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