address-client 4.0.1 → 4.0.2

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 (160) hide show
  1. package/.gradle/8.5/checksums/checksums.lock +0 -0
  2. package/.gradle/8.5/dependencies-accessors/dependencies-accessors.lock +0 -0
  3. package/.gradle/8.5/dependencies-accessors/gc.properties +0 -0
  4. package/.gradle/8.5/executionHistory/executionHistory.bin +0 -0
  5. package/.gradle/8.5/executionHistory/executionHistory.lock +0 -0
  6. package/.gradle/8.5/fileChanges/last-build.bin +0 -0
  7. package/.gradle/8.5/fileHashes/fileHashes.bin +0 -0
  8. package/.gradle/8.5/fileHashes/fileHashes.lock +0 -0
  9. package/.gradle/8.5/gc.properties +0 -0
  10. package/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
  11. package/.gradle/buildOutputCleanup/cache.properties +2 -2
  12. package/.gradle/file-system.probe +0 -0
  13. package/.gradle/vcs-1/gc.properties +0 -0
  14. package/CHANGELOG.md +15 -15
  15. package/build/dev-server.js +185 -185
  16. package/build/versionCheck.js +31 -31
  17. package/build/webpack.base.conf.js +82 -82
  18. package/examples/showAdd/App.vue +40 -40
  19. package/gradle/wrapper/gradle-wrapper.jar +0 -0
  20. package/gradle/wrapper/gradle-wrapper.properties +7 -0
  21. package/gradlew +249 -0
  22. package/gradlew.bat +92 -0
  23. package/index.html +44 -44
  24. package/package.json +101 -101
  25. package/src/address.js +74 -74
  26. package/src/components/AddAreaMsg.vue +757 -757
  27. package/src/components/AddCommunityManageMsg.vue +220 -220
  28. package/src/components/AddStreetManageMsg.vue +204 -204
  29. package/src/components/AddStreetOrPcd.vue +316 -316
  30. package/src/components/AddressAddAddress.vue +479 -479
  31. package/src/components/AddressFiles.vue +156 -156
  32. package/src/components/AddressList.vue +637 -637
  33. package/src/components/AddressListLiuLi.vue +17 -17
  34. package/src/components/AddressManage.vue +117 -117
  35. package/src/components/AddressTree.vue +501 -501
  36. package/src/components/AreaFiles.vue +73 -73
  37. package/src/components/AreaList.vue +410 -410
  38. package/src/components/AreaManage.vue +104 -104
  39. package/src/components/AreaTree.vue +508 -508
  40. package/src/components/Basch.vue +72 -72
  41. package/src/components/BatchOrders.vue +328 -328
  42. package/src/components/BuildingList.vue +129 -129
  43. package/src/components/CityList.vue +134 -134
  44. package/src/components/CityManage.vue +76 -76
  45. package/src/components/CommunityAreaList.vue +87 -87
  46. package/src/components/CommunityManage.vue +78 -78
  47. package/src/components/CommunityManageList.vue +244 -244
  48. package/src/components/NewAddressInfo.vue +432 -432
  49. package/src/components/StreetList.vue +241 -241
  50. package/src/components/StreetManage.vue +68 -68
  51. package/src/components/StreetManageList.vue +225 -225
  52. package/src/components/UserAddress.vue +911 -907
  53. package/src/components/UserAddressChange.vue +58 -58
  54. package/src/components/selectAddress/BatchList.vue +326 -326
  55. package/src/components/selectAddress/BatchOrders.vue +37 -36
  56. package/src/filiale/WEINAN/AddAreaMsg.vue +745 -745
  57. package/src/filiale/WEINAN/AddressList.vue +588 -588
  58. package/src/filiale/WEINAN/AddressManage.vue +122 -122
  59. package/src/filiale/WEINAN/AreaList.vue +435 -435
  60. package/src/filiale/WEINAN/AreaManage.vue +109 -109
  61. package/src/filiale/WEINAN/AreaUserList.vue +226 -226
  62. package/src/filiale/WEINAN/UserAddress.vue +783 -783
  63. package/src/filiale/WEINAN/sale.js +18 -18
  64. package/src/filiale/chengtou/UserAddress.vue +894 -894
  65. package/src/filiale/chengtou/sale.js +7 -7
  66. package/src/filiale/dongguan/AddStreetOrPcd.vue +422 -422
  67. package/src/filiale/dongguan/sale.js +7 -7
  68. package/src/filiale/gaomi/AddressList.vue +430 -430
  69. package/src/filiale/gaomi/UserAddress.vue +832 -832
  70. package/src/filiale/gaomi/sale.js +14 -14
  71. package/src/filiale/gongyi/AddAreaMsg.vue +651 -651
  72. package/src/filiale/gongyi/AreaManage.vue +100 -100
  73. package/src/filiale/gongyi/UserAddress.vue +751 -751
  74. package/src/filiale/gongyi/sale.js +14 -14
  75. package/src/filiale/haile/AddressList.vue +615 -615
  76. package/src/filiale/haile/sale.js +8 -8
  77. package/src/filiale/jingwei/UserAddress.vue +764 -764
  78. package/src/filiale/jingwei/sale.js +12 -12
  79. package/src/filiale/lixianV3/AreaList.vue +416 -416
  80. package/src/filiale/lixianV3/sale.js +12 -12
  81. package/src/filiale/macheng/AddAreaMsg.vue +635 -635
  82. package/src/filiale/macheng/AddStreetOrPcd.vue +231 -231
  83. package/src/filiale/macheng/AddressList.vue +613 -613
  84. package/src/filiale/macheng/AreaList.vue +318 -318
  85. package/src/filiale/macheng/CityManage.vue +76 -76
  86. package/src/filiale/macheng/StreetList.vue +186 -186
  87. package/src/filiale/macheng/UserAddress.vue +743 -743
  88. package/src/filiale/macheng/sale.js +17 -17
  89. package/src/filiale/meihekou/UserAddress.vue +898 -898
  90. package/src/filiale/meihekou/sale.js +8 -8
  91. package/src/filiale/qianneng/AddAreaMsg.vue +755 -755
  92. package/src/filiale/qianneng/AddStreetOrPcd.vue +328 -328
  93. package/src/filiale/qianneng/AddressList.vue +638 -638
  94. package/src/filiale/qianneng/AreaList.vue +431 -431
  95. package/src/filiale/qianneng/CityManage.vue +81 -81
  96. package/src/filiale/qianneng/UserAddress.vue +1125 -1125
  97. package/src/filiale/qianneng/sale.js +20 -20
  98. package/src/filiale/qinhua/AddAreaMsg.vue +743 -743
  99. package/src/filiale/qinhua/AddressList.vue +627 -627
  100. package/src/filiale/qinhua/AddressManage.vue +117 -117
  101. package/src/filiale/qinhua/AreaList.vue +425 -425
  102. package/src/filiale/qinhua/AreaManage.vue +100 -100
  103. package/src/filiale/qinhua/CityManage.vue +76 -76
  104. package/src/filiale/qinhua/StreetList.vue +241 -241
  105. package/src/filiale/qinhua/UserAddress.vue +894 -894
  106. package/src/filiale/qinhua/sale.js +20 -20
  107. package/src/filiale/rizhao/UserAddress.vue +897 -897
  108. package/src/filiale/rizhao/sale.js +8 -8
  109. package/src/filiale/rongcheng/AddressList.vue +363 -363
  110. package/src/filiale/rongcheng/UserAddress.vue +799 -799
  111. package/src/filiale/rongcheng/sale.js +11 -11
  112. package/src/filiale/shanggao/AddAreaMsg.vue +752 -752
  113. package/src/filiale/shanggao/AddStreetOrPcd.vue +312 -312
  114. package/src/filiale/shanggao/AddressList.vue +613 -613
  115. package/src/filiale/shanggao/AreaList.vue +436 -436
  116. package/src/filiale/shanggao/BuildingList.vue +129 -129
  117. package/src/filiale/shanggao/StreetList.vue +240 -240
  118. package/src/filiale/shanggao/UserAddress.vue +953 -953
  119. package/src/filiale/shanggao/sale.js +16 -16
  120. package/src/filiale/shanxian/AddAreaMsg.vue +766 -766
  121. package/src/filiale/shanxian/AddressList.vue +658 -658
  122. package/src/filiale/shanxian/AreaList.vue +458 -458
  123. package/src/filiale/shanxian/AreaManage.vue +107 -107
  124. package/src/filiale/shanxian/UserAddress.vue +900 -900
  125. package/src/filiale/shanxian/sale.js +15 -15
  126. package/src/filiale/shaoguan/AddAreaMsg.vue +629 -629
  127. package/src/filiale/shaoguan/UserAddress.vue +762 -762
  128. package/src/filiale/shaoguan/sale.js +11 -11
  129. package/src/filiale/tongchuan/AddAreaMsg.vue +635 -635
  130. package/src/filiale/tongchuan/AddStreetOrPcd.vue +351 -351
  131. package/src/filiale/tongchuan/AddressList.vue +379 -379
  132. package/src/filiale/tongchuan/AreaList.vue +315 -315
  133. package/src/filiale/tongchuan/AreaManage.vue +100 -100
  134. package/src/filiale/tongchuan/CityList.vue +133 -133
  135. package/src/filiale/tongchuan/StreetList.vue +215 -215
  136. package/src/filiale/tongchuan/UserAddress.vue +822 -822
  137. package/src/filiale/tongchuan/sale.js +19 -19
  138. package/src/filiale/wuhai/UserAddress.vue +795 -795
  139. package/src/filiale/wuhai/sale.js +12 -12
  140. package/src/filiale/xihu/AreaList.vue +409 -409
  141. package/src/filiale/xihu/StreetList.vue +238 -238
  142. package/src/filiale/xihu/sale.js +14 -14
  143. package/src/filiale/xinkang/AddAreaMsg.vue +780 -780
  144. package/src/filiale/xinkang/AreaList.vue +413 -413
  145. package/src/filiale/xinkang/sale.js +9 -9
  146. package/src/filiale/yangchun/AddAreaMsg.vue +764 -764
  147. package/src/filiale/yangchun/sale.js +7 -7
  148. package/src/filiale/zhongsheng/AddressList.vue +671 -671
  149. package/src/filiale/zhongsheng/AreaList.vue +500 -500
  150. package/src/filiale/zhongsheng/sale.js +12 -12
  151. package/src/filiale/zhongyi/AddAreaMsg.vue +757 -757
  152. package/src/filiale/zhongyi/sale.js +12 -12
  153. package/src/filiale/zhoukou/AddAreaMsg.vue +673 -673
  154. package/src/filiale/zhoukou/AddressList.vue +391 -391
  155. package/src/filiale/zhoukou/AddressManage.vue +115 -115
  156. package/src/filiale/zhoukou/AreaList.vue +319 -319
  157. package/src/filiale/zhoukou/AreaManage.vue +100 -100
  158. package/src/filiale/zhoukou/UserAddress.vue +925 -925
  159. package/src/filiale/zhoukou/sale.js +23 -23
  160. package/src/main.js +23 -23
