system-phone 3.1.1 → 3.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (103) hide show
  1. package/.gradle/buildOutputCleanup/cache.properties +2 -2
  2. package/SystemPhone.iml +8 -8
  3. package/build/dev-server.js +141 -141
  4. package/build/webpack.base.conf.js +82 -82
  5. package/build.gradle +27 -27
  6. package/gradle/wrapper/gradle-wrapper.properties +5 -5
  7. package/gradlew +183 -183
  8. package/gradlew.bat +100 -100
  9. package/index.html +21 -21
  10. package/package.json +1 -1
  11. package/src/App.vue +25 -25
  12. package/src/Util.js +415 -415
  13. package/src/assets//346/215/242/350/241/250/347/273/264/344/277/256.png +0 -0
  14. package/src/assets//351/200/232/347/224/250/350/203/214/346/231/257/345/233/276.png +0 -0
  15. package/src/components/AloneLoadParams.vue +26 -26
  16. package/src/components/AlreadyService.vue +193 -193
  17. package/src/components/AttendManage.vue +534 -534
  18. package/src/components/LoadAppdata.vue +38 -38
  19. package/src/components/LoginApp.vue +732 -732
  20. package/src/components/LoginAppNew.vue +587 -587
  21. package/src/components/LoginAppV4.vue +716 -716
  22. package/src/components/ModifyPassWord.vue +216 -216
  23. package/src/components/NavBottom.vue +117 -117
  24. package/src/components/NavBottomV.vue +141 -141
  25. package/src/components/NavBottomVVV.vue +185 -185
  26. package/src/components/OnlineManage.vue +256 -256
  27. package/src/components/PhoneAllInfo.vue +68 -68
  28. package/src/components/PhoneChangemeterInfo.vue +116 -116
  29. package/src/components/PhoneImageInfo.vue +102 -102
  30. package/src/components/PhoneInfoTable.vue +39 -39
  31. package/src/components/PhoneMeterInfo.vue +132 -132
  32. package/src/components/PhoneRepairInfo.vue +146 -146
  33. package/src/components/PhoneSafeInfo.vue +101 -101
  34. package/src/components/PhoneSellInfo.vue +148 -148
  35. package/src/components/PhoneSellInfoLite.vue +112 -112
  36. package/src/components/PhoneUser.vue +202 -202
  37. package/src/components/PhoneUserDetil.vue +70 -70
  38. package/src/components/PhoneUserFind.vue +138 -138
  39. package/src/components/RightTree.vue +217 -217
  40. package/src/components/SystemSetUp.vue +332 -332
  41. package/src/components/TabBarPhone.vue +81 -81
  42. package/src/components/Test.vue +14 -14
  43. package/src/components/ToolsPage.vue +199 -199
  44. package/src/components/UploadManage.vue +194 -194
  45. package/src/components/gaomi/NavBottomV.vue +223 -223
  46. package/src/components/gaomi/NavBottomVVVV.vue +210 -210
  47. package/src/components/gaomi/Scroller.vue +63 -63
  48. package/src/components/gaomi/SystemSetUp.vue +186 -186
  49. package/src/components/gaomi/ToolsPage.vue +168 -168
  50. package/src/components/idea/feedBack.vue +150 -150
  51. package/src/components/idea/feedbackAdd.vue +366 -366
  52. package/src/components/info/ConfigInfo.vue +122 -122
  53. package/src/components/info/FindUserInfo.vue +157 -157
  54. package/src/components/info/InfoTable.vue +37 -37
  55. package/src/components/iot/InstructMessage.vue +313 -313
  56. package/src/components/iot/IotBaseInfo.vue +97 -97
  57. package/src/components/iot/IotMeterInfo.vue +77 -77
  58. package/src/components/iot/iotMonitoringMain.vue +501 -501
  59. package/src/components/online/ApplyOnline.vue +581 -581
  60. package/src/components/online/BJZhongRan/ApplyOnline.vue +600 -600
  61. package/src/components/screen/ChargeContentPage.vue +656 -656
  62. package/src/components/screen/ContentPage.vue +611 -611
  63. package/src/components/screen/GongdanContentPage.vue +149 -149
  64. package/src/components/screen/ListCountItem.vue +93 -93
  65. package/src/components/screen/ModuleTitle.vue +48 -48
  66. package/src/components/screen/SafeOrderContentPage.vue +440 -440
  67. package/src/components/screen/SecurityCheckItem.vue +50 -50
  68. package/src/components/screen/TotalItem.vue +76 -76
  69. package/src/components/screen/TotalUserNumber.vue +77 -77
  70. package/src/components/screen/WorkOrderItem.vue +51 -51
  71. package/src/components/screen/WorkOrderRightDownItem.vue +103 -103
  72. package/src/components/screen/WorkOrderRightItem.vue +115 -115
  73. package/src/components/userinfo/paymentQuery.vue +189 -189
  74. package/src/components/userinfo/queryFile.vue +190 -190
  75. package/src/components/wasm.vue +18 -18
  76. package/src/expandcssAndroid.less +521 -521
  77. package/src/filiale/yulinyuchuan/AlreadyService.vue +194 -194
  78. package/src/filiale/yulinyuchuan/AttendManage.vue +537 -537
  79. package/src/filiale/yulinyuchuan/LoginApp.vue +741 -741
  80. package/src/filiale/yulinyuchuan/OnlineManage.vue +256 -256
  81. package/src/filiale/yulinyuchuan/SystemSetUp.vue +332 -332
  82. package/src/filiale/yulinyuchuan/UploadManage.vue +195 -195
  83. package/src/filiale/yulinyuchuan/systemphonegrid.js +9 -9
  84. package/src/filiale/yulinyuchuanTY/AlreadyService.vue +194 -0
  85. package/src/filiale/yulinyuchuanTY/AttendManage.vue +537 -0
  86. package/src/filiale/yulinyuchuanTY/LoginApp.vue +741 -0
  87. package/src/filiale/yulinyuchuanTY/OnlineManage.vue +256 -0
  88. package/src/filiale/yulinyuchuanTY/SystemSetUp.vue +332 -0
  89. package/src/filiale/yulinyuchuanTY/UploadManage.vue +195 -0
  90. package/src/filiale/yulinyuchuanTY/systemphonegrid.js +9 -0
  91. package/src/index.js +9 -9
  92. package/src/main.js +38 -38
  93. package/src/plugins/const.js +404 -404
  94. package/src/plugins/vue-py.js +37 -37
  95. package/src/stores/AppData.js +79 -79
  96. package/src/systemphone-gaomi.js +105 -105
  97. package/src/systemphone.js +60 -60
  98. package/src/systemphonegrid.js +185 -185
  99. package/src/util/LdapHelper.js +75 -75
  100. package/static/const.js +404 -404
  101. package/static/layui/font/iconfont.svg +554 -554
  102. package/static/vue-py.js +37 -37
  103. package/static/wasm_exec.js +465 -465
