apply-clients 3.5.4-95 → 3.5.4-97

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 (39) hide show
  1. package/build/dev-server.js +9 -7
  2. package/package.json +1 -1
  3. package/src/App.vue +25 -25
  4. package/src/apply.js +139 -139
  5. package/src/components/android/AppCheckTakePic.vue +168 -168
  6. package/src/components/android/Process/AppExplorationUser.vue +508 -508
  7. package/src/components/android/Process/AppServiceControl.vue +1755 -1755
  8. package/src/components/product/PcZhihuanManagement.vue +160 -160
  9. package/src/components/product/Print/BuildOrder/buildOrderList.vue +339 -339
  10. package/src/components/product/Process/Processes/selectApply.vue +251 -251
  11. package/src/components/product/Process/Processes/selectBcakApply.vue +250 -250
  12. package/src/filiale/ancheng/android/AppSign.vue +149 -149
  13. package/src/filiale/ancheng/android/AppTakePic.vue +143 -143
  14. package/src/filiale/ancheng/android.js +7 -7
  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/AppZhihuanManagement.vue +230 -230
  18. package/src/filiale/fugou/pc/AddReplacement.vue +340 -340
  19. package/src/filiale/fugou/pc/ApplyChargeList.vue +480 -480
  20. package/src/filiale/fugou/pc/addMaterialScience.vue +481 -481
  21. package/src/filiale/fugou/pc/addressAndUserinfoManagement.vue +216 -216
  22. package/src/filiale/fugou/pc/chargeReport.vue +143 -143
  23. package/src/filiale/fugou/pc.js +16 -16
  24. package/src/filiale/hongda/pc/ApplyDetailsList.vue +329 -329
  25. package/src/filiale/qianneng/android/AppServiceView.vue +795 -795
  26. package/src/filiale/qianneng/pc/ApplyChargeList.vue +639 -625
  27. package/src/filiale/qianneng/pc/Applybatchdispatch.vue +769 -704
  28. package/src/filiale/qianneng/pc/Applydetail.vue +417 -378
  29. package/src/filiale/qianneng/pc/InstallInfoSelect.vue +434 -391
  30. package/src/filiale/qianneng/pc/ServiceControl.vue +1382 -1384
  31. package/src/filiale/qianneng/pc/StopApplyList.vue +334 -290
  32. package/src/filiale/qianneng/pc/SupervisoryList.vue +396 -382
  33. package/src/filiale/qianneng/pc/chargeManagement.vue +813 -810
  34. package/src/filiale/yangchunboneng/android/AppServiceControl.vue +2 -2
  35. package/src/filiale/yangchunboneng/pc/ServiceControl.vue +1 -1
  36. package/src/main.js +23 -22
  37. package/src/test/SessionTestServlet.java +0 -69
  38. package/webapp/WEB-INF/web.xml +0 -52
  39. package/webapp/session-test.jsp +0 -59
