detailPage.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342
  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. <template slot-scope="scope" slot="accSysNo">
  35. <span style="color: #409EFF;cursor: pointer"
  36. @click.stop="beforeOpenPage(scope.row, scope.index)">{{ scope.row.accSysNo }}</span>
  37. </template>
  38. </avue-crud>
  39. </basic-container>
  40. </div>
  41. </div>
  42. </template>
  43. <script>
  44. import {getListDetailed} from "@/api/accountBalance/index.js";
  45. import {getToken} from "@/util/auth";
  46. export default {
  47. name: "index",
  48. props:{
  49. detailData: Object,
  50. },
  51. data() {
  52. return {
  53. loading: false,
  54. show: true,
  55. search: {},
  56. form: {},
  57. detailData: {},
  58. dataList: [],
  59. page: {
  60. pageSize: 20,
  61. currentPage: 1,
  62. total: 0,
  63. pageSizes: [10, 20, 30, 40, 50, 100, 200, 300, 400, 500]
  64. },
  65. key: 0,
  66. option: {},
  67. optionList: {
  68. viewBtn: false,
  69. editBtn: false,
  70. delBtn: false,
  71. addBtn: false,
  72. index: true,
  73. span: 8,
  74. border: true,
  75. height: "auto",
  76. searchMenuPosition: "right",
  77. align: "center",
  78. menuWidth: 140,
  79. searchSpan: 8,
  80. searchIcon: true,
  81. searchIndex: 2,
  82. highlightCurrentRow: true,
  83. dialogWidth: "70%",
  84. menu: false,
  85. showSummary: true,
  86. sumColumnList: [{
  87. name: 'amount',
  88. type: 'sum',
  89. decimals: 2
  90. },{
  91. name: 'arrivalAmount',
  92. type: 'sum',
  93. decimals: 2
  94. },{
  95. name: 'overPayment',
  96. type: 'sum',
  97. decimals: 2
  98. },{
  99. name: 'caseOverPayment',
  100. type: 'sum',
  101. decimals: 2
  102. },{
  103. name: 'quantity',
  104. type: 'sum',
  105. decimals: 0
  106. },{
  107. name: 'actualQuantity',
  108. type: 'sum',
  109. decimals: 0
  110. }],
  111. column: [{
  112. label: '销售单号',
  113. prop: 'accSysNo',
  114. search: true,
  115. overHidden: true,
  116. }, {
  117. label: '数量',
  118. prop: 'quantity',
  119. overHidden: true,
  120. }, {
  121. label: '金额',
  122. prop: 'amount',
  123. search: true,
  124. overHidden: true,
  125. }, {
  126. label: '科目代码',
  127. prop: 'subjectNumber',
  128. overHidden: true,
  129. }, {
  130. label: '日期',
  131. prop: 'createTime',
  132. type: "date",
  133. format: "yyyy-MM-dd",
  134. overHidden: true,
  135. }, {
  136. label: '到货数量',
  137. prop: 'actualQuantity',
  138. overHidden: true,
  139. }, {
  140. label: '到货金额',
  141. prop: 'arrivalAmount',
  142. overHidden: true,
  143. }, {
  144. label: '开户银行',
  145. prop: 'accountBank',
  146. overHidden: true,
  147. }, {
  148. label: '银行户头',
  149. prop: 'accountName',
  150. overHidden: true,
  151. }, {
  152. label: '银行账号',
  153. prop: 'accountNo',
  154. overHidden: true,
  155. }, {
  156. label: '溢付款',
  157. prop: 'overPayment',
  158. overHidden: true,
  159. }, {
  160. label: '使用溢付款',
  161. prop: 'caseOverPayment',
  162. overHidden: true,
  163. }]
  164. },
  165. }
  166. },
  167. async created() {
  168. this.option = await this.getColumnData(this.getColumnName(239.1), this.optionList);
  169. if (this.detailData.chargePay === "YING"){
  170. this.findObject(this.option.column, "quantity").showColumn = true
  171. this.findObject(this.option.column, "quantity").hide = false
  172. this.findObject(this.option.column, "actualQuantity").showColumn = true
  173. this.findObject(this.option.column, "actualQuantity").hide = false
  174. this.findObject(this.option.column, "arrivalAmount").showColumn = true
  175. this.findObject(this.option.column, "arrivalAmount").hide = false
  176. this.findObject(this.optionList.column, "quantity").showColumn = true
  177. this.findObject(this.optionList.column, "quantity").hide = false
  178. this.findObject(this.optionList.column, "actualQuantity").showColumn = true
  179. this.findObject(this.optionList.column, "actualQuantity").hide = false
  180. this.findObject(this.optionList.column, "arrivalAmount").showColumn = true
  181. this.findObject(this.optionList.column, "arrivalAmount").hide = false
  182. } else if (this.detailData.chargePay === "YI") {
  183. this.findObject(this.option.column, "quantity").showColumn = false
  184. this.findObject(this.option.column, "quantity").hide = true
  185. this.findObject(this.option.column, "actualQuantity").showColumn = false
  186. this.findObject(this.option.column, "actualQuantity").hide = true
  187. this.findObject(this.option.column, "arrivalAmount").showColumn = false
  188. this.findObject(this.option.column, "arrivalAmount").hide = true
  189. this.findObject(this.optionList.column, "quantity").showColumn = false
  190. this.findObject(this.optionList.column, "quantity").hide = true
  191. this.findObject(this.optionList.column, "actualQuantity").showColumn = false
  192. this.findObject(this.optionList.column, "actualQuantity").hide = true
  193. this.findObject(this.optionList.column, "arrivalAmount").showColumn = false
  194. this.findObject(this.optionList.column, "arrivalAmount").hide = true
  195. }
  196. this.key++
  197. let i = 0;
  198. this.option.column.forEach(item => {
  199. if (item.search) i++
  200. })
  201. if (i % 3 !== 0) {
  202. const num = 3 - Number(i % 3)
  203. this.option.searchMenuSpan = num * 8;
  204. this.option.searchMenuPosition = "right";
  205. }
  206. },
  207. activated() {
  208. this.key++
  209. },
  210. methods: {
  211. beforeOpenPage(row, index) {
  212. if (this.detailData.chargePay === "YING") {
  213. if (this.$store.getters.domSaleStatus) {
  214. this.$alert("销售单存在,请保存关闭销售单再进行操作", "温馨提示", {
  215. confirmButtonText: "确定",
  216. type: "warning",
  217. callback: action => {
  218. console.log(action);
  219. }
  220. });
  221. } else {
  222. this.$router.$avueRouter.closeTag("/businessManagement/salesOrder/index");
  223. this.$router.push({
  224. path: "/businessManagement/salesOrder/index",
  225. query: {
  226. id: row.orderId
  227. },
  228. });
  229. }
  230. } else if (this.detailData.chargePay === "YI") {
  231. if (this.$store.getters.collectionSettlement) {
  232. this.$alert("收款结算存在,请保存关闭收款结算再进行操作", "温馨提示", {
  233. confirmButtonText: "确定",
  234. type: "warning",
  235. callback: action => {
  236. console.log(action);
  237. }
  238. });
  239. }else {
  240. this.$router.$avueRouter.closeTag("/financialManagement/receiptSettle/receiptSettle");
  241. this.$router.push({
  242. path: "/financialManagement/receiptSettle/receiptSettle",
  243. query: {
  244. id: row.id
  245. },
  246. });
  247. }
  248. }
  249. },
  250. //导出
  251. outExport() {
  252. this.$confirm('是否导出列表?', '提示', {
  253. confirmButtonText: '确定',
  254. cancelButtonText: '取消',
  255. type: 'warning'
  256. }).then(() => {
  257. let queryParams = this.search
  258. const routeData = this.$router.resolve({
  259. path: '/api/trade-finance/acc/SelAccItemExport', //跳转目标窗口的地址
  260. query: {
  261. 'Blade-Auth': getToken(),
  262. ...queryParams,//括号内是要传递给新窗口的参数
  263. billType: "收费",
  264. chargePay: this.detailData.chargePay,
  265. createDateList: this.detailData.createDateList,
  266. corpId: this.detailData.corpId
  267. }
  268. })
  269. window.open(routeData.href.slice(1, routeData.href.length));
  270. }).catch(() => {
  271. this.$message({
  272. type: 'info',
  273. message: '已取消' //
  274. });
  275. })
  276. },
  277. backToList() {
  278. this.$emit("goBack");
  279. },
  280. //刷新
  281. refreshChange() {
  282. this.onLoad(this.page, this.search)
  283. },
  284. searchChange(params, done) {
  285. done();
  286. this.onLoad(this.page, params)
  287. },
  288. onLoad(page, params = {}) {
  289. params = {
  290. ...params,
  291. current: page.currentPage,
  292. size: page.pageSize,
  293. billType: "收费",
  294. corpId: this.detailData.corpId,
  295. chargePay: this.detailData.chargePay,
  296. createDateList: this.detailData.createDateList,
  297. }
  298. this.loading = true
  299. getListDetailed(params).then(res => {
  300. this.dataList = res.data.data.records
  301. this.page.total = res.data.data.total
  302. this.loading = false
  303. }).finally(() => {
  304. this.loading = false
  305. })
  306. },
  307. //自定义列保存
  308. async saveColumnTwo(ref, option, optionBack, code) {
  309. /**
  310. * 已定义全局方法,直接使用,saveColumnData保存列数据方法,参数传值(表格名称,当前表格的option数据)
  311. * 已定义全局方法,直接使用,getColumnName方法用来获取枚举值,参数根据自己定义的code值获取中文名
  312. * 一定要执行异步操作,要等接口成功返回,才能执行下一行代码
  313. */
  314. const inSave = await this.saveColumnData(this.getColumnName(code), this[option]);
  315. if (inSave) {
  316. this.$message.success("保存成功");
  317. //关闭窗口
  318. this.$refs[ref].$refs.dialogColumn.columnBox = false;
  319. }
  320. },
  321. //自定义列重置
  322. async resetColumnTwo(ref, option, optionBack, code) {
  323. this[option] = this[optionBack];
  324. const inSave = await this.delColumnData(this.getColumnName(code), this[optionBack]);
  325. if (inSave) {
  326. this.$message.success("重置成功");
  327. this.$refs[ref].$refs.dialogColumn.columnBox = false;
  328. }
  329. }
  330. }
  331. }
  332. </script>
  333. <style scoped>
  334. </style>