apply-clients 7.1.36-yuchuan-2 → 7.1.36-yuchuan-3

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 (61) hide show
  1. package/build/dev-server.js +7 -3
  2. package/package.json +3 -3
  3. package/src/AndroidApp.vue +35 -35
  4. package/src/apply.js +12 -1
  5. package/src/applyAndroid.js +87 -83
  6. package/src/components/android/AppUpload.vue +15 -0
  7. package/src/components/android/Ignition/VentilationIgnition.vue +1 -1
  8. package/src/components/android/Process/AppExplorationUser.vue +2 -2
  9. package/src/components/android/Process/AppServiceControl.vue +1410 -1397
  10. package/src/components/android/Supervisory/AppProcessSupervisory.vue +334 -334
  11. package/src/components/android/Task/Build/BuildTsak.vue +7 -4
  12. package/src/components/android/Task/GuanXianJianShe/AppExplorationGuanXian.vue +317 -432
  13. package/src/components/android/Task/GuanXianJianShe/AppGuanXianCaiLiao.vue +237 -0
  14. package/src/components/android/Task/ShenHe/BuZhangShenHe.vue +64 -64
  15. package/src/components/android/Task/ShenHe/JingLiShenHe.vue +64 -64
  16. package/src/components/android/Task/ShiGongXinXi/AppShowBuildUser.vue +11 -7
  17. package/src/components/android/Task/UpBuild/UpBuildDui.vue +5 -2
  18. package/src/components/android/Task/UpBuild/UpBuildTsak.vue +5 -2
  19. package/src/components/android/Task/UpBuild/UpJianLi.vue +98 -98
  20. package/src/components/product/ApplyCharge/ApplyChargeList.vue +943 -606
  21. package/src/components/product/ApplyGaiXianCharge/ApplyGaiXianChargeList.vue +8 -7
  22. package/src/components/product/ApplyGuanXian/GuanXianCaiLiao.vue +236 -235
  23. package/src/components/product/ApplyGuanXian/GuanXianExplorationSelect.vue +324 -323
  24. package/src/components/product/ChongZheng/ApplyChongZhengList.vue +10 -9
  25. package/src/components/product/Function/InstallInfoSelect.vue +371 -370
  26. package/src/components/product/Function/Service/FunctionServiceControl.vue +475 -475
  27. package/src/components/product/Ignition/IgnitionList.vue +236 -236
  28. package/src/components/product/Ignition/IgnitionListManage.vue +403 -204
  29. package/src/components/product/Ignition/IgnitionRecord.vue +14 -13
  30. package/src/components/product/List/ShowAllActivity.vue +455 -0
  31. package/src/components/product/List/ShowDevices.vue +279 -279
  32. package/src/components/product/Print/BuildOrder/buildOrderList.vue +9 -8
  33. package/src/components/product/Print/BuildOrder/printBuildOrder.vue +6 -0
  34. package/src/components/product/Process/ExplorationSelect.vue +591 -581
  35. package/src/components/product/Process/ExplorationUser.vue +158 -158
  36. package/src/components/product/Process/New1ExplorationUser.vue +201 -0
  37. package/src/components/product/Process/New2ExplorationUser.vue +163 -0
  38. package/src/components/product/Process/NewExplorationSelect.vue +586 -0
  39. package/src/components/product/Process/NewExplorationUser.vue +219 -184
  40. package/src/components/product/Process/Processes/ApplyChaiChuInfo.vue +587 -587
  41. package/src/components/product/Process/Processes/InstallationDetails.vue +80 -7
  42. package/src/components/product/Process/Processes/Print/printPaymentApproval.vue +224 -224
  43. package/src/components/product/Process/Processes/newDevicesManagement.vue +26 -1
  44. package/src/components/product/Process/Processes/newInstallationDetails.vue +1 -36
  45. package/src/components/product/Process/Processes/selectOldUserinfo.vue +241 -241
  46. package/src/components/product/Process/Service/ServiceControl.vue +2166 -2162
  47. package/src/components/product/Report/ReportItems.vue +85 -79
  48. package/src/components/product/Report/apply-stair-kaifa.vue +0 -1
  49. package/src/components/product/Report/gongchengbu.vue +199 -0
  50. package/src/components/product/ServiceView.vue +644 -644
  51. package/src/components/product/Stop/StopApplyList.vue +8 -8
  52. package/src/components/product/Supervisory/Service/SupervisoryServiceControl.vue +594 -594
  53. package/src/components/product/Supervisory/SupervisoryList.vue +539 -537
  54. package/src/components/product/Supervisory/YiBanSupervisoryControl.vue +114 -0
  55. package/src/components/product/Supervisory/YiBanSupervisoryList.vue +541 -0
  56. package/src/main.js +27 -27
  57. package/dist-android.7z +0 -0
  58. package/dist.7z +0 -0
  59. package/rebel.xml +0 -16
  60. package/src/components/product/Process/Processes/addressAndUserinfoManagement.vue +0 -207
  61. package/yarn-error.log +0 -9976
@@ -1,644 +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
-
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>
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>