safecheck-client 3.0.35-46 → 3.0.35-48

Sign up to get free protection for your applications and to get access to all the features.
Files changed (26) hide show
  1. package/package.json +3 -3
  2. package/src/components/NewDefectList/DefectPaperNew.vue +1079 -1079
  3. package/src/filiale/dexin/pc/DefectListNew.vue +643 -643
  4. package/src/filiale/dexin/pc/DefectPaperNew.vue +1066 -1066
  5. package/src/filiale/dexin/pc.js +13 -13
  6. package/src/filiale/huaran/pc/PaperList.vue +843 -843
  7. package/src/filiale/huaran/pc/PlanManage.vue +946 -940
  8. package/src/filiale/jingyang/android/AddPlanItem.vue +458 -458
  9. package/src/filiale/jingyang/android/CurrentCreate.vue +1080 -1080
  10. package/src/filiale/jingyang/android/SafecheckOrderV.vue +2734 -2734
  11. package/src/filiale/jingyang/android.js +15 -15
  12. package/src/filiale/qingtongxia/android/AddPlanItem.vue +450 -450
  13. package/src/filiale/qingtongxia/android/CurrentCreate.vue +1053 -1053
  14. package/src/filiale/qingtongxia/android/PhoneUpUserinfo.vue +1230 -1230
  15. package/src/filiale/qingtongxia/android/SafecheckUserInfo.vue +782 -782
  16. package/src/filiale/qingtongxia/android.js +14 -14
  17. package/src/filiale/ruihua/android/SafecheckOrderV.vue +2747 -2747
  18. package/src/filiale/ruihua/android.js +11 -11
  19. package/src/filiale/siyang/android/AppCheckPlan.vue +246 -246
  20. package/src/filiale/siyang/android.js +15 -15
  21. package/src/filiale/siyang/pc/CheckBookList.vue +396 -396
  22. package/src/filiale/siyang/pc.js +22 -22
  23. package/src/filiale/tianke/pc/DefectListNew.vue +545 -538
  24. package/src/filiale/wuan/android/SafecheckOrderV.vue +2241 -2241
  25. package/src/filiale/wuan/android/SafecheckUserInfo.vue +596 -596
  26. package/src/main.js +1 -3
