apply-clients 3.5.4-99 → 3.5.5-10

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 (54) hide show
  1. package/build/dev-server.js +9 -6
  2. package/package.json +1 -1
  3. package/src/App.vue +25 -25
  4. package/src/apply.js +2 -0
  5. package/src/components/android/AppTakePic.vue +182 -182
  6. package/src/components/android/Process/AppExplorationUser.vue +508 -508
  7. package/src/components/product/Material/MaterialDetailed.vue +268 -268
  8. package/src/components/product/Process/Processes/contractModel.vue +424 -0
  9. package/src/components/product/ServiceView.vue +1028 -1028
  10. package/src/filiale/ancheng/android/AppSign.vue +149 -149
  11. package/src/filiale/ancheng/android/AppTakePic.vue +143 -143
  12. package/src/filiale/ancheng/android.js +7 -7
  13. package/src/filiale/baiyin/android/ByAddMaterialScience.vue +858 -858
  14. package/src/filiale/fugou/android/AppAddMaterialScience.vue +20 -16
  15. package/src/filiale/fugou/android/AppDevicesManagement.vue +519 -519
  16. package/src/filiale/fugou/android/AppInstallationDetails.vue +541 -541
  17. package/src/filiale/fugou/android/AppServiceControl.vue +1836 -1845
  18. package/src/filiale/fugou/android/printCharge.vue +162 -162
  19. package/src/filiale/fugou/android.js +16 -16
  20. package/src/filiale/fugou/pc/ExplorationSelect.vue +525 -525
  21. package/src/filiale/fugou/pc/ServiceControl.vue +1705 -1705
  22. package/src/filiale/fugou/pc/ServiceView.vue +941 -941
  23. package/src/filiale/fugou/pc/SupervisoryServiceControl.vue +881 -0
  24. package/src/filiale/fugou/pc/devicesManagement.vue +483 -483
  25. package/src/filiale/fugou/pc/printChargepc.vue +148 -148
  26. package/src/filiale/fugou/pc.js +17 -16
  27. package/src/filiale/gongyi/android/AppAddMaterialScience.vue +493 -493
  28. package/src/filiale/hongda/pc/ApplyDetailsList.vue +329 -329
  29. package/src/filiale/qianneng/android/AppChargeManagement.vue +686 -686
  30. package/src/filiale/qianneng/android/AppServiceView.vue +795 -795
  31. package/src/filiale/qianneng/android.js +15 -15
  32. package/src/filiale/qianneng/pc/ApplyChargeList.vue +639 -639
  33. package/src/filiale/qianneng/pc/ApplyMaterialDetailed.vue +261 -261
  34. package/src/filiale/qianneng/pc/Applybatchdispatch.vue +769 -769
  35. package/src/filiale/qianneng/pc/Applydetail.vue +417 -417
  36. package/src/filiale/qianneng/pc/InstallFunction.vue +188 -188
  37. package/src/filiale/qianneng/pc/InstallInfoSelect.vue +434 -434
  38. package/src/filiale/qianneng/pc/ServiceControl.vue +1382 -1382
  39. package/src/filiale/qianneng/pc/StopApplyList.vue +334 -334
  40. package/src/filiale/qianneng/pc/SupervisoryList.vue +396 -396
  41. package/src/filiale/qianneng/pc/chargeManagement.vue +813 -813
  42. package/src/filiale/qianneng/pc.js +29 -29
  43. package/src/filiale/ruihua/pc/ServiceControl.vue +1967 -1966
  44. package/src/filiale/yangchunboneng/android/AppChargeManagement.vue +520 -520
  45. package/src/filiale/yangchunboneng/android/AppDevicesManagement.vue +645 -645
  46. package/src/filiale/yangchunboneng/android/AppServiceControl.vue +1703 -1706
  47. package/src/filiale/yangchunboneng/pc/ExplorationSelect.vue +547 -547
  48. package/src/filiale/yangchunboneng/pc/ServiceControl.vue +2112 -2115
  49. package/src/filiale/yangchunboneng/pc/ServiceView.vue +1007 -1007
  50. package/src/filiale/yangchunboneng/pc/SupervisoryList.vue +605 -605
  51. package/src/filiale/yangchunboneng/pc/SupervisoryListNew.vue +683 -683
  52. package/src/filiale/yangchunboneng/pc/chargeManagement.vue +1053 -1052
  53. package/src/filiale/yangchunboneng/pc/devicesManagement.vue +574 -574
  54. package/src/main.js +23 -23
