{"remainingRequest":"/data/jenkins/workspace/admin.ws.baibaodun.com.cn/node_modules/vue-loader/lib/index.js??vue-loader-options!/data/jenkins/workspace/admin.ws.baibaodun.com.cn/src/views/distribution/settlementBill/departmentBill.vue?vue&type=script&lang=js","dependencies":[{"path":"/data/jenkins/workspace/admin.ws.baibaodun.com.cn/src/views/distribution/settlementBill/departmentBill.vue","mtime":1712542942122},{"path":"/data/jenkins/workspace/admin.ws.baibaodun.com.cn/node_modules/babel-loader/lib/index.js","mtime":1701741929501},{"path":"/data/jenkins/workspace/admin.ws.baibaodun.com.cn/node_modules/cache-loader/dist/cjs.js","mtime":1701741918737},{"path":"/data/jenkins/workspace/admin.ws.baibaodun.com.cn/node_modules/vue-loader/lib/index.js","mtime":1701741928146}],"contextDependencies":[],"result":["//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n\n// +---------------------------------------------------------------------\n// | CRMEB [ CRMEB赋能开发者,助力企业发展 ]\n// +---------------------------------------------------------------------\n// | Copyright (c) 2016~2023 https://www.crmeb.com All rights reserved.\n// +---------------------------------------------------------------------\n// | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权\n// +---------------------------------------------------------------------\n// | Author: CRMEB Team \n// +---------------------------------------------------------------------\nimport { getSettlementDocApi, confirmSettleApi, batchExporBilltApi, batchExportApi, settleStatisticsApi } from '@/api/distribution';\nimport cardsData from '@/components/cards/index';\nimport tableComp from './component/tableComp.vue';\nimport { checkPermi } from '@/utils/permission'; // 权限判断函数\n\nexport default {\n name: 'settleDepartmentBill',\n components: { cardsData, tableComp },\n data() {\n return {\n listLoading: false,\n fromList: this.$constants.fromList,\n timePeriodVal: [],\n timeVal: [],\n billList: [],\n checkList: [],\n searchInfo: {\n name: '',\n settleStatus: null,\n billPeriodStart: '',\n billPeriodEnd: '',\n uploadAttachments: null,\n dateLimit: ''\n },\n limit: 20,\n page: 1,\n total: 0,\n bcxId: null,\n tabActive: 0,\n totalBrokeragePrice: '',\n totalCount: '',\n totalPayPrice: ''\n };\n },\n mounted() {\n if (checkPermi(['platform:bcx:settle:department:list'])) {\n this.getList()\n }\n this.bcxId = this.$route.query.bcxId;\n },\n methods: {\n checkPermi,\n getList() {\n this.listLoading = true;\n let params = {\n limit: this.limit,\n page: this.page,\n settleStatus: this.tabActive == 0 ? 1 : 2,\n bcxId: this.bcxId ? this.bcxId : null,\n billPeriodStart: this.searchInfo.billPeriodStart ? this.searchInfo.billPeriodStart : null,\n billPeriodEnd: this.searchInfo.billPeriodEnd ? this.searchInfo.billPeriodEnd : null,\n dateLimit: this.searchInfo.dateLimit,\n name: this.searchInfo.name,\n settleNo: this.searchInfo.settleNo,\n uploadAttachments: this.searchInfo.uploadAttachments,\n };\n getSettlementDocApi(4, params).then(res => {\n this.getStatistics()\n this.limit = res.limit;\n this.total = res.total;\n this.page = res.page;\n this.billList = res.list;\n this.listLoading = false;\n }).catch(() => {\n this.listLoading = false;\n })\n },\n getStatistics() {\n let params = {\n searchType: 2,\n settleStatus: this.tabActive == 0 ? 1 : 2,\n bcxId: this.bcxId ? this.bcxId : null,\n billPeriodStart: this.searchInfo.billPeriodStart ? this.searchInfo.billPeriodStart : null,\n billPeriodEnd: this.searchInfo.billPeriodEnd ? this.searchInfo.billPeriodEnd : null,\n dateLimit: this.searchInfo.dateLimit,\n name: this.searchInfo.name,\n settleNo: this.searchInfo.settleNo,\n uploadAttachments: this.searchInfo.uploadAttachments,\n };\n settleStatisticsApi(params).then((res) => {\n this.totalBrokeragePrice = res.totalBrokeragePrice\n this.totalCount = res.totalCount\n this.totalPayPrice = res.totalPayPrice\n })\n },\n searchList() {\n this.page = 1;\n this.getList();\n },\n // 账单周期\n onchangePeriod() {\n [this.searchInfo.billPeriodStart, this.searchInfo.billPeriodEnd] = this.timePeriodVal;\n this.getList();\n },\n // 具体日期\n onchangeTime(e) {\n this.timeVal = e;\n this.searchInfo.dateLimit = e ? this.timeVal.join(',') : '';\n console.info('xxx', this.searchInfo.dateLimit);\n this.getList();\n },\n changeTab() {\n this.getList();\n },\n batchSettleBill() {\n if (!this.checkList.length) {\n this.$message({\n message: '至少选中一条记录',\n type: 'warning',\n showClose: true\n });\n return;\n }\n let ids = [];\n this.checkList.forEach(el => {\n ids.push(el.id);\n });\n let params = {\n settleBillIdList: ids\n };\n confirmSettleApi(params).then(res => {\n this.$message({\n message: '结算成功',\n type: 'success',\n showClose: true\n });\n this.getList();\n }).catch(() => {});\n },\n batchExport() {\n let ids = [];\n if (this.checkList.length) {\n this.checkList.forEach(el => {\n ids.push(el.id);\n });\n }\n let params = {\n searchType: 2,\n settleStatus: this.tabActive == 0 ? 1 : 2,\n bcxId: this.bcxId ? this.bcxId : null,\n billPeriodStart: this.searchInfo.billPeriodStart ? this.searchInfo.billPeriodStart : null,\n billPeriodEnd: this.searchInfo.billPeriodEnd ? this.searchInfo.billPeriodEnd : null,\n dateLimit: this.searchInfo.dateLimit,\n name: this.searchInfo.name,\n settleNo: this.searchInfo.settleNo,\n uploadAttachments: this.searchInfo.uploadAttachments,\n };\n batchExporBilltApi(1, params).then(res => {\n let fileName = decodeURIComponent(res.headers[\"content-disposition\"].split(\"=\")[1])\n let url = window.URL.createObjectURL(new Blob([res.data], {\n type: 'application/vnd.ms-excel'\n }))\n let link = document.createElement('a')\n link.style.display = 'none'\n link.href = url\n link.setAttribute('download', fileName) //对文件进行命名\n document.body.appendChild(link)\n link.click()\n document.body.removeChild(link); //下载完成移除元素\n window.URL.revokeObjectURL(url); //释放掉blob对象\n }).catch(() => {});\n },\n selectOptions(selection) {\n this.checkList = selection;\n },\n confirmSettle(index, id) {\n let params = {\n settleBillIdList: [id]\n }\n confirmSettleApi(params).then(res => {\n this.$message({\n message: '结算成功',\n type: 'success',\n showClose: true\n });\n this.billList[index].settleStatus = 3;\n }).catch(() => {});\n },\n navigateToSettleDetail(id) {\n this.$router.push({\n path: '/distribution/settlementBill/settleBillDetail',\n query: {\n id,\n bcxId: this.bcxId,\n type: 2\n }\n });\n },\n exportDetail(settleBillId) {\n let params = {\n settleBillId\n };\n batchExportApi(3, params).then(res => {\n let fileName = decodeURIComponent(res.headers[\"content-disposition\"].split(\"=\")[1])\n let url = window.URL.createObjectURL(new Blob([res.data], {\n type: 'application/vnd.ms-excel'\n }))\n let link = document.createElement('a')\n link.style.display = 'none'\n link.href = url\n link.setAttribute('download', fileName) //对文件进行命名\n document.body.appendChild(link)\n link.click()\n document.body.removeChild(link); //下载完成移除元素\n window.URL.revokeObjectURL(url); //释放掉blob对象\n }).then(() => {});\n },\n handleSizeChange(val) {\n this.limit = val;\n this.page = 1;\n this.getList();\n },\n pageChange(page) {\n this.page = page;\n this.getList();\n },\n },\n};\n",null]}