billDetails.vue 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191
  1. <template>
  2. <basic-container>
  3. <avue-crud :option="option"
  4. :data="dataList"
  5. ref="crud"
  6. v-model="form"
  7. :page.sync="page"
  8. :search.sync="search"
  9. :table-loading="loading"
  10. @search-change="searchChange"
  11. @search-reset="searchReset"
  12. @selection-change="selectionChange"
  13. @current-change="currentChange"
  14. @size-change="sizeChange"
  15. @refresh-change="refreshChange"
  16. :row-style="rowStyle"
  17. @on-load="onLoad"
  18. @saveColumn="saveColumn"
  19. @resetColumn="resetColumn"
  20. >
  21. <template slot="corpIdSearch">
  22. <select-component
  23. v-model="search.corpId"
  24. :configuration="configuration"
  25. ></select-component>
  26. </template>
  27. <template slot="costTypeSearch">
  28. <breakdown-select
  29. v-model="search.costType"
  30. :configuration="breakConfiguration"
  31. ></breakdown-select>
  32. </template>
  33. <template slot-scope="scope" slot="corpId">
  34. <span>{{ scope.row.corpName }}</span>
  35. </template>
  36. <template slot-scope="scope" slot="costType">
  37. <span>{{ scope.row.itemName }}</span>
  38. </template>
  39. <template slot-scope="scope" slot="menu">
  40. <el-button
  41. type="text"
  42. icon="el-icon-delete"
  43. size="small"
  44. :disabled="scope.row.billType === '申请' || scope.row.settlementAmount != 0"
  45. @click.stop=""
  46. >删除
  47. </el-button>
  48. </template>
  49. </avue-crud>
  50. </basic-container>
  51. </template>
  52. <script>
  53. import option from "./configuration/mainList.json";
  54. import { getBillList } from "@/api/financialManagement/paymentRequest";
  55. import _ from "lodash";
  56. export default {
  57. data() {
  58. return {
  59. loading : false,
  60. form: {},
  61. search:{},
  62. detailData:{},
  63. option: {},
  64. parentId:0,
  65. dataList: [],
  66. page: {
  67. pageSize: 10,
  68. pagerCount: 5,
  69. total: 0,
  70. },
  71. query:{},
  72. configuration:{
  73. multipleChoices:false,
  74. multiple:false,
  75. disabled:false,
  76. searchShow:true,
  77. collapseTags:false,
  78. clearable:true,
  79. placeholder:'请点击右边按钮选择',
  80. dicData:[]
  81. },
  82. breakConfiguration:{
  83. multipleChoices:false,
  84. multiple:false,
  85. disabled:false,
  86. searchShow:true,
  87. collapseTags:false,
  88. clearable:true,
  89. placeholder:'请点击右边按钮选择',
  90. dicData:[]
  91. },
  92. }
  93. },
  94. async created() {
  95. this.option = await this.getColumnData(this.getColumnName(60), option);
  96. },
  97. mounted() {
  98. // option.height = window.innerHeight - 200 ;
  99. },
  100. methods: {
  101. rowStyle(data){
  102. if(_.subtract(data.row.settlementAmount, data.row.amount) < 0){
  103. return {
  104. background: "rgba(248,203,203,0.56)"
  105. }
  106. }
  107. },
  108. //新单打开
  109. addReceipt(row){
  110. console.log(1)
  111. },
  112. //编辑打开
  113. editOpen(row){
  114. console.log(1)
  115. },
  116. searchReset() {
  117. console.log('1')
  118. },
  119. selectionChange() {
  120. console.log('1')
  121. },
  122. sizeChange() {
  123. console.log('1')
  124. },
  125. currentChange(val) {
  126. this.page.currentPage = val
  127. },
  128. refreshChange(params) {
  129. this.onLoad(this.page,params);
  130. },
  131. //点击搜索按钮触发
  132. searchChange(params, done) {
  133. this.query = params;
  134. this.page.currentPage = 1;
  135. this.onLoad(this.page, params);
  136. done()
  137. },
  138. paramsAdjustment(params) {
  139. params = Object.assign({}, this.search);
  140. if (params.createTime && params.createTime.length !==0 ) { //合同
  141. params.createStartDate = params.createTime[0]+ " " + "00:00:00";
  142. params.createEndDate = params.createTime[1] + " " + "23:59:59";
  143. this.$delete(params,'createTime')
  144. }
  145. return params
  146. },
  147. onLoad(page, params = {}) {
  148. this.loading = true;
  149. params = this.paramsAdjustment(params)
  150. getBillList(page.currentPage, page.pageSize,params).then(res=>{
  151. this.dataList = res.data.data.records
  152. this.page.total = res.data.data.total
  153. }).finally(()=>{
  154. this.loading = false;
  155. })
  156. },
  157. //列保存触发
  158. async saveColumn() {
  159. const inSave = await this.saveColumnData(
  160. this.getColumnName(60),
  161. this.option
  162. );
  163. if (inSave) {
  164. this.$message.success("保存成功");
  165. //关闭窗口
  166. this.$refs.crud.$refs.dialogColumn.columnBox = false;
  167. }
  168. },
  169. async resetColumn() {
  170. const inSave = await this.delColumnData(
  171. this.getColumnName(60),
  172. option
  173. );
  174. if (inSave) {
  175. this.$message.success("重置成功");
  176. this.option = option;
  177. //关闭窗口
  178. this.$refs.crud.$refs.dialogColumn.columnBox = false;
  179. }
  180. },
  181. }
  182. }
  183. </script>
  184. <style scoped>
  185. </style>