apply-clients 3.4.3 → 3.4.4

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 (79) hide show
  1. package/package.json +1 -1
  2. package/src/AndroidApp.vue +18 -18
  3. package/src/android.js +1 -1
  4. package/src/apply.js +39 -20
  5. package/src/applyAndroid.js +23 -9
  6. package/src/components/android/AppOnetomany.vue +47 -5
  7. package/src/components/android/AppServiceView.vue +745 -566
  8. package/src/components/android/AppSign.vue +154 -142
  9. package/src/components/android/AppTakePic.vue +11 -11
  10. package/src/components/android/AreaSelect/AppQrcodeReader.vue +73 -0
  11. package/src/components/android/AreaSelect/AppResAreaMapGroup.vue +148 -0
  12. package/src/components/android/AreaSelect/AppResAreaSelect.vue +108 -0
  13. package/src/components/android/AreaSelect/AppResAreaSelectGroup.vue +142 -0
  14. package/src/components/android/Function/AppFunctionServiceControl.vue +344 -0
  15. package/src/components/android/Function/AppInstallFunction.vue +366 -0
  16. package/src/components/android/Process/AppExplorationUser.vue +217 -37
  17. package/src/components/android/Process/AppServiceControl.vue +1708 -757
  18. package/src/components/android/Process/Processes/AppAddMaterialScience.vue +477 -0
  19. package/src/components/android/Process/Processes/AppBuildSign.vue +46 -0
  20. package/src/components/android/Process/Processes/AppChargeManagement.vue +637 -0
  21. package/src/components/android/Process/Processes/AppDevicesManagement.vue +519 -0
  22. package/src/components/android/Process/Processes/AppInstallationDetails.vue +482 -456
  23. package/src/components/android/Process/Processes/AppSupplementalAgreement.vue +298 -0
  24. package/src/components/android/Process/Processes/selectApply.vue +250 -0
  25. package/src/components/android/Process/Processes/selectUserinfo.vue +182 -0
  26. package/src/components/android/Supervisory/AppProcessSupervisory.vue +205 -71
  27. package/src/components/android/Supervisory/AppSupervisoryCart.vue +156 -121
  28. package/src/components/common/TabButton.vue +149 -0
  29. package/src/components/common/Tabs.vue +67 -0
  30. package/src/components/image/dwg.jpg +0 -0
  31. package/src/components/image/txt.jpg +0 -0
  32. package/src/components/image//345/221/250/345/217/243/346/224/266/346/254/276/344/270/223/347/224/250/347/253/240.png +0 -0
  33. package/src/components/image//350/245/277/345/215/216/346/224/266/346/254/276/344/270/223/347/224/250/347/253/240.png +0 -0
  34. package/src/components/image//351/203/270/345/237/216/346/224/266/346/254/276/344/270/223/347/224/250/347/253/240.png +0 -0
  35. package/src/components/image//351/241/271/345/237/216/346/224/266/346/254/276/344/270/223/347/224/250/347/253/240.png +0 -0
  36. package/src/components/image//351/271/277/351/202/221/346/224/266/346/254/276/344/270/223/347/224/250/347/253/240.png +0 -0
  37. package/src/components/product/ApplyCharge/ApplyChargeList.vue +272 -53
  38. package/src/components/product/ApplyCharge/ApplyChargeSearch.vue +3 -3
  39. package/src/components/product/AreaSelect/MyAreaSelect.vue +423 -0
  40. package/src/components/product/AreaSelect/ResAreaSelect.vue +106 -0
  41. package/src/components/product/AreaSelect/ResAreaSelectGroup.vue +150 -0
  42. package/src/components/product/AreaSelect/utils/EventListener.js +29 -0
  43. package/src/components/product/AreaSelect/utils/coerceBoolean.js +7 -0
  44. package/src/components/product/Function/InstallFunction.vue +3 -2
  45. package/src/components/product/Function/InstallInfoSelect.vue +41 -21
  46. package/src/components/product/Function/Service/FunctionServiceControl.vue +96 -71
  47. package/src/components/product/GaoDeMapComponents/GaoDeMap.vue +231 -0
  48. package/src/components/product/Install/InstallProject.vue +194 -0
  49. package/src/components/product/OldApply/Handle/HandleApply.vue +337 -0
  50. package/src/components/product/OldApply/Monitor/MonitorApply.vue +360 -0
  51. package/src/components/product/OldApply/OldApply.vue +209 -0
  52. package/src/components/product/OldApply/OldApplyMessage.vue +420 -0
  53. package/src/components/product/Onetomany.vue +40 -11
  54. package/src/components/product/Process/ExplorationSelect.vue +495 -417
  55. package/src/components/product/Process/ExplorationUser.vue +145 -94
  56. package/src/components/product/Process/Processes/InstallationDetails.vue +610 -592
  57. package/src/components/product/Process/Processes/Print/printCharge.vue +166 -142
  58. package/src/components/product/Process/Processes/Print/printChargepc.vue +142 -0
  59. package/src/components/product/Process/Processes/Print/printRefund.vue +196 -0
  60. package/src/components/product/Process/Processes/addMaterialScience.vue +454 -0
  61. package/src/components/product/Process/Processes/addressAndUserinfoManagement.vue +4 -0
  62. package/src/components/product/Process/Processes/chargeManagement.vue +656 -638
  63. package/src/components/product/Process/Processes/devicesManagement.vue +484 -478
  64. package/src/components/product/Process/Processes/selectApply.vue +2 -2
  65. package/src/components/product/Process/Service/ServiceControl.vue +628 -10
  66. package/src/components/product/Process/ShowBackReason.vue +33 -0
  67. package/src/components/product/ServiceView.vue +981 -631
  68. package/src/components/product/Stop/StopApply.vue +26 -30
  69. package/src/components/product/Stop/StopApplyList.vue +27 -25
  70. package/src/components/product/Supervisory/Service/SupervisoryServiceControl.vue +732 -34
  71. package/src/components/product/Supervisory/SupervisoryControl.vue +38 -1
  72. package/src/components/product/Supervisory/SupervisoryList.vue +404 -233
  73. package/src/components/product/Supervisory/SupervisoryhCart.vue +51 -28
  74. package/src/components/product/VueUtils/ApplyUpload.vue +40 -38
  75. package/src/components/product/VueUtils/GaoPaiYi/HighMeter.vue +1090 -0
  76. package/src/components/product/VueUtils/ToolsPage.vue +51 -0
  77. package/src/components/product/VueUtils/Tree.vue +330 -0
  78. package/src/expandcssAndroid.less +362 -879
  79. package/src/main.js +3 -0
@@ -1,566 +1,745 @@
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>
1
+ <template>
2
+ <div class="form-horizontal select-overspread">
3
+ <validator name='v' @valid="$emit('valid')" @invalid="$emit('invalid')">
4
+ <!--<form>-->
5
+ <div v-for="(index,item) in data.fields">
6
+ <!--input-->
7
+ <div :style="item.style ? item.style : ''"
8
+ v-if="(item.type==='input' || item.type==='number'||item.type === 'tel'||item.type === 'email') && !item.hidden && (item.device === 'app' || !item.device) && (item.label != '证件号码')&&(item.label != '身份证') && (item.label != '用户电话')"
9
+ :class="[item.required && !(item.value) ? 'apply-has-error' : '', item.bootstraped ? item.bootstraped + ' form-group app-input':'col-xs-12 form-group app-input']">
10
+ <label class="control-label-justify">{{item.label}}</label>
11
+ <div :style="item.value_style ? item.value_style:''"
12
+ :class="item.value_bootstraped ? item.value_bootstraped : 'col-xs-8'">
13
+ <input class="" style="width: 100%"
14
+ :type="item.type"
15
+ v-model="data.fields[index].value"
16
+ :placeholder="item.placeholder"
17
+ :value="data.fields[index].value"
18
+ :readonly="item.readonly"
19
+ :disabled="item.disabled"
20
+ @change="onchange(index)"
21
+ @blur="onblur(index)"
22
+ @input="oninput(index)"
23
+ />
24
+ </div>
25
+ </div>
26
+
27
+ <div :style="item.style ? item.style : ''"
28
+ v-if="(data.fields[index-1].value ==='营业执照'||data.fields[index-1].value ==='军官证')&& (item.label === '证件号码')"
29
+ :class="[item.required && !(item.value) ? 'apply-has-error' : '', item.bootstraped ? item.bootstraped + ' form-group app-input':'col-xs-12 form-group app-input']">
30
+ <label class="control-label-justify">{{item.label}}</label>
31
+ <div :style="item.value_style ? item.value_style:''"
32
+ :class="item.value_bootstraped ? item.value_bootstraped : 'col-xs-8'">
33
+ <input class="" style="width: 100%"
34
+ :type="item.type"
35
+ v-model="data.fields[index].value"
36
+ :placeholder="item.placeholder"
37
+ :value="data.fields[index].value"
38
+ :readonly="item.readonly"
39
+ :disabled="item.disabled"
40
+ @change="onchange(index)"
41
+ @blur="onblur(index)"
42
+ @input="oninput(index)"
43
+ />
44
+ </div>
45
+ </div>
46
+
47
+
48
+ <!--input身份证验证-->
49
+ <div :style="item.style ? item.style : ''"
50
+ v-if="(item.label==='身份证') || (item.label === '证件号码' && data.fields[index-1].value ==='身份证')"
51
+ :class="[$v.f_idnumber2.identityCardValid ? '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 :style="item.value_style ? item.value_style:''"
54
+ :class="item.value_bootstraped ? item.value_bootstraped : 'col-xs-8'">
55
+ <input class="" style="width: 100%"
56
+ :type="item.type"
57
+ maxlength="18"
58
+ v-model="data.fields[index].value"
59
+ :placeholder="item.placeholder"
60
+ :value="data.fields[index].value"
61
+ :readonly="item.readonly"
62
+ v-validate:f_idnumber2='{identityCardValid: true}'
63
+ @change="onchange(index)"
64
+ @blur="onblur(index)"
65
+ @input="oninput(index)"
66
+ />
67
+ </div>
68
+ </div>
69
+
70
+
71
+ <!--input手机号验证-->
72
+ <div :style="item.style ? item.style : ''"
73
+ v-if="item.label === '用户电话'"
74
+ :class="[$v.f_user_phone.minlength || $v.f_user_phone.maxlength ? 'apply-has-error' : '',item.bootstraped ? item.bootstraped + ' form-group app-input':'col-xs-12 form-group app-input']">
75
+ <label class="control-label-justify">{{item.label}}</label>
76
+ <div :style="item.value_style ? item.value_style:''"
77
+ :class="item.value_bootstraped ? item.value_bootstraped : 'col-xs-8'">
78
+ <input class="" style="width: 100%"
79
+ maxlength="18"
80
+ type="number"
81
+ onKeypress="return(/[\d\.]/.test(String.fromCharCode(event.keyCode)))"
82
+ oninput="if(value.length > 11) value=value.slice(0,11)"
83
+ v-validate:f_user_phone="{minlength: 7, maxlength: 11 }"
84
+ v-model="data.fields[index].value"
85
+ :placeholder="item.placeholder"
86
+ :value="data.fields[index].value"
87
+ :readonly="item.readonly"
88
+ @change="onchange(index)"
89
+ @blur="onblur(index)"
90
+ @input="oninput(index)"
91
+ />
92
+ </div>
93
+ </div>
94
+
95
+ <!--select-->
96
+ <div :style="item.style ? item.style : ''"
97
+ v-if="item.type==='select' && !item.hidden && (item.device === 'app' || !item.device)"
98
+ :class="[item.required && !(item.value) ? 'apply-has-error' : '', item.bootstraped ? item.bootstraped + ' form-group app-input':'col-xs-12 form-group app-input']">
99
+ <label class="control-label-justify">{{item.label}}</label>
100
+ <div :style="item.value_style ? item.value_style:''"
101
+ :class="item.value_bootstraped ? item.value_bootstraped : 'col-xs-8'">
102
+ <v-select
103
+ class="select" width="100%" align="right"
104
+ :placeholder="item.placeholder"
105
+ :search="item.search"
106
+ close-on-select value-single
107
+ @select-search="selectSearch($arguments,index)"
108
+ :options="data.fields[index].options"
109
+ v-model="data.fields[index].value"
110
+ :value.sync="data.fields[index].value"
111
+ @blur="onblur(index)"
112
+ @change="onchange(index)"
113
+ :readonly="item.readonly"
114
+ :disabled="item.disabled"
115
+ ></v-select>
116
+ </div>
117
+ </div>
118
+
119
+ <!--时间datepicker-->
120
+ <div :style="item.style ? item.style : ''"
121
+ v-if="item.type==='datepicker' && !item.hidden && (item.device === 'app' || !item.device)"
122
+ :class="[item.required && !(item.value) ? 'apply-has-error' : '', item.bootstraped ? item.bootstraped+' form-group app-input':'col-xs-12 form-group app-input']">
123
+ <label class="control-label-justify">{{item.label}}</label>
124
+ <div class="form-group" :style="item.value_style ? item.value_style:''"
125
+ :class="item.value_bootstraped ? item.value_bootstraped : 'col-xs-8'">
126
+ <datepicker
127
+ @change="onchange(index)"
128
+ @blur="onblur(index)"
129
+ :placeholder="item.placeholder"
130
+ :value.sync="data.fields[index].value"
131
+ :format="item.format ? item.format : 'yyyy-MM-dd'"
132
+ v-model="data.fields[index].value"
133
+ :readonly="item.readonly"
134
+ :disabled="item.disabled"
135
+ :show-reset-button="true">
136
+ </datepicker>
137
+ </div>
138
+ </div>
139
+
140
+ <!--textarea-->
141
+ <div :style="item.style ? item.style : ''"
142
+ v-if="item.type==='textarea' && !item.hidden && (item.device === 'app' || !item.device)"
143
+ :class="[item.required && !(item.value) ? 'apply-has-error' : '', item.bootstraped?item.bootstraped+' form-group app-input':'col-xs-12 form-group app-input']">
144
+ <label class="control-label-justify">{{item.label}}</label>
145
+ <div :style="item.value_style ? item.value_style:''"
146
+ :class="item.value_bootstraped ? item.value_bootstraped : 'col-xs-8'">
147
+ <textarea
148
+ :readonly="item.readonly"
149
+ :disabled="item.disabled"
150
+ class="" rows="1"
151
+ style="width: 100%;height: 100%"
152
+ v-model="data.fields[index].value"
153
+ :value="data.fields[index].value"
154
+ @change="onchange(index)"
155
+ @blur="onblur(index)"
156
+ @input="oninput(index)"
157
+ ></textarea>
158
+ </div>
159
+ </div>
160
+
161
+ <!--checkbox-->
162
+ <div :style="item.style ? item.style : ''"
163
+ v-if="item.type==='checkbox' && !item.hidden && (item.device === 'app' || !item.device)"
164
+ :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']">
165
+ <label class="control-label-justify">{{item.label}}</label>
166
+ <div :style="item.value_style ? item.value_style:''"
167
+ :class="item.value_bootstraped ? item.value_bootstraped : 'col-xs-8'">
168
+ <label class="" v-for="(index2,row) in item.options">
169
+ <input type="checkbox" class=""
170
+ :readonly="data.fields[index].readonly"
171
+ :disabled="data.fields[index].disabled"
172
+ v-model="data.fields[index].value"
173
+ :value="data.fields[index].options[index2].value"
174
+ @change="onchange(index)"
175
+ @blur="onblur(index)">
176
+ {{row.label}}
177
+ </label>
178
+ </div>
179
+ </div>
180
+ </div>
181
+ <div class="col-sm-12 col-xs-12" id="test11">
182
+ <accordion one-at-a-time="true">
183
+ <panel v-for="(i,item) in data.onetomany" :header="item.title" :is-open="false" type="primary">
184
+ <app-onetomany :onetomany="item" :index="i" :selectdata="data"></app-onetomany>
185
+ </panel>
186
+ <panel v-for="(i,item) in data.components" :header="item.title" :is-open="true" type="primary" v-if="item.device === 'app' || !item.device">
187
+ <component :is="item.name" :selectdata="data" :mark="item.mark"></component>
188
+ </panel>
189
+ </accordion>
190
+ </div>
191
+
192
+ <!--自定义组件-->
193
+ <slot>
194
+
195
+ </slot>
196
+
197
+ <!-- 按钮组 -->
198
+ <div class="text-center">
199
+ <button v-for="(index,button) in data.buttons"
200
+ :disabled="button.disabled && disable_button"
201
+ style="min-width:100px"
202
+ :class="button.disabled && disable_button ? 'btn btn-default button_spacing' : 'btn btn-primary button_spacing'"
203
+ v-if="!button.hidden && button.button_name !=='提交'&& button.button_name !=='确认'"
204
+ @click.prevent="click_but(button)"
205
+ >
206
+ {{button.button_name}}
207
+ </button>
208
+ <button v-for="(index,button) in data.buttons"
209
+ :disabled="(button.disabled && disable_button) || (!$v.valid)"
210
+ style="min-width:100px"
211
+ :class="button.disabled && disable_button || (!$v.valid) ? 'btn btn-default button_spacing' : 'btn btn-primary button_spacing'"
212
+ v-if="!button.hidden && (button.button_name ==='提交'||button.button_name ==='确认')"
213
+ @click.prevent="click_but(button)"
214
+ >
215
+ {{button.button_name}}
216
+ </button>
217
+ </div>
218
+
219
+ <!-- 按钮模态框 -->
220
+ <modal v-if="showButModal" :show.sync="showButModal" backdrop="false" large>
221
+ <header slot="modal-header" class="modal-header">
222
+ <button type="button" class="close" @click="closeModal()"><span>&times;</span></button>
223
+ <span class="modal-title"><font
224
+ size="3">{{data.button.button_name}}</font></span>
225
+ </header>
226
+ <article slot="modal-body" class="modal-body clearfix">
227
+ <div class="form-group" >
228
+ <div v-for="(index,item) in data.button.button_fields">
229
+ <div :style="item.style ? item.style : ''" :class="[item.required && !(item.value) ? 'has-error' : '', item.bootstraped ? item.bootstraped + ' form-group' : 'form-group']"
230
+ v-if="(item.type==='input' || item.type==='number'||item.type === 'tel'||item.type === 'email') && !item.hidden && (item.device === 'pc' || !item.device)">
231
+ <label :style="item.label_style ? item.label_style : ''"
232
+ :class="item.label_bootstraped ? item.label_bootstraped + ' control-label-justify control-label' : 'control-label-justify control-label'">{{item.label}}</label>
233
+ <div :style="item.value_style ? item.value_style : ''"
234
+ :class="item.value_bootstraped ? item.value_bootstraped : 'col-xs-8'">
235
+ <input class="form-control input_view"
236
+ :placeholder="item.placeholder"
237
+ :type="item.type"
238
+ v-model="item.value"
239
+ :value="item.value"
240
+ :readonly="item.readonly"
241
+ :disabled="item.disabled"
242
+ @change="onbutchange(index)"
243
+ @blur="onbutblur(index)"
244
+ @input="onbutinput(index)"
245
+ />
246
+ </div>
247
+ </div>
248
+
249
+ <!--时间datepicker-->
250
+ <div :style="item.style ? item.style : ''" :class="[item.required && !(item.value) ? 'has-error' : '', item.bootstraped ? item.bootstraped + ' form-group':'form-group']"
251
+ v-if="item.type==='datepicker' && !item.hidden && (item.device === 'pc' || !item.device)">
252
+ <label :style="item.label_style ? item.label_style : ''"
253
+ :class="item.label_bootstraped ? item.label_bootstraped + ' control-label-justify control-label' : 'control-label-justify control-label'">{{item.label}}</label>
254
+ <div :style="item.value_style ? item.value_style : ''"
255
+ :class="item.value_bootstraped ? item.value_bootstraped : 'col-xs-8'">
256
+ <datepicker
257
+ :placeholder="item.placeholder"
258
+ :value.sync="item.value"
259
+ v-model="item.value"
260
+ :readonly="item.readonly"
261
+ :disabled="item.disabled"
262
+ :format="item.format ? item.format : 'yyyy-MM-dd'"
263
+ :show-reset-button="true"
264
+ @change="onbutchange(index)"
265
+ @blur="onbutblur(index)"
266
+ ></datepicker>
267
+ </div>
268
+ </div>
269
+
270
+ <!--select-->
271
+ <div :style="item.style ? item.style : ''" :class="[item.required && !(item.value) ? 'has-error' : '', item.bootstraped ? item.bootstraped + ' form-group':'form-group']"
272
+ v-if="item.type==='select' && !item.hidden && (item.device === 'pc' || !item.device)">
273
+ <label :style="item.label_style ? item.label_style : ''"
274
+ :class="item.label_bootstraped ? item.label_bootstraped + ' control-label-justify control-label' : 'control-label-justify control-label'">{{item.label}}</label>
275
+ <div :style="item.value_style ? item.value_style : ''"
276
+ :class="item.value_bootstraped ? item.value_bootstraped : 'col-xs-8'">
277
+ <input-select
278
+ class="select select_list"
279
+ :value.sync="item.value"
280
+ v-model="item.value"
281
+ :options='item.options'
282
+ :readonly="item.readonly"
283
+ :disable="item.disabled"
284
+ :valueSingle="true"
285
+ @blur="onbutblur(index)"
286
+ @change="onbutchange(index)"
287
+ ></input-select>
288
+ </div>
289
+ </div>
290
+
291
+ <!--textarea-->
292
+ <div :style="item.style ? item.style : ''" :class="[item.required && !(item.value) ? 'has-error' : '', item.bootstraped ? item.bootstraped + ' form-group':'form-group']"
293
+ v-if="item.type==='textarea' && !item.hidden && (item.device === 'pc' || !item.device)">
294
+ <label :style="item.label_style ? item.label_style : ''"
295
+ :class="item.label_bootstraped ? item.label_bootstraped + ' control-label-justify control-label' : 'control-label-justify control-label'">{{item.label}}</label>
296
+ <div :style="item.value_style ? item.value_style : ''"
297
+ :class="item.value_bootstraped ? item.value_bootstraped : 'col-xs-8'">
298
+ <textarea
299
+ class="form-control input_view"
300
+ style="width: 100%;height: 100%"
301
+ v-model="item.value"
302
+ :value="item.value"
303
+ :rows="item.rows"
304
+ :readonly="item.readonly"
305
+ :disabled="item.disabled"
306
+ @change="onbutchange(index)"
307
+ @blur="onbutblur(index)"
308
+ @input="onbutinput(index)"
309
+ ></textarea>
310
+ </div>
311
+ </div>
312
+ </div>
313
+ </div>
314
+ </article>
315
+ <footer slot="modal-footer" class="modal-footer">
316
+ <button :class="disable_modal_button ? 'btn btn-default':'btn btn-primary'"
317
+ :disabled="disable_modal_button" type="button" @click="confirmModal()">
318
+ 确认
319
+ </button>
320
+ </footer>
321
+ </modal>
322
+ <!--</form>-->
323
+ </div>
324
+ </template>
325
+ <script>
326
+ import Vue from 'vue'
327
+ import {isEmpty} from "../Util";
328
+ // Date格式化
329
+ Date.prototype.Format = function (fmt) {
330
+ var o = {
331
+ 'M+': this.getMonth() + 1, // 月份
332
+ 'd+': this.getDate(), // 日
333
+ 'H+': this.getHours(), // 小时
334
+ 'm+': this.getMinutes(), // 分
335
+ 's+': this.getSeconds(), //
336
+ 'q+': Math.floor((this.getMonth() + 3) / 3), // 季度
337
+ 'S': this.getMilliseconds() // 毫秒
338
+ }
339
+ if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (this.getFullYear() + '').substr(4 - RegExp.$1.length))
340
+ for (var k in o) {
341
+ if (new RegExp('(' + k + ')').test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length === 1) ? (o[k]) : (('00' + o[k]).substr(('' + o[k]).length)))
342
+ }
343
+ return fmt
344
+ }
345
+
346
+ export default {
347
+ title: '报建业务通用组件',
348
+ props: {
349
+ data: {
350
+ type: Object
351
+ },
352
+ showprint: {
353
+ type: Boolean,
354
+ default: true
355
+ }
356
+ },
357
+ data () {
358
+ return {
359
+ model: {}, // 公司等属性
360
+ disable_button: true, // 控制按钮禁用
361
+ disable_modal_button: true, // 控制按钮禁用
362
+ showButModal: false,
363
+ areaData:{
364
+ sjvalue:'',
365
+ xianvalue:'',
366
+ sqvalue:'',
367
+ mapvalue:'',
368
+ }
369
+ }
370
+ },
371
+ watch: {
372
+ deep: true
373
+ },
374
+ computed: {
375
+
376
+ },
377
+ created () {
378
+ // 初始化数据
379
+ this.initializtion()
380
+ if (this.data.readyEvent) {
381
+ this.$dispatch(this.data.readyEvent)
382
+ }
383
+ this.$dispatch('initializtionView')
384
+ },
385
+ methods: {
386
+ // 初始化数据
387
+ initializtion () {
388
+ for (const item of this.data.fields) {
389
+ this.data[item.field] = item.value
390
+ }
391
+ // 是否禁用按钮
392
+ this.disableButton()
393
+ },
394
+ async getSelectShijiValue(sjvalue,sjlable) {
395
+
396
+ this.areaData.sjvalue = sjvalue
397
+ console.log("这是父级接收的市级值:",sjvalue,sjlable)
398
+ this.data.areaData = this.areaData
399
+ console.log(this.areaData)
400
+ // 是否禁用按钮
401
+ this.disableButton()
402
+ },
403
+ async getSelectXianValue(xianvalue,xianlable) {
404
+
405
+ this.areaData.xianvalue = xianvalue
406
+ this.data.areaData = this.areaData
407
+ console.log("这是父级接收的县级值:",xianvalue,xianlable)
408
+ console.log(this.areaData)
409
+
410
+ // 是否禁用按钮
411
+ this.disableButton()
412
+ },
413
+ async getSelectShequValue(sqvalue,sqlable) {
414
+ this.areaData.sqvalue = sqvalue
415
+ this.data.areaData = this.areaData
416
+ console.log(this.areaData)
417
+ console.log("这是父级接收的社区值:",sqvalue,sqlable)
418
+
419
+ // 是否禁用按钮
420
+ this.disableButton()
421
+ },
422
+ // 是否禁用按钮
423
+ disableButton () {
424
+ var flag = false
425
+ for (const field of this.data.fields) {
426
+ if (field.required && !field.value && !field.hidden && field.value !== 0) {
427
+ flag = true
428
+ }
429
+
430
+ // 任何选择框只要是否都不能提交
431
+ if (field.type === 'select' && field.value === '否' && field.value_no_disable) {
432
+ flag = true
433
+ }
434
+
435
+ if (field.type === 'checkbox' && field.required && field.value.length === 0) {
436
+ flag = true
437
+ }
438
+ }
439
+ //区域下拉框必选 流程模式为报警器报建 工商业报警器报建
440
+ if ((this.data.f_apply_type === '报警器报建' || this.data.f_apply_type === '工商业报警器报建') && this.data.defname === '工程施工' && this.data.title === '工程施工' && this.data.f_sub_state !='完工'){
441
+ if (!flag){
442
+ if (this.areaData.sjvalue ==null || this.areaData.sjvalue.length ==0 || this.areaData.sqvalue == null || this.areaData.sqvalue.length ==0
443
+ || this.areaData.xianvalue == null || this.areaData.xianvalue == 0){
444
+ console.log("区域为空禁止提交:",this.areaData)
445
+ flag = true
446
+ }
447
+ if (this.areaData.mapvalue ==null || this.areaData.mapvalue ==0){
448
+ console.log("坐标为空禁止提交map:",this.areaData.mapvalue)
449
+ flag = true
450
+ }
451
+ for (const fields of this.areaData.mapvalue) {
452
+ // console.log("报警器数据:",fields.f_bjq_lng)
453
+ if (fields.f_bjq_lng ==null || fields.f_bjq_lng.length ==0){
454
+ console.log("坐标为空禁止提交44444:",this.areaData.mapvalue)
455
+ flag = true
456
+ }
457
+ }
458
+ }
459
+ }
460
+
461
+ this.disable_button = flag
462
+ },
463
+ // 失去焦点且值最终发生变化触发
464
+ async onchange (index) {
465
+ // 是否禁用按钮
466
+ this.disableButton()
467
+ // this.disablebtu()
468
+
469
+ if (!isEmpty(this.data.fields[index].value)) {
470
+ // 前缀、后缀
471
+ if (this.data.fields[index].prefix) {
472
+ this.data.fields[index].value = this.data.fields[index].prefix + this.data.fields[index].value
473
+ }
474
+ if (this.data.fields[index].suffix) {
475
+ this.data.fields[index].value = this.data.fields[index].value + this.data.fields[index].suffix
476
+ }
477
+ }
478
+
479
+ // data赋值
480
+ this.data[this.data.fields[index].field] = this.data.fields[index].value
481
+
482
+ if (this.data.fields[index].type === 'datepicker') {
483
+ this.check_datepicker(index)
484
+ }
485
+
486
+ if (this.data.fields[index].onchange) {
487
+ this.$dispatch(this.data.fields[index].onchange, index)
488
+ }
489
+ this.$dispatch('onchange', index)
490
+
491
+
492
+ },
493
+ // 失去焦点触发,无论值是否发生变化
494
+ onblur (index) {
495
+ this.disableButton()
496
+
497
+ if (this.data.fields[index].onblur) {
498
+ this.$dispatch(this.data.fields[index].onblur, index)
499
+ }
500
+
501
+ this.$dispatch('onblur', index)
502
+ },
503
+ disablebtu(){
504
+ this.flag = true
505
+ },
506
+ oninput (index) {
507
+ // 是否禁用按钮
508
+ this.disableButton()
509
+
510
+ if (this.data.fields[index].oninput) {
511
+ this.$dispatch(this.data.fields[index].oninput, index)
512
+ }
513
+ this.$dispatch('oninput', index)
514
+ },
515
+ // 点击按钮组按钮
516
+ async click_but (button) {
517
+ //报警器区域地址
518
+ this.data.areaData = this.areaData
519
+
520
+ if (this.data.defname === '通气点火') {
521
+
522
+ this.$showMessage(`请确认表号是否正确`).then((res) => {
523
+
524
+
525
+ this.disable_button = true
526
+
527
+ this.data.fields.forEach(item => {
528
+ this.data[item.field] = item.value
529
+ })
530
+
531
+ this.data.button = button
532
+
533
+ if (button.button_fields && button.button_fields.length > 0) {
534
+ this.showButModal = true
535
+ return
536
+ }
537
+
538
+ if (this.data.button.event) {
539
+ this.$dispatch(this.data.button.event)
540
+ } else {
541
+ this.$dispatch('button')
542
+ }
543
+
544
+ })
545
+
546
+ }
547
+ else{
548
+ this.disable_button = true
549
+
550
+ this.data.fields.forEach(item => {
551
+ this.data[item.field] = item.value
552
+ })
553
+
554
+ this.data.button = button
555
+
556
+ if (button.button_fields && button.button_fields.length > 0) {
557
+ this.showButModal = true
558
+ return
559
+ }
560
+
561
+ if (this.data.button.event) {
562
+ this.$dispatch(this.data.button.event)
563
+ } else {
564
+ this.$dispatch('button')
565
+ }
566
+ }
567
+
568
+ },
569
+ confirmModal () {
570
+ this.closeModal()
571
+
572
+ this.data.button.button_fields.forEach(item => {
573
+ this.data.button[item.field] = item.value
574
+ })
575
+
576
+ if (this.data.button.event) {
577
+ this.$dispatch(this.data.button.event)
578
+ } else {
579
+ this.$dispatch('button')
580
+ }
581
+ },
582
+ // 关闭模态框
583
+ closeModal () {
584
+ this.showButModal = false
585
+ this.disable_modal_button = true
586
+ },
587
+ onbutchange (index) {
588
+ // 是否禁用按钮
589
+ this.disableModalButton()
590
+
591
+ if (this.data.button.button_fields[index].onchange) {
592
+ this.$dispatch(this.data.button.button_fields[index].onchange, index)
593
+ } else {
594
+ this.$dispatch('onbutchange', index)
595
+ }
596
+
597
+ },
598
+ onbutblur (index) {
599
+ this.disableModalButton()
600
+
601
+ if (this.data.button.button_fields[index].onblur) {
602
+ this.$dispatch(this.data.button.button_fields[index].onblur, index)
603
+ } else {
604
+ this.$dispatch('onbutblur', index)
605
+ }
606
+ },
607
+ onbutinput (index) {
608
+ // 是否禁用按钮
609
+ this.disableModalButton()
610
+
611
+ if (this.data.button.button_fields[index].oninput) {
612
+ this.$dispatch(this.data.button.button_fields[index].oninput, index)
613
+ } else {
614
+ this.$dispatch('onbutinput', index)
615
+ }
616
+ },
617
+ disableModalButton () {
618
+ let flag = false
619
+
620
+
621
+ for (const item of this.data.button.button_fields) {
622
+ if (item.required && !item.value) {
623
+ if (item.value === 0) {
624
+ flag = false
625
+ } else {
626
+ flag = true
627
+ }
628
+ }
629
+ }
630
+
631
+ this.disable_modal_button = flag
632
+ },
633
+ check_datepicker (index) {
634
+ // 时间格式检测
635
+ if (!isEmpty(this.data.fields[index].value)) {
636
+
637
+ let dateReg = /^[1-9]\d{3}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])$/
638
+ let timeReg = /^(20|21|22|23|[0-1]\d):[0-5]\d:[0-5]\d$/
639
+ 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$/
640
+ if (this.data.fields[index].format) {
641
+ if (this.data.fields[index].format === 'yyyy-MM-dd') {
642
+ if (!dateReg.test(this.data.fields[index].value)) {
643
+ this.data.fields[index].value = ''
644
+ this.$showAlert(this.data.fields[index].label + '格式错误如:2021-01-01', 'warning', 2000)
645
+ }
646
+ }
647
+ if (this.data.fields[index].format === 'HH:mm:ss') {
648
+ if (!timeReg.test(this.data.fields[index].value)) {
649
+ this.data.fields[index].value = ''
650
+ this.$showAlert(this.data.fields[index].label + '格式错误如:00:00:00', 'warning', 2000)
651
+ }
652
+ }
653
+ if (this.data.fields[index].format === 'yyyy-MM-dd HH:mm:ss') {
654
+ if (!datetimeReg.test(this.data.fields[index].value)) {
655
+ this.data.fields[index].value = ''
656
+ this.$showAlert(this.data.fields[index].label + '格式错误如:2021-01-01 00:00:00', 'warning', 2000)
657
+ }
658
+ }
659
+ } else {
660
+ if (!dateReg.test(this.data.fields[index].value)) {
661
+ this.data.fields[index].value = ''
662
+ this.$showAlert(this.data.fields[index].label + '格式错误如:2021-01-01', 'warning', 2000)
663
+ }
664
+ }
665
+ }
666
+ },
667
+ selectSearch(event, index) {
668
+ if (this.data.fields[index].selectSearch) {
669
+ this.$dispatch(this.data.fields[index].selectSearch, event[0], index)
670
+ }
671
+ this.$dispatch('selectSearch', event[0], index)
672
+ }
673
+ },
674
+ events: {
675
+ }
676
+ }
677
+ </script>
678
+ <style scoped>
679
+ .control-label-justify {
680
+ width: 30%;
681
+ text-align: justify;
682
+ text-align-last: justify;
683
+ font-family: PingFang-SC-Bold;
684
+ float: left;
685
+ }
686
+ .button_spacing{margin: 0px 0px 0px 10px;}
687
+ </style>
688
+ <style lang="less">
689
+ .apply-has-error {
690
+ border-bottom: 1px solid #a94442;
691
+ }
692
+ .app-input {
693
+ label {
694
+ float: left;
695
+ }
696
+ .select {
697
+ button {
698
+ border: none;
699
+ outline: none;
700
+ text-align: left;
701
+ .btn-placeholder {
702
+ color: #ACA899
703
+ }
704
+ }
705
+ }
706
+ .datepicker {
707
+ .form-control:focus {
708
+ border: none!important;
709
+ outline: none!important;
710
+ -webkit-box-shadow: none;
711
+ box-shadow: none;
712
+ }
713
+ }
714
+ textarea {
715
+ padding: 8px 10px;
716
+ border: none;
717
+ outline: none;
718
+ margin: 0px;
719
+ }
720
+ input[readonly]{
721
+ color: #ACA899!important;
722
+ background: #FFFFFF;
723
+ border: none;
724
+ outline: none;
725
+ }
726
+ input:disabled{
727
+ color: #ACA899!important;
728
+ background: #FFFFFF;
729
+ border: none;
730
+ outline: none;
731
+ }
732
+ textarea[readonly]{
733
+ color: #ACA899!important;
734
+ background: #FFFFFF;
735
+ border: none;
736
+ outline: none;
737
+ }
738
+ textarea:disabled{
739
+ color: #ACA899!important;
740
+ background: #FFFFFF;
741
+ border: none;
742
+ outline: none;
743
+ }
744
+ }
745
+ </style>