address-client 3.2.53 → 3.2.56

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