detailPage.vue 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227
  1. <template>
  2. <div>
  3. <div class="borderless">
  4. <div class="customer-head">
  5. <div class="customer-back">
  6. <el-button type="danger" style="border: none;background: none;color: red" icon="el-icon-arrow-left"
  7. @click="backToList">返回列表
  8. </el-button>
  9. </div>
  10. </div>
  11. <basic-container style="margin-top: 50px">
  12. <avue-crud
  13. :option="option"
  14. :search.sync="search"
  15. v-model="form"
  16. :table-loading="loading"
  17. :data="dataList"
  18. ref="crud"
  19. :key="key"
  20. @on-load="onLoad"
  21. @search-change="searchChange"
  22. @refresh-change="refreshChange"
  23. @resetColumn="resetColumnTwo('crud','option','optionList',239.1)"
  24. @saveColumn="saveColumnTwo('crud','option','optionList',239.1)"
  25. :page.sync="page">
  26. <template slot-scope="scope" slot="menuLeft">
  27. <el-button type="warning"
  28. icon="el-icon-plus"
  29. size="small"
  30. @click="outExport"
  31. >导出
  32. </el-button>
  33. </template>
  34. </avue-crud>
  35. </basic-container>
  36. </div>
  37. </div>
  38. </template>
  39. <script>
  40. import {getListDetailed} from "@/api/accountBalance/index.js";
  41. import {getToken} from "@/util/auth";
  42. export default {
  43. name: "index",
  44. props:{
  45. detailData: Object,
  46. },
  47. data() {
  48. return {
  49. loading: false,
  50. show: true,
  51. search: {},
  52. form: {},
  53. detailData: {},
  54. dataList: [],
  55. page: {
  56. pageSize: 20,
  57. currentPage: 1,
  58. total: 0,
  59. pageSizes: [10, 20, 30, 40, 50, 100, 200, 300, 400, 500]
  60. },
  61. key: 0,
  62. option: {},
  63. optionList: {
  64. viewBtn: false,
  65. editBtn: false,
  66. delBtn: false,
  67. addBtn: false,
  68. index: true,
  69. span: 8,
  70. border: true,
  71. height: "auto",
  72. searchMenuPosition: "right",
  73. align: "center",
  74. menuWidth: 140,
  75. searchSpan: 8,
  76. searchIcon: true,
  77. searchIndex: 2,
  78. highlightCurrentRow: true,
  79. dialogWidth: "70%",
  80. menu: false,
  81. column: [{
  82. label: '销售单号',
  83. prop: 'accSysNo',
  84. search: true,
  85. overHidden: true,
  86. }, {
  87. label: '数量',
  88. prop: 'quantity',
  89. overHidden: true,
  90. }, {
  91. label: '金额',
  92. prop: 'amount',
  93. search: true,
  94. overHidden: true,
  95. }, {
  96. label: '科目代码',
  97. prop: 'subjectNumber',
  98. overHidden: true,
  99. }, {
  100. label: '开户银行',
  101. prop: 'accountBank',
  102. overHidden: true,
  103. }, {
  104. label: '银行户头',
  105. prop: 'accountName',
  106. overHidden: true,
  107. }, {
  108. label: '银行账号',
  109. prop: 'accountNo',
  110. overHidden: true,
  111. }, {
  112. label: '溢付款',
  113. prop: 'overPayment',
  114. overHidden: true,
  115. }, {
  116. label: '使用溢付款',
  117. prop: 'caseOverPayment',
  118. overHidden: true,
  119. }]
  120. }
  121. }
  122. },
  123. async created() {
  124. this.option = await this.getColumnData(this.getColumnName(239.1), this.optionList);
  125. this.key++
  126. let i = 0;
  127. this.option.column.forEach(item => {
  128. if (item.search) i++
  129. })
  130. if (i % 3 !== 0) {
  131. const num = 3 - Number(i % 3)
  132. this.option.searchMenuSpan = num * 8;
  133. this.option.searchMenuPosition = "right";
  134. }
  135. },
  136. methods: {
  137. //导出
  138. outExport() {
  139. this.$confirm('是否导出列表?', '提示', {
  140. confirmButtonText: '确定',
  141. cancelButtonText: '取消',
  142. type: 'warning'
  143. }).then(() => {
  144. let queryParams = this.search
  145. const routeData = this.$router.resolve({
  146. path: '/api/trade-finance/acc/SelAccItemExport', //跳转目标窗口的地址
  147. query: {
  148. 'Blade-Auth': getToken(),
  149. ...queryParams,//括号内是要传递给新窗口的参数
  150. billType: "收费",
  151. chargePay:this.detailData.chargePay,
  152. createDateList:this.detailData.createDateList,
  153. corpId:this.detailData.corpId
  154. }
  155. })
  156. window.open(routeData.href.slice(1, routeData.href.length));
  157. }).catch(() => {
  158. this.$message({
  159. type: 'info',
  160. message: '已取消' //
  161. });
  162. })
  163. },
  164. backToList() {
  165. this.$emit("goBack");
  166. },
  167. //刷新
  168. refreshChange() {
  169. this.onLoad(this.page, this.search)
  170. },
  171. searchChange(params, done) {
  172. done();
  173. this.onLoad(this.page, params)
  174. },
  175. onLoad(page, params = {}) {
  176. params = {
  177. ...params,
  178. current: page.currentPage,
  179. size: page.pageSize,
  180. billType: "收费",
  181. corpId:this.detailData.corpId,
  182. chargePay:this.detailData.chargePay,
  183. createDateList:this.detailData.createDateList,
  184. }
  185. this.loading = true
  186. getListDetailed(params).then(res => {
  187. this.dataList = res.data.data.records
  188. this.page.total = res.data.data.total
  189. this.loading = false
  190. }).finally(() => {
  191. this.loading = false
  192. })
  193. },
  194. //自定义列保存
  195. async saveColumnTwo(ref, option, optionBack, code) {
  196. /**
  197. * 已定义全局方法,直接使用,saveColumnData保存列数据方法,参数传值(表格名称,当前表格的option数据)
  198. * 已定义全局方法,直接使用,getColumnName方法用来获取枚举值,参数根据自己定义的code值获取中文名
  199. * 一定要执行异步操作,要等接口成功返回,才能执行下一行代码
  200. */
  201. const inSave = await this.saveColumnData(this.getColumnName(code), this[option]);
  202. if (inSave) {
  203. this.$message.success("保存成功");
  204. //关闭窗口
  205. this.$refs[ref].$refs.dialogColumn.columnBox = false;
  206. }
  207. },
  208. //自定义列重置
  209. async resetColumnTwo(ref, option, optionBack, code) {
  210. this[option] = this[optionBack];
  211. const inSave = await this.delColumnData(this.getColumnName(code), this[optionBack]);
  212. if (inSave) {
  213. this.$message.success("重置成功");
  214. this.$refs[ref].$refs.dialogColumn.columnBox = false;
  215. }
  216. }
  217. }
  218. }
  219. </script>
  220. <style scoped>
  221. </style>