address-client 3.0.24-72 → 3.0.24-76

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