人员确认添加二次弹框

This commit is contained in:
2025-12-29 19:04:58 +08:00
parent 64b2099c8b
commit 0732fdcb8e

View File

@@ -97,6 +97,7 @@ export default {
supplierId:'', supplierId:'',
wechatInfo:'', wechatInfo:'',
personInfoId:'', personInfoId:'',
personInfo:'',
isMaster:false, isMaster:false,
} }
}, },
@@ -150,7 +151,7 @@ export default {
this.type=1 this.type=1
} }
this.isMaster=result.data.isMaster this.isMaster=result.data.isMaster
// this.type=1 // this.type=2
let res=await getConfirmPerson({supplierId:this.supplierId}) let res=await getConfirmPerson({supplierId:this.supplierId})
if(res.data && res.data.length>0){ if(res.data && res.data.length>0){
this.personList=res.data this.personList=res.data
@@ -159,10 +160,26 @@ export default {
} }
}, },
async wechatConfirm(){//确认已添加微信按钮 async wechatConfirm(){//确认已添加微信按钮
Dialog.confirm({
message:'请确认相关人员是否已添加该二维码。',
confirmButtonText:'确认',
cancelButtonText:'取消',
confirmButtonColor:'#354E93',
}).then(async() => {
let res=await confirmAddWechat({supplierId:this.supplierId,supplierPersonInfoId:this.personInfoId}) let res=await confirmAddWechat({supplierId:this.supplierId,supplierPersonInfoId:this.personInfoId})
console.log('res',this.personInfo,res.data?.name,this.personInfo.wechatName)
if(res.data?.name == this.personInfo.wechatName){
this.$set(this.personList[this.reviseIndex],'isChange',false)
}else {
this.$set(this.personList[this.reviseIndex],'isChange',true)
}
this.personList[this.reviseIndex].wechatId=res.data?.externalUserId this.personList[this.reviseIndex].wechatId=res.data?.externalUserId
this.personList[this.reviseIndex].wechatName=res.data?.name this.personList[this.reviseIndex].wechatName=res.data?.name
await this.cancelHandle() await this.cancelHandle()
}).catch(async () => {
await this.cancelHandle()
});
}, },
cancelHandle(){ cancelHandle(){
this.dialogShow=false this.dialogShow=false
@@ -171,10 +188,11 @@ export default {
this.personInfoId='' this.personInfoId=''
}, },
async wechatRevise(item,index){ async wechatRevise(item,index){
// console.log('index',index) console.log('item,index',item,index)
// console.log('item',item) // console.log('item',item)
this.personInfoId=item.id this.personInfoId=item.id
this.reviseIndex=index this.reviseIndex=index
this.personInfo=item
await this.getCode() await this.getCode()
this.dialogShow=true this.dialogShow=true
}, },
@@ -189,6 +207,13 @@ export default {
this.$toast('必填项不可为空') this.$toast('必填项不可为空')
return return
} }
console.log('----',this.personList)
let flagRevise=this.personList.some(item => 'isChange' in item && !item.isChange)
console.log('存在未修改',flagRevise)
if(flagRevise){
this.$toast('您仍未修改微信号,请先修改再提交审批。')
return
}
let phone1Flag= this.personList.every(item => this.validatePhone(item.phone1)) let phone1Flag= this.personList.every(item => this.validatePhone(item.phone1))
let phone2Flag= this.personList.every(item => (item.phone2 && this.validatePhone(item.phone2) || !item.phone2)) let phone2Flag= this.personList.every(item => (item.phone2 && this.validatePhone(item.phone2) || !item.phone2))
console.log('phone1Flag',phone1Flag) console.log('phone1Flag',phone1Flag)
@@ -246,6 +271,10 @@ export default {
.van-dialog__content{ .van-dialog__content{
text-align: center !important; text-align: center !important;
} }
.van-dialog__header {
box-sizing: border-box;
padding: 12px;
}
} }
</style> </style>
<style scoped lang="scss"> <style scoped lang="scss">