address-client 3.2.82 → 3.2.83

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