Commit dfcad55f by zhangzhen

结算单功能完善

parent b73bd5b7
...@@ -164,7 +164,7 @@ export const save = (data,Detail) => { ...@@ -164,7 +164,7 @@ export const save = (data,Detail) => {
} }
export const updateSubmitStatus = (data) => { export const updateSubmitStatus = (data) => {
let url = `/service/S_XS_KK_03` let url = `/service/S_XS_JS_08`
let d = setResultData(data); let d = setResultData(data);
return http.post(url, d) return http.post(url, d)
} }
......
...@@ -390,7 +390,7 @@ ...@@ -390,7 +390,7 @@
console.log(val) console.log(val)
let ids = '' let ids = ''
if(this.formList.length){ if(this.formList.length){
ids = this.formList.filter(item => Number(item.selectIndex) === val).map(item=> item.id).join(); ids = this.formList.filter(item => Number(item.selectIndex) === val).map(item=> item.rowId).join();
} }
uni.navigateTo({ uni.navigateTo({
...@@ -576,7 +576,7 @@ ...@@ -576,7 +576,7 @@
cumulativeSettlementTax:this.orderInfo.cumulativeSettlementTax.toString(), cumulativeSettlementTax:this.orderInfo.cumulativeSettlementTax.toString(),
cumulativePriceTax:this.orderInfo.cumulativePriceTax.toString(), cumulativePriceTax:this.orderInfo.cumulativePriceTax.toString(),
},).then(res => { },formList).then(res => {
uni.hideLoading(); uni.hideLoading();
if (res.data.__sys__.status === 0) { if (res.data.__sys__.status === 0) {
uni.showToast({ uni.showToast({
......
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
<text class="text-lg text-bold text-black">详情</text> <text class="text-lg text-bold text-black">详情</text>
</view> </view>
<view class="form-content-box margin-bottom"> <view class="form-content-box margin-bottom">
<form> <form v-if="orderInfo">
<view class="cu-form-group"> <view class="cu-form-group">
<view class="title"> <view class="title">
<text>项目名称:</text> <text>项目名称:</text>
...@@ -193,7 +193,7 @@ ...@@ -193,7 +193,7 @@
<view class="flex-row header"> <view class="flex-row header">
<text class="text-lg text-bold text-black">结算清单</text> <text class="text-lg text-bold text-black">结算清单</text>
</view> </view>
<view class="form-content-box margin-bottom"> <view class="form-content-box">
<view v-for="(item,k) in subList" :key="k" class="sub-item-box"> <view v-for="(item,k) in subList" :key="k" class="sub-item-box">
<form class="item-form"> <form class="item-form">
<view class="cu-form-group"> <view class="cu-form-group">
...@@ -317,10 +317,7 @@ ...@@ -317,10 +317,7 @@
<text>{{item.createdDate}}</text> <text>{{item.createdDate}}</text>
</view> </view>
</view> </view>
</form> </form>
</view> </view>
</view> </view>
<view v-if="subList.length <= 0" class="empty-box"> <view v-if="subList.length <= 0" class="empty-box">
...@@ -337,6 +334,22 @@ ...@@ -337,6 +334,22 @@
@confirm="onConfirm" @close="onCancel"></u-calendar> @confirm="onConfirm" @close="onCancel"></u-calendar>
<u-modal :show="show" title="提示" :content='content' :showCancelButton="true" @confirm="onSave" <u-modal :show="show" title="提示" :content='content' :showCancelButton="true" @confirm="onSave"
@cancel="onCancel" :asyncClose="true"></u-modal> @cancel="onCancel" :asyncClose="true"></u-modal>
<uni-popup ref="popup" type="center">
<view class="pop-content">
<view class="close-box">
<text class="text-title">请选择</text>
<text class="cuIcon-close text-black" @tap="onClose"></text>
</view>
<view class="flex-col btn-box-list">
<button class="cu-btn bg-blue" @tap="onNavToSelectList(1)">合同</button>
<button v-if="['1','2'].includes(contractInfo.contractType)" class="cu-btn bg-blue" @tap="onNavToSelectList(3)">签证单</button>
<button v-if="contractInfo.contractType == '2'" class="cu-btn bg-blue" @tap="onNavToSelectList(2)">扣款单</button>
</view>
</view>
</uni-popup>
</view> </view>
</template> </template>
...@@ -350,7 +363,7 @@ ...@@ -350,7 +363,7 @@
import { import {
getParamsData getParamsData
} from "@/api/product-warehousing.js"; } from "@/api/product-warehousing.js";
import { getList,getSubList,saveSubList,save,getProList2 } from "@/api/settlement-doc.js"; import { getList,getSubList,saveSubList,save,getProList2,updateSubmitStatus } from "@/api/settlement-doc.js";
export default { export default {
data() { data() {
...@@ -362,7 +375,7 @@ ...@@ -362,7 +375,7 @@
minDate: moment().subtract(2, 'M').format("YYYY-MM-DD"), minDate: moment().subtract(2, 'M').format("YYYY-MM-DD"),
content: "请确认是否进行审核操作?", content: "请确认是否进行审核操作?",
statusBarHeight: uni.getStorageSync("statusHeight") || 0, statusBarHeight: uni.getStorageSync("statusHeight") || 0,
orderInfo: {}, orderInfo: '',
id: '', id: '',
submitStatusEnum:{ submitStatusEnum:{
3:'已提交', 3:'已提交',
...@@ -379,7 +392,10 @@ ...@@ -379,7 +392,10 @@
taxPointsList:[], taxPointsList:[],
taxPointsIndex:-1, taxPointsIndex:-1,
settlementTypeList:[], settlementTypeList:[],
settlementTypeIndex:-1 settlementTypeIndex:-1,
contractInfo:{
contractType: '1'
}
}; };
}, },
onLoad(option) { onLoad(option) {
...@@ -435,7 +451,7 @@ ...@@ -435,7 +451,7 @@
if(Number(this.orderInfo.taxPoints) > 0){ if(Number(this.orderInfo.taxPoints) > 0){
this.orderInfo.thisPriceTax =(num*(1+Number(this.orderInfo.taxPoints)/100)).toFixed(2); //含税金额 this.orderInfo.thisPriceTax =(num*(1+Number(this.orderInfo.taxPoints)/100)).toFixed(2); //含税金额
this.orderInfo.cumulativePriceTax = this.orderInfo.thisPriceTax; // 累计含税金额 this.orderInfo.cumulativePriceTax = this.orderInfo.thisPriceTax; // 累计含税金额
this.orderInfo.thisSettlementTax = this.orderInfo.thisPriceTax - num; // 税额 this.orderInfo.thisSettlementTax = (this.orderInfo.thisPriceTax - num).toFixed(2); // 税额
this.orderInfo.cumulativeSettlementTax = this.orderInfo.thisSettlementTax; // 累计税额 this.orderInfo.cumulativeSettlementTax = this.orderInfo.thisSettlementTax; // 累计税额
} }
...@@ -450,18 +466,7 @@ ...@@ -450,18 +466,7 @@
this.content = '请确认是否进行数据保存操作?' this.content = '请确认是否进行数据保存操作?'
this.show = true this.show = true
}else{ }else{
this.isEdit = true; this.isEdit = true;
if(this.orderInfo.taxPoints){
this.taxPointsIndex = this.taxPointsList.findIndex(item => item.value == this.orderInfo.taxPoints)
}
if(this.orderInfo.settlementType){
this.settlementTypeIndex = this.settlementTypeList.findIndex(item => item.value == this.orderInfo.settlementType)
}
if(this.orderInfo.priceTaxSeparation){
this.priceTaxSeparationIndex = this.priceTaxSeparationList.findIndex(item => item.value == this.orderInfo.priceTaxSeparation)
}
this.subList = this.subList.map(item => { this.subList = this.subList.map(item => {
return { return {
...item, ...item,
...@@ -493,31 +498,16 @@ ...@@ -493,31 +498,16 @@
}, },
onSave() { onSave() {
this.show = false; this.show = false;
uni.showLoading({
title: "加载中..."
})
if(this.submitType ==3){ if(this.submitType ==3){
saveSubList(this.subList).then(res => { this.onUpdateAndSave()
uni.hideLoading();
if (res.data.__sys__.status === 0) {
save(this.orderInfo,this.subList).then(res2 => {
if (res2.data.__sys__.status === 0){
uni.showToast({
icon: "success",
title: "提交成功"
})
setTimeout(() => {
this.onGetList();
}, 1500)
}
})
}
})
} else { } else {
uni.showLoading({
title: "加载中..."
})
updateSubmitStatus({ updateSubmitStatus({
...this.orderInfo, ...this.orderInfo,
reviewStatus:3, reviewStatus:3,
signingDate: moment(this.orderInfo.signingDate).format("YYYYMMDD") contractDate: moment(this.orderInfo.contractDate).format("YYYYMMDD")
}).then(res => { }).then(res => {
uni.hideLoading(); uni.hideLoading();
if (res.data.__sys__.status === 0) { if (res.data.__sys__.status === 0) {
...@@ -526,7 +516,7 @@ ...@@ -526,7 +516,7 @@
title: "提交成功" title: "提交成功"
}) })
setTimeout(() => { setTimeout(() => {
this.onBack(); this.getList();
}, 1500) }, 1500)
} }
}) })
...@@ -587,6 +577,17 @@ ...@@ -587,6 +577,17 @@
contractDate: moment(list[0].contractDate).format("YYYY-MM-DD"), contractDate: moment(list[0].contractDate).format("YYYY-MM-DD"),
signingDate: moment(list[0].signingDate).format("YYYY-MM-DD") signingDate: moment(list[0].signingDate).format("YYYY-MM-DD")
} }
if(this.orderInfo.taxPoints){
this.taxPointsIndex = this.taxPointsList.findIndex(item => item.value == this.orderInfo.taxPoints)
}
if(this.orderInfo.settlementType){
this.settlementTypeIndex = this.settlementTypeList.findIndex(item => item.value == this.orderInfo.settlementType)
}
if(this.orderInfo.priceTaxSeparation){
this.priceTaxSeparationIndex = this.priceTaxSeparationList.findIndex(item => item.value == this.orderInfo.priceTaxSeparation)
}
this.onGetSubList() this.onGetSubList()
} }
...@@ -615,24 +616,7 @@ ...@@ -615,24 +616,7 @@
} }
}) })
}, },
onOpenCheck () {
if(this.isEdit){
uni.showToast({
icon:"none",
title:"请将数据保存后操作"
})
return
}
getProList2({
contractNumber: this.orderInfo.contractNumber
}).then(res => {
console.log(res,99999)
})
},
onNavToSelect() { onNavToSelect() {
let checkedId = ''; let checkedId = '';
if(this.subList.length){ if(this.subList.length){
checkedId = this.subList.filter(item => item.isEdit)?.map(item => item.id).join(); checkedId = this.subList.filter(item => item.isEdit)?.map(item => item.id).join();
...@@ -656,6 +640,118 @@ ...@@ -656,6 +640,118 @@
} }
} }
}) })
},
onOpenCheck () {
if(this.isEdit){
uni.showToast({
icon:"none",
title:"请将数据保存后操作"
})
return
}
getProList2({
contractNumber: this.orderInfo.contractNumber
}).then(res => {
console.log(res,99999)
if(res.data.__sys__.status === 0){
let list = toJsonData(res.data.__blocks__.result.rows, res.data.__blocks__.result.meta.columns);
if(list.length && list.length ==1){
this.contractInfo = list[0];
this.$refs.popup.open();
}
}
})
},
onClose(){
this.$refs.popup.close();
},
onNavToSelectList(val) {
console.log(val)
let ids = ''
if(this.subList.length){
ids = this.subList.filter(item => Number(item.selectIndex) === val && item.isEdit).map(item=> item.id).join();
}
this.onClose();
uni.navigateTo({
url: `/pages/settlement-doc/select-list?selectIndex=${val}&contractNumber=${this.contractInfo.contractNumber}&contractType=${this.contractInfo.contractType}&ids=${ids}`,
events: {
acceptDataFromOpenedPage2: (data) => {
console.log(data)
if(data){
this.isEdit = true;
this.subList.push({
...data,
isEdit: true
});
this.$forceUpdate();
this.onCalculatePrice();
}
}
}
})
},
onUpdateAndSave() {
this.show = false;
uni.showLoading({
title: "加载中..."
})
let list = this.subList.filter(item => !item.id);
let formData = {
...this.orderInfo,
projCode: this.orderInfo.projCode,
projName: this.orderInfo.projName,
contractNumber: this.orderInfo.contractNumber,
contractName: this.orderInfo.contractName,
settlementNumber: '',
settlementType: this.settlementTypeList[this.settlementTypeIndex].value,
taxPoints:this.taxPointsList[this.taxPointsIndex].value,
priceTaxSeparation:this.priceTaxSeparationList[this.priceTaxSeparationIndex].value,
contractDate:this.orderInfo.contractDate,
thisSettlementAmount:this.orderInfo.thisSettlementAmount.toString(),
thisSettlementTax:this.orderInfo.thisSettlementTax.toString(),
thisPriceTax:this.orderInfo.thisPriceTax.toString(),
totalContractPrice:this.orderInfo.totalContractPrice,
cumulativeSettlementAmount:this.orderInfo.cumulativeSettlementAmount.toString(),
cumulativeSettlementTax:this.orderInfo.cumulativeSettlementTax.toString(),
cumulativePriceTax:this.orderInfo.cumulativePriceTax.toString(),
}
if(list.length){
saveSubList(list).then(res => {
if(res.data.__sys__.status === 0){
let formList = toJsonData(res.data.__blocks__.detail1.rows, res.data.__blocks__.detail1.meta.columns);
this.onUpdateMainData(formData,formList)
}
})
} else {
let formList = this.subList.map(item =>{
return {
...item,
unitPrice: item.unitPrice.toString(),
totalPrice: item.totalPrice.toString()
}
})
this.onUpdateMainData(formData,formList)
}
},
onUpdateMainData (formData,list){
save(formData,list).then(res => {
uni.hideLoading();
if (res.data.__sys__.status === 0) {
uni.showToast({
icon: "success",
title: "提交成功"
})
setTimeout(() => {
this.isEdit = false;
this.onGetList();
}, 1500)
}
})
} }
} }
} }
...@@ -855,7 +951,7 @@ ...@@ -855,7 +951,7 @@
display: flex; display: flex;
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;
width: 100%;
.header { .header {
display: flex; display: flex;
flex-direction: row; flex-direction: row;
...@@ -871,13 +967,14 @@ ...@@ -871,13 +967,14 @@
} }
.form-content-box { .form-content-box {
display: flex;
flex-direction: column;
align-items: center;
width: 100%; width: 100%;
padding: 12upx 0; padding: 12upx 0;
border-radius: 4upx; border-radius: 4upx;
// box-shadow: 0 0 8upx rgba(0, 0, 0, 0.34); // box-shadow: 0 0 8upx rgba(0, 0, 0, 0.34);
background-color: #ffffff; background-color: #ffffff;
.cu-form-group { .cu-form-group {
height: 32px; height: 32px;
min-height: 32px; min-height: 32px;
...@@ -982,6 +1079,7 @@ ...@@ -982,6 +1079,7 @@
} }
.content-part-2 { .content-part-2 {
margin-bottom: 120upx;
.form-content-box { .form-content-box {
display: flex; display: flex;
background-color: transparent; background-color: transparent;
...@@ -1000,7 +1098,7 @@ ...@@ -1000,7 +1098,7 @@
border-radius: 12upx; border-radius: 12upx;
background-color: #ffffff; background-color: #ffffff;
box-shadow: 0 4upx 6upx rgba(0, 0, 0, 0.34); box-shadow: 0 4upx 6upx rgba(0, 0, 0, 0.34);
margin-bottom: 120upx; margin-bottom: 24upx;
} }
.form-item-label { .form-item-label {
...@@ -1022,4 +1120,33 @@ ...@@ -1022,4 +1120,33 @@
align-items: center; align-items: center;
padding: 0 24upx; padding: 0 24upx;
} }
.pop-content{
display: flex;
flex-direction: column;
background-color: #ffffff;
width: 60vw;
padding: 24upx 30upx;
border-radius: 12upx;
box-shadow: rgba(0, 0, 0, 0.34);
.close-box{
display: flex;
justify-content: space-between;
margin-bottom: 24upx;
align-items: center;
.text-title{
color: #333333;
font-size: 36upx;
font-weight: bold;
}
.text-black{
font-size: 52upx;
}
}
.btn-box-list{
.cu-btn{
height: 80upx;
margin: 16upx 0;
}
}
}
</style> </style>
\ No newline at end of file
...@@ -217,7 +217,7 @@ ...@@ -217,7 +217,7 @@
let thisEngineeringQuantity = this.projectDataList[this.current].provisionalQuantity || 1 let thisEngineeringQuantity = this.projectDataList[this.current].provisionalQuantity || 1
this.eventChannel.emit('acceptDataFromOpenedPage2', { this.eventChannel.emit('acceptDataFromOpenedPage2', {
id: this.projectDataList[this.current].id, rowId: this.projectDataList[this.current].id,
settlementBasis:this.selectTypeEnum[this.selectIndex], settlementBasis:this.selectTypeEnum[this.selectIndex],
taskName:'', taskName:'',
engineeringContent:"", engineeringContent:"",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment