address-client 3.2.111 → 4.0.1

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.
Files changed (143) hide show
  1. package/.gradle/buildOutputCleanup/cache.properties +2 -2
  2. package/CHANGELOG.md +15 -15
  3. package/build/dev-server.js +185 -185
  4. package/build/versionCheck.js +31 -31
  5. package/build/webpack.base.conf.js +82 -82
  6. package/examples/showAdd/App.vue +40 -40
  7. package/index.html +44 -44
  8. package/package.json +101 -101
  9. package/src/address.js +74 -74
  10. package/src/components/AddAreaMsg.vue +757 -757
  11. package/src/components/AddCommunityManageMsg.vue +220 -220
  12. package/src/components/AddStreetManageMsg.vue +204 -204
  13. package/src/components/AddStreetOrPcd.vue +316 -316
  14. package/src/components/AddressAddAddress.vue +479 -479
  15. package/src/components/AddressFiles.vue +156 -156
  16. package/src/components/AddressList.vue +637 -637
  17. package/src/components/AddressListLiuLi.vue +17 -17
  18. package/src/components/AddressManage.vue +117 -117
  19. package/src/components/AddressTree.vue +501 -501
  20. package/src/components/AreaFiles.vue +73 -73
  21. package/src/components/AreaList.vue +410 -410
  22. package/src/components/AreaManage.vue +104 -104
  23. package/src/components/AreaTree.vue +508 -508
  24. package/src/components/Basch.vue +72 -72
  25. package/src/components/BatchOrders.vue +328 -328
  26. package/src/components/BuildingList.vue +129 -129
  27. package/src/components/CityList.vue +134 -134
  28. package/src/components/CityManage.vue +76 -76
  29. package/src/components/CommunityAreaList.vue +87 -87
  30. package/src/components/CommunityManage.vue +78 -78
  31. package/src/components/CommunityManageList.vue +244 -244
  32. package/src/components/NewAddressInfo.vue +432 -432
  33. package/src/components/StreetList.vue +241 -241
  34. package/src/components/StreetManage.vue +68 -68
  35. package/src/components/StreetManageList.vue +225 -225
  36. package/src/components/UserAddress.vue +907 -908
  37. package/src/components/UserAddressChange.vue +58 -58
  38. package/src/components/selectAddress/BatchList.vue +326 -326
  39. package/src/filiale/WEINAN/AddAreaMsg.vue +745 -745
  40. package/src/filiale/WEINAN/AddressList.vue +588 -588
  41. package/src/filiale/WEINAN/AddressManage.vue +122 -122
  42. package/src/filiale/WEINAN/AreaList.vue +435 -435
  43. package/src/filiale/WEINAN/AreaManage.vue +109 -109
  44. package/src/filiale/WEINAN/AreaUserList.vue +226 -226
  45. package/src/filiale/WEINAN/UserAddress.vue +783 -783
  46. package/src/filiale/WEINAN/sale.js +18 -18
  47. package/src/filiale/chengtou/UserAddress.vue +894 -894
  48. package/src/filiale/chengtou/sale.js +7 -7
  49. package/src/filiale/dongguan/AddStreetOrPcd.vue +422 -422
  50. package/src/filiale/dongguan/sale.js +7 -7
  51. package/src/filiale/gaomi/AddressList.vue +430 -430
  52. package/src/filiale/gaomi/UserAddress.vue +832 -832
  53. package/src/filiale/gaomi/sale.js +14 -14
  54. package/src/filiale/gongyi/AddAreaMsg.vue +651 -651
  55. package/src/filiale/gongyi/AreaManage.vue +100 -100
  56. package/src/filiale/gongyi/UserAddress.vue +751 -751
  57. package/src/filiale/gongyi/sale.js +14 -14
  58. package/src/filiale/haile/AddressList.vue +615 -615
  59. package/src/filiale/haile/sale.js +8 -8
  60. package/src/filiale/jingwei/UserAddress.vue +764 -764
  61. package/src/filiale/jingwei/sale.js +12 -12
  62. package/src/filiale/lixianV3/AreaList.vue +416 -416
  63. package/src/filiale/lixianV3/sale.js +12 -12
  64. package/src/filiale/macheng/AddAreaMsg.vue +635 -635
  65. package/src/filiale/macheng/AddStreetOrPcd.vue +231 -231
  66. package/src/filiale/macheng/AddressList.vue +613 -613
  67. package/src/filiale/macheng/AreaList.vue +318 -318
  68. package/src/filiale/macheng/CityManage.vue +76 -76
  69. package/src/filiale/macheng/StreetList.vue +186 -186
  70. package/src/filiale/macheng/UserAddress.vue +743 -743
  71. package/src/filiale/macheng/sale.js +17 -17
  72. package/src/filiale/meihekou/UserAddress.vue +898 -898
  73. package/src/filiale/meihekou/sale.js +8 -8
  74. package/src/filiale/qianneng/AddAreaMsg.vue +755 -755
  75. package/src/filiale/qianneng/AddStreetOrPcd.vue +328 -328
  76. package/src/filiale/qianneng/AddressList.vue +638 -638
  77. package/src/filiale/qianneng/AreaList.vue +431 -431
  78. package/src/filiale/qianneng/CityManage.vue +81 -81
  79. package/src/filiale/qianneng/UserAddress.vue +1125 -1125
  80. package/src/filiale/qianneng/sale.js +20 -20
  81. package/src/filiale/qinhua/AddAreaMsg.vue +743 -743
  82. package/src/filiale/qinhua/AddressList.vue +627 -627
  83. package/src/filiale/qinhua/AddressManage.vue +117 -117
  84. package/src/filiale/qinhua/AreaList.vue +425 -425
  85. package/src/filiale/qinhua/AreaManage.vue +100 -100
  86. package/src/filiale/qinhua/CityManage.vue +76 -76
  87. package/src/filiale/qinhua/StreetList.vue +241 -241
  88. package/src/filiale/qinhua/UserAddress.vue +894 -894
  89. package/src/filiale/qinhua/sale.js +20 -20
  90. package/src/filiale/rizhao/UserAddress.vue +897 -897
  91. package/src/filiale/rizhao/sale.js +8 -8
  92. package/src/filiale/rongcheng/AddressList.vue +363 -363
  93. package/src/filiale/rongcheng/UserAddress.vue +799 -799
  94. package/src/filiale/rongcheng/sale.js +11 -11
  95. package/src/filiale/shanggao/AddAreaMsg.vue +752 -752
  96. package/src/filiale/shanggao/AddStreetOrPcd.vue +312 -312
  97. package/src/filiale/shanggao/AddressList.vue +613 -613
  98. package/src/filiale/shanggao/AreaList.vue +436 -436
  99. package/src/filiale/shanggao/BuildingList.vue +129 -129
  100. package/src/filiale/shanggao/StreetList.vue +240 -240
  101. package/src/filiale/shanggao/UserAddress.vue +953 -953
  102. package/src/filiale/shanggao/sale.js +16 -16
  103. package/src/filiale/shanxian/AddAreaMsg.vue +766 -766
  104. package/src/filiale/shanxian/AddressList.vue +658 -658
  105. package/src/filiale/shanxian/AreaList.vue +458 -458
  106. package/src/filiale/shanxian/AreaManage.vue +107 -107
  107. package/src/filiale/shanxian/UserAddress.vue +900 -900
  108. package/src/filiale/shanxian/sale.js +15 -15
  109. package/src/filiale/shaoguan/AddAreaMsg.vue +629 -629
  110. package/src/filiale/shaoguan/UserAddress.vue +762 -762
  111. package/src/filiale/shaoguan/sale.js +11 -11
  112. package/src/filiale/tongchuan/AddAreaMsg.vue +635 -635
  113. package/src/filiale/tongchuan/AddStreetOrPcd.vue +351 -351
  114. package/src/filiale/tongchuan/AddressList.vue +379 -379
  115. package/src/filiale/tongchuan/AreaList.vue +315 -315
  116. package/src/filiale/tongchuan/AreaManage.vue +100 -100
  117. package/src/filiale/tongchuan/CityList.vue +133 -133
  118. package/src/filiale/tongchuan/StreetList.vue +215 -215
  119. package/src/filiale/tongchuan/UserAddress.vue +822 -822
  120. package/src/filiale/tongchuan/sale.js +19 -19
  121. package/src/filiale/wuhai/UserAddress.vue +795 -795
  122. package/src/filiale/wuhai/sale.js +12 -12
  123. package/src/filiale/xihu/AreaList.vue +409 -409
  124. package/src/filiale/xihu/StreetList.vue +238 -238
  125. package/src/filiale/xihu/sale.js +14 -14
  126. package/src/filiale/xinkang/AddAreaMsg.vue +780 -780
  127. package/src/filiale/xinkang/AreaList.vue +413 -413
  128. package/src/filiale/xinkang/sale.js +9 -9
  129. package/src/filiale/yangchun/AddAreaMsg.vue +764 -764
  130. package/src/filiale/yangchun/sale.js +7 -7
  131. package/src/filiale/zhongsheng/AddressList.vue +671 -671
  132. package/src/filiale/zhongsheng/AreaList.vue +500 -500
  133. package/src/filiale/zhongsheng/sale.js +12 -12
  134. package/src/filiale/zhongyi/AddAreaMsg.vue +757 -757
  135. package/src/filiale/zhongyi/sale.js +12 -12
  136. package/src/filiale/zhoukou/AddAreaMsg.vue +673 -673
  137. package/src/filiale/zhoukou/AddressList.vue +391 -391
  138. package/src/filiale/zhoukou/AddressManage.vue +115 -115
  139. package/src/filiale/zhoukou/AreaList.vue +319 -319
  140. package/src/filiale/zhoukou/AreaManage.vue +100 -100
  141. package/src/filiale/zhoukou/UserAddress.vue +925 -925
  142. package/src/filiale/zhoukou/sale.js +23 -23
  143. package/src/main.js +23 -23
