billDetailList.vue 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. <template>
  2. <div>
  3. <avue-crud :option="option"
  4. :table-loading="loading"
  5. :data="data"
  6. :search.sync="search"
  7. ref="crud"
  8. @refresh-change="refreshChange"
  9. @selection-change="selectionChange"
  10. @search-change="searchChange"
  11. @saveColumn="saveColumn"
  12. :page.sync="page"
  13. @on-load="onLoad">
  14. <template slot="costTypeSearch">
  15. <breakdown-select
  16. v-model="search.costType"
  17. :configuration="breakConfiguration"
  18. ></breakdown-select>
  19. </template>
  20. </avue-crud>
  21. <div class="dialogButton">
  22. <span slot="footer" class="dialog-footer" >
  23. <el-button @click="$emit('closeFun')">取 消</el-button>
  24. <el-button type="primary" @click="importProMent" :disabled="selectList.length == 0">导入</el-button>
  25. </span>
  26. </div>
  27. </div>
  28. </template>
  29. <script>
  30. import option from './config/mainList.json'
  31. import { getBillList } from "@/api/financialManagement/paymentRequest";
  32. export default {
  33. name: "index",
  34. props: {
  35. billType:{
  36. type: String
  37. },
  38. flag:{
  39. type: Number
  40. },
  41. params:{
  42. type: Object
  43. },
  44. itemId: {
  45. type: String
  46. },
  47. closeFun: {
  48. type: Function
  49. }
  50. },
  51. data(){
  52. return {
  53. option:option,
  54. loading:false,
  55. search:{},
  56. data:[],
  57. selectList:[],
  58. page: {
  59. pageSize: 10,
  60. pagerCount: 5,
  61. total: 0,
  62. },
  63. breakConfiguration:{
  64. multipleChoices:false,
  65. multiple:false,
  66. disabled:false,
  67. searchShow:true,
  68. collapseTags:false,
  69. clearable:true,
  70. placeholder:'请点击右边按钮选择',
  71. dicData:[]
  72. },
  73. }
  74. },
  75. watch:{
  76. 'params.corpId' (newVal,oldVal){
  77. if(newVal != oldVal){
  78. this.onLoad(this.page, this.search)
  79. }
  80. }
  81. },
  82. async created() {
  83. // this.option = await this.getColumnData(this.getColumnName(45), option);
  84. },
  85. methods:{
  86. refreshChange(){
  87. this.onLoad(this.page);
  88. },
  89. searchChange(params,done){
  90. this.onLoad(this.page, params);
  91. done()
  92. },
  93. selectionChange(row){
  94. this.selectList = row
  95. },
  96. onLoad(page, params){
  97. this.loading = true;
  98. params = {
  99. ...this.params
  100. }
  101. params.billType = this.billType
  102. params.flag = this.flag
  103. getBillList(page.currentPage, page.pageSize,params).then(res=>{
  104. this.data = res.data.data.records
  105. this.page.total = res.data.data.total
  106. }).finally(()=>{
  107. this.loading = false;
  108. })
  109. },
  110. importProMent(){
  111. this.$emit('importProMent',this.selectList);
  112. },
  113. //列保存触发
  114. async saveColumn() {
  115. const inSave = await this.saveColumnData(
  116. this.getColumnName(45),
  117. this.option
  118. );
  119. if (inSave) {
  120. this.$message.success("保存成功");
  121. //关闭窗口
  122. this.$refs.crud.$refs.dialogColumn.columnBox = false;
  123. }
  124. },
  125. }
  126. }
  127. </script>
  128. <style scoped>
  129. </style>