Pārlūkot izejas kodu

寻根点位排班

Shannon_mu 3 gadi atpakaļ
vecāks
revīzija
aaf0b3d5c5

+ 2 - 3
operationSupport/src/components/common/Header.vue

@@ -75,6 +75,7 @@ export default {
                 require('@/assets/img/icon_msg6.png'),
                 require('@/assets/img/icon_msg7.png'),
                 require('@/assets/img/icon_msg8.png'),
+                require('@/assets/img/icon_msg9.png'),
                 require('@/assets/img/icon_msg9.png')
             ]
         };
@@ -225,9 +226,7 @@ export default {
                         that.getMessageList();
                         that.getUnreadNumber();
                     }
-                } catch (e) {
-                   
-                }
+                } catch (e) {}
             };
 
             //连接关闭的回调方法

+ 9 - 22
operationSupport/src/views/flow/popups/AddOrEdit.vue

@@ -8,19 +8,9 @@
 <template>
     <div class="flowModal">
         <div class="tree-style" v-if="params.todo == 'add'">
-            <el-tree
-                :data="organList"
-                ref="tree"
-                node-key="id"
-                :highlight-current="true"
-                :props="defaultProps"
-                :expand-on-click-node="false"
-                default-expand-all
-                :check-strictly="true"
-                @check="changeOrgan"
-                :show-checkbox="true"
-            >
-            </el-tree>
+            <el-checkbox-group v-model="formData.companyIds">
+                <el-checkbox v-for="item in organList" :label="item.id" :key="item.id">{{ item.communityName }}</el-checkbox>
+            </el-checkbox-group>
         </div>
         <zz-form class="form" :cols="formCols" :data="formData" :rules="formRules" labelWidth="100" ref="form">
             <template slot="businessType">
