From d36a3b011cd63274a9470b8fe63971bb46a2c136 Mon Sep 17 00:00:00 2001
From: Your Name <123456>
Date: 星期三, 11 五月 2022 12:03:36 +0800
Subject: [PATCH] Merge branch 'master' of https://sinanoaq.cn:8888/r/ztqt

---
 src/views/majorHazardSourceMonitoring/productionEquipment/index.vue |   49 +++++++++++++++++++++++++++++++++++++++++++++++--
 1 files changed, 47 insertions(+), 2 deletions(-)

diff --git a/src/views/majorHazardSourceMonitoring/productionEquipment/index.vue b/src/views/majorHazardSourceMonitoring/productionEquipment/index.vue
index a2d0b13..967eb47 100644
--- a/src/views/majorHazardSourceMonitoring/productionEquipment/index.vue
+++ b/src/views/majorHazardSourceMonitoring/productionEquipment/index.vue
@@ -36,6 +36,8 @@
             </el-table-column>
             <el-table-column prop="name" align="center" label="设备名称">
             </el-table-column>
+            <el-table-column prop="areaName" align="center" label="设备区域">
+            </el-table-column>
             <el-table-column label="状态" align="center">
                 <template slot-scope="scope">
                     <span v-if="scope.row.status == 0">在用</span>
@@ -129,11 +131,30 @@
                                 v-model="form.userId"
                                 placeholder="请选择负责人"
                                 style="width: 100%"
+                                filterable
                             >
                                 <el-option
                                     v-for="item in personInCharge"
                                     :key="item.id"
                                     :label="item.realname"
+                                    :value="item.id"
+                                >
+                                </el-option>
+                            </el-select>
+                        </el-form-item>
+                    </el-col>
+                    <el-col :span="12">
+                        <el-form-item label="设备区域" prop="areaId">
+                            <el-select
+                                v-model="form.areaId"
+                                placeholder="请选择设备区域"
+                                style="width: 100%"
+                                filterable
+                            >
+                                <el-option
+                                    v-for="item in areaList"
+                                    :key="item.id"
+                                    :label="item.value"
                                     :value="item.id"
                                 >
                                 </el-option>
@@ -159,6 +180,7 @@
         majorEquipmentDel,
         majorEquipmentLis
     } from "@/api/majorEquipment.js";
+    import {getItemsByType} from '@/api/dictionary'
     export default {
         data() {
             return {
@@ -197,16 +219,26 @@
                     name:{ required: true, message: "设备名称不能为空", trigger: "change" },
                     status:{ required: true, message: "状态不能为空", trigger: "change" },
                     userId:{ required: true, message: "负责人不能为空", trigger: "change" },
+                    areaId:{ required: true, message: "设备区域不能为空", trigger: "change" },
                 },
                 unitIdOptions:[{label:"在用",value:0},{label:"停用",value:1}],
                 personInCharge:[],
+                areaList:[],
             };
         },
         created() {
             this.elementManagementL();
+            this.initDictionaryAllItems()
             this.productionMajorEquipmentErt();
         },
         methods: {
+            initDictionaryAllItems(){
+                getItemsByType('设备区域').then(res=>{
+                    if (res.data.code ==200){
+                        this.areaList=res.data.result
+                    }
+                })
+            },
             productionMajorEquipmentErt(){
                 majorEquipmentLis().then(res=>{
                     if (res.data.code ==200){
@@ -239,7 +271,7 @@
                     };
                 } else {
                     this.title = "编辑";
-                    this.form = value;
+                    this.form=JSON.parse(JSON.stringify(value));
                 }
             },
             AddelementManagement() {
@@ -257,6 +289,10 @@
                                         title: "成功",
                                     });
                                 } else {
+                                    this.$message({
+                                        type: "warning",
+                                        message: res.data.message,
+                                    });
                                 }
                             });
                         } else {
@@ -271,7 +307,10 @@
                                         title: "成功",
                                     });
                                 } else {
-
+                                    this.$message({
+                                        type: "warning",
+                                        message: res.data.message,
+                                    });
                                 }
                             });
                         }
@@ -294,6 +333,12 @@
                                    type: "success",
                                    duration: 2000,
                                });
+                           }else {
+                               this.$message({
+                               type: "warning",
+                               message: res.data.message,
+                           });
+
                            }
                        });
                     })

--
Gitblit v1.9.2