n20-common-lib 2.22.26 → 2.22.27
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/package.json +1 -1
- package/src/assets/css/table.scss +2 -2
- package/src/components/ApprovalButtons/index.vue +66 -92
- package/src/components/ApprovalButtons/indexApp.vue +12 -0
- package/src/components/ApprovalButtons/showOtherAttrNew.vue +79 -31
- package/src/components/TablePro/index.js +1 -27
- package/src/components/TablePro/index.vue +3 -3
- package/style/index.css +1 -1
- package/theme/blue.css +1 -1
- package/theme/cctcRed.css +1 -1
- package/theme/green.css +1 -1
- package/theme/lightBlue.css +1 -1
- package/theme/orange.css +1 -1
- package/theme/purple.css +1 -1
- package/theme/red.css +1 -1
- package/theme/yellow.css +1 -1
package/package.json
CHANGED
|
@@ -136,11 +136,11 @@
|
|
|
136
136
|
line-height: 16px !important;
|
|
137
137
|
vertical-align: middle !important;
|
|
138
138
|
cursor: pointer;
|
|
139
|
-
|
|
139
|
+
padding-right: 4px !important;
|
|
140
140
|
.vxe-sort--asc-btn,
|
|
141
141
|
.vxe-sort--desc-btn {
|
|
142
142
|
width: 6px;
|
|
143
|
-
height:
|
|
143
|
+
height: 12px !important;
|
|
144
144
|
color: #333;
|
|
145
145
|
border: none;
|
|
146
146
|
font-style: normal;
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
title="自定义项"
|
|
8
8
|
:default-expand="otherExpand"
|
|
9
9
|
>
|
|
10
|
-
<el-form ref="approveBtnGroup" label-position="right"
|
|
10
|
+
<el-form ref="approveBtnGroup" label-position="right" label-width="12em">
|
|
11
11
|
<div
|
|
12
12
|
class="p-b-lg p-t-lg p-r-lg"
|
|
13
13
|
style="max-height: 150px; overflow-y: auto; border: 1px dashed var(--border-color-base); border-radius: 5px"
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
</div>
|
|
28
28
|
</div>
|
|
29
29
|
<!-- 抄送加签 -->
|
|
30
|
-
<el-form ref="
|
|
30
|
+
<el-form ref="addEndorseForm" label-position="right" :label-width="_lang === 'zh' ? '6em' : '12em'">
|
|
31
31
|
<div v-if="taskId && showBtn" class="flex-box">
|
|
32
32
|
<el-form-item v-if="authList.includes('isCarboncopy')" :label="'抄送' | $lc" class="flex-1 m-b-s">
|
|
33
33
|
<el-input
|
|
@@ -221,7 +221,7 @@
|
|
|
221
221
|
<carboncopy-prop
|
|
222
222
|
type="addtask"
|
|
223
223
|
:carbon-copy-list="addTaskList"
|
|
224
|
-
@close="
|
|
224
|
+
@close="setAddtaskV = false"
|
|
225
225
|
@confirm="setAddtaskOk"
|
|
226
226
|
/>
|
|
227
227
|
</cl-dialog>
|
|
@@ -598,22 +598,25 @@ export default {
|
|
|
598
598
|
this.checkFlowFn()
|
|
599
599
|
}
|
|
600
600
|
}
|
|
601
|
-
// addTaskTip
|
|
602
|
-
if (res.code === 200 && res.data && res.data.addTaskTip) {
|
|
603
|
-
this
|
|
604
|
-
|
|
601
|
+
// addTaskTip 是否给出加签提示
|
|
602
|
+
if (res.code === 200 && res.data && res.data.addTaskTip && !this.addTaskList.length) {
|
|
603
|
+
this.$confirm('请检查是否向后加签', $lc('提示'), {
|
|
604
|
+
confirmButtonText: $lc('确定'),
|
|
605
|
+
cancelButtonText: $lc('取消'),
|
|
606
|
+
type: 'warning'
|
|
607
|
+
})
|
|
608
|
+
.then(handleResult)
|
|
609
|
+
.catch(() => {})
|
|
605
610
|
} else {
|
|
606
611
|
handleResult()
|
|
607
612
|
}
|
|
608
613
|
} catch (error) {
|
|
609
|
-
console.log(error)
|
|
610
614
|
this.checkFlowFn()
|
|
611
615
|
}
|
|
612
616
|
})
|
|
613
617
|
},
|
|
614
618
|
// 选择审批人
|
|
615
619
|
selectSprListFn(data) {
|
|
616
|
-
console.log(data)
|
|
617
620
|
this.nextEgwOutgoingNodeId = data.nextEgwOutgoingNodeId
|
|
618
621
|
this.nextNodeApproveUnos = data.nextNodeApproveUnos
|
|
619
622
|
this.setSpr = false
|
|
@@ -637,7 +640,6 @@ export default {
|
|
|
637
640
|
this.IsShowUploadWidget = data
|
|
638
641
|
}
|
|
639
642
|
}
|
|
640
|
-
console.log(code, data)
|
|
641
643
|
},
|
|
642
644
|
// 意见是否必填
|
|
643
645
|
getConfiguration() {
|
|
@@ -645,13 +647,11 @@ export default {
|
|
|
645
647
|
.then(({ opinionRequired, showApproveTo }) => {
|
|
646
648
|
this.requiredC = opinionRequired ?? this.required
|
|
647
649
|
this.showApproveTo = showApproveTo ?? true
|
|
648
|
-
// 读取该工作流是否意见必填
|
|
649
|
-
if (this.$route.query.remarkIsMust !== undefined) {
|
|
650
|
-
this.requiredC = this.$route.query.remarkIsMust === '1'
|
|
651
|
-
}
|
|
652
650
|
})
|
|
653
651
|
.catch(() => {
|
|
654
652
|
this.requiredC = this.required
|
|
653
|
+
})
|
|
654
|
+
.finally(() => {
|
|
655
655
|
// 读取该工作流是否意见必填
|
|
656
656
|
if (this.$route.query.remarkIsMust !== undefined) {
|
|
657
657
|
this.requiredC = this.$route.query.remarkIsMust === '1'
|
|
@@ -659,15 +659,20 @@ export default {
|
|
|
659
659
|
})
|
|
660
660
|
},
|
|
661
661
|
getTodoList() {
|
|
662
|
-
return new Promise((resolve
|
|
662
|
+
return new Promise((resolve) => {
|
|
663
663
|
const dto = JSON.parse(sessionStorage.getItem(`approvalDto`))
|
|
664
|
-
axios
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
664
|
+
axios
|
|
665
|
+
.post('/bems/activiti/admin/todo/todo', dto)
|
|
666
|
+
.then(({ data, code }) => {
|
|
667
|
+
if (code === 200) {
|
|
668
|
+
const { list } = data
|
|
669
|
+
this.todoList = list || []
|
|
670
|
+
}
|
|
668
671
|
resolve({ data, code })
|
|
669
|
-
}
|
|
670
|
-
|
|
672
|
+
})
|
|
673
|
+
.catch(() => {
|
|
674
|
+
resolve({ data: {}, code: -1 })
|
|
675
|
+
})
|
|
671
676
|
})
|
|
672
677
|
},
|
|
673
678
|
// 获取加签方式的模式
|
|
@@ -829,8 +834,24 @@ export default {
|
|
|
829
834
|
setParam(obj) {
|
|
830
835
|
Object.assign(this.otherAtt, obj)
|
|
831
836
|
},
|
|
832
|
-
//
|
|
833
|
-
|
|
837
|
+
// 提交前统一校验:意见是否必填、加签审批方式是否选择
|
|
838
|
+
validateBeforeSubmit() {
|
|
839
|
+
if (this.authList.includes('isShowOtherAtt')) {
|
|
840
|
+
const valid = this.$refs['showOtherAttNew']?.validate()
|
|
841
|
+
if (!valid) return false
|
|
842
|
+
}
|
|
843
|
+
if (this.requiredC && !this.messageC) {
|
|
844
|
+
this.errMsgFn(this.authList.includes('byAddTask') && this.addTaskList.length > 0 ? $lc('加签') : $lc('批准'))
|
|
845
|
+
return false
|
|
846
|
+
}
|
|
847
|
+
if (this.addTaskList.length > 0 && !this.addTaskType) {
|
|
848
|
+
this.addErrFn()
|
|
849
|
+
return false
|
|
850
|
+
}
|
|
851
|
+
return true
|
|
852
|
+
},
|
|
853
|
+
// 处理提交响应中的失败信息,返回 true 表示有失败
|
|
854
|
+
_handleFailMsg(data = {}, str = $lc('操作')) {
|
|
834
855
|
let { failCount, failList = {} } = data
|
|
835
856
|
if (failCount > 0) {
|
|
836
857
|
if (Array.isArray(failList)) {
|
|
@@ -846,7 +867,13 @@ export default {
|
|
|
846
867
|
} else {
|
|
847
868
|
this.$message.error(str + $lc('失败'))
|
|
848
869
|
}
|
|
849
|
-
|
|
870
|
+
return true
|
|
871
|
+
}
|
|
872
|
+
return false
|
|
873
|
+
},
|
|
874
|
+
// 提交后的提示
|
|
875
|
+
thenMsg(data = {}, str = $lc('操作')) {
|
|
876
|
+
if (!this._handleFailMsg(data, str)) {
|
|
850
877
|
this.$emit('afterFn', str)
|
|
851
878
|
this.$message.success(str + $lc('成功'))
|
|
852
879
|
setTimeout(this.goFrom, 300)
|
|
@@ -870,8 +897,17 @@ export default {
|
|
|
870
897
|
if (!bFn) {
|
|
871
898
|
callFn()
|
|
872
899
|
} else {
|
|
873
|
-
let
|
|
874
|
-
|
|
900
|
+
let called = false
|
|
901
|
+
let wrappedCallFn = () => {
|
|
902
|
+
if (!called) {
|
|
903
|
+
called = true
|
|
904
|
+
callFn()
|
|
905
|
+
}
|
|
906
|
+
}
|
|
907
|
+
let F = bFn(wrappedCallFn)
|
|
908
|
+
if (F && F.then && typeof F.then === 'function') {
|
|
909
|
+
F.then(wrappedCallFn)
|
|
910
|
+
}
|
|
875
911
|
}
|
|
876
912
|
},
|
|
877
913
|
// 查询是否配置 允许不重走流程
|
|
@@ -888,7 +924,6 @@ export default {
|
|
|
888
924
|
)
|
|
889
925
|
return code === 200 && data
|
|
890
926
|
} catch (error) {
|
|
891
|
-
console.error('查询是否配置允许不重走流程接口错误:', error)
|
|
892
927
|
return false
|
|
893
928
|
}
|
|
894
929
|
},
|
|
@@ -963,14 +998,7 @@ export default {
|
|
|
963
998
|
},
|
|
964
999
|
|
|
965
1000
|
async checkFlowFn() {
|
|
966
|
-
if (
|
|
967
|
-
return this.errMsgFn(
|
|
968
|
-
this.authList.includes('byAddTask') && this.addTaskList.length > 0 ? $lc('加签') : $lc('批准')
|
|
969
|
-
)
|
|
970
|
-
}
|
|
971
|
-
if (this.addTaskList.length > 0 && !this.addTaskType) {
|
|
972
|
-
return this.addErrFn()
|
|
973
|
-
}
|
|
1001
|
+
if (!this.validateBeforeSubmit()) return
|
|
974
1002
|
let { isCheck, taskId, appNo, groupNo, typeCode, orderId, isAgentcy } = this.$route.query
|
|
975
1003
|
this.isWyfk = ['PUBLIC_PAYMENT', 'BATCH_PERSON_PAYMENT'].includes(typeCode)
|
|
976
1004
|
if (isCheck === '1' && this.isCheck) {
|
|
@@ -1026,14 +1054,7 @@ export default {
|
|
|
1026
1054
|
},
|
|
1027
1055
|
// 审批
|
|
1028
1056
|
approvalFn() {
|
|
1029
|
-
if (
|
|
1030
|
-
return this.errMsgFn(
|
|
1031
|
-
this.authList.includes('byAddTask') && this.addTaskList.length > 0 ? $lc('加签') : $lc('批准')
|
|
1032
|
-
)
|
|
1033
|
-
}
|
|
1034
|
-
if (this.addTaskList.length > 0 && !this.addTaskType) {
|
|
1035
|
-
return this.addErrFn()
|
|
1036
|
-
}
|
|
1057
|
+
if (!this.validateBeforeSubmit()) return
|
|
1037
1058
|
axios.post('/bems/activiti/admin/todo/advance', this.getParam()).then(({ data }) => {
|
|
1038
1059
|
this.thenMsg(
|
|
1039
1060
|
data,
|
|
@@ -1042,33 +1063,11 @@ export default {
|
|
|
1042
1063
|
})
|
|
1043
1064
|
},
|
|
1044
1065
|
approvalNext() {
|
|
1045
|
-
if (
|
|
1046
|
-
return this.errMsgFn(
|
|
1047
|
-
this.authList.includes('byAddTask') && this.addTaskList.length > 0 ? $lc('加签') : $lc('批准')
|
|
1048
|
-
)
|
|
1049
|
-
}
|
|
1050
|
-
if (this.addTaskList.length > 0 && !this.addTaskType) {
|
|
1051
|
-
return this.addErrFn()
|
|
1052
|
-
}
|
|
1066
|
+
if (!this.validateBeforeSubmit()) return
|
|
1053
1067
|
|
|
1054
1068
|
this.beforeFn(this.beforeRatify, () => {
|
|
1055
1069
|
axios.post('/bems/activiti/admin/todo/advance', this.getParam()).then(({ data }) => {
|
|
1056
|
-
|
|
1057
|
-
if (failCount > 0) {
|
|
1058
|
-
if (Array.isArray(failList)) {
|
|
1059
|
-
let _failList = {}
|
|
1060
|
-
failList.forEach((f = {}) => {
|
|
1061
|
-
Object.assign(_failList, f)
|
|
1062
|
-
})
|
|
1063
|
-
failList = _failList
|
|
1064
|
-
}
|
|
1065
|
-
let errArr = Object.values(failList)
|
|
1066
|
-
if (errArr.length > 0) {
|
|
1067
|
-
this.$message.error(errArr.join('、'))
|
|
1068
|
-
} else {
|
|
1069
|
-
this.$message.error($lc('审批失败'))
|
|
1070
|
-
}
|
|
1071
|
-
} else {
|
|
1070
|
+
if (!this._handleFailMsg(data, $lc('审批'))) {
|
|
1072
1071
|
this.$message.success($lc('审批成功'))
|
|
1073
1072
|
closeTagsForBackPage()
|
|
1074
1073
|
this.getTodoList().finally(() => {
|
|
@@ -1137,14 +1136,6 @@ export default {
|
|
|
1137
1136
|
|
|
1138
1137
|
this.setCarboncopyV = false
|
|
1139
1138
|
},
|
|
1140
|
-
setAddtaskClose() {
|
|
1141
|
-
this.setAddtaskV = false
|
|
1142
|
-
if (this._pendingAddTaskTip) {
|
|
1143
|
-
const callback = this._pendingAddTaskTip
|
|
1144
|
-
this._pendingAddTaskTip = null
|
|
1145
|
-
callback()
|
|
1146
|
-
}
|
|
1147
|
-
},
|
|
1148
1139
|
setAddtaskOk(list) {
|
|
1149
1140
|
this.addTaskList = list
|
|
1150
1141
|
if (this.addTaskList.length > 0 && !this.addTaskType) {
|
|
@@ -1156,23 +1147,6 @@ export default {
|
|
|
1156
1147
|
}
|
|
1157
1148
|
|
|
1158
1149
|
this.setAddtaskV = false
|
|
1159
|
-
|
|
1160
|
-
// 加签提示场景:未选择被加签人时,弹窗确认是否向后加签
|
|
1161
|
-
if (this._pendingAddTaskTip) {
|
|
1162
|
-
const callback = this._pendingAddTaskTip
|
|
1163
|
-
this._pendingAddTaskTip = null
|
|
1164
|
-
if (this.addTaskList.length === 0) {
|
|
1165
|
-
this.$confirm('请检查是否向后加签', $lc('提示'), {
|
|
1166
|
-
confirmButtonText: $lc('确定'),
|
|
1167
|
-
cancelButtonText: $lc('取消'),
|
|
1168
|
-
type: 'warning'
|
|
1169
|
-
}).then(() => {
|
|
1170
|
-
callback()
|
|
1171
|
-
}).catch(() => {})
|
|
1172
|
-
} else {
|
|
1173
|
-
callback()
|
|
1174
|
-
}
|
|
1175
|
-
}
|
|
1176
1150
|
},
|
|
1177
1151
|
getFileDtos(fileList) {
|
|
1178
1152
|
return fileList.map((file) => {
|
|
@@ -893,6 +893,10 @@ export default {
|
|
|
893
893
|
},
|
|
894
894
|
|
|
895
895
|
async checkFlowFn() {
|
|
896
|
+
if (this.authList.includes('isShowOtherAtt')) {
|
|
897
|
+
const valid = this.$refs['showOtherAttNew']?.validate()
|
|
898
|
+
if (!valid) return
|
|
899
|
+
}
|
|
896
900
|
if (this.requiredC && !this.messageC) {
|
|
897
901
|
return this.errMsgFn(
|
|
898
902
|
this.authList.includes('byAddTask') && this.addTaskList.length > 0 ? $lc('加签') : $lc('批准')
|
|
@@ -956,6 +960,10 @@ export default {
|
|
|
956
960
|
},
|
|
957
961
|
// 审批
|
|
958
962
|
approvalFn() {
|
|
963
|
+
if (this.authList.includes('isShowOtherAtt')) {
|
|
964
|
+
const valid = this.$refs['showOtherAttNew']?.validate()
|
|
965
|
+
if (!valid) return
|
|
966
|
+
}
|
|
959
967
|
if (this.requiredC && !this.messageC) {
|
|
960
968
|
return this.errMsgFn(
|
|
961
969
|
this.authList.includes('byAddTask') && this.addTaskList.length > 0 ? $lc('加签') : $lc('批准')
|
|
@@ -972,6 +980,10 @@ export default {
|
|
|
972
980
|
})
|
|
973
981
|
},
|
|
974
982
|
approvalNext() {
|
|
983
|
+
if (this.authList.includes('isShowOtherAtt')) {
|
|
984
|
+
const valid = this.$refs['showOtherAttNew']?.validate()
|
|
985
|
+
if (!valid) return
|
|
986
|
+
}
|
|
975
987
|
if (this.requiredC && !this.messageC) {
|
|
976
988
|
return this.errMsgFn(
|
|
977
989
|
this.authList.includes('byAddTask') && this.addTaskList.length > 0 ? $lc('加签') : $lc('批准')
|
|
@@ -21,6 +21,14 @@
|
|
|
21
21
|
class="input-w"
|
|
22
22
|
clearable
|
|
23
23
|
/>
|
|
24
|
+
<el-input
|
|
25
|
+
v-if="['12'].includes(item.cfgType)"
|
|
26
|
+
v-model="item.cfgVal"
|
|
27
|
+
:type="'textarea'"
|
|
28
|
+
placeholder="请输入"
|
|
29
|
+
class="input-w"
|
|
30
|
+
clearable
|
|
31
|
+
/>
|
|
24
32
|
<el-select
|
|
25
33
|
v-if="['21'].includes(item.cfgType)"
|
|
26
34
|
v-model="item.cfgVal"
|
|
@@ -58,20 +66,17 @@
|
|
|
58
66
|
placeholder="选择日期"
|
|
59
67
|
/>
|
|
60
68
|
</el-form-item>
|
|
61
|
-
<el-
|
|
62
|
-
v-if="['12'].includes(item.cfgType)"
|
|
63
|
-
v-model="item.cfgVal"
|
|
64
|
-
:type="'textarea'"
|
|
65
|
-
placeholder="请输入"
|
|
66
|
-
class="w-100p m-r-s m-b-s flex-1"
|
|
67
|
-
clearable
|
|
68
|
-
/>
|
|
69
|
-
<el-input
|
|
69
|
+
<el-form-item
|
|
70
70
|
v-if="item.cfgHasRemark === '1' && !['11', '12'].includes(item.cfgType)"
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
71
|
+
class="m-r-ss m-b-s flex-1"
|
|
72
|
+
label="备注"
|
|
73
|
+
>
|
|
74
|
+
<el-input
|
|
75
|
+
v-model="item.cfgRemark"
|
|
76
|
+
class="input-w"
|
|
77
|
+
placeholder="请输入备注"
|
|
78
|
+
/>
|
|
79
|
+
</el-form-item>
|
|
75
80
|
</div>
|
|
76
81
|
</div>
|
|
77
82
|
</template>
|
|
@@ -110,19 +115,45 @@ export default {
|
|
|
110
115
|
mounted() {
|
|
111
116
|
this.getData(this.otherAttDataA)
|
|
112
117
|
},
|
|
118
|
+
watch: {
|
|
119
|
+
otherAttDataA: {
|
|
120
|
+
handler(val) {
|
|
121
|
+
this.getData(val)
|
|
122
|
+
},
|
|
123
|
+
deep: true
|
|
124
|
+
}
|
|
125
|
+
},
|
|
113
126
|
methods: {
|
|
127
|
+
initItem(item) {
|
|
128
|
+
if (['32'].includes(item.cfgType)) {
|
|
129
|
+
this.$set(item, 'checkList', item.checkList || [])
|
|
130
|
+
}
|
|
131
|
+
if (['31'].includes(item.cfgType)) {
|
|
132
|
+
this.$set(item, 'selectList', item.selectList || [])
|
|
133
|
+
}
|
|
134
|
+
if (item.cfgHasRemark === '1' && item.cfgRemark === undefined) {
|
|
135
|
+
this.$set(item, 'cfgRemark', '')
|
|
136
|
+
}
|
|
137
|
+
if (item.cfgVal === undefined) {
|
|
138
|
+
this.$set(item, 'cfgVal', '')
|
|
139
|
+
}
|
|
140
|
+
this.setDefaultValue(item)
|
|
141
|
+
return item
|
|
142
|
+
},
|
|
114
143
|
setDefaultValue(item) {
|
|
115
144
|
const defaultTypes = ['22', '21', '31', '32']
|
|
116
145
|
// 不满足条件的直接返回
|
|
117
|
-
if (!defaultTypes.includes(item.cfgType) || item.cfgVal)
|
|
118
|
-
|
|
146
|
+
if (!defaultTypes.includes(item.cfgType) || item.cfgVal) {
|
|
147
|
+
item.cfgVal = item.cfgVal || ''
|
|
148
|
+
return
|
|
149
|
+
}
|
|
119
150
|
try {
|
|
120
151
|
// 解析cfgJson,获取默认选项
|
|
121
152
|
const cfgJson = JSON.parse(item.cfgJson || '[]')
|
|
122
153
|
const defaultItems = cfgJson.filter((row) => row.isDefault === '1')
|
|
123
|
-
if (!defaultItems
|
|
154
|
+
if (!defaultItems?.length) return
|
|
124
155
|
// 获取默认选项的code值
|
|
125
|
-
const defaultCodes = defaultItems
|
|
156
|
+
const defaultCodes = defaultItems?.map((row) => row.code)
|
|
126
157
|
if (['22', '21'].includes(item.cfgType)) {
|
|
127
158
|
item.cfgVal = defaultCodes[0]
|
|
128
159
|
item.cfgText = defaultItems[0]?.value
|
|
@@ -136,27 +167,17 @@ export default {
|
|
|
136
167
|
}
|
|
137
168
|
}
|
|
138
169
|
} catch (e) {
|
|
139
|
-
|
|
170
|
+
console.error('解析cfgJson失败', e)
|
|
140
171
|
}
|
|
141
172
|
},
|
|
142
173
|
getData(data) {
|
|
143
|
-
if (data
|
|
144
|
-
this.otherAttData = data
|
|
174
|
+
if (data?.length) {
|
|
175
|
+
this.otherAttData = data.map((item) => this.initItem(item))
|
|
145
176
|
}
|
|
146
177
|
if (this.taskId) {
|
|
147
178
|
axios.post(`/bems/admin/customization/${this.taskId}`, null, { loading: false }).then(({ data }) => {
|
|
148
179
|
if (data && data.length) {
|
|
149
|
-
this.otherAttData =
|
|
150
|
-
data?.map((item) => {
|
|
151
|
-
if (['32'].includes(item.cfgType)) {
|
|
152
|
-
item.checkList = item.checkList ? item.checkList : []
|
|
153
|
-
}
|
|
154
|
-
if (['31'].includes(item.cfgType)) {
|
|
155
|
-
item.selectList = item.selectList ? item.selectList : []
|
|
156
|
-
}
|
|
157
|
-
this.setDefaultValue(item)
|
|
158
|
-
return item
|
|
159
|
-
}) || []
|
|
180
|
+
this.otherAttData = data?.map((item) => this.initItem(item)) || []
|
|
160
181
|
}
|
|
161
182
|
})
|
|
162
183
|
}
|
|
@@ -187,6 +208,33 @@ export default {
|
|
|
187
208
|
cfgRemark: item.cfgRemark
|
|
188
209
|
}
|
|
189
210
|
})
|
|
211
|
+
},
|
|
212
|
+
validate() {
|
|
213
|
+
if (!this.required) return true
|
|
214
|
+
for (const item of this.otherAttData) {
|
|
215
|
+
let isEmpty = false
|
|
216
|
+
if (['11', '12', '21', '22', '33'].includes(item.cfgType)) {
|
|
217
|
+
isEmpty = !item.cfgVal && item.cfgVal !== 0
|
|
218
|
+
} else if (item.cfgType === '31') {
|
|
219
|
+
isEmpty = !item.selectList || item.selectList?.length === 0
|
|
220
|
+
} else if (item.cfgType === '32') {
|
|
221
|
+
isEmpty = !item.checkList || item.checkList?.length === 0
|
|
222
|
+
}
|
|
223
|
+
if (isEmpty) {
|
|
224
|
+
this.$message.warning(`请填写${item.cfgName}`)
|
|
225
|
+
return false
|
|
226
|
+
}
|
|
227
|
+
if (
|
|
228
|
+
item.cfgHasRemark === '1' &&
|
|
229
|
+
!['11', '12'].includes(item.cfgType) &&
|
|
230
|
+
!item.cfgRemark &&
|
|
231
|
+
item.cfgRemark !== 0
|
|
232
|
+
) {
|
|
233
|
+
this.$message.warning(`请填写${item.cfgName}备注`)
|
|
234
|
+
return false
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
return true
|
|
190
238
|
}
|
|
191
239
|
}
|
|
192
240
|
}
|
|
@@ -121,33 +121,7 @@ vxeTable.formats.mixin({
|
|
|
121
121
|
}
|
|
122
122
|
}
|
|
123
123
|
})
|
|
124
|
-
|
|
125
|
-
/* vxeTable.renderer.add('FilterInput', {
|
|
126
|
-
// 筛选模板
|
|
127
|
-
renderFilter(h, renderOpts, params) {
|
|
128
|
-
const { data } = params
|
|
129
|
-
return <el-input v-model='data' placeholder='' size='mini'></el-input>
|
|
130
|
-
},
|
|
131
|
-
// 重置数据方法
|
|
132
|
-
filterResetMethod({ options }) {
|
|
133
|
-
options.forEach((option) => {
|
|
134
|
-
option.data = ''
|
|
135
|
-
})
|
|
136
|
-
},
|
|
137
|
-
// 重置筛选复原方法(当未点击确认时,该选项将被恢复为默认值)
|
|
138
|
-
filterRecoverMethod({ option }) {
|
|
139
|
-
option.data = ''
|
|
140
|
-
},
|
|
141
|
-
// 筛选方法
|
|
142
|
-
filterMethod({ option, row, column }) {
|
|
143
|
-
const { data } = option
|
|
144
|
-
const cellValue = row[column.property]
|
|
145
|
-
if (cellValue) {
|
|
146
|
-
return cellValue.indexOf(data) > -1
|
|
147
|
-
}
|
|
148
|
-
return false
|
|
149
|
-
}
|
|
150
|
-
}) */
|
|
124
|
+
|
|
151
125
|
function install(Vue) {
|
|
152
126
|
Vue.use(vxeTable)
|
|
153
127
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div style="height: 100%; position: relative">
|
|
2
|
+
<div class="v2-table-pro-wrapper" style="height: 100%; position: relative">
|
|
3
3
|
<vxe-table
|
|
4
4
|
ref="vxeTable"
|
|
5
5
|
:key="colsKey"
|
|
@@ -472,8 +472,8 @@ export default {
|
|
|
472
472
|
let canCheck = true
|
|
473
473
|
if (typeof this.forbidSelect === 'function') {
|
|
474
474
|
const forbidResult = this.forbidSelect({ row })
|
|
475
|
-
// 只有当 forbidSelect 明确返回 true
|
|
476
|
-
canCheck = forbidResult !==
|
|
475
|
+
// 只有当 forbidSelect 明确返回 true 时才允许勾选
|
|
476
|
+
canCheck = forbidResult !== false
|
|
477
477
|
}
|
|
478
478
|
|
|
479
479
|
if (canCheck) {
|