戴艳蓉 3 yıl önce
ebeveyn
işleme
199f5e26ca

+ 1 - 8
src/utils/validate.js

@@ -185,7 +185,7 @@ export function isWeixin(s) {
  * @param {*} s
  */
  export function isQQ(s) {
-  return /^[1-9][0-9]{4,14}$/.test(screenX)
+  return /^[1-9][0-9]{4,14}$/.test(s)
 }
 
 /**
@@ -248,13 +248,6 @@ export function isURL(s) {
   return /^http[s]?:\/\/.*/.test(s)
 }
 
-/**
- * 包含汉字
- * @param {*} s
- */
- export function hasChinese(s) {
-  return /[\u4E00-\u9FA5\uF900-\uFA2D]/.test(s)
-}
 /**
  * 汉语
  * @param {*} s

+ 22 - 2
src/views/serviceParam/business/addEdit.vue

@@ -328,11 +328,31 @@ export default {
     },
     contactRefresh(e) {
       this.editModel = false;
-      const { index } = e;
+      const {
+        index,
+        contactor,
+        commobile,
+        position,
+        comdepart,
+        wxaccount,
+        qqaccount,
+        email,
+        id,
+        is_del,
+      } = e;
       if (index + "" === "-1") {
         this.tableData.push(e);
       } else {
-        this.tableData[parseInt(index)] = JSON.parse(JSON.stringify(e));
+        let findex = parseInt(index);
+        this.tableData[findex].contactor = contactor || "";
+        this.tableData[findex].commobile = commobile || "";
+        this.tableData[findex].position = position || "";
+        this.tableData[findex].comdepart = comdepart || "";
+        this.tableData[findex].wxaccount = wxaccount || "";
+        this.tableData[findex].qqaccount = qqaccount || "";
+        this.tableData[findex].email = email || "";
+        this.tableData[findex].id = id || "";
+        this.tableData[findex].is_del = is_del || "0";
       }
     },
     async submitForm() {

+ 1 - 0
src/views/serviceParam/business/contactModal.vue

@@ -147,6 +147,7 @@ export default {
       if (value === "") {
         callback();
       } else {
+        console.log(value);
         if (!isQQ(value)) {
           callback(new Error("QQ号格式不正确!"));
         } else {