Hwt 3 years ago
parent
commit
a132406ea6

+ 6 - 2
operationSupport/src/views/patrolManagement/patrolRoute.vue

@@ -118,6 +118,7 @@
       v-if="isLook === 'patrol'"
       @initPage="initPage"
       :patrolDetail="patrolDetail"
+      :disable='disable'
     ></add-patrol>
     <week-edit-page
       v-if="isLook === 'weekEd'"
@@ -177,7 +178,8 @@ export default {
       findUser: [],
       thisObj: {},
       mixins_post: 'post',
-      patrolDetail: {}
+      patrolDetail: {},
+      disable: ''
     };
   },
   created () {
@@ -220,10 +222,12 @@ export default {
       });
     },
     add () {
+      this.disable = '2';
+      this.patrolDetail = {};
       this.isLook = 'patrol';
     },
     details (row) {
-      debugger
+      this.disable = '1';
       this.patrolDetail = row;
       this.isLook = 'patrol';
     },

+ 89 - 28
operationSupport/src/views/patrolManagement/popups/addPatrol.vue

@@ -18,6 +18,7 @@
             v-model="ruleForm.communityId"
             placeholder="所属社区"
             clearable
+            :disabled="this.disable == '1' ? true : false"
           >
             <el-option
               v-for="(item, index) in $parent.communityArr"
@@ -33,6 +34,7 @@
         >
           <el-input
             v-model="ruleForm.routeName"
+            :disabled="this.disable == '1' ? true : false"
             placeholder="请输入巡更路线名称"
           ></el-input>
         </el-form-item>
@@ -49,7 +51,8 @@
                             key: 'id',
                             label: 'pointName',
                             lan: 'latitude',
-                            lng: 'longitude'
+                            lng: 'longitude',
+                            
                         }"
             :titles="['待选列表', '已选列表']"
             @change="handleChange"
@@ -91,6 +94,7 @@
             end-placeholder="选择结束日期"
             @change="effectiveDateToggle"
             :editable="false"
+            :disabled="this.disable == '1' ? true : false"
           ></el-date-picker>
         </el-form-item>
         <el-form-item
