ocpview-plus 1.3.2 → 1.3.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ocpviewplus.min.esm.js +210 -88
- package/dist/ocpviewplus.min.js +14 -14
- package/dist/style.css +1 -1
- package/package.json +1 -1
- package/src/components/masterplate/approval.vue +53 -1
- package/src/components/masterplate/contractappendix.vue +21 -15
- package/src/components/masterplate/detailgridbox.vue +386 -0
- package/src/components/masterplate/editgridcard2.vue +23 -5
- package/src/components/masterplate/lefttreerightdetails.vue +6 -2
- package/src/components/masterplate/listdetails.vue +1 -1
package/package.json
CHANGED
|
@@ -109,6 +109,9 @@
|
|
|
109
109
|
<span class="status">{{item.act_status_name}}</span>
|
|
110
110
|
</p>
|
|
111
111
|
<div>
|
|
112
|
+
<p v-if="index === auditLog.length - 1 && item.candidateUserList && item.candidateUserList.length > 0" class="desc">
|
|
113
|
+
待审批人:<span>{{ getCandidateUserText(item.candidateUserList) }}</span>
|
|
114
|
+
</p>
|
|
112
115
|
<span>{{item.act_time_}}</span>
|
|
113
116
|
<p class="desc">意见:<span v-text="getMessage(item.message)"></span></p>
|
|
114
117
|
</div>
|
|
@@ -354,6 +357,7 @@ export default {
|
|
|
354
357
|
if (data.procinfo && data.procinfo.proclist) {
|
|
355
358
|
let result = data.procinfo.proclist || [];
|
|
356
359
|
let copylist = [];
|
|
360
|
+
let candidateUserList = [];
|
|
357
361
|
if (data.procinfo.cc && data.procinfo.cc.length > 0) {
|
|
358
362
|
data.procinfo.cc.forEach(item => {
|
|
359
363
|
let tmp = {};
|
|
@@ -363,13 +367,26 @@ export default {
|
|
|
363
367
|
copylist.push(tmp);
|
|
364
368
|
});
|
|
365
369
|
}
|
|
366
|
-
|
|
370
|
+
if (data.procinfo && data.procinfo.flowerProgress) {
|
|
371
|
+
if (data.procinfo.flowerProgress.length > 0) {
|
|
372
|
+
let lastflowerProgress = data.procinfo.flowerProgress[data.procinfo.flowerProgress.length - 1];
|
|
373
|
+
if (lastflowerProgress && lastflowerProgress.candidateUserList) {
|
|
374
|
+
candidateUserList = lastflowerProgress.candidateUserList;
|
|
375
|
+
}
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
}
|
|
379
|
+
result.forEach((item, index) => {
|
|
367
380
|
item.active = false;
|
|
368
381
|
item.tasklist.forEach(list => {
|
|
369
382
|
if (list.usernam) {
|
|
370
383
|
list.userName = list.username.substr(-2, 2);
|
|
371
384
|
}
|
|
372
385
|
});
|
|
386
|
+
// 判断是否是最后一个item,添加candidateUserList
|
|
387
|
+
if (index === result.length - 1) {
|
|
388
|
+
item.candidateUserList = candidateUserList;
|
|
389
|
+
}
|
|
373
390
|
});
|
|
374
391
|
|
|
375
392
|
|
|
@@ -409,6 +426,13 @@ export default {
|
|
|
409
426
|
'.billrepeal',
|
|
410
427
|
{billno: this.value.billno},
|
|
411
428
|
(data) => {
|
|
429
|
+
// // 方式1:通过事件 没有生效
|
|
430
|
+
// this.$emit('approvalOk', '');
|
|
431
|
+
|
|
432
|
+
// 方式2:直接调用父组件方法(兜底)
|
|
433
|
+
if (this.$parent && typeof this.$parent.approvalOk === 'function') {
|
|
434
|
+
this.$parent.approvalOk();
|
|
435
|
+
}
|
|
412
436
|
this.alert(data.msg,null,3);
|
|
413
437
|
this.showDrawer = false;
|
|
414
438
|
}
|
|
@@ -426,6 +450,13 @@ export default {
|
|
|
426
450
|
'.billreject' ,
|
|
427
451
|
para,
|
|
428
452
|
(data) => {
|
|
453
|
+
// // 方式1:通过事件 没有生效
|
|
454
|
+
// this.$emit('approvalOk', '');
|
|
455
|
+
|
|
456
|
+
// 方式2:直接调用父组件方法(兜底)
|
|
457
|
+
if (this.$parent && typeof this.$parent.approvalOk === 'function') {
|
|
458
|
+
this.$parent.approvalOk();
|
|
459
|
+
}
|
|
429
460
|
this.showDrawer = false;
|
|
430
461
|
this.alert(data.msg,null,3);
|
|
431
462
|
}
|
|
@@ -449,6 +480,13 @@ export default {
|
|
|
449
480
|
param.comment = this.idea;
|
|
450
481
|
}
|
|
451
482
|
this.doPost('.billsubmit', param, (data) => {
|
|
483
|
+
// // 方式1:通过事件 没有生效
|
|
484
|
+
// this.$emit('approvalOk', '');
|
|
485
|
+
|
|
486
|
+
// 方式2:直接调用父组件方法(兜底)
|
|
487
|
+
if (this.$parent && typeof this.$parent.approvalOk === 'function') {
|
|
488
|
+
this.$parent.approvalOk();
|
|
489
|
+
}
|
|
452
490
|
this.showDrawer = false;
|
|
453
491
|
this.$nextTick(() =>{
|
|
454
492
|
setTimeout(() => {
|
|
@@ -462,6 +500,13 @@ export default {
|
|
|
462
500
|
'.billapproval',
|
|
463
501
|
{billno: this.value.billno,comment: this.idea},
|
|
464
502
|
(data) => {
|
|
503
|
+
// // 方式1:通过事件 没有生效
|
|
504
|
+
// this.$emit('approvalOk', '');
|
|
505
|
+
|
|
506
|
+
// 方式2:直接调用父组件方法(兜底)
|
|
507
|
+
if (this.$parent && typeof this.$parent.approvalOk === 'function') {
|
|
508
|
+
this.$parent.approvalOk();
|
|
509
|
+
}
|
|
465
510
|
this.showDrawer = false;
|
|
466
511
|
this.alert(data.msg,null,3);
|
|
467
512
|
});
|
|
@@ -670,6 +715,13 @@ export default {
|
|
|
670
715
|
},
|
|
671
716
|
selectTypeChange() {
|
|
672
717
|
this.clearUser();
|
|
718
|
+
},
|
|
719
|
+
// 提前所有待审批人姓名
|
|
720
|
+
getCandidateUserText(candidateUserList) {
|
|
721
|
+
if (!candidateUserList || candidateUserList.length === 0) return '';
|
|
722
|
+
// 提取所有待审批人姓名
|
|
723
|
+
let approvers = candidateUserList.map(user => user.userName).join('、');
|
|
724
|
+
return approvers;
|
|
673
725
|
}
|
|
674
726
|
},
|
|
675
727
|
mounted () {
|
|
@@ -9,12 +9,6 @@
|
|
|
9
9
|
</p>
|
|
10
10
|
<div style="padding-left:24px">
|
|
11
11
|
<Divider v-if="showTitle" style="margin-top:0px;margin-bottom:10px;"/>
|
|
12
|
-
<!-- <Row v-show="showGrid" type="flex" justify="start" align="middle" :gutter="0" style="margin-bottom:10px;">-->
|
|
13
|
-
<!-- <Button v-if="loadFlag" customIcon="iconfont icon-custom-fileupload" :disabled="btnReadOnly"-->
|
|
14
|
-
<!-- @click="editGrid">上传-->
|
|
15
|
-
<!-- </Button>-->
|
|
16
|
-
<!-- <Button v-else :loading="true">{{ loadingtext }}</Button>-->
|
|
17
|
-
<!-- </Row>-->
|
|
18
12
|
<Upload v-show="false" id="billiviewUp"
|
|
19
13
|
multiple
|
|
20
14
|
ref="billupload"
|
|
@@ -63,6 +57,8 @@ export default {
|
|
|
63
57
|
myConfig: {
|
|
64
58
|
headStyle: '',
|
|
65
59
|
readOnly: false,
|
|
60
|
+
showAddBtn:true,
|
|
61
|
+
showDelBatchBtn:true,
|
|
66
62
|
downfile: '',
|
|
67
63
|
delfile: '',
|
|
68
64
|
pdffile: '/mss-sysconf-boot/downloadPdf?filekey=',
|
|
@@ -90,27 +86,35 @@ export default {
|
|
|
90
86
|
name: 'filememo',
|
|
91
87
|
type: 'ComboBox',
|
|
92
88
|
dictkey: 'CUSTFILETYPE',
|
|
93
|
-
|
|
89
|
+
codeWithName: false,
|
|
90
|
+
width: 300,
|
|
91
|
+
readOnly: true
|
|
94
92
|
}, {
|
|
95
93
|
label: '附件类型',
|
|
96
94
|
name: 'filemode',
|
|
97
95
|
type: 'TextBox',
|
|
98
96
|
width: 300,
|
|
97
|
+
visible: false,
|
|
98
|
+
readOnly: true
|
|
99
99
|
}, {
|
|
100
100
|
label: '文件名称',
|
|
101
101
|
name: 'filename',
|
|
102
|
-
type: 'TextBox'
|
|
102
|
+
type: 'TextBox',
|
|
103
|
+
width: 200,
|
|
104
|
+
readOnly: true
|
|
103
105
|
}, {
|
|
104
106
|
label: '文件大小',
|
|
105
107
|
name: 'filesize',
|
|
106
108
|
render: this.sizeActionRender,
|
|
107
|
-
width: 120
|
|
109
|
+
width: 120,
|
|
110
|
+
readOnly: true
|
|
108
111
|
}, {
|
|
109
112
|
label: '上传日期',
|
|
110
113
|
name: 'ph_timestamp',
|
|
111
114
|
type: 'DateBox',
|
|
112
115
|
vtype: 'datetime',
|
|
113
|
-
width:
|
|
116
|
+
width: 150,
|
|
117
|
+
readOnly: true
|
|
114
118
|
}, {
|
|
115
119
|
label: '操作',
|
|
116
120
|
key: 'action',
|
|
@@ -182,8 +186,11 @@ export default {
|
|
|
182
186
|
if (!this.myConfig.pdffile) {
|
|
183
187
|
this.myConfig.pdffile = this.OmdUrl.pdffile;
|
|
184
188
|
}
|
|
185
|
-
this.myConfig.
|
|
186
|
-
|
|
189
|
+
if (this.myConfig.showTitle !== undefined) {
|
|
190
|
+
this.showTitle = this.myConfig.showTitle;
|
|
191
|
+
}
|
|
192
|
+
// this.myConfig.showAddBtn = true;
|
|
193
|
+
// this.myConfig.showDelBatchBtn = true;
|
|
187
194
|
this.myConfig.generalOrientation = true;
|
|
188
195
|
if (this.myConfig.fileSize !== undefined) {
|
|
189
196
|
this.fileSize = Number(this.myConfig.fileSize) * 1024;
|
|
@@ -450,7 +457,7 @@ export default {
|
|
|
450
457
|
let obj = {};
|
|
451
458
|
obj.readOnly = value;
|
|
452
459
|
this.setPro(obj);
|
|
453
|
-
this.$refs.grid.setReadOnly(
|
|
460
|
+
this.$refs.grid.setReadOnly(value);
|
|
454
461
|
this.setBtnReadOnly(value);
|
|
455
462
|
},
|
|
456
463
|
showTxt (params) {
|
|
@@ -633,8 +640,7 @@ export default {
|
|
|
633
640
|
} else {
|
|
634
641
|
this.btnReadOnly = value;
|
|
635
642
|
}
|
|
636
|
-
}
|
|
637
|
-
|
|
643
|
+
},
|
|
638
644
|
}
|
|
639
645
|
};
|
|
640
646
|
</script>
|
|
@@ -0,0 +1,386 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<Card :bordered="false" :padding="0" dis-hover>
|
|
3
|
+
<p @click="toggle" style="cursor:pointer;" >
|
|
4
|
+
<Row type="flex" :gutter="0" justify="start" align="middle" style="margin-bottom:14px;margin-top:14px;">
|
|
5
|
+
<Col span="18">
|
|
6
|
+
<Icon custom='iconfont icon-custom-pack' color="#f3b352" v-show="showForm" size="14" /><Icon v-show="!showForm" color="#f3b352" custom='iconfont icon-custom-spread' size="14"/>
|
|
7
|
+
<span style="margin-left:10px;font-size: 14px;font-weight:bold" v-text="myConfig.title" />
|
|
8
|
+
</Col>
|
|
9
|
+
<Col v-show="showForm" span="6">
|
|
10
|
+
<Row type="flex" justify="end" :gutter="0" align="middle">
|
|
11
|
+
<Dropdown placement="bottom-start" style="float:right">
|
|
12
|
+
<Button style="height:21px" type="info">
|
|
13
|
+
更多操作
|
|
14
|
+
<Icon type="ios-arrow-down"></Icon>
|
|
15
|
+
</Button>
|
|
16
|
+
<template #list>
|
|
17
|
+
<DropdownMenu>
|
|
18
|
+
<DropdownItem>
|
|
19
|
+
<Button @click.stop="openForm" >全部展开</Button>
|
|
20
|
+
</DropdownItem>
|
|
21
|
+
<DropdownItem >
|
|
22
|
+
<Button @click.stop="closeForm">全部收起</Button>
|
|
23
|
+
</DropdownItem>
|
|
24
|
+
</DropdownMenu>
|
|
25
|
+
</template>
|
|
26
|
+
</Dropdown>
|
|
27
|
+
</Row>
|
|
28
|
+
</Col>
|
|
29
|
+
</Row>
|
|
30
|
+
</p>
|
|
31
|
+
<Divider style="margin-left:24px;margin-bottom:10px;margin-top: 0px;"/>
|
|
32
|
+
<div style="margin-left:24px;" v-show="showForm" >
|
|
33
|
+
<Row style="margin-bottom:10px;">
|
|
34
|
+
<Button style="padding-left:0px;padding-right:0px" customIcon="iconfont icon-custom-rowadd3" type="text" :disabled="btnReadOnly" @click="add" >添加</Button>
|
|
35
|
+
</Row>
|
|
36
|
+
<FormDetail v-if="showAdd" ref="addform" :config="myConfig" :isAdd="true" @doAction="newDoAction" :dictData="dictData"/>
|
|
37
|
+
<FormDetail v-for="(temp,index) in data" :ref="temp.curlIndex" :key="temp.curlIndex" :valueData="temp" :curlIndex="temp.curlIndex" :index="index" :config="myConfig" @doAction="doAction" :dictData="dictData"/>
|
|
38
|
+
</div>
|
|
39
|
+
</Card>
|
|
40
|
+
</template>
|
|
41
|
+
|
|
42
|
+
<script>
|
|
43
|
+
import FormDetail from './formdetailtwo.vue';
|
|
44
|
+
import random from '../../utils/random_str';
|
|
45
|
+
export default {
|
|
46
|
+
name:'mddetail',
|
|
47
|
+
components:{
|
|
48
|
+
FormDetail
|
|
49
|
+
},
|
|
50
|
+
data () {
|
|
51
|
+
return {
|
|
52
|
+
readOnly:false,
|
|
53
|
+
showAdd:false,
|
|
54
|
+
isGrid:false,
|
|
55
|
+
myConfig:{
|
|
56
|
+
title:'',
|
|
57
|
+
titleType:1,
|
|
58
|
+
addBtnType:'1',
|
|
59
|
+
hide:true,
|
|
60
|
+
addBtnName:'新增',
|
|
61
|
+
editBtnName:'编辑'
|
|
62
|
+
},
|
|
63
|
+
showForm:true,
|
|
64
|
+
editFlag:false,
|
|
65
|
+
showBtn:true,
|
|
66
|
+
iconStyle:'',
|
|
67
|
+
pStyle:'',
|
|
68
|
+
data:[],
|
|
69
|
+
delData:[],
|
|
70
|
+
btnReadOnly:false
|
|
71
|
+
};
|
|
72
|
+
},
|
|
73
|
+
props:{
|
|
74
|
+
config:{
|
|
75
|
+
type:Object,
|
|
76
|
+
default:null
|
|
77
|
+
},
|
|
78
|
+
dictData: {
|
|
79
|
+
type: Object,
|
|
80
|
+
default:null
|
|
81
|
+
}
|
|
82
|
+
},
|
|
83
|
+
created () {
|
|
84
|
+
this.init();
|
|
85
|
+
},
|
|
86
|
+
computed: {
|
|
87
|
+
},
|
|
88
|
+
methods:{
|
|
89
|
+
init (){
|
|
90
|
+
this.myConfig = Object.assign({},this.myConfig,this.config);
|
|
91
|
+
if (this.myConfig.effectKey) {
|
|
92
|
+
if (this.myConfig.gridConfig) {
|
|
93
|
+
if (this.myConfig.gridConfig.effectKey === undefined) {
|
|
94
|
+
this.myConfig.gridConfig.effectKey = this.myConfig.effectKey;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
delete this.myConfig.formConfig.name;
|
|
99
|
+
delete this.myConfig.formConfig.title;
|
|
100
|
+
delete this.myConfig.gridConfig.name;
|
|
101
|
+
delete this.myConfig.gridConfig.title;
|
|
102
|
+
},
|
|
103
|
+
setShowGrid (value) {
|
|
104
|
+
this.showForm = value;
|
|
105
|
+
},
|
|
106
|
+
toggle () {
|
|
107
|
+
this.showForm = !this.showForm;
|
|
108
|
+
},
|
|
109
|
+
getRowObject(index) {
|
|
110
|
+
if (index < this.date.length) {
|
|
111
|
+
if (this.$refs[this.date[index].curlIndex] && this.$refs[this.date[index].curlIndex][0]) {
|
|
112
|
+
return this.$refs[this.date[index].curlIndex][0];
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
return null;
|
|
116
|
+
},
|
|
117
|
+
getRandom() {
|
|
118
|
+
return random(8);
|
|
119
|
+
},
|
|
120
|
+
add (obj) {
|
|
121
|
+
let row = null;
|
|
122
|
+
if (this.myConfig.addRowBefore) {
|
|
123
|
+
row = this.myConfig.addRowBefore();
|
|
124
|
+
if (row === false) {
|
|
125
|
+
return;
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
if (!row || row === true) {
|
|
129
|
+
row = {};
|
|
130
|
+
}
|
|
131
|
+
if (obj) {
|
|
132
|
+
row = Object.assign({},row, obj);
|
|
133
|
+
}
|
|
134
|
+
if (!this.showForm) {
|
|
135
|
+
this.showForm = true;
|
|
136
|
+
}
|
|
137
|
+
this.showAdd = false;
|
|
138
|
+
let self = this;
|
|
139
|
+
this.$nextTick(() => {
|
|
140
|
+
this.showAdd = true;
|
|
141
|
+
this.$nextTick(() => {
|
|
142
|
+
setTimeout(() => {
|
|
143
|
+
row.flag = 'I';
|
|
144
|
+
self.$refs.addform.clearData();
|
|
145
|
+
self.$refs.addform.setData(row);
|
|
146
|
+
self.$refs.addform.setFormReadOnly(false);
|
|
147
|
+
}, 200);
|
|
148
|
+
});
|
|
149
|
+
});
|
|
150
|
+
},
|
|
151
|
+
newDoAction (obj) {
|
|
152
|
+
if (this['new' + obj.name]) {
|
|
153
|
+
this['new' + obj.name](obj);
|
|
154
|
+
}
|
|
155
|
+
},
|
|
156
|
+
newsaveForm (obj) {
|
|
157
|
+
let flag = true;
|
|
158
|
+
let temp = obj.para.data;
|
|
159
|
+
temp.curlIndex = 'formdetail_' + this.getRandom();
|
|
160
|
+
temp.flag = 'I';
|
|
161
|
+
if (this.myConfig.newSaveFormBefore) {
|
|
162
|
+
flag = this.myConfig.newSaveFormBefore(temp);
|
|
163
|
+
}
|
|
164
|
+
if (flag) {
|
|
165
|
+
this.data.push(temp);
|
|
166
|
+
this.showAdd = false;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
},
|
|
170
|
+
isChange () {
|
|
171
|
+
let flag = false;
|
|
172
|
+
if (this.data && this.data.length > 0) {
|
|
173
|
+
this.data.forEach(el => {
|
|
174
|
+
if (!flag) {
|
|
175
|
+
if (this.$refs[el.curlIndex] && this.$refs[el.curlIndex][0]) {
|
|
176
|
+
flag = this.$refs[el.curlIndex][0].isChange();
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
});
|
|
180
|
+
}
|
|
181
|
+
return flag;
|
|
182
|
+
},
|
|
183
|
+
isEdit() {
|
|
184
|
+
return this.showAdd;
|
|
185
|
+
},
|
|
186
|
+
newcancelForm () {
|
|
187
|
+
this.showAdd = false;
|
|
188
|
+
},
|
|
189
|
+
doAction (obj) {
|
|
190
|
+
if (this[obj.name]) {
|
|
191
|
+
this[obj.name](obj);
|
|
192
|
+
}
|
|
193
|
+
},
|
|
194
|
+
getData (flag) {
|
|
195
|
+
let data = [];
|
|
196
|
+
this.data.forEach(el => {
|
|
197
|
+
let obj = this.$Method.copy(el);
|
|
198
|
+
if (!flag) {
|
|
199
|
+
delete obj.curlIndex;
|
|
200
|
+
}
|
|
201
|
+
data.push(obj);
|
|
202
|
+
});
|
|
203
|
+
return data;
|
|
204
|
+
},
|
|
205
|
+
setData (data) {
|
|
206
|
+
this.data = [];
|
|
207
|
+
this.delData = [];
|
|
208
|
+
data.forEach(el => {
|
|
209
|
+
el.curlIndex = 'formdetail_' + this.getRandom();
|
|
210
|
+
});
|
|
211
|
+
this.$nextTick(() => {
|
|
212
|
+
this.data =this.$Method.copy(data);
|
|
213
|
+
});
|
|
214
|
+
},
|
|
215
|
+
setEffectData(data) {
|
|
216
|
+
this.data.forEach(el => {
|
|
217
|
+
if (this.$refs[el.curlIndex] && this.$refs[el.curlIndex][0]) {
|
|
218
|
+
let tmp = [];
|
|
219
|
+
if (this.myConfig.effectKey) {
|
|
220
|
+
let tmpIdex = data.findIndex(el2 => el[this.myConfig.effectKey] === el2[this.myConfig.effectKey]);
|
|
221
|
+
if (tmpIdex > -1) {
|
|
222
|
+
tmp = this.$Method.copy(data[tmpIdex]);
|
|
223
|
+
}
|
|
224
|
+
this.$refs[el.curlIndex][0].setEffectData(tmp);
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
});
|
|
228
|
+
},
|
|
229
|
+
|
|
230
|
+
saveForm (obj) {
|
|
231
|
+
let index = this.data.findIndex(el => el.curlIndex === obj.para.curlIndex);
|
|
232
|
+
if (index > -1) {
|
|
233
|
+
if (this.data[index].flag === undefined) {
|
|
234
|
+
obj.para.data.flag = 'U';
|
|
235
|
+
}
|
|
236
|
+
this.data.splice(index, 1, obj.para.data);
|
|
237
|
+
}
|
|
238
|
+
},
|
|
239
|
+
delForm (obj) {
|
|
240
|
+
this.delCommonForm(obj);
|
|
241
|
+
},
|
|
242
|
+
delCommonForm(obj) {
|
|
243
|
+
let index = this.data.findIndex(el => el.curlIndex === obj.para.curlIndex);
|
|
244
|
+
let that = this;
|
|
245
|
+
if (index > -1) {
|
|
246
|
+
let form = this.$Method.copy(this.data[index]);
|
|
247
|
+
if (this.$refs[obj.para.curlIndex] && this.$refs[obj.para.curlIndex][0]) {
|
|
248
|
+
form = this.$refs[obj.para.curlIndex][0].getData();
|
|
249
|
+
}
|
|
250
|
+
if (this.myConfig.delRowBefore) {
|
|
251
|
+
let obj = {};
|
|
252
|
+
obj.index = index;
|
|
253
|
+
obj.gridObject = that;
|
|
254
|
+
obj.form = Object.assign({}, form);
|
|
255
|
+
let flag = this.myConfig.delRowBefore(obj);
|
|
256
|
+
if (flag === false) {
|
|
257
|
+
return;
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
if (form.flag === undefined || form.flag === 'U') {
|
|
261
|
+
form.flag = 'D';
|
|
262
|
+
delete form.index;
|
|
263
|
+
delete form.curlIndex;
|
|
264
|
+
this.delData.push(form);
|
|
265
|
+
}
|
|
266
|
+
this.data.splice(index, 1);
|
|
267
|
+
}
|
|
268
|
+
},
|
|
269
|
+
editForm(obj) {
|
|
270
|
+
this.showAdd = false;
|
|
271
|
+
if (this.$refs.addform) {
|
|
272
|
+
this.$refs.addform.clearData(obj);
|
|
273
|
+
}
|
|
274
|
+
},
|
|
275
|
+
setReadOnly(value) {
|
|
276
|
+
this.readOnly = value;
|
|
277
|
+
this.$nextTick(() => {
|
|
278
|
+
this.data.forEach(el => {
|
|
279
|
+
if (this.$refs[el.curlIndex] && this.$refs[el.curlIndex][0]) {
|
|
280
|
+
this.$refs[el.curlIndex][0].setReadOnly(value);
|
|
281
|
+
}
|
|
282
|
+
});
|
|
283
|
+
});
|
|
284
|
+
if (this.readOnly) {
|
|
285
|
+
this.showAdd = false;
|
|
286
|
+
}
|
|
287
|
+
this.setBtnReadOnly(value);
|
|
288
|
+
},
|
|
289
|
+
clearData () {
|
|
290
|
+
this.data = [];
|
|
291
|
+
this.delData = [];
|
|
292
|
+
this.showAdd = false;
|
|
293
|
+
if (this.$refs.addform) {
|
|
294
|
+
this.$refs.addform.clearData();
|
|
295
|
+
}
|
|
296
|
+
},
|
|
297
|
+
getChangeData() {
|
|
298
|
+
return this.getCommonChangeData(this.data);
|
|
299
|
+
},
|
|
300
|
+
getCommonChangeData(data) {
|
|
301
|
+
let changeData = [];
|
|
302
|
+
if (data.length > 0) {
|
|
303
|
+
data.forEach(el => {
|
|
304
|
+
if (this.$refs[el.curlIndex] && this.$refs[el.curlIndex][0]) {
|
|
305
|
+
if (this.$refs[el.curlIndex][0].isChange()) {
|
|
306
|
+
changeData.push(this.$refs[el.curlIndex][0].getChangeData());
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
});
|
|
310
|
+
}
|
|
311
|
+
return changeData.concat(this.delData);
|
|
312
|
+
},
|
|
313
|
+
editDetails() {
|
|
314
|
+
if (this.checkIsEdit()) {
|
|
315
|
+
this.editFlag = true;
|
|
316
|
+
this.setReadOnly(false);
|
|
317
|
+
} else {
|
|
318
|
+
this.editFlag = false;
|
|
319
|
+
this.setReadOnly(true);
|
|
320
|
+
}
|
|
321
|
+
},
|
|
322
|
+
checkIsEdit() {
|
|
323
|
+
let flag = true;
|
|
324
|
+
if (this.myConfig.editObjectBefore) {
|
|
325
|
+
flag = this.myConfig.editObjectBefore(this.myConfig.name);
|
|
326
|
+
}
|
|
327
|
+
return flag;
|
|
328
|
+
},
|
|
329
|
+
save () {
|
|
330
|
+
if (this.checkValidate()){
|
|
331
|
+
return;
|
|
332
|
+
}
|
|
333
|
+
let obj = {};
|
|
334
|
+
obj.name = 'saveDetails';
|
|
335
|
+
obj.detailsname = this.myConfig.name;
|
|
336
|
+
this.editFlag = false;
|
|
337
|
+
this.$emit('doAction', obj);
|
|
338
|
+
},
|
|
339
|
+
delRowData (obj) {
|
|
340
|
+
this.delForm(obj);
|
|
341
|
+
},
|
|
342
|
+
checkValidate () {
|
|
343
|
+
let flag = false;
|
|
344
|
+
this.data.some(el => {
|
|
345
|
+
if (this.$refs[el.curlIndex] && this.$refs[el.curlIndex][0]) {
|
|
346
|
+
flag = this.$refs[el.curlIndex][0].checkValidate();
|
|
347
|
+
if (flag) {
|
|
348
|
+
return true;
|
|
349
|
+
}
|
|
350
|
+
}
|
|
351
|
+
});
|
|
352
|
+
if (flag) {
|
|
353
|
+
this.alert('必填项不允许为空');
|
|
354
|
+
}
|
|
355
|
+
return flag;
|
|
356
|
+
},
|
|
357
|
+
cancel() {
|
|
358
|
+
this.editFlag = false;
|
|
359
|
+
this.delData = [];
|
|
360
|
+
},
|
|
361
|
+
setShowBtn(value) {
|
|
362
|
+
this.showBtn = value;
|
|
363
|
+
},
|
|
364
|
+
setBtnReadOnly(value) {
|
|
365
|
+
this.btnReadOnly = value;
|
|
366
|
+
},
|
|
367
|
+
openForm () {
|
|
368
|
+
this.data.forEach(el => {
|
|
369
|
+
if (this.$refs[el.curlIndex] && this.$refs[el.curlIndex][0]) {
|
|
370
|
+
this.$refs[el.curlIndex][0].setShowForm(true);
|
|
371
|
+
}
|
|
372
|
+
});
|
|
373
|
+
},
|
|
374
|
+
closeForm() {
|
|
375
|
+
this.data.forEach(el => {
|
|
376
|
+
if (this.$refs[el.curlIndex] && this.$refs[el.curlIndex][0]) {
|
|
377
|
+
this.$refs[el.curlIndex][0].setShowForm(false);
|
|
378
|
+
}
|
|
379
|
+
});
|
|
380
|
+
this.showAdd = false;
|
|
381
|
+
},
|
|
382
|
+
},
|
|
383
|
+
mounted () {
|
|
384
|
+
}
|
|
385
|
+
};
|
|
386
|
+
</script>
|
|
@@ -1,8 +1,22 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<Card ref="card" :bordered="false" :padding="0" dis-hover>
|
|
3
|
+
<div v-if="$slots.header">
|
|
4
|
+
<slot name="header"></slot>
|
|
5
|
+
</div>
|
|
6
|
+
<Row class-name="row-box" v-else v-show="showGrid" type="flex" justify="start" align="middle" :gutter="0" style="margin-bottom: 10px;">
|
|
7
|
+
<Col v-if="showAddBtn">
|
|
8
|
+
<Button :style="btnStyle" customIcon="iconfont icon-custom-rowadd3" type="text" :disabled="myConfig.readOnly" @click="addRow" >添加</Button>
|
|
9
|
+
</Col>
|
|
10
|
+
<Col v-if="showAddBtn && showDelBatchBtn">
|
|
11
|
+
<Divider type="vertical" style="margin: 0 6px 0 6px;"/>
|
|
12
|
+
</Col>
|
|
13
|
+
<Col v-if="showDelBatchBtn">
|
|
14
|
+
<Button :style="btnStyle" customIcon="iconfont icon-custom-rowdel3" type="text" :disabled="myConfig.readOnly" @click="delBatchRow">删除</Button>
|
|
15
|
+
</Col>
|
|
16
|
+
</Row>
|
|
3
17
|
<Row style="margin-top: 10px;">
|
|
4
18
|
<Table ref="table" :row-class-name="rowClassName" :loading="loading" :size="myConfig.tableSize" :stripe="myConfig.showStripe" :border="myConfig.showBorder" :height="tableHeight" :maxHeight="tableMaxHeight" :show-header="myConfig.showHeader" @on-selection-change="OnSelectionChange" :columns="tableColumns" :data="data" @on-column-width-resize="onColumnWidthResize" :show-summary="myConfig.showSummary" :summary-method="handleSummary">
|
|
5
|
-
<template v-for="config in soltTableColumns" v-slot:[config.key]="{ index }" :key="'show_' + config.key">
|
|
19
|
+
<template v-for="config in soltTableColumns" v-slot:[config.key]="{ index }" :key="'show_' + config.key">
|
|
6
20
|
<div @click="EditCell(index,config)" :class="config.cellClassName">
|
|
7
21
|
<ControlBox v-if="editIndex === index && editKey=== config.key" :autofocus="true" :config="getCellConfig(index,config)" :valueData="getCurRow(index)" @inputValue="input" :editIndex="index" @doAction="doAction"></ControlBox>
|
|
8
22
|
<ShowText v-else :label="formatValue(index,config)" :contentAlign="config.contentAlign" :class="IsCellError(index,config)" :config="config" :rowIndex="index"></ShowText>
|
|
@@ -41,8 +55,9 @@ export default {
|
|
|
41
55
|
showAppendixCol:false,
|
|
42
56
|
appedixLable:'附件'
|
|
43
57
|
},
|
|
44
|
-
|
|
45
|
-
|
|
58
|
+
btnStyle:'padding-left:0px;padding-right:0px',
|
|
59
|
+
showAddBtn:false,
|
|
60
|
+
showDelBatchBtn:false,
|
|
46
61
|
showGrid:true,
|
|
47
62
|
showTitle:true,
|
|
48
63
|
actionAppendixConfig:{
|
|
@@ -55,6 +70,9 @@ export default {
|
|
|
55
70
|
|
|
56
71
|
};
|
|
57
72
|
},
|
|
73
|
+
created () {
|
|
74
|
+
this.myConfig = Object.assign({}, this.myConfig, this.config);
|
|
75
|
+
},
|
|
58
76
|
methods: {
|
|
59
77
|
customInit2() {
|
|
60
78
|
if (this.myConfig.showTitle !== undefined) {
|
|
@@ -67,13 +85,13 @@ export default {
|
|
|
67
85
|
if (!el.width && !el.minWidth) {
|
|
68
86
|
el.minWidth = 60;
|
|
69
87
|
}
|
|
70
|
-
});
|
|
88
|
+
});
|
|
71
89
|
if (this.myConfig.showAppendixCol) {
|
|
72
90
|
this.actionAppendixConfig.label = this.myConfig.appedixLable;
|
|
73
91
|
this.myConfig.items.push(this.actionAppendixConfig);
|
|
74
92
|
}
|
|
75
93
|
|
|
76
|
-
|
|
94
|
+
|
|
77
95
|
},
|
|
78
96
|
toggle () {
|
|
79
97
|
this.showGrid = !this.showGrid;
|
|
@@ -105,8 +105,6 @@ export default {
|
|
|
105
105
|
this.myConfig.gridConfig.overrideData = this.gridOverrideData;
|
|
106
106
|
this.myConfig.gridConfig.showCondition = false;
|
|
107
107
|
this.myConfig.gridConfig.resources = this.myConfig.resources;
|
|
108
|
-
this.myConfig.gridConfig.method = this.myConfig.classPrefix + '.search';
|
|
109
|
-
this.myConfig.gridConfig.response = this.myConfig.response;
|
|
110
108
|
this.myConfig.gridConfig.tableSize ='small';
|
|
111
109
|
this.myConfig.gridConfig.showBorder = false;
|
|
112
110
|
this.myConfig.gridConfig.pageShowSizer = false;
|
|
@@ -116,6 +114,12 @@ export default {
|
|
|
116
114
|
if (this.myConfig.gridConfig.title !== undefined) {
|
|
117
115
|
this.myConfig.gridtitle = this.myConfig.gridConfig.title;
|
|
118
116
|
}
|
|
117
|
+
if (!this.myConfig.gridConfig.method) {
|
|
118
|
+
this.myConfig.gridConfig.method = this.myConfig.classPrefix + '.search';
|
|
119
|
+
}
|
|
120
|
+
if (!this.myConfig.gridConfig.response) {
|
|
121
|
+
this.myConfig.gridConfig.response = this.myConfig.response;
|
|
122
|
+
}
|
|
119
123
|
|
|
120
124
|
this.myConfig.gridConfig.multiSelect = false;
|
|
121
125
|
if (this.myConfig.treeConfig.items) {
|