From e8fba4e48cf0ab5444b6e1c1fdae9f4e4cbc0af3 Mon Sep 17 00:00:00 2001
From: 曹睿 <360930172@qq.com>
Date: 星期二, 25 二月 2025 13:49:06 +0800
Subject: [PATCH] feat: 完成7.1页面接口没测

---
 src/views/CNAS/process/demand/AddContracts.vue |   69 +++++++++++++++++++++++++++++-----
 1 files changed, 58 insertions(+), 11 deletions(-)

diff --git a/src/views/CNAS/process/demand/AddContracts.vue b/src/views/CNAS/process/demand/AddContracts.vue
index 5fb73f0..22fd026 100644
--- a/src/views/CNAS/process/demand/AddContracts.vue
+++ b/src/views/CNAS/process/demand/AddContracts.vue
@@ -1,5 +1,5 @@
 <template>
-    <el-dialog title="鏂板妫�楠屽鎵樺崟" :visible.sync="visible" width="1200px">
+    <el-dialog :title="title" :visible.sync="visible" width="1200px">
         <div id="dialogBody">
             <div style="max-height: 75vh;overflow-y: auto;">
                 <div id="dialogBody">
@@ -119,7 +119,6 @@
                                 <el-radio-group 
                                     v-if="operationType !== 'view'"
                                     v-model="currentInfo.isLeave" 
-                                    v-removeAriaHidden
                                 >
                                     <el-radio :label="1">鏄�</el-radio>
                                     <el-radio :label="0">鍚�</el-radio>
@@ -133,7 +132,7 @@
                                 <p>鏍峰搧澶勭悊鏂瑰紡</p>
                             </td>
                             <td v-if="operationType !== 'view'">
-                                <el-radio-group v-model="currentInfo.processing" v-removeAriaHidden>
+                                <el-radio-group v-model="currentInfo.processing">
                                     <el-radio :label="0">濮旀墭鍗曚綅鍙栧洖</el-radio>
                                     <el-radio :label="1">瀹為獙瀹ゅ鐞�</el-radio>
                                 </el-radio-group>
@@ -169,7 +168,7 @@
                             <td >
                                 <el-radio-group 
                                     v-if="operationType !== 'view'"
-                                    v-model="currentInfo.send" v-removeAriaHidden
+                                    v-model="currentInfo.send"
                                 >
                                     <el-radio :label="1">鑷彇</el-radio>
                                     <el-radio :label="0">鍏朵粬</el-radio>
@@ -222,7 +221,7 @@
                                 <p>鍒ゅ畾瑙勫垯</p>
                             </td>
                             <td v-if="operationType !== 'view'" colspan="3">
-                                <el-radio-group v-model="currentInfo.criterionRule" v-removeAriaHidden>
+                                <el-radio-group v-model="currentInfo.criterionRule">
                                     <el-radio :label="0">涓嶈�冭檻涓嶇‘瀹氬害</el-radio>
                                     <el-radio :label="1">鑰冭檻涓嶇‘瀹氬害</el-radio>
                                 </el-radio-group>
@@ -348,10 +347,7 @@
         </div>
         <span v-if="operationType !== 'view'" slot="footer" class="dialog-footer">
             <el-button @click="detailDialogVisible = false">鍙� 娑�</el-button>
-            <el-button v-if="operationType === 'add'" :loading="buttonLoading" type="primary" @click="handleAdd">
-                纭� 瀹�
-            </el-button>
-            <el-button v-if="operationType === 'edit'" :loading="buttonLoading" type="primary" @click="handleEdit">
+            <el-button :loading="buttonLoading" type="primary" @click="handleSubmit">
                 纭� 瀹�
             </el-button>
         </span>
@@ -359,21 +355,72 @@
 </template>
 <script>
 import ZTTLogo from "@/assets/logo/ZTTlogo.png"
+import { getInspectionOrderByInsOderId, getInspectionOrderOne, addInspectionOrder, editInspectionOrder } from "@/api/cnas/process/demand/demand.js"
+
 export default {
     name: 'AddContracts',
+    props: {
+        operationType: {
+            type: String,
+            default: ''
+        },
+    },
     data() {
         return {
+            title: '',
             ZTTLogo,
             visible: false,
-            operationType: '',
             currentInfo:{
                 orderDetailList: []
             },
+            buttonLoading: false
         }
     },
     methods: {
-        open() {
+        open(row) {
             this.visible = true
+            if(operationType == 'add') {
+                this.goAddOrder(row)
+            } else {
+                
+            }
+        },
+        // 鎵撳紑寮圭獥鐨勬椂鍊欙紝鏌ヨ闇�瑕佹柊澧炵殑濮旀墭鍗曡鎯�
+        async goAddOrder(row) {
+            this.title = '鏂板妫�楠屽鎵樺崟';
+            const { code, data } = await getInspectionOrderByInsOderId({
+                insOrderId: row.id
+            })
+            if(code == 200) {
+                this.currentInfo = res.data
+                this.detailDialogVisible = true
+            }
+        },
+        async goUpdateOrder(row) {
+            this.title = '缂栬緫妫�楠屽鎵樺崟';
+            const { code, data } = await getInspectionOrderOne({
+                insOrderId: row.inspectionOrderId
+            })
+            if(code == 200) {
+                this.currentInfo = res.data
+                this.detailDialogVisible = true
+            }
+        },
+        addOrderDetailList() {
+            if (this.currentInfo.orderDetailList == null) {
+                this.currentInfo.orderDetailList = []
+            }
+            this.currentInfo.orderDetailList.push({
+                sampleNumber: '',
+                testItem: '',
+                testStandard: '',
+                standardMethodList: '',
+                remark: '',
+            })
+        },
+
+        async handleSubmit() {
+            this.operationType == 'add' ? await addInspectionOrder(this.currentInfo) : await editInspectionOrder(this.currentInfo)
         }
     }
 }

--
Gitblit v1.9.3