apply-clients 3.2.32 → 3.2.37

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 (37) hide show
  1. package/package.json +1 -1
  2. package/src/AndroidApp.vue +26 -26
  3. package/src/App.vue +20 -20
  4. package/src/apply.js +67 -67
  5. package/src/applyAndroid.js +24 -24
  6. package/src/components/Util.js +359 -359
  7. package/src/components/app_apply/AppOnetomany.vue +90 -90
  8. package/src/components/app_apply/AppServiceView.vue +664 -664
  9. package/src/components/app_apply/AppTakePic.vue +112 -112
  10. package/src/components/app_apply/Process/AppExplorationUser.vue +310 -310
  11. package/src/components/app_apply/Process/AppServiceControl.vue +409 -409
  12. package/src/components/app_apply/Process/Processes/AppInstallationDetails.vue +456 -456
  13. package/src/components/app_apply/Supervisory/AppProcessSupervisory.vue +300 -300
  14. package/src/components/app_apply/Supervisory/AppSupervisoryCart.vue +121 -121
  15. package/src/components/product/ApplyCharge/ApplyChargeList.vue +251 -251
  16. package/src/components/product/ApplyCharge/ApplyChargeReport.vue +107 -107
  17. package/src/components/product/ApplyCharge/ApplyChargeSearch.vue +30 -30
  18. package/src/components/product/Function/InstallFunction.vue +147 -147
  19. package/src/components/product/Function/InstallInfoSelect.vue +281 -281
  20. package/src/components/product/Function/Service/FunctionServiceControl.vue +245 -245
  21. package/src/components/product/Function/StopApplyCrrdList.vue +176 -176
  22. package/src/components/product/Function/functions/StopInstall.vue +106 -106
  23. package/src/components/product/Process/ExplorationSelect.vue +346 -346
  24. package/src/components/product/Process/ExplorationUser.vue +134 -134
  25. package/src/components/product/Process/Processes/InstallationDetails.vue +243 -233
  26. package/src/components/product/Process/Processes/addressAndUserinfoManagement.vue +201 -201
  27. package/src/components/product/Process/Processes/chargeManagement.vue +555 -555
  28. package/src/components/product/Process/Processes/printCharge.vue +133 -133
  29. package/src/components/product/Process/Processes/supplementalAgreement.vue +297 -297
  30. package/src/components/product/Process/ShowBackReason.vue +32 -32
  31. package/src/components/product/ServiceView.vue +759 -759
  32. package/src/components/product/Supervisory/Service/SupervisoryServiceControl.vue +199 -199
  33. package/src/components/product/Supervisory/SupervisoryControl.vue +119 -119
  34. package/src/components/product/Supervisory/SupervisoryList.vue +208 -208
  35. package/src/components/product/Supervisory/SupervisoryhCart.vue +103 -103
  36. package/src/components/product/VueUtils/ApplyUpload.vue +261 -261
  37. package/src/main.js +23 -23
