apply-clients 3.3.217 → 3.4.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 (121) hide show
  1. package/android.html +23 -23
  2. package/build/css-loaders.js +34 -0
  3. package/build/dev-android.js +101 -0
  4. package/build/dev-client.js +8 -0
  5. package/build/dev-server-app.js +76 -0
  6. package/build/dev-server.js +119 -0
  7. package/build/example-server.js +80 -0
  8. package/build/release.sh +28 -0
  9. package/build/utils.js +80 -0
  10. package/build/webpack.base.conf.js +84 -0
  11. package/build/webpack.baseandroid.conf.js +84 -0
  12. package/build/webpack.dev.conf.js +39 -0
  13. package/build/webpack.devandroid.conf.js +34 -0
  14. package/build/webpack.example.conf.js +49 -0
  15. package/build/webpack.prod.conf.js +60 -0
  16. package/build/webpack.prodandroid.conf.js +60 -0
  17. package/build/webpack.test.conf.js +31 -0
  18. package/index.html +33 -33
  19. package/package.json +3 -3
  20. package/src/AndroidApp.vue +35 -30
  21. package/src/App.vue +20 -20
  22. package/src/android.js +21 -21
  23. package/src/apply.js +81 -90
  24. package/src/applyAndroid.js +32 -53
  25. package/src/components/android/AppOnetomany.vue +301 -285
  26. package/src/components/android/AppServiceView.vue +566 -570
  27. package/src/components/android/AppSign.vue +142 -142
  28. package/src/components/android/AppTakePic.vue +143 -144
  29. package/src/components/android/Process/AppExplorationUser.vue +320 -270
  30. package/src/components/android/Process/AppServiceControl.vue +757 -686
  31. package/src/components/android/Process/Processes/AppInstallationDetails.vue +456 -466
  32. package/src/components/android/ProgressReport/ProgressReportDetail.vue +64 -0
  33. package/src/components/android/ProgressReport/ProgressReportList.vue +209 -0
  34. package/src/components/android/Supervisory/AppProcessSupervisory.vue +73 -152
  35. package/src/components/android/Supervisory/AppSupervisoryCart.vue +121 -115
  36. package/src/components/android/TaskGraph.vue +125 -0
  37. package/src/components/build/Install/ExplorationUser.vue +304 -0
  38. package/src/components/build/Install/Process/zhongran/ZR_Design.vue +537 -0
  39. package/src/components/product/ApplyCharge/ApplyChargeList.vue +36 -50
  40. package/src/components/product/ApplyCharge/ApplyChargeSearch.vue +3 -3
  41. package/src/components/product/Function/InstallFunction.vue +125 -122
  42. package/src/components/product/Function/InstallInfoSelect.vue +292 -318
  43. package/src/components/product/Function/Service/FunctionServiceControl.vue +222 -254
  44. package/src/components/product/Function/StopApplyCrrdList.vue +176 -0
  45. package/src/components/product/Function/functions/ApplyRecordCancel.vue +102 -0
  46. package/src/components/product/Function/functions/StopInstall.vue +106 -0
  47. package/src/components/product/Onetomany.vue +377 -296
  48. package/src/components/product/Order/OrderApply.vue +30 -30
  49. package/src/components/product/Order/OrderApplyList.vue +78 -67
  50. package/src/components/product/Order/OrderMessage.vue +11 -87
  51. package/src/components/product/Process/ExplorationSelect.vue +410 -369
  52. package/src/components/product/Process/ExplorationUser.vue +138 -128
  53. package/src/components/product/Process/Processes/InstallationDetails.vue +592 -504
  54. package/src/components/product/Process/Processes/Print/img/10101.png +0 -0
  55. package/src/components/product/Process/Processes/Print/img/1010109.png +0 -0
  56. package/src/components/product/Process/Processes/Print/img/1010110.png +0 -0
  57. package/src/components/product/Process/Processes/Print/img/1010111.png +0 -0
  58. package/src/components/product/Process/Processes/Print/img/1010112.png +0 -0
  59. package/src/components/product/Process/Processes/Print/printCharge.vue +142 -0
  60. package/src/components/product/Process/Processes/addressAndUserinfoManagement.vue +207 -181
  61. package/src/components/product/Process/Processes/chargeManagement.vue +639 -638
  62. package/src/components/product/Process/Processes/devicesManagement.vue +22 -2
  63. package/src/components/product/Process/Processes/selectApply.vue +1 -1
  64. package/src/components/product/Process/Service/ServiceControl.vue +1254 -883
  65. package/src/components/product/Process/Service/ShowBackReason.vue +33 -0
  66. package/src/components/product/ServiceView.vue +631 -741
  67. package/src/components/product/Stop/StopApply.vue +103 -103
  68. package/src/components/product/Stop/StopApplyList.vue +269 -254
  69. package/src/components/product/Supervisory/Service/SupervisoryServiceControl.vue +186 -517
  70. package/src/components/product/Supervisory/SupervisoryControl.vue +100 -108
  71. package/src/components/product/Supervisory/SupervisoryList.vue +233 -253
  72. package/src/components/product/Supervisory/SupervisoryhCart.vue +107 -124
  73. package/src/components/product/VueUtils/ApplyUpload.vue +273 -264
  74. package/src/components/product/VueUtils/HighMeter.vue +208 -0
  75. package/src/expandcssAndroid.less +1034 -517
  76. package/src/filiale/yuchuan/android/Process/AppServiceControl.vue +731 -414
  77. package/src/filiale/yuchuan/android/Process/Processes/AppInstallationDetails.vue +824 -456
  78. package/src/filiale/yuchuan/android/Process/Processes/AppInstallationDetailsCivil.vue +650 -0
  79. package/src/filiale/yuchuan/android/Sign/AppSignTask.vue +182 -0
  80. package/src/{components/android/Process/Processes/AppBuildSign.vue → filiale/yuchuan/android/Sign/BuildSign.vue} +50 -47
  81. package/src/filiale/yuchuan/android/Sign/ConstructSign.vue +50 -0
  82. package/src/filiale/yuchuan/android/Sign/DesignSign.vue +50 -0
  83. package/src/filiale/yuchuan/android/Sign/SupervisorSign.vue +50 -0
  84. package/src/filiale/yuchuan/android/Task/Build/BuildTsak.vue +60 -0
  85. package/src/filiale/yuchuan/android/Task/Survey/SurveyTsak.vue +60 -0
  86. package/src/filiale/yuchuan/android.js +14 -8
  87. package/src/filiale/yuchuan/pc/Order/OrderApply.vue +528 -517
  88. package/src/filiale/yuchuan/pc/Order/OrderApplyList.vue +343 -343
  89. package/src/filiale/yuchuan/pc/Process/ExplorationSelect.vue +270 -231
  90. package/src/filiale/yuchuan/pc/Process/ExplorationUser.vue +149 -131
  91. package/src/filiale/yuchuan/pc/Process/Processes/ApplyMapCom.vue +67 -0
  92. package/src/filiale/yuchuan/pc/Process/Processes/InstallationDetails.vue +809 -0
  93. package/src/filiale/yuchuan/pc/Process/Processes/InstallationDetailsCivil.vue +595 -0
  94. package/src/filiale/yuchuan/pc/Process/Processes/chargeManagement.vue +470 -0
  95. package/src/filiale/yuchuan/pc/Process/Service/ServiceControl.vue +1074 -517
  96. package/src/filiale/yuchuan/pc.js +12 -13
  97. package/src/main.js +23 -23
  98. package/src/components/android/Function/AppFunctionServiceControl.vue +0 -329
  99. package/src/components/android/Function/AppInstallFunction.vue +0 -330
  100. package/src/components/android/Process/Processes/AppChargeManagement.vue +0 -468
  101. package/src/components/android/Process/Processes/AppDevicesManagement.vue +0 -490
  102. package/src/components/android/Process/Processes/AppSupplementalAgreement.vue +0 -297
  103. package/src/components/android/Process/Processes/AppjiaSign.vue +0 -47
  104. package/src/components/android/Process/Processes/AppjiafangSign.vue +0 -47
  105. package/src/components/android/Process/Processes/ApptechnologySign.vue +0 -47
  106. package/src/components/image/dwg.jpg +0 -0
  107. package/src/components/image/yasuobao.jpg +0 -0
  108. package/src/components/product/Function/Inform.vue +0 -73
  109. package/src/components/product/Function/MarketSurvey.vue +0 -81
  110. package/src/components/product/Process/Processes/printCharge.vue +0 -121
  111. package/src/components/product/Process/ShowBackReason.vue +0 -33
  112. package/src/components/product/Supervisory/Service/printChargeNode.vue +0 -873
  113. package/src/components/product/VueUtils/GaoPaiYi/HighMeter.vue +0 -1090
  114. package/src/components/product/VueUtils/ToolsPage.vue +0 -51
  115. package/src/components/product/VueUtils/Tree.vue +0 -330
  116. package/src/filiale/wuan/android.js +0 -0
  117. package/src/filiale/wuan/pc.js +0 -4
  118. package/src/filiale/yuchuan/android/AppServiceView.vue +0 -599
  119. package/src/filiale/yuchuan/android/Reserve/ApplyReserve.vue +0 -200
  120. package/src/filiale/yuchuan/android/SiteSurvey/TaskGraph.vue +0 -137
  121. package/src/filiale/yuchuan/pc/Process/Processes/MapCom.vue +0 -51
