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