From c863d53a225feffb018e35b4453c1e977eaeca81 Mon Sep 17 00:00:00 2001
From: zouyu <2723363702@qq.com>
Date: 星期一, 11 五月 2026 15:24:34 +0800
Subject: [PATCH] 不合格处理:对接OA报错问题修复

---
 .gitignore                                            |    1 
 src/views/business/unpass/components/unPassDialog.vue |   15 +--
 src/views/business/unpass/components/OAProcess.vue    |  114 +++++++++++++++++++++++++++
 src/views/business/unpass/index-manage.vue            |   63 ++++++++-------
 4 files changed, 152 insertions(+), 41 deletions(-)

diff --git a/.gitignore b/.gitignore
index 78a752d..2529fec 100644
--- a/.gitignore
+++ b/.gitignore
@@ -21,3 +21,4 @@
 
 package-lock.json
 yarn.lock
+.nvmdrc
diff --git a/src/views/business/unpass/components/OAProcess.vue b/src/views/business/unpass/components/OAProcess.vue
index 4becedd..7b4e8e6 100644
--- a/src/views/business/unpass/components/OAProcess.vue
+++ b/src/views/business/unpass/components/OAProcess.vue
@@ -11,7 +11,7 @@
       <el-timeline style="height: 80vh; overflow-y: scroll">
         <el-timeline-item
           placement="top"
-          v-for="node in nodes"
+          v-for="node in isOldData?oldNodes:newNodes"
           :key="node.id"
           :timestamp="node.name"
           :icon="node.hasData ? 'el-icon-check' : 'el-icon-time'"
@@ -52,12 +52,17 @@
       type: Boolean,
       default: () => false,
     },
