From 1085f3fffcdc0afd9f140490f9d0078a8426667c Mon Sep 17 00:00:00 2001
From: zouyu <2723363702@qq.com>
Date: 星期二, 03 二月 2026 13:27:30 +0800
Subject: [PATCH] 不合格管理:问题调整

---
 src/views/business/unpass/index-manage.vue |  201 ++++++++++++++++++++++++++++++++++++++------------
 1 files changed, 152 insertions(+), 49 deletions(-)

diff --git a/src/views/business/unpass/index-manage.vue b/src/views/business/unpass/index-manage.vue
index fc5ac30..76b32c0 100644
--- a/src/views/business/unpass/index-manage.vue
+++ b/src/views/business/unpass/index-manage.vue
@@ -3,6 +3,12 @@
     <div class="search">
       <div>
         <el-form :model="entity" ref="entity" size="small" :inline="true">
+          <el-form-item label="IFS鍩�" prop="contract">
+            <el-select @keyup.enter.native="refreshTable" v-model="entity.contract" clearable placeholder="璇烽�夋嫨" size="small">
+              <el-option label="ZTNS" value="ZTNS"/>
+              <el-option label="KJNS" value="KJNS"/>
+            </el-select>
+          </el-form-item>
           <el-form-item label="鎵瑰彿" prop="updateBatchNo">
             <el-input v-model="entity.updateBatchNo" clearable placeholder="璇疯緭鍏�" size="small"
                       @keyup.enter.native="refreshTable()">
@@ -12,17 +18,48 @@
             <el-input size="small" placeholder="璇疯緭鍏�" clearable v-model="entity.no"
                       @keyup.enter.native="refreshTable()"></el-input>
           </el-form-item>
-          <el-form-item label="瑙勬牸鍨嬪彿" prop="model">
-            <el-input size="small" placeholder="璇疯緭鍏�" clearable v-model="entity.model"
+          <el-form-item label="瑙勬牸鍨嬪彿" prop="specsModels">
+            <el-input size="small" placeholder="璇疯緭鍏�" clearable v-model="entity.specsModels"
                       @keyup.enter.native="refreshTable()"></el-input>
           </el-form-item>
           <el-form-item label="鏍峰搧鍚嶇О" prop="sample">
             <el-input size="small" placeholder="璇疯緭鍏�" clearable v-model="entity.sample"
                       @keyup.enter.native="refreshTable()"></el-input>
           </el-form-item>
+          <el-form-item label="鐗╂枡灞炴��" prop="materialProp">
+            <el-select clearable size="small" v-model="entity.materialProp" style="width: 100%" @change="refreshTable()">
+              <el-option v-for="dict in dict.type.material_prop_type" :key="dict.value" :label="dict.label"
+                         :value="dict.value">
+              </el-option>
+            </el-select>
+          </el-form-item>
+          <el-form-item label="OA瀹℃牳鐘舵��" prop="operation">
+            <el-select clearable size="small" v-model="entity.operation" style="width: 100%" @change="refreshTable()">
+              <el-option v-for="dict in dict.type.oa_workflow_state" :key="dict.value" :label="dict.label"
+                         :value="dict.value">
+              </el-option>
+            </el-select>
+          </el-form-item>
+          <el-form-item label="鍙嶉鏃ユ湡" prop="feedbackDateTime">
+            <el-date-picker
+              type="daterange"
+              size="small"
+              start-placeholder="寮�濮嬫棩鏈�"
+              end-placeholder="缁撴潫鏃ユ湡"
+              clearable
+              value-format="yyyy-MM-dd"
+              v-model="entity.feedbackDateTime"
+              @keyup.enter.native="refreshTable()">
+            </el-date-picker>
+          </el-form-item>
+          <el-form-item label="渚涘簲鍟嗗悕绉�" prop="supplierName">
+            <el-input size="small" placeholder="璇疯緭鍏�" clearable v-model="entity.supplierName"
+                      @keyup.enter.native="refreshTable()"></el-input>
+          </el-form-item>
           <el-form-item>
             <el-button type="primary" size="mini" @click="refreshTable">鏌ヨ</el-button>
             <el-button size="mini" @click="refresh">閲嶇疆</el-button>
+            <el-button :loading="exportLoading" type="success" size="mini" @click="exportUnqualifiedHandler">瀵煎嚭</el-button>
           </el-form-item>
         </el-form>
       </div>
@@ -73,53 +110,70 @@
 import UnPassDialog from "./components/unPassDialog.vue";
 import OAProcess from "./components/OAProcess.vue";
 import limsTable from "@/components/Table/lims-table.vue";
