apply-clients 3.5.5-5 → 3.5.5-7

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 (61) hide show
  1. package/build/dev-server.js +9 -5
  2. package/package.json +1 -1
  3. package/src/App.vue +25 -25
  4. package/src/apply.js +141 -141
  5. package/src/components/android/AppTakePic.vue +182 -182
  6. package/src/components/product/Function/Service/FunctionServiceControl.vue +497 -497
  7. package/src/components/product/Material/MaterialDetailed.vue +268 -268
  8. package/src/components/product/MaterialsManage/MaterialsBase.vue +181 -181
  9. package/src/components/product/MaterialsManage/MaterialsManage.vue +60 -60
  10. package/src/components/product/Process/Processes/contractModel.vue +454 -458
  11. package/src/components/product/ServiceView.vue +1028 -1028
  12. package/src/components/product/Supervisory/SupervisoryList.vue +452 -452
  13. package/src/filiale/dingcheng/pc/SupervisoryList.vue +441 -441
  14. package/src/filiale/fugou/android/AppAddMaterialScience.vue +440 -440
  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 -1836
  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/devicesManagement.vue +483 -483
  24. package/src/filiale/fugou/pc/printChargepc.vue +148 -148
  25. package/src/filiale/gongyi/android/AppAddMaterialScience.vue +493 -493
  26. package/src/filiale/gongyi/android/AppDisclosurerecord.vue +214 -214
  27. package/src/filiale/gongyi/android/AppInstallationDetails.vue +500 -500
  28. package/src/filiale/gongyi/android/AppLegacyIssues.vue +309 -309
  29. package/src/filiale/gongyi/android/AppSign.vue +170 -170
  30. package/src/filiale/gongyi/android/AppSupplementalAgreement.vue +298 -298
  31. package/src/filiale/gongyi/android.js +18 -18
  32. package/src/filiale/gongyi/pc/ApplyUpload.vue +371 -371
  33. package/src/filiale/gongyi/pc/PcAddLogs.vue +221 -221
  34. package/src/filiale/gongyi/pc/PcDisclosurerecord.vue +218 -218
  35. package/src/filiale/gongyi/pc/PcLegacyIssues.vue +309 -309
  36. package/src/filiale/gongyi/pc/SupervisoryServiceControl.vue +894 -894
  37. package/src/filiale/gongyi/pc/SupervisoryServiceView.vue +1005 -1005
  38. package/src/filiale/gongyi/pc/addMaterialScience.vue +575 -575
  39. package/src/filiale/gongyi/pc/chargeManagement.vue +765 -765
  40. package/src/filiale/gongyi/pc/supplementalAgreement.vue +277 -277
  41. package/src/filiale/gongyi/pc.js +24 -24
  42. package/src/filiale/hongda/pc/SupervisoryList.vue +422 -422
  43. package/src/filiale/jingyang/pc/SupervisoryList.vue +459 -459
  44. package/src/filiale/qianneng/android/AppChargeManagement.vue +686 -686
  45. package/src/filiale/qianneng/android.js +15 -15
  46. package/src/filiale/qianneng/pc/ApplyMaterialDetailed.vue +261 -261
  47. package/src/filiale/qianneng/pc/InstallFunction.vue +188 -188
  48. package/src/filiale/qianneng/pc.js +29 -29
  49. package/src/filiale/ruihua/pc/ServiceControl.vue +1966 -1966
  50. package/src/filiale/yangchunboneng/android/AppChargeManagement.vue +520 -520
  51. package/src/filiale/yangchunboneng/android/AppDevicesManagement.vue +645 -645
  52. package/src/filiale/yangchunboneng/android/AppServiceControl.vue +1703 -1703
  53. package/src/filiale/yangchunboneng/pc/ExplorationSelect.vue +547 -547
  54. package/src/filiale/yangchunboneng/pc/ServiceControl.vue +2112 -2112
  55. package/src/filiale/yangchunboneng/pc/ServiceView.vue +1007 -1007
  56. package/src/filiale/yangchunboneng/pc/SupervisoryList.vue +605 -605
  57. package/src/filiale/yangchunboneng/pc/SupervisoryListNew.vue +683 -683
  58. package/src/filiale/yangchunboneng/pc/chargeManagement.vue +1053 -1053
  59. package/src/filiale/yangchunboneng/pc/devicesManagement.vue +574 -574
  60. package/src/main.js +3 -3
  61. package/~/chatbot/main.py +57 -0
