address-client 3.1.1 → 3.1.4

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,391 +1,391 @@
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
-
7
- <div class="row">
8
-
9
- <div :class="$parent.$parent.style">
10
- <label class="font_normal_body">组织机构</label>
11
- <res-select
12
- restype='organization'
13
- @res-select="$parent.$parent.getorg"
14
- is-mul="false"
15
- :initresid='$parent.$parent.curorgid'
16
- >
17
- </res-select>
18
- </div>
19
- <div :class="$parent.$parent.style" v-if="$parent.$parent.showrightchange">
20
- <label class="font_normal_body">用户编号</label>
21
- <input type="text" class="input_search" style="width:60%" v-model="model.f_userinfo_code" style="width:60%"
22
- condition="f_userinfo_code = '{}'" placeholder="用户编号"/>
23
- </div>
24
- <div v-if="$parent.$parent.showrightchange" :class="$parent.$parent.style">
25
- <label class="font_normal_body">小&emsp;&emsp;区</label>
26
- <input type="text" class="input_search" style="width:60%" v-model="model.f_residential_arearea" style="width:60%"
27
- condition="a.f_residential_area like '%{}%'" placeholder="小区"
28
- :size="model.f_residential_arearea ? model.f_residential_arearea.length*2 : 8"/>
29
- </div>
30
- <!--<div v-if="$parent.$parent.showrightchange" :class="$parent.$parent.style" v-if="!$parent.$parent.$parent.useraddressShow">-->
31
-
32
- <div :class="$parent.$parent.style" v-if="$parent.$parent.$parent.showrightchange">
33
- <label class="font_normal_body">楼&emsp;&emsp;号</label>
34
- <input type="text" class="input_search" style="width:60%" v-model="model.f_building" style="width:60%"
35
- condition="a.f_building like '%{}%'" placeholder="楼号"
36
- :size="model.f_building ? model.f_building.length*2 : 6"/>
37
- </div>
38
- <div class="col-sm-4 form-group button-range" >
39
- <button class="button_search button_spacing" @click="search()" >查询</button>
40
- <button class="button_new button_spacing" style="width: max-content" @click="$parent.$parent.add('民用')">添加民用</button>
41
- <button class="button_new button_spacing" style="width: max-content" @click="$parent.$parent.add('非民用')">添加特殊地址</button>
42
- <button class="button_clear button_spacing" @click="$parent.$parent.clear()">清空</button>
43
- <button class="button_export button_spacing" @click="$parent.$parent.importAddress('导入')">模板导入</button>
44
- <button class="button_export button_spacing"
45
- v-show="this.$login.r.includes('完善地址')"
46
- @click="$parent.$parent.importAddress('完善')">完善地址</button>
47
- <export-excel :data="$parent.$parent.getCondition"
48
- :field="$parent.$parent.getfield"
49
- sqlurl="rs/logic/exportfile"
50
- sql-name="addressGetAddress"
51
- template-name='地址管理查询导出'
52
- :choose-col="true"></export-excel>
53
- <div style="float: right" class="button_spacing" :class="{'button_shrink_top':$parent.$parent.criteriaShow,'button_shrink_bottom':!$parent.$parent.criteriaShow}" @click="$parent.$parent.hidden()"></div>
54
- </div>
55
- </div>
56
- <div class="row" v-show="$parent.$parent.criteriaShow">
57
- <div :class="$parent.$parent.style" v-if="!$parent.$parent.showrightchange">
58
- <label class="font_normal_body">用户编号</label>
59
- <input type="text" class="input_search" style="width:60%" v-model="model.f_userinfo_code" style="width:60%"
60
- condition="f_userinfo_code = '{}'" placeholder="用户编号"/>
61
- </div>
62
- <div :class="$parent.$parent.style" >
63
- <label class="font_normal_body">地址类型</label>
64
- <v-select :value.sync="model.f_address_type"
65
- class="f_address_type select"
66
- v-model="model.f_address_type"
67
- condition="a.f_address_type = '{}'"
68
- :options='$parent.$parent.getaddresstype' placeholder='地址类型'
69
- close-on-select>
70
- </v-select>
71
- </div>
72
- <div v-if="!$parent.$parent.showrightchange" :class="$parent.$parent.style">
73
- <label class="font_normal_body">小&emsp;&emsp;区</label>
74
- <input type="text" class="input_search" style="width:60%" v-model="model.f_residential_arearea" style="width:60%"
75
- condition="a.f_residential_area like '%{}%'" placeholder="小区"
76
- :size="model.f_residential_arearea ? model.f_residential_arearea.length*2 : 8"/>
77
- </div>
78
- <div :class="$parent.$parent.style" v-if="!$parent.$parent.$parent.showrightchange">
79
- <label class="font_normal_body">&nbsp;楼号(镇)</label>
80
- <input type="text" class="input_search" style="width:60%" v-model="model.f_building" style="width:60%"
81
- condition="a.f_building like '%{}%'" placeholder="楼号"
82
- :size="model.f_building ? model.f_building.length*2 : 6"/>
83
- </div>
84
- <div :class="$parent.$parent.style" >
85
- <label class="font_normal_body">&nbsp;单元(村)</label>
86
- <input type="text" class="input_search" style="width:60%" v-model="model.f_unit" style="width:60%"
87
- condition="a.f_unit like '%{}%'" placeholder="单元"
88
- :size="model.f_unit ? model.f_unit.length*2 : 6"/>
89
- </div>
90
- <div :class="$parent.$parent.style">
91
- <label class="font_normal_body">&nbsp;楼层(组)</label>
92
- <input type="text" class="input_search" style="width:60%" v-model="model.f_floor" style="width:60%"
93
- condition="a.f_floor like '%{}%'" placeholder="楼层"
94
- :size="model.f_floor ? model.f_floor.length*2 : 6"/>
95
- </div>
96
- <div :class="$parent.$parent.style">
97
- <label class="font_normal_body">&emsp;门牌号</label>
98
- <input type="text" class="input_search" style="width:60%" v-model="model.f_room" style="width:60%"
99
- condition="a.f_room like '%{}%'" placeholder="门牌号"
100
- :size="model.f_room ? model.f_room.length*2 : 6"/>
101
- </div>
102
- <!-- <div :class="$parent.$parent.style">-->
103
- <!-- <label class="font_normal_body">小&emsp;&emsp;区</label>-->
104
- <!-- <input type="text" class="input_search" style="width:60%" v-model="model.f_residential_arearea" style="width:60%"-->
105
- <!-- condition="a.f_residential_area like '%{}%'" placeholder="小区"-->
106
- <!-- :size="model.f_residential_arearea ? model.f_residential_arearea.length*2 : 8"/>-->
107
- <!-- </div>-->
108
-
109
- <div :class="$parent.$parent.style">
110
- <label class="font_normal_body">地址&emsp;ID</label>
111
- <input type="text" class="input_search" style="width:60%" v-model="model.id" style="width:60%"
112
- condition="a.id = '{}'" placeholder="地址ID"
113
- />
114
- </div>
115
- <div :class="$parent.$parent.style" >
116
- <label class="font_normal_body">详细地址</label>
117
- <input type="text" class="input_search" style="width:60%" v-model="model.f_address" style="width:60%"
118
- condition="a.f_address like '%{}%'" placeholder="详细地址"
119
- :size="model.f_address ? model.f_address.length*2 : 8"/>
120
- </div>
121
- <div :class="$parent.$parent.style" v-if="!$parent.$parent.$parent.showrightchange">
122
- <label class="font_normal_body">街&emsp;&emsp;道</label>
123
- <input type="text" class="input_search" style="width:60%" v-model="model.f_street"
124
- condition="f_street like '%{}%'" placeholder="街道"
125
- :size="model.f_street ? model.f_street.length*2 : 6"/>
126
- </div>
127
- <div :class="$parent.$parent.style" >
128
- <label class="font_normal_body">地址状态</label>
129
- <v-select :value.sync="model.f_address_state"
130
- class="select_list select"
131
- v-model="model.f_address_state"
132
- condition="a.f_address_state = '{}'"
133
- :options='$parent.$parent.getaddresstate' placeholder='地址状态'
134
- close-on-select>
135
- </v-select>
136
- </div>
137
- </div>
138
- </div>
139
- </criteria>
140
- <data-grid :model="model" partial='list' style="overflow: auto" class="list_area table_sy" v-ref:grid>
141
- <template partial='head'>
142
- <tr>
143
- <th><nobr>序号</nobr></th>
144
- <th><nobr>用户编号</nobr></th>
145
- <th><nobr>地址类型</nobr></th>
146
- <th v-show="!$parent.$parent.$parent.$parent.useraddressShow"><nobr>区/县</nobr></th>
147
- <th v-show="!$parent.$parent.$parent.$parent.useraddressShow"><nobr>片区</nobr></th>
148
- <th><nobr>街道</nobr></th>
149
- <th><nobr>小区(单位)</nobr></th>
150
- <th v-show="!$parent.$parent.$parent.$parent.useraddressShow"><nobr>楼号(乡/镇)</nobr></th>
151
- <th v-show="!$parent.$parent.$parent.$parent.useraddressShow"><nobr>单元()</nobr></th>
152
- <th v-show="!$parent.$parent.$parent.$parent.useraddressShow"><nobr>楼层(组)</nobr></th>
153
- <th v-show="!$parent.$parent.$parent.$parent.useraddressShow"><nobr>门牌号(号)</nobr></th>
154
- <th><nobr>详细地址</nobr></th>
155
- <th><nobr>地址状态</nobr></th>
156
- <th><nobr>时间</nobr></th>
157
- <th><nobr>操作</nobr></th>
158
- </tr>
159
- </template>
160
- <template partial='body'>
161
- <tr>
162
- <td style="text-align:center"><nobr>{{$index + 1}}</nobr></td>
163
- <td style="text-align:center"><nobr>{{row.f_userinfo_code}}</nobr></td>
164
- <td style="text-align:center"><nobr>{{row.f_address_type}}</nobr></td>
165
- <td v-show="!$parent.$parent.$parent.$parent.useraddressShow" style="text-align:center"><nobr>{{row.f_pcd}}</nobr></td>
166
- <td v-show="!$parent.$parent.$parent.$parent.useraddressShow" style="text-align:center"><nobr>{{row.f_slice_area}}</nobr></td>
167
- <td style="text-align:center"><nobr>{{row.f_street}}</nobr></td>
168
- <td style="text-align:center"><nobr>{{row.f_residential_area}}</nobr></td>
169
- <td v-show="!$parent.$parent.$parent.$parent.useraddressShow" style="text-align:center"><nobr>{{row.f_building}}{{row.f_building_suffix}}</nobr></td>
170
- <td v-show="!$parent.$parent.$parent.$parent.useraddressShow" style="text-align:center"><nobr>{{row.f_unit}}{{row.f_unit_suffix}}</nobr></td>
171
- <td v-show="!$parent.$parent.$parent.$parent.useraddressShow" style="text-align:center"><nobr>{{row.f_floor}}{{row.f_floor_suffix}}</nobr></td>
172
- <td v-show="!$parent.$parent.$parent.$parent.useraddressShow" style="text-align:center"><nobr>{{row.f_room}}{{row.f_room_suffix}}</nobr></td>
173
- <td style="text-align:center"><nobr>{{row.f_address}}</nobr></td>
174
- <td style="text-align:center"><nobr>{{row.f_address_state}}</nobr></td>
175
- <td style="text-align:center"><nobr>{{row.f_create_date}}</nobr></td>
176
- <td style="text-align:center">
177
- <!-- <button type="button" name="button" class="btn btn-link"
178
- @click.stop="$parent.$parent.$parent.modify(row)">修改</button>-->
179
- <button v-if="!row.f_useraddress_id" type="button" name="button" class="btn btn-danger"
180
- style="padding: 5px 12px"
181
- @click.stop="$parent.$parent.$parent.delete(row)">删除</button>
182
- </td>
183
- </tr>
184
- </template>
185
- <template partial='foot'></template>
186
- </data-grid>
187
- </criteria-paged>
188
- </div>
189
- <work-busy :is-busy='isbusy'></work-busy>
190
- <modal :show.sync="showFile" width="480px" v-ref:modal backdrop="true">
191
- <header slot="modal-header" class="modal-header">
192
- <button type="button" class="close" @click="closeFile"><span>&times;</span></button>
193
- <h4 class="modal-title">选择文件</h4>
194
- </header>
195
- <article slot="modal-body" class="modal-body">
196
- <div class="form-group">
197
- <file-upload class="my-file-uploader" name="useraddressUploadFile" action="rs/file/uploadFile" tagname="确定" multiple v-ref:file></file-upload>
198
- </div>
199
- </article>
200
- <footer slot="modal-footer" class="modal-footer" style="display: none"></footer>
201
- </modal>
202
- </template>
203
-
204
- <script>
205
- import { PagedList } from 'vue-client'
206
-
207
-
208
- let readyGen = async function (self) {
209
- self.getfield = self.config.excelHeaders
210
- }
211
-
212
- export default {
213
- data () {
214
- return {
215
- criteriaShow: false,
216
- model: new PagedList('rs/sql/address_getAddress',20,{tablename: `'t_user_address'`,items: `'*'`,orderitem: `'id desc'`}),
217
- config: {
218
- // 导出列要和查询列相同
219
- excelHeaders: {
220
- 'f_user_name':'用户姓名',
221
- 'f_userinfo_code':'用户编号',
222
- 'id':'地址ID',
223
- 'f_pcd':'区/县',
224
- 'f_slice_area':'片区',
225
- 'f_address_type':'地址类型',
226
- 'f_street':'街道',
227
- 'f_residential_area':'小区',
228
- 'f_building':'楼号(乡/镇)',
229
- 'f_unit':'单元(村)',
230
- 'f_floor':'楼层(组)',
231
- 'f_room':'门牌号(号)',
232
- 'f_address':'详细地址',
233
- 'f_address_state':'地址状态',
234
- 'f_create_date':'时间'
235
- },
236
- },
237
- isbusy:false,
238
- addflag: false,
239
- addtitle:'',
240
- other: [],
241
- footer: [],
242
- getfield: {},
243
- imptype:'',
244
- // 公司下拉
245
- curorgid: [this.$login.f.orgid],
246
- f_orgid: '',
247
- getaddresstype:[{label:'全部',value:''},{label:'城区',value:'城区'},{label:'农村',value:'农村'}],
248
- //文件上传弹框
249
- showFile: false,
250
- showrightchange:true
251
- }
252
- },
253
- title: '地址列表',
254
- props:{
255
- f_filialeids:{
256
- type: String
257
- },
258
- style: {
259
- type: String,
260
- default: 'col-sm-2 '
261
- }
262
- },
263
- ready(){
264
- readyGen(this)
265
- this.search()
266
- },
267
- methods: {
268
- getotherfooter() {
269
- // this.$refs.paged.$refs.cri.$refs.exports.otherData=[];
270
- // this.$refs.paged.$refs.cri.$refs.exports.footerData=[];
271
- this.other = [];
272
- this.footer = [];
273
- // let exportdata = this.getCondition;
274
- let otherInData = [];
275
- otherInData.push(`导出时间: ${this.$login.toStandardTimeString()}`);
276
- let footerData = [], exportfield = this.getfield;
277
- footerData.push("合计");
278
- let self = this;
279
- for (var field in self.sumsmodel) {
280
- footerData.push(`${exportfield[field]}合计:${self.sumsmodel[field]}`);
281
- }
282
- this.footer.push(footerData);
283
- this.other.push(otherInData);
284
- },
285
- hidden() {
286
- this.criteriaShow = !this.criteriaShow
287
- },
288
- //添加方法
289
- add(val){
290
- if (this.f_filialeids) {
291
- this.$refs.paged.$refs.grid.selectStore.selected = null
292
- this.$dispatch('add',val)
293
- this.showrightchange = false;
294
- } else {
295
- this.$showAlert('请先选择左上角的所在分公司', 'warning', 2000)
296
- }
297
- },
298
- importAddress(val){
299
- this.imptype = val
300
- this.showFile = true
301
- },
302
- // 关闭文件上传对话框
303
- closeFile() {
304
- this.showFile = false
305
- // 将选的文件清空
306
- this.$refs.file.$el.querySelector('input').value = ''
307
- },
308
- //修改
309
- modify(val){
310
- this.$refs.paged.$refs.grid.selectStore.selected = null
311
- this.$dispatch('modify',val)
312
- },
313
- async delete(row){
314
- if(row.id){
315
- var id = row.id
316
- let userfiles = await this.$resetpost('rs/sql/address_singleTable', {data: {items: 'f_useraddress_id',tablename: 't_userfiles',condition: `f_useraddress_id='${id}' and f_table_state = '正常'`}},{resolveMsg: null, rejectMsg: null})
317
- if(userfiles.data.length){
318
- this.$showAlert('该地址下已有正常表具档案,无法删除!','warning',1000)
319
- }else{
320
- this.$resetdelete('rs/entity/t_user_address', {id: id}, {resolveMsg: '删除成功', rejectMsg: '删除失败'}).then((res) => {
321
- this.$dispatch('cancel')
322
- })
323
- }
324
- }
325
- },
326
-
327
- search () {
328
- this.$refs.paged.$refs.cri.search()
329
- },
330
-
331
- selfSearch (args) {
332
-
333
- if (!this.f_orgid) {
334
- this.getorg([this.$login.f.orgid])
335
- }
336
-
337
- args.condition = `${args.condition} and a.f_filialeid = '${this.f_filialeids}'`
338
- this.model.search(args.condition, args.model)
339
- },
340
-
341
- //清空
342
- clear(){
343
- this.$refs.paged.$refs.cri.model = {}
344
- },
345
- getorg (val) {
346
- this.f_orgid = this.$login.convertToIn(val)
347
- this.f_filialeids = val[0]
348
- }
349
- },
350
- events: {
351
- onFileUpload: async function (file, res) {
352
- this.isbusy = true
353
- console.log("上传完毕"+JSON.stringify(res))
354
- let data = {
355
- filepath: res.f_downloadpath,
356
- user:this.$login.f,
357
- type :this.imptype
358
- }
359
- console.log("filepath="+JSON.stringify(data))
360
- await this.$resetpost(`rs/logic/address_useraddressimport`,data, {resolveMsg: null, rejectMsg: '导入失败', silent: true}, 0).then((res)=>{
361
- this.isbusy = false
362
- if(res.data.type=="success"){
363
- this.$showAlert("导入信息:"+res.data.msg, res.data.type, 2000);
364
- }else{
365
- this.$showMessage(res.data.msg);
366
- }
367
- //关闭上传框
368
- this.closeFile()
369
- //重新查询
370
- this.init()
371
- }).catch(error=>{
372
- this.isbusy = false
373
- })
374
- },
375
- 'onFileError'(error) {
376
- this.$showAlert(error, 'warning', 2000)
377
- }
378
- },
379
- computed: {
380
- //地址状态下拉框
381
- getaddresstate() {
382
- return [{label: '全部', value: ''}, ...this.$appdata.getParam('地址状态')]
383
- },
384
- getCondition() {
385
- return {
386
- condition: `${this.$refs.paged.$refs.cri.condition}` + `and a.f_filialeid = '${this.f_filialeids}'`}
387
- }
388
- }
389
-
390
- }
391
- </script>
1
+ <template>
2
+ <div class="flex" @keyup.enter="search">
3
+ <criteria-paged :model="model" v-ref:paged>
4
+ <criteria partial='criteria' @condition-changed='$parent.selfSearch' v-ref:cri>
5
+ <div novalidate class="form-horizontal select-overspread container-fluid auto" partial>
6
+
7
+ <div class="row">
8
+
9
+ <div :class="$parent.$parent.style">
10
+ <label class="font_normal_body">组织机构</label>
11
+ <res-select
12
+ restype='organization'
13
+ @res-select="$parent.$parent.getorg"
14
+ is-mul="false"
15
+ :initresid='$parent.$parent.curorgid'
16
+ >
17
+ </res-select>
18
+ </div>
19
+ <div :class="$parent.$parent.style" v-if="$parent.$parent.showrightchange">
20
+ <label class="font_normal_body">用户编号</label>
21
+ <input type="text" class="input_search" style="width:60%" v-model="model.f_userinfo_code" style="width:60%"
22
+ condition="f_userinfo_code = '{}'" placeholder="用户编号"/>
23
+ </div>
24
+ <div v-if="$parent.$parent.showrightchange" :class="$parent.$parent.style">
25
+ <label class="font_normal_body">小&emsp;&emsp;区</label>
26
+ <input type="text" class="input_search" style="width:60%" v-model="model.f_residential_arearea" style="width:60%"
27
+ condition="a.f_residential_area like '%{}%'" placeholder="小区"
28
+ :size="model.f_residential_arearea ? model.f_residential_arearea.length*2 : 8"/>
29
+ </div>
30
+ <!--<div v-if="$parent.$parent.showrightchange" :class="$parent.$parent.style" v-if="!$parent.$parent.$parent.useraddressShow">-->
31
+
32
+ <div :class="$parent.$parent.style" v-if="$parent.$parent.$parent.showrightchange">
33
+ <label class="font_normal_body">楼&emsp;&emsp;号</label>
34
+ <input type="text" class="input_search" style="width:60%" v-model="model.f_building" style="width:60%"
35
+ condition="a.f_building like '%{}%'" placeholder="楼号"
36
+ :size="model.f_building ? model.f_building.length*2 : 6"/>
37
+ </div>
38
+ <div class="col-sm-4 form-group button-range" >
39
+ <button class="button_search button_spacing" @click="search()" >查询</button>
40
+ <button class="button_new button_spacing" style="width: max-content" @click="$parent.$parent.add('民用')">添加民用</button>
41
+ <button class="button_new button_spacing" style="width: max-content" @click="$parent.$parent.add('非民用')">添加特殊地址</button>
42
+ <button class="button_clear button_spacing" @click="$parent.$parent.clear()">清空</button>
43
+ <button class="button_export button_spacing" @click="$parent.$parent.importAddress('导入')">模板导入</button>
44
+ <button class="button_export button_spacing"
45
+ v-show="this.$login.r.includes('完善地址')"
46
+ @click="$parent.$parent.importAddress('完善')">完善地址</button>
47
+ <export-excel :data="$parent.$parent.getCondition"
48
+ :field="$parent.$parent.getfield"
49
+ sqlurl="rs/logic/exportfile"
50
+ sql-name="addressGetAddress"
51
+ template-name='地址管理查询导出'
52
+ :choose-col="true"></export-excel>
53
+ <div style="float: right" class="button_spacing" :class="{'button_shrink_top':$parent.$parent.criteriaShow,'button_shrink_bottom':!$parent.$parent.criteriaShow}" @click="$parent.$parent.hidden()"></div>
54
+ </div>
55
+ </div>
56
+ <div class="row" v-show="$parent.$parent.criteriaShow">
57
+ <div :class="$parent.$parent.style" v-if="!$parent.$parent.showrightchange">
58
+ <label class="font_normal_body">用户编号</label>
59
+ <input type="text" class="input_search" style="width:60%" v-model="model.f_userinfo_code" style="width:60%"
60
+ condition="f_userinfo_code = '{}'" placeholder="用户编号"/>
61
+ </div>
62
+ <div :class="$parent.$parent.style" >
63
+ <label class="font_normal_body">地址类型</label>
64
+ <v-select :value.sync="model.f_address_type"
65
+ class="f_address_type select"
66
+ v-model="model.f_address_type"
67
+ condition="a.f_address_type = '{}'"
68
+ :options='$parent.$parent.getaddresstype' placeholder='地址类型'
69
+ close-on-select>
70
+ </v-select>
71
+ </div>
72
+ <div v-if="!$parent.$parent.showrightchange" :class="$parent.$parent.style">
73
+ <label class="font_normal_body">集收单位</label>
74
+ <input type="text" class="input_search" style="width:60%" v-model="model.f_residential_arearea" style="width:60%"
75
+ condition="a.f_residential_area like '%{}%'" placeholder="小区"
76
+ :size="model.f_residential_arearea ? model.f_residential_arearea.length*2 : 8"/>
77
+ </div>
78
+ <div :class="$parent.$parent.style" v-if="!$parent.$parent.$parent.showrightchange">
79
+ <label class="font_normal_body">&nbsp;楼号(镇)</label>
80
+ <input type="text" class="input_search" style="width:60%" v-model="model.f_building" style="width:60%"
81
+ condition="a.f_building like '%{}%'" placeholder="楼号"
82
+ :size="model.f_building ? model.f_building.length*2 : 6"/>
83
+ </div>
84
+ <div :class="$parent.$parent.style" >
85
+ <label class="font_normal_body">&nbsp;单元(村)</label>
86
+ <input type="text" class="input_search" style="width:60%" v-model="model.f_unit" style="width:60%"
87
+ condition="a.f_unit like '%{}%'" placeholder="单元"
88
+ :size="model.f_unit ? model.f_unit.length*2 : 6"/>
89
+ </div>
90
+ <div :class="$parent.$parent.style">
91
+ <label class="font_normal_body">&nbsp;楼层(组)</label>
92
+ <input type="text" class="input_search" style="width:60%" v-model="model.f_floor" style="width:60%"
93
+ condition="a.f_floor like '%{}%'" placeholder="楼层"
94
+ :size="model.f_floor ? model.f_floor.length*2 : 6"/>
95
+ </div>
96
+ <div :class="$parent.$parent.style">
97
+ <label class="font_normal_body">&emsp;门牌号</label>
98
+ <input type="text" class="input_search" style="width:60%" v-model="model.f_room" style="width:60%"
99
+ condition="a.f_room like '%{}%'" placeholder="门牌号"
100
+ :size="model.f_room ? model.f_room.length*2 : 6"/>
101
+ </div>
102
+ <!-- <div :class="$parent.$parent.style">-->
103
+ <!-- <label class="font_normal_body">小&emsp;&emsp;区</label>-->
104
+ <!-- <input type="text" class="input_search" style="width:60%" v-model="model.f_residential_arearea" style="width:60%"-->
105
+ <!-- condition="a.f_residential_area like '%{}%'" placeholder="小区"-->
106
+ <!-- :size="model.f_residential_arearea ? model.f_residential_arearea.length*2 : 8"/>-->
107
+ <!-- </div>-->
108
+
109
+ <div :class="$parent.$parent.style">
110
+ <label class="font_normal_body">地址&emsp;ID</label>
111
+ <input type="text" class="input_search" style="width:60%" v-model="model.id" style="width:60%"
112
+ condition="a.id = '{}'" placeholder="地址ID"
113
+ />
114
+ </div>
115
+ <div :class="$parent.$parent.style" >
116
+ <label class="font_normal_body">详细地址</label>
117
+ <input type="text" class="input_search" style="width:60%" v-model="model.f_address" style="width:60%"
118
+ condition="a.f_address like '%{}%'" placeholder="详细地址"
119
+ :size="model.f_address ? model.f_address.length*2 : 8"/>
120
+ </div>
121
+ <div :class="$parent.$parent.style" v-if="!$parent.$parent.$parent.showrightchange">
122
+ <label class="font_normal_body">街&emsp;&emsp;道</label>
123
+ <input type="text" class="input_search" style="width:60%" v-model="model.f_street"
124
+ condition="f_street like '%{}%'" placeholder="街道"
125
+ :size="model.f_street ? model.f_street.length*2 : 6"/>
126
+ </div>
127
+ <div :class="$parent.$parent.style" >
128
+ <label class="font_normal_body">地址状态</label>
129
+ <v-select :value.sync="model.f_address_state"
130
+ class="select_list select"
131
+ v-model="model.f_address_state"
132
+ condition="a.f_address_state = '{}'"
133
+ :options='$parent.$parent.getaddresstate' placeholder='地址状态'
134
+ close-on-select>
135
+ </v-select>
136
+ </div>
137
+ </div>
138
+ </div>
139
+ </criteria>
140
+ <data-grid :model="model" partial='list' style="overflow: auto" class="list_area table_sy" v-ref:grid>
141
+ <template partial='head'>
142
+ <tr>
143
+ <th><nobr>序号</nobr></th>
144
+ <th><nobr>用户编号</nobr></th>
145
+ <th><nobr>地址类型</nobr></th>
146
+ <th v-show="!$parent.$parent.$parent.$parent.useraddressShow"><nobr>区/县</nobr></th>
147
+ <th v-show="!$parent.$parent.$parent.$parent.useraddressShow"><nobr>片区</nobr></th>
148
+ <th><nobr>街道(乡/镇)</nobr></th>
149
+ <th><nobr>集收单位</nobr></th>
150
+ <th v-show="!$parent.$parent.$parent.$parent.useraddressShow"><nobr>楼号()</nobr></th>
151
+ <th v-show="!$parent.$parent.$parent.$parent.useraddressShow"><nobr>单元()</nobr></th>
152
+ <th v-show="!$parent.$parent.$parent.$parent.useraddressShow"><nobr>楼层</nobr></th>
153
+ <th v-show="!$parent.$parent.$parent.$parent.useraddressShow"><nobr>门牌号(号)</nobr></th>
154
+ <th><nobr>详细地址</nobr></th>
155
+ <th><nobr>地址状态</nobr></th>
156
+ <th><nobr>时间</nobr></th>
157
+ <th><nobr>操作</nobr></th>
158
+ </tr>
159
+ </template>
160
+ <template partial='body'>
161
+ <tr>
162
+ <td style="text-align:center"><nobr>{{$index + 1}}</nobr></td>
163
+ <td style="text-align:center"><nobr>{{row.f_userinfo_code}}</nobr></td>
164
+ <td style="text-align:center"><nobr>{{row.f_address_type}}</nobr></td>
165
+ <td v-show="!$parent.$parent.$parent.$parent.useraddressShow" style="text-align:center"><nobr>{{row.f_pcd}}</nobr></td>
166
+ <td v-show="!$parent.$parent.$parent.$parent.useraddressShow" style="text-align:center"><nobr>{{row.f_slice_area}}</nobr></td>
167
+ <td style="text-align:center"><nobr>{{row.f_street}}</nobr></td>
168
+ <td style="text-align:center"><nobr>{{row.f_residential_area}}</nobr></td>
169
+ <td v-show="!$parent.$parent.$parent.$parent.useraddressShow" style="text-align:center"><nobr>{{row.f_building}}{{row.f_building_suffix}}</nobr></td>
170
+ <td v-show="!$parent.$parent.$parent.$parent.useraddressShow" style="text-align:center"><nobr>{{row.f_unit}}{{row.f_unit_suffix}}</nobr></td>
171
+ <td v-show="!$parent.$parent.$parent.$parent.useraddressShow" style="text-align:center"><nobr>{{row.f_floor}}{{row.f_floor_suffix}}</nobr></td>
172
+ <td v-show="!$parent.$parent.$parent.$parent.useraddressShow" style="text-align:center"><nobr>{{row.f_room}}{{row.f_room_suffix}}</nobr></td>
173
+ <td style="text-align:center"><nobr>{{row.f_address}}</nobr></td>
174
+ <td style="text-align:center"><nobr>{{row.f_address_state}}</nobr></td>
175
+ <td style="text-align:center"><nobr>{{row.f_create_date}}</nobr></td>
176
+ <td style="text-align:center">
177
+ <!-- <button type="button" name="button" class="btn btn-link"
178
+ @click.stop="$parent.$parent.$parent.modify(row)">修改</button>-->
179
+ <button v-if="!row.f_useraddress_id" type="button" name="button" class="btn btn-danger"
180
+ style="padding: 5px 12px"
181
+ @click.stop="$parent.$parent.$parent.delete(row)">删除</button>
182
+ </td>
183
+ </tr>
184
+ </template>
185
+ <template partial='foot'></template>
186
+ </data-grid>
187
+ </criteria-paged>
188
+ </div>
189
+ <work-busy :is-busy='isbusy'></work-busy>
190
+ <modal :show.sync="showFile" width="480px" v-ref:modal backdrop="true">
191
+ <header slot="modal-header" class="modal-header">
192
+ <button type="button" class="close" @click="closeFile"><span>&times;</span></button>
193
+ <h4 class="modal-title">选择文件</h4>
194
+ </header>
195
+ <article slot="modal-body" class="modal-body">
196
+ <div class="form-group">
197
+ <file-upload class="my-file-uploader" name="useraddressUploadFile" action="rs/file/uploadFile" tagname="确定" multiple v-ref:file></file-upload>
198
+ </div>
199
+ </article>
200
+ <footer slot="modal-footer" class="modal-footer" style="display: none"></footer>
201
+ </modal>
202
+ </template>
203
+
204
+ <script>
205
+ import { PagedList } from 'vue-client'
206
+
207
+
208
+ let readyGen = async function (self) {
209
+ self.getfield = self.config.excelHeaders
210
+ }
211
+
212
+ export default {
213
+ data () {
214
+ return {
215
+ criteriaShow: false,
216
+ model: new PagedList('rs/sql/address_getAddress',20,{tablename: `'t_user_address'`,items: `'*'`,orderitem: `'f_create_date desc'`}),
217
+ config: {
218
+ // 导出列要和查询列相同
219
+ excelHeaders: {
220
+ 'f_user_name':'用户姓名',
221
+ 'f_userinfo_code':'用户编号',
222
+ 'id':'地址ID',
223
+ 'f_pcd':'区/县',
224
+ 'f_slice_area':'片区',
225
+ 'f_address_type':'地址类型',
226
+ 'f_street':'街道',
227
+ 'f_residential_area':'小区',
228
+ 'f_building':'楼号(乡/镇)',
229
+ 'f_unit':'单元(村)',
230
+ 'f_floor':'楼层(组)',
231
+ 'f_room':'门牌号(号)',
232
+ 'f_address':'详细地址',
233
+ 'f_address_state':'地址状态',
234
+ 'f_create_date':'时间'
235
+ },
236
+ },
237
+ isbusy:false,
238
+ addflag: false,
239
+ addtitle:'',
240
+ other: [],
241
+ footer: [],
242
+ getfield: {},
243
+ imptype:'',
244
+ // 公司下拉
245
+ curorgid: [this.$login.f.orgid],
246
+ f_orgid: '',
247
+ getaddresstype:[{label:'全部',value:''},{label:'城区',value:'城区'},{label:'农村',value:'农村'}],
248
+ //文件上传弹框
249
+ showFile: false,
250
+ showrightchange:true
251
+ }
252
+ },
253
+ title: '地址列表',
254
+ props:{
255
+ f_filialeids:{
256
+ type: String
257
+ },
258
+ style: {
259
+ type: String,
260
+ default: 'col-sm-2 '
261
+ }
262
+ },
263
+ ready(){
264
+ readyGen(this)
265
+ this.search()
266
+ },
267
+ methods: {
268
+ getotherfooter() {
269
+ // this.$refs.paged.$refs.cri.$refs.exports.otherData=[];
270
+ // this.$refs.paged.$refs.cri.$refs.exports.footerData=[];
271
+ this.other = [];
272
+ this.footer = [];
273
+ // let exportdata = this.getCondition;
274
+ let otherInData = [];
275
+ otherInData.push(`导出时间: ${this.$login.toStandardTimeString()}`);
276
+ let footerData = [], exportfield = this.getfield;
277
+ footerData.push("合计");
278
+ let self = this;
279
+ for (var field in self.sumsmodel) {
280
+ footerData.push(`${exportfield[field]}合计:${self.sumsmodel[field]}`);
281
+ }
282
+ this.footer.push(footerData);
283
+ this.other.push(otherInData);
284
+ },
285
+ hidden() {
286
+ this.criteriaShow = !this.criteriaShow
287
+ },
288
+ //添加方法
289
+ add(val){
290
+ if (this.f_filialeids) {
291
+ this.$refs.paged.$refs.grid.selectStore.selected = null
292
+ this.$dispatch('add',val)
293
+ this.showrightchange = false;
294
+ } else {
295
+ this.$showAlert('请先选择左上角的所在分公司', 'warning', 2000)
296
+ }
297
+ },
298
+ importAddress(val){
299
+ this.imptype = val
300
+ this.showFile = true
301
+ },
302
+ // 关闭文件上传对话框
303
+ closeFile() {
304
+ this.showFile = false
305
+ // 将选的文件清空
306
+ this.$refs.file.$el.querySelector('input').value = ''
307
+ },
308
+ //修改
309
+ modify(val){
310
+ this.$refs.paged.$refs.grid.selectStore.selected = null
311
+ this.$dispatch('modify',val)
312
+ },
313
+ async delete(row){
314
+ if(row.id){
315
+ var id = row.id
316
+ let userfiles = await this.$resetpost('rs/sql/address_singleTable', {data: {items: 'f_useraddress_id',tablename: 't_userfiles',condition: `f_useraddress_id='${id}' and f_table_state = '正常'`}},{resolveMsg: null, rejectMsg: null})
317
+ if(userfiles.data.length){
318
+ this.$showAlert('该地址下已有正常表具档案,无法删除!','warning',1000)
319
+ }else{
320
+ this.$resetdelete('rs/entity/t_user_address', {id: id}, {resolveMsg: '删除成功', rejectMsg: '删除失败'}).then((res) => {
321
+ this.$dispatch('cancel')
322
+ })
323
+ }
324
+ }
325
+ },
326
+
327
+ search () {
328
+ this.$refs.paged.$refs.cri.search()
329
+ },
330
+
331
+ selfSearch (args) {
332
+
333
+ if (!this.f_orgid) {
334
+ this.getorg([this.$login.f.orgid])
335
+ }
336
+
337
+ args.condition = `${args.condition} and a.f_filialeid = '${this.f_filialeids}'`
338
+ this.model.search(args.condition, args.model)
339
+ },
340
+
341
+ //清空
342
+ clear(){
343
+ this.$refs.paged.$refs.cri.model = {}
344
+ },
345
+ getorg (val) {
346
+ this.f_orgid = this.$login.convertToIn(val)
347
+ this.f_filialeids = val[0]
348
+ }
349
+ },
350
+ events: {
351
+ onFileUpload: async function (file, res) {
352
+ this.isbusy = true
353
+ console.log("上传完毕"+JSON.stringify(res))
354
+ let data = {
355
+ filepath: res.f_downloadpath,
356
+ user:this.$login.f,
357
+ type :this.imptype
358
+ }
359
+ console.log("filepath="+JSON.stringify(data))
360
+ await this.$resetpost(`rs/logic/address_useraddressimport`,data, {resolveMsg: null, rejectMsg: '导入失败', silent: true}, 0).then((res)=>{
361
+ this.isbusy = false
362
+ if(res.data.type=="success"){
363
+ this.$showAlert("导入信息:"+res.data.msg, res.data.type, 2000);
364
+ }else{
365
+ this.$showMessage(res.data.msg);
366
+ }
367
+ //关闭上传框
368
+ this.closeFile()
369
+ //重新查询
370
+ this.init()
371
+ }).catch(error=>{
372
+ this.isbusy = false
373
+ })
374
+ },
375
+ 'onFileError'(error) {
376
+ this.$showAlert(error, 'warning', 2000)
377
+ }
378
+ },
379
+ computed: {
380
+ //地址状态下拉框
381
+ getaddresstate() {
382
+ return [{label: '全部', value: ''}, ...this.$appdata.getParam('地址状态')]
383
+ },
384
+ getCondition() {
385
+ return {
386
+ condition: `${this.$refs.paged.$refs.cri.condition}` + `and a.f_filialeid = '${this.f_filialeids}'`}
387
+ }
388
+ }
389
+
390
+ }
391
+ </script>