feat:新增资质变更功能

This commit is contained in:
zty 2024-04-15 15:27:57 +08:00
parent 47662d9f2f
commit e3f6d57875
5 changed files with 154 additions and 74 deletions

View File

@ -11,7 +11,7 @@ export function getMyQi(query) {
export function getQi(id) { export function getQi(id) {
return request({ return request({
url: `/info/faq/${id}/`, url: `/info/faqch/?instance_id=${id}`,
method: 'get' method: 'get'
}) })
} }
@ -57,3 +57,12 @@ export function getChangeInfo(query) {
params: query params: query
}) })
} }
export function getMyOneQi(query) {
return request({
url: `/info/faq/`,
method: 'get',
params: query
})
}

View File

@ -407,64 +407,64 @@ export const asyncRoutes = [
] ]
}, },
//信息收集 //信息收集
// { {
// path: '/infoCollect', path: '/infoCollect',
// component: Layout, component: Layout,
// redirect: '/infoCollect/', redirect: '/infoCollect/',
// name: 'informationCollect', name: 'informationCollect',
// meta: { title: '信息收集', icon: 'PT', perms: ['infoCollect'] }, meta: { title: '信息收集', icon: 'PT', perms: ['infoCollect'] },
// alwaysShow: true, alwaysShow: true,
// children: [ children: [
// { {
// path: 'qualificInfo', path: 'qualificInfo',
// name: 'qualificInfo', name: 'qualificInfo',
// component: () => import('@/views/informatiomCollect/qualificInfo.vue'), component: () => import('@/views/informatiomCollect/qualificInfo.vue'),
// meta: { title: '资质情况', perms: ['infoCollect_QIN'] } meta: { title: '资质情况', perms: ['infoCollect_QIN'] }
// }, },
// { {
// path: 'qualiChange', path: 'qualiChange',
// name: 'qualiChange', name: 'qualiChange',
// component: () => import('@/views/informatiomCollect/qualiChange.vue'), component: () => import('@/views/informatiomCollect/qualiChange.vue'),
// meta: { title: '资质变更情况', perms: ['infoCollect_QICH'] } meta: { title: '资质变更情况', perms: ['infoCollect_QICH'] }
// }, },
// { {
// path: 'reviewStatus', path: 'reviewStatus',
// name: 'reviewStatus', name: 'reviewStatus',
// component: () => import('@/views/informatiomCollect/reviewStatus.vue'), component: () => import('@/views/informatiomCollect/reviewStatus.vue'),
// meta: { title: '评审情况', perms: ['infoCollect_RS'] } meta: { title: '评审情况', perms: ['infoCollect_RS'] }
// }, },
// { {
// path: 'qualityCommend', path: 'qualityCommend',
// name: 'qualityCommend', name: 'qualityCommend',
// component: () => import('@/views/informatiomCollect/qualityCommend.vue'), component: () => import('@/views/informatiomCollect/qualityCommend.vue'),
// meta: { title: '质量表彰', perms: ['infoCollect_QC'] } meta: { title: '质量表彰', perms: ['infoCollect_QC'] }
// }, },
// { {
// path: 'qualityActive.', path: 'qualityActive.',
// name: 'qualityActive.', name: 'qualityActive.',
// component: () => import('@/views/informatiomCollect/qualityActive.vue'), component: () => import('@/views/informatiomCollect/qualityActive.vue'),
// meta: { title: '质量活动', perms: ['infoCollect_QA'] } meta: { title: '质量活动', perms: ['infoCollect_QA'] }
// }, },
// { {
// path: 'laboratoryContact', path: 'laboratoryContact',
// name: 'laboratoryContact', name: 'laboratoryContact',
// component: () => import('@/views/informatiomCollect/laboratoryContact.vue'), component: () => import('@/views/informatiomCollect/laboratoryContact.vue'),
// meta: { title: '实验室联系方式', perms: ['infoCollect_LC'] } meta: { title: '实验室联系方式', perms: ['infoCollect_LC'] }
// }, },
// { {
// path: 'externalAuditor', path: 'externalAuditor',
// name: 'externalAuditor', name: 'externalAuditor',
// component: () => import('@/views/informatiomCollect/externalAuditor.vue'), component: () => import('@/views/informatiomCollect/externalAuditor.vue'),
// meta: { title: '外审员情况', perms: ['infoCollect_EA'] } meta: { title: '外审员情况', perms: ['infoCollect_EA'] }
// }, },
// // { // {
// // path: 'inspectionStats', // path: 'inspectionStats',
// // name: 'inspectionStats', // name: 'inspectionStats',
// // component: () => import('@/views/informatiomCollect/inspectionStats.vue'), // component: () => import('@/views/informatiomCollect/inspectionStats.vue'),
// // meta: { title: '检验检测统计', perms: ['infoCollect_IS'] } // meta: { title: '检验检测统计', perms: ['infoCollect_IS'] }
// // }, // },
// ] ]
// }, },
{ {
path: '/test', path: '/test',
component: Layout, component: Layout,

View File

@ -4,15 +4,25 @@
<el-table :data="tableData.results" style="width: 100%" v-loading="listLoading" <el-table :data="tableData.results" style="width: 100%" v-loading="listLoading"
border fit stripe border fit stripe
highlight-current-row> highlight-current-row>
<el-table-column label="公司名称" prop="company_name"></el-table-column> <el-table-column prop="company_name" label="公司名称" width="180"></el-table-column>
<el-table-column label="修改时间" prop="change_time"></el-table-column> <el-table-column label="操作" width="120" >
<el-table-column label="修改原因" prop="change_reason"></el-table-column> <template slot-scope="scope">{{ curdOp[scope.row.action] }}</template>
<el-table-column </el-table-column>
v-for="(column, index) in tableColumns.difference" :key="index" <el-table-column prop="change_time" label="修改时间" width="180"></el-table-column>
:label="column.name" <el-table-column prop="change_reason" label="变更原因" width="180"></el-table-column>
:new="column.new" <el-table-column label="资质名称" width="180">
:old="column.old" <template v-slot="scope">
></el-table-column> {{ scope.row.val_new.name }}
</template>
</el-table-column>
<el-table-column label="变更详情">
<template slot-scope="scope">
<el-tag v-for="(diff, index) in scope.row.difference" :key="index">
{{ resultsMap[diff.name] }}: {{ diff.old }} -> {{ diff.new }}
</el-tag>
</template>
</el-table-column>
</el-table> </el-table>
<pagination v-show="tableData.count > 0" :total="tableData.count" :page.sync="listQuery.page" <pagination v-show="tableData.count > 0" :total="tableData.count" :page.sync="listQuery.page"
:limit.sync="listQuery.page_size" @pagination="getTableList" /> :limit.sync="listQuery.page_size" @pagination="getTableList" />
@ -40,6 +50,18 @@ export default {
tableData: { tableData: {
count: 0 count: 0
}, },
curdOp:{"update":"更新","create":"创建","delete":"删除"},
resultsMap:{
"company_name":"公司名称",
"name":"资质名称",
"quali_type":"资质类型",
"org":"发证单位",
"org_date":"发证日期",
"expiration_date":"截至日期",
"scope":"资质范围",
"number":"参数数量",
"cie_path":"证书路径",
}
} }
}, },
mounted() { mounted() {

View File

@ -31,9 +31,29 @@
v-if="checkPermission(['infoCollect_QIN']) && checkPermission(['infoCollect_QIN'])"></el-divider> v-if="checkPermission(['infoCollect_QIN']) && checkPermission(['infoCollect_QIN'])"></el-divider>
<el-link :disabled="!checkPermission(['infoCollect_QIN'])" type="danger" size="small" <el-link :disabled="!checkPermission(['infoCollect_QIN'])" type="danger" size="small"
@click="handleDelete(scope)">删除</el-link> @click="handleDelete(scope)">删除</el-link>
<el-link type="primary" @click="handleChange(scope)">变更记录</el-link>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<el-dialog title="变更记录" :visible.sync="dialogTableVisible">
<el-table :data="changeTableData" style="width: 100%">
<el-table-column label="公司名称" prop="company_name"></el-table-column>
<el-table-column label="变更时间" prop="change_time" ></el-table-column>
<el-table-column prop="change_reason" label="变更原因"></el-table-column>
<el-table-column label="资质名称" >
<template v-slot="scope">
<span>{{scope.row.val_new.name}}</span>
</template>
</el-table-column>
<el-table-column label="变更详情" width="500">
<template slot-scope="scope">
<el-tag v-for="(diff, index) in scope.row.difference" :key="index">
{{ resultsMap[diff.name] }}: {{ diff.old }} -> {{ diff.new }}
</el-tag>
</template>
</el-table-column>
</el-table>
</el-dialog>
<pagination v-show="tableData.count > 0" :total="tableData.count" :page.sync="listQuery.page" <pagination v-show="tableData.count > 0" :total="tableData.count" :page.sync="listQuery.page"
:limit.sync="listQuery.page_size" @pagination="getTableList" /> :limit.sync="listQuery.page_size" @pagination="getTableList" />
</el-card> </el-card>
@ -189,6 +209,7 @@ export default {
listLoading: false, listLoading: false,
dialogVisible: false, dialogVisible: false,
showExportDialog: false, showExportDialog: false,
dialogTableVisible:false,
exportForm: { exportForm: {
startDate: '', // 开始日期 startDate: '', // 开始日期
endDate: '', // 结束日期 endDate: '', // 结束日期
@ -200,6 +221,7 @@ export default {
tableData: { tableData: {
count: 0 count: 0
}, },
changeTableData:[],
dialogType: "new", dialogType: "new",
rule: { rule: {
name: [{ required: true, message: "请输入名称", trigger: "blur" }], name: [{ required: true, message: "请输入名称", trigger: "blur" }],
@ -210,7 +232,18 @@ export default {
{key:'国家级',value:'国家级'}, {key:'国家级',value:'国家级'},
{key:'省级',value:'省级'} {key:'省级',value:'省级'}
], ],
ac_options:{'国家级':'国家级', '省级':'省级'} ac_options:{'国家级':'国家级', '省级':'省级'},
resultsMap:{
"company_name":"公司名称",
"name":"资质名称",
"quali_type":"资质类型",
"org":"发证单位",
"org_date":"发证日期",
"expiration_date":"截至日期",
"scope":"资质范围",
"number":"参数数量",
"cie_path":"证书路径",
}
} }
}, },
mounted() { mounted() {
@ -343,18 +376,33 @@ export default {
type: "error", type: "error",
}) })
.then(async () => { .then(async () => {
await delQi(scope.row.id).then(() => { await delQi(scope.row.id);
this.getList(); this.getList();
this.$message.success("成功"); this.$message.success("成功");
this.getTableList();
})
}) })
.catch((err) => { .catch((err) => {
console.error(err); console.error(err);
}); });
}, },
handleChange(scope) {
this.listLoading = true;
this.Content = Object.assign({}, scope.row); // copy obj
this.changeTableData =[];
this.dialogTableVisible=true;
getQi(scope.row.id).then((response) => {
if (response.data.count>0) {
this.changeTableData = response.data.results;
console.log(this.changeTableData);
this.listLoading = false;
}else{
alert('无变更记录')
this.dialogTableVisible=false;
this.listLoading = false;
return
}
});
},
async confirm(form) { async confirm(form) {
this.$refs[form].validate((valid) => { this.$refs[form].validate((valid) => {
if (valid) { if (valid) {

View File

@ -321,4 +321,5 @@ class QualificationViewSet(RbacFilterSet, CreateUpdateCustomMixin, ModelViewSet)
class QualiChangeViewSet(RbacFilterSet, ModelViewSet): class QualiChangeViewSet(RbacFilterSet, ModelViewSet):
queryset = AuditLog.objects.select_related('instance').all() queryset = AuditLog.objects.select_related('instance').all()
serializer_class = AuditLogSerializer serializer_class = AuditLogSerializer
filterset_fields = ['instance_id']