From 3ce04e6702b37501797f3ee2cdd2832c291dcee1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BE=99=E8=BF=90=E6=A8=A1?= <1724894114@qq.com> Date: Tue, 10 Sep 2024 22:15:45 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E5=96=84=E6=88=90=E6=9C=AC=E6=B1=87?= =?UTF-8?q?=E6=80=BB=E5=92=8C=E5=85=AC=E5=8F=B8=E6=A3=80=E7=B4=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/model/finance.js | 9 ++- src/api/model/system.js | 7 ++ src/components/scExport/index.vue | 7 +- src/views/cost/feeRecords/save.vue | 4 +- .../shipmentStatistics/components/table.vue | 4 +- src/views/cost/shipmentStatistics/index.vue | 42 ++++++++--- src/views/setting/company/index.vue | 70 +++++++++---------- 7 files changed, 90 insertions(+), 53 deletions(-) diff --git a/src/api/model/finance.js b/src/api/model/finance.js index f555665..9df4fa0 100644 --- a/src/api/model/finance.js +++ b/src/api/model/finance.js @@ -79,6 +79,13 @@ export default { post: async function (params) { return await http.post(this.url, params); } - } + }, + summaryExport:{ + url: `${config.API_URL}/cost.summary.download`, + name: "成本汇总导出", + post: async function (params) { + return await http.post(this.url, params); + } + }, }, }; diff --git a/src/api/model/system.js b/src/api/model/system.js index ad2e459..2c120a1 100644 --- a/src/api/model/system.js +++ b/src/api/model/system.js @@ -199,6 +199,13 @@ export default { return await http.post(this.url, params); }, }, + field:{ + url: `${config.API_URL}/organization.field.list`, + name: "公司检索", + post: async function (params) { + return await http.post(this.url, params); + }, + }, select:{ url: `${config.API_URL}/organization.name.list`, name: "公司下拉选择", diff --git a/src/components/scExport/index.vue b/src/components/scExport/index.vue index 0344c88..bebc7a0 100644 --- a/src/components/scExport/index.vue +++ b/src/components/scExport/index.vue @@ -41,7 +41,7 @@ export default { }, data(){ return{ - list:[{},{},{},{},{}], + list:[{},{},{},{},{},{}], } }, setup(){ @@ -56,7 +56,7 @@ export default { }, methods:{ getWsResult(res){ - if(res.data && (res.data.type == 6 || res.data.type == 7 || res.data.type == 8 || res.data.type == 11 || res.data.type == 19)){ + if(res.data && (res.data.type == 6 || res.data.type == 7 || res.data.type == 8 || res.data.type == 11 || res.data.type == 19 || res.data.type == 20)){ let item = { type:res.data.type, type_desc:res.data.type_desc, @@ -79,6 +79,9 @@ export default { if(res.data.type == 19){ this.list[4] = item; } + if(res.data.type == 20){ + this.list[5] = item; + } this.$emit('updateShow', item); if(res.data.status==1){ diff --git a/src/views/cost/feeRecords/save.vue b/src/views/cost/feeRecords/save.vue index 2ce8586..67ca25a 100644 --- a/src/views/cost/feeRecords/save.vue +++ b/src/views/cost/feeRecords/save.vue @@ -130,13 +130,13 @@ export default { return this }, async getSelectType() { - const res = await this.$API.finance.cost.typeList.post(); + const res = await this.$API.finance.cost.typeList.post({type_code:this.form.type_code,category_code:this.form.category_code}); if (res.code == 200) { this.setMap.typeList = res.data; } }, async getSelectCategory() { - const res = await this.$API.finance.cost.categoryList.post(); + const res = await this.$API.finance.cost.categoryList.post({type_code:this.form.type_code,category_code:this.form.category_code}); if (res.code == 200) { this.setMap.categoryList = res.data; } diff --git a/src/views/cost/shipmentStatistics/components/table.vue b/src/views/cost/shipmentStatistics/components/table.vue index ef9a6a1..2a230ac 100644 --- a/src/views/cost/shipmentStatistics/components/table.vue +++ b/src/views/cost/shipmentStatistics/components/table.vue @@ -65,7 +65,7 @@ export default { white-space: nowrap; margin: 0 10px; line-height: 23px; - width: 90px; + width: 85px; text-align: left; color: #606266; font-weight: 400; @@ -84,7 +84,7 @@ export default { .td{ white-space: nowrap; margin: 0 10px; - width: 90px; + width: 85px; line-height: 23px; color: #606266; font-weight: inherit; diff --git a/src/views/cost/shipmentStatistics/index.vue b/src/views/cost/shipmentStatistics/index.vue index 5c3dfab..ea7bbfe 100644 --- a/src/views/cost/shipmentStatistics/index.vue +++ b/src/views/cost/shipmentStatistics/index.vue @@ -18,8 +18,8 @@
查询 重置 - - 下载 + + 下载
@@ -74,7 +74,7 @@ export default { reqParams:{ page:1, pageSize:30, - date_type:'day', + date_type:'month', dateSelect:[], start:'', end:'', @@ -137,7 +137,32 @@ export default { this.feesData = res.data; let option = { tooltip: { - trigger: 'axis' + trigger: 'axis', + axisPointer: { + type: 'shadow' + }, + formatter: function (params) { + const filteredParams = params.filter(param => param.value !== 0); + const formattedParams = filteredParams.map(param => { + const seriesColor = param.color; + return ` ${param.seriesName} ${param.value}`; + }).join(''); + return params[0].name + '
' + formattedParams; + } + }, + toolbox:{ + show:true, + feature: { + magicType: { type: ['line', 'bar'] }, + } + }, + grid:{ + bottom:40, + left:10, + }, + legend:{ + show:true, + bottom:10 }, xAxis: { boundaryGap: false, @@ -192,13 +217,13 @@ export default { // 下载导出 exportChangeShow(params){ - if(params.type == 11){ + if(params.type == 20){ this.exportShow = params.status==0?true:false } }, async exportData() { if(this.exportShow) return - const res = await this.$API.orders.order.maintenance.export.post(this.params); + const res = await this.$API.finance.cost.summaryExport.post(this.reqParams); if(res.code == 200){ this.$message.success('开始导出'); } @@ -211,7 +236,7 @@ export default { this.reqParams = { page:1, pageSize:30, - date_type:'day', + date_type:'month', dateSelect:[], start:'', end:'' @@ -219,9 +244,6 @@ export default { this.$refs.scSearch.reload(); this.getData(); }, - handleSaveSuccess(){ - // this.$refs.table.refresh(); - }, } } diff --git a/src/views/setting/company/index.vue b/src/views/setting/company/index.vue index a8369c0..12ecd24 100644 --- a/src/views/setting/company/index.vue +++ b/src/views/setting/company/index.vue @@ -110,9 +110,9 @@ export default { searchShow:false, searchList:[ {name:'开通日期',type:'date',code:'activation_date',show:true}, - {name:'公司类型',type:'select',code:['company_type'], data:[], placeholder:"请选择公司类型",show:true}, - {name:'公司名称',type:'multiple',code:'id', data:[], placeholder:"请选择公司名称",show:true}, - {name:'状态',type:'select',code:'active_status', data:[], placeholder:"请选择状态",isOpen:true,show:false}, + {name:'公司类型',type:'select',code:['company_type'],isConstant:true, data:[], placeholder:"请选择公司类型",show:true}, + {name:'公司名称',type:'multiple',code:'full_name',data:[], placeholder:"请选择公司名称",show:true}, + {name:'状态',type:'select',code:['active_status'],isConstant:true, data:[], placeholder:"请选择状态",isOpen:true,show:false}, {name:'手机号',type:'text',code:['mobile'],placeholder:"请输入手机号",isOpen:true,show:false}, {name:'邮件地址',type:'text',code:['email'],placeholder:"请输入邮箱地址",isOpen:true,show:false}, {name:'公司地址',type:'text',code:['address'],placeholder:"请输入公司地址",isOpen:true,show:false}, @@ -134,15 +134,37 @@ export default { } }) }, - getSelectData(item){ - let {data,params} = item; + async getSelectData(item) { + let {data, params} = item; this.params = params; - if(data.code == "id"){ - this.getCompanyList(data,params) - }else if(data.code == "active_status"){ - this.getStatusList(data,params); - }else if(data.code == "company_type"){ - this.getCompanyTypeList(data,params); + let searchParams = this.$TOOL.objCopy(params); + searchParams.field = "" + if (typeof data.code === 'string') { + searchParams.field = data.code; + } else { + searchParams.field = data.code[0]; + } + if (data.type == 'select' || data.type == 'multiple') { + const res = await this.$API.system.company.field.post(searchParams); + if (res.code == 200) { + if (res.data && res.data.length > 0) { + res.data.forEach(item => { + if(data.isConstant){ + item.label = item[data.code+'_display']; + item.value = item[data.code]; + }else{ + item.label = item[data.code]; + item.value = item.id; + item.id = item[data.code]; + } + }) + } + this.searchList.forEach(item => { + if (item.code == data.code) { + item.data = res.data; + } + }) + } } }, // 加载公司类型 @@ -152,31 +174,7 @@ export default { this.setMap['companyType'] = res.data; } }, - async getCompanyList(data,params) { - const res = await this.$API.system.company.select.post(params); - if(res.data && res.data.length>0){ - res.data.forEach(item=>{ - item.label = item.full_name; - }) - } - if(res.code == 200){ - this.searchList.forEach(item=>{ - if(item.code == data.code){ - item.data = res.data; - } - }) - } - }, - async getStatusList(data,params) { - const res = await this.$API.oss.status.post(params); - if(res.code == 200){ - this.searchList.forEach(item=>{ - if(item.code == data.code){ - item.data = res.data; - } - }) - } - }, + async getCompanyTypeList(data,params) { const res = await this.$API.system.company.typeSelect.post(params); if (res.data && res.data.length > 0) {