From 049fda473cc178917a02f3a174dfd08a84b0cb8d Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期四, 17 九月 2026 10:52:28 +0800
Subject: [PATCH] 新疆——新聚lims 1.每个检验项都要有一个选择检测时间的地方,跟温湿度放在一起,还有检测地点,设备也要单独绑定检验项,最后导出模版再总结到一起 2.产品名称改为检测依据、加一个样品名称手输 3.下单时原始记录模板可以从标准库绑定的模板进行删减

---
 src/views/business/productOrder/index.vue |  287 ++++++++++++++++++++++++++------------------------------
 1 files changed, 134 insertions(+), 153 deletions(-)

diff --git a/src/views/business/productOrder/index.vue b/src/views/business/productOrder/index.vue
index d8371fb..69d9738 100644
--- a/src/views/business/productOrder/index.vue
+++ b/src/views/business/productOrder/index.vue
@@ -39,30 +39,31 @@
         </el-form-item>
       </el-form>
     </div>
-    <div class="table-tab">
-      <div>
-        <ul class="tab">
-          <li :class="{ active: tabIndex === 0 }" v-if="checkPermi(['get:insOrder:reviewed'])" @click="handleTab(0)">寰呭鏍�</li>
-          <li :class="{ active: tabIndex === 1 }" v-if="checkPermi(['get:insOrder:checkout'])" @click="handleTab(1)">妫�楠屼腑</li>
-          <li :class="{ active: tabIndex === 2 }" v-if="checkPermi(['get:insOrder:customerOrdered'])" @click="handleTab(2)">濮旀墭宸叉</li>
-          <li :class="{ active: tabIndex === 3 }" v-if="checkPermi(['get:insOrder:spotCheck'])" @click="handleTab(3)">鎶芥牱宸叉</li>
-          <li :class="{ active: tabIndex === 4 }" v-if="checkPermi(['get:insOrder:sendBack'])" @click="handleTab(4)">閫�鍥�</li>
-          <li :class="{ active: tabIndex === 5 }" v-if="checkPermi(['get:insOrder:revocation'])" @click="handleTab(5)">鎾ら攢</li>
-          <li :class="{ active: tabIndex === 6 }" v-if="checkPermi(['get:insOrder:all'])" @click="handleTab(6)">鍏ㄩ儴</li>
-        </ul>
+    <div class="container" v-loading="isLoading">
+      <div class="table-tab">
+        <div>
+          <ul class="tab">
+            <li :class="{ active: tabIndex === 0 }" v-if="checkPermi(['get:insOrder:reviewed'])" @click="handleTab(0)">寰呭鏍�</li>
+            <li :class="{ active: tabIndex === 1 }" v-if="checkPermi(['get:insOrder:checkout'])" @click="handleTab(1)">妫�楠屼腑</li>
+            <li :class="{ active: tabIndex === 2 }" v-if="checkPermi(['get:insOrder:customerOrdered'])" @click="handleTab(2)">濮旀墭宸叉</li>
+            <li :class="{ active: tabIndex === 3 }" v-if="checkPermi(['get:insOrder:spotCheck'])" @click="handleTab(3)">鎶芥牱宸叉</li>
+            <li :class="{ active: tabIndex === 4 }" v-if="checkPermi(['get:insOrder:sendBack'])" @click="handleTab(4)">閫�鍥�</li>
+            <li :class="{ active: tabIndex === 5 }" v-if="checkPermi(['get:insOrder:revocation'])" @click="handleTab(5)">鎾ら攢</li>
+            <li :class="{ active: tabIndex === 6 }" v-if="checkPermi(['get:insOrder:all'])" @click="handleTab(6)">鍏ㄩ儴</li>
+          </ul>
+        </div>
+        <div>
+          <el-button v-if="tabIndex === 2 || tabIndex === 3 || tabIndex === 6" size="small"
+                     @click="downLoad">瀵煎嚭</el-button>
+          <el-button size="small" type="primary" @click="openPrint">鏍囩鎵撳嵃</el-button>
+          <el-button v-if="checkPermi(['add:insOrder'])" size="small" type="primary" @click="playOrder(1)">涓嬪崟</el-button>
+        </div>
       </div>
