address-client 4.0.1 → 4.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (167) hide show
  1. package/.gradle/8.5/checksums/checksums.lock +0 -0
  2. package/.gradle/8.5/dependencies-accessors/dependencies-accessors.lock +0 -0
  3. package/.gradle/8.5/dependencies-accessors/gc.properties +0 -0
  4. package/.gradle/8.5/executionHistory/executionHistory.bin +0 -0
  5. package/.gradle/8.5/executionHistory/executionHistory.lock +0 -0
  6. package/.gradle/8.5/fileChanges/last-build.bin +0 -0
  7. package/.gradle/8.5/fileHashes/fileHashes.bin +0 -0
  8. package/.gradle/8.5/fileHashes/fileHashes.lock +0 -0
  9. package/.gradle/8.5/gc.properties +0 -0
  10. package/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
  11. package/.gradle/buildOutputCleanup/cache.properties +2 -2
  12. package/.gradle/file-system.probe +0 -0
  13. package/.gradle/vcs-1/gc.properties +0 -0
  14. package/CHANGELOG.md +15 -15
  15. package/build/dev-server.js +185 -185
  16. package/build/versionCheck.js +31 -31
  17. package/build/webpack.base.conf.js +82 -82
  18. package/examples/showAdd/App.vue +40 -40
  19. package/gradle/wrapper/gradle-wrapper.jar +0 -0
  20. package/gradle/wrapper/gradle-wrapper.properties +7 -0
  21. package/gradlew +249 -0
  22. package/gradlew.bat +92 -0
  23. package/index.html +44 -44
  24. package/package.json +101 -101
  25. package/src/address.js +74 -74
  26. package/src/components/AddAreaMsg.vue +757 -757
  27. package/src/components/AddCommunityManageMsg.vue +220 -220
  28. package/src/components/AddStreetManageMsg.vue +204 -204
  29. package/src/components/AddStreetOrPcd.vue +316 -316
  30. package/src/components/AddressAddAddress.vue +479 -479
  31. package/src/components/AddressFiles.vue +156 -156
  32. package/src/components/AddressList.vue +637 -637
  33. package/src/components/AddressListLiuLi.vue +17 -17
  34. package/src/components/AddressManage.vue +117 -117
  35. package/src/components/AddressTree.vue +501 -501
  36. package/src/components/AreaFiles.vue +73 -73
  37. package/src/components/AreaList.vue +410 -410
  38. package/src/components/AreaManage.vue +104 -104
  39. package/src/components/AreaTree.vue +508 -508
  40. package/src/components/Basch.vue +72 -72
  41. package/src/components/BatchOrders.vue +328 -328
  42. package/src/components/BuildingList.vue +129 -129
  43. package/src/components/CityList.vue +134 -134
  44. package/src/components/CityManage.vue +76 -76
  45. package/src/components/CommunityAreaList.vue +87 -87
  46. package/src/components/CommunityManage.vue +78 -78
  47. package/src/components/CommunityManageList.vue +244 -244
  48. package/src/components/NewAddressInfo.vue +432 -432
  49. package/src/components/StreetList.vue +241 -241
  50. package/src/components/StreetManage.vue +68 -68
  51. package/src/components/StreetManageList.vue +225 -225
  52. package/src/components/UserAddress.vue +911 -907
  53. package/src/components/UserAddressChange.vue +58 -58
  54. package/src/components/selectAddress/BatchList.vue +326 -326
  55. package/src/components/selectAddress/BatchOrders.vue +37 -36
  56. package/src/filiale/WEINAN/AddAreaMsg.vue +745 -745
  57. package/src/filiale/WEINAN/AddressList.vue +588 -588
  58. package/src/filiale/WEINAN/AddressManage.vue +122 -122
  59. package/src/filiale/WEINAN/AreaList.vue +435 -435
  60. package/src/filiale/WEINAN/AreaManage.vue +109 -109
  61. package/src/filiale/WEINAN/AreaUserList.vue +226 -226
  62. package/src/filiale/WEINAN/UserAddress.vue +783 -783
  63. package/src/filiale/WEINAN/sale.js +18 -18
  64. package/src/filiale/chengtou/UserAddress.vue +894 -894
  65. package/src/filiale/chengtou/sale.js +7 -7
  66. package/src/filiale/dongguan/AddStreetOrPcd.vue +422 -422
  67. package/src/filiale/dongguan/sale.js +7 -7
  68. package/src/filiale/gaomi/AddressList.vue +430 -430
  69. package/src/filiale/gaomi/UserAddress.vue +832 -832
  70. package/src/filiale/gaomi/sale.js +14 -14
  71. package/src/filiale/gongyi/AddAreaMsg.vue +651 -651
  72. package/src/filiale/gongyi/AreaManage.vue +100 -100
  73. package/src/filiale/gongyi/UserAddress.vue +751 -751
  74. package/src/filiale/gongyi/sale.js +14 -14
  75. package/src/filiale/haile/AddressList.vue +615 -615
  76. package/src/filiale/haile/sale.js +8 -8
  77. package/src/filiale/huaran/components/AddAreaMsg.vue +765 -0
  78. package/src/filiale/huaran/components/AddStreetOrPcd.vue +324 -0
  79. package/src/filiale/huaran/components/AddressList.vue +637 -0
  80. package/src/filiale/huaran/components/AreaList.vue +410 -0
  81. package/src/filiale/huaran/components/StreetList.vue +241 -0
  82. package/src/filiale/huaran/components/UserAddress.vue +919 -0
  83. package/src/filiale/huaran/sale.js +22 -0
  84. package/src/filiale/jingwei/UserAddress.vue +764 -764
  85. package/src/filiale/jingwei/sale.js +12 -12
  86. package/src/filiale/lixianV3/AreaList.vue +416 -416
  87. package/src/filiale/lixianV3/sale.js +12 -12
  88. package/src/filiale/macheng/AddAreaMsg.vue +635 -635
  89. package/src/filiale/macheng/AddStreetOrPcd.vue +231 -231
  90. package/src/filiale/macheng/AddressList.vue +613 -613
  91. package/src/filiale/macheng/AreaList.vue +318 -318
  92. package/src/filiale/macheng/CityManage.vue +76 -76
  93. package/src/filiale/macheng/StreetList.vue +186 -186
  94. package/src/filiale/macheng/UserAddress.vue +743 -743
  95. package/src/filiale/macheng/sale.js +17 -17
  96. package/src/filiale/meihekou/UserAddress.vue +898 -898
  97. package/src/filiale/meihekou/sale.js +8 -8
  98. package/src/filiale/qianneng/AddAreaMsg.vue +755 -755
  99. package/src/filiale/qianneng/AddStreetOrPcd.vue +328 -328
  100. package/src/filiale/qianneng/AddressList.vue +638 -638
  101. package/src/filiale/qianneng/AreaList.vue +431 -431
  102. package/src/filiale/qianneng/CityManage.vue +81 -81
  103. package/src/filiale/qianneng/UserAddress.vue +1125 -1125
  104. package/src/filiale/qianneng/sale.js +20 -20
  105. package/src/filiale/qinhua/AddAreaMsg.vue +743 -743
  106. package/src/filiale/qinhua/AddressList.vue +627 -627
  107. package/src/filiale/qinhua/AddressManage.vue +117 -117
  108. package/src/filiale/qinhua/AreaList.vue +425 -425
  109. package/src/filiale/qinhua/AreaManage.vue +100 -100
  110. package/src/filiale/qinhua/CityManage.vue +76 -76
  111. package/src/filiale/qinhua/StreetList.vue +241 -241
  112. package/src/filiale/qinhua/UserAddress.vue +894 -894
  113. package/src/filiale/qinhua/sale.js +20 -20
  114. package/src/filiale/rizhao/UserAddress.vue +897 -897
  115. package/src/filiale/rizhao/sale.js +8 -8
  116. package/src/filiale/rongcheng/AddressList.vue +363 -363
  117. package/src/filiale/rongcheng/UserAddress.vue +799 -799
  118. package/src/filiale/rongcheng/sale.js +11 -11
  119. package/src/filiale/shanggao/AddAreaMsg.vue +752 -752
  120. package/src/filiale/shanggao/AddStreetOrPcd.vue +312 -312
  121. package/src/filiale/shanggao/AddressList.vue +613 -613
  122. package/src/filiale/shanggao/AreaList.vue +436 -436
  123. package/src/filiale/shanggao/BuildingList.vue +129 -129
  124. package/src/filiale/shanggao/StreetList.vue +240 -240
  125. package/src/filiale/shanggao/UserAddress.vue +953 -953
  126. package/src/filiale/shanggao/sale.js +16 -16
  127. package/src/filiale/shanxian/AddAreaMsg.vue +766 -766
  128. package/src/filiale/shanxian/AddressList.vue +658 -658
  129. package/src/filiale/shanxian/AreaList.vue +458 -458
  130. package/src/filiale/shanxian/AreaManage.vue +107 -107
  131. package/src/filiale/shanxian/UserAddress.vue +900 -900
  132. package/src/filiale/shanxian/sale.js +15 -15
  133. package/src/filiale/shaoguan/AddAreaMsg.vue +629 -629
  134. package/src/filiale/shaoguan/UserAddress.vue +762 -762
  135. package/src/filiale/shaoguan/sale.js +11 -11
  136. package/src/filiale/tongchuan/AddAreaMsg.vue +635 -635
  137. package/src/filiale/tongchuan/AddStreetOrPcd.vue +351 -351
  138. package/src/filiale/tongchuan/AddressList.vue +379 -379
  139. package/src/filiale/tongchuan/AreaList.vue +315 -315
  140. package/src/filiale/tongchuan/AreaManage.vue +100 -100
  141. package/src/filiale/tongchuan/CityList.vue +133 -133
  142. package/src/filiale/tongchuan/StreetList.vue +215 -215
  143. package/src/filiale/tongchuan/UserAddress.vue +822 -822
  144. package/src/filiale/tongchuan/sale.js +19 -19
  145. package/src/filiale/wuhai/UserAddress.vue +795 -795
  146. package/src/filiale/wuhai/sale.js +12 -12
  147. package/src/filiale/xihu/AreaList.vue +409 -409
  148. package/src/filiale/xihu/StreetList.vue +238 -238
  149. package/src/filiale/xihu/sale.js +14 -14
  150. package/src/filiale/xinkang/AddAreaMsg.vue +780 -780
  151. package/src/filiale/xinkang/AreaList.vue +413 -413
  152. package/src/filiale/xinkang/sale.js +9 -9
  153. package/src/filiale/yangchun/AddAreaMsg.vue +764 -764
  154. package/src/filiale/yangchun/sale.js +7 -7
  155. package/src/filiale/zhongsheng/AddressList.vue +671 -671
  156. package/src/filiale/zhongsheng/AreaList.vue +500 -500
  157. package/src/filiale/zhongsheng/sale.js +12 -12
  158. package/src/filiale/zhongyi/AddAreaMsg.vue +757 -757
  159. package/src/filiale/zhongyi/sale.js +12 -12
  160. package/src/filiale/zhoukou/AddAreaMsg.vue +673 -673
  161. package/src/filiale/zhoukou/AddressList.vue +391 -391
  162. package/src/filiale/zhoukou/AddressManage.vue +115 -115
  163. package/src/filiale/zhoukou/AreaList.vue +319 -319
  164. package/src/filiale/zhoukou/AreaManage.vue +100 -100
  165. package/src/filiale/zhoukou/UserAddress.vue +925 -925
  166. package/src/filiale/zhoukou/sale.js +23 -23
  167. package/src/main.js +23 -23
