apply-clients 3.5.4-81 → 3.5.4-82

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