apply-clients 3.3.201 → 3.3.205

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.
@@ -1,638 +1,741 @@
1
- <template>
2
-
3
- <div class="select-overspread" style="background-color: #ffffff;padding: 20px;overflow: scroll">
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)"
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
- <!--时间datepicker-->
30
- <div :style="item.style ? item.style+';height: 40px;margin-bottom: 20px':'height: 40px;margin-bottom: 20px'"
31
- v-if="item.type==='datepicker' && !item.hidden && (item.device === 'pc' || !item.device)"
32
- :class="[item.required && !(item.value) ? 'has-error' : '',item.bootstraped ? item.bootstraped+' form-group':'col-sm-4 form-group']">
33
- <label
34
- :class="item.label_bootstraped ? item.label_bootstraped+' control-label-justify control-label' : 'control-label control-label-justify 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
- <datepicker
38
- @change="onchange(index)"
39
- @blur="onblur(index)"
40
- :placeholder="item.placeholder"
41
- :value.sync="data.fields[index].value"
42
- :format="item.format ? item.format : 'yyyy-MM-dd'"
43
- v-model="data.fields[index].value"
44
- :readonly="item.readonly"
45
- :disabled="item.disabled"
46
- :show-reset-button="reset">
47
- </datepicker>
48
- </div>
49
- </div>
50
-
51
- <!--textarea-->
52
- <div :style="item.style ? item.style+';margin-bottom: 20px':'margin-bottom: 20px'"
53
- v-if="item.type==='textarea' && !item.hidden && (item.device === 'pc' || !item.device)"
54
- :class="[item.required && !(item.value) ? 'has-error' : '',item.bootstraped?item.bootstraped+' form-group':'col-sm-12 form-group']">
55
- <label :style="item.label_style ? item.label_style : ''"
56
- :class="item.label_bootstraped ? item.label_bootstraped + ' control-label-justify control-label' : 'control-label-justify control-label col-sm-3'">{{item.label}}</label>
57
- <div :style="item.value_style ? item.value_style:''"
58
- :class="item.value_bootstraped ? item.value_bootstraped : 'col-sm-10'">
59
- <textarea
60
- :readonly="item.readonly"
61
- :disabled="item.disabled"
62
- class="form-control input_view"
63
- style="width: 100%;height: 100%"
64
- :rows="item.rows"
65
- v-model="data.fields[index].value"
66
- :value="data.fields[index].value"
67
- @change="onchange(index)"
68
- @blur="onblur(index)"
69
- @input="oninput(index)"
70
- >
71
- </textarea>
72
- </div>
73
- </div>
74
-
75
- <!--select-->
76
- <div :style="item.style ? item.style+';height: 40px;margin-bottom: 20px':'height: 40px;margin-bottom: 20px'"
77
- v-if="item.type==='select' && !item.hidden && (item.device === 'pc' || !item.device)"
78
- :class="[item.required && !(item.value) ? 'has-error' : '',item.bootstraped?item.bootstraped+' form-group':'col-sm-4 form-group']">
79
- <label
80
- :class="item.label_bootstraped ? item.label_bootstraped+' control-label control-label-justify':'control-label-justify control-label col-sm-6'">{{item.label}}</label>
81
- <div :style="item.value_style ? item.value_style:''"
82
- :class="item.value_bootstraped ? item.value_bootstraped : 'col-sm-6'">
83
- <input-select
84
- class="select select_list"
85
- @blur="onblur(index)"
86
- @change="onchange(index)"
87
- :readonly="item.readonly"
88
- :disable="item.disabled"
89
- :value.sync="data.fields[index].value"
90
- v-model="data.fields[index].value"
91
- :options='data.fields[index].options'
92
- :valueSingle="true"></input-select>
93
- </div>
94
- </div>
95
-
96
- <!--checkbox-->
97
- <div :style="item.style ? item.style+';height: 40px;margin-bottom: 20px':'height: 40px;margin-bottom: 20px'"
98
- v-if="item.type==='checkbox' && !item.hidden && (item.device === 'pc' || !item.device)"
99
- :class="[item.required && item.value.length === 0 ? 'has-error' : '',item.bootstraped?item.bootstraped+' form-group':'col-sm-4 form-group']">
100
- <label v-if="item.label"
101
- :class="item.label_bootstraped?item.label_bootstraped+' control-label control-label-justify':'control-label-justify control-label col-sm-6'">{{item.label}}</label>
102
- <div :style="item.value_style ? item.value_style:''"
103
- :class="item.value_bootstraped ? item.value_bootstraped : 'col-sm-6'">
104
- <label class="checkbox-inline" v-for="(index2,row) in item.options">
105
- <input type="checkbox" class=""
106
- :readonly="data.fields[index].readonly"
107
- :disabled="data.fields[index].disabled"
108
- v-model="data.fields[index].value"
109
- :value="data.fields[index].options[index2].value"
110
- @change="onchange(index)"
111
- @blur="onblur(index)">
112
- {{row.label}}
113
- </label>
114
- </div>
115
- </div>
116
- </div>
117
- </div>
118
-
119
- <!-- onetomany -->
120
- <div class="" v-for="(index,item) in data.onetomany">
121
- <onetomany :onetomany="item" :index="index" v-if="item.device === 'pc' || !item.device"></onetomany>
122
- </div>
123
-
124
- <div v-for="(i,item) in data.components">
125
- <component v-if="item.device === 'pc' || !item.device" :is="item.name" :selectdata="data" :mark="item.mark"></component>
126
- </div>
127
-
128
- <!--自定义组件-->
129
- <slot></slot>
130
- <!--公司等属性-->
131
- <div class="col-sm-12 form-group text-center" style="padding-top:8px">
132
- <div class="col-sm-3 form-group center-block">
133
- <label class="col-sm-5">所属公司:</label>
134
- <div class="col-sm-6" style="text-align: left">
135
- {{model.orgs}}
136
- </div>
137
- </div>
138
- <div class="col-sm-3 form-group center-block">
139
- <label class="col-sm-5">部门:</label>
140
- <div class="col-sm-6" style="text-align: left">
141
- {{model.parentname}}
142
- </div>
143
- </div>
144
- <div class="col-sm-3 form-group center-block">
145
- <label class="col-sm-5">操作人:</label>
146
- <div class="col-sm-6 " style="text-align: left">
147
- {{model.operator}}
148
- </div>
149
- </div>
150
- <div class="col-sm-3 form-group center-block">
151
- <label class="col-sm-5">操作日期:</label>
152
- <div class="col-sm-6" style="text-align: left">
153
- {{model.operate_date}}
154
- </div>
155
- </div>
156
- </div>
157
- <!-- 按钮组 -->
158
- <div class="from-group col-sm-12 text-center">
159
- <!-- 按钮组 -->
160
- <button v-for="(index,button) in data.buttons"
161
- :disabled="button.disabled && disable_button"
162
- style="min-width:100px"
163
- :class="button.disabled && disable_button ? 'btn btn-default button_spacing' : 'btn btn-primary button_spacing'"
164
- v-if="!button.hidden"
165
- @click.prevent="click_but(button)"
166
- >
167
- {{button.button_name}}
168
- </button>
169
- </div>
170
-
171
- <!-- 按钮模态框 -->
172
- <modal v-if="showButModal" :show.sync="showButModal" backdrop="false" large>
173
- <header slot="modal-header" class="modal-header">
174
- <button type="button" class="close" @click="closeModal()"><span>&times;</span></button>
175
- <span class="modal-title"><font
176
- size="3">{{data.button.button_name}}</font></span>
177
- </header>
178
- <article slot="modal-body" class="modal-body clearfix">
179
- <div class="form-group" style="padding: 0 150px">
180
- <div v-for="(index,item) in data.button.button_fields">
181
- <div :style="item.style ? item.style : ''" :class="[item.required && !(item.value) ? 'has-error' : '', item.bootstraped ? item.bootstraped + ' form-group' : 'form-group']"
182
- v-if="(item.type==='input' || item.type==='number'||item.type === 'tel'||item.type === 'email') && !item.hidden && (item.device === 'pc' || !item.device)">
183
- <label :style="item.label_style ? item.label_style : ''"
184
- :class="item.label_bootstraped ? item.label_bootstraped + ' control-label-justify control-label' : 'control-label-justify control-label col-sm-6'">{{item.label}}</label>
185
- <div :style="item.value_style ? item.value_style : ''"
186
- :class="item.value_bootstraped ? item.value_bootstraped : 'col-sm-9'">
187
- <input class="form-control input_view"
188
- :placeholder="item.placeholder"
189
- :type="item.type"
190
- v-model="item.value"
191
- :value="item.value"
192
- :readonly="item.readonly"
193
- :disabled="item.disabled"
194
- @change="onbutchange(index)"
195
- @blur="onbutblur(index)"
196
- @input="onbutinput(index)"
197
- />
198
- </div>
199
- </div>
200
-
201
- <!--时间datepicker-->
202
- <div :style="item.style ? item.style : ''" :class="[item.required && !(item.value) ? 'has-error' : '', item.bootstraped ? item.bootstraped + ' form-group':'form-group']"
203
- v-if="item.type==='datepicker' && !item.hidden && (item.device === 'pc' || !item.device)">
204
- <label :style="item.label_style ? item.label_style : ''"
205
- :class="item.label_bootstraped ? item.label_bootstraped + ' control-label-justify control-label' : 'control-label-justify control-label col-sm-6'">{{item.label}}</label>
206
- <div :style="item.value_style ? item.value_style : ''"
207
- :class="item.value_bootstraped ? item.value_bootstraped : 'col-sm-9'">
208
- <datepicker
209
- :placeholder="item.placeholder"
210
- :value.sync="item.value"
211
- v-model="item.value"
212
- :readonly="item.readonly"
213
- :disabled="item.disabled"
214
- :format="item.format ? item.format : 'yyyy-MM-dd'"
215
- :show-reset-button="true"
216
- @change="onbutchange(index)"
217
- @blur="onbutblur(index)"
218
- ></datepicker>
219
- </div>
220
- </div>
221
-
222
- <!--select-->
223
- <div :style="item.style ? item.style : ''" :class="[item.required && !(item.value) ? 'has-error' : '', item.bootstraped ? item.bootstraped + ' form-group':'form-group']"
224
- v-if="item.type==='select' && !item.hidden && (item.device === 'pc' || !item.device)">
225
- <label :style="item.label_style ? item.label_style : ''"
226
- :class="item.label_bootstraped ? item.label_bootstraped + ' control-label-justify control-label' : 'control-label-justify control-label col-sm-6'">{{item.label}}</label>
227
- <div :style="item.value_style ? item.value_style : ''"
228
- :class="item.value_bootstraped ? item.value_bootstraped : 'col-sm-9'">
229
- <input-select
230
- class="select select_list"
231
- :value.sync="item.value"
232
- v-model="item.value"
233
- :options='item.options'
234
- :readonly="item.readonly"
235
- :disable="item.disabled"
236
- :valueSingle="true"
237
- @blur="onbutblur(index)"
238
- @change="onbutchange(index)"
239
- ></input-select>
240
- </div>
241
- </div>
242
-
243
- <!--textarea-->
244
- <div :style="item.style ? item.style : ''" :class="[item.required && !(item.value) ? 'has-error' : '', item.bootstraped ? item.bootstraped + ' form-group':'form-group']"
245
- v-if="item.type==='textarea' && !item.hidden && (item.device === 'pc' || !item.device)">
246
- <label :style="item.label_style ? item.label_style : ''"
247
- :class="item.label_bootstraped ? item.label_bootstraped + ' control-label-justify control-label' : 'control-label-justify control-label col-sm-6'">{{item.label}}</label>
248
- <div :style="item.value_style ? item.value_style : ''"
249
- :class="item.value_bootstraped ? item.value_bootstraped : 'col-sm-9'">
250
- <textarea
251
- class="form-control input_view"
252
- style="width: 100%;height: 100%"
253
- v-model="item.value"
254
- :value="item.value"
255
- :rows="item.rows"
256
- :readonly="item.readonly"
257
- :disabled="item.disabled"
258
- @change="onbutchange(index)"
259
- @blur="onbutblur(index)"
260
- @input="onbutinput(index)"
261
- ></textarea>
262
- </div>
263
- </div>
264
- </div>
265
- </div>
266
- </article>
267
- <footer slot="modal-footer" class="modal-footer">
268
- <button :class="disable_modal_button ? 'btn btn-default':'btn btn-primary'"
269
- :disabled="disable_modal_button" type="button" @click="confirmModal()">
270
- 确认
271
- </button>
272
- </footer>
273
- </modal>
274
- </form>
275
- </div>
276
-
277
- </template>
278
- <script>
279
- import Vue from 'vue'
280
- import {isEmpty} from '../Util'
281
- // Date格式化
282
- Date.prototype.Format = function (fmt) {
283
- var o = {
284
- 'M+': this.getMonth() + 1, // 月份
285
- 'd+': this.getDate(), // 日
286
- 'H+': this.getHours(), // 小时
287
- 'm+': this.getMinutes(), // 分
288
- 's+': this.getSeconds(), // 秒
289
- 'q+': Math.floor((this.getMonth() + 3) / 3), // 季度
290
- 'S': this.getMilliseconds() // 毫秒
291
- }
292
- if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (this.getFullYear() + '').substr(4 - RegExp.$1.length))
293
- for (var k in o) {
294
- if (new RegExp('(' + k + ')').test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length === 1) ? (o[k]) : (('00' + o[k]).substr(('' + o[k]).length)))
295
- }
296
- return fmt
297
- }
298
-
299
- export default {
300
- title: '报建业务通用组件',
301
- props: {
302
- data: {
303
- type: Object
304
- }
305
- },
306
- data () {
307
- return {
308
- model: {}, // 公司等属性
309
- disable_button: true, // 控制按钮禁用
310
- disable_modal_button: true, // 控制按钮禁用
311
- showButModal: false
312
- }
313
- },
314
- watch: {
315
- deep: true
316
- },
317
- computed: {
318
-
319
- },
320
- created () {
321
- // 初始化数据
322
- this.initializtion()
323
- if (this.data.readyEvent) {
324
- this.$dispatch(this.data.readyEvent)
325
- }
326
- this.$dispatch('initializtionView')
327
- },
328
- methods: {
329
- // 初始化数据
330
- initializtion () {
331
- for (const item of this.data.fields) {
332
- this.data[item.field] = item.value
333
- }
334
-
335
- // 是否禁用按钮
336
- this.disableButton()
337
-
338
- console.log("----------"+this.$login.f)
339
- // 公司等属性初始化
340
- if (this.data.orgs) {
341
- this.model.orgs = this.data.orgs
342
- } else {
343
- this.model.orgs = this.$login.f.orgs
344
- }
345
- if (this.data.parentname) {
346
- this.model.parentname = this.data.parentname
347
- } else {
348
- this.model.parentname = this.$login.f.f_department_name
349
- }
350
- if (this.data.operate_date) {
351
- this.model.operate_date = this.data.operate_date
352
- } else {
353
- this.model.operate_date = new Date().Format('yyyy-MM-dd')
354
- }
355
- if (this.data.operator) {
356
- this.model.operator = this.data.operator
357
- } else {
358
- this.model.operator = this.$login.f.name
359
- }
360
- },
361
- // 是否禁用按钮
362
- disableButton () {
363
- let flag = false
364
- for (const field of this.data.fields) {
365
- if (field.required && !field.value) {
366
- if (field.value === 0) {
367
- flag = false
368
- } else {
369
- flag = true
370
- }
371
- }
372
-
373
- // 任何选择框只要是否都不能提交
374
- if (field.type === 'select' && field.value === '否' && field.value_no_disable) {
375
- flag = true
376
- }
377
-
378
- if (field.type === 'checkbox' && field.required && field.value.length === 0) {
379
- flag = true
380
- }
381
- }
382
-
383
- if(this.data.defname==='方案确定'){
384
- if( this.data.onetomany && this.data.onetomany[0].rows.length==0 && this.data.onetomany[1].rows.length==0) {
385
- flag = true
386
- }
387
- }
388
-
389
- this.disable_button = flag
390
- },
391
- // 失去焦点且值最终发生变化触发
392
- async onchange (index) {
393
- // 是否禁用按钮
394
- this.disableButton()
395
-
396
- if (!isEmpty(this.data.fields[index].value)) {
397
- // 前缀、后缀
398
- if (this.data.fields[index].prefix) {
399
- this.data.fields[index].value = this.data.fields[index].prefix + this.data.fields[index].value
400
- }
401
- if (this.data.fields[index].suffix) {
402
- this.data.fields[index].value = this.data.fields[index].value + this.data.fields[index].suffix
403
- }
404
- }
405
-
406
- // data赋值
407
- this.data[this.data.fields[index].field] = this.data.fields[index].value
408
-
409
- if (this.data.fields[index].type === 'datepicker') {
410
- this.check_datepicker(index)
411
- }
412
-
413
- if (this.data.fields[index].onchange) {
414
- this.$dispatch(this.data.fields[index].onchange, index)
415
- }
416
- this.$dispatch('onchange', index)
417
-
418
-
419
- },
420
- // 失去焦点触发,无论值是否发生变化
421
- onblur (index) {
422
- this.disableButton()
423
-
424
- if (this.data.fields[index].onblur) {
425
- this.$dispatch(this.data.fields[index].onblur, index)
426
- }
427
-
428
- this.$dispatch('onblur', index)
429
- },
430
- oninput (index) {
431
- // 是否禁用按钮
432
- this.disableButton()
433
-
434
- if (this.data.fields[index].oninput) {
435
- this.$dispatch(this.data.fields[index].oninput, index)
436
- }
437
- this.$dispatch('oninput', index)
438
- },
439
- // 点击按钮组按钮
440
- async click_but (button) {
441
- this.disable_button = true
442
-
443
- this.data.fields.forEach(item => {
444
- this.data[item.field] = item.value
445
- })
446
-
447
- this.data.button = button
448
-
449
- if (button.button_fields && button.button_fields.length > 0) {
450
- this.showButModal = true
451
- return
452
- }
453
-
454
- if (this.data.button.event) {
455
- this.$dispatch(this.data.button.event)
456
- } else {
457
- this.$dispatch('button')
458
- }
459
- },
460
- confirmModal () {
461
- this.closeModal()
462
-
463
- this.data.button.button_fields.forEach(item => {
464
- this.data.button[item.field] = item.value
465
- })
466
-
467
- if (this.data.button.event) {
468
- this.$dispatch(this.data.button.event)
469
- } else {
470
- this.$dispatch('button')
471
- }
472
- },
473
- // 关闭模态框
474
- closeModal () {
475
- this.showButModal = false
476
- this.disable_modal_button = false
477
- },
478
- onbutchange (index) {
479
- // 是否禁用按钮
480
- this.disableModalButton()
481
-
482
- if (this.data.button.button_fields[index].onchange) {
483
- this.$dispatch(this.data.button.button_fields[index].onchange, index)
484
- } else {
485
- this.$dispatch('onbutchange', index)
486
- }
487
-
488
- },
489
- onbutblur (index) {
490
- this.disableModalButton()
491
-
492
- if (this.data.button.button_fields[index].onblur) {
493
- this.$dispatch(this.data.button.button_fields[index].onblur, index)
494
- } else {
495
- this.$dispatch('onbutblur', index)
496
- }
497
- },
498
- onbutinput (index) {
499
- // 是否禁用按钮
500
- this.disableModalButton()
501
-
502
- if (this.data.button.button_fields[index].oninput) {
503
- this.$dispatch(this.data.button.button_fields[index].oninput, index)
504
- } else {
505
- this.$dispatch('onbutinput', index)
506
- }
507
- },
508
- disableModalButton () {
509
- let flag = false
510
-
511
-
512
- for (const item of this.data.button.button_fields) {
513
- if (item.required && !item.value) {
514
- if (item.value === 0) {
515
- flag = false
516
- } else {
517
- flag = true
518
- }
519
- }
520
- }
521
-
522
- this.disable_modal_button = flag
523
- },
524
- check_datepicker (index) {
525
- // 时间格式检测
526
- if (!isEmpty(this.data.fields[index].value)) {
527
-
528
- let dateReg = /^[1-9]\d{3}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])$/
529
- let timeReg = /^(20|21|22|23|[0-1]\d):[0-5]\d:[0-5]\d$/
530
- 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$/
531
- if (this.data.fields[index].format) {
532
- if (this.data.fields[index].format === 'yyyy-MM-dd') {
533
- if (!dateReg.test(this.data.fields[index].value)) {
534
- this.data.fields[index].value = ''
535
- this.$showAlert(this.data.fields[index].label + '格式错误如:2021-01-01', 'warning', 2000)
536
- }
537
- }
538
- if (this.data.fields[index].format === 'HH:mm:ss') {
539
- if (!timeReg.test(this.data.fields[index].value)) {
540
- this.data.fields[index].value = ''
541
- this.$showAlert(this.data.fields[index].label + '格式错误如:00:00:00', 'warning', 2000)
542
- }
543
- }
544
- if (this.data.fields[index].format === 'yyyy-MM-dd HH:mm:ss') {
545
- if (!datetimeReg.test(this.data.fields[index].value)) {
546
- this.data.fields[index].value = ''
547
- this.$showAlert(this.data.fields[index].label + '格式错误如:2021-01-01 00:00:00', 'warning', 2000)
548
- }
549
- }
550
- } else {
551
- if (!dateReg.test(this.data.fields[index].value)) {
552
- this.data.fields[index].value = ''
553
- this.$showAlert(this.data.fields[index].label + '格式错误如:2021-01-01', 'warning', 2000)
554
- }
555
- }
556
- }
557
- }
558
- },
559
- events: {
560
-
561
- }
562
- }
563
- </script>
564
- <style>
565
- .datepicker{
566
- width: 100%!important;
567
- }
568
- .datepicker-input{
569
- background-color: #ffffff!important;
570
- width: 100%!important;
571
- }
572
- .datepicker-input:disabled{
573
- border: 1px solid #DDD!important;
574
- color: #ACA899!important;
575
- width: 100%!important;
576
- }
577
- </style>
578
- <style scoped>
579
- th{
580
- font-size: 15px !important;
581
- text-align: center !important;
582
- background-color: #dfedfb!important;
583
- color: #666666 !important;
584
- font-family: PINGFANG-BOLD !important;
585
- font-weight: normal!important;
586
- }
587
- /*清除model中的浮动*/
588
- .clearfix:after,.clearfix:before{
589
- display: table;
590
- }
591
- .clearfix:after{
592
- clear: both;
593
- }
594
-
595
- .input_view{
596
- padding: 8px;
597
- background-color: #ffffff;
598
- border-radius: 2px;
599
- border: solid 1px #c7c7c7!important;
600
- color: #333333!important;
601
- font-size: 15px!important;
602
- }
603
-
604
- .input_view[readonly]{
605
- border: 1px solid #DDD!important;
606
- color:#ACA899!important;
607
- }
608
- .input_view:disabled{
609
- border: 1px solid #DDD!important;
610
- color:#ACA899!important;
611
- }
612
-
613
- .control-label-justify {
614
- display: inline-block;
615
- vertical-align: top;
616
- width: 110px;
617
- text-align: justify;
618
- font-family: PingFang-SC-Bold;
619
- }
620
-
621
- .control-label-justify::after {
622
- content: "";
623
- display: inline-block;
624
- width: 100%;
625
- overflow: hidden;
626
- height: 0;
627
- }
628
-
629
- input::-webkit-outer-spin-button,
630
- input::-webkit-inner-spin-button {
631
- -webkit-appearance: none;
632
- }
633
-
634
- input[type="number"] {
635
- -moz-appearance: textfield;
636
- }
637
-
638
- </style>
1
+ <template>
2
+
3
+ <div class="select-overspread" style="background-color: #ffffff;padding: 20px;overflow: scroll">
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)"
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
+ <!--时间datepicker-->
30
+ <div :style="item.style ? item.style+';height: 40px;margin-bottom: 20px':'height: 40px;margin-bottom: 20px'"
31
+ v-if="item.type==='datepicker' && !item.hidden && (item.device === 'pc' || !item.device)"
32
+ :class="[item.required && !(item.value) ? 'has-error' : '',item.bootstraped ? item.bootstraped+' form-group':'col-sm-4 form-group']">
33
+ <label
34
+ :class="item.label_bootstraped ? item.label_bootstraped+' control-label-justify control-label' : 'control-label control-label-justify 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
+ <datepicker
38
+ @change="onchange(index)"
39
+ @blur="onblur(index)"
40
+ :placeholder="item.placeholder"
41
+ :value.sync="data.fields[index].value"
42
+ :format="item.format ? item.format : 'yyyy-MM-dd'"
43
+ v-model="data.fields[index].value"
44
+ :readonly="item.readonly"
45
+ :disabled="item.disabled"
46
+ :show-reset-button="reset">
47
+ </datepicker>
48
+ </div>
49
+ </div>
50
+
51
+ <!--textarea-->
52
+ <div :style="item.style ? item.style+';margin-bottom: 20px':'margin-bottom: 20px'"
53
+ v-if="item.type==='textarea' && !item.hidden && (item.device === 'pc' || !item.device)"
54
+ :class="[item.required && !(item.value) ? 'has-error' : '',item.bootstraped?item.bootstraped+' form-group':'col-sm-12 form-group']">
55
+ <label :style="item.label_style ? item.label_style : ''"
56
+ :class="item.label_bootstraped ? item.label_bootstraped + ' control-label-justify control-label' : 'control-label-justify control-label col-sm-3'">{{item.label}}</label>
57
+ <div :style="item.value_style ? item.value_style:''"
58
+ :class="item.value_bootstraped ? item.value_bootstraped : 'col-sm-10'">
59
+ <textarea
60
+ :readonly="item.readonly"
61
+ :disabled="item.disabled"
62
+ class="form-control input_view"
63
+ style="width: 100%;height: 100%"
64
+ :rows="item.rows"
65
+ v-model="data.fields[index].value"
66
+ :value="data.fields[index].value"
67
+ @change="onchange(index)"
68
+ @blur="onblur(index)"
69
+ @input="oninput(index)"
70
+ >
71
+ </textarea>
72
+ </div>
73
+ </div>
74
+
75
+ <!--select-->
76
+ <div :style="item.style ? item.style+';height: 40px;margin-bottom: 20px':'height: 40px;margin-bottom: 20px'"
77
+ v-if="item.type==='select' && !item.hidden && (item.device === 'pc' || !item.device)"
78
+ :class="[item.required && !(item.value) ? 'has-error' : '',item.bootstraped?item.bootstraped+' form-group':'col-sm-4 form-group']">
79
+ <label
80
+ :class="item.label_bootstraped ? item.label_bootstraped+' control-label control-label-justify':'control-label-justify control-label col-sm-6'">{{item.label}}</label>
81
+ <div :style="item.value_style ? item.value_style:''"
82
+ :class="item.value_bootstraped ? item.value_bootstraped : 'col-sm-6'">
83
+ <input-select
84
+ class="select select_list"
85
+ @blur="onblur(index)"
86
+ @change="onchange(index)"
87
+ :readonly="item.readonly"
88
+ :disable="item.disabled"
89
+ :value.sync="data.fields[index].value"
90
+ v-model="data.fields[index].value"
91
+ :options='data.fields[index].options'
92
+ :valueSingle="true"></input-select>
93
+ </div>
94
+ </div>
95
+
96
+ <!--checkbox-->
97
+ <div :style="item.style ? item.style+';height: 40px;margin-bottom: 20px':'height: 40px;margin-bottom: 20px'"
98
+ v-if="item.type==='checkbox' && !item.hidden && (item.device === 'pc' || !item.device)"
99
+ :class="[item.required && item.value.length === 0 ? 'has-error' : '',item.bootstraped?item.bootstraped+' form-group':'col-sm-4 form-group']">
100
+ <label v-if="item.label"
101
+ :class="item.label_bootstraped?item.label_bootstraped+' control-label control-label-justify':'control-label-justify control-label col-sm-6'">{{item.label}}</label>
102
+ <div :style="item.value_style ? item.value_style:''"
103
+ :class="item.value_bootstraped ? item.value_bootstraped : 'col-sm-6'">
104
+ <label class="checkbox-inline" v-for="(index2,row) in item.options">
105
+ <input type="checkbox" class=""
106
+ :readonly="data.fields[index].readonly"
107
+ :disabled="data.fields[index].disabled"
108
+ v-model="data.fields[index].value"
109
+ :value="data.fields[index].options[index2].value"
110
+ @change="onchange(index)"
111
+ @blur="onblur(index)">
112
+ {{row.label}}
113
+ </label>
114
+ </div>
115
+ </div>
116
+ </div>
117
+ </div>
118
+
119
+ <!-- onetomany -->
120
+ <div class="" v-for="(index,item) in data.onetomany">
121
+ <onetomany :onetomany="item" :index="index" v-if="item.device === 'pc' || !item.device"></onetomany>
122
+ </div>
123
+
124
+ <div v-for="(i,item) in data.components">
125
+ <component v-if="item.device === 'pc' || !item.device" :is="item.name" :selectdata="data" :mark="item.mark"></component>
126
+ </div>
127
+
128
+ <!--自定义组件-->
129
+ <slot></slot>
130
+ <!--公司等属性-->
131
+ <div class="col-sm-12 form-group text-center" style="padding-top:8px">
132
+ <div class="col-sm-3 form-group center-block">
133
+ <label class="col-sm-5">所属公司:</label>
134
+ <div class="col-sm-6" style="text-align: left">
135
+ {{model.orgs}}
136
+ </div>
137
+ </div>
138
+ <div class="col-sm-3 form-group center-block">
139
+ <label class="col-sm-5">部门:</label>
140
+ <div class="col-sm-6" style="text-align: left">
141
+ {{model.parentname}}
142
+ </div>
143
+ </div>
144
+ <div class="col-sm-3 form-group center-block">
145
+ <label class="col-sm-5">操作人:</label>
146
+ <div class="col-sm-6 " style="text-align: left">
147
+ {{model.operator}}
148
+ </div>
149
+ </div>
150
+ <div class="col-sm-3 form-group center-block">
151
+ <label class="col-sm-5">操作日期:</label>
152
+ <div class="col-sm-6" style="text-align: left">
153
+ {{model.operate_date}}
154
+ </div>
155
+ </div>
156
+ </div>
157
+ <!-- 按钮组 -->
158
+ <div class="from-group col-sm-12 text-center">
159
+ <!-- 按钮组 -->
160
+ <button v-for="(index,button) in data.buttons"
161
+ :disabled="button.disabled && disable_button"
162
+ style="min-width:100px"
163
+ :class="button.disabled && disable_button ? 'btn btn-default button_spacing' : 'btn btn-primary button_spacing'"
164
+ v-if="!button.hidden"
165
+ @click.prevent="click_but(button)"
166
+ >
167
+ {{button.button_name}}
168
+ </button>
169
+ </div>
170
+
171
+ <!-- 按钮模态框 -->
172
+ <modal v-if="showButModal" :show.sync="showButModal" backdrop="false" large>
173
+ <header slot="modal-header" class="modal-header">
174
+ <button type="button" class="close" @click="closeModal()"><span>&times;</span></button>
175
+ <span class="modal-title"><font
176
+ size="3">{{data.button.button_name}}</font></span>
177
+ </header>
178
+ <article slot="modal-body" class="modal-body clearfix">
179
+ <div class="form-group" style="padding: 0 150px">
180
+ <div v-for="(index,item) in data.button.button_fields">
181
+ <div :style="item.style ? item.style : ''" :class="[item.required && !(item.value) ? 'has-error' : '', item.bootstraped ? item.bootstraped + ' form-group' : 'form-group']"
182
+ v-if="(item.type==='input' || item.type==='number'||item.type === 'tel'||item.type === 'email') && !item.hidden && (item.device === 'pc' || !item.device)">
183
+ <label :style="item.label_style ? item.label_style : ''"
184
+ :class="item.label_bootstraped ? item.label_bootstraped + ' control-label-justify control-label' : 'control-label-justify control-label col-sm-6'">{{item.label}}</label>
185
+ <div :style="item.value_style ? item.value_style : ''"
186
+ :class="item.value_bootstraped ? item.value_bootstraped : 'col-sm-9'">
187
+ <input class="form-control input_view"
188
+ :placeholder="item.placeholder"
189
+ :type="item.type"
190
+ v-model="item.value"
191
+ :value="item.value"
192
+ :readonly="item.readonly"
193
+ :disabled="item.disabled"
194
+ @change="onbutchange(index)"
195
+ @blur="onbutblur(index)"
196
+ @input="onbutinput(index)"
197
+ />
198
+ </div>
199
+ </div>
200
+
201
+ <!--时间datepicker-->
202
+ <div :style="item.style ? item.style : ''" :class="[item.required && !(item.value) ? 'has-error' : '', item.bootstraped ? item.bootstraped + ' form-group':'form-group']"
203
+ v-if="item.type==='datepicker' && !item.hidden && (item.device === 'pc' || !item.device)">
204
+ <label :style="item.label_style ? item.label_style : ''"
205
+ :class="item.label_bootstraped ? item.label_bootstraped + ' control-label-justify control-label' : 'control-label-justify control-label col-sm-6'">{{item.label}}</label>
206
+ <div :style="item.value_style ? item.value_style : ''"
207
+ :class="item.value_bootstraped ? item.value_bootstraped : 'col-sm-9'">
208
+ <datepicker
209
+ :placeholder="item.placeholder"
210
+ :value.sync="item.value"
211
+ v-model="item.value"
212
+ :readonly="item.readonly"
213
+ :disabled="item.disabled"
214
+ :format="item.format ? item.format : 'yyyy-MM-dd'"
215
+ :show-reset-button="true"
216
+ @change="onbutchange(index)"
217
+ @blur="onbutblur(index)"
218
+ ></datepicker>
219
+ </div>
220
+ </div>
221
+
222
+ <!--select-->
223
+ <div :style="item.style ? item.style : ''" :class="[item.required && !(item.value) ? 'has-error' : '', item.bootstraped ? item.bootstraped + ' form-group':'form-group']"
224
+ v-if="item.type==='select' && !item.hidden && (item.device === 'pc' || !item.device)">
225
+ <label :style="item.label_style ? item.label_style : ''"
226
+ :class="item.label_bootstraped ? item.label_bootstraped + ' control-label-justify control-label' : 'control-label-justify control-label col-sm-6'">{{item.label}}</label>
227
+ <div :style="item.value_style ? item.value_style : ''"
228
+ :class="item.value_bootstraped ? item.value_bootstraped : 'col-sm-9'">
229
+ <input-select
230
+ class="select select_list"
231
+ :value.sync="item.value"
232
+ v-model="item.value"
233
+ :options='item.options'
234
+ :readonly="item.readonly"
235
+ :disable="item.disabled"
236
+ :valueSingle="true"
237
+ @blur="onbutblur(index)"
238
+ @change="onbutchange(index)"
239
+ ></input-select>
240
+ </div>
241
+ </div>
242
+
243
+ <!--textarea-->
244
+ <div :style="item.style ? item.style : ''" :class="[item.required && !(item.value) ? 'has-error' : '', item.bootstraped ? item.bootstraped + ' form-group':'form-group']"
245
+ v-if="item.type==='textarea' && !item.hidden && (item.device === 'pc' || !item.device)">
246
+ <label :style="item.label_style ? item.label_style : ''"
247
+ :class="item.label_bootstraped ? item.label_bootstraped + ' control-label-justify control-label' : 'control-label-justify control-label col-sm-6'">{{item.label}}</label>
248
+ <div :style="item.value_style ? item.value_style : ''"
249
+ :class="item.value_bootstraped ? item.value_bootstraped : 'col-sm-9'">
250
+ <textarea
251
+ class="form-control input_view"
252
+ style="width: 100%;height: 100%"
253
+ v-model="item.value"
254
+ :value="item.value"
255
+ :rows="item.rows"
256
+ :readonly="item.readonly"
257
+ :disabled="item.disabled"
258
+ @change="onbutchange(index)"
259
+ @blur="onbutblur(index)"
260
+ @input="onbutinput(index)"
261
+ ></textarea>
262
+ </div>
263
+ </div>
264
+ </div>
265
+ </div>
266
+ </article>
267
+ <footer slot="modal-footer" class="modal-footer">
268
+ <button :class="disable_modal_button ? 'btn btn-default':'btn btn-primary'"
269
+ :disabled="disable_modal_button" type="button" @click="confirmModal()">
270
+ 确认
271
+ </button>
272
+ </footer>
273
+ </modal>
274
+ </form>
275
+ </div>
276
+
277
+ </template>
278
+ <script>
279
+ import Vue from 'vue'
280
+ import {isEmpty} from '../Util'
281
+ // Date格式化
282
+ Date.prototype.Format = function (fmt) {
283
+ var o = {
284
+ 'M+': this.getMonth() + 1, // 月份
285
+ 'd+': this.getDate(), // 日
286
+ 'H+': this.getHours(), // 小时
287
+ 'm+': this.getMinutes(), // 分
288
+ 's+': this.getSeconds(), // 秒
289
+ 'q+': Math.floor((this.getMonth() + 3) / 3), // 季度
290
+ 'S': this.getMilliseconds() // 毫秒
291
+ }
292
+ if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (this.getFullYear() + '').substr(4 - RegExp.$1.length))
293
+ for (var k in o) {
294
+ if (new RegExp('(' + k + ')').test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length === 1) ? (o[k]) : (('00' + o[k]).substr(('' + o[k]).length)))
295
+ }
296
+ return fmt
297
+ }
298
+
299
+ export default {
300
+ title: '报建业务通用组件',
301
+ props: {
302
+ data: {
303
+ type: Object
304
+ }
305
+ },
306
+ data () {
307
+ return {
308
+ model: {}, // 公司等属性
309
+ disable_button: true, // 控制按钮禁用
310
+ disable_modal_button: true, // 控制按钮禁用
311
+ showButModal: false
312
+ }
313
+ },
314
+ watch: {
315
+ deep: true
316
+ },
317
+ computed: {
318
+
319
+ },
320
+ created () {
321
+ // 初始化数据
322
+ this.initializtion()
323
+ if (this.data.readyEvent) {
324
+ this.$dispatch(this.data.readyEvent)
325
+ }
326
+ this.$dispatch('initializtionView')
327
+ },
328
+ ready(){
329
+ this.diaoguo()
330
+ this.diaoguo1()
331
+ this.diaoguo2()
332
+ },
333
+ methods: {
334
+ diaoguo(){
335
+ if (this.model.parentname == '经理部') {
336
+ if(this.data.f_budget_no != '否'){
337
+ for (const item of this.data.fields) {
338
+ if (item.label === '跳过预算审核结果') {
339
+ item.disabled = false
340
+ item.readonly = false
341
+ item.required = true
342
+ }
343
+ }
344
+ }
345
+ }
346
+ },
347
+ diaoguo1(){
348
+ if (this.model.parentname == '经理部') {
349
+ if(this.data.f_toll_no != '否'){
350
+ for (const item of this.data.fields) {
351
+ if ( item.label==='跳过收费审核结果' ) {
352
+ item.disabled = false
353
+ item.readonly = false
354
+ item.required = true
355
+ }
356
+ }
357
+ }
358
+ }
359
+ },
360
+ diaoguo2(){
361
+ if (this.model.parentname == '经理部') {
362
+ if(this.data.f_drawing_issuance_no != '否'){
363
+ for (const item of this.data.fields) {
364
+ if ( item.label==='跳过图纸下发审核结果') {
365
+ item.disabled = false
366
+ item.readonly = false
367
+ item.required = true
368
+ }
369
+ }
370
+ }
371
+ }
372
+ },
373
+ // 初始化数据
374
+ initializtion () {
375
+ for (const item of this.data.fields) {
376
+ this.data[item.field] = item.value
377
+ }
378
+
379
+ // 是否禁用按钮
380
+ this.disableButton()
381
+
382
+ console.log("----------"+this.$login.f)
383
+ // 公司等属性初始化
384
+ if (this.data.orgs) {
385
+ this.model.orgs = this.data.orgs
386
+ } else {
387
+ this.model.orgs = this.$login.f.orgs
388
+ }
389
+ if (this.data.parentname) {
390
+ this.model.parentname = this.data.parentname
391
+ } else {
392
+ this.model.parentname = this.$login.f.f_department_name
393
+ }
394
+ if (this.data.operate_date) {
395
+ this.model.operate_date = this.data.operate_date
396
+ } else {
397
+ this.model.operate_date = new Date().Format('yyyy-MM-dd')
398
+ }
399
+ if (this.data.operator) {
400
+ this.model.operator = this.data.operator
401
+ } else {
402
+ this.model.operator = this.$login.f.name
403
+ }
404
+ },
405
+ // 是否禁用按钮
406
+ disableButton () {
407
+ let flag = false
408
+ for (const field of this.data.fields) {
409
+ if (field.required && !field.value) {
410
+ if (field.value === 0) {
411
+ flag = false
412
+ } else {
413
+ flag = true
414
+ }
415
+ }
416
+ // 任何选择框只要是否都不能提交
417
+ if (field.type === 'select' && field.value === '否' && field.value_no_disable) {
418
+ flag = true
419
+ }
420
+
421
+ if (field.type === 'checkbox' && field.required && field.value.length === 0) {
422
+ flag = true
423
+ }
424
+ }
425
+
426
+ if(this.data.defname==='方案确定'){
427
+ if( this.data.onetomany && this.data.onetomany[0].rows.length==0 && this.data.onetomany[1].rows.length==0) {
428
+ flag = true
429
+ }
430
+ }
431
+ this.disable_button = flag
432
+ },
433
+ // 失去焦点且值最终发生变化触发
434
+ async onchange (index) {
435
+ // 是否禁用按钮
436
+ this.disableButton()
437
+
438
+ if (!isEmpty(this.data.fields[index].value)) {
439
+ // 前缀、后缀
440
+ if (this.data.fields[index].prefix) {
441
+ this.data.fields[index].value = this.data.fields[index].prefix + this.data.fields[index].value
442
+ }
443
+ if (this.data.fields[index].suffix) {
444
+ this.data.fields[index].value = this.data.fields[index].value + this.data.fields[index].suffix
445
+ }
446
+ }
447
+
448
+ // data赋值
449
+ this.data[this.data.fields[index].field] = this.data.fields[index].value
450
+
451
+ if (this.data.fields[index].type === 'datepicker') {
452
+ this.check_datepicker(index)
453
+ }
454
+
455
+ if (this.data.fields[index].onchange) {
456
+ this.$dispatch(this.data.fields[index].onchange, index)
457
+ }
458
+ this.$dispatch('onchange', index)
459
+
460
+
461
+ },
462
+ // 失去焦点触发,无论值是否发生变化
463
+ onblur (index) {
464
+ this.disableButton()
465
+
466
+ if (this.data.fields[index].onblur) {
467
+ this.$dispatch(this.data.fields[index].onblur, index)
468
+ }
469
+
470
+ this.$dispatch('onblur', index)
471
+ },
472
+ oninput (index) {
473
+ // 是否禁用按钮
474
+ this.disableButton()
475
+
476
+ if (this.data.fields[index].oninput) {
477
+ this.$dispatch(this.data.fields[index].oninput, index)
478
+ }
479
+ this.$dispatch('oninput', index)
480
+ },
481
+ // 点击按钮组按钮
482
+ async click_but (button) {
483
+ this.disable_button = true
484
+
485
+ this.data.fields.forEach(item => {
486
+ this.data[item.field] = item.value
487
+ })
488
+
489
+ this.data.button = button
490
+
491
+ if (button.button_fields && button.button_fields.length > 0) {
492
+ this.showButModal = true
493
+ return
494
+ }
495
+
496
+ if (this.data.button.event) {
497
+ this.$dispatch(this.data.button.event)
498
+ } else {
499
+ this.$dispatch('button')
500
+ }
501
+ },
502
+ confirmModal () {
503
+ this.closeModal()
504
+
505
+ this.data.button.button_fields.forEach(item => {
506
+ this.data.button[item.field] = item.value
507
+ })
508
+
509
+ if (this.data.button.event) {
510
+ this.$dispatch(this.data.button.event)
511
+ } else {
512
+ this.$dispatch('button')
513
+ }
514
+ },
515
+ // 关闭模态框
516
+ closeModal () {
517
+ this.showButModal = false
518
+ this.disable_modal_button = false
519
+ },
520
+ onbutchange (index) {
521
+ // 是否禁用按钮
522
+ this.disableModalButton()
523
+
524
+ if (this.data.button.button_fields[index].onchange) {
525
+ this.$dispatch(this.data.button.button_fields[index].onchange, index)
526
+ } else {
527
+ this.$dispatch('onbutchange', index)
528
+ }
529
+
530
+ },
531
+ onbutblur (index) {
532
+ this.disableModalButton()
533
+
534
+ if (this.data.button.button_fields[index].onblur) {
535
+ this.$dispatch(this.data.button.button_fields[index].onblur, index)
536
+ } else {
537
+ this.$dispatch('onbutblur', index)
538
+ }
539
+ },
540
+ onbutinput (index) {
541
+ // 是否禁用按钮
542
+ this.disableModalButton()
543
+
544
+ if (this.data.button.button_fields[index].oninput) {
545
+ this.$dispatch(this.data.button.button_fields[index].oninput, index)
546
+ } else {
547
+ this.$dispatch('onbutinput', index)
548
+ }
549
+ },
550
+ disableModalButton () {
551
+ let flag = false
552
+
553
+
554
+ for (const item of this.data.button.button_fields) {
555
+ if (item.required && !item.value) {
556
+ if (item.value === 0) {
557
+ flag = false
558
+ } else {
559
+ flag = true
560
+ }
561
+ }
562
+ }
563
+
564
+ this.disable_modal_button = flag
565
+ },
566
+ check_datepicker (index) {
567
+ // 时间格式检测
568
+ if (!isEmpty(this.data.fields[index].value)) {
569
+
570
+ let dateReg = /^[1-9]\d{3}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])$/
571
+ let timeReg = /^(20|21|22|23|[0-1]\d):[0-5]\d:[0-5]\d$/
572
+ 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$/
573
+ if (this.data.fields[index].format) {
574
+ if (this.data.fields[index].format === 'yyyy-MM-dd') {
575
+ if (!dateReg.test(this.data.fields[index].value)) {
576
+ this.data.fields[index].value = ''
577
+ this.$showAlert(this.data.fields[index].label + '格式错误如:2021-01-01', 'warning', 2000)
578
+ }
579
+ }
580
+ if (this.data.fields[index].format === 'HH:mm:ss') {
581
+ if (!timeReg.test(this.data.fields[index].value)) {
582
+ this.data.fields[index].value = ''
583
+ this.$showAlert(this.data.fields[index].label + '格式错误如:00:00:00', 'warning', 2000)
584
+ }
585
+ }
586
+ if (this.data.fields[index].format === 'yyyy-MM-dd HH:mm:ss') {
587
+ if (!datetimeReg.test(this.data.fields[index].value)) {
588
+ this.data.fields[index].value = ''
589
+ this.$showAlert(this.data.fields[index].label + '格式错误如:2021-01-01 00:00:00', 'warning', 2000)
590
+ }
591
+ }
592
+ } else {
593
+ if (!dateReg.test(this.data.fields[index].value)) {
594
+ this.data.fields[index].value = ''
595
+ this.$showAlert(this.data.fields[index].label + '格式错误如:2021-01-01', 'warning', 2000)
596
+ }
597
+ }
598
+ }
599
+ }
600
+ },
601
+ events: {
602
+ 'jumpover'(index){
603
+ if(this.data.f_budget_no == '否') {
604
+ for (const item of this.data.fields) {
605
+ if (item.label === '跳过预算审核结果') {
606
+ item.disabled = false
607
+ item.readonly = false
608
+ item.required = false
609
+ }
610
+ }
611
+ }
612
+ if(this.data.f_budget_no == '是') {
613
+ for (const item of this.data.fields) {
614
+ if (item.label === '跳过预算审核结果') {
615
+ item.disabled = true
616
+ item.readonly = true
617
+ item.required = true
618
+ }
619
+ }
620
+ }
621
+ this.diaoguo()
622
+ },
623
+ 'jumpover2'(index){
624
+ if(this.data.f_toll_no == '否') {
625
+ for (const item of this.data.fields) {
626
+ if (item.label === '跳过收费审核结果') {
627
+ item.disabled = false
628
+ item.readonly = false
629
+ item.required = false
630
+ }
631
+ }
632
+ }else{
633
+ for (const item of this.data.fields) {
634
+ if ( item.label=== '跳过收费审核结果') {
635
+ item.disabled = true
636
+ item.readonly = true
637
+ item.required = true
638
+ }
639
+ }
640
+ }
641
+ this.diaoguo1()
642
+ },
643
+ 'jumpover3'(index){
644
+ if(this.data.f_drawing_issuance_no == '否') {
645
+ for (const item of this.data.fields) {
646
+ if ( item.label === '跳过图纸下发审核结果') {
647
+ item.disabled = false
648
+ item.readonly = false
649
+ item.required = false
650
+ }
651
+ }
652
+ }else{
653
+ for (const item of this.data.fields) {
654
+ if (item.label==='跳过图纸下发审核结果') {
655
+ item.disabled = true
656
+ item.readonly = true
657
+ item.required = true
658
+ }
659
+ }
660
+ }
661
+ this.diaoguo2()
662
+ }
663
+
664
+ }
665
+ }
666
+ </script>
667
+ <style>
668
+ .datepicker{
669
+ width: 100%!important;
670
+ }
671
+ .datepicker-input{
672
+ background-color: #ffffff!important;
673
+ width: 100%!important;
674
+ }
675
+ .datepicker-input:disabled{
676
+ border: 1px solid #DDD!important;
677
+ color: #ACA899!important;
678
+ width: 100%!important;
679
+ }
680
+ </style>
681
+ <style scoped>
682
+ th{
683
+ font-size: 15px !important;
684
+ text-align: center !important;
685
+ background-color: #dfedfb!important;
686
+ color: #666666 !important;
687
+ font-family: PINGFANG-BOLD !important;
688
+ font-weight: normal!important;
689
+ }
690
+ /*清除model中的浮动*/
691
+ .clearfix:after,.clearfix:before{
692
+ display: table;
693
+ }
694
+ .clearfix:after{
695
+ clear: both;
696
+ }
697
+
698
+ .input_view{
699
+ padding: 8px;
700
+ background-color: #ffffff;
701
+ border-radius: 2px;
702
+ border: solid 1px #c7c7c7!important;
703
+ color: #333333!important;
704
+ font-size: 15px!important;
705
+ }
706
+
707
+ .input_view[readonly]{
708
+ border: 1px solid #DDD!important;
709
+ color:#ACA899!important;
710
+ }
711
+ .input_view:disabled{
712
+ border: 1px solid #DDD!important;
713
+ color:#ACA899!important;
714
+ }
715
+
716
+ .control-label-justify {
717
+ display: inline-block;
718
+ vertical-align: top;
719
+ width: 110px;
720
+ text-align: justify;
721
+ font-family: PingFang-SC-Bold;
722
+ }
723
+
724
+ .control-label-justify::after {
725
+ content: "";
726
+ display: inline-block;
727
+ width: 100%;
728
+ overflow: hidden;
729
+ height: 0;
730
+ }
731
+
732
+ input::-webkit-outer-spin-button,
733
+ input::-webkit-inner-spin-button {
734
+ -webkit-appearance: none;
735
+ }
736
+
737
+ input[type="number"] {
738
+ -moz-appearance: textfield;
739
+ }
740
+
741
+ </style>