apply-clients 3.4.91 → 3.4.93

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