@@ -1,582 +1,582 @@
1
- <template>
2
- <div>
3
- <!--表具信息-->
4
- <validator name='v' :data.sync="data">
5
- <div class="auto select-overspread form-horizontal repair-bg">
6
- <div class="bq-parent">
7
- <blockquote class="blockquote">
8
- <p>表具信息</p>
9
- </blockquote>
10
- </div>
11
- <div class="panel panel-default auto repair-info-content">
12
- <div class="panel-body auto repair-info-content compatible">
13
- <div class="col-xs-12 col-sm-12 col-md-12 form-input-group" :class="[$v.f_meternumber.required ? 'has-error' : 'has-success']">
14
- <label for="f_meternumber" class="lb-left text-justify">表号</label>
15
- <input id="f_meternumber" v-model="userdata.userinfo.userfiles.f_meternumber" v-validate:f_meternumber="{required: true}" type="text" class="form-control"/>
16
- <button type="button" name="button" class="btn btn-primary" @click="scan">扫码</button>
17
- </div>
18
- <div class="col-xs-12 col-sm-12 col-md-12 form-input-group" :class="[$v.f_meter_brand.required ? 'has-error' : 'has-success']">
19
- <label for="f_meter_brand" class="lb-left text-justify">气表品牌</label>
20
- <input id="f_meter_brand" v-model="userdata.userinfo.userfiles.f_meter_brand" v-validate:f_meter_brand="{required: true}" type="text" class="form-control">
21
- </div>
22
- <div class="col-xs-12 col-sm-12 col-md-12 form-input-group" :class="[$v.f_meter_style.required ? 'has-error' : 'has-success']">
23
- <label for="f_meter_style" class="lb-left text-justify">气表型号</label>
24
- <input id="f_meter_style" v-model="userdata.userinfo.userfiles.f_meter_style" v-validate:f_meter_style="{required: true}" type="text" class="form-control">
25
- </div>
26
- <div class="col-xs-12 col-sm-12 col-md-12 form-input-group" :class="[$v.f_meter_type.required ? 'has-error' : 'has-success']">
27
- <label for="f_meter_type" class="lb-left text-justify">气表类型</label>
28
- <input id="f_meter_type" v-model="userdata.userinfo.userfiles.f_meter_type" v-validate:f_meter_type="{required: true}" type="text" class="form-control">
29
- </div>
30
- <div class="col-xs-12 col-sm-12 col-md-12 form-input-group" :class="[$v.f_aroundmeter.required ? 'has-error' : 'has-success']">
31
- <label for="f_aroundmeter" class="lb-left text-justify">进气方向</label>
32
- <input type="text"
33
- v-show="false"
34
- v-model="userdata.userinfo.userfiles.f_aroundmeter"
35
- v-validate:f_aroundmeter='{required: true}'>
36
- <v-select id="f_aroundmeter"
37
- :value.sync="userdata.userinfo.userfiles.f_aroundmeter"
38
- :value-single="true"
39
- :options='aroundmeterlist'
40
- placeholder='请选择'
41
- close-on-select>
42
- </v-select>
43
- </div>
44
- <div class="col-xs-12 col-sm-12 col-md-12 form-input-group" :class="[$v.f_initial_base.required ? 'has-error' : 'has-success']">
45
- <label for="f_initial_base" class="lb-left text-justify">表基数</label>
46
- <input id="f_initial_base" v-model="userdata.userinfo.userfiles.f_initial_base" v-validate:f_initial_base="{required: true}" type="number" class="form-control">
47
- </div>
48
- </div>
49
- </div>
50
- </div>
51
- <div class="bq-parent">
52
- <blockquote class="blockquote">
53
- <input class="magic-checkbox" type="checkbox" id="isStay" v-model="isStay"/>
54
- <label for="isStay" style="width:150px;padding-bottom: 10px">用户是否入住</label>
55
- </blockquote>
56
- </div>
57
- <!--用户信息-->
58
- <div class="auto select-overspread form-horizontal repair-bg" v-show="isStay">
59
- <div class="bq-parent">
60
- <blockquote class="blockquote">
61
- <p>用户信息</p>
62
- </blockquote>
63
- </div>
64
- <div class="panel panel-default auto repair-info-content">
65
- <div class="panel-body auto repair-info-content compatible">
66
- <div class="col-xs-12 col-sm-12 col-md-12 form-input-group">
67
- <label for="f_user_name" class="lb-left text-justify">用户姓名</label>
68
- <input id="f_user_name" v-model="userdata.userinfo.f_user_name" type="text" class="form-control"/>
69
- </div>
70
- <div class="col-xs-12 col-sm-12 col-md-12 form-input-group">
71
- <label for="f_idnumber" class="lb-left text-justify">身份证号</label>
72
- <input id="f_idnumber" v-model="userdata.userinfo.f_idnumber" type="text" class="form-control">
73
- </div>
74
- <div class="col-xs-12 col-sm-12 col-md-12 form-input-group" v-show="isNotIdNumber">
75
- <span style="font-size:10px;color: red">输入的身份证号长度不对,或者号码不符合规定!</span>
76
- </div>
77
- <div class="col-xs-12 col-sm-12 col-md-12 form-input-group">
78
- <label for="f_user_phone" class="lb-left text-justify">用户电话</label>
79
- <input id="f_user_phone" v-model="userdata.userinfo.f_user_phone" type="text" class="form-control">
80
- </div>
81
- <div class="col-xs-12 col-sm-12 col-md-12 form-input-group">
82
- <label for="f_price_name" class="lb-left text-justify">住户类型</label>
83
- <v-select id="f_price_name"
84
- :value.sync="userdata.userinfo.f_price_name"
85
- :value-single="true"
86
- :options='houseTypeOptions'
87
- placeholder='请选择'
88
- close-on-select>
89
- </v-select>
90
- </div>
91
- <div class="col-xs-12 col-sm-12 col-md-12 form-input-group">
92
- <label for="f_comments" class="lb-left text-justify">备注</label>
93
- <textarea id="f_comments" class="form-control" cols="30" rows="4" style="resize: vertical;" v-model="userdata.userinfo.f_comments"></textarea>
94
- </div>
95
- </div>
96
- </div>
97
- </div>
98
- <!--地址信息-->
99
- <div class="auto select-overspread form-horizontal repair-bg">
100
- <div class="bq-parent">
101
- <blockquote class="blockquote">
102
- <p>地址信息</p>
103
- </blockquote>
104
- </div>
105
- <div class="panel panel-default auto repair-info-content">
106
- <div class="panel-body auto repair-info-content compatible">
107
- <div class="col-xs-12 col-sm-12 col-md-12 form-input-group" :class="[$v.f_pcd_id.required ? 'has-error' : 'has-success']">
108
- <label for="f_pcd_id" class="lb-left text-justify">省市区</label>
109
- <input type="text"
110
- v-show="false"
111
- v-model="addressData.f_pcd_id"
112
- v-validate:f_pcd_id='{required: true}'>
113
- <v-select id="f_pcd_id"
114
- :value.sync="addressData.f_pcd_id"
115
- :value-single="true"
116
- :options='pcdslist'
117
- placeholder='请选择'
118
- close-on-select
119
- search="true"
120
- @change="pcdChange">
121
- </v-select>
122
- </div>
123
- <div class="col-xs-12 col-sm-12 col-md-12 form-input-group" :class="[$v.f_street_id.required ? 'has-error' : 'has-success']">
124
- <label for="f_street_id" class="lb-left text-justify">街道名称</label>
125
- <input type="text"
126
- v-show="false"
127
- v-model="addressData.f_street_id"
128
- v-validate:f_street_id='{required: true}'>
129
- <v-select id="f_street_id"
130
- :value.sync="addressData.f_street_id"
131
- :value-single="true"
132
- :options='streetslist'
133
- placeholder='请选择'
134
- close-on-select
135
- search="true"
136
- @change="streetChange">
137
- </v-select>
138
- </div>
139
- <div class="col-xs-12 col-sm-12 col-md-12 form-input-group" :class="[$v.f_residential_area_id.required ? 'has-error' : 'has-success']">
140
- <label for="f_residential_area_id" class="lb-left text-justify">小区名称</label>
141
- <input type="text"
142
- v-show="false"
143
- v-model="addressData.f_residential_area_id"
144
- v-validate:f_residential_area_id='{required: true}'>
145
- <v-select id="f_residential_area_id"
146
- :value.sync="addressData.f_residential_area_id"
147
- :value-single="true"
148
- :options='areaslist'
149
- placeholder='请选择'
150
- close-on-select
151
- search="true"
152
- @change="areaChange">
153
- </v-select>
154
- </div>
155
- <div class="col-xs-12 col-sm-12 col-md-12 form-input-group" :class="[$v.slice.required ? 'has-error' : 'has-success']">
156
- <label for="f_meter_type" class="lb-left text-justify">片区</label>
157
- <input type="text"
158
- v-show="false"
159
- v-model="$refs.slice.selectedItems"
160
- v-validate:slice='{required: true}'>
161
- <v-select id="slice_area"
162
- :value.sync="addressData.slice_area"
163
- :options='sliceArea'
164
- placeholder='片区/管理站'
165
- filer-key="name"
166
- close-on-select
167
- v-ref:slice>
168
- </v-select>
169
- </div>
170
- <div class="col-xs-12 col-sm-12 col-md-12 form-input-group" :class="[$v.f_building.required ? 'has-error' : 'has-success']">
171
- <label for="f_building" class="lb-left text-justify">楼号</label>
172
- <input id="f_building" v-model="addressData.f_building" v-validate:f_building='{required: true}' type="text" class="form-control" style="width: 70%">
173
- <input id="f_building_suffix" v-model="addressData.f_building_suffix" type="text" class="form-control" style="width: 30%">
174
- </div>
175
- <div class="col-xs-12 col-sm-12 col-md-12 form-input-group" :class="[$v.f_unit.required ? 'has-error' : 'has-success']">
176
- <label for="f_unit" class="lb-left text-justify">单元</label>
177
- <input id="f_unit" v-model="addressData.f_unit" v-validate:f_unit='{required: true}' type="text" class="form-control" style="width: 70%">
178
- <input id="f_unit_suffix" v-model="addressData.f_unit_suffix" type="text" class="form-control" style="width: 30%">
179
- </div>
180
- <div class="col-xs-12 col-sm-12 col-md-12 form-input-group" :class="[$v.f_floor.required ? 'has-error' : 'has-success']">
181
- <label for="f_floor" class="lb-left text-justify">楼层</label>
182
- <input id="f_floor" v-model="addressData.f_floor" v-validate:f_floor='{required: true}' type="text" class="form-control" style="width: 70%">
183
- <input id="f_floor_suffix" v-model="addressData.f_floor_suffix" type="text" class="form-control" style="width: 30%">
184
- </div>
185
- <div class="col-xs-12 col-sm-12 col-md-12 form-input-group" :class="[$v.f_room.required ? 'has-error' : 'has-success']">
186
- <label for="f_room" class="lb-left text-justify">门牌号</label>
187
- <input id="f_room" type="text" v-model="addressData.f_room" v-validate:f_room='{required: true}' class="form-control" style="width: 70%">
188
- <input id="f_room_suffix" type="text" v-model="addressData.f_room_suffix" class="form-control" style="width: 30%">
189
- </div>
190
- </div>
191
- </div>
192
- </div>
193
- </validator>
194
- <!--提交-->
195
- <div class="panel panel-default auto repair-info-content" style="width: 100%;height: auto">
196
- <div style="margin: 0 auto;width: 25%">
197
- <button type="button" name="button" class="col-sm-3 btn btn-primary" :disabled='!$v.valid' @click='summit()'>
198
- 上传档案
199
- </button>
200
- </div>
201
- </div>
202
- <work-busy :is-busy="isBusy"></work-busy>
203
- </div>
204
- </template>
205
-
206
- <script>
207
- import Vue from 'vue'
208
- import {HttpResetClass} from 'vue-client'
209
-
210
- export default {
211
- title: "ApplyOnline",
212
- data() {
213
- return {
214
- userdata: {
215
- address: {
216
- id: null
217
- },
218
- f_user_type: "民用",
219
- userinfo: {
220
- userfiles: {
221
- f_meternumber: null,
222
- f_meter_brand: null,
223
- f_meter_style: null,
224
- f_meter_type: null,
225
- f_aroundmeter: null,
226
- f_initial_base: null,
227
- f_table_state: "待开通"
228
- },
229
- f_price_name: null,
230
- f_rent_phone: null,
231
- f_user_phone: null,
232
- f_user_name: null,
233
- f_idnumber: null,
234
- f_comments: null
235
- },
236
- devices: [],
237
- f_operator: Vue.user.ename
238
- },
239
- // 是否入住
240
- isStay: false,
241
- addressData: {
242
- f_create_person: Vue.user.name,
243
- f_filialeid: Vue.user.orgid,
244
- f_operator: Vue.user.name,
245
- f_operatorid: Vue.user.id,
246
- f_orgid: Vue.user.orgid,
247
- f_orgname: Vue.user.orgs,
248
- f_depid: Vue.user.depids,
249
- f_depname: Vue.user.deps,
250
- f_pcd: null,
251
- f_pcd_id: null,
252
- f_street: null,
253
- f_street_id: null,
254
- f_residential_area: null,
255
- f_residential_area_id: null,
256
- f_address: null,
257
- slice_area: null,
258
- f_slice_area: null,
259
- f_area_code: null,
260
- f_building: null,
261
- f_building_suffix: "号楼",
262
- f_unit: null,
263
- f_unit_suffix: "单元",
264
- f_floor: null,
265
- f_floor_suffix: "层",
266
- f_room: null,
267
- f_room_suffix: "室"
268
- },
269
- //初始化省市区数据
270
- pcdslist: [],
271
- //初始化街道数据
272
- streetslist: [],
273
- //初始化街道数据
274
- areaslist: [],
275
- sliceArea: [],
276
- aroundmeterlist: [{label: '左表', value: '左表'}, {label: '右表', value: '右表'}],
277
- houseTypeOptions: [{label: '自有房', value: '自有房'}, {label: '租赁房', value: '租赁房'}],
278
- isNotIdNumber: false,
279
- isBusy: false
280
- }
281
- },
282
- async ready() {
283
- console.log('进入在线报装页面www')
284
- await this.initpcds(` f_filialeid = '${Vue.user.orgid}'`)
285
- await this.initAreas(Vue.user.orgid)
286
- console.log('pcdslist ===> ' + JSON.stringify(this.pcdslist))
287
- console.log('sliceArea ===> ' + JSON.stringify(this.sliceArea))
288
- },
289
- methods: {
290
- scan() {
291
- HostApp.__this__ = this
292
- HostApp.scanCode({callback: "javascript:HostApp.__this__.scanCallback();"})
293
- },
294
- scanCallback() {
295
- let response = HostApp.getCode()
296
- console.log(`扫码返回值:${response}`)
297
- if (response.code == 200) {
298
- this.userdata.userinfo.userfiles.f_meternumber = response.data
299
- } else {
300
- this.$showMessage('无法识别该条形码,请调整手机聚焦重试。')
301
- }
302
- },
303
- // 初始化片区
304
- async initAreas(val) {
305
- if (val) {
306
- let http = new HttpResetClass()
307
- let getAllArea = await http.load('POST', `${this.$androidUtil.getProxyUrl()}/rs/search`, {
308
- source: 'this.getParentByType($organization$).getAllChildrens().where(row.getType() == $zone$)',
309
- userid: Vue.user.id
310
- }, {resolveMsg: null, rejectMsg: '获取片区出错!!!'})
311
-
312
- let arr = getAllArea.data.filter((res) => {
313
- return res.parentid == val
314
- })
315
- console.log('过滤之后的片区:' + JSON.stringify(arr))
316
- this.sliceArea = []
317
- arr.forEach((res) => {
318
- this.sliceArea.push({label: res.name, value: {name: res.name, code: res.number}})
319
- })
320
- }
321
- },
322
-
323
- //初始化省市区,添加街道
324
- async initpcds(pconditon) {
325
- this.pcdslist = []
326
- let HttpReset = new HttpResetClass()
327
- let req = await HttpReset.load('POST', `${this.$androidUtil.getProxyUrl()}/rs/sql/address_singleTableOrderBy`, {
328
- data: {
329
- items: '*',
330
- tablename: 't_pcd',
331
- orderitem: 'id',
332
- condition: pconditon
333
- }
334
- }, {resolveMsg: null, rejectMsg: '获取地址失败!'})
335
- let redata = []
336
- req.data.forEach((row, n) => {
337
- redata[n] = {
338
- label: row.f_pcd,
339
- value: row.id,
340
- data: row,
341
- id: row.id
342
- }
343
- })
344
- this.pcdslist = redata
345
- },
346
- //初始化街道 添加小区
347
- async initstreets(pconditon) {
348
- this.streetslist = []
349
- let HttpReset = new HttpResetClass()
350
- let req = await HttpReset.load('POST', `${this.$androidUtil.getProxyUrl()}/rs/sql/address_singleTableOrderBy`, {
351
- data: {
352
- items: '*',
353
- tablename: 't_street',
354
- orderitem: 'id',
355
- condition: pconditon
356
- }
357
- }, {resolveMsg: null, rejectMsg: '获取地址失败!'})
358
- let redata = []
359
- req.data.forEach((row, n) => {
360
- redata[n] = {
361
- label: row.f_street,
362
- value: row.id,
363
- data: row,
364
- id: row.id
365
- }
366
- })
367
- this.streetslist = redata
368
- },
369
- //初始化小区添加小区
370
- async initareas(pconditon) {
371
- if (this.usertype) {
372
- pconditon = pconditon + ` and f_special='1' `
373
- }
374
- this.areaslist = []
375
- let HttpReset = new HttpResetClass()
376
- let req = await HttpReset.load('POST', `${this.$androidUtil.getProxyUrl()}/rs/sql/address_singleTableOrderBy`, {
377
- data: {
378
- items: '*',
379
- tablename: 't_area',
380
- orderitem: 'id',
381
- condition: pconditon
382
- }
383
- }, {resolveMsg: null, rejectMsg: '获取地址失败!'})
384
- let redata = []
385
- req.data.forEach((row) => {
386
- redata.push({
387
- label: row.f_residential_area,
388
- value: row.id,
389
- data: row,
390
- id: row.id
391
- })
392
- })
393
- this.areaslist = redata
394
- },
395
- //省/市/区变化
396
- async pcdChange(val) {
397
- console.log(`省/市/区变化 => ${JSON.stringify(val)} => ${JSON.stringify(this.addressData)}`)
398
- if (val) {
399
- //那就把[小区,街道]重新组织一下
400
- await this.initstreets(` f_filialeid = '${Vue.user.orgid}' and f_pcd_id ='${val}' `)
401
- if (this.addressData.f_street_id) {
402
- if (this.findbyid(this.streetslist, this.addressData.f_street_id)) {
403
- let pcd_id = this.findbyid(this.streetslist, this.addressData.f_street_id).f_pcd_id
404
- if (pcd_id != val) {
405
- this.addressData.f_street_id = ''
406
- }
407
- } else {
408
- this.addressData.f_street_id = ''
409
- }
410
-
411
- //那就把[小区,街道]重新组织一下
412
- if (this.addressData.f_street_id) {
413
- await this.initareas(` f_street_id ='${this.addressData.f_street_id}' `)
414
- if (this.addressData.f_residential_area_id) {
415
- if (this.findbyid(this.areaslist, this.addressData.f_residential_area_id)) {
416
- let pcd_id = this.findbyid(this.areaslist, this.addressData.f_residential_area_id).f_pcd_id
417
- if (pcd_id != val) {
418
- this.addressData.f_residential_area_id = ''
419
- }
420
- } else {
421
- this.addressData.f_residential_area_id = ''
422
- }
423
-
424
- }
425
- }
426
- }
427
- }
428
- this.$resetValidation()
429
- },
430
- //小区变化
431
- areaChange(val) {
432
- console.log(`小区变化 => ${JSON.stringify(val)} => ${JSON.stringify(this.addressData)}`)
433
- if (val) {
434
- let getArea = this.areaslist.filter((res) => {
435
- return res.id = this.addressData.f_residential_area_id
436
- })
437
- if (getArea.length > 0) {
438
- console.log('获取小区数据', getArea[0].data)
439
- this.addressData.slice_area = [{name: getArea[0].data.f_slice_area, code: getArea[0].data.f_area_code}]
440
- }
441
- }
442
- this.$resetValidation()
443
- },
444
- //街道变化
445
- async streetChange(val) {
446
- console.log(`街道变化 => ${JSON.stringify(val)} => ${JSON.stringify(this.addressData)}`)
447
- if (this.streetslist[0]) {
448
- var street = ''
449
- this.streetslist.forEach((item) => {
450
- if (item.id === val) {
451
- street = item.label
452
- }
453
- })
454
- this.addressData.f_address = street
455
- }
456
- if (val) {
457
- //那就把[小区]重新组织一下
458
- await this.initareas(` f_street_id ='${val}' `)
459
- if (this.addressData.f_residential_area_id) {
460
- if (this.findbyid(this.areaslist, this.addressData.f_residential_area_id)) {
461
- let street_id = this.findbyid(this.areaslist, this.addressData.f_residential_area_id).f_street_id
462
- if (street_id != val) {
463
- this.addressData.f_residential_area_id = ''
464
- }
465
- } else {
466
- this.addressData.f_residential_area_id = ''
467
- }
468
-
469
- }
470
- }
471
- this.$resetValidation()
472
- },
473
- //根据名字找数据
474
- findbyid(list, name) {
475
- let result
476
- list.forEach((row, n) => {
477
- if (name == row.value) {
478
- result = row.data
479
- }
480
- })
481
- return result
482
- },
483
- async createAddress() {
484
- if (this.addressData.slice_area) {
485
- if (this.addressData.slice_area.length > 0) {
486
- this.addressData.f_slice_area = this.addressData.slice_area[0].name
487
- this.addressData.f_area_code = this.addressData.slice_area[0].code
488
- }
489
- }
490
- this.addressData.f_pcd = this.findbyid(this.pcdslist, this.addressData.f_pcd_id).f_pcd
491
- this.addressData.f_street = this.findbyid(this.streetslist, this.addressData.f_street_id).f_street
492
- this.addressData.f_residential_area = this.findbyid(this.areaslist, this.addressData.f_residential_area_id).f_residential_area
493
- this.addressData.f_address = this.addressData.f_street + this.addressData.f_residential_area + (this.addressData.f_building ? this.addressData.f_building + this.addressData.f_building_suffix : '') + (this.addressData.f_unit ? this.addressData.f_unit + this.addressData.f_unit_suffix : '') + (this.addressData.f_floor ? this.addressData.f_floor + this.addressData.f_floor_suffix : '') + this.addressData.f_room + this.addressData.f_room_suffix
494
- console.log("调用创建地址接口参数 ==> " + JSON.stringify(this.addressData))
495
- let http = new HttpResetClass()
496
- return await http.load('POST', `${this.$androidUtil.getProxyUrl()}/rs/logic/address_updateuseraddress`, this.addressData)
497
- },
498
- async createUserData() {
499
- let http = new HttpResetClass()
500
- return await http.load('POST',
501
- `${this.$androidUtil.getProxyUrl()}/rs/logic/sale_userSave`,
502
- this.userdata
503
- )
504
- },
505
- async summit() {
506
- this.isBusy = true
507
- try {
508
- // 先创建地址信息
509
- console.log('创建地址')
510
- let response = await this.createAddress()
511
- console.log('createAddressResponse ===> ' + JSON.stringify(response))
512
- this.userdata.address.id = response.data.id
513
- } catch (e) {
514
- console.log('e ===> ' + JSON.stringify(e))
515
- // 如果地址已存在,使用存在的地址建档
516
- if (e.status && e.status == 635) {
517
- console.log('地址已存在,获取已存在地址id')
518
- let http = new HttpResetClass()
519
- let data = {
520
- data: {
521
- items: 'id',
522
- tablename: 't_user_address',
523
- condition: `f_address = '${this.addressData.f_address}'`
524
- }
525
- }
526
- let response = await http.load('POST', `${this.$androidUtil.getProxyUrl()}/rs/sql/querySingleTable`, data)
527
- console.log('searchAddressResponse ===> ' + JSON.stringify(response))
528
- if (response.data && response.data.length > 0) {
529
- this.userdata.address.id = response.data[0].id
530
- }
531
- } else {
532
- this.$showMessage('错误:' + JSON.stringify(e))
533
- this.isBusy = false
534
- return
535
- }
536
- }
537
- try {
538
- // 再建立档案
539
- console.log('创建档案')
540
- let response = await this.createUserData()
541
- console.log('createUserDataResponse ===> ' + JSON.stringify(response))
542
- if (response.data.status == 200) {
543
- this.$showMessage('档案创建成功!')
544
- } else {
545
- this.$showMessage('档案创建失败!' + JSON.stringify(response.data))
546
- }
547
- // 上传成功,重新初始化数据
548
- Object.assign(this.$data, this.$options.data())
549
- await this.initpcds(` f_filialeid = '${Vue.user.orgid}'`)
550
- await this.initAreas(Vue.user.orgid)
551
- } catch (e) {
552
- console.log('e ===> ' + JSON.stringify(e))
553
- this.$showMessage('错误:' + JSON.stringify(e))
554
- }
555
- this.isBusy = false
556
- },
557
- },
558
- watch: {
559
- 'userdata.userinfo.userfiles.f_meternumber': async function (newVal, oldVal) {
560
- console.log('newVal ===> ' + JSON.stringify(newVal))
561
- console.log('oldVal ===> ' + JSON.stringify(oldVal))
562
- // let response = await this.$resetpost(`${this.$androidUtil.getProxyUrl()}/rs/logic/xxxxxx`, {})
563
- },
564
- 'userdata.userinfo.f_idnumber'(val){
565
- if(val){
566
- if (!(/^[1-9][0-9]{5}([1][9][0-9]{2}|[2][0][0|1][0-9])([0][1-9]|[1][0|1|2])([0][1-9]|[1|2][0-9]|[3][0|1])[0-9]{3}([0-9]|[X])$/.test(val))) {
567
- // this.$showAlert('输入的身份证号长度不对,或者号码不符合规定!\n15位号码应全为数字,18位号码末位可以为数字或X。')
568
- this.isNotIdNumber = true
569
- }else{
570
- this.isNotIdNumber = false
571
- }
572
- }else{
573
- this.isNotIdNumber = false
574
- }
575
- }
576
- }
577
- }
578
- </script>
579
-
580
- <style scoped>
581
-
1
+ <template>
2
+ <div>
3
+ <!--表具信息-->
4
+ <validator name='v' :data.sync="data">
5
+ <div class="auto select-overspread form-horizontal repair-bg">
6
+ <div class="bq-parent">
7
+ <blockquote class="blockquote">
8
+ <p>表具信息</p>
9
+ </blockquote>
10
+ </div>
11
+ <div class="panel panel-default auto repair-info-content">
12
+ <div class="panel-body auto repair-info-content compatible">
13
+ <div class="col-xs-12 col-sm-12 col-md-12 form-input-group" :class="[$v.f_meternumber.required ? 'has-error' : 'has-success']">
14
+ <label for="f_meternumber" class="lb-left text-justify">表号</label>
15
+ <input id="f_meternumber" v-model="userdata.userinfo.userfiles.f_meternumber" v-validate:f_meternumber="{required: true}" type="text" class="form-control"/>
16
+ <button type="button" name="button" class="btn btn-primary" @click="scan">扫码</button>
17
+ </div>
18
+ <div class="col-xs-12 col-sm-12 col-md-12 form-input-group" :class="[$v.f_meter_brand.required ? 'has-error' : 'has-success']">
19
+ <label for="f_meter_brand" class="lb-left text-justify">气表品牌</label>
20
+ <input id="f_meter_brand" v-model="userdata.userinfo.userfiles.f_meter_brand" v-validate:f_meter_brand="{required: true}" type="text" class="form-control">
21
+ </div>
22
+ <div class="col-xs-12 col-sm-12 col-md-12 form-input-group" :class="[$v.f_meter_style.required ? 'has-error' : 'has-success']">
23
+ <label for="f_meter_style" class="lb-left text-justify">气表型号</label>
24
+ <input id="f_meter_style" v-model="userdata.userinfo.userfiles.f_meter_style" v-validate:f_meter_style="{required: true}" type="text" class="form-control">
25
+ </div>
26
+ <div class="col-xs-12 col-sm-12 col-md-12 form-input-group" :class="[$v.f_meter_type.required ? 'has-error' : 'has-success']">
27
+ <label for="f_meter_type" class="lb-left text-justify">气表类型</label>
28
+ <input id="f_meter_type" v-model="userdata.userinfo.userfiles.f_meter_type" v-validate:f_meter_type="{required: true}" type="text" class="form-control">
29
+ </div>
30
+ <div class="col-xs-12 col-sm-12 col-md-12 form-input-group" :class="[$v.f_aroundmeter.required ? 'has-error' : 'has-success']">
31
+ <label for="f_aroundmeter" class="lb-left text-justify">进气方向</label>
32
+ <input type="text"
33
+ v-show="false"
34
+ v-model="userdata.userinfo.userfiles.f_aroundmeter"
35
+ v-validate:f_aroundmeter='{required: true}'>
36
+ <v-select id="f_aroundmeter"
37
+ :value.sync="userdata.userinfo.userfiles.f_aroundmeter"
38
+ :value-single="true"
39
+ :options='aroundmeterlist'
40
+ placeholder='请选择'
41
+ close-on-select>
42
+ </v-select>
43
+ </div>
44
+ <div class="col-xs-12 col-sm-12 col-md-12 form-input-group" :class="[$v.f_initial_base.required ? 'has-error' : 'has-success']">
45
+ <label for="f_initial_base" class="lb-left text-justify">表基数</label>
46
+ <input id="f_initial_base" v-model="userdata.userinfo.userfiles.f_initial_base" v-validate:f_initial_base="{required: true}" type="number" class="form-control">
47
+ </div>
48
+ </div>
49
+ </div>
50
+ </div>
51
+ <div class="bq-parent">
52
+ <blockquote class="blockquote">
53
+ <input class="magic-checkbox" type="checkbox" id="isStay" v-model="isStay"/>
54
+ <label for="isStay" style="width:150px;padding-bottom: 10px">用户是否入住</label>
55
+ </blockquote>
56
+ </div>
57
+ <!--用户信息-->
58
+ <div class="auto select-overspread form-horizontal repair-bg" v-show="isStay">
59
+ <div class="bq-parent">
60
+ <blockquote class="blockquote">
61
+ <p>用户信息</p>
62
+ </blockquote>
63
+ </div>
64
+ <div class="panel panel-default auto repair-info-content">
65
+ <div class="panel-body auto repair-info-content compatible">
66
+ <div class="col-xs-12 col-sm-12 col-md-12 form-input-group">
67
+ <label for="f_user_name" class="lb-left text-justify">用户姓名</label>
68
+ <input id="f_user_name" v-model="userdata.userinfo.f_user_name" type="text" class="form-control"/>
69
+ </div>
70
+ <div class="col-xs-12 col-sm-12 col-md-12 form-input-group">
71
+ <label for="f_idnumber" class="lb-left text-justify">身份证号</label>
72
+ <input id="f_idnumber" v-model="userdata.userinfo.f_idnumber" type="text" class="form-control">
73
+ </div>
74
+ <div class="col-xs-12 col-sm-12 col-md-12 form-input-group" v-show="isNotIdNumber">
75
+ <span style="font-size:10px;color: red">输入的身份证号长度不对,或者号码不符合规定!</span>
76
+ </div>
77
+ <div class="col-xs-12 col-sm-12 col-md-12 form-input-group">
78
+ <label for="f_user_phone" class="lb-left text-justify">用户电话</label>
79
+ <input id="f_user_phone" v-model="userdata.userinfo.f_user_phone" type="text" class="form-control">
80
+ </div>
81
+ <div class="col-xs-12 col-sm-12 col-md-12 form-input-group">
82
+ <label for="f_price_name" class="lb-left text-justify">住户类型</label>
83
+ <v-select id="f_price_name"
84
+ :value.sync="userdata.userinfo.f_price_name"
85
+ :value-single="true"
86
+ :options='houseTypeOptions'
87
+ placeholder='请选择'
88
+ close-on-select>
89
+ </v-select>
90
+ </div>
91
+ <div class="col-xs-12 col-sm-12 col-md-12 form-input-group">
92
+ <label for="f_comments" class="lb-left text-justify">备注</label>
93
+ <textarea id="f_comments" class="form-control" cols="30" rows="4" style="resize: vertical;" v-model="userdata.userinfo.f_comments"></textarea>
94
+ </div>
95
+ </div>
96
+ </div>
97
+ </div>
98
+ <!--地址信息-->
99
+ <div class="auto select-overspread form-horizontal repair-bg">
100
+ <div class="bq-parent">
101
+ <blockquote class="blockquote">
102
+ <p>地址信息</p>
103
+ </blockquote>
104
+ </div>
105
+ <div class="panel panel-default auto repair-info-content">
106
+ <div class="panel-body auto repair-info-content compatible">
107
+ <div class="col-xs-12 col-sm-12 col-md-12 form-input-group" :class="[$v.f_pcd_id.required ? 'has-error' : 'has-success']">
108
+ <label for="f_pcd_id" class="lb-left text-justify">省市区</label>
109
+ <input type="text"
110
+ v-show="false"
111
+ v-model="addressData.f_pcd_id"
112
+ v-validate:f_pcd_id='{required: true}'>
113
+ <v-select id="f_pcd_id"
114
+ :value.sync="addressData.f_pcd_id"
115
+ :value-single="true"
116
+ :options='pcdslist'
117
+ placeholder='请选择'
118
+ close-on-select
119
+ search="true"
120
+ @change="pcdChange">
121
+ </v-select>
122
+ </div>
123
+ <div class="col-xs-12 col-sm-12 col-md-12 form-input-group" :class="[$v.f_street_id.required ? 'has-error' : 'has-success']">
124
+ <label for="f_street_id" class="lb-left text-justify">街道名称</label>
125
+ <input type="text"
126
+ v-show="false"
127
+ v-model="addressData.f_street_id"
128
+ v-validate:f_street_id='{required: true}'>
129
+ <v-select id="f_street_id"
130
+ :value.sync="addressData.f_street_id"
131
+ :value-single="true"
132
+ :options='streetslist'
133
+ placeholder='请选择'
134
+ close-on-select
135
+ search="true"
136
+ @change="streetChange">
137
+ </v-select>
138
+ </div>
139
+ <div class="col-xs-12 col-sm-12 col-md-12 form-input-group" :class="[$v.f_residential_area_id.required ? 'has-error' : 'has-success']">
140
+ <label for="f_residential_area_id" class="lb-left text-justify">小区名称</label>
141
+ <input type="text"
142
+ v-show="false"
143
+ v-model="addressData.f_residential_area_id"
144
+ v-validate:f_residential_area_id='{required: true}'>
145
+ <v-select id="f_residential_area_id"
146
+ :value.sync="addressData.f_residential_area_id"
147
+ :value-single="true"
148
+ :options='areaslist'
149
+ placeholder='请选择'
150
+ close-on-select
151
+ search="true"
152
+ @change="areaChange">
153
+ </v-select>
154
+ </div>
155
+ <div class="col-xs-12 col-sm-12 col-md-12 form-input-group" :class="[$v.slice.required ? 'has-error' : 'has-success']">
156
+ <label for="f_meter_type" class="lb-left text-justify">片区</label>
157
+ <input type="text"
158
+ v-show="false"
159
+ v-model="$refs.slice.selectedItems"
160
+ v-validate:slice='{required: true}'>
161
+ <v-select id="slice_area"
162
+ :value.sync="addressData.slice_area"
163
+ :options='sliceArea'
164
+ placeholder='片区/管理站'
165
+ filer-key="name"
166
+ close-on-select
167
+ v-ref:slice>
168
+ </v-select>
169
+ </div>
170
+ <div class="col-xs-12 col-sm-12 col-md-12 form-input-group" :class="[$v.f_building.required ? 'has-error' : 'has-success']">
171
+ <label for="f_building" class="lb-left text-justify">楼号</label>
172
+ <input id="f_building" v-model="addressData.f_building" v-validate:f_building='{required: true}' type="text" class="form-control" style="width: 70%">
173
+ <input id="f_building_suffix" v-model="addressData.f_building_suffix" type="text" class="form-control" style="width: 30%">
174
+ </div>
175
+ <div class="col-xs-12 col-sm-12 col-md-12 form-input-group" :class="[$v.f_unit.required ? 'has-error' : 'has-success']">
176
+ <label for="f_unit" class="lb-left text-justify">单元</label>
177
+ <input id="f_unit" v-model="addressData.f_unit" v-validate:f_unit='{required: true}' type="text" class="form-control" style="width: 70%">
178
+ <input id="f_unit_suffix" v-model="addressData.f_unit_suffix" type="text" class="form-control" style="width: 30%">
179
+ </div>
180
+ <div class="col-xs-12 col-sm-12 col-md-12 form-input-group" :class="[$v.f_floor.required ? 'has-error' : 'has-success']">
181
+ <label for="f_floor" class="lb-left text-justify">楼层</label>
182
+ <input id="f_floor" v-model="addressData.f_floor" v-validate:f_floor='{required: true}' type="text" class="form-control" style="width: 70%">
183
+ <input id="f_floor_suffix" v-model="addressData.f_floor_suffix" type="text" class="form-control" style="width: 30%">
184
+ </div>
185
+ <div class="col-xs-12 col-sm-12 col-md-12 form-input-group" :class="[$v.f_room.required ? 'has-error' : 'has-success']">
186
+ <label for="f_room" class="lb-left text-justify">门牌号</label>
187
+ <input id="f_room" type="text" v-model="addressData.f_room" v-validate:f_room='{required: true}' class="form-control" style="width: 70%">
188
+ <input id="f_room_suffix" type="text" v-model="addressData.f_room_suffix" class="form-control" style="width: 30%">
189
+ </div>
190
+ </div>
191
+ </div>
192
+ </div>
193
+ </validator>
194
+ <!--提交-->
195
+ <div class="panel panel-default auto repair-info-content" style="width: 100%;height: auto">
196
+ <div style="margin: 0 auto;width: 25%">
197
+ <button type="button" name="button" class="col-sm-3 btn btn-primary" :disabled='!$v.valid' @click='summit()'>
198
+ 上传档案
199
+ </button>
200
+ </div>
201
+ </div>
202
+ <work-busy :is-busy="isBusy"></work-busy>
203
+ </div>
204
+ </template>
205
+
206
+ <script>
207
+ import Vue from 'vue'
208
+ import {HttpResetClass} from 'vue-client'
209
+
210
+ export default {
211
+ title: "ApplyOnline",
212
+ data() {
213
+ return {
214
+ userdata: {
215
+ address: {
216
+ id: null
217
+ },
218
+ f_user_type: "民用",
219
+ userinfo: {
220
+ userfiles: {
221
+ f_meternumber: null,
222
+ f_meter_brand: null,
223
+ f_meter_style: null,
224
+ f_meter_type: null,
225
+ f_aroundmeter: null,
226
+ f_initial_base: null,
227
+ f_table_state: "待开通"
228
+ },
229
+ f_price_name: null,
230
+ f_rent_phone: null,
231
+ f_user_phone: null,
232
+ f_user_name: null,
233
+ f_idnumber: null,
234
+ f_comments: null
235
+ },
236
+ devices: [],
237
+ f_operator: Vue.user.ename
238
+ },
239
+ // 是否入住
240
+ isStay: false,
241
+ addressData: {
242
+ f_create_person: Vue.user.name,
243
+ f_filialeid: Vue.user.orgid,
244
+ f_operator: Vue.user.name,
245
+ f_operatorid: Vue.user.id,
246
+ f_orgid: Vue.user.orgid,
247
+ f_orgname: Vue.user.orgs,
248
+ f_depid: Vue.user.depids,
249
+ f_depname: Vue.user.deps,
250
+ f_pcd: null,
251
+ f_pcd_id: null,
252
+ f_street: null,
253
+ f_street_id: null,
254
+ f_residential_area: null,
255
+ f_residential_area_id: null,
256
+ f_address: null,
257
+ slice_area: null,
258
+ f_slice_area: null,
259
+ f_area_code: null,
260
+ f_building: null,
261
+ f_building_suffix: "号楼",
262
+ f_unit: null,
263
+ f_unit_suffix: "单元",
264
+ f_floor: null,
265
+ f_floor_suffix: "层",
266
+ f_room: null,
267
+ f_room_suffix: "室"
268
+ },
269
+ //初始化省市区数据
270
+ pcdslist: [],
271
+ //初始化街道数据
272
+ streetslist: [],
273
+ //初始化街道数据
274
+ areaslist: [],
275
+ sliceArea: [],
276
+ aroundmeterlist: [{label: '左表', value: '左表'}, {label: '右表', value: '右表'}],
277
+ houseTypeOptions: [{label: '自有房', value: '自有房'}, {label: '租赁房', value: '租赁房'}],
278
+ isNotIdNumber: false,
279
+ isBusy: false
280
+ }
281
+ },
282
+ async ready() {
283
+ console.log('进入在线报装页面www')
284
+ await this.initpcds(` f_filialeid = '${Vue.user.orgid}'`)
285
+ await this.initAreas(Vue.user.orgid)
286
+ console.log('pcdslist ===> ' + JSON.stringify(this.pcdslist))
287
+ console.log('sliceArea ===> ' + JSON.stringify(this.sliceArea))
288
+ },
289
+ methods: {
290
+ scan() {
291
+ HostApp.__this__ = this
292
+ HostApp.scanCode({callback: "javascript:HostApp.__this__.scanCallback();"})
293
+ },
294
+ scanCallback() {
295
+ let response = HostApp.getCode()
296
+ console.log(`扫码返回值:${response}`)
297
+ if (response.code == 200) {
298
+ this.userdata.userinfo.userfiles.f_meternumber = response.data
299
+ } else {
300
+ this.$showMessage('无法识别该条形码,请调整手机聚焦重试。')
301
+ }
302
+ },
303
+ // 初始化片区
304
+ async initAreas(val) {
305
+ if (val) {
306
+ let http = new HttpResetClass()
307
+ let getAllArea = await http.load('POST', `${this.$androidUtil.getProxyUrl()}/rs/search`, {
308
+ source: 'this.getParentByType($organization$).getAllChildrens().where(row.getType() == $zone$)',
309
+ userid: Vue.user.id
310
+ }, {resolveMsg: null, rejectMsg: '获取片区出错!!!'})
311
+
312
+ let arr = getAllArea.data.filter((res) => {
313
+ return res.parentid == val
314
+ })
315
+ console.log('过滤之后的片区:' + JSON.stringify(arr))
316
+ this.sliceArea = []
317
+ arr.forEach((res) => {
318
+ this.sliceArea.push({label: res.name, value: {name: res.name, code: res.number}})
319
+ })
320
+ }
321
+ },
322
+
323
+ //初始化省市区,添加街道
324
+ async initpcds(pconditon) {
325
+ this.pcdslist = []
326
+ let HttpReset = new HttpResetClass()
327
+ let req = await HttpReset.load('POST', `${this.$androidUtil.getProxyUrl()}/rs/sql/address_singleTableOrderBy`, {
328
+ data: {
329
+ items: '*',
330
+ tablename: 't_pcd',
331
+ orderitem: 'id',
332
+ condition: pconditon
333
+ }
334
+ }, {resolveMsg: null, rejectMsg: '获取地址失败!'})
335
+ let redata = []
336
+ req.data.forEach((row, n) => {
337
+ redata[n] = {
338
+ label: row.f_pcd,
339
+ value: row.id,
340
+ data: row,
341
+ id: row.id
342
+ }
343
+ })
344
+ this.pcdslist = redata
345
+ },
346
+ //初始化街道 添加小区
347
+ async initstreets(pconditon) {
348
+ this.streetslist = []
349
+ let HttpReset = new HttpResetClass()
350
+ let req = await HttpReset.load('POST', `${this.$androidUtil.getProxyUrl()}/rs/sql/address_singleTableOrderBy`, {
351
+ data: {
352
+ items: '*',
353
+ tablename: 't_street',
354
+ orderitem: 'id',
355
+ condition: pconditon
356
+ }
357
+ }, {resolveMsg: null, rejectMsg: '获取地址失败!'})
358
+ let redata = []
359
+ req.data.forEach((row, n) => {
360
+ redata[n] = {
361
+ label: row.f_street,
362
+ value: row.id,
363
+ data: row,
364
+ id: row.id
365
+ }
366
+ })
367
+ this.streetslist = redata
368
+ },
369
+ //初始化小区添加小区
370
+ async initareas(pconditon) {
371
+ if (this.usertype) {
372
+ pconditon = pconditon + ` and f_special='1' `
373
+ }
374
+ this.areaslist = []
375
+ let HttpReset = new HttpResetClass()
376
+ let req = await HttpReset.load('POST', `${this.$androidUtil.getProxyUrl()}/rs/sql/address_singleTableOrderBy`, {
377
+ data: {
378
+ items: '*',
379
+ tablename: 't_area',
380
+ orderitem: 'id',
381
+ condition: pconditon
382
+ }
383
+ }, {resolveMsg: null, rejectMsg: '获取地址失败!'})
384
+ let redata = []
385
+ req.data.forEach((row) => {
386
+ redata.push({
387
+ label: row.f_residential_area,
388
+ value: row.id,
389
+ data: row,
390
+ id: row.id
391
+ })
392
+ })
393
+ this.areaslist = redata
394
+ },
395
+ //省/市/区变化
396
+ async pcdChange(val) {
397
+ console.log(`省/市/区变化 => ${JSON.stringify(val)} => ${JSON.stringify(this.addressData)}`)
398
+ if (val) {
399
+ //那就把[小区,街道]重新组织一下
400
+ await this.initstreets(` f_filialeid = '${Vue.user.orgid}' and f_pcd_id ='${val}' `)
401
+ if (this.addressData.f_street_id) {
402
+ if (this.findbyid(this.streetslist, this.addressData.f_street_id)) {
403
+ let pcd_id = this.findbyid(this.streetslist, this.addressData.f_street_id).f_pcd_id
404
+ if (pcd_id != val) {
405
+ this.addressData.f_street_id = ''
406
+ }
407
+ } else {
408
+ this.addressData.f_street_id = ''
409
+ }
410
+
411
+ //那就把[小区,街道]重新组织一下
412
+ if (this.addressData.f_street_id) {
413
+ await this.initareas(` f_street_id ='${this.addressData.f_street_id}' `)
414
+ if (this.addressData.f_residential_area_id) {
415
+ if (this.findbyid(this.areaslist, this.addressData.f_residential_area_id)) {
416
+ let pcd_id = this.findbyid(this.areaslist, this.addressData.f_residential_area_id).f_pcd_id
417
+ if (pcd_id != val) {
418
+ this.addressData.f_residential_area_id = ''
419
+ }
420
+ } else {
421
+ this.addressData.f_residential_area_id = ''
422
+ }
423
+
424
+ }
425
+ }
426
+ }
427
+ }
428
+ this.$resetValidation()
429
+ },
430
+ //小区变化
431
+ areaChange(val) {
432
+ console.log(`小区变化 => ${JSON.stringify(val)} => ${JSON.stringify(this.addressData)}`)
433
+ if (val) {
434
+ let getArea = this.areaslist.filter((res) => {
435
+ return res.id = this.addressData.f_residential_area_id
436
+ })
437
+ if (getArea.length > 0) {
438
+ console.log('获取小区数据', getArea[0].data)
439
+ this.addressData.slice_area = [{name: getArea[0].data.f_slice_area, code: getArea[0].data.f_area_code}]
440
+ }
441
+ }
442
+ this.$resetValidation()
443
+ },
444
+ //街道变化
445
+ async streetChange(val) {
446
+ console.log(`街道变化 => ${JSON.stringify(val)} => ${JSON.stringify(this.addressData)}`)
447
+ if (this.streetslist[0]) {
448
+ var street = ''
449
+ this.streetslist.forEach((item) => {
450
+ if (item.id === val) {
451
+ street = item.label
452
+ }
453
+ })
454
+ this.addressData.f_address = street
455
+ }
456
+ if (val) {
457
+ //那就把[小区]重新组织一下
458
+ await this.initareas(` f_street_id ='${val}' `)
459
+ if (this.addressData.f_residential_area_id) {
460
+ if (this.findbyid(this.areaslist, this.addressData.f_residential_area_id)) {
461
+ let street_id = this.findbyid(this.areaslist, this.addressData.f_residential_area_id).f_street_id
462
+ if (street_id != val) {
463
+ this.addressData.f_residential_area_id = ''
464
+ }
465
+ } else {
466
+ this.addressData.f_residential_area_id = ''
467
+ }
468
+
469
+ }
470
+ }
471
+ this.$resetValidation()
472
+ },
473
+ //根据名字找数据
474
+ findbyid(list, name) {
475
+ let result
476
+ list.forEach((row, n) => {
477
+ if (name == row.value) {
478
+ result = row.data
479
+ }
480
+ })
481
+ return result
482
+ },
483
+ async createAddress() {
484
+ if (this.addressData.slice_area) {
485
+ if (this.addressData.slice_area.length > 0) {
486
+ this.addressData.f_slice_area = this.addressData.slice_area[0].name
487
+ this.addressData.f_area_code = this.addressData.slice_area[0].code
488
+ }
489
+ }
490
+ this.addressData.f_pcd = this.findbyid(this.pcdslist, this.addressData.f_pcd_id).f_pcd
491
+ this.addressData.f_street = this.findbyid(this.streetslist, this.addressData.f_street_id).f_street
492
+ this.addressData.f_residential_area = this.findbyid(this.areaslist, this.addressData.f_residential_area_id).f_residential_area
493
+ this.addressData.f_address = this.addressData.f_street + this.addressData.f_residential_area + (this.addressData.f_building ? this.addressData.f_building + this.addressData.f_building_suffix : '') + (this.addressData.f_unit ? this.addressData.f_unit + this.addressData.f_unit_suffix : '') + (this.addressData.f_floor ? this.addressData.f_floor + this.addressData.f_floor_suffix : '') + this.addressData.f_room + this.addressData.f_room_suffix
494
+ console.log("调用创建地址接口参数 ==> " + JSON.stringify(this.addressData))
495
+ let http = new HttpResetClass()
496
+ return await http.load('POST', `${this.$androidUtil.getProxyUrl()}/rs/logic/address_updateuseraddress`, this.addressData)
497
+ },
498
+ async createUserData() {
499
+ let http = new HttpResetClass()
500
+ return await http.load('POST',
501
+ `${this.$androidUtil.getProxyUrl()}/rs/logic/sale_userSave`,
502
+ this.userdata
503
+ )
504
+ },
505
+ async summit() {
506
+ this.isBusy = true
507
+ try {
508
+ // 先创建地址信息
509
+ console.log('创建地址')
510
+ let response = await this.createAddress()
511
+ console.log('createAddressResponse ===> ' + JSON.stringify(response))
512
+ this.userdata.address.id = response.data.id
513
+ } catch (e) {
514
+ console.log('e ===> ' + JSON.stringify(e))
515
+ // 如果地址已存在,使用存在的地址建档
516
+ if (e.status && e.status == 635) {
517
+ console.log('地址已存在,获取已存在地址id')
518
+ let http = new HttpResetClass()
519
+ let data = {
520
+ data: {
521
+ items: 'id',
522
+ tablename: 't_user_address',
523
+ condition: `f_address = '${this.addressData.f_address}'`
524
+ }
525
+ }
526
+ let response = await http.load('POST', `${this.$androidUtil.getProxyUrl()}/rs/sql/querySingleTable`, data)
527
+ console.log('searchAddressResponse ===> ' + JSON.stringify(response))
528
+ if (response.data && response.data.length > 0) {
529
+ this.userdata.address.id = response.data[0].id
530
+ }
531
+ } else {
532
+ this.$showMessage('错误:' + JSON.stringify(e))
533
+ this.isBusy = false
534
+ return
535
+ }
536
+ }
537
+ try {
538
+ // 再建立档案
539
+ console.log('创建档案')
540
+ let response = await this.createUserData()
541
+ console.log('createUserDataResponse ===> ' + JSON.stringify(response))
542
+ if (response.data.status == 200) {
543
+ this.$showMessage('档案创建成功!')
544
+ } else {
545
+ this.$showMessage('档案创建失败!' + JSON.stringify(response.data))
546
+ }
547
+ // 上传成功,重新初始化数据
548
+ Object.assign(this.$data, this.$options.data())
549
+ await this.initpcds(` f_filialeid = '${Vue.user.orgid}'`)
550
+ await this.initAreas(Vue.user.orgid)
551
+ } catch (e) {
552
+ console.log('e ===> ' + JSON.stringify(e))
553
+ this.$showMessage('错误:' + JSON.stringify(e))
554
+ }
555
+ this.isBusy = false
556
+ },
557
+ },
558
+ watch: {
559
+ 'userdata.userinfo.userfiles.f_meternumber': async function (newVal, oldVal) {
560
+ console.log('newVal ===> ' + JSON.stringify(newVal))
561
+ console.log('oldVal ===> ' + JSON.stringify(oldVal))
562
+ // let response = await this.$resetpost(`${this.$androidUtil.getProxyUrl()}/rs/logic/xxxxxx`, {})
563
+ },
564
+ 'userdata.userinfo.f_idnumber'(val){
565
+ if(val){
566
+ if (!(/^[1-9][0-9]{5}([1][9][0-9]{2}|[2][0][0|1][0-9])([0][1-9]|[1][0|1|2])([0][1-9]|[1|2][0-9]|[3][0|1])[0-9]{3}([0-9]|[X])$/.test(val))) {
567
+ // this.$showAlert('输入的身份证号长度不对,或者号码不符合规定!\n15位号码应全为数字,18位号码末位可以为数字或X。')
568
+ this.isNotIdNumber = true
569
+ }else{
570
+ this.isNotIdNumber = false
571
+ }
572
+ }else{
573
+ this.isNotIdNumber = false
574
+ }
575
+ }
576
+ }
577
+ }
578
+ </script>
579
+
580
+ <style scoped>
581
+
582
582
  </style>