apply-clients 7.1.36-1 → 7.1.36-yuchuan-2

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