@@ -232,10 +236,11 @@
 <script>
 import mapValue from './mapValue.vue';
 export default {
-  props: ['patrolDetail'],
+  props: ['patrolDetail', 'disable'],
   components: { mapValue },
   data () {
     return {
+      disables: false,
       ruleForm: {
         communityId: '',
         routeName: '',
@@ -275,6 +280,7 @@ export default {
       this.getPoint(e);
     },
     periodValue (e) {
+      debugger
       this.ruleForm.periodValue = e.join();
     }
   },
@@ -336,11 +342,25 @@ export default {
       this.$emit('initPage');
     },
     getPoint (id) {
-      this.ruleForm.routePointRelationDtos = [];
-      this.targetData = [];
-      this.$http.get('/czc-community/patrol/point/getPointList', { id, id }).then(({ data, status, msg }) => {
-        this.patrolArr = data;
-      });
+      if (JSON.stringify(this.patrolDetail) == "{}") {
+        this.ruleForm.routePointRelationDtos = [];
+        this.targetData = [];
+        this.$http.get('/czc-community/patrol/point/getPointList', { id, id }).then(({ data, status, msg }) => {
+          this.patrolArr = data;
+        });
+      } else {
+        this.$http.get('/czc-community/patrol/point/getPointList', { id, id }).then(({ data, status, msg }) => {
+
+          this.patrolArr = data;
+          for (let i = 0; i < this.patrolArr.length; i++) {
+
+            this.patrolArr[i]['disabled'] = true;
+          }
+          console.log(this.patrolArr)
+          this.handleChange();
+        });
+      }
+
     },
     handleChange () {
       this.$nextTick(() => {
@@ -364,32 +384,73 @@ export default {
       }
     },
     optionUp (nub, item) {
-      let thisArr = this.ruleForm.routePointRelationDtos;
-      let okArr = this.$refs.transferTude.targetData;
-      let newArr = [];
-      let inx = null;
-      thisArr.map((list, index) => {
-        if (list == item.id) {
-          inx = index;
-        }
-        return inx;
-      });
-      if (inx !== null && thisArr.length > 1) {
-        //向下
-        if (nub == 1 && inx < thisArr.length - 1) {
-          thisArr.splice(inx + 1, 1, ...thisArr.splice(inx, 1, thisArr[inx + 1]));
-          okArr.splice(inx + 1, 1, ...okArr.splice(inx, 1, okArr[inx + 1]));
-        } else if (nub != 1 && inx > 0) {
-          thisArr.splice(inx, 1, ...thisArr.splice(inx - 1, 1, thisArr[inx]));
-          okArr.splice(inx, 1, ...okArr.splice(inx - 1, 1, okArr[inx]));
+      if (this.disable != '1') {
+        let thisArr = this.ruleForm.routePointRelationDtos;
+        let okArr = this.$refs.transferTude.targetData;
+        let newArr = [];
+        let inx = null;
+        thisArr.map((list, index) => {
+          if (list == item.id) {
+            inx = index;
+          }
+          return inx;
+        });
+        if (inx !== null && thisArr.length > 1) {
+          //向下
+          if (nub == 1 && inx < thisArr.length - 1) {
+            thisArr.splice(inx + 1, 1, ...thisArr.splice(inx, 1, thisArr[inx + 1]));
+            okArr.splice(inx + 1, 1, ...okArr.splice(inx, 1, okArr[inx + 1]));
+          } else if (nub != 1 && inx > 0) {
+            thisArr.splice(inx, 1, ...thisArr.splice(inx - 1, 1, thisArr[inx]));
+            okArr.splice(inx, 1, ...okArr.splice(inx - 1, 1, okArr[inx]));
+          }
+          this.targetData = okArr;
         }
-        this.targetData = okArr;
       }
+
     }
   },
   created () {
-    debugger;
-    this.patrolDetail;
+    if (JSON.stringify(this.patrolDetail) == "{}") {
+      this.disables = this.disable == '1' ? true : false;
+    } else {
+      debugger
+      this.disable;
+
+
+      this.disables = this.disable == '1' ? true : false;
+
+      this.ruleForm.communityId = this.patrolDetail.communityId;
+      this.ruleForm.routeName = this.patrolDetail.routeName;
+      this.effectiveDate[0] = this.patrolDetail.startDate;
+      this.effectiveDate[1] = this.patrolDetail.endDate;
+      this.timePeriod = [];
+      let dataRes = this.patrolDetail.timePeriod.split(",");
+      dataRes.map((item, index) => {
+        this.timePeriod.push({
+          startTime: (item).substr(0, 5),
+          endTime: (item).substr(6, 5),
+        })
+      });
+
+      // periodType
+      this.ruleForm.periodType = this.patrolDetail.periodType;
+
+
+      let data = [];
+      this.periodValue = [];
+      data = (this.patrolDetail.periodValue).split(",");
+      data.map((item) => {
+        this.periodValue.push(Number(item))
+      });
+      this.ruleForm.positioningDistance = this.patrolDetail.positioningDistance;
+      this.ruleForm.cameraSettings = this.patrolDetail.cameraSettings;
+      this.ruleForm.signFlag = this.patrolDetail.signFlag;
+      this.ruleForm.remark = this.patrolDetail.remark;
+      // 巡更点
+      this.ruleForm.routePointRelationDtos = [20, 21, 22];
+
+    }
   }
 };
 </script>

+ 1 - 1
operationSupport/src/views/propertyManagement/stepPage/informAdd.vue

@@ -767,7 +767,7 @@ export default {
               let obj = {
                 noticeId: '',
                 userId: item,
-                userType: 2
+                userType: 0
               };
               userVos.push(obj);
             });