@@ -1,479 +1,479 @@
1
- <template>
2
- <div class="auto content">
3
- <div class="col-sm-12">
4
- <label v-if="!model.id" class="add">添加{{type=='区'?'区/县':type}}</label>
5
- <label v-if="model.id && !isarea" class="fs24">修改{{type=='区'?'区/县':type}}</label>
6
- <label v-if="model.id && isarea" class="fs24">修改 {{model.f_name}} 默认表具</label>
7
- </div>
8
- <div class="col-sm-12" role="group">
9
- <center v-if="!(type=='区'||type=='街道'||type=='小区') && !model.id && isbasch">
10
- <button class="btn" :class="isselected ? 'btn-info':'btn-default'" @click="changetosingle">单个添加</button>
11
- <button class="btn" :class="isselected ? 'btn-default':'btn-info'" @click="changetobatch">批量添加</button>
12
- </center>
13
- <div class="auto col-sm-12 margintop" v-show="parent.f_name!='' && parent.f_type!='' && !isarea">
14
- <span class="shangji">上级名称:<label class="name">{{parent.f_name}}</label></span>
15
- <span class="shangji">上级类型:<label class="name">{{parent.f_type=='区'?'区/县':parent.f_type}}</label></span>
16
- </div>
17
-
18
- <div v-if="isselected && !isarea" class="form-group col-sm-12" style="margin-bottom: 20px; margin-top: 30px">
19
- <span class="col-sm-2 font_normal_body shangji">{{model.f_type=='区'?'区/县':model.f_type}}名称:</span>
20
- <input type="text" v-model="model.f_name" class="col-sm-10 input" placeholder="请输入" >
21
- </div>
22
-
23
- <div v-if="!isselected && !(type=='小区') && isbasch">
24
- <div class="form-group col-sm-12" v-show="type=='楼号'">
25
- <span class="col-sm-2 font_normal_body name">楼号:</span>
26
- <input v-model="name_l" class="col-sm-6" />
27
- <span class="col-sm-2 font_normal_body name">名称:</span>
28
- <input v-model="name_l_t" class="col-sm-2" />
29
- </div>
30
- <div class="form-group remark" v-show="type=='楼号'">备注:例如1-5,10-18</div>
31
- <div class="form-group col-sm-12" v-show="type=='楼号'||type=='单元'">
32
- <span class="col-sm-2 font_normal_body name">单元:</span>
33
- <input class="col-sm-6" v-model="name_d"/>
34
- <span class="col-sm-2 font_normal_body name">名称:</span>
35
- <input class="col-sm-2" v-model="name_d_t"/>
36
- </div>
37
- <div class="form-group remark" v-show="type=='楼号'||type=='单元'">备注:例如1-4</div>
38
- <div class="form-group col-sm-12" v-show="type=='楼号'||type=='单元'||type=='楼层'">
39
- <span class="col-sm-2 font_normal_body name">楼层:</span>
40
- <input class="col-sm-6" v-model="name_c" />
41
- <span class="col-sm-2 font_normal_body name">名称:</span>
42
- <input class="col-sm-2" v-model="name_c_t" />
43
- </div>
44
- <div class="form-group remark" v-show="type=='楼号'||type=='单元'||type=='楼层'">备注:例如1-5,8-10</div>
45
- <div class="form-group col-sm-12">
46
- <span class="col-sm-2 font_normal_body name">门牌号:</span>
47
- <input v-model="name_m" class="col-sm-6"/>
48
- <span class="col-sm-2 font_normal_body name">名称:</span>
49
- <input v-model="name_m_t" class="col-sm-2"/>
50
- </div>
51
- <div class="form-group remark">备注:例如1-4,门牌号规则:单元+楼层+门牌号</div>
52
- </div>
53
- <div class="form-group auto" v-show="isarea">
54
- <new-address-info v-ref:newaddressinfo v-if="type=='小区'" :areatype="areatype" :row="areaData" @addchild="addChild" @signout="signOut"></new-address-info>
55
- </div>
56
- <div class="form-group col-sm-12" v-show="!(type=='小区') || !isarea">
57
- <button type="button" class="button_search button_spacing" @click="addChild" >保存</button>
58
- <button type="button" class="button_clear button_spacing" @click="signOut">取消</button>
59
- </div>
60
- </div>
61
- </div>
62
- </template>
63
-
64
- <script>
65
- import NewAddressInfo from './NewAddressInfo'
66
- import {HttpResetClass} from 'vue-client'
67
- // 提交地址
68
- let asyncAddChild = async function(self, val) {
69
- console.log('33333333333333333',val)
70
- let result = null
71
- let data = null
72
- //新增 || 修改
73
- if(val.id != null) {
74
- console.log("asyncAddChild=" , val)
75
- result = await self.$resetpost(`api/af-revenue/logic/address_addAddress`, val, {resolveMsg: null})
76
- // 添加小区 t_area
77
- if(val.f_type=='小区') {
78
- let parent = await self.$resetpost(`api/af-revenue/logic/address_parent`, {id: val.id + ""}, {resolveMsg: null})
79
- await self.$refs.newaddressinfo.confirm(result.data.id, parent.data)
80
- }
81
- } else {
82
- // 子地址 || 根地址
83
- if(val.f_parentId == null) {
84
- data = {data: {f_parentId: null, condition: `f_locationId=${val.f_locationId} and f_locationType='${val.f_locationType}' and f_name='${val.f_name}'`}}
85
- } else {
86
- data = {data: {f_parentId: val.f_parentId.id, condition: `f_name='${val.f_name}'`}}
87
- }
88
- console.log('444444444444444',data)
89
- result = await self.$resetpost('rs/path/address_getRoot', data, {resolveMsg: null})
90
- console.log('55555555555555',result)
91
- // 查询改地址是否已存在
92
- console.log('666666666666666',result.data.length)
93
- if(result.data.length > 0) {
94
- alert("该地址已存在")
95
- throw err = new Error( '该地址已存在' )
96
- } else {
97
- console.log("调剂的速度val: ", val)
98
- result = await self.$resetpost(`api/af-revenue/logic/address_addAddress`, val, {resolveMsg: null})
99
- // 添加小区 t_area
100
- console.log("result=" , result)
101
- if(result.data && val.f_type=='小区') {
102
- let parent = await self.$resetpost(`api/af-revenue/logic/address_parent`, {id: result.data.id+""}, {resolveMsg: null})
103
- await self.$refs.newaddressinfo.confirm(result.data.id, parent.data)
104
- }
105
- }
106
- }
107
- return result
108
- }
109
- // 获取地址
110
- let asyncGetAddress = async function(self,num) {
111
- let data = {data: {f_parentId: null, condition: `id='${self.f_parentid}'`}}
112
- let result
113
- if(num == 1){ //添加
114
- result = await self.$resetpost('api/af-revenue/sql/address_getSelf', {data: {id: self.f_parentid}}, {resolveMsg: null})
115
- } else { //修改
116
- result = await self.$resetpost('api/af-revenue/sql/address_getParent', {data: {id: self.model.id}}, {resolveMsg: null})
117
- }
118
- if(result.data.length > 0) {
119
- self.parent = result.data[0]
120
- } else {
121
- self.parent = {}
122
- }
123
- return result
124
- }
125
-
126
- export default {
127
- name: "AddressAddAddress",
128
- components: {NewAddressInfo},
129
- props: {
130
- // 主键 id
131
- row: {
132
- type: Object,
133
- },
134
- // 父节点id
135
- f_parentid: {
136
- type: Number,
137
- },
138
- //位置
139
- f_location: {
140
- type: Object,
141
- },
142
- // 地址类型
143
- type: {
144
- type: String,
145
- },
146
- // 是否显示小区信息
147
- isarea: {
148
- type: Boolean,
149
- default: false,
150
- },
151
- // 是否显示批量添加
152
- isbasch: {
153
- type: Boolean,
154
- default: true
155
- }
156
- },
157
- data() {
158
- return {
159
- model: {
160
- id: null, //地址id
161
- f_locationId: null, //位置id
162
- f_locationType: null,//位置类型
163
- f_parentId: null,//上级地址id
164
- f_name: '', //地址名称
165
- f_type: '', //地址类型
166
- },
167
- // 上级地址
168
- parent: {},
169
- // 小区信息
170
- areaData: null,
171
- // 小区 的 区名称
172
- areatype: '',
173
- isselected:true,
174
- // 楼号
175
- name_l: '',
176
- name_l_t: '',
177
- // 单元
178
- name_d: '',
179
- name_d_t: '',
180
- // 楼层
181
- name_c: '',
182
- name_c_t: '',
183
- // 门牌号
184
- name_m: '',
185
- name_m_t: '',
186
- }
187
- },
188
- ready () {
189
- if(this.row) {
190
- this.model = Object.assign({}, this.model, this.row)
191
- }
192
- if(this.f_parentid) {
193
- this.model.f_parentId = {id: this.f_parentid}
194
- return this.init()
195
- }
196
- if(this.f_location) {
197
- this.model.f_locationId = this.f_location.f_locationId
198
- this.model.f_locationType = this.f_location.f_locationType
199
- }
200
- if(this.type!='') {
201
- this.model.f_type = this.type
202
- }
203
- },
204
- watch: {
205
- 'f_location' (val) {
206
- this.isselected = true
207
- if(val) {
208
- this.model.f_locationId = val.f_locationId
209
- this.model.f_locationType = val.f_locationType
210
- } else {
211
- this.model.f_locationId = null
212
- this.model.f_locationType = null
213
- }
214
- },
215
- 'f_parentid' (val) {
216
- this.isselected = true
217
- // 添加
218
- if(val) {
219
- this.model.f_parentId = {id: val}
220
- this.addinit(val)
221
- } else {
222
- this.model.f_parentId = null
223
- this.parent = {}
224
- }
225
- },
226
- 'type' (val) {
227
- console.log("asdasd safffgg456756val", val)
228
- this.isselected = true
229
- if(val!='') {
230
- this.model.f_type = val
231
- }
232
- },
233
- 'row' (val) {
234
- console.log("val", val)
235
- this.isselected = true
236
- if(val) {
237
- this.getParent(val)
238
- } else {
239
- this.addArea()
240
- }
241
- }
242
- },
243
- methods: {
244
-
245
- // 添加
246
- async addinit(val){
247
- let http = new HttpResetClass()
248
- let res = await http.load('POST', 'api/af-revenue/sql/address_getSelf', {data: {id: this.f_parentid}}, {resolveMsg: null})
249
- this.parent = res.data.length > 0 ? res.data[0]: {}
250
- let parent = await http.load('POST', `api/af-revenue/logic/address_parent`, {id: val+""}, {resolveMsg: null, rejectMsg:'请求address_parent报错!!'})
251
- this.areatype = parent.data.f_area
252
- },
253
- // 初始化
254
- async init(num) {
255
- let data = {data: {f_parentId: null, condition: `id='${this.f_parentid}'`}}
256
- let result
257
- if(num == 1){ //添加
258
- result = await this.$resetpost('api/af-revenue/sql/address_getSelf', {data: {id: this.f_parentid}}, {resolveMsg: null})
259
- } else { //修改
260
- result = await this.$resetpost('api/af-revenue/sql/address_getParent', {data: {id: this.model.id}}, {resolveMsg: null})
261
- }
262
- if(result.data.length > 0) {
263
- this.parent = result.data[0]
264
- } else {
265
- this.parent = {}
266
- }
267
- return result
268
- },
269
- //提交地址
270
- addChild() {
271
- // 判断是否是批量添加
272
- if(!this.isselected && !(this.type=='小区') && this.isbasch) {
273
- console.log("批量添加,上级id: ", this.model.f_parentId)
274
- return this.baschAdd(this.model.f_parentId)
275
- } else {
276
- console.log('11111111111111111111',this.model)
277
- let data = Object.assign({}, data, this.model)
278
- console.log('2222222222222222',data)
279
- let id = this.model.id
280
- if(this.model.f_name != '') {
281
- return asyncAddChild(this, data).then((res) => {
282
- let result = data
283
- result.id = res.data.id
284
- this.model.f_name = ''
285
- this.model.idstr = null
286
- this.model.size = null
287
- this.isselected = true
288
- this.$parent.showAddress = !this.$parent.showAddress
289
- this.initModel()
290
- console.log("addChild", result)
291
- if(id != null) { // 修改
292
- this.$emit('updata-child-node', result)
293
- } else { //新增
294
- this.$emit('add-child-node', result)
295
- }
296
- }).catch((error) => {
297
- this.$emit('error', error)
298
- })
299
- } else {
300
- alert("名称和类型不能为空")
301
- }
302
- }
303
- },
304
- //返回
305
- signOut() {
306
- if (this.type === '小区') {
307
- this.$refs.newaddressinfo.initModel()
308
- }
309
- this.model.f_name = ''
310
- this.model.id = null
311
- this.isselected = true
312
- this.initModel()
313
- this.$parent.showAddress = !this.$parent.showAddress
314
- },
315
- async baschAdd(id) {
316
- if(!this.isselected) {
317
- let batchs = new Array()
318
- if(this.name_l != '') {
319
- if(this.name_l_t == ''){
320
- this.name_l_t = '号楼'
321
- }
322
- batchs.push({type: '楼号', names: this.name_l, n_type: this.name_l_t})
323
- }
324
- if(this.name_d != '') {
325
- if(this.name_d_t == ''){
326
- this.name_d_t = '单元'
327
- }
328
- batchs.push({type: '单元', names: this.name_d, n_type: this.name_d_t})
329
- }
330
- if(this.name_c != '') {
331
- if(this.name_c_t == ''){
332
- this.name_c_t = '层'
333
- }
334
- batchs.push({type: '楼层', names: this.name_c, n_type: this.name_c_t})
335
- }
336
- if(this.name_m != '') {
337
- if(this.name_m_t == ''){
338
- this.name_m_t = '号'
339
- }
340
- batchs.push({type: '门牌号', names: this.name_m, n_type: this.name_m_t})
341
- }
342
- console.log("批量添加baschAdd: ",batchs, " ", id)
343
- this.$showMessage('将会占用几分钟!!', ['confirm', 'cancel']).then((res) => {
344
- if (res === 'confirm') {
345
- this.isselected = true
346
- this.$parent.showAddress = !this.$parent.showAddress
347
- let http = new HttpResetClass()
348
- http.load('POST', 'api/af-revenue/logic/address_batch', {id: id.id+"", json: batchs}, {rejectMsg:'批量上传出错', resolveMsg: '地址导入完成'}, 0).then(() => {
349
- this.$showMessage('导入完成。。!', ['confirm']).then((res) => {
350
- if (res === 'confirm') {
351
- this.initModel()
352
- this.$emit('add-child-node')
353
- }
354
- })
355
- })
356
- }
357
- })
358
- // let http = new HttpResetClass()
359
- // await http.load('POST', `api/af-revenue/logic/address_batch`, {id: id.id+"", json: batchs})
360
- // this.isselected = true
361
- // this.initModel()
362
- // this.$parent.showAddress = !this.$parent.showAddress
363
- // this.$emit('add-child-node')
364
- }
365
- },
366
- // 新增
367
- addArea() {
368
- this.model.id = null
369
- this.parent = {}
370
- this.model.f_name = ''
371
- if(this.type=='') {
372
- this.model.f_type = ''
373
- }
374
- if(!this.f_location) {
375
- this.model.f_locationId = null
376
- this.model.f_locationType = null
377
- }
378
- if(!this.f_parentid){
379
- this.model.f_parentId = null
380
- }
381
- this.areaData = null
382
- },
383
- //
384
- async getParent(val) {
385
- let http = new HttpResetClass()
386
- let parent = await http.load('POST', `api/af-revenue/logic/address_parent`, {id: val.id+""}, {resolveMsg: null, rejectMsg:'请求address_parent报错!!'})
387
- this.areatype = parent.data.f_area
388
-
389
- this.model = Object.assign({}, this.model, val)
390
-
391
- let res = await http.load('POST', 'api/af-revenue/sql/address_getParent', {data: {id: this.model.id}}, {resolveMsg: null, rejectMsg:'请求address_getParent报错!!'})
392
- if(res.data.length > 0) {
393
- this.parent = res.data[0]
394
- } else {
395
- this.parent = {}
396
- }
397
-
398
- if(val.id != null && this.type=='小区') {
399
- let result = await http.load('POST','rs/path/address_getArea', {data: {id: val.id}}, {resolveMsg: null})
400
- if(result.data.length > 0) {
401
- this.areaData = result.data[0]
402
- } else {
403
- this.areaData = null
404
- }
405
- } else {
406
- this.areaData = null
407
- }
408
- },
409
-
410
- changetosingle(){
411
- this.isselected = true
412
- },
413
- changetobatch(){
414
- this.isselected = false
415
- },
416
- // 初始化参数
417
- initModel() {
418
- this.name_l = ''
419
- this.name_l_t = ''
420
- // 单元
421
- this.name_d = ''
422
- this.name_d_t = ''
423
- // 楼层
424
- this.name_c = ''
425
- this.name_c_t = ''
426
- // 门牌号
427
- this.name_m = ''
428
- this.name_m_t = ''
429
- }
430
- },
431
- }
432
- </script>
433
-
434
- <style type="text/css" scoped>
435
- *{
436
- margin: 0 auto;
437
- text-align: center;
438
- }
439
- div {
440
- margin-top: 10px;
441
- }
442
- .btngroup{
443
- height: 32px;
444
- width: 92px;
445
- }
446
- .btn-group > .btn:not(:first-child):not(:last-child):not(.dropdown-toggle){
447
- border-radius: 4px;
448
- border-bottom-right-radius: 0;
449
- border-top-right-radius: 0;
450
- }
451
- .add{
452
- font-family: PingFangSC-Medium;
453
- font-size: 24px;
454
- color: #333333;
455
- }
456
- .shangji{
457
- font-family: PingFangSC-Medium;
458
- font-size: 16px;
459
- color: #666666;
460
- }
461
- .name{
462
- font-family: PingFangSC-Bold;
463
- font-size: 16px;
464
- color: #333333;
465
- }
466
- .margintop{
467
- margin-top: 20px;
468
- }
469
- .input{
470
- background-color: #FFFFFF;
471
- border: 1px solid #999999;
472
- }
473
- .remark{
474
- font-family: PingFangSC-Medium;
475
- font-size: 14px;
476
- color: #666666;
477
- }
478
-
479
- </style>
1
+ <template>
2
+ <div class="auto content">
3
+ <div class="col-sm-12">
4
+ <label v-if="!model.id" class="add">添加{{type=='区'?'区/县':type}}</label>
5
+ <label v-if="model.id && !isarea" class="fs24">修改{{type=='区'?'区/县':type}}</label>
6
+ <label v-if="model.id && isarea" class="fs24">修改 {{model.f_name}} 默认表具</label>
7
+ </div>
8
+ <div class="col-sm-12" role="group">
9
+ <center v-if="!(type=='区'||type=='街道'||type=='小区') && !model.id && isbasch">
10
+ <button class="btn" :class="isselected ? 'btn-info':'btn-default'" @click="changetosingle">单个添加</button>
11
+ <button class="btn" :class="isselected ? 'btn-default':'btn-info'" @click="changetobatch">批量添加</button>
12
+ </center>
13
+ <div class="auto col-sm-12 margintop" v-show="parent.f_name!='' && parent.f_type!='' && !isarea">
14
+ <span class="shangji">上级名称:<label class="name">{{parent.f_name}}</label></span>
15
+ <span class="shangji">上级类型:<label class="name">{{parent.f_type=='区'?'区/县':parent.f_type}}</label></span>
16
+ </div>
17
+
18
+ <div v-if="isselected && !isarea" class="form-group col-sm-12" style="margin-bottom: 20px; margin-top: 30px">
19
+ <span class="col-sm-2 font_normal_body shangji">{{model.f_type=='区'?'区/县':model.f_type}}名称:</span>
20
+ <input type="text" v-model="model.f_name" class="col-sm-10 input" placeholder="请输入" >
21
+ </div>
22
+
23
+ <div v-if="!isselected && !(type=='小区') && isbasch">
24
+ <div class="form-group col-sm-12" v-show="type=='楼号'">
25
+ <span class="col-sm-2 font_normal_body name">楼号:</span>
26
+ <input v-model="name_l" class="col-sm-6" />
27
+ <span class="col-sm-2 font_normal_body name">名称:</span>
28
+ <input v-model="name_l_t" class="col-sm-2" />
29
+ </div>
30
+ <div class="form-group remark" v-show="type=='楼号'">备注:例如1-5,10-18</div>
31
+ <div class="form-group col-sm-12" v-show="type=='楼号'||type=='单元'">
32
+ <span class="col-sm-2 font_normal_body name">单元:</span>
33
+ <input class="col-sm-6" v-model="name_d"/>
34
+ <span class="col-sm-2 font_normal_body name">名称:</span>
35
+ <input class="col-sm-2" v-model="name_d_t"/>
36
+ </div>
37
+ <div class="form-group remark" v-show="type=='楼号'||type=='单元'">备注:例如1-4</div>
38
+ <div class="form-group col-sm-12" v-show="type=='楼号'||type=='单元'||type=='楼层'">
39
+ <span class="col-sm-2 font_normal_body name">楼层:</span>
40
+ <input class="col-sm-6" v-model="name_c" />
41
+ <span class="col-sm-2 font_normal_body name">名称:</span>
42
+ <input class="col-sm-2" v-model="name_c_t" />
43
+ </div>
44
+ <div class="form-group remark" v-show="type=='楼号'||type=='单元'||type=='楼层'">备注:例如1-5,8-10</div>
45
+ <div class="form-group col-sm-12">
46
+ <span class="col-sm-2 font_normal_body name">门牌号:</span>
47
+ <input v-model="name_m" class="col-sm-6"/>
48
+ <span class="col-sm-2 font_normal_body name">名称:</span>
49
+ <input v-model="name_m_t" class="col-sm-2"/>
50
+ </div>
51
+ <div class="form-group remark">备注:例如1-4,门牌号规则:单元+楼层+门牌号</div>
52
+ </div>
53
+ <div class="form-group auto" v-show="isarea">
54
+ <new-address-info v-ref:newaddressinfo v-if="type=='小区'" :areatype="areatype" :row="areaData" @addchild="addChild" @signout="signOut"></new-address-info>
55
+ </div>
56
+ <div class="form-group col-sm-12" v-show="!(type=='小区') || !isarea">
57
+ <button type="button" class="button_search button_spacing" @click="addChild" >保存</button>
58
+ <button type="button" class="button_clear button_spacing" @click="signOut">取消</button>
59
+ </div>
60
+ </div>
61
+ </div>
62
+ </template>
63
+
64
+ <script>
65
+ import NewAddressInfo from './NewAddressInfo'
66
+ import {HttpResetClass} from 'vue-client'
67
+ // 提交地址
68
+ let asyncAddChild = async function(self, val) {
69
+ console.log('33333333333333333',val)
70
+ let result = null
71
+ let data = null
72
+ //新增 || 修改
73
+ if(val.id != null) {
74
+ console.log("asyncAddChild=" , val)
75
+ result = await self.$resetpost(`api/af-revenue/logic/address_addAddress`, val, {resolveMsg: null})
76
+ // 添加小区 t_area
77
+ if(val.f_type=='小区') {
78
+ let parent = await self.$resetpost(`api/af-revenue/logic/address_parent`, {id: val.id + ""}, {resolveMsg: null})
79
+ await self.$refs.newaddressinfo.confirm(result.data.id, parent.data)
80
+ }
81
+ } else {
82
+ // 子地址 || 根地址
83
+ if(val.f_parentId == null) {
84
+ data = {data: {f_parentId: null, condition: `f_locationId=${val.f_locationId} and f_locationType='${val.f_locationType}' and f_name='${val.f_name}'`}}
85
+ } else {
86
+ data = {data: {f_parentId: val.f_parentId.id, condition: `f_name='${val.f_name}'`}}
87
+ }
88
+ console.log('444444444444444',data)
89
+ result = await self.$resetpost('rs/path/address_getRoot', data, {resolveMsg: null})
90
+ console.log('55555555555555',result)
91
+ // 查询改地址是否已存在
92
+ console.log('666666666666666',result.data.length)
93
+ if(result.data.length > 0) {
94
+ alert("该地址已存在")
95
+ throw err = new Error( '该地址已存在' )
96
+ } else {
97
+ console.log("调剂的速度val: ", val)
98
+ result = await self.$resetpost(`api/af-revenue/logic/address_addAddress`, val, {resolveMsg: null})
99
+ // 添加小区 t_area
100
+ console.log("result=" , result)
101
+ if(result.data && val.f_type=='小区') {
102
+ let parent = await self.$resetpost(`api/af-revenue/logic/address_parent`, {id: result.data.id+""}, {resolveMsg: null})
103
+ await self.$refs.newaddressinfo.confirm(result.data.id, parent.data)
104
+ }
105
+ }
106
+ }
107
+ return result
108
+ }
109
+ // 获取地址
110
+ let asyncGetAddress = async function(self,num) {
111
+ let data = {data: {f_parentId: null, condition: `id='${self.f_parentid}'`}}
112
+ let result
113
+ if(num == 1){ //添加
114
+ result = await self.$resetpost('api/af-revenue/sql/address_getSelf', {data: {id: self.f_parentid}}, {resolveMsg: null})
115
+ } else { //修改
116
+ result = await self.$resetpost('api/af-revenue/sql/address_getParent', {data: {id: self.model.id}}, {resolveMsg: null})
117
+ }
118
+ if(result.data.length > 0) {
119
+ self.parent = result.data[0]
120
+ } else {
121
+ self.parent = {}
122
+ }
123
+ return result
124
+ }
125
+
126
+ export default {
127
+ name: "AddressAddAddress",
128
+ components: {NewAddressInfo},
129
+ props: {
130
+ // 主键 id
131
+ row: {
132
+ type: Object,
133
+ },
134
+ // 父节点id
135
+ f_parentid: {
136
+ type: Number,
137
+ },
138
+ //位置
139
+ f_location: {
140
+ type: Object,
141
+ },
142
+ // 地址类型
143
+ type: {
144
+ type: String,
145
+ },
146
+ // 是否显示小区信息
147
+ isarea: {
148
+ type: Boolean,
149
+ default: false,
150
+ },
151
+ // 是否显示批量添加
152
+ isbasch: {
153
+ type: Boolean,
154
+ default: true
155
+ }
156
+ },
157
+ data() {
158
+ return {
159
+ model: {
160
+ id: null, //地址id
161
+ f_locationId: null, //位置id
162
+ f_locationType: null,//位置类型
163
+ f_parentId: null,//上级地址id
164
+ f_name: '', //地址名称
165
+ f_type: '', //地址类型
166
+ },
167
+ // 上级地址
168
+ parent: {},
169
+ // 小区信息
170
+ areaData: null,
171
+ // 小区 的 区名称
172
+ areatype: '',
173
+ isselected:true,
174
+ // 楼号
175
+ name_l: '',
176
+ name_l_t: '',
177
+ // 单元
178
+ name_d: '',
179
+ name_d_t: '',
180
+ // 楼层
181
+ name_c: '',
182
+ name_c_t: '',
183
+ // 门牌号
184
+ name_m: '',
185
+ name_m_t: '',
186
+ }
187
+ },
188
+ ready () {
189
+ if(this.row) {
190
+ this.model = Object.assign({}, this.model, this.row)
191
+ }
192
+ if(this.f_parentid) {
193
+ this.model.f_parentId = {id: this.f_parentid}
194
+ return this.init()
195
+ }
196
+ if(this.f_location) {
197
+ this.model.f_locationId = this.f_location.f_locationId
198
+ this.model.f_locationType = this.f_location.f_locationType
199
+ }
200
+ if(this.type!='') {
201
+ this.model.f_type = this.type
202
+ }
203
+ },
204
+ watch: {
205
+ 'f_location' (val) {
206
+ this.isselected = true
207
+ if(val) {
208
+ this.model.f_locationId = val.f_locationId
209
+ this.model.f_locationType = val.f_locationType
210
+ } else {
211
+ this.model.f_locationId = null
212
+ this.model.f_locationType = null
213
+ }
214
+ },
215
+ 'f_parentid' (val) {
216
+ this.isselected = true
217
+ // 添加
218
+ if(val) {
219
+ this.model.f_parentId = {id: val}
220
+ this.addinit(val)
221
+ } else {
222
+ this.model.f_parentId = null
223
+ this.parent = {}
224
+ }
225
+ },
226
+ 'type' (val) {
227
+ console.log("asdasd safffgg456756val", val)
228
+ this.isselected = true
229
+ if(val!='') {
230
+ this.model.f_type = val
231
+ }
232
+ },
233
+ 'row' (val) {
234
+ console.log("val", val)
235
+ this.isselected = true
236
+ if(val) {
237
+ this.getParent(val)
238
+ } else {
239
+ this.addArea()
240
+ }
241
+ }
242
+ },
243
+ methods: {
244
+
245
+ // 添加
246
+ async addinit(val){
247
+ let http = new HttpResetClass()
248
+ let res = await http.load('POST', 'api/af-revenue/sql/address_getSelf', {data: {id: this.f_parentid}}, {resolveMsg: null})
249
+ this.parent = res.data.length > 0 ? res.data[0]: {}
250
+ let parent = await http.load('POST', `api/af-revenue/logic/address_parent`, {id: val+""}, {resolveMsg: null, rejectMsg:'请求address_parent报错!!'})
251
+ this.areatype = parent.data.f_area
252
+ },
253
+ // 初始化
254
+ async init(num) {
255
+ let data = {data: {f_parentId: null, condition: `id='${this.f_parentid}'`}}
256
+ let result
257
+ if(num == 1){ //添加
258
+ result = await this.$resetpost('api/af-revenue/sql/address_getSelf', {data: {id: this.f_parentid}}, {resolveMsg: null})
259
+ } else { //修改
260
+ result = await this.$resetpost('api/af-revenue/sql/address_getParent', {data: {id: this.model.id}}, {resolveMsg: null})
261
+ }
262
+ if(result.data.length > 0) {
263
+ this.parent = result.data[0]
264
+ } else {
265
+ this.parent = {}
266
+ }
267
+ return result
268
+ },
269
+ //提交地址
270
+ addChild() {
271
+ // 判断是否是批量添加
272
+ if(!this.isselected && !(this.type=='小区') && this.isbasch) {
273
+ console.log("批量添加,上级id: ", this.model.f_parentId)
274
+ return this.baschAdd(this.model.f_parentId)
275
+ } else {
276
+ console.log('11111111111111111111',this.model)
277
+ let data = Object.assign({}, data, this.model)
278
+ console.log('2222222222222222',data)
279
+ let id = this.model.id
280
+ if(this.model.f_name != '') {
281
+ return asyncAddChild(this, data).then((res) => {
282
+ let result = data
283
+ result.id = res.data.id
284
+ this.model.f_name = ''
285
+ this.model.idstr = null
286
+ this.model.size = null
287
+ this.isselected = true
288
+ this.$parent.showAddress = !this.$parent.showAddress
289
+ this.initModel()
290
+ console.log("addChild", result)
291
+ if(id != null) { // 修改
292
+ this.$emit('updata-child-node', result)
293
+ } else { //新增
294
+ this.$emit('add-child-node', result)
295
+ }
296
+ }).catch((error) => {
297
+ this.$emit('error', error)
298
+ })
299
+ } else {
300
+ alert("名称和类型不能为空")
301
+ }
302
+ }
303
+ },
304
+ //返回
305
+ signOut() {
306
+ if (this.type === '小区') {
307
+ this.$refs.newaddressinfo.initModel()
308
+ }
309
+ this.model.f_name = ''
310
+ this.model.id = null
311
+ this.isselected = true
312
+ this.initModel()
313
+ this.$parent.showAddress = !this.$parent.showAddress
314
+ },
315
+ async baschAdd(id) {
316
+ if(!this.isselected) {
317
+ let batchs = new Array()
318
+ if(this.name_l != '') {
319
+ if(this.name_l_t == ''){
320
+ this.name_l_t = '号楼'
321
+ }
322
+ batchs.push({type: '楼号', names: this.name_l, n_type: this.name_l_t})
323
+ }
324
+ if(this.name_d != '') {
325
+ if(this.name_d_t == ''){
326
+ this.name_d_t = '单元'
327
+ }
328
+ batchs.push({type: '单元', names: this.name_d, n_type: this.name_d_t})
329
+ }
330
+ if(this.name_c != '') {
331
+ if(this.name_c_t == ''){
332
+ this.name_c_t = '层'
333
+ }
334
+ batchs.push({type: '楼层', names: this.name_c, n_type: this.name_c_t})
335
+ }
336
+ if(this.name_m != '') {
337
+ if(this.name_m_t == ''){
338
+ this.name_m_t = '号'
339
+ }
340
+ batchs.push({type: '门牌号', names: this.name_m, n_type: this.name_m_t})
341
+ }
342
+ console.log("批量添加baschAdd: ",batchs, " ", id)
343
+ this.$showMessage('将会占用几分钟!!', ['confirm', 'cancel']).then((res) => {
344
+ if (res === 'confirm') {
345
+ this.isselected = true
346
+ this.$parent.showAddress = !this.$parent.showAddress
347
+ let http = new HttpResetClass()
348
+ http.load('POST', 'api/af-revenue/logic/address_batch', {id: id.id+"", json: batchs}, {rejectMsg:'批量上传出错', resolveMsg: '地址导入完成'}, 0).then(() => {
349
+ this.$showMessage('导入完成。。!', ['confirm']).then((res) => {
350
+ if (res === 'confirm') {
351
+ this.initModel()
352
+ this.$emit('add-child-node')
353
+ }
354
+ })
355
+ })
356
+ }
357
+ })
358
+ // let http = new HttpResetClass()
359
+ // await http.load('POST', `api/af-revenue/logic/address_batch`, {id: id.id+"", json: batchs})
360
+ // this.isselected = true
361
+ // this.initModel()
362
+ // this.$parent.showAddress = !this.$parent.showAddress
363
+ // this.$emit('add-child-node')
364
+ }
365
+ },
366
+ // 新增
367
+ addArea() {
368
+ this.model.id = null
369
+ this.parent = {}
370
+ this.model.f_name = ''
371
+ if(this.type=='') {
372
+ this.model.f_type = ''
373
+ }
374
+ if(!this.f_location) {
375
+ this.model.f_locationId = null
376
+ this.model.f_locationType = null
377
+ }
378
+ if(!this.f_parentid){
379
+ this.model.f_parentId = null
380
+ }
381
+ this.areaData = null
382
+ },
383
+ //
384
+ async getParent(val) {
385
+ let http = new HttpResetClass()
386
+ let parent = await http.load('POST', `api/af-revenue/logic/address_parent`, {id: val.id+""}, {resolveMsg: null, rejectMsg:'请求address_parent报错!!'})
387
+ this.areatype = parent.data.f_area
388
+
389
+ this.model = Object.assign({}, this.model, val)
390
+
391
+ let res = await http.load('POST', 'api/af-revenue/sql/address_getParent', {data: {id: this.model.id}}, {resolveMsg: null, rejectMsg:'请求address_getParent报错!!'})
392
+ if(res.data.length > 0) {
393
+ this.parent = res.data[0]
394
+ } else {
395
+ this.parent = {}
396
+ }
397
+
398
+ if(val.id != null && this.type=='小区') {
399
+ let result = await http.load('POST','rs/path/address_getArea', {data: {id: val.id}}, {resolveMsg: null})
400
+ if(result.data.length > 0) {
401
+ this.areaData = result.data[0]
402
+ } else {
403
+ this.areaData = null
404
+ }
405
+ } else {
406
+ this.areaData = null
407
+ }
408
+ },
409
+
410
+ changetosingle(){
411
+ this.isselected = true
412
+ },
413
+ changetobatch(){
414
+ this.isselected = false
415
+ },
416
+ // 初始化参数
417
+ initModel() {
418
+ this.name_l = ''
419
+ this.name_l_t = ''
420
+ // 单元
421
+ this.name_d = ''
422
+ this.name_d_t = ''
423
+ // 楼层
424
+ this.name_c = ''
425
+ this.name_c_t = ''
426
+ // 门牌号
427
+ this.name_m = ''
428
+ this.name_m_t = ''
429
+ }
430
+ },
431
+ }
432
+ </script>
433
+
434
+ <style type="text/css" scoped>
435
+ *{
436
+ margin: 0 auto;
437
+ text-align: center;
438
+ }
439
+ div {
440
+ margin-top: 10px;
441
+ }
442
+ .btngroup{
443
+ height: 32px;
444
+ width: 92px;
445
+ }
446
+ .btn-group > .btn:not(:first-child):not(:last-child):not(.dropdown-toggle){
447
+ border-radius: 4px;
448
+ border-bottom-right-radius: 0;
449
+ border-top-right-radius: 0;
450
+ }
451
+ .add{
452
+ font-family: PingFangSC-Medium;
453
+ font-size: 24px;
454
+ color: #333333;
455
+ }
456
+ .shangji{
457
+ font-family: PingFangSC-Medium;
458
+ font-size: 16px;
459
+ color: #666666;
460
+ }
461
+ .name{
462
+ font-family: PingFangSC-Bold;
463
+ font-size: 16px;
464
+ color: #333333;
465
+ }
466
+ .margintop{
467
+ margin-top: 20px;
468
+ }
469
+ .input{
470
+ background-color: #FFFFFF;
471
+ border: 1px solid #999999;
472
+ }
473
+ .remark{
474
+ font-family: PingFangSC-Medium;
475
+ font-size: 14px;
476
+ color: #666666;
477
+ }
478
+
479
+ </style>