safecheck-client 3.0.33-5 → 3.0.33-50

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.
Files changed (55) hide show
  1. package/package.json +3 -3
  2. package/src/App.vue +31 -31
  3. package/src/components/paper/PaperList.vue +5 -4
  4. package/src/components/planmanage/checkUserList.vue +34 -2
  5. package/src/components/report/CheckPlanCountChartArea.vue +5 -0
  6. package/src/filiale/Util.js +5 -0
  7. package/src/filiale/bayan/android/AddPlanItem.vue +12 -3
  8. package/src/filiale/bayan/android/SafecheckOrderV.vue +4 -1
  9. package/src/filiale/bayan/android/SafecheckUserInfo.vue +532 -508
  10. package/src/filiale/dexin/android/SafecheckDevices.vue +1 -1
  11. package/src/filiale/dexin/android/WebMeterOpen.vue +1 -1
  12. package/src/filiale/dexin/android/WebMeterOpenEdit.vue +25 -37
  13. package/src/filiale/fugou/pc/AddToCheckBook.vue +56 -119
  14. package/src/filiale/fugou/pc/CheckBook.vue +2 -0
  15. package/src/filiale/fugou/pc/CheckBookEntry.vue +47 -19
  16. package/src/filiale/fugou/pc/CheckBookList.vue +2 -2
  17. package/src/filiale/fugou/pc/CheckBookSearchUser.vue +733 -574
  18. package/src/filiale/fugou/pc/CheckBookUser.vue +102 -45
  19. package/src/filiale/fugou/pc/PlanManage.vue +62 -8
  20. package/src/filiale/fugou/pc/checkUserList.vue +222 -42
  21. package/src/filiale/hanzhong/pc/CheckHiddenDanger.vue +15 -5
  22. package/src/filiale/hanzhong/pc/CheckSafeDetail.vue +12 -2
  23. package/src/filiale/hanzhong/pc/CheckSafeStatus.vue +12 -3
  24. package/src/filiale/hanzhong/pc/CheckSearchUser.vue +13 -0
  25. package/src/filiale/hanzhong/pc/CheckUserList.vue +30 -11
  26. package/src/filiale/hanzhong/pc/CheckerSafeDetail.vue +11 -2
  27. package/src/filiale/jingyang/pc/ReportCheckItemList.vue +543 -0
  28. package/src/filiale/jingyang/pc.js +1 -0
  29. package/src/filiale/rongchuang/android/SafecheckDevices.vue +468 -748
  30. package/src/filiale/rongchuang/android/SafecheckOrderV.vue +984 -1234
  31. package/src/filiale/rongchuang/android.js +1 -0
  32. package/src/filiale/rongchuang/pc/NewCheckpaper.vue +294 -305
  33. package/src/filiale/rongchuang/pc/PaperList.vue +812 -0
  34. package/src/filiale/rongchuang/pc.js +1 -0
  35. package/src/filiale/tongchuan/pc/checkUserList.vue +2 -2
  36. package/src/filiale/weinan/android/SafecheckDevices.vue +1082 -1025
  37. package/src/filiale/weinan/android/SafecheckOrderV.vue +71 -26
  38. package/src/filiale/weinan/pc/CheckSearchUser.vue +1078 -0
  39. package/src/filiale/weinan/pc/DefectPaperNew.vue +1065 -1059
  40. package/src/filiale/weinan/pc.js +45 -44
  41. package/src/filiale/wensu/pc/CheckSearchUser.vue +2 -0
  42. package/src/filiale/wensu/pc/DefectPaperNew.vue +1148 -1148
  43. package/src/filiale/wensu/pc/checkUserList.vue +650 -650
  44. package/src/filiale/wenxi/android/SafecheckUserInfo.vue +1 -1
  45. package/src/filiale/wuhai/pc/PaperList.vue +785 -0
  46. package/src/filiale/wuhai/pc.js +1 -0
  47. package/src/filiale/yangchunboneng/android/SafecheckOrderV.vue +2 -2
  48. package/src/filiale/yongzhou/pc/CheckPlan.vue +59 -0
  49. package/src/filiale/yongzhou/pc/DefectPaperNew.vue +1105 -0
  50. package/src/filiale/yongzhou/pc/SelectCheckPlan.vue +364 -0
  51. package/src/filiale/yongzhou/pc/communityTypeDetailM.vue +94 -187
  52. package/src/filiale/yongzhou/pc/safeDetail.vue +212 -14
  53. package/src/filiale/yongzhou/pc.js +3 -0
  54. package/src/filiale/yunchengminsheng/pc/checkUserList.vue +18 -1
  55. package/src/main.js +1 -1