@@ -1,664 +1,664 @@
1
- <template>
2
- <div class="select-overspread">
3
- <validator name="v">
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 : ''"
9
- v-if="(item.type==='input' || item.type==='number'||item.type === 'tel'||item.type === 'email') && !item.hidden && (item.device === 'app' || !item.device)"
10
- :class="[item.required && !(item.value) ? 'has-error' : '',item.bootstraped ? item.bootstraped + ' form-group':'col-xs-12 form-group']">
11
- <div :style="item.label_style ? item.label_style : ''" :class="item.label_bootstraped ? item.label_bootstraped : 'col-xs-4'">
12
- <label class="control-label-justify control-label">{{item.label}}</label>
13
- </div>
14
- <div :style="item.value_style ? item.value_style:''"
15
- :class="item.value_bootstraped ? item.value_bootstraped : 'col-xs-8'">
16
- <input class="form-control input_view"
17
- style="width: 100%;height: 100%;border-radius: 5px"
18
- :type="item.type"
19
- v-model="data.fields[index].value"
20
- :placeholder="item.placeholder"
21
- :value="data.fields[index].value"
22
- :readonly="item.readonly"
23
- :disabled="item.disabled"
24
- @change="onchange(index)"
25
- @blur="onblur(index)"
26
- @input="oninput(index)"
27
- />
28
- <span
29
- v-if="item.error&&item.error.msg&&item.error.flag"
30
- style="color: red">{{item.error.msg}}</span>
31
- </div>
32
- </div>
33
-
34
- <!--时间datepicker-->
35
- <div :style="item.style ? item.style : ''"
36
- v-if="item.type==='datepicker' && !item.hidden && (item.device === 'app' || !item.device)"
37
- :class="[item.required && !(item.value) ? 'has-error' : '',item.bootstraped ? item.bootstraped+' form-group':'col-xs-12 form-group']">
38
- <div :class="item.label_bootstraped ? item.label_bootstraped : 'col-xs-4'">
39
- <label class="control-label-justify control-label">{{item.label}}</label>
40
- </div>
41
- <div :style="item.value_style ? item.value_style:''"
42
- :class="item.value_bootstraped ? item.value_bootstraped : 'col-xs-8'">
43
- <datepicker
44
- @change="onchange(index)"
45
- @blur="onblur(index)"
46
- :placeholder="item.placeholder"
47
- :value.sync="data.fields[index].value"
48
- :format="item.format ? item.format : 'yyyy-MM-dd'"
49
- v-model="data.fields[index].value"
50
- :readonly="item.readonly"
51
- :disabled="item.disabled"
52
- :show-reset-button="reset">
53
- </datepicker>
54
- </div>
55
- <span
56
- v-if="item.error&&item.error.msg&&item.error.flag"
57
- style="color: red">{{item.error.msg}}</span>
58
- </div>
59
-
60
- <!--textarea-->
61
- <div :style="item.style ? item.style : ''"
62
- v-if="item.type==='textarea' && !item.hidden && (item.device === 'app' || !item.device)"
63
- :class="[item.required && !(item.value) ? 'has-error' : '',item.bootstraped?item.bootstraped+' form-group':'col-xs-12 form-group']">
64
- <div :style="item.label_style ? item.label_style : ''" :class="item.label_bootstraped ? item.label_bootstraped : 'col-xs-4'">
65
- <label class="control-label-justify control-label">{{item.label}}</label>
66
- </div>
67
- <div :style="item.value_style ? item.value_style:''"
68
- :class="item.value_bootstraped ? item.value_bootstraped : 'col-xs-8'">
69
- <textarea
70
- :readonly="item.readonly"
71
- :disabled="item.disabled"
72
- class="form-control input_view"
73
- style="width: 100%;height: 100%"
74
- :rows="item.rows"
75
- v-model="data.fields[index].value"
76
- :value="data.fields[index].value"
77
- @change="onchange(index)"
78
- @blur="onblur(index)"
79
- @input="oninput(index)"
80
- >
81
- </textarea>
82
- </div>
83
- <span
84
- v-if="item.error&&item.error.msg&&item.error.flag"
85
- style="color: red">{{item.error.msg}}</span>
86
- </div>
87
-
88
- <!--select-->
89
- <div :style="item.style ? item.style : ''"
90
- v-if="item.type==='select' && !item.hidden && (item.device === 'app' || !item.device)"
91
- :class="[item.required && !(item.value) ? 'has-error' : '',item.bootstraped?item.bootstraped+' form-group':'col-xs-12 form-group']">
92
- <div :style="item.label_style ? item.label_style : ''" :class="item.label_bootstraped ? item.label_bootstraped : 'col-xs-4'">
93
- <label class="control-label control-label-justify">{{item.label}}</label>
94
- </div>
95
- <div :style="item.value_style ? item.value_style:''"
96
- :class="item.value_bootstraped ? item.value_bootstraped : 'col-xs-8'">
97
- <input-select
98
- class="select select_list"
99
- @blur="onblur(index)"
100
- @change="onchange(index)"
101
- :readonly="item.readonly"
102
- :disable="item.disabled"
103
- :value.sync="data.fields[index].value"
104
- v-model="data.fields[index].value"
105
- :options='data.fields[index].options'
106
- :valueSingle="true"></input-select>
107
- </div>
108
- <span
109
- v-if="item.error&&item.error.msg&&item.error.flag"
110
- style="color: red">{{item.error.msg}}</span>
111
- </div>
112
- </div>
113
- </div>
114
-
115
- <accordion one-at-a-time="true">
116
- <panel v-for="(i,item) in data.onetomany" :header="item.title" :is-open="false" type="primary">
117
- <app-onetomany :onetomany="item" :index="i"></app-onetomany>
118
- </panel>
119
- <panel v-for="(i,item) in data.components" :header="item.title" :is-open="false" type="primary" v-if="item.device === 'app' || !item.device">
120
- <component :is="item.name" :selectdata="data" :mark="item.mark"></component>
121
- </panel>
122
- </accordion>
123
-
124
- <!--自定义组件-->
125
- <slot></slot>
126
-
127
- <!-- 按钮组 -->
128
- <div class="form-group text-center">
129
- <div v-for="(index,button) in data.buttons" class="form-group col-xs-6" v-if="!button.hidden">
130
- <button :disabled="(button.button_name==='提交'||button.button_name==='下发') && disable_button"
131
- :class="(button.button_name==='提交'||button.button_name==='下发')&&disable_button?'btn btn-default':'btn btn-primary'"
132
- @click.prevent="clicked(index,button)"
133
- style="min-width:100px;">
134
- {{button.button_name}}
135
- </button>
136
- </div>
137
- </div>
138
- </form>
139
- </validator>
140
-
141
- <!-- onetomany模态框 -->
142
- <modal v-if="show" :show.sync="show" backdrop="false" :large="modalSize === 'large' ? true : false" :small="modalSize === 'small' ? true : false">
143
- <header slot="modal-header" class="modal-header">
144
- <button type="button" class="close" @click="closemodal()"><span>&times;</span></button>
145
- <span class="modal-title"><font
146
- size="3">{{modeltitle}}</font></span>
147
- </header>
148
- <article slot="modal-body" class="modal-body clearfix">
149
- <div
150
- :class="[item.required&&!(item.value) ? 'has-error' : '',item.bootstraped?item.bootstraped + 'form-group' :'col-xs-12 form-group']"
151
- v-for="(index,item) in data.onetomany[onetomany_index].fields" v-if="!item.displayPosition || item.displayPosition === '*' || item.displayPosition === 'from'">
152
- <div :class="item.label_bootstraped ? item.label_bootstraped : 'col-xs-3'">
153
- <label v-show="!item.hidden" class="control-label-justify control-label" >{{item.label}}</label>
154
- </div>
155
- <div :class="item.value_bootstraped ? item.value_bootstraped : 'col-xs-9'" v-show="!item.hidden">
156
- <!--时间datepicker-->
157
- <datepicker
158
- v-if="item.type === 'datepicker'"
159
- @change="onchange_modal(index)"
160
- @blur="onblur_modal(index)"
161
- :placeholder="item.placeholder"
162
- :value.sync="data.onetomany[onetomany_index].fields[index].value"
163
- :format="'yyyy-MM-dd'"
164
- v-model="data.onetomany[onetomany_index].fields[index].value"
165
- :readonly="item.readonly"
166
- :disabled="item.disabled"
167
- :show-reset-button="reset">
168
- </datepicker>
169
- <!--select-->
170
- <input-select
171
- @change="onchange_modal(index)"
172
- v-if="item.type === 'select'"
173
- @blur="onblur_modal(index)"
174
- :value.sync="data.onetomany[onetomany_index].fields[index].value"
175
- v-model="data.onetomany[onetomany_index].fields[index].value"
176
- :options='data.onetomany[onetomany_index].fields[index].options'>
177
- </input-select>
178
- <!-- input -->
179
- <input v-if="item.type==='input' || item.type==='number'||item.type === 'tel'||item.type === 'email'"
180
- class="form-control"
181
- :type="item.type"
182
- v-model="data.onetomany[onetomany_index].fields[index].value"
183
- :placeholder="item.placeholder"
184
- :value="data.onetomany[onetomany_index].fields[index].value"
185
- :readonly="item.readonly"
186
- :disabled="item.disabled"
187
- @change="onchange_modal(index)"
188
- @blur="onblur_modal(index)"
189
- @input="oninput_modal(index)"
190
- />
191
-
192
- <textarea
193
- v-if="item.type==='textarea'"
194
- :readonly="item.readonly"
195
- :disabled="item.disabled"
196
- class="form-control input_view"
197
- style="width: 100%;height: 100%"
198
- :rows="item.rows"
199
- v-model="data.onetomany[onetomany_index].fields[index].value"
200
- :value="data.onetomany[onetomany_index].fields[index].value"
201
- @change="onchange_modal(index)"
202
- @blur="onblur_modal(index)"
203
- @input="oninput_modal(index)"
204
- >
205
- </textarea>
206
- </div>
207
- </div>
208
- </article>
209
- <footer slot="modal-footer" class="modal-footer">
210
- <button :class="disable_button_onetomany?'btn btn-default':'btn btn-primary'"
211
- :disabled="disable_button_onetomany" type="button" @click.prevent="confirm_modal(modeltitle)">
212
- 确认
213
- </button>
214
- </footer>
215
- </modal>
216
-
217
- <!-- 按钮模态框 -->
218
- <modal v-if="showbutmodal" :show.sync="showbutmodal" v-ref:modal backdrop="false">
219
- <header slot="modal-header" class="modal-header">
220
- <button type="button" class="close" @click="closemodal()"><span>&times;</span></button>
221
- <h4 class="modal-title">{{model.button.button_name}}</h4>
222
- </header>
223
- <article slot="modal-body" class="modal-body clearfix">
224
- <div class="col-xs-12 col-sm-12" v-for="(index,button) in data.buttons[model.button.button_index].button_fields">
225
- <label class="control-label col-xs-4" style="margin-top: 10px">{{button.label}}:</label>
226
- <div class="col-xs-8">
227
- <!--select-->
228
- <input-select v-if="button.type=='select'"
229
- :value.sync="data.buttons[model.button.button_index].button_fields[index].value"
230
- v-model="data.buttons[model.button.button_index].button_fields[index].value"
231
- :options='button.options'></input-select>
232
- <!-- input -->
233
- <input v-else type="text" class="form-control"
234
- v-model="data.buttons[model.button.button_index].button_fields[index].value"/>
235
- </div>
236
- </div>
237
- </article>
238
- <footer slot="modal-footer" class="modal-footer">
239
- <button type="button" class="btn btn-primary" :disabled="disable_button_but" @click='confirm_but_modal()'>确认</button>
240
- </footer>
241
- </modal>
242
- </div>
243
- </template>
244
- <script>
245
- import Vue from 'vue'
246
- // Date格式化
247
- Date.prototype.Format = function (fmt) {
248
- var o = {
249
- 'M+': this.getMonth() + 1, // 月份
250
- 'd+': this.getDate(), // 日
251
- 'H+': this.getHours(), // 小时
252
- 'm+': this.getMinutes(), // 分
253
- 's+': this.getSeconds(), // 秒
254
- 'q+': Math.floor((this.getMonth() + 3) / 3), // 季度
255
- 'S': this.getMilliseconds() // 毫秒
256
- }
257
- if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (this.getFullYear() + '').substr(4 - RegExp.$1.length))
258
- for (var k in o) {
259
- if (new RegExp('(' + k + ')').test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length === 1) ? (o[k]) : (('00' + o[k]).substr(('' + o[k]).length)))
260
- }
261
- return fmt
262
- }
263
-
264
- export default {
265
- title: '报建业务通用组件',
266
- props: {
267
- data: {
268
- type: Object
269
- },
270
- showprint: {
271
- type: Boolean,
272
- default: true
273
- }
274
- },
275
- data () {
276
- return {
277
- model: {}, // 公司等属性
278
- disable_button: true, // 控制按钮禁用
279
- show: false, // 控制onetomany模态框
280
- disable_button_onetomany: true, // 控制onetomany模态框按钮
281
- onetomany_index: null, // 当前选择的下标
282
- update_onetomany_index: null, // 当前需要修改的下标
283
- modeltitle: null, // 模态框标题
284
- modalSize: null, // 模态框大小
285
- showbutmodal: false,
286
- }
287
- },
288
- watch: {
289
- deep: true
290
- },
291
- computed: {
292
-
293
- },
294
- created () {
295
- // 初始化数据
296
- this.initializtion()
297
- },
298
- methods: {
299
- // 初始化数据
300
- initializtion () {
301
- // 是否禁用按钮
302
- this.disableButton()
303
- this.$dispatch('initializtionView')
304
- },
305
- // 按钮模态框确定
306
- confirm_but_modal() {
307
- for (const item of this.data.buttons[this.model.button.button_index].button_fields) {
308
- this.model.button.button_fields[item.field] = item.value
309
- }
310
- this.showbutmodal = false
311
- this.disable_button_but = true
312
- this.$dispatch('button', this.model)
313
- },
314
- // 点击按钮组按钮
315
- async clicked(index, button) {
316
- this.disable_button = true
317
- // 组织model.fields数据
318
- for (const item of this.data.fields) {
319
- // checkbox特殊处理
320
- if (item.type === 'checkbox') {
321
- for (let j = 0; j < item.items.length; j++) {
322
- this.model[item.items[j].field] = item.items[j].value
323
- }
324
- } else {
325
- this.model[item.field] = item.value
326
- }
327
- }
328
- this.model.f_process_id = this.data.f_process_id
329
-
330
- // 初始化model.button数据
331
- let buttondatas = {
332
- button_fields: {}
333
- }
334
- buttondatas.button_name = button.button_name
335
- buttondatas.button_index = index
336
- if (button.button_fields) {
337
- for (const item of button.button_fields) {
338
- buttondatas.button_fields[item.field] = item.value
339
- }
340
- }
341
- this.model.button = buttondatas
342
- this.model.title = this.data.title
343
- this.model.fields = this.data.fields
344
- this.model.onetomany = this.data.onetomany
345
-
346
-
347
- if (button.button_name === '退回') {
348
- this.showbutmodal = true
349
- } else if (button.button_name === '下发') {
350
- this.showbutmodal = true
351
- } else {
352
- this.$dispatch('button', this.model)
353
- }
354
- },
355
- // 是否禁用按钮
356
- disableButton () {
357
- let fields = this.data.fields
358
-
359
- let flag = false
360
- for (const item of fields) {
361
- if (item.type !== 'checkbox' && item.required && !item.value) {
362
- if (item.value === 0) {
363
- flag = false
364
- } else {
365
- flag = true
366
- }
367
- }
368
- // 任何选择框只要是否都不能提交
369
- if (item.type === 'select' && item.value === '否' && item.disabledButton) {
370
- flag = true
371
- }
372
- }
373
-
374
- let count = 0
375
- for (const item of fields) {
376
- if (item.type !== 'checkbox' && item.required) {
377
- count++
378
- }
379
- }
380
- if (count === 0) {
381
- flag = false
382
- }
383
-
384
- this.disable_button = flag
385
- },
386
- // 失去焦点触发,无论值是否发生变化
387
- onblur (index) {
388
- // 是否禁用按钮
389
- this.disableButton()
390
-
391
- this.$dispatch('onblur', index)
392
- // 如果有错误信息提示走错误信息判断处理
393
-
394
- if (this.data.fields[index].error || this.data.fields[index].type === 'datepicker') {
395
- this.$dispatch('error_check', index)
396
- }
397
- },
398
- // 失去焦点且值最终发生变化触发
399
- async onchange (index) {
400
- console.log('失去焦点-----', index)
401
- console.log(this.data.fields[index].label)
402
- console.log('禁用按钮--前--', this.disable_button)
403
- // 是否禁用按钮
404
- this.disableButton()
405
-
406
- console.log('禁用按钮--后--', this.disable_button)
407
-
408
- this.data.fields[index].value = this.data.fields[index].value.trim()
409
-
410
- if (this.data.fields[index].prefix && this.data.fields[index].value !== '') {
411
- this.data.fields[index].value = this.data.fields[index].prefix + this.data.fields[index].value
412
- }
413
-
414
- this.data[this.data.fields[index].field] = this.data.fields[index].value
415
-
416
- await this.$dispatch('onchange', index)
417
-
418
- // 如果有错误信息提示走错误信息判断处理
419
- if (this.data.fields[index].error || this.data.fields[index].type === 'datepicker') {
420
- this.$dispatch('error_check', index)
421
- }
422
- },
423
- oninput (index) {
424
- // 是否禁用按钮
425
- this.disableButton()
426
-
427
- this.$dispatch('oninput', index)
428
-
429
- // 如果有错误信息提示走错误信息判断处理
430
- if (this.data.fields[index].error || this.data.fields[index].type === 'datepicker') {
431
- this.$dispatch('error_check', index)
432
- }
433
- },
434
- // 模态框确认按钮
435
- confirm_modal (title) {
436
- if (title === '新增') {
437
- if (this.data.onetomany[this.onetomany_index].addEvent === 'default' || !this.data.onetomany[this.onetomany_index].addEvent) {
438
- this.$dispatch('onetomanyadd', this.onetomany_index)
439
- } else {
440
- this.$dispatch(this.data.onetomany[this.onetomany_index].addEvent, this.onetomany_index)
441
- }
442
- } else {
443
- if (this.data.onetomany[this.onetomany_index].updateEvent === 'default' || !this.data.onetomany[this.onetomany_index].updateEvent) {
444
- this.$dispatch('onetomanyupdate', this.onetomany_index, this.update_onetomany_index)
445
- } else {
446
- this.$dispatch(this.data.onetomany[this.onetomany_index].updateEvent, this.onetomany_index, this.update_onetomany_index)
447
- }
448
- }
449
-
450
- this.closemodal()
451
- },
452
- // 关闭模态框
453
- closemodal () {
454
- debugger
455
- for (const item of this.data.onetomany[this.onetomany_index].fields) {
456
- item.value = ''
457
- }
458
-
459
- this.show = false
460
- this.showbutmodal = false
461
- this.disable_button_onetomany = true
462
- this.onetomany_index = null
463
- this.update_onetomany_index = null
464
- this.modeltitle = null
465
- this.modalSize = null
466
- },
467
- // 是否禁用模态框按钮
468
- disableModalButton () {
469
- let fields = this.data.onetomany[this.onetomany_index].fields
470
-
471
- let flag = false
472
- for (const item of fields) {
473
- if (item.type !== 'checkbox' && item.required && !item.value) {
474
- if (item.value === 0) {
475
- flag = false
476
- } else {
477
- flag = true
478
- }
479
- }
480
- }
481
-
482
- let count = 0
483
- for (const item of fields) {
484
- if (item.type !== 'checkbox' && item.required) {
485
- count++
486
- }
487
- }
488
- if (count === 0) {
489
- flag = false
490
- }
491
- this.disable_button_onetomany = flag
492
- },
493
- // 监听模态框属性失去焦点
494
- onchange_modal (index) {
495
- this.disableModalButton()
496
- this.$dispatch('onchange_modal', this.onetomany_index, index)
497
- },
498
- // 监听模态框属性失去焦点
499
- onblur_modal (index) {
500
- this.disableModalButton()
501
- this.$dispatch('onblur_modal', this.onetomany_index, index)
502
- },
503
- // input输入属性值发生变化监听
504
- oninput_modal (index) {
505
- this.disableModalButton()
506
- this.$dispatch('oninput_modal', this.onetomany_index, index)
507
- }
508
- },
509
- events: {
510
- 'add' (index) {
511
- let count = 0
512
- for (const item of this.data.onetomany[index].fields) {
513
- if (item.type === 'datepicker' && !item.value && item.default) {
514
- item.value = new Date().Format('yyyy-MM-dd')
515
- }
516
- if (item.required) {
517
- count++
518
- }
519
- }
520
-
521
- if (count === 0) {
522
- this.disable_button_onetomany = false
523
- }
524
- this.modeltitle = '新增'
525
- this.modalSize = this.data.onetomany[index].modalSize
526
- this.onetomany_index = index
527
-
528
- this.$dispatch('openAddModel',index)
529
-
530
- this.show = true
531
- },
532
- 'update' (i, j) {
533
- let onetomany = this.data.onetomany[i]
534
- let item = this.data.onetomany[i].rows[j]
535
- let count = 0
536
- for (let k = 0; k < onetomany.fields.length; k++) {
537
- // 防止初始化的时候没有value
538
- Vue.set(this.data.onetomany[i].fields[k], 'value', item[this.data.onetomany[i].fields[k].field])
539
-
540
- if (onetomany.fields[j].required) {
541
- count++
542
- }
543
- }
544
- if (count === 0) {
545
- this.disable_button_onetomany = false
546
- }
547
- this.modeltitle = '修改'
548
- this.modalSize = this.data.onetomany[i].modalSize
549
- this.onetomany_index = i
550
- this.update_onetomany_index = j
551
-
552
- this.$dispatch('openUpdateModel',i,j)
553
-
554
- this.show = true
555
-
556
- this.disableModalButton()
557
- },
558
- 'delete'(i, j) {
559
- this.$showMessage((this.data.onetomany[i].deleteMessage === 'default' || !this.data.onetomany[i].deleteMessage) ? '您确定要删除这条记录吗?' : this.data.onetomany[i].deleteMessage, ['confirm']).then((res) => {
560
- if (res === 'confirm') {
561
- if (this.data.onetomany[i].deleteEvent === 'default' || !this.data.onetomany[i].deleteEvent) {
562
- this.$dispatch('onetomanydelete', i, j)
563
- } else {
564
- this.$dispatch(this.data.onetomany[i].deleteEvent, i, j)
565
- }
566
- }
567
- })
568
- }
569
- }
570
- }
571
- </script>
572
- <style>
573
- .datepicker{
574
- width: 100%!important;
575
- }
576
- .datepicker-input{
577
- background-color: #ffffff!important;
578
- width: 100%!important;
579
- }
580
- .datepicker-input:disabled{
581
- border: 1px solid #DDD!important;
582
- color: #ACA899!important;
583
- width: 100%!important;
584
- }
585
- </style>
586
- <style scoped>
587
- .app-text {
588
- font-size: 12px;
589
- }
590
- .panel-self{
591
- border-radius: 10px;
592
- border:1px solid #499EDF;
593
- background-color: #F8F8F8;
594
- }
595
- .font{
596
- font: 15px PingFang-SC-Medium;
597
- color: #666666;
598
- }
599
- .input-font{
600
- font: 15px PingFang-SC-Medium;
601
- color: #333333;
602
- }
603
- th{
604
- font-size: 15px !important;
605
- text-align: center !important;
606
- background-color: #dfedfb!important;
607
- color: #666666 !important;
608
- font-family: PINGFANG-BOLD !important;
609
- font-weight: normal!important;
610
- }
611
- /*清除model中的浮动*/
612
- .clearfix:after,.clearfix:before{
613
- display: table;
614
- }
615
- .clearfix:after{
616
- clear: both;
617
- }
618
-
619
- .input_view{
620
- padding: 8px;
621
- background-color: #ffffff;
622
- border-radius: 2px;
623
- border: solid 1px #c7c7c7!important;
624
- color: #333333!important;
625
- font-size: 15px!important;
626
- }
627
-
628
- .input_view[readonly]{
629
- border: 1px solid #DDD!important;
630
- /*background-color: #F5F5F5;*/
631
- color:#ACA899!important;
632
- }
633
- .input_view:disabled{
634
- border: 1px solid #DDD!important;
635
- /*background-color: #F5F5F5;*/
636
- color:#ACA899!important;
637
- }
638
-
639
- .control-label-justify {
640
- display: inline-block;
641
- vertical-align: top;
642
- width: 100%;
643
- text-align: justify;
644
- font-family: PingFang-SC-Bold;
645
- }
646
-
647
- .control-label-justify::after {
648
- content: "";
649
- display: inline-block;
650
- width: 100%;
651
- overflow: hidden;
652
- height: 0;
653
- }
654
-
655
- input::-webkit-outer-spin-button,
656
- input::-webkit-inner-spin-button {
657
- -webkit-appearance: none;
658
- }
659
-
660
- input[type="number"] {
661
- -moz-appearance: textfield;
662
- }
663
-
664
- </style>
1
+ <template>
2
+ <div class="select-overspread">
3
+ <validator name="v">
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 : ''"
9
+ v-if="(item.type==='input' || item.type==='number'||item.type === 'tel'||item.type === 'email') && !item.hidden && (item.device === 'app' || !item.device)"
10
+ :class="[item.required && !(item.value) ? 'has-error' : '',item.bootstraped ? item.bootstraped + ' form-group':'col-xs-12 form-group']">
11
+ <div :style="item.label_style ? item.label_style : ''" :class="item.label_bootstraped ? item.label_bootstraped : 'col-xs-4'">
12
+ <label class="control-label-justify control-label">{{item.label}}</label>
13
+ </div>
14
+ <div :style="item.value_style ? item.value_style:''"
15
+ :class="item.value_bootstraped ? item.value_bootstraped : 'col-xs-8'">
16
+ <input class="form-control input_view"
17
+ style="width: 100%;height: 100%;border-radius: 5px"
18
+ :type="item.type"
19
+ v-model="data.fields[index].value"
20
+ :placeholder="item.placeholder"
21
+ :value="data.fields[index].value"
22
+ :readonly="item.readonly"
23
+ :disabled="item.disabled"
24
+ @change="onchange(index)"
25
+ @blur="onblur(index)"
26
+ @input="oninput(index)"
27
+ />
28
+ <span
29
+ v-if="item.error&&item.error.msg&&item.error.flag"
30
+ style="color: red">{{item.error.msg}}</span>
31
+ </div>
32
+ </div>
33
+
34
+ <!--时间datepicker-->
35
+ <div :style="item.style ? item.style : ''"
36
+ v-if="item.type==='datepicker' && !item.hidden && (item.device === 'app' || !item.device)"
37
+ :class="[item.required && !(item.value) ? 'has-error' : '',item.bootstraped ? item.bootstraped+' form-group':'col-xs-12 form-group']">
38
+ <div :class="item.label_bootstraped ? item.label_bootstraped : 'col-xs-4'">
39
+ <label class="control-label-justify control-label">{{item.label}}</label>
40
+ </div>
41
+ <div :style="item.value_style ? item.value_style:''"
42
+ :class="item.value_bootstraped ? item.value_bootstraped : 'col-xs-8'">
43
+ <datepicker
44
+ @change="onchange(index)"
45
+ @blur="onblur(index)"
46
+ :placeholder="item.placeholder"
47
+ :value.sync="data.fields[index].value"
48
+ :format="item.format ? item.format : 'yyyy-MM-dd'"
49
+ v-model="data.fields[index].value"
50
+ :readonly="item.readonly"
51
+ :disabled="item.disabled"
52
+ :show-reset-button="reset">
53
+ </datepicker>
54
+ </div>
55
+ <span
56
+ v-if="item.error&&item.error.msg&&item.error.flag"
57
+ style="color: red">{{item.error.msg}}</span>
58
+ </div>
59
+
60
+ <!--textarea-->
61
+ <div :style="item.style ? item.style : ''"
62
+ v-if="item.type==='textarea' && !item.hidden && (item.device === 'app' || !item.device)"
63
+ :class="[item.required && !(item.value) ? 'has-error' : '',item.bootstraped?item.bootstraped+' form-group':'col-xs-12 form-group']">
64
+ <div :style="item.label_style ? item.label_style : ''" :class="item.label_bootstraped ? item.label_bootstraped : 'col-xs-4'">
65
+ <label class="control-label-justify control-label">{{item.label}}</label>
66
+ </div>
67
+ <div :style="item.value_style ? item.value_style:''"
68
+ :class="item.value_bootstraped ? item.value_bootstraped : 'col-xs-8'">
69
+ <textarea
70
+ :readonly="item.readonly"
71
+ :disabled="item.disabled"
72
+ class="form-control input_view"
73
+ style="width: 100%;height: 100%"
74
+ :rows="item.rows"
75
+ v-model="data.fields[index].value"
76
+ :value="data.fields[index].value"
77
+ @change="onchange(index)"
78
+ @blur="onblur(index)"
79
+ @input="oninput(index)"
80
+ >
81
+ </textarea>
82
+ </div>
83
+ <span
84
+ v-if="item.error&&item.error.msg&&item.error.flag"
85
+ style="color: red">{{item.error.msg}}</span>
86
+ </div>
87
+
88
+ <!--select-->
89
+ <div :style="item.style ? item.style : ''"
90
+ v-if="item.type==='select' && !item.hidden && (item.device === 'app' || !item.device)"
91
+ :class="[item.required && !(item.value) ? 'has-error' : '',item.bootstraped?item.bootstraped+' form-group':'col-xs-12 form-group']">
92
+ <div :style="item.label_style ? item.label_style : ''" :class="item.label_bootstraped ? item.label_bootstraped : 'col-xs-4'">
93
+ <label class="control-label control-label-justify">{{item.label}}</label>
94
+ </div>
95
+ <div :style="item.value_style ? item.value_style:''"
96
+ :class="item.value_bootstraped ? item.value_bootstraped : 'col-xs-8'">
97
+ <input-select
98
+ class="select select_list"
99
+ @blur="onblur(index)"
100
+ @change="onchange(index)"
101
+ :readonly="item.readonly"
102
+ :disable="item.disabled"
103
+ :value.sync="data.fields[index].value"
104
+ v-model="data.fields[index].value"
105
+ :options='data.fields[index].options'
106
+ :valueSingle="true"></input-select>
107
+ </div>
108
+ <span
109
+ v-if="item.error&&item.error.msg&&item.error.flag"
110
+ style="color: red">{{item.error.msg}}</span>
111
+ </div>
112
+ </div>
113
+ </div>
114
+
115
+ <accordion one-at-a-time="true">
116
+ <panel v-for="(i,item) in data.onetomany" :header="item.title" :is-open="false" type="primary">
117
+ <app-onetomany :onetomany="item" :index="i"></app-onetomany>
118
+ </panel>
119
+ <panel v-for="(i,item) in data.components" :header="item.title" :is-open="false" type="primary" v-if="item.device === 'app' || !item.device">
120
+ <component :is="item.name" :selectdata="data" :mark="item.mark"></component>
121
+ </panel>
122
+ </accordion>
123
+
124
+ <!--自定义组件-->
125
+ <slot></slot>
126
+
127
+ <!-- 按钮组 -->
128
+ <div class="form-group text-center">
129
+ <div v-for="(index,button) in data.buttons" class="form-group col-xs-6" v-if="!button.hidden">
130
+ <button :disabled="(button.button_name==='提交'||button.button_name==='下发') && disable_button"
131
+ :class="(button.button_name==='提交'||button.button_name==='下发')&&disable_button?'btn btn-default':'btn btn-primary'"
132
+ @click.prevent="clicked(index,button)"
133
+ style="min-width:100px;">
134
+ {{button.button_name}}
135
+ </button>
136
+ </div>
137
+ </div>
138
+ </form>
139
+ </validator>
140
+
141
+ <!-- onetomany模态框 -->
142
+ <modal v-if="show" :show.sync="show" backdrop="false" :large="modalSize === 'large' ? true : false" :small="modalSize === 'small' ? true : false">
143
+ <header slot="modal-header" class="modal-header">
144
+ <button type="button" class="close" @click="closemodal()"><span>&times;</span></button>
145
+ <span class="modal-title"><font
146
+ size="3">{{modeltitle}}</font></span>
147
+ </header>
148
+ <article slot="modal-body" class="modal-body clearfix">
149
+ <div
150
+ :class="[item.required&&!(item.value) ? 'has-error' : '',item.bootstraped?item.bootstraped + 'form-group' :'col-xs-12 form-group']"
151
+ v-for="(index,item) in data.onetomany[onetomany_index].fields" v-if="!item.displayPosition || item.displayPosition === '*' || item.displayPosition === 'from'">
152
+ <div :class="item.label_bootstraped ? item.label_bootstraped : 'col-xs-3'">
153
+ <label v-show="!item.hidden" class="control-label-justify control-label" >{{item.label}}</label>
154
+ </div>
155
+ <div :class="item.value_bootstraped ? item.value_bootstraped : 'col-xs-9'" v-show="!item.hidden">
156
+ <!--时间datepicker-->
157
+ <datepicker
158
+ v-if="item.type === 'datepicker'"
159
+ @change="onchange_modal(index)"
160
+ @blur="onblur_modal(index)"
161
+ :placeholder="item.placeholder"
162
+ :value.sync="data.onetomany[onetomany_index].fields[index].value"
163
+ :format="'yyyy-MM-dd'"
164
+ v-model="data.onetomany[onetomany_index].fields[index].value"
165
+ :readonly="item.readonly"
166
+ :disabled="item.disabled"
167
+ :show-reset-button="reset">
168
+ </datepicker>
169
+ <!--select-->
170
+ <input-select
171
+ @change="onchange_modal(index)"
172
+ v-if="item.type === 'select'"
173
+ @blur="onblur_modal(index)"
174
+ :value.sync="data.onetomany[onetomany_index].fields[index].value"
175
+ v-model="data.onetomany[onetomany_index].fields[index].value"
176
+ :options='data.onetomany[onetomany_index].fields[index].options'>
177
+ </input-select>
178
+ <!-- input -->
179
+ <input v-if="item.type==='input' || item.type==='number'||item.type === 'tel'||item.type === 'email'"
180
+ class="form-control"
181
+ :type="item.type"
182
+ v-model="data.onetomany[onetomany_index].fields[index].value"
183
+ :placeholder="item.placeholder"
184
+ :value="data.onetomany[onetomany_index].fields[index].value"
185
+ :readonly="item.readonly"
186
+ :disabled="item.disabled"
187
+ @change="onchange_modal(index)"
188
+ @blur="onblur_modal(index)"
189
+ @input="oninput_modal(index)"
190
+ />
191
+
192
+ <textarea
193
+ v-if="item.type==='textarea'"
194
+ :readonly="item.readonly"
195
+ :disabled="item.disabled"
196
+ class="form-control input_view"
197
+ style="width: 100%;height: 100%"
198
+ :rows="item.rows"
199
+ v-model="data.onetomany[onetomany_index].fields[index].value"
200
+ :value="data.onetomany[onetomany_index].fields[index].value"
201
+ @change="onchange_modal(index)"
202
+ @blur="onblur_modal(index)"
203
+ @input="oninput_modal(index)"
204
+ >
205
+ </textarea>
206
+ </div>
207
+ </div>
208
+ </article>
209
+ <footer slot="modal-footer" class="modal-footer">
210
+ <button :class="disable_button_onetomany?'btn btn-default':'btn btn-primary'"
211
+ :disabled="disable_button_onetomany" type="button" @click.prevent="confirm_modal(modeltitle)">
212
+ 确认
213
+ </button>
214
+ </footer>
215
+ </modal>
216
+
217
+ <!-- 按钮模态框 -->
218
+ <modal v-if="showbutmodal" :show.sync="showbutmodal" v-ref:modal backdrop="false">
219
+ <header slot="modal-header" class="modal-header">
220
+ <button type="button" class="close" @click="closemodal()"><span>&times;</span></button>
221
+ <h4 class="modal-title">{{model.button.button_name}}</h4>
222
+ </header>
223
+ <article slot="modal-body" class="modal-body clearfix">
224
+ <div class="col-xs-12 col-sm-12" v-for="(index,button) in data.buttons[model.button.button_index].button_fields">
225
+ <label class="control-label col-xs-4" style="margin-top: 10px">{{button.label}}:</label>
226
+ <div class="col-xs-8">
227
+ <!--select-->
228
+ <input-select v-if="button.type=='select'"
229
+ :value.sync="data.buttons[model.button.button_index].button_fields[index].value"
230
+ v-model="data.buttons[model.button.button_index].button_fields[index].value"
231
+ :options='button.options'></input-select>
232
+ <!-- input -->
233
+ <input v-else type="text" class="form-control"
234
+ v-model="data.buttons[model.button.button_index].button_fields[index].value"/>
235
+ </div>
236
+ </div>
237
+ </article>
238
+ <footer slot="modal-footer" class="modal-footer">
239
+ <button type="button" class="btn btn-primary" :disabled="disable_button_but" @click='confirm_but_modal()'>确认</button>
240
+ </footer>
241
+ </modal>
242
+ </div>
243
+ </template>
244
+ <script>
245
+ import Vue from 'vue'
246
+ // Date格式化
247
+ Date.prototype.Format = function (fmt) {
248
+ var o = {
249
+ 'M+': this.getMonth() + 1, // 月份
250
+ 'd+': this.getDate(), // 日
251
+ 'H+': this.getHours(), // 小时
252
+ 'm+': this.getMinutes(), // 分
253
+ 's+': this.getSeconds(), // 秒
254
+ 'q+': Math.floor((this.getMonth() + 3) / 3), // 季度
255
+ 'S': this.getMilliseconds() // 毫秒
256
+ }
257
+ if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (this.getFullYear() + '').substr(4 - RegExp.$1.length))
258
+ for (var k in o) {
259
+ if (new RegExp('(' + k + ')').test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length === 1) ? (o[k]) : (('00' + o[k]).substr(('' + o[k]).length)))
260
+ }
261
+ return fmt
262
+ }
263
+
264
+ export default {
265
+ title: '报建业务通用组件',
266
+ props: {
267
+ data: {
268
+ type: Object
269
+ },
270
+ showprint: {
271
+ type: Boolean,
272
+ default: true
273
+ }
274
+ },
275
+ data () {
276
+ return {
277
+ model: {}, // 公司等属性
278
+ disable_button: true, // 控制按钮禁用
279
+ show: false, // 控制onetomany模态框
280
+ disable_button_onetomany: true, // 控制onetomany模态框按钮
281
+ onetomany_index: null, // 当前选择的下标
282
+ update_onetomany_index: null, // 当前需要修改的下标
283
+ modeltitle: null, // 模态框标题
284
+ modalSize: null, // 模态框大小
285
+ showbutmodal: false,
286
+ }
287
+ },
288
+ watch: {
289
+ deep: true
290
+ },
291
+ computed: {
292
+
293
+ },
294
+ created () {
295
+ // 初始化数据
296
+ this.initializtion()
297
+ },
298
+ methods: {
299
+ // 初始化数据
300
+ initializtion () {
301
+ // 是否禁用按钮
302
+ this.disableButton()
303
+ this.$dispatch('initializtionView')
304
+ },
305
+ // 按钮模态框确定
306
+ confirm_but_modal() {
307
+ for (const item of this.data.buttons[this.model.button.button_index].button_fields) {
308
+ this.model.button.button_fields[item.field] = item.value
309
+ }
310
+ this.showbutmodal = false
311
+ this.disable_button_but = true
312
+ this.$dispatch('button', this.model)
313
+ },
314
+ // 点击按钮组按钮
315
+ async clicked(index, button) {
316
+ this.disable_button = true
317
+ // 组织model.fields数据
318
+ for (const item of this.data.fields) {
319
+ // checkbox特殊处理
320
+ if (item.type === 'checkbox') {
321
+ for (let j = 0; j < item.items.length; j++) {
322
+ this.model[item.items[j].field] = item.items[j].value
323
+ }
324
+ } else {
325
+ this.model[item.field] = item.value
326
+ }
327
+ }
328
+ this.model.f_process_id = this.data.f_process_id
329
+
330
+ // 初始化model.button数据
331
+ let buttondatas = {
332
+ button_fields: {}
333
+ }
334
+ buttondatas.button_name = button.button_name
335
+ buttondatas.button_index = index
336
+ if (button.button_fields) {
337
+ for (const item of button.button_fields) {
338
+ buttondatas.button_fields[item.field] = item.value
339
+ }
340
+ }
341
+ this.model.button = buttondatas
342
+ this.model.title = this.data.title
343
+ this.model.fields = this.data.fields
344
+ this.model.onetomany = this.data.onetomany
345
+
346
+
347
+ if (button.button_name === '退回') {
348
+ this.showbutmodal = true
349
+ } else if (button.button_name === '下发') {
350
+ this.showbutmodal = true
351
+ } else {
352
+ this.$dispatch('button', this.model)
353
+ }
354
+ },
355
+ // 是否禁用按钮
356
+ disableButton () {
357
+ let fields = this.data.fields
358
+
359
+ let flag = false
360
+ for (const item of fields) {
361
+ if (item.type !== 'checkbox' && item.required && !item.value) {
362
+ if (item.value === 0) {
363
+ flag = false
364
+ } else {
365
+ flag = true
366
+ }
367
+ }
368
+ // 任何选择框只要是否都不能提交
369
+ if (item.type === 'select' && item.value === '否' && item.disabledButton) {
370
+ flag = true
371
+ }
372
+ }
373
+
374
+ let count = 0
375
+ for (const item of fields) {
376
+ if (item.type !== 'checkbox' && item.required) {
377
+ count++
378
+ }
379
+ }
380
+ if (count === 0) {
381
+ flag = false
382
+ }
383
+
384
+ this.disable_button = flag
385
+ },
386
+ // 失去焦点触发,无论值是否发生变化
387
+ onblur (index) {
388
+ // 是否禁用按钮
389
+ this.disableButton()
390
+
391
+ this.$dispatch('onblur', index)
392
+ // 如果有错误信息提示走错误信息判断处理
393
+
394
+ if (this.data.fields[index].error || this.data.fields[index].type === 'datepicker') {
395
+ this.$dispatch('error_check', index)
396
+ }
397
+ },
398
+ // 失去焦点且值最终发生变化触发
399
+ async onchange (index) {
400
+ console.log('失去焦点-----', index)
401
+ console.log(this.data.fields[index].label)
402
+ console.log('禁用按钮--前--', this.disable_button)
403
+ // 是否禁用按钮
404
+ this.disableButton()
405
+
406
+ console.log('禁用按钮--后--', this.disable_button)
407
+
408
+ this.data.fields[index].value = this.data.fields[index].value.trim()
409
+
410
+ if (this.data.fields[index].prefix && this.data.fields[index].value !== '') {
411
+ this.data.fields[index].value = this.data.fields[index].prefix + this.data.fields[index].value
412
+ }
413
+
414
+ this.data[this.data.fields[index].field] = this.data.fields[index].value
415
+
416
+ await this.$dispatch('onchange', index)
417
+
418
+ // 如果有错误信息提示走错误信息判断处理
419
+ if (this.data.fields[index].error || this.data.fields[index].type === 'datepicker') {
420
+ this.$dispatch('error_check', index)
421
+ }
422
+ },
423
+ oninput (index) {
424
+ // 是否禁用按钮
425
+ this.disableButton()
426
+
427
+ this.$dispatch('oninput', index)
428
+
429
+ // 如果有错误信息提示走错误信息判断处理
430
+ if (this.data.fields[index].error || this.data.fields[index].type === 'datepicker') {
431
+ this.$dispatch('error_check', index)
432
+ }
433
+ },
434
+ // 模态框确认按钮
435
+ confirm_modal (title) {
436
+ if (title === '新增') {
437
+ if (this.data.onetomany[this.onetomany_index].addEvent === 'default' || !this.data.onetomany[this.onetomany_index].addEvent) {
438
+ this.$dispatch('onetomanyadd', this.onetomany_index)
439
+ } else {
440
+ this.$dispatch(this.data.onetomany[this.onetomany_index].addEvent, this.onetomany_index)
441
+ }
442
+ } else {
443
+ if (this.data.onetomany[this.onetomany_index].updateEvent === 'default' || !this.data.onetomany[this.onetomany_index].updateEvent) {
444
+ this.$dispatch('onetomanyupdate', this.onetomany_index, this.update_onetomany_index)
445
+ } else {
446
+ this.$dispatch(this.data.onetomany[this.onetomany_index].updateEvent, this.onetomany_index, this.update_onetomany_index)
447
+ }
448
+ }
449
+
450
+ this.closemodal()
451
+ },
452
+ // 关闭模态框
453
+ closemodal () {
454
+ debugger
455
+ for (const item of this.data.onetomany[this.onetomany_index].fields) {
456
+ item.value = ''
457
+ }
458
+
459
+ this.show = false
460
+ this.showbutmodal = false
461
+ this.disable_button_onetomany = true
462
+ this.onetomany_index = null
463
+ this.update_onetomany_index = null
464
+ this.modeltitle = null
465
+ this.modalSize = null
466
+ },
467
+ // 是否禁用模态框按钮
468
+ disableModalButton () {
469
+ let fields = this.data.onetomany[this.onetomany_index].fields
470
+
471
+ let flag = false
472
+ for (const item of fields) {
473
+ if (item.type !== 'checkbox' && item.required && !item.value) {
474
+ if (item.value === 0) {
475
+ flag = false
476
+ } else {
477
+ flag = true
478
+ }
479
+ }
480
+ }
481
+
482
+ let count = 0
483
+ for (const item of fields) {
484
+ if (item.type !== 'checkbox' && item.required) {
485
+ count++
486
+ }
487
+ }
488
+ if (count === 0) {
489
+ flag = false
490
+ }
491
+ this.disable_button_onetomany = flag
492
+ },
493
+ // 监听模态框属性失去焦点
494
+ onchange_modal (index) {
495
+ this.disableModalButton()
496
+ this.$dispatch('onchange_modal', this.onetomany_index, index)
497
+ },
498
+ // 监听模态框属性失去焦点
499
+ onblur_modal (index) {
500
+ this.disableModalButton()
501
+ this.$dispatch('onblur_modal', this.onetomany_index, index)
502
+ },
503
+ // input输入属性值发生变化监听
504
+ oninput_modal (index) {
505
+ this.disableModalButton()
506
+ this.$dispatch('oninput_modal', this.onetomany_index, index)
507
+ }
508
+ },
509
+ events: {
510
+ 'add' (index) {
511
+ let count = 0
512
+ for (const item of this.data.onetomany[index].fields) {
513
+ if (item.type === 'datepicker' && !item.value && item.default) {
514
+ item.value = new Date().Format('yyyy-MM-dd')
515
+ }
516
+ if (item.required) {
517
+ count++
518
+ }
519
+ }
520
+
521
+ if (count === 0) {
522
+ this.disable_button_onetomany = false
523
+ }
524
+ this.modeltitle = '新增'
525
+ this.modalSize = this.data.onetomany[index].modalSize
526
+ this.onetomany_index = index
527
+
528
+ this.$dispatch('openAddModel',index)
529
+
530
+ this.show = true
531
+ },
532
+ 'update' (i, j) {
533
+ let onetomany = this.data.onetomany[i]
534
+ let item = this.data.onetomany[i].rows[j]
535
+ let count = 0
536
+ for (let k = 0; k < onetomany.fields.length; k++) {
537
+ // 防止初始化的时候没有value
538
+ Vue.set(this.data.onetomany[i].fields[k], 'value', item[this.data.onetomany[i].fields[k].field])
539
+
540
+ if (onetomany.fields[j].required) {
541
+ count++
542
+ }
543
+ }
544
+ if (count === 0) {
545
+ this.disable_button_onetomany = false
546
+ }
547
+ this.modeltitle = '修改'
548
+ this.modalSize = this.data.onetomany[i].modalSize
549
+ this.onetomany_index = i
550
+ this.update_onetomany_index = j
551
+
552
+ this.$dispatch('openUpdateModel',i,j)
553
+
554
+ this.show = true
555
+
556
+ this.disableModalButton()
557
+ },
558
+ 'delete'(i, j) {
559
+ this.$showMessage((this.data.onetomany[i].deleteMessage === 'default' || !this.data.onetomany[i].deleteMessage) ? '您确定要删除这条记录吗?' : this.data.onetomany[i].deleteMessage, ['confirm']).then((res) => {
560
+ if (res === 'confirm') {
561
+ if (this.data.onetomany[i].deleteEvent === 'default' || !this.data.onetomany[i].deleteEvent) {
562
+ this.$dispatch('onetomanydelete', i, j)
563
+ } else {
564
+ this.$dispatch(this.data.onetomany[i].deleteEvent, i, j)
565
+ }
566
+ }
567
+ })
568
+ }
569
+ }
570
+ }
571
+ </script>
572
+ <style>
573
+ .datepicker{
574
+ width: 100%!important;
575
+ }
576
+ .datepicker-input{
577
+ background-color: #ffffff!important;
578
+ width: 100%!important;
579
+ }
580
+ .datepicker-input:disabled{
581
+ border: 1px solid #DDD!important;
582
+ color: #ACA899!important;
583
+ width: 100%!important;
584
+ }
585
+ </style>
586
+ <style scoped>
587
+ .app-text {
588
+ font-size: 12px;
589
+ }
590
+ .panel-self{
591
+ border-radius: 10px;
592
+ border:1px solid #499EDF;
593
+ background-color: #F8F8F8;
594
+ }
595
+ .font{
596
+ font: 15px PingFang-SC-Medium;
597
+ color: #666666;
598
+ }
599
+ .input-font{
600
+ font: 15px PingFang-SC-Medium;
601
+ color: #333333;
602
+ }
603
+ th{
604
+ font-size: 15px !important;
605
+ text-align: center !important;
606
+ background-color: #dfedfb!important;
607
+ color: #666666 !important;
608
+ font-family: PINGFANG-BOLD !important;
609
+ font-weight: normal!important;
610
+ }
611
+ /*清除model中的浮动*/
612
+ .clearfix:after,.clearfix:before{
613
+ display: table;
614
+ }
615
+ .clearfix:after{
616
+ clear: both;
617
+ }
618
+
619
+ .input_view{
620
+ padding: 8px;
621
+ background-color: #ffffff;
622
+ border-radius: 2px;
623
+ border: solid 1px #c7c7c7!important;
624
+ color: #333333!important;
625
+ font-size: 15px!important;
626
+ }
627
+
628
+ .input_view[readonly]{
629
+ border: 1px solid #DDD!important;
630
+ /*background-color: #F5F5F5;*/
631
+ color:#ACA899!important;
632
+ }
633
+ .input_view:disabled{
634
+ border: 1px solid #DDD!important;
635
+ /*background-color: #F5F5F5;*/
636
+ color:#ACA899!important;
637
+ }
638
+
639
+ .control-label-justify {
640
+ display: inline-block;
641
+ vertical-align: top;
642
+ width: 100%;
643
+ text-align: justify;
644
+ font-family: PingFang-SC-Bold;
645
+ }
646
+
647
+ .control-label-justify::after {
648
+ content: "";
649
+ display: inline-block;
650
+ width: 100%;
651
+ overflow: hidden;
652
+ height: 0;
653
+ }
654
+
655
+ input::-webkit-outer-spin-button,
656
+ input::-webkit-inner-spin-button {
657
+ -webkit-appearance: none;
658
+ }
659
+
660
+ input[type="number"] {
661
+ -moz-appearance: textfield;
662
+ }
663
+
664
+ </style>