diff --git a/src/views/emis/emisSettleSubBill/SubBillConfirmByMoneyList.vue b/src/views/emis/emisSettleSubBill/SubBillConfirmByMoneyList.vue index 06ed1231..e1a330d4 100644 --- a/src/views/emis/emisSettleSubBill/SubBillConfirmByMoneyList.vue +++ b/src/views/emis/emisSettleSubBill/SubBillConfirmByMoneyList.vue @@ -24,11 +24,11 @@ - + - + - + + @@ -89,7 +90,7 @@ ref="refTable" row-key="id" - storageName="SubBillConfirmByMoneyList_main" + :storageName="storageName" :data="emisSettleSubBillList" :showSearch.sync="showSearch" @@ -106,7 +107,7 @@ show-summary :summary-method="getSummaries" > -
+
+
+ + + 批量确认 + + + 置账单异常 + + + 取消确认 + + + +
+
总票数:{{queryStatInfoMap?queryStatInfoMap.totalNum:0}}, - 总运费:{{queryStatInfoMap?queryStatInfoMap.totalBillFee.toFixed(2):0}} + 总运费:{{queryStatInfoMap?queryStatInfoMap.totalBillFee:0}}
@@ -225,6 +262,12 @@ + + + + + - - - -
+
+
+ + + 批量确认 + + + 置账单异常 + + + 取消确认 + + + +
+
总票数:{{queryStatInfoMap?queryStatInfoMap.totalNum:0}}, @@ -190,7 +221,7 @@ @@ -561,8 +438,11 @@ export default { // 结算子账单表格数据 emisSettleSubBillList: [], + actionType:null, settleType:null, + storageName:null, + queryStatInfoMap:null, currentId:null, @@ -759,34 +639,68 @@ export default { }, created() { this.queryParams.blConfirm='0'; - this.settleType=this.$route.query.settleType; + this.actionType=this.$route.query.actionType; + this.initData(); this.getList(); }, methods: { + + initData(){ + if(this.actionType==1){ + this.storageName="SubBillConfirmByMoneyList_main"; + } + else if(this.actionType==2){ + this.storageName="SubBillConfirmByMonthList_main"; + } + else if(this.actionType==3){ + this.storageName="SubBillConfirmBySitehList_main"; + } + }, handleClick(tab, event) { // console.log(tab, event); - if (tab.name == 'all') { + if(this.actionType==1|| this.actionType==2){ + this.queryParams.blSiteConfirm=null; this.queryParams.blConfirm=null; - } - else if (tab.name == 'waitConfirm') { - this.queryParams.blConfirm='0'; - } - else if (tab.name == 'hasConfirm') { - this.queryParams.blConfirm='1'; - } - else if (tab.name == 'confirmNotBill') { - this.queryParams.blConfirm='2'; - } - else if (tab.name == 'billError') { - this.queryParams.blConfirm='3'; - } - else if (tab.name == 'siteBillError') { - this.queryParams.blSiteConfirm='3'; - } - - + if (tab.name == 'all') { + this.queryParams.blConfirm=null; + } + else if (tab.name == 'waitConfirm') { + this.queryParams.blConfirm='0'; + } + else if (tab.name == 'hasConfirm') { + this.queryParams.blConfirm='1'; + } + else if (tab.name == 'confirmNotBill') { + this.queryParams.blConfirm='2'; + } + else if (tab.name == 'billError') { + this.queryParams.blConfirm='3'; + } + else if (tab.name == 'siteBillError') { + this.queryParams.blSiteConfirm='3'; + } + } + else if(this.actionType==2){ + this.queryParams.blSiteConfirm=null; + this.queryParams.blConfirm=1; + if (tab.name == 'all') { + this.queryParams.blSiteConfirm=null; + } + else if (tab.name == 'waitConfirm') { + this.queryParams.blSiteConfirm='0'; + } + else if (tab.name == 'hasConfirm') { + this.queryParams.blSiteConfirm='1'; + } + // else if (tab.name == 'confirmNotBill') { + // this.queryParams.blSiteConfirm='2'; + // } + else if (tab.name == 'billError') { + this.queryParams.blSiteConfirm='3'; + } + } this.getList(); }, @@ -809,7 +723,13 @@ export default { /** 查询结算子账单列表 */ initQueryParams(){ - this.queryParams.settleType=this.settleType; + if(this.actionType==3){ + this.queryParams.params.salesmen=this.$store.getters.empName + }else if(this.actionType==2){ + this.queryParams.settleType=2; + }else if(this.actionType==1){ + this.queryParams.settleType=1; + } this.queryParams=this.addDateRange(this.queryParams, this.dateTimeRange,"sendDate") }, getList() { @@ -829,6 +749,98 @@ export default { }); }, + //指定列求和 + getSummaries(param) { + const { columns, data } = param; + console.log("===>getSummaries==>",param) + const sums = []; + columns.forEach((column, index) => { + if (index === 0) { + sums[index] = '合计'; + return; + } + + + if ( + column.property === 'waybillDetail.billWeight' + ) { + const values = data.map(item => Number(item.waybillDetail.billWeight)); + sums[index] = values.reduce((prev, curr) => { + const value = Number(curr); + if (!isNaN(value)) { + return prev + curr; + } else { + return prev; + } + }, 0); + sums[index] = sums[index].toFixed(2); //保留2位小数 + } + + else if ( + column.property === 'waybillDetail.volumeWeight' + + ) { + const values = data.map(item => Number(item.waybillDetail.volumeWeight)); + + sums[index] = values.reduce((prev, curr) => { + const value = Number(curr); + if (!isNaN(value)) { + return prev + curr; + } else { + return prev; + } + }, 0); + sums[index] = sums[index].toFixed(2); //保留2位小数 + } + else if ( + column.property === 'waybillDetail.freight' + + ) { + const values = data.map(item => Number(item.waybillDetail.freight)); + + sums[index] = values.reduce((prev, curr) => { + const value = Number(curr); + if (!isNaN(value)) { + return prev + curr; + } else { + return prev; + } + }, 0); + sums[index] = sums[index].toFixed(2); //保留2位小数 + } + + else if ( + column.property === 'waybillDetail.totalVolume' + ) { + const values = data.map(item => Number(item.waybillDetail.totalVolume)); + sums[index] = values.reduce((prev, curr) => { + const value = Number(curr); + if (!isNaN(value)) { + return prev + curr; + } else { + return prev; + } + }, 0); + sums[index] = sums[index].toFixed(5); //保留2位小数 + } + else if( + column.property === 'waybillDetail.parcelQty' + ){ + const values = data.map(item => Number(item.waybillDetail.parcelQty)); + sums[index] = values.reduce((prev, curr) => { + const value = Number(curr); + if (!isNaN(value)) { + return prev + curr; + } else { + return prev; + } + }, 0); + sums[index]; + } + }); + console.log(sums); + return sums + }, handleShowTraceInfo(row){ this.openTraceInfoTitle="运单详情【"+row.billCode+"】"; @@ -917,12 +929,56 @@ export default { }); }).catch(() => {}); }, - handleView(row) { - this.id=row.id; - this.titleView="查看"; - this.openView=true; - // this.router.push({ path: '/emis/emisSettleSubBill/viewDetail', query: { id: row.id }}) + + handleConfirmBySite(row) { + const ids = row.id || this.ids; + this.$modal.confirm('是否确认').then(function() { + return confirmBillBySite(ids); + }).then(() => { + this.getList(); + this.$modal.msgSuccess("操作成功"); + }).catch(() => {}); }, + handleCancelConfirmBySite(row) { + const ids = row.id || this.ids; + this.$modal.confirm('是否取消确认').then(function() { + return cancelConfirmBillBySite(ids); + }).then(() => { + this.getList(); + this.$modal.msgSuccess("操作成功"); + }).catch(() => {}); + }, + handleConfirmNoBillBySite(row) { + const ids = row.id || this.ids; + this.$prompt('请输入不出账原因', "操作确认", { + confirmButtonText: "确定", + cancelButtonText: "取消", + closeOnClickModal: false, + inputPattern: /^.{1,30}$/, + inputErrorMessage: "原因长度必须介于 1 和 30 之间" + }).then(({ value }) => { + confirmNoBillBySite(ids,value).then(response => { + this.$modal.msgSuccess("操作成功" ); + this.getList(); + }); + }).catch(() => {}); + }, + handleSetBillErrorBySite(row) { + const ids = row.id || this.ids; + this.$prompt('请输入账单异常原因', "操作确认", { + confirmButtonText: "确定", + cancelButtonText: "取消", + closeOnClickModal: false, + inputPattern: /^.{1,30}$/, + inputErrorMessage: "原因长度必须介于 1 和 30 之间" + }).then(({ value }) => { + setBillErrorBySite(ids,value).then(response => { + this.$modal.msgSuccess("操作成功" ); + this.getList(); + }); + }).catch(() => {}); + }, + handleFormChanged(){ this.openForm = false; this.getList(); @@ -994,7 +1050,7 @@ export default { .feeItem{ - border: 1px solid #d4d4d4; + border: 1px solid #dfe6ec; ul{ list-style: none; @@ -1003,7 +1059,7 @@ export default { width: 590px; height: 32px; line-height: 32px; - border: 1px solid #ffffff; + border: 1px solid #dfe6ec; border-top: 0px; font-size: 12px; @@ -1012,7 +1068,7 @@ export default { display:block; width:33%; float:left;text-indent:2em } .th{ - background:#F1FADE; font-weight:bold; border-top:1px + background:#FFF; font-weight:bold; border-top:1px } } diff --git a/src/views/emis/emisSettleSubBill/SubBillConfirmBySiteList.vue b/src/views/emis/emisSettleSubBill/SubBillConfirmBySiteList.vue index 894037af..e1a330d4 100644 --- a/src/views/emis/emisSettleSubBill/SubBillConfirmBySiteList.vue +++ b/src/views/emis/emisSettleSubBill/SubBillConfirmBySiteList.vue @@ -15,20 +15,20 @@ :rows="2" /> - + - - + + - + - + - - + + - + - + - + - + - + - - - -
+
+ + + 批量确认 + + + 确认不出账 + + + 置账单异常 + + + 取消确认 + + + + + + 导出 + + +
+ +
取消确认 - - - - 导出 - - +
@@ -180,7 +221,7 @@ @@ -551,8 +438,11 @@ export default { // 结算子账单表格数据 emisSettleSubBillList: [], + actionType:null, settleType:null, + storageName:null, + queryStatInfoMap:null, currentId:null, @@ -749,32 +639,68 @@ export default { }, created() { this.queryParams.blConfirm='0'; - this.settleType=this.$route.query.settleType; + this.actionType=this.$route.query.actionType; + this.initData(); this.getList(); }, methods: { + + initData(){ + if(this.actionType==1){ + this.storageName="SubBillConfirmByMoneyList_main"; + } + else if(this.actionType==2){ + this.storageName="SubBillConfirmByMonthList_main"; + } + else if(this.actionType==3){ + this.storageName="SubBillConfirmBySitehList_main"; + } + }, handleClick(tab, event) { // console.log(tab, event); - if (tab.name == 'all') { + if(this.actionType==1|| this.actionType==2){ this.queryParams.blSiteConfirm=null; - } - else if (tab.name == 'waitConfirm') { - this.queryParams.blSiteConfirm='0'; - } - else if (tab.name == 'hasConfirm') { - this.queryParams.blSiteConfirm='1'; - } - // else if (tab.name == 'confirmNotBill') { - // this.queryParams.blSiteConfirm='2'; - // } - else if (tab.name == 'billError') { - this.queryParams.blSiteConfirm='3'; - } - - - + this.queryParams.blConfirm=null; + if (tab.name == 'all') { + this.queryParams.blConfirm=null; + } + else if (tab.name == 'waitConfirm') { + this.queryParams.blConfirm='0'; + } + else if (tab.name == 'hasConfirm') { + this.queryParams.blConfirm='1'; + } + else if (tab.name == 'confirmNotBill') { + this.queryParams.blConfirm='2'; + } + else if (tab.name == 'billError') { + this.queryParams.blConfirm='3'; + } + else if (tab.name == 'siteBillError') { + this.queryParams.blSiteConfirm='3'; + } + } + else if(this.actionType==2){ + this.queryParams.blSiteConfirm=null; + this.queryParams.blConfirm=1; + if (tab.name == 'all') { + this.queryParams.blSiteConfirm=null; + } + else if (tab.name == 'waitConfirm') { + this.queryParams.blSiteConfirm='0'; + } + else if (tab.name == 'hasConfirm') { + this.queryParams.blSiteConfirm='1'; + } + // else if (tab.name == 'confirmNotBill') { + // this.queryParams.blSiteConfirm='2'; + // } + else if (tab.name == 'billError') { + this.queryParams.blSiteConfirm='3'; + } + } this.getList(); }, @@ -797,8 +723,13 @@ export default { /** 查询结算子账单列表 */ initQueryParams(){ - this.queryParams.settleType=this.settleType; - this.queryParams.params.salesmen=this.$store.getters.empName + if(this.actionType==3){ + this.queryParams.params.salesmen=this.$store.getters.empName + }else if(this.actionType==2){ + this.queryParams.settleType=2; + }else if(this.actionType==1){ + this.queryParams.settleType=1; + } this.queryParams=this.addDateRange(this.queryParams, this.dateTimeRange,"sendDate") }, getList() { @@ -818,6 +749,98 @@ export default { }); }, + //指定列求和 + getSummaries(param) { + const { columns, data } = param; + console.log("===>getSummaries==>",param) + const sums = []; + columns.forEach((column, index) => { + if (index === 0) { + sums[index] = '合计'; + return; + } + + + if ( + column.property === 'waybillDetail.billWeight' + ) { + const values = data.map(item => Number(item.waybillDetail.billWeight)); + sums[index] = values.reduce((prev, curr) => { + const value = Number(curr); + if (!isNaN(value)) { + return prev + curr; + } else { + return prev; + } + }, 0); + sums[index] = sums[index].toFixed(2); //保留2位小数 + } + + else if ( + column.property === 'waybillDetail.volumeWeight' + + ) { + const values = data.map(item => Number(item.waybillDetail.volumeWeight)); + + sums[index] = values.reduce((prev, curr) => { + const value = Number(curr); + if (!isNaN(value)) { + return prev + curr; + } else { + return prev; + } + }, 0); + sums[index] = sums[index].toFixed(2); //保留2位小数 + } + else if ( + column.property === 'waybillDetail.freight' + + ) { + const values = data.map(item => Number(item.waybillDetail.freight)); + + sums[index] = values.reduce((prev, curr) => { + const value = Number(curr); + if (!isNaN(value)) { + return prev + curr; + } else { + return prev; + } + }, 0); + sums[index] = sums[index].toFixed(2); //保留2位小数 + } + + else if ( + column.property === 'waybillDetail.totalVolume' + ) { + const values = data.map(item => Number(item.waybillDetail.totalVolume)); + sums[index] = values.reduce((prev, curr) => { + const value = Number(curr); + if (!isNaN(value)) { + return prev + curr; + } else { + return prev; + } + }, 0); + sums[index] = sums[index].toFixed(5); //保留2位小数 + } + else if( + column.property === 'waybillDetail.parcelQty' + ){ + const values = data.map(item => Number(item.waybillDetail.parcelQty)); + sums[index] = values.reduce((prev, curr) => { + const value = Number(curr); + if (!isNaN(value)) { + return prev + curr; + } else { + return prev; + } + }, 0); + sums[index]; + } + }); + console.log(sums); + return sums + }, handleShowTraceInfo(row){ this.openTraceInfoTitle="运单详情【"+row.billCode+"】"; @@ -858,6 +881,55 @@ export default { this.openForm = true; this.titleForm = "修改"; }, + handleConfirmByCenter(row) { + const ids = row.id || this.ids; + this.$modal.confirm('是否确认').then(function() { + return confirmBillByCenter(ids); + }).then(() => { + this.getList(); + this.$modal.msgSuccess("操作成功"); + }).catch(() => {}); + }, + handleCancelConfirmByCenter(row) { + const ids = row.id || this.ids; + this.$modal.confirm('是否取消确认').then(function() { + return cancelConfirmBillByCenter(ids); + }).then(() => { + this.getList(); + this.$modal.msgSuccess("操作成功"); + }).catch(() => {}); + }, + handleConfirmNoBillByCenter(row) { + const ids = row.id || this.ids; + this.$prompt('请输入不出账原因', "操作确认", { + confirmButtonText: "确定", + cancelButtonText: "取消", + closeOnClickModal: false, + inputPattern: /^.{1,30}$/, + inputErrorMessage: "原因长度必须介于 1 和 30 之间" + }).then(({ value }) => { + confirmNoBillByCenter(ids,value).then(response => { + this.$modal.msgSuccess("操作成功" ); + this.getList(); + }); + }).catch(() => {}); + }, + handleSetBillErrorByCenter(row) { + const ids = row.id || this.ids; + this.$prompt('请输入账单异常原因', "操作确认", { + confirmButtonText: "确定", + cancelButtonText: "取消", + closeOnClickModal: false, + inputPattern: /^.{1,30}$/, + inputErrorMessage: "原因长度必须介于 1 和 30 之间" + }).then(({ value }) => { + setBillErrorByCenter(ids,value).then(response => { + this.$modal.msgSuccess("操作成功" ); + this.getList(); + }); + }).catch(() => {}); + }, + handleConfirmBySite(row) { const ids = row.id || this.ids; this.$modal.confirm('是否确认').then(function() { @@ -906,12 +978,7 @@ export default { }); }).catch(() => {}); }, - handleView(row) { - this.id=row.id; - this.titleView="查看"; - this.openView=true; - // this.router.push({ path: '/emis/emisSettleSubBill/viewDetail', query: { id: row.id }}) - }, + handleFormChanged(){ this.openForm = false; this.getList(); @@ -983,7 +1050,7 @@ export default { .feeItem{ - border: 1px solid #d4d4d4; + border: 1px solid #dfe6ec; ul{ list-style: none; @@ -992,7 +1059,7 @@ export default { width: 590px; height: 32px; line-height: 32px; - border: 1px solid #ffffff; + border: 1px solid #dfe6ec; border-top: 0px; font-size: 12px; @@ -1001,7 +1068,7 @@ export default { display:block; width:33%; float:left;text-indent:2em } .th{ - background:#F1FADE; font-weight:bold; border-top:1px + background:#FFF; font-weight:bold; border-top:1px } }