From 66df6f71812e3a86c470bb71a818f6e6c41e3054 Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期三, 05 三月 2025 11:27:13 +0800
Subject: [PATCH] 添加检验项页面接口修改

---
 src/api/business/productOrder.js                                |   24 ++++++++++++++++++++++++
 src/views/business/productOrder/components/addInspectionDia.vue |   26 +++++++-------------------
 2 files changed, 31 insertions(+), 19 deletions(-)

diff --git a/src/api/business/productOrder.js b/src/api/business/productOrder.js
index 71a4d05..1b991ac 100644
--- a/src/api/business/productOrder.js
+++ b/src/api/business/productOrder.js
@@ -98,3 +98,27 @@
     data: query
   })
 }
+// 鏍规嵁璁㈠崟id鏌ヨ鏍峰搧
+export function getSampleByOrderId(query) {
+  return request({
+    url: '/insOrder/getSampleByOrderId',
+    method: 'get',
+    params: query
+  })
+}
+// 鏍规嵁鏍峰搧id鏌ヨ妫�楠岄」鏍�
+export function getProductTreeBySampleId(query) {
+  return request({
+    url: '/insOrder/getProductTreeBySampleId',
+    method: 'get',
+    params: query
+  })
+}
+// 娣诲姞閬楁紡鐨勬楠岄」
+export function addOmitOrderProduct(query) {
+  return request({
+    url: '/insOrder/addOmitOrderProduct',
+    method: 'post',
+    data: query
+  })
+}
diff --git a/src/views/business/productOrder/components/addInspectionDia.vue b/src/views/business/productOrder/components/addInspectionDia.vue
index 3872bff..f72ecc4 100644
--- a/src/views/business/productOrder/components/addInspectionDia.vue
+++ b/src/views/business/productOrder/components/addInspectionDia.vue
@@ -46,7 +46,7 @@
       title="娣诲姞妫�楠岄」"
       width="90%">
       <el-table ref="productTable" v-loading="getProductLoad" :data="productList" :row-class-name="tableRowClassName" border class="el-table"
-                max-height="700px" style="margin-bottom: 10px;" tooltip-effect="dark"
+                max-height="580px" tooltip-effect="dark"
                 @selection-change="selectProduct">
         <el-table-column type="selection" width="65"></el-table-column>
         <el-table-column label="妫�楠岄」鍒嗙被" min-width="140" prop="inspectionItemClass" show-overflow-tooltip></el-table-column>
@@ -105,6 +105,8 @@
 </template>
 
 <script>
+import {addOmitOrderProduct, getProductTreeBySampleId, getSampleByOrderId} from "@/api/business/productOrder";
+
 export default {
   name: "addInspectionDia",
   // import 寮曞叆鐨勭粍浠堕渶瑕佹敞鍏ュ埌瀵硅薄涓墠鑳戒娇鐢�
@@ -132,10 +134,7 @@
   methods: {
     getDataList(row) {
       this.dialogVisible = true
-      this.$axios.get(this.$api.insOrder.getSampleByOrderId + '?insOrderId=' + row.id).then(res => {
-        if (res.code === 201) {
-          return
-        }
+      getSampleByOrderId({insOrderId: row.id}).then(res => {
         this.sampleList = res.data
       })
     },
@@ -143,11 +142,8 @@
       this.itemDialogVisible = true
       this.getProductLoad = true
       this.id=row.id
-      this.$axios.get(this.$api.insOrder.getProductTreeBySampleId + '?insSampleId=' + row.id).then(res => {
+      getProductTreeBySampleId({insSampleId: row.id}).then(res => {
         this.getProductLoad = false
-        if (res.code === 201) {
-          return
-        }
         this.productList = res.data
       }).catch(err => {
         this.getProductLoad = false
@@ -170,16 +166,8 @@
         type: 'warning'
       }).then(() => {
         this.upLoad = true
-        this.$axios.post(this.$api.insOrder.addOmitOrderProduct,{insProductBindingList:this.productListSelected,insSampleId:this.id}, {
-          headers: {
-            "Content-Type": "application/json"
-          },
-          noQs: true
-        } ).then(res => {
+        addOmitOrderProduct({insProductBindingList:this.productListSelected,insSampleId:this.id}).then(res => {
           this.upLoad = false
-          if (res.code === 201) {
-            return
-          }
           this.$message.success('娣诲姞鎴愬姛锛�')
           this.itemDialogVisible = false
         }).catch(err => {
@@ -188,7 +176,7 @@
       }).catch(() => {
         this.$message({
           type: 'info',
-          message: '宸插彇娑堝垹闄�'
+          message: '宸插彇娑堟坊鍔�'
         });
       });
     },

--
Gitblit v1.9.3