apply-clients 3.2.32 → 3.2.37

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 (37) hide show
  1. package/package.json +1 -1
  2. package/src/AndroidApp.vue +26 -26
  3. package/src/App.vue +20 -20
  4. package/src/apply.js +67 -67
  5. package/src/applyAndroid.js +24 -24
  6. package/src/components/Util.js +359 -359
  7. package/src/components/app_apply/AppOnetomany.vue +90 -90
  8. package/src/components/app_apply/AppServiceView.vue +664 -664
  9. package/src/components/app_apply/AppTakePic.vue +112 -112
  10. package/src/components/app_apply/Process/AppExplorationUser.vue +310 -310
  11. package/src/components/app_apply/Process/AppServiceControl.vue +409 -409
  12. package/src/components/app_apply/Process/Processes/AppInstallationDetails.vue +456 -456
  13. package/src/components/app_apply/Supervisory/AppProcessSupervisory.vue +300 -300
  14. package/src/components/app_apply/Supervisory/AppSupervisoryCart.vue +121 -121
  15. package/src/components/product/ApplyCharge/ApplyChargeList.vue +251 -251
  16. package/src/components/product/ApplyCharge/ApplyChargeReport.vue +107 -107
  17. package/src/components/product/ApplyCharge/ApplyChargeSearch.vue +30 -30
  18. package/src/components/product/Function/InstallFunction.vue +147 -147
  19. package/src/components/product/Function/InstallInfoSelect.vue +281 -281
  20. package/src/components/product/Function/Service/FunctionServiceControl.vue +245 -245
  21. package/src/components/product/Function/StopApplyCrrdList.vue +176 -176
  22. package/src/components/product/Function/functions/StopInstall.vue +106 -106
  23. package/src/components/product/Process/ExplorationSelect.vue +346 -346
  24. package/src/components/product/Process/ExplorationUser.vue +134 -134
  25. package/src/components/product/Process/Processes/InstallationDetails.vue +243 -233
  26. package/src/components/product/Process/Processes/addressAndUserinfoManagement.vue +201 -201
  27. package/src/components/product/Process/Processes/chargeManagement.vue +555 -555
  28. package/src/components/product/Process/Processes/printCharge.vue +133 -133
  29. package/src/components/product/Process/Processes/supplementalAgreement.vue +297 -297
  30. package/src/components/product/Process/ShowBackReason.vue +32 -32
  31. package/src/components/product/ServiceView.vue +759 -759
  32. package/src/components/product/Supervisory/Service/SupervisoryServiceControl.vue +199 -199
  33. package/src/components/product/Supervisory/SupervisoryControl.vue +119 -119
  34. package/src/components/product/Supervisory/SupervisoryList.vue +208 -208
  35. package/src/components/product/Supervisory/SupervisoryhCart.vue +103 -103
  36. package/src/components/product/VueUtils/ApplyUpload.vue +261 -261
  37. package/src/main.js +23 -23
@@ -1,759 +1,759 @@
1
- <template>
2
- <div class="select-overspread" style="background-color: #ffffff;padding: 20px;overflow: scroll">
3
- <validator name="v">
4
- <form class="form-horizontal">
5
- <div class="form-group">
6
- <div v-for="(index,item) in data.fields" style="">
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)"
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
- <span
27
- v-if="item.error&&item.error.msg&&item.error.flag"
28
- style="color: red">{{item.error.msg}}</span>
29
- </div>
30
- </div>
31
- <!--时间datepicker-->
32
- <div :style="item.style ? item.style+';height: 40px;margin-bottom: 20px':'height: 40px;margin-bottom: 20px'"
33
- v-if="item.type==='datepicker' && !item.hidden && (item.device === 'pc' || !item.device)"
34
- :class="[item.required && !(item.value) ? 'has-error' : '',item.bootstraped ? item.bootstraped+' form-group':'col-sm-4 form-group']">
35
- <label
36
- :class="item.label_bootstraped ? item.label_bootstraped+' control-label-justify control-label' : 'control-label control-label-justify col-sm-6'">{{item.label}}</label>
37
- <div :style="item.value_style ? item.value_style:''"
38
- :class="item.value_bootstraped ? item.value_bootstraped : 'col-sm-6'">
39
- <datepicker
40
- @change="onchange(index)"
41
- @blur="onblur(index)"
42
- :placeholder="item.placeholder"
43
- :value.sync="data.fields[index].value"
44
- :format="item.format ? item.format : 'yyyy-MM-dd'"
45
- v-model="data.fields[index].value"
46
- :readonly="item.readonly"
47
- :disabled="item.disabled"
48
- :show-reset-button="reset">
49
- </datepicker>
50
- </div>
51
- <span
52
- v-if="item.error&&item.error.msg&&item.error.flag"
53
- style="color: red">{{item.error.msg}}</span>
54
- </div>
55
-
56
- <!--textarea-->
57
- <div :style="item.style ? item.style+';height: 40px;margin-bottom: 20px':'height: 40px;margin-bottom: 20px'"
58
- v-if="item.type==='textarea' && !item.hidden && (item.device === 'pc' || !item.device)"
59
- :class="[item.required && !(item.value) ? 'has-error' : '',item.bootstraped?item.bootstraped+' form-group':'col-sm-12 form-group']">
60
- <label :style="item.label_style ? item.label_style : ''"
61
- :class="item.label_bootstraped ? item.label_bootstraped + ' control-label-justify control-label' : 'control-label-justify control-label col-sm-3'">{{item.label}}</label>
62
- <div :style="item.value_style ? item.value_style:''"
63
- :class="item.value_bootstraped ? item.value_bootstraped : 'col-sm-10'">
64
- <textarea
65
- :readonly="item.readonly"
66
- :disabled="item.disabled"
67
- class="form-control input_view"
68
- style="width: 100%;height: 100%"
69
- :rows="item.rows"
70
- v-model="data.fields[index].value"
71
- :value="data.fields[index].value"
72
- @change="onchange(index)"
73
- @blur="onblur(index)"
74
- @input="oninput(index)"
75
- >
76
- </textarea>
77
- </div>
78
- <span
79
- v-if="item.error&&item.error.msg&&item.error.flag"
80
- style="color: red">{{item.error.msg}}</span>
81
- </div>
82
-
83
- <!--radio-->
84
- <div :style="item.style ? item.style+';height: 40px;margin-bottom: 20px':'height: 40px;margin-bottom: 20px'"
85
- v-if="item.type==='radio' && !item.hidden && (item.device === 'pc' || !item.device)"
86
- :class="[item.required && !(item.value) ? 'has-error' : '',item.bootstraped?item.bootstraped+' form-group':'col-sm-12 form-group']">
87
- <label v-if="item.label"
88
- :class="item.label_bootstraped?item.label_bootstraped+' control-label-justify control-label':'control-label-justify control-label col-sm-2'">{{item.label}}</label>
89
- <div
90
- :style="item.value_style ? item.value_style:''"
91
- :class="item.value_bootstraped?item.value_bootstraped:item.items.length%2 == 0?'col-sm-5': 'col-sm-3'"
92
- v-for="(index2,row) in item.items">
93
- <label :for="row.label"
94
- :class="item.items.length%2 == 0?'col-sm-3 control-label': 'col-sm-2 control-label'">{{row.label}}</label>
95
- <input @blur="onblur(index)"
96
- :class="item.items.length%2 == 0?'col-sm-3 control-label': 'col-sm-2 control-label'"
97
- :readonly="item.readonly" :disabled="item.disabled" style="margin-top: 10px" type="radio"
98
- :name="index" :id="row.label" v-bind:value="data.fields[index].items[index2].value"
99
- v-model="data.fields[index].value">
100
- </div>
101
- <span
102
- v-if="item.error&&item.error.msg&&item.error.flag"
103
- style="color: red">{{item.error.msg}}</span>
104
- </div>
105
-
106
- <!--select-->
107
- <div :style="item.style ? item.style+';height: 40px;margin-bottom: 20px':'height: 40px;margin-bottom: 20px'"
108
- v-if="item.type==='select' && !item.hidden && (item.device === 'pc' || !item.device)"
109
- :class="[item.required && !(item.value) ? 'has-error' : '',item.bootstraped?item.bootstraped+' form-group':'col-sm-4 form-group']">
110
- <label
111
- :class="item.label_bootstraped ? item.label_bootstraped+' control-label control-label-justify':'control-label-justify control-label col-sm-6'">{{item.label}}</label>
112
- <div :style="item.value_style ? item.value_style:''"
113
- :class="item.value_bootstraped ? item.value_bootstraped : 'col-sm-6'">
114
- <input-select
115
- class="select select_list"
116
- @blur="onblur(index)"
117
- @change="onchange(index)"
118
- :readonly="item.readonly"
119
- :disable="item.disabled"
120
- :value.sync="data.fields[index].value"
121
- v-model="data.fields[index].value"
122
- :options='data.fields[index].options'
123
- :valueSingle="true"></input-select>
124
- </div>
125
- <span
126
- v-if="item.error&&item.error.msg&&item.error.flag"
127
- style="color: red">{{item.error.msg}}</span>
128
- </div>
129
-
130
- <!--checkbox-->
131
- <div :style="item.style ? item.style+';height: 40px;margin-bottom: 20px':'height: 40px;margin-bottom: 20px'"
132
- v-if="item.type==='checkbox' && !item.hidden && (item.device === 'pc' || !item.device)"
133
- :class="[item.required&&!(item.value) ? 'has-error' : '',item.bootstraped?item.bootstraped+' form-group':'col-sm-12 form-group']">
134
- <label v-if="item.label"
135
- :class="item.label_bootstraped?item.label_bootstraped+' control-label ':'control-label col-sm-2'">{{item.label}}</label>
136
- <div style="margin-top: 6px"
137
- :class="item.value_bootstraped?item.value_bootstraped:'control-label col-sm-2'"
138
- v-for="(index2,row) in item.items">
139
- <label class="font-size form-group col-sm-6">{{row.label}}</label>
140
- <input :readonly="item.readonly" :disabled="item.disabled" type="checkbox" class="col-sm-6"
141
- :id="row.label" v-model="data.fields[index].items[index2].value" @blur="onblur(index)" >
142
- </div>
143
- </div>
144
- </div>
145
- </div>
146
- <!-- onetomany -->
147
- <div class="" v-for="(i,item) in data.onetomany" style="overflow:auto;width:100%">
148
- <table v-show="!item.hidden" class="table table-bordered table-striped table-hover" style="white-space:nowrap">
149
- <tr>
150
- <th>序号</th>
151
- <th v-for="field in item.fields" v-if="!field.displayPosition || field.displayPosition === '*' || field.displayPosition === 'list'">
152
- <nobr>{{field.label}}</nobr>
153
- </th>
154
- <th v-if="!item.hiddenOperate">
155
- <button type="button" @click="add(i)" class="btn btn-info"
156
- v-if="showprint && !item.addHidden">
157
- <span v-if="item.addText === 'default' || !item.addText" class="glyphicon glyphicon-plus" aria-hidden="true"></span>
158
- <span v-else :style="item.addStyle">{{item.addText}}</span>
159
- </button>
160
- </th>
161
- </tr>
162
- <tr v-for="(j,row) in item.rows" style="">
163
- <td style="text-align: center">{{$index+1}}</td>
164
- <td v-for="key in item.fields" v-if="!key.displayPosition || key.displayPosition === '*' || key.displayPosition === 'list'" style="text-align: center">
165
- {{row[key.field]}}
166
- </td>
167
- <td style="text-align: center" v-if="!item.hiddenOperate">
168
- <span @click="update(i,j)" v-if="showprint && !item.updateHidden">
169
- <span v-if="item.updateText === 'default' || !item.updateText" class="glyphicon glyphicon-wrench" aria-hidden="true"></span>
170
- <span v-else :style="item.updateStyle">{{item.updateText}}</span>
171
- </span>
172
- <span @click="delete(i,j)" v-if="showprint && !item.deleteHidden" style="margin-left: 10px">
173
- <span v-if="item.deleteText === 'default' || !item.deleteText" class="glyphicon glyphicon-trash" aria-hidden="true"></span>
174
- <span v-else :style="item.deleteStyle">{{item.deleteText}}</span>
175
- </span>
176
- </td>
177
- </tr>
178
- </table>
179
- </div>
180
-
181
- <div v-for="(i,item) in data.components">
182
- <component v-if="item.device === 'pc' || !item.device" :is="item.name" :selectdata="data" :mark="item.mark"></component>
183
- </div>
184
-
185
- <!--自定义组件-->
186
- <slot></slot>
187
- <!--公司等属性-->
188
- <div class="col-sm-12 form-group text-center" style="padding-top:8px">
189
- <div class="col-sm-3 form-group center-block">
190
- <label class="col-sm-5">所属公司:</label>
191
- <div class="col-sm-6" style="text-align: left">
192
- {{model.f_filiale}}
193
- </div>
194
- </div>
195
- <div class="col-sm-3 form-group center-block">
196
- <label class="col-sm-5">部门:</label>
197
- <div class="col-sm-6" style="text-align: left">
198
- {{model.f_parentname}}
199
- </div>
200
- </div>
201
- <div class="col-sm-3 form-group center-block">
202
- <label class="col-sm-5">操作人:</label>
203
- <div class="col-sm-6 " style="text-align: left">
204
- {{model.f_operator}}
205
- </div>
206
- </div>
207
- <div class="col-sm-3 form-group center-block">
208
- <label class="col-sm-5">操作日期:</label>
209
- <div class="col-sm-6" style="text-align: left">
210
- {{model.f_operate_date}}
211
- </div>
212
- </div>
213
- </div>
214
-
215
- </form>
216
- </validator>
217
-
218
- <!-- 按钮组 -->
219
- <div class="from-group col-sm-12" style="margin-top: 20px;height: 100px">
220
- <center>
221
- <!-- 按钮组 -->
222
- <button v-for="(index,button) in data.buttons"
223
- :disabled="(button.button_name==='提交'||button.button_name==='下发')&&disable_button" type="button"
224
- @click="clicked(index,button)"
225
- :class="(button.button_name==='提交'||button.button_name==='下发')&&disable_button?'btn btn-default':'btn btn-primary'"
226
- v-if="!button.hidden"
227
- style="min-width:100px; margin-right:50px;">
228
- {{button.button_name}}
229
- </button>
230
- </center>
231
- </div>
232
-
233
- <!-- onetomany模态框 -->
234
- <modal v-if="show" :show.sync="show" backdrop="false" :large="modalSize === 'large' ? true : false" :small="modalSize === 'small' ? true : false">
235
- <header slot="modal-header" class="modal-header">
236
- <button type="button" class="close" @click="closemodal(modeltitle)"><span>&times;</span></button>
237
- <span class="modal-title"><font
238
- size="3">{{modeltitle}}</font></span>
239
- </header>
240
- <article slot="modal-body" class="modal-body clearfix">
241
- <div
242
- :class="[item.required&&!(item.value) ? 'has-error' : '',item.bootstraped?item.bootstraped:'col-sm-12']"
243
- v-for="(index,item) in data.onetomany[onetomany_index].fields" v-if="!item.displayPosition || item.displayPosition === '*' || item.displayPosition === 'from'">
244
- <label v-show="!item.hidden" :class="item.label_bootstraped ? item.label_bootstraped + ' control-label' : 'control-label col-sm-3'" style="margin-top: 10px">{{item.label}}:</label>
245
- <div :class="item.value_bootstraped ? item.value_bootstraped : 'col-sm-7'" v-show="!item.hidden">
246
- <!--时间datepicker-->
247
- <datepicker
248
- v-if="item.type=='datepicker'"
249
- @change="onchange_modal(index)"
250
- @blur="onblur_modal(index)"
251
- :placeholder="item.placeholder"
252
- :value.sync="data.onetomany[onetomany_index].fields[index].value"
253
- :format="'yyyy-MM-dd'"
254
- v-model="data.onetomany[onetomany_index].fields[index].value"
255
- :readonly="item.readonly"
256
- :disabled="item.disabled"
257
- :show-reset-button="reset">
258
- </datepicker>
259
- <!--select-->
260
- <input-select
261
- @change="onchange_modal(index)"
262
- v-if="item.type=='select'"
263
- @blur="onblur_modal(index)"
264
- :value.sync="data.onetomany[onetomany_index].fields[index].value"
265
- v-model="data.onetomany[onetomany_index].fields[index].value"
266
- :options='data.onetomany[onetomany_index].fields[index].options'>
267
- </input-select>
268
- <!-- input -->
269
- <input v-if="item.type==='input' || item.type==='number'||item.type === 'tel'||item.type === 'email'"
270
- class="form-control"
271
- :type="item.type"
272
- v-model="data.onetomany[onetomany_index].fields[index].value"
273
- :placeholder="item.placeholder"
274
- :value="data.onetomany[onetomany_index].fields[index].value"
275
- :readonly="item.readonly"
276
- :disabled="item.disabled"
277
- @change="onchange_modal(index)"
278
- @blur="onblur_modal(index)"
279
- @input="oninput_modal(index)"
280
- />
281
-
282
- <textarea
283
- v-if="item.type==='textarea'"
284
- :readonly="item.readonly"
285
- :disabled="item.disabled"
286
- class="form-control input_view"
287
- style="width: 100%;height: 100%"
288
- :rows="item.rows"
289
- v-model="data.onetomany[onetomany_index].fields[index].value"
290
- :value="data.onetomany[onetomany_index].fields[index].value"
291
- @change="onchange_modal(index)"
292
- @blur="onblur_modal(index)"
293
- @input="oninput_modal(index)"
294
- >
295
- </textarea>
296
- </div>
297
- </div>
298
- </article>
299
- <footer slot="modal-footer" class="modal-footer">
300
- <button :class="disable_button_onetomany?'btn btn-default':'btn btn-primary'"
301
- :disabled="disable_button_onetomany" type="button" @click="confirm_modal(modeltitle)">
302
- 确认
303
- </button>
304
- </footer>
305
- </modal>
306
-
307
- <!-- 按钮模态框 -->
308
- <modal v-if="showbutmodal" :show.sync="showbutmodal" v-ref:modal backdrop="false">
309
- <header slot="modal-header" class="modal-header">
310
- <button type="button" class="close" @click="closemodal('but')"><span>&times;</span></button>
311
- <h4 class="modal-title">{{model.button.button_name}}</h4>
312
- </header>
313
- <article slot="modal-body" class="modal-body">
314
- <div class="col-sm-12" v-for="(index,button) in data.buttons[model.button.button_index].button_fields">
315
- <label class="control-label col-sm-3" style="margin-top: 10px">{{button.label}}:</label>
316
- <div class="col-sm-7">
317
- <!--select-->
318
- <input-select v-if="button.type=='select'"
319
- :value.sync="data.buttons[model.button.button_index].button_fields[index].value"
320
- v-model="data.buttons[model.button.button_index].button_fields[index].value"
321
- :options='button.options'></input-select>
322
- <!-- input -->
323
- <input v-else type="text" class="form-control"
324
- v-model="data.buttons[model.button.button_index].button_fields[index].value"/>
325
- </div>
326
- </div>
327
- </article>
328
- <footer slot="modal-footer" style="border-top:none" class="modal-footer">
329
- <button type="button" class="btn btn-primary" :disabled="disable_button_but" @click='confirm_but_modal()'>确认</button>
330
- </footer>
331
- </modal>
332
- </div>
333
- </template>
334
- <script>
335
- import Vue from 'vue'
336
- // Date格式化
337
- Date.prototype.Format = function (fmt) {
338
- var o = {
339
- 'M+': this.getMonth() + 1, // 月份
340
- 'd+': this.getDate(), // 日
341
- 'H+': this.getHours(), // 小时
342
- 'm+': this.getMinutes(), // 分
343
- 's+': this.getSeconds(), // 秒
344
- 'q+': Math.floor((this.getMonth() + 3) / 3), // 季度
345
- 'S': this.getMilliseconds() // 毫秒
346
- }
347
- if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (this.getFullYear() + '').substr(4 - RegExp.$1.length))
348
- for (var k in o) {
349
- if (new RegExp('(' + k + ')').test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length === 1) ? (o[k]) : (('00' + o[k]).substr(('' + o[k]).length)))
350
- }
351
- return fmt
352
- }
353
-
354
- export default {
355
- title: '报建业务通用组件',
356
- props: {
357
- data: {
358
- type: Object
359
- },
360
- showprint: {
361
- type: Boolean,
362
- default: true
363
- }
364
- },
365
- data () {
366
- return {
367
- model: {}, // 公司等属性
368
- disable_button: true, // 控制按钮禁用
369
- show: false, // 控制onetomany模态框
370
- disable_button_onetomany: true, // 控制onetomany模态框按钮
371
- onetomany_index: null, // 当前选择的下标
372
- update_onetomany_index: null, // 当前需要修改的下标
373
- modeltitle: null, // 模态框标题
374
- modalSize: null, // 模态框大小
375
- showbutmodal: false,
376
- }
377
- },
378
- watch: {
379
- deep: true
380
- },
381
- computed: {
382
-
383
- },
384
- created () {
385
- // 初始化数据
386
- this.initializtion()
387
- this.$dispatch('initializtionView')
388
- },
389
- methods: {
390
- // 按钮模态框确定
391
- confirm_but_modal() {
392
- for (const item of this.data.buttons[this.model.button.button_index].button_fields) {
393
- this.model.button.button_fields[item.field] = item.value
394
- }
395
- this.showbutmodal = false
396
- this.disable_button_but = true
397
- this.$dispatch('button', this.model)
398
- },
399
- // 点击按钮组按钮
400
- async clicked(index, button) {
401
- this.disable_button = true
402
- // 组织model.fields数据
403
- for (const item of this.data.fields) {
404
- // checkbox特殊处理
405
- if (item.type === 'checkbox') {
406
- for (let j = 0; j < item.items.length; j++) {
407
- this.model[item.items[j].field] = item.items[j].value
408
- }
409
- } else {
410
- this.model[item.field] = item.value
411
- }
412
- }
413
- this.model.f_process_id = this.data.f_process_id
414
-
415
- // 初始化model.button数据
416
- let buttondatas = {
417
- button_fields: {}
418
- }
419
- buttondatas.button_name = button.button_name
420
- buttondatas.button_index = index
421
- if (button.button_fields) {
422
- for (const item of button.button_fields) {
423
- buttondatas.button_fields[item.field] = item.value
424
- }
425
- }
426
- this.model.button = buttondatas
427
- this.model.title = this.data.title
428
- this.model.fields = this.data.fields
429
- this.model.onetomany = this.data.onetomany
430
-
431
-
432
- if (button.button_name === '退回') {
433
- this.showbutmodal = true
434
- } else if (button.button_name === '下发') {
435
- this.showbutmodal = true
436
- } else {
437
- this.$dispatch('button', this.model)
438
- }
439
- },
440
- // 初始化数据
441
- initializtion () {
442
- // 是否禁用按钮
443
- this.disableButton()
444
-
445
- // 公司等属性初始化
446
- if (this.data.filiale) {
447
- this.model.f_filiale = this.data.filiale
448
- } else {
449
- this.model.f_filiale = this.$login.f.orgs
450
- }
451
- if (this.data.f_parentname) {
452
- this.model.f_parentname = this.data.f_parentname
453
- } else {
454
- this.model.f_parentname = this.$login.f.f_department_name
455
- }
456
- if (this.data.operate_date) {
457
- this.model.f_operate_date = this.data.operate_date
458
- } else {
459
- this.model.f_operate_date = new Date().Format('yyyy-MM-dd')
460
- }
461
- if (this.data.operator) {
462
- this.model.f_operator = this.data.operator
463
- } else {
464
- this.model.f_operator = this.$login.f.name
465
- }
466
- },
467
- // 是否禁用按钮
468
- disableButton () {
469
- let fields = this.data.fields
470
-
471
- let flag = false
472
- for (const item of fields) {
473
- if (item.type !== 'checkbox' && item.required && !item.value) {
474
- if (item.value === 0) {
475
- flag = false
476
- } else {
477
- flag = true
478
- }
479
- }
480
- // 任何选择框只要是否都不能提交
481
- if (item.type === 'select' && item.value === '否' && item.disabledButton) {
482
- flag = true
483
- }
484
- }
485
-
486
- let count = 0
487
- for (const item of fields) {
488
- if (item.type !== 'checkbox' && item.required) {
489
- count++
490
- }
491
- }
492
- if (count === 0) {
493
- flag = false
494
- }
495
-
496
- this.disable_button = flag
497
- },
498
- // 失去焦点触发,无论值是否发生变化
499
- onblur (index) {
500
- // 是否禁用按钮
501
- this.disableButton()
502
-
503
- this.$dispatch('onblur', index)
504
- // 如果有错误信息提示走错误信息判断处理
505
-
506
- if (this.data.fields[index].error || this.data.fields[index].type === 'datepicker') {
507
- this.$dispatch('error_check', index)
508
- }
509
- },
510
- // 失去焦点且值最终发生变化触发
511
- async onchange (index) {
512
- // 是否禁用按钮
513
- this.disableButton()
514
-
515
- this.data.fields[index].value = this.data.fields[index].value.trim()
516
-
517
- if (this.data.fields[index].prefix && this.data.fields[index].value !== '') {
518
- this.data.fields[index].value = this.data.fields[index].prefix + this.data.fields[index].value
519
- }
520
-
521
- this.data[this.data.fields[index].field] = this.data.fields[index].value
522
-
523
- await this.$dispatch('onchange', index)
524
-
525
- // 如果有错误信息提示走错误信息判断处理
526
- if (this.data.fields[index].error || this.data.fields[index].type === 'datepicker') {
527
- this.$dispatch('error_check', index)
528
- }
529
- },
530
- oninput (index) {
531
- // 是否禁用按钮
532
- this.disableButton()
533
-
534
- this.$dispatch('oninput', index)
535
-
536
- // 如果有错误信息提示走错误信息判断处理
537
- if (this.data.fields[index].error || this.data.fields[index].type === 'datepicker') {
538
- this.$dispatch('error_check', index)
539
- }
540
- },
541
- // 模态框确认按钮
542
- confirm_modal (title) {
543
- if (title === '新增') {
544
- if (this.data.onetomany[this.onetomany_index].addEvent === 'default' || !this.data.onetomany[this.onetomany_index].addEvent) {
545
- this.$dispatch('onetomanyadd', this.onetomany_index)
546
- } else {
547
- this.$dispatch(this.data.onetomany[this.onetomany_index].addEvent, this.onetomany_index)
548
- }
549
- } else {
550
- if (this.data.onetomany[this.onetomany_index].updateEvent === 'default' || !this.data.onetomany[this.onetomany_index].updateEvent) {
551
- this.$dispatch('onetomanyupdate', this.onetomany_index, this.update_onetomany_index)
552
- } else {
553
- this.$dispatch(this.data.onetomany[this.onetomany_index].updateEvent, this.onetomany_index, this.update_onetomany_index)
554
- }
555
- }
556
-
557
- this.closemodal()
558
- },
559
- // 删除
560
- delete (i, j) {
561
- this.$showMessage((this.data.onetomany[i].deleteMessage === 'default' || !this.data.onetomany[i].deleteMessage) ? '您确定要删除这条记录吗?' : this.data.onetomany[i].deleteMessage, ['confirm']).then((res) => {
562
- if (res === 'confirm') {
563
- if (this.data.onetomany[i].deleteEvent === 'default' || !this.data.onetomany[i].deleteEvent) {
564
- this.$dispatch('onetomanydelete', i, j)
565
- } else {
566
- this.$dispatch(this.data.onetomany[i].deleteEvent, i, j)
567
- }
568
- }
569
- })
570
- },
571
- // 修改
572
- update (i, j) {
573
- let onetomany = this.data.onetomany[i]
574
- let item = this.data.onetomany[i].rows[j]
575
- let count = 0
576
- for (let k = 0; k < onetomany.fields.length; k++) {
577
- // 防止初始化的时候没有value
578
- Vue.set(this.data.onetomany[i].fields[k], 'value', item[this.data.onetomany[i].fields[k].field])
579
-
580
- if (onetomany.fields[j].required) {
581
- count++
582
- }
583
- }
584
- if (count === 0) {
585
- this.disable_button_onetomany = false
586
- }
587
- this.modeltitle = '修改'
588
- this.modalSize = this.data.onetomany[i].modalSize
589
- this.onetomany_index = i
590
- this.update_onetomany_index = j
591
-
592
- this.$dispatch('openUpdateModel',i,j)
593
-
594
- this.show = true
595
- },
596
- // 添加
597
- add (index) {
598
- let count = 0
599
- for (const item of this.data.onetomany[index].fields) {
600
- if (item.type === 'datepicker' && !item.value && item.default) {
601
- item.value = new Date().Format('yyyy-MM-dd')
602
- }
603
- if (item.required) {
604
- count++
605
- }
606
- }
607
-
608
- if (count === 0) {
609
- this.disable_button_onetomany = false
610
- }
611
- this.modeltitle = '新增'
612
- this.modalSize = this.data.onetomany[index].modalSize
613
- this.onetomany_index = index
614
-
615
- this.$dispatch('openAddModel',index)
616
-
617
- this.show = true
618
- },
619
- // 关闭模态框
620
- closemodal (val) {
621
- if (val === 'but'){
622
- this.disableButton()
623
- this.showbutmodal = false
624
- return
625
- }
626
- for (const item of this.data.onetomany[this.onetomany_index].fields) {
627
- item.value = ''
628
- }
629
- this.show = false
630
- this.disable_button_onetomany = true
631
- this.onetomany_index = null
632
- this.update_onetomany_index = null
633
- this.modeltitle = null
634
- this.modalSize = null
635
- },
636
- // 是否禁用模态框按钮
637
- disableModalButton () {
638
- let fields = this.data.onetomany[this.onetomany_index].fields
639
-
640
- let flag = false
641
- for (const item of fields) {
642
- if (item.type !== 'checkbox' && item.required && !item.value) {
643
- if (item.value === 0) {
644
- flag = false
645
- } else {
646
- flag = true
647
- }
648
- }
649
- }
650
-
651
- let count = 0
652
- for (const item of fields) {
653
- if (item.type !== 'checkbox' && item.required) {
654
- count++
655
- }
656
- }
657
- if (count === 0) {
658
- flag = false
659
- }
660
- this.disable_button_onetomany = flag
661
- },
662
- // 监听模态框属性失去焦点
663
- onchange_modal (index) {
664
- this.disableModalButton()
665
- this.$dispatch('onchange_modal', this.onetomany_index, index)
666
- },
667
- // 监听模态框属性失去焦点
668
- onblur_modal (index) {
669
- this.disableModalButton()
670
- this.$dispatch('onblur_modal', this.onetomany_index, index)
671
- },
672
- // input输入属性值发生变化监听
673
- oninput_modal (index) {
674
- this.disableModalButton()
675
- this.$dispatch('oninput_modal', this.onetomany_index, index)
676
- }
677
- },
678
- events: {
679
-
680
- }
681
- }
682
- </script>
683
- <style>
684
- .datepicker{
685
- width: 100%!important;
686
- }
687
- .datepicker-input{
688
- background-color: #ffffff!important;
689
- width: 100%!important;
690
- }
691
- .datepicker-input:disabled{
692
- border: 1px solid #DDD!important;
693
- color: #ACA899!important;
694
- width: 100%!important;
695
- }
696
- </style>
697
- <style scoped>
698
- th{
699
- font-size: 15px !important;
700
- text-align: center !important;
701
- background-color: #dfedfb!important;
702
- color: #666666 !important;
703
- font-family: PINGFANG-BOLD !important;
704
- font-weight: normal!important;
705
- }
706
- /*清除model中的浮动*/
707
- .clearfix:after,.clearfix:before{
708
- display: table;
709
- }
710
- .clearfix:after{
711
- clear: both;
712
- }
713
-
714
- .input_view{
715
- padding: 8px;
716
- background-color: #ffffff;
717
- border-radius: 2px;
718
- border: solid 1px #c7c7c7!important;
719
- color: #333333!important;
720
- font-size: 15px!important;
721
- }
722
-
723
- .input_view[readonly]{
724
- border: 1px solid #DDD!important;
725
- /*background-color: #F5F5F5;*/
726
- color:#ACA899!important;
727
- }
728
- .input_view:disabled{
729
- border: 1px solid #DDD!important;
730
- /*background-color: #F5F5F5;*/
731
- color:#ACA899!important;
732
- }
733
-
734
- .control-label-justify {
735
- display: inline-block;
736
- vertical-align: top;
737
- width: 110px;
738
- text-align: justify;
739
- font-family: PingFang-SC-Bold;
740
- }
741
-
742
- .control-label-justify::after {
743
- content: "";
744
- display: inline-block;
745
- width: 70px;
746
- overflow: hidden;
747
- height: 0;
748
- }
749
-
750
- input::-webkit-outer-spin-button,
751
- input::-webkit-inner-spin-button {
752
- -webkit-appearance: none;
753
- }
754
-
755
- input[type="number"] {
756
- -moz-appearance: textfield;
757
- }
758
-
759
- </style>
1
+ <template>
2
+ <div class="select-overspread" style="background-color: #ffffff;padding: 20px;overflow: scroll">
3
+ <validator name="v">
4
+ <form class="form-horizontal">
5
+ <div class="form-group">
6
+ <div v-for="(index,item) in data.fields" style="">
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)"
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
+ <span
27
+ v-if="item.error&&item.error.msg&&item.error.flag"
28
+ style="color: red">{{item.error.msg}}</span>
29
+ </div>
30
+ </div>
31
+ <!--时间datepicker-->
32
+ <div :style="item.style ? item.style+';height: 40px;margin-bottom: 20px':'height: 40px;margin-bottom: 20px'"
33
+ v-if="item.type==='datepicker' && !item.hidden && (item.device === 'pc' || !item.device)"
34
+ :class="[item.required && !(item.value) ? 'has-error' : '',item.bootstraped ? item.bootstraped+' form-group':'col-sm-4 form-group']">
35
+ <label
36
+ :class="item.label_bootstraped ? item.label_bootstraped+' control-label-justify control-label' : 'control-label control-label-justify col-sm-6'">{{item.label}}</label>
37
+ <div :style="item.value_style ? item.value_style:''"
38
+ :class="item.value_bootstraped ? item.value_bootstraped : 'col-sm-6'">
39
+ <datepicker
40
+ @change="onchange(index)"
41
+ @blur="onblur(index)"
42
+ :placeholder="item.placeholder"
43
+ :value.sync="data.fields[index].value"
44
+ :format="item.format ? item.format : 'yyyy-MM-dd'"
45
+ v-model="data.fields[index].value"
46
+ :readonly="item.readonly"
47
+ :disabled="item.disabled"
48
+ :show-reset-button="reset">
49
+ </datepicker>
50
+ </div>
51
+ <span
52
+ v-if="item.error&&item.error.msg&&item.error.flag"
53
+ style="color: red">{{item.error.msg}}</span>
54
+ </div>
55
+
56
+ <!--textarea-->
57
+ <div :style="item.style ? item.style+';height: 40px;margin-bottom: 20px':'height: 40px;margin-bottom: 20px'"
58
+ v-if="item.type==='textarea' && !item.hidden && (item.device === 'pc' || !item.device)"
59
+ :class="[item.required && !(item.value) ? 'has-error' : '',item.bootstraped?item.bootstraped+' form-group':'col-sm-12 form-group']">
60
+ <label :style="item.label_style ? item.label_style : ''"
61
+ :class="item.label_bootstraped ? item.label_bootstraped + ' control-label-justify control-label' : 'control-label-justify control-label col-sm-3'">{{item.label}}</label>
62
+ <div :style="item.value_style ? item.value_style:''"
63
+ :class="item.value_bootstraped ? item.value_bootstraped : 'col-sm-10'">
64
+ <textarea
65
+ :readonly="item.readonly"
66
+ :disabled="item.disabled"
67
+ class="form-control input_view"
68
+ style="width: 100%;height: 100%"
69
+ :rows="item.rows"
70
+ v-model="data.fields[index].value"
71
+ :value="data.fields[index].value"
72
+ @change="onchange(index)"
73
+ @blur="onblur(index)"
74
+ @input="oninput(index)"
75
+ >
76
+ </textarea>
77
+ </div>
78
+ <span
79
+ v-if="item.error&&item.error.msg&&item.error.flag"
80
+ style="color: red">{{item.error.msg}}</span>
81
+ </div>
82
+
83
+ <!--radio-->
84
+ <div :style="item.style ? item.style+';height: 40px;margin-bottom: 20px':'height: 40px;margin-bottom: 20px'"
85
+ v-if="item.type==='radio' && !item.hidden && (item.device === 'pc' || !item.device)"
86
+ :class="[item.required && !(item.value) ? 'has-error' : '',item.bootstraped?item.bootstraped+' form-group':'col-sm-12 form-group']">
87
+ <label v-if="item.label"
88
+ :class="item.label_bootstraped?item.label_bootstraped+' control-label-justify control-label':'control-label-justify control-label col-sm-2'">{{item.label}}</label>
89
+ <div
90
+ :style="item.value_style ? item.value_style:''"
91
+ :class="item.value_bootstraped?item.value_bootstraped:item.items.length%2 == 0?'col-sm-5': 'col-sm-3'"
92
+ v-for="(index2,row) in item.items">
93
+ <label :for="row.label"
94
+ :class="item.items.length%2 == 0?'col-sm-3 control-label': 'col-sm-2 control-label'">{{row.label}}</label>
95
+ <input @blur="onblur(index)"
96
+ :class="item.items.length%2 == 0?'col-sm-3 control-label': 'col-sm-2 control-label'"
97
+ :readonly="item.readonly" :disabled="item.disabled" style="margin-top: 10px" type="radio"
98
+ :name="index" :id="row.label" v-bind:value="data.fields[index].items[index2].value"
99
+ v-model="data.fields[index].value">
100
+ </div>
101
+ <span
102
+ v-if="item.error&&item.error.msg&&item.error.flag"
103
+ style="color: red">{{item.error.msg}}</span>
104
+ </div>
105
+
106
+ <!--select-->
107
+ <div :style="item.style ? item.style+';height: 40px;margin-bottom: 20px':'height: 40px;margin-bottom: 20px'"
108
+ v-if="item.type==='select' && !item.hidden && (item.device === 'pc' || !item.device)"
109
+ :class="[item.required && !(item.value) ? 'has-error' : '',item.bootstraped?item.bootstraped+' form-group':'col-sm-4 form-group']">
110
+ <label
111
+ :class="item.label_bootstraped ? item.label_bootstraped+' control-label control-label-justify':'control-label-justify control-label col-sm-6'">{{item.label}}</label>
112
+ <div :style="item.value_style ? item.value_style:''"
113
+ :class="item.value_bootstraped ? item.value_bootstraped : 'col-sm-6'">
114
+ <input-select
115
+ class="select select_list"
116
+ @blur="onblur(index)"
117
+ @change="onchange(index)"
118
+ :readonly="item.readonly"
119
+ :disable="item.disabled"
120
+ :value.sync="data.fields[index].value"
121
+ v-model="data.fields[index].value"
122
+ :options='data.fields[index].options'
123
+ :valueSingle="true"></input-select>
124
+ </div>
125
+ <span
126
+ v-if="item.error&&item.error.msg&&item.error.flag"
127
+ style="color: red">{{item.error.msg}}</span>
128
+ </div>
129
+
130
+ <!--checkbox-->
131
+ <div :style="item.style ? item.style+';height: 40px;margin-bottom: 20px':'height: 40px;margin-bottom: 20px'"
132
+ v-if="item.type==='checkbox' && !item.hidden && (item.device === 'pc' || !item.device)"
133
+ :class="[item.required&&!(item.value) ? 'has-error' : '',item.bootstraped?item.bootstraped+' form-group':'col-sm-12 form-group']">
134
+ <label v-if="item.label"
135
+ :class="item.label_bootstraped?item.label_bootstraped+' control-label ':'control-label col-sm-2'">{{item.label}}</label>
136
+ <div style="margin-top: 6px"
137
+ :class="item.value_bootstraped?item.value_bootstraped:'control-label col-sm-2'"
138
+ v-for="(index2,row) in item.items">
139
+ <label class="font-size form-group col-sm-6">{{row.label}}</label>
140
+ <input :readonly="item.readonly" :disabled="item.disabled" type="checkbox" class="col-sm-6"
141
+ :id="row.label" v-model="data.fields[index].items[index2].value" @blur="onblur(index)" >
142
+ </div>
143
+ </div>
144
+ </div>
145
+ </div>
146
+ <!-- onetomany -->
147
+ <div class="" v-for="(i,item) in data.onetomany" style="overflow:auto;width:100%">
148
+ <table v-show="!item.hidden" class="table table-bordered table-striped table-hover" style="white-space:nowrap">
149
+ <tr>
150
+ <th>序号</th>
151
+ <th v-for="field in item.fields" v-if="!field.displayPosition || field.displayPosition === '*' || field.displayPosition === 'list'">
152
+ <nobr>{{field.label}}</nobr>
153
+ </th>
154
+ <th v-if="!item.hiddenOperate">
155
+ <button type="button" @click="add(i)" class="btn btn-info"
156
+ v-if="showprint && !item.addHidden">
157
+ <span v-if="item.addText === 'default' || !item.addText" class="glyphicon glyphicon-plus" aria-hidden="true"></span>
158
+ <span v-else :style="item.addStyle">{{item.addText}}</span>
159
+ </button>
160
+ </th>
161
+ </tr>
162
+ <tr v-for="(j,row) in item.rows" style="">
163
+ <td style="text-align: center">{{$index+1}}</td>
164
+ <td v-for="key in item.fields" v-if="!key.displayPosition || key.displayPosition === '*' || key.displayPosition === 'list'" style="text-align: center">
165
+ {{row[key.field]}}
166
+ </td>
167
+ <td style="text-align: center" v-if="!item.hiddenOperate">
168
+ <span @click="update(i,j)" v-if="showprint && !item.updateHidden">
169
+ <span v-if="item.updateText === 'default' || !item.updateText" class="glyphicon glyphicon-wrench" aria-hidden="true"></span>
170
+ <span v-else :style="item.updateStyle">{{item.updateText}}</span>
171
+ </span>
172
+ <span @click="delete(i,j)" v-if="showprint && !item.deleteHidden" style="margin-left: 10px">
173
+ <span v-if="item.deleteText === 'default' || !item.deleteText" class="glyphicon glyphicon-trash" aria-hidden="true"></span>
174
+ <span v-else :style="item.deleteStyle">{{item.deleteText}}</span>
175
+ </span>
176
+ </td>
177
+ </tr>
178
+ </table>
179
+ </div>
180
+
181
+ <div v-for="(i,item) in data.components">
182
+ <component v-if="item.device === 'pc' || !item.device" :is="item.name" :selectdata="data" :mark="item.mark"></component>
183
+ </div>
184
+
185
+ <!--自定义组件-->
186
+ <slot></slot>
187
+ <!--公司等属性-->
188
+ <div class="col-sm-12 form-group text-center" style="padding-top:8px">
189
+ <div class="col-sm-3 form-group center-block">
190
+ <label class="col-sm-5">所属公司:</label>
191
+ <div class="col-sm-6" style="text-align: left">
192
+ {{model.f_filiale}}
193
+ </div>
194
+ </div>
195
+ <div class="col-sm-3 form-group center-block">
196
+ <label class="col-sm-5">部门:</label>
197
+ <div class="col-sm-6" style="text-align: left">
198
+ {{model.f_parentname}}
199
+ </div>
200
+ </div>
201
+ <div class="col-sm-3 form-group center-block">
202
+ <label class="col-sm-5">操作人:</label>
203
+ <div class="col-sm-6 " style="text-align: left">
204
+ {{model.f_operator}}
205
+ </div>
206
+ </div>
207
+ <div class="col-sm-3 form-group center-block">
208
+ <label class="col-sm-5">操作日期:</label>
209
+ <div class="col-sm-6" style="text-align: left">
210
+ {{model.f_operate_date}}
211
+ </div>
212
+ </div>
213
+ </div>
214
+
215
+ </form>
216
+ </validator>
217
+
218
+ <!-- 按钮组 -->
219
+ <div class="from-group col-sm-12" style="margin-top: 20px;height: 100px">
220
+ <center>
221
+ <!-- 按钮组 -->
222
+ <button v-for="(index,button) in data.buttons"
223
+ :disabled="(button.button_name==='提交'||button.button_name==='下发')&&disable_button" type="button"
224
+ @click="clicked(index,button)"
225
+ :class="(button.button_name==='提交'||button.button_name==='下发')&&disable_button?'btn btn-default':'btn btn-primary'"
226
+ v-if="!button.hidden"
227
+ style="min-width:100px; margin-right:50px;">
228
+ {{button.button_name}}
229
+ </button>
230
+ </center>
231
+ </div>
232
+
233
+ <!-- onetomany模态框 -->
234
+ <modal v-if="show" :show.sync="show" backdrop="false" :large="modalSize === 'large' ? true : false" :small="modalSize === 'small' ? true : false">
235
+ <header slot="modal-header" class="modal-header">
236
+ <button type="button" class="close" @click="closemodal(modeltitle)"><span>&times;</span></button>
237
+ <span class="modal-title"><font
238
+ size="3">{{modeltitle}}</font></span>
239
+ </header>
240
+ <article slot="modal-body" class="modal-body clearfix">
241
+ <div
242
+ :class="[item.required&&!(item.value) ? 'has-error' : '',item.bootstraped?item.bootstraped:'col-sm-12']"
243
+ v-for="(index,item) in data.onetomany[onetomany_index].fields" v-if="!item.displayPosition || item.displayPosition === '*' || item.displayPosition === 'from'">
244
+ <label v-show="!item.hidden" :class="item.label_bootstraped ? item.label_bootstraped + ' control-label' : 'control-label col-sm-3'" style="margin-top: 10px">{{item.label}}:</label>
245
+ <div :class="item.value_bootstraped ? item.value_bootstraped : 'col-sm-7'" v-show="!item.hidden">
246
+ <!--时间datepicker-->
247
+ <datepicker
248
+ v-if="item.type=='datepicker'"
249
+ @change="onchange_modal(index)"
250
+ @blur="onblur_modal(index)"
251
+ :placeholder="item.placeholder"
252
+ :value.sync="data.onetomany[onetomany_index].fields[index].value"
253
+ :format="'yyyy-MM-dd'"
254
+ v-model="data.onetomany[onetomany_index].fields[index].value"
255
+ :readonly="item.readonly"
256
+ :disabled="item.disabled"
257
+ :show-reset-button="reset">
258
+ </datepicker>
259
+ <!--select-->
260
+ <input-select
261
+ @change="onchange_modal(index)"
262
+ v-if="item.type=='select'"
263
+ @blur="onblur_modal(index)"
264
+ :value.sync="data.onetomany[onetomany_index].fields[index].value"
265
+ v-model="data.onetomany[onetomany_index].fields[index].value"
266
+ :options='data.onetomany[onetomany_index].fields[index].options'>
267
+ </input-select>
268
+ <!-- input -->
269
+ <input v-if="item.type==='input' || item.type==='number'||item.type === 'tel'||item.type === 'email'"
270
+ class="form-control"
271
+ :type="item.type"
272
+ v-model="data.onetomany[onetomany_index].fields[index].value"
273
+ :placeholder="item.placeholder"
274
+ :value="data.onetomany[onetomany_index].fields[index].value"
275
+ :readonly="item.readonly"
276
+ :disabled="item.disabled"
277
+ @change="onchange_modal(index)"
278
+ @blur="onblur_modal(index)"
279
+ @input="oninput_modal(index)"
280
+ />
281
+
282
+ <textarea
283
+ v-if="item.type==='textarea'"
284
+ :readonly="item.readonly"
285
+ :disabled="item.disabled"
286
+ class="form-control input_view"
287
+ style="width: 100%;height: 100%"
288
+ :rows="item.rows"
289
+ v-model="data.onetomany[onetomany_index].fields[index].value"
290
+ :value="data.onetomany[onetomany_index].fields[index].value"
291
+ @change="onchange_modal(index)"
292
+ @blur="onblur_modal(index)"
293
+ @input="oninput_modal(index)"
294
+ >
295
+ </textarea>
296
+ </div>
297
+ </div>
298
+ </article>
299
+ <footer slot="modal-footer" class="modal-footer">
300
+ <button :class="disable_button_onetomany?'btn btn-default':'btn btn-primary'"
301
+ :disabled="disable_button_onetomany" type="button" @click="confirm_modal(modeltitle)">
302
+ 确认
303
+ </button>
304
+ </footer>
305
+ </modal>
306
+
307
+ <!-- 按钮模态框 -->
308
+ <modal v-if="showbutmodal" :show.sync="showbutmodal" v-ref:modal backdrop="false">
309
+ <header slot="modal-header" class="modal-header">
310
+ <button type="button" class="close" @click="closemodal('but')"><span>&times;</span></button>
311
+ <h4 class="modal-title">{{model.button.button_name}}</h4>
312
+ </header>
313
+ <article slot="modal-body" class="modal-body">
314
+ <div class="col-sm-12" v-for="(index,button) in data.buttons[model.button.button_index].button_fields">
315
+ <label class="control-label col-sm-3" style="margin-top: 10px">{{button.label}}:</label>
316
+ <div class="col-sm-7">
317
+ <!--select-->
318
+ <input-select v-if="button.type=='select'"
319
+ :value.sync="data.buttons[model.button.button_index].button_fields[index].value"
320
+ v-model="data.buttons[model.button.button_index].button_fields[index].value"
321
+ :options='button.options'></input-select>
322
+ <!-- input -->
323
+ <input v-else type="text" class="form-control"
324
+ v-model="data.buttons[model.button.button_index].button_fields[index].value"/>
325
+ </div>
326
+ </div>
327
+ </article>
328
+ <footer slot="modal-footer" style="border-top:none" class="modal-footer">
329
+ <button type="button" class="btn btn-primary" :disabled="disable_button_but" @click='confirm_but_modal()'>确认</button>
330
+ </footer>
331
+ </modal>
332
+ </div>
333
+ </template>
334
+ <script>
335
+ import Vue from 'vue'
336
+ // Date格式化
337
+ Date.prototype.Format = function (fmt) {
338
+ var o = {
339
+ 'M+': this.getMonth() + 1, // 月份
340
+ 'd+': this.getDate(), // 日
341
+ 'H+': this.getHours(), // 小时
342
+ 'm+': this.getMinutes(), // 分
343
+ 's+': this.getSeconds(), // 秒
344
+ 'q+': Math.floor((this.getMonth() + 3) / 3), // 季度
345
+ 'S': this.getMilliseconds() // 毫秒
346
+ }
347
+ if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (this.getFullYear() + '').substr(4 - RegExp.$1.length))
348
+ for (var k in o) {
349
+ if (new RegExp('(' + k + ')').test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length === 1) ? (o[k]) : (('00' + o[k]).substr(('' + o[k]).length)))
350
+ }
351
+ return fmt
352
+ }
353
+
354
+ export default {
355
+ title: '报建业务通用组件',
356
+ props: {
357
+ data: {
358
+ type: Object
359
+ },
360
+ showprint: {
361
+ type: Boolean,
362
+ default: true
363
+ }
364
+ },
365
+ data () {
366
+ return {
367
+ model: {}, // 公司等属性
368
+ disable_button: true, // 控制按钮禁用
369
+ show: false, // 控制onetomany模态框
370
+ disable_button_onetomany: true, // 控制onetomany模态框按钮
371
+ onetomany_index: null, // 当前选择的下标
372
+ update_onetomany_index: null, // 当前需要修改的下标
373
+ modeltitle: null, // 模态框标题
374
+ modalSize: null, // 模态框大小
375
+ showbutmodal: false,
376
+ }
377
+ },
378
+ watch: {
379
+ deep: true
380
+ },
381
+ computed: {
382
+
383
+ },
384
+ created () {
385
+ // 初始化数据
386
+ this.initializtion()
387
+ this.$dispatch('initializtionView')
388
+ },
389
+ methods: {
390
+ // 按钮模态框确定
391
+ confirm_but_modal() {
392
+ for (const item of this.data.buttons[this.model.button.button_index].button_fields) {
393
+ this.model.button.button_fields[item.field] = item.value
394
+ }
395
+ this.showbutmodal = false
396
+ this.disable_button_but = true
397
+ this.$dispatch('button', this.model)
398
+ },
399
+ // 点击按钮组按钮
400
+ async clicked(index, button) {
401
+ this.disable_button = true
402
+ // 组织model.fields数据
403
+ for (const item of this.data.fields) {
404
+ // checkbox特殊处理
405
+ if (item.type === 'checkbox') {
406
+ for (let j = 0; j < item.items.length; j++) {
407
+ this.model[item.items[j].field] = item.items[j].value
408
+ }
409
+ } else {
410
+ this.model[item.field] = item.value
411
+ }
412
+ }
413
+ this.model.f_process_id = this.data.f_process_id
414
+
415
+ // 初始化model.button数据
416
+ let buttondatas = {
417
+ button_fields: {}
418
+ }
419
+ buttondatas.button_name = button.button_name
420
+ buttondatas.button_index = index
421
+ if (button.button_fields) {
422
+ for (const item of button.button_fields) {
423
+ buttondatas.button_fields[item.field] = item.value
424
+ }
425
+ }
426
+ this.model.button = buttondatas
427
+ this.model.title = this.data.title
428
+ this.model.fields = this.data.fields
429
+ this.model.onetomany = this.data.onetomany
430
+
431
+
432
+ if (button.button_name === '退回') {
433
+ this.showbutmodal = true
434
+ } else if (button.button_name === '下发') {
435
+ this.showbutmodal = true
436
+ } else {
437
+ this.$dispatch('button', this.model)
438
+ }
439
+ },
440
+ // 初始化数据
441
+ initializtion () {
442
+ // 是否禁用按钮
443
+ this.disableButton()
444
+
445
+ // 公司等属性初始化
446
+ if (this.data.filiale) {
447
+ this.model.f_filiale = this.data.filiale
448
+ } else {
449
+ this.model.f_filiale = this.$login.f.orgs
450
+ }
451
+ if (this.data.f_parentname) {
452
+ this.model.f_parentname = this.data.f_parentname
453
+ } else {
454
+ this.model.f_parentname = this.$login.f.f_department_name
455
+ }
456
+ if (this.data.operate_date) {
457
+ this.model.f_operate_date = this.data.operate_date
458
+ } else {
459
+ this.model.f_operate_date = new Date().Format('yyyy-MM-dd')
460
+ }
461
+ if (this.data.operator) {
462
+ this.model.f_operator = this.data.operator
463
+ } else {
464
+ this.model.f_operator = this.$login.f.name
465
+ }
466
+ },
467
+ // 是否禁用按钮
468
+ disableButton () {
469
+ let fields = this.data.fields
470
+
471
+ let flag = false
472
+ for (const item of fields) {
473
+ if (item.type !== 'checkbox' && item.required && !item.value) {
474
+ if (item.value === 0) {
475
+ flag = false
476
+ } else {
477
+ flag = true
478
+ }
479
+ }
480
+ // 任何选择框只要是否都不能提交
481
+ if (item.type === 'select' && item.value === '否' && item.disabledButton) {
482
+ flag = true
483
+ }
484
+ }
485
+
486
+ let count = 0
487
+ for (const item of fields) {
488
+ if (item.type !== 'checkbox' && item.required) {
489
+ count++
490
+ }
491
+ }
492
+ if (count === 0) {
493
+ flag = false
494
+ }
495
+
496
+ this.disable_button = flag
497
+ },
498
+ // 失去焦点触发,无论值是否发生变化
499
+ onblur (index) {
500
+ // 是否禁用按钮
501
+ this.disableButton()
502
+
503
+ this.$dispatch('onblur', index)
504
+ // 如果有错误信息提示走错误信息判断处理
505
+
506
+ if (this.data.fields[index].error || this.data.fields[index].type === 'datepicker') {
507
+ this.$dispatch('error_check', index)
508
+ }
509
+ },
510
+ // 失去焦点且值最终发生变化触发
511
+ async onchange (index) {
512
+ // 是否禁用按钮
513
+ this.disableButton()
514
+
515
+ this.data.fields[index].value = this.data.fields[index].value.trim()
516
+
517
+ if (this.data.fields[index].prefix && this.data.fields[index].value !== '') {
518
+ this.data.fields[index].value = this.data.fields[index].prefix + this.data.fields[index].value
519
+ }
520
+
521
+ this.data[this.data.fields[index].field] = this.data.fields[index].value
522
+
523
+ await this.$dispatch('onchange', index)
524
+
525
+ // 如果有错误信息提示走错误信息判断处理
526
+ if (this.data.fields[index].error || this.data.fields[index].type === 'datepicker') {
527
+ this.$dispatch('error_check', index)
528
+ }
529
+ },
530
+ oninput (index) {
531
+ // 是否禁用按钮
532
+ this.disableButton()
533
+
534
+ this.$dispatch('oninput', index)
535
+
536
+ // 如果有错误信息提示走错误信息判断处理
537
+ if (this.data.fields[index].error || this.data.fields[index].type === 'datepicker') {
538
+ this.$dispatch('error_check', index)
539
+ }
540
+ },
541
+ // 模态框确认按钮
542
+ confirm_modal (title) {
543
+ if (title === '新增') {
544
+ if (this.data.onetomany[this.onetomany_index].addEvent === 'default' || !this.data.onetomany[this.onetomany_index].addEvent) {
545
+ this.$dispatch('onetomanyadd', this.onetomany_index)
546
+ } else {
547
+ this.$dispatch(this.data.onetomany[this.onetomany_index].addEvent, this.onetomany_index)
548
+ }
549
+ } else {
550
+ if (this.data.onetomany[this.onetomany_index].updateEvent === 'default' || !this.data.onetomany[this.onetomany_index].updateEvent) {
551
+ this.$dispatch('onetomanyupdate', this.onetomany_index, this.update_onetomany_index)
552
+ } else {
553
+ this.$dispatch(this.data.onetomany[this.onetomany_index].updateEvent, this.onetomany_index, this.update_onetomany_index)
554
+ }
555
+ }
556
+
557
+ this.closemodal()
558
+ },
559
+ // 删除
560
+ delete (i, j) {
561
+ this.$showMessage((this.data.onetomany[i].deleteMessage === 'default' || !this.data.onetomany[i].deleteMessage) ? '您确定要删除这条记录吗?' : this.data.onetomany[i].deleteMessage, ['confirm']).then((res) => {
562
+ if (res === 'confirm') {
563
+ if (this.data.onetomany[i].deleteEvent === 'default' || !this.data.onetomany[i].deleteEvent) {
564
+ this.$dispatch('onetomanydelete', i, j)
565
+ } else {
566
+ this.$dispatch(this.data.onetomany[i].deleteEvent, i, j)
567
+ }
568
+ }
569
+ })
570
+ },
571
+ // 修改
572
+ update (i, j) {
573
+ let onetomany = this.data.onetomany[i]
574
+ let item = this.data.onetomany[i].rows[j]
575
+ let count = 0
576
+ for (let k = 0; k < onetomany.fields.length; k++) {
577
+ // 防止初始化的时候没有value
578
+ Vue.set(this.data.onetomany[i].fields[k], 'value', item[this.data.onetomany[i].fields[k].field])
579
+
580
+ if (onetomany.fields[j].required) {
581
+ count++
582
+ }
583
+ }
584
+ if (count === 0) {
585
+ this.disable_button_onetomany = false
586
+ }
587
+ this.modeltitle = '修改'
588
+ this.modalSize = this.data.onetomany[i].modalSize
589
+ this.onetomany_index = i
590
+ this.update_onetomany_index = j
591
+
592
+ this.$dispatch('openUpdateModel',i,j)
593
+
594
+ this.show = true
595
+ },
596
+ // 添加
597
+ add (index) {
598
+ let count = 0
599
+ for (const item of this.data.onetomany[index].fields) {
600
+ if (item.type === 'datepicker' && !item.value && item.default) {
601
+ item.value = new Date().Format('yyyy-MM-dd')
602
+ }
603
+ if (item.required) {
604
+ count++
605
+ }
606
+ }
607
+
608
+ if (count === 0) {
609
+ this.disable_button_onetomany = false
610
+ }
611
+ this.modeltitle = '新增'
612
+ this.modalSize = this.data.onetomany[index].modalSize
613
+ this.onetomany_index = index
614
+
615
+ this.$dispatch('openAddModel',index)
616
+
617
+ this.show = true
618
+ },
619
+ // 关闭模态框
620
+ closemodal (val) {
621
+ if (val === 'but'){
622
+ this.disableButton()
623
+ this.showbutmodal = false
624
+ return
625
+ }
626
+ for (const item of this.data.onetomany[this.onetomany_index].fields) {
627
+ item.value = ''
628
+ }
629
+ this.show = false
630
+ this.disable_button_onetomany = true
631
+ this.onetomany_index = null
632
+ this.update_onetomany_index = null
633
+ this.modeltitle = null
634
+ this.modalSize = null
635
+ },
636
+ // 是否禁用模态框按钮
637
+ disableModalButton () {
638
+ let fields = this.data.onetomany[this.onetomany_index].fields
639
+
640
+ let flag = false
641
+ for (const item of fields) {
642
+ if (item.type !== 'checkbox' && item.required && !item.value) {
643
+ if (item.value === 0) {
644
+ flag = false
645
+ } else {
646
+ flag = true
647
+ }
648
+ }
649
+ }
650
+
651
+ let count = 0
652
+ for (const item of fields) {
653
+ if (item.type !== 'checkbox' && item.required) {
654
+ count++
655
+ }
656
+ }
657
+ if (count === 0) {
658
+ flag = false
659
+ }
660
+ this.disable_button_onetomany = flag
661
+ },
662
+ // 监听模态框属性失去焦点
663
+ onchange_modal (index) {
664
+ this.disableModalButton()
665
+ this.$dispatch('onchange_modal', this.onetomany_index, index)
666
+ },
667
+ // 监听模态框属性失去焦点
668
+ onblur_modal (index) {
669
+ this.disableModalButton()
670
+ this.$dispatch('onblur_modal', this.onetomany_index, index)
671
+ },
672
+ // input输入属性值发生变化监听
673
+ oninput_modal (index) {
674
+ this.disableModalButton()
675
+ this.$dispatch('oninput_modal', this.onetomany_index, index)
676
+ }
677
+ },
678
+ events: {
679
+
680
+ }
681
+ }
682
+ </script>
683
+ <style>
684
+ .datepicker{
685
+ width: 100%!important;
686
+ }
687
+ .datepicker-input{
688
+ background-color: #ffffff!important;
689
+ width: 100%!important;
690
+ }
691
+ .datepicker-input:disabled{
692
+ border: 1px solid #DDD!important;
693
+ color: #ACA899!important;
694
+ width: 100%!important;
695
+ }
696
+ </style>
697
+ <style scoped>
698
+ th{
699
+ font-size: 15px !important;
700
+ text-align: center !important;
701
+ background-color: #dfedfb!important;
702
+ color: #666666 !important;
703
+ font-family: PINGFANG-BOLD !important;
704
+ font-weight: normal!important;
705
+ }
706
+ /*清除model中的浮动*/
707
+ .clearfix:after,.clearfix:before{
708
+ display: table;
709
+ }
710
+ .clearfix:after{
711
+ clear: both;
712
+ }
713
+
714
+ .input_view{
715
+ padding: 8px;
716
+ background-color: #ffffff;
717
+ border-radius: 2px;
718
+ border: solid 1px #c7c7c7!important;
719
+ color: #333333!important;
720
+ font-size: 15px!important;
721
+ }
722
+
723
+ .input_view[readonly]{
724
+ border: 1px solid #DDD!important;
725
+ /*background-color: #F5F5F5;*/
726
+ color:#ACA899!important;
727
+ }
728
+ .input_view:disabled{
729
+ border: 1px solid #DDD!important;
730
+ /*background-color: #F5F5F5;*/
731
+ color:#ACA899!important;
732
+ }
733
+
734
+ .control-label-justify {
735
+ display: inline-block;
736
+ vertical-align: top;
737
+ width: 110px;
738
+ text-align: justify;
739
+ font-family: PingFang-SC-Bold;
740
+ }
741
+
742
+ .control-label-justify::after {
743
+ content: "";
744
+ display: inline-block;
745
+ width: 70px;
746
+ overflow: hidden;
747
+ height: 0;
748
+ }
749
+
750
+ input::-webkit-outer-spin-button,
751
+ input::-webkit-inner-spin-button {
752
+ -webkit-appearance: none;
753
+ }
754
+
755
+ input[type="number"] {
756
+ -moz-appearance: textfield;
757
+ }
758
+
759
+ </style>