From 3beb65aad0fc663e87f85173931987c25cc5503b Mon Sep 17 00:00:00 2001 From: cclu <1106109051@qq.com> Date: Thu, 25 Jul 2024 20:17:25 +0800 Subject: [PATCH] update --- pages/settlementApproval/detail.vue | 949 +++++++++++++++++--- pages/settlementApproval/index.vue | 2 +- pages/settlementApproval/yearSettlement.vue | 66 ++ 3 files changed, 872 insertions(+), 145 deletions(-) diff --git a/pages/settlementApproval/detail.vue b/pages/settlementApproval/detail.vue index abfca4e..637b536 100644 --- a/pages/settlementApproval/detail.vue +++ b/pages/settlementApproval/detail.vue @@ -77,9 +77,9 @@ - - - {{ detailObj.Approvalstate>0?'精算数据':'结算数据' }} + + + 结算数据 @@ -139,70 +139,351 @@ + + + - + + 结算数据 + + + 期限: + {{`${detailObj.STARTDATE}-${detailObj.ENDDATE}`}} + + + + + + 本月营收: + {{actuaryData.CurMonthRevenue?`${$util.getMoney(actuaryData.CurMonthRevenue)}`:''}} + + + + + + 累计营业额: + {{actuaryData.REVENUEDAILY_AMOUNTTotal?`${$util.getMoney(actuaryData.REVENUEDAILY_AMOUNTTotal)}`:''}} + + + + + + 移动支付: + {{actuaryData.MOBILEPAY_AMOUNT?`${$util.getMoney(actuaryData.MOBILEPAY_AMOUNT)}`:''}} + + + + + + 移动冲正: + {{actuaryData.MOBILEPAY_CORRECT?`${$util.getMoney(actuaryData.MOBILEPAY_CORRECT)}`:'0'}} + + + + + + 现金交易: + {{actuaryData.CASHPAY_AMOUNT?`${$util.getMoney(actuaryData.CASHPAY_AMOUNT)}`:''}} + + + + + + 现金冲正: + {{actuaryData.CASHPAY_CORRECT?`${$util.getMoney(actuaryData.CASHPAY_CORRECT)}`:'0'}} + + + + + + 提成金额: + {{actuaryData.GUARANTEERATIOAMOUNT?`${$util.getMoney(actuaryData.GUARANTEERATIOAMOUNT)}`:''}} + + + + + 提成收入: + {{actuaryData.GUARANTEERATIOINCOME?`${$util.getMoney(actuaryData.GUARANTEERATIOINCOME)}`:''}} + + + + + + + 精算数据 + + + 期限: + {{detailObj.STARTDATE}} - {{detailObj.ENDDATE}} + + + + + + 本月营收: + {{monthNewCalibration.CurMonthRevenueTEXT?monthNewCalibration.CurMonthRevenueTEXT:''}} + + + + + 累计营业额: + {{monthNewCalibration.REVENUEDAILY_AMOUNTTotalTEXT?monthNewCalibration.REVENUEDAILY_AMOUNTTotalTEXT:''}} + + + + + 移动支付: + {{monthNewCalibration.MOBILEPAY_AMOUNTTEXT || ''}} + + + + + + 移动冲正: + {{monthNewCalibration.MOBILEPAY_CORRECTTEXT || ''}} + + + + + + 现金交易: + {{monthNewCalibration.CASHPAY_AMOUNTTEXT || ''}} + + + + + + 现金冲正: + {{monthNewCalibration.CASHPAY_CORRECTTEXT || '0'}} + + + + + + 提成金额: + {{monthNewCalibration.GUARANTEERATIOAMOUNTTEXT || ''}} + + + + + + 提成收入: + {{monthNewCalibration.GUARANTEERATIOINCOMETEXT || ''}} + + + + + + + - {{ detailObj.Approvalstate>0?'精算数据':'结算数据' }} + 结算数据 - - - - 期限: - {{item.PeriodDesc ||''}} + + + + 期限: + {{item.PeriodDesc ||''}} + + + 结算状态: + {{detailObj.Approvalstate>0?'已结算':'待结算'}} + - - 结算状态: - {{detailObj.Approvalstate>0?'已结算':'待结算'}} + + + + 现金: + {{item.CashAmount?numeral($util.getMoney(item.CashAmount)).format('0,0.00'):''}} + + + 微支付: + {{item.MobilePayAmount?numeral($util.getMoney(item.MobilePayAmount)).format('0,0.00'):''}} + + + + + + 营业额合计: + {{item.RevenueAmount?numeral($util.getMoney(item.RevenueAmount)).format('0,0.00'):''}} + + + 驿达收款: + {{item.RoyaltyAmount?numeral($util.getMoney(item.RoyaltyAmount)).format('0,0.00'):''}} + + + + + + 营收费用合计: + {{item.ReceivableAmount?numeral($util.getMoney(item.ReceivableAmount)).format('0,0.00'):''}} + + + 租金: + {{item.GuaranteeFee?numeral($util.getMoney(item.GuaranteeFee)).format('0,0.00'):''}} + + + + + 退补款: + {{item.RefundSupplement?numeral($util.getMoney(item.RefundSupplement)).format('0,0.00'):''}} + + + + + + + + + + + + + + + 结算数据 + + + 期限: + {{item.PeriodDesc ||''}} + + + + + + 结算状态: + {{detailObj.Approvalstate>0?'已结算':'待结算'}} + + + + + + 现金: + {{item.CashAmount?numeral($util.getMoney(item.CashAmount)).format('0,0.00'):''}} + + + + + + 微支付: + {{item.MobilePayAmount?numeral($util.getMoney(item.MobilePayAmount)).format('0,0.00'):''}} + + + + + + 营业额合计: + {{item.RevenueAmount?numeral($util.getMoney(item.RevenueAmount)).format('0,0.00'):''}} + + + + + + 驿达收款: + {{item.RoyaltyAmount?numeral($util.getMoney(item.RoyaltyAmount)).format('0,0.00'):''}} + + + + + + 营收费用合计: + {{item.ReceivableAmount?numeral($util.getMoney(item.ReceivableAmount)).format('0,0.00'):''}} + + + + + + 租金: + {{item.GuaranteeFee?numeral($util.getMoney(item.GuaranteeFee)).format('0,0.00'):''}} + + + + + + 退补款: + {{item.RefundSupplement?numeral($util.getMoney(item.RefundSupplement)).format('0,0.00'):''}} + + + + + + + + 精算数据 + + + + + + 期限: + {{afterItem.PeriodDesc ||''}} + + + + + + 结算状态: + {{detailObj.Approvalstate>0?'已结算':'待结算'}} + + + + + + 现金: + {{afterItem.CashAmountTEXT || ''}} + + + + + + 微支付: + {{afterItem.MobilePayAmountTEXT || ''}} + + + + + + 营业额合计: + {{afterItem.RevenueAmountTEXT || ''}} + + + + + + 驿达收款: + {{afterItem.RoyaltyAmountTEXT || ''}} + + + + + + 营收费用合计: + {{afterItem.ReceivableAmountTEXT || ''}} + + + + + + 租金: + {{afterItem.GuaranteeFeeTEXT || ''}} + + + + + + 退补款: + {{afterItem.RefundSupplementTEXT || ''}} + + + + + + + - - - 现金: - {{item.CashAmount?numeral($util.getMoney(item.CashAmount)).format('0,0.00'):''}} - - - 微支付: - {{item.MobilePayAmount?numeral($util.getMoney(item.MobilePayAmount)).format('0,0.00'):''}} - - - - - - 营业额合计: - {{item.RevenueAmount?numeral($util.getMoney(item.RevenueAmount)).format('0,0.00'):''}} - - - 驿达收款: - {{item.RoyaltyAmount?numeral($util.getMoney(item.RoyaltyAmount)).format('0,0.00'):''}} - - - - - - 营收费用合计: - {{item.ReceivableAmount?numeral($util.getMoney(item.ReceivableAmount)).format('0,0.00'):''}} - - - 租金: - {{item.GuaranteeFee?numeral($util.getMoney(item.GuaranteeFee)).format('0,0.00'):''}} - - - - - 退补款: - {{item.RefundSupplement?numeral($util.getMoney(item.RefundSupplement)).format('0,0.00'):''}} - - - - - - - - - - @@ -268,6 +549,134 @@ + + + + 精算数据 + + + + + 期限: + {{item.PeriodDesc ||''}} + + + 结算状态: + {{detailObj.Approvalstate>0?'已结算':'待结算'}} + + + + + + 现金: + {{item.CashAmountTEXT || ''}} + + + 微支付: + {{item.MobilePayAmountTEXT || ''}} + + + + + + 营业额合计: + {{item.RevenueAmountTEXT || ''}} + + + 驿达收款: + {{item.RoyaltyAmountTEXT || ''}} + + + + + + 营收费用合计: + {{item.ReceivableAmountTEXT || ''}} + + + 租金: + {{item.GuaranteeFeeTEXT || ''}} + + + + + 退补款: + {{item.RefundSupplementTEXT || ''}} + + + + + + + + + + + + + + + + 期限: + {{subItem.PeriodDesc ||''}} + + + 结算状态: + {{subItem.IsApplySuccess?'已结算':'待结算'}} + + + + + + 现金: + {{subItem.CashAmount?numeral($util.getMoney(subItem.CashAmount)).format('0,0.00'):''}} + + + 微支付: + {{subItem.MobilePayAmount?numeral($util.getMoney(subItem.MobilePayAmount)).format('0,0.00'):''}} + + + + + + 营业额合计: + {{subItem.RevenueAmount?numeral($util.getMoney(subItem.RevenueAmount)).format('0,0.00'):''}} + + + 驿达收款: + {{subItem.RoyaltyAmount?numeral($util.getMoney(subItem.RoyaltyAmount)).format('0,0.00'):''}} + + + + + + 营收费用合计: + {{subItem.ReceivableAmount?numeral($util.getMoney(subItem.ReceivableAmount)).format('0,0.00'):''}} + + + 租金: + {{subItem.GuaranteeFee?numeral($util.getMoney(subItem.GuaranteeFee)).format('0,0.00'):''}} + + + + + 退补款: + {{subItem.RefundSupplement?numeral($util.getMoney(subItem.RefundSupplement)).format('0,0.00'):''}} + + + + + + + + + + + + + + + @@ -285,21 +694,21 @@ - + 发起申请 - + 审核 - + @@ -312,8 +721,9 @@ 审批流程 + - + 申请人: {{progressDetail.STAFF_NAME || ''}} @@ -323,18 +733,25 @@ - + + + 待审核人: + {{progressDetail.APPOVED_NAME || ''}} + + + + - {{`【${item.APPLYAPPROVE_NAME}】`}} + {{`【${item.APPLYAPPROVE_NAME}】`}} {{`${item.APPLYAPPROVE_DATE}`}} - {{item.STAFF_NAME}} + {{item.STAFF_NAME}}: {{`${item.APPLYAPPROVE_INFO}`}} @@ -349,7 +766,7 @@ - + 下一环节审批人: {{nextPersonIndex?nextPerson[nextPersonIndex].label:'请选择'}} @@ -600,30 +1017,70 @@ export default { isShowSelect: false,// 出现选人的悬浮框 yearDataList:[],// 年度结算的悬浮框数据 isAllMonthSuccess: true,// 判断是不是全部的月份都已经审结了 - allYearMonthDataList:[]//用来处理没完成的结算月度数据 + allYearMonthDataList:[],//用来处理没完成的结算月度数据 + yearDataListAfter:[],// 年度精算数据 + isShowProgress: true,// 是否显示流程进度 + isPush: false,// 是否是推送 + progressObjDetail:{},// 流程详情 + monthId:'', // 月份审批二次进入发起申请的时候带的唯一id + monthNewCalibration:{},// 月度精算过后 详情进入查看的值 + yearId:'',// 年度审批二次进入发起申请的时候带的id } }, async onLoad(query){ - - if(query.obj){ - this.detailObj = JSON.parse(query.obj) + console.log('query',query) + if (query.id) { + this.isPush = true + await this.handleGetPageDetail(query.id) + }else{ + if(query.obj){ + this.detailObj = JSON.parse(query.obj) + } } - console.log('this.detailObj',this.detailObj) + if(query.staticMonth){ this.staticMonth = this.$moment(query.staticMonth).format('YYYYMM') } - + // 拿到顶部数据 await this.handleGetDetailDifference() - await this.handleGetActuaryData() - await this.handleGetProgress() - // 如果是年度的 就去请求年度的结算数据 if(this.detailObj.SETTLEMENT_TYPE===1){ + // 如果是年度的 就去请求年度的结算数据 await this.handleGetYearSettlement() + if (this.detailObj.Approvalstate > 0) { + // 请求年度的精算数据 + await this.handleGetYearSettlementRight() + } + }else{ + // 月度数据 + // 拿到月度精算数据 + await this.handleGetActuaryData() + if (this.detailObj.Approvalstate > 0) { + // 精算数据 + await this.handleGetDetail() + } } + // 拿到流程数据 + await this.handleGetProgress() }, onUnload(){ + + // 因为返回不会卸载页面 但是详情返回列表下一次进来肯定全部重新判断的 所以只能这样 + this.detailObj = {} + this.topDetail = {} + this.actuaryData = {} + this.newCalibration = {} + this.progressDetail = {} + this.nextPerson = [] + this.staticMonth = '' + this.nextPersonIndex = '' + this.showLabel = '' + this.approveDesc = '' + this.progressList = [] + this.afterCalibration = false + this.monthId = '' + this.closePop() this.closeApplyFor() this.closeShowSelect() @@ -634,6 +1091,109 @@ export default { methods:{ numeral, + async handleGetDetail(){ + uni.showLoading({ + title: '请求月度精算数据...' + }) + const data = await request.$webGet('EShangApiMain/BusinessProcess/GetBUSINESSAPPROVALDetail',{BUSINESSAPPROVALId: this.detailObj.BUSINESSAPPROVAL_ID}) + console.log('data', data) + let id = data.Result_Data.BUSINESSPROCESS_ID + const res = await request.$webGet('EShangApiMain/BusinessProject/GetBIZPSPLITMONTHDetail',{BIZPSPLITMONTHId: id}) + let obj = res.Result_Data + const req = { + BusinessProjectId: this.detailObj.BUSINESSPROJECT_ID, + StatisticsMonth: this.staticMonth || (this.detailObj.SETTLEMENT_DATE ? this.$moment(this.detailObj.SETTLEMENT_DATE).format('YYYYMM') : ''), + ShopRoyaltyId: this.detailObj.SHOPROYALTY_ID, + MobilePayCorrect: obj.MOBILEPAY_CORRECT || 0, + CashPayCorrect: obj.CASHPAY_CORRECT || 0 + } + const result = await request.$webGet('EShangApiMain/Finance/GetProjectPeriodIncome',req) + console.log('Incomeresult',result) + let bigObj = result.Result_Data.List[0] + this.monthId = bigObj.bizpsplitMonthId + this.monthNewCalibration = bigObj + this.monthNewCalibration.REVENUEDAILY_AMOUNTTotalTEXT = this.$util.getMoney(this.monthNewCalibration.REVENUEDAILY_AMOUNTTotal) + this.monthNewCalibration.CurMonthRevenueTEXT = this.$util.getMoney(this.monthNewCalibration.CurMonthRevenue) + this.monthNewCalibration.MOBILEPAY_AMOUNTTEXT = this.monthNewCalibration.MOBILEPAY_AMOUNT + ? numeral(this.$util.getMoney(this.monthNewCalibration.MOBILEPAY_AMOUNT + (this.monthNewCalibration.MOBILEPAY_CORRECT || 0))).format('0,0.00') + (this.monthNewCalibration.MOBILEPAY_CORRECT ? ('(' + (this.monthNewCalibration.MOBILEPAY_CORRECT > 0 ? '+' : '') + this.monthNewCalibration.MOBILEPAY_CORRECT + ')') : '') + : '' + this.monthNewCalibration.MOBILEPAY_CORRECTTEXT = this.$util.getMoney(this.monthNewCalibration.MOBILEPAY_CORRECT) + this.monthNewCalibration.CASHPAY_AMOUNTTEXT = this.monthNewCalibration.CASHPAY_AMOUNT + ? numeral(this.$util.getMoney(this.monthNewCalibration.CASHPAY_AMOUNT + (this.monthNewCalibration.CASHPAY_CORRECT || 0))).format('0,0.00') + (this.monthNewCalibration.CASHPAY_CORRECT ? ('(' + (this.monthNewCalibration.CASHPAY_CORRECT > 0 ? '+' : '') + this.monthNewCalibration.CASHPAY_CORRECT + ')') : '') + : '' + this.monthNewCalibration.CASHPAY_CORRECTTEXT = this.$util.getMoney(this.monthNewCalibration.CASHPAY_CORRECT) + this.monthNewCalibration.GUARANTEERATIOAMOUNTTEXT = this.$util.getMoney(this.monthNewCalibration.GUARANTEERATIOAMOUNT) + this.monthNewCalibration.GUARANTEERATIOINCOMETEXT = this.$util.getMoney(this.monthNewCalibration.GUARANTEERATIOINCOME) + console.log('this.newCalibration2', this.monthNewCalibration) + uni.hideLoading() + }, + // 控制流程进度是否显示 + handleChangeShowProgress() { + this.isShowProgress = !this.isShowProgress + }, + // 请求年度的精算数据 + async handleGetYearSettlementRight(){ + const req = { + BUSINESSPROJECT_ID: this.detailObj.BUSINESSPROJECT_ID, + SHOPROYALTY_ID: this.detailObj.SHOPROYALTY_ID + } + uni.showLoading({ + title: '请求精算数据...' + }) + const data = await request.$webGet('EShangApiMain/Finance/GetProjectPeriodAccount',req) + let res = data.Result_Data + // 页面显示的结算数据 + let resList = wrapTreeNode(res.ProjectPeriodList) + console.log('resList222222', resList) + // 年度的精算数据只取最后一条 所以处理 且不保留子级 + let result = [resList[resList.length - 1]] + if (result && result.length > 0) { + console.log('result33333', result) + result.forEach(item => { + item.level = 1 + item.showChildren = false + item.CashAmountTEXT = numeral(this.$util.getMoney(item.CashAmount)).format('0,0.00') + item.MobilePayAmountTEXT = numeral(this.$util.getMoney(item.MobilePayAmount)).format('0,0.00') + item.RevenueAmountTEXT = + numeral(this.$util.getMoney(item.RevenueAmount)).format('0,0.00') + (item.CorrectAmount ? ('(' + (item.CorrectAmount > 0 ? '+' : '') + item.CorrectAmount + ')') : '') + + item.RoyaltyAmountTEXT = numeral(this.$util.getMoney(item.RoyaltyAmount)).format('0,0.00') + item.ReceivableAmountTEXT = numeral(this.$util.getMoney(item.ReceivableAmount)).format('0,0.00') + item.GuaranteeFeeTEXT = numeral(this.$util.getMoney(item.GuaranteeFee)).format('0,0.00') + item.RefundSupplementTEXT = numeral(this.$util.getMoney(item.RefundSupplement)).format('0,0.00') + item.children = null + }) + } + this.yearDataListAfter = result + this.yearId = result[0].RevenueConfirmId + console.log('this.yearDataListAfter',this.yearDataListAfter) + console.log('this.yearId',this.yearId) + uni.hideLoading() + }, + // 推送拿到进入页面的初始参数 + async handleGetPageDetail(id) { + uni.showLoading({ + title: '请求用户数据...' + }) + const req = { + BusinessApprovalId: id, + UserId: this.users.UserId + } + console.log('req',req) + const data = await request.$webGet('EShangApiMain/BusinessProject/GetProjectAccountDetail',req) + console.log('data',data) + let res = data.Result_Data + console.log('res',res) + let obj = { + ...res, + Approvalstate: res.SETTLEMENT_STATE === 0 ? 0 : res.SETTLEMENT_STATE === 1 ? 9 : res.SETTLEMENT_STATE === 2 ? 1 : '', + startTime: this.$moment(res.SETTLEMENT_DATE).startOf('months').format('YYYY-MM-DD'), + endTime: this.$moment(res.SETTLEMENT_DATE).endOf('months').format('YYYY-MM-DD') + } + this.detailObj = obj + console.log('this.detailObj',this.detailObj) + uni.hideLoading() + }, // 拿到年度结算数据 async handleGetYearSettlement(){ const req = { @@ -641,7 +1201,7 @@ export default { SHOPROYALTY_ID: this.detailObj.SHOPROYALTY_ID } uni.showLoading({ - title: '请求数据...' + title: '请求结算数据...' }) const data = await request.$webGet('EShangApiMain/Finance/GetReconciliation',req) let res = data.Result_Data.List[0] @@ -749,6 +1309,7 @@ export default { // 选择审批人 handleChangePerson(e){ console.log('e',e) + console.log('this.nextPerson',this.nextPerson) this.nextPersonIndex = Number(e.target.value) let value = this.nextPerson[this.nextPersonIndex].value this.nextPersonValue = value @@ -781,40 +1342,44 @@ export default { // 判断是年度结算还是月度结算 let _this = this if(this.detailObj.SETTLEMENT_TYPE===1){ - // 年度 - const req = { - BusinessapprovalModel:{ - OPERATION_TYPE: '11', - // BUSINESSPROCESS_ID:'', - PROINST_ID: this.detailObj.SHOPROYALTY_ID, - SERVERPART_ID: this.detailObj.SERVERPART_ID, - SERVERPART_IDS: this.detailObj.SERVERPART_ID, - BUSINESSPROCESS_NAME:'', - BUSINESS_STARTDATE:'', - BUSINESSAPPROVAL_STATE: 1000, - BUSINESSAPPROVAL_DESC:'', - STAFF_NAME:this.detailObj.UserName, - STAFF_ID:this.detailObj.UserId, - Serverpart_Name:'', - SERVERPARTSHOP_ID:'', - SERVERPARTSHOP_NAME:'', - CORRECT_AMOUNT:'', - APPOVED_IDS:'', - APPOVED_NAME:'' - }, - RevenueconfirmModel: [] - } - - // const data = await request.$webPost('EShangApiMain/Finance/ApplyAccountProinst', req) + // // 年度 + // const req = { + // BusinessapprovalModel:{ + // OPERATION_TYPE: '11', + // // BUSINESSPROCESS_ID:'', + // PROINST_ID: this.detailObj.SHOPROYALTY_ID, + // SERVERPART_ID: this.detailObj.SERVERPART_ID, + // SERVERPART_IDS: this.detailObj.SERVERPART_ID, + // BUSINESSPROCESS_NAME:'', + // BUSINESS_STARTDATE:'', + // BUSINESSAPPROVAL_STATE: 1000, + // BUSINESSAPPROVAL_DESC:'', + // STAFF_NAME:this.detailObj.UserName, + // STAFF_ID:this.detailObj.UserId, + // Serverpart_Name:'', + // SERVERPARTSHOP_ID:'', + // SERVERPARTSHOP_NAME:'', + // CORRECT_AMOUNT:'', + // APPOVED_IDS:'', + // APPOVED_NAME:'' + // }, + // RevenueconfirmModel: [] + // } + // + // // const data = await request.$webPost('EShangApiMain/Finance/ApplyAccountProinst', req) }else{ // 月度 console.log('this.nextPersonValue',this.nextPersonValue) let [APPOVED_NAME,APPOVED_IDS] = this.nextPersonValue.split('-') console.log('APPOVED_IDS',APPOVED_IDS) console.log('APPOVED_NAME',APPOVED_NAME) + uni.showLoading({ + title: '正在发起申请...' + }) const req = { BusinessapprovalModel:{ OPERATION_TYPE:'12', + BUSINESSAPPROVAL_ID: this.detailObj.BUSINESSAPPROVAL_ID || '', BUSINESSPROCESS_NAME:`${this.detailObj.BUSINESSPROJECT_NAME}【${this.detailObj.startTime}-${this.detailObj.endTime}】月度结算`, PROINST_ID: this.detailObj.BUSINESSPROJECT_ID, SERVERPART_ID: this.detailObj.SERVERPART_ID, @@ -852,20 +1417,39 @@ export default { MOBILEPAY_CORRECT: this.newCalibration.MOBILEPAY_CORRECT, CASHPAY_CORRECT: this.newCalibration.CASHPAY_CORRECT, ACCOUNT_TYPE: 1000, - BIZPSPLITMONTH_STATE: 2 + BIZPSPLITMONTH_STATE: 2, + BIZPSPLITMONTH_ID: this.monthId, } } console.log('req',req) + // return const data = await request.$webPost('EShangApiMain/Finance/ApplyMonthAccountProinst', req) if (data.Result_Code === 100) { - uni.showToast({ - icon:'success', - duration: 2000, - title: data.Result_Desc, - }); - uni.navigateBack({ - delta: 1 - }); + if (this.isPush) { + uni.showToast({ + icon:'success', + duration: 2000, + title: data.Result_Desc, + }); + setTimeout(()=>{ + uni.redirectTo({ + url: '/pages/settlementApproval/index' + }); + },2000) + }else{ + uni.showToast({ + icon:'success', + duration: 2000, + title: data.Result_Desc, + }); + uni.setStorageSync('reolad','true') + setTimeout(()=>{ + uni.navigateBack({ + delta: 1 + }); + },2000) + } + }else{ uni.showToast({ icon:'error', @@ -873,7 +1457,7 @@ export default { title: data.Result_Desc, }); } - + uni.hideLoading() } }, // 重新校准 @@ -882,7 +1466,7 @@ export default { console.log('this.CashPayCorrect',this.CashPayCorrect) const req = { BusinessProjectId: this.detailObj.BUSINESSPROJECT_ID, - StatisticsMonth: this.staticMonth, + StatisticsMonth: this.staticMonth || (this.detailObj.SETTLEMENT_DATE ? this.$moment(this.detailObj.SETTLEMENT_DATE).format('YYYYMM') : ''), ShopRoyaltyId: this.detailObj.SHOPROYALTY_ID, MobilePayCorrect: this.MobilePayCorrect || 0, CashPayCorrect: this.CashPayCorrect || 0, @@ -951,7 +1535,7 @@ export default { }, // 跳转去年度结算页面 handleGoYearSettlementPage(){ - this.$util.toNextRoute('navigateTo', `/pages/settlementApproval/yearSettlement?obj=${JSON.stringify(this.detailObj)}`) + this.$util.toNextRoute('navigateTo', `/pages/settlementApproval/yearSettlement?obj=${JSON.stringify(this.detailObj)}&yearId=${this.yearId}`) }, // 关闭发起申请的悬浮框 closeApplyFor(){ @@ -969,7 +1553,7 @@ export default { SERVERPARTSHOP_ID: this.detailObj.SERVERPARTSHOP_ID, DataSourceType: 2, SERVERPART_ID: this.detailObj.SERVERPART_ID, - STATISTICS_MONTH: this.staticMonth, + STATISTICS_MONTH: this.staticMonth || (this.detailObj.SETTLEMENT_DATE ? this.$moment(this.detailObj.SETTLEMENT_DATE).format('YYYYMM') : '') } uni.showLoading({ title: '请求详情数据...' @@ -988,7 +1572,7 @@ export default { async handleGetActuaryData(){ const req = { BusinessProjectId: this.detailObj.BUSINESSPROJECT_ID, - StatisticsMonth: this.staticMonth, + StatisticsMonth: this.staticMonth || (this.detailObj.SETTLEMENT_DATE ? this.$moment(this.detailObj.SETTLEMENT_DATE).format('YYYYMM') : ''), ShopRoyaltyId: this.detailObj.SHOPROYALTY_ID, } uni.showLoading({ @@ -996,14 +1580,14 @@ export default { }) const data = await request.$webGet('EShangApiMain/Finance/GetProjectPeriodIncome', req) let res = data.Result_Data.List[0] - console.log('res',res) + console.log('res3232',res) this.actuaryData = res if(res.AllowSettlement===1){ this.lastMonthIsOver = true }else if(res.AllowSettlement===2){ this.lastMonthIsOver = false - this.LastSettlementMonth = `${res.LastSettlementMonth}审结中月度结算正在审批中,请审结后再发起${this.detailObj.STATISTICS_MONTH}月度结算` + this.LastSettlementMonth = `${res.LastSettlementMonth}审结中月度结算正在审批中,请审结后再发起${req.StatisticsMonth}月度结算` }else{ this.lastMonthIsOver = false if(res.LastSettlementState===0){ @@ -1069,7 +1653,7 @@ export default { let req = {} let data = {} if(type===1){ - if(!this.approveDesc){ + if(!this.approveDesc ){ uni.showToast({ title: '请输入审核意见', icon:'error', @@ -1077,7 +1661,7 @@ export default { }); return } - if(!this.nextPersonValue){ + if(!this.nextPersonValue && this.progressObjDetail.NEXT_STATE!==9000){ uni.showToast({ title: '请选择下一审批人', icon:'error', @@ -1088,13 +1672,14 @@ export default { uni.showLoading({ title: '发起申请...' }) + let [APPOVED_NAME,APPOVED_IDS] = this.nextPersonValue.split('-') req = { businessApprovalID: this.detailObj.BUSINESSAPPROVAL_ID, curProinstState: this.progressDetail.BUSINESSAPPROVAL_STATE, approveedInfo: this.approveDesc , approveedStaffId: Store.state.userData.UserId, approveedStaffName: Store.state.userData.UserName, - nextId: this.nextPersonValue + nextId: APPOVED_IDS } if (this.detailObj.SETTLEMENT_TYPE === 2) { data = await request.$webGet('EShangApiMain/Finance/ApproveMonthAccountProinst', req) @@ -1143,12 +1728,23 @@ export default { icon:'none', duration: 2000 }); - setTimeout(()=>{ - uni.setStorageSync('reolad','true') - uni.navigateBack({ - delta: 1 - }); - },2000) + if (this.isPush) { + setTimeout(()=>{ + uni.setStorageSync('reolad','true') + uni.redirectTo({ + url: '/pages/settlementApproval/index' + }); + },2000) + }else{ + setTimeout(()=>{ + uni.setStorageSync('reolad','true') + uni.navigateBack({ + delta: 1 + }); + },2000) + } + + }else{ uni.showToast({ title: data.Result_Desc, @@ -1194,6 +1790,18 @@ export default { const data = await request.$webGet('EShangApiMain/BusinessProcess/GetBUSINESSAPPROVALDetail', req) let res = data.Result_Data console.log('res',res) + const secondReq = { + OperationType: this.detailObj.SETTLEMENT_TYPE===1?'11':'12', + CurState: res.BUSINESSAPPROVAL_STATE, + IsValid: 1, + ShowApprovalUser: true, + ServerpartIds: this.detailObj.SERVERPART_ID || '', + ShopIds: this.detailObj.SERVERPARTSHOP_ID || '' + } + const secondData = await request.$webGet('EShangApiMain/BusinessProcess/GetAPPROVALROUTEDetail', secondReq) + this.progressObjDetail = secondData.Result_Data + console.log('secondData',secondData) + this.progressDetail = res console.log('Store.state.userData.UserId',Store.state.userData.UserId) console.log('res.APPOVED_IDS',res.APPOVED_IDS) @@ -1208,18 +1816,24 @@ export default { APPLYAPPROVE_INFO:'', }) let list = [] - res.UserList.forEach(item=>{ - list.push({label: item.USER_NAME,value: item.USER_ID}) - }) + if(res.UserList && res.UserList.length>0){ + res.UserList.forEach(item=>{ + // list.push({label: item.USER_NAME,value: item.USER_ID}) + list.push({label: item.USER_NAME,value: `${item.USER_NAME}-${item.USER_ID}`}) + }) + } + this.nextPerson = list console.log('this.nextPerson',this.nextPerson) let rejectList = [] + if(res.rejectList && res.rejectList.length>0){ + res.rejectList.forEach((item) => { + rejectList.push({ label: item.APPROVALROUTE_NAME, value: JSON.stringify(item) }) + }) + } - res.rejectList.forEach((item) => { - rejectList.push({ label: item.APPROVALROUTE_NAME, value: JSON.stringify(item) }) - }) this.rejectDataList = rejectList console.log('this.rejectDataList',this.rejectDataList) uni.hideLoading() @@ -1323,6 +1937,43 @@ export default { transform: rotate(90deg); } } + .compareBox{ + width: 100%; + display: flex; + .compareBoxItem{ + width: 50%; + .smallTitle{ + font-size: 26rpx; + font-weight: 600; + margin-bottom: 16rpx; + } + .rowItemBox{ + display: flex; + .allRowItem{ + width: 100%; + .label{ + color: #ADB2BF; + font-size: 26rpx; + } + .value{ + font-size: 26rpx; + } + } + .rowItem{ + width: 50%; + display: flex; + justify-content: flex-start; + .label{ + color: #ADB2BF; + font-size: 26rpx; + } + .value{ + font-size: 26rpx; + } + } + } + } + } } .btnBox{ @@ -1398,21 +2049,21 @@ export default { box-sizing: border-box; padding: 32rpx; background: #fff; + margin-top: 24rpx; .progressTopBox{ width: 100%; position: relative; + margin-bottom: 16rpx; + display: flex; + align-items: center; + justify-content: space-between; .progressTitle{ } - .progressTitle:after{ - font-family: uniicons; - content: '\e581'; - position: absolute; - right: 24rpx; - top: 50%; - color: #bbb; - -webkit-transform: translateY(-50%); - transform: translateY(-50%); + .getMoreIcon{ + width: 30rpx; + height: 30rpx; } + } .detailTopBox{ width: 100%; @@ -1425,9 +2076,11 @@ export default { align-items: center; .label{ color: #888; + font-size: 26rpx; } .value{ margin-left: 8rpx; + font-size: 26rpx; } } } @@ -1448,15 +2101,23 @@ export default { width: 20rpx; height: 20rpx; } + .progressValue{ + font-size: 26rpx; + } + } + .progressItemTopRight{ + font-size: 26rpx; } } .progressItemBottom{ width: 100%; display: flex; align-items: center; - justify-content: space-between; + .progressItemBottomLeft{ + font-size: 26rpx; + } .progressItemBottomRight{ - width: 250rpx; + flex: 1; text-overflow: ellipsis; overflow: hidden; white-space: nowrap; diff --git a/pages/settlementApproval/index.vue b/pages/settlementApproval/index.vue index f1ecc9f..0e25354 100644 --- a/pages/settlementApproval/index.vue +++ b/pages/settlementApproval/index.vue @@ -132,7 +132,7 @@ import {wrapTreeNode} from "../../util/dateTime"; } }, onLoad(){ - this.startDate = this.$moment().subtract(1,'months').format('YYYY-MM') + this.startDate = this.$moment().startOf('year').format('YYYY-MM') this.endDate = this.$moment().subtract(1,'months').format('YYYY-MM') console.log('Store.state.userData',Store.state.userData) this.selectServiceList = Store.state.userData.serverPartList diff --git a/pages/settlementApproval/yearSettlement.vue b/pages/settlementApproval/yearSettlement.vue index 8fb70f4..ae773a6 100644 --- a/pages/settlementApproval/yearSettlement.vue +++ b/pages/settlementApproval/yearSettlement.vue @@ -429,6 +429,8 @@ export default { nextPersonValue:'',// 审核人的value showLabel:'',// 审核人名称 approveDesc:'',// 意见 + yearId:'',// 年度id + yearAfterData:[],// 年度精算之后的数据 } }, computed: { @@ -439,9 +441,16 @@ export default { if(query.obj){ this.detailObj = JSON.parse(query.obj) } + await this.handleGetYearSettlement() await this.handleGetSupplementList() await this.handleGetPersonList() + + // 判断是不是二次的申请 如果是要拿到新的结算数据 + if(query.yearId){ + this.yearId = query.yearId + await this.handleGetYearSettlementRight() + } }, methods:{ numeral, @@ -480,6 +489,24 @@ export default { }) } this.yearDataList = resList + console.log('this.yearDataList',this.yearDataList ) + uni.hideLoading() + }, + // 请求年度的精算数据 + async handleGetYearSettlementRight() { + const req = { + BUSINESSPROJECT_ID: this.detailObj.BUSINESSPROJECT_ID, + SHOPROYALTY_ID: this.detailObj.SHOPROYALTY_ID + } + uni.showLoading({ + title: '请求精算数据...' + }) + const data = await request.$webGet('EShangApiMain/Finance/GetProjectPeriodAccount',req) + let res = data.Result_Data + // 页面显示的结算数据 + let resList = wrapTreeNode(res.ProjectPeriodList) + console.log('resList222222', resList) + this.yearAfterData = resList uni.hideLoading() }, // 显示子级 @@ -657,16 +684,52 @@ export default { if(this.yearDataList && this.yearDataList.length>0){ let newList = [] let reqList = JSON.parse(JSON.stringify(this.yearDataList)) + console.log('reqList',reqList) + console.log('this.yearAfterData',this.yearAfterData) + if(this.yearAfterData && this.yearAfterData.length>0){ + reqList.forEach(item=>{ + this.yearAfterData.forEach(subItem=>{ + if(moment(item.EndDate).format('YYYY-MM-DD') === moment(subItem.EndDate).format('YYYY-MM-DD') && moment(item.StartDate).format('YYYY-MM-DD') === moment(subItem.StartDate).format('YYYY-MM-DD')){ + console.log(subItem) + item.RevenueConfirmId = subItem.RevenueConfirmId + } + }) + let childrenList = [] + if(this.yearAfterData && this.yearAfterData.length>0){ + let obj = this.yearAfterData[0] + if(obj.children && obj.children.length>0){ + childrenList = obj.children + } + } + if(item.children && item.children.length>0){ + if(childrenList && childrenList.length>0){ + item.children.forEach(subItem=>{ + childrenList.forEach(childrenItem=>{ + if(moment(childrenItem.EndDate).format('YYYY-MM-DD') === moment(subItem.EndDate).format('YYYY-MM-DD') && moment(childrenItem.StartDate).format('YYYY-MM-DD') === moment(subItem.StartDate).format('YYYY-MM-DD')){ + subItem.RevenueConfirmId = childrenItem.RevenueConfirmId + } + }) + }) + } + } + }) + } + + + console.log('reqList231231231',reqList) + reqList.forEach((item) => { if (item.PeriodIndex === resObj.PeriodIndex) { newList.push({ ...resObj, + RevenueConfirmId: item.RevenueConfirmId, children: item.children }) } else { newList.push(item) } }) + console.log('newList',newList) newList.forEach((item, index) => { if (item.children && item.children.length > 0) { @@ -682,6 +745,7 @@ export default { SERVERPARTSHOP_ID: this.detailObj.SERVERPARTSHOP_ID, BUSINESS_STARTDATE: subItem.StartDate, BUSINESS_ENDDATE: subItem.EndDate, + REVENUECONFIRM_ID: subItem.RevenueConfirmId, GUARANTEE_AMOUNT: subItem.MinturnOver, GUARANTEERATIO: subItem.GuaranteeRatio, ACTUAL_REVENUE: subItem.RevenueAmount, @@ -717,6 +781,7 @@ export default { BUSINESS_ENDDATE: item.EndDate, GUARANTEE_AMOUNT: item.MinturnOver, GUARANTEERATIO: item.GuaranteeRatio, + REVENUECONFIRM_ID: item.RevenueConfirmId, ACTUAL_REVENUE: item.RevenueAmount, PARTYA_SHAREPROFIT: item.RoyaltyTheory, PARTYB_SHAREPROFIT: item.SubroyaltyTheory, @@ -752,6 +817,7 @@ export default { GUARANTEE_AMOUNT: item.MinturnOver, GUARANTEERATIO: item.GuaranteeRatio, ACTUAL_REVENUE: item.RevenueAmount, + REVENUECONFIRM_ID: item.RevenueConfirmId, PARTYA_SHAREPROFIT: item.RoyaltyTheory, PARTYB_SHAREPROFIT: item.SubroyaltyTheory, LIQUIDATION_AMOUNT: item.RefundSupplement,