+    isOldData:{
+      type: Boolean,
+      default: () => true,
+    }
   },
   data() {
     // 杩欓噷瀛樻斁鏁版嵁
     return {
       isShow: this.OAProcess,
-      nodes: [
+      //鏃ф祦绋嬭妭鐐�
+      oldNodes: [
         {
           id: 1,
           name: "1妫�楠屽憳",
@@ -140,6 +145,108 @@
           hasData: false,
         },
       ],
+      //鏂版祦绋嬭妭鐐�
+      newNodes:[
+        {
+          id: 1,
+          name: "1鐢宠",
+          info: "",
+          time: "",
+          operator: "",
+          operation: "",
+          hasData: false,
+        },
+        {
+          id: 2,
+          name: "2璐ㄩ噺閮ㄧ粡鐞�",
+          info: "",
+          time: "",
+          operator: "",
+          operation: "",
+          hasData: false,
+        },
+        {
+          id: 3,
+          name: "3宸ヨ壓锛堜竴绫讳笉鍚堟牸锛�",
+          info: "",
+          time: "",
+          operator: "",
+          operation: "",
+          hasData: false,
+        },
+        {
+          id: 4,
+          name: "3宸ヨ壓锛堜簩绫讳笉鍚堟牸锛�",
+          info: "",
+          time: "",
+          operator: "",
+          operation: "",
+          hasData: false,
+        },
+        {
+          id: 5,
+          name: "4鎶�鏈粡鐞嗭紙涓�绫讳笉鍚堟牸锛�",
+          info: "",
+          time: "",
+          operator: "",
+          operation: "",
+          hasData: false,
+        },
+        {
+          id: 6,
+          name: "4鎶�鏈粡鐞嗭紙浜岀被涓嶅悎鏍硷級",
+          info: "",
+          time: "",
+          operator: "",
+          operation: "",
+          hasData: false,
+        },
+        {
+          id: 7,
+          name: "5鏍哥畻锛堜竴绫讳笉鍚堟牸锛�",
+          info: "",
+          time: "",
+          operator: "",
+          operation: "",
+          hasData: false,
+        },
+        {
+          id: 8,
+          name: "5鎬荤粡鐞嗭紙浜岀被涓嶅悎鏍硷級",
+          info: "",
+          time: "",
+          operator: "",
+          operation: "",
+          hasData: false,
+        },
+        {
+          id: 9,
+          name: "6褰掓。锛堜竴绫讳笉鍚堟牸锛�",
+          info: "",
+          time: "",
+          operator: "",
+          operation: "",
+          hasData: false,
+        },
+        {
+          id: 10,
+          name: "6鏍哥畻锛堜簩绫讳笉鍚堟牸锛�",
+          info: "",
+          time: "",
+          operator: "",
+          operation: "",
+          hasData: false,
+        },
+        {
+          id: 11,
+          name: "7褰掓。锛堜簩绫讳笉鍚堟牸锛�",
+          info: "",
+          time: "",
+          operator: "",
+          operation: "",
+          hasData: false,
+        },
+      ]
     };
   },
   // 鏂规硶闆嗗悎
@@ -153,7 +260,8 @@
             const data = res.data;
             if (data.length > 0) {
               data.forEach((item) => {
-                const node = this.nodes.find((n) => n.name === item.nodeName);
+                const nodes = this.isOldData ? this.oldNodes : this.newNodes;
+                const node = nodes.find((n) => n.name === item.nodeName);
                 if (node) {
                   node.time = item.approvalDate + " " + item.approvalTime;
                   if(item.nodeName && item.nodeName==="1妫�楠屽憳"){
diff --git a/src/views/business/unpass/components/unPassDialog.vue b/src/views/business/unpass/components/unPassDialog.vue
index f9ee7ae..af51b98 100644
--- a/src/views/business/unpass/components/unPassDialog.vue
+++ b/src/views/business/unpass/components/unPassDialog.vue
@@ -14,9 +14,9 @@
           <el-form-item label="渚涘簲鍟嗗悕绉�:">
             <el-input clearable v-model="unPassForm.supplierName" disabled size="small" placeholder="璇疯緭鍏�"></el-input>
           </el-form-item>
-          <el-form-item label="鐗╂枡鍚嶇О:">
+          <el-form-item label="鐗╂枡鍚嶇О:" prop="materialName">
             <el-tooltip class="item" effect="dark" placement="top" :content="unPassForm.materialName">
-              <el-input clearable v-model="unPassForm.materialName" disabled size="small" placeholder="璇疯緭鍏�"></el-input>
+              <el-input clearable v-model="unPassForm.materialName" :disabled="type==='view'" size="small" placeholder="璇疯緭鍏�"></el-input>
             </el-tooltip>
           </el-form-item>
           <el-form-item label="鐢熶骇鎵规:">
@@ -42,7 +42,7 @@
             </el-date-picker>
           </el-form-item>
           <el-form-item label="鍒嗙被:" prop="classification">
-            <el-select v-model="unPassForm.classification" :disabled="type === 'view'" size="small" placeholder="璇烽�夋嫨">
+            <el-select v-model="unPassForm.classification" :disabled="type === 'view' || !unPassForm.id" size="small" placeholder="璇烽�夋嫨">
               <el-option v-for="item in classificationOptions" :key="item.value" :label="item.label"
                 :value="item.value">
               </el-option>
@@ -127,6 +127,9 @@
         ],
         headline: [
           { required: true, message: '璇峰~鍐欐爣棰�', trigger: 'blur' }
+        ],
+        materialName: [
+          { required: true, message: '璇峰~鍐欑墿鏂欏悕绉�', trigger: 'blur' }
         ]
       },
       unPassFilesList: [], // 涓嶅悎鏍煎鐞嗛檮浠舵暟鎹�
@@ -154,11 +157,7 @@
         }).then(res => {
           if (res.code === 200) {
             this.unPassForm.feedbackTime = new Date().toISOString().substring(0, 10) // 鎶ユ鏃堕棿
-            if(res.data.insOrder && res.data.insOrder.contract==='ZTNS'){
-              this.unPassForm.headline = `No.0005-涓ぉ鑰愪笣-澶栬喘鍝佷笉鍚堟牸鍙嶉璇勫鍙婄籂姝i闃叉祦绋�(姝e紡鐗�)-${this.nickName}-${this.unPassForm.feedbackTime}` // 鏍囬
-            }else{
-              this.unPassForm.headline = `No.0017-涓ぉ绉戞妧-澶栬喘鍝佷笉鍚堟牸鍙嶉璇勫鍙婄籂姝i闃叉祦绋�(姝e紡鐗�)-${this.nickName}-${this.unPassForm.feedbackTime}` // 鏍囬
-            }
+            this.unPassForm.headline = `No.0020-涓ぉ鑰愪笣-渚涘簲鍟嗚川閲忓紓甯稿弽棣堟祦绋�-${res.data.insOrderTemplate.supplierName}-${this.unPassForm.feedbackTime}` // 鏍囬
             this.unPassForm.feedbackUser = this.nickName // 鍙嶉浜�
             this.unPassForm.insOrderId = res.data.insOrder.id // 璁㈠崟id
             this.unPassForm.materialName = res.data.insOrder.sampleType // 鐗╂枡鍚嶇О
diff --git a/src/views/business/unpass/index-manage.vue b/src/views/business/unpass/index-manage.vue
index f2aa6c7..cb5d776 100644
--- a/src/views/business/unpass/index-manage.vue
+++ b/src/views/business/unpass/index-manage.vue
@@ -134,6 +134,7 @@
                   :unPassDialog="unPassDialog"></UnPassDialog>
     <OAProcess ref="OAProcess"
                :OAProcess="OAProcess"
+               :isOldData="isOldData"
                @closeOAProcess="closeOAProcess"
                v-if="OAProcess"></OAProcess>
   </div>
@@ -152,7 +153,7 @@
     OAProcess,
     UnPassDialog,
   },
-  dicts: ['material_prop_type','oa_workflow_state'],
+  dicts: ['material_prop_type','oa_workflow_state','categories_no_conformities','attribution_no_conformities'],
   data() {
     return {
       lotBatchNo:null,
@@ -385,22 +386,22 @@
           width: "100px",
           dataType: "tag",
           formatData: (params) => {
-            if (params == 0) {
-              return "涓�绫讳笉鍚堟牸";
-            } else if(params == 1) {
-              return "浜岀被涓嶅悎鏍�";
-            } else {
-              return null
-            }
+            let label = null
+            this.dict.type.categories_no_conformities.forEach(item=>{
+              if(item.raw.dictValue==params){
+                label = item.raw.dictLabel
+              }
+            })
+            return label
           },
           formatType: (params) => {
-            if (params == 0) {
-              return "warning";
-            } else if(params == 1) {
-              return "info";
-            } else {
-              return "null";
-            }
+            let type = null
+            this.dict.type.categories_no_conformities.forEach(item=>{
+              if(item.raw.dictValue==params){
+                type =  item.raw.listClass
+              }
+            })
+            return type
           },
         },
         { label: '渚涘簲鍟嗙紪鐮�', prop: 'supplierId',width:'140' },
@@ -411,22 +412,22 @@
           width: "120px",
           dataType: "tag",
           formatData: (params) => {
-            if (params == 0) {
-              return "妫�娴嬩笉鍚堟牸";
-            } else if(params == 1) {
-              return "鐢熶骇鍙嶉涓嶅悎鏍�";
-            } else {
-              return null
-            }
+            let label = params
+            this.dict.type.attribution_no_conformities.forEach(item=>{
+              if(item.raw.dictValue==params){
+                label = item.raw.dictLabel
+              }
+            })
+            return label
           },
           formatType: (params) => {
-            if (params == 0) {
-              return "danger";
-            } else if(params == 1) {
-              return "warning";
-            } else {
-              return "null";
-            }
+            let type = null
+            this.dict.type.attribution_no_conformities.forEach(item=>{
+              if(item.raw.dictValue==params){
+                type = item.raw.listClass
+              }
+            })
+            return type
           },
         },
         { label: '涓嶅悎鏍兼弿杩�', prop: 'unqualifiedDesc',width: "160px" },
@@ -481,7 +482,8 @@
       submitOALoading: false, // OA娴佺▼寮规鎻愪氦鎸夐挳loading
       deleteVisible: false, // OA娴佺▼鍒犻櫎寮规
       cancelOALoading: false, // OA娴佺▼鍒犻櫎寮规鎻愪氦鎸夐挳loading
-      exportLoading:false
+      exportLoading:false,
+      isOldData: true,//鏄惁鏄棫鏁版嵁
     };
   },
   mounted() {
@@ -668,6 +670,7 @@
     // 鏌ョ湅OA娴佺▼
     OAView (row) {
       this.OAProcess = true
+      this.isOldData = row.isOldData
       this.$nextTick(() => {
         this.$refs.OAProcess.getInfo(row.handlerId,row?row.unqualifiedDesc:"")
       })

--
Gitblit v1.9.3