Kaynağa Gözat

提交合同管理

Lijy 2 yıl önce
ebeveyn
işleme
6a840c70e7

+ 18 - 8
fhKeeper/formulahousekeeper/timesheet/src/views/contract/index.vue

@@ -685,17 +685,27 @@ export default {
       })
     },
     lookover(row){
-      // console.log('lookover',row);
+      console.log('lookover',row);
       if(this.user.userNameNeedTranslate == 1) {
         let obj = {name: '',text: ''}
-        if(row.msg.indexOf('$userName=') != '-1') {
-          let str = row.msg.split('$userName=')[1]
-          let arr = str.split('$')
-          obj.name = arr[0]
-          obj.text = arr[1]
-        } else {
-          obj.text = row.msg
+
+        if (row.msg) {
+          let match = row.msg.match(/\$userName=(.*?)\$(.*)/);
+          if (match) {
+            obj.name = match[1];
+            obj.text = match[2];
+          } else {
+            obj.text = row.msg;
+          }
         }
+        // if(row.msg.indexOf('$userName=') != '-1') {
+        //   let str = row.msg.split('$userName=')[1]
+        //   let arr = str.split('$')
+        //   obj.name = arr[0]
+        //   obj.text = arr[1]
+        // } else {
+        //   obj.text = row.msg
+        // }
         row.msg = obj
         this.contractForm = row
       } else {