@@ -1,396 +1,396 @@
1
- <template>
2
- <div class="flex">
3
- <criteria-paged :model="model" v-ref:paged>
4
- <criteria partial='criteria' @condition-changed='$parent.search' v-ref:criteria>
5
- <div novalidate class="form-horizontal select-overspread container-fluid auto" partial>
6
- <div class="row" v-show="!$parent.$parent.$parent.showItemAll">
7
- <div :class="$parent.$parent.style2" style="margin: 0px">
8
- <role-selector-safe
9
- role-name="安检员"
10
- role-lable="安&nbsp;检&nbsp;员&nbsp;"
11
- @re-res="$parent.$parent.getRes"
12
- :value.sync="model.f_checker_id"
13
- v-model="model.f_checker_id"
14
- :value-multiple="true"
15
- condition=" f_checker_name in {}">
16
- </role-selector-safe>
17
- </div>
18
- <div :class="$parent.$parent.style">
19
- <label class="font_normal_body">片区名称</label>
20
- <v-select :value.sync="model.f_check_book_id" v-model='model.f_check_book_id'
21
- :value-single="true" style="width: 60%"
22
- class="select_list select"
23
- :options='$parent.$parent.checkBooks' placeholder='片区名称'
24
- close-on-select
25
- condition="tcb.id ='{}'"></v-select>
26
- </div>
27
- <!-- <div :class="$parent.$parent.style">-->
28
- <!-- <label class="font_normal_body">表册类型</label>-->
29
- <!-- <v-select :value.sync="model.f_check_book_type" v-model='model.f_check_book_type'-->
30
- <!-- :value-single="true" style="width: 60%"-->
31
- <!-- class="select_list select"-->
32
- <!-- :options='$parent.$parent.bookTypes' placeholder='表册类型'-->
33
- <!-- close-on-select-->
34
- <!-- condition="tcb.f_check_book_type ='{}'"></v-select>-->
35
- <!-- </div>-->
36
- <!-- <div :class="$parent.$parent.style">-->
37
- <!-- <label class="font_normal_body">用户类型</label>-->
38
- <!-- <v-select :value.sync="model.f_user_type" v-model='model.f_user_type'-->
39
- <!-- :value-single="true" style="width: 60%"-->
40
- <!-- class="select_list select"-->
41
- <!-- :options='$parent.$parent.userTypes' placeholder='用户类型'-->
42
- <!-- close-on-select-->
43
- <!-- condition="tcb.f_user_type ='{}'"></v-select>-->
44
- <!-- </div>-->
45
- <div :class="$parent.$parent.style" style="width: auto;margin-top:8px;float: right">
46
- <button type="button" class="button_search button_spacing" @click="search()">查询</button>
47
- <button type="button" class="button_new button_spacing" @click="$parent.$parent.add()">新增片区</button>
48
- <button type="button" class="button_new button_spacing" @click="$parent.$parent.showModal = true">片区用户管理</button>
49
- <div style="float: right" class="button_spacing"
50
- v-show="$parent.$parent.$parent.showItem ||$parent.$parent.$parent.showItemUser"
51
- :class="{'button_shrink_left':$parent.$parent.$parent.showItemAll,'button_shrink_right':!$parent.$parent.$parent.showItemAll}"
52
- @click="($parent.$parent.$parent.showItem =false) || ($parent.$parent.$parent.showItemUser =false)"></div>
53
- </div>
54
-
55
-
56
- </div>
57
-
58
-
59
- <div class="row" v-show="$parent.$parent.$parent.showItemAll">
60
- <div :class="$parent.$parent.style2" style="margin: 0px">
61
- <role-selector-safe
62
- role-name="安检员"
63
- role-lable="安&nbsp;检&nbsp;员&nbsp;"
64
- @re-res="$parent.$parent.getRes"
65
- :value.sync="model.f_checker_id"
66
- v-model="model.f_checker_id"
67
- :value-multiple="true"
68
- condition=" f_checker_name in {}">
69
- </role-selector-safe>
70
- </div>
71
- <div :class="$parent.$parent.style">
72
- <label class="font_normal_body">片区名</label>
73
- <v-select :value.sync="model.f_check_book_id" v-model='model.f_check_book_id'
74
- :value-single="true" style="width: 60%"
75
- class="select_list select"
76
- :options='$parent.$parent.checkBooks' placeholder='片区名称'
77
- close-on-select
78
- condition="tcb.id ='{}'"></v-select>
79
- </div>
80
- <div :class="$parent.$parent.style" style="width: auto;margin-top:8px;float: right">
81
- <button type="button" class="button_search button_spacing" @click="search()">查询</button>
82
- <button type="button" class="button_new button_spacing" @click="$parent.$parent.add()">新增片区</button>
83
- <button type="button" class="button_new button_spacing" @click="$parent.$parent.showModal = true">片区用户管理</button>
84
- <div style="float: right" class="button_spacing"
85
- v-show="$parent.$parent.$parent.showItem ||$parent.$parent.$parent.showItemUser"
86
- :class="{'button_shrink_left':$parent.$parent.$parent.showItemAll,'button_shrink_right':!$parent.$parent.$parent.showItemAll}"
87
- @click="($parent.$parent.$parent.showItem =false) || ($parent.$parent.$parent.showItemUser =false)"></div>
88
- <!-- <div style="float: right" class="button_spacing"-->
89
- <!-- :class="{'button_shrink_top':$parent.$parent.criteriaShow,'button_shrink_bottom':!$parent.$parent.criteriaShow}"-->
90
- <!-- @click="$parent.$parent.hidden()">-->
91
- <!-- </div>-->
92
- </div>
93
-
94
- </div>
95
-
96
- </div>
97
- </criteria>
98
- <data-grid :model="model" partial="list" class="list_area table_sy" v-ref:grid>
99
- <template partial='head'>
100
- <tr>
101
- <th>
102
- <nobr>所属安检员</nobr>
103
- </th>
104
- <th>
105
- <nobr>片区名称</nobr>
106
- </th>
107
- <!-- <th>-->
108
- <!-- <nobr>片区类型</nobr>-->
109
- <!-- </th>-->
110
- <th>
111
- <nobr>用户类型</nobr>
112
- </th>
113
- <th>
114
- <nobr>创建日期</nobr>
115
- </th>
116
- <th>
117
- <nobr>创建人</nobr>
118
- </th>
119
-
120
- <th>
121
- <nobr>执行日期</nobr>
122
- </th>
123
- <th>
124
- <nobr>执行周期</nobr>
125
- </th>
126
- <th>
127
- <nobr>小区/单位数量</nobr>
128
- </th>
129
- <th>
130
- <nobr>已下发</nobr>
131
- </th>
132
- <th>
133
- <nobr>未下发</nobr>
134
- </th>
135
- <th>
136
- <nobr>已检</nobr>
137
- </th>
138
- <th>
139
- <nobr>未检</nobr>
140
- </th>
141
- <!-- <th v-show="$parent.$parent.$parent.showCaoZuo">-->
142
- <!-- <nobr>操作</nobr>-->
143
- <!-- </th>-->
144
- </tr>
145
- </template>
146
- <template partial='body' >
147
- <td :style="{ textAlign: 'center', color:$parent.$parent.$parent.setbackgroundColor(row.f_run_date) ? 'red' : ''}">{{ row.f_checker_name }}</td>
148
- <td :style="{ textAlign: 'center', color:$parent.$parent.$parent.setbackgroundColor(row.f_run_date) ? 'red' : ''}">{{ row.f_check_book_name }}</td>
149
- <td :style="{ textAlign: 'center', color:$parent.$parent.$parent.setbackgroundColor(row.f_run_date) ? 'red' : ''}">{{ row.f_user_type }}</td>
150
- <td :style="{ textAlign: 'center', color:$parent.$parent.$parent.setbackgroundColor(row.f_run_date) ? 'red' : ''}">{{ row.f_create_date }}</td>
151
- <td :style="{ textAlign: 'center', color:$parent.$parent.$parent.setbackgroundColor(row.f_run_date) ? 'red' : ''}">{{ row.f_create_person }}</td>
152
- <td :style="{ textAlign: 'center', color:$parent.$parent.$parent.setbackgroundColor(row.f_run_date) ? 'red' : ''}">{{ row.f_run_date }}</td>
153
- <td :style="{ textAlign: 'center', color:$parent.$parent.$parent.setbackgroundColor(row.f_run_date) ? 'red' : ''}">{{ row.f_around_time }}{{ row.f_around_unit }}</td>
154
- <td :style="{ textAlign: 'center', color:$parent.$parent.$parent.setbackgroundColor(row.f_run_date) ? 'red' : ''}"><button @click.stop="$parent.$parent.$parent.details(row)" class="btn btn-link"><b>{{row.f_user_type==='民用'?row.num2:row.num3}}</b></button></td>
155
- <td :style="{ textAlign: 'center', color:$parent.$parent.$parent.setbackgroundColor(row.f_run_date) ? 'red' : ''}">{{ row.xiafa }}</td>
156
- <td :style="{ textAlign: 'center', color:$parent.$parent.$parent.setbackgroundColor(row.f_run_date) ? 'red' : ''}">{{ row.f_user_type =='民用'?row.num-row.xiafa:row.num4-row.xiafa }}</td>
157
- <td :style="{ textAlign: 'center', color:$parent.$parent.$parent.setbackgroundColor(row.f_run_date) ? 'red' : ''}">{{ row.yijian }}</td>
158
- <td :style="{ textAlign: 'center', color:$parent.$parent.$parent.setbackgroundColor(row.f_run_date) ? 'red' : ''}">{{ row.weijian }}</td>
159
- <!-- <td v-show="row.f_check_book_type!='小区'" style="text-align: center;"><button class="button_spacing button_search-1" @click.stop='$parent.$parent.$parent.send(row)'>下发</button></td>-->
160
- </template>
161
- </data-grid>
162
- </criteria-paged>
163
- <modal :show.sync="showModal" :backdrop="false" id="checkbookEntryShow">
164
- <article slot="modal-body" class="modal-body">
165
- <check-book-entry v-if="showModal" @select-changed="selectedEntry"></check-book-entry>
166
- </article>
167
- <footer slot="modal-footer">
168
- </footer>
169
-
170
- </modal>
171
- <modal :show.sync="showSendModal" :backdrop="false" width="90%" height="90%">
172
- <article slot="modal-body" class="modal-body" style="height: 80vh">
173
- <check-book-search-user-list v-if="showSendModal" :row="checkBookRow" :bookrow="checkBookRow" :needprops="needprops":userlogin="userlogin"></check-book-search-user-list>
174
- </article>
175
- <footer slot="modal-footer">
176
- </footer>
177
-
178
- </modal>
179
- </div>
180
- </template>
181
-
182
- <script>
183
- import {PagedList} from 'vue-client'
184
- import {HttpResetClass} from 'vue-client'
185
- import bus from '../../../bus'
186
- export default {
187
- title: '用户安检情况',
188
- data () {
189
- return {
190
- showSendModal:false,
191
- searchData: {
192
- condition: '1=1'
193
- },
194
- showCaoZuo:false,
195
- userlogin:{
196
- id:this.$login.f.id,
197
- name:this.$login.f.name,
198
- orgid:this.$login.f.orgid,
199
- orgstr:this.$login.f.orgs,
200
- },
201
- checkBooks:[],
202
- bookTypes: [{label: '全部', value: ''}, {label: '用户', value: '用户'}, {label: '小区', value: '小区'}],
203
- userTypes: [{label: '全部', value: ''}, {label: '民用', value: '民用'}, {label: '非民用', value: '非民用'}],
204
- aroundUnit: [{label: '年', value: '年'}, {label: '月', value: '月'}, {label: '日', value: '日'}],
205
- showModal:false,
206
- excelHeaders: {
207
-
208
- 'f_userinfo_code': '用户编号',
209
- 'f_user_name': '用户名称',
210
- 'f_user_phone': '用户电话',
211
- 'f_meternumber': '用户表号',
212
- 'f_user_type': '用户类型',
213
- 'f_last_checker': '安检员',
214
- 'f_residential_area': '小区名称',
215
- 'f_address': '地址',
216
- 'f_last_check_date': '安检日期',
217
- 'f_last_check_state': '安检状态',
218
- 'f_last_check_result': '安检结果'
219
- },
220
- model: new PagedList('rs/sql/QueryCheckBook', 20),
221
- checkBookRow:{},
222
- checkBook :{
223
- f_check_book_name: '',
224
- f_run_date: '',
225
- f_around_time: '',
226
- f_around_unit: '',
227
- f_create_date: '',
228
- f_create_person: '',
229
- f_orgid: '',
230
- f_checker_name: ''
231
- }
232
- }
233
- },
234
- props: {
235
- style: {
236
- type: String,
237
- default: 'col-sm-2 form-group'
238
- },
239
- style2: {
240
- type: String,
241
- default: 'col-sm-4 form-group'
242
- },
243
- needprops:{
244
- type: Object,
245
- default:{}
246
- },
247
- showtype:{
248
- type: String
249
- }
250
- },
251
- ready () {
252
- bus.$on('fresh-main',()=>{
253
- console.log("进入方法")
254
- this.$refs.paged.$refs.criteria.search()
255
- })
256
- this.freshCheckBook()
257
- },
258
- beforeDestroy() {
259
- //tag
260
- bus.$off('fresh-main')
261
- },
262
- methods: {
263
- setbackgroundColor(val) {
264
- var t = this.$appdata.getSingleValue('安检册提醒时间');
265
- //将t转为数字
266
- t = parseInt(t);
267
- if (typeof t !== 'number' || isNaN(t)) {
268
- console.error('获取的安检册提醒时间不是一个有效的数字');
269
- return false;
270
- }
271
- // 将传入的日期字符串转换为 Date 对象
272
- var inputDate = new Date(val);
273
- if (isNaN(inputDate.getTime())) {
274
- console.error('传入的日期不是一个有效的日期格式');
275
- return false;
276
- }
277
- // 获取当前日期
278
- var currentDate = new Date();
279
- // 计算两个日期之间的月份差
280
- var monthsDifference = (currentDate.getFullYear() - inputDate.getFullYear()) * 12 + (currentDate.getMonth() - inputDate.getMonth());
281
- // 判断月份差是否大于 t
282
- return monthsDifference <= t;
283
-
284
- },
285
- send(row){
286
- console.log("7758521",row)
287
- this.checkBookRow = row
288
- this.showSendModal = true
289
- },
290
- freshCheckBook () {
291
- this.checkBooks = []
292
- new HttpResetClass().load('POST', `/rs/sql/safe_singleTable_OrderBy`, {
293
- data: {
294
- items: 'id,f_check_book_name',
295
- tablename: 't_check_book',
296
- condition: this.$refs.paged.$refs.criteria.model.f_orgid?`f_orgid in ${this.$refs.paged.$refs.criteria.model.f_orgid} and f_user_type ='${this.showtype}' `:`f_user_type ='${this.showtype}'`,
297
- orderitem: 'id desc'
298
- }
299
- }, {resolveMsg: null, rejectMsg: null}).then(res => {
300
- this.checkBooks.push({label: '全部', value: ''})
301
- res.data.forEach(ress => {
302
- this.checkBooks.push({
303
- label: ress.f_check_book_name,
304
- value: ress.id
305
- })
306
- })
307
- })
308
- },
309
- selectedEntry(){
310
- console.log("666666666666666666")
311
- },
312
- details(row){
313
- this.$emit('showdetails' ,row)
314
- },
315
- add(){
316
- this.$emit('addbook')
317
- },
318
- ok (){
319
- //tag
320
- let http = new HttpResetClass()
321
- http.load('POST', 'rs/logic/safeEntity', {data:{tableName:'t_check_book',entityData:this.checkBook}},
322
- {resolveMsg: '更新片区信息成功', rejectMsg: '保存片区信息成功'}).then(res=>{
323
- if (res.data.code===200){
324
- this.$showMessage('修改成功')
325
- this.showModal = false
326
- this.checkBook= {}
327
- }
328
- })
329
- },
330
- cancel () {
331
- this.showModal = false
332
- this.checkBook= {}
333
- },
334
- updateCheckBook(val){
335
- this.checkBook=val
336
- this.showModal = true
337
- },
338
- search (args) {
339
- // //tag
340
- this.$parent.showItem = false
341
- this.$parent.showItemUser = false
342
- args.condition += ` and f_orgid in ${this.model.f_filialeids}`
343
- args.condition += ` and tcb.f_user_type ='${this.showtype}' `
344
- return this.model.search(args.condition, args.model)
345
- },
346
- getRes (obj) {
347
- this.model.f_filialeids = this.$login.convertToIn(obj.resids)
348
- },
349
- async deleteCheckBook (val) {
350
- try {
351
- //tag
352
- let http = new HttpResetClass()
353
- let upAddress = `update t_user_address set f_check_book_id = null where f_check_book_id = '${val.id}'`
354
- let delCheckBook= `delete from t_check_book where id ='${val.id}'`
355
- await http.load('POST', 'rs/logic/runSQL', {data: {sql: upAddress}},
356
- {resolveMsg: null, rejectMsg: '删除片区失败'})
357
- await http.load('POST', 'rs/logic/runSQL', {data: {sql: delCheckBook}},
358
- {resolveMsg: null, rejectMsg: '删除片区失败'})
359
- this.$showMessage('删除成功')
360
- this.$refs.paged.$refs.criteria.search()
361
- }catch (e) {
362
- this.$showMessage('删除失败',e)
363
- }
364
- }
365
- },
366
-
367
- watch: {
368
- 'model.rows'(val){
369
- console.log("997997",val)
370
- this.showCaoZuo = val.filter(item=>item.f_check_book_type!='小区').length>0
371
- }
372
- },
373
- computed: {
374
- selected () {
375
- return this.$refs.paged.$refs.grid.selected
376
- }
377
- }
378
- }
379
- </script>
380
- <style scoped>
381
- .newcolor {
382
- color: red;
383
- }
384
-
385
- .table th {
386
- background-color: #f2f6fa;
387
- color: black;
388
- }
389
- </style>
390
- <style lang="less">
391
- #checkbookEntryShow {
392
- .modal-dialog {
393
- width: 80%;
394
- }
395
- }
396
- </style>
1
+ <template>
2
+ <div class="flex">
3
+ <criteria-paged :model="model" v-ref:paged>
4
+ <criteria partial='criteria' @condition-changed='$parent.search' v-ref:criteria>
5
+ <div novalidate class="form-horizontal select-overspread container-fluid auto" partial>
6
+ <div class="row" v-show="!$parent.$parent.$parent.showItemAll">
7
+ <div :class="$parent.$parent.style2" style="margin: 0px">
8
+ <role-selector-safe
9
+ role-name="安检员"
10
+ role-lable="安&nbsp;检&nbsp;员&nbsp;"
11
+ @re-res="$parent.$parent.getRes"
12
+ :value.sync="model.f_checker_id"
13
+ v-model="model.f_checker_id"
14
+ :value-multiple="true"
15
+ condition=" f_checker_name in {}">
16
+ </role-selector-safe>
17
+ </div>
18
+ <div :class="$parent.$parent.style">
19
+ <label class="font_normal_body">片区名称</label>
20
+ <v-select :value.sync="model.f_check_book_id" v-model='model.f_check_book_id'
21
+ :value-single="true" style="width: 60%"
22
+ class="select_list select"
23
+ :options='$parent.$parent.checkBooks' placeholder='片区名称'
24
+ close-on-select
25
+ condition="tcb.id ='{}'"></v-select>
26
+ </div>
27
+ <!-- <div :class="$parent.$parent.style">-->
28
+ <!-- <label class="font_normal_body">表册类型</label>-->
29
+ <!-- <v-select :value.sync="model.f_check_book_type" v-model='model.f_check_book_type'-->
30
+ <!-- :value-single="true" style="width: 60%"-->
31
+ <!-- class="select_list select"-->
32
+ <!-- :options='$parent.$parent.bookTypes' placeholder='表册类型'-->
33
+ <!-- close-on-select-->
34
+ <!-- condition="tcb.f_check_book_type ='{}'"></v-select>-->
35
+ <!-- </div>-->
36
+ <!-- <div :class="$parent.$parent.style">-->
37
+ <!-- <label class="font_normal_body">用户类型</label>-->
38
+ <!-- <v-select :value.sync="model.f_user_type" v-model='model.f_user_type'-->
39
+ <!-- :value-single="true" style="width: 60%"-->
40
+ <!-- class="select_list select"-->
41
+ <!-- :options='$parent.$parent.userTypes' placeholder='用户类型'-->
42
+ <!-- close-on-select-->
43
+ <!-- condition="tcb.f_user_type ='{}'"></v-select>-->
44
+ <!-- </div>-->
45
+ <div :class="$parent.$parent.style" style="width: auto;margin-top:8px;float: right">
46
+ <button type="button" class="button_search button_spacing" @click="search()">查询</button>
47
+ <button type="button" class="button_new button_spacing" @click="$parent.$parent.add()">新增片区</button>
48
+ <button type="button" class="button_new button_spacing" @click="$parent.$parent.showModal = true">片区用户管理</button>
49
+ <div style="float: right" class="button_spacing"
50
+ v-show="$parent.$parent.$parent.showItem ||$parent.$parent.$parent.showItemUser"
51
+ :class="{'button_shrink_left':$parent.$parent.$parent.showItemAll,'button_shrink_right':!$parent.$parent.$parent.showItemAll}"
52
+ @click="($parent.$parent.$parent.showItem =false) || ($parent.$parent.$parent.showItemUser =false)"></div>
53
+ </div>
54
+
55
+
56
+ </div>
57
+
58
+
59
+ <div class="row" v-show="$parent.$parent.$parent.showItemAll">
60
+ <div :class="$parent.$parent.style2" style="margin: 0px">
61
+ <role-selector-safe
62
+ role-name="安检员"
63
+ role-lable="安&nbsp;检&nbsp;员&nbsp;"
64
+ @re-res="$parent.$parent.getRes"
65
+ :value.sync="model.f_checker_id"
66
+ v-model="model.f_checker_id"
67
+ :value-multiple="true"
68
+ condition=" f_checker_name in {}">
69
+ </role-selector-safe>
70
+ </div>
71
+ <div :class="$parent.$parent.style">
72
+ <label class="font_normal_body">片区名</label>
73
+ <v-select :value.sync="model.f_check_book_id" v-model='model.f_check_book_id'
74
+ :value-single="true" style="width: 60%"
75
+ class="select_list select"
76
+ :options='$parent.$parent.checkBooks' placeholder='片区名称'
77
+ close-on-select
78
+ condition="tcb.id ='{}'"></v-select>
79
+ </div>
80
+ <div :class="$parent.$parent.style" style="width: auto;margin-top:8px;float: right">
81
+ <button type="button" class="button_search button_spacing" @click="search()">查询</button>
82
+ <button type="button" class="button_new button_spacing" @click="$parent.$parent.add()">新增片区</button>
83
+ <button type="button" class="button_new button_spacing" @click="$parent.$parent.showModal = true">片区用户管理</button>
84
+ <div style="float: right" class="button_spacing"
85
+ v-show="$parent.$parent.$parent.showItem ||$parent.$parent.$parent.showItemUser"
86
+ :class="{'button_shrink_left':$parent.$parent.$parent.showItemAll,'button_shrink_right':!$parent.$parent.$parent.showItemAll}"
87
+ @click="($parent.$parent.$parent.showItem =false) || ($parent.$parent.$parent.showItemUser =false)"></div>
88
+ <!-- <div style="float: right" class="button_spacing"-->
89
+ <!-- :class="{'button_shrink_top':$parent.$parent.criteriaShow,'button_shrink_bottom':!$parent.$parent.criteriaShow}"-->
90
+ <!-- @click="$parent.$parent.hidden()">-->
91
+ <!-- </div>-->
92
+ </div>
93
+
94
+ </div>
95
+
96
+ </div>
97
+ </criteria>
98
+ <data-grid :model="model" partial="list" class="list_area table_sy" v-ref:grid>
99
+ <template partial='head'>
100
+ <tr>
101
+ <th>
102
+ <nobr>所属安检员</nobr>
103
+ </th>
104
+ <th>
105
+ <nobr>片区名称</nobr>
106
+ </th>
107
+ <!-- <th>-->
108
+ <!-- <nobr>片区类型</nobr>-->
109
+ <!-- </th>-->
110
+ <th>
111
+ <nobr>用户类型</nobr>
112
+ </th>
113
+ <th>
114
+ <nobr>创建日期</nobr>
115
+ </th>
116
+ <th>
117
+ <nobr>创建人</nobr>
118
+ </th>
119
+
120
+ <th>
121
+ <nobr>执行日期</nobr>
122
+ </th>
123
+ <th>
124
+ <nobr>执行周期</nobr>
125
+ </th>
126
+ <th>
127
+ <nobr>小区/单位数量</nobr>
128
+ </th>
129
+ <th>
130
+ <nobr>已下发</nobr>
131
+ </th>
132
+ <th>
133
+ <nobr>未下发</nobr>
134
+ </th>
135
+ <th>
136
+ <nobr>已检</nobr>
137
+ </th>
138
+ <th>
139
+ <nobr>未检</nobr>
140
+ </th>
141
+ <!-- <th v-show="$parent.$parent.$parent.showCaoZuo">-->
142
+ <!-- <nobr>操作</nobr>-->
143
+ <!-- </th>-->
144
+ </tr>
145
+ </template>
146
+ <template partial='body' >
147
+ <td :style="{ textAlign: 'center', color:$parent.$parent.$parent.setbackgroundColor(row.f_run_date) ? 'red' : ''}">{{ row.f_checker_name }}</td>
148
+ <td :style="{ textAlign: 'center', color:$parent.$parent.$parent.setbackgroundColor(row.f_run_date) ? 'red' : ''}">{{ row.f_check_book_name }}</td>
149
+ <td :style="{ textAlign: 'center', color:$parent.$parent.$parent.setbackgroundColor(row.f_run_date) ? 'red' : ''}">{{ row.f_user_type }}</td>
150
+ <td :style="{ textAlign: 'center', color:$parent.$parent.$parent.setbackgroundColor(row.f_run_date) ? 'red' : ''}">{{ row.f_create_date }}</td>
151
+ <td :style="{ textAlign: 'center', color:$parent.$parent.$parent.setbackgroundColor(row.f_run_date) ? 'red' : ''}">{{ row.f_create_person }}</td>
152
+ <td :style="{ textAlign: 'center', color:$parent.$parent.$parent.setbackgroundColor(row.f_run_date) ? 'red' : ''}">{{ row.f_run_date }}</td>
153
+ <td :style="{ textAlign: 'center', color:$parent.$parent.$parent.setbackgroundColor(row.f_run_date) ? 'red' : ''}">{{ row.f_around_time }}{{ row.f_around_unit }}</td>
154
+ <td :style="{ textAlign: 'center', color:$parent.$parent.$parent.setbackgroundColor(row.f_run_date) ? 'red' : ''}"><button @click.stop="$parent.$parent.$parent.details(row)" class="btn btn-link"><b>{{row.f_user_type==='民用'?row.num2:row.num3}}</b></button></td>
155
+ <td :style="{ textAlign: 'center', color:$parent.$parent.$parent.setbackgroundColor(row.f_run_date) ? 'red' : ''}">{{ row.xiafa }}</td>
156
+ <td :style="{ textAlign: 'center', color:$parent.$parent.$parent.setbackgroundColor(row.f_run_date) ? 'red' : ''}">{{ row.f_user_type =='民用'?row.num-row.xiafa:row.num4-row.xiafa }}</td>
157
+ <td :style="{ textAlign: 'center', color:$parent.$parent.$parent.setbackgroundColor(row.f_run_date) ? 'red' : ''}">{{ row.yijian }}</td>
158
+ <td :style="{ textAlign: 'center', color:$parent.$parent.$parent.setbackgroundColor(row.f_run_date) ? 'red' : ''}">{{ row.weijian }}</td>
159
+ <!-- <td v-show="row.f_check_book_type!='小区'" style="text-align: center;"><button class="button_spacing button_search-1" @click.stop='$parent.$parent.$parent.send(row)'>下发</button></td>-->
160
+ </template>
161
+ </data-grid>
162
+ </criteria-paged>
163
+ <modal :show.sync="showModal" :backdrop="false" id="checkbookEntryShow">
164
+ <article slot="modal-body" class="modal-body">
165
+ <check-book-entry v-if="showModal" @select-changed="selectedEntry"></check-book-entry>
166
+ </article>
167
+ <footer slot="modal-footer">
168
+ </footer>
169
+
170
+ </modal>
171
+ <modal :show.sync="showSendModal" :backdrop="false" width="90%" height="90%">
172
+ <article slot="modal-body" class="modal-body" style="height: 80vh">
173
+ <check-book-search-user-list v-if="showSendModal" :row="checkBookRow" :bookrow="checkBookRow" :needprops="needprops":userlogin="userlogin"></check-book-search-user-list>
174
+ </article>
175
+ <footer slot="modal-footer">
176
+ </footer>
177
+
178
+ </modal>
179
+ </div>
180
+ </template>
181
+
182
+ <script>
183
+ import {PagedList} from 'vue-client'
184
+ import {HttpResetClass} from 'vue-client'
185
+ import bus from '../../../bus'
186
+ export default {
187
+ title: '用户安检情况',
188
+ data () {
189
+ return {
190
+ showSendModal:false,
191
+ searchData: {
192
+ condition: '1=1'
193
+ },
194
+ showCaoZuo:false,
195
+ userlogin:{
196
+ id:this.$login.f.id,
197
+ name:this.$login.f.name,
198
+ orgid:this.$login.f.orgid,
199
+ orgstr:this.$login.f.orgs,
200
+ },
201
+ checkBooks:[],
202
+ bookTypes: [{label: '全部', value: ''}, {label: '用户', value: '用户'}, {label: '小区', value: '小区'}],
203
+ userTypes: [{label: '全部', value: ''}, {label: '民用', value: '民用'}, {label: '非民用', value: '非民用'}],
204
+ aroundUnit: [{label: '年', value: '年'}, {label: '月', value: '月'}, {label: '日', value: '日'}],
205
+ showModal:false,
206
+ excelHeaders: {
207
+
208
+ 'f_userinfo_code': '用户编号',
209
+ 'f_user_name': '用户名称',
210
+ 'f_user_phone': '用户电话',
211
+ 'f_meternumber': '用户表号',
212
+ 'f_user_type': '用户类型',
213
+ 'f_last_checker': '安检员',
214
+ 'f_residential_area': '小区名称',
215
+ 'f_address': '地址',
216
+ 'f_last_check_date': '安检日期',
217
+ 'f_last_check_state': '安检状态',
218
+ 'f_last_check_result': '安检结果'
219
+ },
220
+ model: new PagedList('rs/sql/QueryCheckBook', 20),
221
+ checkBookRow:{},
222
+ checkBook :{
223
+ f_check_book_name: '',
224
+ f_run_date: '',
225
+ f_around_time: '',
226
+ f_around_unit: '',
227
+ f_create_date: '',
228
+ f_create_person: '',
229
+ f_orgid: '',
230
+ f_checker_name: ''
231
+ }
232
+ }
233
+ },
234
+ props: {
235
+ style: {
236
+ type: String,
237
+ default: 'col-sm-2 form-group'
238
+ },
239
+ style2: {
240
+ type: String,
241
+ default: 'col-sm-4 form-group'
242
+ },
243
+ needprops:{
244
+ type: Object,
245
+ default:{}
246
+ },
247
+ showtype:{
248
+ type: String
249
+ }
250
+ },
251
+ ready () {
252
+ bus.$on('fresh-main',()=>{
253
+ console.log("进入方法")
254
+ this.$refs.paged.$refs.criteria.search()
255
+ })
256
+ this.freshCheckBook()
257
+ },
258
+ beforeDestroy() {
259
+ //tag
260
+ bus.$off('fresh-main')
261
+ },
262
+ methods: {
263
+ setbackgroundColor(val) {
264
+ var t = this.$appdata.getSingleValue('安检册提醒时间');
265
+ //将t转为数字
266
+ t = parseInt(t);
267
+ if (typeof t !== 'number' || isNaN(t)) {
268
+ console.error('获取的安检册提醒时间不是一个有效的数字');
269
+ return false;
270
+ }
271
+ // 将传入的日期字符串转换为 Date 对象
272
+ var inputDate = new Date(val);
273
+ if (isNaN(inputDate.getTime())) {
274
+ console.error('传入的日期不是一个有效的日期格式');
275
+ return false;
276
+ }
277
+ // 获取当前日期
278
+ var currentDate = new Date();
279
+ // 计算两个日期之间的月份差
280
+ var monthsDifference = (currentDate.getFullYear() - inputDate.getFullYear()) * 12 + (currentDate.getMonth() - inputDate.getMonth());
281
+ // 判断月份差是否大于 t
282
+ return monthsDifference <= t;
283
+
284
+ },
285
+ send(row){
286
+ console.log("7758521",row)
287
+ this.checkBookRow = row
288
+ this.showSendModal = true
289
+ },
290
+ freshCheckBook () {
291
+ this.checkBooks = []
292
+ new HttpResetClass().load('POST', `/rs/sql/safe_singleTable_OrderBy`, {
293
+ data: {
294
+ items: 'id,f_check_book_name',
295
+ tablename: 't_check_book',
296
+ condition: this.$refs.paged.$refs.criteria.model.f_orgid?`f_orgid in ${this.$refs.paged.$refs.criteria.model.f_orgid} and f_user_type ='${this.showtype}' `:`f_user_type ='${this.showtype}'`,
297
+ orderitem: 'id desc'
298
+ }
299
+ }, {resolveMsg: null, rejectMsg: null}).then(res => {
300
+ this.checkBooks.push({label: '全部', value: ''})
301
+ res.data.forEach(ress => {
302
+ this.checkBooks.push({
303
+ label: ress.f_check_book_name,
304
+ value: ress.id
305
+ })
306
+ })
307
+ })
308
+ },
309
+ selectedEntry(){
310
+ console.log("666666666666666666")
311
+ },
312
+ details(row){
313
+ this.$emit('showdetails' ,row)
314
+ },
315
+ add(){
316
+ this.$emit('addbook')
317
+ },
318
+ ok (){
319
+ //tag
320
+ let http = new HttpResetClass()
321
+ http.load('POST', 'rs/logic/safeEntity', {data:{tableName:'t_check_book',entityData:this.checkBook}},
322
+ {resolveMsg: '更新片区信息成功', rejectMsg: '保存片区信息成功'}).then(res=>{
323
+ if (res.data.code===200){
324
+ this.$showMessage('修改成功')
325
+ this.showModal = false
326
+ this.checkBook= {}
327
+ }
328
+ })
329
+ },
330
+ cancel () {
331
+ this.showModal = false
332
+ this.checkBook= {}
333
+ },
334
+ updateCheckBook(val){
335
+ this.checkBook=val
336
+ this.showModal = true
337
+ },
338
+ search (args) {
339
+ // //tag
340
+ this.$parent.showItem = false
341
+ this.$parent.showItemUser = false
342
+ args.condition += ` and f_orgid in ${this.model.f_filialeids}`
343
+ args.condition += ` and tcb.f_user_type ='${this.showtype}' `
344
+ return this.model.search(args.condition, args.model)
345
+ },
346
+ getRes (obj) {
347
+ this.model.f_filialeids = this.$login.convertToIn(obj.resids)
348
+ },
349
+ async deleteCheckBook (val) {
350
+ try {
351
+ //tag
352
+ let http = new HttpResetClass()
353
+ let upAddress = `update t_user_address set f_check_book_id = null where f_check_book_id = '${val.id}'`
354
+ let delCheckBook= `delete from t_check_book where id ='${val.id}'`
355
+ await http.load('POST', 'rs/logic/runSQL', {data: {sql: upAddress}},
356
+ {resolveMsg: null, rejectMsg: '删除片区失败'})
357
+ await http.load('POST', 'rs/logic/runSQL', {data: {sql: delCheckBook}},
358
+ {resolveMsg: null, rejectMsg: '删除片区失败'})
359
+ this.$showMessage('删除成功')
360
+ this.$refs.paged.$refs.criteria.search()
361
+ }catch (e) {
362
+ this.$showMessage('删除失败',e)
363
+ }
364
+ }
365
+ },
366
+
367
+ watch: {
368
+ 'model.rows'(val){
369
+ console.log("997997",val)
370
+ this.showCaoZuo = val.filter(item=>item.f_check_book_type!='小区').length>0
371
+ }
372
+ },
373
+ computed: {
374
+ selected () {
375
+ return this.$refs.paged.$refs.grid.selected
376
+ }
377
+ }
378
+ }
379
+ </script>
380
+ <style scoped>
381
+ .newcolor {
382
+ color: red;
383
+ }
384
+
385
+ .table th {
386
+ background-color: #f2f6fa;
387
+ color: black;
388
+ }
389
+ </style>
390
+ <style lang="less">
391
+ #checkbookEntryShow {
392
+ .modal-dialog {
393
+ width: 80%;
394
+ }
395
+ }
396
+ </style>