This commit is contained in:
cclu 2024-07-24 20:12:01 +08:00
parent 123acdb8c9
commit 6e1eead1b2
4 changed files with 1505 additions and 29 deletions

View File

@ -98,6 +98,13 @@
{ {
"navigationBarTitleText": "结算审批" "navigationBarTitleText": "结算审批"
} }
},
{
"path": "yearSettlement",
"style":
{
"navigationBarTitleText": "年度结算"
}
} }
] ]
}, },

View File

@ -49,7 +49,7 @@
<view class="detailRow"> <view class="detailRow">
<view class="detailItem"> <view class="detailItem">
<span class="label">结算模式</span> <span class="label">结算模式</span>
<span class="value">{{detailObj.BUSINESS_TYPE?SETTLEMENT_MODESObj[detailObj.BUSINESS_TYPE] : ''}}</span> <span class="value">{{detailObj.SETTLEMENT_MODES?SETTLEMENT_MODESObj[detailObj.SETTLEMENT_MODES] : ''}}</span>
</view> </view>
<view class="detailItem"> <view class="detailItem">
<span class="label">项目期数</span> <span class="label">项目期数</span>
@ -78,7 +78,7 @@
</view> </view>
<!-- 结算的表格数据--> <!-- 结算的表格数据-->
<view class="tableBox"> <view class="tableBox" v-if="detailObj.SETTLEMENT_TYPE!==1">
<view class="smallTitle">{{ detailObj.Approvalstate>0?'精算数据':'结算数据' }}</view> <view class="smallTitle">{{ detailObj.Approvalstate>0?'精算数据':'结算数据' }}</view>
<view class="tableRow"> <view class="tableRow">
@ -140,6 +140,134 @@
</view> </view>
</view> </view>
<!-- 年度的结算数据-->
<view class="tableBox" v-if="detailObj.SETTLEMENT_TYPE===1">
<view class="smallTitle">{{ detailObj.Approvalstate>0?'精算数据':'结算数据' }}</view>
<view class="tableRow" v-for="(item,index) in yearDataList" :key="index">
<view class="rowItemBox">
<view class="rowItem" style="width: 60%">
<span class="label">期限</span>
<span class="value">{{item.PeriodDesc ||''}}</span>
</view>
<view class="rowItem" style="width: 40%">
<span class="label">结算状态</span>
<span class="value" :style="{color: detailObj.Approvalstate>0?'#faad14':'#1890ff'}">{{detailObj.Approvalstate>0?'已结算':'待结算'}}</span>
</view>
</view>
<view class="rowItemBox">
<view class="rowItem">
<span class="label">现金</span>
<span class="value">{{item.CashAmount?numeral($util.getMoney(item.CashAmount)).format('0,0.00'):''}}</span>
</view>
<view class="rowItem">
<span class="label">微支付</span>
<span class="value">{{item.MobilePayAmount?numeral($util.getMoney(item.MobilePayAmount)).format('0,0.00'):''}}</span>
</view>
</view>
<view class="rowItemBox">
<view class="rowItem">
<span class="label">营业额合计</span>
<span class="value">{{item.RevenueAmount?numeral($util.getMoney(item.RevenueAmount)).format('0,0.00'):''}}</span>
</view>
<view class="rowItem">
<span class="label">驿达收款</span>
<span class="value">{{item.RoyaltyAmount?numeral($util.getMoney(item.RoyaltyAmount)).format('0,0.00'):''}}</span>
</view>
</view>
<view class="rowItemBox">
<view class="rowItem">
<span class="label">营收费用合计</span>
<span class="value">{{item.ReceivableAmount?numeral($util.getMoney(item.ReceivableAmount)).format('0,0.00'):''}}</span>
</view>
<view class="rowItem">
<span class="label">租金</span>
<span class="value">{{item.GuaranteeFee?numeral($util.getMoney(item.GuaranteeFee)).format('0,0.00'):''}}</span>
</view>
</view>
<view class="rowItemBox">
<view class="rowItem">
<span class="label">退补款</span>
<span class="value">{{item.RefundSupplement?numeral($util.getMoney(item.RefundSupplement)).format('0,0.00'):''}}</span>
</view>
<view class="rowItem">
<span class="label"></span>
<span class="value"></span>
</view>
</view>
<view class="getMoreBox" v-if="item.children && item.children.length>0" @click="handleShowChildren(item)">
<image class="imgIcon" :style="{transform: item.children?'rotate(90deg)':'rotate(-90deg)'}" src="https://eshangtech.com/ShopICO/ahyd-BID/newIndex3/goMore.svg"/>
</view>
<view v-if="item.children && item.children.length>0 && item.showChildren">
<view class="line"></view>
<view v-for="(subItem,subIndex) in item.children" :key="subIndex" style="padding-left: 32rpx">
<view class="rowItemBox">
<view class="rowItem" style="width: 60%">
<span class="label">期限</span>
<span class="value">{{subItem.PeriodDesc ||''}}</span>
</view>
<view class="rowItem" style="width: 40%">
<span class="label">结算状态</span>
<span class="value" :style="{color: subItem.IsApplySuccess?'#faad14':'#1890ff'}">{{subItem.IsApplySuccess?'已结算':'待结算'}}</span>
</view>
</view>
<view class="rowItemBox">
<view class="rowItem">
<span class="label">现金</span>
<span class="value">{{subItem.CashAmount?numeral($util.getMoney(subItem.CashAmount)).format('0,0.00'):''}}</span>
</view>
<view class="rowItem">
<span class="label">微支付</span>
<span class="value">{{subItem.MobilePayAmount?numeral($util.getMoney(subItem.MobilePayAmount)).format('0,0.00'):''}}</span>
</view>
</view>
<view class="rowItemBox">
<view class="rowItem">
<span class="label">营业额合计</span>
<span class="value">{{subItem.RevenueAmount?numeral($util.getMoney(subItem.RevenueAmount)).format('0,0.00'):''}}</span>
</view>
<view class="rowItem">
<span class="label">驿达收款</span>
<span class="value">{{subItem.RoyaltyAmount?numeral($util.getMoney(subItem.RoyaltyAmount)).format('0,0.00'):''}}</span>
</view>
</view>
<view class="rowItemBox">
<view class="rowItem">
<span class="label">营收费用合计</span>
<span class="value">{{subItem.ReceivableAmount?numeral($util.getMoney(subItem.ReceivableAmount)).format('0,0.00'):''}}</span>
</view>
<view class="rowItem">
<span class="label">租金</span>
<span class="value">{{subItem.GuaranteeFee?numeral($util.getMoney(subItem.GuaranteeFee)).format('0,0.00'):''}}</span>
</view>
</view>
<view class="rowItemBox">
<view class="rowItem">
<span class="label">退补款</span>
<span class="value">{{subItem.RefundSupplement?numeral($util.getMoney(subItem.RefundSupplement)).format('0,0.00'):''}}</span>
</view>
<view class="rowItem">
<span class="label"></span>
<span class="value"></span>
</view>
</view>
<view class="line" v-if="subIndex!==item.children.length-1"></view>
</view>
</view>
<view class="line" v-if="index!==yearDataList.length-1"></view>
</view>
</view>
<!-- 按钮--> <!-- 按钮-->
<view class="btnBox"> <view class="btnBox">
@ -420,6 +548,7 @@
</view> </view>
</view> </view>
</UniPop> </UniPop>
</view> </view>
</template> </template>
<script> <script>
@ -427,6 +556,8 @@ import request from '@/util/index.js'
import UniPop from '@/components/uni-popup.vue' import UniPop from '@/components/uni-popup.vue'
import Store from "../../store/store"; import Store from "../../store/store";
import {mapGetters} from "vuex"; import {mapGetters} from "vuex";
import {wrapTreeNode} from "../../util/dateTime";
import numeral from "numeral";
export default { export default {
name: "detail", name: "detail",
components: {UniPop}, components: {UniPop},
@ -467,7 +598,9 @@ export default {
lastMonthIsOver: false,// lastMonthIsOver: false,//
LastSettlementMonth: '',// LastSettlementMonth: '',//
isShowSelect: false,// isShowSelect: false,//
yearDataList:[],//
isAllMonthSuccess: true,//
allYearMonthDataList:[]//
} }
}, },
async onLoad(query){ async onLoad(query){
@ -483,12 +616,136 @@ export default {
await this.handleGetDetailDifference() await this.handleGetDetailDifference()
await this.handleGetActuaryData() await this.handleGetActuaryData()
await this.handleGetProgress() await this.handleGetProgress()
//
if(this.detailObj.SETTLEMENT_TYPE===1){
await this.handleGetYearSettlement()
}
},
onUnload(){
this.closePop()
this.closeApplyFor()
this.closeShowSelect()
}, },
computed: { computed: {
...mapGetters({'users':'getUser'}), ...mapGetters({'users':'getUser'}),
}, },
methods:{ methods:{
numeral,
//
async handleGetYearSettlement(){
const req = {
BUSINESSPROJECT_ID: this.detailObj.BUSINESSPROJECT_ID,
SHOPROYALTY_ID: this.detailObj.SHOPROYALTY_ID
}
uni.showLoading({
title: '请求数据...'
})
const data = await request.$webGet('EShangApiMain/Finance/GetReconciliation',req)
let res = data.Result_Data.List[0]
console.log('res',res)
//
let resList = wrapTreeNode(res.ProjectPeriodList.children)
if(resList && resList.length>0){
resList.forEach(item=>{
item.level = 1
if(item.children && item.children.length>0){
item.showChildren = false
item.children.forEach(subItem=>{
subItem.level = 2
})
}
})
}
this.yearDataList = resList
console.log('this',this.yearDataList)
//
let other = res.ProjectPeriodList.node
let isContinue = true
if(!other.AllowApply){
isContinue = false
}
this.isAllMonthSuccess = isContinue
let list = wrapTreeNode([res.ProjectPeriodList.children[0]])
this.allYearMonthDataList = list
console.log('list',list)
uni.hideLoading()
},
//
handleShowChildren(obj){
let list = JSON.parse(JSON.stringify(this.yearDataList))
list.forEach(item=>{
if(item.ShopRoyalty_Id === obj.ShopRoyalty_Id && item.PeriodIndex === obj.PeriodIndex){
item.showChildren = !item.showChildren
}
})
this.yearDataList = list
},
//
async handleSuccessAllMonth(list){
uni.showLoading({
title: '正在自动月度结算...'
})
let ShopRoyaltyIdStr = ''
let minStartTime = ''
let maxEndTime = ''
console.log('list',list)
if(list && list.length>0){
//
list.forEach((item,index)=>{
if (index === 0) {
minStartTime = this.$moment(item.StartDate).format('YYYY-MM-DD')
maxEndTime = this.$moment(item.EndDate).format('YYYY-MM-DD')
}else{
if (new Date(minStartTime).getTime() > new Date(this.$moment(item.StartDate).format('YYYY-MM-DD')).getTime()) {
minStartTime = this.$moment(item.StartDate).format('YYYY-MM-DD')
}
if (new Date(maxEndTime).getTime() < new Date(this.$moment(item.EndDate).format('YYYY-MM-DD')).getTime()) {
maxEndTime = this.$moment(item.EndDate).format('YYYY-MM-DD')
}
}
if (ShopRoyaltyIdStr) {
ShopRoyaltyIdStr += `,${item.ShopRoyalty_Id}`
} else {
ShopRoyaltyIdStr = `${item.ShopRoyalty_Id}`
}
})
//
const monthReq = {
ProjectId: this.detailObj.BUSINESSPROJECT_ID,
ShopRoyaltyId: ShopRoyaltyIdStr,
StartMonth: minStartTime ? this.$moment(minStartTime).format('YYYYMM') : '',
EndMonth: maxEndTime ? this.$moment(maxEndTime).format('YYYYMM') : '',
}
console.log('monthReq',monthReq)
const monthData = await request.$webGet('EShangApiMain/Finance/ApprovePeriodAccount',monthReq)
uni.hideLoading()
console.log('monthData',monthData)
if (monthData.Result_Code === 100) {
uni.showToast({
title: monthData.Result_Desc,
icon:'success',
duration: 1000
});
//
await this.handleGetYearSettlement()
//
this.handleShowApplyForPop()
}else{
uni.showToast({
title: monthData.Result_Desc,
icon:'error',
duration: 1000
});
}
}
},
// //
handleChangePerson(e){ handleChangePerson(e){
console.log('e',e) console.log('e',e)
@ -649,8 +906,10 @@ export default {
this.isShowSelect = false this.isShowSelect = false
}, },
// //
handleShowApplyForPop(){ async handleShowApplyForPop(){
let _this = this let _this = this
if(this.detailObj.SETTLEMENT_TYPE===2){
//
if (this.lastMonthIsOver) { if (this.lastMonthIsOver) {
this.isShowApplyFor = true this.isShowApplyFor = true
}else{ }else{
@ -666,18 +925,39 @@ export default {
delta: 1 delta: 1
}); });
} else if (res.cancel) { } else if (res.cancel) {
uni.navigateBack({ // uni.navigateBack({
delta: 1 // delta: 1
}); // });
} }
} }
}); });
} }
}else{
//
if(this.isAllMonthSuccess){
//
this.handleGoYearSettlementPage()
}else{
uni.showModal({
content:'请先完成全部月度结算! 点击确认将自动进行结算!',
success: async function (res) {
if (res.confirm) {
_this.handleSuccessAllMonth(_this.yearDataList)
}
}
})
}
}
},
//
handleGoYearSettlementPage(){
this.$util.toNextRoute('navigateTo', `/pages/settlementApproval/yearSettlement?obj=${JSON.stringify(this.detailObj)}`)
}, },
// //
closeApplyFor(){ closeApplyFor(){
this.isShowApplyFor = false this.isShowApplyFor = false
}, },
// //
async handleGetDetailDifference(){ async handleGetDetailDifference(){
const req = { const req = {
@ -816,7 +1096,11 @@ export default {
approveedStaffName: Store.state.userData.UserName, approveedStaffName: Store.state.userData.UserName,
nextId: this.nextPersonValue nextId: this.nextPersonValue
} }
if (this.detailObj.SETTLEMENT_TYPE === 2) {
data = await request.$webGet('EShangApiMain/Finance/ApproveMonthAccountProinst', req) data = await request.$webGet('EShangApiMain/Finance/ApproveMonthAccountProinst', req)
}else{
data = await request.$webGet('EShangApiMain/Finance/ApproveAccountProinst', req)
}
console.log('data',data) console.log('data',data)
}else if(type===2){ }else if(type===2){
if(!this.rejectSelectValue){ if(!this.rejectSelectValue){
@ -845,7 +1129,11 @@ export default {
approveedInfo: this.approveDesc, approveedInfo: this.approveDesc,
targetProinstState: this.rejectSelectValue.APPROVALROUTE_STATE targetProinstState: this.rejectSelectValue.APPROVALROUTE_STATE
} }
if (this.detailObj.SETTLEMENT_TYPE === 2) {
data = await request.$webGet('EShangApiMain/Finance/RejectMonthAccountProinst', req) data = await request.$webGet('EShangApiMain/Finance/RejectMonthAccountProinst', req)
}else{
data = await request.$webGet('EShangApiMain/Finance/RejectAccountProinst', req)
}
console.log('data',data) console.log('data',data)
} }
uni.hideLoading() uni.hideLoading()
@ -991,6 +1279,13 @@ export default {
font-weight: 600; font-weight: 600;
margin-bottom: 16rpx; margin-bottom: 16rpx;
} }
.line{
height: 2rpx;
width: 100%;
background-color: #eee;
margin-bottom: 18rpx;
margin-top: 16rpx;
}
.rowItemBox{ .rowItemBox{
display: flex; display: flex;
.allRowItem{ .allRowItem{
@ -1016,6 +1311,18 @@ export default {
} }
} }
} }
.getMoreBox{
width: 100%;
display: flex;
align-items: center;
justify-content: center;
.imgIcon{
width: 50rpx;
height: 32rpx;
border-radius: 50%;
transform: rotate(90deg);
}
}
} }
.btnBox{ .btnBox{
@ -1286,6 +1593,7 @@ export default {
} }
} }
} }
} }
} }
@ -1402,5 +1710,77 @@ export default {
} }
} }
} }
.uniPopupYearApplyFor{
width: calc(100vw - 140rpx);
height: 480px;
box-sizing: border-box;
padding: 32rpx 0;
.uniPopupTop{
width: 100%;
display: flex;
align-items: center;
justify-content: space-between;
.uniPopupTitle{
font-family: PingFangSC, PingFang SC;
font-weight: 600;
font-size: 32rpx;
color: #160002;
line-height: 44rpx;
text-align: left;
font-style: normal;
}
.close{
width: 40rpx;
height: 40rpx;
}
}
.detailBoxApplyFor{
.smallTitle{
font-size: 26rpx;
font-weight: 600;
margin-bottom: 16rpx;
}
.tableRow{
.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;
}
}
.rowItemSpecial{
display: flex;
justify-content: flex-start;
.label{
color: #ADB2BF;
font-size: 26rpx;
}
.value{
font-size: 26rpx;
}
}
}
}
}
}
} }
</style> </style>

