safecheck-client 4.0.1-30 → 4.0.1-33

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,26 @@
1
+ // ... existing code ...
2
+ mulchs:{//覆盖物控制显示
3
+ level1:true,
4
+ level3:true,
5
+ problems:true
6
+ },
7
+ styleObject :[
8
+ {
9
+ url: require('../../assets/level1.png'), //拒检图标URL
10
+ anchor: new AMap.Pixel(14, 8), // 图标偏移位置
11
+ size: new AMap.Size(26, 28) //图标大小
12
+ },
13
+ {
14
+ url: require('../../assets/level3.png'), //到访不遇图标URL
15
+ anchor: new AMap.Pixel(14, 8), // 图标偏移位置
16
+ size: new AMap.Size(26, 28) //图标大小
17
+ },
18
+ {
19
+ url: require('../../assets/ordinary.png'), //正常图标URL
20
+ anchor: new AMap.Pixel(14, 8), // 图标偏移位置
21
+ size: new AMap.Size(26, 28) //图标大小
22
+ }
23
+ ]
24
+ }
25
+ },
26
+ // ... existing code ...
@@ -0,0 +1,202 @@
1
+ <template>
2
+ <div class="basic-main" style="height: 100%">
3
+ <div class="row">
4
+ <div class="col-sm-12 amap-main">
5
+ <div class="form-horizontal select-overspread container-fluid auto">
6
+ <div class="row">
7
+ <div class="col-sm-3 form-input-group" style="width: 20%">
8
+ <label class="control-label">公&emsp;&emsp;司</label>
9
+ <right-tree-safe @re-res="getRes" >
10
+ </right-tree-safe>
11
+ </div>
12
+ <div class="col-sm-3 form-input-group" style="width: 20%">
13
+ <label class="control-label" >安检日期</label>
14
+ <datepicker placeholder="选择日期"
15
+ :value.sync="searchCondition.date"
16
+ v-model="searchCondition.date"
17
+ :format="'yyyy-MM-dd'">
18
+ </datepicker>
19
+ </div>
20
+ <div class="col-sm-3 form-input-group" style="width: 20%">
21
+ <label class="control-label">安检员</label>
22
+ <v-select :value.sync="searchCondition.userId" v-model='searchCondition.userId'
23
+ :value-single="true" clear-button search
24
+ :options='searchUserEndOption' placeholder='请选择'
25
+ ></v-select>
26
+ </div>
27
+ <div class="col-sm-3 form-input-group" style="width: 20%">
28
+ <label class="control-label">班组</label>
29
+ <v-select :value.sync="searchCondition.departmentId" v-model='searchCondition.departmentId'
30
+ :value-single="true" clear-button search
31
+ :options='searchDepartmentOption' placeholder='请选择'
32
+ ></v-select>
33
+ </div>
34
+ <div class="col-sm-3 form-input-group" style="width: 20%;float:right;">
35
+ <button class="btn btn-primary" @click="search">查询</button>
36
+ </div>
37
+ </div>
38
+ </div>
39
+ <a-map-points :points="showTaskPoints" :dom="dom"></a-map-points>
40
+ </div>
41
+ </div>
42
+
43
+ </div>
44
+ </template>
45
+
46
+ <script>
47
+ import * as Util from '../Util'
48
+ import {HttpResetClass} from 'vue-client'
49
+
50
+ export default {
51
+ title: "安检数据点位",
52
+ data() {
53
+ return {
54
+ showTaskPoints: [],
55
+ taskModel: {},
56
+ // 当前分公司下所有的用户id
57
+ toUserIds: '',
58
+ // 当前公司的所有安检员
59
+ searchUserEndOption: [],
60
+ searchDepartmentOption: [],
61
+ // 分公司ids
62
+ f_filialeids: '',
63
+ path: [],
64
+ aMap: null,
65
+ map: null,
66
+ filialeOptions: [],
67
+ userid: null,
68
+ dom: 'amapIdLOCUS' + Math.round(Math.random() * 10) + Math.round(Math.random() * 10),
69
+ rootSubmenuKeys: ['1', '2'],
70
+ openKeys: ['1'],
71
+ searchCondition: {
72
+ condition: '1 = 1',
73
+ orderTime: 'ps.f_realtime asc',
74
+ date: '',
75
+ userId: undefined,
76
+ departmentId: undefined
77
+ }
78
+ }
79
+ },
80
+ methods: {
81
+ search() {
82
+ var condition = '1 = 1'
83
+ if (!this.f_filialeids) {
84
+ return this.$showMessage('请选择需要查询的分公司')
85
+ }
86
+ if (!this.searchCondition.date) {
87
+ return this.$showMessage('请选择需要查看的轨迹时间')
88
+ }
89
+ // if (!this.searchCondition.userId[0]) {
90
+ // return this.$showMessage('请选择需要查看的轨迹所属人员')
91
+ // }
92
+
93
+ if (typeof this.searchCondition.date !== 'string') {
94
+ this.searchCondition.date = this.searchCondition.date.format('YYYY-MM-DD')
95
+ }
96
+ condition += " and f_check_date >= '" + this.searchCondition.date + " 00:00:00' and f_check_date <= '" + this.searchCondition.date + " 23:59:59'"
97
+ if(this.searchCondition.userId){
98
+ condition += ` and f_user_id = '${this.searchCondition.userId}'`
99
+ }
100
+ let condition2 = '1 = 1'
101
+ if(this.searchCondition.departmentId){
102
+ condition2 += ` and d.id = '${this.searchCondition.departmentId}'`
103
+ }
104
+ this.searchCondition.condition = condition
105
+ this.$resetpost('api/af-safecheck/logic/getSafeData', { condition: this.searchCondition.condition, condition2 }, {resolveMsg: "点位数据查询成功", rejectMsg: "点位数据查询失败"}).then((response)=>{
106
+ if (response.data && Array.isArray(response.data)) {
107
+ const points = response.data.map(item => {
108
+ if (item.f_longitude && item.f_latitude) {
109
+ let color = 'yellow'; // 到访不遇
110
+ if (item.f_entry_state === '入户') {
111
+ color = 'green';
112
+ } else if (item.f_entry_state === '拒检') {
113
+ color = 'red';
114
+ }
115
+ return {
116
+ position: [item.f_longitude, item.f_latitude],
117
+ color: color,
118
+ name: item.f_entry_state
119
+ };
120
+ }
121
+ }).filter(p => p);
122
+ this.showTaskPoints = points;
123
+ if(points.length === 0){
124
+ this.$showMessage("没有查询到安检数据点位");
125
+ }
126
+ } else {
127
+ this.showTaskPoints = [];
128
+ this.$showMessage("没有查询到安检数据点位");
129
+ }
130
+ })
131
+ },
132
+ getRes(obj){
133
+ // this.model.f_filialeids = this.$login.convertToIn(obj.resids);
134
+ if (obj.res != undefined && obj.res.length > 0 && obj.res[0] != undefined) {
135
+ this.getNewData(obj.res[0])
136
+ }
137
+ this.f_filialeids = this.$login.convertToIn(obj.resids);
138
+ },
139
+ //获取定位人员类表
140
+ async getNewData(organization){
141
+ // let organization = '公司名称'
142
+ // let userRolestr = '需要定位人员'
143
+ let userRolestr = '安检员'
144
+ let res =await new HttpResetClass().load('POST', '/rs/search', {
145
+ // source: 'this.getParentByType($department$).getAllChildrens().where(row.getAttributes().get($rolestr$).indexOf($需要定位人员$) != -1))',
146
+ source: "this.getParentByName($"+organization+"$).getAllChildrens().where(row.getAttributes().get($resourcetype$)==$user$).where(row.getAttributes().get($rolestr$)!=null).where(row.getAttributes().get($rolestr$).indexOf($"+userRolestr+"$)!=-1)",
147
+ userid: this.$login.f.id
148
+ }, {resolveMsg: null, rejectMsg: null})
149
+ let dataEnd = [{label:'全部',value:''}]
150
+ let idsEnd = []
151
+ res.data.forEach(res=>{
152
+ let h=true
153
+ dataEnd.forEach(per=>{
154
+ if(res.id==per.value){
155
+ h=false
156
+ }
157
+ })
158
+ if(h){
159
+ dataEnd.push({label:res.name,value:res.id})
160
+ idsEnd.push(res.id)
161
+ }
162
+ })
163
+ this.toUserIds = this.$login.convertToIn(idsEnd); //所有的员工ID
164
+ this.searchUserEndOption = dataEnd
165
+
166
+ let resp = await new HttpResetClass().load('POST', `/api/af-safecheck/sql/safe_singleTable_OrderBy`, {
167
+ data: {
168
+ items:'*',
169
+ tablename: 't_department',
170
+ condition: `parentid = '${this.$login.f.orgid}' and f_dep_type = '部门'`,
171
+ orderitem:'id desc'
172
+ }
173
+ }, {resolveMsg: null, rejectMsg: null})
174
+ //tag)
175
+ const departments = [{label: '全部', value: ''}]
176
+ for (const item of resp.data) {
177
+ departments.push({
178
+ label: item.name,
179
+ value: item.id
180
+ })
181
+ }
182
+ this.searchDepartmentOption = departments
183
+ },
184
+ toStandardDateString () {
185
+ const dt = new Date()
186
+ const month = dt.getMonth() + 1
187
+ const date = dt.getDate()
188
+ return dt.getFullYear() + '-' + (month < 10 ? '0' + month : month) + '-' + (date < 10 ? '0' + date : date)
189
+ }
190
+ },
191
+ ready(){
192
+ this.searchCondition.date = this.toStandardDateString()
193
+ }
194
+ }
195
+ </script>
196
+
197
+ <style lang="less" scoped>
198
+ .amap-main {
199
+ height: 90%;
200
+ padding-right:10px;
201
+ }
202
+ </style>