From 8ba602b2f08724c1b92ef1e90f89a6fa33861577 Mon Sep 17 00:00:00 2001
From: yangys <y_ys79@sina.com>
Date: 星期六, 30 八月 2025 11:52:31 +0800
Subject: [PATCH] 锁定加上锁定原因

---
 src/views/flowmgr/taskassign.vue |  120 ++++++++++++++++++++++++++++++++++++++++++++++++-----------
 1 files changed, 97 insertions(+), 23 deletions(-)

diff --git a/src/views/flowmgr/taskassign.vue b/src/views/flowmgr/taskassign.vue
index 604241c..eab0580 100644
--- a/src/views/flowmgr/taskassign.vue
+++ b/src/views/flowmgr/taskassign.vue
@@ -8,26 +8,40 @@
 -->
 <template>
   <basic-container>
-    <avue-form ref="form" :option="attachOption" v-model="attachForm" @submit="formSubmit"></avue-form>
+    <avue-form ref="form" :option="attachOption" v-model="attachForm" @submit="formSubmit" @blur="handleTrim"></avue-form>
   </basic-container>
 </template>
 
 <script>
+import {
+  getQueryString,
+} from '@/utils/util';
+
 export default {
   watch: {
     'attachForm.drawingNo': function (val) {
-      if(val && this.attachForm.processNo) {
-        this.attachForm.title = `${val}-${this.attachForm.processNo}-鏁版帶绋嬪簭缂栧埗`;
+      if(val && this.attachForm.processNo && this.attachForm.processEdition) {
+        this.attachForm.title = `${val}-${this.attachForm.processNo}-${this.attachForm.processEdition}-璁″垝浠诲姟`;
       }
     },
     'attachForm.processNo': function (val) {
-      if(val && this.attachForm.drawingNo) {
+      if(val && this.attachForm.drawingNo && this.attachForm.processEdition) {
         //this.attachForm.title = `${val}-${this.attachForm.processNo}-鏁版帶绋嬪簭缂栧埗`;
-		this.attachForm.title = `${this.attachForm.drawingNo}-${val}-鏁版帶绋嬪簭缂栧埗`;
+		    this.attachForm.title = `${this.attachForm.drawingNo}-${val}-${this.attachForm.processEdition}-璁″垝浠诲姟`;
+      }
+    },
+    'attachForm.processEdition': function (val) {
+      if(val && this.attachForm.drawingNo && this.attachForm.processNo ) {
+        //this.attachForm.title = `${val}-${this.attachForm.processNo}-鏁版帶绋嬪簭缂栧埗`;
+		    this.attachForm.title = `${this.attachForm.drawingNo}-${this.attachForm.processNo}-${val}-璁″垝浠诲姟`;
       }
     },
   },
   data() {
+    
+    var isTempFlow = getQueryString("isTempFlow");
+    isTempFlow = isTempFlow === 'Y'?'Y':'N';
+    
     var that = this;
     return {
       form: {},
@@ -43,15 +57,22 @@
             prop: 'title',
             type: 'input',
             span: 24,
+            disabled:true,
             dataType: 'string',
-            rules: [{ required: true, message: '蹇呭~', trigger: 'blur' }],
+            rules: [{ required: true, message: '蹇呭~'}],
+            blur: (col) => {
+              this.handleTrim(col)
+            }
           },
           {
-            label: '鍥惧彿',
+            label: '闆剁粍浠跺彿',
             prop: 'drawingNo',
             type: 'input',
             span: 12,
             dataType: 'string',
+            blur: (col) => {
+              this.handleTrim(col)
+            },
             rules: [{ required: true, message: '蹇呭~', trigger: 'blur' }],
           },
           {
@@ -61,6 +82,9 @@
             span: 12,
             dataType: 'string',
             rules: [{ required: true, message: '蹇呭~', trigger: 'blur' }],
+            blur: (col) => {
+              this.handleTrim(col)
+            },
           },
           {
             label: '浜у搧鍨嬪彿',
@@ -69,13 +93,9 @@
             span: 12,
             dataType: 'string',
             rules: [{ required: true, message: '蹇呭~', trigger: 'blur' }],
-            // rules: [
-            //   {
-            //     required: true,
-            //     message: '璇烽�夋嫨娴佺▼绫诲瀷',
-            //     trigger: 'blur',
-            //   },
-            // ],
+            blur: (col) => {
+              this.handleTrim(col)
+            },
           },
           {
             label: '宸ュ簭鍙�',
@@ -85,8 +105,10 @@
             step: 1,
             precision: 0,
             dataType: 'string',
-            max: 999,
             rules: [{ required: true, message: '蹇呭~', trigger: 'blur' }],
+            blur: (col) => {
+              this.handleTrim(col)
+            },
           },
           {
             label: '宸ュ簭鍚嶇О',
@@ -95,6 +117,9 @@
             span: 12,
             dataType: 'string',
             rules: [{ required: true, message: '蹇呭~', trigger: 'blur' }],
+            blur: (col) => {
+              this.handleTrim(col)
+            },
           },
           {
             label: '宸ュ簭鐗堟',
@@ -103,22 +128,28 @@
             span: 12,
             dataType: 'string',
             rules: [{ required: true, message: '蹇呭~', trigger: 'blur' }],
+            blur: (col) => {
+              this.handleTrim(col)
+            },
           },
           {
-            label: '宸ヨ壓鐗堟',
+            label: '鎵规鍙�',
             prop: 'craftEdition',
+            placeholder:'濡�"A"',
             type: 'input',
             span: 12,
             dataType: 'string',
-            maxlength: 2,
-            rules: [{ required: true, message: '蹇呭~', trigger: 'blur' }],
+            maxlength: 10,
+            blur: (col) => {
+              this.handleTrim(col)
+            },
           },
           {
             label: '鍔犲伐鏈哄簥',
             prop: 'machineCode',
             type: 'select',
-			filterable: true,
-            dicUrl: `/blade-mdm/machine/page`,
+			      filterable: true,
+            dicUrl: `/blade-mdm/machine/page?size=10000`,
             dicFormatter: function (res) {
               that.machineCodeList = res.data.records;
               return res.data.records;
@@ -133,9 +164,13 @@
           {
             label: '璁″垝閿佸畾鏃堕棿锛堝ぉ锛�',
             prop: 'planLockDays',
-            type: 'input',
+            type: 'number',
+            min:0,
+            max:30,
             span: 12,
+            controls:true,
             dataType: 'number',
+            controlsPosition:'right',
             rules: [{ required: true, message: '蹇呭~', trigger: 'blur' }],
           },
           {
@@ -154,14 +189,31 @@
             type: 'input',
             span: 12,
             dataType: 'string',
+            placeholder:'闈炲亸绂诲崟浠诲姟璇风暀绌�',
+            blur: (col) => {
+              this.handleTrim(col)
+            },
             // rules: [{ required: true, message: '蹇呭~', trigger: 'blur' }],
-          },
+          }
         ],
       },
-      attachForm: {},
+      attachForm: {planLockDays:7},//榛樿7澶�
     };
   },
   methods: {
+    
+    handleTrim(col){
+      //console.log(col)
+      let value = this.attachForm[col.column.prop];
+      if (typeof value === 'string') {
+            const trimmedValue = value.trim();
+            // 鍙湁褰撳�肩‘瀹炲彂鐢熷彉鍖栨椂鎵嶆洿鏂�
+            if (trimmedValue !== value) {
+                this.attachForm[col.column.prop] = trimmedValue;
+            }
+        }
+     // this.attachForm[col.column.prop]='dddd'
+    },
     formSubmit(form, done) {
       var form = { ...form };
       this.machineCodeList.forEach(item => {
@@ -188,6 +240,28 @@
           done();
         }
       );
+    },
+    handleGlobalBlur( {prop, value} ) {
+      console.log('prop')
+      // 1. 绛涢�夐渶瑕佸鐞嗙殑瀛楁绫诲瀷锛堜粎杈撳叆绫伙細input/textarea锛�
+      const inputTypes = ["input", "textarea"];
+      const currentColumn = this.attachOption.column.find(item => item.prop === prop);
+      
+      // 2. 鑻ヤ负杈撳叆绫诲瓧娈碉紝涓斿�间负瀛楃涓诧紝鎵ц trim 澶勭悊
+      if (currentColumn && inputTypes.includes(currentColumn.type) && typeof value === "string") {
+        const trimmedValue = value.trim();
+        // 3. 鍚屾澶勭悊鍚庣殑鍊煎埌琛ㄥ崟 model锛堥伩鍏嶇洿鎺ヤ慨鏀� prop锛岄�氳繃 $set 纭繚鍝嶅簲寮忥級
+        this.$set(this.attachForm, prop, trimmedValue);
+      }
+    },
+    handleBlur(prop, value) {
+        if (typeof value === 'string') {
+            const trimmedValue = value.trim();
+            // 鍙湁褰撳�肩‘瀹炲彂鐢熷彉鍖栨椂鎵嶆洿鏂�
+            if (trimmedValue !== value) {
+                this.attachForm[prop] = trimmedValue;
+            }
+        }
     }
   },
 };

--
Gitblit v1.9.3