From 5218032b30db4a1e19ac6bb243b71900a600da28 Mon Sep 17 00:00:00 2001
From: hdy <1105738590@qq.com>
Date: 星期二, 19 三月 2024 10:37:57 +0800
Subject: [PATCH] 设备保养计划修改

---
 jcdm-ui/src/views/main/em/inspectionPlan/index.vue |   34 +++++++++++++++++++++++++++-------
 1 files changed, 27 insertions(+), 7 deletions(-)

diff --git a/jcdm-ui/src/views/main/em/inspectionPlan/index.vue b/jcdm-ui/src/views/main/em/inspectionPlan/index.vue
index 6ff1b90..b4b7d6c 100644
--- a/jcdm-ui/src/views/main/em/inspectionPlan/index.vue
+++ b/jcdm-ui/src/views/main/em/inspectionPlan/index.vue
@@ -94,23 +94,32 @@
           <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
         </el-row>
 
-        <el-table border v-loading="loading" :data="inspectionPlanList" @selection-change="handleSelectionChange" @inSelected="inMachineryAdd">
+        <el-table border v-loading="loading" :data="inspectionPlanList" @selection-change="handleSelectionChange" >
           <el-table-column type="selection" width="55" align="center" />
           <el-table-column label="璁″垝鍚嶇О" align="center" prop="planName">
           </el-table-column>
           <el-table-column label="璁″垝缂栧彿" align="center" prop="planCode">
           </el-table-column>
           <el-table-column label="璁″垝绫诲瀷" align="center" prop="planType">
+            <template slot-scope="scope">
+              <dict-tag :options="dict.type.plan_type" :value="scope.row.planType"/>
+            </template>
           </el-table-column>
           <el-table-column label="棰戠巼" align="center" prop="frequency">
           </el-table-column>
           <el-table-column label="缁村害" align="center" prop="dimension">
+            <template slot-scope="scope">
+              <dict-tag :options="dict.type.dimension" :value="scope.row.dimension"/>
+            </template>
           </el-table-column>
           <el-table-column label="寮�濮嬫椂闂�" align="center" prop="startTime">
           </el-table-column>
           <el-table-column label="缁撴潫鏃堕棿" align="center" prop="endTime">
           </el-table-column>
           <el-table-column label="鐘舵��" align="center" prop="state">
+            <template slot-scope="scope">
+              <dict-tag :options="dict.type.plan_status" :value="scope.row.state"/>
+            </template>
           </el-table-column>
           <el-table-column label="涓婃鐢熸垚鏃堕棿" align="center" prop="lastGenerationTime">
           </el-table-column>
@@ -151,7 +160,6 @@
         <el-form-item label="鐘舵��" prop="state">
           <el-radio-group style="width: 450px" v-model="form.status">
             <el-radio
-
               v-for="dict in dict.type.plan_status"
               :key="dict.value"
               :label="dict.value"
@@ -206,7 +214,7 @@
       </el-form>
       <el-tabs type="border-card" >
         <el-tab-pane label="璁惧娓呭崟" >
-          <Checkmachinery ref="machinerylist"  ></Checkmachinery>
+          <Checkmachinery ref="machinerylist"  @inSelected="onMachineryAdd"></Checkmachinery>
         </el-tab-pane>
         <el-tab-pane label="鐐规椤圭洰">
           <Checksubject ref="subjectlist"></Checksubject>
@@ -215,13 +223,14 @@
       <el-divider></el-divider>
         <el-button type="primary" @click="submitForm">纭� 瀹�</el-button>
         <el-button @click="cancel">鍙� 娑�</el-button>
-      <el-button type="primary" @click="cs">娴� 璇�</el-button>
+      <el-button @click="checkMachineryAdd">娴嬭瘯</el-button>
     </el-dialog>
   </div>
 </template>
 
 <script>
 import { listInspectionPlan, getInspectionPlan, delInspectionPlan, addInspectionPlan, updateInspectionPlan } from "@/api/main/em/inspectionPlan/inspectionPlan";
+import { listInspectionPlanArchives, delInspectionPlanArchives, addInspectionPlanArchives} from "@/api/main/em/inspectionPlanArchives/inspectionPlanArchives";
 import Checkmachinery from "./machinery.vue"
 import Checksubject from "./subject.vue"
 
@@ -247,6 +256,7 @@
       total: 0,
       // 鐐规淇濆吇璁″垝琛ㄦ牸鏁版嵁
       inspectionPlanList: [],
+      machineryList: [],
       // 寮瑰嚭灞傛爣棰�
       title: "",
       // 鏄惁鏄剧ず寮瑰嚭灞�
@@ -375,9 +385,11 @@
       };
       this.resetForm("form");
     },
-    /** 娴嬭瘯鎸夐挳 */
-    cs(){
-      this.$emit('inSelected',this.planCode);
+
+    onMachineryAdd(checkmachineryList){
+      if(checkmachineryList !=null && checkmachineryList.length >0){
+        this.machineryList = checkmachineryList
+      }
     },
     /** 鎼滅储鎸夐挳鎿嶄綔 */
     handleQuery() {
@@ -411,6 +423,14 @@
         this.titleName = "淇敼鐐规淇濆吇璁″垝";
       });
     },
+    /** 璁惧娓呭崟鏂板 */
+    checkMachineryAdd(){
+      for (let i = 0; i < this.machineryList.length; i++) {
+        this.machineryList[i].planCode = this.form.planCode
+        addInspectionPlanArchives(this.machineryList[i]).then(response =>{
+        });
+      }
+    },
     /** 鎻愪氦鎸夐挳 */
     submitForm() {
       this.$refs["form"].validate(valid => {

--
Gitblit v1.9.3