修改重新审核bug,选择固=时间去记账之后返回还是原本的时间和tab

This commit is contained in:
2023-11-06 17:31:48 +08:00
parent 340da8348f
commit afa3dedc05
3 changed files with 46 additions and 13 deletions

View File

@ -276,6 +276,7 @@ export default {
auditPhotoList:[],
supplierPhotoList:[],
index:'',//记录工单对账属于哪个状态
queryTime:'',//记录工单对账选择的时间
uploadedImage: null,
show:false,//是否显示弹框
imgId:'',//删除供应商图片的Id
@ -358,6 +359,8 @@ export default {
this.id=this.$route.params?.id;
this.postfix=this.$route.params?.postfix;
this.index=this.$route.params?.index;
this.queryTime = this.$route.params?.queryTime
// console.log(" this.queryTime", this.queryTime)
this.$nextTick(async ()=>{
await this.getDetail()
})
@ -395,7 +398,8 @@ export default {
this.$router.push({
name:"workOrderReconciliation",
params:{
activeIndex:this.index
activeIndex:this.index,
queryTime:this.queryTime
}
})
},
@ -566,7 +570,14 @@ export default {
if(res.code === 200){
this.$toast('操作成功')
setTimeout(()=>{
this.$router.back()
// this.$router.back()
this.$router.push({
name:"workOrderReconciliation",
params:{
activeIndex:this.index,
queryTime:this.queryTime
}
})
},2000)
}
this.loading = false;
@ -597,6 +608,7 @@ export default {
if(this.form.financePrice >= this.form.settleAmount){//服务商确认中道价格,且等于财务金额,则直接到审核完成
accountStatus = 4
}
this.form.accountStatus = accountStatus;
const formData = new FormData();
let obj = this.form;
Object.keys(obj).forEach((key) => {
@ -605,7 +617,7 @@ export default {
this.files.forEach((file) => {
formData.append('file', file.file);
});
formData.append('accountStatus', accountStatus);
// formData.append('accountStatus', accountStatus);
formData.append('state', 0);
formData.append('postfix', this.postfix);
formData.append('supplierBridgeAmount', parseInt(this.form.supplierBridgeAmountAb || 0) + parseInt(this.form.supplierBridgeAmountBc || 0) + parseInt(this.form.supplierBridgeAmountCa || 0));
@ -613,7 +625,14 @@ export default {
if(res.code === 200){
this.$toast('操作成功')
setTimeout(()=>{
this.$router.back()
// this.$router.back()
this.$router.push({
name:"workOrderReconciliation",
params:{
activeIndex:this.index,
queryTime:this.queryTime
}
})
},2000)
}
this.loading1 = false;

View File

@ -127,6 +127,7 @@ export default {
postfix:'',
orderInfo:{},
index:"",
queryTime:'',//记录工单对账选择的时间
serviceType:'',
settleType:'',
taskFlowId: '',
@ -161,6 +162,7 @@ export default {
this.id=this.$route.params?.id;
this.postfix=this.$route.params?.postfix;
this.index=this.$route.params?.index;
this.queryTime = this.$route.params?.queryTime
await this.getDetail()
},
methods: {
@ -169,6 +171,7 @@ export default {
name:"workOrderReconciliation",
params:{
activeIndex:this.index,
queryTime:this.queryTime
}
})
},

View File

@ -93,16 +93,18 @@ export default {
currentDate: new Date(),
ymTime: '',//默认显示时间为当年当月
isLoading:"",
permissonList:[]
permissonList:[],
time:'',//当页面已经跳转到其他页面时就用原本的时间,如果没有就用当前时间
}
},
mounted() {
async mounted() {
this.activeIndex=this.$route.params?.activeIndex || 0
this.queryType=this.$route.params?.queryType || this.queryType
this.initIndex()
this.initSelectTime();
this.getPermissions();
this.getList();
this.time = this.$route.params?.queryTime || this.queryTime
await this.initIndex()
await this.initSelectTime();
await this.getPermissions();
await this.getList();
},
computed:{
show() {
@ -130,7 +132,7 @@ export default {
pageNum:this.pageNum,
pageSize:this.pageSize,
queryType:this.queryType,
queryTime:this.queryTime
queryTime:this.time || this.queryTime,//当页面已经跳转到其他页面时就用原本的时间,如果没有就用当前时间
})
if(res.code === 200){
this.orderList = res.data;
@ -139,16 +141,18 @@ export default {
async getPermissions(){
let res = await userOperationPermissions();
this.permissonList = res.data
console.log("1122",this.permissonList)
// console.log("1122",this.permissonList)
// console.log('工单对账',this.permissonList.includes('supplierRecordOperation'))
},
handleAccounting(item){
console.log("item")
this.$router.push({
name: 'accountingView', // 目标路由的名称
params: {
id: item.id, // 参数对象的属性
postfix:item.postfix,
index:this.activeIndex
index:this.activeIndex,
queryTime:this.queryTime
}
});
},
@ -170,6 +174,7 @@ export default {
id: item.id, // 参数对象的属性
postfix:item.postfix,
index:this.activeIndex,
queryTime:this.queryTime
}
});
},
@ -188,6 +193,12 @@ export default {
const month = (this.currentDate.getMonth() + 1).toString().padStart(2, '0'); // 获取月份,需要注意月份从 0 开始,所以要加 1结果为 9
this.ymTime = year + '-' + month;
this.queryTime=timeFormat(new Date());
if(this.time){
const date = new Date(this.time);
const year = date.getFullYear(); // 获取年份,结果为 2023
const month = (date.getMonth() + 1).toString().padStart(2, '0'); // 获取月份,需要注意月份从 0 开始,所以要加 1结果为 9
this.ymTime = year + '-' + month
}
},
}
}