|
|
@@ -29,6 +29,17 @@
|
|
|
新增
|
|
|
</el-button>
|
|
|
</template>
|
|
|
+ <template v-slot:ruleState="{ row }">
|
|
|
+ <el-switch
|
|
|
+ v-model="row.ruleState"
|
|
|
+ active-color="#13ce66"
|
|
|
+ inactive-color="#ff4949"
|
|
|
+ active-value="1"
|
|
|
+ inactive-value="0"
|
|
|
+ @change="(val) => handleStatus(row, val)"
|
|
|
+ >
|
|
|
+ </el-switch>
|
|
|
+ </template>
|
|
|
|
|
|
<!-- 操作列 -->
|
|
|
<template v-slot:action="{ row }">
|
|
|
@@ -75,11 +86,13 @@
|
|
|
import { calcReceiveDateTypeOp, payConfirmTypeOp, dateUnitOptions } from '@/enum/dict';
|
|
|
import {
|
|
|
getTableList,
|
|
|
- deleteInformation
|
|
|
+ deleteInformation,
|
|
|
+ updateRuleState
|
|
|
} from '@/api/rulesManagement/receiveTerms';
|
|
|
+ import dictMixins from '@/mixins/dictMixins';
|
|
|
|
|
|
export default {
|
|
|
- mixins: [tabMixins],
|
|
|
+ mixins: [tabMixins, dictMixins],
|
|
|
components: {
|
|
|
searchForm,
|
|
|
addDialog
|
|
|
@@ -163,6 +176,21 @@
|
|
|
showOverflowTooltip: true,
|
|
|
minWidth: 120
|
|
|
},
|
|
|
+ {
|
|
|
+ prop: 'createTime',
|
|
|
+ label: '创建时间',
|
|
|
+ align: 'center',
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ minWidth: 120
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'ruleState',
|
|
|
+ slot: 'ruleState',
|
|
|
+ label: '状态',
|
|
|
+ align: 'center',
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ minWidth: 120
|
|
|
+ },
|
|
|
{
|
|
|
columnKey: 'action',
|
|
|
label: '操作',
|
|
|
@@ -177,6 +205,9 @@
|
|
|
cacheKeyUrl: 'eos-paymentTerms-list'
|
|
|
};
|
|
|
},
|
|
|
+ created() {
|
|
|
+ this.requestDict('支付类型');
|
|
|
+ },
|
|
|
methods: {
|
|
|
/* 表格数据源 */
|
|
|
datasource({ page, limit, where }) {
|
|
|
@@ -188,6 +219,25 @@
|
|
|
});
|
|
|
},
|
|
|
|
|
|
+ handleStatus(row, val) {
|
|
|
+ console.log('row', row);
|
|
|
+ console.log('val', val);
|
|
|
+ let msg = val == 1 ? '是否启用该规则' : '是否关闭该规则';
|
|
|
+ this.$confirm(msg, '提示', {
|
|
|
+ type: 'warning'
|
|
|
+ })
|
|
|
+ .then(async () => {
|
|
|
+ await updateRuleState({
|
|
|
+ id: row.id,
|
|
|
+ ruleState: val
|
|
|
+ });
|
|
|
+ this.$message.success('操作成功');
|
|
|
+ })
|
|
|
+ .catch(() => {
|
|
|
+ row.ruleState = val == 1 ? 0 : 1;
|
|
|
+ });
|
|
|
+ },
|
|
|
+
|
|
|
// 构建支付方式字符串
|
|
|
buildPaymentMethod(list) {
|
|
|
return list
|
|
|
@@ -195,7 +245,7 @@
|
|
|
const unit =
|
|
|
(dateUnitOptions.find(opt => opt.value === item.dateType) || {}).label ||
|
|
|
'月';
|
|
|
- return `${item.percentage}% ${item.paymentSum}${unit} ${item.paymentType}`;
|
|
|
+ return `${item.percentage}% ${item.paymentSum}${unit} ${this.dict['payment_type'].find(opt => opt.dictCode === item.paymentType)?.dictValue || ''}`;
|
|
|
})
|
|
|
.join(',');
|
|
|
},
|