@@ -1,1005 +1,1005 @@
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="1"></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
-
336
- <!-- 按钮模态框 -->
337
- <modal v-if="showButModal" :show.sync="showButModal" backdrop="false" large>
338
- <header slot="modal-header" class="modal-header">
339
- <button type="button" class="close" @click="closeModal()"><span>&times;</span></button>
340
- <span class="modal-title"><font
341
- size="3">{{data.button.button_name}}</font></span>
342
- </header>
343
- <article slot="modal-body" class="modal-body clearfix">
344
- <div class="form-group" style="padding: 0 150px">
345
- <div v-for="(index,item) in data.button.button_fields">
346
- <div :style="item.style ? item.style : ''" :class="[item.required && !(item.value) ? 'has-error' : '', item.bootstraped ? item.bootstraped + ' form-group' : 'form-group']"
347
- v-if="(item.type==='input' || item.type==='number'||item.type === 'tel'||item.type === 'email') && !item.hidden && (item.device === 'pc' || !item.device)">
348
- <label :style="item.label_style ? item.label_style : ''"
349
- :class="item.label_bootstraped ? item.label_bootstraped + ' control-label-justify control-label' : 'control-label-justify control-label col-sm-6'">{{item.label}}</label>
350
- <div :style="item.value_style ? item.value_style : ''"
351
- :class="item.value_bootstraped ? item.value_bootstraped : 'col-sm-9'">
352
- <input class="form-control input_view"
353
- :placeholder="item.placeholder"
354
- :type="item.type"
355
- v-model="item.value"
356
- :value="item.value"
357
- :readonly="item.readonly"
358
- :disabled="item.disabled"
359
- @change="onbutchange(index)"
360
- @blur="onbutblur(index)"
361
- @input="onbutinput(index)"
362
- />
363
- </div>
364
- </div>
365
-
366
- <!--时间datepicker-->
367
- <div :style="item.style ? item.style : ''" :class="[item.required && !(item.value) ? 'has-error' : '', item.bootstraped ? item.bootstraped + ' form-group':'form-group']"
368
- v-if="item.type==='datepicker' && !item.hidden && (item.device === 'pc' || !item.device)">
369
- <label :style="item.label_style ? item.label_style : ''"
370
- :class="item.label_bootstraped ? item.label_bootstraped + ' control-label-justify control-label' : 'control-label-justify control-label col-sm-6'">{{item.label}}</label>
371
- <div :style="item.value_style ? item.value_style : ''"
372
- :class="item.value_bootstraped ? item.value_bootstraped : 'col-sm-9'">
373
- <datepicker
374
- :placeholder="item.placeholder"
375
- :value.sync="item.value"
376
- v-model="item.value"
377
- :readonly="item.readonly"
378
- :disabled="item.disabled"
379
- :format="item.format ? item.format : 'yyyy-MM-dd'"
380
- :show-reset-button="true"
381
- @change="onbutchange(index)"
382
- @blur="onbutblur(index)"
383
- ></datepicker>
384
- </div>
385
- </div>
386
-
387
- <!--select-->
388
- <div :style="item.style ? item.style : ''" :class="[item.required && !(item.value) ? 'has-error' : '', item.bootstraped ? item.bootstraped + ' form-group':'form-group']"
389
- v-if="item.type==='select' && !item.hidden && (item.device === 'pc' || !item.device)">
390
- <label :style="item.label_style ? item.label_style : ''"
391
- :class="item.label_bootstraped ? item.label_bootstraped + ' control-label-justify control-label' : 'control-label-justify control-label col-sm-6'">{{item.label}}</label>
392
- <div :style="item.value_style ? item.value_style : ''"
393
- :class="item.value_bootstraped ? item.value_bootstraped : 'col-sm-9'">
394
- <input-select
395
- class="select select_list"
396
- :value.sync="item.value"
397
- v-model="item.value"
398
- :options='item.options'
399
- :readonly="item.readonly"
400
- :disable="item.disabled"
401
- :valueSingle="true"
402
- @blur="onbutblur(index)"
403
- @change="onbutchange(index)"
404
- ></input-select>
405
- </div>
406
- </div>
407
-
408
- <!--textarea-->
409
- <div :style="item.style ? item.style : ''" :class="[item.required && !(item.value) ? 'has-error' : '', item.bootstraped ? item.bootstraped + ' form-group':'form-group']"
410
- v-if="item.type==='textarea' && !item.hidden && (item.device === 'pc' || !item.device)">
411
- <label :style="item.label_style ? item.label_style : ''"
412
- :class="item.label_bootstraped ? item.label_bootstraped + ' control-label-justify control-label' : 'control-label-justify control-label col-sm-6'">{{item.label}}</label>
413
- <div :style="item.value_style ? item.value_style : ''"
414
- :class="item.value_bootstraped ? item.value_bootstraped : 'col-sm-9'">
415
- <textarea
416
- class="form-control input_view"
417
- style="width: 100%;height: 100%"
418
- v-model="item.value"
419
- :value="item.value"
420
- :rows="item.rows"
421
- :readonly="item.readonly"
422
- :disabled="item.disabled"
423
- @change="onbutchange(index)"
424
- @blur="onbutblur(index)"
425
- @input="onbutinput(index)"
426
- ></textarea>
427
- </div>
428
- </div>
429
- </div>
430
- </div>
431
- </article>
432
- <footer slot="modal-footer" class="modal-footer">
433
- <button :class="disable_modal_button ? 'btn btn-default':'btn btn-primary'"
434
- :disabled="disable_modal_button" type="button" @click="confirmModal()">
435
- 确认
436
- </button>
437
- </footer>
438
- </modal>
439
- </form>
440
- </div>
441
- </template>
442
- <script>
443
- import Vue from 'vue'
444
- import {isEmpty} from "../../../components/Util";
445
- import {HttpResetClass} from 'vue-client'
446
- // Date格式化
447
- Date.prototype.Format = function (fmt) {
448
- var o = {
449
- 'M+': this.getMonth() + 1, // 月份
450
- 'd+': this.getDate(), // 日
451
- 'H+': this.getHours(), // 小时
452
- 'm+': this.getMinutes(), // 分
453
- 's+': this.getSeconds(), // 秒
454
- 'q+': Math.floor((this.getMonth() + 3) / 3), // 季度
455
- 'S': this.getMilliseconds() // 毫秒
456
- }
457
- if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (this.getFullYear() + '').substr(4 - RegExp.$1.length))
458
- for (var k in o) {
459
- if (new RegExp('(' + k + ')').test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length === 1) ? (o[k]) : (('00' + o[k]).substr(('' + o[k]).length)))
460
- }
461
- return fmt
462
- }
463
-
464
- export default {
465
- title: '报建业务通用组件',
466
- props: {
467
- data: {
468
- type: Object
469
- }
470
- },
471
- data () {
472
- return {
473
- model: {}, // 公司等属性
474
- disable_button: true, // 控制按钮禁用
475
- disable_modal_button: true, // 控制按钮禁用
476
- //初始化省市区数据
477
- pcdslist: [],
478
- //初始化街道数据
479
- streetslist: [],
480
- //初始化街道数据
481
- areaslist: [],
482
- showButModal: false,
483
- areaData:{
484
- sjvalue:'',
485
- xianvalue:'',
486
- sqvalue:'',
487
- },
488
- templatlng: {
489
- gaodetemplng: "",
490
- gaodetemplat: "",
491
- baidutemplng: "",
492
- baidutemplat: ""
493
- }
494
- }
495
- },
496
- watch: {
497
- deep: true
498
- },
499
- computed: {
500
-
501
- },
502
- created () {
503
- // 初始化数据
504
- this.initializtion()
505
- if (this.data.readyEvent) {
506
- this.$dispatch(this.data.readyEvent)
507
- }
508
- this.$dispatch('initializtionView')
509
- },
510
- methods: {
511
- // 初始化数据
512
- initializtion () {
513
- for (const item of this.data.fields) {
514
- this.data[item.field] = item.value
515
- }
516
-
517
- // 是否禁用按钮
518
- this.disableButton()
519
- // 公司等属性初始化
520
- if (this.data.orgs) {
521
- this.model.orgs = this.data.orgs
522
- } else {
523
- this.model.orgs = this.$login.f.orgs
524
- }
525
- if (this.data.parentname) {
526
- this.model.parentname = this.data.parentname
527
- } else {
528
- this.model.parentname = this.$login.f.f_department_name
529
- }
530
- if (this.data.operate_date) {
531
- this.model.operate_date = this.data.operate_date
532
- } else {
533
- this.model.operate_date = new Date().Format('yyyy-MM-dd')
534
- }
535
- if (this.data.operator) {
536
- this.model.operator = this.data.operator
537
- } else {
538
- this.model.operator = this.$login.f.name
539
- }
540
-
541
- this.initpcds(` j_orgid = '${this.$login.f.orgid}'`)
542
- },
543
- async getSelectShijiValue(sjvalue,sjlable) {
544
- this.areaData.sjvalue = sjvalue
545
- console.log("这是父级接收的市级值:",sjvalue,sjlable)
546
- this.data.areaData = this.areaData
547
-
548
- // 是否禁用按钮
549
- this.disableButton()
550
- },
551
- async getSelectXianValue(xianvalue,xianlable) {
552
- this.areaData.xianvalue = xianvalue
553
- this.data.areaData = this.areaData
554
- console.log("这是父级接收的县级值:",xianvalue,xianlable)
555
-
556
- // 是否禁用按钮
557
- this.disableButton()
558
- },
559
- async getSelectShequValue(sqvalue,sqlable) {
560
- this.areaData.sqvalue = sqvalue
561
- this.data.areaData = this.areaData
562
- console.log("这是父级接收的社区值:",sqvalue,sqlable)
563
-
564
- // 是否禁用按钮
565
- this.disableButton()
566
- },
567
- //初始化省市区,添加街道
568
- async initpcds(pconditon) {
569
- // console.log('initpcds', pconditon)
570
- // this.pcdslist = []
571
- // let HttpReset = new HttpResetClass()
572
- // let req = await HttpReset.load('POST', 'rs/sql/address_singleTableOrderBy?pageNo=1&pageSize=9999999', {
573
- // data: {
574
- // items: '*',
575
- // tablename: 'j_bjqpcd',
576
- // orderitem: 'id',
577
- // condition: pconditon
578
- // }
579
- // }, {resolveMsg: null, rejectMsg: '获取地址失败!'})
580
- // let redata = []
581
- // req.data.forEach((row, n) => {
582
- // redata[n] = {
583
- // label: row.j_areaname,
584
- // value: row.j_areaid,
585
- // data: row,
586
- // id: row.id
587
- // }
588
- // })
589
- // console.log('市区', redata)
590
- // this.pcdslist = redata
591
- },
592
- //初始化街道 添加小区
593
- async initstreets(pconditon) {
594
- // console.log('市区32', pconditon)
595
- // this.streetslist = []
596
- // let HttpReset = new HttpResetClass()
597
- // let req = await HttpReset.load('POST', 'rs/sql/address_singleTableOrderBy', {
598
- // data: {
599
- // items: '*',
600
- // tablename: 'j_bjqstreet',
601
- // orderitem: 'id',
602
- // condition: pconditon
603
- // }
604
- // }, {resolveMsg: null, rejectMsg: '获取地址失败!'})
605
- // let redata = []
606
- // req.data.forEach((row, n) => {
607
- // redata[n] = {
608
- // label: row.j_areaname,
609
- // value: row.j_areaid,
610
- // data: row,
611
- // id: row.id
612
- // }
613
- // })
614
- // console.log('市区333', redata)
615
- // this.streetslist = redata
616
- // this.model.f_iscity = this.findbyid(this.streetslist, this.model.f_street_id).f_iscity
617
- },
618
- //初始化小区添加小区
619
- async initareas(pconditon) {
620
- // if(this.usertype){
621
- // pconditon=pconditon+` and f_special='1' `
622
- // }
623
- // this.areaslist = []
624
- // let HttpReset = new HttpResetClass()
625
- // let req = await HttpReset.load('POST', 'rs/sql/address_singleTableOrderBy?pageNo=1&pageSize=100', {
626
- // data: {
627
- // items: '*',
628
- // tablename: 'j_bjqarea',
629
- // orderitem: 'id',
630
- // condition: pconditon
631
- // }
632
- // }, {resolveMsg: null, rejectMsg: '获取地址失败!'})
633
- // let redata = []
634
- // req.data.forEach((row) => {
635
- // redata.push({
636
- // label: row.j_areaname,
637
- // value: row.j_areaid,
638
- // data: row,
639
- // id: row.id
640
- // })
641
- // })
642
- // console.log('市区666', redata)
643
- // if (redata.length>0){
644
- // this.areaslist = redata
645
- // }
646
- },
647
- //省/市/区变化
648
- async pcdChange(val) {
649
-
650
- // console.log("省/市/区变化", val)
651
- // console.log("省/市/区变化", ` f_pcd_id ='${val}' `)
652
- // if (val) {
653
- // //那就把[小区,街道]重新组织一下
654
- // await this.initstreets(` j_parentid ='${val}' `)
655
- // if (this.model.f_street_id) {
656
- // if (this.findbyid(this.streetslist, this.model.f_street_id)) {
657
- // let pcd_id = this.findbyid(this.streetslist, this.model.f_street_id).f_pcd_id
658
- // if (pcd_id != val) {
659
- // this.model.f_street_id = ''
660
- // }
661
- // } else {
662
- // this.model.f_street_id = ''
663
- // }
664
- //
665
- // //那就把[小区,街道]重新组织一下
666
- // if (this.model.f_street_id) {
667
- // await this.initareas(` j_parentid ='${this.model.f_street_id}' `)
668
- // if (this.model.f_residential_area_id) {
669
- // if (this.findbyid(this.areaslist, this.model.f_residential_area_id)) {
670
- // let pcd_id = this.findbyid(this.areaslist, this.model.f_residential_area_id).f_pcd_id
671
- // if (pcd_id != val) {
672
- // this.model.f_residential_area_id = ''
673
- // }
674
- // } else {
675
- // this.model.f_residential_area_id = ''
676
- // }
677
- //
678
- // }
679
- // }
680
- // }
681
- // }
682
- // this.$resetValidation()
683
- },
684
- //街道变化
685
- async streetChange(val) {
686
- // console.log("街道变化", val)
687
- // if (this.streetslist[0]) {
688
- // var street = ''
689
- // this.streetslist.forEach((item) => {
690
- // if (item.id === val) {
691
- // street = item.label
692
- // }
693
- // })
694
- // this.model.f_address = street
695
- // }
696
- // if (val) {
697
- // //那就把[小区]重新组织一下
698
- // await this.initareas(` j_parentid ='${val}' `)
699
- // if (this.model.f_residential_area_id) {
700
- // if (this.findbyid(this.areaslist, this.model.f_residential_area_id)) {
701
- // let street_id = this.findbyid(this.areaslist, this.model.f_residential_area_id).f_street_id
702
- // if (street_id != val) {
703
- // this.model.f_residential_area_id = ''
704
- // }
705
- // } else {
706
- // this.model.f_residential_area_id = ''
707
- // }
708
- //
709
- // }
710
- // }
711
- // this.$resetValidation()
712
- },
713
- // 是否禁用按钮
714
- disableButton () {
715
- let flag = false
716
- for (const field of this.data.fields) {
717
- if (field.required && !field.value && !field.hidden && field.value !== 0) {
718
- flag = true
719
- }
720
-
721
- // 任何选择框只要是否都不能提交
722
- if (field.type === 'select' && field.value === '否' && field.value_no_disable) {
723
- flag = true
724
- }
725
-
726
- if (field.type === 'checkbox' && field.required && field.value.length === 0) {
727
- flag = true
728
- }
729
- }
730
-
731
- //区域下拉框必选 流程模式为报警器报建
732
- if ((this.data.f_apply_type === '报警器报建' || this.data.f_apply_type === '工商业报警器报建') && this.data.defname === '工程施工' && this.data.title === '工程施工' && this.data.f_sub_state !='完工'){
733
- if (!flag){
734
- if (this.areaData.sjvalue ==null || this.areaData.sjvalue.length ==0 || this.areaData.sqvalue == null || this.areaData.sqvalue.length ==0
735
- || this.areaData.xianvalue == null || this.areaData.xianvalue.length == 0){
736
- console.log("区域为空禁止提交:",this.areaData)
737
- flag = true
738
- }
739
-
740
- if (this.templatlng.baidutemplat ==null || this.templatlng.baidutemplat.length ==0 || this.templatlng.baidutemplng == null || this.templatlng.baidutemplng.length ==0
741
- || this.templatlng.gaodetemplat == null || this.templatlng.gaodetemplat.length == 0 || this.templatlng.gaodetemplng == null || this.templatlng.gaodetemplng.length == 0){
742
- console.log("地图坐标为空禁止提交:",this.templatlng)
743
- flag = true
744
- }
745
- }
746
- }
747
- this.disable_button = flag
748
- },
749
- // 失去焦点且值最终发生变化触发
750
- async onchange (index) {
751
- // 是否禁用按钮
752
- this.disableButton()
753
-
754
- if (!isEmpty(this.data.fields[index].value)) {
755
- // 前缀、后缀
756
- if (this.data.fields[index].prefix) {
757
- this.data.fields[index].value = this.data.fields[index].prefix + this.data.fields[index].value
758
- }
759
- if (this.data.fields[index].suffix) {
760
- this.data.fields[index].value = this.data.fields[index].value + this.data.fields[index].suffix
761
- }
762
- }
763
-
764
- // data赋值
765
- this.data[this.data.fields[index].field] = this.data.fields[index].value
766
-
767
- if (this.data.fields[index].type === 'datepicker') {
768
- this.check_datepicker(index)
769
- }
770
-
771
- if (this.data.fields[index].onchange) {
772
- this.$dispatch(this.data.fields[index].onchange, index)
773
- }
774
- this.$dispatch('onchange', index)
775
- },
776
- // 失去焦点触发,无论值是否发生变化
777
- onblur (index) {
778
- this.disableButton()
779
-
780
- if (this.data.fields[index].onblur) {
781
- this.$dispatch(this.data.fields[index].onblur, index)
782
- }
783
-
784
- this.$dispatch('onblur', index)
785
- },
786
- oninput (index) {
787
- // 是否禁用按钮
788
- this.disableButton()
789
-
790
- if (this.data.fields[index].oninput) {
791
- this.$dispatch(this.data.fields[index].oninput, index)
792
- }
793
- this.$dispatch('oninput', index)
794
- },
795
- selectSearch(event, index) {
796
- if (this.data.fields[index].selectSearch) {
797
- this.$dispatch(this.data.fields[index].selectSearch, event[0], index)
798
- }
799
- this.$dispatch('selectSearch', event[0], index)
800
- },
801
- // 点击按钮组按钮
802
- async click_but (button) {
803
- //报警器区域地址
804
- this.data.areaData = this.areaData
805
- this.data.templatlng = this.templatlng
806
-
807
- this.disable_button = true
808
-
809
- this.data.fields.forEach(item => {
810
- this.data[item.field] = item.value
811
- })
812
-
813
- this.data.button = button
814
-
815
- if (button.button_fields && button.button_fields.length > 0) {
816
- this.showButModal = true
817
- return
818
- }
819
-
820
- if (this.data.button.event) {
821
- this.$dispatch(this.data.button.event)
822
- } else {
823
- this.$dispatch('button')
824
- }
825
-
826
- },
827
- confirmModal () {
828
- this.closeModal()
829
-
830
- this.data.button.button_fields.forEach(item => {
831
- this.data.button[item.field] = item.value
832
- })
833
-
834
- if (this.data.button.event) {
835
- this.$dispatch(this.data.button.event)
836
- } else {
837
- this.$dispatch('button')
838
- }
839
- },
840
- // 关闭模态框
841
- closeModal () {
842
- this.showButModal = false
843
- this.disable_modal_button = false
844
- },
845
- onbutchange (index) {
846
- // 是否禁用按钮
847
- this.disableModalButton()
848
-
849
- if (this.data.button.button_fields[index].onchange) {
850
- this.$dispatch(this.data.button.button_fields[index].onchange, index)
851
- } else {
852
- this.$dispatch('onbutchange', index)
853
- }
854
-
855
- },
856
- onbutblur (index) {
857
- this.disableModalButton()
858
-
859
- if (this.data.button.button_fields[index].onblur) {
860
- this.$dispatch(this.data.button.button_fields[index].onblur, index)
861
- } else {
862
- this.$dispatch('onbutblur', index)
863
- }
864
- },
865
- onbutinput (index) {
866
- // 是否禁用按钮
867
- this.disableModalButton()
868
-
869
- if (this.data.button.button_fields[index].oninput) {
870
- this.$dispatch(this.data.button.button_fields[index].oninput, index)
871
- } else {
872
- this.$dispatch('onbutinput', index)
873
- }
874
- },
875
- disableModalButton () {
876
- let flag = false
877
-
878
-
879
- for (const item of this.data.button.button_fields) {
880
- if (item.required && !item.value) {
881
- if (item.value === 0) {
882
- flag = false
883
- } else {
884
- flag = true
885
- }
886
- }
887
- }
888
-
889
- this.disable_modal_button = flag
890
- },
891
- check_datepicker (index) {
892
- // 时间格式检测
893
- if (!isEmpty(this.data.fields[index].value)) {
894
-
895
- let dateReg = /^[1-9]\d{3}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])$/
896
- let timeReg = /^(20|21|22|23|[0-1]\d):[0-5]\d:[0-5]\d$/
897
- 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$/
898
- if (this.data.fields[index].format) {
899
- if (this.data.fields[index].format === 'yyyy-MM-dd') {
900
- if (!dateReg.test(this.data.fields[index].value)) {
901
- this.data.fields[index].value = ''
902
- this.$showAlert(this.data.fields[index].label + '格式错误如:2021-01-01', 'warning', 2000)
903
- }
904
- }
905
- if (this.data.fields[index].format === 'HH:mm:ss') {
906
- if (!timeReg.test(this.data.fields[index].value)) {
907
- this.data.fields[index].value = ''
908
- this.$showAlert(this.data.fields[index].label + '格式错误如:00:00:00', 'warning', 2000)
909
- }
910
- }
911
- if (this.data.fields[index].format === 'yyyy-MM-dd HH:mm:ss') {
912
- if (!datetimeReg.test(this.data.fields[index].value)) {
913
- this.data.fields[index].value = ''
914
- this.$showAlert(this.data.fields[index].label + '格式错误如:2021-01-01 00:00:00', 'warning', 2000)
915
- }
916
- }
917
- } else {
918
- if (!dateReg.test(this.data.fields[index].value)) {
919
- this.data.fields[index].value = ''
920
- this.$showAlert(this.data.fields[index].label + '格式错误如:2021-01-01', 'warning', 2000)
921
- }
922
- }
923
- }
924
- }
925
- },
926
- events: {
927
-
928
- }
929
- }
930
- </script>
931
- <style>
932
- .datepicker{
933
- width: 100%!important;
934
- }
935
- .datepicker-input{
936
- background-color: #ffffff!important;
937
- width: 100%!important;
938
- }
939
- .datepicker-input:disabled{
940
- border: 1px solid #DDD!important;
941
- color: #ACA899!important;
942
- width: 100%!important;
943
- }
944
- </style>
945
- <style scoped>
946
- th{
947
- font-size: 15px !important;
948
- text-align: center !important;
949
- background-color: #dfedfb!important;
950
- color: #666666 !important;
951
- font-family: PINGFANG-BOLD !important;
952
- font-weight: normal!important;
953
- }
954
- /*清除model中的浮动*/
955
- .clearfix:after,.clearfix:before{
956
- display: table;
957
- }
958
- .clearfix:after{
959
- clear: both;
960
- }
961
-
962
- .input_view{
963
- padding: 8px;
964
- background-color: #ffffff;
965
- border-radius: 2px;
966
- border: solid 1px #c7c7c7!important;
967
- color: #333333!important;
968
- font-size: 15px!important;
969
- }
970
-
971
- .input_view[readonly]{
972
- border: 1px solid #DDD!important;
973
- color:#ACA899!important;
974
- }
975
- .input_view:disabled{
976
- border: 1px solid #DDD!important;
977
- color:#ACA899!important;
978
- }
979
-
980
- .control-label-justify {
981
- display: inline-block;
982
- vertical-align: top;
983
- width: 110px;
984
- text-align: justify;
985
- font-family: PingFang-SC-Bold;
986
- }
987
-
988
- .control-label-justify::after {
989
- content: "";
990
- display: inline-block;
991
- width: 100%;
992
- overflow: hidden;
993
- height: 0;
994
- }
995
-
996
- input::-webkit-outer-spin-button,
997
- input::-webkit-inner-spin-button {
998
- -webkit-appearance: none;
999
- }
1000
-
1001
- input[type="number"] {
1002
- -moz-appearance: textfield;
1003
- }
1004
-
1005
- </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="1"></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
+
336
+ <!-- 按钮模态框 -->
337
+ <modal v-if="showButModal" :show.sync="showButModal" backdrop="false" large>
338
+ <header slot="modal-header" class="modal-header">
339
+ <button type="button" class="close" @click="closeModal()"><span>&times;</span></button>
340
+ <span class="modal-title"><font
341
+ size="3">{{data.button.button_name}}</font></span>
342
+ </header>
343
+ <article slot="modal-body" class="modal-body clearfix">
344
+ <div class="form-group" style="padding: 0 150px">
345
+ <div v-for="(index,item) in data.button.button_fields">
346
+ <div :style="item.style ? item.style : ''" :class="[item.required && !(item.value) ? 'has-error' : '', item.bootstraped ? item.bootstraped + ' form-group' : 'form-group']"
347
+ v-if="(item.type==='input' || item.type==='number'||item.type === 'tel'||item.type === 'email') && !item.hidden && (item.device === 'pc' || !item.device)">
348
+ <label :style="item.label_style ? item.label_style : ''"
349
+ :class="item.label_bootstraped ? item.label_bootstraped + ' control-label-justify control-label' : 'control-label-justify control-label col-sm-6'">{{item.label}}</label>
350
+ <div :style="item.value_style ? item.value_style : ''"
351
+ :class="item.value_bootstraped ? item.value_bootstraped : 'col-sm-9'">
352
+ <input class="form-control input_view"
353
+ :placeholder="item.placeholder"
354
+ :type="item.type"
355
+ v-model="item.value"
356
+ :value="item.value"
357
+ :readonly="item.readonly"
358
+ :disabled="item.disabled"
359
+ @change="onbutchange(index)"
360
+ @blur="onbutblur(index)"
361
+ @input="onbutinput(index)"
362
+ />
363
+ </div>
364
+ </div>
365
+
366
+ <!--时间datepicker-->
367
+ <div :style="item.style ? item.style : ''" :class="[item.required && !(item.value) ? 'has-error' : '', item.bootstraped ? item.bootstraped + ' form-group':'form-group']"
368
+ v-if="item.type==='datepicker' && !item.hidden && (item.device === 'pc' || !item.device)">
369
+ <label :style="item.label_style ? item.label_style : ''"
370
+ :class="item.label_bootstraped ? item.label_bootstraped + ' control-label-justify control-label' : 'control-label-justify control-label col-sm-6'">{{item.label}}</label>
371
+ <div :style="item.value_style ? item.value_style : ''"
372
+ :class="item.value_bootstraped ? item.value_bootstraped : 'col-sm-9'">
373
+ <datepicker
374
+ :placeholder="item.placeholder"
375
+ :value.sync="item.value"
376
+ v-model="item.value"
377
+ :readonly="item.readonly"
378
+ :disabled="item.disabled"
379
+ :format="item.format ? item.format : 'yyyy-MM-dd'"
380
+ :show-reset-button="true"
381
+ @change="onbutchange(index)"
382
+ @blur="onbutblur(index)"
383
+ ></datepicker>
384
+ </div>
385
+ </div>
386
+
387
+ <!--select-->
388
+ <div :style="item.style ? item.style : ''" :class="[item.required && !(item.value) ? 'has-error' : '', item.bootstraped ? item.bootstraped + ' form-group':'form-group']"
389
+ v-if="item.type==='select' && !item.hidden && (item.device === 'pc' || !item.device)">
390
+ <label :style="item.label_style ? item.label_style : ''"
391
+ :class="item.label_bootstraped ? item.label_bootstraped + ' control-label-justify control-label' : 'control-label-justify control-label col-sm-6'">{{item.label}}</label>
392
+ <div :style="item.value_style ? item.value_style : ''"
393
+ :class="item.value_bootstraped ? item.value_bootstraped : 'col-sm-9'">
394
+ <input-select
395
+ class="select select_list"
396
+ :value.sync="item.value"
397
+ v-model="item.value"
398
+ :options='item.options'
399
+ :readonly="item.readonly"
400
+ :disable="item.disabled"
401
+ :valueSingle="true"
402
+ @blur="onbutblur(index)"
403
+ @change="onbutchange(index)"
404
+ ></input-select>
405
+ </div>
406
+ </div>
407
+
408
+ <!--textarea-->
409
+ <div :style="item.style ? item.style : ''" :class="[item.required && !(item.value) ? 'has-error' : '', item.bootstraped ? item.bootstraped + ' form-group':'form-group']"
410
+ v-if="item.type==='textarea' && !item.hidden && (item.device === 'pc' || !item.device)">
411
+ <label :style="item.label_style ? item.label_style : ''"
412
+ :class="item.label_bootstraped ? item.label_bootstraped + ' control-label-justify control-label' : 'control-label-justify control-label col-sm-6'">{{item.label}}</label>
413
+ <div :style="item.value_style ? item.value_style : ''"
414
+ :class="item.value_bootstraped ? item.value_bootstraped : 'col-sm-9'">
415
+ <textarea
416
+ class="form-control input_view"
417
+ style="width: 100%;height: 100%"
418
+ v-model="item.value"
419
+ :value="item.value"
420
+ :rows="item.rows"
421
+ :readonly="item.readonly"
422
+ :disabled="item.disabled"
423
+ @change="onbutchange(index)"
424
+ @blur="onbutblur(index)"
425
+ @input="onbutinput(index)"
426
+ ></textarea>
427
+ </div>
428
+ </div>
429
+ </div>
430
+ </div>
431
+ </article>
432
+ <footer slot="modal-footer" class="modal-footer">
433
+ <button :class="disable_modal_button ? 'btn btn-default':'btn btn-primary'"
434
+ :disabled="disable_modal_button" type="button" @click="confirmModal()">
435
+ 确认
436
+ </button>
437
+ </footer>
438
+ </modal>
439
+ </form>
440
+ </div>
441
+ </template>
442
+ <script>
443
+ import Vue from 'vue'
444
+ import {isEmpty} from "../../../components/Util";
445
+ import {HttpResetClass} from 'vue-client'
446
+ // Date格式化
447
+ Date.prototype.Format = function (fmt) {
448
+ var o = {
449
+ 'M+': this.getMonth() + 1, // 月份
450
+ 'd+': this.getDate(), // 日
451
+ 'H+': this.getHours(), // 小时
452
+ 'm+': this.getMinutes(), // 分
453
+ 's+': this.getSeconds(), // 秒
454
+ 'q+': Math.floor((this.getMonth() + 3) / 3), // 季度
455
+ 'S': this.getMilliseconds() // 毫秒
456
+ }
457
+ if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (this.getFullYear() + '').substr(4 - RegExp.$1.length))
458
+ for (var k in o) {
459
+ if (new RegExp('(' + k + ')').test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length === 1) ? (o[k]) : (('00' + o[k]).substr(('' + o[k]).length)))
460
+ }
461
+ return fmt
462
+ }
463
+
464
+ export default {
465
+ title: '报建业务通用组件',
466
+ props: {
467
+ data: {
468
+ type: Object
469
+ }
470
+ },
471
+ data () {
472
+ return {
473
+ model: {}, // 公司等属性
474
+ disable_button: true, // 控制按钮禁用
475
+ disable_modal_button: true, // 控制按钮禁用
476
+ //初始化省市区数据
477
+ pcdslist: [],
478
+ //初始化街道数据
479
+ streetslist: [],
480
+ //初始化街道数据
481
+ areaslist: [],
482
+ showButModal: false,
483
+ areaData:{
484
+ sjvalue:'',
485
+ xianvalue:'',
486
+ sqvalue:'',
487
+ },
488
+ templatlng: {
489
+ gaodetemplng: "",
490
+ gaodetemplat: "",
491
+ baidutemplng: "",
492
+ baidutemplat: ""
493
+ }
494
+ }
495
+ },
496
+ watch: {
497
+ deep: true
498
+ },
499
+ computed: {
500
+
501
+ },
502
+ created () {
503
+ // 初始化数据
504
+ this.initializtion()
505
+ if (this.data.readyEvent) {
506
+ this.$dispatch(this.data.readyEvent)
507
+ }
508
+ this.$dispatch('initializtionView')
509
+ },
510
+ methods: {
511
+ // 初始化数据
512
+ initializtion () {
513
+ for (const item of this.data.fields) {
514
+ this.data[item.field] = item.value
515
+ }
516
+
517
+ // 是否禁用按钮
518
+ this.disableButton()
519
+ // 公司等属性初始化
520
+ if (this.data.orgs) {
521
+ this.model.orgs = this.data.orgs
522
+ } else {
523
+ this.model.orgs = this.$login.f.orgs
524
+ }
525
+ if (this.data.parentname) {
526
+ this.model.parentname = this.data.parentname
527
+ } else {
528
+ this.model.parentname = this.$login.f.f_department_name
529
+ }
530
+ if (this.data.operate_date) {
531
+ this.model.operate_date = this.data.operate_date
532
+ } else {
533
+ this.model.operate_date = new Date().Format('yyyy-MM-dd')
534
+ }
535
+ if (this.data.operator) {
536
+ this.model.operator = this.data.operator
537
+ } else {
538
+ this.model.operator = this.$login.f.name
539
+ }
540
+
541
+ this.initpcds(` j_orgid = '${this.$login.f.orgid}'`)
542
+ },
543
+ async getSelectShijiValue(sjvalue,sjlable) {
544
+ this.areaData.sjvalue = sjvalue
545
+ console.log("这是父级接收的市级值:",sjvalue,sjlable)
546
+ this.data.areaData = this.areaData
547
+
548
+ // 是否禁用按钮
549
+ this.disableButton()
550
+ },
551
+ async getSelectXianValue(xianvalue,xianlable) {
552
+ this.areaData.xianvalue = xianvalue
553
+ this.data.areaData = this.areaData
554
+ console.log("这是父级接收的县级值:",xianvalue,xianlable)
555
+
556
+ // 是否禁用按钮
557
+ this.disableButton()
558
+ },
559
+ async getSelectShequValue(sqvalue,sqlable) {
560
+ this.areaData.sqvalue = sqvalue
561
+ this.data.areaData = this.areaData
562
+ console.log("这是父级接收的社区值:",sqvalue,sqlable)
563
+
564
+ // 是否禁用按钮
565
+ this.disableButton()
566
+ },
567
+ //初始化省市区,添加街道
568
+ async initpcds(pconditon) {
569
+ // console.log('initpcds', pconditon)
570
+ // this.pcdslist = []
571
+ // let HttpReset = new HttpResetClass()
572
+ // let req = await HttpReset.load('POST', 'rs/sql/address_singleTableOrderBy?pageNo=1&pageSize=9999999', {
573
+ // data: {
574
+ // items: '*',
575
+ // tablename: 'j_bjqpcd',
576
+ // orderitem: 'id',
577
+ // condition: pconditon
578
+ // }
579
+ // }, {resolveMsg: null, rejectMsg: '获取地址失败!'})
580
+ // let redata = []
581
+ // req.data.forEach((row, n) => {
582
+ // redata[n] = {
583
+ // label: row.j_areaname,
584
+ // value: row.j_areaid,
585
+ // data: row,
586
+ // id: row.id
587
+ // }
588
+ // })
589
+ // console.log('市区', redata)
590
+ // this.pcdslist = redata
591
+ },
592
+ //初始化街道 添加小区
593
+ async initstreets(pconditon) {
594
+ // console.log('市区32', pconditon)
595
+ // this.streetslist = []
596
+ // let HttpReset = new HttpResetClass()
597
+ // let req = await HttpReset.load('POST', 'rs/sql/address_singleTableOrderBy', {
598
+ // data: {
599
+ // items: '*',
600
+ // tablename: 'j_bjqstreet',
601
+ // orderitem: 'id',
602
+ // condition: pconditon
603
+ // }
604
+ // }, {resolveMsg: null, rejectMsg: '获取地址失败!'})
605
+ // let redata = []
606
+ // req.data.forEach((row, n) => {
607
+ // redata[n] = {
608
+ // label: row.j_areaname,
609
+ // value: row.j_areaid,
610
+ // data: row,
611
+ // id: row.id
612
+ // }
613
+ // })
614
+ // console.log('市区333', redata)
615
+ // this.streetslist = redata
616
+ // this.model.f_iscity = this.findbyid(this.streetslist, this.model.f_street_id).f_iscity
617
+ },
618
+ //初始化小区添加小区
619
+ async initareas(pconditon) {
620
+ // if(this.usertype){
621
+ // pconditon=pconditon+` and f_special='1' `
622
+ // }
623
+ // this.areaslist = []
624
+ // let HttpReset = new HttpResetClass()
625
+ // let req = await HttpReset.load('POST', 'rs/sql/address_singleTableOrderBy?pageNo=1&pageSize=100', {
626
+ // data: {
627
+ // items: '*',
628
+ // tablename: 'j_bjqarea',
629
+ // orderitem: 'id',
630
+ // condition: pconditon
631
+ // }
632
+ // }, {resolveMsg: null, rejectMsg: '获取地址失败!'})
633
+ // let redata = []
634
+ // req.data.forEach((row) => {
635
+ // redata.push({
636
+ // label: row.j_areaname,
637
+ // value: row.j_areaid,
638
+ // data: row,
639
+ // id: row.id
640
+ // })
641
+ // })
642
+ // console.log('市区666', redata)
643
+ // if (redata.length>0){
644
+ // this.areaslist = redata
645
+ // }
646
+ },
647
+ //省/市/区变化
648
+ async pcdChange(val) {
649
+
650
+ // console.log("省/市/区变化", val)
651
+ // console.log("省/市/区变化", ` f_pcd_id ='${val}' `)
652
+ // if (val) {
653
+ // //那就把[小区,街道]重新组织一下
654
+ // await this.initstreets(` j_parentid ='${val}' `)
655
+ // if (this.model.f_street_id) {
656
+ // if (this.findbyid(this.streetslist, this.model.f_street_id)) {
657
+ // let pcd_id = this.findbyid(this.streetslist, this.model.f_street_id).f_pcd_id
658
+ // if (pcd_id != val) {
659
+ // this.model.f_street_id = ''
660
+ // }
661
+ // } else {
662
+ // this.model.f_street_id = ''
663
+ // }
664
+ //
665
+ // //那就把[小区,街道]重新组织一下
666
+ // if (this.model.f_street_id) {
667
+ // await this.initareas(` j_parentid ='${this.model.f_street_id}' `)
668
+ // if (this.model.f_residential_area_id) {
669
+ // if (this.findbyid(this.areaslist, this.model.f_residential_area_id)) {
670
+ // let pcd_id = this.findbyid(this.areaslist, this.model.f_residential_area_id).f_pcd_id
671
+ // if (pcd_id != val) {
672
+ // this.model.f_residential_area_id = ''
673
+ // }
674
+ // } else {
675
+ // this.model.f_residential_area_id = ''
676
+ // }
677
+ //
678
+ // }
679
+ // }
680
+ // }
681
+ // }
682
+ // this.$resetValidation()
683
+ },
684
+ //街道变化
685
+ async streetChange(val) {
686
+ // console.log("街道变化", val)
687
+ // if (this.streetslist[0]) {
688
+ // var street = ''
689
+ // this.streetslist.forEach((item) => {
690
+ // if (item.id === val) {
691
+ // street = item.label
692
+ // }
693
+ // })
694
+ // this.model.f_address = street
695
+ // }
696
+ // if (val) {
697
+ // //那就把[小区]重新组织一下
698
+ // await this.initareas(` j_parentid ='${val}' `)
699
+ // if (this.model.f_residential_area_id) {
700
+ // if (this.findbyid(this.areaslist, this.model.f_residential_area_id)) {
701
+ // let street_id = this.findbyid(this.areaslist, this.model.f_residential_area_id).f_street_id
702
+ // if (street_id != val) {
703
+ // this.model.f_residential_area_id = ''
704
+ // }
705
+ // } else {
706
+ // this.model.f_residential_area_id = ''
707
+ // }
708
+ //
709
+ // }
710
+ // }
711
+ // this.$resetValidation()
712
+ },
713
+ // 是否禁用按钮
714
+ disableButton () {
715
+ let flag = false
716
+ for (const field of this.data.fields) {
717
+ if (field.required && !field.value && !field.hidden && field.value !== 0) {
718
+ flag = true
719
+ }
720
+
721
+ // 任何选择框只要是否都不能提交
722
+ if (field.type === 'select' && field.value === '否' && field.value_no_disable) {
723
+ flag = true
724
+ }
725
+
726
+ if (field.type === 'checkbox' && field.required && field.value.length === 0) {
727
+ flag = true
728
+ }
729
+ }
730
+
731
+ //区域下拉框必选 流程模式为报警器报建
732
+ if ((this.data.f_apply_type === '报警器报建' || this.data.f_apply_type === '工商业报警器报建') && this.data.defname === '工程施工' && this.data.title === '工程施工' && this.data.f_sub_state !='完工'){
733
+ if (!flag){
734
+ if (this.areaData.sjvalue ==null || this.areaData.sjvalue.length ==0 || this.areaData.sqvalue == null || this.areaData.sqvalue.length ==0
735
+ || this.areaData.xianvalue == null || this.areaData.xianvalue.length == 0){
736
+ console.log("区域为空禁止提交:",this.areaData)
737
+ flag = true
738
+ }
739
+
740
+ if (this.templatlng.baidutemplat ==null || this.templatlng.baidutemplat.length ==0 || this.templatlng.baidutemplng == null || this.templatlng.baidutemplng.length ==0
741
+ || this.templatlng.gaodetemplat == null || this.templatlng.gaodetemplat.length == 0 || this.templatlng.gaodetemplng == null || this.templatlng.gaodetemplng.length == 0){
742
+ console.log("地图坐标为空禁止提交:",this.templatlng)
743
+ flag = true
744
+ }
745
+ }
746
+ }
747
+ this.disable_button = flag
748
+ },
749
+ // 失去焦点且值最终发生变化触发
750
+ async onchange (index) {
751
+ // 是否禁用按钮
752
+ this.disableButton()
753
+
754
+ if (!isEmpty(this.data.fields[index].value)) {
755
+ // 前缀、后缀
756
+ if (this.data.fields[index].prefix) {
757
+ this.data.fields[index].value = this.data.fields[index].prefix + this.data.fields[index].value
758
+ }
759
+ if (this.data.fields[index].suffix) {
760
+ this.data.fields[index].value = this.data.fields[index].value + this.data.fields[index].suffix
761
+ }
762
+ }
763
+
764
+ // data赋值
765
+ this.data[this.data.fields[index].field] = this.data.fields[index].value
766
+
767
+ if (this.data.fields[index].type === 'datepicker') {
768
+ this.check_datepicker(index)
769
+ }
770
+
771
+ if (this.data.fields[index].onchange) {
772
+ this.$dispatch(this.data.fields[index].onchange, index)
773
+ }
774
+ this.$dispatch('onchange', index)
775
+ },
776
+ // 失去焦点触发,无论值是否发生变化
777
+ onblur (index) {
778
+ this.disableButton()
779
+
780
+ if (this.data.fields[index].onblur) {
781
+ this.$dispatch(this.data.fields[index].onblur, index)
782
+ }
783
+
784
+ this.$dispatch('onblur', index)
785
+ },
786
+ oninput (index) {
787
+ // 是否禁用按钮
788
+ this.disableButton()
789
+
790
+ if (this.data.fields[index].oninput) {
791
+ this.$dispatch(this.data.fields[index].oninput, index)
792
+ }
793
+ this.$dispatch('oninput', index)
794
+ },
795
+ selectSearch(event, index) {
796
+ if (this.data.fields[index].selectSearch) {
797
+ this.$dispatch(this.data.fields[index].selectSearch, event[0], index)
798
+ }
799
+ this.$dispatch('selectSearch', event[0], index)
800
+ },
801
+ // 点击按钮组按钮
802
+ async click_but (button) {
803
+ //报警器区域地址
804
+ this.data.areaData = this.areaData
805
+ this.data.templatlng = this.templatlng
806
+
807
+ this.disable_button = true
808
+
809
+ this.data.fields.forEach(item => {
810
+ this.data[item.field] = item.value
811
+ })
812
+
813
+ this.data.button = button
814
+
815
+ if (button.button_fields && button.button_fields.length > 0) {
816
+ this.showButModal = true
817
+ return
818
+ }
819
+
820
+ if (this.data.button.event) {
821
+ this.$dispatch(this.data.button.event)
822
+ } else {
823
+ this.$dispatch('button')
824
+ }
825
+
826
+ },
827
+ confirmModal () {
828
+ this.closeModal()
829
+
830
+ this.data.button.button_fields.forEach(item => {
831
+ this.data.button[item.field] = item.value
832
+ })
833
+
834
+ if (this.data.button.event) {
835
+ this.$dispatch(this.data.button.event)
836
+ } else {
837
+ this.$dispatch('button')
838
+ }
839
+ },
840
+ // 关闭模态框
841
+ closeModal () {
842
+ this.showButModal = false
843
+ this.disable_modal_button = false
844
+ },
845
+ onbutchange (index) {
846
+ // 是否禁用按钮
847
+ this.disableModalButton()
848
+
849
+ if (this.data.button.button_fields[index].onchange) {
850
+ this.$dispatch(this.data.button.button_fields[index].onchange, index)
851
+ } else {
852
+ this.$dispatch('onbutchange', index)
853
+ }
854
+
855
+ },
856
+ onbutblur (index) {
857
+ this.disableModalButton()
858
+
859
+ if (this.data.button.button_fields[index].onblur) {
860
+ this.$dispatch(this.data.button.button_fields[index].onblur, index)
861
+ } else {
862
+ this.$dispatch('onbutblur', index)
863
+ }
864
+ },
865
+ onbutinput (index) {
866
+ // 是否禁用按钮
867
+ this.disableModalButton()
868
+
869
+ if (this.data.button.button_fields[index].oninput) {
870
+ this.$dispatch(this.data.button.button_fields[index].oninput, index)
871
+ } else {
872
+ this.$dispatch('onbutinput', index)
873
+ }
874
+ },
875
+ disableModalButton () {
876
+ let flag = false
877
+
878
+
879
+ for (const item of this.data.button.button_fields) {
880
+ if (item.required && !item.value) {
881
+ if (item.value === 0) {
882
+ flag = false
883
+ } else {
884
+ flag = true
885
+ }
886
+ }
887
+ }
888
+
889
+ this.disable_modal_button = flag
890
+ },
891
+ check_datepicker (index) {
892
+ // 时间格式检测
893
+ if (!isEmpty(this.data.fields[index].value)) {
894
+
895
+ let dateReg = /^[1-9]\d{3}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])$/
896
+ let timeReg = /^(20|21|22|23|[0-1]\d):[0-5]\d:[0-5]\d$/
897
+ 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$/
898
+ if (this.data.fields[index].format) {
899
+ if (this.data.fields[index].format === 'yyyy-MM-dd') {
900
+ if (!dateReg.test(this.data.fields[index].value)) {
901
+ this.data.fields[index].value = ''
902
+ this.$showAlert(this.data.fields[index].label + '格式错误如:2021-01-01', 'warning', 2000)
903
+ }
904
+ }
905
+ if (this.data.fields[index].format === 'HH:mm:ss') {
906
+ if (!timeReg.test(this.data.fields[index].value)) {
907
+ this.data.fields[index].value = ''
908
+ this.$showAlert(this.data.fields[index].label + '格式错误如:00:00:00', 'warning', 2000)
909
+ }
910
+ }
911
+ if (this.data.fields[index].format === 'yyyy-MM-dd HH:mm:ss') {
912
+ if (!datetimeReg.test(this.data.fields[index].value)) {
913
+ this.data.fields[index].value = ''
914
+ this.$showAlert(this.data.fields[index].label + '格式错误如:2021-01-01 00:00:00', 'warning', 2000)
915
+ }
916
+ }
917
+ } else {
918
+ if (!dateReg.test(this.data.fields[index].value)) {
919
+ this.data.fields[index].value = ''
920
+ this.$showAlert(this.data.fields[index].label + '格式错误如:2021-01-01', 'warning', 2000)
921
+ }
922
+ }
923
+ }
924
+ }
925
+ },
926
+ events: {
927
+
928
+ }
929
+ }
930
+ </script>
931
+ <style>
932
+ .datepicker{
933
+ width: 100%!important;
934
+ }
935
+ .datepicker-input{
936
+ background-color: #ffffff!important;
937
+ width: 100%!important;
938
+ }
939
+ .datepicker-input:disabled{
940
+ border: 1px solid #DDD!important;
941
+ color: #ACA899!important;
942
+ width: 100%!important;
943
+ }
944
+ </style>
945
+ <style scoped>
946
+ th{
947
+ font-size: 15px !important;
948
+ text-align: center !important;
949
+ background-color: #dfedfb!important;
950
+ color: #666666 !important;
951
+ font-family: PINGFANG-BOLD !important;
952
+ font-weight: normal!important;
953
+ }
954
+ /*清除model中的浮动*/
955
+ .clearfix:after,.clearfix:before{
956
+ display: table;
957
+ }
958
+ .clearfix:after{
959
+ clear: both;
960
+ }
961
+
962
+ .input_view{
963
+ padding: 8px;
964
+ background-color: #ffffff;
965
+ border-radius: 2px;
966
+ border: solid 1px #c7c7c7!important;
967
+ color: #333333!important;
968
+ font-size: 15px!important;
969
+ }
970
+
971
+ .input_view[readonly]{
972
+ border: 1px solid #DDD!important;
973
+ color:#ACA899!important;
974
+ }
975
+ .input_view:disabled{
976
+ border: 1px solid #DDD!important;
977
+ color:#ACA899!important;
978
+ }
979
+
980
+ .control-label-justify {
981
+ display: inline-block;
982
+ vertical-align: top;
983
+ width: 110px;
984
+ text-align: justify;
985
+ font-family: PingFang-SC-Bold;
986
+ }
987
+
988
+ .control-label-justify::after {
989
+ content: "";
990
+ display: inline-block;
991
+ width: 100%;
992
+ overflow: hidden;
993
+ height: 0;
994
+ }
995
+
996
+ input::-webkit-outer-spin-button,
997
+ input::-webkit-inner-spin-button {
998
+ -webkit-appearance: none;
999
+ }
1000
+
1001
+ input[type="number"] {
1002
+ -moz-appearance: textfield;
1003
+ }
1004
+
1005
+ </style>