This commit is contained in:
cclu 2024-07-25 20:17:25 +08:00
parent 6e1eead1b2
commit 3beb65aad0
3 changed files with 872 additions and 145 deletions

File diff suppressed because it is too large Load Diff

View File

@ -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

View File

@ -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,