@@ -4,36 +4,59 @@
4
4
  <criteria partial='criteria' @condition-changed='$parent.selfSearch' v-ref:criteria>
5
5
  <div novalidate class="form-horizontal select-overspread container-fluid auto" partial>
6
6
  <div class="row">
7
- <div class="form-group col-sm-3" >
7
+ <div class="form-group col-sm-3">
8
8
  <label class="font_normal_body">客户编号</label>
9
- <input type="text" class="input_search" style="width:60%" v-model="model.f_userinfo_code" placeholder='客户编号'
9
+ <input type="text" class="input_search" style="width:60%" v-model="model.f_userinfo_code"
10
+ placeholder='客户编号'
10
11
  condition="f_userinfo_code = '{}'" @keyup.enter="search()">
11
12
  </div>
12
- <div class="form-group col-sm-2 button-range" >
13
- <button class="button_search" style="margin-right: 10px" @click="search()" v-el:cba>查询</button>
13
+ <div class="form-group col-sm-2 button-range">
14
+ <button class="button_search" style="margin-right: 10px" @click="search()" v-el:cba>查询</button>
15
+
16
+ </div>
17
+ <div class="form-group col-sm-2 button-range">
18
+ <button class="button_search" style="margin-right: 10px" @click="$parent.$parent.delOfCheckBook()" v-el:cba>移出</button>
14
19
 
15
20
  </div>
16
21
  </div>
17
22
  </div>
18
23
  </criteria>
19
- <data-grid :model="model" class="table_sy" partial='list' v-ref:grid >
20
- <template partial='head' >
24
+ <data-grid :model="model" class="table_sy" partial='list' v-ref:grid>
25
+ <template partial='head'>
21
26
  <tr>
22
- <th><nobr>序号</nobr></th>
23
- <th><nobr>用户编号</nobr></th>
24
- <th><nobr>用户姓名</nobr></th>
25
- <th><nobr>用户电话</nobr></th>
26
- <th><nobr>用户地址</nobr></th>
27
+ <th>
28
+ <nobr><input type="checkbox" v-model="$parent.$parent.$parent.bookAll"></input>全选</nobr>
29
+ </th>
30
+ <th>
31
+ <nobr>序号</nobr>
32
+ </th>
33
+ <th>
34
+ <nobr>用户编号</nobr>
35
+ </th>
36
+ <th>
37
+ <nobr>用户姓名</nobr>
38
+ </th>
39
+ <th>
40
+ <nobr>用户电话</nobr>
41
+ </th>
42
+ <th>
43
+ <nobr>用户地址</nobr>
44
+ </th>
27
45
 
28
46
  </tr>
29
47
  </template>
30
- <template partial='body' >
31
- <tr >
32
- <td style="text-align:center;">{{$index+1}}</td>
33
- <td style="text-align:center">{{row.f_userinfo_code}}</td>
34
- <td style="text-align:center">{{row.f_user_name}}</td>
35
- <td style="text-align:center">{{row.f_user_phone}}</td>
36
- <td style="text-align:center">{{row.f_address}}</td>
48
+ <template partial='body'>
49
+ <tr>
50
+ <td style="text-align: center">
51
+ <nobr><input type="checkbox" :checked="$parent.$parent.$parent.checkModel(row)"
52
+ @change="$parent.$parent.$parent.checkChange(row, $event)"></input>
53
+ </nobr>
54
+ </td>
55
+ <td style="text-align:center;">{{ $index + 1 }}</td>
56
+ <td style="text-align:center">{{ row.f_userinfo_code }}</td>
57
+ <td style="text-align:center">{{ row.f_user_name }}</td>
58
+ <td style="text-align:center">{{ row.f_user_phone }}</td>
59
+ <td style="text-align:center">{{ row.f_address }}</td>
37
60
  </tr>
38
61
  </template>
39
62
  <template partial='foot'></template>
@@ -43,58 +66,92 @@
43
66
  </template>
44
67
 