@@ -1,570 +1,566 @@
1
- <template>
2
- <div class="form-horizontal select-overspread">
3
- <div v-for="(index,item) in data.fields">
4
- <!--input-->
5
- <div :style="item.style ? item.style : ''"
6
- v-if="(item.type==='input' || item.type==='number'||item.type === 'tel'||item.type === 'email') && !item.hidden && (item.device === 'app' || !item.device)"
7
- :class="[item.required && !(item.value) ? 'apply-has-error' : '', item.bootstraped ? item.bootstraped + ' form-group app-input':'col-xs-12 form-group app-input']">
8
- <label class="control-label-justify">{{item.label}}</label>
9
- <div :style="item.value_style ? item.value_style:''"
10
- :class="item.value_bootstraped ? item.value_bootstraped : 'col-xs-8'">
11
- <input class="" style="width: 100%"
12
- :type="item.type"
13
- v-model="data.fields[index].value"
14
- :placeholder="item.placeholder"
15
- :value="data.fields[index].value"
16
- :readonly="item.readonly"
17
- :disabled="item.disabled"
18
- @change="onchange(index)"
19
- @blur="onblur(index)"
20
- @input="oninput(index)"
21
- />
22
- </div>
23
- </div>
24
-
25
- <!--select-->
26
- <div :style="item.style ? item.style : ''"
27
- v-if="item.type==='select' && !item.hidden && (item.device === 'app' || !item.device)"
28
- :class="[item.required && !(item.value) ? 'apply-has-error' : '', item.bootstraped ? item.bootstraped + ' form-group app-input':'col-xs-12 form-group app-input']">
29
- <label class="control-label-justify">{{item.label}}</label>
30
- <div :style="item.value_style ? item.value_style:''"
31
- :class="item.value_bootstraped ? item.value_bootstraped : 'col-xs-8'">
32
- <v-select
33
- class="select" width="100%" align="right"
34
- :placeholder="item.placeholder"
35
- :search="item.search"
36
- close-on-select value-single
37
- :options="data.fields[index].options"
38
- v-model="data.fields[index].value"
39
- :value.sync="data.fields[index].value"
40
- @blur="onblur(index)"
41
- @change="onchange(index)"
42
- :readonly="item.readonly"
43
- :disabled="item.disabled"
44
- ></v-select>
45
- </div>
46
- </div>
47
-
48
- <!--时间datepicker-->
49
- <div :style="item.style ? item.style : ''"
50
- v-if="item.type==='datepicker' && !item.hidden && (item.device === 'app' || !item.device)"
51
- :class="[item.required && !(item.value) ? 'apply-has-error' : '', item.bootstraped ? item.bootstraped+' form-group app-input':'col-xs-12 form-group app-input']">
52
- <label class="control-label-justify">{{item.label}}</label>
53
- <div class="form-group" :style="item.value_style ? item.value_style:''"
54
- :class="item.value_bootstraped ? item.value_bootstraped : 'col-xs-8'">
55
- <datepicker
56
- @change="onchange(index)"
57
- @blur="onblur(index)"
58
- :placeholder="item.placeholder"
59
- :value.sync="data.fields[index].value"
60
- :format="item.format ? item.format : 'yyyy-MM-dd'"
61
- v-model="data.fields[index].value"
62
- :readonly="item.readonly"
63
- :disabled="item.disabled"
64
- :show-reset-button="true">
65
- </datepicker>
66
- </div>
67
- </div>
68
-
69
- <!--textarea-->
70
- <div :style="item.style ? item.style : ''"
71
- v-if="item.type==='textarea' && !item.hidden && (item.device === 'app' || !item.device)"
72
- :class="[item.required && !(item.value) ? 'apply-has-error' : '', item.bootstraped?item.bootstraped+' form-group app-input':'col-xs-12 form-group app-input']">
73
- <label class="control-label-justify">{{item.label}}</label>
74
- <div :style="item.value_style ? item.value_style:''"
75
- :class="item.value_bootstraped ? item.value_bootstraped : 'col-xs-8'">
76
- <textarea
77
- :readonly="item.readonly"
78
- :disabled="item.disabled"
79
- class="" rows="1"
80
- style="width: 100%;height: 100%"
81
- v-model="data.fields[index].value"
82
- :value="data.fields[index].value"
83
- @change="onchange(index)"
84
- @blur="onblur(index)"
85
- @input="oninput(index)"
86
- ></textarea>
87
- </div>
88
- </div>
89
-
90
- <!--checkbox-->
91
- <div :style="item.style ? item.style : ''"
92
- v-if="item.type==='checkbox' && !item.hidden && (item.device === 'app' || !item.device)"
93
- :class="[item.required && item.value.length === 0 ? 'apply-has-error' : '',item.bootstraped?item.bootstraped+' form-group app-input':'col-xs-12 form-group app-input']">
94
- <label class="control-label-justify">{{item.label}}</label>
95
- <div :style="item.value_style ? item.value_style:''"
96
- :class="item.value_bootstraped ? item.value_bootstraped : 'col-xs-8'">
97
- <label class="" v-for="(index2,row) in item.options">
98
- <input type="checkbox" class=""
99
- :readonly="data.fields[index].readonly"
100
- :disabled="data.fields[index].disabled"
101
- v-model="data.fields[index].value"
102
- :value="data.fields[index].options[index2].value"
103
- @change="onchange(index)"
104
- @blur="onblur(index)">
105
- {{row.label}}
106
- </label>
107
- </div>
108
- </div>
109
- </div>
110
-
111
- <div class="col-sm-12 col-xs-12">
112
- <accordion one-at-a-time="true">
113
- <panel v-for="(i,item) in data.onetomany" :header="item.title" :is-open="false" type="primary">
114
- <app-onetomany :onetomany="item" :index="i"></app-onetomany>
115
- </panel>
116
- <panel v-for="(i,item) in data.components" :header="item.title" :is-open="false" type="primary" v-if="item.device === 'app' || !item.device">
117
- <component :is="item.name" :selectdata="data" :mark="item.mark"></component>
118
- </panel>
119
- </accordion>
120
- </div>
121
-
122
- <!--自定义组件-->
123
- <slot></slot>
124
-
125
- <!-- 按钮组 -->
126
- <div class="text-center">
127
- <button v-for="(index,button) in data.buttons"
128
- :disabled="button.disabled && disable_button"
129
- style="min-width:100px"
130
- :class="button.disabled && disable_button ? 'btn btn-default button_spacing' : 'btn btn-primary button_spacing'"
131
- v-if="!button.hidden"
132
- @click.prevent="click_but(button)"
133
- >
134
- {{button.button_name}}
135
- </button>
136
- </div>
137
-
138
- <!-- 按钮模态框 -->
139
- <modal v-if="showButModal" :show.sync="showButModal" backdrop="false" large>
140
- <header slot="modal-header" class="modal-header">
141
- <button type="button" class="close" @click="closeModal()"><span>&times;</span></button>
142
- <span class="modal-title"><font
143
- size="3">{{data.button.button_name}}</font></span>
144
- </header>
145
- <article slot="modal-body" class="modal-body clearfix">
146
- <div class="form-group" >
147
- <div v-for="(index,item) in data.button.button_fields">
148
- <div :style="item.style ? item.style : ''" :class="[item.required && !(item.value) ? 'has-error' : '', item.bootstraped ? item.bootstraped + ' form-group' : 'form-group']"
149
- v-if="(item.type==='input' || item.type==='number'||item.type === 'tel'||item.type === 'email') && !item.hidden && (item.device === 'pc' || !item.device)">
150
- <label :style="item.label_style ? item.label_style : ''"
151
- :class="item.label_bootstraped ? item.label_bootstraped + ' control-label-justify control-label' : 'control-label-justify control-label'">{{item.label}}</label>
152
- <div :style="item.value_style ? item.value_style : ''"
153
- :class="item.value_bootstraped ? item.value_bootstraped : 'col-xs-8'">
154
- <input class="form-control input_view"
155
- :placeholder="item.placeholder"
156
- :type="item.type"
157
- v-model="item.value"
158
- :value="item.value"
159
- :readonly="item.readonly"
160
- :disabled="item.disabled"
161
- @change="onbutchange(index)"
162
- @blur="onbutblur(index)"
163
- @input="onbutinput(index)"
164
- />
165
- </div>
166
- </div>
167
-
168
- <!--时间datepicker-->
169
- <div :style="item.style ? item.style : ''" :class="[item.required && !(item.value) ? 'has-error' : '', item.bootstraped ? item.bootstraped + ' form-group':'form-group']"
170
- v-if="item.type==='datepicker' && !item.hidden && (item.device === 'pc' || !item.device)">
171
- <label :style="item.label_style ? item.label_style : ''"
172
- :class="item.label_bootstraped ? item.label_bootstraped + ' control-label-justify control-label' : 'control-label-justify control-label'">{{item.label}}</label>
173
- <div :style="item.value_style ? item.value_style : ''"
174
- :class="item.value_bootstraped ? item.value_bootstraped : 'col-xs-8'">
175
- <datepicker
176
- :placeholder="item.placeholder"
177
- :value.sync="item.value"
178
- v-model="item.value"
179
- :readonly="item.readonly"
180
- :disabled="item.disabled"
181
- :format="item.format ? item.format : 'yyyy-MM-dd'"
182
- :show-reset-button="true"
183
- @change="onbutchange(index)"
184
- @blur="onbutblur(index)"
185
- ></datepicker>
186
- </div>
187
- </div>
188
-
189
- <!--select-->
190
- <div :style="item.style ? item.style : ''" :class="[item.required && !(item.value) ? 'has-error' : '', item.bootstraped ? item.bootstraped + ' form-group':'form-group']"
191
- v-if="item.type==='select' && !item.hidden && (item.device === 'pc' || !item.device)">
192
- <label :style="item.label_style ? item.label_style : ''"
193
- :class="item.label_bootstraped ? item.label_bootstraped + ' control-label-justify control-label' : 'control-label-justify control-label'">{{item.label}}</label>
194
- <div :style="item.value_style ? item.value_style : ''"
195
- :class="item.value_bootstraped ? item.value_bootstraped : 'col-xs-8'">
196
- <input-select
197
- class="select select_list"
198
- :value.sync="item.value"
199
- v-model="item.value"
200
- :options='item.options'
201
- :readonly="item.readonly"
202
- :disable="item.disabled"
203
- :valueSingle="true"
204
- @blur="onbutblur(index)"
205
- @change="onbutchange(index)"
206
- ></input-select>
207
- </div>
208
- </div>
209
-
210
- <!--textarea-->
211
- <div :style="item.style ? item.style : ''" :class="[item.required && !(item.value) ? 'has-error' : '', item.bootstraped ? item.bootstraped + ' form-group':'form-group']"
212
- v-if="item.type==='textarea' && !item.hidden && (item.device === 'pc' || !item.device)">
213
- <label :style="item.label_style ? item.label_style : ''"
214
- :class="item.label_bootstraped ? item.label_bootstraped + ' control-label-justify control-label' : 'control-label-justify control-label'">{{item.label}}</label>
215
- <div :style="item.value_style ? item.value_style : ''"
216
- :class="item.value_bootstraped ? item.value_bootstraped : 'col-xs-8'">
217
- <textarea
218
- class="form-control input_view"
219
- style="width: 100%;height: 100%"
220
- v-model="item.value"
221
- :value="item.value"
222
- :rows="item.rows"
223
- :readonly="item.readonly"
224
- :disabled="item.disabled"
225
- @change="onbutchange(index)"
226
- @blur="onbutblur(index)"
227
- @input="onbutinput(index)"
228
- ></textarea>
229
- </div>
230
- </div>
231
- </div>
232
- </div>
233
- </article>
234
- <footer slot="modal-footer" class="modal-footer">
235
- <button :class="disable_modal_button ? 'btn btn-default':'btn btn-primary'"
236
- :disabled="disable_modal_button" type="button" @click="confirmModal()">
237
- 确认
238
- </button>
239
- </footer>
240
- </modal>
241
- </div>
242
- </template>
243
- <script>
244
- import Vue from 'vue'
245
- import {isEmpty} from "../Util";
246
- // Date格式化
247
- Date.prototype.Format = function (fmt) {
248
- var o = {
249
- 'M+': this.getMonth() + 1, // 月份
250
- 'd+': this.getDate(), // 日
251
- 'H+': this.getHours(), // 小时
252
- 'm+': this.getMinutes(), // 分
253
- 's+': this.getSeconds(), // 秒
254
- 'q+': Math.floor((this.getMonth() + 3) / 3), // 季度
255
- 'S': this.getMilliseconds() // 毫秒
256
- }
257
- if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (this.getFullYear() + '').substr(4 - RegExp.$1.length))
258
- for (var k in o) {
259
- if (new RegExp('(' + k + ')').test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length === 1) ? (o[k]) : (('00' + o[k]).substr(('' + o[k]).length)))
260
- }
261
- return fmt
262
- }
263
-
264
- export default {
265
- title: '报建业务通用组件',
266
- props: {
267
- data: {
268
- type: Object
269
- },
270
- showprint: {
271
- type: Boolean,
272
- default: true
273
- }
274
- },
275
- data () {
276
- return {
277
- model: {}, // 公司等属性
278
- disable_button: true, // 控制按钮禁用
279
- disable_modal_button: true, // 控制按钮禁用
280
- showButModal: false,
281
- }
282
- },
283
- watch: {
284
- deep: true
285
- },
286
- computed: {
287
-
288
- },
289
- created () {
290
- // 初始化数据
291
- this.initializtion()
292
- if (this.data.readyEvent) {
293
- this.$dispatch(this.data.readyEvent)
294
- }
295
- this.$dispatch('initializtionView')
296
- },
297
- methods: {
298
- // 初始化数据
299
- initializtion () {
300
- for (const item of this.data.fields) {
301
- this.data[item.field] = item.value
302
- }
303
- // 是否禁用按钮
304
- this.disableButton()
305
- },
306
- // 是否禁用按钮
307
- disableButton () {
308
- let flag = false
309
-
310
- for (const field of this.data.fields) {
311
- if (field.required && !field.value) {
312
- if (field.value === 0) {
313
- flag = false
314
- } else {
315
- flag = true
316
- }
317
- }
318
-
319
- // 任何选择框只要是否都不能提交
320
- if (field.type === 'select' && field.value === '否' && field.value_no_disable) {
321
- flag = true
322
- }
323
-
324
- if (field.type === 'checkbox' && field.required && field.value.length === 0) {
325
- flag = true
326
- }
327
- }
328
-
329
- this.disable_button = flag
330
- },
331
- // 失去焦点且值最终发生变化触发
332
- async onchange (index) {
333
- // 是否禁用按钮
334
- this.disableButton()
335
-
336
- if (!isEmpty(this.data.fields[index].value)) {
337
- // 前缀、后缀
338
- if (this.data.fields[index].prefix) {
339
- this.data.fields[index].value = this.data.fields[index].prefix + this.data.fields[index].value
340
- }
341
- if (this.data.fields[index].suffix) {
342
- this.data.fields[index].value = this.data.fields[index].value + this.data.fields[index].suffix
343
- }
344
- }
345
-
346
- // data赋值
347
- this.data[this.data.fields[index].field] = this.data.fields[index].value
348
-
349
- if (this.data.fields[index].type === 'datepicker') {
350
- this.check_datepicker(index)
351
- }
352
-
353
- if (this.data.fields[index].onchange) {
354
- this.$dispatch(this.data.fields[index].onchange, index)
355
- }
356
- this.$dispatch('onchange', index)
357
-
358
-
359
- },
360
- // 失去焦点触发,无论值是否发生变化
361
- onblur (index) {
362
- this.disableButton()
363
-
364
- if (this.data.fields[index].onblur) {
365
- this.$dispatch(this.data.fields[index].onblur, index)
366
- }
367
-
368
- this.$dispatch('onblur', index)
369
- },
370
- oninput (index) {
371
- // 是否禁用按钮
372
- this.disableButton()
373
-
374
- if (this.data.fields[index].oninput) {
375
- this.$dispatch(this.data.fields[index].oninput, index)
376
- }
377
- this.$dispatch('oninput', index)
378
- },
379
- // 点击按钮组按钮
380
- async click_but (button) {
381
- this.disable_button = true
382
-
383
- this.data.fields.forEach(item => {
384
- this.data[item.field] = item.value
385
- })
386
-
387
- this.data.button = button
388
-
389
- if (button.button_fields && button.button_fields.length > 0) {
390
- this.showButModal = true
391
- return
392
- }
393
-
394
- if (this.data.button.event) {
395
- this.$dispatch(this.data.button.event)
396
- } else {
397
- this.$dispatch('button')
398
- }
399
- },
400
- confirmModal () {
401
- this.closeModal()
402
-
403
- this.data.button.button_fields.forEach(item => {
404
- this.data.button[item.field] = item.value
405
- })
406
-
407
- if (this.data.button.event) {
408
- this.$dispatch(this.data.button.event)
409
- } else {
410
- this.$dispatch('button')
411
- }
412
- },
413
- // 关闭模态框
414
- closeModal () {
415
- this.showButModal = false
416
- this.disable_modal_button = true
417
- },
418
- onbutchange (index) {
419
- // 是否禁用按钮
420
- this.disableModalButton()
421
-
422
- if (this.data.button.button_fields[index].onchange) {
423
- this.$dispatch(this.data.button.button_fields[index].onchange, index)
424
- } else {
425
- this.$dispatch('onbutchange', index)
426
- }
427
-
428
- },
429
- onbutblur (index) {
430
- this.disableModalButton()
431
-
432
- if (this.data.button.button_fields[index].onblur) {
433
- this.$dispatch(this.data.button.button_fields[index].onblur, index)
434
- } else {
435
- this.$dispatch('onbutblur', index)
436
- }
437
- },
438
- onbutinput (index) {
439
- // 是否禁用按钮
440
- this.disableModalButton()
441
-
442
- if (this.data.button.button_fields[index].oninput) {
443
- this.$dispatch(this.data.button.button_fields[index].oninput, index)
444
- } else {
445
- this.$dispatch('onbutinput', index)
446
- }
447
- },
448
- disableModalButton () {
449
- let flag = false
450
-
451
-
452
- for (const item of this.data.button.button_fields) {
453
- if (item.required && !item.value) {
454
- if (item.value === 0) {
455
- flag = false
456
- } else {
457
- flag = true
458
- }
459
- }
460
- }
461
-
462
- this.disable_modal_button = flag
463
- },
464
- check_datepicker (index) {
465
- // 时间格式检测
466
- if (!isEmpty(this.data.fields[index].value)) {
467
-
468
- let dateReg = /^[1-9]\d{3}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])$/
469
- let timeReg = /^(20|21|22|23|[0-1]\d):[0-5]\d:[0-5]\d$/
470
- 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$/
471
- if (this.data.fields[index].format) {
472
- if (this.data.fields[index].format === 'yyyy-MM-dd') {
473
- if (!dateReg.test(this.data.fields[index].value)) {
474
- this.data.fields[index].value = ''
475
- this.$showAlert(this.data.fields[index].label + '格式错误如:2021-01-01', 'warning', 2000)
476
- }
477
- }
478
- if (this.data.fields[index].format === 'HH:mm:ss') {
479
- if (!timeReg.test(this.data.fields[index].value)) {
480
- this.data.fields[index].value = ''
481
- this.$showAlert(this.data.fields[index].label + '格式错误如:00:00:00', 'warning', 2000)
482
- }
483
- }
484
- if (this.data.fields[index].format === 'yyyy-MM-dd HH:mm:ss') {
485
- if (!datetimeReg.test(this.data.fields[index].value)) {
486
- this.data.fields[index].value = ''
487
- this.$showAlert(this.data.fields[index].label + '格式错误如:2021-01-01 00:00:00', 'warning', 2000)
488
- }
489
- }
490
- } else {
491
- if (!dateReg.test(this.data.fields[index].value)) {
492
- this.data.fields[index].value = ''
493
- this.$showAlert(this.data.fields[index].label + '格式错误如:2021-01-01', 'warning', 2000)
494
- }
495
- }
496
- }
497
- }
498
- },
499
- events: {
500
- }
501
- }
502
- </script>
503
- <style scoped>
504
- .control-label-justify {
505
- width: 30%;
506
- text-align: justify;
507
- text-align-last: justify;
508
- font-family: PingFang-SC-Bold;
509
- float: left;
510
- }
511
- .button_spacing{margin: 0px 0px 0px 10px;}
512
- </style>
513
- <style lang="less">
514
- .apply-has-error {
515
- border-bottom: 1px solid #a94442;
516
- }
517
- .app-input {
518
- label {
519
- float: left;
520
- }
521
- .select {
522
- button {
523
- border: none;
524
- outline: none;
525
- text-align: left;
526
- .btn-placeholder {
527
- color: #ACA899
528
- }
529
- }
530
- }
531
- .datepicker {
532
- .form-control:focus {
533
- border: none!important;
534
- outline: none!important;
535
- -webkit-box-shadow: none;
536
- box-shadow: none;
537
- }
538
- }
539
- textarea {
540
- padding: 8px 10px;
541
- border: none;
542
- outline: none;
543
- margin: 0px;
544
- }
545
- input[readonly]{
546
- color: #ACA899!important;
547
- background: #FFFFFF;
548
- border: none;
549
- outline: none;
550
- }
551
- input:disabled{
552
- color: #ACA899!important;
553
- background: #FFFFFF;
554
- border: none;
555
- outline: none;
556
- }
557
- textarea[readonly]{
558
- color: #ACA899!important;
559
- background: #FFFFFF;
560
- border: none;
561
- outline: none;
562
- }
563
- textarea:disabled{
564
- color: #ACA899!important;
565
- background: #FFFFFF;
566
- border: none;
567
- outline: none;
568
- }
569
- }
570
- </style>
1
+ <template>
2
+ <div class="form-horizontal select-overspread">
3
+ <div v-for="(index,item) in data.fields">
4
+ <!--input-->
5
+ <div :style="item.style ? item.style : ''"
6
+ v-if="(item.type==='input' || item.type==='number'||item.type === 'tel'||item.type === 'email') && !item.hidden && (item.device === 'app' || !item.device)"
7
+ :class="[item.required && !(item.value) ? 'apply-has-error' : '', item.bootstraped ? item.bootstraped + ' form-group app-input':'col-xs-12 form-group app-input']">
8
+ <label class="control-label-justify">{{item.label}}</label>
9
+ <div :style="item.value_style ? item.value_style:''"
10
+ :class="item.value_bootstraped ? item.value_bootstraped : 'col-xs-8'">
11
+ <input class="" style="width: 100%"
12
+ :type="item.type"
13
+ v-model="data.fields[index].value"
14
+ :placeholder="item.placeholder"
15
+ :value="data.fields[index].value"
16
+ :readonly="item.readonly"
17
+ :disabled="item.disabled"
18
+ @change="onchange(index)"
19
+ @blur="onblur(index)"
20
+ @input="oninput(index)"
21
+ />
22
+ </div>
23
+ </div>
24
+
25
+ <!--select-->
26
+ <div :style="item.style ? item.style : ''"
27
+ v-if="item.type==='select' && !item.hidden && (item.device === 'app' || !item.device)"
28
+ :class="[item.required && !(item.value) ? 'apply-has-error' : '', item.bootstraped ? item.bootstraped + ' form-group app-input':'col-xs-12 form-group app-input']">
29
+ <label class="control-label-justify">{{item.label}}</label>
30
+ <div :style="item.value_style ? item.value_style:''"
31
+ :class="item.value_bootstraped ? item.value_bootstraped : 'col-xs-8'">
32
+ <v-select
33
+ class="select" width="100%" align="right"
34
+ :placeholder="item.placeholder"
35
+ :search="item.search"
36
+ close-on-select value-single
37
+ :options="data.fields[index].options"
38
+ v-model="data.fields[index].value"
39
+ :value.sync="data.fields[index].value"
40
+ @blur="onblur(index)"
41
+ @change="onchange(index)"
42
+ :readonly="item.readonly"
43
+ :disabled="item.disabled"
44
+ ></v-select>
45
+ </div>
46
+ </div>
47
+
48
+ <!--时间datepicker-->
49
+ <div :style="item.style ? item.style : ''"
50
+ v-if="item.type==='datepicker' && !item.hidden && (item.device === 'app' || !item.device)"
51
+ :class="[item.required && !(item.value) ? 'apply-has-error' : '', item.bootstraped ? item.bootstraped+' form-group app-input':'col-xs-12 form-group app-input']">
52
+ <label class="control-label-justify">{{item.label}}</label>
53
+ <div class="form-group" :style="item.value_style ? item.value_style:''"
54
+ :class="item.value_bootstraped ? item.value_bootstraped : 'col-xs-8'">
55
+ <datepicker
56
+ @change="onchange(index)"
57
+ @blur="onblur(index)"
58
+ :placeholder="item.placeholder"
59
+ :value.sync="data.fields[index].value"
60
+ :format="item.format ? item.format : 'yyyy-MM-dd'"
61
+ v-model="data.fields[index].value"
62
+ :readonly="item.readonly"
63
+ :disabled="item.disabled"
64
+ :show-reset-button="true">
65
+ </datepicker>
66
+ </div>
67
+ </div>
68
+
69
+ <!--textarea-->
70
+ <div :style="item.style ? item.style : ''"
71
+ v-if="item.type==='textarea' && !item.hidden && (item.device === 'app' || !item.device)"
72
+ :class="[item.required && !(item.value) ? 'apply-has-error' : '', item.bootstraped?item.bootstraped+' form-group app-input':'col-xs-12 form-group app-input']">
73
+ <label class="control-label-justify">{{item.label}}</label>
74
+ <div :style="item.value_style ? item.value_style:''"
75
+ :class="item.value_bootstraped ? item.value_bootstraped : 'col-xs-8'">
76
+ <textarea
77
+ :readonly="item.readonly"
78
+ :disabled="item.disabled"
79
+ class="" rows="1"
80
+ style="width: 100%;height: 100%"
81
+ v-model="data.fields[index].value"
82
+ :value="data.fields[index].value"
83
+ @change="onchange(index)"
84
+ @blur="onblur(index)"
85
+ @input="oninput(index)"
86
+ ></textarea>
87
+ </div>
88
+ </div>
89
+
90
+ <!--checkbox-->
91
+ <div :style="item.style ? item.style : ''"
92
+ v-if="item.type==='checkbox' && !item.hidden && (item.device === 'app' || !item.device)"
93
+ :class="[item.required && item.value.length === 0 ? 'apply-has-error' : '',item.bootstraped?item.bootstraped+' form-group app-input':'col-xs-12 form-group app-input']">
94
+ <label class="control-label-justify">{{item.label}}</label>
95
+ <div :style="item.value_style ? item.value_style:''"
96
+ :class="item.value_bootstraped ? item.value_bootstraped : 'col-xs-8'">
97
+ <label class="" v-for="(index2,row) in item.options">
98
+ <input type="checkbox" class=""
99
+ :readonly="data.fields[index].readonly"
100
+ :disabled="data.fields[index].disabled"
101
+ v-model="data.fields[index].value"
102
+ :value="data.fields[index].options[index2].value"
103
+ @change="onchange(index)"
104
+ @blur="onblur(index)">
105
+ {{row.label}}
106
+ </label>
107
+ </div>
108
+ </div>
109
+ </div>
110
+
111
+ <div class="col-sm-12 col-xs-12">
112
+ <accordion one-at-a-time="true">
113
+ <panel v-for="(i,item) in data.onetomany" :header="item.title" :is-open="false" type="primary">
114
+ <app-onetomany :onetomany="item" :index="i"></app-onetomany>
115
+ </panel>
116
+ <panel v-for="(i,item) in data.components" :header="item.title" :is-open="false" type="primary" v-if="item.device === 'app' || !item.device">
117
+ <component :is="item.name" :selectdata="data" :mark="item.mark"></component>
118
+ </panel>
119
+ </accordion>
120
+ </div>
121
+
122
+ <!--自定义组件-->
123
+ <slot></slot>
124
+
125
+ <!-- 按钮组 -->
126
+ <div class="text-center">
127
+ <button v-for="(index,button) in data.buttons"
128
+ :disabled="button.disabled && disable_button"
129
+ style="min-width:100px"
130
+ :class="button.disabled && disable_button ? 'btn btn-default button_spacing' : 'btn btn-primary button_spacing'"
131
+ v-if="!button.hidden"
132
+ @click.prevent="click_but(button)"
133
+ >
134
+ {{button.button_name}}
135
+ </button>
136
+ </div>
137
+
138
+ <!-- 按钮模态框 -->
139
+ <modal v-if="showButModal" :show.sync="showButModal" backdrop="false" large>
140
+ <header slot="modal-header" class="modal-header">
141
+ <button type="button" class="close" @click="closeModal()"><span>&times;</span></button>
142
+ <span class="modal-title"><font
143
+ size="3">{{data.button.button_name}}</font></span>
144
+ </header>
145
+ <article slot="modal-body" class="modal-body clearfix">
146
+ <div class="form-group" >
147
+ <div v-for="(index,item) in data.button.button_fields">
148
+ <div :style="item.style ? item.style : ''" :class="[item.required && !(item.value) ? 'has-error' : '', item.bootstraped ? item.bootstraped + ' form-group' : 'form-group']"
149
+ v-if="(item.type==='input' || item.type==='number'||item.type === 'tel'||item.type === 'email') && !item.hidden && (item.device === 'pc' || !item.device)">
150
+ <label :style="item.label_style ? item.label_style : ''"
151
+ :class="item.label_bootstraped ? item.label_bootstraped + ' control-label-justify control-label' : 'control-label-justify control-label'">{{item.label}}</label>
152
+ <div :style="item.value_style ? item.value_style : ''"
153
+ :class="item.value_bootstraped ? item.value_bootstraped : 'col-xs-8'">
154
+ <input class="form-control input_view"
155
+ :placeholder="item.placeholder"
156
+ :type="item.type"
157
+ v-model="item.value"
158
+ :value="item.value"
159
+ :readonly="item.readonly"
160
+ :disabled="item.disabled"
161
+ @change="onbutchange(index)"
162
+ @blur="onbutblur(index)"
163
+ @input="onbutinput(index)"
164
+ />
165
+ </div>
166
+ </div>
167
+
168
+ <!--时间datepicker-->
169
+ <div :style="item.style ? item.style : ''" :class="[item.required && !(item.value) ? 'has-error' : '', item.bootstraped ? item.bootstraped + ' form-group':'form-group']"
170
+ v-if="item.type==='datepicker' && !item.hidden && (item.device === 'pc' || !item.device)">
171
+ <label :style="item.label_style ? item.label_style : ''"
172
+ :class="item.label_bootstraped ? item.label_bootstraped + ' control-label-justify control-label' : 'control-label-justify control-label'">{{item.label}}</label>
173
+ <div :style="item.value_style ? item.value_style : ''"
174
+ :class="item.value_bootstraped ? item.value_bootstraped : 'col-xs-8'">
175
+ <datepicker
176
+ :placeholder="item.placeholder"
177
+ :value.sync="item.value"
178
+ v-model="item.value"
179
+ :readonly="item.readonly"
180
+ :disabled="item.disabled"
181
+ :format="item.format ? item.format : 'yyyy-MM-dd'"
182
+ :show-reset-button="true"
183
+ @change="onbutchange(index)"
184
+ @blur="onbutblur(index)"
185
+ ></datepicker>
186
+ </div>
187
+ </div>
188
+
189
+ <!--select-->
190
+ <div :style="item.style ? item.style : ''" :class="[item.required && !(item.value) ? 'has-error' : '', item.bootstraped ? item.bootstraped + ' form-group':'form-group']"
191
+ v-if="item.type==='select' && !item.hidden && (item.device === 'pc' || !item.device)">
192
+ <label :style="item.label_style ? item.label_style : ''"
193
+ :class="item.label_bootstraped ? item.label_bootstraped + ' control-label-justify control-label' : 'control-label-justify control-label'">{{item.label}}</label>
194
+ <div :style="item.value_style ? item.value_style : ''"
195
+ :class="item.value_bootstraped ? item.value_bootstraped : 'col-xs-8'">
196
+ <input-select
197
+ class="select select_list"
198
+ :value.sync="item.value"
199
+ v-model="item.value"
200
+ :options='item.options'
201
+ :readonly="item.readonly"
202
+ :disable="item.disabled"
203
+ :valueSingle="true"
204
+ @blur="onbutblur(index)"
205
+ @change="onbutchange(index)"
206
+ ></input-select>
207
+ </div>
208
+ </div>
209
+
210
+ <!--textarea-->
211
+ <div :style="item.style ? item.style : ''" :class="[item.required && !(item.value) ? 'has-error' : '', item.bootstraped ? item.bootstraped + ' form-group':'form-group']"
212
+ v-if="item.type==='textarea' && !item.hidden && (item.device === 'pc' || !item.device)">
213
+ <label :style="item.label_style ? item.label_style : ''"
214
+ :class="item.label_bootstraped ? item.label_bootstraped + ' control-label-justify control-label' : 'control-label-justify control-label'">{{item.label}}</label>
215
+ <div :style="item.value_style ? item.value_style : ''"
216
+ :class="item.value_bootstraped ? item.value_bootstraped : 'col-xs-8'">
217
+ <textarea
218
+ class="form-control input_view"
219
+ style="width: 100%;height: 100%"
220
+ v-model="item.value"
221
+ :value="item.value"
222
+ :rows="item.rows"
223
+ :readonly="item.readonly"
224
+ :disabled="item.disabled"
225
+ @change="onbutchange(index)"
226
+ @blur="onbutblur(index)"
227
+ @input="onbutinput(index)"
228
+ ></textarea>
229
+ </div>
230
+ </div>
231
+ </div>
232
+ </div>
233
+ </article>
234
+ <footer slot="modal-footer" class="modal-footer">
235
+ <button :class="disable_modal_button ? 'btn btn-default':'btn btn-primary'"
236
+ :disabled="disable_modal_button" type="button" @click="confirmModal()">
237
+ 确认
238
+ </button>
239
+ </footer>
240
+ </modal>
241
+ </div>
242
+ </template>
243
+ <script>
244
+ import Vue from 'vue'
245
+ import {isEmpty} from "../Util";
246
+ // Date格式化
247
+ Date.prototype.Format = function (fmt) {
248
+ var o = {
249
+ 'M+': this.getMonth() + 1, // 月份
250
+ 'd+': this.getDate(), // 日
251
+ 'H+': this.getHours(), // 小时
252
+ 'm+': this.getMinutes(), // 分
253
+ 's+': this.getSeconds(), // 秒
254
+ 'q+': Math.floor((this.getMonth() + 3) / 3), // 季度
255
+ 'S': this.getMilliseconds() // 毫秒
256
+ }
257
+ if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (this.getFullYear() + '').substr(4 - RegExp.$1.length))
258
+ for (var k in o) {
259
+ if (new RegExp('(' + k + ')').test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length === 1) ? (o[k]) : (('00' + o[k]).substr(('' + o[k]).length)))
260
+ }
261
+ return fmt
262
+ }
263
+
264
+ export default {
265
+ title: '报建业务通用组件',
266
+ props: {
267
+ data: {
268
+ type: Object
269
+ },
270
+ showprint: {
271
+ type: Boolean,
272
+ default: true
273
+ }
274
+ },
275
+ data () {
276
+ return {
277
+ model: {}, // 公司等属性
278
+ disable_button: true, // 控制按钮禁用
279
+ disable_modal_button: true, // 控制按钮禁用
280
+ showButModal: false
281
+ }
282
+ },
283
+ watch: {
284
+ deep: true
285
+ },
286
+ computed: {
287
+
288
+ },
289
+ created () {
290
+ // 初始化数据
291
+ this.initializtion()
292
+ if (this.data.readyEvent) {
293
+ this.$dispatch(this.data.readyEvent)
294
+ }
295
+ this.$dispatch('initializtionView')
296
+ },
297
+ methods: {
298
+ // 初始化数据
299
+ initializtion () {
300
+ for (const item of this.data.fields) {
301
+ this.data[item.field] = item.value
302
+ }
303
+ // 是否禁用按钮
304
+ this.disableButton()
305
+ },
306
+ // 是否禁用按钮
307
+ disableButton () {
308
+ let flag = false
309
+
310
+ for (const field of this.data.fields) {
311
+ if (field.required && !field.value && !field.hidden && field.value !== 0) {
312
+ flag = true
313
+ }
314
+
315
+ // 任何选择框只要是否都不能提交
316
+ if (field.type === 'select' && field.value === '否' && field.value_no_disable) {
317
+ flag = true
318
+ }
319
+
320
+ if (field.type === 'checkbox' && field.required && field.value.length === 0) {
321
+ flag = true
322
+ }
323
+ }
324
+
325
+ this.disable_button = flag
326
+ },
327
+ // 失去焦点且值最终发生变化触发
328
+ async onchange (index) {
329
+ // 是否禁用按钮
330
+ this.disableButton()
331
+
332
+ if (!isEmpty(this.data.fields[index].value)) {
333
+ // 前缀、后缀
334
+ if (this.data.fields[index].prefix) {
335
+ this.data.fields[index].value = this.data.fields[index].prefix + this.data.fields[index].value
336
+ }
337
+ if (this.data.fields[index].suffix) {
338
+ this.data.fields[index].value = this.data.fields[index].value + this.data.fields[index].suffix
339
+ }
340
+ }
341
+
342
+ // data赋值
343
+ this.data[this.data.fields[index].field] = this.data.fields[index].value
344
+
345
+ if (this.data.fields[index].type === 'datepicker') {
346
+ this.check_datepicker(index)
347
+ }
348
+
349
+ if (this.data.fields[index].onchange) {
350
+ this.$dispatch(this.data.fields[index].onchange, index)
351
+ }
352
+ this.$dispatch('onchange', index)
353
+
354
+
355
+ },
356
+ // 失去焦点触发,无论值是否发生变化
357
+ onblur (index) {
358
+ this.disableButton()
359
+
360
+ if (this.data.fields[index].onblur) {
361
+ this.$dispatch(this.data.fields[index].onblur, index)
362
+ }
363
+
364
+ this.$dispatch('onblur', index)
365
+ },
366
+ oninput (index) {
367
+ // 是否禁用按钮
368
+ this.disableButton()
369
+
370
+ if (this.data.fields[index].oninput) {
371
+ this.$dispatch(this.data.fields[index].oninput, index)
372
+ }
373
+ this.$dispatch('oninput', index)
374
+ },
375
+ // 点击按钮组按钮
376
+ async click_but (button) {
377
+ this.disable_button = true
378
+
379
+ this.data.fields.forEach(item => {
380
+ this.data[item.field] = item.value
381
+ })
382
+
383
+ this.data.button = button
384
+
385
+ if (button.button_fields && button.button_fields.length > 0) {
386
+ this.showButModal = true
387
+ return
388
+ }
389
+
390
+ if (this.data.button.event) {
391
+ this.$dispatch(this.data.button.event)
392
+ } else {
393
+ this.$dispatch('button')
394
+ }
395
+ },
396
+ confirmModal () {
397
+ this.closeModal()
398
+
399
+ this.data.button.button_fields.forEach(item => {
400
+ this.data.button[item.field] = item.value
401
+ })
402
+
403
+ if (this.data.button.event) {
404
+ this.$dispatch(this.data.button.event)
405
+ } else {
406
+ this.$dispatch('button')
407
+ }
408
+ },
409
+ // 关闭模态框
410
+ closeModal () {
411
+ this.showButModal = false
412
+ this.disable_modal_button = true
413
+ },
414
+ onbutchange (index) {
415
+ // 是否禁用按钮
416
+ this.disableModalButton()
417
+
418
+ if (this.data.button.button_fields[index].onchange) {
419
+ this.$dispatch(this.data.button.button_fields[index].onchange, index)
420
+ } else {
421
+ this.$dispatch('onbutchange', index)
422
+ }
423
+
424
+ },
425
+ onbutblur (index) {
426
+ this.disableModalButton()
427
+
428
+ if (this.data.button.button_fields[index].onblur) {
429
+ this.$dispatch(this.data.button.button_fields[index].onblur, index)
430
+ } else {
431
+ this.$dispatch('onbutblur', index)
432
+ }
433
+ },
434
+ onbutinput (index) {
435
+ // 是否禁用按钮
436
+ this.disableModalButton()
437
+
438
+ if (this.data.button.button_fields[index].oninput) {
439
+ this.$dispatch(this.data.button.button_fields[index].oninput, index)
440
+ } else {
441
+ this.$dispatch('onbutinput', index)
442
+ }
443
+ },
444
+ disableModalButton () {
445
+ let flag = false
446
+
447
+
448
+ for (const item of this.data.button.button_fields) {
449
+ if (item.required && !item.value) {
450
+ if (item.value === 0) {
451
+ flag = false
452
+ } else {
453
+ flag = true
454
+ }
455
+ }
456
+ }
457
+
458
+ this.disable_modal_button = flag
459
+ },
460
+ check_datepicker (index) {
461
+ // 时间格式检测
462
+ if (!isEmpty(this.data.fields[index].value)) {
463
+
464
+ let dateReg = /^[1-9]\d{3}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])$/
465
+ let timeReg = /^(20|21|22|23|[0-1]\d):[0-5]\d:[0-5]\d$/
466
+ 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$/
467
+ if (this.data.fields[index].format) {
468
+ if (this.data.fields[index].format === 'yyyy-MM-dd') {
469
+ if (!dateReg.test(this.data.fields[index].value)) {
470
+ this.data.fields[index].value = ''
471
+ this.$showAlert(this.data.fields[index].label + '格式错误如:2021-01-01', 'warning', 2000)
472
+ }
473
+ }
474
+ if (this.data.fields[index].format === 'HH:mm:ss') {
475
+ if (!timeReg.test(this.data.fields[index].value)) {
476
+ this.data.fields[index].value = ''
477
+ this.$showAlert(this.data.fields[index].label + '格式错误如:00:00:00', 'warning', 2000)
478
+ }
479
+ }
480
+ if (this.data.fields[index].format === 'yyyy-MM-dd HH:mm:ss') {
481
+ if (!datetimeReg.test(this.data.fields[index].value)) {
482
+ this.data.fields[index].value = ''
483
+ this.$showAlert(this.data.fields[index].label + '格式错误如:2021-01-01 00:00:00', 'warning', 2000)
484
+ }
485
+ }
486
+ } else {
487
+ if (!dateReg.test(this.data.fields[index].value)) {
488
+ this.data.fields[index].value = ''
489
+ this.$showAlert(this.data.fields[index].label + '格式错误如:2021-01-01', 'warning', 2000)
490
+ }
491
+ }
492
+ }
493
+ }
494
+ },
495
+ events: {
496
+ }
497
+ }
498
+ </script>
499
+ <style scoped>
500
+ .control-label-justify {
501
+ width: 30%;
502
+ text-align: justify;
503
+ text-align-last: justify;
504
+ font-family: PingFang-SC-Bold;
505
+ float: left;
506
+ }
507
+ .button_spacing{margin: 0px 0px 0px 10px;}
508
+ </style>
509
+ <style lang="less">
510
+ .apply-has-error {
511
+ border-bottom: 1px solid #a94442;
512
+ }
513
+ .app-input {
514
+ label {
515
+ float: left;
516
+ }
517
+ .select {
518
+ button {
519
+ border: none;
520
+ outline: none;
521
+ text-align: left;
522
+ .btn-placeholder {
523
+ color: #ACA899
524
+ }
525
+ }
526
+ }
527
+ .datepicker {
528
+ .form-control:focus {
529
+ border: none!important;
530
+ outline: none!important;
531
+ -webkit-box-shadow: none;
532
+ box-shadow: none;
533
+ }
534
+ }
535
+ textarea {
536
+ padding: 8px 10px;
537
+ border: none;
538
+ outline: none;
539
+ margin: 0px;
540
+ }
541
+ input[readonly]{
542
+ color: #ACA899!important;
543
+ background: #FFFFFF;
544
+ border: none;
545
+ outline: none;
546
+ }
547
+ input:disabled{
548
+ color: #ACA899!important;
549
+ background: #FFFFFF;
550
+ border: none;
551
+ outline: none;
552
+ }
553
+ textarea[readonly]{
554
+ color: #ACA899!important;
555
+ background: #FFFFFF;
556
+ border: none;
557
+ outline: none;
558
+ }
559
+ textarea:disabled{
560
+ color: #ACA899!important;
561
+ background: #FFFFFF;
562
+ border: none;
563
+ outline: none;
564
+ }
565
+ }
566
+ </style>