-      <div>
-        <el-button v-if="tabIndex === 2 || tabIndex === 3 || tabIndex === 6" size="small"
-          @click="downLoad">瀵煎嚭</el-button>
-        <el-button v-if="tabIndex === 1" size="small" type="primary" @click="openAddIns">娣诲姞妫�楠岄」</el-button>
-        <el-button size="small" type="primary" @click="openPrint">鏍囩鎵撳嵃</el-button>
-        <el-button v-if="checkPermi(['add:insOrder'])" size="small" type="primary" @click="playOrder(1)">涓嬪崟</el-button>
+      <div class="table">
+        <lims-table :tableData="tableData" :column="column" :isSelection="true" :handleSelectionChange="selectMethod"
+                    @pagination="pagination" :height="'calc(100vh - 280px)'" :key="upIndex" :page="page"
+                    :tableLoading="tableLoading"></lims-table>
       </div>
-    </div>
-    <div class="table">
-      <lims-table :tableData="tableData" :column="column" :isSelection="true" :handleSelectionChange="selectMethod"
-        @pagination="pagination" :height="'calc(100vh - 280px)'" :key="upIndex" :page="page"
-        :tableLoading="tableLoading"></lims-table>
     </div>
     <div>
       <!-- 瀹℃牳 -->
@@ -128,11 +129,11 @@
               </div>
             </el-col>
             <el-col class="search_thing" style="width: 95%;">
-              <div class="search_label"><span class="required-span">* </span>璇曢獙瀹わ細</div>
+              <div class="search_label">璇曢獙瀹わ細</div>
               <div class="search_input">
                 <el-select v-model="distributeData.sonLaboratory" clearable filterable placeholder="璇烽�夋嫨" size="small"
                   style="width: 100%;">
-                  <el-option v-for="(item, i) in sonLaboratoryList" :key="i + 'oooo'" :label="item.label"
+                  <el-option v-for="(item, i) in newJuLaboratoryList" :key="i + 'oooo'" :label="item.label"
                     :value="item.value">
                   </el-option>
                 </el-select>
@@ -164,7 +165,7 @@
         <div v-if="deleteDialogVisible" style="height: 70vh;overflow-y: auto;">
           <lims-table :tableData="componentDataDelete" :column="columnDelete" :isSelection="true"
             :handleSelectionChange="selectDelete" @pagination="paginationDelete" height="500px"
-            key="componentDataDelete" :page="pageDelete" :tableLoading="tableLoadingDelete"></lims-table>
+            :key="orderId" :page="pageDelete" :tableLoading="tableLoadingDelete"></lims-table>
         </div>
         <span slot="footer" class="dialog-footer">
           <el-row>
@@ -292,8 +293,6 @@
     <!--鏍囩鎵撳嵃寮规-->
     <print-dialog v-if="printDialog" ref="printDialog" :printDialog="printDialog"
       @closePrintDialog="closePrintDialog"></print-dialog>
-    <!--娣诲姞閬楁紡妫�楠岄」寮规-->
-    <add-inspection-dia v-if="addInspectionDia" ref="addInspectionDia"></add-inspection-dia>
     <!--淇敼鏍峰搧鍨嬪彿寮规-->
     <el-dialog :close-on-click-modal="false" :close-on-press-escape="false"
                :visible.sync="dialogVisible" title="淇敼鏍峰搧鍨嬪彿" width="80%">
@@ -323,14 +322,16 @@
 import vueQr from 'vue-qr'
 import PrintJS from 'print-js'
 import PrintDialog from "@/views/business/productOrder/components/printDialog.vue";
