From 0426c72922004cbaa47fafbb0ee6eb5d9386a063 Mon Sep 17 00:00:00 2001
From: luobisheng <727299681@qq.com>
Date: 星期三, 07 十二月 2022 15:50:11 +0800
Subject: [PATCH] 预警研判增加调度弹窗

---
 src/views/intelligentPatrol/studyJudge/index.vue |   83 +++++++++++++++++++++++++++++------------
 1 files changed, 59 insertions(+), 24 deletions(-)

diff --git a/src/views/intelligentPatrol/studyJudge/index.vue b/src/views/intelligentPatrol/studyJudge/index.vue
index 921fa55..f0c9402 100644
--- a/src/views/intelligentPatrol/studyJudge/index.vue
+++ b/src/views/intelligentPatrol/studyJudge/index.vue
@@ -31,7 +31,7 @@
               <span>鎶ヨ璁板綍</span>
               <span>涔卞仠涔辨斁杩濇硶鍗犻亾</span>
             </div>
-            <el-form ref="currentEvent" label-width="120px" :model="currentEvent" :rules="rules">
+            <el-form ref="currentEvent" label-width="120px" :model="eventInfoData" :rules="rules">
               <el-form-item label="浜嬩欢缂栧彿:">
                 <span>{{ currentEvent.code }}</span>
               </el-form-item>
@@ -48,33 +48,33 @@
                 <span>{{ currentEvent.conntinueTime }}</span>
               </el-form-item>
               <el-form-item label="鍏宠仈搴楅摵" prop="store">
-                <el-select v-model="currentEvent.store" @change="selectStoreChange" placeholder="璇烽�夋嫨鍏宠仈搴楅摵">
+                <el-select v-model="eventInfoData.store" @change="selectStoreChange" placeholder="璇烽�夋嫨鍏宠仈搴楅摵">
                   <el-option v-for="store in storeList" :value="store.id" :label="store.storeName" :key="store.id" />
                 </el-select>
               </el-form-item>
-              <el-form-item v-if="currentEvent.store" label="搴楅摵寰楀垎:">
-                <span>{{ selectStoreChange(currentEvent.store).storeScore }}</span>
+              <el-form-item v-if="eventInfoData.store" label="搴楅摵寰楀垎:">
+                <span>{{ selectStoreChange(eventInfoData.store).storeScore }}</span>
               </el-form-item>
               <el-form-item label="澶勭悊鎰忚:" prop="advice">
-                <el-radio-group v-model="currentEvent.advice">
+                <el-radio-group v-model="eventInfoData.advice">
                   <el-radio :label="item.id" v-for="item in adviceList" :key="item.id">{{ item.label }}</el-radio>
                 </el-radio-group>
               </el-form-item>
               <el-form-item label="澶х被鍚嶇О:" prop="categoryId">
-                <el-select v-model="currentEvent.categoryId" placeholder="璇烽�夋嫨澶х被鍚嶇О" @change="categoryChange">
+                <el-select v-model="eventInfoData.categoryId" placeholder="璇烽�夋嫨澶х被鍚嶇О" @change="categoryChange">
                   <el-option v-for="category in categoryOptions" :key="category.id" :value="category.id" :label="category.name" />
                 </el-select>
               </el-form-item>
               <el-form-item label="灏忕被鍚嶇О:" prop="typeId">
-                <el-select v-model="currentEvent.typeId" placeholder="璇烽�夋嫨灏忕被鍚嶇О">
+                <el-select v-model="eventInfoData.typeId" placeholder="璇烽�夋嫨灏忕被鍚嶇О">
                   <el-option v-for="type in typeOptions" :key="type.id" :value="type.id" :label="type.name" />
                 </el-select>
               </el-form-item>
               <el-form-item label="杞︾墝鍙�:" prop="carNumber">
-                <el-input v-model="currentEvent.carNumber" placeholder="璇峰~鍐欒溅鐗屽彿鐮�"></el-input>
+                <el-input v-model="eventInfoData.carNumber" placeholder="璇峰~鍐欒溅鐗屽彿鐮�"></el-input>
               </el-form-item>
               <el-form-item label="澶囨敞:" prop="description">
