From 998b75f0d4aaed03001ec4246cd4f3b4b0743b7e Mon Sep 17 00:00:00 2001
From: guoshilong <123456>
Date: Wed, 23 Nov 2022 10:14:28 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'

---
 src/views/taskinfo/taskinfoPlan.vue |   48 +++++++++++++++++++++++++++++++++---------------
 1 files changed, 33 insertions(+), 15 deletions(-)

diff --git a/src/views/taskinfo/taskinfoPlan.vue b/src/views/taskinfo/taskinfoPlan.vue
index 42831ee..95f34ef 100644
--- a/src/views/taskinfo/taskinfoPlan.vue
+++ b/src/views/taskinfo/taskinfoPlan.vue
@@ -1,6 +1,6 @@
 <template>
   <basic-container>
-    <avue-crud v-show="!isSetPlanUser" :option="option"
+    <avue-crud v-show="!isSetPlanUser&&!detailVisible" :option="option"
                :table-loading="loading"
                :data="data"
                :page.sync="page"
@@ -11,6 +11,7 @@
                @row-update="rowUpdate"
                @row-save="rowSave"
                @row-del="rowDel"
+               @row-dblclick="rowClick"
                @search-change="searchChange"
                @search-reset="searchReset"
                @selection-change="selectionChange"
@@ -39,7 +40,7 @@
             <!--divided 是一个划分线-->
             <el-dropdown-item icon="el-icon-edit" :size="size" :type="type"
                               :disabled="row.state >= 1"
-                              @click.native="$refs.crud.rowEdit(row,index)">修 改</el-dropdown-item>
+                              @click.native="$refs.crud.rowEdit(row,index)">编 辑</el-dropdown-item>
           </el-col>
           <el-col :span="12">
             <el-dropdown-item icon="el-icon-delete" :size="size" :type="type"
@@ -61,21 +62,25 @@
 
       </template>
     </avue-crud>
+    <!--设置巡检人-->
     <taskplan-user v-show="isSetPlanUser" ref="taskplanUser" @setPlanUser="setPlanUser"></taskplan-user>
+    <!--查看详情-->
+    <taskinfo-plan-detail v-if="detailVisible" ref="detailVisible" :detailInfo="detailInfo" @isDetail="isDetail"></taskinfo-plan-detail>
   </basic-container>
 </template>
 
 
 
 <script>
-  import {getList, getDetail, add, update, remove, changeStatus} from "@/api/taskinfo/taskinfoPlan";
+  import {getList, add, update, remove, changeStatus} from "@/api/taskinfo/taskinfoPlan";
   import option from "@/const/taskinfo/taskinfoPlan";
   import {mapGetters} from "vuex";
   import TaskplanUser from "@/views/taskinfo/taskplanUser";
   import OpenLayersMap from "@/components/OpenLayersMap/index";
+  import TaskinfoPlanDetail from "@/views/taskinfo/taskinfoPlanDetail";
 
   export default {
-    components: {TaskplanUser,OpenLayersMap},
+    components: {TaskinfoPlanDetail, TaskplanUser,OpenLayersMap},
     data() {
       return {
         isSetPlanUser:false,
@@ -89,7 +94,9 @@
         },
         selectionList: [],
         option: option,
-        data: []
+        data: [],
+        detailVisible:false,
+        detailInfo:{},
       };
     },
     computed: {
@@ -177,15 +184,10 @@
           });
       },
       beforeOpen(done, type) {
-        if (["edit", "view"].includes(type)) {
-          getDetail(this.form.id).then(res => {
-            this.form = res.data.data;
-            console.log( this.form.routeRange,123456)
-
-            // this.form.routeRange = '\'' + this.form.routeRange + '\''
-          });
-        } else {
+        if (["add"].includes(type)) {
           this.form.status = 2
+        }else if (["edit"].includes(type)) {
+          this.form.routeRange = '\'' + this.form.routeRange + '\''
         }
         done();
       },
@@ -195,6 +197,11 @@
       },
       searchChange(params, done) {
         this.query = params;
+        if (this.query.daterange){
+          this.query.startCreateTime = this.query.daterange[0]
+          this.query.endCreateTime = this.query.daterange[1]
+          this.query.daterange = null
+        }
         this.page.currentPage = 1;
         this.onLoad(this.page, params);
         done();
@@ -223,7 +230,6 @@
           this.data = data.records;
           this.loading = false;
           this.selectionClear();
-          console.log(this.data)
         });
       },
       isChangeStatus(id,status) {
@@ -238,7 +244,11 @@
       },
       goToTaskplanUser(planId) {
         // this.$router.push({ path: "/taskinfo/taskplanUser", query: {planId:planId} });
-        this.$refs.taskplanUser.getUserList();
+        var page = {
+          currentPage:1,
+          pageSize:this.page.pageSize
+        }
+        this.$refs.taskplanUser.onLoad(page,{planId:planId});
         this.setPlanUser()
       },
       setPlanUser() {
@@ -247,6 +257,14 @@
       toData(toData) {
         this.form.routeRange = toData
       },
+      //点击当前行事件
+      rowClick(val){
+        this.detailInfo = val
+        this.isDetail();
+      },
+      isDetail(){
+        this.detailVisible = !this.detailVisible
+      }
     }
   };
 </script>

--
Gitblit v1.9.3