CRM_25-12-23#story#7473,服务商系统、调度APP新增服务商人员确认

This commit is contained in:
2025-12-17 21:53:36 +08:00
parent 1a567dee57
commit 0fc9be28d1

View File

@@ -27,7 +27,8 @@
<span v-else-if="type==4">当前信息已确认如需调整请联系区域经理</span> <span v-else-if="type==4">当前信息已确认如需调整请联系区域经理</span>
</div> </div>
<van-loading v-show="personList.length<=0" class="loadingWrap" type="spinner" color="#1989fa" /> <van-loading v-show="personList.length<=0" class="loadingWrap" type="spinner" color="#1989fa" />
<div class="contentWrap" v-show="personList.length>0"> <div class="contentWrap" v-show="personList.length>0"
:style="{'height':[1,2].includes(type) ? 'calc(100% - 160px)' : 'calc(100% - 90px)'}">
<div class="itemWrap" v-for="(item,index) in personList" :key="index"> <div class="itemWrap" v-for="(item,index) in personList" :key="index">
<div class="opaCol">人员{{(index+1)}}:</div> <div class="opaCol">人员{{(index+1)}}:</div>
<div class="line"></div> <div class="line"></div>
@@ -70,7 +71,7 @@
</div> </div>
</div> </div>
</div> </div>
<div class="btnWrap"> <div class="btnWrap" v-if="[1,2].includes(type)">
<div v-show="type==2" class="audit common" @click="auditHandle">提交审批</div> <div v-show="type==2" class="audit common" @click="auditHandle">提交审批</div>
<div v-show="type==1" class="revise common" @click="reviseHandle">立即修改</div> <div v-show="type==1" class="revise common" @click="reviseHandle">立即修改</div>
<div v-show="type==1" class="confirm common" @click="confirmHandle">确认信息无误</div> <div v-show="type==1" class="confirm common" @click="confirmHandle">确认信息无误</div>
@@ -86,7 +87,7 @@
<script> <script>
import {myMixins} from "@/utils/myMixins" import {myMixins} from "@/utils/myMixins"
import {getConfirmPerson,getConfirmStatus,getQrCode,confirmAddWechat,confirm} from "@/api/authentication"; import {getConfirmPerson,getConfirmStatus,getQrCode,confirmAddWechat,confirm,submitConfirm} from "@/api/authentication";
import { Dialog } from 'vant'; import { Dialog } from 'vant';
export default { export default {
name: "personList", name: "personList",
@@ -107,10 +108,10 @@ export default {
async mounted() { async mounted() {
window.addEventListener('message', (event) => { window.addEventListener('message', (event) => {
if (event.data === 'dialogClosed') { if (event.data === 'dialogClosed') {
console.log('Dialog 已关闭 // 执行关闭后的逻辑'); // console.log('Dialog 已关闭 // 执行关闭后的逻辑');
} }
}); });
console.log('isWebFunc()',this.isWebFunc()) // console.log('isWebFunc()',this.isWebFunc())
const urlParams = new URLSearchParams(window.location.search); const urlParams = new URLSearchParams(window.location.search);
this.id=this.$route.query.id || urlParams.get('id'); this.id=this.$route.query.id || urlParams.get('id');
this.supplierId=1128 || this.$route.query.supplierId || urlParams.get('supplierId'); this.supplierId=1128 || this.$route.query.supplierId || urlParams.get('supplierId');
@@ -120,14 +121,14 @@ export default {
blurHandle(e){ blurHandle(e){
let val= e.target.value || '' let val= e.target.value || ''
let flag=this.validatePhone(val) let flag=this.validatePhone(val)
console.log('flag',flag) // console.log('flag',flag)
if(!flag){ if(!flag){
this.$toast('手机号格式不正确') this.$toast('手机号格式不正确')
} }
}, },
validatePhone(val) { validatePhone(val) {
if(!val){ if(!val){
return return true
} }
const purePhone = val.replace(/\s|-/g, ''); const purePhone = val.replace(/\s|-/g, '');
// 情况111位且1开头 → 合法 // 情况111位且1开头 → 合法
@@ -143,16 +144,14 @@ export default {
}, },
async getPersonList(){ async getPersonList(){
let result=await getConfirmStatus({supplierId:this.supplierId}) let result=await getConfirmStatus({supplierId:this.supplierId})
if(!result.data?.wechatConfirmStatus || result.data?.wechatConfirmStatus==1){
this.type=1
}
if(result.data?.wechatConfirmStatus==2){ if(result.data?.wechatConfirmStatus==2){
this.type=3 this.type=3
} }else if(result.data?.wechatConfirmStatus==3){
if(result.data?.wechatConfirmStatus==3){
this.type=4 this.type=4
}else if(!result.data?.wechatConfirmStatus || result.data?.wechatConfirmStatus==1){
this.type=1
} }
this.type=2 this.type=1
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
@@ -173,8 +172,8 @@ export default {
this.personInfoId='' this.personInfoId=''
}, },
async wechatRevise(item,index){ async wechatRevise(item,index){
console.log('index',index) // console.log('index',index)
console.log('item',item) // console.log('item',item)
this.personInfoId=item.id this.personInfoId=item.id
this.reviseIndex=index this.reviseIndex=index
await this.getCode() await this.getCode()
@@ -193,11 +192,16 @@ export default {
} }
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)) let phone2Flag= this.personList.every(item => item.phone2 && this.validatePhone(item.phone2))
console.log('phone1Flag',phone1Flag) // console.log('phone1Flag',phone1Flag)
console.log('phone2Flag',phone2Flag) // console.log('phone2Flag',phone2Flag)
if(!flag){ if(!phone1Flag || !phone2Flag){
this.$toast('手机号格式不正确') return
} }
await submitConfirm({supplierId:this.supplierId,infos:this.personList})
this.$toast('操作成功')
setTimeout(()=>{
this.goBack();
},2000)
}, },
async reviseHandle(){//修改 async reviseHandle(){//修改
this.type=2 this.type=2
@@ -209,7 +213,7 @@ export default {
cancelButtonText:'返回', cancelButtonText:'返回',
confirmButtonColor:'#354E93', confirmButtonColor:'#354E93',
}).then(async() => { }).then(async() => {
console.log('确认无误') // console.log('确认无误')
await confirm({supplierId:this.supplierId}) await confirm({supplierId:this.supplierId})
setTimeout(() => { setTimeout(() => {
this.goBack() this.goBack()
@@ -297,12 +301,13 @@ export default {
}*/ }*/
.loadingWrap{ .loadingWrap{
width: 100%; width: 100%;
height: calc(100% - 160px); height: calc(100% - 90px);
text-align: center; text-align: center;
line-height: 200px; line-height: 200px;
} }
.contentWrap{ .contentWrap{
height: calc(100% - 160px); //height: calc(100% - 160px);
//height: calc(100% - 90px);//没有按钮时
overflow-y: auto; overflow-y: auto;
.itemWrap{ .itemWrap{
font-size: 14px; font-size: 14px;