address-client 3.2.28 → 3.2.29

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.
@@ -1,436 +1,436 @@
1
- <template>
2
- <div class="flex" @keyup.enter="search">
3
- <criteria-paged :model="model" v-ref:paged>
4
- <criteria partial='criteria' @condition-changed='$parent.selfSearch' v-ref:cri>
5
- <div novalidate class="form-horizontal select-overspread container-fluid auto" partial>
6
- <div class="row">
7
- <div :class="$parent.$parent.style">
8
- <label class="font_normal_body">组织机构</label>
9
- <res-select restype='organization'
10
- @res-select="$parent.$parent.getorg"
11
- is-mul="false"
12
- :initresid='$parent.$parent.curorgid'>
13
- </res-select>
14
- </div>
15
- <div :class="$parent.$parent.style" v-if="!$parent.$parent.$parent.areaShow">
16
- <label class="font_normal_body">小区编号</label>
17
- <input type="text" class="input_search" style="width:60%" v-model="model.f_area_id"
18
- condition="f_area_id = '{}'" placeholder="小区编号"/>
19
- </div>
20
- <div :class="$parent.$parent.style" v-if="false">
21
- <label class="font_normal_body">省&emsp;&emsp;份</label>
22
- <input type="text" class="input_search" style="width:60%" v-model="model.f_province"
23
- condition="f_province like '%{}%'" placeholder="省份"/>
24
- </div>
25
- <!--<div :class="$parent.$parent.style" v-if="!$parent.$parent.$parent.areaShow">-->
26
- <div :class="$parent.$parent.style" v-if="false">
27
- <label class="font_normal_body">城&emsp;&emsp;市</label>
28
- <input type="text" class="input_search" style="width:60%" v-model="model.f_city"
29
- condition="f_city like '%{}%'" placeholder="城市"/>
30
- </div>
31
- <div :class="$parent.$parent.style" v-if="!$parent.$parent.$parent.areaShow">
32
- <label class="font_normal_body">区&emsp;&emsp;县</label>
33
- <input type="text" class="input_search" style="width:60%" v-model="model.f_district"
34
- condition="f_district like '%{}%'" placeholder="区县"/>
35
- </div>
36
- <div :class="$parent.$parent.style" v-if="!$parent.$parent.$parent.areaShow">
37
- <label class="font_normal_body">大片区号</label>
38
- <input type="text" class="input_search" style="width:60%" v-model="model.f_street"
39
- condition="f_street like '%{}%'" placeholder="大片区号"/>
40
- </div>
41
- <div class="col-sm-4 form-group button-range">
42
- <button class="button_search button_spacing" @click="search()" >查询</button>
43
- <button class="button_search button_spacing" @click="$parent.$parent.batchDelete()">批量删除</button>
44
- <button class="button_new button_spacing" style="width: max-content;" @click="$parent.$parent.add('楼栋')">楼栋管理</button>
45
- <button v-if="!$parent.$parent.f_special" class="button_new button_spacing" style="width: max-content;" @click="$parent.$parent.add('小区')">添加小区</button>
46
- <button v-if="$parent.$parent.f_special"class="button_new button_spacing" style="width: max-content;" @click="$parent.$parent.add('单位')">添加单位</button>
47
- <button class="button_clear button_spacing" @click="$parent.$parent.clear()">清空</button>
48
- <export-excel :data="$parent.$parent.getCondition"
49
- :field="$parent.$parent.getfield"
50
- sqlurl="rs/logic/exportfile"
51
- sql-name="manage_getarealist"
52
- template-name='小区信息查询导出'
53
- :choose-col="true"></export-excel>
54
- <div style="float: right" class="button_spacing" :class="{'button_shrink_top':$parent.$parent.criteriaShow,'button_shrink_bottom':!$parent.$parent.criteriaShow}" @click="$parent.$parent.hidden()"></div>
55
- </div>
56
- </div>
57
- <div class="row" v-if="$parent.$parent.criteriaShow">
58
- <div :class="$parent.$parent.style" v-if="$parent.$parent.$parent.areaShow">
59
- <label class="font_normal_body">小区编号</label>
60
- <input type="text" class="input_search" style="width:60%" v-model="model.f_area_id"
61
- condition="f_area_id = '{}'" placeholder="小区编号"/>
62
- </div>
63
- <div :class="$parent.$parent.style" v-if="$parent.$parent.$parent.areaShow">
64
- <label class="font_normal_body">城&emsp;&emsp;市</label>
65
- <input type="text" class="input_search" style="width:60%" v-model="model.f_city"
66
- condition="f_city like '%{}%'" placeholder="城市"
67
- :size="model.f_city ? model.f_city.length*2 : 6"/>
68
- </div>
69
- <div :class="$parent.$parent.style" v-if="$parent.$parent.$parent.areaShow">
70
- <label class="font_normal_body">区&emsp;&emsp;县</label>
71
- <input type="text" class="input_search" style="width:60%" v-model="model.f_district"
72
- condition="f_district like '%{}%'" placeholder="区县"
73
- :size="model.f_district ? model.f_district.length*2 : 6"/>
74
- </div>
75
- <div :class="$parent.$parent.style" v-if="$parent.$parent.$parent.areaShow">
76
- <label class="font_normal_body">大片区号</label>
77
- <input type="text" class="input_search" style="width:60%" v-model="model.f_street"
78
- condition="f_street like '%{}%'" placeholder="街道/乡镇"
79
- :size="model.f_street ? model.f_street.length*2 : 6"/>
80
- </div>
81
- <div :class="$parent.$parent.style">
82
- <label class="font_normal_body">小区名称</label>
83
- <input type="text" class="input_search" style="width:60%" v-model="model.f_residential_area"
84
- condition="f_residential_area like '%{}%'" placeholder="小区"
85
- :size="model.f_residential_area ? model.f_residential_area.length*2 : 6"/>
86
- </div>
87
- <div :class="$parent.$parent.style">
88
- <label class="font_normal_body">房屋类型</label>
89
- <v-select :options='$parent.$parent.housetype' :value.sync="model.f_house_type"
90
- close-on-select condition="f_house_type='{}'"
91
- placeholder='房屋类型' v-model="model.f_house_type"></v-select>
92
- </div>
93
- <div :class="$parent.$parent.style">
94
- <label class="font_normal_body">安装位置</label>
95
- <v-select :options='$parent.$parent.position' :value.sync="model.f_position"
96
- close-on-select condition="f_position='{}'"
97
- placeholder='安装位置' v-model="model.f_position"></v-select>
98
- </div>
99
- <div :class="$parent.$parent.style">
100
- <label class="font_normal_body">&emsp;抄表员</label>
101
- <v-select :options='$parent.$parent.inputtores' :value.sync="model.f_inputtor"
102
- close-on-select condition="f_inputtor='{}'"
103
- placeholder='抄表员' v-model="model.f_inputtor"></v-select>
104
- </div>
105
- </div>
106
- </div>
107
- </criteria>
108
-
109
- <data-grid :model="model" partial='list' class="list_area table_sy" :optional="true" v-ref:grid>
110
- <template partial='head'>
111
- <th><nobr>序号</nobr></th>
112
- <th v-if="false"><nobr>省份</nobr></th>
113
- <th v-if="false"><nobr>城市</nobr></th>
114
- <th v-show="!$parent.$parent.$parent.$parent.areaShow"><nobr>区/县</nobr></th>
115
- <th><nobr>大片区号</nobr></th>
116
- <!--民用小区信息开始-->
117
- <th v-if="!$parent.$parent.$parent.f_special"><nobr>小区名称</nobr></th>
118
- <th v-if="!$parent.$parent.$parent.f_special"><nobr>详细地址</nobr></th>
119
- <th v-if="!$parent.$parent.$parent.f_special && !$parent.$parent.$parent.$parent.areaShow"><nobr>小区备注</nobr></th>
120
- <!--民用小区信息结束-->
121
- <!--非民用单位信息开始-->
122
- <th v-if="$parent.$parent.$parent.f_special"><nobr>单位名称</nobr></th>
123
- <th v-if="$parent.$parent.$parent.f_special"><nobr>单位地址</nobr></th>
124
- <th v-if="$parent.$parent.$parent.f_special"><nobr>联系人</nobr></th>
125
- <th v-if="$parent.$parent.$parent.f_special"><nobr>联系电话</nobr></th>
126
- <!--非民用单位信息结束-->
127
- <th v-show="!$parent.$parent.$parent.$parent.areaShow"><nobr>抄表员</nobr></th>
128
- <th v-show="!$parent.$parent.$parent.$parent.areaShow"><nobr>房屋类型</nobr></th>
129
- <th v-show="!$parent.$parent.$parent.$parent.areaShow"><nobr>安装位置</nobr></th>
130
- <th v-show="!$parent.$parent.$parent.$parent.areaShow"><nobr>片区/管理站 </nobr></th>
131
- <th><nobr>操作人</nobr></th>
132
- <th><nobr>操作日期</nobr></th>
133
- <th title="该小区下现有的地址数"><nobr>地址数</nobr></th>
134
- <th><nobr>操作</nobr></th>
135
- </template>
136
- <template partial='body'>
137
- <td style="text-align:center"><nobr>{{$index + 1}}</nobr></td>
138
- <td style="text-align:center" v-if="false"><nobr>{{row.f_province}}</nobr></td>
139
- <td style="text-align:center" v-if="false"><nobr>{{row.f_city}}</nobr></td>
140
- <td v-show="!$parent.$parent.$parent.$parent.areaShow" style="text-align:center"><nobr>{{row.f_district}}</nobr></td>
141
- <td style="text-align:center"><nobr>{{row.f_street}}</nobr></td>
142
- <td style="text-align:center"><nobr>{{row.f_residential_area}}</nobr></td>
143
- <td style="text-align:center"><nobr>{{row.f_area_address}}{{row.f_residential_area}}</nobr></td>
144
- <td v-show="!$parent.$parent.$parent.$parent.areaShow" style="text-align:center"><nobr>{{row.f_comments}}</nobr></td>
145
- <!--非民用单位信息开始-->
146
- <td v-if="$parent.$parent.$parent.f_special" style="text-align:center"><nobr>{{row.f_linkname}}</nobr></td>
147
- <td v-if="$parent.$parent.$parent.f_special" style="text-align:center"><nobr>{{row.f_linkphone}}</nobr></td>
148
- <!--非民用单位信息结束-->
149
- <td v-show="!$parent.$parent.$parent.$parent.areaShow" style="text-align:center"><nobr>{{row.f_inputtor}}</nobr></td>
150
- <td v-show="!$parent.$parent.$parent.$parent.areaShow" style="text-align:center"><nobr>{{row.f_house_type}}</nobr></td>
151
- <td v-show="!$parent.$parent.$parent.$parent.areaShow" style="text-align:center"><nobr>{{row.f_position}}</nobr></td>
152
- <td v-show="!$parent.$parent.$parent.$parent.areaShow" style="text-align:center"><nobr>{{row.f_slice_area}}</nobr></td>
153
- <td style="text-align:center"><nobr>{{row.f_operator}}</nobr></td>
154
- <td style="text-align:center"><nobr>{{row.f_operate_date}}</nobr></td>
155
- <td style="text-align:center"><nobr>{{row.addressnum}}</nobr></td>
156
- <td><nobr>
157
- <!--<button type="button" name="button" class="btn btn-link"
158
- @click.stop="$parent.$parent.$parent.modify(row)">修改</button>-->
159
- <button v-if="!row.f_residential_area_id" type="button" name="button" class="btn btn-danger"
160
- style="padding: 5px 12px"
161
- @click.stop="$parent.$parent.$parent.delete(row)">删除</button>
162
- </nobr>
163
- </td>
164
- </template>
165
- <template partial='foot'></template>
166
- </data-grid>
167
- </criteria-paged>
168
- <modal :show="showDelete" large backdrop="false" :width="900">
169
- <header slot="modal-header" class="modal-header">
170
- <p class="bg-info text-center" style="padding: 8px;">请选择目标小区</p>
171
- </header>
172
- <article slot="modal-body" class="modal-body">
173
- <validator name='v'>
174
- <div class="col-sm-6 form-group ">
175
- <label class="font_normal_body">小区名称</label>
176
- <input type="text" style="width:41%" v-show="false" v-validate:f_residential_area_id='{required: true }' v-model="areamodel.f_residential_area_id">
177
- <v-select :value.sync="areamodel.f_residential_area_id" :value-single="true"
178
- @change="areaChange"
179
- :options='areaslist' placeholder='请选择'
180
- close-on-select search="true">
181
- </v-select>
182
- </div>
183
- </validator>
184
- </article>
185
- <footer slot="modal-footer" class="modal-footer">
186
- <button v-show="showDelete" type="button" class="button_search button_spacing" @click='confirmDelete()' :disabled='!$v.valid'>确认</button>
187
- <button v-show="showDelete" type="button" class="button_clear button_spacing" @click='cancelDelete()'>取消</button>
188
- </footer>
189
- </modal>
190
- </div>
191
- </template>
192
-
193
- <script>
194
- import { PagedList } from 'vue-client'
195
- let readyGen = async function (self) {
196
- self.getfield = self.config.excelHeaders
197
- self.search()
198
- }
199
- export default {
200
-
201
- data () {
202
- return {
203
- showDelete: false,
204
- criteriaShow: false,
205
- // 目标小区数据
206
- areamodel: {
207
- f_residential_area_id: '',
208
- f_pcd: '',
209
- f_pcd_id: '',
210
- f_street: '',
211
- f_street_id: '',
212
- f_slice_area: '',
213
- f_residential_area: ''
214
- },
215
- model: new PagedList('rs/sql/address_getarealist',20),
216
- addflag: false,
217
- addtitle:'',
218
- getfield: {},
219
- // 公司下拉
220
- curorgid: [this.$login.f.orgid],
221
- f_orgid: '',
222
- //初始化小区数据
223
- areaslist:[],
224
- config: {
225
- // 导出列要和查询列相同
226
- excelHeaders: {
227
- 'f_district':'区/县',
228
- 'f_street':'街道名称',
229
- 'f_residential_area':'小区名称',
230
- 'f_area_address':'小区地址',
231
- 'f_comments':'小区备注',
232
- 'f_inputtor':'抄表员',
233
- 'f_house_type':'房屋类型',
234
- 'f_position':'安装位置',
235
- 'f_slice_area':'片区/管理站',
236
- 'f_operator':'操作人',
237
- 'f_operate_date':'操作日期',
238
- 'addressnum':'地址数'
239
- }
240
- },
241
- housetype:[{label:'全部',value:''},{label: '楼房', value: '楼房'}, {label: '自建房', value: '自建房'}],
242
- position:this.$appdata.getParam('安装位置')?[{label:'全部',value:''},...this.$appdata.getParam('安装位置')]:[{label:'全部',value:''}]
243
- }
244
- },
245
- title: '小区管理',
246
- props:{
247
- f_filialeids:{
248
- type: String
249
- },
250
- style: {
251
- type: String,
252
- default: 'col-sm-2 form-group'
253
- },
254
- f_special:{
255
- type: String
256
- }
257
- },
258
- ready(){
259
- readyGen(this)
260
-
261
- },
262
- methods: {
263
- hidden() {
264
- this.criteriaShow = !this.criteriaShow
265
- },
266
- search() {
267
- this.$refs.paged.$refs.cri.search()
268
- },
269
-
270
- async delete(row){
271
- if(row.id >= 0){
272
- var id = row.id
273
- let useraredss = await this.$resetpost('rs/sql/address_singleTable',
274
- {data: {
275
- items: 'f_residential_area_id',
276
- tablename: 't_user_address',
277
- condition: `f_residential_area_id='${id}'`}
278
- },
279
- {resolveMsg: null, rejectMsg: null})
280
- if(useraredss.data.length>0){
281
- this.$showAlert('该小区下已有地址信息,无法删除!','warning',1000)
282
- }else{
283
- this.$resetdelete('rs/entity/t_area', {id: id}, {resolveMsg: '删除成功', rejectMsg: '删除失败'}).then((res) => {
284
- this.$dispatch('cancel')
285
- })
286
- }
287
- }
288
- },
289
- add(val){
290
- if (this.f_filialeids) {
291
- this.$refs.paged.$refs.grid.selectStore.selected = null
292
- this.$dispatch('add', val)
293
- } else {
294
- this.$showAlert('请先选择左上角的所在分公司', 'warning', 2000)
295
- }
296
- },
297
- modify(val){
298
- this.$refs.paged.$refs.grid.selectStore.selected = null
299
- this.$dispatch('modify',val)
300
- },
301
- selfSearch (args) {
302
-
303
- if (!this.f_orgid) {
304
- this.getorg([this.$login.f.orgid])
305
- }
306
- if(this.f_special){
307
- args.condition = `${args.condition} and s.f_special='1' and s.f_filialeid = '${this.f_filialeids}'`
308
- }else{
309
- args.condition = `${args.condition} and s.f_filialeid = ${this.f_orgid}`
310
- }
311
- this.model.search(args.condition, args.model)
312
- },
313
- //清空
314
- clear(){
315
- this.$refs.paged.$refs.cri.model = {}
316
- },
317
- getorg (val) {
318
- this.f_orgid = this.$login.convertToIn(val)
319
- this.f_filialeids = val[0]
320
- },
321
- async batchDelete () {
322
- if (this.f_filialeids) {
323
- if (this.$refs.paged.$refs.grid.getRowData().length != 0) {
324
- this.showDelete = true
325
- let condition = `a.f_orgid = '${this.f_filialeids}'`
326
- let req = await this.$resetpost('rs/sql/address_getresidential', {
327
- data: {
328
- condition: condition
329
- }
330
- }, {resolveMsg: null, rejectMsg: '获取地址失败!'})
331
- let redata = []
332
- req.data.forEach((row) => {
333
- redata.push({
334
- label: row.f_residential_area,
335
- value: row.id,
336
- data: row,
337
- id: row.id
338
- })
339
- })
340
- this.areaslist = redata
341
- } else {
342
- this.$showAlert('请至少选择一项!', 'warning', 2000)
343
- }
344
- }else {
345
- this.$showAlert('请先选择左上角的所在分公司', 'warning', 2000)
346
- }
347
- },
348
- confirmDelete () {
349
- let msg = {
350
- resolveMsg: '批量删除成功',
351
- rejectMsg: '批量删除失败!'
352
- }
353
- let oldAreaIds = []
354
- // 获取要批量删除的小区数据
355
- this.$refs.paged.$refs.grid.getRowData().forEach((row,n) => {
356
- oldAreaIds[n] = row.id
357
- })
358
- this.$resetpost('rs/logic/batchDelete',{
359
- data:{
360
- areamodel:this.areamodel,
361
- oldAreaIds:oldAreaIds,
362
- f_operator: this.$login.f.name,
363
- f_operatorid: this.$login.f.id,
364
- f_orgid: this.$login.f.orgid,
365
- f_orgname: this.$login.f.orgs,
366
- f_depid: this.$login.f.depids,
367
- f_depname: this.$login.f.deps
368
- }
369
- },msg)
370
- this.$refs.paged.$refs.grid.selectInit()
371
- this.$refs.paged.$refs.cri.search()
372
- this.areamodel.f_residential_area_id = ''
373
- this.showDelete = false
374
- },
375
- cancelDelete () {
376
- this.$refs.paged.$refs.grid.selectInit()
377
- this.$refs.paged.$refs.cri.search()
378
- this.areamodel.f_residential_area_id = ''
379
- this.showDelete = false
380
- },
381
- areaChange(val){
382
- console.log("小区变化",val)
383
- let selectArea // 选中的小区数据
384
- for (let row of this.areaslist) {
385
- if (val == row.value) {
386
- selectArea = row.data
387
- break
388
- }
389
- }
390
- if (selectArea) {
391
- this.areamodel.f_residential_area_id = selectArea.id
392
- this.areamodel.f_pcd = selectArea.f_pcd
393
- this.areamodel.f_pcd_id = selectArea.f_pcd_id
394
- this.areamodel.f_street = selectArea.f_street
395
- this.areamodel.f_street_id = selectArea.f_street_id
396
- this.areamodel.f_slice_area = selectArea.f_slice_area
397
- this.areamodel.f_residential_area = selectArea.f_residential_area
398
- }
399
- this.$nextTick(() => {
400
- this.$resetValidation()
401
- })
402
- },
403
- },
404
- watch:{
405
-
406
- },
407
- computed:{
408
- getCondition() {
409
- var condition=''
410
- if(this.f_special){
411
- condition = `${this.$refs.paged.$refs.cri.condition} and s.f_special='1' and s.f_filialeid = '${this.f_filialeids}'`
412
- }else{
413
- condition = `${this.$refs.paged.$refs.cri.condition} and s.f_filialeid = ${this.f_orgid}`
414
- }
415
- return {
416
- condition: condition
417
- }
418
- },
419
- inputtores () {
420
- // 获取抄表员
421
- let rs = new Array()
422
- if (this.$login.f.f_gasman.length > 0) {
423
- for (let i = 0; i < this.$login.f.f_gasman.length; i++) {
424
- let temp = {
425
- label: this.$login.f.f_gasman[i].name,
426
- value: this.$login.f.f_gasman[i].name
427
- }
428
- rs.push(temp)
429
- }
430
- }
431
- return rs
432
- }
433
- }
434
-
435
- }
436
- </script>
1
+ <template>
2
+ <div class="flex" @keyup.enter="search">
3
+ <criteria-paged :model="model" v-ref:paged>
4
+ <criteria partial='criteria' @condition-changed='$parent.selfSearch' v-ref:cri>
5
+ <div novalidate class="form-horizontal select-overspread container-fluid auto" partial>
6
+ <div class="row">
7
+ <div :class="$parent.$parent.style">
8
+ <label class="font_normal_body">组织机构</label>
9
+ <res-select restype='organization'
10
+ @res-select="$parent.$parent.getorg"
11
+ is-mul="false"
12
+ :initresid='$parent.$parent.curorgid'>
13
+ </res-select>
14
+ </div>
15
+ <div :class="$parent.$parent.style" v-if="!$parent.$parent.$parent.areaShow">
16
+ <label class="font_normal_body">小区编号</label>
17
+ <input type="text" class="input_search" style="width:60%" v-model="model.f_area_id"
18
+ condition="f_area_id = '{}'" placeholder="小区编号"/>
19
+ </div>
20
+ <div :class="$parent.$parent.style" v-if="false">
21
+ <label class="font_normal_body">省&emsp;&emsp;份</label>
22
+ <input type="text" class="input_search" style="width:60%" v-model="model.f_province"
23
+ condition="f_province like '%{}%'" placeholder="省份"/>
24
+ </div>
25
+ <!--<div :class="$parent.$parent.style" v-if="!$parent.$parent.$parent.areaShow">-->
26
+ <div :class="$parent.$parent.style" v-if="false">
27
+ <label class="font_normal_body">城&emsp;&emsp;市</label>
28
+ <input type="text" class="input_search" style="width:60%" v-model="model.f_city"
29
+ condition="f_city like '%{}%'" placeholder="城市"/>
30
+ </div>
31
+ <div :class="$parent.$parent.style" v-if="!$parent.$parent.$parent.areaShow">
32
+ <label class="font_normal_body">区&emsp;&emsp;县</label>
33
+ <input type="text" class="input_search" style="width:60%" v-model="model.f_district"
34
+ condition="f_district like '%{}%'" placeholder="区县"/>
35
+ </div>
36
+ <div :class="$parent.$parent.style" v-if="!$parent.$parent.$parent.areaShow">
37
+ <label class="font_normal_body">大片区号</label>
38
+ <input type="text" class="input_search" style="width:60%" v-model="model.f_street"
39
+ condition="f_street like '%{}%'" placeholder="大片区号"/>
40
+ </div>
41
+ <div class="col-sm-4 form-group button-range">
42
+ <button class="button_search button_spacing" @click="search()" >查询</button>
43
+ <button class="button_search button_spacing" @click="$parent.$parent.batchDelete()">批量删除</button>
44
+ <button class="button_new button_spacing" style="width: max-content;" @click="$parent.$parent.add('楼栋')">楼栋管理</button>
45
+ <button v-if="!$parent.$parent.f_special" class="button_new button_spacing" style="width: max-content;" @click="$parent.$parent.add('小区')">添加小区</button>
46
+ <button v-if="$parent.$parent.f_special"class="button_new button_spacing" style="width: max-content;" @click="$parent.$parent.add('单位')">添加单位</button>
47
+ <button class="button_clear button_spacing" @click="$parent.$parent.clear()">清空</button>
48
+ <export-excel :data="$parent.$parent.getCondition"
49
+ :field="$parent.$parent.getfield"
50
+ sqlurl="rs/logic/exportfile"
51
+ sql-name="manage_getarealist"
52
+ template-name='小区信息查询导出'
53
+ :choose-col="true"></export-excel>
54
+ <div style="float: right" class="button_spacing" :class="{'button_shrink_top':$parent.$parent.criteriaShow,'button_shrink_bottom':!$parent.$parent.criteriaShow}" @click="$parent.$parent.hidden()"></div>
55
+ </div>
56
+ </div>
57
+ <div class="row" v-if="$parent.$parent.criteriaShow">
58
+ <div :class="$parent.$parent.style" v-if="$parent.$parent.$parent.areaShow">
59
+ <label class="font_normal_body">小区编号</label>
60
+ <input type="text" class="input_search" style="width:60%" v-model="model.f_area_id"
61
+ condition="f_area_id = '{}'" placeholder="小区编号"/>
62
+ </div>
63
+ <div :class="$parent.$parent.style" v-if="$parent.$parent.$parent.areaShow">
64
+ <label class="font_normal_body">城&emsp;&emsp;市</label>
65
+ <input type="text" class="input_search" style="width:60%" v-model="model.f_city"
66
+ condition="f_city like '%{}%'" placeholder="城市"
67
+ :size="model.f_city ? model.f_city.length*2 : 6"/>
68
+ </div>
69
+ <div :class="$parent.$parent.style" v-if="$parent.$parent.$parent.areaShow">
70
+ <label class="font_normal_body">区&emsp;&emsp;县</label>
71
+ <input type="text" class="input_search" style="width:60%" v-model="model.f_district"
72
+ condition="f_district like '%{}%'" placeholder="区县"
73
+ :size="model.f_district ? model.f_district.length*2 : 6"/>
74
+ </div>
75
+ <div :class="$parent.$parent.style" v-if="$parent.$parent.$parent.areaShow">
76
+ <label class="font_normal_body">大片区号</label>
77
+ <input type="text" class="input_search" style="width:60%" v-model="model.f_street"
78
+ condition="f_street like '%{}%'" placeholder="街道/乡镇"
79
+ :size="model.f_street ? model.f_street.length*2 : 6"/>
80
+ </div>
81
+ <div :class="$parent.$parent.style">
82
+ <label class="font_normal_body">小区名称</label>
83
+ <input type="text" class="input_search" style="width:60%" v-model="model.f_residential_area"
84
+ condition="f_residential_area like '%{}%'" placeholder="小区"
85
+ :size="model.f_residential_area ? model.f_residential_area.length*2 : 6"/>
86
+ </div>
87
+ <div :class="$parent.$parent.style">
88
+ <label class="font_normal_body">房屋类型</label>
89
+ <v-select :options='$parent.$parent.housetype' :value.sync="model.f_house_type"
90
+ close-on-select condition="f_house_type='{}'"
91
+ placeholder='房屋类型' v-model="model.f_house_type"></v-select>
92
+ </div>
93
+ <div :class="$parent.$parent.style">
94
+ <label class="font_normal_body">安装位置</label>
95
+ <v-select :options='$parent.$parent.position' :value.sync="model.f_position"
96
+ close-on-select condition="f_position='{}'"
97
+ placeholder='安装位置' v-model="model.f_position"></v-select>
98
+ </div>
99
+ <div :class="$parent.$parent.style">
100
+ <label class="font_normal_body">&emsp;抄表员</label>
101
+ <v-select :options='$parent.$parent.inputtores' :value.sync="model.f_inputtor"
102
+ close-on-select condition="f_inputtor='{}'"
103
+ placeholder='抄表员' v-model="model.f_inputtor"></v-select>
104
+ </div>
105
+ </div>
106
+ </div>
107
+ </criteria>
108
+
109
+ <data-grid :model="model" partial='list' class="list_area table_sy" :optional="true" v-ref:grid>
110
+ <template partial='head'>
111
+ <th><nobr>序号</nobr></th>
112
+ <th v-if="false"><nobr>省份</nobr></th>
113
+ <th v-if="false"><nobr>城市</nobr></th>
114
+ <th v-show="!$parent.$parent.$parent.$parent.areaShow"><nobr>区/县</nobr></th>
115
+ <th><nobr>大片区号</nobr></th>
116
+ <!--民用小区信息开始-->
117
+ <th v-if="!$parent.$parent.$parent.f_special"><nobr>小区名称</nobr></th>
118
+ <th v-if="!$parent.$parent.$parent.f_special"><nobr>详细地址</nobr></th>
119
+ <th v-if="!$parent.$parent.$parent.f_special && !$parent.$parent.$parent.$parent.areaShow"><nobr>小区备注</nobr></th>
120
+ <!--民用小区信息结束-->
121
+ <!--非民用单位信息开始-->
122
+ <th v-if="$parent.$parent.$parent.f_special"><nobr>单位名称</nobr></th>
123
+ <th v-if="$parent.$parent.$parent.f_special"><nobr>单位地址</nobr></th>
124
+ <th v-if="$parent.$parent.$parent.f_special"><nobr>联系人</nobr></th>
125
+ <th v-if="$parent.$parent.$parent.f_special"><nobr>联系电话</nobr></th>
126
+ <!--非民用单位信息结束-->
127
+ <th v-show="!$parent.$parent.$parent.$parent.areaShow"><nobr>抄表员</nobr></th>
128
+ <th v-show="!$parent.$parent.$parent.$parent.areaShow"><nobr>房屋类型</nobr></th>
129
+ <th v-show="!$parent.$parent.$parent.$parent.areaShow"><nobr>安装位置</nobr></th>
130
+ <th v-show="!$parent.$parent.$parent.$parent.areaShow"><nobr>片区/管理站 </nobr></th>
131
+ <th><nobr>操作人</nobr></th>
132
+ <th><nobr>操作日期</nobr></th>
133
+ <th title="该小区下现有的地址数"><nobr>地址数</nobr></th>
134
+ <th><nobr>操作</nobr></th>
135
+ </template>
136
+ <template partial='body'>
137
+ <td style="text-align:center"><nobr>{{$index + 1}}</nobr></td>
138
+ <td style="text-align:center" v-if="false"><nobr>{{row.f_province}}</nobr></td>
139
+ <td style="text-align:center" v-if="false"><nobr>{{row.f_city}}</nobr></td>
140
+ <td v-show="!$parent.$parent.$parent.$parent.areaShow" style="text-align:center"><nobr>{{row.f_district}}</nobr></td>
141
+ <td style="text-align:center"><nobr>{{row.f_street}}</nobr></td>
142
+ <td style="text-align:center"><nobr>{{row.f_residential_area}}</nobr></td>
143
+ <td style="text-align:center"><nobr>{{row.f_area_address}}{{row.f_residential_area}}</nobr></td>
144
+ <td v-show="!$parent.$parent.$parent.$parent.areaShow" style="text-align:center"><nobr>{{row.f_comments}}</nobr></td>
145
+ <!--非民用单位信息开始-->
146
+ <td v-if="$parent.$parent.$parent.f_special" style="text-align:center"><nobr>{{row.f_linkname}}</nobr></td>
147
+ <td v-if="$parent.$parent.$parent.f_special" style="text-align:center"><nobr>{{row.f_linkphone}}</nobr></td>
148
+ <!--非民用单位信息结束-->
149
+ <td v-show="!$parent.$parent.$parent.$parent.areaShow" style="text-align:center"><nobr>{{row.f_inputtor}}</nobr></td>
150
+ <td v-show="!$parent.$parent.$parent.$parent.areaShow" style="text-align:center"><nobr>{{row.f_house_type}}</nobr></td>
151
+ <td v-show="!$parent.$parent.$parent.$parent.areaShow" style="text-align:center"><nobr>{{row.f_position}}</nobr></td>
152
+ <td v-show="!$parent.$parent.$parent.$parent.areaShow" style="text-align:center"><nobr>{{row.f_slice_area}}</nobr></td>
153
+ <td style="text-align:center"><nobr>{{row.f_operator}}</nobr></td>
154
+ <td style="text-align:center"><nobr>{{row.f_operate_date}}</nobr></td>
155
+ <td style="text-align:center"><nobr>{{row.addressnum}}</nobr></td>
156
+ <td><nobr>
157
+ <!--<button type="button" name="button" class="btn btn-link"
158
+ @click.stop="$parent.$parent.$parent.modify(row)">修改</button>-->
159
+ <button v-if="!row.f_residential_area_id" type="button" name="button" class="btn btn-danger"
160
+ style="padding: 5px 12px"
161
+ @click.stop="$parent.$parent.$parent.delete(row)">删除</button>
162
+ </nobr>
163
+ </td>
164
+ </template>
165
+ <template partial='foot'></template>
166
+ </data-grid>
167
+ </criteria-paged>
168
+ <modal :show="showDelete" large backdrop="false" :width="900">
169
+ <header slot="modal-header" class="modal-header">
170
+ <p class="bg-info text-center" style="padding: 8px;">请选择目标小区</p>
171
+ </header>
172
+ <article slot="modal-body" class="modal-body">
173
+ <validator name='v'>
174
+ <div class="col-sm-6 form-group ">
175
+ <label class="font_normal_body">小区名称</label>
176
+ <input type="text" style="width:41%" v-show="false" v-validate:f_residential_area_id='{required: true }' v-model="areamodel.f_residential_area_id">
177
+ <v-select :value.sync="areamodel.f_residential_area_id" :value-single="true"
178
+ @change="areaChange"
179
+ :options='areaslist' placeholder='请选择'
180
+ close-on-select search="true">
181
+ </v-select>
182
+ </div>
183
+ </validator>
184
+ </article>
185
+ <footer slot="modal-footer" class="modal-footer">
186
+ <button v-show="showDelete" type="button" class="button_search button_spacing" @click='confirmDelete()' :disabled='!$v.valid'>确认</button>
187
+ <button v-show="showDelete" type="button" class="button_clear button_spacing" @click='cancelDelete()'>取消</button>
188
+ </footer>
189
+ </modal>
190
+ </div>
191
+ </template>
192
+
193
+ <script>
194
+ import { PagedList } from 'vue-client'
195
+ let readyGen = async function (self) {
196
+ self.getfield = self.config.excelHeaders
197
+ self.search()
198
+ }
199
+ export default {
200
+
201
+ data () {
202
+ return {
203
+ showDelete: false,
204
+ criteriaShow: false,
205
+ // 目标小区数据
206
+ areamodel: {
207
+ f_residential_area_id: '',
208
+ f_pcd: '',
209
+ f_pcd_id: '',
210
+ f_street: '',
211
+ f_street_id: '',
212
+ f_slice_area: '',
213
+ f_residential_area: ''
214
+ },
215
+ model: new PagedList('rs/sql/address_getarealist',20),
216
+ addflag: false,
217
+ addtitle:'',
218
+ getfield: {},
219
+ // 公司下拉
220
+ curorgid: [this.$login.f.orgid],
221
+ f_orgid: '',
222
+ //初始化小区数据
223
+ areaslist:[],
224
+ config: {
225
+ // 导出列要和查询列相同
226
+ excelHeaders: {
227
+ 'f_district':'区/县',
228
+ 'f_street':'街道名称',
229
+ 'f_residential_area':'小区名称',
230
+ 'f_area_address':'小区地址',
231
+ 'f_comments':'小区备注',
232
+ 'f_inputtor':'抄表员',
233
+ 'f_house_type':'房屋类型',
234
+ 'f_position':'安装位置',
235
+ 'f_slice_area':'片区/管理站',
236
+ 'f_operator':'操作人',
237
+ 'f_operate_date':'操作日期',
238
+ 'addressnum':'地址数'
239
+ }
240
+ },
241
+ housetype:[{label:'全部',value:''},{label: '楼房', value: '楼房'}, {label: '自建房', value: '自建房'}],
242
+ position:this.$appdata.getParam('安装位置')?[{label:'全部',value:''},...this.$appdata.getParam('安装位置')]:[{label:'全部',value:''}]
243
+ }
244
+ },
245
+ title: '小区管理',
246
+ props:{
247
+ f_filialeids:{
248
+ type: String
249
+ },
250
+ style: {
251
+ type: String,
252
+ default: 'col-sm-2 form-group'
253
+ },
254
+ f_special:{
255
+ type: String
256
+ }
257
+ },
258
+ ready(){
259
+ readyGen(this)
260
+
261
+ },
262
+ methods: {
263
+ hidden() {
264
+ this.criteriaShow = !this.criteriaShow
265
+ },
266
+ search() {
267
+ this.$refs.paged.$refs.cri.search()
268
+ },
269
+
270
+ async delete(row){
271
+ if(row.id >= 0){
272
+ var id = row.id
273
+ let useraredss = await this.$resetpost('rs/sql/address_singleTable',
274
+ {data: {
275
+ items: 'f_residential_area_id',
276
+ tablename: 't_user_address',
277
+ condition: `f_residential_area_id='${id}'`}
278
+ },
279
+ {resolveMsg: null, rejectMsg: null})
280
+ if(useraredss.data.length>0){
281
+ this.$showAlert('该小区下已有地址信息,无法删除!','warning',1000)
282
+ }else{
283
+ this.$resetdelete('rs/entity/t_area', {id: id}, {resolveMsg: '删除成功', rejectMsg: '删除失败'}).then((res) => {
284
+ this.$dispatch('cancel')
285
+ })
286
+ }
287
+ }
288
+ },
289
+ add(val){
290
+ if (this.f_filialeids) {
291
+ this.$refs.paged.$refs.grid.selectStore.selected = null
292
+ this.$dispatch('add', val)
293
+ } else {
294
+ this.$showAlert('请先选择左上角的所在分公司', 'warning', 2000)
295
+ }
296
+ },
297
+ modify(val){
298
+ this.$refs.paged.$refs.grid.selectStore.selected = null
299
+ this.$dispatch('modify',val)
300
+ },
301
+ selfSearch (args) {
302
+
303
+ if (!this.f_orgid) {
304
+ this.getorg([this.$login.f.orgid])
305
+ }
306
+ if(this.f_special){
307
+ args.condition = `${args.condition} and s.f_special='1' and s.f_filialeid = '${this.f_filialeids}'`
308
+ }else{
309
+ args.condition = `${args.condition} and s.f_filialeid = ${this.f_orgid}`
310
+ }
311
+ this.model.search(args.condition, args.model)
312
+ },
313
+ //清空
314
+ clear(){
315
+ this.$refs.paged.$refs.cri.model = {}
316
+ },
317
+ getorg (val) {
318
+ this.f_orgid = this.$login.convertToIn(val)
319
+ this.f_filialeids = val[0]
320
+ },
321
+ async batchDelete () {
322
+ if (this.f_filialeids) {
323
+ if (this.$refs.paged.$refs.grid.getRowData().length != 0) {
324
+ this.showDelete = true
325
+ let condition = `a.f_orgid = '${this.f_filialeids}'`
326
+ let req = await this.$resetpost('rs/sql/address_getresidential', {
327
+ data: {
328
+ condition: condition
329
+ }
330
+ }, {resolveMsg: null, rejectMsg: '获取地址失败!'})
331
+ let redata = []
332
+ req.data.forEach((row) => {
333
+ redata.push({
334
+ label: row.f_residential_area,
335
+ value: row.id,
336
+ data: row,
337
+ id: row.id
338
+ })
339
+ })
340
+ this.areaslist = redata
341
+ } else {
342
+ this.$showAlert('请至少选择一项!', 'warning', 2000)
343
+ }
344
+ }else {
345
+ this.$showAlert('请先选择左上角的所在分公司', 'warning', 2000)
346
+ }
347
+ },
348
+ confirmDelete () {
349
+ let msg = {
350
+ resolveMsg: '批量删除成功',
351
+ rejectMsg: '批量删除失败!'
352
+ }
353
+ let oldAreaIds = []
354
+ // 获取要批量删除的小区数据
355
+ this.$refs.paged.$refs.grid.getRowData().forEach((row,n) => {
356
+ oldAreaIds[n] = row.id
357
+ })
358
+ this.$resetpost('rs/logic/batchDelete',{
359
+ data:{
360
+ areamodel:this.areamodel,
361
+ oldAreaIds:oldAreaIds,
362
+ f_operator: this.$login.f.name,
363
+ f_operatorid: this.$login.f.id,
364
+ f_orgid: this.$login.f.orgid,
365
+ f_orgname: this.$login.f.orgs,
366
+ f_depid: this.$login.f.depids,
367
+ f_depname: this.$login.f.deps
368
+ }
369
+ },msg)
370
+ this.$refs.paged.$refs.grid.selectInit()
371
+ this.$refs.paged.$refs.cri.search()
372
+ this.areamodel.f_residential_area_id = ''
373
+ this.showDelete = false
374
+ },
375
+ cancelDelete () {
376
+ this.$refs.paged.$refs.grid.selectInit()
377
+ this.$refs.paged.$refs.cri.search()
378
+ this.areamodel.f_residential_area_id = ''
379
+ this.showDelete = false
380
+ },
381
+ areaChange(val){
382
+ console.log("小区变化",val)
383
+ let selectArea // 选中的小区数据
384
+ for (let row of this.areaslist) {
385
+ if (val == row.value) {
386
+ selectArea = row.data
387
+ break
388
+ }
389
+ }
390
+ if (selectArea) {
391
+ this.areamodel.f_residential_area_id = selectArea.id
392
+ this.areamodel.f_pcd = selectArea.f_pcd
393
+ this.areamodel.f_pcd_id = selectArea.f_pcd_id
394
+ this.areamodel.f_street = selectArea.f_street
395
+ this.areamodel.f_street_id = selectArea.f_street_id
396
+ this.areamodel.f_slice_area = selectArea.f_slice_area
397
+ this.areamodel.f_residential_area = selectArea.f_residential_area
398
+ }
399
+ this.$nextTick(() => {
400
+ this.$resetValidation()
401
+ })
402
+ },
403
+ },
404
+ watch:{
405
+
406
+ },
407
+ computed:{
408
+ getCondition() {
409
+ var condition=''
410
+ if(this.f_special){
411
+ condition = `${this.$refs.paged.$refs.cri.condition} and s.f_special='1' and s.f_filialeid = '${this.f_filialeids}'`
412
+ }else{
413
+ condition = `${this.$refs.paged.$refs.cri.condition} and s.f_filialeid = ${this.f_orgid}`
414
+ }
415
+ return {
416
+ condition: condition
417
+ }
418
+ },
419
+ inputtores () {
420
+ // 获取抄表员
421
+ let rs = new Array()
422
+ if (this.$login.f.f_gasman.length > 0) {
423
+ for (let i = 0; i < this.$login.f.f_gasman.length; i++) {
424
+ let temp = {
425
+ label: this.$login.f.f_gasman[i].name,
426
+ value: this.$login.f.f_gasman[i].name
427
+ }
428
+ rs.push(temp)
429
+ }
430
+ }
431
+ return rs
432
+ }
433
+ }
434
+
435
+ }
436
+ </script>