-import AddInspectionDia from "@/views/business/productOrder/components/addInspectionDia.vue";
 import limsTable from "@/components/Table/lims-table.vue";
 import {
   checkUpdate, delInsOrder, getSampleByOrderId,
   rawAllInsOrderExport,
-  selectInsOrderParameter, selectNoProducts, selectOrderManDay,
+  selectInsOrderParameter,
+  selectNoProducts,
+  getRevocationInsProductList,
+  selectOrderManDay,
   updateInspected,
-  updateOrderEntrustCode, updateSampleModel, updateStatus, upInsOrder, upPlanUser2
+  updateOrderEntrustCode, updateSampleModel, updateStatus, upInsOrder
 } from "@/api/business/productOrder";
 import { selectUserCondition } from "@/api/performance/class";
 import { downFile, getFileList, selectSampleAndProductByOrderId } from "@/api/business/rawMaterialOrder";
@@ -339,12 +340,12 @@
   name: 'ProductOrder',
   components: {
     limsTable,
-    AddInspectionDia,
     PrintDialog,
     vueQr
   },
   data() {
     return {
+      isLoading: false, // 鎺у埗鍔犺浇鐘舵��
       entity: {
         orderType: '',
         state: '',
@@ -361,75 +362,27 @@
           linkMethod: "changeEntrustCode",
         },
         { label: '濮旀墭鍗曚綅', prop: 'company' },
-        {
-          label: "鏍峰搧鍚嶇О",
-          prop: "sampleName",
-          width: "160px",
-          dataType: "link",
-          linkMethod: "selectAllByOne",
-        },
-        {
-          label: "鏍峰搧鍨嬪彿",
-          prop: "sampleModel",
-          width: "160px",
-          dataType: "link",
-          linkMethod: "editSampleModel",
-        },
-        { label: '鏍峰搧鏁伴噺', prop: 'sampleNum' },
+        { label: '妫�娴嬩緷鎹�', prop: 'sample' },
+        { label: '鏍峰搧鍚嶇О', prop: 'sampleView' },
+        // {
+        //   label: "鏍峰搧鍚嶇О",
+        //   prop: "sampleName",
+        //   width: "160px",
+        //   dataType: "link",
+        //   linkMethod: "selectAllByOne",
+        // },
+        // {
+        //   label: "鏍峰搧鍨嬪彿",
+        //   prop: "sampleModel",
+        //   width: "160px",
+        //   dataType: "link",
+        //   linkMethod: "editSampleModel",
+        // },
+        { label: '鏍峰搧鏁伴噺', prop: 'testQuantity' },
         { label: '妫�楠屼汉', prop: 'testingName' },
-        {
-          dataType: 'tag',
-          label: '绱ф�ョ▼搴�',
-          prop: 'type',
-          formatData: (params) => {
-            if (params == 0) {
-              return '鏅��'
-            } else if (params == 1) {
-              return '浼樺厛'
-            } else {
-              return '绱ф��'
-            }
-          },
-          formatType: (params) => {
-            if (params == 0) {
-              return 'success'
-            } else if (params == 1) {
-              return 'warning'
-            } else {
-              return 'danger'
-            }
-          }
-        },
         { label: '澶囨敞', prop: 'remark' },
         { label: '妫�楠岃繘搴�%', prop: 'insProgress' },
         { label: '绾﹀畾鏃堕棿', prop: 'appointed' },
-        {
-          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: 'createTime' },
         { label: '涓嬪彂鏃堕棿', prop: 'sendTime' },
         { label: '閫�鍥炵悊鐢�', prop: 'tell' },
@@ -439,6 +392,13 @@
           fixed: 'right',
           label: '鎿嶄綔',
           operation: [
+            {
+              name: '鏌ョ湅璇︽儏',
+              type: 'text',
+              clickFun: (row) => {
+                this.selectAllByOne(row);
+              }
+            },
             {
               name: '鏁版嵁鏌ョ湅',
               type: 'text',
@@ -759,9 +719,7 @@
       ],
       qrData: [],
       multipleSelection: [],
-      sonLaboratoryList: [],
       printDialog: false,
-      addInspectionDia: false,
       dialogVisible: false,
       submitListLoad: false,
       sampleList: []
@@ -777,10 +735,19 @@
       }
     }
   },
