address-client 3.2.93 → 3.2.95

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,410 @@
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_use_institution"
78
+ close-on-select condition="f_use_institution='{}'"
79
+ placeholder='房屋类型' v-model="model.f_use_institution"></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
+ <table class="table-hover">
175
+ <tr style="position: relative" class="table-bordered">
176
+ <td
177
+ style="display: inline-block;width: auto;border-right: 1px solid #F2F6FA;padding: 0px 10px 0px 10px;color: #5CB95C;font-weight: bold">
178
+ 汇总信息
179
+ </td>
180
+ <td style="display: inline-block;width: auto;border-right: 1px solid #F2F6FA;padding: 0px 10px 0px 10px;font-weight: bold">
181
+ 共有用户:&emsp;{{sumsmodel.addressnum}}户
182
+ </td>
183
+ </tr>
184
+ </table>
185
+ </template>
186
+
187
+ <script>
188
+ import { PagedList } from 'vue-client'
189
+
190
+ export default {
191
+
192
+ data () {
193
+ return {
194
+ criteriaShow: false,
195
+ model: new PagedList('rs/sql/address_getarealist',20,{},{addressnum: 0}),
196
+ addflag: false,
197
+ addtitle:'',
198
+
199
+ // 公司下拉
200
+ curorgid: [this.$login.f.orgid],
201
+ f_orgid: '',
202
+ handmonth:[{label:'全部',value:''},{label:'单月',value:'单月'},{label:'双月',value:'双月'}],
203
+ housetype:[{label:'全部',value:''},...this.$appdata.getParam('房屋类型')],
204
+ position:this.$appdata.getParam('安装位置')?[{label:'全部',value:''},...this.$appdata.getParam('安装位置')]:[{label:'全部',value:''}],
205
+ // 合计数据
206
+ sumsmodel: {},
207
+ //初始化小区数据
208
+ areaslist:[],
209
+ // 目标小区数据
210
+ areamodel: {
211
+ f_residential_area_id: '',
212
+ f_pcd: '',
213
+ f_pcd_id: '',
214
+ f_street: '',
215
+ f_street_id: '',
216
+ f_slice_area: '',
217
+ f_residential_area: ''
218
+ },
219
+ showDelete: false,
220
+ }
221
+ },
222
+ title: '小区管理',
223
+ props:{
224
+ f_filialeids:{
225
+ type: String
226
+ },
227
+ style: {
228
+ type: String,
229
+ default: 'col-sm-2 form-group'
230
+ },
231
+ f_special:{
232
+ type: String
233
+ }
234
+ },
235
+ ready(){
236
+ this.search()
237
+ },
238
+ methods: {
239
+ handDblclick(row){
240
+ console.log('row',row)
241
+ this.$dispatch("child-dblclick",row)
242
+ },
243
+ dealmsg (row) {
244
+ this.$dispatch('shouAreaAllUser',row)
245
+ },
246
+ hidden() {
247
+ this.criteriaShow = !this.criteriaShow
248
+ },
249
+ search() {
250
+ this.$refs.paged.$refs.cri.search()
251
+ },
252
+
253
+ async delete(row){
254
+ if(row.id){
255
+ var id = row.id
256
+ let useraredss = await this.$resetpost('rs/sql/address_singleTable',
257
+ {data: {
258
+ items: 'f_residential_area_id',
259
+ tablename: 't_user_address',
260
+ condition: `f_residential_area_id='${id}'`}
261
+ },
262
+ {resolveMsg: null, rejectMsg: null})
263
+ if(useraredss.data.length>0){
264
+ this.$showAlert('该小区下已有地址信息,无法删除!','warning',1000)
265
+ }else{
266
+ this.$resetdelete('rs/entity/t_area', {id: id}, {resolveMsg: '删除成功', rejectMsg: '删除失败'}).then((res) => {
267
+ this.$dispatch('cancel')
268
+ })
269
+ }
270
+ }
271
+ },
272
+ add(val){
273
+ if (this.f_filialeids) {
274
+ this.$refs.paged.$refs.grid.selectStore.selected = null
275
+ this.$dispatch('add')
276
+ } else {
277
+ this.$showAlert('请先选择左上角的所在分公司', 'warning', 2000)
278
+ }
279
+ },
280
+ modify(val){
281
+ this.$refs.paged.$refs.grid.selectStore.selected = null
282
+ this.$dispatch('modify',val)
283
+ },
284
+ selfSearch (args) {
285
+
286
+ if (!this.f_orgid) {
287
+ this.getorg([this.$login.f.orgid])
288
+ }
289
+ console.log('查询。。。', this.f_orgid)
290
+ if(this.f_special){
291
+ args.condition = `${args.condition} and s.f_special='1' and s.f_filialeid = '${this.f_filialeids}'`
292
+ }else{
293
+ args.condition = `${args.condition} and s.f_filialeid = ${this.f_orgid}`
294
+ }
295
+ this.model.search(args.condition, args.model)
296
+ this.sumsmodel = this.$refs.paged.$refs.grid.model.sums;
297
+ },
298
+ //清空
299
+ clear(){
300
+ this.$refs.paged.$refs.cri.model = {}
301
+ },
302
+ getorg (val) {
303
+ this.f_orgid = this.$login.convertToIn(val)
304
+ this.f_filialeids = val[0]
305
+ },
306
+ async batchDelete () {
307
+ if (this.f_filialeids) {
308
+ if (this.$refs.paged.$refs.grid.getRowData().length != 0) {
309
+ this.showDelete = true
310
+ let condition = `a.f_orgid = '${this.f_filialeids}'`
311
+ let req = await this.$resetpost('rs/sql/address_getresidential', {
312
+ data: {
313
+ condition: condition
314
+ }
315
+ }, {resolveMsg: null, rejectMsg: '获取地址失败!'})
316
+ let redata = []
317
+ req.data.forEach((row) => {
318
+ redata.push({
319
+ label: row.f_residential_area,
320
+ value: row.id,
321
+ data: row,
322
+ id: row.id
323
+ })
324
+ })
325
+ this.areaslist = redata
326
+ } else {
327
+ this.$showAlert('请至少选择一项!', 'warning', 2000)
328
+ }
329
+ }else {
330
+ this.$showAlert('请先选择左上角的所在分公司', 'warning', 2000)
331
+ }
332
+ },
333
+ confirmDelete () {
334
+ let msg = {
335
+ resolveMsg: '批量删除成功',
336
+ rejectMsg: '批量删除失败!'
337
+ }
338
+ let oldAreaIds = []
339
+ // 获取要批量删除的小区数据
340
+ this.$refs.paged.$refs.grid.getRowData().forEach((row,n) => {
341
+ oldAreaIds[n] = row.id
342
+ })
343
+ this.$resetpost('rs/logic/batchDelete',{
344
+ data:{
345
+ areamodel:this.areamodel,
346
+ oldAreaIds:oldAreaIds,
347
+ f_operator: this.$login.f.name,
348
+ f_operatorid: this.$login.f.id,
349
+ f_orgid: this.$login.f.orgid,
350
+ f_orgname: this.$login.f.orgs,
351
+ f_depid: this.$login.f.depids,
352
+ f_depname: this.$login.f.deps
353
+ }
354
+ },msg)
355
+ this.$refs.paged.$refs.grid.selectInit()
356
+ this.$refs.paged.$refs.cri.search()
357
+ this.areamodel.f_residential_area_id = ''
358
+ this.showDelete = false
359
+ },
360
+ cancelDelete () {
361
+ this.$refs.paged.$refs.grid.selectInit()
362
+ this.$refs.paged.$refs.cri.search()
363
+ this.areamodel.f_residential_area_id = ''
364
+ this.showDelete = false
365
+ },
366
+ areaChange(val){
367
+ console.log("小区变化",val)
368
+ let selectArea // 选中的小区数据
369
+ for (let row of this.areaslist) {
370
+ if (val == row.value) {
371
+ selectArea = row.data
372
+ break
373
+ }
374
+ }
375
+ if (selectArea) {
376
+ this.areamodel.f_residential_area_id = selectArea.id
377
+ this.areamodel.f_pcd = selectArea.f_pcd
378
+ this.areamodel.f_pcd_id = selectArea.f_pcd_id
379
+ this.areamodel.f_street = selectArea.f_street
380
+ this.areamodel.f_street_id = selectArea.f_street_id
381
+ this.areamodel.f_slice_area = selectArea.f_slice_area
382
+ this.areamodel.f_residential_area = selectArea.f_residential_area
383
+ }
384
+ this.$nextTick(() => {
385
+ this.$resetValidation()
386
+ })
387
+ },
388
+ },
389
+ watch:{
390
+
391
+ },
392
+ computed:{
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>