-                <el-input type="textarea" :rows="5" v-model="currentEvent.description"></el-input>
+                <el-input type="textarea" :rows="5" v-model="eventInfoData.description"></el-input>
               </el-form-item>
               <el-form-item>
                 <el-button :disabled="currentPage === 1" @click="pageChange('prev')">涓婁竴鏉�</el-button>
@@ -86,6 +86,9 @@
         </div>
       </div>
     </div>
+    <el-dialog :visible="isShowDialog" title="璋冨害淇℃伅">
+      <MyDispatch v-if="isShowDialog" :mytype="1" @confirmInspection="handleConfirm" :isGetData="true" @changeDialog="closeDialog"></MyDispatch>
+    </el-dialog>
   </div>
 </template>
 
@@ -95,10 +98,13 @@
 import { getStoreInfoList } from "@/api/operate/storeManagement";
 import { FILE_ORIGINAL_URL } from "@/utils";
 import { validateCarNum } from "@/utils/validate";
+import MyDispatch from '@/components/dispatch';
 
 export default {
+  components: { MyDispatch },
   created() {
     this.getInspectionData();
+    this.initEventParams();
     basecase.getInspectionCountData()
         .then(res => {
           this.countData = res;
@@ -145,11 +151,11 @@
       currentEvent: {},
       adviceList: [
         {
-          id: 1,
+          id: 2,
           label: '涓婃姤',
         },
         {
-          id: 2,
+          id: 6,
           label: '璋冨害',
         },
         {
@@ -161,6 +167,7 @@
           label: '鏆備笉澶勭悊',
         },
       ],
+      eventInfoData: null,
       rules:{
         advice:[
           {
@@ -184,7 +191,8 @@
       categoryOptions: [],
       typeOptions: [],
       storeList: [],
-      typeList: []
+      typeList: [],
+      isShowDialog: false
     }
   },
   methods:{
@@ -213,30 +221,57 @@
     handleConfirm(){
       this.$refs.currentEvent.validate((flag)=>{
         if(flag){
-          this.currentEvent.linkShop = 0;
-          if (this.currentEvent.store) {
-            const selectedStore = this.selectStoreChange(this.currentEvent.store);
-            this.currentEvent.shopName = selectedStore.storeName;
-            this.currentEvent.linkShop = 1;
+          this.eventInfoData.baseId = this.currentEvent.code;
+
+          // 璋冨害
+          if (this.eventInfoData.advice === 6) {
+            this.isShowDialog = true;
+          } else {
+            this.confirmInspection();
           }
-          basecase.confirmInspection(this.currentEvent)
-              .then(() => {
-                this.$message.success('鎿嶄綔鎴愬姛');
-                this.getInspectionData();
-              })
-              .catch(err => this.$message.error(err))
         } else {
           this.$message.warning('璇锋鏌ュ繀濉」');
         }
       })
     },
 
+    initEventParams() {
+      this.eventInfoData = {
+        baseId: null,
+        store: null,
+        advice: null,
+        categoryId: null,
+        typeId: null,
+        carNumber: null,
+        description: null,
+        linkShop: 0,
+        shopName: null
+      }
+    },
+
     categoryChange(id) {
       this.typeOptions = this.typeList.filter(type => type.parentId === id);
     },
 
+    confirmInspection(data) {
+      basecase.confirmInspection({ ...this.eventInfoData, ...data })
+          .then(() => {
+            this.$message.success('鎿嶄綔鎴愬姛');
+            this.getInspectionData();
+            this.initEventParams();
+          })
+          .catch(err => this.$message.error(err))
+    },
+
+    closeDialog() {
+      this.isShowDialog = false;
+    },
+
     selectStoreChange(id) {
-      return this.storeList.find(store => store.id === id);
+      const selectedStore = this.storeList.find(store => store.id === id);
+      this.eventInfoData.shopName = selectedStore.storeName;
+      this.eventInfoData.linkShop = 1;
+      return selectedStore;
     }
   }
 }

--
Gitblit v1.8.0