@@ -1,501 +1,501 @@
1
- <template>
2
- <div>
3
- <div class="border">
4
- <div v-if="!isquery" class="form-group" style="height: auto;position: relative;">
5
- <div class="col-sm-2">
6
- <input type="text" class="form-control col-sm-2" v-model="f_name" condition="f_name='{}'" placeholder='地址名称' >
7
- </div>
8
- <v-select class="col-sm-2" style="margin-left: 5px" :value.sync="f_type" :options='address_type' placeholder='地址类型'
9
- close-on-select v-model='f_type' v-ref:f_adjustable></v-select>
10
- <button class="btn btn-info" @click="query">查询</button>
11
- <button class="btn btn-info" @click="addRoot">添加区(县)</button>
12
- <button class="btn btn-success" @click="importAddress">导入地址</button>
13
- </div>
14
- <div v-if="isquery" class="form-group row" style="height: auto;position: relative;">
15
- <div class="col-sm-2 paddingLeft">
16
- <right-tree :userid.sync='userid' :source.sync='source' @re-res="getRes" > </right-tree>
17
- </div>
18
- <div class="col-sm-2 paddingLeft">
19
- <input type="text" class="form-control" v-model="name_x"
20
- condition="f_name='{}'" :placeholder='config.querys[0]'>
21
- </div>
22
- <div class="col-sm-2 paddingLeft">
23
- <input type="text" class="form-control" v-model="name_l"
24
- condition="f_name='{}'" :placeholder='config.querys[1]'>
25
- </div>
26
- <div class="col-sm-2 paddingLeft">
27
- <input type="text" class="form-control" v-model="name_d"
28
- condition="f_name='{}'" :placeholder='config.querys[2]'>
29
- </div>
30
- <!--<div class="col-sm-2 paddingLeft">-->
31
- <!--<input type="text" class="form-control" v-model="name_c" @keyup.enter="search(name_c, config.querys[3])"-->
32
- <!--condition="f_name='{}'" :placeholder='config.querys[3]'>-->
33
- <!--</div>-->
34
- <!--<div class="col-sm-2 paddingLeft">-->
35
- <!--<input type="text" class="form-control" v-model="name_m" @keyup.enter="search(name_m, config.querys[4])"-->
36
- <!--condition="f_name='{}'" :placeholder='config.querys[4]'>-->
37
- <!--</div>-->
38
- <button class="btn btn-info" @click="search">查询</button>
39
- <button class="btn btn-info" @click="clear">清空</button>
40
- <button class="btn btn-info" @click="addRoot">添加区(县)</button>
41
- <button v-if="isbasch" class="btn btn-success" @click="importAddress">导入地址</button>
42
- </div>
43
- <tree-grid class="treeList" :model="model" v-ref:tree :is-Click="true" :isEdit="true" @select-changed='selectclick' url='rs/path/address_getChild' id="vc-chooser">
44
- <template partial='head'>
45
- <tr>
46
- <th>类型</th>
47
- <th>内容</th>
48
- </tr>
49
- </template>
50
- <template partial='body'>
51
- <td>{{row.data.f_type=='区'?'区/县':row.data.f_type}}</td>
52
- <td>
53
- <tree-grid-item :row="row" iconsize="18px">
54
- <span partial>
55
- <span v-if="$parent.$parent.isinspect">
56
- <span v-if="row.data.f_type=='门牌号' && (!row.data.idstr || row.data.idstr<=0)" style="color: green">{{row.data.f_name}}</span>
57
- <span v-else>{{row.data.f_type=='门牌号'?row.data.f_name+'(此地址已有档案)':row.data.f_name}}</span>
58
- </span>
59
- <span v-if="!$parent.$parent.isinspect">
60
- <span>{{row.data.f_name}}</span>
61
- </span>
62
- <span>({{row.size>0?row.size:0}})</span>
63
- <span v-if="$parent.isSelected(row)">
64
- <!--添加地址-->
65
- <button class="btn btn-info btn-sm" v-for="type in $parent.$parent.config.types[row.data.f_type]" @click="$parent.$parent.$parent.addType(row, type)">
66
- <span class="glyphicon glyphicon-plus-sign">{{type}}</span>
67
- </button>
68
- <!--修改地址-->
69
- <button class="btn btn-success btn-sm" @click="$parent.$parent.updateType(row, 1)">修改名称</button>
70
- <!--修改默认表具-->
71
- <button v-if="row.data.f_type=='小区'" class="btn btn-success btn-sm"
72
- @click="$parent.$parent.updateType(row, 2)">修改默认表具</button>
73
- <!--删除地址-->
74
- <button v-if="row.size<=0" class="btn btn-success btn-sm" @click="$parent.$parent.deleteType(row)">删除</button>
75
- </span>
76
- </span>
77
- </tree-grid-item>
78
- </td>
79
- </template>
80
- </tree-grid>
81
- </div>
82
- <div class="rightDiv" v-show="showAddress" >
83
- <address-add style="flex: 1.5;width: 85%" :isbasch="isbasch" :row="item" :f_parentid="parentid" :type="type" :f_location="location" :isarea="isarea"
84
- @add-child-node="addChildNode" @updata-child-node="updataChildNode" v-ref:addressadd ></address-add>
85
- </div>
86
- <modal :show.sync="showFile" v-ref:modal backdrop="true">
87
- <header slot="modal-header" class="modal-header">
88
- <button type="button" class="close" @click="closeFile"><span>&times;</span></button>
89
- <h4 class="modal-title">文件导入</h4>
90
- </header>
91
- <article slot="modal-body" class="modal-body">
92
- <div class="form-group">
93
- <file-upload class="my-file-uploader" name="addressUploadFile" action="rs/file/uploadFile" tagname="文件导入" :headers="headers" multiple v-ref:file></file-upload>
94
- </div>
95
- </article>
96
- <footer slot="modal-footer" class="modal-footer"></footer>
97
- </modal>
98
- </div>
99
- </template>
100
-
101
- <script>
102
- import addressAdd from '../components/AddressAddAddress'
103
- import * as ldapHelper from '../util/LdapHelper'
104
- import Vue from 'vue'
105
-
106
- export default {
107
- name: "AddressTreeManage",
108
- components: {
109
- addressAdd,
110
- },
111
- title: '地址管理',
112
- props: {
113
- //位置
114
- f_location: {
115
- default: {
116
- f_locationId: '1535',
117
- f_locationType: 't_organization',
118
- },
119
- type: Object,
120
- },
121
- // 查询格式
122
- isquery: {
123
- type: Boolean,
124
- default : false,
125
- },
126
- // 是否显示小区信息
127
- isarea: {
128
- type: Boolean,
129
- default: false,
130
- },
131
- // 是否显示批量添加
132
- isbasch: {
133
- type: Boolean,
134
- default: true,
135
- },
136
- // 是否检查用户建档
137
- isinspect: {
138
- type: Boolean,
139
- default: false,
140
- }
141
- },
142
-
143
- data () {
144
- return {
145
- config: {
146
- // 类型定义
147
- types: {
148
- '区': ['街道'],
149
- '街道': ['小区','门牌号'],
150
- '小区': ['楼号', '单元'],
151
- '楼号': ['单元', '楼层', '门牌号'],
152
- '单元': ['楼层', '门牌号'],
153
- '楼层': ['门牌号']
154
- },
155
- // 查询类型
156
- querys: ['小区', '楼号', '单元', '楼层', '门牌号'],
157
- },
158
- model: [],
159
- showAddress: false,
160
- //当前更改
161
- item: null,
162
- parentid: null,
163
- location: null,
164
- showFile: false,
165
- headers: {'username': '', 'blodid': '','f_usetype':'','f_remarks':''},
166
- login: {id: '1535',type: 't_organization'},
167
- type: '',
168
- // 参数类, 用于修改tree组件的类
169
- category: {
170
- child: {
171
- add: [], // ''
172
- remove: []
173
- },
174
- span: {
175
- add: ['glyphicon glyphicon-minus-sign','glyphicon glyphicon-plus-sign'],
176
- remove: ['glyphicon glyphicon-chevron-down','glyphicon glyphicon-chevron-right']
177
- }
178
- },
179
- // 选中的节点
180
- treeRow: null,
181
- selectItem: null, // 选择的参数
182
- userid: this.$login.f.id,
183
- source:`tool.getFullTree(this.getRights().where(row.getType() == $organization$))`,
184
- f_type: ['小区'],
185
- f_name: '',
186
- name_x: '',
187
- name_l: '',
188
- name_d: '',
189
- name_c: '',
190
- name_m: '',
191
- }
192
- },
193
- ready() {
194
- if(Vue.$login.f.parent && Vue.$login.f.parent.parentid) {
195
- this.f_location.f_locationId = Vue.$login.f.parent.parentid
196
- this.login.id = Vue.$login.f.parent.parentid+""
197
- }
198
- if(this.f_location.f_locationId && this.f_location.f_locationType) {
199
- this.init()
200
- }
201
- },
202
- watch: {
203
- 'f_location' (val) {
204
- this.showAddress = false
205
- if(val.f_locationId && val.f_locationType) {
206
- this.init()
207
- }
208
- },
209
- 'f_location.f_locationId' () {
210
- this.showAddress = false
211
- if(this.f_location.f_locationId && this.f_location.f_locationType) {
212
- this.init()
213
- }
214
- }
215
- },
216
- computed : {
217
- address_type() {
218
- return this.$appdata.getParam('地址类型')
219
- }
220
- },
221
- methods: {
222
- // 参数初始化
223
- init() {
224
- return asyncGetRoot(this).then(() => {
225
- this.$emit('ready')
226
- }).catch((error) => {
227
- this.$emit('error', error)
228
- })
229
- },
230
- //添加根地址
231
- addRoot() {
232
- this.type = '区'
233
- this.item = null
234
- this.location = Object.assign({}, this.location, this.f_location)
235
- this.parentid = null
236
- this.treeRow = null
237
- this.isarea = false
238
- this.showAddress = true
239
- },
240
- //添加子地址
241
- addType(row, type) {
242
- this.type = type
243
- this.item = null
244
- this.location = Object.assign({}, this.location, this.f_location)
245
- this.parentid = row.data.id
246
- this.treeRow = row
247
- this.isarea = false
248
- this.showAddress = true
249
- },
250
- //修改地址
251
- updateType(row, type) {
252
- console.log('xiugai ......', row, type)
253
- if(type == 1){
254
- this.isarea = false
255
- } else {
256
- this.isarea = true
257
- }
258
- this.type = row.data.f_type
259
- this.parentid = null
260
- this.location = null
261
- this.item = Object.assign({}, this.item, row.data)
262
- this.treeRow = row
263
- this.showAddress = true
264
- },
265
- //删除地址
266
- deleteType(row) {
267
- console.log(row)
268
- let self = this
269
- let id = row.data.id
270
- return asyncDelete(this, row, row.data.f_type).then((res) => {
271
- console.log(res.data.status + " " + res.data.msg)
272
- if(res.data.status == 200) {
273
- console.log(row.parent)
274
- if(row.parent) {
275
- // 父节点刷新
276
- this.$refs.tree.refreshChild(row.parent)
277
- } else {
278
- this.init()
279
- }
280
- } else {
281
- alert(res.data.msg)
282
- }
283
- this.showAddress = false
284
- })
285
- },
286
- //导入地址
287
- importAddress() {
288
- this.showFile = true
289
- },
290
- // 关闭文件上传对话框
291
- closeFile() {
292
- this.showFile = false
293
- // 将选的文件清空
294
- // this.$showMessage(this.$refs.file.$el.querySelector('input').value)
295
- this.$refs.file.$el.querySelector('input').value = ''
296
- },
297
- // 父组件更新子组件属性 , 传入登陆信息
298
- updateData(val) {
299
- if(val.headers){
300
- this.headers = val.headers
301
- }
302
- if(val.login){
303
- this.login = val.login
304
- }
305
- },
306
- // 添加子节点
307
- addChildNode(data) {
308
- if(this.treeRow) {
309
- // 刷新当前节点
310
- this.$refs.tree.refreshChild(this.treeRow)
311
- } else {
312
- this.init()
313
- }
314
- },
315
- // 修改
316
- updataChildNode(data) {
317
- if(this.treeRow.parent){
318
- this.$refs.tree.refreshChild(this.treeRow.parent)
319
- } else {
320
- this.init()
321
- }
322
- },
323
- filterParams (param,filialeCodeStr) {
324
- this.selectItem = null
325
- if(param){
326
- this.model.rows = this.allParams.filter((item) => {
327
- return filialeCodeStr==(item.f_orgstr) && item.name.includes(param)
328
- })
329
- }else{
330
- this.model.rows = this.allParams.filter((item) => {
331
- return filialeCodeStr==(item.f_orgstr)
332
- })
333
- }
334
- },
335
- async query() {
336
- if(this.f_name==="") {
337
- await this.init()
338
- } else if(this.f_type.length <= 0) {
339
- alert("请输入地址类型");
340
- } else {
341
- let condition ={
342
- name: this.f_name,
343
- type: this.f_type[0]
344
- }
345
- let login = {
346
- id: this.f_location.f_locationId+"",
347
- type: this.f_location.f_locationType
348
- }
349
- let res = await asyncQuery(this, condition, login)
350
- this.model = res.data
351
- await new Promise(resolve => {
352
- this.$nextTick(() => {
353
- resolve()
354
- })
355
- })
356
- // 展开所有子
357
- this.$refs.tree.openAll()
358
- this.$emit('ready')
359
- }
360
- },
361
- // 地址搜索
362
- async search() {
363
- let condition ={
364
- f_area: this.name_x,
365
- f_building: this.name_l,
366
- f_unit: this.name_d
367
- }
368
- let login = {
369
- id: this.f_location.f_locationId+"",
370
- type: this.f_location.f_locationType
371
- }
372
- let res = await this.$resetpost(`api/af-revenue/logic/address_search`, {data: {condition: condition, login: login}},{resolveMsg: null})
373
- this.model = res.data
374
- //刷新dom
375
- await new Promise(resolve => {
376
- this.$nextTick(() => {
377
- resolve()
378
- })
379
- })
380
- // 展开所有子
381
- this.$refs.tree.openAll()
382
- },
383
- // 清空
384
- clear() {
385
- this.name_x = ''
386
- this.name_l = ''
387
- this.name_d = ''
388
- this.name_c = ''
389
- this.name_m = ''
390
- this.init()
391
- },
392
- selectclick (obj) {
393
- let row = obj.val
394
- if(this.isinspect){
395
- //如果选择地址已有档案则不返回事件,并把选中状态改为未选中
396
- if(row.data.idstr > 0) {
397
- this.$refs.tree.selectStore.selected = null
398
- return
399
- }
400
- }
401
- console.log('看看row',row)
402
- let newobj={
403
- "rows": ldapHelper.getFullNameType(row, 'f_name', 'f_type'),
404
- "id": ldapHelper.getFullName(row, 'id')+''
405
- }
406
- let address = ''
407
- newobj.rows.forEach((item)=>{
408
- address += item.name
409
- })
410
- this.textContent = address
411
- this.contentId = row.id
412
- this.treeRow = row
413
- //返回, 需要修改
414
- console.log('返回数据',newobj,address)
415
- this.$dispatch('re-ref', newobj,address)
416
- },
417
- getRes (obj) {
418
- let loc = obj.resids.split('.');
419
- this.f_location.f_locationId = loc[loc.length-2];
420
- }
421
- },
422
- events: {
423
- onFile: function (file, res) {
424
- console.log("上传完毕"+JSON.stringify(res))
425
- let data = {
426
- filepath: res.f_downloadpath,
427
- login: this.login
428
- }
429
- console.log("filepath="+JSON.stringify(data))
430
- return asyncImport(this, data).then(() => {
431
- this.closeFile()
432
- this.init()
433
- }).catch((error) => {
434
- this.$emit('error', error)
435
- })
436
- },
437
- 'onFileError'(error) {
438
- this.$showAlert(error, 'warning', 2000)
439
- }
440
- },
441
- }
442
- // 导入地址
443
- let asyncImport = async function (self, data) {
444
- let result = await self.$resetpost(`api/af-revenue/logic/address_import`,data, {resolveMsg: '导入成功', rejectMsg: '导入失败', silent: true}, 0)
445
- return result
446
- }
447
- // 获取根地址
448
- let asyncGetRoot = async function(self) {
449
- let condition = ""
450
- if(self.f_location) {
451
- condition = `f_locationId=${self.f_location.f_locationId} and f_locationType='${self.f_location.f_locationType}'`
452
- } else {
453
- condition = " 1=1 "
454
- }
455
- let that = self
456
- // console.log(`condition=${condition}`)
457
- let result = await self.$resetpost('rs/path/address_getRoot',{data: {f_parentId: null, condition: condition}},{resolveMsg: null})
458
- // console.log(JSON.stringify(result.data))
459
- self.model = result.data
460
- return result
461
- }
462
- // 删除地址
463
- let asyncDelete = async function(self, row, type) {
464
- let result = await self.$resetpost(`api/af-revenue/logic/address_deleteAddress`, {childId: `${row.data.id}`}, {resolveMsg: null})
465
- if(type == '小区') {
466
- await self.$resetpost(`api/af-revenue/logic/address_deleteArea`,{areaId: `${row.data.id}`}, {resolveMsg: null})
467
- }
468
- return result
469
- }
470
- //查询地址
471
- let asyncQuery = async function(self, condition, login) {
472
- let result = await self.$resetpost(`api/af-revenue/logic/address_query`, {data: {condition: condition, login: login}},{resolveMsg: null})
473
- return result
474
- }
475
-
476
- </script>
477
-
478
- <style lang="less" scoped>
479
- .btn{
480
- margin-left: 7px;
481
- border-radius: 4px;
482
- }
483
- .border{
484
- max-width: 50%;
485
- /*overflow-y: auto;*/
486
- float: left;
487
- }
488
- .rightDiv{
489
- width: 50%;
490
- /*margin-left: 200px;*/
491
- float: left;
492
- }
493
- .treeList {
494
- overflow-y: auto;
495
- max-height: 90%;
496
- }
497
- .paddingLeft {
498
- padding-left: 10px;
499
- width: 15%;
500
- }
501
- </style>
1
+ <template>
2
+ <div>
3
+ <div class="border">
4
+ <div v-if="!isquery" class="form-group" style="height: auto;position: relative;">
5
+ <div class="col-sm-2">
6
+ <input type="text" class="form-control col-sm-2" v-model="f_name" condition="f_name='{}'" placeholder='地址名称' >
7
+ </div>
8
+ <v-select class="col-sm-2" style="margin-left: 5px" :value.sync="f_type" :options='address_type' placeholder='地址类型'
9
+ close-on-select v-model='f_type' v-ref:f_adjustable></v-select>
10
+ <button class="btn btn-info" @click="query">查询</button>
11
+ <button class="btn btn-info" @click="addRoot">添加区(县)</button>
12
+ <button class="btn btn-success" @click="importAddress">导入地址</button>
13
+ </div>
14
+ <div v-if="isquery" class="form-group row" style="height: auto;position: relative;">
15
+ <div class="col-sm-2 paddingLeft">
16
+ <right-tree :userid.sync='userid' :source.sync='source' @re-res="getRes" > </right-tree>
17
+ </div>
18
+ <div class="col-sm-2 paddingLeft">
19
+ <input type="text" class="form-control" v-model="name_x"
20
+ condition="f_name='{}'" :placeholder='config.querys[0]'>
21
+ </div>
22
+ <div class="col-sm-2 paddingLeft">
23
+ <input type="text" class="form-control" v-model="name_l"
24
+ condition="f_name='{}'" :placeholder='config.querys[1]'>
25
+ </div>
26
+ <div class="col-sm-2 paddingLeft">
27
+ <input type="text" class="form-control" v-model="name_d"
28
+ condition="f_name='{}'" :placeholder='config.querys[2]'>
29
+ </div>
30
+ <!--<div class="col-sm-2 paddingLeft">-->
31
+ <!--<input type="text" class="form-control" v-model="name_c" @keyup.enter="search(name_c, config.querys[3])"-->
32
+ <!--condition="f_name='{}'" :placeholder='config.querys[3]'>-->
33
+ <!--</div>-->
34
+ <!--<div class="col-sm-2 paddingLeft">-->
35
+ <!--<input type="text" class="form-control" v-model="name_m" @keyup.enter="search(name_m, config.querys[4])"-->
36
+ <!--condition="f_name='{}'" :placeholder='config.querys[4]'>-->
37
+ <!--</div>-->
38
+ <button class="btn btn-info" @click="search">查询</button>
39
+ <button class="btn btn-info" @click="clear">清空</button>
40
+ <button class="btn btn-info" @click="addRoot">添加区(县)</button>
41
+ <button v-if="isbasch" class="btn btn-success" @click="importAddress">导入地址</button>
42
+ </div>
43
+ <tree-grid class="treeList" :model="model" v-ref:tree :is-Click="true" :isEdit="true" @select-changed='selectclick' url='rs/path/address_getChild' id="vc-chooser">
44
+ <template partial='head'>
45
+ <tr>
46
+ <th>类型</th>
47
+ <th>内容</th>
48
+ </tr>
49
+ </template>
50
+ <template partial='body'>
51
+ <td>{{row.data.f_type=='区'?'区/县':row.data.f_type}}</td>
52
+ <td>
53
+ <tree-grid-item :row="row" iconsize="18px">
54
+ <span partial>
55
+ <span v-if="$parent.$parent.isinspect">
56
+ <span v-if="row.data.f_type=='门牌号' && (!row.data.idstr || row.data.idstr<=0)" style="color: green">{{row.data.f_name}}</span>
57
+ <span v-else>{{row.data.f_type=='门牌号'?row.data.f_name+'(此地址已有档案)':row.data.f_name}}</span>
58
+ </span>
59
+ <span v-if="!$parent.$parent.isinspect">
60
+ <span>{{row.data.f_name}}</span>
61
+ </span>
62
+ <span>({{row.size>0?row.size:0}})</span>
63
+ <span v-if="$parent.isSelected(row)">
64
+ <!--添加地址-->
65
+ <button class="btn btn-info btn-sm" v-for="type in $parent.$parent.config.types[row.data.f_type]" @click="$parent.$parent.$parent.addType(row, type)">
66
+ <span class="glyphicon glyphicon-plus-sign">{{type}}</span>
67
+ </button>
68
+ <!--修改地址-->
69
+ <button class="btn btn-success btn-sm" @click="$parent.$parent.updateType(row, 1)">修改名称</button>
70
+ <!--修改默认表具-->
71
+ <button v-if="row.data.f_type=='小区'" class="btn btn-success btn-sm"
72
+ @click="$parent.$parent.updateType(row, 2)">修改默认表具</button>
73
+ <!--删除地址-->
74
+ <button v-if="row.size<=0" class="btn btn-success btn-sm" @click="$parent.$parent.deleteType(row)">删除</button>
75
+ </span>
76
+ </span>
77
+ </tree-grid-item>
78
+ </td>
79
+ </template>
80
+ </tree-grid>
81
+ </div>
82
+ <div class="rightDiv" v-show="showAddress" >
83
+ <address-add style="flex: 1.5;width: 85%" :isbasch="isbasch" :row="item" :f_parentid="parentid" :type="type" :f_location="location" :isarea="isarea"
84
+ @add-child-node="addChildNode" @updata-child-node="updataChildNode" v-ref:addressadd ></address-add>
85
+ </div>
86
+ <modal :show.sync="showFile" v-ref:modal backdrop="true">
87
+ <header slot="modal-header" class="modal-header">
88
+ <button type="button" class="close" @click="closeFile"><span>&times;</span></button>
89
+ <h4 class="modal-title">文件导入</h4>
90
+ </header>
91
+ <article slot="modal-body" class="modal-body">
92
+ <div class="form-group">
93
+ <file-upload class="my-file-uploader" name="addressUploadFile" action="rs/file/uploadFile" tagname="文件导入" :headers="headers" multiple v-ref:file></file-upload>
94
+ </div>
95
+ </article>
96
+ <footer slot="modal-footer" class="modal-footer"></footer>
97
+ </modal>
98
+ </div>
99
+ </template>
100
+
101
+ <script>
102
+ import addressAdd from '../components/AddressAddAddress'
103
+ import * as ldapHelper from '../util/LdapHelper'
104
+ import Vue from 'vue'
105
+
106
+ export default {
107
+ name: "AddressTreeManage",
108
+ components: {
109
+ addressAdd,
110
+ },
111
+ title: '地址管理',
112
+ props: {
113
+ //位置
114
+ f_location: {
115
+ default: {
116
+ f_locationId: '1535',
117
+ f_locationType: 't_organization',
118
+ },
119
+ type: Object,
120
+ },
121
+ // 查询格式
122
+ isquery: {
123
+ type: Boolean,
124
+ default : false,
125
+ },
126
+ // 是否显示小区信息
127
+ isarea: {
128
+ type: Boolean,
129
+ default: false,
130
+ },
131
+ // 是否显示批量添加
132
+ isbasch: {
133
+ type: Boolean,
134
+ default: true,
135
+ },
136
+ // 是否检查用户建档
137
+ isinspect: {
138
+ type: Boolean,
139
+ default: false,
140
+ }
141
+ },
142
+
143
+ data () {
144
+ return {
145
+ config: {
146
+ // 类型定义
147
+ types: {
148
+ '区': ['街道'],
149
+ '街道': ['小区','门牌号'],
150
+ '小区': ['楼号', '单元'],
151
+ '楼号': ['单元', '楼层', '门牌号'],
152
+ '单元': ['楼层', '门牌号'],
153
+ '楼层': ['门牌号']
154
+ },
155
+ // 查询类型
156
+ querys: ['小区', '楼号', '单元', '楼层', '门牌号'],
157
+ },
158
+ model: [],
159
+ showAddress: false,
160
+ //当前更改
161
+ item: null,
162
+ parentid: null,
163
+ location: null,
164
+ showFile: false,
165
+ headers: {'username': '', 'blodid': '','f_usetype':'','f_remarks':''},
166
+ login: {id: '1535',type: 't_organization'},
167
+ type: '',
168
+ // 参数类, 用于修改tree组件的类
169
+ category: {
170
+ child: {
171
+ add: [], // ''
172
+ remove: []
173
+ },
174
+ span: {
175
+ add: ['glyphicon glyphicon-minus-sign','glyphicon glyphicon-plus-sign'],
176
+ remove: ['glyphicon glyphicon-chevron-down','glyphicon glyphicon-chevron-right']
177
+ }
178
+ },
179
+ // 选中的节点
180
+ treeRow: null,
181
+ selectItem: null, // 选择的参数
182
+ userid: this.$login.f.id,
183
+ source:`tool.getFullTree(this.getRights().where(row.getType() == $organization$))`,
184
+ f_type: ['小区'],
185
+ f_name: '',
186
+ name_x: '',
187
+ name_l: '',
188
+ name_d: '',
189
+ name_c: '',
190
+ name_m: '',
191
+ }
192
+ },
193
+ ready() {
194
+ if(Vue.$login.f.parent && Vue.$login.f.parent.parentid) {
195
+ this.f_location.f_locationId = Vue.$login.f.parent.parentid
196
+ this.login.id = Vue.$login.f.parent.parentid+""
197
+ }
198
+ if(this.f_location.f_locationId && this.f_location.f_locationType) {
199
+ this.init()
200
+ }
201
+ },
202
+ watch: {
203
+ 'f_location' (val) {
204
+ this.showAddress = false
205
+ if(val.f_locationId && val.f_locationType) {
206
+ this.init()
207
+ }
208
+ },
209
+ 'f_location.f_locationId' () {
210
+ this.showAddress = false
211
+ if(this.f_location.f_locationId && this.f_location.f_locationType) {
212
+ this.init()
213
+ }
214
+ }
215
+ },
216
+ computed : {
217
+ address_type() {
218
+ return this.$appdata.getParam('地址类型')
219
+ }
220
+ },
221
+ methods: {
222
+ // 参数初始化
223
+ init() {
224
+ return asyncGetRoot(this).then(() => {
225
+ this.$emit('ready')
226
+ }).catch((error) => {
227
+ this.$emit('error', error)
228
+ })
229
+ },
230
+ //添加根地址
231
+ addRoot() {
232
+ this.type = '区'
233
+ this.item = null
234
+ this.location = Object.assign({}, this.location, this.f_location)
235
+ this.parentid = null
236
+ this.treeRow = null
237
+ this.isarea = false
238
+ this.showAddress = true
239
+ },
240
+ //添加子地址
241
+ addType(row, type) {
242
+ this.type = type
243
+ this.item = null
244
+ this.location = Object.assign({}, this.location, this.f_location)
245
+ this.parentid = row.data.id
246
+ this.treeRow = row
247
+ this.isarea = false
248
+ this.showAddress = true
249
+ },
250
+ //修改地址
251
+ updateType(row, type) {
252
+ console.log('xiugai ......', row, type)
253
+ if(type == 1){
254
+ this.isarea = false
255
+ } else {
256
+ this.isarea = true
257
+ }
258
+ this.type = row.data.f_type
259
+ this.parentid = null
260
+ this.location = null
261
+ this.item = Object.assign({}, this.item, row.data)
262
+ this.treeRow = row
263
+ this.showAddress = true
264
+ },
265
+ //删除地址
266
+ deleteType(row) {
267
+ console.log(row)
268
+ let self = this
269
+ let id = row.data.id
270
+ return asyncDelete(this, row, row.data.f_type).then((res) => {
271
+ console.log(res.data.status + " " + res.data.msg)
272
+ if(res.data.status == 200) {
273
+ console.log(row.parent)
274
+ if(row.parent) {
275
+ // 父节点刷新
276
+ this.$refs.tree.refreshChild(row.parent)
277
+ } else {
278
+ this.init()
279
+ }
280
+ } else {
281
+ alert(res.data.msg)
282
+ }
283
+ this.showAddress = false
284
+ })
285
+ },
286
+ //导入地址
287
+ importAddress() {
288
+ this.showFile = true
289
+ },
290
+ // 关闭文件上传对话框
291
+ closeFile() {
292
+ this.showFile = false
293
+ // 将选的文件清空
294
+ // this.$showMessage(this.$refs.file.$el.querySelector('input').value)
295
+ this.$refs.file.$el.querySelector('input').value = ''
296
+ },
297
+ // 父组件更新子组件属性 , 传入登陆信息
298
+ updateData(val) {
299
+ if(val.headers){
300
+ this.headers = val.headers
301
+ }
302
+ if(val.login){
303
+ this.login = val.login
304
+ }
305
+ },
306
+ // 添加子节点
307
+ addChildNode(data) {
308
+ if(this.treeRow) {
309
+ // 刷新当前节点
310
+ this.$refs.tree.refreshChild(this.treeRow)
311
+ } else {
312
+ this.init()
313
+ }
314
+ },
315
+ // 修改
316
+ updataChildNode(data) {
317
+ if(this.treeRow.parent){
318
+ this.$refs.tree.refreshChild(this.treeRow.parent)
319
+ } else {
320
+ this.init()
321
+ }
322
+ },
323
+ filterParams (param,filialeCodeStr) {
324
+ this.selectItem = null
325
+ if(param){
326
+ this.model.rows = this.allParams.filter((item) => {
327
+ return filialeCodeStr==(item.f_orgstr) && item.name.includes(param)
328
+ })
329
+ }else{
330
+ this.model.rows = this.allParams.filter((item) => {
331
+ return filialeCodeStr==(item.f_orgstr)
332
+ })
333
+ }
334
+ },
335
+ async query() {
336
+ if(this.f_name==="") {
337
+ await this.init()
338
+ } else if(this.f_type.length <= 0) {
339
+ alert("请输入地址类型");
340
+ } else {
341
+ let condition ={
342
+ name: this.f_name,
343
+ type: this.f_type[0]
344
+ }
345
+ let login = {
346
+ id: this.f_location.f_locationId+"",
347
+ type: this.f_location.f_locationType
348
+ }
349
+ let res = await asyncQuery(this, condition, login)
350
+ this.model = res.data
351
+ await new Promise(resolve => {
352
+ this.$nextTick(() => {
353
+ resolve()
354
+ })
355
+ })
356
+ // 展开所有子
357
+ this.$refs.tree.openAll()
358
+ this.$emit('ready')
359
+ }
360
+ },
361
+ // 地址搜索
362
+ async search() {
363
+ let condition ={
364
+ f_area: this.name_x,
365
+ f_building: this.name_l,
366
+ f_unit: this.name_d
367
+ }
368
+ let login = {
369
+ id: this.f_location.f_locationId+"",
370
+ type: this.f_location.f_locationType
371
+ }
372
+ let res = await this.$resetpost(`api/af-revenue/logic/address_search`, {data: {condition: condition, login: login}},{resolveMsg: null})
373
+ this.model = res.data
374
+ //刷新dom
375
+ await new Promise(resolve => {
376
+ this.$nextTick(() => {
377
+ resolve()
378
+ })
379
+ })
380
+ // 展开所有子
381
+ this.$refs.tree.openAll()
382
+ },
383
+ // 清空
384
+ clear() {
385
+ this.name_x = ''
386
+ this.name_l = ''
387
+ this.name_d = ''
388
+ this.name_c = ''
389
+ this.name_m = ''
390
+ this.init()
391
+ },
392
+ selectclick (obj) {
393
+ let row = obj.val
394
+ if(this.isinspect){
395
+ //如果选择地址已有档案则不返回事件,并把选中状态改为未选中
396
+ if(row.data.idstr > 0) {
397
+ this.$refs.tree.selectStore.selected = null
398
+ return
399
+ }
400
+ }
401
+ console.log('看看row',row)
402
+ let newobj={
403
+ "rows": ldapHelper.getFullNameType(row, 'f_name', 'f_type'),
404
+ "id": ldapHelper.getFullName(row, 'id')+''
405
+ }
406
+ let address = ''
407
+ newobj.rows.forEach((item)=>{
408
+ address += item.name
409
+ })
410
+ this.textContent = address
411
+ this.contentId = row.id
412
+ this.treeRow = row
413
+ //返回, 需要修改
414
+ console.log('返回数据',newobj,address)
415
+ this.$dispatch('re-ref', newobj,address)
416
+ },
417
+ getRes (obj) {
418
+ let loc = obj.resids.split('.');
419
+ this.f_location.f_locationId = loc[loc.length-2];
420
+ }
421
+ },
422
+ events: {
423
+ onFile: function (file, res) {
424
+ console.log("上传完毕"+JSON.stringify(res))
425
+ let data = {
426
+ filepath: res.f_downloadpath,
427
+ login: this.login
428
+ }
429
+ console.log("filepath="+JSON.stringify(data))
430
+ return asyncImport(this, data).then(() => {
431
+ this.closeFile()
432
+ this.init()
433
+ }).catch((error) => {
434
+ this.$emit('error', error)
435
+ })
436
+ },
437
+ 'onFileError'(error) {
438
+ this.$showAlert(error, 'warning', 2000)
439
+ }
440
+ },
441
+ }
442
+ // 导入地址
443
+ let asyncImport = async function (self, data) {
444
+ let result = await self.$resetpost(`api/af-revenue/logic/address_import`,data, {resolveMsg: '导入成功', rejectMsg: '导入失败', silent: true}, 0)
445
+ return result
446
+ }
447
+ // 获取根地址
448
+ let asyncGetRoot = async function(self) {
449
+ let condition = ""
450
+ if(self.f_location) {
451
+ condition = `f_locationId=${self.f_location.f_locationId} and f_locationType='${self.f_location.f_locationType}'`
452
+ } else {
453
+ condition = " 1=1 "
454
+ }
455
+ let that = self
456
+ // console.log(`condition=${condition}`)
457
+ let result = await self.$resetpost('rs/path/address_getRoot',{data: {f_parentId: null, condition: condition}},{resolveMsg: null})
458
+ // console.log(JSON.stringify(result.data))
459
+ self.model = result.data
460
+ return result
461
+ }
462
+ // 删除地址
463
+ let asyncDelete = async function(self, row, type) {
464
+ let result = await self.$resetpost(`api/af-revenue/logic/address_deleteAddress`, {childId: `${row.data.id}`}, {resolveMsg: null})
465
+ if(type == '小区') {
466
+ await self.$resetpost(`api/af-revenue/logic/address_deleteArea`,{areaId: `${row.data.id}`}, {resolveMsg: null})
467
+ }
468
+ return result
469
+ }
470
+ //查询地址
471
+ let asyncQuery = async function(self, condition, login) {
472
+ let result = await self.$resetpost(`api/af-revenue/logic/address_query`, {data: {condition: condition, login: login}},{resolveMsg: null})
473
+ return result
474
+ }
475
+
476
+ </script>
477
+
478
+ <style lang="less" scoped>
479
+ .btn{
480
+ margin-left: 7px;
481
+ border-radius: 4px;
482
+ }
483
+ .border{
484
+ max-width: 50%;
485
+ /*overflow-y: auto;*/
486
+ float: left;
487
+ }
488
+ .rightDiv{
489
+ width: 50%;
490
+ /*margin-left: 200px;*/
491
+ float: left;
492
+ }
493
+ .treeList {
494
+ overflow-y: auto;
495
+ max-height: 90%;
496
+ }
497
+ .paddingLeft {
498
+ padding-left: 10px;
499
+ width: 15%;
500
+ }
501
+ </style>