+  dicts: ['sys_sub_lab'],
   computed: {
     ...mapGetters(["nickName"]),
+    newJuLaboratoryList() {
+      return (this.dict.type.sys_sub_lab || []).filter(item => item.label === '鏂拌仛')
+    },
   },
   mounted() {
+    if (this.checkPermi(['get:raw:await'])) {
+      this.tabIndex = 0
+    } else {
+      this.tabIndex = 2
+    }
     this.refreshTable()
     this.getAuthorizedPerson()
   },
@@ -800,8 +767,9 @@
         }
       }
       const params = { ...this.entity, state: this.tabList[this.tabIndex].value }
-      this.tableLoading = true
+      this.isLoading = true; // 寮�濮嬪姞杞�
       selectInsOrderParameter({...this.page,...params}).then(res => {
+        this.isLoading = false; // 缁撴潫鍔犺浇
         this.upIndex++
         this.tableLoading = false
         if (res.code === 200) {
@@ -809,7 +777,7 @@
           this.page.total = res.data.total
         }
       }).catch(err => {
-        this.tableLoading = false
+        this.isLoading = false; // 缁撴潫鍔犺浇
       })
     },
     refresh() {
@@ -901,24 +869,14 @@
         font_size: '0.20cm',
       });
     },
-    // 鎵撳紑娣诲姞妫�楠岄」寮规
-    openAddIns() {
-      if (this.multipleSelection.length === 0) {
-        this.$message.warning('璇烽�夋嫨闇�瑕佹坊鍔犳楠岄」鐨勬暟鎹�')
-        return
-      }
-      if (this.multipleSelection.length > 1) {
-        this.$message.warning('鍙兘閫夋嫨涓�鏉℃暟鎹�')
-        return
-      }
-      this.addInspectionDia = true
-      this.$nextTick(() => {
-        this.$refs.addInspectionDia.getDataList(this.multipleSelection[0])
-      })
-    },
     // 瀵煎嚭璁板綍
     downLoad() {
-      const params = { ...this.entity, state: this.tabList[this.tabIndex].value }
+      let params = {}
+      if (this.multipleSelection.length > 0) {
+        params.ids = this.multipleSelection.map(item => item.id).join(',');
+      } else {
+        params = { ...this.entity, state: this.tabList[this.tabIndex].value }
+      }
       rawAllInsOrderExport({ ...params }).then(res => {
         const blob = new Blob([res], { type: 'application/octet-stream' });
         this.$download.saveAs(blob, '濮旀墭妫�娴嬩俊鎭鍑�.xlsx');
@@ -971,14 +929,26 @@
     },
     // 鐐瑰嚮鏍峰搧鍚嶇О
     selectAllByOne(row) {
-      this.$router.push({
-        path: "/productOrder/addView", query: {
-          examine: 1,
-          active: 2,
-          currentId: row.id,
-          tabIndex: this.tabIndex,
-        }
-      });
+      if (this.tabIndex === 4) {
+        this.$router.push({
+          path: "/productOrder/addOrder", query: {
+            examine: 1,
+            active: 2,
+            currentId: row.id,
+            tabIndex: this.tabIndex,
+          }
+        });
+      } else {
+        this.$router.push({
+          path: "/productOrder/addView", query: {
+            examine: 1,
+            active: 2,
+            currentId: row.id,
+            tabIndex: this.tabIndex,
+          }
+        });
+      }
+
     },
     // 淇敼鏍峰搧鍨嬪彿
     editSampleModel (row) {
@@ -1141,7 +1111,20 @@
       this.orderId = row.id
       this.revocationInsProductIds = row.revocationInsProductIds
       this.deleteTilte = '鎾ら攢瀹℃牳'
+      // this.getRevocationInsProductList()
       this.deleteDialogVisible = true;
+    },
+    getRevocationInsProductList(){
+      this.tableLoadingDelete = true
+      getRevocationInsProductList({orderId:this.orderId}).then(res=>{
+        if(res.code===200){
+          this.componentDataDelete = res.data
+        }
+        this.tableLoadingDelete = false
+      }).catch(error=>{
+        console.error(error)
+        this.tableLoadingDelete = false
+      })
     },
     handleNo() {
       if (this.deleteTilte == '鎾ら攢') {
@@ -1160,6 +1143,7 @@
     // 涓嬪彂
     handleIssued(row) {
       this.issuedDialogVisible = true;
+      this.distributeData.sonLaboratory = this.newJuLaboratoryList.length > 0 ? this.newJuLaboratoryList[0].value : ''
       selectOrderManDay({
         id: row.id
       }).then(res => {
@@ -1167,19 +1151,6 @@
         this.distributeData.sampleId = row.sampleId
         this.distributeData.appointed = res.data
         this.distributeData.type = row.type
-      })
-      upPlanUser2({
-        orderId: row.id,
-      }).then(res => {
-        if (res.code === 200 && res.data.length > 0) {
-          this.sonLaboratoryList = [];
-          res.data.forEach(m => {
-            this.sonLaboratoryList.push({
-              value: m,
-              label: m
-            })
-          })
-        }
       })
     },
     submitForm2() {
@@ -1190,10 +1161,6 @@
       //
       if (this.distributeData.userId == null || this.distributeData.userId == '') {
         this.$message.error('鎸囨淳浜哄憳鏈~鍐�')
-        return
-      }
-      if (this.distributeData.userId && (this.distributeData.sonLaboratory == null || this.distributeData.sonLaboratory == '')) {
-        this.$message.error('璇曢獙瀹ゆ湭濉啓')
         return
       }
       this.upLoad = true;
@@ -1251,6 +1218,7 @@
     },
     handleTab(i) {
       this.tabIndex = i;
+      this.multipleSelection = []
       this.refreshTable()
     },
     // 鏌ョ湅妫�楠屾暟鎹�
@@ -1261,16 +1229,29 @@
         inspectorList = row.userName.split(',')
       }
       inspectorList.push(this.nickName)
-      this.$router.push({
-        path: "/inspectionTask/inspection",
-        query: {
-          sonLaboratory: row.sonLaboratory,
-          state: 3,
-          typeSource: row.typeSource,
-          orderId: row.id,
-          inspectorList: inspectorList,
-        },
-      })
+      if (this.checkPermi(['business:inspectionView'])) {
+        this.$router.push({
+          name: "InspectionView",
+          query: {
+            sonLaboratory: row.sonLaboratory,
+            state: 3,
+            typeSource: row.typeSource,
+            orderId: row.id,
+            inspectorList: inspectorList,
+          },
+        })
+      } else {
+        this.$router.push({
+          path: "/inspectionTask/inspection",
+          query: {
+            sonLaboratory: row.sonLaboratory,
+            state: 3,
+            typeSource: row.typeSource,
+            orderId: row.id,
+            inspectorList: inspectorList,
+          },
+        })
+      }
     },
     goback() {
       this.state = 0
@@ -1281,8 +1262,8 @@
       this.InspectionKey++
     },
     changeUser() {
-      if (this.sonLaboratoryList.length > 0) {
-        this.distributeData.sonLaboratory = this.sonLaboratoryList[0].value
+      if (this.newJuLaboratoryList.length > 0) {
+        this.distributeData.sonLaboratory = this.newJuLaboratoryList[0].value
       }
     },
     handleDelete(row) {

--
Gitblit v1.9.3