detailPage.vue 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258
  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',240.1)"
  24. @saveColumn="saveColumnTwo('crud','option','optionList',240.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. dataList: [],
  54. page: {
  55. pageSize: 20,
  56. currentPage: 1,
  57. total: 0,
  58. pageSizes: [10, 20, 30, 40, 50, 100, 200, 300, 400, 500]
  59. },
  60. key: 0,
  61. option: {},
  62. optionList: {
  63. viewBtn: false,
  64. editBtn: false,
  65. delBtn: false,
  66. addBtn: false,
  67. index: true,
  68. span: 8,
  69. border: true,
  70. height: "auto",
  71. searchMenuPosition: "right",
  72. align: "center",
  73. menuWidth: 140,
  74. searchSpan: 8,
  75. searchIcon: true,
  76. searchIndex: 2,
  77. highlightCurrentRow: true,
  78. dialogWidth: "70%",
  79. menu: false,
  80. showSummary: true,
  81. sumColumnList: [{
  82. name: 'amount',
  83. type: 'sum',
  84. decimals: 2
  85. },{
  86. name: 'arrivalAmount',
  87. type: 'sum',
  88. decimals: 2
  89. },{
  90. name: 'overPayment',
  91. type: 'sum',
  92. decimals: 2
  93. },{
  94. name: 'caseOverPayment',
  95. type: 'sum',
  96. decimals: 2
  97. },{
  98. name: 'quantity',
  99. type: 'sum',
  100. decimals: 0
  101. },{
  102. name: 'actualQuantity',
  103. type: 'sum',
  104. decimals: 0
  105. }],
  106. column: [{
  107. label: '采购单号',
  108. prop: 'accSysNo',
  109. search: true,
  110. overHidden: true,
  111. }, {
  112. label: '数量',
  113. prop: 'quantity',
  114. overHidden: true,
  115. }, {
  116. label: '金额',
  117. prop: 'amount',
  118. search: true,
  119. overHidden: true,
  120. }, {
  121. label: '科目代码',
  122. prop: 'subjectNumber',
  123. overHidden: true,
  124. }, {
  125. label: '日期',
  126. prop: 'createTime',
  127. type: "date",
  128. format: "yyyy-MM-dd",
  129. overHidden: true,
  130. }, {
  131. label: '开户银行',
  132. prop: 'accountBank',
  133. overHidden: true,
  134. }, {
  135. label: '银行户头',
  136. prop: 'accountName',
  137. overHidden: true,
  138. }, {
  139. label: '银行账号',
  140. prop: 'accountNo',
  141. overHidden: true,
  142. }, {
  143. label: '溢付款',
  144. prop: 'overPayment',
  145. overHidden: true,
  146. }, {
  147. label: '使用溢付款',
  148. prop: 'caseOverPayment',
  149. overHidden: true,
  150. }]
  151. }
  152. }
  153. },
  154. async created() {
  155. this.option = await this.getColumnData(this.getColumnName(240.1), this.optionList);
  156. this.key++
  157. let i = 0;
  158. this.option.column.forEach(item => {
  159. if (item.search) i++
  160. })
  161. if (i % 3 !== 0) {
  162. const num = 3 - Number(i % 3)
  163. this.option.searchMenuSpan = num * 8;
  164. this.option.searchMenuPosition = "right";
  165. }
  166. },
  167. methods: {
  168. //导出
  169. outExport() {
  170. this.$confirm('是否导出列表?', '提示', {
  171. confirmButtonText: '确定',
  172. cancelButtonText: '取消',
  173. type: 'warning'
  174. }).then(() => {
  175. let queryParams = this.search
  176. const routeData = this.$router.resolve({
  177. path: '/api/trade-finance/acc/SelAccItemExport', //跳转目标窗口的地址
  178. query: {
  179. 'Blade-Auth': getToken(),
  180. ...queryParams, //括号内是要传递给新窗口的参数
  181. billType: "申请",
  182. chargePay:this.detailData.chargePay,
  183. createDateList:this.detailData.createDateList,
  184. corpId:this.detailData.corpId
  185. }
  186. })
  187. window.open(routeData.href.slice(1, routeData.href.length));
  188. }).catch(() => {
  189. this.$message({
  190. type: 'info',
  191. message: '已取消' //
  192. });
  193. })
  194. },
  195. backToList() {
  196. this.$emit("goBack");
  197. },
  198. //刷新
  199. refreshChange() {
  200. this.onLoad(this.page, this.search)
  201. },
  202. searchChange(params, done) {
  203. done();
  204. this.onLoad(this.page, params)
  205. },
  206. onLoad(page, params = {}) {
  207. params = {
  208. ...params,
  209. current: page.currentPage,
  210. size: page.pageSize,
  211. billType: "申请",
  212. chargePay:this.detailData.chargePay,
  213. createDateList:this.detailData.createDateList,
  214. corpId:this.detailData.corpId
  215. }
  216. this.loading = true
  217. getListDetailed(params).then(res => {
  218. this.dataList = res.data.data.records
  219. this.page.total = res.data.data.total
  220. this.loading = false
  221. }).finally(() => {
  222. this.loading = false
  223. })
  224. },
  225. //自定义列保存
  226. async saveColumnTwo(ref, option, optionBack, code) {
  227. /**
  228. * 已定义全局方法,直接使用,saveColumnData保存列数据方法,参数传值(表格名称,当前表格的option数据)
  229. * 已定义全局方法,直接使用,getColumnName方法用来获取枚举值,参数根据自己定义的code值获取中文名
  230. * 一定要执行异步操作,要等接口成功返回,才能执行下一行代码
  231. */
  232. const inSave = await this.saveColumnData(this.getColumnName(code), this[option]);
  233. if (inSave) {
  234. this.$message.success("保存成功");
  235. //关闭窗口
  236. this.$refs[ref].$refs.dialogColumn.columnBox = false;
  237. }
  238. },
  239. //自定义列重置
  240. async resetColumnTwo(ref, option, optionBack, code) {
  241. this[option] = this[optionBack];
  242. const inSave = await this.delColumnData(this.getColumnName(code), this[optionBack]);
  243. if (inSave) {
  244. this.$message.success("重置成功");
  245. this.$refs[ref].$refs.dialogColumn.columnBox = false;
  246. }
  247. }
  248. }
  249. }
  250. </script>
  251. <style scoped>
  252. </style>