address-client 3.0.26-aode → 3.0.27-aode

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.
@@ -0,0 +1,13 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <module external.linked.project.id="AddressClient" external.linked.project.path="$MODULE_DIR$" external.root.project.path="$MODULE_DIR$" external.system.id="GRADLE" external.system.module.group="" external.system.module.version="3.0.11" type="JAVA_MODULE" version="4">
3
+ <component name="NewModuleRootManager" inherit-compiler-output="true">
4
+ <exclude-output />
5
+ <content url="file://$MODULE_DIR$">
6
+ <excludeFolder url="file://$MODULE_DIR$/.gradle" />
7
+ <excludeFolder url="file://$MODULE_DIR$/build" />
8
+ <excludeFolder url="file://$MODULE_DIR$/out" />
9
+ </content>
10
+ <orderEntry type="inheritedJdk" />
11
+ <orderEntry type="sourceFolder" forTests="false" />
12
+ </component>
13
+ </module>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "address-client",
3
- "version": "3.0.26-aode",
3
+ "version": "3.0.27-aode",
4
4
  "description": "地址管理前台组件",
5
5
  "author": "wanbochao",
6
6
  "license": "ISC",
@@ -1,307 +1,307 @@
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
- <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>
45
- </div>
46
- </div>
47
- <div class="row" v-show="$parent.$parent.criteriaShow">
48
- <div :class="$parent.$parent.style" v-if="!$parent.$parent.showrightchange">
49
- <label class="font_normal_body">用户编号</label>
50
- <input type="text" class="input_search" style="width:60%" v-model="model.f_userinfo_code" style="width:60%"
51
- condition="f_userinfo_code = '{}'" placeholder="用户编号"/>
52
- </div>
53
- <div v-if="!$parent.$parent.showrightchange" :class="$parent.$parent.style">
54
- <label class="font_normal_body">小&emsp;&emsp;区</label>
55
- <input type="text" class="input_search" style="width:60%" v-model="model.f_residential_arearea" style="width:60%"
56
- condition="a.f_residential_area like '%{}%'" placeholder="小区"
57
- :size="model.f_residential_arearea ? model.f_residential_arearea.length*2 : 8"/>
58
- </div>
59
- <div :class="$parent.$parent.style" v-if="!$parent.$parent.$parent.showrightchange">
60
- <label class="font_normal_body">楼&emsp;&emsp;号</label>
61
- <input type="text" class="input_search" style="width:60%" v-model="model.f_building" style="width:60%"
62
- condition="a.f_building like '{}'" placeholder="楼号"
63
- :size="model.f_building ? model.f_building.length*2 : 6"/>
64
- </div>
65
- <div :class="$parent.$parent.style" >
66
- <label class="font_normal_body">单&emsp;&emsp;元</label>
67
- <input type="text" class="input_search" style="width:60%" v-model="model.f_unit" style="width:60%"
68
- condition="a.f_unit like '{}'" placeholder="单元"
69
- :size="model.f_unit ? model.f_unit.length*2 : 6"/>
70
- </div>
71
- <div :class="$parent.$parent.style">
72
- <label class="font_normal_body">楼&emsp;&emsp;层</label>
73
- <input type="text" class="input_search" style="width:60%" v-model="model.f_floor" style="width:60%"
74
- condition="a.f_floor like '{}'" placeholder="楼层"
75
- :size="model.f_floor ? model.f_floor.length*2 : 6"/>
76
- </div>
77
- <div :class="$parent.$parent.style">
78
- <label class="font_normal_body">门&ensp;牌&ensp;号</label>
79
- <input type="text" class="input_search" style="width:60%" v-model="model.f_room" style="width:60%"
80
- condition="a.f_room like '%{}%'" placeholder="门牌号"
81
- :size="model.f_room ? model.f_room.length*2 : 6"/>
82
- </div>
83
- <div :class="$parent.$parent.style">
84
- <label class="font_normal_body">地址&emsp;ID</label>
85
- <input type="text" class="input_search" style="width:60%" v-model="model.id" style="width:60%"
86
- condition="a.id = '{}'" placeholder="地址ID"
87
- />
88
- </div>
89
- <div :class="$parent.$parent.style" >
90
- <label class="font_normal_body">详细地址</label>
91
- <input type="text" class="input_search" style="width:60%" v-model="model.f_address" style="width:60%"
92
- condition="a.f_address like '%{}%'" placeholder="详细地址"
93
- :size="model.f_address ? model.f_address.length*2 : 8"/>
94
- </div>
95
- <div :class="$parent.$parent.style" >
96
- <label class="font_normal_body">特殊地址</label>
97
- <v-select :value.sync="model.f_special"
98
- v-model="model.f_special"
99
- :options='$parent.$parent.specialoptions' placeholder='请选择'
100
- condition=" {} "
101
- close-on-select></v-select>
102
- </div>
103
-
104
- </div>
105
- </div>
106
- </criteria>
107
- <data-grid :model="model" partial='list' style="overflow: auto" class="list_area table_sy" v-ref:grid>
108
- <template partial='head'>
109
- <tr>
110
- <th><nobr>序号</nobr></th>
111
- <th><nobr>用户编号</nobr></th>
112
- <th><nobr>区/县</nobr></th>
113
- <th><nobr>片区</nobr></th>
114
- <th><nobr>街道</nobr></th>
115
- <th><nobr>小区(单位)</nobr></th>
116
- <th><nobr>楼号</nobr></th>
117
- <th><nobr>单元</nobr></th>
118
- <th><nobr>楼层</nobr></th>
119
- <th><nobr>门牌号</nobr></th>
120
- <th><nobr>详细地址</nobr></th>
121
- <th><nobr>时间</nobr></th>
122
- <th><nobr>操作</nobr></th>
123
- </tr>
124
- </template>
125
- <template partial='body'>
126
- <tr>
127
- <td style="text-align:center"><nobr>{{$index + 1}}</nobr></td>
128
- <td style="text-align:center"><nobr>{{row.f_userinfo_code}}</nobr></td>
129
- <td style="text-align:center"><nobr>{{row.f_pcd}}</nobr></td>
130
- <td style="text-align:center"><nobr>{{row.f_slice_area}}</nobr></td>
131
- <td style="text-align:center"><nobr>{{row.f_street}}</nobr></td>
132
- <td style="text-align:center"><nobr>{{row.f_residential_area}}</nobr></td>
133
- <td style="text-align:center"><nobr>{{row.f_building}}{{row.f_building_suffix}}</nobr></td>
134
- <td style="text-align:center"><nobr>{{row.f_unit}}{{row.f_unit_suffix}}</nobr></td>
135
- <td style="text-align:center"><nobr>{{row.f_floor}}{{row.f_floor_suffix}}</nobr></td>
136
- <td style="text-align:center"><nobr>{{row.f_room}}{{row.f_room_suffix}}</nobr></td>
137
- <td style="text-align:center"><nobr>{{row.f_address}}</nobr></td>
138
- <td style="text-align:center"><nobr>{{row.f_create_date}}</nobr></td>
139
- <td style="text-align:center">
140
- <!-- <button type="button" name="button" class="btn btn-link"
141
- @click.stop="$parent.$parent.$parent.modify(row)">修改</button>-->
142
- <button type="button" name="button" class="btn btn-link"
143
- @click.stop="$parent.$parent.$parent.delete(row)">删除</button>
144
- </td>
145
- </tr>
146
- </template>
147
- <template partial='foot'></template>
148
- </data-grid>
149
- </criteria-paged>
150
- </div>
151
- <modal :show.sync="showFile" v-ref:modal backdrop="true">
152
- <header slot="modal-header" class="modal-header">
153
- <button type="button" class="close" @click="closeFile"><span>&times;</span></button>
154
- <h4 class="modal-title">选择文件</h4>
155
- </header>
156
- <article slot="modal-body" class="modal-body">
157
- <div class="form-group">
158
- <file-upload class="my-file-uploader" name="useraddressUploadFile" action="rs/file/uploadFile" tagname="确定" multiple v-ref:file></file-upload>
159
- </div>
160
- </article>
161
- <footer slot="modal-footer" class="modal-footer"></footer>
162
- </modal>
163
- <work-busy :is-busy="iswork" v-show="iswork"></work-busy>
164
-
165
- </template>
166
-
167
- <script>
168
- import { PagedList } from 'vue-client'
169
-
170
- export default {
171
- data () {
172
- return {
173
- iswork: false,
174
- criteriaShow: false,
175
- model: new PagedList('rs/sql/address_getAddress',20,{tablename: `'t_user_address'`,items: `'*'`,orderitem: `'id desc'`}),
176
- addflag: false,
177
- addtitle:'',
178
-
179
- // 公司下拉
180
- curorgid: [this.$login.f.orgid],
181
- f_orgid: '',
182
-
183
- //文件上传弹框
184
- showFile: false,
185
- showrightchange:true,
186
- specialoptions:[{label:"全部",value:""},{label:"是",value:"a.f_special ='1'"},{label:"否",value:"a.f_special is null"}]
187
- }
188
- },
189
- title: '地址列表',
190
- props:{
191
- f_filialeids:{
192
- type: String
193
- },
194
- style: {
195
- type: String,
196
- default: 'col-sm-2 '
197
- }
198
- },
199
- ready(){
200
- this.search()
201
- },
202
- methods: {
203
- hidden() {
204
- this.criteriaShow = !this.criteriaShow
205
- },
206
- //添加方法
207
- add(val){
208
- if (this.f_filialeids) {
209
- this.$refs.paged.$refs.grid.selectStore.selected = null
210
- this.$dispatch('add',val)
211
- this.showrightchange = false;
212
- } else {
213
- this.$showAlert('请先选择左上角的所在分公司', 'warning', 2000)
214
- }
215
- },
216
- importAddress(){
217
- this.showFile = true
218
- },
219
- // 关闭文件上传对话框
220
- closeFile() {
221
- this.showFile = false
222
- // 将选的文件清空
223
- this.$refs.file.$el.querySelector('input').value = ''
224
- },
225
- //修改
226
- modify(val){
227
- this.$refs.paged.$refs.grid.selectStore.selected = null
228
- this.$dispatch('modify',val)
229
- },
230
- async delete(row){
231
-
232
- if(row.id){
233
- var id = row.id
234
- 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 in ('正常','待开通')`}},{resolveMsg: null, rejectMsg: null})
235
- let isdelete = await this.$resetpost('rs/sql/isDeleteAddress', {data: {f_addressid: id}},{resolveMsg: null, rejectMsg: null})
236
- if(userfiles.data.length){
237
- this.$showAlert('该地址下已有正常/待开通表具档案,无法删除!','warning',1000)
238
- return
239
- }
240
- if(isdelete.data.length){
241
- this.$showAlert('该地址下已有正在工作的置换单,无法删除!','warning',1000)
242
- return
243
- }
244
- this.$resetdelete('rs/entity/t_user_address', {id: id}, {resolveMsg: '删除成功', rejectMsg: '删除失败'}).then((res) => {
245
- this.$dispatch('cancel')
246
- })
247
- }
248
- },
249
-
250
- search () {
251
- this.$refs.paged.$refs.cri.search()
252
- },
253
-
254
- selfSearch (args) {
255
- debugger
256
- //去除空格
257
- for(let key in args.model){
258
- if(args.model[key] instanceof String){
259
- args.model[key] = args.model[key].trim();
260
- }
261
- }
262
- if (!this.f_orgid) {
263
- this.getorg([this.$login.f.orgid])
264
- }
265
- console.log("xxx"+this.f_filialeids)
266
- args.condition = `${args.condition} and a.f_filialeid = '${this.f_filialeids}'`
267
- this.model.search(args.condition, args.model)
268
- },
269
-
270
- //清空
271
- clear(){
272
- this.$refs.paged.$refs.cri.model = {}
273
- },
274
- getorg (val) {
275
- this.f_orgid = this.$login.convertToIn(val)
276
- if (!this.f_orgid) {
277
- this.f_orgid = this.f_filialeids
278
- }
279
- this.f_filialeids = val[0]
280
- }
281
- },
282
- events: {
283
- onFileUpload: async function (file, res) {
284
- this.$showAlert('文件上传成功','success',1000);
285
- this.iswork = true
286
- console.log("上传完毕"+JSON.stringify(res))
287
- let data = {
288
- filepath: res.f_downloadpath,
289
- user:this.$login.f
290
- }
291
- this.closeFile();
292
- try{
293
- await this.$resetpost(`rs/logic/address_useraddressimport`,data, {resolveMsg: null, rejectMsg: '导入失败', silent: true}, 0).then((res)=>{
294
- this.$showAlert("导入成功",'success', 2000);
295
- this.iswork = false
296
- this.init()
297
- })
298
- }catch(e){
299
- }
300
- },
301
- 'onFileError'(error) {
302
- this.$showAlert(error, 'warning', 2000)
303
- }
304
- }
305
-
306
- }
307
- </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
+ <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>
45
+ </div>
46
+ </div>
47
+ <div class="row" v-show="$parent.$parent.criteriaShow">
48
+ <div :class="$parent.$parent.style" v-if="!$parent.$parent.showrightchange">
49
+ <label class="font_normal_body">用户编号</label>
50
+ <input type="text" class="input_search" style="width:60%" v-model="model.f_userinfo_code" style="width:60%"
51
+ condition="f_userinfo_code = '{}'" placeholder="用户编号"/>
52
+ </div>
53
+ <div v-if="!$parent.$parent.showrightchange" :class="$parent.$parent.style">
54
+ <label class="font_normal_body">小&emsp;&emsp;区</label>
55
+ <input type="text" class="input_search" style="width:60%" v-model="model.f_residential_arearea" style="width:60%"
56
+ condition="a.f_residential_area like '%{}%'" placeholder="小区"
57
+ :size="model.f_residential_arearea ? model.f_residential_arearea.length*2 : 8"/>
58
+ </div>
59
+ <div :class="$parent.$parent.style" v-if="!$parent.$parent.$parent.showrightchange">
60
+ <label class="font_normal_body">楼&emsp;&emsp;号</label>
61
+ <input type="text" class="input_search" style="width:60%" v-model="model.f_building" style="width:60%"
62
+ condition="a.f_building like '%{}%'" placeholder="楼号"
63
+ :size="model.f_building ? model.f_building.length*2 : 6"/>
64
+ </div>
65
+ <div :class="$parent.$parent.style" >
66
+ <label class="font_normal_body">单&emsp;&emsp;元</label>
67
+ <input type="text" class="input_search" style="width:60%" v-model="model.f_unit" style="width:60%"
68
+ condition="a.f_unit like '%{}%'" placeholder="单元"
69
+ :size="model.f_unit ? model.f_unit.length*2 : 6"/>
70
+ </div>
71
+ <div :class="$parent.$parent.style">
72
+ <label class="font_normal_body">楼&emsp;&emsp;层</label>
73
+ <input type="text" class="input_search" style="width:60%" v-model="model.f_floor" style="width:60%"
74
+ condition="a.f_floor like '%{}%'" placeholder="楼层"
75
+ :size="model.f_floor ? model.f_floor.length*2 : 6"/>
76
+ </div>
77
+ <div :class="$parent.$parent.style">
78
+ <label class="font_normal_body">门&ensp;牌&ensp;号</label>
79
+ <input type="text" class="input_search" style="width:60%" v-model="model.f_room" style="width:60%"
80
+ condition="a.f_room like '%{}%'" placeholder="门牌号"
81
+ :size="model.f_room ? model.f_room.length*2 : 6"/>
82
+ </div>
83
+ <div :class="$parent.$parent.style">
84
+ <label class="font_normal_body">地址&emsp;ID</label>
85
+ <input type="text" class="input_search" style="width:60%" v-model="model.id" style="width:60%"
86
+ condition="a.id = '%{}%'" placeholder="地址ID"
87
+ />
88
+ </div>
89
+ <div :class="$parent.$parent.style" >
90
+ <label class="font_normal_body">详细地址</label>
91
+ <input type="text" class="input_search" style="width:60%" v-model="model.f_address" style="width:60%"
92
+ condition="a.f_address like '%{}%'" placeholder="详细地址"
93
+ :size="model.f_address ? model.f_address.length*2 : 8"/>
94
+ </div>
95
+ <div :class="$parent.$parent.style" >
96
+ <label class="font_normal_body">特殊地址</label>
97
+ <v-select :value.sync="model.f_special"
98
+ v-model="model.f_special"
99
+ :options='$parent.$parent.specialoptions' placeholder='请选择'
100
+ condition=" {} "
101
+ close-on-select></v-select>
102
+ </div>
103
+
104
+ </div>
105
+ </div>
106
+ </criteria>
107
+ <data-grid :model="model" partial='list' style="overflow: auto" class="list_area table_sy" v-ref:grid>
108
+ <template partial='head'>
109
+ <tr>
110
+ <th><nobr>序号</nobr></th>
111
+ <th><nobr>用户编号</nobr></th>
112
+ <th><nobr>区/县</nobr></th>
113
+ <th><nobr>片区</nobr></th>
114
+ <th><nobr>街道</nobr></th>
115
+ <th><nobr>小区(单位)</nobr></th>
116
+ <th><nobr>楼号</nobr></th>
117
+ <th><nobr>单元</nobr></th>
118
+ <th><nobr>楼层</nobr></th>
119
+ <th><nobr>门牌号</nobr></th>
120
+ <th><nobr>详细地址</nobr></th>
121
+ <th><nobr>时间</nobr></th>
122
+ <th><nobr>操作</nobr></th>
123
+ </tr>
124
+ </template>
125
+ <template partial='body'>
126
+ <tr>
127
+ <td style="text-align:center"><nobr>{{$index + 1}}</nobr></td>
128
+ <td style="text-align:center"><nobr>{{row.f_userinfo_code}}</nobr></td>
129
+ <td style="text-align:center"><nobr>{{row.f_pcd}}</nobr></td>
130
+ <td style="text-align:center"><nobr>{{row.f_slice_area}}</nobr></td>
131
+ <td style="text-align:center"><nobr>{{row.f_street}}</nobr></td>
132
+ <td style="text-align:center"><nobr>{{row.f_residential_area}}</nobr></td>
133
+ <td style="text-align:center"><nobr>{{row.f_building}}{{row.f_building_suffix}}</nobr></td>
134
+ <td style="text-align:center"><nobr>{{row.f_unit}}{{row.f_unit_suffix}}</nobr></td>
135
+ <td style="text-align:center"><nobr>{{row.f_floor}}{{row.f_floor_suffix}}</nobr></td>
136
+ <td style="text-align:center"><nobr>{{row.f_room}}{{row.f_room_suffix}}</nobr></td>
137
+ <td style="text-align:center"><nobr>{{row.f_address}}</nobr></td>
138
+ <td style="text-align:center"><nobr>{{row.f_create_date}}</nobr></td>
139
+ <td style="text-align:center">
140
+ <!-- <button type="button" name="button" class="btn btn-link"
141
+ @click.stop="$parent.$parent.$parent.modify(row)">修改</button>-->
142
+ <button type="button" name="button" class="btn btn-link"
143
+ @click.stop="$parent.$parent.$parent.delete(row)">删除</button>
144
+ </td>
145
+ </tr>
146
+ </template>
147
+ <template partial='foot'></template>
148
+ </data-grid>
149
+ </criteria-paged>
150
+ </div>
151
+ <modal :show.sync="showFile" v-ref:modal backdrop="true">
152
+ <header slot="modal-header" class="modal-header">
153
+ <button type="button" class="close" @click="closeFile"><span>&times;</span></button>
154
+ <h4 class="modal-title">选择文件</h4>
155
+ </header>
156
+ <article slot="modal-body" class="modal-body">
157
+ <div class="form-group">
158
+ <file-upload class="my-file-uploader" name="useraddressUploadFile" action="rs/file/uploadFile" tagname="确定" multiple v-ref:file></file-upload>
159
+ </div>
160
+ </article>
161
+ <footer slot="modal-footer" class="modal-footer"></footer>
162
+ </modal>
163
+ <work-busy :is-busy="iswork" v-show="iswork"></work-busy>
164
+
165
+ </template>
166
+
167
+ <script>
168
+ import { PagedList } from 'vue-client'
169
+
170
+ export default {
171
+ data () {
172
+ return {
173
+ iswork: false,
174
+ criteriaShow: false,
175
+ model: new PagedList('rs/sql/address_getAddress',20,{tablename: `'t_user_address'`,items: `'*'`,orderitem: `'id desc'`}),
176
+ addflag: false,
177
+ addtitle:'',
178
+
179
+ // 公司下拉
180
+ curorgid: [this.$login.f.orgid],
181
+ f_orgid: '',
182
+
183
+ //文件上传弹框
184
+ showFile: false,
185
+ showrightchange:true,
186
+ specialoptions:[{label:"全部",value:""},{label:"是",value:"a.f_special ='1'"},{label:"否",value:"a.f_special is null"}]
187
+ }
188
+ },
189
+ title: '地址列表',
190
+ props:{
191
+ f_filialeids:{
192
+ type: String
193
+ },
194
+ style: {
195
+ type: String,
196
+ default: 'col-sm-2 '
197
+ }
198
+ },
199
+ ready(){
200
+ this.search()
201
+ },
202
+ methods: {
203
+ hidden() {
204
+ this.criteriaShow = !this.criteriaShow
205
+ },
206
+ //添加方法
207
+ add(val){
208
+ if (this.f_filialeids) {
209
+ this.$refs.paged.$refs.grid.selectStore.selected = null
210
+ this.$dispatch('add',val)
211
+ this.showrightchange = false;
212
+ } else {
213
+ this.$showAlert('请先选择左上角的所在分公司', 'warning', 2000)
214
+ }
215
+ },
216
+ importAddress(){
217
+ this.showFile = true
218
+ },
219
+ // 关闭文件上传对话框
220
+ closeFile() {
221
+ this.showFile = false
222
+ // 将选的文件清空
223
+ this.$refs.file.$el.querySelector('input').value = ''
224
+ },
225
+ //修改
226
+ modify(val){
227
+ this.$refs.paged.$refs.grid.selectStore.selected = null
228
+ this.$dispatch('modify',val)
229
+ },
230
+ async delete(row){
231
+
232
+ if(row.id){
233
+ var id = row.id
234
+ 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 in ('正常','待开通')`}},{resolveMsg: null, rejectMsg: null})
235
+ let isdelete = await this.$resetpost('rs/sql/isDeleteAddress', {data: {f_addressid: id}},{resolveMsg: null, rejectMsg: null})
236
+ if(userfiles.data.length){
237
+ this.$showAlert('该地址下已有正常/待开通表具档案,无法删除!','warning',1000)
238
+ return
239
+ }
240
+ if(isdelete.data.length){
241
+ this.$showAlert('该地址下已有正在工作的置换单,无法删除!','warning',1000)
242
+ return
243
+ }
244
+ this.$resetdelete('rs/entity/t_user_address', {id: id}, {resolveMsg: '删除成功', rejectMsg: '删除失败'}).then((res) => {
245
+ this.$dispatch('cancel')
246
+ })
247
+ }
248
+ },
249
+
250
+ search () {
251
+ this.$refs.paged.$refs.cri.search()
252
+ },
253
+
254
+ selfSearch (args) {
255
+ debugger
256
+ //去除空格
257
+ for(let key in args.model){
258
+ if(args.model[key] instanceof String){
259
+ args.model[key] = args.model[key].trim();
260
+ }
261
+ }
262
+ if (!this.f_orgid) {
263
+ this.getorg([this.$login.f.orgid])
264
+ }
265
+ console.log("xxx"+this.f_filialeids)
266
+ args.condition = `${args.condition} and a.f_filialeid = '${this.f_filialeids}'`
267
+ this.model.search(args.condition, args.model)
268
+ },
269
+
270
+ //清空
271
+ clear(){
272
+ this.$refs.paged.$refs.cri.model = {}
273
+ },
274
+ getorg (val) {
275
+ this.f_orgid = this.$login.convertToIn(val)
276
+ if (!this.f_orgid) {
277
+ this.f_orgid = this.f_filialeids
278
+ }
279
+ this.f_filialeids = val[0]
280
+ }
281
+ },
282
+ events: {
283
+ onFileUpload: async function (file, res) {
284
+ this.$showAlert('文件上传成功','success',1000);
285
+ this.iswork = true
286
+ console.log("上传完毕"+JSON.stringify(res))
287
+ let data = {
288
+ filepath: res.f_downloadpath,
289
+ user:this.$login.f
290
+ }
291
+ this.closeFile();
292
+ try{
293
+ await this.$resetpost(`rs/logic/address_useraddressimport`,data, {resolveMsg: null, rejectMsg: '导入失败', silent: true}, 0).then((res)=>{
294
+ this.$showAlert("导入成功",'success', 2000);
295
+ this.iswork = false
296
+ this.init()
297
+ })
298
+ }catch(e){
299
+ }
300
+ },
301
+ 'onFileError'(error) {
302
+ this.$showAlert(error, 'warning', 2000)
303
+ }
304
+ }
305
+
306
+ }
307
+ </script>