@@ -1,1007 +1,1007 @@
1
- <template>
2
- <div class="select-overspread" style="background-color: #ffffff;padding: 20px;overflow: scroll">
3
- <validator name='v' @valid="$emit('valid')" @invalid="$emit('invalid')">
4
- <form class="form-horizontal">
5
- <div class="form-group">
6
- <div v-for="(index,item) in data.fields">
7
- <!--input-->
8
- <div :style="item.style ? item.style+';height: 40px;margin-bottom: 20px':'height: 40px;margin-bottom: 20px'"
9
- v-if="(item.type==='input' || item.type==='number'||item.type === 'tel'||item.type === 'email') && !item.hidden && (item.device === 'pc' || !item.device) && ( item.label != '证件号码')&&( item.label !== '身份证') && (item.label !== '用户电话')"
10
- :class="[item.required && !(item.value) ? 'has-error' : '',item.bootstraped ? item.bootstraped + ' form-group':'col-sm-4 form-group']">
11
- <label :style="item.label_style ? item.label_style : ''"
12
- :class="item.label_bootstraped ? item.label_bootstraped+' control-label-justify control-label' : 'control-label-justify control-label col-sm-6'">{{item.label}}</label>
13
- <div :style="item.value_style ? item.value_style:''"
14
- :class="item.value_bootstraped ? item.value_bootstraped : 'col-sm-6'">
15
- <input class="form-control input_view" style=""
16
- :type="item.type"
17
- v-model="data.fields[index].value"
18
- :placeholder="item.placeholder"
19
- :value="data.fields[index].value"
20
- :readonly="item.readonly"
21
- :disabled="item.disabled"
22
- @change="onchange(index)"
23
- @blur="onblur(index)"
24
- @input="oninput(index)"
25
- />
26
- </div>
27
- </div>
28
-
29
- <!--input-->
30
- <div :style="item.style ? item.style+';height: 40px;margin-bottom: 20px':'height: 40px;margin-bottom: 20px'"
31
- v-if="(data.f_credentials != '身份证' && item.label === '证件号码')"
32
- :class="[item.required && !(item.value) ? 'has-error' : '',item.bootstraped ? item.bootstraped + ' form-group':'col-sm-4 form-group']">
33
- <label :style="item.label_style ? item.label_style : ''"
34
- :class="item.label_bootstraped ? item.label_bootstraped+' control-label-justify control-label' : 'control-label-justify control-label col-sm-6'">{{item.label}}</label>
35
- <div :style="item.value_style ? item.value_style:''"
36
- :class="item.value_bootstraped ? item.value_bootstraped : 'col-sm-6'">
37
- <input class="form-control input_view" style=""
38
- :type="item.type"
39
- v-model="data.fields[index].value"
40
- :placeholder="item.placeholder"
41
- :value="data.fields[index].value"
42
- :readonly="item.readonly"
43
- :disabled="item.disabled"
44
- @change="onchange(index)"
45
- @blur="onblur(index)"
46
- @input="oninput(index)"
47
- />
48
- </div>
49
- </div>
50
- <!--身份证验证-->
51
- <div :style="item.style ? item.style+';height: 40px;margin-bottom: 20px':'height: 40px;margin-bottom: 20px'"
52
- v-if="(item.label==='身份证') || (data.f_credentials === '身份证' && item.label === '证件号码')"
53
- :class="[$v.f_idnumber2.identityCardValid ? 'has-error' : '',item.bootstraped ? item.bootstraped + ' form-group':'col-sm-4 form-group']">
54
- <label :style="item.label_style ? item.label_style : ''"
55
- :class="item.label_bootstraped ? item.label_bootstraped+' control-label-justify control-label' : 'control-label-justify control-label col-sm-6'">{{item.label}}</label>
56
- <div :style="item.value_style ? item.value_style:''"
57
- :class="item.value_bootstraped ? item.value_bootstraped : 'col-sm-6'">
58
- <input class="form-control input_view" style=""
59
- :type="item.type"
60
- maxlength="18"
61
- v-model="data.fields[index].value"
62
- :placeholder="item.placeholder"
63
- :value="data.fields[index].value"
64
- v-validate:f_idnumber2='{identityCardValid: true}'
65
- :readonly="item.readonly"
66
- :disabled="item.disabled"
67
- @change="onchange(index)"
68
- @blur="onblur(index)"
69
- @input="oninput(index)"
70
- />
71
- </div>
72
- </div>
73
-
74
-
75
- <div :style="item.style ? item.style+';height: 40px;margin-bottom: 20px':'height: 40px;margin-bottom: 20px'"
76
- v-if="item.label === '用户电话'"
77
- :class="[$v.f_user_phone.minlength || $v.f_user_phone.maxlength ? 'has-error' : '',item.bootstraped ? item.bootstraped + ' form-group':'col-sm-4 form-group']">
78
- <label :style="item.label_style ? item.label_style : ''"
79
- :class="item.label_bootstraped ? item.label_bootstraped+' control-label-justify control-label' : 'control-label-justify control-label col-sm-6'">{{item.label}}</label>
80
- <div :style="item.value_style ? item.value_style:''"
81
- :class="item.value_bootstraped ? item.value_bootstraped : 'col-sm-6'">
82
- <input class="form-control input_view" style=""
83
- type="number"
84
- oninput="if(value.length > 11) value=value.slice(0,11)"
85
- v-validate:f_user_phone="{minlength: 7, maxlength: 11 }"
86
- v-model="data.fields[index].value"
87
- :placeholder="item.placeholder"
88
- :value="data.fields[index].value"
89
- onKeypress="return(/[\d\.]/.test(String.fromCharCode(event.keyCode)))"
90
- :readonly="item.readonly"
91
- :disabled="item.disabled"
92
- @change="onchange(index)"
93
- @blur="onblur(index)"
94
- @input="oninput(index)"
95
- />
96
- </div>
97
- </div>
98
-
99
-
100
-
101
- <!--时间datepicker-->
102
- <div :style="item.style ? item.style+';height: 40px;margin-bottom: 20px':'height: 40px;margin-bottom: 20px'"
103
- v-if="item.type==='datepicker' && !item.hidden && (item.device === 'pc' || !item.device)"
104
- :class="[item.required && !(item.value) ? 'has-error' : '',item.bootstraped ? item.bootstraped+' form-group':'col-sm-4 form-group']">
105
- <label
106
- :class="item.label_bootstraped ? item.label_bootstraped+' control-label-justify control-label' : 'control-label control-label-justify col-sm-6'">{{item.label}}</label>
107
- <div :style="item.value_style ? item.value_style:''"
108
- :class="item.value_bootstraped ? item.value_bootstraped : 'col-sm-6'">
109
- <datepicker
110
- @change="onchange(index)"
111
- @blur="onblur(index)"
112
- :placeholder="item.placeholder"
113
- :value.sync="data.fields[index].value"
114
- :format="item.format ? item.format : 'yyyy-MM-dd'"
115
- v-model="data.fields[index].value"
116
- :readonly="item.readonly"
117
- :disabled="item.disabled"
118
- :show-reset-button="reset">
119
- </datepicker>
120
- </div>
121
- </div>
122
-
123
- <!--textarea-->
124
- <div :style="item.style ? item.style+';margin-bottom: 20px':'margin-bottom: 20px'"
125
- v-if="item.type==='textarea' && !item.hidden && (item.device === 'pc' || !item.device)"
126
- :class="[item.required && !(item.value) ? 'has-error' : '',item.bootstraped?item.bootstraped+' form-group':'col-sm-12 form-group']">
127
- <label :style="item.label_style ? item.label_style : ''"
128
- :class="item.label_bootstraped ? item.label_bootstraped + ' control-label-justify control-label' : 'control-label-justify control-label col-sm-3'">{{item.label}}</label>
129
- <div :style="item.value_style ? item.value_style:''"
130
- :class="item.value_bootstraped ? item.value_bootstraped : 'col-sm-10'">
131
- <textarea
132
- :readonly="item.readonly"
133
- :disabled="item.disabled"
134
- class="form-control input_view"
135
- style="width: 100%;height: 100%"
136
- :rows="item.rows"
137
- v-model="data.fields[index].value"
138
- :value="data.fields[index].value"
139
- @change="onchange(index)"
140
- @blur="onblur(index)"
141
- @input="oninput(index)"
142
- >
143
- </textarea>
144
- </div>
145
- </div>
146
-
147
- <!--select-->
148
- <div :style="item.style ? item.style+';height: 40px;margin-bottom: 20px':'height: 40px;margin-bottom: 20px'"
149
- v-if="item.type==='select' && !item.hidden && (item.device === 'pc' || !item.device) && !item.multiple"
150
- :class="[item.required && !(item.value) ? 'has-error' : '',item.bootstraped?item.bootstraped+' form-group':'col-sm-4 form-group']">
151
- <label
152
- :class="item.label_bootstraped ? item.label_bootstraped+' control-label control-label-justify':'control-label-justify control-label col-sm-6'">{{item.label}}</label>
153
- <div :style="item.value_style ? item.value_style:''"
154
- :class="item.value_bootstraped ? item.value_bootstraped : 'col-sm-6'">
155
- <input-select
156
- class="select select_list"
157
- @blur="onblur(index)"
158
- @change="onchange(index)"
159
- @select-search="selectSearch($arguments,index)"
160
- :readonly="item.readonly"
161
- :disable="item.disabled"
162
- :value.sync="data.fields[index].value"
163
- v-model="data.fields[index].value"
164
- :options='data.fields[index].options'
165
- :valueSingle="true"></input-select>
166
- </div>
167
- </div>
168
- <!--select 多选-->
169
- <div :style="item.style ? item.style+';height: 40px;margin-bottom: 20px':'height: 40px;margin-bottom: 20px'"
170
- v-if="item.type==='select' && !item.hidden && (item.device === 'pc' || !item.device)&& item.multiple"
171
- :class="[item.required && !(item.value) ? 'has-error' : '',item.bootstraped?item.bootstraped+' form-group':'col-sm-4 form-group']">
172
- <label
173
- :class="item.label_bootstraped ? item.label_bootstraped+' control-label control-label-justify':'control-label-justify control-label col-sm-6'">{{item.label}}</label>
174
- <div :style="item.value_style ? item.value_style:''"
175
- :class="item.value_bootstraped ? item.value_bootstraped : 'col-sm-6'">
176
- <v-select
177
- width="100%"
178
- class="select select_list"
179
- @blur="onblur(index)"
180
- @change="onchange(index)"
181
- @select-search="selectSearch($arguments,index)"
182
- :readonly="item.readonly"
183
- :disable="item.disabled"
184
- :value.sync="data.fields[index].value"
185
- v-model="data.fields[index].value"
186
- :options='data.fields[index].options'
187
- :multiple="data.fields[index].multiple"
188
- :valueSingle="true"></v-select>
189
- </div>
190
- </div>
191
-
192
- <!--checkbox-->
193
- <div :style="item.style ? item.style+';height: 40px;margin-bottom: 20px':'height: 40px;margin-bottom: 20px'"
194
- v-if="item.type==='checkbox' && !item.hidden && (item.device === 'pc' || !item.device)"
195
- :class="[item.required && item.value.length === 0 ? 'has-error' : '',item.bootstraped?item.bootstraped+' form-group':'col-sm-4 form-group']">
196
- <label v-if="item.label"
197
- :class="item.label_bootstraped?item.label_bootstraped+' control-label control-label-justify':'control-label-justify control-label col-sm-6'">{{item.label}}</label>
198
- <div :style="item.value_style ? item.value_style:''"
199
- :class="item.value_bootstraped ? item.value_bootstraped : 'col-sm-6'">
200
- <label class="checkbox-inline" v-for="(index2,row) in item.options">
201
- <input type="checkbox" class=""
202
- :readonly="data.fields[index].readonly"
203
- :disabled="data.fields[index].disabled"
204
- v-model="data.fields[index].value"
205
- :value="data.fields[index].options[index2].value"
206
- @change="onchange(index)"
207
- @blur="onblur(index)">
208
- {{row.label}}
209
- </label>
210
- </div>
211
- </div>
212
- </div>
213
- <!--区域地址联动-->
214
- <div>
215
- <res-area-select-group
216
- v-if="(data.f_apply_type === '报警器报建' || data.f_apply_type === '工商业报警器报建') && data.defname === '工程施工' && data.title === '工程施工' && data.f_sub_state !='完工'"
217
- labelstyle = "control-label"
218
- @shiji-select = "getSelectShijiValue"
219
- @xian-select = "getSelectXianValue"
220
- @shequ-select = "getSelectShequValue"
221
- >
222
- </res-area-select-group>
223
- </div>
224
-
225
- <gaode-map
226
- v-if="(data.f_apply_type === '报警器报建' || data.f_apply_type === '工商业报警器报建') && data.defname === '工程施工' && data.title === '工程施工' && data.f_sub_state !='完工'"
227
- >
228
-
229
- </gaode-map>
230
-
231
- </div>
232
-
233
- <!-- onetomany -->
234
- <div class="" v-for="(index,item) in data.onetomany">
235
- <onetomany :selectdata="data" :onetomany="item" :index="index" v-if="item.device === 'pc' || !item.device"></onetomany>
236
- </div>
237
-
238
- <div v-for="(i,item) in data.components">
239
- <h3 v-if="item.device === 'pc'"><nbr >{{item.title}}</nbr></h3>
240
- <component v-if="item.device === 'pc' || !item.device" :is="item.name" :selectdata="data" :mark="item.mark"></component>
241
- </div>
242
-
243
- <!--自定义组件-->
244
- <slot>
245
- <!--<div :style="item.style ? item.style+';height: 40px;margin-bottom: 20px':'height: 40px;margin-bottom: 20px'"-->
246
- <!-- v-if="data.f_apply_type === '报警器报建' && data.defname === '工程施工'"-->
247
- <!-- :class="[$v.f_idnumber2.identityCardValid ? 'has-error' : '',item.bootstraped ? item.bootstraped + ' form-group':'col-sm-4 form-group']">-->
248
-
249
- <!--<div class="col-sm-6 form-group "-->
250
- <!-- :class="[$v.f_pcd_id.required ? 'has-error' : 'has-success']">-->
251
- <!-- <label class="font_normal_body">省&ensp;市&ensp;区</label>-->
252
- <!-- <input type="text" style="width:41%" v-show="false" v-model="model.f_pcd_id"-->
253
- <!-- v-validate:f_pcd_id='{required: true }'-->
254
- <!-- >-->
255
-
256
- <!-- <v-select :value.sync="model.f_pcd_id" :value-single="true"-->
257
- <!-- :options='pcdslist' placeholder='请选择2'-->
258
- <!-- close-on-select search="true" @change="pcdChange">-->
259
- <!-- </v-select>-->
260
- <!--</div>-->
261
- <!--<div class="col-sm-6 form-group "-->
262
- <!-- :class="[$v.f_street_id.required ? 'has-error' : 'has-success']">-->
263
- <!-- <label class="font_normal_body">街道/乡镇</label>-->
264
- <!-- <input type="text" style="width:41%" v-show="false" v-model="model.f_street_id"-->
265
- <!-- >-->
266
- <!-- <v-select :value.sync="model.f_street_id" :value-single="true"-->
267
- <!-- :options='streetslist' placeholder='请选择'-->
268
- <!-- @change="streetChange"-->
269
- <!-- close-on-select search="true">-->
270
- <!-- </v-select>-->
271
-
272
- <!--</div>-->
273
- <!--<div class="col-sm-6 form-group "-->
274
- <!-- :class="[$v.f_residential_area_id.required ? 'has-error' : 'has-success']">-->
275
- <!-- <label class="font_normal_body">小区</label>-->
276
- <!-- <input type="text" style="width:41%" v-show="false" v-model="model.f_residential_area_id"-->
277
- <!-- v-validate:f_residential_area_id='{required: true }'>-->
278
- <!-- <v-select :value.sync="model.f_residential_area_id" :value-single="true"-->
279
- <!-- :options='areaslist' placeholder='请选择'-->
280
- <!-- @change="" @select-search="selectSearch"-->
281
- <!-- close-on-select search="true">-->
282
- <!-- </v-select>-->
283
- <!--</div>-->
284
- <!--</div>-->
285
- </slot>
286
- <!--公司等属性-->
287
- <div class="col-sm-12 form-group text-center" style="padding-top:8px">
288
- <div class="col-sm-3 form-group center-block">
289
- <label class="col-sm-5">所属公司:</label>
290
- <div class="col-sm-6" style="text-align: left">
291
- {{model.orgs}}
292
- </div>
293
- </div>
294
- <div class="col-sm-3 form-group center-block">
295
- <label class="col-sm-5">部门:</label>
296
- <div class="col-sm-6" style="text-align: left">
297
- {{model.parentname}}
298
- </div>
299
- </div>
300
- <div class="col-sm-3 form-group center-block">
301
- <label class="col-sm-5">操作人:</label>
302
- <div class="col-sm-6 " style="text-align: left">
303
- {{model.operator}}
304
- </div>
305
- </div>
306
- <div class="col-sm-3 form-group center-block">
307
- <label class="col-sm-5">操作日期:</label>
308
- <div class="col-sm-6" style="text-align: left">
309
- {{model.operate_date}}
310
- </div>
311
- </div>
312
- </div>
313
- <!-- 按钮组 -->
314
- <div class="from-group col-sm-12 text-center">
315
- <!-- 按钮组 -->
316
- <button v-for="(index,button) in data.buttons"
317
- :disabled="(button.disabled && disable_button)"
318
- style="min-width:100px"
319
- :class="button.disabled && disable_button ? 'btn btn-default button_spacing' : 'btn btn-primary button_spacing'"
320
- v-if="!button.hidden && button.button_name !=='提交'&& button.button_name !=='确认'"
321
- @click.prevent="click_but(button)"
322
- >
323
- {{button.button_name}}
324
- </button>
325
- <button v-for="(index,button) in data.buttons"
326
- :disabled="(button.disabled && disable_button) || (!$v.valid)"
327
- style="min-width:100px"
328
- :class="button.disabled && disable_button || (!$v.valid) ? 'btn btn-default button_spacing' : 'btn btn-primary button_spacing'"
329
- v-if="!button.hidden && (button.button_name ==='提交'||button.button_name ==='确认')"
330
- @click.prevent="click_but(button)"
331
- >
332
- {{button.button_name}}
333
- </button>
334
- </div>
335
- <div class="from-group col-sm-12 text-center" style="height: 20px;">
336
-
337
- </div>
338
- <!-- 按钮模态框 -->
339
- <modal v-if="showButModal" :show.sync="showButModal" backdrop="false" large>
340
- <header slot="modal-header" class="modal-header">
341
- <button type="button" class="close" @click="closeModal()"><span>&times;</span></button>
342
- <span class="modal-title"><font
343
- size="3">{{data.button.button_name}}</font></span>
344
- </header>
345
- <article slot="modal-body" class="modal-body clearfix">
346
- <div class="form-group" style="padding: 0 150px">
347
- <div v-for="(index,item) in data.button.button_fields">
348
- <div :style="item.style ? item.style : ''" :class="[item.required && !(item.value) ? 'has-error' : '', item.bootstraped ? item.bootstraped + ' form-group' : 'form-group']"
349
- v-if="(item.type==='input' || item.type==='number'||item.type === 'tel'||item.type === 'email') && !item.hidden && (item.device === 'pc' || !item.device)">
350
- <label :style="item.label_style ? item.label_style : ''"
351
- :class="item.label_bootstraped ? item.label_bootstraped + ' control-label-justify control-label' : 'control-label-justify control-label col-sm-6'">{{item.label}}</label>
352
- <div :style="item.value_style ? item.value_style : ''"
353
- :class="item.value_bootstraped ? item.value_bootstraped : 'col-sm-9'">
354
- <input class="form-control input_view"
355
- :placeholder="item.placeholder"
356
- :type="item.type"
357
- v-model="item.value"
358
- :value="item.value"
359
- :readonly="item.readonly"
360
- :disabled="item.disabled"
361
- @change="onbutchange(index)"
362
- @blur="onbutblur(index)"
363
- @input="onbutinput(index)"
364
- />
365
- </div>
366
- </div>
367
-
368
- <!--时间datepicker-->
369
- <div :style="item.style ? item.style : ''" :class="[item.required && !(item.value) ? 'has-error' : '', item.bootstraped ? item.bootstraped + ' form-group':'form-group']"
370
- v-if="item.type==='datepicker' && !item.hidden && (item.device === 'pc' || !item.device)">
371
- <label :style="item.label_style ? item.label_style : ''"
372
- :class="item.label_bootstraped ? item.label_bootstraped + ' control-label-justify control-label' : 'control-label-justify control-label col-sm-6'">{{item.label}}</label>
373
- <div :style="item.value_style ? item.value_style : ''"
374
- :class="item.value_bootstraped ? item.value_bootstraped : 'col-sm-9'">
375
- <datepicker
376
- :placeholder="item.placeholder"
377
- :value.sync="item.value"
378
- v-model="item.value"
379
- :readonly="item.readonly"
380
- :disabled="item.disabled"
381
- :format="item.format ? item.format : 'yyyy-MM-dd'"
382
- :show-reset-button="true"
383
- @change="onbutchange(index)"
384
- @blur="onbutblur(index)"
385
- ></datepicker>
386
- </div>
387
- </div>
388
-
389
- <!--select-->
390
- <div :style="item.style ? item.style : ''" :class="[item.required && !(item.value) ? 'has-error' : '', item.bootstraped ? item.bootstraped + ' form-group':'form-group']"
391
- v-if="item.type==='select' && !item.hidden && (item.device === 'pc' || !item.device)">
392
- <label :style="item.label_style ? item.label_style : ''"
393
- :class="item.label_bootstraped ? item.label_bootstraped + ' control-label-justify control-label' : 'control-label-justify control-label col-sm-6'">{{item.label}}</label>
394
- <div :style="item.value_style ? item.value_style : ''"
395
- :class="item.value_bootstraped ? item.value_bootstraped : 'col-sm-9'">
396
- <input-select
397
- class="select select_list"
398
- :value.sync="item.value"
399
- v-model="item.value"
400
- :options='item.options'
401
- :readonly="item.readonly"
402
- :disable="item.disabled"
403
- :valueSingle="true"
404
- @blur="onbutblur(index)"
405
- @change="onbutchange(index)"
406
- ></input-select>
407
- </div>
408
- </div>
409
-
410
- <!--textarea-->
411
- <div :style="item.style ? item.style : ''" :class="[item.required && !(item.value) ? 'has-error' : '', item.bootstraped ? item.bootstraped + ' form-group':'form-group']"
412
- v-if="item.type==='textarea' && !item.hidden && (item.device === 'pc' || !item.device)">
413
- <label :style="item.label_style ? item.label_style : ''"
414
- :class="item.label_bootstraped ? item.label_bootstraped + ' control-label-justify control-label' : 'control-label-justify control-label col-sm-6'">{{item.label}}</label>
415
- <div :style="item.value_style ? item.value_style : ''"
416
- :class="item.value_bootstraped ? item.value_bootstraped : 'col-sm-9'">
417
- <textarea
418
- class="form-control input_view"
419
- style="width: 100%;height: 100%"
420
- v-model="item.value"
421
- :value="item.value"
422
- :rows="item.rows"
423
- :readonly="item.readonly"
424
- :disabled="item.disabled"
425
- @change="onbutchange(index)"
426
- @blur="onbutblur(index)"
427
- @input="onbutinput(index)"
428
- ></textarea>
429
- </div>
430
- </div>
431
- </div>
432
- </div>
433
- </article>
434
- <footer slot="modal-footer" class="modal-footer">
435
- <button :class="disable_modal_button ? 'btn btn-default':'btn btn-primary'"
436
- :disabled="disable_modal_button" type="button" @click="confirmModal()">
437
- 确认
438
- </button>
439
- </footer>
440
- </modal>
441
- </form>
442
- </div>
443
- </template>
444
- <script>
445
- import Vue from 'vue'
446
- import {isEmpty} from '../../../components/Util'
447
- import {HttpResetClass} from 'vue-client'
448
- // Date格式化
449
- Date.prototype.Format = function (fmt) {
450
- var o = {
451
- 'M+': this.getMonth() + 1, // 月份
452
- 'd+': this.getDate(), // 日
453
- 'H+': this.getHours(), // 小时
454
- 'm+': this.getMinutes(), // 分
455
- 's+': this.getSeconds(), // 秒
456
- 'q+': Math.floor((this.getMonth() + 3) / 3), // 季度
457
- 'S': this.getMilliseconds() // 毫秒
458
- }
459
- if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (this.getFullYear() + '').substr(4 - RegExp.$1.length))
460
- for (var k in o) {
461
- if (new RegExp('(' + k + ')').test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length === 1) ? (o[k]) : (('00' + o[k]).substr(('' + o[k]).length)))
462
- }
463
- return fmt
464
- }
465
-
466
- export default {
467
- title: '报建业务通用组件',
468
- props: {
469
- data: {
470
- type: Object
471
- }
472
- },
473
- data () {
474
- return {
475
- model: {}, // 公司等属性
476
- disable_button: true, // 控制按钮禁用
477
- disable_modal_button: true, // 控制按钮禁用
478
- //初始化省市区数据
479
- pcdslist: [],
480
- //初始化街道数据
481
- streetslist: [],
482
- //初始化街道数据
483
- areaslist: [],
484
- showButModal: false,
485
- areaData:{
486
- sjvalue:'',
487
- xianvalue:'',
488
- sqvalue:'',
489
- },
490
- templatlng: {
491
- gaodetemplng: "",
492
- gaodetemplat: "",
493
- baidutemplng: "",
494
- baidutemplat: ""
495
- }
496
- }
497
- },
498
- watch: {
499
- deep: true
500
- },
501
- computed: {
502
-
503
- },
504
- created () {
505
- // 初始化数据
506
- this.initializtion()
507
- if (this.data.readyEvent) {
508
- this.$dispatch(this.data.readyEvent)
509
- }
510
- this.$dispatch('initializtionView')
511
- },
512
- methods: {
513
- // 初始化数据
514
- initializtion () {
515
- for (const item of this.data.fields) {
516
- this.data[item.field] = item.value
517
- }
518
-
519
- // 是否禁用按钮
520
- this.disableButton()
521
- // 公司等属性初始化
522
- if (this.data.orgs) {
523
- this.model.orgs = this.data.orgs
524
- } else {
525
- this.model.orgs = this.$login.f.orgs
526
- }
527
- if (this.data.parentname) {
528
- this.model.parentname = this.data.parentname
529
- } else {
530
- this.model.parentname = this.$login.f.f_department_name
531
- }
532
- if (this.data.operate_date) {
533
- this.model.operate_date = this.data.operate_date
534
- } else {
535
- this.model.operate_date = new Date().Format('yyyy-MM-dd')
536
- }
537
- if (this.data.operator) {
538
- this.model.operator = this.data.operator
539
- } else {
540
- this.model.operator = this.$login.f.name
541
- }
542
-
543
- this.initpcds(` j_orgid = '${this.$login.f.orgid}'`)
544
- },
545
- async getSelectShijiValue(sjvalue,sjlable) {
546
- this.areaData.sjvalue = sjvalue
547
- console.log("这是父级接收的市级值:",sjvalue,sjlable)
548
- this.data.areaData = this.areaData
549
-
550
- // 是否禁用按钮
551
- this.disableButton()
552
- },
553
- async getSelectXianValue(xianvalue,xianlable) {
554
- this.areaData.xianvalue = xianvalue
555
- this.data.areaData = this.areaData
556
- console.log("这是父级接收的县级值:",xianvalue,xianlable)
557
-
558
- // 是否禁用按钮
559
- this.disableButton()
560
- },
561
- async getSelectShequValue(sqvalue,sqlable) {
562
- this.areaData.sqvalue = sqvalue
563
- this.data.areaData = this.areaData
564
- console.log("这是父级接收的社区值:",sqvalue,sqlable)
565
-
566
- // 是否禁用按钮
567
- this.disableButton()
568
- },
569
- //初始化省市区,添加街道
570
- async initpcds(pconditon) {
571
- // console.log('initpcds', pconditon)
572
- // this.pcdslist = []
573
- // let HttpReset = new HttpResetClass()
574
- // let req = await HttpReset.load('POST', 'rs/sql/address_singleTableOrderBy?pageNo=1&pageSize=9999999', {
575
- // data: {
576
- // items: '*',
577
- // tablename: 'j_bjqpcd',
578
- // orderitem: 'id',
579
- // condition: pconditon
580
- // }
581
- // }, {resolveMsg: null, rejectMsg: '获取地址失败!'})
582
- // let redata = []
583
- // req.data.forEach((row, n) => {
584
- // redata[n] = {
585
- // label: row.j_areaname,
586
- // value: row.j_areaid,
587
- // data: row,
588
- // id: row.id
589
- // }
590
- // })
591
- // console.log('市区', redata)
592
- // this.pcdslist = redata
593
- },
594
- //初始化街道 添加小区
595
- async initstreets(pconditon) {
596
- // console.log('市区32', pconditon)
597
- // this.streetslist = []
598
- // let HttpReset = new HttpResetClass()
599
- // let req = await HttpReset.load('POST', 'rs/sql/address_singleTableOrderBy', {
600
- // data: {
601
- // items: '*',
602
- // tablename: 'j_bjqstreet',
603
- // orderitem: 'id',
604
- // condition: pconditon
605
- // }
606
- // }, {resolveMsg: null, rejectMsg: '获取地址失败!'})
607
- // let redata = []
608
- // req.data.forEach((row, n) => {
609
- // redata[n] = {
610
- // label: row.j_areaname,
611
- // value: row.j_areaid,
612
- // data: row,
613
- // id: row.id
614
- // }
615
- // })
616
- // console.log('市区333', redata)
617
- // this.streetslist = redata
618
- // this.model.f_iscity = this.findbyid(this.streetslist, this.model.f_street_id).f_iscity
619
- },
620
- //初始化小区添加小区
621
- async initareas(pconditon) {
622
- // if(this.usertype){
623
- // pconditon=pconditon+` and f_special='1' `
624
- // }
625
- // this.areaslist = []
626
- // let HttpReset = new HttpResetClass()
627
- // let req = await HttpReset.load('POST', 'rs/sql/address_singleTableOrderBy?pageNo=1&pageSize=100', {
628
- // data: {
629
- // items: '*',
630
- // tablename: 'j_bjqarea',
631
- // orderitem: 'id',
632
- // condition: pconditon
633
- // }
634
- // }, {resolveMsg: null, rejectMsg: '获取地址失败!'})
635
- // let redata = []
636
- // req.data.forEach((row) => {
637
- // redata.push({
638
- // label: row.j_areaname,
639
- // value: row.j_areaid,
640
- // data: row,
641
- // id: row.id
642
- // })
643
- // })
644
- // console.log('市区666', redata)
645
- // if (redata.length>0){
646
- // this.areaslist = redata
647
- // }
648
- },
649
- //省/市/区变化
650
- async pcdChange(val) {
651
-
652
- // console.log("省/市/区变化", val)
653
- // console.log("省/市/区变化", ` f_pcd_id ='${val}' `)
654
- // if (val) {
655
- // //那就把[小区,街道]重新组织一下
656
- // await this.initstreets(` j_parentid ='${val}' `)
657
- // if (this.model.f_street_id) {
658
- // if (this.findbyid(this.streetslist, this.model.f_street_id)) {
659
- // let pcd_id = this.findbyid(this.streetslist, this.model.f_street_id).f_pcd_id
660
- // if (pcd_id != val) {
661
- // this.model.f_street_id = ''
662
- // }
663
- // } else {
664
- // this.model.f_street_id = ''
665
- // }
666
- //
667
- // //那就把[小区,街道]重新组织一下
668
- // if (this.model.f_street_id) {
669
- // await this.initareas(` j_parentid ='${this.model.f_street_id}' `)
670
- // if (this.model.f_residential_area_id) {
671
- // if (this.findbyid(this.areaslist, this.model.f_residential_area_id)) {
672
- // let pcd_id = this.findbyid(this.areaslist, this.model.f_residential_area_id).f_pcd_id
673
- // if (pcd_id != val) {
674
- // this.model.f_residential_area_id = ''
675
- // }
676
- // } else {
677
- // this.model.f_residential_area_id = ''
678
- // }
679
- //
680
- // }
681
- // }
682
- // }
683
- // }
684
- // this.$resetValidation()
685
- },
686
- //街道变化
687
- async streetChange(val) {
688
- // console.log("街道变化", val)
689
- // if (this.streetslist[0]) {
690
- // var street = ''
691
- // this.streetslist.forEach((item) => {
692
- // if (item.id === val) {
693
- // street = item.label
694
- // }
695
- // })
696
- // this.model.f_address = street
697
- // }
698
- // if (val) {
699
- // //那就把[小区]重新组织一下
700
- // await this.initareas(` j_parentid ='${val}' `)
701
- // if (this.model.f_residential_area_id) {
702
- // if (this.findbyid(this.areaslist, this.model.f_residential_area_id)) {
703
- // let street_id = this.findbyid(this.areaslist, this.model.f_residential_area_id).f_street_id
704
- // if (street_id != val) {
705
- // this.model.f_residential_area_id = ''
706
- // }
707
- // } else {
708
- // this.model.f_residential_area_id = ''
709
- // }
710
- //
711
- // }
712
- // }
713
- // this.$resetValidation()
714
- },
715
- // 是否禁用按钮
716
- disableButton () {
717
- let flag = false
718
- for (const field of this.data.fields) {
719
- if (field.required && !field.value && !field.hidden && field.value !== 0) {
720
- flag = true
721
- }
722
-
723
- // 任何选择框只要是否都不能提交
724
- if (field.type === 'select' && field.value === '否' && field.value_no_disable) {
725
- flag = true
726
- }
727
-
728
- if (field.type === 'checkbox' && field.required && field.value.length === 0) {
729
- flag = true
730
- }
731
- }
732
-
733
- //区域下拉框必选 流程模式为报警器报建
734
- if ((this.data.f_apply_type === '报警器报建' || this.data.f_apply_type === '工商业报警器报建') && this.data.defname === '工程施工' && this.data.title === '工程施工' && this.data.f_sub_state !='完工'){
735
- if (!flag){
736
- if (this.areaData.sjvalue ==null || this.areaData.sjvalue.length ==0 || this.areaData.sqvalue == null || this.areaData.sqvalue.length ==0
737
- || this.areaData.xianvalue == null || this.areaData.xianvalue.length == 0){
738
- console.log("区域为空禁止提交:",this.areaData)
739
- flag = true
740
- }
741
-
742
- if (this.templatlng.baidutemplat ==null || this.templatlng.baidutemplat.length ==0 || this.templatlng.baidutemplng == null || this.templatlng.baidutemplng.length ==0
743
- || this.templatlng.gaodetemplat == null || this.templatlng.gaodetemplat.length == 0 || this.templatlng.gaodetemplng == null || this.templatlng.gaodetemplng.length == 0){
744
- console.log("地图坐标为空禁止提交:",this.templatlng)
745
- flag = true
746
- }
747
- }
748
- }
749
- this.disable_button = flag
750
- },
751
- // 失去焦点且值最终发生变化触发
752
- async onchange (index) {
753
- // 是否禁用按钮
754
- this.disableButton()
755
-
756
- if (!isEmpty(this.data.fields[index].value)) {
757
- // 前缀、后缀
758
- if (this.data.fields[index].prefix) {
759
- this.data.fields[index].value = this.data.fields[index].prefix + this.data.fields[index].value
760
- }
761
- if (this.data.fields[index].suffix) {
762
- this.data.fields[index].value = this.data.fields[index].value + this.data.fields[index].suffix
763
- }
764
- }
765
-
766
- // data赋值
767
- this.data[this.data.fields[index].field] = this.data.fields[index].value
768
-
769
- if (this.data.fields[index].type === 'datepicker') {
770
- this.check_datepicker(index)
771
- }
772
-
773
- if (this.data.fields[index].onchange) {
774
- this.$dispatch(this.data.fields[index].onchange, index)
775
- }
776
- this.$dispatch('onchange', index)
777
- },
778
- // 失去焦点触发,无论值是否发生变化
779
- onblur (index) {
780
- this.disableButton()
781
-
782
- if (this.data.fields[index].onblur) {
783
- this.$dispatch(this.data.fields[index].onblur, index)
784
- }
785
-
786
- this.$dispatch('onblur', index)
787
- },
788
- oninput (index) {
789
- // 是否禁用按钮
790
- this.disableButton()
791
-
792
- if (this.data.fields[index].oninput) {
793
- this.$dispatch(this.data.fields[index].oninput, index)
794
- }
795
- this.$dispatch('oninput', index)
796
- },
797
- selectSearch(event, index) {
798
- if (this.data.fields[index].selectSearch) {
799
- this.$dispatch(this.data.fields[index].selectSearch, event[0], index)
800
- }
801
- this.$dispatch('selectSearch', event[0], index)
802
- },
803
- // 点击按钮组按钮
804
- async click_but (button) {
805
- //报警器区域地址
806
- this.data.areaData = this.areaData
807
- this.data.templatlng = this.templatlng
808
-
809
- this.disable_button = true
810
-
811
- this.data.fields.forEach(item => {
812
- this.data[item.field] = item.value
813
- })
814
-
815
- this.data.button = button
816
-
817
- if (button.button_fields && button.button_fields.length > 0) {
818
- this.showButModal = true
819
- return
820
- }
821
-
822
- if (this.data.button.event) {
823
- this.$dispatch(this.data.button.event)
824
- } else {
825
- this.$dispatch('button')
826
- }
827
-
828
- },
829
- confirmModal () {
830
- this.closeModal()
831
-
832
- this.data.button.button_fields.forEach(item => {
833
- this.data.button[item.field] = item.value
834
- })
835
-
836
- if (this.data.button.event) {
837
- this.$dispatch(this.data.button.event)
838
- } else {
839
- this.$dispatch('button')
840
- }
841
- },
842
- // 关闭模态框
843
- closeModal () {
844
- this.showButModal = false
845
- this.disable_modal_button = false
846
- },
847
- onbutchange (index) {
848
- // 是否禁用按钮
849
- this.disableModalButton()
850
-
851
- if (this.data.button.button_fields[index].onchange) {
852
- this.$dispatch(this.data.button.button_fields[index].onchange, index)
853
- } else {
854
- this.$dispatch('onbutchange', index)
855
- }
856
-
857
- },
858
- onbutblur (index) {
859
- this.disableModalButton()
860
-
861
- if (this.data.button.button_fields[index].onblur) {
862
- this.$dispatch(this.data.button.button_fields[index].onblur, index)
863
- } else {
864
- this.$dispatch('onbutblur', index)
865
- }
866
- },
867
- onbutinput (index) {
868
- // 是否禁用按钮
869
- this.disableModalButton()
870
-
871
- if (this.data.button.button_fields[index].oninput) {
872
- this.$dispatch(this.data.button.button_fields[index].oninput, index)
873
- } else {
874
- this.$dispatch('onbutinput', index)
875
- }
876
- },
877
- disableModalButton () {
878
- let flag = false
879
-
880
-
881
- for (const item of this.data.button.button_fields) {
882
- if (item.required && !item.value) {
883
- if (item.value === 0) {
884
- flag = false
885
- } else {
886
- flag = true
887
- }
888
- }
889
- }
890
-
891
- this.disable_modal_button = flag
892
- },
893
- check_datepicker (index) {
894
- // 时间格式检测
895
- if (!isEmpty(this.data.fields[index].value)) {
896
-
897
- let dateReg = /^[1-9]\d{3}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])$/
898
- let timeReg = /^(20|21|22|23|[0-1]\d):[0-5]\d:[0-5]\d$/
899
- let datetimeReg = /^[1-9]\d{3}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])\s+(20|21|22|23|[0-1]\d):[0-5]\d:[0-5]\d$/
900
- if (this.data.fields[index].format) {
901
- if (this.data.fields[index].format === 'yyyy-MM-dd') {
902
- if (!dateReg.test(this.data.fields[index].value)) {
903
- this.data.fields[index].value = ''
904
- this.$showAlert(this.data.fields[index].label + '格式错误如:2021-01-01', 'warning', 2000)
905
- }
906
- }
907
- if (this.data.fields[index].format === 'HH:mm:ss') {
908
- if (!timeReg.test(this.data.fields[index].value)) {
909
- this.data.fields[index].value = ''
910
- this.$showAlert(this.data.fields[index].label + '格式错误如:00:00:00', 'warning', 2000)
911
- }
912
- }
913
- if (this.data.fields[index].format === 'yyyy-MM-dd HH:mm:ss') {
914
- if (!datetimeReg.test(this.data.fields[index].value)) {
915
- this.data.fields[index].value = ''
916
- this.$showAlert(this.data.fields[index].label + '格式错误如:2021-01-01 00:00:00', 'warning', 2000)
917
- }
918
- }
919
- } else {
920
- if (!dateReg.test(this.data.fields[index].value)) {
921
- this.data.fields[index].value = ''
922
- this.$showAlert(this.data.fields[index].label + '格式错误如:2021-01-01', 'warning', 2000)
923
- }
924
- }
925
- }
926
- }
927
- },
928
- events: {
929
-
930
- }
931
- }
932
- </script>
933
- <style>
934
- .datepicker{
935
- width: 100%!important;
936
- }
937
- .datepicker-input{
938
- background-color: #ffffff!important;
939
- width: 100%!important;
940
- }
941
- .datepicker-input:disabled{
942
- border: 1px solid #DDD!important;
943
- color: #ACA899!important;
944
- width: 100%!important;
945
- }
946
- </style>
947
- <style scoped>
948
- th{
949
- font-size: 15px !important;
950
- text-align: center !important;
951
- background-color: #dfedfb!important;
952
- color: #666666 !important;
953
- font-family: PINGFANG-BOLD !important;
954
- font-weight: normal!important;
955
- }
956
- /*清除model中的浮动*/
957
- .clearfix:after,.clearfix:before{
958
- display: table;
959
- }
960
- .clearfix:after{
961
- clear: both;
962
- }
963
-
964
- .input_view{
965
- padding: 8px;
966
- background-color: #ffffff;
967
- border-radius: 2px;
968
- border: solid 1px #c7c7c7!important;
969
- color: #333333!important;
970
- font-size: 15px!important;
971
- }
972
-
973
- .input_view[readonly]{
974
- border: 1px solid #DDD!important;
975
- color:#ACA899!important;
976
- }
977
- .input_view:disabled{
978
- border: 1px solid #DDD!important;
979
- color:#ACA899!important;
980
- }
981
-
982
- .control-label-justify {
983
- display: inline-block;
984
- vertical-align: top;
985
- width: 150px;
986
- text-align: justify;
987
- font-family: PingFang-SC-Bold;
988
- }
989
-
990
- .control-label-justify::after {
991
- content: "";
992
- display: inline-block;
993
- width: 100%;
994
- overflow: hidden;
995
- height: 0;
996
- }
997
-
998
- input::-webkit-outer-spin-button,
999
- input::-webkit-inner-spin-button {
1000
- -webkit-appearance: none;
1001
- }
1002
-
1003
- input[type="number"] {
1004
- -moz-appearance: textfield;
1005
- }
1006
-
1007
- </style>
1
+ <template>
2
+ <div class="select-overspread" style="background-color: #ffffff;padding: 20px;overflow: scroll">
3
+ <validator name='v' @valid="$emit('valid')" @invalid="$emit('invalid')">
4
+ <form class="form-horizontal">
5
+ <div class="form-group">
6
+ <div v-for="(index,item) in data.fields">
7
+ <!--input-->
8
+ <div :style="item.style ? item.style+';height: 40px;margin-bottom: 20px':'height: 40px;margin-bottom: 20px'"
9
+ v-if="(item.type==='input' || item.type==='number'||item.type === 'tel'||item.type === 'email') && !item.hidden && (item.device === 'pc' || !item.device) && ( item.label != '证件号码')&&( item.label !== '身份证') && (item.label !== '用户电话')"
10
+ :class="[item.required && !(item.value) ? 'has-error' : '',item.bootstraped ? item.bootstraped + ' form-group':'col-sm-4 form-group']">
11
+ <label :style="item.label_style ? item.label_style : ''"
12
+ :class="item.label_bootstraped ? item.label_bootstraped+' control-label-justify control-label' : 'control-label-justify control-label col-sm-6'">{{item.label}}</label>
13
+ <div :style="item.value_style ? item.value_style:''"
14
+ :class="item.value_bootstraped ? item.value_bootstraped : 'col-sm-6'">
15
+ <input class="form-control input_view" style=""
16
+ :type="item.type"
17
+ v-model="data.fields[index].value"
18
+ :placeholder="item.placeholder"
19
+ :value="data.fields[index].value"
20
+ :readonly="item.readonly"
21
+ :disabled="item.disabled"
22
+ @change="onchange(index)"
23
+ @blur="onblur(index)"
24
+ @input="oninput(index)"
25
+ />
26
+ </div>
27
+ </div>
28
+
29
+ <!--input-->
30
+ <div :style="item.style ? item.style+';height: 40px;margin-bottom: 20px':'height: 40px;margin-bottom: 20px'"
31
+ v-if="(data.f_credentials != '身份证' && item.label === '证件号码')"
32
+ :class="[item.required && !(item.value) ? 'has-error' : '',item.bootstraped ? item.bootstraped + ' form-group':'col-sm-4 form-group']">
33
+ <label :style="item.label_style ? item.label_style : ''"
34
+ :class="item.label_bootstraped ? item.label_bootstraped+' control-label-justify control-label' : 'control-label-justify control-label col-sm-6'">{{item.label}}</label>
35
+ <div :style="item.value_style ? item.value_style:''"
36
+ :class="item.value_bootstraped ? item.value_bootstraped : 'col-sm-6'">
37
+ <input class="form-control input_view" style=""
38
+ :type="item.type"
39
+ v-model="data.fields[index].value"
40
+ :placeholder="item.placeholder"
41
+ :value="data.fields[index].value"
42
+ :readonly="item.readonly"
43
+ :disabled="item.disabled"
44
+ @change="onchange(index)"
45
+ @blur="onblur(index)"
46
+ @input="oninput(index)"
47
+ />
48
+ </div>
49
+ </div>
50
+ <!--身份证验证-->
51
+ <div :style="item.style ? item.style+';height: 40px;margin-bottom: 20px':'height: 40px;margin-bottom: 20px'"
52
+ v-if="(item.label==='身份证') || (data.f_credentials === '身份证' && item.label === '证件号码')"
53
+ :class="[$v.f_idnumber2.identityCardValid ? 'has-error' : '',item.bootstraped ? item.bootstraped + ' form-group':'col-sm-4 form-group']">
54
+ <label :style="item.label_style ? item.label_style : ''"
55
+ :class="item.label_bootstraped ? item.label_bootstraped+' control-label-justify control-label' : 'control-label-justify control-label col-sm-6'">{{item.label}}</label>
56
+ <div :style="item.value_style ? item.value_style:''"
57
+ :class="item.value_bootstraped ? item.value_bootstraped : 'col-sm-6'">
58
+ <input class="form-control input_view" style=""
59
+ :type="item.type"
60
+ maxlength="18"
61
+ v-model="data.fields[index].value"
62
+ :placeholder="item.placeholder"
63
+ :value="data.fields[index].value"
64
+ v-validate:f_idnumber2='{identityCardValid: true}'
65
+ :readonly="item.readonly"
66
+ :disabled="item.disabled"
67
+ @change="onchange(index)"
68
+ @blur="onblur(index)"
69
+ @input="oninput(index)"
70
+ />
71
+ </div>
72
+ </div>
73
+
74
+
75
+ <div :style="item.style ? item.style+';height: 40px;margin-bottom: 20px':'height: 40px;margin-bottom: 20px'"
76
+ v-if="item.label === '用户电话'"
77
+ :class="[$v.f_user_phone.minlength || $v.f_user_phone.maxlength ? 'has-error' : '',item.bootstraped ? item.bootstraped + ' form-group':'col-sm-4 form-group']">
78
+ <label :style="item.label_style ? item.label_style : ''"
79
+ :class="item.label_bootstraped ? item.label_bootstraped+' control-label-justify control-label' : 'control-label-justify control-label col-sm-6'">{{item.label}}</label>
80
+ <div :style="item.value_style ? item.value_style:''"
81
+ :class="item.value_bootstraped ? item.value_bootstraped : 'col-sm-6'">
82
+ <input class="form-control input_view" style=""
83
+ type="number"
84
+ oninput="if(value.length > 11) value=value.slice(0,11)"
85
+ v-validate:f_user_phone="{minlength: 7, maxlength: 11 }"
86
+ v-model="data.fields[index].value"
87
+ :placeholder="item.placeholder"
88
+ :value="data.fields[index].value"
89
+ onKeypress="return(/[\d\.]/.test(String.fromCharCode(event.keyCode)))"
90
+ :readonly="item.readonly"
91
+ :disabled="item.disabled"
92
+ @change="onchange(index)"
93
+ @blur="onblur(index)"
94
+ @input="oninput(index)"
95
+ />
96
+ </div>
97
+ </div>
98
+
99
+
100
+
101
+ <!--时间datepicker-->
102
+ <div :style="item.style ? item.style+';height: 40px;margin-bottom: 20px':'height: 40px;margin-bottom: 20px'"
103
+ v-if="item.type==='datepicker' && !item.hidden && (item.device === 'pc' || !item.device)"
104
+ :class="[item.required && !(item.value) ? 'has-error' : '',item.bootstraped ? item.bootstraped+' form-group':'col-sm-4 form-group']">
105
+ <label
106
+ :class="item.label_bootstraped ? item.label_bootstraped+' control-label-justify control-label' : 'control-label control-label-justify col-sm-6'">{{item.label}}</label>
107
+ <div :style="item.value_style ? item.value_style:''"
108
+ :class="item.value_bootstraped ? item.value_bootstraped : 'col-sm-6'">
109
+ <datepicker
110
+ @change="onchange(index)"
111
+ @blur="onblur(index)"
112
+ :placeholder="item.placeholder"
113
+ :value.sync="data.fields[index].value"
114
+ :format="item.format ? item.format : 'yyyy-MM-dd'"
115
+ v-model="data.fields[index].value"
116
+ :readonly="item.readonly"
117
+ :disabled="item.disabled"
118
+ :show-reset-button="reset">
119
+ </datepicker>
120
+ </div>
121
+ </div>
122
+
123
+ <!--textarea-->
124
+ <div :style="item.style ? item.style+';margin-bottom: 20px':'margin-bottom: 20px'"
125
+ v-if="item.type==='textarea' && !item.hidden && (item.device === 'pc' || !item.device)"
126
+ :class="[item.required && !(item.value) ? 'has-error' : '',item.bootstraped?item.bootstraped+' form-group':'col-sm-12 form-group']">
127
+ <label :style="item.label_style ? item.label_style : ''"
128
+ :class="item.label_bootstraped ? item.label_bootstraped + ' control-label-justify control-label' : 'control-label-justify control-label col-sm-3'">{{item.label}}</label>
129
+ <div :style="item.value_style ? item.value_style:''"
130
+ :class="item.value_bootstraped ? item.value_bootstraped : 'col-sm-10'">
131
+ <textarea
132
+ :readonly="item.readonly"
133
+ :disabled="item.disabled"
134
+ class="form-control input_view"
135
+ style="width: 100%;height: 100%"
136
+ :rows="item.rows"
137
+ v-model="data.fields[index].value"
138
+ :value="data.fields[index].value"
139
+ @change="onchange(index)"
140
+ @blur="onblur(index)"
141
+ @input="oninput(index)"
142
+ >
143
+ </textarea>
144
+ </div>
145
+ </div>
146
+
147
+ <!--select-->
148
+ <div :style="item.style ? item.style+';height: 40px;margin-bottom: 20px':'height: 40px;margin-bottom: 20px'"
149
+ v-if="item.type==='select' && !item.hidden && (item.device === 'pc' || !item.device) && !item.multiple"
150
+ :class="[item.required && !(item.value) ? 'has-error' : '',item.bootstraped?item.bootstraped+' form-group':'col-sm-4 form-group']">
151
+ <label
152
+ :class="item.label_bootstraped ? item.label_bootstraped+' control-label control-label-justify':'control-label-justify control-label col-sm-6'">{{item.label}}</label>
153
+ <div :style="item.value_style ? item.value_style:''"
154
+ :class="item.value_bootstraped ? item.value_bootstraped : 'col-sm-6'">
155
+ <input-select
156
+ class="select select_list"
157
+ @blur="onblur(index)"
158
+ @change="onchange(index)"
159
+ @select-search="selectSearch($arguments,index)"
160
+ :readonly="item.readonly"
161
+ :disable="item.disabled"
162
+ :value.sync="data.fields[index].value"
163
+ v-model="data.fields[index].value"
164
+ :options='data.fields[index].options'
165
+ :valueSingle="true"></input-select>
166
+ </div>
167
+ </div>
168
+ <!--select 多选-->
169
+ <div :style="item.style ? item.style+';height: 40px;margin-bottom: 20px':'height: 40px;margin-bottom: 20px'"
170
+ v-if="item.type==='select' && !item.hidden && (item.device === 'pc' || !item.device)&& item.multiple"
171
+ :class="[item.required && !(item.value) ? 'has-error' : '',item.bootstraped?item.bootstraped+' form-group':'col-sm-4 form-group']">
172
+ <label
173
+ :class="item.label_bootstraped ? item.label_bootstraped+' control-label control-label-justify':'control-label-justify control-label col-sm-6'">{{item.label}}</label>
174
+ <div :style="item.value_style ? item.value_style:''"
175
+ :class="item.value_bootstraped ? item.value_bootstraped : 'col-sm-6'">
176
+ <v-select
177
+ width="100%"
178
+ class="select select_list"
179
+ @blur="onblur(index)"
180
+ @change="onchange(index)"
181
+ @select-search="selectSearch($arguments,index)"
182
+ :readonly="item.readonly"
183
+ :disable="item.disabled"
184
+ :value.sync="data.fields[index].value"
185
+ v-model="data.fields[index].value"
186
+ :options='data.fields[index].options'
187
+ :multiple="data.fields[index].multiple"
188
+ :valueSingle="true"></v-select>
189
+ </div>
190
+ </div>
191
+
192
+ <!--checkbox-->
193
+ <div :style="item.style ? item.style+';height: 40px;margin-bottom: 20px':'height: 40px;margin-bottom: 20px'"
194
+ v-if="item.type==='checkbox' && !item.hidden && (item.device === 'pc' || !item.device)"
195
+ :class="[item.required && item.value.length === 0 ? 'has-error' : '',item.bootstraped?item.bootstraped+' form-group':'col-sm-4 form-group']">
196
+ <label v-if="item.label"
197
+ :class="item.label_bootstraped?item.label_bootstraped+' control-label control-label-justify':'control-label-justify control-label col-sm-6'">{{item.label}}</label>
198
+ <div :style="item.value_style ? item.value_style:''"
199
+ :class="item.value_bootstraped ? item.value_bootstraped : 'col-sm-6'">
200
+ <label class="checkbox-inline" v-for="(index2,row) in item.options">
201
+ <input type="checkbox" class=""
202
+ :readonly="data.fields[index].readonly"
203
+ :disabled="data.fields[index].disabled"
204
+ v-model="data.fields[index].value"
205
+ :value="data.fields[index].options[index2].value"
206
+ @change="onchange(index)"
207
+ @blur="onblur(index)">
208
+ {{row.label}}
209
+ </label>
210
+ </div>
211
+ </div>
212
+ </div>
213
+ <!--区域地址联动-->
214
+ <div>
215
+ <res-area-select-group
216
+ v-if="(data.f_apply_type === '报警器报建' || data.f_apply_type === '工商业报警器报建') && data.defname === '工程施工' && data.title === '工程施工' && data.f_sub_state !='完工'"
217
+ labelstyle = "control-label"
218
+ @shiji-select = "getSelectShijiValue"
219
+ @xian-select = "getSelectXianValue"
220
+ @shequ-select = "getSelectShequValue"
221
+ >
222
+ </res-area-select-group>
223
+ </div>
224
+
225
+ <gaode-map
226
+ v-if="(data.f_apply_type === '报警器报建' || data.f_apply_type === '工商业报警器报建') && data.defname === '工程施工' && data.title === '工程施工' && data.f_sub_state !='完工'"
227
+ >
228
+
229
+ </gaode-map>
230
+
231
+ </div>
232
+
233
+ <!-- onetomany -->
234
+ <div class="" v-for="(index,item) in data.onetomany">
235
+ <onetomany :selectdata="data" :onetomany="item" :index="index" v-if="item.device === 'pc' || !item.device"></onetomany>
236
+ </div>
237
+
238
+ <div v-for="(i,item) in data.components">
239
+ <h3 v-if="item.device === 'pc'"><nbr >{{item.title}}</nbr></h3>
240
+ <component v-if="item.device === 'pc' || !item.device" :is="item.name" :selectdata="data" :mark="item.mark"></component>
241
+ </div>
242
+
243
+ <!--自定义组件-->
244
+ <slot>
245
+ <!--<div :style="item.style ? item.style+';height: 40px;margin-bottom: 20px':'height: 40px;margin-bottom: 20px'"-->
246
+ <!-- v-if="data.f_apply_type === '报警器报建' && data.defname === '工程施工'"-->
247
+ <!-- :class="[$v.f_idnumber2.identityCardValid ? 'has-error' : '',item.bootstraped ? item.bootstraped + ' form-group':'col-sm-4 form-group']">-->
248
+
249
+ <!--<div class="col-sm-6 form-group "-->
250
+ <!-- :class="[$v.f_pcd_id.required ? 'has-error' : 'has-success']">-->
251
+ <!-- <label class="font_normal_body">省&ensp;市&ensp;区</label>-->
252
+ <!-- <input type="text" style="width:41%" v-show="false" v-model="model.f_pcd_id"-->
253
+ <!-- v-validate:f_pcd_id='{required: true }'-->
254
+ <!-- >-->
255
+
256
+ <!-- <v-select :value.sync="model.f_pcd_id" :value-single="true"-->
257
+ <!-- :options='pcdslist' placeholder='请选择2'-->
258
+ <!-- close-on-select search="true" @change="pcdChange">-->
259
+ <!-- </v-select>-->
260
+ <!--</div>-->
261
+ <!--<div class="col-sm-6 form-group "-->
262
+ <!-- :class="[$v.f_street_id.required ? 'has-error' : 'has-success']">-->
263
+ <!-- <label class="font_normal_body">街道/乡镇</label>-->
264
+ <!-- <input type="text" style="width:41%" v-show="false" v-model="model.f_street_id"-->
265
+ <!-- >-->
266
+ <!-- <v-select :value.sync="model.f_street_id" :value-single="true"-->
267
+ <!-- :options='streetslist' placeholder='请选择'-->
268
+ <!-- @change="streetChange"-->
269
+ <!-- close-on-select search="true">-->
270
+ <!-- </v-select>-->
271
+
272
+ <!--</div>-->
273
+ <!--<div class="col-sm-6 form-group "-->
274
+ <!-- :class="[$v.f_residential_area_id.required ? 'has-error' : 'has-success']">-->
275
+ <!-- <label class="font_normal_body">小区</label>-->
276
+ <!-- <input type="text" style="width:41%" v-show="false" v-model="model.f_residential_area_id"-->
277
+ <!-- v-validate:f_residential_area_id='{required: true }'>-->
278
+ <!-- <v-select :value.sync="model.f_residential_area_id" :value-single="true"-->
279
+ <!-- :options='areaslist' placeholder='请选择'-->
280
+ <!-- @change="" @select-search="selectSearch"-->
281
+ <!-- close-on-select search="true">-->
282
+ <!-- </v-select>-->
283
+ <!--</div>-->
284
+ <!--</div>-->
285
+ </slot>
286
+ <!--公司等属性-->
287
+ <div class="col-sm-12 form-group text-center" style="padding-top:8px">
288
+ <div class="col-sm-3 form-group center-block">
289
+ <label class="col-sm-5">所属公司:</label>
290
+ <div class="col-sm-6" style="text-align: left">
291
+ {{model.orgs}}
292
+ </div>
293
+ </div>
294
+ <div class="col-sm-3 form-group center-block">
295
+ <label class="col-sm-5">部门:</label>
296
+ <div class="col-sm-6" style="text-align: left">
297
+ {{model.parentname}}
298
+ </div>
299
+ </div>
300
+ <div class="col-sm-3 form-group center-block">
301
+ <label class="col-sm-5">操作人:</label>
302
+ <div class="col-sm-6 " style="text-align: left">
303
+ {{model.operator}}
304
+ </div>
305
+ </div>
306
+ <div class="col-sm-3 form-group center-block">
307
+ <label class="col-sm-5">操作日期:</label>
308
+ <div class="col-sm-6" style="text-align: left">
309
+ {{model.operate_date}}
310
+ </div>
311
+ </div>
312
+ </div>
313
+ <!-- 按钮组 -->
314
+ <div class="from-group col-sm-12 text-center">
315
+ <!-- 按钮组 -->
316
+ <button v-for="(index,button) in data.buttons"
317
+ :disabled="(button.disabled && disable_button)"
318
+ style="min-width:100px"
319
+ :class="button.disabled && disable_button ? 'btn btn-default button_spacing' : 'btn btn-primary button_spacing'"
320
+ v-if="!button.hidden && button.button_name !=='提交'&& button.button_name !=='确认'"
321
+ @click.prevent="click_but(button)"
322
+ >
323
+ {{button.button_name}}
324
+ </button>
325
+ <button v-for="(index,button) in data.buttons"
326
+ :disabled="(button.disabled && disable_button) || (!$v.valid)"
327
+ style="min-width:100px"
328
+ :class="button.disabled && disable_button || (!$v.valid) ? 'btn btn-default button_spacing' : 'btn btn-primary button_spacing'"
329
+ v-if="!button.hidden && (button.button_name ==='提交'||button.button_name ==='确认')"
330
+ @click.prevent="click_but(button)"
331
+ >
332
+ {{button.button_name}}
333
+ </button>
334
+ </div>
335
+ <div class="from-group col-sm-12 text-center" style="height: 20px;">
336
+
337
+ </div>
338
+ <!-- 按钮模态框 -->
339
+ <modal v-if="showButModal" :show.sync="showButModal" backdrop="false" large>
340
+ <header slot="modal-header" class="modal-header">
341
+ <button type="button" class="close" @click="closeModal()"><span>&times;</span></button>
342
+ <span class="modal-title"><font
343
+ size="3">{{data.button.button_name}}</font></span>
344
+ </header>
345
+ <article slot="modal-body" class="modal-body clearfix">
346
+ <div class="form-group" style="padding: 0 150px">
347
+ <div v-for="(index,item) in data.button.button_fields">
348
+ <div :style="item.style ? item.style : ''" :class="[item.required && !(item.value) ? 'has-error' : '', item.bootstraped ? item.bootstraped + ' form-group' : 'form-group']"
349
+ v-if="(item.type==='input' || item.type==='number'||item.type === 'tel'||item.type === 'email') && !item.hidden && (item.device === 'pc' || !item.device)">
350
+ <label :style="item.label_style ? item.label_style : ''"
351
+ :class="item.label_bootstraped ? item.label_bootstraped + ' control-label-justify control-label' : 'control-label-justify control-label col-sm-6'">{{item.label}}</label>
352
+ <div :style="item.value_style ? item.value_style : ''"
353
+ :class="item.value_bootstraped ? item.value_bootstraped : 'col-sm-9'">
354
+ <input class="form-control input_view"
355
+ :placeholder="item.placeholder"
356
+ :type="item.type"
357
+ v-model="item.value"
358
+ :value="item.value"
359
+ :readonly="item.readonly"
360
+ :disabled="item.disabled"
361
+ @change="onbutchange(index)"
362
+ @blur="onbutblur(index)"
363
+ @input="onbutinput(index)"
364
+ />
365
+ </div>
366
+ </div>
367
+
368
+ <!--时间datepicker-->
369
+ <div :style="item.style ? item.style : ''" :class="[item.required && !(item.value) ? 'has-error' : '', item.bootstraped ? item.bootstraped + ' form-group':'form-group']"
370
+ v-if="item.type==='datepicker' && !item.hidden && (item.device === 'pc' || !item.device)">
371
+ <label :style="item.label_style ? item.label_style : ''"
372
+ :class="item.label_bootstraped ? item.label_bootstraped + ' control-label-justify control-label' : 'control-label-justify control-label col-sm-6'">{{item.label}}</label>
373
+ <div :style="item.value_style ? item.value_style : ''"
374
+ :class="item.value_bootstraped ? item.value_bootstraped : 'col-sm-9'">
375
+ <datepicker
376
+ :placeholder="item.placeholder"
377
+ :value.sync="item.value"
378
+ v-model="item.value"
379
+ :readonly="item.readonly"
380
+ :disabled="item.disabled"
381
+ :format="item.format ? item.format : 'yyyy-MM-dd'"
382
+ :show-reset-button="true"
383
+ @change="onbutchange(index)"
384
+ @blur="onbutblur(index)"
385
+ ></datepicker>
386
+ </div>
387
+ </div>
388
+
389
+ <!--select-->
390
+ <div :style="item.style ? item.style : ''" :class="[item.required && !(item.value) ? 'has-error' : '', item.bootstraped ? item.bootstraped + ' form-group':'form-group']"
391
+ v-if="item.type==='select' && !item.hidden && (item.device === 'pc' || !item.device)">
392
+ <label :style="item.label_style ? item.label_style : ''"
393
+ :class="item.label_bootstraped ? item.label_bootstraped + ' control-label-justify control-label' : 'control-label-justify control-label col-sm-6'">{{item.label}}</label>
394
+ <div :style="item.value_style ? item.value_style : ''"
395
+ :class="item.value_bootstraped ? item.value_bootstraped : 'col-sm-9'">
396
+ <input-select
397
+ class="select select_list"
398
+ :value.sync="item.value"
399
+ v-model="item.value"
400
+ :options='item.options'
401
+ :readonly="item.readonly"
402
+ :disable="item.disabled"
403
+ :valueSingle="true"
404
+ @blur="onbutblur(index)"
405
+ @change="onbutchange(index)"
406
+ ></input-select>
407
+ </div>
408
+ </div>
409
+
410
+ <!--textarea-->
411
+ <div :style="item.style ? item.style : ''" :class="[item.required && !(item.value) ? 'has-error' : '', item.bootstraped ? item.bootstraped + ' form-group':'form-group']"
412
+ v-if="item.type==='textarea' && !item.hidden && (item.device === 'pc' || !item.device)">
413
+ <label :style="item.label_style ? item.label_style : ''"
414
+ :class="item.label_bootstraped ? item.label_bootstraped + ' control-label-justify control-label' : 'control-label-justify control-label col-sm-6'">{{item.label}}</label>
415
+ <div :style="item.value_style ? item.value_style : ''"
416
+ :class="item.value_bootstraped ? item.value_bootstraped : 'col-sm-9'">
417
+ <textarea
418
+ class="form-control input_view"
419
+ style="width: 100%;height: 100%"
420
+ v-model="item.value"
421
+ :value="item.value"
422
+ :rows="item.rows"
423
+ :readonly="item.readonly"
424
+ :disabled="item.disabled"
425
+ @change="onbutchange(index)"
426
+ @blur="onbutblur(index)"
427
+ @input="onbutinput(index)"
428
+ ></textarea>
429
+ </div>
430
+ </div>
431
+ </div>
432
+ </div>
433
+ </article>
434
+ <footer slot="modal-footer" class="modal-footer">
435
+ <button :class="disable_modal_button ? 'btn btn-default':'btn btn-primary'"
436
+ :disabled="disable_modal_button" type="button" @click="confirmModal()">
437
+ 确认
438
+ </button>
439
+ </footer>
440
+ </modal>
441
+ </form>
442
+ </div>
443
+ </template>
444
+ <script>
445
+ import Vue from 'vue'
446
+ import {isEmpty} from '../../../components/Util'
447
+ import {HttpResetClass} from 'vue-client'
448
+ // Date格式化
449
+ Date.prototype.Format = function (fmt) {
450
+ var o = {
451
+ 'M+': this.getMonth() + 1, // 月份
452
+ 'd+': this.getDate(), // 日
453
+ 'H+': this.getHours(), // 小时
454
+ 'm+': this.getMinutes(), // 分
455
+ 's+': this.getSeconds(), // 秒
456
+ 'q+': Math.floor((this.getMonth() + 3) / 3), // 季度
457
+ 'S': this.getMilliseconds() // 毫秒
458
+ }
459
+ if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (this.getFullYear() + '').substr(4 - RegExp.$1.length))
460
+ for (var k in o) {
461
+ if (new RegExp('(' + k + ')').test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length === 1) ? (o[k]) : (('00' + o[k]).substr(('' + o[k]).length)))
462
+ }
463
+ return fmt
464
+ }
465
+
466
+ export default {
467
+ title: '报建业务通用组件',
468
+ props: {
469
+ data: {
470
+ type: Object
471
+ }
472
+ },
473
+ data () {
474
+ return {
475
+ model: {}, // 公司等属性
476
+ disable_button: true, // 控制按钮禁用
477
+ disable_modal_button: true, // 控制按钮禁用
478
+ //初始化省市区数据
479
+ pcdslist: [],
480
+ //初始化街道数据
481
+ streetslist: [],
482
+ //初始化街道数据
483
+ areaslist: [],
484
+ showButModal: false,
485
+ areaData:{
486
+ sjvalue:'',
487
+ xianvalue:'',
488
+ sqvalue:'',
489
+ },
490
+ templatlng: {
491
+ gaodetemplng: "",
492
+ gaodetemplat: "",
493
+ baidutemplng: "",
494
+ baidutemplat: ""
495
+ }
496
+ }
497
+ },
498
+ watch: {
499
+ deep: true
500
+ },
501
+ computed: {
502
+
503
+ },
504
+ created () {
505
+ // 初始化数据
506
+ this.initializtion()
507
+ if (this.data.readyEvent) {
508
+ this.$dispatch(this.data.readyEvent)
509
+ }
510
+ this.$dispatch('initializtionView')
511
+ },
512
+ methods: {
513
+ // 初始化数据
514
+ initializtion () {
515
+ for (const item of this.data.fields) {
516
+ this.data[item.field] = item.value
517
+ }
518
+
519
+ // 是否禁用按钮
520
+ this.disableButton()
521
+ // 公司等属性初始化
522
+ if (this.data.orgs) {
523
+ this.model.orgs = this.data.orgs
524
+ } else {
525
+ this.model.orgs = this.$login.f.orgs
526
+ }
527
+ if (this.data.parentname) {
528
+ this.model.parentname = this.data.parentname
529
+ } else {
530
+ this.model.parentname = this.$login.f.f_department_name
531
+ }
532
+ if (this.data.operate_date) {
533
+ this.model.operate_date = this.data.operate_date
534
+ } else {
535
+ this.model.operate_date = new Date().Format('yyyy-MM-dd')
536
+ }
537
+ if (this.data.operator) {
538
+ this.model.operator = this.data.operator
539
+ } else {
540
+ this.model.operator = this.$login.f.name
541
+ }
542
+
543
+ this.initpcds(` j_orgid = '${this.$login.f.orgid}'`)
544
+ },
545
+ async getSelectShijiValue(sjvalue,sjlable) {
546
+ this.areaData.sjvalue = sjvalue
547
+ console.log("这是父级接收的市级值:",sjvalue,sjlable)
548
+ this.data.areaData = this.areaData
549
+
550
+ // 是否禁用按钮
551
+ this.disableButton()
552
+ },
553
+ async getSelectXianValue(xianvalue,xianlable) {
554
+ this.areaData.xianvalue = xianvalue
555
+ this.data.areaData = this.areaData
556
+ console.log("这是父级接收的县级值:",xianvalue,xianlable)
557
+
558
+ // 是否禁用按钮
559
+ this.disableButton()
560
+ },
561
+ async getSelectShequValue(sqvalue,sqlable) {
562
+ this.areaData.sqvalue = sqvalue
563
+ this.data.areaData = this.areaData
564
+ console.log("这是父级接收的社区值:",sqvalue,sqlable)
565
+
566
+ // 是否禁用按钮
567
+ this.disableButton()
568
+ },
569
+ //初始化省市区,添加街道
570
+ async initpcds(pconditon) {
571
+ // console.log('initpcds', pconditon)
572
+ // this.pcdslist = []
573
+ // let HttpReset = new HttpResetClass()
574
+ // let req = await HttpReset.load('POST', 'rs/sql/address_singleTableOrderBy?pageNo=1&pageSize=9999999', {
575
+ // data: {
576
+ // items: '*',
577
+ // tablename: 'j_bjqpcd',
578
+ // orderitem: 'id',
579
+ // condition: pconditon
580
+ // }
581
+ // }, {resolveMsg: null, rejectMsg: '获取地址失败!'})
582
+ // let redata = []
583
+ // req.data.forEach((row, n) => {
584
+ // redata[n] = {
585
+ // label: row.j_areaname,
586
+ // value: row.j_areaid,
587
+ // data: row,
588
+ // id: row.id
589
+ // }
590
+ // })
591
+ // console.log('市区', redata)
592
+ // this.pcdslist = redata
593
+ },
594
+ //初始化街道 添加小区
595
+ async initstreets(pconditon) {
596
+ // console.log('市区32', pconditon)
597
+ // this.streetslist = []
598
+ // let HttpReset = new HttpResetClass()
599
+ // let req = await HttpReset.load('POST', 'rs/sql/address_singleTableOrderBy', {
600
+ // data: {
601
+ // items: '*',
602
+ // tablename: 'j_bjqstreet',
603
+ // orderitem: 'id',
604
+ // condition: pconditon
605
+ // }
606
+ // }, {resolveMsg: null, rejectMsg: '获取地址失败!'})
607
+ // let redata = []
608
+ // req.data.forEach((row, n) => {
609
+ // redata[n] = {
610
+ // label: row.j_areaname,
611
+ // value: row.j_areaid,
612
+ // data: row,
613
+ // id: row.id
614
+ // }
615
+ // })
616
+ // console.log('市区333', redata)
617
+ // this.streetslist = redata
618
+ // this.model.f_iscity = this.findbyid(this.streetslist, this.model.f_street_id).f_iscity
619
+ },
620
+ //初始化小区添加小区
621
+ async initareas(pconditon) {
622
+ // if(this.usertype){
623
+ // pconditon=pconditon+` and f_special='1' `
624
+ // }
625
+ // this.areaslist = []
626
+ // let HttpReset = new HttpResetClass()
627
+ // let req = await HttpReset.load('POST', 'rs/sql/address_singleTableOrderBy?pageNo=1&pageSize=100', {
628
+ // data: {
629
+ // items: '*',
630
+ // tablename: 'j_bjqarea',
631
+ // orderitem: 'id',
632
+ // condition: pconditon
633
+ // }
634
+ // }, {resolveMsg: null, rejectMsg: '获取地址失败!'})
635
+ // let redata = []
636
+ // req.data.forEach((row) => {
637
+ // redata.push({
638
+ // label: row.j_areaname,
639
+ // value: row.j_areaid,
640
+ // data: row,
641
+ // id: row.id
642
+ // })
643
+ // })
644
+ // console.log('市区666', redata)
645
+ // if (redata.length>0){
646
+ // this.areaslist = redata
647
+ // }
648
+ },
649
+ //省/市/区变化
650
+ async pcdChange(val) {
651
+
652
+ // console.log("省/市/区变化", val)
653
+ // console.log("省/市/区变化", ` f_pcd_id ='${val}' `)
654
+ // if (val) {
655
+ // //那就把[小区,街道]重新组织一下
656
+ // await this.initstreets(` j_parentid ='${val}' `)
657
+ // if (this.model.f_street_id) {
658
+ // if (this.findbyid(this.streetslist, this.model.f_street_id)) {
659
+ // let pcd_id = this.findbyid(this.streetslist, this.model.f_street_id).f_pcd_id
660
+ // if (pcd_id != val) {
661
+ // this.model.f_street_id = ''
662
+ // }
663
+ // } else {
664
+ // this.model.f_street_id = ''
665
+ // }
666
+ //
667
+ // //那就把[小区,街道]重新组织一下
668
+ // if (this.model.f_street_id) {
669
+ // await this.initareas(` j_parentid ='${this.model.f_street_id}' `)
670
+ // if (this.model.f_residential_area_id) {
671
+ // if (this.findbyid(this.areaslist, this.model.f_residential_area_id)) {
672
+ // let pcd_id = this.findbyid(this.areaslist, this.model.f_residential_area_id).f_pcd_id
673
+ // if (pcd_id != val) {
674
+ // this.model.f_residential_area_id = ''
675
+ // }
676
+ // } else {
677
+ // this.model.f_residential_area_id = ''
678
+ // }
679
+ //
680
+ // }
681
+ // }
682
+ // }
683
+ // }
684
+ // this.$resetValidation()
685
+ },
686
+ //街道变化
687
+ async streetChange(val) {
688
+ // console.log("街道变化", val)
689
+ // if (this.streetslist[0]) {
690
+ // var street = ''
691
+ // this.streetslist.forEach((item) => {
692
+ // if (item.id === val) {
693
+ // street = item.label
694
+ // }
695
+ // })
696
+ // this.model.f_address = street
697
+ // }
698
+ // if (val) {
699
+ // //那就把[小区]重新组织一下
700
+ // await this.initareas(` j_parentid ='${val}' `)
701
+ // if (this.model.f_residential_area_id) {
702
+ // if (this.findbyid(this.areaslist, this.model.f_residential_area_id)) {
703
+ // let street_id = this.findbyid(this.areaslist, this.model.f_residential_area_id).f_street_id
704
+ // if (street_id != val) {
705
+ // this.model.f_residential_area_id = ''
706
+ // }
707
+ // } else {
708
+ // this.model.f_residential_area_id = ''
709
+ // }
710
+ //
711
+ // }
712
+ // }
713
+ // this.$resetValidation()
714
+ },
715
+ // 是否禁用按钮
716
+ disableButton () {
717
+ let flag = false
718
+ for (const field of this.data.fields) {
719
+ if (field.required && !field.value && !field.hidden && field.value !== 0) {
720
+ flag = true
721
+ }
722
+
723
+ // 任何选择框只要是否都不能提交
724
+ if (field.type === 'select' && field.value === '否' && field.value_no_disable) {
725
+ flag = true
726
+ }
727
+
728
+ if (field.type === 'checkbox' && field.required && field.value.length === 0) {
729
+ flag = true
730
+ }
731
+ }
732
+
733
+ //区域下拉框必选 流程模式为报警器报建
734
+ if ((this.data.f_apply_type === '报警器报建' || this.data.f_apply_type === '工商业报警器报建') && this.data.defname === '工程施工' && this.data.title === '工程施工' && this.data.f_sub_state !='完工'){
735
+ if (!flag){
736
+ if (this.areaData.sjvalue ==null || this.areaData.sjvalue.length ==0 || this.areaData.sqvalue == null || this.areaData.sqvalue.length ==0
737
+ || this.areaData.xianvalue == null || this.areaData.xianvalue.length == 0){
738
+ console.log("区域为空禁止提交:",this.areaData)
739
+ flag = true
740
+ }
741
+
742
+ if (this.templatlng.baidutemplat ==null || this.templatlng.baidutemplat.length ==0 || this.templatlng.baidutemplng == null || this.templatlng.baidutemplng.length ==0
743
+ || this.templatlng.gaodetemplat == null || this.templatlng.gaodetemplat.length == 0 || this.templatlng.gaodetemplng == null || this.templatlng.gaodetemplng.length == 0){
744
+ console.log("地图坐标为空禁止提交:",this.templatlng)
745
+ flag = true
746
+ }
747
+ }
748
+ }
749
+ this.disable_button = flag
750
+ },
751
+ // 失去焦点且值最终发生变化触发
752
+ async onchange (index) {
753
+ // 是否禁用按钮
754
+ this.disableButton()
755
+
756
+ if (!isEmpty(this.data.fields[index].value)) {
757
+ // 前缀、后缀
758
+ if (this.data.fields[index].prefix) {
759
+ this.data.fields[index].value = this.data.fields[index].prefix + this.data.fields[index].value
760
+ }
761
+ if (this.data.fields[index].suffix) {
762
+ this.data.fields[index].value = this.data.fields[index].value + this.data.fields[index].suffix
763
+ }
764
+ }
765
+
766
+ // data赋值
767
+ this.data[this.data.fields[index].field] = this.data.fields[index].value
768
+
769
+ if (this.data.fields[index].type === 'datepicker') {
770
+ this.check_datepicker(index)
771
+ }
772
+
773
+ if (this.data.fields[index].onchange) {
774
+ this.$dispatch(this.data.fields[index].onchange, index)
775
+ }
776
+ this.$dispatch('onchange', index)
777
+ },
778
+ // 失去焦点触发,无论值是否发生变化
779
+ onblur (index) {
780
+ this.disableButton()
781
+
782
+ if (this.data.fields[index].onblur) {
783
+ this.$dispatch(this.data.fields[index].onblur, index)
784
+ }
785
+
786
+ this.$dispatch('onblur', index)
787
+ },
788
+ oninput (index) {
789
+ // 是否禁用按钮
790
+ this.disableButton()
791
+
792
+ if (this.data.fields[index].oninput) {
793
+ this.$dispatch(this.data.fields[index].oninput, index)
794
+ }
795
+ this.$dispatch('oninput', index)
796
+ },
797
+ selectSearch(event, index) {
798
+ if (this.data.fields[index].selectSearch) {
799
+ this.$dispatch(this.data.fields[index].selectSearch, event[0], index)
800
+ }
801
+ this.$dispatch('selectSearch', event[0], index)
802
+ },
803
+ // 点击按钮组按钮
804
+ async click_but (button) {
805
+ //报警器区域地址
806
+ this.data.areaData = this.areaData
807
+ this.data.templatlng = this.templatlng
808
+
809
+ this.disable_button = true
810
+
811
+ this.data.fields.forEach(item => {
812
+ this.data[item.field] = item.value
813
+ })
814
+
815
+ this.data.button = button
816
+
817
+ if (button.button_fields && button.button_fields.length > 0) {
818
+ this.showButModal = true
819
+ return
820
+ }
821
+
822
+ if (this.data.button.event) {
823
+ this.$dispatch(this.data.button.event)
824
+ } else {
825
+ this.$dispatch('button')
826
+ }
827
+
828
+ },
829
+ confirmModal () {
830
+ this.closeModal()
831
+
832
+ this.data.button.button_fields.forEach(item => {
833
+ this.data.button[item.field] = item.value
834
+ })
835
+
836
+ if (this.data.button.event) {
837
+ this.$dispatch(this.data.button.event)
838
+ } else {
839
+ this.$dispatch('button')
840
+ }
841
+ },
842
+ // 关闭模态框
843
+ closeModal () {
844
+ this.showButModal = false
845
+ this.disable_modal_button = false
846
+ },
847
+ onbutchange (index) {
848
+ // 是否禁用按钮
849
+ this.disableModalButton()
850
+
851
+ if (this.data.button.button_fields[index].onchange) {
852
+ this.$dispatch(this.data.button.button_fields[index].onchange, index)
853
+ } else {
854
+ this.$dispatch('onbutchange', index)
855
+ }
856
+
857
+ },
858
+ onbutblur (index) {
859
+ this.disableModalButton()
860
+
861
+ if (this.data.button.button_fields[index].onblur) {
862
+ this.$dispatch(this.data.button.button_fields[index].onblur, index)
863
+ } else {
864
+ this.$dispatch('onbutblur', index)
865
+ }
866
+ },
867
+ onbutinput (index) {
868
+ // 是否禁用按钮
869
+ this.disableModalButton()
870
+
871
+ if (this.data.button.button_fields[index].oninput) {
872
+ this.$dispatch(this.data.button.button_fields[index].oninput, index)
873
+ } else {
874
+ this.$dispatch('onbutinput', index)
875
+ }
876
+ },
877
+ disableModalButton () {
878
+ let flag = false
879
+
880
+
881
+ for (const item of this.data.button.button_fields) {
882
+ if (item.required && !item.value) {
883
+ if (item.value === 0) {
884
+ flag = false
885
+ } else {
886
+ flag = true
887
+ }
888
+ }
889
+ }
890
+
891
+ this.disable_modal_button = flag
892
+ },
893
+ check_datepicker (index) {
894
+ // 时间格式检测
895
+ if (!isEmpty(this.data.fields[index].value)) {
896
+
897
+ let dateReg = /^[1-9]\d{3}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])$/
898
+ let timeReg = /^(20|21|22|23|[0-1]\d):[0-5]\d:[0-5]\d$/
899
+ let datetimeReg = /^[1-9]\d{3}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])\s+(20|21|22|23|[0-1]\d):[0-5]\d:[0-5]\d$/
900
+ if (this.data.fields[index].format) {
901
+ if (this.data.fields[index].format === 'yyyy-MM-dd') {
902
+ if (!dateReg.test(this.data.fields[index].value)) {
903
+ this.data.fields[index].value = ''
904
+ this.$showAlert(this.data.fields[index].label + '格式错误如:2021-01-01', 'warning', 2000)
905
+ }
906
+ }
907
+ if (this.data.fields[index].format === 'HH:mm:ss') {
908
+ if (!timeReg.test(this.data.fields[index].value)) {
909
+ this.data.fields[index].value = ''
910
+ this.$showAlert(this.data.fields[index].label + '格式错误如:00:00:00', 'warning', 2000)
911
+ }
912
+ }
913
+ if (this.data.fields[index].format === 'yyyy-MM-dd HH:mm:ss') {
914
+ if (!datetimeReg.test(this.data.fields[index].value)) {
915
+ this.data.fields[index].value = ''
916
+ this.$showAlert(this.data.fields[index].label + '格式错误如:2021-01-01 00:00:00', 'warning', 2000)
917
+ }
918
+ }
919
+ } else {
920
+ if (!dateReg.test(this.data.fields[index].value)) {
921
+ this.data.fields[index].value = ''
922
+ this.$showAlert(this.data.fields[index].label + '格式错误如:2021-01-01', 'warning', 2000)
923
+ }
924
+ }
925
+ }
926
+ }
927
+ },
928
+ events: {
929
+
930
+ }
931
+ }
932
+ </script>
933
+ <style>
934
+ .datepicker{
935
+ width: 100%!important;
936
+ }
937
+ .datepicker-input{
938
+ background-color: #ffffff!important;
939
+ width: 100%!important;
940
+ }
941
+ .datepicker-input:disabled{
942
+ border: 1px solid #DDD!important;
943
+ color: #ACA899!important;
944
+ width: 100%!important;
945
+ }
946
+ </style>
947
+ <style scoped>
948
+ th{
949
+ font-size: 15px !important;
950
+ text-align: center !important;
951
+ background-color: #dfedfb!important;
952
+ color: #666666 !important;
953
+ font-family: PINGFANG-BOLD !important;
954
+ font-weight: normal!important;
955
+ }
956
+ /*清除model中的浮动*/
957
+ .clearfix:after,.clearfix:before{
958
+ display: table;
959
+ }
960
+ .clearfix:after{
961
+ clear: both;
962
+ }
963
+
964
+ .input_view{
965
+ padding: 8px;
966
+ background-color: #ffffff;
967
+ border-radius: 2px;
968
+ border: solid 1px #c7c7c7!important;
969
+ color: #333333!important;
970
+ font-size: 15px!important;
971
+ }
972
+
973
+ .input_view[readonly]{
974
+ border: 1px solid #DDD!important;
975
+ color:#ACA899!important;
976
+ }
977
+ .input_view:disabled{
978
+ border: 1px solid #DDD!important;
979
+ color:#ACA899!important;
980
+ }
981
+
982
+ .control-label-justify {
983
+ display: inline-block;
984
+ vertical-align: top;
985
+ width: 150px;
986
+ text-align: justify;
987
+ font-family: PingFang-SC-Bold;
988
+ }
989
+
990
+ .control-label-justify::after {
991
+ content: "";
992
+ display: inline-block;
993
+ width: 100%;
994
+ overflow: hidden;
995
+ height: 0;
996
+ }
997
+
998
+ input::-webkit-outer-spin-button,
999
+ input::-webkit-inner-spin-button {
1000
+ -webkit-appearance: none;
1001
+ }
1002
+
1003
+ input[type="number"] {
1004
+ -moz-appearance: textfield;
1005
+ }
1006
+
1007
+ </style>