-import {deleteUnqualifiedHandler, page, pushOA} from "@/api/business/unqualifiedHandler";
-
+import {deleteUnqualifiedHandler, page, pushOA,exportUnqualifiedHandler} from "@/api/business/unqualifiedHandler";
+import {transformExcel} from '@/utils/file'
 export default {
   components: {
     limsTable,
     OAProcess,
     UnPassDialog,
   },
+  dicts: ['material_prop_type','oa_workflow_state'],
   data() {
     return {
       handlerId: null,
+      contract:null,
       entity: {
+        contract: null,
         sample: null,
-        model: null,
+        specsModels: null,
+        supplierName: null,
+        feedbackDateTime:[],
+        materialProp: null,
+        operation:null
       },
       tableData: [],
       tableLoading: false,
       column: [
+        {
+          label: 'IFS鍩�',
+          prop: 'contract',
+          width: '80px',
+          dataType: 'tag',
+          formatData: (params) => {
+            return params
+          },
+          formatType: (params) => {
+            if (params === 'ZTNS') {
+              return ''
+            } else if (params === 'KJNS') {
+              return 'success'
+            }else {
+              return null
+            }
+          }
+
+        },
         { label: '缂栧彿', prop: 'no', width: "160px", },
-        // {
-        //   label: "OA瀹℃牳鐘舵��",
-        //   prop: "oaState",
-        //   width: "100px",
-        //   dataType: "tag",
-        //   formatData: (params) => {
-        //     if (params == 1) {
-        //       return "寰呭鏍�";
-        //     } else if(params == 2) {
-        //       return "瀹℃牳涓�";
-        //     }  else if(params == 3) {
-        //       return "閫氳繃";
-        //     } else {
-        //       return "椹冲洖";
-        //     }
-        //   },
-        //   formatType: (params) => {
-        //     if (params == 1) {
-        //       return "warning";
-        //     } else if(params == 2) {
-        //       return "info";
-        //     }  else if(params == 3) {
-        //       return "success";
-        //     } else {
-        //       return "danger";
-        //     }
-        //   },
-        // },
+        {
+          label: "OA瀹℃牳鐘舵��",
+          prop: "operation",
+          width: "100px",
+          dataType: "tag",
+          formatData: (params) => {
+            return params
+          },
+          formatType: (params) => {
+            if(params){
+              this.dict.type.oa_workflow_state.forEach(item => {
+                if(item.value === params){
+                  params = item.raw.listClass
+                }
+              });
+            }
+            return params
+          },
+        },
         { label: '璁㈠崟鍙�', prop: 'orderNo' },
         {
           label: "闆朵欢鍙�",
@@ -128,16 +182,31 @@
           dataType: "link",
           linkMethod: "openUnPassDialog",
         },
-        { label: '闆朵欢鎻忚堪', prop: 'partDesc' },
-        { label: '鐗╂枡鍚嶇О', prop: 'materialName' },
-        { label: '鐢熶骇鎵规', prop: 'productionBatch' },
+        { label: '闆朵欢鎻忚堪', prop: 'partDesc',width: "160px" },
+        {
+          label: '鐗╂枡灞炴��',
+          prop: 'materialProp',
+          formatData: (params) => {
+            if (!params) return null
+
+            for (let i = 0; i < this.dict.type.material_prop_type.length; i++) {
+              const item = this.dict.type.material_prop_type[i]
+              if (item.value == params) {
+                return item.label
+              }
+            }
+            return null
+          }
+        },
+        { label: '鐗╂枡鍚嶇О', prop: 'materialName',width: "160px" },
+        { label: '鐢熶骇鎵规', prop: 'productionBatch',width: "160px" },
         { label: '鍒拌揣鏁伴噺', prop: 'cargoQuantity' },
         { label: '瑙勬牸鍨嬪彿', prop: 'specsModels' },
         { label: '鎶ユ鏃ユ湡', prop: 'inspectTime' },
         { label: '鐘舵��', prop: 'statusDB' },
         { label: '鍙嶉浜�', prop: 'feedbackUser' },
-        { label: '瑕佹楠岀殑閲囪喘鏁伴噺', prop: 'qtyToInspect' },
-        { label: '鍙嶉鏃ユ湡', prop: 'feedbackTime' },
+        { label: '瑕佹楠岀殑閲囪喘鏁伴噺', prop: 'qtyToInspect',width: "140px" },
+        { label: '鍙嶉鏃ユ湡', prop: 'feedbackTime',width: "100px" },
         {
           label: "鍒嗙被",
           prop: "classification",
@@ -166,7 +235,7 @@
         {
           label: "涓嶅悎鏍煎綊灞�",
           prop: "offGradeAscription",
-          width: "100px",
+          width: "120px",
           dataType: "tag",
           formatData: (params) => {
             if (params == 0) {
@@ -187,21 +256,23 @@
             }
           },
         },
-        { label: '涓嶅悎鏍兼弿杩�', prop: 'unqualifiedDesc' },
+        { label: '涓嶅悎鏍兼弿杩�', prop: 'unqualifiedDesc',width: "160px" },
         {
           dataType: 'action',
           fixed: 'right',
           label: '鎿嶄綔',
-          width: '180px',
+          width: '220px',
           operation: [
             {
-              name: '鎻愪氦OA',
+              name: (row)=>{
+                return row.requestId !== null && row.operation==='閫�鍥�' ? '閲嶆柊鎻愪氦' : '鎻愪氦OA'
+              },
               type: 'text',
               clickFun: (row) => {
                 this.openOA(row);
               },
               disabled: (row, index) => {
-                return row.requestId !== null  // 鏈塺equestId璇存槑宸茬粡鎻愪氦杩嘜A锛屼笉鍙啀娆℃彁浜�
+                return row.requestId !== null && row.operation!=='閫�鍥�'  // 鏈塺equestId璇存槑宸茬粡鎻愪氦杩嘜A锛屼笉鍙啀娆℃彁浜�
               }
             },
             {
@@ -218,7 +289,7 @@
                 this.deleteOA(row);
               },
               disabled: (row, index) => {
-                return row.requestId !== null  // 鏈塺equestId璇存槑宸茬粡鎻愪氦杩嘜A锛屼笉鍙啀娆℃彁浜�
+                return row.requestId !== null && row.operation!=='閫�鍥�'  // 鏈塺equestId璇存槑宸茬粡鎻愪氦杩嘜A锛屼笉鍙啀娆℃彁浜�
               }
             },
           ]
@@ -226,7 +297,7 @@
       ],
       page: {
         total: 0,
-        size: 10,
+        size: 20,
         current: 1
       },
       statusList: [],
@@ -237,15 +308,35 @@
       submitOALoading: false, // OA娴佺▼寮规鎻愪氦鎸夐挳loading
       deleteVisible: false, // OA娴佺▼鍒犻櫎寮规
       cancelOALoading: false, // OA娴佺▼鍒犻櫎寮规鎻愪氦鎸夐挳loading
+      exportLoading:false
     };
   },
   mounted() {
     this.refreshTable()
   },
   methods: {
+    exportUnqualifiedHandler(){
+      this.exportLoading = true
+      const newEntity = { ...this.entity }
+      if (newEntity.feedbackDateTime && newEntity.feedbackDateTime.length > 0) {
+        newEntity.feedbackStartTime = newEntity.feedbackDateTime[0]
+        newEntity.feedbackEndTime = newEntity.feedbackDateTime[1]
+      }
+      exportUnqualifiedHandler({...newEntity}).then(res=>{
+        transformExcel(res,'涓嶅悎鏍煎鐞嗚褰�.xlsx')
+        this.exportLoading = false
+      }).catch(error=>{
+        console.error(error)
+      })
+    },
     refreshTable() {
       this.tableLoading = true
-      page({ ...this.page, ...this.entity }).then(res => {
+      const newEntity = { ...this.entity }
+      if (newEntity.feedbackDateTime && newEntity.feedbackDateTime.length > 0) {
+        newEntity.feedbackStartTime = newEntity.feedbackDateTime[0]
+        newEntity.feedbackEndTime = newEntity.feedbackDateTime[1]
+      }
+      page({ ...this.page, ...newEntity }).then(res => {
         this.tableLoading = false
         this.tableData = res.data.records
         this.page.total = res.data.total
@@ -274,6 +365,9 @@
     resetForm1 () {
       this.$refs.unPassDialog.$refs['unPassForm'].resetFields();
       this.unPassDialog = false
+      this.$nextTick(()=>{
+        this.refreshTable('page')
+      })
     },
     // 鎵撳紑鍒犻櫎OA纭寮规
     deleteOA (row) {
@@ -298,13 +392,22 @@
     // 鏌ョ湅鎻愪氦OA鐨勬暟鎹�
     openOA (row) {
       this.handlerId = row.handlerId
-      this.dialogVisible = true
+      this.contract = row.contract
+      if(row && row.requestId !== null  ){
+        // 閲嶆柊鎻愪氦OA,鎵撳紑缂栬緫寮规
+        this.unPassDialog = true
+        this.$nextTick(() => {
+          this.$refs.unPassDialog.getInsOrder('resubmit', row)
+        })
+      }else{
+        this.dialogVisible = true
+      }
     },
     // 鏌ョ湅OA娴佺▼
     OAView (row) {
       this.OAProcess = true
       this.$nextTick(() => {
-        this.$refs.OAProcess.getInfo(row.handlerId)
+        this.$refs.OAProcess.getInfo(row.handlerId,row?row.unqualifiedDesc:"")
       })
     },
     // 鍏抽棴鏌ョ湅OA娴佺▼鐨勫脊妗�
@@ -315,7 +418,7 @@
     submitOA(row) {
       // 鎻愪氦OA
       this.submitOALoading = true
-      pushOA({handlerId: this.handlerId,}).then(res => {
+      pushOA({handlerId: this.handlerId,contract:this.contract}).then(res => {
         this.submitOALoading = false
         if (res.code === 200) {
           this.dialogVisible = false

--
Gitblit v1.9.3