address-client 4.0.1 → 4.0.2

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