@@ -1,635 +1,635 @@
1
- <template>
2
- <div class="span">
3
- <validator name='v'>
4
- <div class="form-horizontal select-overspread container-fluid" style="overflow-y: auto">
5
- <div class="row auto">
6
- <div class="col-sm-12 bg-info text-center" style="padding: 8px;font-size: 18px;font-weight: bold">
7
- <span v-if="operation=='add'&&!f_specia">添加{{areatype}}</span>
8
- <span v-if="operation=='modify'&&!f_special">修改【{{areamodel.f_residential_area}}】小区</span>
9
- <span v-if="operation=='add'&&f_specia">添加{{areatype}}</span>
10
- <span v-if="operation=='modify'&&f_special">修改【{{areamodel.f_residential_area}}】单位</span>
11
- </div>
12
- <!--基本小区(单位)信息-->
13
- <div class="col-sm-6 form-group">
14
- <label class="font_normal_body">小区编号</label>
15
- <input type="text" class="input_search" style="width:60%" v-model="areamodel.f_area_id"
16
- @blur="areaidChange" placeholder="小区编号">
17
- </div>
18
-
19
- <div class="col-sm-6 form-group"
20
- :class="[$v.f_pcd_id.required ? 'has-error' : 'has-success']">
21
- <label class="font_normal_body">省&ensp;市&ensp;区</label>
22
- <input type="text" class="input_search" class="input_search" style="width:60%" v-show="false" v-model="areamodel.f_pcd_id"
23
- v-validate:f_pcd_id='{required: true }'>
24
- <v-select
25
- :value.sync="areamodel.f_pcd_id" :value-single="true"
26
- :options='pcdslist' placeholder='请选择'
27
- close-on-select search="true" @change="pcdChange">
28
- </v-select>
29
- </div>
30
- <div class="col-sm-6 form-group"
31
- :class="[$v.f_street_id.required ? 'has-error' : 'has-success']">
32
- <label class="font_normal_body">社区/村委</label>
33
- <input type="text" style="width:60%" class="input_search" v-show="false" v-model="areamodel.f_street_id"
34
- v-validate:f_street_id='{required: true }'>
35
- <v-select
36
- :value.sync="areamodel.f_street_id" :value-single="true"
37
- :options='streetslist' placeholder='请选择'
38
- close-on-select search="true" @change="streetChange">
39
- </v-select>
40
- </div>
41
- <div class="col-sm-6 form-group" :class="[$v.slice.required ? 'has-error' : 'has-success']">
42
- <label class="font_normal_body">片&emsp;&emsp;区</label>
43
- <input type="text" style="width:60%" class="input_search" v-show="false" v-model="$refs.slice.selectedItems"
44
- v-validate:slice='{required: true }'>
45
- <v-select :value.sync="areamodel.slice_area" v-model="areamodel.slice_area"
46
- :options='sliceArea' placeholder='片区/管理站' filer-key="name"
47
- close-on-select v-ref:slice>
48
- </v-select>
49
- </div>
50
- <!--小区(特殊)信息-->
51
- <div v-if="!f_special"
52
- class="col-sm-6 form-group"
53
- :class="[$v.f_residential_area.required ? 'has-error' : 'has-success']">
54
- <label class="font_normal_body">小区名称</label>
55
- <input type="text" style="width:60%" class="input_search" v-model="areamodel.f_residential_area"
56
- class="form-control" placeholder="小区名称"
57
- v-validate:f_residential_area='{required: true }'>
58
- </div>
59
- <div v-if="!f_special"
60
- class="col-sm-12 form-group">
61
- <label class="font_normal_body">小区地址</label>
62
- <input type="text" style="width:80%" class="input_search" v-model="areamodel.f_area_address"
63
- class="form-control" placeholder="小区地址">
64
- </div>
65
- <!--单位(特殊)信息-->
66
- <div v-if="f_special"
67
- class="col-sm-6 form-group"
68
- :class="[$v.f_residential_area.required ? 'has-error' : 'has-success']">
69
- <label class="font_normal_body">单位名称</label>
70
- <input type="text" style="width:60%" class="input_search" v-model="areamodel.f_residential_area"
71
- class="form-control" placeholder="单位名称"
72
- v-validate:f_residential_area='{required: true }'>
73
- </div>
74
- <div v-if="f_special"
75
- class="col-sm-12 form-group">
76
- <label class="font_normal_body">单位地址</label>
77
- <input type="text" style="width:60%" class="input_search" v-model="areamodel.f_area_address"
78
- class="form-control" placeholder="单位地址">
79
- </div>
80
- <div v-if="f_special"
81
- class="col-sm-6 form-group"
82
- :class="[$v.f_linkname.required ? 'has-error' : 'has-success']">
83
- <label class="font_normal_body">联&ensp;系&ensp;人</label>
84
- <input type="text" style="width:60%" class="input_search" v-model="areamodel.f_linkname"
85
- class="form-control" placeholder="联系人"
86
- v-validate:f_linkname='{required: true }'>
87
- </div>
88
- <div v-if="f_special"
89
- class="col-sm-6 form-group"
90
- :class="[$v.f_linkphone.required ? 'has-error' : 'has-success']">
91
- <label class="font_normal_body">联系电话</label>
92
- <input type="text" style="width:60%" class="input_search" v-model="areamodel.f_linkphone"
93
- class="form-control" placeholder="联系电话"
94
- v-validate:f_linkphone='{required: true }'>
95
- </div>
96
- <div class="col-sm-12 form-group">
97
- <label class="font_normal_body " style="">备&emsp;&emsp;注</label>
98
- <textarea class="input_textarea" rows="3" style="margin-top:20px;width:80%;height: auto;" v-model="areamodel.f_comments"></textarea>
99
- </div>
100
- <div class="col-sm-12 form-group">
101
- <br/>
102
- </div>
103
- <!--表具信息-->
104
- <div v-if="!f_special" class="col-sm-12 bg-info text-center" style="padding: 8px;font-size: 18px;font-weight: bold">
105
- <span >默认表具信息</span>
106
- </div>
107
- <div v-if="!f_special" class="row">
108
- <div class="col-sm-6 form-group">
109
- <label class="font_normal_body">用户类型</label>
110
- <input type="text" style="width:60%" class="input_search" v-show="false" v-model="areamodel.f_user_type">
111
- <v-select
112
- :value.sync="areamodel.f_user_type" :value-single="true"
113
- :options='usertypes' placeholder='用户类型' @change="userTypeChange"
114
- close-on-select >
115
- </v-select>
116
- </div>
117
- <div class="col-sm-6 form-group">
118
- <label class="font_normal_body">用气性质</label>
119
- <input type="text" style="width:60%" class="input_search" v-show="false" v-model="areamodel.f_gasproperties">
120
- <v-select
121
- :value.sync="areamodel.f_gasproperties" :value-single="true"
122
- :options='gasproperties' placeholder='用气性质'
123
- close-on-select >
124
- </v-select>
125
- </div>
126
- <div class="col-sm-6 form-group">
127
- <label class="font_normal_body">气价类型</label>
128
- <input type="text" style="width:60%" class="input_search" v-show="false" v-model="areamodel.f_price_type">
129
- <v-select
130
- :value.sync="areamodel.f_price_type" :value-single="true"
131
- :options='f_price_types' placeholder='气价类型'
132
- close-on-select >
133
- </v-select>
134
- </div>
135
- <div class="col-sm-6 form-group">
136
- <label class="font_normal_body">气价名称</label>
137
- <input type="text" style="width:60%" class="input_search" v-show="false" v-model="areamodel.f_price_name">
138
- <v-select
139
- :value.sync="areamodel.f_price_name" :value-single="true"
140
- :options='pricenames' placeholder='气价名称'
141
- close-on-select >
142
- </v-select>
143
- </div>
144
- <div class="col-sm-6 form-group">
145
- <label class="font_normal_body">气表品牌</label>
146
- <input type="text" style="width:60%" class="input_search" v-show="false" v-model="areamodel.f_meter_brand">
147
- <v-select
148
- :value.sync="areamodel.f_meter_brand" :value-single="true"
149
- :options='meterbrands' placeholder='气表品牌'
150
- close-on-select >
151
- </v-select>
152
- </div>
153
- <div class="col-sm-6 form-group">
154
- <label class="font_normal_body">气表型号</label>
155
- <input type="text" style="width:60%" class="input_search" v-show="false" v-model="areamodel.f_meter_style">
156
- <v-select
157
- :value.sync="areamodel.f_meter_style" :value-single="true"
158
- :options='meterstyle' placeholder='气表型号'
159
- close-on-select >
160
- </v-select>
161
- </div>
162
- <div class="col-sm-6 form-group" :class="[$v.f_meter_type.required ? 'has-error' : 'has-success']">
163
- <label class="font_normal_body">气表类型</label>
164
- <input type="text" style="width:60%" class="input_search" v-show="false"
165
- v-model="areamodel.f_meter_type">
166
- <v-select :value.sync="areamodel.f_meter_type" :value-single="true"
167
- :options='metertypes' placeholder='请选择'
168
- close-on-select></v-select>
169
- </div>
170
- <div class="col-sm-6 form-group" v-if="isMachine">
171
- <label class="font_normal_body">抄&ensp;表&ensp;册</label>
172
- <input type="text" style="width:60%" class="input_search" v-show="false"
173
- v-model="areamodel.f_meter_book">
174
- <v-select
175
- :value.sync="areamodel.f_meter_book" :value-single="true"
176
- :options='meterbooks' placeholder='抄表册'
177
- close-on-select >
178
- </v-select>
179
- </div>
180
- <div class="col-sm-6 form-group" v-if="!isMachine" :class="[$v.f_meter_book.required ? 'has-error' : 'has-success']">
181
- <label class="font_normal_body">抄&ensp;表&ensp;册</label>
182
- <input type="text" style="width:60%" class="input_search" v-show="false"
183
- v-model="areamodel.f_meter_book">
184
- <v-select
185
- :value.sync="areamodel.f_meter_book" :value-single="true"
186
- :options='meterbooks' placeholder='抄表册'
187
- close-on-select >
188
- </v-select>
189
- </div>
190
- <div class="col-sm-6 form-group" :class="[$v.f_inputtor.required ? 'has-error' : 'has-success']">
191
- <label class="font_normal_body">抄&ensp;表&ensp;员</label>
192
- <input type="text" style="width:60%" class="input_search"
193
- v-show="false" v-model="areamodel.f_inputtor">
194
- <v-select
195
- :value.sync="areamodel.f_inputtor" :value-single="true"
196
- :options='inputtores' placeholder='抄表员'
197
- close-on-select >
198
- </v-select>
199
- </div>
200
- <div class="col-sm-6 form-group" :class="[$v.f_adjustable_id.required ? 'has-error' : 'has-success']">
201
- <label class="font_normal_body">调&ensp;压&ensp;箱</label>
202
- <input type="text" style="width:60%" class="input_search" v-show="false"
203
- v-model="areamodel.f_adjustable_id">
204
- <v-select
205
- :value.sync="areamodel.f_adjustable_id" :value-single="true"
206
- :options='adjustables' placeholder='调压箱'
207
- close-on-select >
208
- </v-select>
209
- </div>
210
- <div class="col-sm-6 form-group" :class="[$v.f_house_type.required ? 'has-error' : 'has-success']">
211
- <label class="font_normal_body">房屋类型</label>
212
- <input type="text" style="width:60%" class="input_search" v-show="false"
213
- v-model="areamodel.f_house_type" >
214
- <v-select
215
- :value.sync="areamodel.f_house_type" :value-single="true"
216
- :options='housetypeoptions' placeholder='房屋类型'
217
- close-on-select >
218
- </v-select>
219
- </div>
220
- <div class="col-sm-6 form-group" :class="[$v.f_position.required ? 'has-error' : 'has-success']">
221
- <label class="font_normal_body">安装位置</label>
222
- <input type="text" style="width:60%" class="input_search" v-show="false" v-model="areamodel.f_position" >
223
- <v-select
224
- :value.sync="areamodel.f_position" :value-single="true"
225
- :options='positions' placeholder='安装位置'
226
- close-on-select >
227
- </v-select>
228
- </div>
229
- </div>
230
- <div v-if="f_special" class="col-sm-6 form-group">
231
- <br/>
232
- </div>
233
- </div>
234
- <div class="row auto" style="text-align:right;">
235
- <button class="button_search button_spacing" @click="confirm()" :disabled='!$v.valid'>保存</button>
236
- <button class="button_clear button_spacing" @click="cancel()">取消</button>
237
- </div>
238
- </div>
239
- </validator>
240
- </div>
241
- </template>
242
-
243
- <script>
244
- import {HttpResetClass} from 'vue-client'
245
-
246
- let initGen = async function (self) {
247
- await self.initdata()
248
- await self.$LoadParams.loadMeterBook(self.f_filialeids)
249
- await self.loadMeterBooks();
250
- }
251
- export default {
252
- title: '小区添加',
253
- data () {
254
- return {
255
- //初始化省市区数据
256
- pcdslist:[],
257
- //初始化街道数据
258
- streetslist:[],
259
- //小区
260
- areamodel: {
261
- f_area_id: '',
262
- f_pcd_id:'',
263
- f_linkname:'',
264
- f_linkphone:'',
265
- f_street_id:'',
266
- f_slice_area:'',
267
- f_adjustable_id:'',
268
- f_residential_area:'',
269
- f_user_type:'',
270
- f_gasproperties:'',
271
- f_meter_brand:'',
272
- f_price_name:'',
273
- f_area_address:'',
274
- f_price_type:'',
275
- f_meter_style:'',
276
- f_position:'',
277
- f_comments:'',
278
- f_meter_type: ''
279
- },
280
- meterbrands: [],
281
- adjustables: [],
282
- sliceArea: [],
283
- gasproperties: [],
284
- meterbooks:[{label: '全部',value: ''}],
285
- housetypeoptions:[{label: '楼房', value: '楼房'}, {label: '自建房', value: '自建房'}],
286
- isMachine: true
287
- }
288
- },
289
- props: ['f_filialeids','f_special', 'areatype','row','operation'],
290
- ready(){
291
- initGen(this)
292
- },
293
- methods: {
294
- loadMeterBooks(){
295
- this.meterbooks = [...this.meterbooks, ...this.$GetSaleParam.getMeterBooks()]
296
- },
297
- //初始化数据
298
- async initdata(){
299
- // 初始化参数
300
- await this.initParams()
301
-
302
- // 初始化片区
303
- await this.initSlice(this.f_filialeids)
304
- await this.initpcds(` f_filialeid = '${this.f_filialeids}'`)
305
- },
306
- initrow(val){
307
- this.areamodel.f_meter_book = val.f_meter_book;
308
- this.areamodel.f_adjustable_id = val.f_adjustable_id;
309
- },
310
- async initParams() {
311
- await this.$LoadParams.loadParam(this.f_filialeids)
312
- this.initBrands()
313
- this.initAdjustables()
314
- },
315
-
316
- initBrands () {
317
- let ret = this.$GetSaleParam.getGasbrand()
318
- let rs = new Array()
319
- ret.forEach((item, index) =>{
320
- rs.push({label: item.label, value: item.value.f_meter_brand})
321
- })
322
- this.meterbrands = rs
323
- },
324
-
325
- initAdjustables () {
326
- let filter = this.$login.f.orgid
327
- let ret = this.$GetSaleParam.getAdjustable(filter)
328
- let arr = new Array()
329
- ret.forEach((item, index) => {
330
- arr.push({label: `[${item.value.f_adjustable_id}]-${item.label}`, value: item.value.id})
331
- })
332
- this.adjustables = arr
333
- },
334
-
335
- async initSlice (val) {
336
- if (val) {
337
- let getAllArea = await this.$resetpost('/rs/search', {
338
- source: 'this.getParentByType($organization$).getAllChildrens().where(row.getType() == $zone$)',
339
- userid: this.$login.f.id
340
- }, {resolveMsg: null, rejectMsg: '获取片区出错!!!'})
341
-
342
- let arr = getAllArea.data.filter((res) => {
343
- return res.parentid == val
344
- })
345
- this.sliceArea = []
346
- arr.forEach((res) => {
347
- this.sliceArea.push({label: res.name, value: {name: res.name, code:res.number}})
348
- })
349
- }
350
- },
351
-
352
- //初始化省市区,添加街道
353
- async initpcds(pconditon){
354
- this.pcdslist = []
355
- let HttpReset = new HttpResetClass()
356
- let req = await HttpReset.load('POST', 'api/af-revenue/sql/address_singleTableOrderBy', {
357
- data: {
358
- items: '*',
359
- tablename: 't_pcd',
360
- orderitem: 'id',
361
- condition: pconditon
362
- }
363
- }, {resolveMsg: null, rejectMsg: '获取地址失败!'})
364
- let redata = []
365
- req.data.forEach((row, n) => {
366
- redata[n] = {
367
- label: row.f_pcd,
368
- value: row.id,
369
- data:row,
370
- id:row.id
371
- }
372
- })
373
- this.pcdslist=redata
374
-
375
- },
376
- //初始化街道 添加小区
377
- async initstreets(pconditon){
378
- this.streetslist = []
379
- let HttpReset = new HttpResetClass()
380
- let req = await HttpReset.load('POST', 'api/af-revenue/sql/address_singleTableOrderBy', {
381
- data: {
382
- items: '*',
383
- tablename: 't_street',
384
- orderitem: 'id',
385
- condition: pconditon
386
- }
387
- }, {resolveMsg: null, rejectMsg: '获取地址失败!'})
388
- let redata = []
389
- req.data.forEach((row, n) => {
390
- redata[n] = {
391
- label: row.f_street,
392
- value: row.id,
393
- data:row,
394
- id:row.id
395
- }
396
- })
397
- this.streetslist=redata
398
- },
399
-
400
- async areaidChange () {
401
- // 验证小区编号是否已存在
402
-
403
- let param = {
404
- id: this.areamodel.id,
405
- f_area_id: this.areamodel.f_area_id,
406
- f_filialeid: this.f_filialeids
407
- }
408
-
409
- let res = await this.$resetpost('api/af-revenue/logic/address_validateAreaID', param, {resolveMsg: null,rejectMsg: '小区编号验证失败!!'})
410
- console.log('验证小区是否存在', res)
411
- if (res.data) {
412
- this.$showAlert('这个小区编号已存在!!!请核实', 'warning', 3000)
413
- this.areamodel.f_area_id = ''
414
- }
415
-
416
- },
417
-
418
-
419
- //根据名字找数据
420
- findbyid(list,name){
421
- var result
422
- list.forEach((row, n) => {
423
- if(name==row.id){
424
- result= row.data
425
- }
426
- })
427
- return result
428
- },
429
- userTypeChange () {
430
- this.gasproperties = []
431
- if (this.areamodel.f_user_type) {
432
- this.gasproperties = this.$appdata.getParam(this.areamodel.f_user_type)
433
- }
434
- },
435
-
436
- //省/市/区变化
437
- async pcdChange(val){
438
- if(val){
439
- //那就把街道数据重新组织一下
440
- await this.initstreets(` f_filialeid = '${this.f_filialeids}' and f_pcd_id ='${val}' `)
441
- if(this.areamodel.f_street_id){
442
- if (this.findbyid(this.streetslist,this.areamodel.f_street_id)) {
443
- let pcd_id=this.findbyid(this.streetslist,this.areamodel.f_street_id).f_pcd_id
444
- if(pcd_id!=val){
445
- this.areamodel.f_street_id=''
446
- }
447
- } else {
448
- this.areamodel.f_street_id=''
449
- }
450
-
451
- }
452
- }
453
- this.$resetValidation()
454
- },
455
- //街道变化
456
- streetChange(val){
457
- if(val&&this.operation=='add'){
458
- // if(this.areamodel.f_pcd_id.length==0){
459
- if (this.findbyid(this.streetslist,this.areamodel.f_street_id)) {
460
- console.log("aa",this.findbyid(this.streetslist,this.areamodel.f_street_id))
461
- console.log("bbb",this.findbyid(this.streetslist,this.areamodel.f_street_id).f_pcd_id)
462
- this.areamodel.f_pcd_id=this.findbyid(this.streetslist,this.areamodel.f_street_id).f_pcd_id
463
- }
464
- // }
465
- }
466
- this.$resetValidation()
467
- },
468
- //保存
469
- async confirm(){
470
- await this.savearea()
471
- this.cleardara()
472
- this.$dispatch('confirm')
473
- },
474
- //保存小区
475
- async savearea(){
476
- if(this.f_special){
477
- this.areamodel.f_special='1'
478
- }
479
- this.areamodel.f_filialeid = this.f_filialeids
480
- this.areamodel.f_operator = this.$login.f.name
481
- this.areamodel.f_operatorid = this.$login.f.id
482
- this.areamodel.f_orgid = this.$login.f.orgid
483
- this.areamodel.f_orgname = this.$login.f.orgs
484
- this.areamodel.f_depid = this.$login.f.depids
485
- this.areamodel.f_depname = this.$login.f.deps
486
- if (this.areamodel.slice_area) {
487
- if (this.areamodel.slice_area.length > 0) {
488
- this.areamodel.f_slice_area = this.areamodel.slice_area[0].name
489
- this.areamodel.f_area_code = this.areamodel.slice_area[0].code
490
- }
491
- }
492
- this.areamodel.f_pcd=this.findbyid(this.pcdslist,this.areamodel.f_pcd_id).f_pcd
493
- this.areamodel.f_street=this.findbyid(this.streetslist,this.areamodel.f_street_id).f_street
494
-
495
- await this.$resetpost('api/af-revenue/logic/address_updatearea', this.areamodel)
496
- },
497
- cleardara(){
498
- this.areamodel= {
499
- f_area_id: '',
500
- f_pcd_id:'',
501
- f_street_id:'',
502
- f_slice_area:'',
503
- f_linkname:'',
504
- f_linkphone:'',
505
- f_adjustable_id:'',
506
- f_residential_area:'',
507
- f_user_type:'',
508
- f_gasproperties:'',
509
- f_area_address:'',
510
- f_meter_brand:'',
511
- f_price_name:'',
512
- f_price_type:'',
513
- f_meter_style:'',
514
- f_position:'',
515
- f_comments:'',
516
- f_meter_type: ''
517
- }
518
- },
519
- cancel(){
520
- this.cleardara()
521
- this.$dispatch('cancel')
522
- },
523
- },
524
- watch: {
525
- 'areamodel.f_meter_type' (val) {
526
- if (val === '机表')
527
- this.isMachine = false
528
- },
529
- 'areatype'(){
530
- this.initdata()
531
- },
532
- 'areamodel.f_pcd_id'(){
533
- if(this.areamodel.f_pcd_id&&this.areamodel.f_street_id){
534
- if (this.findbyid(this.pcdslist,this.areamodel.f_pcd_id) && this.findbyid(this.streetslist,this.areamodel.f_street_id)) {
535
- this.areamodel.f_area_address = this.findbyid(this.pcdslist,this.areamodel.f_pcd_id).f_pcd + this.findbyid(this.streetslist,this.areamodel.f_street_id).f_street
536
- }
537
- }
538
- },
539
- 'areamodel.f_street_id'(){
540
- if (this.areamodel.f_pcd_id && this.areamodel.f_street_id) {
541
- if (this.findbyid(this.pcdslist, this.areamodel.f_pcd_id) && this.findbyid(this.streetslist, this.areamodel.f_street_id)) {
542
- this.areamodel.f_area_address = this.findbyid(this.pcdslist, this.areamodel.f_pcd_id).f_pcd + this.findbyid(this.streetslist, this.areamodel.f_street_id).f_street
543
- }
544
- }
545
- },
546
- 'f_filialeids'(){
547
- if (this.areamodel.f_filialeid) {
548
- if (this.areamodel.f_filialeid != this.f_filialeids) {
549
- this.$dispatch('cancel')
550
- }
551
- }
552
- this.cleardara()
553
- this.initdata()
554
- }
555
- },
556
- computed: {
557
- metertypes() {
558
- return this.$appdata.getParam('气表类型')
559
- },
560
- usertypes () {
561
- return this.$appdata.getParam('用户类型')
562
- },
563
- f_price_types () {
564
- return this.$appdata.getParam('气价类型')
565
- },
566
- meterstyle () {
567
- let ret = this.$GetSaleParam.getGasbrand()
568
- let rs = new Array()
569
- if(this.areamodel.f_meter_brand) {
570
- ret.forEach((item, index) => {
571
- if(this.areamodel.f_meter_brand == item.value.f_meter_brand) {
572
- item.value.gasmodel.forEach((item1, index) =>{
573
- rs.push({label: item1.label, value:item1.label})
574
- })
575
- }
576
- })
577
- }
578
- return rs
579
- },
580
- pricenames () {
581
- let rs = new Array()
582
- if (this.areamodel.f_user_type && this.areamodel.f_gasproperties && this.areamodel.f_price_type) {
583
- let params = {
584
- f_user_type: this.areamodel.f_user_type,
585
- f_gasproperties: this.areamodel.f_gasproperties,
586
- f_price_type: this.areamodel.f_price_type,
587
- filter: this.f_filialeids
588
- }
589
- let ret = this.$GetSaleParam.getPrice(params)
590
- ret.forEach((item, index) => {
591
- rs.push({label: item.label, value: item.value.f_price_name})
592
- })
593
- }
594
- if (rs.length == 0) {
595
- this.areamodel.f_price_name = ''
596
- }
597
- return rs
598
- },
599
- positions () {
600
- return this.$appdata.getParam('安装位置')
601
- },
602
- inputtores () {
603
- // 获取抄表员
604
- let rs = new Array()
605
- if (this.$login.f.f_gasman.length > 0) {
606
- for (let i = 0; i < this.$login.f.f_gasman.length; i++) {
607
- let temp = {
608
- label: this.$login.f.f_gasman[i].name,
609
- value: this.$login.f.f_gasman[i].name
610
- }
611
- rs.push(temp)
612
- }
613
- }
614
- return rs
615
- }
616
- }
617
- }
618
- </script>
619
- <style>
620
- .box {
621
- width: 727px;
622
- height: 175px;
623
- border-radius: 2px;
624
- background-color: #fafafa;
625
- border: 1px solid #999999;
626
- margin-top: 13px;
627
- }
628
- .datapanel {
629
- color: #333;
630
- background-color: white;
631
- box-shadow: darkgrey 0.5px 0.5px 0.5px 0.5px ;
632
- padding: 10px 30px 10px 30px;
633
- border-radius:15px;
634
- }
635
- </style>
1
+ <template>
2
+ <div class="span">
3
+ <validator name='v'>
4
+ <div class="form-horizontal select-overspread container-fluid" style="overflow-y: auto">
5
+ <div class="row auto">
6
+ <div class="col-sm-12 bg-info text-center" style="padding: 8px;font-size: 18px;font-weight: bold">
7
+ <span v-if="operation=='add'&&!f_specia">添加{{areatype}}</span>
8
+ <span v-if="operation=='modify'&&!f_special">修改【{{areamodel.f_residential_area}}】小区</span>
9
+ <span v-if="operation=='add'&&f_specia">添加{{areatype}}</span>
10
+ <span v-if="operation=='modify'&&f_special">修改【{{areamodel.f_residential_area}}】单位</span>
11
+ </div>
12
+ <!--基本小区(单位)信息-->
13
+ <div class="col-sm-6 form-group">
14
+ <label class="font_normal_body">小区编号</label>
15
+ <input type="text" class="input_search" style="width:60%" v-model="areamodel.f_area_id"
16
+ @blur="areaidChange" placeholder="小区编号">
17
+ </div>
18
+
19
+ <div class="col-sm-6 form-group"
20
+ :class="[$v.f_pcd_id.required ? 'has-error' : 'has-success']">
21
+ <label class="font_normal_body">省&ensp;市&ensp;区</label>
22
+ <input type="text" class="input_search" class="input_search" style="width:60%" v-show="false" v-model="areamodel.f_pcd_id"
23
+ v-validate:f_pcd_id='{required: true }'>
24
+ <v-select
25
+ :value.sync="areamodel.f_pcd_id" :value-single="true"
26
+ :options='pcdslist' placeholder='请选择'
27
+ close-on-select search="true" @change="pcdChange">
28
+ </v-select>
29
+ </div>
30
+ <div class="col-sm-6 form-group"
31
+ :class="[$v.f_street_id.required ? 'has-error' : 'has-success']">
32
+ <label class="font_normal_body">社区/村委</label>
33
+ <input type="text" style="width:60%" class="input_search" v-show="false" v-model="areamodel.f_street_id"
34
+ v-validate:f_street_id='{required: true }'>
35
+ <v-select
36
+ :value.sync="areamodel.f_street_id" :value-single="true"
37
+ :options='streetslist' placeholder='请选择'
38
+ close-on-select search="true" @change="streetChange">
39
+ </v-select>
40
+ </div>
41
+ <div class="col-sm-6 form-group" :class="[$v.slice.required ? 'has-error' : 'has-success']">
42
+ <label class="font_normal_body">片&emsp;&emsp;区</label>
43
+ <input type="text" style="width:60%" class="input_search" v-show="false" v-model="$refs.slice.selectedItems"
44
+ v-validate:slice='{required: true }'>
45
+ <v-select :value.sync="areamodel.slice_area" v-model="areamodel.slice_area"
46
+ :options='sliceArea' placeholder='片区/管理站' filer-key="name"
47
+ close-on-select v-ref:slice>
48
+ </v-select>
49
+ </div>
50
+ <!--小区(特殊)信息-->
51
+ <div v-if="!f_special"
52
+ class="col-sm-6 form-group"
53
+ :class="[$v.f_residential_area.required ? 'has-error' : 'has-success']">
54
+ <label class="font_normal_body">小区名称</label>
55
+ <input type="text" style="width:60%" class="input_search" v-model="areamodel.f_residential_area"
56
+ class="form-control" placeholder="小区名称"
57
+ v-validate:f_residential_area='{required: true }'>
58
+ </div>
59
+ <div v-if="!f_special"
60
+ class="col-sm-12 form-group">
61
+ <label class="font_normal_body">小区地址</label>
62
+ <input type="text" style="width:80%" class="input_search" v-model="areamodel.f_area_address"
63
+ class="form-control" placeholder="小区地址">
64
+ </div>
65
+ <!--单位(特殊)信息-->
66
+ <div v-if="f_special"
67
+ class="col-sm-6 form-group"
68
+ :class="[$v.f_residential_area.required ? 'has-error' : 'has-success']">
69
+ <label class="font_normal_body">单位名称</label>
70
+ <input type="text" style="width:60%" class="input_search" v-model="areamodel.f_residential_area"
71
+ class="form-control" placeholder="单位名称"
72
+ v-validate:f_residential_area='{required: true }'>
73
+ </div>
74
+ <div v-if="f_special"
75
+ class="col-sm-12 form-group">
76
+ <label class="font_normal_body">单位地址</label>
77
+ <input type="text" style="width:60%" class="input_search" v-model="areamodel.f_area_address"
78
+ class="form-control" placeholder="单位地址">
79
+ </div>
80
+ <div v-if="f_special"
81
+ class="col-sm-6 form-group"
82
+ :class="[$v.f_linkname.required ? 'has-error' : 'has-success']">
83
+ <label class="font_normal_body">联&ensp;系&ensp;人</label>
84
+ <input type="text" style="width:60%" class="input_search" v-model="areamodel.f_linkname"
85
+ class="form-control" placeholder="联系人"
86
+ v-validate:f_linkname='{required: true }'>
87
+ </div>
88
+ <div v-if="f_special"
89
+ class="col-sm-6 form-group"
90
+ :class="[$v.f_linkphone.required ? 'has-error' : 'has-success']">
91
+ <label class="font_normal_body">联系电话</label>
92
+ <input type="text" style="width:60%" class="input_search" v-model="areamodel.f_linkphone"
93
+ class="form-control" placeholder="联系电话"
94
+ v-validate:f_linkphone='{required: true }'>
95
+ </div>
96
+ <div class="col-sm-12 form-group">
97
+ <label class="font_normal_body " style="">备&emsp;&emsp;注</label>
98
+ <textarea class="input_textarea" rows="3" style="margin-top:20px;width:80%;height: auto;" v-model="areamodel.f_comments"></textarea>
99
+ </div>
100
+ <div class="col-sm-12 form-group">
101
+ <br/>
102
+ </div>
103
+ <!--表具信息-->
104
+ <div v-if="!f_special" class="col-sm-12 bg-info text-center" style="padding: 8px;font-size: 18px;font-weight: bold">
105
+ <span >默认表具信息</span>
106
+ </div>
107
+ <div v-if="!f_special" class="row">
108
+ <div class="col-sm-6 form-group">
109
+ <label class="font_normal_body">用户类型</label>
110
+ <input type="text" style="width:60%" class="input_search" v-show="false" v-model="areamodel.f_user_type">
111
+ <v-select
112
+ :value.sync="areamodel.f_user_type" :value-single="true"
113
+ :options='usertypes' placeholder='用户类型' @change="userTypeChange"
114
+ close-on-select >
115
+ </v-select>
116
+ </div>
117
+ <div class="col-sm-6 form-group">
118
+ <label class="font_normal_body">用气性质</label>
119
+ <input type="text" style="width:60%" class="input_search" v-show="false" v-model="areamodel.f_gasproperties">
120
+ <v-select
121
+ :value.sync="areamodel.f_gasproperties" :value-single="true"
122
+ :options='gasproperties' placeholder='用气性质'
123
+ close-on-select >
124
+ </v-select>
125
+ </div>
126
+ <div class="col-sm-6 form-group">
127
+ <label class="font_normal_body">气价类型</label>
128
+ <input type="text" style="width:60%" class="input_search" v-show="false" v-model="areamodel.f_price_type">
129
+ <v-select
130
+ :value.sync="areamodel.f_price_type" :value-single="true"
131
+ :options='f_price_types' placeholder='气价类型'
132
+ close-on-select >
133
+ </v-select>
134
+ </div>
135
+ <div class="col-sm-6 form-group">
136
+ <label class="font_normal_body">气价名称</label>
137
+ <input type="text" style="width:60%" class="input_search" v-show="false" v-model="areamodel.f_price_name">
138
+ <v-select
139
+ :value.sync="areamodel.f_price_name" :value-single="true"
140
+ :options='pricenames' placeholder='气价名称'
141
+ close-on-select >
142
+ </v-select>
143
+ </div>
144
+ <div class="col-sm-6 form-group">
145
+ <label class="font_normal_body">气表品牌</label>
146
+ <input type="text" style="width:60%" class="input_search" v-show="false" v-model="areamodel.f_meter_brand">
147
+ <v-select
148
+ :value.sync="areamodel.f_meter_brand" :value-single="true"
149
+ :options='meterbrands' placeholder='气表品牌'
150
+ close-on-select >
151
+ </v-select>
152
+ </div>
153
+ <div class="col-sm-6 form-group">
154
+ <label class="font_normal_body">气表型号</label>
155
+ <input type="text" style="width:60%" class="input_search" v-show="false" v-model="areamodel.f_meter_style">
156
+ <v-select
157
+ :value.sync="areamodel.f_meter_style" :value-single="true"
158
+ :options='meterstyle' placeholder='气表型号'
159
+ close-on-select >
160
+ </v-select>
161
+ </div>
162
+ <div class="col-sm-6 form-group" :class="[$v.f_meter_type.required ? 'has-error' : 'has-success']">
163
+ <label class="font_normal_body">气表类型</label>
164
+ <input type="text" style="width:60%" class="input_search" v-show="false"
165
+ v-model="areamodel.f_meter_type">
166
+ <v-select :value.sync="areamodel.f_meter_type" :value-single="true"
167
+ :options='metertypes' placeholder='请选择'
168
+ close-on-select></v-select>
169
+ </div>
170
+ <div class="col-sm-6 form-group" v-if="isMachine">
171
+ <label class="font_normal_body">抄&ensp;表&ensp;册</label>
172
+ <input type="text" style="width:60%" class="input_search" v-show="false"
173
+ v-model="areamodel.f_meter_book">
174
+ <v-select
175
+ :value.sync="areamodel.f_meter_book" :value-single="true"
176
+ :options='meterbooks' placeholder='抄表册'
177
+ close-on-select >
178
+ </v-select>
179
+ </div>
180
+ <div class="col-sm-6 form-group" v-if="!isMachine" :class="[$v.f_meter_book.required ? 'has-error' : 'has-success']">
181
+ <label class="font_normal_body">抄&ensp;表&ensp;册</label>
182
+ <input type="text" style="width:60%" class="input_search" v-show="false"
183
+ v-model="areamodel.f_meter_book">
184
+ <v-select
185
+ :value.sync="areamodel.f_meter_book" :value-single="true"
186
+ :options='meterbooks' placeholder='抄表册'
187
+ close-on-select >
188
+ </v-select>
189
+ </div>
190
+ <div class="col-sm-6 form-group" :class="[$v.f_inputtor.required ? 'has-error' : 'has-success']">
191
+ <label class="font_normal_body">抄&ensp;表&ensp;员</label>
192
+ <input type="text" style="width:60%" class="input_search"
193
+ v-show="false" v-model="areamodel.f_inputtor">
194
+ <v-select
195
+ :value.sync="areamodel.f_inputtor" :value-single="true"
196
+ :options='inputtores' placeholder='抄表员'
197
+ close-on-select >
198
+ </v-select>
199
+ </div>
200
+ <div class="col-sm-6 form-group" :class="[$v.f_adjustable_id.required ? 'has-error' : 'has-success']">
201
+ <label class="font_normal_body">调&ensp;压&ensp;箱</label>
202
+ <input type="text" style="width:60%" class="input_search" v-show="false"
203
+ v-model="areamodel.f_adjustable_id">
204
+ <v-select
205
+ :value.sync="areamodel.f_adjustable_id" :value-single="true"
206
+ :options='adjustables' placeholder='调压箱'
207
+ close-on-select >
208
+ </v-select>
209
+ </div>
210
+ <div class="col-sm-6 form-group" :class="[$v.f_house_type.required ? 'has-error' : 'has-success']">
211
+ <label class="font_normal_body">房屋类型</label>
212
+ <input type="text" style="width:60%" class="input_search" v-show="false"
213
+ v-model="areamodel.f_house_type" >
214
+ <v-select
215
+ :value.sync="areamodel.f_house_type" :value-single="true"
216
+ :options='housetypeoptions' placeholder='房屋类型'
217
+ close-on-select >
218
+ </v-select>
219
+ </div>
220
+ <div class="col-sm-6 form-group" :class="[$v.f_position.required ? 'has-error' : 'has-success']">
221
+ <label class="font_normal_body">安装位置</label>
222
+ <input type="text" style="width:60%" class="input_search" v-show="false" v-model="areamodel.f_position" >
223
+ <v-select
224
+ :value.sync="areamodel.f_position" :value-single="true"
225
+ :options='positions' placeholder='安装位置'
226
+ close-on-select >
227
+ </v-select>
228
+ </div>
229
+ </div>
230
+ <div v-if="f_special" class="col-sm-6 form-group">
231
+ <br/>
232
+ </div>
233
+ </div>
234
+ <div class="row auto" style="text-align:right;">
235
+ <button class="button_search button_spacing" @click="confirm()" :disabled='!$v.valid'>保存</button>
236
+ <button class="button_clear button_spacing" @click="cancel()">取消</button>
237
+ </div>
238
+ </div>
239
+ </validator>
240
+ </div>
241
+ </template>
242
+
243
+ <script>
244
+ import {HttpResetClass} from 'vue-client'
245
+
246
+ let initGen = async function (self) {
247
+ await self.initdata()
248
+ await self.$LoadParams.loadMeterBook(self.f_filialeids)
249
+ await self.loadMeterBooks();
250
+ }
251
+ export default {
252
+ title: '小区添加',
253
+ data () {
254
+ return {
255
+ //初始化省市区数据
256
+ pcdslist:[],
257
+ //初始化街道数据
258
+ streetslist:[],
259
+ //小区
260
+ areamodel: {
261
+ f_area_id: '',
262
+ f_pcd_id:'',
263
+ f_linkname:'',
264
+ f_linkphone:'',
265
+ f_street_id:'',
266
+ f_slice_area:'',
267
+ f_adjustable_id:'',
268
+ f_residential_area:'',
269
+ f_user_type:'',
270
+ f_gasproperties:'',
271
+ f_meter_brand:'',
272
+ f_price_name:'',
273
+ f_area_address:'',
274
+ f_price_type:'',
275
+ f_meter_style:'',
276
+ f_position:'',
277
+ f_comments:'',
278
+ f_meter_type: ''
279
+ },
280
+ meterbrands: [],
281
+ adjustables: [],
282
+ sliceArea: [],
283
+ gasproperties: [],
284
+ meterbooks:[{label: '全部',value: ''}],
285
+ housetypeoptions:[{label: '楼房', value: '楼房'}, {label: '自建房', value: '自建房'}],
286
+ isMachine: true
287
+ }
288
+ },
289
+ props: ['f_filialeids','f_special', 'areatype','row','operation'],
290
+ ready(){
291
+ initGen(this)
292
+ },
293
+ methods: {
294
+ loadMeterBooks(){
295
+ this.meterbooks = [...this.meterbooks, ...this.$GetSaleParam.getMeterBooks()]
296
+ },
297
+ //初始化数据
298
+ async initdata(){
299
+ // 初始化参数
300
+ await this.initParams()
301
+
302
+ // 初始化片区
303
+ await this.initSlice(this.f_filialeids)
304
+ await this.initpcds(` f_filialeid = '${this.f_filialeids}'`)
305
+ },
306
+ initrow(val){
307
+ this.areamodel.f_meter_book = val.f_meter_book;
308
+ this.areamodel.f_adjustable_id = val.f_adjustable_id;
309
+ },
310
+ async initParams() {
311
+ await this.$LoadParams.loadParam(this.f_filialeids)
312
+ this.initBrands()
313
+ this.initAdjustables()
314
+ },
315
+
316
+ initBrands () {
317
+ let ret = this.$GetSaleParam.getGasbrand()
318
+ let rs = new Array()
319
+ ret.forEach((item, index) =>{
320
+ rs.push({label: item.label, value: item.value.f_meter_brand})
321
+ })
322
+ this.meterbrands = rs
323
+ },
324
+
325
+ initAdjustables () {
326
+ let filter = this.$login.f.orgid
327
+ let ret = this.$GetSaleParam.getAdjustable(filter)
328
+ let arr = new Array()
329
+ ret.forEach((item, index) => {
330
+ arr.push({label: `[${item.value.f_adjustable_id}]-${item.label}`, value: item.value.id})
331
+ })
332
+ this.adjustables = arr
333
+ },
334
+
335
+ async initSlice (val) {
336
+ if (val) {
337
+ let getAllArea = await this.$resetpost('/rs/search', {
338
+ source: 'this.getParentByType($organization$).getAllChildrens().where(row.getType() == $zone$)',
339
+ userid: this.$login.f.id
340
+ }, {resolveMsg: null, rejectMsg: '获取片区出错!!!'})
341
+
342
+ let arr = getAllArea.data.filter((res) => {
343
+ return res.parentid == val
344
+ })
345
+ this.sliceArea = []
346
+ arr.forEach((res) => {
347
+ this.sliceArea.push({label: res.name, value: {name: res.name, code:res.number}})
348
+ })
349
+ }
350
+ },
351
+
352
+ //初始化省市区,添加街道
353
+ async initpcds(pconditon){
354
+ this.pcdslist = []
355
+ let HttpReset = new HttpResetClass()
356
+ let req = await HttpReset.load('POST', 'api/af-revenue/sql/address_singleTableOrderBy', {
357
+ data: {
358
+ items: '*',
359
+ tablename: 't_pcd',
360
+ orderitem: 'id',
361
+ condition: pconditon
362
+ }
363
+ }, {resolveMsg: null, rejectMsg: '获取地址失败!'})
364
+ let redata = []
365
+ req.data.forEach((row, n) => {
366
+ redata[n] = {
367
+ label: row.f_pcd,
368
+ value: row.id,
369
+ data:row,
370
+ id:row.id
371
+ }
372
+ })
373
+ this.pcdslist=redata
374
+
375
+ },
376
+ //初始化街道 添加小区
377
+ async initstreets(pconditon){
378
+ this.streetslist = []
379
+ let HttpReset = new HttpResetClass()
380
+ let req = await HttpReset.load('POST', 'api/af-revenue/sql/address_singleTableOrderBy', {
381
+ data: {
382
+ items: '*',
383
+ tablename: 't_street',
384
+ orderitem: 'id',
385
+ condition: pconditon
386
+ }
387
+ }, {resolveMsg: null, rejectMsg: '获取地址失败!'})
388
+ let redata = []
389
+ req.data.forEach((row, n) => {
390
+ redata[n] = {
391
+ label: row.f_street,
392
+ value: row.id,
393
+ data:row,
394
+ id:row.id
395
+ }
396
+ })
397
+ this.streetslist=redata
398
+ },
399
+
400
+ async areaidChange () {
401
+ // 验证小区编号是否已存在
402
+
403
+ let param = {
404
+ id: this.areamodel.id,
405
+ f_area_id: this.areamodel.f_area_id,
406
+ f_filialeid: this.f_filialeids
407
+ }
408
+
409
+ let res = await this.$resetpost('api/af-revenue/logic/address_validateAreaID', param, {resolveMsg: null,rejectMsg: '小区编号验证失败!!'})
410
+ console.log('验证小区是否存在', res)
411
+ if (res.data) {
412
+ this.$showAlert('这个小区编号已存在!!!请核实', 'warning', 3000)
413
+ this.areamodel.f_area_id = ''
414
+ }
415
+
416
+ },
417
+
418
+
419
+ //根据名字找数据
420
+ findbyid(list,name){
421
+ var result
422
+ list.forEach((row, n) => {
423
+ if(name==row.id){
424
+ result= row.data
425
+ }
426
+ })
427
+ return result
428
+ },
429
+ userTypeChange () {
430
+ this.gasproperties = []
431
+ if (this.areamodel.f_user_type) {
432
+ this.gasproperties = this.$appdata.getParam(this.areamodel.f_user_type)
433
+ }
434
+ },
435
+
436
+ //省/市/区变化
437
+ async pcdChange(val){
438
+ if(val){
439
+ //那就把街道数据重新组织一下
440
+ await this.initstreets(` f_filialeid = '${this.f_filialeids}' and f_pcd_id ='${val}' `)
441
+ if(this.areamodel.f_street_id){
442
+ if (this.findbyid(this.streetslist,this.areamodel.f_street_id)) {
443
+ let pcd_id=this.findbyid(this.streetslist,this.areamodel.f_street_id).f_pcd_id
444
+ if(pcd_id!=val){
445
+ this.areamodel.f_street_id=''
446
+ }
447
+ } else {
448
+ this.areamodel.f_street_id=''
449
+ }
450
+
451
+ }
452
+ }
453
+ this.$resetValidation()
454
+ },
455
+ //街道变化
456
+ streetChange(val){
457
+ if(val&&this.operation=='add'){
458
+ // if(this.areamodel.f_pcd_id.length==0){
459
+ if (this.findbyid(this.streetslist,this.areamodel.f_street_id)) {
460
+ console.log("aa",this.findbyid(this.streetslist,this.areamodel.f_street_id))
461
+ console.log("bbb",this.findbyid(this.streetslist,this.areamodel.f_street_id).f_pcd_id)
462
+ this.areamodel.f_pcd_id=this.findbyid(this.streetslist,this.areamodel.f_street_id).f_pcd_id
463
+ }
464
+ // }
465
+ }
466
+ this.$resetValidation()
467
+ },
468
+ //保存
469
+ async confirm(){
470
+ await this.savearea()
471
+ this.cleardara()
472
+ this.$dispatch('confirm')
473
+ },
474
+ //保存小区
475
+ async savearea(){
476
+ if(this.f_special){
477
+ this.areamodel.f_special='1'
478
+ }
479
+ this.areamodel.f_filialeid = this.f_filialeids
480
+ this.areamodel.f_operator = this.$login.f.name
481
+ this.areamodel.f_operatorid = this.$login.f.id
482
+ this.areamodel.f_orgid = this.$login.f.orgid
483
+ this.areamodel.f_orgname = this.$login.f.orgs
484
+ this.areamodel.f_depid = this.$login.f.depids
485
+ this.areamodel.f_depname = this.$login.f.deps
486
+ if (this.areamodel.slice_area) {
487
+ if (this.areamodel.slice_area.length > 0) {
488
+ this.areamodel.f_slice_area = this.areamodel.slice_area[0].name
489
+ this.areamodel.f_area_code = this.areamodel.slice_area[0].code
490
+ }
491
+ }
492
+ this.areamodel.f_pcd=this.findbyid(this.pcdslist,this.areamodel.f_pcd_id).f_pcd
493
+ this.areamodel.f_street=this.findbyid(this.streetslist,this.areamodel.f_street_id).f_street
494
+
495
+ await this.$resetpost('api/af-revenue/logic/address_updatearea', this.areamodel)
496
+ },
497
+ cleardara(){
498
+ this.areamodel= {
499
+ f_area_id: '',
500
+ f_pcd_id:'',
501
+ f_street_id:'',
502
+ f_slice_area:'',
503
+ f_linkname:'',
504
+ f_linkphone:'',
505
+ f_adjustable_id:'',
506
+ f_residential_area:'',
507
+ f_user_type:'',
508
+ f_gasproperties:'',
509
+ f_area_address:'',
510
+ f_meter_brand:'',
511
+ f_price_name:'',
512
+ f_price_type:'',
513
+ f_meter_style:'',
514
+ f_position:'',
515
+ f_comments:'',
516
+ f_meter_type: ''
517
+ }
518
+ },
519
+ cancel(){
520
+ this.cleardara()
521
+ this.$dispatch('cancel')
522
+ },
523
+ },
524
+ watch: {
525
+ 'areamodel.f_meter_type' (val) {
526
+ if (val === '机表')
527
+ this.isMachine = false
528
+ },
529
+ 'areatype'(){
530
+ this.initdata()
531
+ },
532
+ 'areamodel.f_pcd_id'(){
533
+ if(this.areamodel.f_pcd_id&&this.areamodel.f_street_id){
534
+ if (this.findbyid(this.pcdslist,this.areamodel.f_pcd_id) && this.findbyid(this.streetslist,this.areamodel.f_street_id)) {
535
+ this.areamodel.f_area_address = this.findbyid(this.pcdslist,this.areamodel.f_pcd_id).f_pcd + this.findbyid(this.streetslist,this.areamodel.f_street_id).f_street
536
+ }
537
+ }
538
+ },
539
+ 'areamodel.f_street_id'(){
540
+ if (this.areamodel.f_pcd_id && this.areamodel.f_street_id) {
541
+ if (this.findbyid(this.pcdslist, this.areamodel.f_pcd_id) && this.findbyid(this.streetslist, this.areamodel.f_street_id)) {
542
+ this.areamodel.f_area_address = this.findbyid(this.pcdslist, this.areamodel.f_pcd_id).f_pcd + this.findbyid(this.streetslist, this.areamodel.f_street_id).f_street
543
+ }
544
+ }
545
+ },
546
+ 'f_filialeids'(){
547
+ if (this.areamodel.f_filialeid) {
548
+ if (this.areamodel.f_filialeid != this.f_filialeids) {
549
+ this.$dispatch('cancel')
550
+ }
551
+ }
552
+ this.cleardara()
553
+ this.initdata()
554
+ }
555
+ },
556
+ computed: {
557
+ metertypes() {
558
+ return this.$appdata.getParam('气表类型')
559
+ },
560
+ usertypes () {
561
+ return this.$appdata.getParam('用户类型')
562
+ },
563
+ f_price_types () {
564
+ return this.$appdata.getParam('气价类型')
565
+ },
566
+ meterstyle () {
567
+ let ret = this.$GetSaleParam.getGasbrand()
568
+ let rs = new Array()
569
+ if(this.areamodel.f_meter_brand) {
570
+ ret.forEach((item, index) => {
571
+ if(this.areamodel.f_meter_brand == item.value.f_meter_brand) {
572
+ item.value.gasmodel.forEach((item1, index) =>{
573
+ rs.push({label: item1.label, value:item1.label})
574
+ })
575
+ }
576
+ })
577
+ }
578
+ return rs
579
+ },
580
+ pricenames () {
581
+ let rs = new Array()
582
+ if (this.areamodel.f_user_type && this.areamodel.f_gasproperties && this.areamodel.f_price_type) {
583
+ let params = {
584
+ f_user_type: this.areamodel.f_user_type,
585
+ f_gasproperties: this.areamodel.f_gasproperties,
586
+ f_price_type: this.areamodel.f_price_type,
587
+ filter: this.f_filialeids
588
+ }
589
+ let ret = this.$GetSaleParam.getPrice(params)
590
+ ret.forEach((item, index) => {
591
+ rs.push({label: item.label, value: item.value.f_price_name})
592
+ })
593
+ }
594
+ if (rs.length == 0) {
595
+ this.areamodel.f_price_name = ''
596
+ }
597
+ return rs
598
+ },
599
+ positions () {
600
+ return this.$appdata.getParam('安装位置')
601
+ },
602
+ inputtores () {
603
+ // 获取抄表员
604
+ let rs = new Array()
605
+ if (this.$login.f.f_gasman.length > 0) {
606
+ for (let i = 0; i < this.$login.f.f_gasman.length; i++) {
607
+ let temp = {
608
+ label: this.$login.f.f_gasman[i].name,
609
+ value: this.$login.f.f_gasman[i].name
610
+ }
611
+ rs.push(temp)
612
+ }
613
+ }
614
+ return rs
615
+ }
616
+ }
617
+ }
618
+ </script>
619
+ <style>
620
+ .box {
621
+ width: 727px;
622
+ height: 175px;
623
+ border-radius: 2px;
624
+ background-color: #fafafa;
625
+ border: 1px solid #999999;
626
+ margin-top: 13px;
627
+ }
628
+ .datapanel {
629
+ color: #333;
630
+ background-color: white;
631
+ box-shadow: darkgrey 0.5px 0.5px 0.5px 0.5px ;
632
+ padding: 10px 30px 10px 30px;
633
+ border-radius:15px;
634
+ }
635
+ </style>