apply-clients 3.4.72 → 3.4.73

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.
@@ -0,0 +1,1037 @@
1
+ 1<template>
2
+ <div class="select-overspread" style="background-color: #ffffff;padding: 20px;overflow: scroll">
3
+ <validator name='v' @valid="$emit('valid')" @invalid="$emit('invalid')">
4
+ <form class="form-horizontal">
5
+ <div class="form-group">
6
+ <div v-for="(index,item) in data.fields">
7
+ <!--input-->
8
+ <div :style="item.style ? item.style+';height: 40px;margin-bottom: 20px':'height: 40px;margin-bottom: 20px'"
9
+ v-if="(item.type==='input' || item.type==='number'||item.type === 'tel'||item.type === 'email') && !item.hidden && (item.device === 'pc' || !item.device) && ( item.label != '证件号码')&&( item.label !== '身份证') && (item.label !== '用户电话')"
10
+ :class="[item.required && !(item.value) ? 'has-error' : '',item.bootstraped ? item.bootstraped + ' form-group':'col-sm-4 form-group']">
11
+ <label :style="item.label_style ? item.label_style : ''"
12
+ :class="item.label_bootstraped ? item.label_bootstraped+' control-label-justify control-label' : 'control-label-justify control-label col-sm-6'">{{item.label}}</label>
13
+ <div :style="item.value_style ? item.value_style:''"
14
+ :class="item.value_bootstraped ? item.value_bootstraped : 'col-sm-6'">
15
+ <input class="form-control input_view" style=""
16
+ :type="item.type"
17
+ v-model="data.fields[index].value"
18
+ :placeholder="item.placeholder"
19
+ :value="data.fields[index].value"
20
+ :readonly="item.readonly"
21
+ :disabled="item.disabled"
22
+ @change="onchange(index)"
23
+ @blur="onblur(index)"
24
+ @input="oninput(index)"
25
+ />
26
+ </div>
27
+ </div>
28
+
29
+ <!--input-->
30
+ <div :style="item.style ? item.style+';height: 40px;margin-bottom: 20px':'height: 40px;margin-bottom: 20px'"
31
+ v-if="((data.f_credentials === '军官证' ||data.f_credentials === '营业执照')&& item.label === '证件号码')"
32
+ :class="[item.required && !(item.value) ? 'has-error' : '',item.bootstraped ? item.bootstraped + ' form-group':'col-sm-4 form-group']">
33
+ <label :style="item.label_style ? item.label_style : ''"
34
+ :class="item.label_bootstraped ? item.label_bootstraped+' control-label-justify control-label' : 'control-label-justify control-label col-sm-6'">{{item.label}}</label>
35
+ <div :style="item.value_style ? item.value_style:''"
36
+ :class="item.value_bootstraped ? item.value_bootstraped : 'col-sm-6'">
37
+ <input class="form-control input_view" style=""
38
+ :type="item.type"
39
+ v-model="data.fields[index].value"
40
+ :placeholder="item.placeholder"
41
+ :value="data.fields[index].value"
42
+ :readonly="item.readonly"
43
+ :disabled="item.disabled"
44
+ @change="onchange(index)"
45
+ @blur="onblur(index)"
46
+ @input="oninput(index)"
47
+ />
48
+ </div>
49
+ </div>
50
+ <!--身份证验证-->
51
+ <div :style="item.style ? item.style+';height: 40px;margin-bottom: 20px':'height: 40px;margin-bottom: 20px'"
52
+ v-if="(item.label==='身份证') || (data.f_credentials === '身份证' && item.label === '证件号码')"
53
+ :class="[$v.f_idnumber2.identityCardValid ? 'has-error' : '',item.bootstraped ? item.bootstraped + ' form-group':'col-sm-4 form-group']">
54
+ <label :style="item.label_style ? item.label_style : ''"
55
+ :class="item.label_bootstraped ? item.label_bootstraped+' control-label-justify control-label' : 'control-label-justify control-label col-sm-6'">{{item.label}}</label>
56
+ <div :style="item.value_style ? item.value_style:''"
57
+ :class="item.value_bootstraped ? item.value_bootstraped : 'col-sm-6'">
58
+ <input class="form-control input_view" style=""
59
+ :type="item.type"
60
+ maxlength="18"
61
+ v-model="data.fields[index].value"
62
+ :placeholder="item.placeholder"
63
+ :value="data.fields[index].value"
64
+ v-validate:f_idnumber2='{identityCardValid: true}'
65
+ :readonly="item.readonly"
66
+ :disabled="item.disabled"
67
+ @change="onchange(index)"
68
+ @blur="onblur(index)"
69
+ @input="oninput(index)"
70
+ />
71
+ </div>
72
+ </div>
73
+
74
+
75
+ <div :style="item.style ? item.style+';height: 40px;margin-bottom: 20px':'height: 40px;margin-bottom: 20px'"
76
+ v-if="item.label === '用户电话'"
77
+ :class="[$v.f_user_phone.minlength || $v.f_user_phone.maxlength ? 'has-error' : '',item.bootstraped ? item.bootstraped + ' form-group':'col-sm-4 form-group']">
78
+ <label :style="item.label_style ? item.label_style : ''"
79
+ :class="item.label_bootstraped ? item.label_bootstraped+' control-label-justify control-label' : 'control-label-justify control-label col-sm-6'">{{item.label}}</label>
80
+ <div :style="item.value_style ? item.value_style:''"
81
+ :class="item.value_bootstraped ? item.value_bootstraped : 'col-sm-6'">
82
+ <input class="form-control input_view" style=""
83
+ type="number"
84
+ oninput="if(value.length > 11) value=value.slice(0,11)"
85
+ v-validate:f_user_phone="{minlength: 7, maxlength: 11 }"
86
+ v-model="data.fields[index].value"
87
+ :placeholder="item.placeholder"
88
+ :value="data.fields[index].value"
89
+ onKeypress="return(/[\d\.]/.test(String.fromCharCode(event.keyCode)))"
90
+ :readonly="item.readonly"
91
+ :disabled="item.disabled"
92
+ @change="onchange(index)"
93
+ @blur="onblur(index)"
94
+ @input="oninput(index)"
95
+ />
96
+ </div>
97
+ </div>
98
+
99
+
100
+
101
+ <!--时间datepicker-->
102
+ <div :style="item.style ? item.style+';height: 40px;margin-bottom: 20px':'height: 40px;margin-bottom: 20px'"
103
+ v-if="item.type==='datepicker' && !item.hidden && (item.device === 'pc' || !item.device)"
104
+ :class="[item.required && !(item.value) ? 'has-error' : '',item.bootstraped ? item.bootstraped+' form-group':'col-sm-4 form-group']">
105
+ <label
106
+ :class="item.label_bootstraped ? item.label_bootstraped+' control-label-justify control-label' : 'control-label control-label-justify col-sm-6'">{{item.label}}</label>
107
+ <div :style="item.value_style ? item.value_style:''"
108
+ :class="item.value_bootstraped ? item.value_bootstraped : 'col-sm-6'">
109
+ <datepicker
110
+ @change="onchange(index)"
111
+ @blur="onblur(index)"
112
+ :placeholder="item.placeholder"
113
+ :value.sync="data.fields[index].value"
114
+ :format="item.format ? item.format : 'yyyy-MM-dd'"
115
+ v-model="data.fields[index].value"
116
+ :readonly="item.readonly"
117
+ :disabled="item.disabled"
118
+ :show-reset-button="reset">
119
+ </datepicker>
120
+ </div>
121
+ </div>
122
+
123
+ <!--textarea-->
124
+ <div :style="item.style ? item.style+';margin-bottom: 20px':'margin-bottom: 20px'"
125
+ v-if="item.type==='textarea' && !item.hidden && (item.device === 'pc' || !item.device)"
126
+ :class="[item.required && !(item.value) ? 'has-error' : '',item.bootstraped?item.bootstraped+' form-group':'col-sm-12 form-group']">
127
+ <label :style="item.label_style ? item.label_style : ''"
128
+ :class="item.label_bootstraped ? item.label_bootstraped + ' control-label-justify control-label' : 'control-label-justify control-label col-sm-3'">{{item.label}}</label>
129
+ <div :style="item.value_style ? item.value_style:''"
130
+ :class="item.value_bootstraped ? item.value_bootstraped : 'col-sm-10'">
131
+ <textarea
132
+ :readonly="item.readonly"
133
+ :disabled="item.disabled"
134
+ class="form-control input_view"
135
+ style="width: 100%;height: 100%"
136
+ :rows="item.rows"
137
+ v-model="data.fields[index].value"
138
+ :value="data.fields[index].value"
139
+ @change="onchange(index)"
140
+ @blur="onblur(index)"
141
+ @input="oninput(index)"
142
+ >
143
+ </textarea>
144
+ <button
145
+ v-if="(item.field==='f_prospecting_result')&&exploration" @click="showModle()">查看所有</button>
146
+ </div>
147
+ </div>
148
+
149
+ <!--select-->
150
+ <div :style="item.style ? item.style+';height: 40px;margin-bottom: 20px':'height: 40px;margin-bottom: 20px'"
151
+ v-if="item.type==='select' && !item.hidden && (item.device === 'pc' || !item.device)"
152
+ :class="[item.required && !(item.value) ? 'has-error' : '',item.bootstraped?item.bootstraped+' form-group':'col-sm-4 form-group']">
153
+ <label
154
+ :class="item.label_bootstraped ? item.label_bootstraped+' control-label control-label-justify':'control-label-justify control-label col-sm-6'">{{item.label}}</label>
155
+ <div :style="item.value_style ? item.value_style:''"
156
+ :class="item.value_bootstraped ? item.value_bootstraped : 'col-sm-6'">
157
+ <input-select
158
+ class="select select_list"
159
+ @blur="onblur(index)"
160
+ @change="onchange(index)"
161
+ @select-search="selectSearch($arguments,index)"
162
+ :readonly="item.readonly"
163
+ :disable="item.disabled"
164
+ :value.sync="data.fields[index].value"
165
+ v-model="data.fields[index].value"
166
+ :options='data.fields[index].options'
167
+ :valueSingle="true"></input-select>
168
+ </div>
169
+ </div>
170
+
171
+ <!--checkbox-->
172
+ <div :style="item.style ? item.style+';height: 40px;margin-bottom: 20px':'height: 40px;margin-bottom: 20px'"
173
+ v-if="item.type==='checkbox' && !item.hidden && (item.device === 'pc' || !item.device)"
174
+ :class="[item.required && item.value.length === 0 ? 'has-error' : '',item.bootstraped?item.bootstraped+' form-group':'col-sm-4 form-group']">
175
+ <label v-if="item.label"
176
+ :class="item.label_bootstraped?item.label_bootstraped+' control-label control-label-justify':'control-label-justify control-label col-sm-6'">{{item.label}}</label>
177
+ <div :style="item.value_style ? item.value_style:''"
178
+ :class="item.value_bootstraped ? item.value_bootstraped : 'col-sm-6'">
179
+ <label class="checkbox-inline" v-for="(index2,row) in item.options">
180
+ <input type="checkbox" class=""
181
+ :readonly="data.fields[index].readonly"
182
+ :disabled="data.fields[index].disabled"
183
+ v-model="data.fields[index].value"
184
+ :value="data.fields[index].options[index2].value"
185
+ @change="onchange(index)"
186
+ @blur="onblur(index)">
187
+ {{row.label}}
188
+ </label>
189
+ </div>
190
+ </div>
191
+ </div>
192
+ <!--区域地址联动-->
193
+ <div>
194
+ <res-area-select-group
195
+ v-if="(data.f_apply_type === '报警器报建' || data.f_apply_type === '工商业报警器报建') && data.defname === '工程施工' && data.title === '工程施工' && data.f_sub_state !='完工'"
196
+ labelstyle = "control-label"
197
+ @shiji-select = "getSelectShijiValue"
198
+ @xian-select = "getSelectXianValue"
199
+ @shequ-select = "getSelectShequValue"
200
+ >
201
+ </res-area-select-group>
202
+ </div>
203
+
204
+ <gaode-map
205
+ v-if="(data.f_apply_type === '报警器报建' || data.f_apply_type === '工商业报警器报建') && data.defname === '工程施工' && data.title === '工程施工' && data.f_sub_state !='完工'"
206
+ >
207
+
208
+ </gaode-map>
209
+
210
+ </div>
211
+
212
+ <!-- onetomany -->
213
+ <div class="" v-for="(index,item) in data.onetomany">
214
+ <onetomany :selectdata="data" :onetomany="item" :index="index" v-if="item.device === 'pc' || !item.device"></onetomany>
215
+ </div>
216
+
217
+ <div v-for="(i,item) in data.components">
218
+ <component v-if="item.device === 'pc' || !item.device" :is="item.name" :selectdata="data" :mark="item.mark"></component>
219
+ </div>
220
+
221
+ <!--自定义组件-->
222
+ <slot>
223
+ <!--<div :style="item.style ? item.style+';height: 40px;margin-bottom: 20px':'height: 40px;margin-bottom: 20px'"-->
224
+ <!-- v-if="data.f_apply_type === '报警器报建' && data.defname === '工程施工'"-->
225
+ <!-- :class="[$v.f_idnumber2.identityCardValid ? 'has-error' : '',item.bootstraped ? item.bootstraped + ' form-group':'col-sm-4 form-group']">-->
226
+
227
+ <!--<div class="col-sm-6 form-group "-->
228
+ <!-- :class="[$v.f_pcd_id.required ? 'has-error' : 'has-success']">-->
229
+ <!-- <label class="font_normal_body">省&ensp;市&ensp;区</label>-->
230
+ <!-- <input type="text" style="width:41%" v-show="false" v-model="model.f_pcd_id"-->
231
+ <!-- v-validate:f_pcd_id='{required: true }'-->
232
+ <!-- >-->
233
+
234
+ <!-- <v-select :value.sync="model.f_pcd_id" :value-single="true"-->
235
+ <!-- :options='pcdslist' placeholder='请选择2'-->
236
+ <!-- close-on-select search="true" @change="pcdChange">-->
237
+ <!-- </v-select>-->
238
+ <!--</div>-->
239
+ <!--<div class="col-sm-6 form-group "-->
240
+ <!-- :class="[$v.f_street_id.required ? 'has-error' : 'has-success']">-->
241
+ <!-- <label class="font_normal_body">街道/乡镇</label>-->
242
+ <!-- <input type="text" style="width:41%" v-show="false" v-model="model.f_street_id"-->
243
+ <!-- >-->
244
+ <!-- <v-select :value.sync="model.f_street_id" :value-single="true"-->
245
+ <!-- :options='streetslist' placeholder='请选择'-->
246
+ <!-- @change="streetChange"-->
247
+ <!-- close-on-select search="true">-->
248
+ <!-- </v-select>-->
249
+
250
+ <!--</div>-->
251
+ <!--<div class="col-sm-6 form-group "-->
252
+ <!-- :class="[$v.f_residential_area_id.required ? 'has-error' : 'has-success']">-->
253
+ <!-- <label class="font_normal_body">集收单位</label>-->
254
+ <!-- <input type="text" style="width:41%" v-show="false" v-model="model.f_residential_area_id"-->
255
+ <!-- v-validate:f_residential_area_id='{required: true }'>-->
256
+ <!-- <v-select :value.sync="model.f_residential_area_id" :value-single="true"-->
257
+ <!-- :options='areaslist' placeholder='请选择'-->
258
+ <!-- @change="" @select-search="selectSearch"-->
259
+ <!-- close-on-select search="true">-->
260
+ <!-- </v-select>-->
261
+ <!--</div>-->
262
+ <!--</div>-->
263
+ </slot>
264
+ <!--公司等属性-->
265
+ <div class="col-sm-12 form-group text-center" style="padding-top:8px">
266
+ <div class="col-sm-3 form-group center-block">
267
+ <label class="col-sm-5">所属公司:</label>
268
+ <div class="col-sm-6" style="text-align: left">
269
+ {{model.orgs}}
270
+ </div>
271
+ </div>
272
+ <div class="col-sm-3 form-group center-block">
273
+ <label class="col-sm-5">部门:</label>
274
+ <div class="col-sm-6" style="text-align: left">
275
+ {{model.parentname}}
276
+ </div>
277
+ </div>
278
+ <div class="col-sm-3 form-group center-block">
279
+ <label class="col-sm-5">操作人:</label>
280
+ <div class="col-sm-6 " style="text-align: left">
281
+ {{model.operator}}
282
+ </div>
283
+ </div>
284
+ <div class="col-sm-3 form-group center-block">
285
+ <label class="col-sm-5">操作日期:</label>
286
+ <div class="col-sm-6" style="text-align: left">
287
+ {{model.operate_date}}
288
+ </div>
289
+ </div>
290
+ </div>
291
+ <!-- 按钮组 -->
292
+ <div class="from-group col-sm-12 text-center">
293
+ <!-- 按钮组 -->
294
+ <button v-for="(index,button) in data.buttons"
295
+ :disabled="(button.disabled && disable_button)"
296
+ style="min-width:100px"
297
+ :class="button.disabled && disable_button ? 'btn btn-default button_spacing' : 'btn btn-primary button_spacing'"
298
+ v-if="!button.hidden && button.button_name !=='提交'&& button.button_name !=='确认'"
299
+ @click.prevent="click_but(button)"
300
+ >
301
+ {{button.button_name}}
302
+ </button>
303
+ <button v-for="(index,button) in data.buttons"
304
+ :disabled="(button.disabled && disable_button) || (!$v.valid)"
305
+ style="min-width:100px"
306
+ :class="button.disabled && disable_button || (!$v.valid) ? 'btn btn-default button_spacing' : 'btn btn-primary button_spacing'"
307
+ v-if="!button.hidden && (button.button_name ==='提交'||button.button_name ==='确认')"
308
+ @click.prevent="click_but(button)"
309
+ >
310
+ {{button.button_name}}
311
+ </button>
312
+ </div>
313
+
314
+ <!-- 按钮模态框 -->
315
+ <modal v-if="showButModal" :show.sync="showButModal" backdrop="false" large>
316
+ <header slot="modal-header" class="modal-header">
317
+ <button type="button" class="close" @click="closeModal()"><span>&times;</span></button>
318
+ <span class="modal-title"><font
319
+ size="3">{{data.button.button_name}}</font></span>
320
+ </header>
321
+ <article slot="modal-body" class="modal-body clearfix">
322
+ <div class="form-group" style="padding: 0 150px">
323
+ <div v-for="(index,item) in data.button.button_fields">
324
+ <div :style="item.style ? item.style : ''" :class="[item.required && !(item.value) ? 'has-error' : '', item.bootstraped ? item.bootstraped + ' form-group' : 'form-group']"
325
+ v-if="(item.type==='input' || item.type==='number'||item.type === 'tel'||item.type === 'email') && !item.hidden && (item.device === 'pc' || !item.device)">
326
+ <label :style="item.label_style ? item.label_style : ''"
327
+ :class="item.label_bootstraped ? item.label_bootstraped + ' control-label-justify control-label' : 'control-label-justify control-label col-sm-6'">{{item.label}}</label>
328
+ <div :style="item.value_style ? item.value_style : ''"
329
+ :class="item.value_bootstraped ? item.value_bootstraped : 'col-sm-9'">
330
+ <input class="form-control input_view"
331
+ :placeholder="item.placeholder"
332
+ :type="item.type"
333
+ v-model="item.value"
334
+ :value="item.value"
335
+ :readonly="item.readonly"
336
+ :disabled="item.disabled"
337
+ @change="onbutchange(index)"
338
+ @blur="onbutblur(index)"
339
+ @input="onbutinput(index)"
340
+ />
341
+ </div>
342
+ </div>
343
+
344
+ <!--时间datepicker-->
345
+ <div :style="item.style ? item.style : ''" :class="[item.required && !(item.value) ? 'has-error' : '', item.bootstraped ? item.bootstraped + ' form-group':'form-group']"
346
+ v-if="item.type==='datepicker' && !item.hidden && (item.device === 'pc' || !item.device)">
347
+ <label :style="item.label_style ? item.label_style : ''"
348
+ :class="item.label_bootstraped ? item.label_bootstraped + ' control-label-justify control-label' : 'control-label-justify control-label col-sm-6'">{{item.label}}</label>
349
+ <div :style="item.value_style ? item.value_style : ''"
350
+ :class="item.value_bootstraped ? item.value_bootstraped : 'col-sm-9'">
351
+ <datepicker
352
+ :placeholder="item.placeholder"
353
+ :value.sync="item.value"
354
+ v-model="item.value"
355
+ :readonly="item.readonly"
356
+ :disabled="item.disabled"
357
+ :format="item.format ? item.format : 'yyyy-MM-dd'"
358
+ :show-reset-button="true"
359
+ @change="onbutchange(index)"
360
+ @blur="onbutblur(index)"
361
+ ></datepicker>
362
+ </div>
363
+ </div>
364
+
365
+ <!--select-->
366
+ <div :style="item.style ? item.style : ''" :class="[item.required && !(item.value) ? 'has-error' : '', item.bootstraped ? item.bootstraped + ' form-group':'form-group']"
367
+ v-if="item.type==='select' && !item.hidden && (item.device === 'pc' || !item.device)">
368
+ <label :style="item.label_style ? item.label_style : ''"
369
+ :class="item.label_bootstraped ? item.label_bootstraped + ' control-label-justify control-label' : 'control-label-justify control-label col-sm-6'">{{item.label}}</label>
370
+ <div :style="item.value_style ? item.value_style : ''"
371
+ :class="item.value_bootstraped ? item.value_bootstraped : 'col-sm-9'">
372
+ <input-select
373
+ class="select select_list"
374
+ :value.sync="item.value"
375
+ v-model="item.value"
376
+ :options='item.options'
377
+ :readonly="item.readonly"
378
+ :disable="item.disabled"
379
+ :valueSingle="true"
380
+ @blur="onbutblur(index)"
381
+ @change="onbutchange(index)"
382
+ ></input-select>
383
+ </div>
384
+ </div>
385
+
386
+ <!--textarea-->
387
+ <div :style="item.style ? item.style : ''" :class="[item.required && !(item.value) ? 'has-error' : '', item.bootstraped ? item.bootstraped + ' form-group':'form-group']"
388
+ v-if="item.type==='textarea' && !item.hidden && (item.device === 'pc' || !item.device)">
389
+ <label :style="item.label_style ? item.label_style : ''"
390
+ :class="item.label_bootstraped ? item.label_bootstraped + ' control-label-justify control-label' : 'control-label-justify control-label col-sm-6'">{{item.label}}</label>
391
+ <div :style="item.value_style ? item.value_style : ''"
392
+ :class="item.value_bootstraped ? item.value_bootstraped : 'col-sm-9'">
393
+ <textarea
394
+ class="form-control input_view"
395
+ style="width: 100%;height: 100%"
396
+ v-model="item.value"
397
+ :value="item.value"
398
+ :rows="item.rows"
399
+ :readonly="item.readonly"
400
+ :disabled="item.disabled"
401
+ @change="onbutchange(index)"
402
+ @blur="onbutblur(index)"
403
+ @input="onbutinput(index)"
404
+ ></textarea>
405
+ </div>
406
+ </div>
407
+ </div>
408
+ </div>
409
+ </article>
410
+ <footer slot="modal-footer" class="modal-footer">
411
+ <button :class="disable_modal_button ? 'btn btn-default':'btn btn-primary'"
412
+ :disabled="disable_modal_button" type="button" @click="confirmModal()">
413
+ 确认
414
+ </button>
415
+ </footer>
416
+ </modal>
417
+ </form>
418
+ <modal v-if="showModal" :show.sync="showModal" cancel-text="取消"
419
+ ok-text="确认">
420
+ <div class="form-horizontal" slot="modal-body">
421
+ <!-- table表格,标题为勘察结果,勘察时间-->
422
+ <table class="table table-bordered table-hover table-striped">
423
+ <thead>
424
+ <tr>
425
+ <th>序号</th>
426
+ <th>勘察结果</th>
427
+ <th>勘察时间</th>
428
+ </tr>
429
+ </thead>
430
+ <tbody>
431
+ <tr v-for="(index,item) in exdata" >
432
+ <td :style="{ textAlign: 'center' }">{{index*1+1}}</td>
433
+ <td :style="{ textAlign: 'center' }">{{item.f_exploration_result}}</td>
434
+ <td :style="{ textAlign: 'center' }">{{item.f_time}}</td>
435
+ </tr>
436
+ </tbody>
437
+ </table>
438
+ </div>
439
+ </modal>
440
+ </div>
441
+ </template>
442
+ <script>
443
+ import Vue from 'vue'
444
+ import {isEmpty} from '../Util'
445
+ import {HttpResetClass} from 'vue-client'
446
+ // Date格式化
447
+ Date.prototype.Format = function (fmt) {
448
+ var o = {
449
+ 'M+': this.getMonth() + 1, // 月份
450
+ 'd+': this.getDate(), // 日
451
+ 'H+': this.getHours(), // 小时
452
+ 'm+': this.getMinutes(), // 分
453
+ 's+': this.getSeconds(), // 秒
454
+ 'q+': Math.floor((this.getMonth() + 3) / 3), // 季度
455
+ 'S': this.getMilliseconds() // 毫秒
456
+ }
457
+ if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (this.getFullYear() + '').substr(4 - RegExp.$1.length))
458
+ for (var k in o) {
459
+ if (new RegExp('(' + k + ')').test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length === 1) ? (o[k]) : (('00' + o[k]).substr(('' + o[k]).length)))
460
+ }
461
+ return fmt
462
+ }
463
+
464
+ export default {
465
+ title: '报建业务通用组件',
466
+ props: {
467
+ data: {
468
+ type: Object
469
+ }
470
+ },
471
+ data () {
472
+ return {
473
+ showModal:false,//勘察结果弹窗
474
+ exdata: [],//勘察结果数据
475
+ model: {}, // 公司等属性
476
+ exploration:false,//勘察结果按钮显示
477
+ disable_button: true, // 控制按钮禁用
478
+ disable_modal_button: true, // 控制按钮禁用
479
+ //初始化省市区数据
480
+ pcdslist: [],
481
+ //初始化街道数据
482
+ streetslist: [],
483
+ //初始化街道数据
484
+ areaslist: [],
485
+ showButModal: false,
486
+ areaData:{
487
+ sjvalue:'',
488
+ xianvalue:'',
489
+ sqvalue:'',
490
+ },
491
+ templatlng: {
492
+ gaodetemplng: "",
493
+ gaodetemplat: "",
494
+ baidutemplng: "",
495
+ baidutemplat: ""
496
+ }
497
+ }
498
+ },
499
+ watch: {
500
+ deep: true
501
+ },
502
+ computed: {
503
+
504
+ },
505
+ ready () {
506
+ if(this.data.defname=='部门领导审核') {
507
+ let http = new HttpResetClass()
508
+ let res = http.load(
509
+ 'POST',
510
+ `rs/sql/exploration`,
511
+ {
512
+ data: {
513
+ id: this.data.f_process_id,
514
+ }
515
+ },
516
+ {resolveMsg: null, rejectMsg: '勘察结果查询失败!!!'}
517
+ ).then(value =>{
518
+ //遍历value.data数组
519
+ for(let i=0;i<value.data.length;i++){
520
+ // value.data[i].f_time=new Date(value.data[i].f_time).Format("yyyy-MM-dd HH:mm:ss")
521
+ //将数组中的每一个对象赋值给exdata
522
+ this.exdata.push(value.data[i])
523
+ }
524
+ if(value.data.length>1){
525
+ this.exploration=true
526
+ }
527
+ })
528
+
529
+ }
530
+ },
531
+ created () {
532
+ // 初始化数据
533
+ this.initializtion()
534
+ if (this.data.readyEvent) {
535
+ this.$dispatch(this.data.readyEvent)
536
+ }
537
+ this.$dispatch('initializtionView')
538
+ },
539
+ methods: {
540
+ showModle(){
541
+ this.showModal=true
542
+ },
543
+ // 初始化数据
544
+ initializtion () {
545
+ for (const item of this.data.fields) {
546
+ this.data[item.field] = item.value
547
+ }
548
+
549
+ // 是否禁用按钮
550
+ this.disableButton()
551
+ // 公司等属性初始化
552
+ if (this.data.orgs) {
553
+ this.model.orgs = this.data.orgs
554
+ } else {
555
+ this.model.orgs = this.$login.f.orgs
556
+ }
557
+ if (this.data.parentname) {
558
+ this.model.parentname = this.data.parentname
559
+ } else {
560
+ this.model.parentname = this.$login.f.f_department_name
561
+ }
562
+ if (this.data.operate_date) {
563
+ this.model.operate_date = this.data.operate_date
564
+ } else {
565
+ this.model.operate_date = new Date().Format('yyyy-MM-dd')
566
+ }
567
+ if (this.data.operator) {
568
+ this.model.operator = this.data.operator
569
+ } else {
570
+ this.model.operator = this.$login.f.name
571
+ }
572
+
573
+ this.initpcds(` j_orgid = '${this.$login.f.orgid}'`)
574
+ },
575
+ async getSelectShijiValue(sjvalue,sjlable) {
576
+ this.areaData.sjvalue = sjvalue
577
+ console.log("这是父级接收的市级值:",sjvalue,sjlable)
578
+ this.data.areaData = this.areaData
579
+
580
+ // 是否禁用按钮
581
+ this.disableButton()
582
+ },
583
+ async getSelectXianValue(xianvalue,xianlable) {
584
+ this.areaData.xianvalue = xianvalue
585
+ this.data.areaData = this.areaData
586
+ console.log("这是父级接收的县级值:",xianvalue,xianlable)
587
+
588
+ // 是否禁用按钮
589
+ this.disableButton()
590
+ },
591
+ async getSelectShequValue(sqvalue,sqlable) {
592
+ this.areaData.sqvalue = sqvalue
593
+ this.data.areaData = this.areaData
594
+ console.log("这是父级接收的社区值:",sqvalue,sqlable)
595
+
596
+ // 是否禁用按钮
597
+ this.disableButton()
598
+ },
599
+ //初始化省市区,添加街道
600
+ async initpcds(pconditon) {
601
+ // console.log('initpcds', pconditon)
602
+ // this.pcdslist = []
603
+ // let HttpReset = new HttpResetClass()
604
+ // let req = await HttpReset.load('POST', 'rs/sql/address_singleTableOrderBy?pageNo=1&pageSize=9999999', {
605
+ // data: {
606
+ // items: '*',
607
+ // tablename: 'j_bjqpcd',
608
+ // orderitem: 'id',
609
+ // condition: pconditon
610
+ // }
611
+ // }, {resolveMsg: null, rejectMsg: '获取地址失败!'})
612
+ // let redata = []
613
+ // req.data.forEach((row, n) => {
614
+ // redata[n] = {
615
+ // label: row.j_areaname,
616
+ // value: row.j_areaid,
617
+ // data: row,
618
+ // id: row.id
619
+ // }
620
+ // })
621
+ // console.log('市区', redata)
622
+ // this.pcdslist = redata
623
+ },
624
+ //初始化街道 添加小区
625
+ async initstreets(pconditon) {
626
+ // console.log('市区32', pconditon)
627
+ // this.streetslist = []
628
+ // let HttpReset = new HttpResetClass()
629
+ // let req = await HttpReset.load('POST', 'rs/sql/address_singleTableOrderBy', {
630
+ // data: {
631
+ // items: '*',
632
+ // tablename: 'j_bjqstreet',
633
+ // orderitem: 'id',
634
+ // condition: pconditon
635
+ // }
636
+ // }, {resolveMsg: null, rejectMsg: '获取地址失败!'})
637
+ // let redata = []
638
+ // req.data.forEach((row, n) => {
639
+ // redata[n] = {
640
+ // label: row.j_areaname,
641
+ // value: row.j_areaid,
642
+ // data: row,
643
+ // id: row.id
644
+ // }
645
+ // })
646
+ // console.log('市区333', redata)
647
+ // this.streetslist = redata
648
+ // this.model.f_iscity = this.findbyid(this.streetslist, this.model.f_street_id).f_iscity
649
+ },
650
+ //初始化小区添加小区
651
+ async initareas(pconditon) {
652
+ // if(this.usertype){
653
+ // pconditon=pconditon+` and f_special='1' `
654
+ // }
655
+ // this.areaslist = []
656
+ // let HttpReset = new HttpResetClass()
657
+ // let req = await HttpReset.load('POST', 'rs/sql/address_singleTableOrderBy?pageNo=1&pageSize=100', {
658
+ // data: {
659
+ // items: '*',
660
+ // tablename: 'j_bjqarea',
661
+ // orderitem: 'id',
662
+ // condition: pconditon
663
+ // }
664
+ // }, {resolveMsg: null, rejectMsg: '获取地址失败!'})
665
+ // let redata = []
666
+ // req.data.forEach((row) => {
667
+ // redata.push({
668
+ // label: row.j_areaname,
669
+ // value: row.j_areaid,
670
+ // data: row,
671
+ // id: row.id
672
+ // })
673
+ // })
674
+ // console.log('市区666', redata)
675
+ // if (redata.length>0){
676
+ // this.areaslist = redata
677
+ // }
678
+ },
679
+ //省/市/区变化
680
+ async pcdChange(val) {
681
+
682
+ // console.log("省/市/区变化", val)
683
+ // console.log("省/市/区变化", ` f_pcd_id ='${val}' `)
684
+ // if (val) {
685
+ // //那就把[小区,街道]重新组织一下
686
+ // await this.initstreets(` j_parentid ='${val}' `)
687
+ // if (this.model.f_street_id) {
688
+ // if (this.findbyid(this.streetslist, this.model.f_street_id)) {
689
+ // let pcd_id = this.findbyid(this.streetslist, this.model.f_street_id).f_pcd_id
690
+ // if (pcd_id != val) {
691
+ // this.model.f_street_id = ''
692
+ // }
693
+ // } else {
694
+ // this.model.f_street_id = ''
695
+ // }
696
+ //
697
+ // //那就把[小区,街道]重新组织一下
698
+ // if (this.model.f_street_id) {
699
+ // await this.initareas(` j_parentid ='${this.model.f_street_id}' `)
700
+ // if (this.model.f_residential_area_id) {
701
+ // if (this.findbyid(this.areaslist, this.model.f_residential_area_id)) {
702
+ // let pcd_id = this.findbyid(this.areaslist, this.model.f_residential_area_id).f_pcd_id
703
+ // if (pcd_id != val) {
704
+ // this.model.f_residential_area_id = ''
705
+ // }
706
+ // } else {
707
+ // this.model.f_residential_area_id = ''
708
+ // }
709
+ //
710
+ // }
711
+ // }
712
+ // }
713
+ // }
714
+ // this.$resetValidation()
715
+ },
716
+ //街道变化
717
+ async streetChange(val) {
718
+ // console.log("街道变化", val)
719
+ // if (this.streetslist[0]) {
720
+ // var street = ''
721
+ // this.streetslist.forEach((item) => {
722
+ // if (item.id === val) {
723
+ // street = item.label
724
+ // }
725
+ // })
726
+ // this.model.f_address = street
727
+ // }
728
+ // if (val) {
729
+ // //那就把[小区]重新组织一下
730
+ // await this.initareas(` j_parentid ='${val}' `)
731
+ // if (this.model.f_residential_area_id) {
732
+ // if (this.findbyid(this.areaslist, this.model.f_residential_area_id)) {
733
+ // let street_id = this.findbyid(this.areaslist, this.model.f_residential_area_id).f_street_id
734
+ // if (street_id != val) {
735
+ // this.model.f_residential_area_id = ''
736
+ // }
737
+ // } else {
738
+ // this.model.f_residential_area_id = ''
739
+ // }
740
+ //
741
+ // }
742
+ // }
743
+ // this.$resetValidation()
744
+ },
745
+ // 是否禁用按钮
746
+ disableButton () {
747
+ let flag = false
748
+ for (const field of this.data.fields) {
749
+ if (field.required && !field.value && !field.hidden && field.value !== 0) {
750
+ flag = true
751
+ }
752
+
753
+ // 任何选择框只要是否都不能提交
754
+ if (field.type === 'select' && field.value === '否' && field.value_no_disable) {
755
+ flag = true
756
+ }
757
+
758
+ if (field.type === 'checkbox' && field.required && field.value.length === 0) {
759
+ flag = true
760
+ }
761
+ }
762
+
763
+ //区域下拉框必选 流程模式为报警器报建
764
+ if ((this.data.f_apply_type === '报警器报建' || this.data.f_apply_type === '工商业报警器报建') && this.data.defname === '工程施工' && this.data.title === '工程施工' && this.data.f_sub_state !='完工'){
765
+ if (!flag){
766
+ if (this.areaData.sjvalue ==null || this.areaData.sjvalue.length ==0 || this.areaData.sqvalue == null || this.areaData.sqvalue.length ==0
767
+ || this.areaData.xianvalue == null || this.areaData.xianvalue.length == 0){
768
+ console.log("区域为空禁止提交:",this.areaData)
769
+ flag = true
770
+ }
771
+
772
+ if (this.templatlng.baidutemplat ==null || this.templatlng.baidutemplat.length ==0 || this.templatlng.baidutemplng == null || this.templatlng.baidutemplng.length ==0
773
+ || this.templatlng.gaodetemplat == null || this.templatlng.gaodetemplat.length == 0 || this.templatlng.gaodetemplng == null || this.templatlng.gaodetemplng.length == 0){
774
+ console.log("地图坐标为空禁止提交:",this.templatlng)
775
+ flag = true
776
+ }
777
+ }
778
+ }
779
+ this.disable_button = flag
780
+ },
781
+ // 失去焦点且值最终发生变化触发
782
+ async onchange (index) {
783
+ // 是否禁用按钮
784
+ this.disableButton()
785
+
786
+ if (!isEmpty(this.data.fields[index].value)) {
787
+ // 前缀、后缀
788
+ if (this.data.fields[index].prefix) {
789
+ this.data.fields[index].value = this.data.fields[index].prefix + this.data.fields[index].value
790
+ }
791
+ if (this.data.fields[index].suffix) {
792
+ this.data.fields[index].value = this.data.fields[index].value + this.data.fields[index].suffix
793
+ }
794
+ }
795
+
796
+ // data赋值
797
+ this.data[this.data.fields[index].field] = this.data.fields[index].value
798
+
799
+ if (this.data.fields[index].type === 'datepicker') {
800
+ this.check_datepicker(index)
801
+ }
802
+
803
+ if (this.data.fields[index].onchange) {
804
+ this.$dispatch(this.data.fields[index].onchange, index)
805
+ }
806
+ this.$dispatch('onchange', index)
807
+ },
808
+ // 失去焦点触发,无论值是否发生变化
809
+ onblur (index) {
810
+ this.disableButton()
811
+
812
+ if (this.data.fields[index].onblur) {
813
+ this.$dispatch(this.data.fields[index].onblur, index)
814
+ }
815
+
816
+ this.$dispatch('onblur', index)
817
+ },
818
+ oninput (index) {
819
+ // 是否禁用按钮
820
+ this.disableButton()
821
+
822
+ if (this.data.fields[index].oninput) {
823
+ this.$dispatch(this.data.fields[index].oninput, index)
824
+ }
825
+ this.$dispatch('oninput', index)
826
+ },
827
+ selectSearch(event, index) {
828
+ if (this.data.fields[index].selectSearch) {
829
+ this.$dispatch(this.data.fields[index].selectSearch, event[0], index)
830
+ }
831
+ this.$dispatch('selectSearch', event[0], index)
832
+ },
833
+ // 点击按钮组按钮
834
+ async click_but (button) {
835
+ //报警器区域地址
836
+ this.data.areaData = this.areaData
837
+ this.data.templatlng = this.templatlng
838
+
839
+ this.disable_button = true
840
+
841
+ this.data.fields.forEach(item => {
842
+ this.data[item.field] = item.value
843
+ })
844
+
845
+ this.data.button = button
846
+
847
+ if (button.button_fields && button.button_fields.length > 0) {
848
+ this.showButModal = true
849
+ return
850
+ }
851
+
852
+ if (this.data.button.event) {
853
+ this.$dispatch(this.data.button.event)
854
+ } else {
855
+ this.$dispatch('button')
856
+ }
857
+
858
+ },
859
+ confirmModal () {
860
+ this.closeModal()
861
+
862
+ this.data.button.button_fields.forEach(item => {
863
+ this.data.button[item.field] = item.value
864
+ })
865
+
866
+ if (this.data.button.event) {
867
+ this.$dispatch(this.data.button.event)
868
+ } else {
869
+ this.$dispatch('button')
870
+ }
871
+ },
872
+ // 关闭模态框
873
+ closeModal () {
874
+ this.showButModal = false
875
+ this.disable_modal_button = false
876
+ },
877
+ onbutchange (index) {
878
+ // 是否禁用按钮
879
+ this.disableModalButton()
880
+
881
+ if (this.data.button.button_fields[index].onchange) {
882
+ this.$dispatch(this.data.button.button_fields[index].onchange, index)
883
+ } else {
884
+ this.$dispatch('onbutchange', index)
885
+ }
886
+
887
+ },
888
+ onbutblur (index) {
889
+ this.disableModalButton()
890
+
891
+ if (this.data.button.button_fields[index].onblur) {
892
+ this.$dispatch(this.data.button.button_fields[index].onblur, index)
893
+ } else {
894
+ this.$dispatch('onbutblur', index)
895
+ }
896
+ },
897
+ onbutinput (index) {
898
+ // 是否禁用按钮
899
+ this.disableModalButton()
900
+
901
+ if (this.data.button.button_fields[index].oninput) {
902
+ this.$dispatch(this.data.button.button_fields[index].oninput, index)
903
+ } else {
904
+ this.$dispatch('onbutinput', index)
905
+ }
906
+ },
907
+ disableModalButton () {
908
+ let flag = false
909
+
910
+
911
+ for (const item of this.data.button.button_fields) {
912
+ if (item.required && !item.value) {
913
+ if (item.value === 0) {
914
+ flag = false
915
+ } else {
916
+ flag = true
917
+ }
918
+ }
919
+ }
920
+
921
+ this.disable_modal_button = flag
922
+ },
923
+ check_datepicker (index) {
924
+ // 时间格式检测
925
+ if (!isEmpty(this.data.fields[index].value)) {
926
+
927
+ let dateReg = /^[1-9]\d{3}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])$/
928
+ let timeReg = /^(20|21|22|23|[0-1]\d):[0-5]\d:[0-5]\d$/
929
+ 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$/
930
+ if (this.data.fields[index].format) {
931
+ if (this.data.fields[index].format === 'yyyy-MM-dd') {
932
+ if (!dateReg.test(this.data.fields[index].value)) {
933
+ this.data.fields[index].value = ''
934
+ this.$showAlert(this.data.fields[index].label + '格式错误如:2021-01-01', 'warning', 2000)
935
+ }
936
+ }
937
+ if (this.data.fields[index].format === 'HH:mm:ss') {
938
+ if (!timeReg.test(this.data.fields[index].value)) {
939
+ this.data.fields[index].value = ''
940
+ this.$showAlert(this.data.fields[index].label + '格式错误如:00:00:00', 'warning', 2000)
941
+ }
942
+ }
943
+ if (this.data.fields[index].format === 'yyyy-MM-dd HH:mm:ss') {
944
+ if (!datetimeReg.test(this.data.fields[index].value)) {
945
+ this.data.fields[index].value = ''
946
+ this.$showAlert(this.data.fields[index].label + '格式错误如:2021-01-01 00:00:00', 'warning', 2000)
947
+ }
948
+ }
949
+ } else {
950
+ if (!dateReg.test(this.data.fields[index].value)) {
951
+ this.data.fields[index].value = ''
952
+ this.$showAlert(this.data.fields[index].label + '格式错误如:2021-01-01', 'warning', 2000)
953
+ }
954
+ }
955
+ }
956
+ }
957
+ },
958
+ events: {
959
+
960
+ }
961
+ }
962
+ </script>
963
+ <style>
964
+ .datepicker{
965
+ width: 100%!important;
966
+ }
967
+ .datepicker-input{
968
+ background-color: #ffffff!important;
969
+ width: 100%!important;
970
+ }
971
+ .datepicker-input:disabled{
972
+ border: 1px solid #DDD!important;
973
+ color: #ACA899!important;
974
+ width: 100%!important;
975
+ }
976
+ </style>
977
+ <style scoped>
978
+ th{
979
+ font-size: 15px !important;
980
+ text-align: center !important;
981
+ background-color: #dfedfb!important;
982
+ color: #666666 !important;
983
+ font-family: PINGFANG-BOLD !important;
984
+ font-weight: normal!important;
985
+ }
986
+ /*清除model中的浮动*/
987
+ .clearfix:after,.clearfix:before{
988
+ display: table;
989
+ }
990
+ .clearfix:after{
991
+ clear: both;
992
+ }
993
+
994
+ .input_view{
995
+ padding: 8px;
996
+ background-color: #ffffff;
997
+ border-radius: 2px;
998
+ border: solid 1px #c7c7c7!important;
999
+ color: #333333!important;
1000
+ font-size: 15px!important;
1001
+ }
1002
+
1003
+ .input_view[readonly]{
1004
+ border: 1px solid #DDD!important;
1005
+ color:#ACA899!important;
1006
+ }
1007
+ .input_view:disabled{
1008
+ border: 1px solid #DDD!important;
1009
+ color:#ACA899!important;
1010
+ }
1011
+
1012
+ .control-label-justify {
1013
+ display: inline-block;
1014
+ vertical-align: top;
1015
+ width: 110px;
1016
+ text-align: justify;
1017
+ font-family: PingFang-SC-Bold;
1018
+ }
1019
+
1020
+ .control-label-justify::after {
1021
+ content: "";
1022
+ display: inline-block;
1023
+ width: 100%;
1024
+ overflow: hidden;
1025
+ height: 0;
1026
+ }
1027
+
1028
+ input::-webkit-outer-spin-button,
1029
+ input::-webkit-inner-spin-button {
1030
+ -webkit-appearance: none;
1031
+ }
1032
+
1033
+ input[type="number"] {
1034
+ -moz-appearance: textfield;
1035
+ }
1036
+
1037
+ </style>