From 6816ee4cbdaa253c2cd452e0e582a351860ffbe7 Mon Sep 17 00:00:00 2001
From: spring <2396852758@qq.com>
Date: 星期一, 07 四月 2025 16:35:36 +0800
Subject: [PATCH] 成品检验项分配人员

---
 src/views/business/materialOrderComponents/materialOrder/dataLookVisible.vue |  165 ++++++++++++++++++++++++++++++++++---------------------
 1 files changed, 102 insertions(+), 63 deletions(-)

diff --git a/src/views/business/materialOrderComponents/materialOrder/dataLookVisible.vue b/src/views/business/materialOrderComponents/materialOrder/dataLookVisible.vue
index 79aceca..c379f86 100644
--- a/src/views/business/materialOrderComponents/materialOrder/dataLookVisible.vue
+++ b/src/views/business/materialOrderComponents/materialOrder/dataLookVisible.vue
@@ -2,26 +2,28 @@
   <div>
     <el-dialog title="鏁版嵁鏌ョ湅" :visible.sync="isShow" width="80%" @closed="$emit('closeDataLook')">
       <ul class="tab">
-        <li v-for="(m,i) in dataVisibleTitle" :key="i" :class="{active:i===dataVisibleIndex}" @click="handleDataVisibleTab(m,i)">{{m.label}}</li>
+        <li v-for="(m, i) in dataVisibleTitle" :key="i" :class="{ active: i === dataVisibleIndex }"
+          @click="handleDataVisibleTab(m, i)">{{ m.label }}</li>
       </ul>
-      <div style="height: 70vh;overflow-y: auto;">
-        <ValueTable ref="ValueTableDataLook" :url="$api.insOrder.selectSampleAndProductByOrderId"
-                    :key="upIndex"
-                    :componentData="componentDataDataLook"/>
+      <div>
+        <lims-table :tableData="tableData" :column="column" @pagination="pagination" height="500px" key="tableData"
+          :page="page" :tableLoading="tableLoading"></lims-table>
       </div>
     </el-dialog>
-    <un-pass-retest-result :retestVisible="retestVisible" :retestInfo="retestInfo" @closeRetestLook="closeRetestLook" v-if="retestVisible"></un-pass-retest-result>
+    <un-pass-retest-result :retestVisible="retestVisible" :retestInfo="retestInfo" @closeRetestLook="closeRetestLook"
+      v-if="retestVisible"></un-pass-retest-result>
   </div>
 </template>
 
 <script>
-import ValueTable from "@/components/Table/value-table.vue";
 import UnPassRetestResult from "./unPassRetestResult.vue";
