address-client 4.0.1 → 4.0.3

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 (167) 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/huaran/components/AddAreaMsg.vue +765 -0
  78. package/src/filiale/huaran/components/AddStreetOrPcd.vue +324 -0
  79. package/src/filiale/huaran/components/AddressList.vue +637 -0
  80. package/src/filiale/huaran/components/AreaList.vue +410 -0
  81. package/src/filiale/huaran/components/StreetList.vue +241 -0
  82. package/src/filiale/huaran/components/UserAddress.vue +919 -0
  83. package/src/filiale/huaran/sale.js +22 -0
  84. package/src/filiale/jingwei/UserAddress.vue +764 -764
  85. package/src/filiale/jingwei/sale.js +12 -12
  86. package/src/filiale/lixianV3/AreaList.vue +416 -416
  87. package/src/filiale/lixianV3/sale.js +12 -12
  88. package/src/filiale/macheng/AddAreaMsg.vue +635 -635
  89. package/src/filiale/macheng/AddStreetOrPcd.vue +231 -231
  90. package/src/filiale/macheng/AddressList.vue +613 -613
  91. package/src/filiale/macheng/AreaList.vue +318 -318
  92. package/src/filiale/macheng/CityManage.vue +76 -76
  93. package/src/filiale/macheng/StreetList.vue +186 -186
  94. package/src/filiale/macheng/UserAddress.vue +743 -743
  95. package/src/filiale/macheng/sale.js +17 -17
  96. package/src/filiale/meihekou/UserAddress.vue +898 -898
  97. package/src/filiale/meihekou/sale.js +8 -8
  98. package/src/filiale/qianneng/AddAreaMsg.vue +755 -755
  99. package/src/filiale/qianneng/AddStreetOrPcd.vue +328 -328
  100. package/src/filiale/qianneng/AddressList.vue +638 -638
  101. package/src/filiale/qianneng/AreaList.vue +431 -431
  102. package/src/filiale/qianneng/CityManage.vue +81 -81
  103. package/src/filiale/qianneng/UserAddress.vue +1125 -1125
  104. package/src/filiale/qianneng/sale.js +20 -20
  105. package/src/filiale/qinhua/AddAreaMsg.vue +743 -743
  106. package/src/filiale/qinhua/AddressList.vue +627 -627
  107. package/src/filiale/qinhua/AddressManage.vue +117 -117
  108. package/src/filiale/qinhua/AreaList.vue +425 -425
  109. package/src/filiale/qinhua/AreaManage.vue +100 -100
  110. package/src/filiale/qinhua/CityManage.vue +76 -76
  111. package/src/filiale/qinhua/StreetList.vue +241 -241
  112. package/src/filiale/qinhua/UserAddress.vue +894 -894
  113. package/src/filiale/qinhua/sale.js +20 -20
  114. package/src/filiale/rizhao/UserAddress.vue +897 -897
  115. package/src/filiale/rizhao/sale.js +8 -8
  116. package/src/filiale/rongcheng/AddressList.vue +363 -363
  117. package/src/filiale/rongcheng/UserAddress.vue +799 -799
  118. package/src/filiale/rongcheng/sale.js +11 -11
  119. package/src/filiale/shanggao/AddAreaMsg.vue +752 -752
  120. package/src/filiale/shanggao/AddStreetOrPcd.vue +312 -312
  121. package/src/filiale/shanggao/AddressList.vue +613 -613
  122. package/src/filiale/shanggao/AreaList.vue +436 -436
  123. package/src/filiale/shanggao/BuildingList.vue +129 -129
  124. package/src/filiale/shanggao/StreetList.vue +240 -240
  125. package/src/filiale/shanggao/UserAddress.vue +953 -953
  126. package/src/filiale/shanggao/sale.js +16 -16
  127. package/src/filiale/shanxian/AddAreaMsg.vue +766 -766
  128. package/src/filiale/shanxian/AddressList.vue +658 -658
  129. package/src/filiale/shanxian/AreaList.vue +458 -458
  130. package/src/filiale/shanxian/AreaManage.vue +107 -107
  131. package/src/filiale/shanxian/UserAddress.vue +900 -900
  132. package/src/filiale/shanxian/sale.js +15 -15
  133. package/src/filiale/shaoguan/AddAreaMsg.vue +629 -629
  134. package/src/filiale/shaoguan/UserAddress.vue +762 -762
  135. package/src/filiale/shaoguan/sale.js +11 -11
  136. package/src/filiale/tongchuan/AddAreaMsg.vue +635 -635
  137. package/src/filiale/tongchuan/AddStreetOrPcd.vue +351 -351
  138. package/src/filiale/tongchuan/AddressList.vue +379 -379
  139. package/src/filiale/tongchuan/AreaList.vue +315 -315
  140. package/src/filiale/tongchuan/AreaManage.vue +100 -100
  141. package/src/filiale/tongchuan/CityList.vue +133 -133
  142. package/src/filiale/tongchuan/StreetList.vue +215 -215
  143. package/src/filiale/tongchuan/UserAddress.vue +822 -822
  144. package/src/filiale/tongchuan/sale.js +19 -19
  145. package/src/filiale/wuhai/UserAddress.vue +795 -795
  146. package/src/filiale/wuhai/sale.js +12 -12
  147. package/src/filiale/xihu/AreaList.vue +409 -409
  148. package/src/filiale/xihu/StreetList.vue +238 -238
  149. package/src/filiale/xihu/sale.js +14 -14
  150. package/src/filiale/xinkang/AddAreaMsg.vue +780 -780
  151. package/src/filiale/xinkang/AreaList.vue +413 -413
  152. package/src/filiale/xinkang/sale.js +9 -9
  153. package/src/filiale/yangchun/AddAreaMsg.vue +764 -764
  154. package/src/filiale/yangchun/sale.js +7 -7
  155. package/src/filiale/zhongsheng/AddressList.vue +671 -671
  156. package/src/filiale/zhongsheng/AreaList.vue +500 -500
  157. package/src/filiale/zhongsheng/sale.js +12 -12
  158. package/src/filiale/zhongyi/AddAreaMsg.vue +757 -757
  159. package/src/filiale/zhongyi/sale.js +12 -12
  160. package/src/filiale/zhoukou/AddAreaMsg.vue +673 -673
  161. package/src/filiale/zhoukou/AddressList.vue +391 -391
  162. package/src/filiale/zhoukou/AddressManage.vue +115 -115
  163. package/src/filiale/zhoukou/AreaList.vue +319 -319
  164. package/src/filiale/zhoukou/AreaManage.vue +100 -100
  165. package/src/filiale/zhoukou/UserAddress.vue +925 -925
  166. package/src/filiale/zhoukou/sale.js +23 -23
  167. package/src/main.js +23 -23
