address-client 3.2.111 → 4.0.1

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