Browse Source

Merge branch 'new_web' of http://39.108.172.131:3000/Shannon_mu/SmartCommunity into new_web

DESKTOP-4G80JF4\long 3 years ago
parent
commit
47e1bc4471

+ 2 - 2
operationSupport/src/views/facilityInspections/popups/add.vue

@@ -202,7 +202,7 @@ export default {
                     });
             });
         },
-        
+
         findUserToggle() {
             this.formData.peopleName = this.$refs.userName.getCheckedNodes()[0].label;
         },
@@ -276,7 +276,7 @@ export default {
     created() {
         this.deviceArr = this.params.deviceArr;
         this.findUser = this.params.arrData;
-        if (!!this.params.data.id) {
+        if (!!this.params.data && !!this.params.data.id) {
             new Promise((resolve) => {
                 this.getDetails(this.params.data.id, resolve);
             }).then((_) => {

+ 3 - 3
operationSupport/src/views/facilityInspections/popups/details.vue

@@ -35,7 +35,7 @@
                 @page-change="pageChange"
             >
                 <template slot="picturePath" slot-scope="scope">
-                    <div class="imgVdio" v-for="item in scope.row.repairFile.split(',')" :key="item">
+                    <div class="imgVdio" v-for="item in scope.row.picturePath.split(',')" :key="item">
                         <video v-if="typeVideo(item)" :src="item" @click="lookVideos(item)"></video>
                         <el-image class="imgs" v-else :src="item" :preview-src-list="[item]"></el-image>
                     </div>
@@ -104,7 +104,7 @@ export default {
                 },
                 {
                     label: '设备名称',
-                    prop: 'inspectionName'
+                    prop: 'typeValue'
                 },
                 {
                     label: '地址',
@@ -112,7 +112,7 @@ export default {
                 },
                 {
                     label: '巡检时间',
-                    prop: 'inspectionTime'
+                    prop: 'checkTime'
                 },
                 {
                     label: '巡检结果',

+ 64 - 20
operationSupport/src/views/patrolManagement/index.vue

@@ -21,13 +21,16 @@
             :pageset="mixins_pageset"
             @page-change="pageChange"
         >
+            <template slot="pointQrcode">
+                <i class="zoniot_font zoniot-icon-erweimachakan" style="cursor: inherit"></i>
+            </template>
             <template slot-scope="scope" slot="opt">
                 <div class="opt">
                     <el-tooltip effect="light" placement="bottom" content="下载二维码">
                         <i class="zoniot_font zoniot-icon-erweimaxiazai" @click="lookImg(scope.row)"></i>
                     </el-tooltip>
                     <el-tooltip effect="light" placement="bottom" content="编辑">
-                        <i class="zoniot_font zoniot-icon-bianji" @click="addOrEdit('edit', scope)"></i>
+                        <i class="zoniot_font zoniot-icon-bianji" @click="addOrEdit('edit', scope.row)"></i>
                     </el-tooltip>
                     <el-tooltip effect="light" placement="bottom" content="删除">
                         <i class="zoniot_font zoniot-icon-shanchu redText" @click="deleteOne(scope.row.id)"></i>
@@ -39,7 +42,7 @@
         <el-dialog title="下载二维码" :visible.sync="centerDialogVisible" width="400px">
             <div class="QRImg" ref="QRImg">
                 <img :src="QRImg" alt="门禁设备二维码" />
-                <div>{{ DeviceName }} - {{ deviceNo }}</div>
+                <div>{{ pointName }} - {{ pointNo }}</div>
             </div>
             <span slot="footer" class="dialog-footer">
                 <el-button type="primary" @click="downImg">下载</el-button>
@@ -51,13 +54,18 @@
 <script>
 import list from '@utils/list.js';
 import html2canvas from 'html2canvas';
+import scheduling from './popups/scheduling.vue';
 export default {
     mixins: [list],
     name: 'patrolManagement',
+    components: {
+        scheduling
+    },
     data() {
         let _this = this;
         return {
             communityArr: [],
+            communityTre: [],
             cols: [
                 {
                     label: '所属社区',
@@ -65,26 +73,25 @@ export default {
                 },
                 {
                     label: '楼栋',
-                    prop: 'address'
+                    prop: 'buildingName'
                 },
                 {
                     label: '单元',
-                    prop: 'repairName'
+                    prop: 'unit'
                 },
                 {
                     label: '巡更点名称',
-                    prop: 'repairPhone'
+                    prop: 'pointName'
                 },
                 {
                     label: '位置编号',
-                    prop: 'repairContent'
+                    prop: 'pointNo'
                 },
                 {
                     label: '巡更点二维码',
-                    prop: 'repairFile',
-                    slot: 'repairFile'
+                    prop: 'pointQrcode',
+                    slot: 'pointQrcode'
                 },
-
                 {
                     label: '操作',
                     prop: 'id',
@@ -93,15 +100,18 @@ export default {
             ],
             findUser: [],
             centerDialogVisible: false,
-            mixins_post: 'get'
+            mixins_post: 'post',
+            pointName: '',
+            pointNo: ''
         };
     },
     created() {
         this.getorgTree();
-        this.mixins_dataUrl = '/sc-community-web/patrolRoute/page';
+        this.mixins_dataUrl = '/sc-community/patrol/point/page';
         this.mixins_query = {};
         this.mixins_search();
         this.getUserList();
+        this.getCommunity();
     },
     mounted() {},
     methods: {
@@ -120,12 +130,16 @@ export default {
                 this.findUser = data;
             });
         },
-
+        getCommunity() {
+            this.$http.get('/sc-community/assets/tree/community/find').then(({ data, status, msg }) => {
+                this.communityTre = data;
+            });
+        },
         lookImg(row) {
             let _this = this;
-            this.DeviceName = row.deviceName;
-            this.deviceNo = row.deviceNo;
-            this.getBinary('/sc-community/device/generateQRCodeImage', { id: row.id, type: 'DEVICE' }, function (data) {
+            this.pointName = row.pointName;
+            this.pointNo = row.pointNo;
+            this.getBinary('/sc-community/device/generateQRCodeImage', { id: row.id, type: 'PATROLPOINT' }, function (data) {
                 _this.QRImg = window.URL.createObjectURL(data);
                 _this.centerDialogVisible = !_this.centerDialogVisible;
             });
@@ -134,7 +148,7 @@ export default {
             html2canvas(this.$refs.QRImg).then((canvas) => {
                 let dataURL = canvas.toDataURL('image/png');
                 let a = document.createElement('a');
-                a.download = `${this.DeviceName} - ${this.deviceNo}`;
+                a.download = `${this.pointName} - ${this.pointNo}`;
                 a.href = dataURL;
                 document.body.appendChild(a);
                 a.click();
@@ -170,24 +184,54 @@ export default {
             };
             xmlhttp.send();
         },
-        addOrEdit() {
+        addOrEdit(todo, row) {
+            let title = '添加巡更点';
+            if (todo == 'edit') {
+                title = '修改巡更点';
+            }
             new Promise((resolve) => {
-                let title = '添加工单';
                 this.$store.dispatch('addPopup', {
-                    url: '/workOrders/popups/add.vue',
+                    url: '/patrolManagement/popups/addPoint.vue',
                     width: '500px',
                     height: '500px',
                     props: {
-                        callback: resolve
+                        callback: resolve,
+                        communityArr: this.communityArr,
+                        communityTre: this.communityTre,
+                        data: row,
+                        todo
                     },
                     title: title
                 });
             }).then(() => {
                 this.mixins_search();
             });
+        },
+        deleteOne(id) {
+            this.$msgBox(`删除`, '删除后将无法恢复,请问是否继续?')
+                .then(() => {
+                    this.$http.get('/sc-community/patrol/point/delete', { id: id }).then(({ status, data, msg }) => {
+                        if (0 === status) {
+                            this.$message({
+                                type: 'success',
+                                message: '删除成功!'
+                            });
+                            this.mixins_search();
+                        }
+                    });
+                })
+                .catch(() => {});
         }
     }
 };
 </script>
 <style scoped lang='scss'>
+.QRImg > div {
+    position: absolute;
+    width: 100%;
+    bottom: 0;
+    text-align: center;
+    left: 50%;
+    transform: translateX(-50%);
+}
 </style>

+ 140 - 0
operationSupport/src/views/patrolManagement/patrolRecords.vue

@@ -0,0 +1,140 @@
+<template>
+    <div class="main">
+        <div class="search">
+            <el-input placeholder="请输入巡更路线/人员" class="search-input" clearable v-model="mixins_query.partolName"></el-input>
+            <el-select class="width90" placeholder="请选择巡更状态" v-model="mixins_query.patrolStatus" clearable>
+                <el-option label="待执行" :value="1"></el-option>
+                <el-option label="执行中" :value="2"></el-option>
+                <el-option label="已完成" :value="3"></el-option>
+                <el-option label="已完成(超时)" :value="4"></el-option>
+                <el-option label="已逾期" :value="5"></el-option>
+            </el-select>
+            <el-date-picker
+                v-model="times"
+                value-format="yyyy-MM-dd"
+                type="daterange"
+                range-separator="至"
+                start-placeholder="开始日期"
+                end-placeholder="结束日期"
+                @change="effectiveDateToggle"
+            ></el-date-picker>
+            <el-button type="primary" class="search-btn" @click="mixins_search" icon="el-icon-search">查询 </el-button>
+        </div>
+        <zz-table
+            :cols="cols"
+            :settings="{ showIndex: true, stripe: true }"
+            :loading="mixins_onQuery"
+            :data="mixins_list"
+            :pageset="mixins_pageset"
+            @page-change="pageChange"
+        >
+            <template slot-scope="scope" slot="opt">
+                <div class="opt">
+                    <el-tooltip effect="light" placement="bottom" content="详情">
+                        <i class="zoniot_font zoniot-icon-xiangqing" @click="lookDetails(scope.row)"></i>
+                    </el-tooltip>
+                </div>
+            </template>
+        </zz-table>
+    </div>
+</template>
+
+<script>
+import list from '@utils/list.js';
+export default {
+    mixins: [list],
+    name: 'workOrdersRecords',
+    data() {
+        return {
+            communityArr: [],
+            cols: [
+                {
+                    label: '所属社区',
+                    prop: 'communityName'
+                },
+                {
+                    label: '巡更路线',
+                    prop: 'patrolRouteId'
+                },
+                {
+                    label: '巡更人员',
+                    prop: 'currentUsers'
+                },
+                {
+                    label: '巡更日期',
+                    prop: 'patrolDate'
+                },
+                {
+                    label: '巡更时间',
+                    prop: 'patrolTime'
+                },
+                {
+                    label: '状态',
+                    prop: 'patrolStatus',
+                    format(val) {
+                        if (val == 1) {
+                            return '待执行';
+                        } else if (val == 2) {
+                            return '执行中';
+                        } else if (val == 3) {
+                            return '已完成';
+                        } else if (val == 4) {
+                            return '已完成(超时)';
+                        } else if (val == 5) {
+                            return '已逾期';
+                        }
+                        return '--';
+                    }
+                },
+                {
+                    label: '操作',
+                    prop: 'id',
+                    slot: 'opt'
+                }
+            ],
+            times: [],
+            mixins_post: 'post'
+        };
+    },
+    created() {
+        this.mixins_dataUrl = '/sc-community/patrolRecord/page';
+        this.mixins_query = {};
+        this.mixins_search();
+    },
+    mounted() {},
+    methods: {
+        effectiveDateToggle(va) {
+            let arr = va;
+            if (!arr) {
+                arr = ['', ''];
+            }
+            this.mixins_query.startTime = arr[0];
+            this.mixins_query.endTime = arr[1];
+        },
+        lookDetails(row) {
+            new Promise((resolve) => {
+                this.$store.dispatch('addPopup', {
+                    url: '/facilityInspections/popups/details.vue',
+                    width: '900px',
+                    height: '581px',
+                    props: {
+                        data: row,
+                        callback: resolve
+                    },
+                    showConfirmButton: true,
+                    showCancelButton: true,
+                    hideStar: true,
+                    title: '巡检详情'
+                });
+            }).then(() => {
+                this.mixins_search();
+            });
+        }
+    }
+};
+</script>
+<style scoped lang='scss'>
+.imgVdio img {
+    width: 64px;
+}
+</style>

+ 122 - 0
operationSupport/src/views/patrolManagement/patrolRoute.vue

@@ -0,0 +1,122 @@
+<template>
+    <div class="main">
+        <!-- <div class="search">
+            <el-input placeholder="请输入巡更点名称" class="search-input" clearable v-model="mixins_query.name"></el-input>
+            <el-select v-model="mixins_query.communityId" placeholder="请选择所属社区" clearable>
+                <el-option v-for="(item, index) in communityArr" :key="index" :label="item.communityName" :value="item.id"></el-option>
+            </el-select>
+            <el-button type="primary" class="search-btn" @click="mixins_search" icon="el-icon-search">查询 </el-button>
+
+            <div class="search-icon">
+                <el-tooltip class="item" effect="light" placement="bottom" content="新增">
+                    <i class="zoniot_font zoniot-icon-tianjia2" @click="addOrEdit('add')"></i>
+                </el-tooltip>
+            </div>
+        </div>
+        <zz-table
+            :cols="cols"
+            :settings="{ showIndex: true, stripe: true }"
+            :loading="mixins_onQuery"
+            :data="mixins_list"
+            :pageset="mixins_pageset"
+            @page-change="pageChange"
+        >
+            <template slot-scope="scope" slot="opt">
+                <div class="opt">
+                    <el-tooltip effect="light" placement="bottom" content="编辑">
+                        <i class="zoniot_font zoniot-icon-bianji" @click="addOrEdit('edit', scope)"></i>
+                    </el-tooltip>
+                    <el-tooltip effect="light" placement="bottom" content="删除">
+                        <i class="zoniot_font zoniot-icon-shanchu redText" @click="deleteOne(scope.row.id)"></i>
+                    </el-tooltip>
+                </div>
+            </template>
+        </zz-table> -->
+
+        <!-- <scheduling></scheduling> -->
+        <add-patrol></add-patrol>
+    </div>
+</template>
+
+<script>
+import list from '@utils/list.js';
+import scheduling from './popups/scheduling.vue';
+import addPatrol from './popups/addPatrol.vue';
+export default {
+    mixins: [list],
+    name: 'patrolManagement',
+    components: {
+        scheduling,
+        addPatrol
+    },
+    data() {
+        let _this = this;
+        return {
+            communityArr: [],
+            cols: [
+                {
+                    label: '所属社区',
+                    prop: 'communityName'
+                },
+                {
+                    label: '楼栋',
+                    prop: 'address'
+                },
+                {
+                    label: '单元',
+                    prop: 'repairName'
+                },
+                {
+                    label: '巡更点名称',
+                    prop: 'repairPhone'
+                },
+                {
+                    label: '位置编号',
+                    prop: 'repairContent'
+                },
+                {
+                    label: '巡更点二维码',
+                    prop: 'repairFile',
+                    slot: 'repairFile'
+                },
+
+                {
+                    label: '操作',
+                    prop: 'id',
+                    slot: 'opt'
+                }
+            ],
+            findUser: [],
+            mixins_post: 'post'
+        };
+    },
+    created() {
+        this.getorgTree();
+        this.mixins_dataUrl = '/sc-community/patrol/point/page';
+        this.mixins_query = {};
+        this.mixins_search();
+        this.getUserList();
+    },
+    mounted() {},
+    methods: {
+        getorgTree() {
+            this.$http
+                .get('/sc-community/assets/community/list')
+                .then((data) => {
+                    this.communityArr = data.data;
+                    this.$store.commit('setAreaSelect', data.data);
+                })
+
+                .catch(function () {});
+        },
+        getUserList() {
+            this.$http.get('/sc-user-center/user/findUserList').then(({ data, status, msg }) => {
+                this.findUser = data;
+            });
+        },
+        addOrEdit() {}
+    }
+};
+</script>
+<style scoped lang='scss'>
+</style>

+ 283 - 0
operationSupport/src/views/patrolManagement/popups/addPatrol.vue

@@ -0,0 +1,283 @@
+<template>
+    <div class="main">
+        <div class="blockName">{{ !isAdd ? '编辑' : '新增' }}巡更路线(<span class="show-required-icon-star"></span>为必填项)</div>
+        <el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="120px" class="formContent">
+            <div class="formContent-item">
+                <el-form-item label="所属社区" prop="communityId">
+                    <el-select class="width100" v-model="ruleForm.communityId" placeholder="所属社区" clearable>
+                        <el-option
+                            v-for="(item, index) in $parent.communityArr"
+                            :key="index"
+                            :label="item.communityName"
+                            :value="item.id"
+                        ></el-option>
+                    </el-select>
+                </el-form-item>
+                <el-form-item label="巡更路线名称" prop="routeName">
+                    <el-input v-model="ruleForm.routeName" placeholder="请输入巡更路线名称"></el-input>
+                </el-form-item>
+                <el-form-item label="巡更点" prop="routePointRelationDtos">
+                    <el-transfer
+                        v-model="ruleForm.routePointRelationDtos"
+                        ref="transferTude"
+                        filterable
+                        :props="{
+                            key: 'id',
+                            label: 'pointName',
+                            lan: 'latitude',
+                            lng: 'longitude'
+                        }"
+                        :titles="['待选列表', '已选列表']"
+                        @change="handleChange"
+                        :data="patrolArr"
+                    >
+                    </el-transfer>
+                    <map-value :point="targetData"></map-value>
+                </el-form-item>
+            </div>
+            <div class="formContent-item">
+                <el-form-item label="巡更日期" prop="startDate">
+                    <el-date-picker
+                        class="width100"
+                        v-model="effectiveDate"
+                        value-format="yyyy-MM-dd "
+                        type="daterange"
+                        range-separator="至"
+                        start-placeholder="选择开始日期"
+                        end-placeholder="选择结束日期"
+                        @change="effectiveDateToggle"
+                        :editable="false"
+                    ></el-date-picker>
+                </el-form-item>
+                <el-form-item label="巡更时间" prop="communityName">
+                    <div>
+                        <el-time-picker
+                            is-range
+                            v-model="value1"
+                            range-separator="至"
+                            start-placeholder="开始时间"
+                            end-placeholder="结束时间"
+                            placeholder="选择时间范围"
+                        >
+                        </el-time-picker>
+                        <div class="sunm">
+                            <i class="zoniot_font zoniot-icon-tianjia1"></i>
+                        </div>
+                        <div class="sunm">
+                            <i class="zoniot_font zoniot-icon-shanjian"></i>
+                        </div>
+                    </div>
+                </el-form-item>
+                <el-form-item label="巡更周期" prop="periodValue">
+                    <el-radio-group v-model="ruleForm.periodType">
+                        <el-radio :label="1">每周重复</el-radio>
+                        <el-radio :label="2">间隔天数重复</el-radio>
+                    </el-radio-group>
+
+                    <el-checkbox-group v-if="ruleForm.periodType == 1" v-model="ruleForm.periodValue">
+                        <el-checkbox :label="1">周一</el-checkbox>
+                        <el-checkbox :label="2">周二</el-checkbox>
+                        <el-checkbox :label="3">周三</el-checkbox>
+                        <el-checkbox :label="4">周四</el-checkbox>
+                        <el-checkbox :label="5">周五</el-checkbox>
+                        <el-checkbox :label="6">周六</el-checkbox>
+                        <el-checkbox :label="7">周日</el-checkbox>
+                    </el-checkbox-group>
+                    <div v-else class="periodValueInput">
+                        每隔
+                        <el-input-number v-model="ruleForm.periodValue" controls-position="right" :min="0" :max="30"></el-input-number>
+                        天进行(输入0-30的数字,0代表每天都要进行任务)
+                    </div>
+                </el-form-item>
+                <el-form-item label="定位距离(m)">
+                    <el-input
+                        v-model="ruleForm.positioningDistance"
+                        placeholder="巡更定位距离,可输入1-100米,不输入则不检查定位距离"
+                    ></el-input>
+                </el-form-item>
+                <el-form-item label="拍照/视频要求">
+                    <el-select class="width100" v-model="ruleForm.cameraSettings" placeholder="请选择拍照/视频要求" clearable>
+                        <el-option label="是" :value="1"></el-option>
+                        <el-option label="否" :value="0"></el-option>
+                    </el-select>
+                </el-form-item>
+                <el-form-item label="备注信息">
+                    <el-input
+                        type="textarea"
+                        placeholder="请输入备注信息"
+                        resize="none"
+                        :rows="4"
+                        v-model="ruleForm.remark"
+                        maxlength="300"
+                        show-word-limit
+                    >
+                    </el-input>
+                </el-form-item>
+            </div>
+        </el-form>
+        <div style="text-align: right">
+            <el-button @click="close">取消</el-button>
+            <el-button type="primary" @click="addEdit">保存</el-button>
+        </div>
+    </div>
+</template>
+<script>
+import mapValue from './mapValue.vue';
+export default {
+    components: { mapValue },
+    props: {
+        params: {
+            type: Object
+        },
+        isAdd: {
+            type: Boolean,
+            default: true
+        }
+    },
+    data() {
+        return {
+            ruleForm: {
+                communityId: '',
+                routeName: '',
+                routePointRelationDtos: [],
+                startDate: '',
+                endDate: '',
+                timePeriod: '',
+                periodType: 1,
+                periodValue: '',
+                positioningDistance: '',
+                cameraSettings: '',
+                remark: ''
+            },
+            rules: {
+                communityId: [this.$valid.inputRequired('社区名称')],
+                routeName: [this.$valid.inputRequired('巡更路线名称')],
+                routePointRelationDtos: [this.$valid.inputRequired('巡更点')],
+                startDate: [this.$valid.selectRequired('巡更日期')],
+                timePeriod: [this.$valid.selectRequired('巡更时间')],
+                periodValue: [this.$valid.selectRequired('巡更周期')]
+            },
+            effectiveDate: [],
+            patrolArr: [],
+            targetData: []
+        };
+    },
+    watch: {
+        'ruleForm.communityId'(e) {
+            this.getPoint(e);
+        },
+        'ruleForm.periodValue'(e) {
+            console.log(e);
+        }
+    },
+    methods: {
+        //保存
+        addEdit() {
+            this.$refs.ruleForm.validate((valid) => {
+                console.log(this.ruleForm);
+                if (valid) {
+                    let url = '/sc-community/assets/community/add';
+                    let params = this.ruleForm;
+                    if (!this.isAdd) {
+                        url = '/sc-community/assets/community/update';
+                    }
+                    this.$http
+                        .post(url, params)
+                        .then(({ status, msg }) => {
+                            if (status == 0) {
+                                this.$message.success(msg);
+                                this.close();
+                            } else {
+                                this.$message.error(msg);
+                            }
+                        })
+                        .catch(() => {});
+                }
+            });
+        },
+        getDetails(id) {
+            let url = '/sc-community/assets/community/find/' + id;
+            this.$http
+                .get(url)
+                .then(({ data, status, msg }) => {
+                    if (0 === status) {
+                        this.ruleForm = data;
+                        this.regionId = [data.provinceId, data.cityId, data.regionId];
+                        this.ruleForm.companyOrgId = data.beCompanyOrgId;
+                        // this.companyOrgId = [null, null, data.companyOrgId];
+                        // this.deptOrgId = [null, null, data.deptOrgId];
+                    } else {
+                        this.$message.error(msg);
+                    }
+                })
+                .catch(() => {});
+        },
+        effectiveDateToggle(va) {
+            let arr = va;
+            if (!arr) {
+                arr = ['', ''];
+            }
+            this.ruleForm.startDate = arr[0];
+            this.ruleForm.endDate = arr[1];
+        },
+        handlePeriodValue(e) {
+            console.log(e);
+        },
+        close() {
+            this.$emit('clerOwnerStatus');
+        },
+        getPoint(id) {
+            this.$http.get('/sc-community/patrol/point/getPointList', { id, id }).then(({ data, status, msg }) => {
+                this.patrolArr = data;
+            });
+        },
+        handleChange() {
+            this.$nextTick(() => {
+                this.targetData = this.$refs.transferTude.targetData;
+            });
+        }
+    },
+    created() {
+        if (!!this.params && !!this.params.id) {
+            this.getDetails(this.params.id);
+        }
+    }
+};
+</script>
+<style lang='scss' scoped>
+@import '@assets/css/public-style.scss';
+.main {
+    padding: 20px;
+    background: white;
+    .blockName {
+        padding-bottom: 20px;
+        margin-bottom: 20px;
+        border-bottom: 1px solid #e0e1e3;
+    }
+}
+
+.show-required-icon-star {
+    &:before {
+        content: '*';
+        color: #f56c6c;
+    }
+}
+
+.formContent {
+    display: flex;
+    justify-content: space-between;
+    .formContent-item {
+        width: 49%;
+    }
+    .periodValueInput {
+        color: #606266;
+    }
+    .sunm {
+        width: 15px;
+        text-align: center;
+        display: inline-block;
+        cursor: pointer;
+        margin-left: 10px;
+    }
+}
+</style>

+ 188 - 0
operationSupport/src/views/patrolManagement/popups/addPoint.vue

@@ -0,0 +1,188 @@
+<template>
+    <div>
+        <zz-form :cols="formCols" :data="formData" :rules="formRules" labelWidth="100" ref="form">
+            <el-select v-model="formData.communityId" placeholder="请选择所属社区" clearable slot="communityId">
+                <el-option v-for="(item, index) in communityArr" :key="index" :label="item.communityName" :value="item.id"></el-option>
+            </el-select>
+            <el-select v-model="formData.buildingId" placeholder="请选择楼栋" clearable slot="buildingId">
+                <el-option v-for="(item, index) in buildingArr" :key="index" :label="item.label" :value="item.id"></el-option>
+            </el-select>
+            <el-select v-model="formData.unit" placeholder="请选择单元" clearable slot="unit">
+                <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="请选择经纬坐标">
+                    <i slot="suffix" class="zoniot_font zoniot-icon-dizhi" @click="QueryClick"></i>
+                </el-input>
+            </template>
+        </zz-form>
+    </div>
+</template>
+<script >
+import MapPopup from '@/components/mapPopup/index.vue';
+export default {
+    props: ['params'],
+    components: {
+        MapPopup
+    },
+    data() {
+        return {
+            formData: {
+                communityId: '',
+                pointName: '',
+                pointNo: '',
+                buildingId: '',
+                unit: '',
+                latitude: '',
+                longitude: ''
+            },
+            initDot: [],
+            communityTre: [],
+            formRules: {
+                communityId: [this.$valid.selectRequired('公司')],
+                pointName: [this.$valid.inputRequired('巡更点名称')],
+                pointNo: [this.$valid.inputRequired('巡更点编号')],
+                latitude: [this.$valid.inputRequired('经纬度坐标'), this.$valid.selectRequired('经纬度坐标')]
+            },
+            formCols: [
+                [
+                    {
+                        label: '所属社区',
+                        prop: 'communityId',
+                        slot: 'communityId'
+                    },
+                    {
+                        label: '楼栋',
+                        prop: 'buildingId',
+                        slot: 'buildingId'
+                    },
+                    {
+                        label: '单元',
+                        prop: 'unit',
+                        slot: 'unit'
+                    },
+                    {
+                        label: '巡更点名称',
+                        prop: 'pointName',
+                        input: true
+                    },
+                    {
+                        label: '巡更点编号',
+                        prop: 'pointNo',
+                        input: true
+                    },
+                    {
+                        label: '经纬度坐标',
+                        prop: 'latitude',
+                        slot: 'latitude'
+                    }
+                ]
+            ],
+            communityArr: [],
+            buildingArr: [],
+            unitArr: [],
+            mapPopUpStatus: false //地图弹出框
+        };
+    },
+    watch: {
+        'formData.communityId'(e) {
+            this.communityTre.map((item) => {
+                this.buildingArr = [];
+                if (item.value == e && !!item.children) {
+                    item.children.map((itemBuilding) => {
+                        this.buildingArr.push({
+                            label: itemBuilding.name,
+                            id: itemBuilding.value,
+                            children: itemBuilding.children,
+                            type: itemBuilding.type
+                        });
+                    });
+                }
+            });
+        },
+        'formData.buildingId'(e) {
+            this.buildingArr.map((item) => {
+                this.unitArr = [];
+                if (item.id == e && !!item.children) {
+                    item.children.map((itemUnit) => {
+                        if (itemUnit.type == 'unit') {
+                            this.$nextTick(() => {
+                                this.unitArr.push({
+                                    label: itemUnit.name,
+                                    id: itemUnit.value,
+                                    type: itemUnit.type
+                                });
+                            });
+                        }
+                    });
+                }
+            });
+        }
+    },
+    methods: {
+        QueryClick() {
+            new Promise((resolve) => {
+                let title = '选择坐标';
+                this.$store.dispatch('addPopup', {
+                    url: '/patrolManagement/popups/popMap.vue',
+                    width: '500px',
+                    height: '500px',
+                    props: {
+                        callback: resolve
+                    },
+                    title: title
+                });
+            }).then((e) => {
+                this.initDot = [e.lat, e.lng];
+                this.formData.latitude = `${e.lat},${e.lng}`;
+                this.formData.longitude = e.lng;
+            });
+        },
+        submit() {
+            new Promise((resolve) => {
+                this.$refs.form.validate(resolve);
+            }).then(() => {
+                var loading = this.$loading();
+                let url = '/sc-community/patrol/point/add';
+                let initData = {
+                    communityId: this.formData.communityId,
+                    pointName: this.formData.pointName,
+                    pointNo: this.formData.pointNo,
+                    buildingId: this.formData.buildingId,
+                    unit: this.formData.unit,
+                    latitude: this.initDot[0],
+                    longitude: this.initDot[1]
+                };
+                if (this.params.todo == 'edit') {
+                    url = '/sc-community/patrol/point/update';
+                    initData.id = this.formData.id;
+                }
+                this.$http
+                    .post(url, initData)
+                    .then(({ status, msg }) => {
+                        if (status == 0) {
+                            this.$message.success(msg);
+                            this.params.callback();
+                            this.$emit('close');
+                        } else {
+                            this.$message.error(msg);
+                        }
+                        loading.close();
+                    })
+                    .catch(() => {
+                        loading.close();
+                    });
+            });
+        }
+    },
+    created() {
+        this.communityTre = this.params.communityTre;
+        this.communityArr = this.params.communityArr;
+        if (this.params.todo == 'edit') {
+            this.formData = JSON.parse(JSON.stringify(this.params.data));
+            this.initDot = [this.params.data.latitude, this.params.data.longitude];
+            this.formData.latitude = `${this.params.data.latitude},${this.params.data.longitude}`;
+        }
+    }
+};
+</script>

+ 72 - 0
operationSupport/src/views/patrolManagement/popups/mapValue.vue

@@ -0,0 +1,72 @@
+<template>
+    <div id="mapValue"></div>
+</template>
+
+<script>
+export default {
+    props: ['point'],
+    data() {
+        return {
+            map: '',
+            marker: '',
+            icon: 'https://webapi.amap.com/theme/v1.3/markers/n/mark_b.png'
+        };
+    },
+    watch: {
+        point(e) {
+            this.point.map((item) => {
+                if (!!this.map) {
+                    this.addIcon(item);
+                }
+            });
+        }
+    },
+    methods: {
+        init() {
+            this.map = new AMap.Map('mapValue', {
+                resizeEnable: true, //是否监控地图容器尺寸变化
+                zoom: 11 //初始化地图层级
+            });
+        },
+        addIcon(e) {
+            let _this = this;
+            _this.marker = new AMap.Marker({
+                icon: _this.icon,
+                position: [e.longitude, e.latitude]
+                // map: _this.map
+            });
+            // this.marker.setMap(this.map);
+            this.map.add(this.marker);
+            this.map.setFitView();
+        }
+    },
+    created() {
+        this.$nextTick(() => {
+            this.init();
+        });
+    }
+};
+</script>
+<style scoped  lang="scss">
+/* --------------------------------高德地图样式----------------------------- */
+#mapValue {
+    margin-top: 20px;
+    width: 100%;
+    height: 300px;
+}
+.my-autocomplete {
+    li {
+        line-height: normal;
+        padding: 7px;
+
+        .name {
+            text-overflow: ellipsis;
+            overflow: hidden;
+            span {
+                font-size: 12px;
+                color: #b4b4b4;
+            }
+        }
+    }
+}
+</style>

+ 114 - 0
operationSupport/src/views/patrolManagement/popups/popMap.vue

@@ -0,0 +1,114 @@
+<template>
+    <div>
+        <el-autocomplete
+            popper-class="my-autocomplete"
+            v-model="addressName"
+            :fetch-suggestions="querySearch"
+            placeholder="请输入地址查找"
+            @select="handleSelect"
+        >
+            <template slot-scope="{ item }">
+                <div class="name">
+                    {{ item.name }} <span>({{ item.cityname + item.adname }})</span>
+                </div>
+            </template>
+        </el-autocomplete>
+        <div id="container"></div>
+    </div>
+</template>
+
+<script>
+export default {
+    props: ['params'],
+    data() {
+        return {
+            map: '',
+            placeSearch: '',
+            marker: '',
+            addressName: '', //地址查询名称
+            poisArray: []
+        };
+    },
+    methods: {
+        init() {
+            let _this = this;
+            this.map = new AMap.Map('container', {
+                resizeEnable: true, //是否监控地图容器尺寸变化
+                zoom: 11 //初始化地图层级
+            });
+
+            this.map.on('click', this.mapClick);
+            this.placeSearch = new AMap.PlaceSearch({
+                map: _this.map
+            });
+        },
+        mapClick(e) {
+            this.addIcon(e.lnglat);
+        },
+        mapSelect(e) {
+            this.addIcon(e.location);
+        },
+        addIcon(e) {
+            // if (this.marker !== '') {
+            //     this.map.remove(this.marker);
+            // }
+            let loc = [e.lat, e.lng];
+            this.marker = new AMap.Marker({
+                icon: 'https://webapi.amap.com/theme/v1.3/markers/n/mark_b.png',
+                position: loc
+            });
+            this.map.add(this.marker);
+            this.params.callback && this.params.callback(e);
+            this.$emit('close');
+        },
+        togglePlaceSearch(val, resolve) {
+            this.placeSearch.search(val, (status, result) => {
+                if (result.info == 'OK') {
+                    this.poisArray = result.poiList.pois;
+                }
+                resolve && resolve(true);
+            });
+        },
+        handleSelect(item) {
+            this.mapSelect(item);
+        },
+        querySearch(queryString, cb) {
+            new Promise((resolve) => {
+                this.togglePlaceSearch(queryString, resolve);
+            }).then(() => {
+                if (this.poisArray.length !== 0) {
+                    cb(this.poisArray);
+                }
+            });
+        }
+    },
+    created() {
+        this.$nextTick(() => {
+            this.init();
+        });
+    }
+};
+</script>
+<style scoped  lang="scss">
+/* --------------------------------高德地图样式----------------------------- */
+#container {
+    margin-top: 20px;
+    width: 100%;
+    height: 400px;
+}
+.my-autocomplete {
+    li {
+        line-height: normal;
+        padding: 7px;
+
+        .name {
+            text-overflow: ellipsis;
+            overflow: hidden;
+            span {
+                font-size: 12px;
+                color: #b4b4b4;
+            }
+        }
+    }
+}
+</style>

+ 150 - 0
operationSupport/src/views/patrolManagement/popups/scheduling.vue

@@ -0,0 +1,150 @@
+<template>
+    <div class="scheduling">
+        <div class="search">
+            <el-date-picker
+                v-model="monthValue"
+                value-format="yyyy-MM-dd"
+                type="month"
+                placeholder="选择时间"
+                @change="changeMonth"
+                :clearable="false"
+            ></el-date-picker>
+            <div class="search-icon">
+                <el-tooltip effect="light" placement="bottom" content="批量排班">
+                    <i class="zoniot_font zoniot-icon-piliangshenhe" @click="add()"></i>
+                </el-tooltip>
+                <el-tooltip effect="light" placement="bottom" content="返回">
+                    <i class="zoniot_font zoniot-icon-fanhui" @click="goback()"></i>
+                </el-tooltip>
+            </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'">
+                <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)">
+                            <template v-for="itx in item.rosterUserDtos"
+                                ><div :key="itx" class="listTime">
+                                    <span>{{ itx.partrolTime }}</span> <span>{{ itx.partolName }}</span>
+                                </div></template
+                            >
+                        </div>
+                    </template>
+                </div>
+                <div class="pointSet" @click="add(data)">点击设置</div>
+            </template>
+        </el-calendar>
+    </div>
+</template>
+<script>
+export default {
+    data() {
+        return {
+            monthValue: '',
+            findUser: [],
+            calendarData: [
+                {
+                    partrolDate: '2022-02-21',
+                    rosterUserDtos: [
+                        { partrolTime: '8:30-10:00', partolName: '奥特曼' },
+                        { partrolTime: '18:30-19:00', partolName: '奥特曼30' }
+                    ]
+                }
+            ]
+        };
+    },
+    filters: {
+        dateNewType(val) {
+            return val.getDate();
+        }
+    },
+    methods: {
+        add(dateDe, onj) {
+            let title = '排班',
+                isSingle = true;
+            if (dateDe == undefined && onj == undefined) {
+                title = '批量排班';
+                isSingle = false;
+            }
+            new Promise((resolve) => {
+                this.$store.dispatch('addPopup', {
+                    url: '/patrolManagement/popups/schedulingAdd.vue',
+                    width: '450px',
+                    height: '300px',
+                    props: {
+                        callback: resolve,
+                        findUser: this.findUser,
+                        dateDe,
+                        onj,
+                        isSingle: isSingle
+                    },
+                    title: title
+                });
+            }).then(() => {
+                this.mixins_search();
+            });
+        },
+        getUserList() {
+            this.$http.get('/sc-user-center/user/findUserList').then(({ data, status, msg }) => {
+                this.findUser = data;
+            });
+        },
+        changeMonth(va) {
+            console.log(va);
+        },
+        goback() {},
+        initDate(type) {
+            this.monthValue = this.$moment().format(type);
+        }
+    },
+    created() {
+        this.initDate('YYYY-MM-DD');
+    },
+    mounted() {
+        this.getUserList();
+        this.$el.querySelector('div.el-calendar__header').remove();
+    }
+};
+</script>
+<style scoped lang='scss'>
+.scheduling {
+    font-size: 12px;
+    .showDateDay {
+        font-size: 30px;
+        text-align: center;
+    }
+    .schedulingUser {
+        cursor: pointer;
+        padding: 0 20px;
+        line-height: 25px;
+        .listTime {
+            width: 100%;
+            display: flex;
+            justify-content: space-between;
+        }
+    }
+    .pointSet {
+        cursor: pointer;
+        line-height: 35px;
+        text-align: center;
+    }
+    /deep/ .el-calendar-table {
+        &:not(.is-range) {
+            td.next {
+                pointer-events: none;
+            }
+            td.prev {
+                pointer-events: none;
+            }
+            td.current {
+                // pointer-events: none;
+            }
+        }
+        .el-calendar-day {
+            height: 110px;
+            overflow: hidden;
+        }
+    }
+}
+</style>

+ 110 - 0
operationSupport/src/views/patrolManagement/popups/schedulingAdd.vue

@@ -0,0 +1,110 @@
+<template>
+    <el-form class="timeNewStyle" label-width="100px" :model="formData" :rules="formRules" ref="formRu">
+        <el-form-item label="巡更日期" v-if="!params.isSingle" prop="partrolDate">
+            <el-date-picker
+                v-model="formData.partrolDate"
+                value-format="yyyy-MM-dd"
+                type="daterange"
+                start-placeholder="开始日期"
+                end-placeholder="结束日期"
+            ></el-date-picker>
+        </el-form-item>
+        <el-form-item label="巡更日期" v-else>{{ thisDay.day | dateText }}</el-form-item>
+        <el-form-item label="8:30-10:00">
+            <el-cascader
+                ref="userName0"
+                v-model="timePeriod[0].partolUserId"
+                :props="defaultProps"
+                :options="findUser"
+                @change="findUserToggle(0)"
+            ></el-cascader>
+        </el-form-item>
+        <el-form-item label="18:30-19:00">
+            <el-cascader
+                ref="userName1"
+                v-model="timePeriod[1].partolUserId"
+                :props="defaultProps"
+                :options="findUser"
+                @change="findUserToggle(1)"
+            ></el-cascader>
+        </el-form-item>
+    </el-form>
+</template>
+<script>
+export default {
+    props: ['params'],
+    data() {
+        return {
+            timePeriod: [
+                {
+                    partolName: '',
+                    partolUserId: '',
+                    partrolTime: '8:30-10:00'
+                },
+                {
+                    partolName: '',
+                    partolUserId: '',
+                    partrolTime: '18:30-19:00'
+                }
+            ],
+            findUser: [],
+            thisDay: {},
+            defaultProps: {
+                value: 'id', // 唯一标识
+                label: 'label', // 标签显示
+                children: 'children',
+                emitPath: false
+            },
+            formData: {
+                partrolDate: []
+            },
+            formRules: {
+                partrolDate: [this.$valid.selectRequired('时间段')]
+            }
+        };
+    },
+    filters: {
+        dateText(va) {
+            if (!!va) {
+                let timeAr = va.split('-');
+                return `${timeAr[0]}年${timeAr[1]}月${timeAr[2]}日`;
+            } else {
+                return '';
+            }
+        }
+    },
+    methods: {
+        findUserToggle(index) {
+            this.timePeriod[index].partolName = this.$refs['userName' + index].getCheckedNodes()[0].label;
+        },
+        submit() {
+            if (!this.params.isSingle) {
+                this.$refs['formRu'].validate((valid) => {
+                    if (valid) {
+                        // 批量添加
+                    }
+                });
+            } else {
+                // 单个添加修改
+            }
+        }
+    },
+    created() {
+        this.findUser = this.params.findUser;
+        if (!!this.params.dateDe) {
+            this.thisDay = this.params.dateDe;
+        }
+        if (!!this.params.onj) {
+            console.log(this.params.onj);
+        }
+    },
+    mounted() {}
+};
+</script>
+<style scoped lang='scss'>
+.timeNewStyle {
+    /deep/ .el-date-editor--daterange.el-input__inner {
+        width: 100%;
+    }
+}
+</style>

+ 2 - 1
operationSupport/src/views/workOrders/popups/add.vue

@@ -135,7 +135,7 @@ export default {
                     }
                 ]
             ],
-            fileType: [],
+            fileType: []
         };
     },
 
@@ -191,6 +191,7 @@ export default {
             return videoType.includes(type);
         },
         clickFile() {
+            // this.$refs['uploaduserlogo'].$refs['upload-inner'].handleClick();
             this.$refs.uploadBox.$children[0].$refs.input.click();
         }
     },