View File

@ -63,7 +63,7 @@
<view class="filterBox"> <view class="filterBox">
<view class="filterTitle">统计时间</view> <view class="filterTitle">统计时间</view>
<view class="filterTimeBox"> <view class="filterTimeBox">
<picker class="timeSelect" mode="date" fields="month" :value="$moment(startDate).format('YYYY-MM')" :start="'2024-01-01'" :end="end" @change="handleGetStartTime">{{startDate}}</picker> <picker class="timeSelect" mode="date" fields="month" :value="$moment(startDate).format('YYYY-MM')" :start="'2023-01-01'" :end="end" @change="handleGetStartTime">{{startDate}}</picker>
<span class="timeSelect" style="margin: 0 4rpx">-</span> <span class="timeSelect" style="margin: 0 4rpx">-</span>
<picker class="timeSelect" mode="date" fields="month" :value="$moment(endDate).format('YYYY-MM')" :start="start" :end="end" @change="handleGetEndTime">{{endDate}}</picker> <picker class="timeSelect" mode="date" fields="month" :value="$moment(endDate).format('YYYY-MM')" :start="start" :end="end" @change="handleGetEndTime">{{endDate}}</picker>
</view> </view>
@ -227,7 +227,6 @@ import {wrapTreeNode} from "../../util/dateTime";
// //
closePop(){ closePop(){
this.showPop = false this.showPop = false
}, },
// //
handleGetStartTime(e){ handleGetStartTime(e){
@ -280,7 +279,6 @@ import {wrapTreeNode} from "../../util/dateTime";
if(data.Result_Data.TotalCount < 10){ if(data.Result_Data.TotalCount < 10){
this.isEnd = true this.isEnd = true
} }
uni.hideLoading() uni.hideLoading()
}, },
// //

File diff suppressed because it is too large Load Diff