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": "结算审批"
}
},
{
"path": "yearSettlement",
"style":
{
"navigationBarTitleText": "年度结算"
}
}
]
},

View File

@ -49,7 +49,7 @@
<view class="detailRow">
<view class="detailItem">
<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 class="detailItem">
<span class="label">项目期数</span>
@ -78,7 +78,7 @@
</view>
<!-- 结算的表格数据-->
<view class="tableBox">
<view class="tableBox" v-if="detailObj.SETTLEMENT_TYPE!==1">
<view class="smallTitle">{{ detailObj.Approvalstate>0?'精算数据':'结算数据' }}</view>
<view class="tableRow">
@ -140,6 +140,134 @@
</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">
@ -420,6 +548,7 @@
</view>
</view>
</UniPop>
</view>
</template>
<script>
@ -427,6 +556,8 @@ import request from '@/util/index.js'
import UniPop from '@/components/uni-popup.vue'
import Store from "../../store/store";
import {mapGetters} from "vuex";
import {wrapTreeNode} from "../../util/dateTime";
import numeral from "numeral";
export default {
name: "detail",
components: {UniPop},
@ -467,7 +598,9 @@ export default {
lastMonthIsOver: false,//
LastSettlementMonth: '',//
isShowSelect: false,//
yearDataList:[],//
isAllMonthSuccess: true,//
allYearMonthDataList:[]//
}
},
async onLoad(query){
@ -483,12 +616,136 @@ export default {
await this.handleGetDetailDifference()
await this.handleGetActuaryData()
await this.handleGetProgress()
//
if(this.detailObj.SETTLEMENT_TYPE===1){
await this.handleGetYearSettlement()
}
},
onUnload(){
this.closePop()
this.closeApplyFor()
this.closeShowSelect()
},
computed: {
...mapGetters({'users':'getUser'}),
},
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){
console.log('e',e)
@ -649,35 +906,58 @@ export default {
this.isShowSelect = false
},
//
handleShowApplyForPop(){
async handleShowApplyForPop(){
let _this = this
if (this.lastMonthIsOver) {
this.isShowApplyFor = true
}else{
uni.showModal({
title: '系统检测',
content: `${this.detailObj.SERVERPART_NAME}-${this.detailObj.SERVERPARTSHOP_NAME},项目期数内存在未审批月度结算!点击确定自动为您调整到${this.LastSettlementMonth}月进行审批?`,
success: function (res) {
if (res.confirm) {
uni.setStorageSync('handleGetNewMonth','true')
uni.setStorageSync('handleGetNewMonthObj',_this.detailObj)
uni.setStorageSync('handleGetNewMonthTime',_this.LastSettlementMonth)
uni.navigateBack({
delta: 1
});
} else if (res.cancel) {
uni.navigateBack({
delta: 1
});
if(this.detailObj.SETTLEMENT_TYPE===2){
//
if (this.lastMonthIsOver) {
this.isShowApplyFor = true
}else{
uni.showModal({
title: '系统检测',
content: `${this.detailObj.SERVERPART_NAME}-${this.detailObj.SERVERPARTSHOP_NAME},项目期数内存在未审批月度结算!点击确定自动为您调整到${this.LastSettlementMonth}月进行审批?`,
success: function (res) {
if (res.confirm) {
uni.setStorageSync('handleGetNewMonth','true')
uni.setStorageSync('handleGetNewMonthObj',_this.detailObj)
uni.setStorageSync('handleGetNewMonthTime',_this.LastSettlementMonth)
uni.navigateBack({
delta: 1
});
} else if (res.cancel) {
// uni.navigateBack({
// 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(){
this.isShowApplyFor = false
},
//
async handleGetDetailDifference(){
const req = {
@ -816,7 +1096,11 @@ export default {
approveedStaffName: Store.state.userData.UserName,
nextId: this.nextPersonValue
}
data = await request.$webGet('EShangApiMain/Finance/ApproveMonthAccountProinst', req)
if (this.detailObj.SETTLEMENT_TYPE === 2) {
data = await request.$webGet('EShangApiMain/Finance/ApproveMonthAccountProinst', req)
}else{
data = await request.$webGet('EShangApiMain/Finance/ApproveAccountProinst', req)
}
console.log('data',data)
}else if(type===2){
if(!this.rejectSelectValue){
@ -845,7 +1129,11 @@ export default {
approveedInfo: this.approveDesc,
targetProinstState: this.rejectSelectValue.APPROVALROUTE_STATE
}
data = await request.$webGet('EShangApiMain/Finance/RejectMonthAccountProinst', req)
if (this.detailObj.SETTLEMENT_TYPE === 2) {
data = await request.$webGet('EShangApiMain/Finance/RejectMonthAccountProinst', req)
}else{
data = await request.$webGet('EShangApiMain/Finance/RejectAccountProinst', req)
}
console.log('data',data)
}
uni.hideLoading()
@ -991,6 +1279,13 @@ export default {
font-weight: 600;
margin-bottom: 16rpx;
}
.line{
height: 2rpx;
width: 100%;
background-color: #eee;
margin-bottom: 18rpx;
margin-top: 16rpx;
}
.rowItemBox{
display: flex;
.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{
@ -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>

View File

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

File diff suppressed because it is too large Load Diff