+import limsTable from "@/components/Table/lims-table.vue";
+import { getRetestResult, selectSampleAndProductByOrderId } from "@/api/business/rawMaterialOrder";
 
 export default {
   name: "dataLookVisible",
   // import 寮曞叆鐨勭粍浠堕渶瑕佹敞鍏ュ埌瀵硅薄涓墠鑳戒娇鐢�
-  components: {UnPassRetestResult, ValueTable},
+  components: { limsTable, UnPassRetestResult },
   props: {
     dataDialogVisible: {
       type: Boolean,
@@ -29,13 +31,78 @@
     },
     dataLookInfo: {
       type: Object,
-      default: () => {}
+      default: () => { }
     },
   },
   data() {
     // 杩欓噷瀛樻斁鏁版嵁
     return {
-      upIndex: 0,
+      tableData: [],
+      tableLoading: false,
+      column: [
+        { label: '鏍峰搧缂栧彿', prop: 'sampleCode' },
+        { label: '鏍峰搧鍚嶇О', prop: 'sample' },
+        { label: '妫�楠岄」鍒嗙被', prop: 'inspectionItemClass' },
+        { label: '妫�楠岄」', prop: 'inspectionItem' },
+        { label: '妫�楠屽瓙椤�', prop: 'inspectionItemSubclass' },
+        { label: '鍗曚綅', prop: 'unit' },
+        { label: '鏍峰搧鍨嬪彿', prop: 'model' },
+        { label: '鏉′欢', prop: 'radius' },
+        { label: '鐢电紗鏍囪瘑', prop: 'cableTag' },
+        { label: '璇曢獙瑕佹眰', prop: 'tell' },
+        { label: '妫�楠岀粨鏋�', prop: 'lastValue' },
+        {
+          dataType: 'tag',
+          label: '缁撴灉鍒ゅ畾',
+          prop: 'insResult',
+          formatData: (params) => {
+            if (params == 1) {
+              return '鍚堟牸'
+            } else if (params == 0) {
+              return '涓嶅悎鏍�'
+            } else if (params == 3) {
+              return '涓嶅垽瀹�'
+            } else {
+              return null
+            }
+          },
+          formatType: (params) => {
+            if (params == 1) {
+              return 'success'
+            } else if (params == 0) {
+              return 'danger'
+            } else if (params == 3) {
+              return ''
+            } else {
+              return null
+            }
+          }
+        },
+        { label: "妫�楠屼汉", prop: "checkUserName" },
+        {
+          dataType: 'action',
+          fixed: 'right',
+          label: '鎿嶄綔',
+          width: '170px',
+          operation: [
+            {
+              name: '涓嶅悎鏍煎娴嬫煡鐪�',
+              type: 'text',
+              clickFun: (row) => {
+                this.getRetestResult(row);
+              },
+              disabled: (row, index) => {
+                return row.insResult != 0
+              }
+            },
+          ]
+        }
+      ],
+      page: {
+        total: 0,
+        size: 10,
+        current: 1
+      },
       isShow: this.dataDialogVisible,
       dataVisibleTitle: [
         {
@@ -48,48 +115,8 @@
         },
       ],
       dataVisibleIndex: 0, // 鏁版嵁鏌ョ湅tab鏍忛�夋嫨鍊�
-      // 琛ㄦ牸鏁版嵁
-      componentDataDataLook: { // 鏁扮粍鏌ョ湅鐨則able鏁版嵁
-        entity: {
-          id: null,
-        },
-        isIndex: false,
-        showSelect: false,
-        select: false,
-        do: [
-          {
-            id: '',
-            font: '涓嶅悎鏍煎娴嬫煡鐪�',
-            type: 'text',
-            method: 'getRetestResult',
-            disabFun: (row, index) =>  {
-              return row.insResult!=0
-            }
-          }
-        ],
-        tagField: {
-          insState: {
-            select: []
-          },
-          insResult: {
-            select: [{
-              value: 1,
-              label: '鍚堟牸',
-              type: 'success'
-            },{
-              value: 0,
-              label: '涓嶅悎鏍�',
-              type: 'danger'
-            },{
-              value: 3,
-              label: '涓嶅垽瀹�',
-              type: ''
-            }]
-          }
-        },
-        selectField: {},
-        requiredAdd: [],
-        requiredUp: []
+      entity: {
+        id: null,
       },
       retestVisible: false,
       retestInfo: []
@@ -101,30 +128,41 @@
   // 鏂规硶闆嗗悎
   methods: {
     // 鍒囨崲鏁版嵁鏌ョ湅tab鏍�
-    handleDataVisibleTab (m, i) {
+    handleDataVisibleTab(m, i) {
       this.dataVisibleIndex = i
       this.refreshTable()
     },
     // 鏌ヨ鍥炶皟
-    refreshTable(e) {
+    refreshTable() {
       if (this.dataVisibleIndex === 0) {
-        this.componentDataDataLook.entity.id = this.dataLookInfo.enterOrderId
+        this.entity.id = this.dataLookInfo.enterOrderId
       } else {
-        this.componentDataDataLook.entity.id = this.dataLookInfo.quarterOrderId
+        this.entity.id = this.dataLookInfo.quarterOrderId
       }
-      this.$nextTick(() => {
-        this.$refs['ValueTableDataLook'].selectList(e)
+      this.tableLoading = true
+      const params = { ...this.entity, ...this.page }
+      selectSampleAndProductByOrderId(params).then(res => {
+        this.tableLoading = false
+        if (res.code === 200) {
+          this.tableData = res.data.records
+          this.page.total = res.data.total
+        }
+      }).catch(err => {
+        this.tableLoading = false
       })
     },
+    pagination(page) {
+      this.page.size = page.limit
+      this.refreshTable()
+    },
     // 鏌ョ湅涓嶅悎鏍煎娴嬬粨鏋�
-    getRetestResult (row) {
-      this.$axios.get(this.$api.insOrder.getRetestResult+'?insProductId='+row.insProductId).then(res => {
-        if (res.code == 201) return
+    getRetestResult(row) {
+      getRetestResult({ insProductId: row.insProductId }).then(res => {
         this.retestVisible = true
         this.retestInfo = res.data
       })
     },
-    closeRetestLook () {
+    closeRetestLook() {
       this.retestVisible = false
     },
   },
@@ -135,7 +173,8 @@
 .tab {
   list-style-type: none;
   display: flex;
-  margin-bottom: 12px;
+  margin-top: 0 !important;
+  padding-left: 0 !important;
 }
 
 .tab li {

--
Gitblit v1.9.3