@@ -49,6 +39,7 @@ export default {
     props: ['params'],
     data() {
         return {
+            formType: [],
             organList: [],
             defaultProps: {
                 children: 'orgs',
@@ -96,14 +87,6 @@ export default {
         };
     },
     methods: {
-        changeOrgan() {
-            var data = this.$refs.tree.getCheckedNodes();
-            let arr = [];
-            data.map((item, index) => {
-                arr.push(item.id);
-            });
-            this.formData.companyIds = arr;
-        },
         getOrgTreeList() {
             this.$http.get('/sc-community-web/assets/community/list').then(({ status, data, msg }) => {
                 if (status === 0 && data) {
@@ -135,7 +118,7 @@ export default {
                 } else {
                     posturl = '/sc-community/workflow/process/add';
                     if (!this.formData.companyIds.length) {
-                        this.$message.error('请勾选所属公司');
+                        this.$message.error('请勾选所属社区');
                         loading.close();
                         return;
                     }
@@ -208,6 +191,10 @@ export default {
         border-radius: 4px;
         overflow: auto;
         padding: 20px;
+        /deep/ .el-checkbox {
+            line-height: 26px;
+            display: block;
+        }
     }
     .form {
         height: 100%;

+ 25 - 9
operationSupport/src/views/patrolManagement/popups/addPoint.vue

@@ -11,7 +11,7 @@
                 <el-option v-for="(item, index) in unitArr" :key="index" :label="item.label" :value="item.id"></el-option>
             </el-select>
             <template slot="latitude">
-                <el-input v-model="formData.latitude" placeholder="请选择经纬坐标">
+                <el-input v-model="initDot" @change="initDotTggle" placeholder="请选择经纬坐标">
                     <i slot="suffix" class="zoniot_font zoniot-icon-dizhi" @click="QueryClick"></i>
                 </el-input>
             </template>
@@ -26,6 +26,7 @@ export default {
         MapPopup
     },
     data() {
+        const _this = this;
         return {
             formData: {
                 communityId: '',
@@ -36,13 +37,26 @@ export default {
                 latitude: '',
                 longitude: ''
             },
-            initDot: [],
+            initDot: '',
             communityTre: [],
             formRules: {
                 communityId: [this.$valid.selectRequired('公司')],
                 pointName: [this.$valid.inputRequired('巡更点名称')],
                 pointNo: [this.$valid.inputRequired('巡更点编号')],
-                latitude: [this.$valid.inputRequired('经纬度坐标'), this.$valid.selectRequired('经纬度坐标')]
+                latitude: this.$valid.custome({
+                    validator(rule, value, cb) {
+                        const rl = rule;
+                        if (!value) {
+                            rl.message = '请输入或选择坐标';
+                            cb(new Error());
+                        } else if (_this.initDot.split(',').length > 2) {
+                            rl.message = '一个巡更点只能有一个经纬度';
+                            cb(new Error());
+                        } else {
+                            cb();
+                        }
+                    }
+                })
             },
             formCols: [
                 [
@@ -100,8 +114,8 @@ export default {
                     title: title
                 });
             }).then((e) => {
-                this.initDot = [e.lat, e.lng];
-                this.formData.latitude = `${e.lat},${e.lng}`;
+                this.initDot = `${e.lat},${e.lng}`;
+                this.formData.latitude = e.lat;
                 this.formData.longitude = e.lng;
             });
         },
@@ -143,8 +157,8 @@ export default {
                     pointNo: this.formData.pointNo,
                     buildingId: this.formData.buildingId,
                     unit: this.formData.unit,
-                    latitude: this.initDot[0],
-                    longitude: this.initDot[1]
+                    latitude: this.formData.latitude,
+                    longitude: this.formData.longitude
                 };
                 if (this.params.todo == 'edit') {
                     url = '/sc-community/patrol/point/update';
@@ -175,6 +189,9 @@ export default {
         buildingChange(e) {
             this.formData.unit = '';
             this.nestedLoop(this.buildingArr, 'unit', 'unitArr', e);
+        },
+        initDotTggle() {
+            // console.log(this.initDot.split(','))
         }
     },
     created() {
@@ -185,8 +202,7 @@ export default {
             this.formData = newData;
             this.nestedLoop(this.communityTre, 'building', 'buildingArr', newData.communityId);
             this.nestedLoop(this.buildingArr, 'unit', 'unitArr', newData.buildingId);
-            this.initDot = [newData.latitude, newData.longitude];
-            this.formData.latitude = `${newData.latitude},${newData.longitude}`;
+            this.initDot = `${newData.latitude},${newData.longitude}`;
         }
     }
 };

+ 25 - 16
operationSupport/src/views/patrolManagement/popups/scheduling.vue

@@ -18,19 +18,11 @@
             </div>
         </div>
         <el-calendar first-day-of-week="7" v-model="monthValue">
-            <template
-                slot="dateCell"
-                slot-scope="{ date, data }"
-                v-if="data.type === 'current-month'"
-            >
+            <template slot="dateCell" slot-scope="{ date, data }" v-if="data.type === 'current-month'">
                 <div class="showDateDay">{{ date | dateNewType }}</div>
                 <div class="schedulingUser">
                     <template v-for="(item, index) in calendarData">
-                        <div
-                            :key="index"
-                            v-if="data.day == item.partrolDate"
-                            @click="add(data, item)"
-                        >
+                        <div :key="index" v-if="data.day == item.partrolDate" @click="add(data, item)">
                             <template v-for="itx in item.rosterUserDtos">
                                 <div :key="itx" class="listTime">
                                     <span>{{ itx.partrolTime }}</span>
@@ -41,9 +33,11 @@
                     </template>
                     <div
                         class="pointSet"
-                        v-if="date.getTime()>=new Date(new Date().toLocaleDateString()).getTime()"
+                        v-if="date.getTime() >= new Date(new Date().toLocaleDateString()).getTime() && !trueArr.includes(time)"
                         @click="add(data)"
-                    >点击设置</div>
+                    >
+                        点击设置
+                    </div>
                 </div>
             </template>
         </el-calendar>
@@ -56,7 +50,8 @@ export default {
             monthValue: '',
             findUser: [],
             thisObj: {},
-            calendarData: []
+            calendarData: [],
+            trueArr: [] //已有设置时间集合
         };
     },
     filters: {
@@ -89,7 +84,7 @@ export default {
                 new Date(dateDe).getTime() >= new Date(new Date().toLocaleDateString()).getTime();
                 return;
             }
-            new Promise(resolve => {
+            new Promise((resolve) => {
                 this.$store.dispatch('addPopup', {
                     url: '/patrolManagement/popups/schedulingAdd.vue',
                     width: '450px',
@@ -125,14 +120,16 @@ export default {
             this.$http.post('/sc-community/patrolRoute/getShiftInformation', obj).then(({ data, status, msg }) => {
                 if (!!data) {
                     this.calendarData = [];
+                    this.trueArr = [];
                     for (let inx in data) {
                         let rosterUserDtos = [];
-                        data[inx].map(item => {
+                        data[inx].map((item) => {
                             rosterUserDtos.push({
                                 partrolTime: item.patrolTime,
                                 partolName: item.partolName
                             });
                         });
+                        this.trueArr.push(this.$moment(inx).format('YYYY-MM-DD'));
                         this.calendarData.push({
                             partrolDate: this.$moment(inx).format('YYYY-MM-DD'),
                             rosterUserDtos: rosterUserDtos
@@ -173,6 +170,7 @@ export default {
         cursor: pointer;
         line-height: 35px;
         text-align: center;
+        color: #0eaeff;
     }
     /deep/ .el-calendar-table {
         &:not(.is-range) {
@@ -188,7 +186,18 @@ export default {
         }
         .el-calendar-day {
             height: 110px;
-            overflow: hidden;
+            overflow: auto;
+            &::-webkit-scrollbar {
+                width: 10px;
+            }
+            &::-webkit-scrollbar-track {
+                border-radius: 10px;
+                background: #c6c4c4a9;
+            }
+            &::-webkit-scrollbar-thumb {
+                border-radius: 10px;
+                background: #f4f7f9a8;
+            }
         }
     }
 }