billDetails.vue 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172
  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. @resetColumn="resetColumn"
  13. :page.sync="page"
  14. @on-load="onLoad">
  15. <template slot="costTypeSearch">
  16. <breakdown-select
  17. v-model="search.costType"
  18. :configuration="breakConfiguration"
  19. ></breakdown-select>
  20. </template>
  21. <template slot="corpNameSearch">
  22. <crop-select v-model="search.corpId" corpType="KH"/>
  23. </template>
  24. <template slot-scope="scope" slot="costType">
  25. <span>{{ scope.row.itemName }}</span>
  26. </template>
  27. </avue-crud>
  28. <div class="dialogButton">
  29. <span slot="footer" class="dialog-footer" >
  30. <el-button @click="$emit('closeFun')">取 消</el-button>
  31. <el-button type="primary" @click="importProMent" :disabled="selectList.length == 0">导入</el-button>
  32. </span>
  33. </div>
  34. </div>
  35. </template>
  36. <script>
  37. import option from './config/details.json'
  38. import { getBillList,getBillListTwo } from "@/api/financialManagement/zpaymentRequest";
  39. import {fleetList} from "@/api/basicData/customerInformation";
  40. export default {
  41. name: "index",
  42. props: {
  43. billType:{
  44. type: String
  45. },
  46. flag:{
  47. type: Number
  48. },
  49. params:{
  50. type: Object
  51. },
  52. itemId: {
  53. type: String
  54. },
  55. closeFun: {
  56. type: Function
  57. }
  58. },
  59. data(){
  60. return {
  61. option:option,
  62. loading:false,
  63. search:{},
  64. data:[],
  65. selectList:[],
  66. page: {
  67. pageSize: 10,
  68. pagerCount: 5,
  69. total: 0,
  70. },
  71. breakConfiguration:{
  72. multipleChoices:false,
  73. multiple:false,
  74. disabled:false,
  75. searchShow:true,
  76. collapseTags:false,
  77. clearable:true,
  78. placeholder:'请点击右边按钮选择',
  79. dicData:[]
  80. },
  81. }
  82. },
  83. watch:{
  84. 'params.corpId' (newVal,oldVal){
  85. if(newVal != oldVal){
  86. this.onLoad(this.page, this.search)
  87. }
  88. }
  89. },
  90. async created() {
  91. // this.option = await this.getColumnData(this.getColumnName(45), option);
  92. fleetList().then(res => {
  93. this.findObject(this.option.column, "fleetName").dicData = res.data.data
  94. })
  95. },
  96. methods:{
  97. refreshChange(){
  98. this.onLoad(this.page);
  99. },
  100. searchChange(params,done){
  101. if (params.createStart){
  102. params.createStartDate = params.createStart[0]
  103. params.createEndDate = params.createStart[1]
  104. }
  105. this.onLoad(this.page, params);
  106. done()
  107. },
  108. selectionChange(row){
  109. this.selectList = row
  110. },
  111. onLoad(page, params){
  112. this.loading = true;
  113. params = {
  114. ...params,
  115. ...this.params
  116. }
  117. params.billType = this.billType
  118. if (this.$store.getters.userInfo.tenant_id === "673511") {
  119. params.type = "CMY"
  120. }
  121. params.flag = this.flag
  122. if (this.billType === "申请" || this.billType === "付费"){
  123. getBillList(page.currentPage, page.pageSize,params).then(res=>{
  124. this.data = res.data.data.records
  125. this.page.total = res.data.data.total
  126. }).finally(()=>{
  127. this.loading = false;
  128. })
  129. }else if (this.billType === "收费") {
  130. getBillListTwo(page.currentPage, page.pageSize,params).then(res=>{
  131. this.data = res.data.data.records
  132. this.page.total = res.data.data.total
  133. }).finally(()=>{
  134. this.loading = false;
  135. })
  136. }
  137. },
  138. importProMent(){
  139. this.$emit('importProMent',this.selectList);
  140. },
  141. async resetColumn() {
  142. const inSave = await this.delColumnData(
  143. this.getColumnName(45),
  144. option
  145. );
  146. if (inSave) {
  147. this.$message.success("重置成功");
  148. this.option = option;
  149. //关闭窗口
  150. this.$refs.crud.$refs.dialogColumn.columnBox = false;
  151. }
  152. },
  153. //列保存触发
  154. async saveColumn() {
  155. const inSave = await this.saveColumnData(
  156. this.getColumnName(45),
  157. this.option
  158. );
  159. if (inSave) {
  160. this.$message.success("保存成功");
  161. //关闭窗口
  162. this.$refs.crud.$refs.dialogColumn.columnBox = false;
  163. }
  164. },
  165. }
  166. }
  167. </script>
  168. <style scoped>
  169. </style>