@@ -1,795 +1,795 @@
1
- <template>
2
- <div class="form-horizontal select-overspread">
3
- <validator name='v' @valid="$emit('valid')" @invalid="$emit('invalid')">
4
- <!--<form>-->
5
- <div v-for="(index,item) in data.fields">
6
- <!--input-->
7
- <div :style="item.style ? item.style : ''"
8
- v-if="(item.type==='input' || item.type==='number'||item.type === 'tel'||item.type === 'email') && !item.hidden && (item.device === 'app' || !item.device) && (item.label != '证件号码')&&(item.label != '身份证') && (item.label != '用户电话')"
9
- :class="[item.required && !(item.value) ? 'apply-has-error' : '', item.bootstraped ? item.bootstraped + ' form-group app-input':'col-xs-12 form-group app-input']">
10
- <label class="control-label-justify">{{item.label}}</label>
11
- <div :style="item.value_style ? item.value_style:''"
12
- :class="item.value_bootstraped ? item.value_bootstraped : 'col-xs-8'">
13
- <input class="" style="width: 100%"
14
- :type="item.type"
15
- v-model="data.fields[index].value"
16
- :placeholder="item.placeholder"
17
- :value="data.fields[index].value"
18
- :readonly="item.readonly"
19
- :disabled="item.disabled"
20
- @change="onchange(index)"
21
- @blur="onblur(index)"
22
- @input="oninput(index)"
23
- />
24
- </div>
25
- </div>
26
- <!--input-->
27
- <div :style="item.style ? item.style : ''"
28
- v-if="(data.f_credentials != '身份证' && item.label === '证件号码')"
29
- :class="[item.required && !(item.value) ? 'apply-has-error' : '', item.bootstraped ? item.bootstraped + ' form-group app-input':'col-xs-12 form-group app-input']">
30
- <label class="control-label-justify">{{item.label}}</label>
31
- <div :style="item.value_style ? item.value_style:''"
32
- :class="item.value_bootstraped ? item.value_bootstraped : 'col-xs-8'">
33
- <input class="" style="width: 100%"
34
- :type="item.type"
35
- v-model="data.fields[index].value"
36
- :placeholder="item.placeholder"
37
- :value="data.fields[index].value"
38
- :readonly="item.readonly"
39
- :disabled="item.disabled"
40
- @change="onchange(index)"
41
- @blur="onblur(index)"
42
- @input="oninput(index)"
43
- />
44
- </div>
45
- </div>
46
- <!--input身份证验证-->
47
- <div :style="item.style ? item.style : ''"
48
- v-if="(item.label==='身份证') || (item.label === '证件号码' && data.f_credentials === '身份证')"
49
- :class="[$v.f_idnumber2.identityCardValid ? 'apply-has-error' : '',item.bootstraped ? item.bootstraped + ' form-group app-input':'col-xs-12 form-group app-input']">
50
- <label class="control-label-justify">{{item.label}}</label>
51
- <div :style="item.value_style ? item.value_style:''"
52
- :class="item.value_bootstraped ? item.value_bootstraped : 'col-xs-8'">
53
- <input class="" style="width: 100%"
54
- :type="item.type"
55
- maxlength="18"
56
- v-model="data.fields[index].value"
57
- :placeholder="item.placeholder"
58
- :value="data.fields[index].value"
59
- :readonly="item.readonly"
60
- v-validate:f_idnumber2='{identityCardValid: true}'
61
- @change="onchange(index)"
62
- @blur="onblur(index)"
63
- @input="oninput(index)"
64
- />
65
- </div>
66
- </div>
67
- <!--input手机号验证-->
68
- <div :style="item.style ? item.style : ''"
69
- v-if="item.label === '客户电话'"
70
- :class="[$v.f_user_phone.minlength || $v.f_user_phone.maxlength ? 'apply-has-error' : '',item.bootstraped ? item.bootstraped + ' form-group app-input':'col-xs-12 form-group app-input']">
71
- <label class="control-label-justify">{{item.label}}</label>
72
- <div :style="item.value_style ? item.value_style:''"
73
- :class="item.value_bootstraped ? item.value_bootstraped : 'col-xs-8'">
74
- <input class="" style="width: 100%"
75
- maxlength="18"
76
- type="number"
77
- onKeypress="return(/[\d\.]/.test(String.fromCharCode(event.keyCode)))"
78
- oninput="if(value.length > 11) value=value.slice(0,11)"
79
- v-validate:f_user_phone="{minlength: 7, maxlength: 11 }"
80
- v-model="data.fields[index].value"
81
- :placeholder="item.placeholder"
82
- :value="data.fields[index].value"
83
- :readonly="item.readonly"
84
- @change="onchange(index)"
85
- @blur="onblur(index)"
86
- @input="oninput(index)"
87
- />
88
- </div>
89
- </div>
90
- <!--select-->
91
- <div :style="item.style ? item.style : ''"
92
- v-if="item.type==='select' && !item.hidden && (item.device === 'app' || !item.device)&& !item.multiple"
93
- :class="[item.required && !(item.value) ? 'apply-has-error' : '', item.bootstraped ? item.bootstraped + ' form-group app-input':'col-xs-12 form-group app-input']">
94
- <label class="control-label-justify">{{item.label}}</label>
95
- <div :style="item.value_style ? item.value_style:''"
96
- :class="item.value_bootstraped ? item.value_bootstraped : 'col-xs-8'">
97
- <v-select
98
- class="select" width="100%" align="right"
99
- :placeholder="item.placeholder"
100
- :search="item.search"
101
- close-on-select value-single
102
- @select-search="selectSearch($arguments,index)"
103
- :options="data.fields[index].options"
104
- v-model="data.fields[index].value"
105
- :value.sync="data.fields[index].value"
106
- @blur="onblur(index)"
107
- @change="onchange(index)"
108
- :readonly="item.readonly"
109
- :disabled="item.disabled"
110
- ></v-select>
111
- </div>
112
- </div>
113
- <!--select-->
114
- <div :style="item.style ? item.style : ''"
115
- v-if="item.type==='select' && !item.hidden && (item.device === 'app' || !item.device)&& item.multiple"
116
- :class="[item.required && !(item.value) ? 'apply-has-error' : '', item.bootstraped ? item.bootstraped + ' form-group app-input':'col-xs-12 form-group app-input']">
117
- <label class="control-label-justify">{{item.label}}</label>
118
- <div :style="item.value_style ? item.value_style:''"
119
- :class="item.value_bootstraped ? item.value_bootstraped : 'col-xs-8'">
120
- <v-select
121
- class="select" width="100%" align="right"
122
- :placeholder="item.placeholder"
123
- :search="item.search"
124
- @select-search="selectSearch($arguments,index)"
125
- :options="data.fields[index].options"
126
- v-model="data.fields[index].value"
127
- :value.sync="data.fields[index].value"
128
- @blur="onblur(index)"
129
- @change="onchange(index)"
130
- :readonly="item.readonly"
131
- :disabled="item.disabled"
132
- :multiple="data.fields[index].multiple"
133
- :valueSingle="true"
134
- ></v-select>
135
- </div>
136
- </div>
137
- <!--时间datepicker-->
138
- <div :style="item.style ? item.style : ''"
139
- v-if="item.type==='datepicker' && !item.hidden && (item.device === 'app' || !item.device)"
140
- :class="[item.required && !(item.value) ? 'apply-has-error' : '', item.bootstraped ? item.bootstraped+' form-group app-input':'col-xs-12 form-group app-input']">
141
- <label class="control-label-justify">{{item.label}}</label>
142
- <div class="form-group" :style="item.value_style ? item.value_style:''"
143
- :class="item.value_bootstraped ? item.value_bootstraped : 'col-xs-8'">
144
- <datepicker
145
- @change="onchange(index)"
146
- @blur="onblur(index)"
147
- :placeholder="item.placeholder"
148
- :value.sync="data.fields[index].value"
149
- :format="item.format ? item.format : 'yyyy-MM-dd'"
150
- v-model="data.fields[index].value"
151
- :readonly="item.readonly"
152
- :disabled="item.disabled"
153
- :show-reset-button="true">
154
- </datepicker>
155
- </div>
156
- </div>
157
- <!--textarea-->
158
- <div :style="item.style ? item.style : ''"
159
- v-if="item.type==='textarea' && !item.hidden && (item.device === 'app' || !item.device)"
160
- :class="[item.required && !(item.value) ? 'apply-has-error' : '', item.bootstraped?item.bootstraped+' form-group app-input':'col-xs-12 form-group app-input']">
161
- <label class="control-label-justify">{{item.label}}</label>
162
- <div :style="item.value_style ? item.value_style:''"
163
- :class="item.value_bootstraped ? item.value_bootstraped : 'col-xs-8'">
164
- <textarea
165
- :readonly="item.readonly"
166
- :disabled="item.disabled"
167
- class="" :rows="item.rows"
168
- style="width: 100%;height: 100%"
169
- v-model="data.fields[index].value"
170
- :value="data.fields[index].value"
171
- @change="onchange(index)"
172
- @blur="onblur(index)"
173
- @input="oninput(index)"
174
- ></textarea>
175
- </div>
176
- </div>
177
- <!--checkbox-->
178
- <div :style="item.style ? item.style : ''"
179
- v-if="item.type==='checkbox' && !item.hidden && (item.device === 'app' || !item.device)"
180
- :class="[item.required && item.value.length === 0 ? 'apply-has-error' : '',item.bootstraped?item.bootstraped+' form-group app-input':'col-xs-12 form-group app-input']">
181
- <label class="control-label-justify">{{item.label}}</label>
182
- <div :style="item.value_style ? item.value_style:''"
183
- :class="item.value_bootstraped ? item.value_bootstraped : 'col-xs-8'">
184
- <label class="" v-for="(index2,row) in item.options">
185
- <input type="checkbox" class=""
186
- :readonly="data.fields[index].readonly"
187
- :disabled="data.fields[index].disabled"
188
- v-model="data.fields[index].value"
189
- :value="data.fields[index].options[index2].value"
190
- @change="onchange(index)"
191
- @blur="onblur(index)">
192
- {{row.label}}
193
- </label>
194
- </div>
195
- </div>
196
- </div>
197
- <div class="col-sm-12 col-xs-12" id="test11">
198
- <accordion one-at-a-time="true">
199
- <panel v-for="(i,item) in data.onetomany" :header="item.title" :is-open="false" type="primary">
200
- <app-onetomany :onetomany="item" :index="i" :selectdata="data"></app-onetomany>
201
- </panel>
202
- <panel v-for="(i,item) in data.components" :header="item.title" :is-open="true" type="primary" v-if="item.device === 'app' || !item.device">
203
- <component :is="item.name" :selectdata="data" :mark="item.mark"></component>
204
- </panel>
205
- </accordion>
206
- </div>
207
-
208
- <!--自定义组件-->
209
- <slot>
210
-
211
- </slot>
212
-
213
- <!-- 按钮组 -->
214
- <div class="text-center">
215
- <button v-for="(index,button) in data.buttons"
216
- :disabled="button.disabled && disable_button"
217
- style="min-width:100px"
218
- :class="button.disabled && disable_button ? 'btn btn-default button_spacing' : 'btn btn-primary button_spacing'"
219
- v-if="!button.hidden && button.button_name !=='提交'&& button.button_name !=='确认'"
220
- @click.prevent="click_but(button)"
221
- >
222
- {{button.button_name}}
223
- </button>
224
- <button v-for="(index,button) in data.buttons"
225
- :disabled="(button.disabled && disable_button) || (!$v.valid)"
226
- style="min-width:100px"
227
- :class="button.disabled && disable_button || (!$v.valid) ? 'btn btn-default button_spacing' : 'btn btn-primary button_spacing'"
228
- v-if="!button.hidden && (button.button_name ==='提交'||button.button_name ==='确认')"
229
- @click.prevent="click_but(button)"
230
- >
231
- {{button.button_name}}
232
- </button>
233
- </div>
234
- <div class="text-center" style="margin-top: 1%">
235
- <button style="min-width:100px"
236
- class="btn btn-primary "
237
- v-if="data.defname == '工程施工' || data.defname == '通气验收' "
238
- @click.prevent="showmaterials()"
239
- >
240
- 材料收费
241
- </button>
242
- </div>
243
- <!-- 按钮模态框 -->
244
- <modal v-if="showButModal" :show.sync="showButModal" backdrop="false" large>
245
- <header slot="modal-header" class="modal-header">
246
- <button type="button" class="close" @click="closeModal()"><span>&times;</span></button>
247
- <span class="modal-title"><font
248
- size="3">{{data.button.button_name}}</font></span>
249
- </header>
250
- <article slot="modal-body" class="modal-body clearfix">
251
- <div class="form-group" >
252
- <div v-for="(index,item) in data.button.button_fields">
253
- <div :style="item.style ? item.style : ''" :class="[item.required && !(item.value) ? 'has-error' : '', item.bootstraped ? item.bootstraped + ' form-group' : 'form-group']"
254
- v-if="(item.type==='input' || item.type==='number'||item.type === 'tel'||item.type === 'email') && !item.hidden && (item.device === 'pc' || !item.device)">
255
- <label :style="item.label_style ? item.label_style : ''"
256
- :class="item.label_bootstraped ? item.label_bootstraped + ' control-label-justify control-label' : 'control-label-justify control-label'">{{item.label}}</label>
257
- <div :style="item.value_style ? item.value_style : ''"
258
- :class="item.value_bootstraped ? item.value_bootstraped : 'col-xs-8'">
259
- <input class="form-control input_view"
260
- :placeholder="item.placeholder"
261
- :type="item.type"
262
- v-model="item.value"
263
- :value="item.value"
264
- :readonly="item.readonly"
265
- :disabled="item.disabled"
266
- @change="onbutchange(index)"
267
- @blur="onbutblur(index)"
268
- @input="onbutinput(index)"
269
- />
270
- </div>
271
- </div>
272
-
273
- <!--时间datepicker-->
274
- <div :style="item.style ? item.style : ''" :class="[item.required && !(item.value) ? 'has-error' : '', item.bootstraped ? item.bootstraped + ' form-group':'form-group']"
275
- v-if="item.type==='datepicker' && !item.hidden && (item.device === 'pc' || !item.device)">
276
- <label :style="item.label_style ? item.label_style : ''"
277
- :class="item.label_bootstraped ? item.label_bootstraped + ' control-label-justify control-label' : 'control-label-justify control-label'">{{item.label}}</label>
278
- <div :style="item.value_style ? item.value_style : ''"
279
- :class="item.value_bootstraped ? item.value_bootstraped : 'col-xs-8'">
280
- <datepicker
281
- :placeholder="item.placeholder"
282
- :value.sync="item.value"
283
- v-model="item.value"
284
- :readonly="item.readonly"
285
- :disabled="item.disabled"
286
- :format="item.format ? item.format : 'yyyy-MM-dd'"
287
- :show-reset-button="true"
288
- @change="onbutchange(index)"
289
- @blur="onbutblur(index)"
290
- ></datepicker>
291
- </div>
292
- </div>
293
-
294
- <!--select-->
295
- <div :style="item.style ? item.style : ''" :class="[item.required && !(item.value) ? 'has-error' : '', item.bootstraped ? item.bootstraped + ' form-group':'form-group']"
296
- v-if="item.type==='select' && !item.hidden && (item.device === 'pc' || !item.device)">
297
- <label :style="item.label_style ? item.label_style : ''"
298
- :class="item.label_bootstraped ? item.label_bootstraped + ' control-label-justify control-label' : 'control-label-justify control-label'">{{item.label}}</label>
299
- <div :style="item.value_style ? item.value_style : ''"
300
- :class="item.value_bootstraped ? item.value_bootstraped : 'col-xs-8'">
301
- <input-select
302
- class="select select_list"
303
- :value.sync="item.value"
304
- v-model="item.value"
305
- :options='item.options'
306
- :readonly="item.readonly"
307
- :disable="item.disabled"
308
- :valueSingle="true"
309
- @blur="onbutblur(index)"
310
- @change="onbutchange(index)"
311
- ></input-select>
312
- </div>
313
- </div>
314
-
315
- <!--textarea-->
316
- <div :style="item.style ? item.style : ''" :class="[item.required && !(item.value) ? 'has-error' : '', item.bootstraped ? item.bootstraped + ' form-group':'form-group']"
317
- v-if="item.type==='textarea' && !item.hidden && (item.device === 'pc' || !item.device)">
318
- <label :style="item.label_style ? item.label_style : ''"
319
- :class="item.label_bootstraped ? item.label_bootstraped + ' control-label-justify control-label' : 'control-label-justify control-label'">{{item.label}}</label>
320
- <div :style="item.value_style ? item.value_style : ''"
321
- :class="item.value_bootstraped ? item.value_bootstraped : 'col-xs-8'">
322
- <textarea
323
- class="form-control input_view"
324
- style="width: 100%;height: 100%"
325
- v-model="item.value"
326
- :value="item.value"
327
- :rows="item.rows"
328
- :readonly="item.readonly"
329
- :disabled="item.disabled"
330
- @change="onbutchange(index)"
331
- @blur="onbutblur(index)"
332
- @input="onbutinput(index)"
333
- ></textarea>
334
- </div>
335
- </div>
336
- </div>
337
- </div>
338
- </article>
339
- <footer slot="modal-footer" class="modal-footer">
340
- <button :class="disable_modal_button ? 'btn btn-default':'btn btn-primary'"
341
- :disabled="disable_modal_button" type="button" @click="confirmModal()">
342
- 确认
343
- </button>
344
- </footer>
345
- </modal>
346
- <modal :show.sync="showmaterial" backdrop="false" style="overflow: scroll;height: 100%">
347
- <header slot="modal-header" class="modal-header text-center">
348
- <button type="button" class="close" @click="showmaterial = false"><span>&times;</span></button>
349
- <h4 class="modal-title">材料收费列表</h4>
350
- </header>
351
- <article slot="modal-body">
352
- <charges-list v-if="showmaterial" :selectdata = "selectdata"></charges-list>
353
- </article>
354
- <footer slot="modal-footer"></footer>
355
- </modal>
356
- <!--</form>-->
357
- </validator>
358
- </div>
359
- </template>
360
- <script>
361
- import Vue from 'vue'
362
- import {isEmpty} from "../../../components/Util";
363
- import chargesList from "telephone-clients/src/filiale/qianneng/android/chargesList";
364
- // Date格式化
365
- Date.prototype.Format = function (fmt) {
366
- var o = {
367
- 'M+': this.getMonth() + 1, // 月份
368
- 'd+': this.getDate(), // 日
369
- 'H+': this.getHours(), // 小时
370
- 'm+': this.getMinutes(), // 分
371
- 's+': this.getSeconds(), // 秒
372
- 'q+': Math.floor((this.getMonth() + 3) / 3), // 季度
373
- 'S': this.getMilliseconds() // 毫秒
374
- }
375
- if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (this.getFullYear() + '').substr(4 - RegExp.$1.length))
376
- for (var k in o) {
377
- if (new RegExp('(' + k + ')').test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length === 1) ? (o[k]) : (('00' + o[k]).substr(('' + o[k]).length)))
378
- }
379
- return fmt
380
- }
381
-
382
- export default {
383
- title: '报建业务通用组件',
384
- props: {
385
- data: {
386
- type: Object
387
- },
388
- showprint: {
389
- type: Boolean,
390
- default: true
391
- }
392
- },
393
- data () {
394
- return {
395
- model: {}, // 公司等属性
396
- disable_button: true, // 控制按钮禁用
397
- disable_modal_button: true, // 控制按钮禁用
398
- showButModal: false,
399
- showmaterial: false,
400
- selectdata:{},
401
- areaData:{
402
- sjvalue:'',
403
- xianvalue:'',
404
- sqvalue:'',
405
- mapvalue:'',
406
- }
407
- }
408
- },
409
- watch: {
410
- deep: true
411
- },
412
- computed: {
413
-
414
- },
415
- components: {
416
- 'charges-list': chargesList
417
- },
418
- created () {
419
- // 初始化数据
420
- this.initializtion()
421
- if (this.data.readyEvent) {
422
- this.$dispatch(this.data.readyEvent)
423
- }
424
- this.$dispatch('initializtionView')
425
- },
426
- methods: {
427
- showmaterials(){
428
- this.selectdata = {}
429
- this.selectdata = {
430
- f_process_id: this.data.f_process_id,
431
- f_fee_type:'报建费用',
432
- model:this.data
433
- }
434
- this.showmaterial = true
435
- },
436
- // 初始化数据
437
- initializtion () {
438
- for (const item of this.data.fields) {
439
- this.data[item.field] = item.value
440
- }
441
- // 是否禁用按钮
442
- this.disableButton()
443
- },
444
- async getSelectShijiValue(sjvalue,sjlable) {
445
-
446
- this.areaData.sjvalue = sjvalue
447
- console.log("这是父级接收的市级值:",sjvalue,sjlable)
448
- this.data.areaData = this.areaData
449
- console.log(this.areaData)
450
- // 是否禁用按钮
451
- this.disableButton()
452
- },
453
- async getSelectXianValue(xianvalue,xianlable) {
454
-
455
- this.areaData.xianvalue = xianvalue
456
- this.data.areaData = this.areaData
457
- console.log("这是父级接收的县级值:",xianvalue,xianlable)
458
- console.log(this.areaData)
459
-
460
- // 是否禁用按钮
461
- this.disableButton()
462
- },
463
- async getSelectShequValue(sqvalue,sqlable) {
464
- this.areaData.sqvalue = sqvalue
465
- this.data.areaData = this.areaData
466
- console.log(this.areaData)
467
- console.log("这是父级接收的社区值:",sqvalue,sqlable)
468
-
469
- // 是否禁用按钮
470
- this.disableButton()
471
- },
472
- // 是否禁用按钮
473
- disableButton () {
474
- var flag = false
475
- for (const field of this.data.fields) {
476
- if (field.required && !field.value && !field.hidden && field.value !== 0) {
477
- flag = true
478
- }
479
-
480
- // 任何选择框只要是否都不能提交
481
- if (field.type === 'select' && field.value === '否' && field.value_no_disable) {
482
- flag = true
483
- }
484
-
485
- if (field.type === 'checkbox' && field.required && field.value.length === 0) {
486
- flag = true
487
- }
488
- }
489
- //区域下拉框必选 流程模式为报警器报建 工商业报警器报建
490
- if ((this.data.f_apply_type === '报警器报建' || this.data.f_apply_type === '工商业报警器报建') && this.data.defname === '工程施工' && this.data.title === '工程施工' && this.data.f_sub_state !='完工'){
491
- if (!flag){
492
- if (this.areaData.sjvalue ==null || this.areaData.sjvalue.length ==0 || this.areaData.sqvalue == null || this.areaData.sqvalue.length ==0
493
- || this.areaData.xianvalue == null || this.areaData.xianvalue == 0){
494
- console.log("区域为空禁止提交:",this.areaData)
495
- flag = true
496
- }
497
- if (this.areaData.mapvalue ==null || this.areaData.mapvalue ==0){
498
- console.log("坐标为空禁止提交map:",this.areaData.mapvalue)
499
- flag = true
500
- }
501
- for (const fields of this.areaData.mapvalue) {
502
- // console.log("报警器数据:",fields.f_bjq_lng)
503
- if (fields.f_bjq_lng ==null || fields.f_bjq_lng.length ==0){
504
- console.log("坐标为空禁止提交44444:",this.areaData.mapvalue)
505
- flag = true
506
- }
507
- }
508
- }
509
- }
510
-
511
- this.disable_button = flag
512
- },
513
- // 失去焦点且值最终发生变化触发
514
- async onchange (index) {
515
- // 是否禁用按钮
516
- this.disableButton()
517
- // this.disablebtu()
518
-
519
- if (!isEmpty(this.data.fields[index].value)) {
520
- // 前缀、后缀
521
- if (this.data.fields[index].prefix) {
522
- this.data.fields[index].value = this.data.fields[index].prefix + this.data.fields[index].value
523
- }
524
- if (this.data.fields[index].suffix) {
525
- this.data.fields[index].value = this.data.fields[index].value + this.data.fields[index].suffix
526
- }
527
- }
528
-
529
- // data赋值
530
- this.data[this.data.fields[index].field] = this.data.fields[index].value
531
-
532
- if (this.data.fields[index].type === 'datepicker') {
533
- this.check_datepicker(index)
534
- }
535
-
536
- if (this.data.fields[index].onchange) {
537
- this.$dispatch(this.data.fields[index].onchange, index)
538
- }
539
- this.$dispatch('onchange', index)
540
-
541
-
542
- },
543
- // 失去焦点触发,无论值是否发生变化
544
- onblur (index) {
545
- this.disableButton()
546
-
547
- if (this.data.fields[index].onblur) {
548
- this.$dispatch(this.data.fields[index].onblur, index)
549
- }
550
-
551
- this.$dispatch('onblur', index)
552
- },
553
- disablebtu(){
554
- this.flag = true
555
- },
556
- oninput (index) {
557
- // 是否禁用按钮
558
- this.disableButton()
559
-
560
- if (this.data.fields[index].oninput) {
561
- this.$dispatch(this.data.fields[index].oninput, index)
562
- }
563
- this.$dispatch('oninput', index)
564
- },
565
- // 点击按钮组按钮
566
- async click_but (button) {
567
- //报警器区域地址
568
- this.data.areaData = this.areaData
569
-
570
- if (this.data.defname === '通气点火') {
571
-
572
- this.$showMessage(`请确认表号是否正确`).then((res) => {
573
-
574
-
575
- this.disable_button = true
576
-
577
- this.data.fields.forEach(item => {
578
- this.data[item.field] = item.value
579
- })
580
-
581
- this.data.button = button
582
-
583
- if (button.button_fields && button.button_fields.length > 0) {
584
- this.showButModal = true
585
- return
586
- }
587
-
588
- if (this.data.button.event) {
589
- this.$dispatch(this.data.button.event)
590
- } else {
591
- this.$dispatch('button')
592
- }
593
-
594
- })
595
-
596
- }
597
- else{
598
- this.disable_button = true
599
-
600
- this.data.fields.forEach(item => {
601
- this.data[item.field] = item.value
602
- })
603
-
604
- this.data.button = button
605
-
606
- if (button.button_fields && button.button_fields.length > 0) {
607
- this.showButModal = true
608
- return
609
- }
610
-
611
- if (this.data.button.event) {
612
- this.$dispatch(this.data.button.event)
613
- } else {
614
- this.$dispatch('button')
615
- }
616
- }
617
-
618
- },
619
- confirmModal () {
620
- this.closeModal()
621
-
622
- this.data.button.button_fields.forEach(item => {
623
- this.data.button[item.field] = item.value
624
- })
625
-
626
- if (this.data.button.event) {
627
- this.$dispatch(this.data.button.event)
628
- } else {
629
- this.$dispatch('button')
630
- }
631
- },
632
- // 关闭模态框
633
- closeModal () {
634
- this.showButModal = false
635
- this.disable_modal_button = true
636
- },
637
- onbutchange (index) {
638
- // 是否禁用按钮
639
- this.disableModalButton()
640
-
641
- if (this.data.button.button_fields[index].onchange) {
642
- this.$dispatch(this.data.button.button_fields[index].onchange, index)
643
- } else {
644
- this.$dispatch('onbutchange', index)
645
- }
646
-
647
- },
648
- onbutblur (index) {
649
- this.disableModalButton()
650
-
651
- if (this.data.button.button_fields[index].onblur) {
652
- this.$dispatch(this.data.button.button_fields[index].onblur, index)
653
- } else {
654
- this.$dispatch('onbutblur', index)
655
- }
656
- },
657
- onbutinput (index) {
658
- // 是否禁用按钮
659
- this.disableModalButton()
660
-
661
- if (this.data.button.button_fields[index].oninput) {
662
- this.$dispatch(this.data.button.button_fields[index].oninput, index)
663
- } else {
664
- this.$dispatch('onbutinput', index)
665
- }
666
- },
667
- disableModalButton () {
668
- let flag = false
669
-
670
-
671
- for (const item of this.data.button.button_fields) {
672
- if (item.required && !item.value) {
673
- if (item.value === 0) {
674
- flag = false
675
- } else {
676
- flag = true
677
- }
678
- }
679
- }
680
-
681
- this.disable_modal_button = flag
682
- },
683
- check_datepicker (index) {
684
- // 时间格式检测
685
- if (!isEmpty(this.data.fields[index].value)) {
686
-
687
- let dateReg = /^[1-9]\d{3}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])$/
688
- let timeReg = /^(20|21|22|23|[0-1]\d):[0-5]\d:[0-5]\d$/
689
- 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$/
690
- if (this.data.fields[index].format) {
691
- if (this.data.fields[index].format === 'yyyy-MM-dd') {
692
- if (!dateReg.test(this.data.fields[index].value)) {
693
- this.data.fields[index].value = ''
694
- this.$showAlert(this.data.fields[index].label + '格式错误如:2021-01-01', 'warning', 2000)
695
- }
696
- }
697
- if (this.data.fields[index].format === 'HH:mm:ss') {
698
- if (!timeReg.test(this.data.fields[index].value)) {
699
- this.data.fields[index].value = ''
700
- this.$showAlert(this.data.fields[index].label + '格式错误如:00:00:00', 'warning', 2000)
701
- }
702
- }
703
- if (this.data.fields[index].format === 'yyyy-MM-dd HH:mm:ss') {
704
- if (!datetimeReg.test(this.data.fields[index].value)) {
705
- this.data.fields[index].value = ''
706
- this.$showAlert(this.data.fields[index].label + '格式错误如:2021-01-01 00:00:00', 'warning', 2000)
707
- }
708
- }
709
- } else {
710
- if (!dateReg.test(this.data.fields[index].value)) {
711
- this.data.fields[index].value = ''
712
- this.$showAlert(this.data.fields[index].label + '格式错误如:2021-01-01', 'warning', 2000)
713
- }
714
- }
715
- }
716
- },
717
- selectSearch(event, index) {
718
- if (this.data.fields[index].selectSearch) {
719
- this.$dispatch(this.data.fields[index].selectSearch, event[0], index)
720
- }
721
- this.$dispatch('selectSearch', event[0], index)
722
- }
723
- },
724
- events: {
725
- }
726
- }
727
- </script>
728
- <style scoped>
729
- .control-label-justify {
730
- width: 30%;
731
- text-align: justify;
732
- text-align-last: justify;
733
- font-family: PingFang-SC-Bold;
734
- float: left;
735
- }
736
- .button_spacing{margin: 0px 0px 0px 10px;}
737
- </style>
738
- <style lang="less">
739
- .apply-has-error {
740
- border-bottom: 1px solid #a94442;
741
- }
742
- .app-input {
743
- label {
744
- float: left;
745
- }
746
- .select {
747
- button {
748
- border: none;
749
- outline: none;
750
- text-align: left;
751
- .btn-placeholder {
752
- color: #ACA899
753
- }
754
- }
755
- }
756
- .datepicker {
757
- .form-control:focus {
758
- border: none!important;
759
- outline: none!important;
760
- -webkit-box-shadow: none;
761
- box-shadow: none;
762
- }
763
- }
764
- textarea {
765
- padding: 8px 10px;
766
- border: none;
767
- outline: none;
768
- margin: 0px;
769
- }
770
- input[readonly]{
771
- color: #ACA899!important;
772
- background: #FFFFFF;
773
- border: none;
774
- outline: none;
775
- }
776
- input:disabled{
777
- color: #ACA899!important;
778
- background: #FFFFFF;
779
- border: none;
780
- outline: none;
781
- }
782
- textarea[readonly]{
783
- color: #ACA899!important;
784
- background: #FFFFFF;
785
- border: none;
786
- outline: none;
787
- }
788
- textarea:disabled{
789
- color: #ACA899!important;
790
- background: #FFFFFF;
791
- border: none;
792
- outline: none;
793
- }
794
- }
795
- </style>
1
+ <template>
2
+ <div class="form-horizontal select-overspread">
3
+ <validator name='v' @valid="$emit('valid')" @invalid="$emit('invalid')">
4
+ <!--<form>-->
5
+ <div v-for="(index,item) in data.fields">
6
+ <!--input-->
7
+ <div :style="item.style ? item.style : ''"
8
+ v-if="(item.type==='input' || item.type==='number'||item.type === 'tel'||item.type === 'email') && !item.hidden && (item.device === 'app' || !item.device) && (item.label != '证件号码')&&(item.label != '身份证') && (item.label != '用户电话')"
9
+ :class="[item.required && !(item.value) ? 'apply-has-error' : '', item.bootstraped ? item.bootstraped + ' form-group app-input':'col-xs-12 form-group app-input']">
10
+ <label class="control-label-justify">{{item.label}}</label>
11
+ <div :style="item.value_style ? item.value_style:''"
12
+ :class="item.value_bootstraped ? item.value_bootstraped : 'col-xs-8'">
13
+ <input class="" style="width: 100%"
14
+ :type="item.type"
15
+ v-model="data.fields[index].value"
16
+ :placeholder="item.placeholder"
17
+ :value="data.fields[index].value"
18
+ :readonly="item.readonly"
19
+ :disabled="item.disabled"
20
+ @change="onchange(index)"
21
+ @blur="onblur(index)"
22
+ @input="oninput(index)"
23
+ />
24
+ </div>
25
+ </div>
26
+ <!--input-->
27
+ <div :style="item.style ? item.style : ''"
28
+ v-if="(data.f_credentials != '身份证' && item.label === '证件号码')"
29
+ :class="[item.required && !(item.value) ? 'apply-has-error' : '', item.bootstraped ? item.bootstraped + ' form-group app-input':'col-xs-12 form-group app-input']">
30
+ <label class="control-label-justify">{{item.label}}</label>
31
+ <div :style="item.value_style ? item.value_style:''"
32
+ :class="item.value_bootstraped ? item.value_bootstraped : 'col-xs-8'">
33
+ <input class="" style="width: 100%"
34
+ :type="item.type"
35
+ v-model="data.fields[index].value"
36
+ :placeholder="item.placeholder"
37
+ :value="data.fields[index].value"
38
+ :readonly="item.readonly"
39
+ :disabled="item.disabled"
40
+ @change="onchange(index)"
41
+ @blur="onblur(index)"
42
+ @input="oninput(index)"
43
+ />
44
+ </div>
45
+ </div>
46
+ <!--input身份证验证-->
47
+ <div :style="item.style ? item.style : ''"
48
+ v-if="(item.label==='身份证') || (item.label === '证件号码' && data.f_credentials === '身份证')"
49
+ :class="[$v.f_idnumber2.identityCardValid ? 'apply-has-error' : '',item.bootstraped ? item.bootstraped + ' form-group app-input':'col-xs-12 form-group app-input']">
50
+ <label class="control-label-justify">{{item.label}}</label>
51
+ <div :style="item.value_style ? item.value_style:''"
52
+ :class="item.value_bootstraped ? item.value_bootstraped : 'col-xs-8'">
53
+ <input class="" style="width: 100%"
54
+ :type="item.type"
55
+ maxlength="18"
56
+ v-model="data.fields[index].value"
57
+ :placeholder="item.placeholder"
58
+ :value="data.fields[index].value"
59
+ :readonly="item.readonly"
60
+ v-validate:f_idnumber2='{identityCardValid: true}'
61
+ @change="onchange(index)"
62
+ @blur="onblur(index)"
63
+ @input="oninput(index)"
64
+ />
65
+ </div>
66
+ </div>
67
+ <!--input手机号验证-->
68
+ <div :style="item.style ? item.style : ''"
69
+ v-if="item.label === '客户电话'"
70
+ :class="[$v.f_user_phone.minlength || $v.f_user_phone.maxlength ? 'apply-has-error' : '',item.bootstraped ? item.bootstraped + ' form-group app-input':'col-xs-12 form-group app-input']">
71
+ <label class="control-label-justify">{{item.label}}</label>
72
+ <div :style="item.value_style ? item.value_style:''"
73
+ :class="item.value_bootstraped ? item.value_bootstraped : 'col-xs-8'">
74
+ <input class="" style="width: 100%"
75
+ maxlength="18"
76
+ type="number"
77
+ onKeypress="return(/[\d\.]/.test(String.fromCharCode(event.keyCode)))"
78
+ oninput="if(value.length > 11) value=value.slice(0,11)"
79
+ v-validate:f_user_phone="{minlength: 7, maxlength: 11 }"
80
+ v-model="data.fields[index].value"
81
+ :placeholder="item.placeholder"
82
+ :value="data.fields[index].value"
83
+ :readonly="item.readonly"
84
+ @change="onchange(index)"
85
+ @blur="onblur(index)"
86
+ @input="oninput(index)"
87
+ />
88
+ </div>
89
+ </div>
90
+ <!--select-->
91
+ <div :style="item.style ? item.style : ''"
92
+ v-if="item.type==='select' && !item.hidden && (item.device === 'app' || !item.device)&& !item.multiple"
93
+ :class="[item.required && !(item.value) ? 'apply-has-error' : '', item.bootstraped ? item.bootstraped + ' form-group app-input':'col-xs-12 form-group app-input']">
94
+ <label class="control-label-justify">{{item.label}}</label>
95
+ <div :style="item.value_style ? item.value_style:''"
96
+ :class="item.value_bootstraped ? item.value_bootstraped : 'col-xs-8'">
97
+ <v-select
98
+ class="select" width="100%" align="right"
99
+ :placeholder="item.placeholder"
100
+ :search="item.search"
101
+ close-on-select value-single
102
+ @select-search="selectSearch($arguments,index)"
103
+ :options="data.fields[index].options"
104
+ v-model="data.fields[index].value"
105
+ :value.sync="data.fields[index].value"
106
+ @blur="onblur(index)"
107
+ @change="onchange(index)"
108
+ :readonly="item.readonly"
109
+ :disabled="item.disabled"
110
+ ></v-select>
111
+ </div>
112
+ </div>
113
+ <!--select-->
114
+ <div :style="item.style ? item.style : ''"
115
+ v-if="item.type==='select' && !item.hidden && (item.device === 'app' || !item.device)&& item.multiple"
116
+ :class="[item.required && !(item.value) ? 'apply-has-error' : '', item.bootstraped ? item.bootstraped + ' form-group app-input':'col-xs-12 form-group app-input']">
117
+ <label class="control-label-justify">{{item.label}}</label>
118
+ <div :style="item.value_style ? item.value_style:''"
119
+ :class="item.value_bootstraped ? item.value_bootstraped : 'col-xs-8'">
120
+ <v-select
121
+ class="select" width="100%" align="right"
122
+ :placeholder="item.placeholder"
123
+ :search="item.search"
124
+ @select-search="selectSearch($arguments,index)"
125
+ :options="data.fields[index].options"
126
+ v-model="data.fields[index].value"
127
+ :value.sync="data.fields[index].value"
128
+ @blur="onblur(index)"
129
+ @change="onchange(index)"
130
+ :readonly="item.readonly"
131
+ :disabled="item.disabled"
132
+ :multiple="data.fields[index].multiple"
133
+ :valueSingle="true"
134
+ ></v-select>
135
+ </div>
136
+ </div>
137
+ <!--时间datepicker-->
138
+ <div :style="item.style ? item.style : ''"
139
+ v-if="item.type==='datepicker' && !item.hidden && (item.device === 'app' || !item.device)"
140
+ :class="[item.required && !(item.value) ? 'apply-has-error' : '', item.bootstraped ? item.bootstraped+' form-group app-input':'col-xs-12 form-group app-input']">
141
+ <label class="control-label-justify">{{item.label}}</label>
142
+ <div class="form-group" :style="item.value_style ? item.value_style:''"
143
+ :class="item.value_bootstraped ? item.value_bootstraped : 'col-xs-8'">
144
+ <datepicker
145
+ @change="onchange(index)"
146
+ @blur="onblur(index)"
147
+ :placeholder="item.placeholder"
148
+ :value.sync="data.fields[index].value"
149
+ :format="item.format ? item.format : 'yyyy-MM-dd'"
150
+ v-model="data.fields[index].value"
151
+ :readonly="item.readonly"
152
+ :disabled="item.disabled"
153
+ :show-reset-button="true">
154
+ </datepicker>
155
+ </div>
156
+ </div>
157
+ <!--textarea-->
158
+ <div :style="item.style ? item.style : ''"
159
+ v-if="item.type==='textarea' && !item.hidden && (item.device === 'app' || !item.device)"
160
+ :class="[item.required && !(item.value) ? 'apply-has-error' : '', item.bootstraped?item.bootstraped+' form-group app-input':'col-xs-12 form-group app-input']">
161
+ <label class="control-label-justify">{{item.label}}</label>
162
+ <div :style="item.value_style ? item.value_style:''"
163
+ :class="item.value_bootstraped ? item.value_bootstraped : 'col-xs-8'">
164
+ <textarea
165
+ :readonly="item.readonly"
166
+ :disabled="item.disabled"
167
+ class="" :rows="item.rows"
168
+ style="width: 100%;height: 100%"
169
+ v-model="data.fields[index].value"
170
+ :value="data.fields[index].value"
171
+ @change="onchange(index)"
172
+ @blur="onblur(index)"
173
+ @input="oninput(index)"
174
+ ></textarea>
175
+ </div>
176
+ </div>
177
+ <!--checkbox-->
178
+ <div :style="item.style ? item.style : ''"
179
+ v-if="item.type==='checkbox' && !item.hidden && (item.device === 'app' || !item.device)"
180
+ :class="[item.required && item.value.length === 0 ? 'apply-has-error' : '',item.bootstraped?item.bootstraped+' form-group app-input':'col-xs-12 form-group app-input']">
181
+ <label class="control-label-justify">{{item.label}}</label>
182
+ <div :style="item.value_style ? item.value_style:''"
183
+ :class="item.value_bootstraped ? item.value_bootstraped : 'col-xs-8'">
184
+ <label class="" v-for="(index2,row) in item.options">
185
+ <input type="checkbox" class=""
186
+ :readonly="data.fields[index].readonly"
187
+ :disabled="data.fields[index].disabled"
188
+ v-model="data.fields[index].value"
189
+ :value="data.fields[index].options[index2].value"
190
+ @change="onchange(index)"
191
+ @blur="onblur(index)">
192
+ {{row.label}}
193
+ </label>
194
+ </div>
195
+ </div>
196
+ </div>
197
+ <div class="col-sm-12 col-xs-12" id="test11">
198
+ <accordion one-at-a-time="true">
199
+ <panel v-for="(i,item) in data.onetomany" :header="item.title" :is-open="false" type="primary">
200
+ <app-onetomany :onetomany="item" :index="i" :selectdata="data"></app-onetomany>
201
+ </panel>
202
+ <panel v-for="(i,item) in data.components" :header="item.title" :is-open="true" type="primary" v-if="item.device === 'app' || !item.device">
203
+ <component :is="item.name" :selectdata="data" :mark="item.mark"></component>
204
+ </panel>
205
+ </accordion>
206
+ </div>
207
+
208
+ <!--自定义组件-->
209
+ <slot>
210
+
211
+ </slot>
212
+
213
+ <!-- 按钮组 -->
214
+ <div class="text-center">
215
+ <button v-for="(index,button) in data.buttons"
216
+ :disabled="button.disabled && disable_button"
217
+ style="min-width:100px"
218
+ :class="button.disabled && disable_button ? 'btn btn-default button_spacing' : 'btn btn-primary button_spacing'"
219
+ v-if="!button.hidden && button.button_name !=='提交'&& button.button_name !=='确认'"
220
+ @click.prevent="click_but(button)"
221
+ >
222
+ {{button.button_name}}
223
+ </button>
224
+ <button v-for="(index,button) in data.buttons"
225
+ :disabled="(button.disabled && disable_button) || (!$v.valid)"
226
+ style="min-width:100px"
227
+ :class="button.disabled && disable_button || (!$v.valid) ? 'btn btn-default button_spacing' : 'btn btn-primary button_spacing'"
228
+ v-if="!button.hidden && (button.button_name ==='提交'||button.button_name ==='确认')"
229
+ @click.prevent="click_but(button)"
230
+ >
231
+ {{button.button_name}}
232
+ </button>
233
+ </div>
234
+ <div class="text-center" style="margin-top: 1%">
235
+ <button style="min-width:100px"
236
+ class="btn btn-primary "
237
+ v-if="data.defname == '工程施工' || data.defname == '通气验收' "
238
+ @click.prevent="showmaterials()"
239
+ >
240
+ 材料收费
241
+ </button>
242
+ </div>
243
+ <!-- 按钮模态框 -->
244
+ <modal v-if="showButModal" :show.sync="showButModal" backdrop="false" large>
245
+ <header slot="modal-header" class="modal-header">
246
+ <button type="button" class="close" @click="closeModal()"><span>&times;</span></button>
247
+ <span class="modal-title"><font
248
+ size="3">{{data.button.button_name}}</font></span>
249
+ </header>
250
+ <article slot="modal-body" class="modal-body clearfix">
251
+ <div class="form-group" >
252
+ <div v-for="(index,item) in data.button.button_fields">
253
+ <div :style="item.style ? item.style : ''" :class="[item.required && !(item.value) ? 'has-error' : '', item.bootstraped ? item.bootstraped + ' form-group' : 'form-group']"
254
+ v-if="(item.type==='input' || item.type==='number'||item.type === 'tel'||item.type === 'email') && !item.hidden && (item.device === 'pc' || !item.device)">
255
+ <label :style="item.label_style ? item.label_style : ''"
256
+ :class="item.label_bootstraped ? item.label_bootstraped + ' control-label-justify control-label' : 'control-label-justify control-label'">{{item.label}}</label>
257
+ <div :style="item.value_style ? item.value_style : ''"
258
+ :class="item.value_bootstraped ? item.value_bootstraped : 'col-xs-8'">
259
+ <input class="form-control input_view"
260
+ :placeholder="item.placeholder"
261
+ :type="item.type"
262
+ v-model="item.value"
263
+ :value="item.value"
264
+ :readonly="item.readonly"
265
+ :disabled="item.disabled"
266
+ @change="onbutchange(index)"
267
+ @blur="onbutblur(index)"
268
+ @input="onbutinput(index)"
269
+ />
270
+ </div>
271
+ </div>
272
+
273
+ <!--时间datepicker-->
274
+ <div :style="item.style ? item.style : ''" :class="[item.required && !(item.value) ? 'has-error' : '', item.bootstraped ? item.bootstraped + ' form-group':'form-group']"
275
+ v-if="item.type==='datepicker' && !item.hidden && (item.device === 'pc' || !item.device)">
276
+ <label :style="item.label_style ? item.label_style : ''"
277
+ :class="item.label_bootstraped ? item.label_bootstraped + ' control-label-justify control-label' : 'control-label-justify control-label'">{{item.label}}</label>
278
+ <div :style="item.value_style ? item.value_style : ''"
279
+ :class="item.value_bootstraped ? item.value_bootstraped : 'col-xs-8'">
280
+ <datepicker
281
+ :placeholder="item.placeholder"
282
+ :value.sync="item.value"
283
+ v-model="item.value"
284
+ :readonly="item.readonly"
285
+ :disabled="item.disabled"
286
+ :format="item.format ? item.format : 'yyyy-MM-dd'"
287
+ :show-reset-button="true"
288
+ @change="onbutchange(index)"
289
+ @blur="onbutblur(index)"
290
+ ></datepicker>
291
+ </div>
292
+ </div>
293
+
294
+ <!--select-->
295
+ <div :style="item.style ? item.style : ''" :class="[item.required && !(item.value) ? 'has-error' : '', item.bootstraped ? item.bootstraped + ' form-group':'form-group']"
296
+ v-if="item.type==='select' && !item.hidden && (item.device === 'pc' || !item.device)">
297
+ <label :style="item.label_style ? item.label_style : ''"
298
+ :class="item.label_bootstraped ? item.label_bootstraped + ' control-label-justify control-label' : 'control-label-justify control-label'">{{item.label}}</label>
299
+ <div :style="item.value_style ? item.value_style : ''"
300
+ :class="item.value_bootstraped ? item.value_bootstraped : 'col-xs-8'">
301
+ <input-select
302
+ class="select select_list"
303
+ :value.sync="item.value"
304
+ v-model="item.value"
305
+ :options='item.options'
306
+ :readonly="item.readonly"
307
+ :disable="item.disabled"
308
+ :valueSingle="true"
309
+ @blur="onbutblur(index)"
310
+ @change="onbutchange(index)"
311
+ ></input-select>
312
+ </div>
313
+ </div>
314
+
315
+ <!--textarea-->
316
+ <div :style="item.style ? item.style : ''" :class="[item.required && !(item.value) ? 'has-error' : '', item.bootstraped ? item.bootstraped + ' form-group':'form-group']"
317
+ v-if="item.type==='textarea' && !item.hidden && (item.device === 'pc' || !item.device)">
318
+ <label :style="item.label_style ? item.label_style : ''"
319
+ :class="item.label_bootstraped ? item.label_bootstraped + ' control-label-justify control-label' : 'control-label-justify control-label'">{{item.label}}</label>
320
+ <div :style="item.value_style ? item.value_style : ''"
321
+ :class="item.value_bootstraped ? item.value_bootstraped : 'col-xs-8'">
322
+ <textarea
323
+ class="form-control input_view"
324
+ style="width: 100%;height: 100%"
325
+ v-model="item.value"
326
+ :value="item.value"
327
+ :rows="item.rows"
328
+ :readonly="item.readonly"
329
+ :disabled="item.disabled"
330
+ @change="onbutchange(index)"
331
+ @blur="onbutblur(index)"
332
+ @input="onbutinput(index)"
333
+ ></textarea>
334
+ </div>
335
+ </div>
336
+ </div>
337
+ </div>
338
+ </article>
339
+ <footer slot="modal-footer" class="modal-footer">
340
+ <button :class="disable_modal_button ? 'btn btn-default':'btn btn-primary'"
341
+ :disabled="disable_modal_button" type="button" @click="confirmModal()">
342
+ 确认
343
+ </button>
344
+ </footer>
345
+ </modal>
346
+ <!-- <modal :show.sync="showmaterial" backdrop="false" style="overflow: scroll;height: 100%">-->
347
+ <!-- <header slot="modal-header" class="modal-header text-center">-->
348
+ <!-- <button type="button" class="close" @click="showmaterial = false"><span>&times;</span></button>-->
349
+ <!-- <h4 class="modal-title">材料收费列表</h4>-->
350
+ <!-- </header>-->
351
+ <!-- <article slot="modal-body">-->
352
+ <!-- <charges-list v-if="showmaterial" :selectdata = "selectdata"></charges-list>-->
353
+ <!-- </article>-->
354
+ <!-- <footer slot="modal-footer"></footer>-->
355
+ <!-- </modal>-->
356
+ <!--</form>-->
357
+ </validator>
358
+ </div>
359
+ </template>
360
+ <script>
361
+ import Vue from 'vue'
362
+ import {isEmpty} from "../../../components/Util";
363
+ // import chargesList from "telephone-clients/src/filiale/qianneng/android/chargesList";
364
+ // Date格式化
365
+ Date.prototype.Format = function (fmt) {
366
+ var o = {
367
+ 'M+': this.getMonth() + 1, // 月份
368
+ 'd+': this.getDate(), // 日
369
+ 'H+': this.getHours(), // 小时
370
+ 'm+': this.getMinutes(), // 分
371
+ 's+': this.getSeconds(), // 秒
372
+ 'q+': Math.floor((this.getMonth() + 3) / 3), // 季度
373
+ 'S': this.getMilliseconds() // 毫秒
374
+ }
375
+ if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (this.getFullYear() + '').substr(4 - RegExp.$1.length))
376
+ for (var k in o) {
377
+ if (new RegExp('(' + k + ')').test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length === 1) ? (o[k]) : (('00' + o[k]).substr(('' + o[k]).length)))
378
+ }
379
+ return fmt
380
+ }
381
+
382
+ export default {
383
+ title: '报建业务通用组件',
384
+ props: {
385
+ data: {
386
+ type: Object
387
+ },
388
+ showprint: {
389
+ type: Boolean,
390
+ default: true
391
+ }
392
+ },
393
+ data () {
394
+ return {
395
+ model: {}, // 公司等属性
396
+ disable_button: true, // 控制按钮禁用
397
+ disable_modal_button: true, // 控制按钮禁用
398
+ showButModal: false,
399
+ showmaterial: false,
400
+ selectdata:{},
401
+ areaData:{
402
+ sjvalue:'',
403
+ xianvalue:'',
404
+ sqvalue:'',
405
+ mapvalue:'',
406
+ }
407
+ }
408
+ },
409
+ watch: {
410
+ deep: true
411
+ },
412
+ computed: {
413
+
414
+ },
415
+ components: {
416
+ // 'charges-list': chargesList
417
+ },
418
+ created () {
419
+ // 初始化数据
420
+ this.initializtion()
421
+ if (this.data.readyEvent) {
422
+ this.$dispatch(this.data.readyEvent)
423
+ }
424
+ this.$dispatch('initializtionView')
425
+ },
426
+ methods: {
427
+ showmaterials(){
428
+ this.selectdata = {}
429
+ this.selectdata = {
430
+ f_process_id: this.data.f_process_id,
431
+ f_fee_type:'报建费用',
432
+ model:this.data
433
+ }
434
+ this.showmaterial = true
435
+ },
436
+ // 初始化数据
437
+ initializtion () {
438
+ for (const item of this.data.fields) {
439
+ this.data[item.field] = item.value
440
+ }
441
+ // 是否禁用按钮
442
+ this.disableButton()
443
+ },
444
+ async getSelectShijiValue(sjvalue,sjlable) {
445
+
446
+ this.areaData.sjvalue = sjvalue
447
+ console.log("这是父级接收的市级值:",sjvalue,sjlable)
448
+ this.data.areaData = this.areaData
449
+ console.log(this.areaData)
450
+ // 是否禁用按钮
451
+ this.disableButton()
452
+ },
453
+ async getSelectXianValue(xianvalue,xianlable) {
454
+
455
+ this.areaData.xianvalue = xianvalue
456
+ this.data.areaData = this.areaData
457
+ console.log("这是父级接收的县级值:",xianvalue,xianlable)
458
+ console.log(this.areaData)
459
+
460
+ // 是否禁用按钮
461
+ this.disableButton()
462
+ },
463
+ async getSelectShequValue(sqvalue,sqlable) {
464
+ this.areaData.sqvalue = sqvalue
465
+ this.data.areaData = this.areaData
466
+ console.log(this.areaData)
467
+ console.log("这是父级接收的社区值:",sqvalue,sqlable)
468
+
469
+ // 是否禁用按钮
470
+ this.disableButton()
471
+ },
472
+ // 是否禁用按钮
473
+ disableButton () {
474
+ var flag = false
475
+ for (const field of this.data.fields) {
476
+ if (field.required && !field.value && !field.hidden && field.value !== 0) {
477
+ flag = true
478
+ }
479
+
480
+ // 任何选择框只要是否都不能提交
481
+ if (field.type === 'select' && field.value === '否' && field.value_no_disable) {
482
+ flag = true
483
+ }
484
+
485
+ if (field.type === 'checkbox' && field.required && field.value.length === 0) {
486
+ flag = true
487
+ }
488
+ }
489
+ //区域下拉框必选 流程模式为报警器报建 工商业报警器报建
490
+ if ((this.data.f_apply_type === '报警器报建' || this.data.f_apply_type === '工商业报警器报建') && this.data.defname === '工程施工' && this.data.title === '工程施工' && this.data.f_sub_state !='完工'){
491
+ if (!flag){
492
+ if (this.areaData.sjvalue ==null || this.areaData.sjvalue.length ==0 || this.areaData.sqvalue == null || this.areaData.sqvalue.length ==0
493
+ || this.areaData.xianvalue == null || this.areaData.xianvalue == 0){
494
+ console.log("区域为空禁止提交:",this.areaData)
495
+ flag = true
496
+ }
497
+ if (this.areaData.mapvalue ==null || this.areaData.mapvalue ==0){
498
+ console.log("坐标为空禁止提交map:",this.areaData.mapvalue)
499
+ flag = true
500
+ }
501
+ for (const fields of this.areaData.mapvalue) {
502
+ // console.log("报警器数据:",fields.f_bjq_lng)
503
+ if (fields.f_bjq_lng ==null || fields.f_bjq_lng.length ==0){
504
+ console.log("坐标为空禁止提交44444:",this.areaData.mapvalue)
505
+ flag = true
506
+ }
507
+ }
508
+ }
509
+ }
510
+
511
+ this.disable_button = flag
512
+ },
513
+ // 失去焦点且值最终发生变化触发
514
+ async onchange (index) {
515
+ // 是否禁用按钮
516
+ this.disableButton()
517
+ // this.disablebtu()
518
+
519
+ if (!isEmpty(this.data.fields[index].value)) {
520
+ // 前缀、后缀
521
+ if (this.data.fields[index].prefix) {
522
+ this.data.fields[index].value = this.data.fields[index].prefix + this.data.fields[index].value
523
+ }
524
+ if (this.data.fields[index].suffix) {
525
+ this.data.fields[index].value = this.data.fields[index].value + this.data.fields[index].suffix
526
+ }
527
+ }
528
+
529
+ // data赋值
530
+ this.data[this.data.fields[index].field] = this.data.fields[index].value
531
+
532
+ if (this.data.fields[index].type === 'datepicker') {
533
+ this.check_datepicker(index)
534
+ }
535
+
536
+ if (this.data.fields[index].onchange) {
537
+ this.$dispatch(this.data.fields[index].onchange, index)
538
+ }
539
+ this.$dispatch('onchange', index)
540
+
541
+
542
+ },
543
+ // 失去焦点触发,无论值是否发生变化
544
+ onblur (index) {
545
+ this.disableButton()
546
+
547
+ if (this.data.fields[index].onblur) {
548
+ this.$dispatch(this.data.fields[index].onblur, index)
549
+ }
550
+
551
+ this.$dispatch('onblur', index)
552
+ },
553
+ disablebtu(){
554
+ this.flag = true
555
+ },
556
+ oninput (index) {
557
+ // 是否禁用按钮
558
+ this.disableButton()
559
+
560
+ if (this.data.fields[index].oninput) {
561
+ this.$dispatch(this.data.fields[index].oninput, index)
562
+ }
563
+ this.$dispatch('oninput', index)
564
+ },
565
+ // 点击按钮组按钮
566
+ async click_but (button) {
567
+ //报警器区域地址
568
+ this.data.areaData = this.areaData
569
+
570
+ if (this.data.defname === '通气点火') {
571
+
572
+ this.$showMessage(`请确认表号是否正确`).then((res) => {
573
+
574
+
575
+ this.disable_button = true
576
+
577
+ this.data.fields.forEach(item => {
578
+ this.data[item.field] = item.value
579
+ })
580
+
581
+ this.data.button = button
582
+
583
+ if (button.button_fields && button.button_fields.length > 0) {
584
+ this.showButModal = true
585
+ return
586
+ }
587
+
588
+ if (this.data.button.event) {
589
+ this.$dispatch(this.data.button.event)
590
+ } else {
591
+ this.$dispatch('button')
592
+ }
593
+
594
+ })
595
+
596
+ }
597
+ else{
598
+ this.disable_button = true
599
+
600
+ this.data.fields.forEach(item => {
601
+ this.data[item.field] = item.value
602
+ })
603
+
604
+ this.data.button = button
605
+
606
+ if (button.button_fields && button.button_fields.length > 0) {
607
+ this.showButModal = true
608
+ return
609
+ }
610
+
611
+ if (this.data.button.event) {
612
+ this.$dispatch(this.data.button.event)
613
+ } else {
614
+ this.$dispatch('button')
615
+ }
616
+ }
617
+
618
+ },
619
+ confirmModal () {
620
+ this.closeModal()
621
+
622
+ this.data.button.button_fields.forEach(item => {
623
+ this.data.button[item.field] = item.value
624
+ })
625
+
626
+ if (this.data.button.event) {
627
+ this.$dispatch(this.data.button.event)
628
+ } else {
629
+ this.$dispatch('button')
630
+ }
631
+ },
632
+ // 关闭模态框
633
+ closeModal () {
634
+ this.showButModal = false
635
+ this.disable_modal_button = true
636
+ },
637
+ onbutchange (index) {
638
+ // 是否禁用按钮
639
+ this.disableModalButton()
640
+
641
+ if (this.data.button.button_fields[index].onchange) {
642
+ this.$dispatch(this.data.button.button_fields[index].onchange, index)
643
+ } else {
644
+ this.$dispatch('onbutchange', index)
645
+ }
646
+
647
+ },
648
+ onbutblur (index) {
649
+ this.disableModalButton()
650
+
651
+ if (this.data.button.button_fields[index].onblur) {
652
+ this.$dispatch(this.data.button.button_fields[index].onblur, index)
653
+ } else {
654
+ this.$dispatch('onbutblur', index)
655
+ }
656
+ },
657
+ onbutinput (index) {
658
+ // 是否禁用按钮
659
+ this.disableModalButton()
660
+
661
+ if (this.data.button.button_fields[index].oninput) {
662
+ this.$dispatch(this.data.button.button_fields[index].oninput, index)
663
+ } else {
664
+ this.$dispatch('onbutinput', index)
665
+ }
666
+ },
667
+ disableModalButton () {
668
+ let flag = false
669
+
670
+
671
+ for (const item of this.data.button.button_fields) {
672
+ if (item.required && !item.value) {
673
+ if (item.value === 0) {
674
+ flag = false
675
+ } else {
676
+ flag = true
677
+ }
678
+ }
679
+ }
680
+
681
+ this.disable_modal_button = flag
682
+ },
683
+ check_datepicker (index) {
684
+ // 时间格式检测
685
+ if (!isEmpty(this.data.fields[index].value)) {
686
+
687
+ let dateReg = /^[1-9]\d{3}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])$/
688
+ let timeReg = /^(20|21|22|23|[0-1]\d):[0-5]\d:[0-5]\d$/
689
+ 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$/
690
+ if (this.data.fields[index].format) {
691
+ if (this.data.fields[index].format === 'yyyy-MM-dd') {
692
+ if (!dateReg.test(this.data.fields[index].value)) {
693
+ this.data.fields[index].value = ''
694
+ this.$showAlert(this.data.fields[index].label + '格式错误如:2021-01-01', 'warning', 2000)
695
+ }
696
+ }
697
+ if (this.data.fields[index].format === 'HH:mm:ss') {
698
+ if (!timeReg.test(this.data.fields[index].value)) {
699
+ this.data.fields[index].value = ''
700
+ this.$showAlert(this.data.fields[index].label + '格式错误如:00:00:00', 'warning', 2000)
701
+ }
702
+ }
703
+ if (this.data.fields[index].format === 'yyyy-MM-dd HH:mm:ss') {
704
+ if (!datetimeReg.test(this.data.fields[index].value)) {
705
+ this.data.fields[index].value = ''
706
+ this.$showAlert(this.data.fields[index].label + '格式错误如:2021-01-01 00:00:00', 'warning', 2000)
707
+ }
708
+ }
709
+ } else {
710
+ if (!dateReg.test(this.data.fields[index].value)) {
711
+ this.data.fields[index].value = ''
712
+ this.$showAlert(this.data.fields[index].label + '格式错误如:2021-01-01', 'warning', 2000)
713
+ }
714
+ }
715
+ }
716
+ },
717
+ selectSearch(event, index) {
718
+ if (this.data.fields[index].selectSearch) {
719
+ this.$dispatch(this.data.fields[index].selectSearch, event[0], index)
720
+ }
721
+ this.$dispatch('selectSearch', event[0], index)
722
+ }
723
+ },
724
+ events: {
725
+ }
726
+ }
727
+ </script>
728
+ <style scoped>
729
+ .control-label-justify {
730
+ width: 30%;
731
+ text-align: justify;
732
+ text-align-last: justify;
733
+ font-family: PingFang-SC-Bold;
734
+ float: left;
735
+ }
736
+ .button_spacing{margin: 0px 0px 0px 10px;}
737
+ </style>
738
+ <style lang="less">
739
+ .apply-has-error {
740
+ border-bottom: 1px solid #a94442;
741
+ }
742
+ .app-input {
743
+ label {
744
+ float: left;
745
+ }
746
+ .select {
747
+ button {
748
+ border: none;
749
+ outline: none;
750
+ text-align: left;
751
+ .btn-placeholder {
752
+ color: #ACA899
753
+ }
754
+ }
755
+ }
756
+ .datepicker {
757
+ .form-control:focus {
758
+ border: none!important;
759
+ outline: none!important;
760
+ -webkit-box-shadow: none;
761
+ box-shadow: none;
762
+ }
763
+ }
764
+ textarea {
765
+ padding: 8px 10px;
766
+ border: none;
767
+ outline: none;
768
+ margin: 0px;
769
+ }
770
+ input[readonly]{
771
+ color: #ACA899!important;
772
+ background: #FFFFFF;
773
+ border: none;
774
+ outline: none;
775
+ }
776
+ input:disabled{
777
+ color: #ACA899!important;
778
+ background: #FFFFFF;
779
+ border: none;
780
+ outline: none;
781
+ }
782
+ textarea[readonly]{
783
+ color: #ACA899!important;
784
+ background: #FFFFFF;
785
+ border: none;
786
+ outline: none;
787
+ }
788
+ textarea:disabled{
789
+ color: #ACA899!important;
790
+ background: #FFFFFF;
791
+ border: none;
792
+ outline: none;
793
+ }
794
+ }
795
+ </style>