address-client 3.2.78 → 3.2.81

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