billDetailList.vue 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  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. params:{
  39. type: Object
  40. },
  41. itemId: {
  42. type: String
  43. },
  44. closeFun: {
  45. type: Function
  46. }
  47. },
  48. data(){
  49. return {
  50. option:option,
  51. loading:false,
  52. search:{},
  53. data:[],
  54. selectList:[],
  55. page: {
  56. pageSize: 10,
  57. pagerCount: 5,
  58. total: 0,
  59. },
  60. breakConfiguration:{
  61. multipleChoices:false,
  62. multiple:false,
  63. disabled:false,
  64. searchShow:true,
  65. collapseTags:false,
  66. clearable:true,
  67. placeholder:'请点击右边按钮选择',
  68. dicData:[]
  69. },
  70. }
  71. },
  72. watch:{
  73. 'params.corpId' (newVal,oldVal){
  74. if(newVal != oldVal){
  75. this.onLoad(this.page, this.search)
  76. }
  77. }
  78. },
  79. async created() {
  80. // this.option = await this.getColumnData(this.getColumnName(45), option);
  81. },
  82. methods:{
  83. refreshChange(){
  84. this.onLoad(this.page);
  85. },
  86. searchChange(params,done){
  87. this.onLoad(this.page, params);
  88. done()
  89. },
  90. selectionChange(row){
  91. this.selectList = row
  92. },
  93. onLoad(page, params){
  94. this.loading = true;
  95. params = {
  96. ...this.params
  97. }
  98. params.billType = this.billType
  99. params.flag = 1
  100. getBillList(page.currentPage, page.pageSize,params).then(res=>{
  101. this.data = res.data.data.records
  102. this.page.total = res.data.data.total
  103. }).finally(()=>{
  104. this.loading = false;
  105. })
  106. },
  107. importProMent(){
  108. this.$emit('importProMent',this.selectList);
  109. },
  110. //列保存触发
  111. async saveColumn() {
  112. const inSave = await this.saveColumnData(
  113. this.getColumnName(45),
  114. this.option
  115. );
  116. if (inSave) {
  117. this.$message.success("保存成功");
  118. //关闭窗口
  119. this.$refs.crud.$refs.dialogColumn.columnBox = false;
  120. }
  121. },
  122. }
  123. }
  124. </script>
  125. <style scoped>
  126. </style>