apply-clients 7.1.36-yuchuan-83 → 7.1.36-yuchuan-84

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 (36) hide show
  1. package/build/dev-server.js +3 -6
  2. package/package.json +1 -1
  3. package/src/components/android/AppServiceView.vue +603 -603
  4. package/src/components/android/Process/AppServiceControl.vue +1434 -1434
  5. package/src/components/android/Process/Processes/AppInstallationDetails.vue +1032 -1032
  6. package/src/components/android/Process/Processes/newAppInstallationDetails.vue +671 -671
  7. package/src/components/android/SealBind.vue +426 -426
  8. package/src/components/product/ApplyCharge/ApplyChargeList.vue +1115 -1115
  9. package/src/components/product/ApplyGaiXianCharge/ApplyGaiXianChargeList.vue +211 -211
  10. package/src/components/product/ApplyGuanXian/GuanXianExplorationSelect.vue +325 -325
  11. package/src/components/product/Function/Service/FunctionServiceControl.vue +581 -581
  12. package/src/components/product/GongJianPush/ApplyPushDispose.vue +299 -299
  13. package/src/components/product/GongJianPush/ApplyPushManage.vue +92 -92
  14. package/src/components/product/Ignition/IgnitionListManage.vue +604 -604
  15. package/src/components/product/List/OldShowDevices.vue +272 -272
  16. package/src/components/product/List/ShowAllActivity.vue +540 -540
  17. package/src/components/product/Print/BuildOrder/buildOrderList.vue +446 -446
  18. package/src/components/product/Print/BuildOrder/printGaiXianOrder.vue +271 -271
  19. package/src/components/product/Print/OrderPrint/GaiXianOrder.vue +314 -314
  20. package/src/components/product/Print/OrderPrint/printChaiChuOrder.vue +266 -266
  21. package/src/components/product/Process/ExplorationSelect.vue +593 -593
  22. package/src/components/product/Process/NewExplorationSelect.vue +587 -587
  23. package/src/components/product/Process/Processes/InstallationDetails.vue +1166 -1166
  24. package/src/components/product/Process/Processes/Print/printCharge.vue +250 -250
  25. package/src/components/product/Process/Processes/Print/printGaiXianCharge.vue +244 -244
  26. package/src/components/product/Process/Processes/chargeManagement.vue +766 -766
  27. package/src/components/product/Process/Processes/newInstallationDetails.vue +683 -683
  28. package/src/components/product/Process/Processes/supplementalAgreement.vue +298 -298
  29. package/src/components/product/Process/Service/ServiceControl.vue +2232 -2232
  30. package/src/components/product/ServiceView.vue +650 -650
  31. package/src/components/product/Supervisory/ExportExcel.vue +359 -359
  32. package/src/components/product/Supervisory/Service/SupervisoryServiceControl.vue +592 -592
  33. package/src/components/product/Supervisory/SupervisoryList.vue +585 -585
  34. package/src/components/product/Supervisory/YiBanSupervisoryList.vue +543 -543
  35. package/src/components/product/VueUtils/ApplyUpload.vue +302 -302
  36. package/src/components/product/VueUtils/HighMeter.vue +208 -208
