From 4b221581b1d7b6c22e86af4e12c363ef482898c8 Mon Sep 17 00:00:00 2001 From: WXL (wul) <wl_5969728@163.com> Date: 星期三, 20 八月 2025 17:37:38 +0800 Subject: [PATCH] 随访详情及控制台错误优化 --- src/views/followvisit/record/detailpage/index.vue | 74 +++++++++++++++++++----------------- 1 files changed, 39 insertions(+), 35 deletions(-) diff --git a/src/views/followvisit/record/detailpage/index.vue b/src/views/followvisit/record/detailpage/index.vue index ab859d4..0e292ce 100644 --- a/src/views/followvisit/record/detailpage/index.vue +++ b/src/views/followvisit/record/detailpage/index.vue @@ -587,7 +587,7 @@ 瀹屾暣璇煶锛� <mini-audio :audio-source=" - voice ? voice : 'https://example.com/example.mp3' + voice ? voice : '@assets/order/example.mp3' " ></mini-audio> </div> @@ -611,7 +611,7 @@ :audio-source=" item.questionvoice ? item.questionvoice - : 'https://example.com/example.mp3' + : '@assets/order/example.mp3' " ></mini-audio> </div> @@ -1239,7 +1239,7 @@ }) .catch(() => { if (this.form.serviceType == 13) { - if (this.visitCount) { + if (this.visitCount!=1) { this.$router.push({ path: "/logisticsservice/zbAgain", }); @@ -1249,7 +1249,7 @@ }); } } else if (this.form.serviceType == 2) { - if (this.visitCount) { + if (this.visitCount!=1) { this.$router.push({ path: "/logisticsservice/again", }); @@ -1267,41 +1267,41 @@ }); }, // 楠岃瘉鐢佃瘽鍙风爜鏍煎紡骞惰繑鍥為敊璇俊鎭� -validatePhoneNumber(phone) { - if (!phone) { - return { isValid: false, message: '璇疯緭鍏ョ數璇濆彿鐮�' }; - } + validatePhoneNumber(phone) { + if (!phone) { + return { isValid: false, message: "璇疯緭鍏ョ數璇濆彿鐮�" }; + } - // 鎵嬫満鍙锋鍒� - const mobileRegex = /^1[3-9]\d{9}$/; + // 鎵嬫満鍙锋鍒� + const mobileRegex = /^1[3-9]\d{9}$/; - // 甯﹀尯鍙风殑鍥哄畾鐢佃瘽锛堝畬鏁存牸寮忥級 - const landlineFullRegex = /^0\d{2,3}-?\d{7,8}$/; + // 甯﹀尯鍙风殑鍥哄畾鐢佃瘽锛堝畬鏁存牸寮忥級 + const landlineFullRegex = /^0\d{2,3}-?\d{7,8}$/; - // 涓嶅甫鍖哄彿鐨勫浐瀹氱數璇濓紙浠呮湰鍦板彿鐮侊級 - const landlineLocalRegex = /^\d{7,8}$/; + // 涓嶅甫鍖哄彿鐨勫浐瀹氱數璇濓紙浠呮湰鍦板彿鐮侊級 + const landlineLocalRegex = /^\d{7,8}$/; - if (mobileRegex.test(phone)) { - return { isValid: true, type: 'mobile' }; - } else if (landlineFullRegex.test(phone)) { - return { isValid: true, type: 'landline' }; - } else if (landlineLocalRegex.test(phone)) { - return { - isValid: false, - message: '鏈湴鍙风爜璇锋坊鍔犲尯鍙凤紙濡�028-1234567锛�' - }; - } else { - return { - isValid: false, - message: '璇疯緭鍏ユ纭殑鐢佃瘽鍙风爜锛堟墜鏈哄彿鎴栧甫鍖哄彿鐨勫浐瀹氱數璇濓級' - }; - } -}, + if (mobileRegex.test(phone)) { + return { isValid: true, type: "mobile" }; + } else if (landlineFullRegex.test(phone)) { + return { isValid: true, type: "landline" }; + } else if (landlineLocalRegex.test(phone)) { + return { + isValid: false, + message: "鏈湴鍙风爜璇锋坊鍔犲尯鍙凤紙濡�028-1234567锛�", + }; + } else { + return { + isValid: false, + message: "璇疯緭鍏ユ纭殑鐢佃瘽鍙风爜锛堟墜鏈哄彿鎴栧甫鍖哄彿鐨勫浐瀹氱數璇濓級", + }; + } + }, -// 浣跨敤绀轰緥 -isValidPhone(phone) { - return this.validatePhoneNumber(phone).isValid; -}, + // 浣跨敤绀轰緥 + isValidPhone(phone) { + return this.validatePhoneNumber(phone).isValid; + }, handleCall(phone, type) { if (!this.isValidPhone(phone)) { this.$message.error("璇疯緭鍏ユ纭殑鎵嬫満鍙风爜"); @@ -1324,7 +1324,7 @@ // 澶勭悊閫氳瘽鐘舵�佸彉鍖� handleCallStatusChange(status) { - console.log(status,'status'); + console.log(status, "status"); this.callStatus = status.type; @@ -1597,6 +1597,10 @@ setupsubtask() { this.$refs["zcform"].validate((valid) => { if (valid) { + if (this.form.date1 && new Date(this.form.date1) < new Date()) { + this.$message.error("闅忚鏃堕棿涓嶈兘灏忎簬褰撳墠鏃堕棿"); + return false; + } this.form.remark = this.form.remark + "銆�" + this.getCurrentTime() + "銆�"; let form = structuredClone(this.form); -- Gitblit v1.9.3