Commit 29cc88d4 by caoyanzhi

feat: 审核事项

parent a05d4ec1
......@@ -5,7 +5,9 @@
</div>
<el-table :data="auditItemList">
<el-table-column label="审核组" prop="auditGroupName" :formatter="(row, col, val) => val || '--'"></el-table-column>
<el-table-column label="审核事项" prop="auditTypes" :formatter="(row, col, val) => val || '--'"></el-table-column>
<el-table-column label="审核事项" prop="auditTypes" show-overflow-tooltip>
<template slot-scope="{ row }">{{ row.auditTypes | formatAuditTypes(auditTypes) }}</template>
</el-table-column>
<el-table-column label="操作">
<template slot-scope="{ row }">
<el-button type="text" @click="toCreateItem(row)">编辑</el-button>
......@@ -17,14 +19,15 @@
</template>
<script>
import auditTypes from './audit-types';
import fetch from '@/api/review';
// eslint-disable-next-line
const { auditItemList, delAuditItem } = fetch;
export default {
name: 'AuditItemList',
data() {
return {
wxEnterpriseId: '',
auditTypes,
auditItemList: []
};
},
......@@ -42,7 +45,7 @@ export default {
toCreateItem(itemData) {
const { auditItemId } = itemData || {};
const url = '/create-audit-item';
this.$router.push(auditItemId ? `${url}?auditItemid=${auditItemId}` : url);
this.$router.push(auditItemId ? `${url}?auditItemId=${auditItemId}` : url);
},
onDelItem(itemData) {
const { auditGroupName, auditItemId } = itemData;
......@@ -53,6 +56,14 @@ export default {
});
});
}
},
filters: {
formatAuditTypes(types, auditTypes) {
if (!types) return '--';
types = types.split(',');
const result = auditTypes.filter(el => types.some(item => item == el.type));
return result.length > 0 ? result.map(el => el.title).join('、') : '--';
}
}
};
</script>
......
// 审核事项类型列表
export default [
{
type: '3',
title: '导购账号新增',
desc: '能看到管辖范围内导购添加的审核事项'
},
{
type: '1',
title: '导购账号绑定',
desc: '能看到管辖范围内导购账号绑定申请'
}
];
......@@ -20,8 +20,8 @@
</template>
<script>
import auditTypes from './audit-types';
import fetch from '@/api/review';
// eslint-disable-next-line
const { addAuditItem, editAuditItem, auditItemDetail, getAuditGroupList } = fetch;
export default {
name: 'CreateAuditItem',
......@@ -31,18 +31,7 @@ export default {
// 审核组列表
auditGroupList: [],
// 审核事项类型列表
auditTypes: [
{
type: '3',
title: '导购账号新增',
desc: '能看到管辖范围内导购添加的审核事项'
},
{
type: '1',
title: '导购账号绑定',
desc: '能看到管辖范围内导购账号绑定申请'
}
],
auditTypes,
// 审核事项详情数据
auditData: {
auditGroupIds: [], // aaa,bbb,cccc
......@@ -78,8 +67,9 @@ export default {
if (typeof auditTypes == 'string') {
this.auditData.auditTypes = auditTypes.split(',');
}
if (typeof auditGroupId == 'string') {
this.auditData.auditGroupIds = auditGroupId.split(',');
// 新建、编辑保存的时候审核组可以多选,编辑回显的时候只有一个审核组
if (typeof auditGroupId == 'string' || typeof auditGroupId == 'number') {
this.auditData.auditGroupIds = [ auditGroupId ];
}
});
},
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment