apply-clients 3.2.41 → 3.2.50

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 (43) hide show
  1. package/package.json +1 -1
  2. package/src/App.vue +20 -20
  3. package/src/apply.js +185 -175
  4. package/src/components/app_apply/Process/AppExplorationUser.vue +1 -1
  5. package/src/components/app_apply/ProgressReport/ProgressReportList.vue +209 -208
  6. package/src/components/app_apply/Supervisory/AppProcessSupervisory.vue +183 -183
  7. package/src/components/image/tubiao.png +0 -0
  8. package/src/components/product/Ledger/ContractManagement/OtherContract/OtherContractInformation.vue +429 -429
  9. package/src/components/product/Ledger/ContractManagement/OtherContract/OtherContractList.vue +267 -267
  10. package/src/components/product/Ledger/ContractManagement/PurchaseContract/PurchaseContractInformation.vue +715 -682
  11. package/src/components/product/Ledger/ContractManagement/PurchaseContract/PurchaseContractList.vue +304 -304
  12. package/src/components/product/Ledger/ContractManagement/RepairContract/RepairContractInformation.vue +286 -286
  13. package/src/components/product/Ledger/ContractManagement/RepairContract/RepairContractList.vue +258 -258
  14. package/src/components/product/Ledger/FacilityManagement/FacilityInventory/FacilityInventory.vue +31 -0
  15. package/src/components/product/Ledger/FacilityManagement/FacilityInventory/FacilityInventoryList.vue +5 -0
  16. package/src/components/product/Ledger/FacilityManagement/FacilityInventory/addoldFacilityInformation.vue +326 -0
  17. package/src/components/product/Ledger/FileDownload/FileDownload.vue +42 -0
  18. package/src/components/product/Ledger/Function/InstallInfoSelect.vue +4 -1
  19. package/src/components/product/Ledger/ImportApply/ImportApply.vue +68 -0
  20. package/src/components/product/Ledger/MaterialManagement/DeliveryRecord/DeliveryRecordList.vue +39 -3
  21. package/src/components/product/Ledger/MaterialManagement/InventoryInformation/InventoryInformationList.vue +32 -2
  22. package/src/components/product/Ledger/MaterialManagement/InventoryInformation/MaterialInformation.vue +1 -1
  23. package/src/components/product/Ledger/MaterialManagement/InventoryInformation/MaterialOutStock.vue +438 -430
  24. package/src/components/product/Ledger/MaterialManagement/InventoryInformation/MaterialOutboundOrder.vue +457 -449
  25. package/src/components/product/Ledger/MaterialManagement/InventoryInformation/PurchaseMaterial.vue +10 -2
  26. package/src/components/product/Ledger/MaterialManagement/InventoryInformation/PurchaseOrder.vue +10 -2
  27. package/src/components/product/Ledger/MaterialManagement/InventoryInformation/ReturnMaterial.vue +10 -2
  28. package/src/components/product/Ledger/MaterialManagement/OutboundOrder/OutboundOrderInformation.vue +3 -1
  29. package/src/components/product/Ledger/MaterialManagement/OutboundOrder/OutboundOrderList.vue +31 -2
  30. package/src/components/product/Ledger/MaterialManagement/OutboundOrder/PrintMaterialBill.vue +2 -2
  31. package/src/components/product/Ledger/MaterialManagement/PurchaseRecords/PrintPurchaseOrder.vue +5 -4
  32. package/src/components/product/Ledger/MaterialManagement/PurchaseRecords/PurchaseRecordsInformation.vue +5 -1
  33. package/src/components/product/Ledger/MaterialManagement/PurchaseRecords/PurchaseRecordsList.vue +33 -7
  34. package/src/components/product/Ledger/MaterialManagement/WarehousingRecord/WarehousingRecordList.vue +45 -3
  35. package/src/components/product/Ledger/Process/ProcessSelect.vue +3 -5
  36. package/src/components/product/Ledger/Process/Service/ServiceControl.vue +42 -5
  37. package/src/components/product/Ledger/QinhuaMaterial/PickingRecord/PickingInformation.vue +24 -3
  38. package/src/components/product/Ledger/QinhuaMaterial/SeasoningRecord/SeasoningRecordList.vue +14 -2
  39. package/src/components/product/Ledger/Supervisory/Service/RenWuDan.vue +78 -0
  40. package/src/components/product/Ledger/Supervisory/Service/SupervisoryServiceControl.vue +38 -2
  41. package/src/components/product/Ledger/Supervisory/SupervisoryList.vue +182 -7
  42. package/src/components/product/ServiceView.vue +761 -850
  43. package/static/images/lefticon//346/226/207/344/273/266/346/250/241/345/235/227.png +0 -0
@@ -1,850 +1,761 @@
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-if="!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 form-group']"
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
- a:0,
377
- b:0,
378
- c:0,
379
- a1:0,
380
- b1:0,
381
- c1:0,
382
- d1:0,
383
- a2:0,
384
- b2:0,
385
- c2:0,
386
- d2:0
387
- }
388
- },
389
- watch: {
390
- deep: true
391
- },
392
- computed: {
393
-
394
- },
395
- created () {
396
- // 初始化数据
397
- this.initializtion()
398
- this.$dispatch('initializtionView')
399
- },
400
- methods: {
401
- // 按钮模态框确定
402
- confirm_but_modal() {
403
- for (const item of this.data.buttons[this.model.button.button_index].button_fields) {
404
- this.model.button.button_fields[item.field] = item.value
405
- }
406
- this.showbutmodal = false
407
- this.disable_button_but = true
408
- this.$dispatch('button', this.model)
409
- },
410
- getNumber(){
411
- if(this.data.fields[this.a].value !=null || this.data.fields[this.b].value !=null)
412
- this.$set('data.fields['+this.c+'].value', parseInt(this.data.fields[this.a].value) + parseInt(this.data.fields[this.b].value))
413
- },
414
- getNumber1(){
415
- if(this.data.fields[this.a1].value !=null || this.data.fields[this.b1].value !=null||this.data.fields[this.c1].value !=null)
416
- this.$set('data.fields['+this.d1+'].value', (parseInt(this.data.fields[this.a1].value) + parseInt(this.data.fields[this.b1].value)+parseInt(this.data.fields[this.c1].value))*0.11)
417
- },
418
- getNumber2(){
419
- if(this.data.fields[this.a2].value !=null || this.data.fields[this.b2].value !=null||this.data.fields[this.c2].value !=null)
420
- this.$set('data.fields['+this.d2+'].value', (parseInt(this.data.fields[this.a2].value) + parseInt(this.data.fields[this.b2].value)+parseInt(this.data.fields[this.c2].value))*0.11)
421
- },
422
- // 点击按钮组按钮
423
- async clicked(index, button) {
424
- this.disable_button = true
425
- // 组织model.fields数据
426
- for (const item of this.data.fields) {
427
- // checkbox特殊处理
428
- if (item.type === 'checkbox') {
429
- for (let j = 0; j < item.items.length; j++) {
430
- this.model[item.items[j].field] = item.items[j].value
431
- }
432
- } else {
433
- this.model[item.field] = item.value
434
- }
435
- }
436
- this.model.f_process_id = this.data.f_process_id
437
-
438
- // 初始化model.button数据
439
- let buttondatas = {
440
- button_fields: {}
441
- }
442
- buttondatas.button_name = button.button_name
443
- buttondatas.button_index = index
444
- if (button.button_fields) {
445
- for (const item of button.button_fields) {
446
- buttondatas.button_fields[item.field] = item.value
447
- }
448
- }
449
- this.model.button = buttondatas
450
- this.model.title = this.data.title
451
- this.model.fields = this.data.fields
452
- this.model.onetomany = this.data.onetomany
453
-
454
-
455
- if (button.button_name === '退回') {
456
- this.showbutmodal = true
457
- } else if (button.button_name === '下发') {
458
- this.showbutmodal = true
459
- } else {
460
- this.$dispatch('button', this.model)
461
- }
462
- },
463
- // 初始化数据
464
- initializtion () {
465
- // 是否禁用按钮
466
- this.disableButton()
467
-
468
- // 公司等属性初始化
469
- if (this.data.filiale) {
470
- this.model.f_filiale = this.data.filiale
471
- } else {
472
- this.model.f_filiale = this.$login.f.orgs
473
- }
474
- if (this.data.f_parentname) {
475
- this.model.f_parentname = this.data.f_parentname
476
- } else {
477
- this.model.f_parentname = this.$login.f.f_department_name
478
- }
479
- if (this.data.operate_date) {
480
- this.model.f_operate_date = this.data.operate_date
481
- } else {
482
- this.model.f_operate_date = new Date().Format('yyyy-MM-dd')
483
- }
484
- if (this.data.operator) {
485
- this.model.f_operator = this.data.operator
486
- } else {
487
- this.model.f_operator = this.$login.f.name
488
- }
489
- },
490
- // 是否禁用按钮
491
- disableButton () {
492
- let fields = this.data.fields
493
-
494
- let flag = false
495
- for (const item of fields) {
496
- if (item.type !== 'checkbox' && item.required && !item.value) {
497
- if (item.value === 0) {
498
- flag = false
499
- } else {
500
- flag = true
501
- }
502
- }
503
- // 任何选择框只要是否都不能提交
504
- if (item.type === 'select' && item.value === '否' && item.disabledButton) {
505
- flag = true
506
- }
507
- }
508
-
509
- let count = 0
510
- for (const item of fields) {
511
- if (item.type !== 'checkbox' && item.required) {
512
- count++
513
- }
514
- }
515
- if (count === 0) {
516
- flag = false
517
- }
518
-
519
- this.disable_button = flag
520
- },
521
- // 失去焦点触发,无论值是否发生变化
522
- onblur (index) {
523
- // 是否禁用按钮
524
- this.disableButton()
525
-
526
- this.$dispatch('onblur', index)
527
- // 如果有错误信息提示走错误信息判断处理
528
-
529
- if (this.data.fields[index].error || this.data.fields[index].type === 'datepicker') {
530
- this.$dispatch('error_check', index)
531
- }
532
- },
533
- // 失去焦点且值最终发生变化触发
534
- async onchange (index) {
535
- // 是否禁用按钮
536
- this.disableButton()
537
-
538
- this.data.fields[index].value = this.data.fields[index].value.trim()
539
-
540
- if (this.data.fields[index].prefix && this.data.fields[index].value !== '') {
541
- this.data.fields[index].value = this.data.fields[index].prefix + this.data.fields[index].value
542
- }
543
-
544
- this.data[this.data.fields[index].field] = this.data.fields[index].value
545
-
546
- await this.$dispatch('onchange', index)
547
-
548
- // 如果有错误信息提示走错误信息判断处理
549
- if (this.data.fields[index].error || this.data.fields[index].type === 'datepicker') {
550
- this.$dispatch('error_check', index)
551
- }
552
- },
553
- oninput (index) {
554
- // 是否禁用按钮
555
- this.disableButton()
556
-
557
- this.$dispatch('oninput', index)
558
-
559
- // 如果有错误信息提示走错误信息判断处理
560
- if (this.data.fields[index].error || this.data.fields[index].type === 'datepicker') {
561
- this.$dispatch('error_check', index)
562
- }
563
- },
564
- // 模态框确认按钮
565
- confirm_modal (title) {
566
- if (title === '新增') {
567
- if (this.data.onetomany[this.onetomany_index].addEvent === 'default' || !this.data.onetomany[this.onetomany_index].addEvent) {
568
- this.$dispatch('onetomanyadd', this.onetomany_index)
569
- } else {
570
- this.$dispatch(this.data.onetomany[this.onetomany_index].addEvent, this.onetomany_index)
571
- }
572
- } else {
573
- if (this.data.onetomany[this.onetomany_index].updateEvent === 'default' || !this.data.onetomany[this.onetomany_index].updateEvent) {
574
- this.$dispatch('onetomanyupdate', this.onetomany_index, this.update_onetomany_index)
575
- } else {
576
- this.$dispatch(this.data.onetomany[this.onetomany_index].updateEvent, this.onetomany_index, this.update_onetomany_index)
577
- }
578
- }
579
-
580
- this.closemodal()
581
- },
582
- // 删除
583
- delete (i, j) {
584
- this.$showMessage((this.data.onetomany[i].deleteMessage === 'default' || !this.data.onetomany[i].deleteMessage) ? '您确定要删除这条记录吗?' : this.data.onetomany[i].deleteMessage, ['confirm']).then((res) => {
585
- if (res === 'confirm') {
586
- if (this.data.onetomany[i].deleteEvent === 'default' || !this.data.onetomany[i].deleteEvent) {
587
- this.$dispatch('onetomanydelete', i, j)
588
- } else {
589
- this.$dispatch(this.data.onetomany[i].deleteEvent, i, j)
590
- }
591
- }
592
- })
593
- },
594
- // 修改
595
- update (i, j) {
596
- let onetomany = this.data.onetomany[i]
597
- let item = this.data.onetomany[i].rows[j]
598
- let count = 0
599
- for (let k = 0; k < onetomany.fields.length; k++) {
600
- // 防止初始化的时候没有value
601
- Vue.set(this.data.onetomany[i].fields[k], 'value', item[this.data.onetomany[i].fields[k].field])
602
-
603
- if (onetomany.fields[j].required) {
604
- count++
605
- }
606
- }
607
- if (count === 0) {
608
- this.disable_button_onetomany = false
609
- }
610
- this.modeltitle = '修改'
611
- this.modalSize = this.data.onetomany[i].modalSize
612
- this.onetomany_index = i
613
- this.update_onetomany_index = j
614
-
615
- this.$dispatch('openUpdateModel',i,j)
616
-
617
- this.show = true
618
- },
619
- // 添加
620
- add (index) {
621
- let count = 0
622
- for (const item of this.data.onetomany[index].fields) {
623
- if (item.type === 'datepicker' && !item.value && item.default) {
624
- item.value = new Date().Format('yyyy-MM-dd')
625
- }
626
- if (item.required) {
627
- count++
628
- }
629
- }
630
-
631
- if (count === 0) {
632
- this.disable_button_onetomany = false
633
- }
634
- this.modeltitle = '新增'
635
- this.modalSize = this.data.onetomany[index].modalSize
636
- this.onetomany_index = index
637
-
638
- this.$dispatch('openAddModel',index)
639
-
640
- this.show = true
641
- },
642
- // 关闭模态框
643
- closemodal (val) {
644
- if (val === 'but'){
645
- this.disableButton()
646
- this.showbutmodal = false
647
- return
648
- }
649
- for (const item of this.data.onetomany[this.onetomany_index].fields) {
650
- item.value = ''
651
- }
652
- this.show = false
653
- this.disable_button_onetomany = true
654
- this.onetomany_index = null
655
- this.update_onetomany_index = null
656
- this.modeltitle = null
657
- this.modalSize = null
658
- },
659
- // 是否禁用模态框按钮
660
- disableModalButton () {
661
- let fields = this.data.onetomany[this.onetomany_index].fields
662
-
663
- let flag = false
664
- for (const item of fields) {
665
- if (item.type !== 'checkbox' && item.required && !item.value) {
666
- if (item.value === 0) {
667
- flag = false
668
- } else {
669
- flag = true
670
- }
671
- }
672
- }
673
-
674
- let count = 0
675
- for (const item of fields) {
676
- if (item.type !== 'checkbox' && item.required) {
677
- count++
678
- }
679
- }
680
- if (count === 0) {
681
- flag = false
682
- }
683
- this.disable_button_onetomany = flag
684
- },
685
- // 监听模态框属性失去焦点
686
- onchange_modal (index) {
687
- this.disableModalButton()
688
- this.$dispatch('onchange_modal', this.onetomany_index, index)
689
- },
690
- // 监听模态框属性失去焦点
691
- onblur_modal (index) {
692
- this.disableModalButton()
693
- this.$dispatch('onblur_modal', this.onetomany_index, index)
694
- },
695
- // input输入属性值发生变化监听
696
- oninput_modal (index) {
697
- this.disableModalButton()
698
- this.$dispatch('oninput_modal', this.onetomany_index, index)
699
- }
700
- },
701
- events: {
702
-
703
- },
704
- watch : {
705
- 'data.fields'() {
706
- console.log('666666666666666666666' + this.data.fields)
707
- for (var i = 0; i < this.data.fields.length; i++) {
708
-
709
- if (this.data.fields[i].label == '室外造价') {
710
- this.a = i;
711
- this.$watch('data.fields[' + i + '].value', function () {
712
- this.getNumber()
713
- })
714
- } else if (this.data.fields[i].label == '室内造价') {
715
- this.b = i;
716
- this.$watch('data.fields[' + i + '].value', function () {
717
- this.getNumber()
718
- })
719
- } else if (this.data.fields[i].label == '合同总造价') {
720
- this.c = i;
721
- this.$watch('data.fields[' + i + '].value', function () {
722
- this.getNumber()
723
- })
724
- } else if (this.data.fields[i].label == '室外安装费') {
725
- this.a1 = i;
726
- this.$watch('data.fields[' + i + '].value', function () {
727
- this.getNumber1()
728
- })
729
- } else if (this.data.fields[i].label == '室外甲供材') {
730
- this.b1 = i;
731
- this.$watch('data.fields[' + i + '].value', function () {
732
- this.getNumber1()
733
- })
734
- } else if (this.data.fields[i].label == '室外设备费') {
735
- this.c1 = i;
736
- this.$watch('data.fields[' + i + '].value', function () {
737
- this.getNumber1()
738
- })
739
- } else if (this.data.fields[i].label == '室外税金') {
740
- this.d1 = i;
741
- this.$watch('data.fields[' + i + '].value', function () {
742
- this.getNumber1()
743
- })
744
-
745
- } else if (this.data.fields[i].label == '室内安装费') {
746
- this.a2 = i;
747
- this.$watch('data.fields[' + i + '].value', function () {
748
- this.getNumber2()
749
- })
750
- } else if (this.data.fields[i].label == '室内甲供材') {
751
- this.b2 = i;
752
- this.$watch('data.fields[' + i + '].value', function () {
753
- this.getNumber2()
754
- })
755
- } else if (this.data.fields[i].label == '室内设备费') {
756
- this.c2 = i;
757
- this.$watch('data.fields[' + i + '].value', function () {
758
- this.getNumber2()
759
- })
760
- } else if (this.data.fields[i].label == '室内税金') {
761
- this.d2 = i;
762
- this.$watch('data.fields[' + i + '].value', function () {
763
- this.getNumber2()
764
- })
765
-
766
- }
767
-
768
- }
769
-
770
- }
771
-
772
- }}
773
- </script>
774
- <style>
775
- .datepicker{
776
- width: 100%!important;
777
- }
778
- .datepicker-input{
779
- background-color: #ffffff!important;
780
- width: 100%!important;
781
- }
782
- .datepicker-input:disabled{
783
- border: 1px solid #DDD!important;
784
- color: #ACA899!important;
785
- width: 100%!important;
786
- }
787
- </style>
788
- <style scoped>
789
- th{
790
- font-size: 15px !important;
791
- text-align: center !important;
792
- background-color: #dfedfb!important;
793
- color: #666666 !important;
794
- font-family: PINGFANG-BOLD !important;
795
- font-weight: normal!important;
796
- }
797
- /*清除model中的浮动*/
798
- .clearfix:after,.clearfix:before{
799
- display: table;
800
- }
801
- .clearfix:after{
802
- clear: both;
803
- }
804
-
805
- .input_view{
806
- padding: 8px;
807
- background-color: #ffffff;
808
- border-radius: 2px;
809
- border: solid 1px #c7c7c7!important;
810
- color: #333333!important;
811
- font-size: 15px!important;
812
- }
813
-
814
- .input_view[readonly]{
815
- border: 1px solid #DDD!important;
816
- /*background-color: #F5F5F5;*/
817
- color:#ACA899!important;
818
- }
819
- .input_view:disabled{
820
- border: 1px solid #DDD!important;
821
- /*background-color: #F5F5F5;*/
822
- color:#ACA899!important;
823
- }
824
-
825
- .control-label-justify {
826
- display: inline-block;
827
- vertical-align: top;
828
- width: 110px;
829
- text-align: justify;
830
- font-family: PingFang-SC-Bold;
831
- }
832
-
833
- .control-label-justify::after {
834
- content: "";
835
- display: inline-block;
836
- width: 70px;
837
- overflow: hidden;
838
- height: 0;
839
- }
840
-
841
- input::-webkit-outer-spin-button,
842
- input::-webkit-inner-spin-button {
843
- -webkit-appearance: none;
844
- }
845
-
846
- input[type="number"] {
847
- -moz-appearance: textfield;
848
- }
849
-
850
- </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-if="!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 form-group']"
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
+ },
379
+ watch: {
380
+ deep: true
381
+ },
382
+ computed: {
383
+
384
+ },
385
+ created () {
386
+ // 初始化数据
387
+ this.initializtion()
388
+ this.$dispatch('initializtionView')
389
+ },
390
+ methods: {
391
+ // 按钮模态框确定
392
+ confirm_but_modal() {
393
+ for (const item of this.data.buttons[this.model.button.button_index].button_fields) {
394
+ this.model.button.button_fields[item.field] = item.value
395
+ }
396
+ this.showbutmodal = false
397
+ this.disable_button_but = true
398
+ this.$dispatch('button', this.model)
399
+ },
400
+
401
+ // 点击按钮组按钮
402
+ async clicked(index, button) {
403
+ this.disable_button = true
404
+ // 组织model.fields数据
405
+ for (const item of this.data.fields) {
406
+ // checkbox特殊处理
407
+ if (item.type === 'checkbox') {
408
+ for (let j = 0; j < item.items.length; j++) {
409
+ this.model[item.items[j].field] = item.items[j].value
410
+ }
411
+ } else {
412
+ this.model[item.field] = item.value
413
+ }
414
+ }
415
+ this.model.f_process_id = this.data.f_process_id
416
+
417
+ // 初始化model.button数据
418
+ let buttondatas = {
419
+ button_fields: {}
420
+ }
421
+ buttondatas.button_name = button.button_name
422
+ buttondatas.button_index = index
423
+ if (button.button_fields) {
424
+ for (const item of button.button_fields) {
425
+ buttondatas.button_fields[item.field] = item.value
426
+ }
427
+ }
428
+ this.model.button = buttondatas
429
+ this.model.title = this.data.title
430
+ this.model.fields = this.data.fields
431
+ this.model.onetomany = this.data.onetomany
432
+
433
+
434
+ if (button.button_name === '退回') {
435
+ this.showbutmodal = true
436
+ } else if (button.button_name === '下发') {
437
+ this.showbutmodal = true
438
+ } else {
439
+ this.$dispatch('button', this.model)
440
+ }
441
+ },
442
+ // 初始化数据
443
+ initializtion () {
444
+ // 是否禁用按钮
445
+ this.disableButton()
446
+
447
+ // 公司等属性初始化
448
+ if (this.data.filiale) {
449
+ this.model.f_filiale = this.data.filiale
450
+ } else {
451
+ this.model.f_filiale = this.$login.f.orgs
452
+ }
453
+ if (this.data.f_parentname) {
454
+ this.model.f_parentname = this.data.f_parentname
455
+ } else {
456
+ this.model.f_parentname = this.$login.f.f_department_name
457
+ }
458
+ if (this.data.operate_date) {
459
+ this.model.f_operate_date = this.data.operate_date
460
+ } else {
461
+ this.model.f_operate_date = new Date().Format('yyyy-MM-dd')
462
+ }
463
+ if (this.data.operator) {
464
+ this.model.f_operator = this.data.operator
465
+ } else {
466
+ this.model.f_operator = this.$login.f.name
467
+ }
468
+ },
469
+ // 是否禁用按钮
470
+ disableButton () {
471
+ let fields = this.data.fields
472
+
473
+ let flag = false
474
+ for (const item of fields) {
475
+ if (item.type !== 'checkbox' && item.required && !item.value) {
476
+ if (item.value === 0) {
477
+ flag = false
478
+ } else {
479
+ flag = true
480
+ }
481
+ }
482
+ // 任何选择框只要是否都不能提交
483
+ if (item.type === 'select' && item.value === '否' && item.disabledButton) {
484
+ flag = true
485
+ }
486
+ }
487
+
488
+ let count = 0
489
+ for (const item of fields) {
490
+ if (item.type !== 'checkbox' && item.required) {
491
+ count++
492
+ }
493
+ }
494
+ if (count === 0) {
495
+ flag = false
496
+ }
497
+
498
+ this.disable_button = flag
499
+ },
500
+ // 失去焦点触发,无论值是否发生变化
501
+ onblur (index) {
502
+ // 是否禁用按钮
503
+ this.disableButton()
504
+
505
+ this.$dispatch('onblur', index)
506
+ // 如果有错误信息提示走错误信息判断处理
507
+
508
+ if (this.data.fields[index].error || this.data.fields[index].type === 'datepicker') {
509
+ this.$dispatch('error_check', index)
510
+ }
511
+ },
512
+ // 失去焦点且值最终发生变化触发
513
+ async onchange (index) {
514
+ // 是否禁用按钮
515
+ this.disableButton()
516
+
517
+ this.data.fields[index].value = this.data.fields[index].value.trim()
518
+
519
+ if (this.data.fields[index].prefix && this.data.fields[index].value !== '') {
520
+ this.data.fields[index].value = this.data.fields[index].prefix + this.data.fields[index].value
521
+ }
522
+
523
+ this.data[this.data.fields[index].field] = this.data.fields[index].value
524
+
525
+ await this.$dispatch('onchange', index)
526
+
527
+ // 如果有错误信息提示走错误信息判断处理
528
+ if (this.data.fields[index].error || this.data.fields[index].type === 'datepicker') {
529
+ this.$dispatch('error_check', index)
530
+ }
531
+ },
532
+ oninput (index) {
533
+ // 是否禁用按钮
534
+ this.disableButton()
535
+
536
+ this.$dispatch('oninput', index)
537
+
538
+ // 如果有错误信息提示走错误信息判断处理
539
+ if (this.data.fields[index].error || this.data.fields[index].type === 'datepicker') {
540
+ this.$dispatch('error_check', index)
541
+ }
542
+ },
543
+ // 模态框确认按钮
544
+ confirm_modal (title) {
545
+ if (title === '新增') {
546
+ if (this.data.onetomany[this.onetomany_index].addEvent === 'default' || !this.data.onetomany[this.onetomany_index].addEvent) {
547
+ this.$dispatch('onetomanyadd', this.onetomany_index)
548
+ } else {
549
+ this.$dispatch(this.data.onetomany[this.onetomany_index].addEvent, this.onetomany_index)
550
+ }
551
+ } else {
552
+ if (this.data.onetomany[this.onetomany_index].updateEvent === 'default' || !this.data.onetomany[this.onetomany_index].updateEvent) {
553
+ this.$dispatch('onetomanyupdate', this.onetomany_index, this.update_onetomany_index)
554
+ } else {
555
+ this.$dispatch(this.data.onetomany[this.onetomany_index].updateEvent, this.onetomany_index, this.update_onetomany_index)
556
+ }
557
+ }
558
+
559
+ this.closemodal()
560
+ },
561
+ // 删除
562
+ delete (i, j) {
563
+ this.$showMessage((this.data.onetomany[i].deleteMessage === 'default' || !this.data.onetomany[i].deleteMessage) ? '您确定要删除这条记录吗?' : this.data.onetomany[i].deleteMessage, ['confirm']).then((res) => {
564
+ if (res === 'confirm') {
565
+ if (this.data.onetomany[i].deleteEvent === 'default' || !this.data.onetomany[i].deleteEvent) {
566
+ this.$dispatch('onetomanydelete', i, j)
567
+ } else {
568
+ this.$dispatch(this.data.onetomany[i].deleteEvent, i, j)
569
+ }
570
+ }
571
+ })
572
+ },
573
+ // 修改
574
+ update (i, j) {
575
+ let onetomany = this.data.onetomany[i]
576
+ let item = this.data.onetomany[i].rows[j]
577
+ let count = 0
578
+ for (let k = 0; k < onetomany.fields.length; k++) {
579
+ // 防止初始化的时候没有value
580
+ Vue.set(this.data.onetomany[i].fields[k], 'value', item[this.data.onetomany[i].fields[k].field])
581
+
582
+ if (onetomany.fields[j].required) {
583
+ count++
584
+ }
585
+ }
586
+ if (count === 0) {
587
+ this.disable_button_onetomany = false
588
+ }
589
+ this.modeltitle = '修改'
590
+ this.modalSize = this.data.onetomany[i].modalSize
591
+ this.onetomany_index = i
592
+ this.update_onetomany_index = j
593
+
594
+ this.$dispatch('openUpdateModel',i,j)
595
+
596
+ this.show = true
597
+ },
598
+ // 添加
599
+ add (index) {
600
+ let count = 0
601
+ for (const item of this.data.onetomany[index].fields) {
602
+ if (item.type === 'datepicker' && !item.value && item.default) {
603
+ item.value = new Date().Format('yyyy-MM-dd')
604
+ }
605
+ if (item.required) {
606
+ count++
607
+ }
608
+ }
609
+
610
+ if (count === 0) {
611
+ this.disable_button_onetomany = false
612
+ }
613
+ this.modeltitle = '新增'
614
+ this.modalSize = this.data.onetomany[index].modalSize
615
+ this.onetomany_index = index
616
+
617
+ this.$dispatch('openAddModel',index)
618
+
619
+ this.show = true
620
+ },
621
+ // 关闭模态框
622
+ closemodal (val) {
623
+ if (val === 'but'){
624
+ this.disableButton()
625
+ this.showbutmodal = false
626
+ return
627
+ }
628
+ for (const item of this.data.onetomany[this.onetomany_index].fields) {
629
+ item.value = ''
630
+ }
631
+ this.show = false
632
+ this.disable_button_onetomany = true
633
+ this.onetomany_index = null
634
+ this.update_onetomany_index = null
635
+ this.modeltitle = null
636
+ this.modalSize = null
637
+ },
638
+ // 是否禁用模态框按钮
639
+ disableModalButton () {
640
+ let fields = this.data.onetomany[this.onetomany_index].fields
641
+
642
+ let flag = false
643
+ for (const item of fields) {
644
+ if (item.type !== 'checkbox' && item.required && !item.value) {
645
+ if (item.value === 0) {
646
+ flag = false
647
+ } else {
648
+ flag = true
649
+ }
650
+ }
651
+ }
652
+
653
+ let count = 0
654
+ for (const item of fields) {
655
+ if (item.type !== 'checkbox' && item.required) {
656
+ count++
657
+ }
658
+ }
659
+ if (count === 0) {
660
+ flag = false
661
+ }
662
+ this.disable_button_onetomany = flag
663
+ },
664
+ // 监听模态框属性失去焦点
665
+ onchange_modal (index) {
666
+ this.disableModalButton()
667
+ this.$dispatch('onchange_modal', this.onetomany_index, index)
668
+ },
669
+ // 监听模态框属性失去焦点
670
+ onblur_modal (index) {
671
+ this.disableModalButton()
672
+ this.$dispatch('onblur_modal', this.onetomany_index, index)
673
+ },
674
+ // input输入属性值发生变化监听
675
+ oninput_modal (index) {
676
+ this.disableModalButton()
677
+ this.$dispatch('oninput_modal', this.onetomany_index, index)
678
+ }
679
+ },
680
+ events: {
681
+
682
+ },
683
+ }
684
+ </script>
685
+ <style>
686
+ .datepicker{
687
+ width: 100%!important;
688
+ }
689
+ .datepicker-input{
690
+ background-color: #ffffff!important;
691
+ width: 100%!important;
692
+ }
693
+ .datepicker-input:disabled{
694
+ border: 1px solid #DDD!important;
695
+ color: #ACA899!important;
696
+ width: 100%!important;
697
+ }
698
+ </style>
699
+ <style scoped>
700
+ th{
701
+ font-size: 15px !important;
702
+ text-align: center !important;
703
+ background-color: #dfedfb!important;
704
+ color: #666666 !important;
705
+ font-family: PINGFANG-BOLD !important;
706
+ font-weight: normal!important;
707
+ }
708
+ /*清除model中的浮动*/
709
+ .clearfix:after,.clearfix:before{
710
+ display: table;
711
+ }
712
+ .clearfix:after{
713
+ clear: both;
714
+ }
715
+
716
+ .input_view{
717
+ padding: 8px;
718
+ background-color: #ffffff;
719
+ border-radius: 2px;
720
+ border: solid 1px #c7c7c7!important;
721
+ color: #333333!important;
722
+ font-size: 15px!important;
723
+ }
724
+
725
+ .input_view[readonly]{
726
+ border: 1px solid #DDD!important;
727
+ /*background-color: #F5F5F5;*/
728
+ color:#ACA899!important;
729
+ }
730
+ .input_view:disabled{
731
+ border: 1px solid #DDD!important;
732
+ /*background-color: #F5F5F5;*/
733
+ color:#ACA899!important;
734
+ }
735
+
736
+ .control-label-justify {
737
+ display: inline-block;
738
+ vertical-align: top;
739
+ width: 110px;
740
+ text-align: justify;
741
+ font-family: PingFang-SC-Bold;
742
+ }
743
+
744
+ .control-label-justify::after {
745
+ content: "";
746
+ display: inline-block;
747
+ width: 70px;
748
+ overflow: hidden;
749
+ height: 0;
750
+ }
751
+
752
+ input::-webkit-outer-spin-button,
753
+ input::-webkit-inner-spin-button {
754
+ -webkit-appearance: none;
755
+ }
756
+
757
+ input[type="number"] {
758
+ -moz-appearance: textfield;
759
+ }
760
+
761
+ </style>