45
68
  <script>
46
- import {PagedList} from 'vue-client'
69
+ import {HttpResetClass, PagedList} from 'vue-client'
47
70
 
48
71
  export default {
49
72
  title: '安检记录列表',
50
73
  props: ['row'],
51
- data () {
74
+ data() {
52
75
  return {
53
76
  rowdata: this.row,
54
- model: new PagedList('rs/sql/getUserByCheckBook', 50)
77
+ bookAll: false,
78
+ bookList:[],
79
+ model: new PagedList('rs/sql/safe_singleTable_OrderBy', 50,
80
+ {
81
+ items: '"tua.f_address,tui.f_userinfo_code,tui.f_user_name,tui.f_user_phone,tui.f_userinfo_id"',
82
+ tablename: '"t_user_address tua left join t_userinfo tui on tua.f_userinfo_id = tui.f_userinfo_id"',
83
+ orderitem: '"tua.id desc"'
84
+ }
85
+ )
55
86
  }
56
87
  },
57
- ready(){
58
- if(this.row){
59
- let condition=''
60
- if(this.row.f_check_book_type1=='小区'){
61
- this.model.url = 'rs/sql/getUserByCheckBook'
62
- condition = `ta.f_check_book_id =${this.row.f_check_book_id} and ta.id=${this.row.id}`
63
- }else{
64
- this.model.url = 'rs/sql/getUserByCheckBookCompany'
65
- condition = `tc.f_check_book_id =${this.row.f_check_book_id} and tc.id=${this.row.id}`
66
- }
88
+ ready() {
89
+ if (this.row) {
90
+ let condition = ''
91
+ condition = `tua.f_check_book_id =${this.row.id}`
67
92
  this.model.search(condition)
68
93
  //只显示用户页面
69
- this.row.f_check_book_type='用户'
94
+ this.row.f_check_book_type = '用户'
70
95
  }
71
96
  },
72
97
  watch: {
73
- 'row' (val) {
98
+ 'row'(val) {
74
99
  if (val) {
75
100
  this.rowdata = val
76
- let condition=''
77
- if(this.row.f_check_book_type1=='小区'){
78
- condition = `ta.f_check_book_id =${val.f_check_book_id} and ta.id=${val.id}`
79
- }else{
80
- condition = `tc.f_check_book_id =${val.f_check_book_id} and tc.id=${val.id}`
81
- }
101
+ let condition = ''
102
+ condition = `tua.f_check_book_id =${val.id} `
82
103
  this.model.search(condition)
83
104
  }
84
105
  }
85
106
  },
86
107
  methods: {
87
- selfSearch (args) {
108
+ selfSearch(args) {
88
109
  if (this.rowdata.id) {
89
- if(this.rowdata.f_check_book_type1=='小区'){
90
- args.condition += `and ta.f_check_book_id =${this.rowdata.f_check_book_id} and ta.id=${this.rowdata.id}`
91
- }else{
92
- args.condition += `and tc.f_check_book_id =${this.rowdata.f_check_book_id} and tc.id=${this.rowdata.id}`
93
- }
110
+ args.condition += `and tua.f_check_book_id =${this.rowdata.id}`
94
111
  this.model.search(args.condition)
95
112
  } else {
96
113
  this.$showMessage('请选择片区')
97
114
  }
115
+ },
116
+ checkModel (row) {
117
+ if (this.bookAll) {
118
+ return true
119
+ } else {
120
+ return this.bookList.findIndex(res => res === row.f_userinfo_id) !== -1;
121
+ }
122
+ },
123
+ checkChange (row, e) {
124
+ if (e.target.checked) {
125
+ this.bookList.push(row.f_userinfo_id)
126
+ } else {
127
+ this.bookList.splice(this.bookList.findIndex(res => res === row.f_userinfo_id), 1)
128
+ }
129
+ },
130
+ delOfCheckBook(){
131
+ try {
132
+ let upAddress = `update t_user_address set f_check_book_id = null where 1 = 2 `
133
+ if (this.bookAll){
134
+ upAddress = `update t_user_address set f_check_book_id = null where f_check_book_id = '${this.row.id}'`
135
+ }else if (this.bookList.length > 0){
136
+ let codes = this.bookList.map( item => { return `'${item}'` } ).join()
137
+ upAddress = `update t_user_address set f_check_book_id = null where f_userinfo_id in (${codes})`
138
+ }
139
+ this.$showMessage('确认移出安检册', ['confirm', 'cancel']).then((res) => {
140
+ if (res === 'confirm') {
141
+ let http = new HttpResetClass()
142
+ http.load('POST', 'rs/logic/runSQL', {data: {sql: upAddress}},
143
+ {resolveMsg: null, rejectMsg: '移出安检册失败'}).then(resp=>{
144
+ this.$showMessage('移出成功')
145
+ this.$refs.paged.$refs.criteria.search()
146
+ }).catch(error=>{
147
+ this.$showMessage('移出失败',error)
148
+
149
+ })
150
+ }
151
+ })
152
+ }catch (e) {
153
+ this.$showMessage('移出失败',e)
154
+ }
98
155
  }
99
156
  }
100
157
  }
@@ -27,7 +27,7 @@
27
27
  v-for="row in checkplan.list.data" @click="selectPlanChange(row)">
28
28
  <table style="width:100%;table-layout:fixed">
29
29
  <tr class="safe-planfont">
30
- <td rowspan="6"><input type="checkbox" style="pointer-events:auto"
30
+ <td rowspan="7"><input type="checkbox" style="pointer-events:auto"
31
31
  v-show="row.plan_count==0 || row.f_issued=='未下发'"
32
32
  onClick="event.cancelBubble = true"
33
33
  :checked="checkplan.check.isChecked(row.f_check_item_id)"
@@ -59,6 +59,18 @@
59
59
  :title="row.f_create_time">{{ row.f_create_time }}
60
60
  </td>
61
61
  </tr>
62
+ <tr class="safe-bodyfont" v-if="row.f_end_time">
63
+ <td colspan="3">结束时间 :</td>
64
+ <td colspan="5" style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;"
65
+ :title="row.f_end_time">{{ row.f_end_time }}
66
+ </td>
67
+ </tr>
68
+ <tr class="safe-bodyfont" >
69
+ <td colspan="3">计划状态:</td>
70
+ <td colspan="5" style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;"
71
+ >{{ checkState(row.f_end_time,row.unchecked)}}
72
+ </td>
73
+ </tr>
62
74
  <tr class="safe-bodyfont" v-if="row.f_safecheck_type">
63
75
  <td colspan="3">安检类型 :</td>
64
76
  <td colspan="5" style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;"
@@ -66,7 +78,7 @@
66
78
  </td>
67
79
  </tr>
68
80
  <tr class="safe-bodyfont" v-if="row.f_safecheck_type">
69
- <td >
81
+ <td colspan="8">
70
82
  <input type="button" style="pointer-events:auto"
71
83
  @click="showPlanHistory(row)"
72
84
  onClick="event.cancelBubble = true"/>变更记录
@@ -139,18 +151,20 @@
139
151
  <label class="font_normal_body">开始时间</label>
140
152
  <datepicker
141
153
  :value.sync="planCondition.f_start_time"
154
+ style="width: 60%;margin-bottom: 8px"
142
155
  :format="'yyyy-MM-dd HH:mm:ss'"
143
156
  v-model="planCondition.f_start_time"
144
- :show-reset-button="reset" placeholder="请输入开始时间" style="margin-bottom: 8px">
157
+ :show-reset-button="reset" placeholder="请输入开始时间">
145
158
  </datepicker>
146
159
  </div>
147
160
  <div class="form-group col-sm-4">
148
161
  <label class="font_normal_body">结束时间:</label>
149
162
  <datepicker
150
163
  :value.sync="planCondition.f_end_time"
164
+ style="width: 60%;margin-bottom: 8px"
151
165
  :format="'yyyy-MM-dd HH:mm:ss'"
152
166
  v-model="planCondition.f_end_time"
153
- :show-reset-button="reset" placeholder="请输入结束时间" style="margin-bottom: 8px">
167
+ :show-reset-button="reset" placeholder="请输入结束时间">
154
168
  </datepicker>
155
169
  </div>
156
170
  <div class="form-group col-sm-4">
@@ -231,6 +245,21 @@
231
245
  >
232
246
  </v-select>
233
247
  </div>
248
+ <div class="form-group col-sm-4">
249
+ <label class="font_normal_body">计划类型:</label>
250
+ <v-select
251
+ class="select select_list"
252
+ :value.sync="planCondition.f_plan_type"
253
+ v-model="planCondition.f_plan_type"
254
+ @change="setProperty('checkplan','f_plan_type',planCondition.f_plan_type)"
255
+ :search="false"
256
+ :options='planType'
257
+ placeholder='请选择'
258
+ close-on-select
259
+ value-single
260
+ >
261
+ </v-select>
262
+ </div>
234
263
  </div>
235
264
  </div>
236
265
  <div slot="modal-footer" class="modal-footer" style="text-align: center">
@@ -397,7 +426,7 @@
397
426
  value-single>
398
427
  </v-select>
399
428
  </div>
400
- <div class="form-group col-sm-4" v-if="$login.f.rolestr.includes('计划结束时间')==true">
429
+ <div class="form-group col-sm-4" >
401
430
  <label class="font_normal_body">结束时间:</label>
402
431
  <datepicker
403
432
  :value.sync="upCheckPlan.f_end_time"
@@ -602,6 +631,29 @@ export default {
602
631
 
603
632
  },
604
633
  methods: {
634
+ //判断计划状态
635
+ checkState(time,unchecked) {
636
+ //判断当前时间与time的大小,time格式为 yyyy-MM-dd HH:mm:ss
637
+ let now = new Date()
638
+ let last = new Date(time)
639
+ if(time==undefined || time==''){
640
+ return '无'
641
+ }else{
642
+ if(last.getTime() >now.getTime() ){
643
+ return '安检中'
644
+ }else if(last.getTime() <now.getTime()){
645
+ //结束时间小于当前时间,
646
+ //判断未检数,未检大于0,则逾期
647
+ if(unchecked>0){
648
+ return '逾期'
649
+ }
650
+ if(unchecked<=0){
651
+ return '已完成'
652
+ }
653
+ }
654
+ }
655
+
656
+ },
605
657
  showPlanHistory(row){
606
658
  this.showPlanHistoryButton = true
607
659
  this.planHistory = JSON.parse(row.f_update_check_plan)
@@ -776,7 +828,8 @@ export default {
776
828
  "isAndNot": "f_checker {}",
777
829
  "safechecktype": "f_safecheck_type='{}'",
778
830
  "issude": "f_issued = '{}'",
779
- "f_create_operator": "f_create_operator like '%{}%'"
831
+ "f_create_operator": "f_create_operator like '%{}%'",
832
+ "f_plan_type": "f_plan_type = '{}'"
780
833
  },
781
834
  {
782
835
  orderitem: fieldValue,
@@ -807,10 +860,10 @@ export default {
807
860
  this.showUpPlan = true
808
861
  },
809
862
  async upPlan() {
810
- if (this.upCheckPlan.f_issued == '已下发') {
863
+ /*if (this.upCheckPlan.f_issued == '已下发') {
811
864
  this.$showMessage("该计划已下发,无法进行修改!")
812
865
  return
813
- }
866
+ }*/
814
867
  if (!this.upCheckPlan.f_plan_name) {
815
868
  Vue.showMessage("请输入安检计划名称!")
816
869
  return false
@@ -849,6 +902,7 @@ export default {
849
902
  f_end_time: this.upCheckPlan.f_end_time,
850
903
  f_operetiom_name:this.upCheckPlan.f_operetiom_name,
851
904
  f_update_message:this.upCheckPlan.f_update_message,
905
+ issued: '是' // 修改已下发计划
852
906
  }
853
907
  }, {resolveMsg: null, rejectMsg: null})
854
908
  if (res.data.code == 200) {
@@ -22,13 +22,13 @@
22
22
  <v-select
23
23
  class="select select_list"
24
24
  :width="'95%'"
25
- :value.sync="model.f_area"
26
- v-model="model.f_area"
25
+ :value.sync="model.f_check_book_id"
26
+ v-model="model.f_check_book_id"
27
27
  :options='$parent.$parent.areaList'
28
28
  :timeout="500"
29
29
  @select-search="$parent.$parent.select_search"
30
30
  placeholder='安检册筛选'
31
- condition="ua.f_residential_area = '{}'"
31
+ condition="ua.f_check_book_id ='{}'"
32
32
  close-on-select
33
33
  value-single
34
34
  >
@@ -81,35 +81,33 @@
81
81
  >
82
82
  </v-select>
83
83
  </div>
84
- <div class="form-group col-sm-4" >
85
- <label class="font_normal_body">片&ensp;&ensp;&ensp;&ensp;区:</label>
86
- <v-select
87
- class="select select_list"
88
- :value.sync="model.f_book_slice_area"
89
- v-model="model.f_book_slice_area"
90
- :options='$parent.$parent.sliceArea'
91
- @change="$parent.$parent.slice_areaChange(model.f_book_slice_area)"
92
- placeholder='请选择'
93
- condition="ua.f_slice_area ='{}'"
94
- close-on-select
95
- value-single
96
- >
84
+ <div class="col-sm-3 form-group">
85
+ <label class="font_normal_body">街道/乡镇</label>
86
+ <v-select :value.sync="model.f_street_id" :value-single="true"
87
+ :options='$parent.$parent.streetslist' placeholder='请选择'
88
+ condition=" area.f_street_id = '{}'"
89
+ v-model='model.f_street_id'
90
+ @change="$parent.$parent.streetChange"
91
+ close-on-select :search="true" >
97
92
  </v-select>
98
93
  </div>
99
- <div class="form-group col-sm-4" >
100
- <label class="font_normal_body">区/县:</label>
101
- <input type="text" class="input_search" v-model="model.f_pcd"
102
- style="width: 60%" placeholder="小区名称" condition="f_pcd like '%{}%'">
103
- </div>
104
- <div class="form-group col-sm-4" >
105
- <label class="font_normal_body">街道/乡镇:</label>
106
- <input type="text" class="input_search" v-model="model.f_street"
107
- style="width: 60%" placeholder="街道/乡镇" condition="f_street like '%{}%'">
94
+ <div class="col-sm-3 form-group">
95
+ <label class="font_normal_body">片区/行政村</label>
96
+ <v-select :value.sync="model.f_community_id" v-model='model.f_community_id'
97
+ :options='$parent.$parent.communitylist' placeholder='片区/管理站' filer-key="name"
98
+ condition="ua.f_community_id = '{}'"
99
+ @change="$parent.$parent.communityChange"
100
+ close-on-select v-ref:slice>
101
+ </v-select>
108
102
  </div>
109
- <div class="form-group col-sm-4" >
110
- <label class="font_normal_body">小区名称:</label>
111
- <input type="text" class="input_search" v-model="model.f_residential_area"
112
- style="width: 60%" placeholder="小区名称" condition="f_residential_area like '%{}%'">
103
+ <div class="col-sm-3 form-group">
104
+ <label class="font_normal_body">小区/自然村</label>
105
+ <v-select :value.sync="model.f_residential_area_id" :value-single="true"
106
+ :options='$parent.$parent.areaslist' placeholder='请选择'
107
+ condition="ua.f_residential_area_id = '{}'"
108
+ v-model='model.f_residential_area_id'
109
+ close-on-select>
110
+ </v-select>
113
111
  </div>
114
112
  <div class="form-group col-sm-4" >
115
113
  <label class="font_normal_body">派发情况:</label>
@@ -381,7 +379,11 @@
381
379
  checkAll:false,
382
380
  checkes:[],
383
381
  excelUserCondtion:false,
384
- uploadCodeCondition:''
382
+ uploadCodeCondition:'',
383
+ streetslist:[],
384
+ communitylist:[],
385
+ areaslist:[],
386
+ f_filialeids: this.$login.f.orgid,
385
387
  }
386
388
  },
387
389
  props:["selectplan","userlogin"],
@@ -394,8 +396,182 @@
394
396
  this.setConList()
395
397
  this.loadpage()
396
398
  this.getCommunity()
399
+ this.initpcds(` f_orgid = '${this.userlogin.orgid}'`)
400
+ this.initstreets(` f_orgid = '${this.userlogin.orgid}' `)
401
+ this.initareas(` f_orgid = '${this.userlogin.orgid}'`)
397
402
  },
398
403
  methods: {
404
+ // 初始化省市区,添加街道
405
+ async initpcds (pconditon) {
406
+ this.pcdslist = []
407
+ let HttpReset = new HttpResetClass()
408
+ let req = await HttpReset.load('POST', 'api/af-revenue/sql/address_singleTableOrderBy?pageNo=1&pageSize=9999999', {
409
+ data: {
410
+ items: '*',
411
+ tablename: 't_pcd',
412
+ orderitem: 'id',
413
+ condition: pconditon
414
+ }
415
+ }, {resolveMsg: null, rejectMsg: '获取地址失败!'})
416
+ let redata = []
417
+ req.data.forEach((row, n) => {
418
+ redata[n] = {
419
+ label: row.f_pcd,
420
+ value: row.id,
421
+ data: row,
422
+ id: row.id
423
+ }
424
+ })
425
+ this.pcdslist = redata
426
+ console.log("xxxxxxxxxxxxxx")
427
+ console.log(this.pcdslist)
428
+ console.log("redataxxxxxxxx")
429
+ },
430
+ // 初始化街道 添加小区
431
+ async initstreets (pconditon) {
432
+ this.streetslist = []
433
+ let HttpReset = new HttpResetClass()
434
+ let req = await HttpReset.load('POST', 'api/af-revenue/sql/address_singleTableOrderBy', {
435
+ data: {
436
+ items: '*',
437
+ tablename: 't_street',
438
+ orderitem: 'id',
439
+ condition: pconditon
440
+ }
441
+ }, {resolveMsg: null, rejectMsg: '获取地址失败!'})
442
+ let redata = []
443
+ req.data.forEach((row, n) => {
444
+ redata[n] = {
445
+ label: row.f_street,
446
+ value: row.id,
447
+ data: row,
448
+ id: row.id
449
+ }
450
+ })
451
+ this.streetslist = redata
452
+ console.log("xxxxxxxxxxxxxx")
453
+ console.log(this.streetslist)
454
+ console.log("redataxxxxxxxx")
455
+ },
456
+ // 初始化小区添加小区
457
+ async initareas (pconditon) {
458
+ // if(this.usertype){
459
+ // pconditon=pconditon+` and f_special='1' `
460
+ // }
461
+ this.areaslist = []
462
+ let HttpReset = new HttpResetClass()
463
+ let req = await HttpReset.load('POST', 'api/af-revenue/sql/address_singleTableOrderBy?pageNo=1&pageSize=9999999', {
464
+ data: {
465
+ items: '*',
466
+ tablename: 't_area',
467
+ orderitem: 'id',
468
+ condition: pconditon
469
+ }
470
+ }, {resolveMsg: null, rejectMsg: '获取地址失败!'})
471
+ let redata = []
472
+ req.data.forEach((row) => {
473
+ redata.push({
474
+ label: row.f_residential_area,
475
+ value: row.id,
476
+ data: row,
477
+ id: row.id
478
+ })
479
+ })
480
+ this.areaslist = redata
481
+ },
482
+ //小区变化
483
+ areaChange(val){
484
+ console.log("小区变化",val)
485
+ // 选择小区后级联出省市区和街道
486
+ let selectArea // 选中的小区数据
487
+ for (let row of this.areaslist) {
488
+ if (val == row.value) {
489
+ selectArea = row.data
490
+ break
491
+ }
492
+ }
493
+ if (selectArea) {
494
+ this.model.f_street_id = selectArea.f_street_id
495
+ this.model.f_pcd_id = selectArea.f_pcd_id
496
+ this.model.f_community_id = selectArea.f_community_id
497
+ console.log( this.model.f_community_id)
498
+
499
+ this.initstreets(` f_filialeid = '${this.f_filialeids}' and id ='${selectArea.f_street_id}' `)
500
+ this.initpcds(` f_filialeid = '${this.f_filialeids}' and id ='${selectArea.f_pcd_id}' `)
501
+ if(selectArea.f_community_id){
502
+ this.initcommunity(` f_filialeid = '${this.f_filialeids}' and id ='${selectArea.f_community_id}' `)
503
+ }
504
+ // this.model.f_slice_area = selectArea.f_slice_area
505
+ // 拼接地址
506
+ this.model.f_address = `${selectArea.f_street}${selectArea.f_community}${selectArea.f_residential_area}`
507
+ console.log( this.model.f_community_id)
508
+ }
509
+ this.$nextTick(() => {
510
+ this.$resetValidation()
511
+ })
512
+ },
513
+ // 片区变化 f_area_code
514
+ async areasChange (val) {
515
+ console.log('街道变化', val)
516
+ if (this.streetslist[0]) {
517
+ var street = ''
518
+ this.streetslist.forEach((item) => {
519
+ if (item.id === val) {
520
+ street = item.label
521
+ }
522
+ })
523
+ // this.model.f_address = street
524
+ }
525
+ if (val) {
526
+ // 那就把[小区]重新组织一下
527
+ await this.initareas(` f_area_code ='${val}' `)
528
+ if (this.$refs.paged.$refs.criteria.model.f_residential_area_id) {
529
+ if (this.findbyid(this.areaslist, this.$refs.paged.$refs.criteria.model.f_residential_area_id)) {
530
+ let street_id = this.findbyid(this.areaslist,this.$refs.paged.$refs.criteria.model.f_residential_area_id).f_street_id
531
+ if (street_id != val) {
532
+ this.$refs.paged.$refs.criteria.model.f_residential_area_id = ''
533
+ }
534
+ } else {
535
+ this.$refs.paged.$refs.criteria.model.f_residential_area_id = ''
536
+ }
537
+ }
538
+ }
539
+ },
540
+ //街道变化
541
+ //初始化街道 添加小区
542
+ async initcommunity(pconditon){
543
+ this.communitylist = []
544
+ let HttpReset = new HttpResetClass()
545
+ let req = await HttpReset.load('POST', 'api/af-revenue/sql/address_singleTableOrderBy', {
546
+ data: {
547
+ items: '*',
548
+ tablename: 't_community',
549
+ orderitem: 'id',
550
+ condition: pconditon
551
+ }
552
+ }, {resolveMsg: null, rejectMsg: '获取地址失败!'})
553
+ let redata = []
554
+ req.data.forEach((row, n) => {
555
+ redata[n] = {
556
+ label: row.f_community_name,
557
+ value: row.id,
558
+ data:row,
559
+ id:row.id
560
+ }
561
+ })
562
+ this.communitylist=redata
563
+ },
564
+ async streetChange(val){
565
+ if(val){
566
+ await this.initcommunity(` f_filialeid = '${this.f_filialeids}' and f_street_id ='${val}' `)
567
+ }
568
+ },
569
+ async communityChange(val){
570
+ console.log(val)
571
+ if(val){
572
+ await this.initareas(` f_filialeid = '${this.f_filialeids}' and f_community_id ='${val}' `)
573
+ }
574
+ },
399
575
  getCommunity(){
400
576
  this.community=[]
401
577
  new HttpResetClass().load('POST', `/rs/sql/safe_singleTable_OrderBy`, {
@@ -518,19 +694,23 @@
518
694
  value: ''
519
695
  }, ...this.$appdata.getParam('气表类型')] : [{label: '全部', value: ''}]
520
696
  },
521
- select_search(text){
522
- //tag
523
- let pcdText=text?` and f_residential_area like '%${text}%'`:''
524
- new HttpResetClass().load("POST", `${this.$androidUtil.getProxyUrl()}/rs/sql/safe_singleTable_OrderBy`, {data:{items:"*",tablename:"t_area",orderitem:"id",condition:`f_orgid = '${this.userlogin.orgid}' ${pcdText} `}}, {resolveMsg: null, rejectMsg: null}).then((res)=>{
525
- //tag)
526
- if(res.data.length>0){
527
- this.areaList=[]
528
- this.areaList.push({label:"全部",value:""})
529
- res.data.forEach((result)=>{
530
- this.areaList.push({label:result.f_residential_area,value:result.f_residential_area})
531
- })
697
+ select_search(){
698
+ this.areaList = []
699
+ new HttpResetClass().load('POST', `/rs/sql/safe_singleTable_OrderBy`, {
700
+ data: {
701
+ items: 'id,f_check_book_name',
702
+ tablename: 't_check_book',
703
+ condition: `f_orgid = '${this.userlogin.orgid}'`,
704
+ orderitem: 'id desc'
532
705
  }
533
- //tag)
706
+ }, {resolveMsg: null, rejectMsg: null}).then(res => {
707
+ this.areaList.push({label: '全部', value: ''})
708
+ res.data.forEach(ress => {
709
+ this.areaList.push({
710
+ label: ress.f_check_book_name,
711
+ value: ress.id
712
+ })
713
+ })
534
714
  })
535
715
  },
536
716
  //获取抄表册