@@ -1,822 +1,822 @@
1
- <template>
2
- <div class="auto" style="height:80%">
3
- <validator name='v'>
4
- <p class="bg-info text-center" style="padding: 8px;">{{usertype ? '特殊地址管理' : '民用地址管理'}}</p>
5
- <div class="auto select-overspread form-horizontal">
6
- <div class="form-group" v-if="!usertype&&!model.id&&!config.hasnumber">
7
- <input type="radio" id="true" value="one" v-model="onedata">
8
- <label for="one">单户</label>
9
- <input type="radio" id="false" value="more" v-model="onedata">
10
- <label for="more">多户</label>
11
- </div>
12
- <!--单个录入-->
13
- <div v-if="onedata=='one'" class="row">
14
- <div class="col-sm-6 form-group "
15
- :class="[$v.f_pcd_id.required ? 'has-error' : 'has-success']" v-if="!usertype">
16
- <label class="font_normal_body">省&ensp;市&ensp;区</label>
17
- <input type="text" style="width:41%" v-show="false" v-model="model.f_pcd_id"
18
- >
19
- <v-select :value.sync="model.f_pcd_id" :value-single="true"
20
- :options='pcdslist' placeholder='请选择'
21
- close-on-select search="true" @change="pcdChange" :disabled="!usertype">
22
- </v-select>
23
- </div>
24
- <div class="col-sm-6 form-group "
25
- :class="[$v.f_pcd_id.required ? 'has-error' : 'has-success']" v-if="usertype">
26
- <label class="font_normal_body">省&ensp;市&ensp;区</label>
27
- <input type="text" style="width:41%" v-show="false" v-model="model.f_pcd_id" v-validate:f_pcd_id='{required: true }'
28
- >
29
- <v-select :value.sync="model.f_pcd_id" :value-single="true"
30
- :options='pcdslist' placeholder='请选择'
31
- close-on-select search="true" @change="pcdChange" :disabled="!usertype">
32
- </v-select>
33
- </div>
34
-
35
- <div class="col-sm-6 form-group " v-if="!usertype"
36
- :class="[$v.f_street_id.required ? 'has-error' : 'has-success']">
37
- <label class="font_normal_body">街道/乡镇</label>
38
- <input type="text" style="width:41%" v-show="false" v-model="model.f_street_id"
39
- >
40
- <v-select :value.sync="model.f_street_id" :value-single="true"
41
- :options='streetslist' placeholder='请选择'
42
- close-on-select search="true" :disabled="!usertype">
43
- </v-select>
44
- </div>
45
- <div class="col-sm-6 form-group " v-if="usertype"
46
- :class="[$v.f_street_id.required ? 'has-error' : 'has-success']">
47
- <label class="font_normal_body">街道/乡镇</label>
48
- <input type="text" style="width:41%" v-show="false" v-model="model.f_street_id" v-validate:f_street_id='{required: true }'
49
- >
50
- <v-select :value.sync="model.f_street_id" :value-single="true"
51
- :options='streetslist' placeholder='请选择'
52
- @change="streetChange"
53
- close-on-select search="true" :disabled="!usertype">
54
- </v-select>
55
- </div>
56
- <div class="col-sm-6 form-group " v-if="!usertype"
57
- :class="[$v.f_residential_area_id1.required ? 'has-error' : 'has-success']">
58
- <label class="font_normal_body">小区名称</label>
59
- <input type="text" style="width:41%" v-show="false" v-model="model.f_residential_area_id"
60
- v-validate:f_residential_area_id1='{required: true }'>
61
- <v-select :value.sync="model.f_residential_area_id" :value-single="true"
62
- :options='areaslist' placeholder='请选择'
63
- @change="areaChange"
64
- close-on-select search="true">
65
- </v-select>
66
- </div>
67
-
68
- <div class="col-sm-6 form-group " v-if="usertype">
69
- <label class="font_normal_body">小区名称</label>
70
- <v-select :value.sync="model.f_residential_area_id" :value-single="true"
71
- :options='areaslist' placeholder='请选择'
72
- @change="areaChange"
73
- close-on-select search="true">
74
- </v-select>
75
- </div>
76
-
77
- <div class="col-sm-6 form-group " :class="[$v.slice_area1.required ? 'has-error' : 'has-success']" v-if="false">
78
- <label class="font_normal_body">片&emsp;&emsp;区</label>
79
- <input type="text" style="width:60%" class="input_search" v-show="false" v-model="$refs.slice.selectedItems"
80
- v-validate:slice_area1='{required: true }'>
81
- <v-select :value.sync="model.slice_area" v-model="model.slice_area" :value-single="true"
82
- :options='sliceArea' placeholder='片区/管理站' filer-key="name"
83
- close-on-select v-ref:slice>
84
- </v-select>
85
- </div>
86
- <!-- <div class="col-sm-6 form-group " v-if="!usertype">
87
- <label class="font_normal_body">地区类型</label>
88
- <v-select
89
- :value.sync="model.f_iscity" :value-single="true"
90
- :options='iscity' placeholder='请选择'
91
- @change="changecity"
92
- close-on-select>
93
- </v-select>
94
- </div>-->
95
- <div v-if="!usertype" class="col-sm-6 form-group ">
96
- <label for="f_address" class="font_normal_body">楼&emsp;&emsp;号</label>
97
- <input type="text" style="width:40%" v-model="model.f_building" class="input_search"
98
- placeholder="楼号"/>
99
- <input type="text" style="width:20%" v-model="model.f_building_suffix" class="input_search"
100
- />
101
-
102
- </div>
103
- <div v-if="!usertype" class="col-sm-6 form-group ">
104
- <label for="f_address" class="font_normal_body">单&emsp;&emsp;元</label>
105
- <input type="text" style="width:40%" v-model="model.f_unit" class="input_search" placeholder="单元"/>
106
- <input type="text" style="width:20%" v-model="model.f_unit_suffix" class="input_search"
107
- />
108
- </div>
109
- <div v-if="!usertype" class="col-sm-6 form-group ">
110
- <label for="f_address" class="font_normal_body">楼&emsp;&emsp;层</label>
111
- <input type="text" style="width:40%" v-model="model.f_floor" class="input_search"
112
- placeholder="楼层" />
113
- <input type="text" style="width:20%" v-model="model.f_floor_suffix" class="input_search"
114
- />
115
- </div>
116
- <div v-if="!usertype" class="col-sm-6 form-group "
117
- :class="[$v.f_room.required ? 'has-error' : 'has-success']">
118
- <label for="f_address" class="font_normal_body">门&ensp;牌&ensp;号</label>
119
- <input type="text" style="width:40%" v-model="model.f_room" class="input_search" placeholder="门牌号"
120
- v-validate:f_room='{required: true }'/>
121
- <input type="text" style="width:20%" v-model="model.f_room_suffix" class="input_search"
122
- />
123
- </div>
124
- <div class="col-sm-6 form-group">
125
- <label class="font_normal_body">地址状态</label>
126
- <v-select :value.sync="model.f_address_state" :value-single="true"
127
- class="select_list select"
128
- condition="f_address_state = '{}'"
129
- :options='addresstate' placeholder='地址状态'
130
- close-on-select>
131
- </v-select>
132
- </div>
133
- <div v-if="usertype" class="col-sm-12 form-group "
134
- :class="[$v.f_address.required ? 'has-error' : 'has-success']">
135
- <label for="f_address" class="font_normal_body">详细地址</label>
136
- <input type="text" style="width:80%" v-model="model.f_address" class="input_search" placeholder="详细地址"
137
- v-validate:f_address='{required: true }'/>
138
- </div>
139
- <div class="col-sm-6 form-group " v-if="config.hasnumber"
140
- :class="[$v.f_standard_number.required ? 'has-error' : 'has-success']">
141
- <label class="font_normal_body">&nbsp;&nbsp;&nbsp;规范号</label>
142
- <input type="text" v-model="model.f_standard_number"
143
- @change="standardyanzheng"
144
- class="input_search" style="width:60%" placeholder="地址规范号"
145
- v-validate:f_standard_number='{required: true }'>
146
- </div>
147
- <div class="col-sm-6 form-group " v-if="config.hasnumber"
148
- :class="[$v.f_contracts_number.required ? 'has-error' : 'has-success']">
149
- <label class="font_normal_body">&nbsp;&nbsp;&nbsp;合同号</label>
150
- <input type="text" v-model="model.f_contracts_number"
151
- @change="contractsyanzheng"
152
- class="input_search" style="width:60%" placeholder="合同顺序号"
153
- v-validate:f_contracts_number='{required: true }'>
154
- </div>
155
- <div class="col-sm-12 form-group">
156
- <label class="font_normal_body " >备&emsp;&emsp;注</label>
157
- <textarea class="input_textarea" rows="3" style="margin-top: 25px; width:80%;height: auto;" v-model="model.f_comments"></textarea>
158
- </div>
159
- <div style="text-align:right;margin-top:40px;margin-right:50px;" class="col-sm-12">
160
- <button class="button_search button_spacing" @click="confirm()" :disabled='!$v.valid'>保存</button>
161
- <button class="button_clear button_spacing" @click="cancel()">取消</button>
162
- </div>
163
-
164
- </div>
165
- <!--批量录入-->
166
- <div v-if="onedata=='more'" class="row">
167
- <div class="col-sm-6 form-group "
168
- :class="[$v.f_pcd_id.required ? 'has-error' : 'has-success']">
169
- <label class="font_normal_body">省&ensp;市&ensp;区</label>
170
- <input type="text" style="width:60%" v-show="false" v-model="model.f_pcd_id"
171
- >
172
- <v-select :value.sync="model.f_pcd_id" :value-single="true"
173
- :options='pcdslist' placeholder='请选择'
174
- close-on-select search="true" @change="pcdChange" :disabled="!usertype">
175
- </v-select>
176
- </div>
177
- <div class="col-sm-6 form-group "
178
- :class="[$v.f_street_id.required ? 'has-error' : 'has-success']">
179
- <label class="font_normal_body">街&emsp;&emsp;道</label>
180
- <input type="text" style="width:60%" v-show="false" v-model="model.f_street_id"
181
- >
182
- <v-select :value.sync="model.f_street_id" :value-single="true"
183
- :options='streetslist' placeholder='请选择'
184
- close-on-select search="true" :disabled="!usertype">
185
- </v-select>
186
- </div>
187
- <div class="col-sm-6 form-group "
188
- :class="[$v.f_residential_area_id.required ? 'has-error' : 'has-success']">
189
- <label class="font_normal_body">小区名称</label>
190
- <input type="text" style="width:60%" v-show="false" v-model="model.f_residential_area_id"
191
- v-validate:f_residential_area_id='{required: true }'>
192
- <v-select :value.sync="model.f_residential_area_id" :value-single="true"
193
- @change="areaChange"
194
- :options='areaslist' placeholder='请选择'
195
- close-on-select search="true">
196
- </v-select>
197
- </div>
198
- <div class="col-sm-6 form-group ">
199
- <label class="font_normal_body">片&emsp;&emsp;区</label>
200
- <v-select :value.sync="model.slice_area" v-model="model.slice_area" :value-single="true"
201
- :options='sliceArea' placeholder='片区/管理站' filer-key="name"
202
- close-on-select v-ref:slice>
203
- </v-select>
204
- </div>
205
-
206
- <div class="col-sm-6 form-group "
207
- :class="[$v.f_building_start.integernum || $v.f_building_start.dctest ?'has-error' : 'has-success']">
208
- <label for="f_address" class="font_normal_body">起始楼号</label>
209
- <input type="text" style="width:15%" placeholder="前缀" v-model="model.f_building_prefix" class="input_search"/>
210
- <input type="text" style="width:25%"
211
- v-validate:f_building_start='{integernum: true ,dctest: [model.f_building_end, "<=" ]}'
212
- v-model="model.f_building_start" class="input_search" placeholder="楼号"/>
213
- <input type="text" style="width:17%" v-model="model.f_building_suffix" class="input_search"/>
214
- </div>
215
- <div class="col-sm-6 form-group "
216
- :class="[$v.f_building_end.integernum ||$v.f_building_end.dctest ? 'has-error' : 'has-success']">
217
- <label for="f_address" class="font_normal_body">截止楼号</label>
218
- <input type="text" style="width:15%" placeholder="前缀" v-model="model.f_building_prefix" class="input_search"/>
219
- <input type="text" style="width:25%"
220
- v-validate:f_building_end='{integernum: true ,dctest: [model.f_building_start, ">=" ]}'
221
- v-model="model.f_building_end" class="input_search" placeholder="楼号"/>
222
- <input type="text" style="width:17%" v-model="model.f_building_suffix" class="input_search"
223
- />
224
- </div>
225
- <div class="col-sm-6 form-group "
226
- :class="[$v.f_unit_start.integernum || $v.f_unit_start.dctest ? 'has-error' : 'has-success']">
227
- <label for="f_address" class="font_normal_body">起始单元</label>
228
- <input type="text" style="width:15%" placeholder="前缀" v-model="model.f_unit_prefix" class="input_search" />
229
- <input type="text" style="width:25%"
230
- v-validate:f_unit_start='{integernum: true ,dctest: [model.f_unit_end, "<=" ]}'
231
- v-model="model.f_unit_start" class="input_search" placeholder="单元"/>
232
- <input type="text" style="width:17%" v-model="model.f_unit_suffix" class="input_search" />
233
- </div>
234
- <div class="col-sm-6 form-group "
235
- :class="[$v.f_unit_end.integernum ||$v.f_unit_end.dctest ? 'has-error' : 'has-success']">
236
- <label for="f_address" class="font_normal_body">截止单元</label>
237
- <input type="text" style="width:15%" placeholder="前缀" v-model="model.f_unit_prefix" class="input_search" />
238
- <input type="text" style="width:25%"
239
- v-validate:f_unit_end='{integernum: true ,dctest: [model.f_unit_start, ">="]}'
240
- v-model="model.f_unit_end" class="input_search" placeholder="单元"/>
241
- <input type="text" style="width:17%" v-model="model.f_unit_suffix" class="input_search"/>
242
- </div>
243
- <div class="col-sm-6 form-group "
244
- :class="[$v.f_floor_start.integernum || $v.f_floor_start.dctest ? 'has-error' : 'has-success']">
245
- <label for="f_address" class="font_normal_body">起始楼层</label>
246
- <input type="text" style="width:15%" placeholder="前缀" v-model="model.f_floor_prefix" class="input_search"/>
247
- <input type="text" style="width:25%"
248
- v-validate:f_floor_start='{integernum: true,dctest: [model.f_floor_end, "<=" ] }'
249
- v-model="model.f_floor_start" class="input_search" placeholder="楼层"/>
250
- <input type="text" style="width:17%" v-model="model.f_floor_suffix" class="input_search"/>
251
- </div>
252
- <div class="col-sm-6 form-group "
253
- :class="[$v.f_floor_end.integernum ||$v.f_floor_end.dctest ? 'has-error' : 'has-success']">
254
- <label for="f_address" class="font_normal_body">截止楼层</label>
255
- <input type="text" style="width:15%" placeholder="前缀" v-model="model.f_floor_prefix" class="input_search"/>
256
- <input type="text" style="width:25%" v-model="model.f_floor_end"
257
- v-validate:f_floor_end='{integernum: true,dctest: [model.f_floor_start, ">=" ] }'
258
- class="input_search" placeholder="楼层"/>
259
- <input type="text" style="width:17%" v-model="model.f_floor_suffix" class="input_search"/>
260
- </div>
261
- <div class="col-sm-6 form-group "
262
- :class="[$v.f_room_start.integernum || $v.f_room_start.dctest ? 'has-error' : 'has-success']">
263
- <label for="f_address" class="font_normal_body">起始门牌</label>
264
- <input type="text" style="width:15%" placeholder="前缀" v-model="model.f_room_prefix" class="input_search"/>
265
- <input type="text" style="width:25%" v-model="model.f_room_start"
266
- class="input_search" placeholder="门牌号"
267
- v-validate:f_room_start='{integernum: true ,dctest: [model.f_room_end, "<=" ]}'
268
- />
269
- <input type="text" style="width:17%" v-model="model.f_room_suffix" class="input_search"/>
270
- </div>
271
- <div class="col-sm-6 form-group "
272
- :class="[$v.f_room_end.integernum ||$v.f_room_end.dctest ? 'has-error' : 'has-success']">
273
- <label for="f_address" class="font_normal_body">截止门牌</label>
274
- <input type="text" style="width:15%" placeholder="前缀" v-model="model.f_room_prefix" class="input_search"/>
275
- <input type="text" style="width:25%" v-model="model.f_room_end" class="input_search" placeholder="门牌号"
276
- v-validate:f_room_end='{integernum: true ,dctest: [model.f_room_start, ">=" ]}'/>
277
- <input type="text" style="width:17%" v-model="model.f_room_suffix" class="input_search"/>
278
- </div>
279
- <div class="col-sm-6 form-group">
280
- <label class="font_normal_body">地址状态</label>
281
- <v-select :value.sync="model.f_address_state" :value-single="true"
282
- class="select_list select"
283
- condition="f_address_state = '{}'"
284
- :options='addresstate' placeholder='地址状态'
285
- close-on-select>
286
- </v-select>
287
- </div>
288
- <div class="col-sm-10 form-group ">
289
- <p class="navbar-text" style="margin-left: 10%">说明: 层数输入1,门牌号输入001。产生的最终门牌号显示1001</p>
290
- </div>
291
- <div class="col-sm-12 form-group">
292
- <label class="font_normal_body " style="margin-top:-20px">备&emsp;&emsp;注</label>
293
- <textarea class="input_textarea" rows="3" style="width:80%;height: auto;" v-model="model.f_comments"></textarea>
294
- </div>
295
- <div class="row">
296
- <div style="text-align:right;margin-top:20px;margin-right:50px;" class="col-sm-12">
297
- <button class="button_search button_spacing" @click="confirmall()" :disabled='!$v.valid'>保存</button>
298
- <button class="button_clear button_spacing" @click="cancel()">取消</button>
299
- </div>
300
- </div>
301
- </div>
302
- </div>
303
- </validator>
304
- </div>
305
- </template>
306
-
307
- <script>
308
- import {HttpResetClass} from 'vue-client'
309
-
310
-
311
- let getAreaConfig = async function (self) {
312
- // 获取气价里面的配置
313
- await self.$getConfig(self, 'UserAddress')
314
- console.log('原地址配置',self.config)
315
- console.log('获取地址配置',self.config)
316
- Object.assign(self.model, self.config)
317
- }
318
-
319
- export default {
320
- title: '用户地址添加',
321
- data () {
322
- return {
323
- //初始化省市区数据
324
- pcdslist:[],
325
- //初始化街道数据
326
- streetslist:[],
327
- //初始化街道数据
328
- areaslist:[],
329
- iscity:[{label:'市区',value:'市区'},{label:'乡镇',value:'乡镇'},{label:'全部',value:''}],
330
- config:{
331
- hasnumber:false,
332
- f_building_suffix: '号楼',
333
- f_unit_suffix: '单元',
334
- f_floor_suffix: '层',
335
- f_room_suffix: '室'
336
- },
337
- model: {
338
- f_pcd_id: '',
339
- f_street_id: '',
340
- f_comments:'',
341
- f_residential_area_id: '',
342
- f_pcd: '',
343
- f_street: '',
344
- f_residential_area: '',
345
- f_slice_area: '',
346
- slice_area:'',
347
- f_building: '',
348
- f_building_start: '',
349
- f_building_end: '',
350
- f_building_suffix: '',
351
- f_unit: '',
352
- f_unit_start: '',
353
- f_unit_end: '',
354
- f_unit_suffix: '',
355
- f_floor: '',
356
- f_floor_start: '',
357
- f_floor_end: '',
358
- f_floor_suffix: '',
359
- f_room: '',
360
- f_room_start: '',
361
- f_room_end: '',
362
- f_room_suffix: '',
363
- //详细地址
364
- f_address: '',
365
- //单位名称
366
- f_company: '',
367
- //单位地址
368
- f_company_address: '',
369
- },
370
- //判读是否为单个数据录入
371
- onedata: 'one',
372
- //选中所有地址
373
- addresslist: [],
374
- usertype:false,
375
-
376
- // 公司信息
377
- curorgid: [this.$login.f.orgid],
378
-
379
- f_orgid: '',
380
-
381
- sliceArea: []
382
- }
383
- },
384
- props: ['f_filialeids', 'row','operation','usertype'],
385
- ready(){
386
- this.initdata()
387
- getAreaConfig(this)
388
- this.model.f_building_suffix=this.config.f_building_suffix
389
- this.model.f_unit_suffix=this.config.f_unit_suffix
390
- this.model.f_floor_suffix=this.config.f_floor_suffix
391
- this.model.f_room_suffix=this.config.f_room_suffix
392
- },
393
- methods: {
394
- async changecity(){
395
- this.areaslist = []
396
- let condition = `isnull(f_iscity,'') = isnull('${this.model.f_iscity}','') and a.f_orgid = '${this.f_filialeids}'`
397
- let req = await this.$resetpost('api/af-revenue/sql/address_getresidential', {
398
- data: {
399
- condition: condition
400
- }
401
- }, {resolveMsg: null, rejectMsg: '获取地址失败!'})
402
- let redata = []
403
- req.data.forEach((row) => {
404
- redata.push({
405
- label: row.f_residential_area,
406
- value: row.id,
407
- data: row,
408
- id: row.id
409
- })
410
- })
411
- this.areaslist=redata
412
- },
413
- standardyanzheng() {
414
- console.log(this.model.f_standard_number.length)
415
- if (this.model.f_standard_number.length != 2){
416
- this.$showAlert('请输入正确的位数', 'warning', 2000)
417
- this.model.f_standard_number = ''
418
- }
419
- },
420
- contractsyanzheng(){
421
- console.log(this.model.f_contracts_number.length)
422
- if (this.model.f_contracts_number.length != 5){
423
- this.$showAlert('请输入正确的位数', 'warning', 2000)
424
- this.model.f_contracts_number = ''
425
- }
426
- },
427
- async initdata(){
428
- this.model.f_address_state = '已通气'
429
- this.initAreas(this.f_filialeids)
430
- // 添加特殊地址选省市区
431
-
432
- this.initpcds(` f_orgid = '${this.f_filialeids}'`)
433
- this.initstreets(` f_orgid = '${this.f_filialeids}' `)
434
- this.initareas(` f_orgid = '${this.f_filialeids}'`)
435
-
436
- },
437
-
438
- // 初始化片区
439
- async initAreas (val) {
440
- if (val) {
441
- let getAllArea = await this.$resetpost('/rs/search', {
442
- source: 'this.getParentByType($organization$).getAllChildrens().where(row.getType() == $zone$)',
443
- userid: this.$login.f.id
444
- }, {resolveMsg: null, rejectMsg: '获取片区出错!!!'})
445
-
446
- let arr = getAllArea.data.filter((res) => {
447
- return res.parentid == val
448
- })
449
- console.log('过滤之后的片区', arr)
450
- this.sliceArea = []
451
- arr.forEach((res) => {
452
- this.sliceArea.push({label: res.name, value: res.name})
453
- })
454
- }
455
- },
456
- //初始化省市区,添加街道
457
- async initpcds(pconditon){
458
- this.pcdslist = []
459
- let HttpReset = new HttpResetClass()
460
- let req = await HttpReset.load('POST', 'api/af-revenue/sql/address_singleTableOrderBy?pageNo=1&pageSize=9999999', {
461
- data: {
462
- items: '*',
463
- tablename: 't_pcd',
464
- orderitem: 'id',
465
- condition: pconditon
466
- }
467
- }, {resolveMsg: null, rejectMsg: '获取地址失败!'})
468
- let redata = []
469
- req.data.forEach((row, n) => {
470
- redata[n] = {
471
- label: row.f_pcd,
472
- value: row.id,
473
- data:row,
474
- id:row.id
475
- }
476
- })
477
- this.pcdslist=redata
478
- },
479
- //初始化街道 添加小区
480
- async initstreets(pconditon){
481
- this.streetslist = []
482
- let HttpReset = new HttpResetClass()
483
- let req = await HttpReset.load('POST', 'api/af-revenue/sql/address_singleTableOrderBy', {
484
- data: {
485
- items: '*',
486
- tablename: 't_street',
487
- orderitem: 'id',
488
- condition: pconditon
489
- }
490
- }, {resolveMsg: null, rejectMsg: '获取地址失败!'})
491
- let redata = []
492
- req.data.forEach((row, n) => {
493
- redata[n] = {
494
- label: row.f_street,
495
- value: row.id,
496
- data:row,
497
- id:row.id
498
- }
499
- })
500
- this.streetslist=redata
501
- },
502
- //初始化小区添加小区
503
- async initareas(pconditon){
504
- // if(this.usertype){
505
- // pconditon=pconditon+` and f_special='1' `
506
- // }
507
- this.areaslist = []
508
- let HttpReset = new HttpResetClass()
509
- let req = await HttpReset.load('POST', 'api/af-revenue/sql/address_singleTableOrderBy?pageNo=1&pageSize=9999999', {
510
- data: {
511
- items: '*',
512
- tablename: 't_area',
513
- orderitem: 'id',
514
- condition: pconditon
515
- }
516
- }, {resolveMsg: null, rejectMsg: '获取地址失败!'})
517
- let redata = []
518
- req.data.forEach((row) => {
519
- redata.push({
520
- label: row.f_residential_area,
521
- value: row.id,
522
- data: row,
523
- id: row.id
524
- })
525
- })
526
- this.areaslist=redata
527
- },
528
- //省/市/区变化
529
- async pcdChange(val){
530
- // 只有添加特殊地址时才级联
531
- if (!this.usertype) {
532
- return
533
- }
534
- console.log("省/市/区变化",val)
535
- if(val){
536
- //那就把[小区,街道]重新组织一下
537
- await this.initstreets(` f_pcd_id ='${val}' `)
538
- if(this.model.f_street_id){
539
- if (this.findbyid(this.streetslist,this.model.f_street_id)) {
540
- let pcd_id=this.findbyid(this.streetslist,this.model.f_street_id).f_pcd_id
541
- if(pcd_id!=val){
542
- this.model.f_street_id=''
543
- }
544
- } else {
545
- this.model.f_street_id=''
546
- }
547
-
548
- //那就把[小区,街道]重新组织一下
549
- if (this.model.f_street_id) {
550
- await this.initareas(` f_street_id ='${this.model.f_street_id}' `)
551
- if(this.model.f_residential_area_id){
552
- if (this.findbyid(this.areaslist,this.model.f_residential_area_id)) {
553
- let pcd_id=this.findbyid(this.areaslist,this.model.f_residential_area_id).f_pcd_id
554
- if(pcd_id!=val){
555
- this.model.f_residential_area_id=''
556
- }
557
- } else {
558
- this.model.f_residential_area_id=''
559
- }
560
-
561
- }
562
- }
563
- }
564
- }
565
- this.$resetValidation()
566
- },
567
- //小区变化
568
- areaChange(val){
569
- console.log("小区变化",val)
570
- // 选择小区后级联出省市区和街道
571
- let selectArea // 选中的小区数据
572
- for (let row of this.areaslist) {
573
- if (val == row.value) {
574
- selectArea = row.data
575
- break
576
- }
577
- }
578
- if (selectArea) {
579
- this.model.f_street_id = selectArea.f_street_id
580
- this.model.f_pcd_id = selectArea.f_pcd_id
581
- this.initstreets(` f_filialeid = '${this.f_filialeids}' and id ='${selectArea.f_street_id}' `)
582
- this.initpcds(` f_filialeid = '${this.f_filialeids}' and id ='${selectArea.f_pcd_id}' `)
583
- this.model.slice_area = selectArea.f_slice_area
584
- // 拼接地址
585
- this.model.f_address = `${selectArea.f_street}${selectArea.f_residential_area}`
586
- }
587
- this.$nextTick(() => {
588
- this.$resetValidation()
589
- })
590
- },
591
- //街道变化
592
- async streetChange(val){
593
- console.log("街道变化",val)
594
- if(this.streetslist[0]) {
595
- var street=''
596
- this.streetslist.forEach((item)=>{
597
- if(item.id===val){
598
- street=item.label
599
- }
600
- })
601
- this.model.f_address = street
602
- }
603
- if(val){
604
- //那就把[小区]重新组织一下
605
- await this.initareas(` f_street_id ='${val}' `)
606
- if(this.model.f_residential_area_id){
607
- if (this.findbyid(this.areaslist,this.model.f_residential_area_id)) {
608
- let street_id=this.findbyid(this.areaslist,this.model.f_residential_area_id).f_street_id
609
- if(street_id!=val){
610
- this.model.f_residential_area_id=''
611
- }
612
- } else {
613
- this.model.f_residential_area_id=''
614
- }
615
-
616
- }
617
- }
618
- this.$resetValidation()
619
- },
620
-
621
- getorg (val) {
622
- this.f_orgid = val[0]
623
- },
624
-
625
- //处理批量地址信息
626
- dealaddlist(){
627
- try {
628
- var resultlist=[]
629
- for (var i = parseInt(this.model.f_building_start); i <= parseInt(this.model.f_building_end); i++) {
630
- for (var j = parseInt(this.model.f_unit_start); j <= parseInt(this.model.f_unit_end); j++) {
631
- for (var m = parseInt(this.model.f_floor_start); m <= parseInt(this.model.f_floor_end); m++) {
632
- for (var n = parseInt(this.model.f_room_start); n <= parseInt(this.model.f_room_end); n++) {
633
- //预备一个空的json
634
- console.log('批量', this.model)
635
- let data=Object.assign({},this.model)
636
- data.f_create_person= this.$login.f.name
637
- data.f_building= data.f_building_prefix + i
638
- data.f_unit= data.f_unit_prefix + j
639
- data.f_floor= data.f_floor_prefix + m
640
- // 目前房号都按两位处理 如: 101室 201室 110室
641
- if ((n+'').length == 1) {
642
- data.f_room = data.f_room_prefix + m + '0' + n
643
- } else {
644
- data.f_room = data.f_room_prefix + m + '' + n
645
- }
646
- data.f_filialeid = this.f_filialeids
647
- data.f_operator = this.$login.f.name
648
- data.f_operatorid = this.$login.f.id
649
- data.f_orgid = this.$login.f.orgid
650
- data.f_orgname = this.$login.f.orgs
651
- data.f_depid = this.$login.f.depids
652
- data.f_depname = this.$login.f.deps
653
- data.f_pcd=this.findbyid(this.pcdslist,this.model.f_pcd_id).f_pcd
654
- data.f_street=this.findbyid(this.streetslist,this.model.f_street_id).f_street
655
- data.f_residential_area=this.findbyid(this.areaslist,this.model.f_residential_area_id).f_residential_area
656
- data.f_address = data.f_street
657
- + data.f_residential_area +
658
- data.f_building + data.f_building_suffix
659
- + data.f_unit + data.f_unit_suffix
660
- + data.f_floor + data.f_floor_suffix
661
- + data.f_room + data.f_room_suffix
662
- if (this.model.slice_area) {
663
- data.f_slice_area = this.model.slice_area
664
-
665
- }
666
- resultlist.push(data)
667
- }
668
- }
669
- }
670
- }
671
- this.addresslist=resultlist
672
- } catch (e) {
673
- console.log(e)
674
- this.$showAlert('输出数据有误,请检查', 'warning', 2000)
675
- }
676
- },
677
- //保存多个
678
- async confirmall(){
679
- this.dealaddlist()
680
- if(this.addresslist.length>0){
681
- let msg = {
682
- resolveMsg: '地址保存成功',
683
- rejectMsg: '地址保存失败'
684
- }
685
- this.$showMessage('确定要批量添加'+this.addresslist.length+'户地址吗?,如有已经存在的,将会重复添加!!!', ['confirm', 'cancel']).then((res) => {
686
- if (res === 'confirm') {
687
- this.$resetpost('api/af-revenue/logic/address_adduserlist',{data: {addlist:this.addresslist}},msg).then((req) => {
688
- this.cleardara()
689
- this.$dispatch('confirm')
690
- })
691
- }
692
- })
693
- }
694
- },
695
- //保存
696
- async confirm(){
697
- if(this.onedata=='one'){
698
- await this.saveonedata()
699
- }
700
- this.cleardara()
701
- this.$dispatch('confirm')
702
- },
703
- //保存一户信息
704
- async saveonedata(){
705
- this.model.f_create_person= this.$login.f.name
706
- this.model.f_filialeid = this.f_filialeids
707
- this.model.f_operator = this.$login.f.name
708
- this.model.f_operatorid = this.$login.f.id
709
- this.model.f_orgid = this.$login.f.orgid
710
- this.model.f_orgname = this.$login.f.orgs
711
- this.model.f_depid = this.$login.f.depids
712
- this.model.f_depname = this.$login.f.deps
713
- console.log("片区:",this.model.slice_area)
714
- if (this.model.slice_area ) {
715
- if (this.model.slice_area instanceof Array) {
716
- console.log("修改",this.model.slice_area)
717
- this.model.f_slice_area = this.model.slice_area[0].name
718
- }else{
719
- console.log("保存",this.model.slice_area)
720
- this.model.f_slice_area = this.model.slice_area
721
- }
722
- }
723
- if (this.usertype) {
724
- //非民用
725
- this.model.f_special='1'
726
- this.model.f_building_suffix=''
727
- this.model.f_unit_suffix=''
728
- this.model.f_floor_suffix=''
729
- this.model.f_room_suffix=''
730
- this.model.f_pcd=this.findbyid(this.pcdslist,this.model.f_pcd_id).f_pcd
731
- this.model.f_street=this.findbyid(this.streetslist,this.model.f_street_id).f_street
732
- this.model.f_residential_area = this.findbyid(this.areaslist,this.model.f_residential_area_id) ? this.findbyid(this.areaslist,this.model.f_residential_area_id).f_residential_area : ''
733
- } else {
734
- //民用
735
- this.model.f_pcd=this.findbyid(this.pcdslist,this.model.f_pcd_id).f_pcd
736
- this.model.f_street=this.findbyid(this.streetslist,this.model.f_street_id).f_street
737
- this.model.f_residential_area=this.findbyid(this.areaslist,this.model.f_residential_area_id).f_residential_area
738
- this.model.f_address = this.model.f_street + this.model.f_residential_area + (this.model.f_building?this.model.f_building +this.model.f_building_suffix:'') + (this.model.f_unit?this.model.f_unit +this.model.f_unit_suffix:'') + (this.model.f_floor?this.model.f_floor +this.model.f_floor_suffix:'') + this.model.f_room + this.model.f_room_suffix
739
- }
740
- await this.$resetpost('api/af-revenue/logic/address_updateuseraddress', this.model)
741
- },
742
- cancel(){
743
- this.cleardara()
744
- this.$dispatch('cancel')
745
- },
746
- cleardara(){
747
- this.model= {
748
- f_pcd_id: '',
749
- f_street_id: '',
750
- f_residential_area_id: '',
751
- f_pcd: '',
752
- f_comments:'',
753
- f_street: '',
754
- f_residential_area: '',
755
- f_slice_area: '',
756
- slice_area: '',
757
- f_building: '',
758
- f_building_start: '',
759
- f_building_end: '',
760
- f_building_prefix: '',
761
- f_building_suffix: this.config.f_building_suffix,
762
- f_unit: '',
763
- f_unit_start: '',
764
- f_unit_end: '',
765
- f_unit_prefix: '',
766
- f_unit_suffix: this.config.f_unit_suffix,
767
- f_floor: '',
768
- f_floor_start: '',
769
- f_floor_end: '',
770
- f_floor_prefix: '',
771
- f_floor_suffix: this.config.f_floor_suffix,
772
- f_room: '',
773
- f_room_start: '',
774
- f_room_end: '',
775
- f_room_prefix: '',
776
- f_room_suffix: this.config.f_room_suffix,
777
- //详细地址
778
- f_address: '',
779
- //单位名称
780
- f_company: '',
781
- //单位地址
782
- f_company_address: '',
783
- }
784
- // this.pcdslist = []
785
- // this.streetslist = []
786
- // this.areaslist = []
787
- },
788
-
789
- //根据名字找数据
790
- findbyid(list,name){
791
- var result
792
- list.forEach((row, n) => {
793
- if(name==row.value){
794
- result= row.data
795
- }
796
- })
797
- return result
798
- },
799
- },
800
- watch: {
801
- //分公司变化
802
- 'f_filialeids'(){
803
- if (this.model.f_filialeid) {
804
- if (this.model.f_filialeid != this.f_filialeids) {
805
- this.$dispatch('cancel')
806
- }
807
- }
808
- this.cleardara()
809
- this.initdata()
810
- },
811
- 'row'(){
812
- this.onedata='one'
813
- }
814
- },
815
- computed: {
816
- //地址状态下拉框
817
- addresstate() {
818
- return [{label: '全部', value: ''}, ...this.$appdata.getParam('地址状态')]
819
- }
820
- }
821
- }
822
- </script>
1
+ <template>
2
+ <div class="auto" style="height:80%">
3
+ <validator name='v'>
4
+ <p class="bg-info text-center" style="padding: 8px;">{{usertype ? '特殊地址管理' : '民用地址管理'}}</p>
5
+ <div class="auto select-overspread form-horizontal">
6
+ <div class="form-group" v-if="!usertype&&!model.id&&!config.hasnumber">
7
+ <input type="radio" id="true" value="one" v-model="onedata">
8
+ <label for="one">单户</label>
9
+ <input type="radio" id="false" value="more" v-model="onedata">
10
+ <label for="more">多户</label>
11
+ </div>
12
+ <!--单个录入-->
13
+ <div v-if="onedata=='one'" class="row">
14
+ <div class="col-sm-6 form-group "
15
+ :class="[$v.f_pcd_id.required ? 'has-error' : 'has-success']" v-if="!usertype">
16
+ <label class="font_normal_body">省&ensp;市&ensp;区</label>
17
+ <input type="text" style="width:41%" v-show="false" v-model="model.f_pcd_id"
18
+ >
19
+ <v-select :value.sync="model.f_pcd_id" :value-single="true"
20
+ :options='pcdslist' placeholder='请选择'
21
+ close-on-select search="true" @change="pcdChange" :disabled="!usertype">
22
+ </v-select>
23
+ </div>
24
+ <div class="col-sm-6 form-group "
25
+ :class="[$v.f_pcd_id.required ? 'has-error' : 'has-success']" v-if="usertype">
26
+ <label class="font_normal_body">省&ensp;市&ensp;区</label>
27
+ <input type="text" style="width:41%" v-show="false" v-model="model.f_pcd_id" v-validate:f_pcd_id='{required: true }'
28
+ >
29
+ <v-select :value.sync="model.f_pcd_id" :value-single="true"
30
+ :options='pcdslist' placeholder='请选择'
31
+ close-on-select search="true" @change="pcdChange" :disabled="!usertype">
32
+ </v-select>
33
+ </div>
34
+
35
+ <div class="col-sm-6 form-group " v-if="!usertype"
36
+ :class="[$v.f_street_id.required ? 'has-error' : 'has-success']">
37
+ <label class="font_normal_body">街道/乡镇</label>
38
+ <input type="text" style="width:41%" v-show="false" v-model="model.f_street_id"
39
+ >
40
+ <v-select :value.sync="model.f_street_id" :value-single="true"
41
+ :options='streetslist' placeholder='请选择'
42
+ close-on-select search="true" :disabled="!usertype">
43
+ </v-select>
44
+ </div>
45
+ <div class="col-sm-6 form-group " v-if="usertype"
46
+ :class="[$v.f_street_id.required ? 'has-error' : 'has-success']">
47
+ <label class="font_normal_body">街道/乡镇</label>
48
+ <input type="text" style="width:41%" v-show="false" v-model="model.f_street_id" v-validate:f_street_id='{required: true }'
49
+ >
50
+ <v-select :value.sync="model.f_street_id" :value-single="true"
51
+ :options='streetslist' placeholder='请选择'
52
+ @change="streetChange"
53
+ close-on-select search="true" :disabled="!usertype">
54
+ </v-select>
55
+ </div>
56
+ <div class="col-sm-6 form-group " v-if="!usertype"
57
+ :class="[$v.f_residential_area_id1.required ? 'has-error' : 'has-success']">
58
+ <label class="font_normal_body">小区名称</label>
59
+ <input type="text" style="width:41%" v-show="false" v-model="model.f_residential_area_id"
60
+ v-validate:f_residential_area_id1='{required: true }'>
61
+ <v-select :value.sync="model.f_residential_area_id" :value-single="true"
62
+ :options='areaslist' placeholder='请选择'
63
+ @change="areaChange"
64
+ close-on-select search="true">
65
+ </v-select>
66
+ </div>
67
+
68
+ <div class="col-sm-6 form-group " v-if="usertype">
69
+ <label class="font_normal_body">小区名称</label>
70
+ <v-select :value.sync="model.f_residential_area_id" :value-single="true"
71
+ :options='areaslist' placeholder='请选择'
72
+ @change="areaChange"
73
+ close-on-select search="true">
74
+ </v-select>
75
+ </div>
76
+
77
+ <div class="col-sm-6 form-group " :class="[$v.slice_area1.required ? 'has-error' : 'has-success']" v-if="false">
78
+ <label class="font_normal_body">片&emsp;&emsp;区</label>
79
+ <input type="text" style="width:60%" class="input_search" v-show="false" v-model="$refs.slice.selectedItems"
80
+ v-validate:slice_area1='{required: true }'>
81
+ <v-select :value.sync="model.slice_area" v-model="model.slice_area" :value-single="true"
82
+ :options='sliceArea' placeholder='片区/管理站' filer-key="name"
83
+ close-on-select v-ref:slice>
84
+ </v-select>
85
+ </div>
86
+ <!-- <div class="col-sm-6 form-group " v-if="!usertype">
87
+ <label class="font_normal_body">地区类型</label>
88
+ <v-select
89
+ :value.sync="model.f_iscity" :value-single="true"
90
+ :options='iscity' placeholder='请选择'
91
+ @change="changecity"
92
+ close-on-select>
93
+ </v-select>
94
+ </div>-->
95
+ <div v-if="!usertype" class="col-sm-6 form-group ">
96
+ <label for="f_address" class="font_normal_body">楼&emsp;&emsp;号</label>
97
+ <input type="text" style="width:40%" v-model="model.f_building" class="input_search"
98
+ placeholder="楼号"/>
99
+ <input type="text" style="width:20%" v-model="model.f_building_suffix" class="input_search"
100
+ />
101
+
102
+ </div>
103
+ <div v-if="!usertype" class="col-sm-6 form-group ">
104
+ <label for="f_address" class="font_normal_body">单&emsp;&emsp;元</label>
105
+ <input type="text" style="width:40%" v-model="model.f_unit" class="input_search" placeholder="单元"/>
106
+ <input type="text" style="width:20%" v-model="model.f_unit_suffix" class="input_search"
107
+ />
108
+ </div>
109
+ <div v-if="!usertype" class="col-sm-6 form-group ">
110
+ <label for="f_address" class="font_normal_body">楼&emsp;&emsp;层</label>
111
+ <input type="text" style="width:40%" v-model="model.f_floor" class="input_search"
112
+ placeholder="楼层" />
113
+ <input type="text" style="width:20%" v-model="model.f_floor_suffix" class="input_search"
114
+ />
115
+ </div>
116
+ <div v-if="!usertype" class="col-sm-6 form-group "
117
+ :class="[$v.f_room.required ? 'has-error' : 'has-success']">
118
+ <label for="f_address" class="font_normal_body">门&ensp;牌&ensp;号</label>
119
+ <input type="text" style="width:40%" v-model="model.f_room" class="input_search" placeholder="门牌号"
120
+ v-validate:f_room='{required: true }'/>
121
+ <input type="text" style="width:20%" v-model="model.f_room_suffix" class="input_search"
122
+ />
123
+ </div>
124
+ <div class="col-sm-6 form-group">
125
+ <label class="font_normal_body">地址状态</label>
126
+ <v-select :value.sync="model.f_address_state" :value-single="true"
127
+ class="select_list select"
128
+ condition="f_address_state = '{}'"
129
+ :options='addresstate' placeholder='地址状态'
130
+ close-on-select>
131
+ </v-select>
132
+ </div>
133
+ <div v-if="usertype" class="col-sm-12 form-group "
134
+ :class="[$v.f_address.required ? 'has-error' : 'has-success']">
135
+ <label for="f_address" class="font_normal_body">详细地址</label>
136
+ <input type="text" style="width:80%" v-model="model.f_address" class="input_search" placeholder="详细地址"
137
+ v-validate:f_address='{required: true }'/>
138
+ </div>
139
+ <div class="col-sm-6 form-group " v-if="config.hasnumber"
140
+ :class="[$v.f_standard_number.required ? 'has-error' : 'has-success']">
141
+ <label class="font_normal_body">&nbsp;&nbsp;&nbsp;规范号</label>
142
+ <input type="text" v-model="model.f_standard_number"
143
+ @change="standardyanzheng"
144
+ class="input_search" style="width:60%" placeholder="地址规范号"
145
+ v-validate:f_standard_number='{required: true }'>
146
+ </div>
147
+ <div class="col-sm-6 form-group " v-if="config.hasnumber"
148
+ :class="[$v.f_contracts_number.required ? 'has-error' : 'has-success']">
149
+ <label class="font_normal_body">&nbsp;&nbsp;&nbsp;合同号</label>
150
+ <input type="text" v-model="model.f_contracts_number"
151
+ @change="contractsyanzheng"
152
+ class="input_search" style="width:60%" placeholder="合同顺序号"
153
+ v-validate:f_contracts_number='{required: true }'>
154
+ </div>
155
+ <div class="col-sm-12 form-group">
156
+ <label class="font_normal_body " >备&emsp;&emsp;注</label>
157
+ <textarea class="input_textarea" rows="3" style="margin-top: 25px; width:80%;height: auto;" v-model="model.f_comments"></textarea>
158
+ </div>
159
+ <div style="text-align:right;margin-top:40px;margin-right:50px;" class="col-sm-12">
160
+ <button class="button_search button_spacing" @click="confirm()" :disabled='!$v.valid'>保存</button>
161
+ <button class="button_clear button_spacing" @click="cancel()">取消</button>
162
+ </div>
163
+
164
+ </div>
165
+ <!--批量录入-->
166
+ <div v-if="onedata=='more'" class="row">
167
+ <div class="col-sm-6 form-group "
168
+ :class="[$v.f_pcd_id.required ? 'has-error' : 'has-success']">
169
+ <label class="font_normal_body">省&ensp;市&ensp;区</label>
170
+ <input type="text" style="width:60%" v-show="false" v-model="model.f_pcd_id"
171
+ >
172
+ <v-select :value.sync="model.f_pcd_id" :value-single="true"
173
+ :options='pcdslist' placeholder='请选择'
174
+ close-on-select search="true" @change="pcdChange" :disabled="!usertype">
175
+ </v-select>
176
+ </div>
177
+ <div class="col-sm-6 form-group "
178
+ :class="[$v.f_street_id.required ? 'has-error' : 'has-success']">
179
+ <label class="font_normal_body">街&emsp;&emsp;道</label>
180
+ <input type="text" style="width:60%" v-show="false" v-model="model.f_street_id"
181
+ >
182
+ <v-select :value.sync="model.f_street_id" :value-single="true"
183
+ :options='streetslist' placeholder='请选择'
184
+ close-on-select search="true" :disabled="!usertype">
185
+ </v-select>
186
+ </div>
187
+ <div class="col-sm-6 form-group "
188
+ :class="[$v.f_residential_area_id.required ? 'has-error' : 'has-success']">
189
+ <label class="font_normal_body">小区名称</label>
190
+ <input type="text" style="width:60%" v-show="false" v-model="model.f_residential_area_id"
191
+ v-validate:f_residential_area_id='{required: true }'>
192
+ <v-select :value.sync="model.f_residential_area_id" :value-single="true"
193
+ @change="areaChange"
194
+ :options='areaslist' placeholder='请选择'
195
+ close-on-select search="true">
196
+ </v-select>
197
+ </div>
198
+ <div class="col-sm-6 form-group ">
199
+ <label class="font_normal_body">片&emsp;&emsp;区</label>
200
+ <v-select :value.sync="model.slice_area" v-model="model.slice_area" :value-single="true"
201
+ :options='sliceArea' placeholder='片区/管理站' filer-key="name"
202
+ close-on-select v-ref:slice>
203
+ </v-select>
204
+ </div>
205
+
206
+ <div class="col-sm-6 form-group "
207
+ :class="[$v.f_building_start.integernum || $v.f_building_start.dctest ?'has-error' : 'has-success']">
208
+ <label for="f_address" class="font_normal_body">起始楼号</label>
209
+ <input type="text" style="width:15%" placeholder="前缀" v-model="model.f_building_prefix" class="input_search"/>
210
+ <input type="text" style="width:25%"
211
+ v-validate:f_building_start='{integernum: true ,dctest: [model.f_building_end, "<=" ]}'
212
+ v-model="model.f_building_start" class="input_search" placeholder="楼号"/>
213
+ <input type="text" style="width:17%" v-model="model.f_building_suffix" class="input_search"/>
214
+ </div>
215
+ <div class="col-sm-6 form-group "
216
+ :class="[$v.f_building_end.integernum ||$v.f_building_end.dctest ? 'has-error' : 'has-success']">
217
+ <label for="f_address" class="font_normal_body">截止楼号</label>
218
+ <input type="text" style="width:15%" placeholder="前缀" v-model="model.f_building_prefix" class="input_search"/>
219
+ <input type="text" style="width:25%"
220
+ v-validate:f_building_end='{integernum: true ,dctest: [model.f_building_start, ">=" ]}'
221
+ v-model="model.f_building_end" class="input_search" placeholder="楼号"/>
222
+ <input type="text" style="width:17%" v-model="model.f_building_suffix" class="input_search"
223
+ />
224
+ </div>
225
+ <div class="col-sm-6 form-group "
226
+ :class="[$v.f_unit_start.integernum || $v.f_unit_start.dctest ? 'has-error' : 'has-success']">
227
+ <label for="f_address" class="font_normal_body">起始单元</label>
228
+ <input type="text" style="width:15%" placeholder="前缀" v-model="model.f_unit_prefix" class="input_search" />
229
+ <input type="text" style="width:25%"
230
+ v-validate:f_unit_start='{integernum: true ,dctest: [model.f_unit_end, "<=" ]}'
231
+ v-model="model.f_unit_start" class="input_search" placeholder="单元"/>
232
+ <input type="text" style="width:17%" v-model="model.f_unit_suffix" class="input_search" />
233
+ </div>
234
+ <div class="col-sm-6 form-group "
235
+ :class="[$v.f_unit_end.integernum ||$v.f_unit_end.dctest ? 'has-error' : 'has-success']">
236
+ <label for="f_address" class="font_normal_body">截止单元</label>
237
+ <input type="text" style="width:15%" placeholder="前缀" v-model="model.f_unit_prefix" class="input_search" />
238
+ <input type="text" style="width:25%"
239
+ v-validate:f_unit_end='{integernum: true ,dctest: [model.f_unit_start, ">="]}'
240
+ v-model="model.f_unit_end" class="input_search" placeholder="单元"/>
241
+ <input type="text" style="width:17%" v-model="model.f_unit_suffix" class="input_search"/>
242
+ </div>
243
+ <div class="col-sm-6 form-group "
244
+ :class="[$v.f_floor_start.integernum || $v.f_floor_start.dctest ? 'has-error' : 'has-success']">
245
+ <label for="f_address" class="font_normal_body">起始楼层</label>
246
+ <input type="text" style="width:15%" placeholder="前缀" v-model="model.f_floor_prefix" class="input_search"/>
247
+ <input type="text" style="width:25%"
248
+ v-validate:f_floor_start='{integernum: true,dctest: [model.f_floor_end, "<=" ] }'
249
+ v-model="model.f_floor_start" class="input_search" placeholder="楼层"/>
250
+ <input type="text" style="width:17%" v-model="model.f_floor_suffix" class="input_search"/>
251
+ </div>
252
+ <div class="col-sm-6 form-group "
253
+ :class="[$v.f_floor_end.integernum ||$v.f_floor_end.dctest ? 'has-error' : 'has-success']">
254
+ <label for="f_address" class="font_normal_body">截止楼层</label>
255
+ <input type="text" style="width:15%" placeholder="前缀" v-model="model.f_floor_prefix" class="input_search"/>
256
+ <input type="text" style="width:25%" v-model="model.f_floor_end"
257
+ v-validate:f_floor_end='{integernum: true,dctest: [model.f_floor_start, ">=" ] }'
258
+ class="input_search" placeholder="楼层"/>
259
+ <input type="text" style="width:17%" v-model="model.f_floor_suffix" class="input_search"/>
260
+ </div>
261
+ <div class="col-sm-6 form-group "
262
+ :class="[$v.f_room_start.integernum || $v.f_room_start.dctest ? 'has-error' : 'has-success']">
263
+ <label for="f_address" class="font_normal_body">起始门牌</label>
264
+ <input type="text" style="width:15%" placeholder="前缀" v-model="model.f_room_prefix" class="input_search"/>
265
+ <input type="text" style="width:25%" v-model="model.f_room_start"
266
+ class="input_search" placeholder="门牌号"
267
+ v-validate:f_room_start='{integernum: true ,dctest: [model.f_room_end, "<=" ]}'
268
+ />
269
+ <input type="text" style="width:17%" v-model="model.f_room_suffix" class="input_search"/>
270
+ </div>
271
+ <div class="col-sm-6 form-group "
272
+ :class="[$v.f_room_end.integernum ||$v.f_room_end.dctest ? 'has-error' : 'has-success']">
273
+ <label for="f_address" class="font_normal_body">截止门牌</label>
274
+ <input type="text" style="width:15%" placeholder="前缀" v-model="model.f_room_prefix" class="input_search"/>
275
+ <input type="text" style="width:25%" v-model="model.f_room_end" class="input_search" placeholder="门牌号"
276
+ v-validate:f_room_end='{integernum: true ,dctest: [model.f_room_start, ">=" ]}'/>
277
+ <input type="text" style="width:17%" v-model="model.f_room_suffix" class="input_search"/>
278
+ </div>
279
+ <div class="col-sm-6 form-group">
280
+ <label class="font_normal_body">地址状态</label>
281
+ <v-select :value.sync="model.f_address_state" :value-single="true"
282
+ class="select_list select"
283
+ condition="f_address_state = '{}'"
284
+ :options='addresstate' placeholder='地址状态'
285
+ close-on-select>
286
+ </v-select>
287
+ </div>
288
+ <div class="col-sm-10 form-group ">
289
+ <p class="navbar-text" style="margin-left: 10%">说明: 层数输入1,门牌号输入001。产生的最终门牌号显示1001</p>
290
+ </div>
291
+ <div class="col-sm-12 form-group">
292
+ <label class="font_normal_body " style="margin-top:-20px">备&emsp;&emsp;注</label>
293
+ <textarea class="input_textarea" rows="3" style="width:80%;height: auto;" v-model="model.f_comments"></textarea>
294
+ </div>
295
+ <div class="row">
296
+ <div style="text-align:right;margin-top:20px;margin-right:50px;" class="col-sm-12">
297
+ <button class="button_search button_spacing" @click="confirmall()" :disabled='!$v.valid'>保存</button>
298
+ <button class="button_clear button_spacing" @click="cancel()">取消</button>
299
+ </div>
300
+ </div>
301
+ </div>
302
+ </div>
303
+ </validator>
304
+ </div>
305
+ </template>
306
+
307
+ <script>
308
+ import {HttpResetClass} from 'vue-client'
309
+
310
+
311
+ let getAreaConfig = async function (self) {
312
+ // 获取气价里面的配置
313
+ await self.$getConfig(self, 'UserAddress')
314
+ console.log('原地址配置',self.config)
315
+ console.log('获取地址配置',self.config)
316
+ Object.assign(self.model, self.config)
317
+ }
318
+
319
+ export default {
320
+ title: '用户地址添加',
321
+ data () {
322
+ return {
323
+ //初始化省市区数据
324
+ pcdslist:[],
325
+ //初始化街道数据
326
+ streetslist:[],
327
+ //初始化街道数据
328
+ areaslist:[],
329
+ iscity:[{label:'市区',value:'市区'},{label:'乡镇',value:'乡镇'},{label:'全部',value:''}],
330
+ config:{
331
+ hasnumber:false,
332
+ f_building_suffix: '号楼',
333
+ f_unit_suffix: '单元',
334
+ f_floor_suffix: '层',
335
+ f_room_suffix: '室'
336
+ },
337
+ model: {
338
+ f_pcd_id: '',
339
+ f_street_id: '',
340
+ f_comments:'',
341
+ f_residential_area_id: '',
342
+ f_pcd: '',
343
+ f_street: '',
344
+ f_residential_area: '',
345
+ f_slice_area: '',
346
+ slice_area:'',
347
+ f_building: '',
348
+ f_building_start: '',
349
+ f_building_end: '',
350
+ f_building_suffix: '',
351
+ f_unit: '',
352
+ f_unit_start: '',
353
+ f_unit_end: '',
354
+ f_unit_suffix: '',
355
+ f_floor: '',
356
+ f_floor_start: '',
357
+ f_floor_end: '',
358
+ f_floor_suffix: '',
359
+ f_room: '',
360
+ f_room_start: '',
361
+ f_room_end: '',
362
+ f_room_suffix: '',
363
+ //详细地址
364
+ f_address: '',
365
+ //单位名称
366
+ f_company: '',
367
+ //单位地址
368
+ f_company_address: '',
369
+ },
370
+ //判读是否为单个数据录入
371
+ onedata: 'one',
372
+ //选中所有地址
373
+ addresslist: [],
374
+ usertype:false,
375
+
376
+ // 公司信息
377
+ curorgid: [this.$login.f.orgid],
378
+
379
+ f_orgid: '',
380
+
381
+ sliceArea: []
382
+ }
383
+ },
384
+ props: ['f_filialeids', 'row','operation','usertype'],
385
+ ready(){
386
+ this.initdata()
387
+ getAreaConfig(this)
388
+ this.model.f_building_suffix=this.config.f_building_suffix
389
+ this.model.f_unit_suffix=this.config.f_unit_suffix
390
+ this.model.f_floor_suffix=this.config.f_floor_suffix
391
+ this.model.f_room_suffix=this.config.f_room_suffix
392
+ },
393
+ methods: {
394
+ async changecity(){
395
+ this.areaslist = []
396
+ let condition = `isnull(f_iscity,'') = isnull('${this.model.f_iscity}','') and a.f_orgid = '${this.f_filialeids}'`
397
+ let req = await this.$resetpost('api/af-revenue/sql/address_getresidential', {
398
+ data: {
399
+ condition: condition
400
+ }
401
+ }, {resolveMsg: null, rejectMsg: '获取地址失败!'})
402
+ let redata = []
403
+ req.data.forEach((row) => {
404
+ redata.push({
405
+ label: row.f_residential_area,
406
+ value: row.id,
407
+ data: row,
408
+ id: row.id
409
+ })
410
+ })
411
+ this.areaslist=redata
412
+ },
413
+ standardyanzheng() {
414
+ console.log(this.model.f_standard_number.length)
415
+ if (this.model.f_standard_number.length != 2){
416
+ this.$showAlert('请输入正确的位数', 'warning', 2000)
417
+ this.model.f_standard_number = ''
418
+ }
419
+ },
420
+ contractsyanzheng(){
421
+ console.log(this.model.f_contracts_number.length)
422
+ if (this.model.f_contracts_number.length != 5){
423
+ this.$showAlert('请输入正确的位数', 'warning', 2000)
424
+ this.model.f_contracts_number = ''
425
+ }
426
+ },
427
+ async initdata(){
428
+ this.model.f_address_state = '已通气'
429
+ this.initAreas(this.f_filialeids)
430
+ // 添加特殊地址选省市区
431
+
432
+ this.initpcds(` f_orgid = '${this.f_filialeids}'`)
433
+ this.initstreets(` f_orgid = '${this.f_filialeids}' `)
434
+ this.initareas(` f_orgid = '${this.f_filialeids}'`)
435
+
436
+ },
437
+
438
+ // 初始化片区
439
+ async initAreas (val) {
440
+ if (val) {
441
+ let getAllArea = await this.$resetpost('/rs/search', {
442
+ source: 'this.getParentByType($organization$).getAllChildrens().where(row.getType() == $zone$)',
443
+ userid: this.$login.f.id
444
+ }, {resolveMsg: null, rejectMsg: '获取片区出错!!!'})
445
+
446
+ let arr = getAllArea.data.filter((res) => {
447
+ return res.parentid == val
448
+ })
449
+ console.log('过滤之后的片区', arr)
450
+ this.sliceArea = []
451
+ arr.forEach((res) => {
452
+ this.sliceArea.push({label: res.name, value: res.name})
453
+ })
454
+ }
455
+ },
456
+ //初始化省市区,添加街道
457
+ async initpcds(pconditon){
458
+ this.pcdslist = []
459
+ let HttpReset = new HttpResetClass()
460
+ let req = await HttpReset.load('POST', 'api/af-revenue/sql/address_singleTableOrderBy?pageNo=1&pageSize=9999999', {
461
+ data: {
462
+ items: '*',
463
+ tablename: 't_pcd',
464
+ orderitem: 'id',
465
+ condition: pconditon
466
+ }
467
+ }, {resolveMsg: null, rejectMsg: '获取地址失败!'})
468
+ let redata = []
469
+ req.data.forEach((row, n) => {
470
+ redata[n] = {
471
+ label: row.f_pcd,
472
+ value: row.id,
473
+ data:row,
474
+ id:row.id
475
+ }
476
+ })
477
+ this.pcdslist=redata
478
+ },
479
+ //初始化街道 添加小区
480
+ async initstreets(pconditon){
481
+ this.streetslist = []
482
+ let HttpReset = new HttpResetClass()
483
+ let req = await HttpReset.load('POST', 'api/af-revenue/sql/address_singleTableOrderBy', {
484
+ data: {
485
+ items: '*',
486
+ tablename: 't_street',
487
+ orderitem: 'id',
488
+ condition: pconditon
489
+ }
490
+ }, {resolveMsg: null, rejectMsg: '获取地址失败!'})
491
+ let redata = []
492
+ req.data.forEach((row, n) => {
493
+ redata[n] = {
494
+ label: row.f_street,
495
+ value: row.id,
496
+ data:row,
497
+ id:row.id
498
+ }
499
+ })
500
+ this.streetslist=redata
501
+ },
502
+ //初始化小区添加小区
503
+ async initareas(pconditon){
504
+ // if(this.usertype){
505
+ // pconditon=pconditon+` and f_special='1' `
506
+ // }
507
+ this.areaslist = []
508
+ let HttpReset = new HttpResetClass()
509
+ let req = await HttpReset.load('POST', 'api/af-revenue/sql/address_singleTableOrderBy?pageNo=1&pageSize=9999999', {
510
+ data: {
511
+ items: '*',
512
+ tablename: 't_area',
513
+ orderitem: 'id',
514
+ condition: pconditon
515
+ }
516
+ }, {resolveMsg: null, rejectMsg: '获取地址失败!'})
517
+ let redata = []
518
+ req.data.forEach((row) => {
519
+ redata.push({
520
+ label: row.f_residential_area,
521
+ value: row.id,
522
+ data: row,
523
+ id: row.id
524
+ })
525
+ })
526
+ this.areaslist=redata
527
+ },
528
+ //省/市/区变化
529
+ async pcdChange(val){
530
+ // 只有添加特殊地址时才级联
531
+ if (!this.usertype) {
532
+ return
533
+ }
534
+ console.log("省/市/区变化",val)
535
+ if(val){
536
+ //那就把[小区,街道]重新组织一下
537
+ await this.initstreets(` f_pcd_id ='${val}' `)
538
+ if(this.model.f_street_id){
539
+ if (this.findbyid(this.streetslist,this.model.f_street_id)) {
540
+ let pcd_id=this.findbyid(this.streetslist,this.model.f_street_id).f_pcd_id
541
+ if(pcd_id!=val){
542
+ this.model.f_street_id=''
543
+ }
544
+ } else {
545
+ this.model.f_street_id=''
546
+ }
547
+
548
+ //那就把[小区,街道]重新组织一下
549
+ if (this.model.f_street_id) {
550
+ await this.initareas(` f_street_id ='${this.model.f_street_id}' `)
551
+ if(this.model.f_residential_area_id){
552
+ if (this.findbyid(this.areaslist,this.model.f_residential_area_id)) {
553
+ let pcd_id=this.findbyid(this.areaslist,this.model.f_residential_area_id).f_pcd_id
554
+ if(pcd_id!=val){
555
+ this.model.f_residential_area_id=''
556
+ }
557
+ } else {
558
+ this.model.f_residential_area_id=''
559
+ }
560
+
561
+ }
562
+ }
563
+ }
564
+ }
565
+ this.$resetValidation()
566
+ },
567
+ //小区变化
568
+ areaChange(val){
569
+ console.log("小区变化",val)
570
+ // 选择小区后级联出省市区和街道
571
+ let selectArea // 选中的小区数据
572
+ for (let row of this.areaslist) {
573
+ if (val == row.value) {
574
+ selectArea = row.data
575
+ break
576
+ }
577
+ }
578
+ if (selectArea) {
579
+ this.model.f_street_id = selectArea.f_street_id
580
+ this.model.f_pcd_id = selectArea.f_pcd_id
581
+ this.initstreets(` f_filialeid = '${this.f_filialeids}' and id ='${selectArea.f_street_id}' `)
582
+ this.initpcds(` f_filialeid = '${this.f_filialeids}' and id ='${selectArea.f_pcd_id}' `)
583
+ this.model.slice_area = selectArea.f_slice_area
584
+ // 拼接地址
585
+ this.model.f_address = `${selectArea.f_street}${selectArea.f_residential_area}`
586
+ }
587
+ this.$nextTick(() => {
588
+ this.$resetValidation()
589
+ })
590
+ },
591
+ //街道变化
592
+ async streetChange(val){
593
+ console.log("街道变化",val)
594
+ if(this.streetslist[0]) {
595
+ var street=''
596
+ this.streetslist.forEach((item)=>{
597
+ if(item.id===val){
598
+ street=item.label
599
+ }
600
+ })
601
+ this.model.f_address = street
602
+ }
603
+ if(val){
604
+ //那就把[小区]重新组织一下
605
+ await this.initareas(` f_street_id ='${val}' `)
606
+ if(this.model.f_residential_area_id){
607
+ if (this.findbyid(this.areaslist,this.model.f_residential_area_id)) {
608
+ let street_id=this.findbyid(this.areaslist,this.model.f_residential_area_id).f_street_id
609
+ if(street_id!=val){
610
+ this.model.f_residential_area_id=''
611
+ }
612
+ } else {
613
+ this.model.f_residential_area_id=''
614
+ }
615
+
616
+ }
617
+ }
618
+ this.$resetValidation()
619
+ },
620
+
621
+ getorg (val) {
622
+ this.f_orgid = val[0]
623
+ },
624
+
625
+ //处理批量地址信息
626
+ dealaddlist(){
627
+ try {
628
+ var resultlist=[]
629
+ for (var i = parseInt(this.model.f_building_start); i <= parseInt(this.model.f_building_end); i++) {
630
+ for (var j = parseInt(this.model.f_unit_start); j <= parseInt(this.model.f_unit_end); j++) {
631
+ for (var m = parseInt(this.model.f_floor_start); m <= parseInt(this.model.f_floor_end); m++) {
632
+ for (var n = parseInt(this.model.f_room_start); n <= parseInt(this.model.f_room_end); n++) {
633
+ //预备一个空的json
634
+ console.log('批量', this.model)
635
+ let data=Object.assign({},this.model)
636
+ data.f_create_person= this.$login.f.name
637
+ data.f_building= data.f_building_prefix + i
638
+ data.f_unit= data.f_unit_prefix + j
639
+ data.f_floor= data.f_floor_prefix + m
640
+ // 目前房号都按两位处理 如: 101室 201室 110室
641
+ if ((n+'').length == 1) {
642
+ data.f_room = data.f_room_prefix + m + '0' + n
643
+ } else {
644
+ data.f_room = data.f_room_prefix + m + '' + n
645
+ }
646
+ data.f_filialeid = this.f_filialeids
647
+ data.f_operator = this.$login.f.name
648
+ data.f_operatorid = this.$login.f.id
649
+ data.f_orgid = this.$login.f.orgid
650
+ data.f_orgname = this.$login.f.orgs
651
+ data.f_depid = this.$login.f.depids
652
+ data.f_depname = this.$login.f.deps
653
+ data.f_pcd=this.findbyid(this.pcdslist,this.model.f_pcd_id).f_pcd
654
+ data.f_street=this.findbyid(this.streetslist,this.model.f_street_id).f_street
655
+ data.f_residential_area=this.findbyid(this.areaslist,this.model.f_residential_area_id).f_residential_area
656
+ data.f_address = data.f_street
657
+ + data.f_residential_area +
658
+ data.f_building + data.f_building_suffix
659
+ + data.f_unit + data.f_unit_suffix
660
+ + data.f_floor + data.f_floor_suffix
661
+ + data.f_room + data.f_room_suffix
662
+ if (this.model.slice_area) {
663
+ data.f_slice_area = this.model.slice_area
664
+
665
+ }
666
+ resultlist.push(data)
667
+ }
668
+ }
669
+ }
670
+ }
671
+ this.addresslist=resultlist
672
+ } catch (e) {
673
+ console.log(e)
674
+ this.$showAlert('输出数据有误,请检查', 'warning', 2000)
675
+ }
676
+ },
677
+ //保存多个
678
+ async confirmall(){
679
+ this.dealaddlist()
680
+ if(this.addresslist.length>0){
681
+ let msg = {
682
+ resolveMsg: '地址保存成功',
683
+ rejectMsg: '地址保存失败'
684
+ }
685
+ this.$showMessage('确定要批量添加'+this.addresslist.length+'户地址吗?,如有已经存在的,将会重复添加!!!', ['confirm', 'cancel']).then((res) => {
686
+ if (res === 'confirm') {
687
+ this.$resetpost('api/af-revenue/logic/address_adduserlist',{data: {addlist:this.addresslist}},msg).then((req) => {
688
+ this.cleardara()
689
+ this.$dispatch('confirm')
690
+ })
691
+ }
692
+ })
693
+ }
694
+ },
695
+ //保存
696
+ async confirm(){
697
+ if(this.onedata=='one'){
698
+ await this.saveonedata()
699
+ }
700
+ this.cleardara()
701
+ this.$dispatch('confirm')
702
+ },
703
+ //保存一户信息
704
+ async saveonedata(){
705
+ this.model.f_create_person= this.$login.f.name
706
+ this.model.f_filialeid = this.f_filialeids
707
+ this.model.f_operator = this.$login.f.name
708
+ this.model.f_operatorid = this.$login.f.id
709
+ this.model.f_orgid = this.$login.f.orgid
710
+ this.model.f_orgname = this.$login.f.orgs
711
+ this.model.f_depid = this.$login.f.depids
712
+ this.model.f_depname = this.$login.f.deps
713
+ console.log("片区:",this.model.slice_area)
714
+ if (this.model.slice_area ) {
715
+ if (this.model.slice_area instanceof Array) {
716
+ console.log("修改",this.model.slice_area)
717
+ this.model.f_slice_area = this.model.slice_area[0].name
718
+ }else{
719
+ console.log("保存",this.model.slice_area)
720
+ this.model.f_slice_area = this.model.slice_area
721
+ }
722
+ }
723
+ if (this.usertype) {
724
+ //非民用
725
+ this.model.f_special='1'
726
+ this.model.f_building_suffix=''
727
+ this.model.f_unit_suffix=''
728
+ this.model.f_floor_suffix=''
729
+ this.model.f_room_suffix=''
730
+ this.model.f_pcd=this.findbyid(this.pcdslist,this.model.f_pcd_id).f_pcd
731
+ this.model.f_street=this.findbyid(this.streetslist,this.model.f_street_id).f_street
732
+ this.model.f_residential_area = this.findbyid(this.areaslist,this.model.f_residential_area_id) ? this.findbyid(this.areaslist,this.model.f_residential_area_id).f_residential_area : ''
733
+ } else {
734
+ //民用
735
+ this.model.f_pcd=this.findbyid(this.pcdslist,this.model.f_pcd_id).f_pcd
736
+ this.model.f_street=this.findbyid(this.streetslist,this.model.f_street_id).f_street
737
+ this.model.f_residential_area=this.findbyid(this.areaslist,this.model.f_residential_area_id).f_residential_area
738
+ this.model.f_address = this.model.f_street + this.model.f_residential_area + (this.model.f_building?this.model.f_building +this.model.f_building_suffix:'') + (this.model.f_unit?this.model.f_unit +this.model.f_unit_suffix:'') + (this.model.f_floor?this.model.f_floor +this.model.f_floor_suffix:'') + this.model.f_room + this.model.f_room_suffix
739
+ }
740
+ await this.$resetpost('api/af-revenue/logic/address_updateuseraddress', this.model)
741
+ },
742
+ cancel(){
743
+ this.cleardara()
744
+ this.$dispatch('cancel')
745
+ },
746
+ cleardara(){
747
+ this.model= {
748
+ f_pcd_id: '',
749
+ f_street_id: '',
750
+ f_residential_area_id: '',
751
+ f_pcd: '',
752
+ f_comments:'',
753
+ f_street: '',
754
+ f_residential_area: '',
755
+ f_slice_area: '',
756
+ slice_area: '',
757
+ f_building: '',
758
+ f_building_start: '',
759
+ f_building_end: '',
760
+ f_building_prefix: '',
761
+ f_building_suffix: this.config.f_building_suffix,
762
+ f_unit: '',
763
+ f_unit_start: '',
764
+ f_unit_end: '',
765
+ f_unit_prefix: '',
766
+ f_unit_suffix: this.config.f_unit_suffix,
767
+ f_floor: '',
768
+ f_floor_start: '',
769
+ f_floor_end: '',
770
+ f_floor_prefix: '',
771
+ f_floor_suffix: this.config.f_floor_suffix,
772
+ f_room: '',
773
+ f_room_start: '',
774
+ f_room_end: '',
775
+ f_room_prefix: '',
776
+ f_room_suffix: this.config.f_room_suffix,
777
+ //详细地址
778
+ f_address: '',
779
+ //单位名称
780
+ f_company: '',
781
+ //单位地址
782
+ f_company_address: '',
783
+ }
784
+ // this.pcdslist = []
785
+ // this.streetslist = []
786
+ // this.areaslist = []
787
+ },
788
+
789
+ //根据名字找数据
790
+ findbyid(list,name){
791
+ var result
792
+ list.forEach((row, n) => {
793
+ if(name==row.value){
794
+ result= row.data
795
+ }
796
+ })
797
+ return result
798
+ },
799
+ },
800
+ watch: {
801
+ //分公司变化
802
+ 'f_filialeids'(){
803
+ if (this.model.f_filialeid) {
804
+ if (this.model.f_filialeid != this.f_filialeids) {
805
+ this.$dispatch('cancel')
806
+ }
807
+ }
808
+ this.cleardara()
809
+ this.initdata()
810
+ },
811
+ 'row'(){
812
+ this.onedata='one'
813
+ }
814
+ },
815
+ computed: {
816
+ //地址状态下拉框
817
+ addresstate() {
818
+ return [{label: '全部', value: ''}, ...this.$appdata.getParam('地址状态')]
819
+ }
820
+ }
821
+ }
822
+ </script>