@@ -1,650 +1,650 @@
1
- <template>
2
- <div class="select-overspread" style="background-color: #ffffff;padding: 20px;overflow: scroll">
3
- <form class="form-horizontal">
4
- <div class="form-group">
5
- <div v-for="(index,item) in data.fields">
6
- <!--input-->
7
- <div :style="item.style ? item.style+';height: 40px;margin-bottom: 4px':'height: 40px;margin-bottom: 4px'"
8
- v-if="(item.type==='input' || item.type==='number'||item.type === 'tel'||item.type === 'email') && !item.hidden && (item.device === 'pc' || !item.device)"
9
- :class="[item.required && !(item.value) ? 'has-error' : '',item.bootstraped ? item.bootstraped + ' form-group':'col-sm-4 form-group']">
10
- <label :style="item.label_style ? item.label_style : ''"
11
- :class="item.label_bootstraped ? item.label_bootstraped+' control-label-justify control-label' : 'control-label-justify control-label col-sm-6'">{{item.label}}</label>
12
- <div :style="item.value_style ? item.value_style:''"
13
- :class="item.value_bootstraped ? item.value_bootstraped : 'col-sm-6'">
14
- <input class="form-control input_view" style=""
15
- :type="item.type"
16
- v-model="data.fields[index].value"
17
- :placeholder="item.placeholder"
18
- :value="data.fields[index].value"
19
- :readonly="item.readonly"
20
- :disabled="item.disabled"
21
- @change="onchange(index)"
22
- @blur="onblur(index)"
23
- @input="oninput(index)"
24
- />
25
- </div>
26
- </div>
27
-
28
- <!--时间datepicker-->
29
- <div :style="item.style ? item.style+';height: 40px;margin-bottom: 4px':'height: 40px;margin-bottom: 4px'"
30
- v-if="item.type==='datepicker' && !item.hidden && (item.device === 'pc' || !item.device)"
31
- :class="[item.required && !(item.value) ? 'has-error' : '',item.bootstraped ? item.bootstraped+' form-group':'col-sm-4 form-group']">
32
- <label
33
- :class="item.label_bootstraped ? item.label_bootstraped+' control-label-justify control-label' : 'control-label control-label-justify col-sm-6'">{{item.label}}</label>
34
- <div :style="item.value_style ? item.value_style:''"
35
- :class="item.value_bootstraped ? item.value_bootstraped : 'col-sm-6'">
36
- <datepicker
37
- @change="onchange(index)"
38
- @blur="onblur(index)"
39
- :placeholder="item.placeholder"
40
- :value.sync="data.fields[index].value"
41
- :format="item.format ? item.format : 'yyyy-MM-dd'"
42
- v-model="data.fields[index].value"
43
- :readonly="item.readonly"
44
- :disabled="item.disabled"
45
- :show-reset-button="reset">
46
- </datepicker>
47
- </div>
48
- </div>
49
-
50
- <!--textarea-->
51
- <div :style="item.style ? item.style+';margin-bottom: 4px':'margin-bottom: 4px'"
52
- v-if="item.type==='textarea' && !item.hidden && (item.device === 'pc' || !item.device)"
53
- :class="[item.required && !(item.value) ? 'has-error' : '',item.bootstraped?item.bootstraped+' form-group':'col-sm-12 form-group']">
54
- <label :style="item.label_style ? item.label_style : ''"
55
- :class="item.label_bootstraped ? item.label_bootstraped + ' control-label-justify control-label' : 'control-label-justify control-label col-sm-3'">{{item.label}}</label>
56
- <div :style="item.value_style ? item.value_style:''"
57
- :class="item.value_bootstraped ? item.value_bootstraped : 'col-sm-10'">
58
- <textarea
59
- :readonly="item.readonly"
60
- :disabled="item.disabled"
61
- class="form-control input_view"
62
- style="width: 100%;height: 100%"
63
- :rows="item.rows"
64
- v-model="data.fields[index].value"
65
- :value="data.fields[index].value"
66
- @change="onchange(index)"
67
- @blur="onblur(index)"
68
- @input="oninput(index)"
69
- >
70
- </textarea>
71
- </div>
72
- </div>
73
-
74
- <!--select-->
75
- <div :style="item.style ? item.style+';height: 40px;margin-bottom: 4px':'height: 40px;margin-bottom: 4px'"
76
- v-if="item.type==='select' && !item.hidden && (item.device === 'pc' || !item.device)"
77
- :class="[item.required && !(item.value) ? 'has-error' : '',item.bootstraped?item.bootstraped+' form-group':'col-sm-4 form-group']">
78
- <label
79
- :class="item.label_bootstraped ? item.label_bootstraped+' control-label control-label-justify':'control-label-justify control-label col-sm-6'">{{item.label}}</label>
80
- <div :style="item.value_style ? item.value_style:''"
81
- :class="item.value_bootstraped ? item.value_bootstraped : 'col-sm-6'">
82
- <input-select
83
- class="select select_list"
84
- @blur="onblur(index)"
85
- @change="onchange(index)"
86
- @select-search="selectSearch($arguments,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: 4px':'height: 40px;margin-bottom: 4px'"
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
-
117
- <!--image-->
118
- <div :style="item.style ? item.style :'height: 40px;margin-bottom: 4px'"
119
- v-if="item.type==='image' && !item.hidden && (item.device === 'pc' || !item.device)"
120
- :class="[item.required && item.value.length === 0 ? 'has-error' : '',item.bootstraped?item.bootstraped+' form-group':'col-sm-4 form-group']">
121
- <label :style="item.label_style ? item.label_style : ''"
122
- :class="item.label_bootstraped ? item.label_bootstraped+' control-label-justify control-label' : 'control-label-justify control-label col-sm-6'">{{item.label}}</label>
123
- <div :style="item.value_style ? item.value_style:''"
124
- :class="item.value_bootstraped ? item.value_bootstraped : 'col-sm-6'">
125
- <img v-if="data.fields[index].value" :src="data.fields[index].value" :style="item.imgStyle ? item.imgStyle : ''">
126
- </div>
127
- </div>
128
- </div>
129
- </div>
130
-
131
- <!-- onetomany -->
132
- <div class="" v-for="(index,item) in data.onetomany">
133
- <onetomany :selectdata="data" :onetomany="item" :index="index" v-if="(item.device === 'pc' || !item.device) && !item.hidden"></onetomany>
134
- </div>
135
-
136
- <div v-for="(i,item) in data.components">
137
- <component v-if="(item.device === 'pc' || !item.device) && !item.hidden" :is="item.name" :selectdata="data" :mark="item.mark"></component>
138
- </div>
139
-
140
- <!--自定义组件-->
141
- <slot></slot>
142
- <!--公司等属性-->
143
- <div class="col-sm-12 form-group text-center" style="padding-top:8px">
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.orgs}}
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.parentname}}
154
- </div>
155
- </div>
156
- <div class="col-sm-3 form-group center-block">
157
- <label class="col-sm-5">操作人:</label>
158
- <div class="col-sm-6 " style="text-align: left">
159
- {{model.operator}}
160
- </div>
161
- </div>
162
- <div class="col-sm-3 form-group center-block">
163
- <label class="col-sm-5">操作日期:</label>
164
- <div class="col-sm-6" style="text-align: left">
165
- {{model.operate_date}}
166
- </div>
167
- </div>
168
- </div>
169
- <!-- 按钮组 -->
170
- <div class="from-group col-sm-12 text-center" >
171
- <!-- 按钮组 -->
172
- <button v-for="(index,button) in data.buttons"
173
- :disabled="button.disabled && disable_button"
174
- style="min-width:100px"
175
- :class="button.disabled && disable_button ? 'btn btn-default button_spacing' : 'btn btn-primary button_spacing'"
176
- v-if="!button.hidden"
177
- @click.prevent="click_but(button)"
178
- >
179
- {{button.button_name}}
180
- </button>
181
- </div>
182
-
183
- <!-- 按钮模态框 -->
184
- <modal v-if="showButModal" :show.sync="showButModal" backdrop="false" large>
185
- <header slot="modal-header" class="modal-header">
186
- <button type="button" class="close" @click="closeModal()"><span>&times;</span></button>
187
- <span class="modal-title"><font
188
- size="3">{{data.button.button_name}}</font></span>
189
- </header>
190
- <article slot="modal-body" class="modal-body clearfix">
191
- <div class="form-group" style="padding: 0 150px">
192
- <div v-for="(index,item) in data.button.button_fields">
193
- <div :style="item.style ? item.style : ''" :class="[item.required && !(item.value) ? 'has-error' : '', item.bootstraped ? item.bootstraped + ' form-group' : 'form-group']"
194
- v-if="(item.type==='input' || item.type==='number'||item.type === 'tel'||item.type === 'email') && !item.hidden && (item.device === 'pc' || !item.device)">
195
- <label :style="item.label_style ? item.label_style : ''"
196
- :class="item.label_bootstraped ? item.label_bootstraped + ' control-label-justify control-label' : 'control-label-justify control-label col-sm-6'">{{item.label}}</label>
197
- <div :style="item.value_style ? item.value_style : ''"
198
- :class="item.value_bootstraped ? item.value_bootstraped : 'col-sm-9'">
199
- <input class="form-control input_view"
200
- :placeholder="item.placeholder"
201
- :type="item.type"
202
- v-model="item.value"
203
- :value="item.value"
204
- :readonly="item.readonly"
205
- :disabled="item.disabled"
206
- @change="onbutchange(index)"
207
- @blur="onbutblur(index)"
208
- @input="onbutinput(index)"
209
- />
210
- </div>
211
- </div>
212
-
213
- <!--时间datepicker-->
214
- <div :style="item.style ? item.style : ''" :class="[item.required && !(item.value) ? 'has-error' : '', item.bootstraped ? item.bootstraped + ' form-group':'form-group']"
215
- v-if="item.type==='datepicker' && !item.hidden && (item.device === 'pc' || !item.device)">
216
- <label :style="item.label_style ? item.label_style : ''"
217
- :class="item.label_bootstraped ? item.label_bootstraped + ' control-label-justify control-label' : 'control-label-justify control-label col-sm-6'">{{item.label}}</label>
218
- <div :style="item.value_style ? item.value_style : ''"
219
- :class="item.value_bootstraped ? item.value_bootstraped : 'col-sm-9'">
220
- <datepicker
221
- :placeholder="item.placeholder"
222
- :value.sync="item.value"
223
- v-model="item.value"
224
- :readonly="item.readonly"
225
- :disabled="item.disabled"
226
- :format="item.format ? item.format : 'yyyy-MM-dd'"
227
- :show-reset-button="true"
228
- @change="onbutchange(index)"
229
- @blur="onbutblur(index)"
230
- ></datepicker>
231
- </div>
232
- </div>
233
-
234
- <!--select-->
235
- <div :style="item.style ? item.style : ''" :class="[item.required && !(item.value) ? 'has-error' : '', item.bootstraped ? item.bootstraped + ' form-group':'form-group']"
236
- v-if="item.type==='select' && !item.hidden && (item.device === 'pc' || !item.device)">
237
- <label :style="item.label_style ? item.label_style : ''"
238
- :class="item.label_bootstraped ? item.label_bootstraped + ' control-label-justify control-label' : 'control-label-justify control-label col-sm-6'">{{item.label}}</label>
239
- <div :style="item.value_style ? item.value_style : ''"
240
- :class="item.value_bootstraped ? item.value_bootstraped : 'col-sm-9'">
241
- <input-select
242
- class="select select_list"
243
- :value.sync="item.value"
244
- v-model="item.value"
245
- :options='item.options'
246
- :readonly="item.readonly"
247
- :disable="item.disabled"
248
- :valueSingle="true"
249
- @blur="onbutblur(index)"
250
- @change="onbutchange(index)"
251
- ></input-select>
252
- </div>
253
- </div>
254
-
255
- <!--textarea-->
256
- <div :style="item.style ? item.style : ''" :class="[item.required && !(item.value) ? 'has-error' : '', item.bootstraped ? item.bootstraped + ' form-group':'form-group']"
257
- v-if="item.type==='textarea' && !item.hidden && (item.device === 'pc' || !item.device)">
258
- <label :style="item.label_style ? item.label_style : ''"
259
- :class="item.label_bootstraped ? item.label_bootstraped + ' control-label-justify control-label' : 'control-label-justify control-label col-sm-6'">{{item.label}}</label>
260
- <div :style="item.value_style ? item.value_style : ''"
261
- :class="item.value_bootstraped ? item.value_bootstraped : 'col-sm-9'">
262
- <textarea
263
- class="form-control input_view"
264
- style="width: 100%;height: 100%"
265
- v-model="item.value"
266
- :value="item.value"
267
- :rows="item.rows"
268
- :readonly="item.readonly"
269
- :disabled="item.disabled"
270
- @change="onbutchange(index)"
271
- @blur="onbutblur(index)"
272
- @input="onbutinput(index)"
273
- ></textarea>
274
- </div>
275
- </div>
276
- </div>
277
- </div>
278
- </article>
279
- <footer slot="modal-footer" class="modal-footer">
280
- <button :class="disable_modal_button ? 'btn btn-default':'btn btn-primary'"
281
- :disabled="disable_modal_button" type="button" @click="confirmModal()">
282
- 确认
283
- </button>
284
- </footer>
285
- </modal>
286
- </form>
287
- </div>
288
- </template>
289
- <script>
290
- import Vue from 'vue'
291
- import {isEmpty} from '../Util'
292
- // Date格式化
293
- Date.prototype.Format = function (fmt) {
294
- var o = {
295
- 'M+': this.getMonth() + 1, // 月份
296
- 'd+': this.getDate(), // 日
297
- 'H+': this.getHours(), // 小时
298
- 'm+': this.getMinutes(), // 分
299
- 's+': this.getSeconds(), // 秒
300
- 'q+': Math.floor((this.getMonth() + 3) / 3), // 季度
301
- 'S': this.getMilliseconds() // 毫秒
302
- }
303
- if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (this.getFullYear() + '').substr(4 - RegExp.$1.length))
304
- for (var k in o) {
305
- if (new RegExp('(' + k + ')').test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length === 1) ? (o[k]) : (('00' + o[k]).substr(('' + o[k]).length)))
306
- }
307
- return fmt
308
- }
309
-
310
- export default {
311
- title: '报建业务通用组件',
312
- props: {
313
- data: {
314
- type: Object
315
- }
316
- },
317
- data () {
318
- return {
319
- hiddenButon: true,
320
- disableds: true,
321
- model: {}, // 公司等属性
322
- disable_button: true, // 控制按钮禁用
323
- disable_modal_button: true, // 控制按钮禁用
324
- showButModal: false
325
- }
326
- },
327
- watch: {
328
- deep: true
329
- },
330
- computed: {
331
-
332
- },
333
- created () {
334
- // 初始化数据
335
- this.initializtion()
336
- if (this.data.readyEvent) {
337
- this.$dispatch(this.data.readyEvent)
338
- }
339
- this.$dispatch('initializtionView')
340
-
341
- setTimeout(() => {
342
- // 是否禁用按钮
343
- this.disableButton()
344
- }, 2000)
345
- },
346
- methods: {
347
- // 初始化数据
348
- initializtion () {
349
- for (const item of this.data.fields) {
350
- this.data[item.field] = item.value
351
- }
352
-
353
- // 公司等属性初始化
354
- if (this.data.orgs) {
355
- this.model.orgs = this.data.orgs
356
- } else {
357
- this.model.orgs = this.$login.f.f_fengongsi
358
- console.log("数据",this.model.orgs)
359
- }
360
- if (this.data.parentname) {
361
- this.model.parentname = this.data.parentname
362
- } else {
363
- this.model.parentname = this.$login.f.f_department_name
364
- }
365
- if (this.data.operate_date) {
366
- this.model.operate_date = this.data.operate_date
367
- } else {
368
- this.model.operate_date = new Date().Format('yyyy-MM-dd')
369
- }
370
- if (this.data.operator) {
371
- this.model.operator = this.data.operator
372
- } else {
373
- this.model.operator = this.$login.f.name
374
- }
375
- },
376
- // 是否禁用按钮
377
- disableButton () {
378
- let flag = false
379
-
380
- for (const field of this.data.fields) {
381
- if (field.required && !field.value && !field.hidden && field.value !== 0) {
382
- flag = true
383
- }
384
-
385
- // 任何选择框只要是否都不能提交
386
- if (field.type === 'select' && field.value === '否' && field.value_no_disable) {
387
- flag = true
388
- }
389
-
390
- if (field.type === 'checkbox' && field.required && field.value.length === 0) {
391
- flag = true
392
- }
393
- }
394
-
395
- this.disable_button = flag
396
- },
397
- // 失去焦点且值最终发生变化触发
398
- async onchange (index) {
399
- // 是否禁用按钮
400
- this.disableButton()
401
-
402
- if (!isEmpty(this.data.fields[index].value)) {
403
- // 前缀、后缀
404
- if (this.data.fields[index].prefix) {
405
- this.data.fields[index].value = this.data.fields[index].prefix + this.data.fields[index].value
406
- }
407
- if (this.data.fields[index].suffix) {
408
- this.data.fields[index].value = this.data.fields[index].value + this.data.fields[index].suffix
409
- }
410
- }
411
-
412
- // data赋值
413
- this.data[this.data.fields[index].field] = this.data.fields[index].value
414
-
415
- if (this.data.fields[index].type === 'datepicker') {
416
- this.check_datepicker(index)
417
- }
418
-
419
- if (this.data.fields[index].onchange) {
420
- this.$dispatch(this.data.fields[index].onchange, index)
421
- }
422
- this.$dispatch('onchange', index)
423
- },
424
- // 失去焦点触发,无论值是否发生变化
425
- onblur (index) {
426
- this.disableButton()
427
-
428
- if (this.data.fields[index].onblur) {
429
- this.$dispatch(this.data.fields[index].onblur, index)
430
- }
431
-
432
- this.$dispatch('onblur', index)
433
- },
434
- oninput (index) {
435
- // 是否禁用按钮
436
- this.disableButton()
437
-
438
- if (this.data.fields[index].oninput) {
439
- this.$dispatch(this.data.fields[index].oninput, index)
440
- }
441
- this.$dispatch('oninput', index)
442
- },
443
- selectSearch(event, index) {
444
- if (this.data.fields[index].selectSearch) {
445
- this.$dispatch(this.data.fields[index].selectSearch, event[0], index)
446
- }
447
- this.$dispatch('selectSearch', event[0], index)
448
- },
449
- // 点击按钮组按钮
450
- async click_but (button) {
451
- this.disable_button = true
452
- for (let i = 0; i < this.data.buttons.length; i++) {
453
- if( button.button_name!='下发'){
454
- if(button.button_name===this.data.buttons[i].button_name){
455
- this.data.buttons[i].disabled= true
456
- }
457
- }
458
- }
459
- this.data.fields.forEach(item => {
460
- this.data[item.field] = item.value
461
- })
462
- this.data.button = button
463
- if (button.button_fields && button.button_fields.length > 0) {
464
- this.showButModal = true
465
- return
466
- }
467
-
468
- if (this.data.button.event) {
469
- this.$dispatch(this.data.button.event)
470
- } else {
471
- this.$dispatch('button')
472
- }
473
- },
474
- confirmModal () {
475
- this.closeModal()
476
-
477
- this.data.button.button_fields.forEach(item => {
478
- this.data.button[item.field] = item.value
479
- })
480
-
481
- if (this.data.button.event) {
482
- this.$dispatch(this.data.button.event)
483
- } else {
484
- this.$dispatch('button')
485
- }
486
- },
487
- // 关闭模态框
488
- closeModal () {
489
- this.showButModal = false
490
- this.disable_modal_button = false
491
- },
492
- onbutchange (index) {
493
- // 是否禁用按钮
494
- this.disableModalButton()
495
-
496
- if (this.data.button.button_fields[index].onchange) {
497
- this.$dispatch(this.data.button.button_fields[index].onchange, index)
498
- } else {
499
- this.$dispatch('onbutchange', index)
500
- }
501
-
502
- },
503
- onbutblur (index) {
504
- this.disableModalButton()
505
-
506
- if (this.data.button.button_fields[index].onblur) {
507
- this.$dispatch(this.data.button.button_fields[index].onblur, index)
508
- } else {
509
- this.$dispatch('onbutblur', index)
510
- }
511
- },
512
- onbutinput (index) {
513
- // 是否禁用按钮
514
- this.disableModalButton()
515
-
516
- if (this.data.button.button_fields[index].oninput) {
517
- this.$dispatch(this.data.button.button_fields[index].oninput, index)
518
- } else {
519
- this.$dispatch('onbutinput', index)
520
- }
521
- },
522
- disableModalButton () {
523
- let flag = false
524
-
525
-
526
- for (const item of this.data.button.button_fields) {
527
- if (item.required && !item.value) {
528
- if (item.value === 0) {
529
- flag = false
530
- } else {
531
- flag = true
532
- }
533
- }
534
- }
535
-
536
- this.disable_modal_button = flag
537
- },
538
- check_datepicker (index) {
539
- // 时间格式检测
540
- if (!isEmpty(this.data.fields[index].value)) {
541
-
542
- let dateReg = /^[1-9]\d{3}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])$/
543
- let timeReg = /^(20|21|22|23|[0-1]\d):[0-5]\d:[0-5]\d$/
544
- 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$/
545
- if (this.data.fields[index].format) {
546
- if (this.data.fields[index].format === 'yyyy-MM-dd') {
547
- if (!dateReg.test(this.data.fields[index].value)) {
548
- this.data.fields[index].value = ''
549
- this.$showMessage(this.data.fields[index].label + '格式错误如:2021-01-01')
550
- }
551
- }
552
- if (this.data.fields[index].format === 'HH:mm:ss') {
553
- if (!timeReg.test(this.data.fields[index].value)) {
554
- this.data.fields[index].value = ''
555
- this.$showMessage(this.data.fields[index].label + '格式错误如:00:00:00')
556
- }
557
- }
558
- if (this.data.fields[index].format === 'yyyy-MM-dd HH:mm:ss') {
559
- if (!datetimeReg.test(this.data.fields[index].value)) {
560
- this.data.fields[index].value = ''
561
- this.$showMessage(this.data.fields[index].label + '格式错误如:2021-01-01 00:00:00')
562
- }
563
- }
564
- } else {
565
- if (!dateReg.test(this.data.fields[index].value)) {
566
- this.data.fields[index].value = ''
567
- this.$showMessage(this.data.fields[index].label + '格式错误如:2021-01-01')
568
- }
569
- }
570
- }
571
- }
572
- },
573
- events: {
574
-
575
- }
576
- }
577
- </script>
578
- <style>
579
- .datepicker{
580
- width: 100%!important;
581
- }
582
- .datepicker-input{
583
- background-color: #ffffff!important;
584
- width: 100%!important;
585
- }
586
- .datepicker-input:disabled{
587
- border: 1px solid #DDD!important;
588
- color: rgba(21, 1, 1, 0.8) !important;
589
- width: 100%!important;
590
- }
591
- </style>
592
- <style scoped>
593
- th{
594
- font-size: 15px !important;
595
- text-align: center !important;
596
- background-color: #dfedfb!important;
597
- color: rgba(21, 1, 1, 0.8) !important;
598
- font-family: PINGFANG-BOLD !important;
599
- font-weight: normal!important;
600
- }
601
- /*清除model中的浮动*/
602
- .clearfix:after,.clearfix:before{
603
- display: table;
604
- }
605
- .clearfix:after{
606
- clear: both;
607
- }
608
-
609
- .input_view{
610
- background-color: #ffffff;
611
- border-radius: 2px;
612
- border: solid 1px #c7c7c7!important;
613
- color: rgba(21, 1, 1, 0.8) !important;
614
- font-size: 15px!important;
615
- }
616
-
617
- .input_view[readonly]{
618
- border: 1px solid #DDD!important;
619
- color: rgba(21, 1, 1, 0.8) !important;
620
- }
621
- .input_view:disabled{
622
- border: 1px solid #DDD!important;
623
- color: rgba(21, 1, 1, 0.85) !important;
624
- }
625
-
626
- .control-label-justify {
627
- display: inline-block;
628
- vertical-align: top;
629
- width: 110px;
630
- text-align: justify;
631
- font-family: PingFang-SC-Bold;
632
- }
633
-
634
- .control-label-justify::after {
635
- content: "";
636
- display: inline-block;
637
- width: 100%;
638
- overflow: hidden;
639
- height: 0;
640
- }
641
- input::-webkit-outer-spin-button,
642
- input::-webkit-inner-spin-button {
643
- -webkit-appearance: none;
644
- }
645
-
646
- input[type="number"] {
647
- -moz-appearance: textfield;
648
- }
649
-
650
- </style>
1
+ <template>
2
+ <div class="select-overspread" style="background-color: #ffffff;padding: 20px;overflow: scroll">
3
+ <form class="form-horizontal">
4
+ <div class="form-group">
5
+ <div v-for="(index,item) in data.fields">
6
+ <!--input-->
7
+ <div :style="item.style ? item.style+';height: 40px;margin-bottom: 4px':'height: 40px;margin-bottom: 4px'"
8
+ v-if="(item.type==='input' || item.type==='number'||item.type === 'tel'||item.type === 'email') && !item.hidden && (item.device === 'pc' || !item.device)"
9
+ :class="[item.required && !(item.value) ? 'has-error' : '',item.bootstraped ? item.bootstraped + ' form-group':'col-sm-4 form-group']">
10
+ <label :style="item.label_style ? item.label_style : ''"
11
+ :class="item.label_bootstraped ? item.label_bootstraped+' control-label-justify control-label' : 'control-label-justify control-label col-sm-6'">{{item.label}}</label>
12
+ <div :style="item.value_style ? item.value_style:''"
13
+ :class="item.value_bootstraped ? item.value_bootstraped : 'col-sm-6'">
14
+ <input class="form-control input_view" style=""
15
+ :type="item.type"
16
+ v-model="data.fields[index].value"
17
+ :placeholder="item.placeholder"
18
+ :value="data.fields[index].value"
19
+ :readonly="item.readonly"
20
+ :disabled="item.disabled"
21
+ @change="onchange(index)"
22
+ @blur="onblur(index)"
23
+ @input="oninput(index)"
24
+ />
25
+ </div>
26
+ </div>
27
+
28
+ <!--时间datepicker-->
29
+ <div :style="item.style ? item.style+';height: 40px;margin-bottom: 4px':'height: 40px;margin-bottom: 4px'"
30
+ v-if="item.type==='datepicker' && !item.hidden && (item.device === 'pc' || !item.device)"
31
+ :class="[item.required && !(item.value) ? 'has-error' : '',item.bootstraped ? item.bootstraped+' form-group':'col-sm-4 form-group']">
32
+ <label
33
+ :class="item.label_bootstraped ? item.label_bootstraped+' control-label-justify control-label' : 'control-label control-label-justify col-sm-6'">{{item.label}}</label>
34
+ <div :style="item.value_style ? item.value_style:''"
35
+ :class="item.value_bootstraped ? item.value_bootstraped : 'col-sm-6'">
36
+ <datepicker
37
+ @change="onchange(index)"
38
+ @blur="onblur(index)"
39
+ :placeholder="item.placeholder"
40
+ :value.sync="data.fields[index].value"
41
+ :format="item.format ? item.format : 'yyyy-MM-dd'"
42
+ v-model="data.fields[index].value"
43
+ :readonly="item.readonly"
44
+ :disabled="item.disabled"
45
+ :show-reset-button="reset">
46
+ </datepicker>
47
+ </div>
48
+ </div>
49
+
50
+ <!--textarea-->
51
+ <div :style="item.style ? item.style+';margin-bottom: 4px':'margin-bottom: 4px'"
52
+ v-if="item.type==='textarea' && !item.hidden && (item.device === 'pc' || !item.device)"
53
+ :class="[item.required && !(item.value) ? 'has-error' : '',item.bootstraped?item.bootstraped+' form-group':'col-sm-12 form-group']">
54
+ <label :style="item.label_style ? item.label_style : ''"
55
+ :class="item.label_bootstraped ? item.label_bootstraped + ' control-label-justify control-label' : 'control-label-justify control-label col-sm-3'">{{item.label}}</label>
56
+ <div :style="item.value_style ? item.value_style:''"
57
+ :class="item.value_bootstraped ? item.value_bootstraped : 'col-sm-10'">
58
+ <textarea
59
+ :readonly="item.readonly"
60
+ :disabled="item.disabled"
61
+ class="form-control input_view"
62
+ style="width: 100%;height: 100%"
63
+ :rows="item.rows"
64
+ v-model="data.fields[index].value"
65
+ :value="data.fields[index].value"
66
+ @change="onchange(index)"
67
+ @blur="onblur(index)"
68
+ @input="oninput(index)"
69
+ >
70
+ </textarea>
71
+ </div>
72
+ </div>
73
+
74
+ <!--select-->
75
+ <div :style="item.style ? item.style+';height: 40px;margin-bottom: 4px':'height: 40px;margin-bottom: 4px'"
76
+ v-if="item.type==='select' && !item.hidden && (item.device === 'pc' || !item.device)"
77
+ :class="[item.required && !(item.value) ? 'has-error' : '',item.bootstraped?item.bootstraped+' form-group':'col-sm-4 form-group']">
78
+ <label
79
+ :class="item.label_bootstraped ? item.label_bootstraped+' control-label control-label-justify':'control-label-justify control-label col-sm-6'">{{item.label}}</label>
80
+ <div :style="item.value_style ? item.value_style:''"
81
+ :class="item.value_bootstraped ? item.value_bootstraped : 'col-sm-6'">
82
+ <input-select
83
+ class="select select_list"
84
+ @blur="onblur(index)"
85
+ @change="onchange(index)"
86
+ @select-search="selectSearch($arguments,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: 4px':'height: 40px;margin-bottom: 4px'"
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
+
117
+ <!--image-->
118
+ <div :style="item.style ? item.style :'height: 40px;margin-bottom: 4px'"
119
+ v-if="item.type==='image' && !item.hidden && (item.device === 'pc' || !item.device)"
120
+ :class="[item.required && item.value.length === 0 ? 'has-error' : '',item.bootstraped?item.bootstraped+' form-group':'col-sm-4 form-group']">
121
+ <label :style="item.label_style ? item.label_style : ''"
122
+ :class="item.label_bootstraped ? item.label_bootstraped+' control-label-justify control-label' : 'control-label-justify control-label col-sm-6'">{{item.label}}</label>
123
+ <div :style="item.value_style ? item.value_style:''"
124
+ :class="item.value_bootstraped ? item.value_bootstraped : 'col-sm-6'">
125
+ <img v-if="data.fields[index].value" :src="data.fields[index].value" :style="item.imgStyle ? item.imgStyle : ''">
126
+ </div>
127
+ </div>
128
+ </div>
129
+ </div>
130
+
131
+ <!-- onetomany -->
132
+ <div class="" v-for="(index,item) in data.onetomany">
133
+ <onetomany :selectdata="data" :onetomany="item" :index="index" v-if="(item.device === 'pc' || !item.device) && !item.hidden"></onetomany>
134
+ </div>
135
+
136
+ <div v-for="(i,item) in data.components">
137
+ <component v-if="(item.device === 'pc' || !item.device) && !item.hidden" :is="item.name" :selectdata="data" :mark="item.mark"></component>
138
+ </div>
139
+
140
+ <!--自定义组件-->
141
+ <slot></slot>
142
+ <!--公司等属性-->
143
+ <div class="col-sm-12 form-group text-center" style="padding-top:8px">
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.orgs}}
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.parentname}}
154
+ </div>
155
+ </div>
156
+ <div class="col-sm-3 form-group center-block">
157
+ <label class="col-sm-5">操作人:</label>
158
+ <div class="col-sm-6 " style="text-align: left">
159
+ {{model.operator}}
160
+ </div>
161
+ </div>
162
+ <div class="col-sm-3 form-group center-block">
163
+ <label class="col-sm-5">操作日期:</label>
164
+ <div class="col-sm-6" style="text-align: left">
165
+ {{model.operate_date}}
166
+ </div>
167
+ </div>
168
+ </div>
169
+ <!-- 按钮组 -->
170
+ <div class="from-group col-sm-12 text-center" >
171
+ <!-- 按钮组 -->
172
+ <button v-for="(index,button) in data.buttons"
173
+ :disabled="button.disabled && disable_button"
174
+ style="min-width:100px"
175
+ :class="button.disabled && disable_button ? 'btn btn-default button_spacing' : 'btn btn-primary button_spacing'"
176
+ v-if="!button.hidden"
177
+ @click.prevent="click_but(button)"
178
+ >
179
+ {{button.button_name}}
180
+ </button>
181
+ </div>
182
+
183
+ <!-- 按钮模态框 -->
184
+ <modal v-if="showButModal" :show.sync="showButModal" backdrop="false" large>
185
+ <header slot="modal-header" class="modal-header">
186
+ <button type="button" class="close" @click="closeModal()"><span>&times;</span></button>
187
+ <span class="modal-title"><font
188
+ size="3">{{data.button.button_name}}</font></span>
189
+ </header>
190
+ <article slot="modal-body" class="modal-body clearfix">
191
+ <div class="form-group" style="padding: 0 150px">
192
+ <div v-for="(index,item) in data.button.button_fields">
193
+ <div :style="item.style ? item.style : ''" :class="[item.required && !(item.value) ? 'has-error' : '', item.bootstraped ? item.bootstraped + ' form-group' : 'form-group']"
194
+ v-if="(item.type==='input' || item.type==='number'||item.type === 'tel'||item.type === 'email') && !item.hidden && (item.device === 'pc' || !item.device)">
195
+ <label :style="item.label_style ? item.label_style : ''"
196
+ :class="item.label_bootstraped ? item.label_bootstraped + ' control-label-justify control-label' : 'control-label-justify control-label col-sm-6'">{{item.label}}</label>
197
+ <div :style="item.value_style ? item.value_style : ''"
198
+ :class="item.value_bootstraped ? item.value_bootstraped : 'col-sm-9'">
199
+ <input class="form-control input_view"
200
+ :placeholder="item.placeholder"
201
+ :type="item.type"
202
+ v-model="item.value"
203
+ :value="item.value"
204
+ :readonly="item.readonly"
205
+ :disabled="item.disabled"
206
+ @change="onbutchange(index)"
207
+ @blur="onbutblur(index)"
208
+ @input="onbutinput(index)"
209
+ />
210
+ </div>
211
+ </div>
212
+
213
+ <!--时间datepicker-->
214
+ <div :style="item.style ? item.style : ''" :class="[item.required && !(item.value) ? 'has-error' : '', item.bootstraped ? item.bootstraped + ' form-group':'form-group']"
215
+ v-if="item.type==='datepicker' && !item.hidden && (item.device === 'pc' || !item.device)">
216
+ <label :style="item.label_style ? item.label_style : ''"
217
+ :class="item.label_bootstraped ? item.label_bootstraped + ' control-label-justify control-label' : 'control-label-justify control-label col-sm-6'">{{item.label}}</label>
218
+ <div :style="item.value_style ? item.value_style : ''"
219
+ :class="item.value_bootstraped ? item.value_bootstraped : 'col-sm-9'">
220
+ <datepicker
221
+ :placeholder="item.placeholder"
222
+ :value.sync="item.value"
223
+ v-model="item.value"
224
+ :readonly="item.readonly"
225
+ :disabled="item.disabled"
226
+ :format="item.format ? item.format : 'yyyy-MM-dd'"
227
+ :show-reset-button="true"
228
+ @change="onbutchange(index)"
229
+ @blur="onbutblur(index)"
230
+ ></datepicker>
231
+ </div>
232
+ </div>
233
+
234
+ <!--select-->
235
+ <div :style="item.style ? item.style : ''" :class="[item.required && !(item.value) ? 'has-error' : '', item.bootstraped ? item.bootstraped + ' form-group':'form-group']"
236
+ v-if="item.type==='select' && !item.hidden && (item.device === 'pc' || !item.device)">
237
+ <label :style="item.label_style ? item.label_style : ''"
238
+ :class="item.label_bootstraped ? item.label_bootstraped + ' control-label-justify control-label' : 'control-label-justify control-label col-sm-6'">{{item.label}}</label>
239
+ <div :style="item.value_style ? item.value_style : ''"
240
+ :class="item.value_bootstraped ? item.value_bootstraped : 'col-sm-9'">
241
+ <input-select
242
+ class="select select_list"
243
+ :value.sync="item.value"
244
+ v-model="item.value"
245
+ :options='item.options'
246
+ :readonly="item.readonly"
247
+ :disable="item.disabled"
248
+ :valueSingle="true"
249
+ @blur="onbutblur(index)"
250
+ @change="onbutchange(index)"
251
+ ></input-select>
252
+ </div>
253
+ </div>
254
+
255
+ <!--textarea-->
256
+ <div :style="item.style ? item.style : ''" :class="[item.required && !(item.value) ? 'has-error' : '', item.bootstraped ? item.bootstraped + ' form-group':'form-group']"
257
+ v-if="item.type==='textarea' && !item.hidden && (item.device === 'pc' || !item.device)">
258
+ <label :style="item.label_style ? item.label_style : ''"
259
+ :class="item.label_bootstraped ? item.label_bootstraped + ' control-label-justify control-label' : 'control-label-justify control-label col-sm-6'">{{item.label}}</label>
260
+ <div :style="item.value_style ? item.value_style : ''"
261
+ :class="item.value_bootstraped ? item.value_bootstraped : 'col-sm-9'">
262
+ <textarea
263
+ class="form-control input_view"
264
+ style="width: 100%;height: 100%"
265
+ v-model="item.value"
266
+ :value="item.value"
267
+ :rows="item.rows"
268
+ :readonly="item.readonly"
269
+ :disabled="item.disabled"
270
+ @change="onbutchange(index)"
271
+ @blur="onbutblur(index)"
272
+ @input="onbutinput(index)"
273
+ ></textarea>
274
+ </div>
275
+ </div>
276
+ </div>
277
+ </div>
278
+ </article>
279
+ <footer slot="modal-footer" class="modal-footer">
280
+ <button :class="disable_modal_button ? 'btn btn-default':'btn btn-primary'"
281
+ :disabled="disable_modal_button" type="button" @click="confirmModal()">
282
+ 确认
283
+ </button>
284
+ </footer>
285
+ </modal>
286
+ </form>
287
+ </div>
288
+ </template>
289
+ <script>
290
+ import Vue from 'vue'
291
+ import {isEmpty} from '../Util'
292
+ // Date格式化
293
+ Date.prototype.Format = function (fmt) {
294
+ var o = {
295
+ 'M+': this.getMonth() + 1, // 月份
296
+ 'd+': this.getDate(), // 日
297
+ 'H+': this.getHours(), // 小时
298
+ 'm+': this.getMinutes(), // 分
299
+ 's+': this.getSeconds(), // 秒
300
+ 'q+': Math.floor((this.getMonth() + 3) / 3), // 季度
301
+ 'S': this.getMilliseconds() // 毫秒
302
+ }
303
+ if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (this.getFullYear() + '').substr(4 - RegExp.$1.length))
304
+ for (var k in o) {
305
+ if (new RegExp('(' + k + ')').test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length === 1) ? (o[k]) : (('00' + o[k]).substr(('' + o[k]).length)))
306
+ }
307
+ return fmt
308
+ }
309
+
310
+ export default {
311
+ title: '报建业务通用组件',
312
+ props: {
313
+ data: {
314
+ type: Object
315
+ }
316
+ },
317
+ data () {
318
+ return {
319
+ hiddenButon: true,
320
+ disableds: true,
321
+ model: {}, // 公司等属性
322
+ disable_button: true, // 控制按钮禁用
323
+ disable_modal_button: true, // 控制按钮禁用
324
+ showButModal: false
325
+ }
326
+ },
327
+ watch: {
328
+ deep: true
329
+ },
330
+ computed: {
331
+
332
+ },
333
+ created () {
334
+ // 初始化数据
335
+ this.initializtion()
336
+ if (this.data.readyEvent) {
337
+ this.$dispatch(this.data.readyEvent)
338
+ }
339
+ this.$dispatch('initializtionView')
340
+
341
+ setTimeout(() => {
342
+ // 是否禁用按钮
343
+ this.disableButton()
344
+ }, 2000)
345
+ },
346
+ methods: {
347
+ // 初始化数据
348
+ initializtion () {
349
+ for (const item of this.data.fields) {
350
+ this.data[item.field] = item.value
351
+ }
352
+
353
+ // 公司等属性初始化
354
+ if (this.data.orgs) {
355
+ this.model.orgs = this.data.orgs
356
+ } else {
357
+ this.model.orgs = this.$login.f.f_fengongsi
358
+ console.log("数据",this.model.orgs)
359
+ }
360
+ if (this.data.parentname) {
361
+ this.model.parentname = this.data.parentname
362
+ } else {
363
+ this.model.parentname = this.$login.f.f_department_name
364
+ }
365
+ if (this.data.operate_date) {
366
+ this.model.operate_date = this.data.operate_date
367
+ } else {
368
+ this.model.operate_date = new Date().Format('yyyy-MM-dd')
369
+ }
370
+ if (this.data.operator) {
371
+ this.model.operator = this.data.operator
372
+ } else {
373
+ this.model.operator = this.$login.f.name
374
+ }
375
+ },
376
+ // 是否禁用按钮
377
+ disableButton () {
378
+ let flag = false
379
+
380
+ for (const field of this.data.fields) {
381
+ if (field.required && !field.value && !field.hidden && field.value !== 0) {
382
+ flag = true
383
+ }
384
+
385
+ // 任何选择框只要是否都不能提交
386
+ if (field.type === 'select' && field.value === '否' && field.value_no_disable) {
387
+ flag = true
388
+ }
389
+
390
+ if (field.type === 'checkbox' && field.required && field.value.length === 0) {
391
+ flag = true
392
+ }
393
+ }
394
+
395
+ this.disable_button = flag
396
+ },
397
+ // 失去焦点且值最终发生变化触发
398
+ async onchange (index) {
399
+ // 是否禁用按钮
400
+ this.disableButton()
401
+
402
+ if (!isEmpty(this.data.fields[index].value)) {
403
+ // 前缀、后缀
404
+ if (this.data.fields[index].prefix) {
405
+ this.data.fields[index].value = this.data.fields[index].prefix + this.data.fields[index].value
406
+ }
407
+ if (this.data.fields[index].suffix) {
408
+ this.data.fields[index].value = this.data.fields[index].value + this.data.fields[index].suffix
409
+ }
410
+ }
411
+
412
+ // data赋值
413
+ this.data[this.data.fields[index].field] = this.data.fields[index].value
414
+
415
+ if (this.data.fields[index].type === 'datepicker') {
416
+ this.check_datepicker(index)
417
+ }
418
+
419
+ if (this.data.fields[index].onchange) {
420
+ this.$dispatch(this.data.fields[index].onchange, index)
421
+ }
422
+ this.$dispatch('onchange', index)
423
+ },
424
+ // 失去焦点触发,无论值是否发生变化
425
+ onblur (index) {
426
+ this.disableButton()
427
+
428
+ if (this.data.fields[index].onblur) {
429
+ this.$dispatch(this.data.fields[index].onblur, index)
430
+ }
431
+
432
+ this.$dispatch('onblur', index)
433
+ },
434
+ oninput (index) {
435
+ // 是否禁用按钮
436
+ this.disableButton()
437
+
438
+ if (this.data.fields[index].oninput) {
439
+ this.$dispatch(this.data.fields[index].oninput, index)
440
+ }
441
+ this.$dispatch('oninput', index)
442
+ },
443
+ selectSearch(event, index) {
444
+ if (this.data.fields[index].selectSearch) {
445
+ this.$dispatch(this.data.fields[index].selectSearch, event[0], index)
446
+ }
447
+ this.$dispatch('selectSearch', event[0], index)
448
+ },
449
+ // 点击按钮组按钮
450
+ async click_but (button) {
451
+ this.disable_button = true
452
+ for (let i = 0; i < this.data.buttons.length; i++) {
453
+ if( button.button_name!='下发'){
454
+ if(button.button_name===this.data.buttons[i].button_name){
455
+ this.data.buttons[i].disabled= true
456
+ }
457
+ }
458
+ }
459
+ this.data.fields.forEach(item => {
460
+ this.data[item.field] = item.value
461
+ })
462
+ this.data.button = button
463
+ if (button.button_fields && button.button_fields.length > 0) {
464
+ this.showButModal = true
465
+ return
466
+ }
467
+
468
+ if (this.data.button.event) {
469
+ this.$dispatch(this.data.button.event)
470
+ } else {
471
+ this.$dispatch('button')
472
+ }
473
+ },
474
+ confirmModal () {
475
+ this.closeModal()
476
+
477
+ this.data.button.button_fields.forEach(item => {
478
+ this.data.button[item.field] = item.value
479
+ })
480
+
481
+ if (this.data.button.event) {
482
+ this.$dispatch(this.data.button.event)
483
+ } else {
484
+ this.$dispatch('button')
485
+ }
486
+ },
487
+ // 关闭模态框
488
+ closeModal () {
489
+ this.showButModal = false
490
+ this.disable_modal_button = false
491
+ },
492
+ onbutchange (index) {
493
+ // 是否禁用按钮
494
+ this.disableModalButton()
495
+
496
+ if (this.data.button.button_fields[index].onchange) {
497
+ this.$dispatch(this.data.button.button_fields[index].onchange, index)
498
+ } else {
499
+ this.$dispatch('onbutchange', index)
500
+ }
501
+
502
+ },
503
+ onbutblur (index) {
504
+ this.disableModalButton()
505
+
506
+ if (this.data.button.button_fields[index].onblur) {
507
+ this.$dispatch(this.data.button.button_fields[index].onblur, index)
508
+ } else {
509
+ this.$dispatch('onbutblur', index)
510
+ }
511
+ },
512
+ onbutinput (index) {
513
+ // 是否禁用按钮
514
+ this.disableModalButton()
515
+
516
+ if (this.data.button.button_fields[index].oninput) {
517
+ this.$dispatch(this.data.button.button_fields[index].oninput, index)
518
+ } else {
519
+ this.$dispatch('onbutinput', index)
520
+ }
521
+ },
522
+ disableModalButton () {
523
+ let flag = false
524
+
525
+
526
+ for (const item of this.data.button.button_fields) {
527
+ if (item.required && !item.value) {
528
+ if (item.value === 0) {
529
+ flag = false
530
+ } else {
531
+ flag = true
532
+ }
533
+ }
534
+ }
535
+
536
+ this.disable_modal_button = flag
537
+ },
538
+ check_datepicker (index) {
539
+ // 时间格式检测
540
+ if (!isEmpty(this.data.fields[index].value)) {
541
+
542
+ let dateReg = /^[1-9]\d{3}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])$/
543
+ let timeReg = /^(20|21|22|23|[0-1]\d):[0-5]\d:[0-5]\d$/
544
+ 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$/
545
+ if (this.data.fields[index].format) {
546
+ if (this.data.fields[index].format === 'yyyy-MM-dd') {
547
+ if (!dateReg.test(this.data.fields[index].value)) {
548
+ this.data.fields[index].value = ''
549
+ this.$showMessage(this.data.fields[index].label + '格式错误如:2021-01-01')
550
+ }
551
+ }
552
+ if (this.data.fields[index].format === 'HH:mm:ss') {
553
+ if (!timeReg.test(this.data.fields[index].value)) {
554
+ this.data.fields[index].value = ''
555
+ this.$showMessage(this.data.fields[index].label + '格式错误如:00:00:00')
556
+ }
557
+ }
558
+ if (this.data.fields[index].format === 'yyyy-MM-dd HH:mm:ss') {
559
+ if (!datetimeReg.test(this.data.fields[index].value)) {
560
+ this.data.fields[index].value = ''
561
+ this.$showMessage(this.data.fields[index].label + '格式错误如:2021-01-01 00:00:00')
562
+ }
563
+ }
564
+ } else {
565
+ if (!dateReg.test(this.data.fields[index].value)) {
566
+ this.data.fields[index].value = ''
567
+ this.$showMessage(this.data.fields[index].label + '格式错误如:2021-01-01')
568
+ }
569
+ }
570
+ }
571
+ }
572
+ },
573
+ events: {
574
+
575
+ }
576
+ }
577
+ </script>
578
+ <style>
579
+ .datepicker{
580
+ width: 100%!important;
581
+ }
582
+ .datepicker-input{
583
+ background-color: #ffffff!important;
584
+ width: 100%!important;
585
+ }
586
+ .datepicker-input:disabled{
587
+ border: 1px solid #DDD!important;
588
+ color: rgba(21, 1, 1, 0.8) !important;
589
+ width: 100%!important;
590
+ }
591
+ </style>
592
+ <style scoped>
593
+ th{
594
+ font-size: 15px !important;
595
+ text-align: center !important;
596
+ background-color: #dfedfb!important;
597
+ color: rgba(21, 1, 1, 0.8) !important;
598
+ font-family: PINGFANG-BOLD !important;
599
+ font-weight: normal!important;
600
+ }
601
+ /*清除model中的浮动*/
602
+ .clearfix:after,.clearfix:before{
603
+ display: table;
604
+ }
605
+ .clearfix:after{
606
+ clear: both;
607
+ }
608
+
609
+ .input_view{
610
+ background-color: #ffffff;
611
+ border-radius: 2px;
612
+ border: solid 1px #c7c7c7!important;
613
+ color: rgba(21, 1, 1, 0.8) !important;
614
+ font-size: 15px!important;
615
+ }
616
+
617
+ .input_view[readonly]{
618
+ border: 1px solid #DDD!important;
619
+ color: rgba(21, 1, 1, 0.8) !important;
620
+ }
621
+ .input_view:disabled{
622
+ border: 1px solid #DDD!important;
623
+ color: rgba(21, 1, 1, 0.85) !important;
624
+ }
625
+
626
+ .control-label-justify {
627
+ display: inline-block;
628
+ vertical-align: top;
629
+ width: 110px;
630
+ text-align: justify;
631
+ font-family: PingFang-SC-Bold;
632
+ }
633
+
634
+ .control-label-justify::after {
635
+ content: "";
636
+ display: inline-block;
637
+ width: 100%;
638
+ overflow: hidden;
639
+ height: 0;
640
+ }
641
+ input::-webkit-outer-spin-button,
642
+ input::-webkit-inner-spin-button {
643
+ -webkit-appearance: none;
644
+ }
645
+
646
+ input[type="number"] {
647
+ -moz-appearance: textfield;
648
+ }
649
+
650
+ </style>