feat: cnas添加说明列

This commit is contained in:
caoqianming 2024-01-24 17:24:43 +08:00
parent 16d6d0a26a
commit 477c83817b
5 changed files with 823 additions and 997 deletions

View File

@ -1,152 +1,73 @@
<template> <template>
<div class="app-container"> <div class="app-container">
<el-card> <el-card>
<el-row :gutter="6"> <el-row :gutter="6">
<el-col :xs="24" :md="16"> <el-col :xs="24" :md="16">
<el-input <el-input v-model="listQuery.search" placeholder="项目/标准/编号/中心" style="width: 100%" class="filter-item"
v-model="listQuery.search" @keyup.enter.native="handleFilter" />
placeholder="项目/标准/编号/中心" </el-col>
style="width: 100%" <el-col :xs="24" :md="8">
class="filter-item" <el-button class="filter-item" type="primary" icon="el-icon-search" @click="handleFilter">搜索</el-button>
@keyup.enter.native="handleFilter" <el-button class="filter-item" type="primary" icon="el-icon-refresh-left" @click="resetFilter">重置</el-button>
/> </el-col>
</el-col> </el-row>
<el-col :xs="24" :md="8"> <div style="margin-top: 10px">
<el-button <!-- <el-button type="primary" icon="el-icon-plus" @click="handleAdd" v-if="checkPermission(['cma_create'])">新增</el-button> -->
class="filter-item" <el-popover placement="top" width="160" v-if="checkPermission(['ability_import'])" v-model="popovervisible">
type="primary" <p>导入能力列表压缩包.</p>
icon="el-icon-search" <div style="text-align: left; margin: 0">
@click="handleFilter" <el-upload :action="upUrl" :on-success="handleUploadSuccess" accept=".zip" :headers="upHeaders"
>搜索</el-button :show-file-list="false">
> <el-button size="small" type="primary" @click="popovervisible = false">上传导入</el-button>
<el-button </el-upload>
class="filter-item" </div>
type="primary"
icon="el-icon-refresh-left"
@click="resetFilter"
>重置</el-button
>
</el-col>
</el-row>
<div style="margin-top: 10px">
<!-- <el-button type="primary" icon="el-icon-plus" @click="handleAdd" v-if="checkPermission(['cma_create'])">新增</el-button> -->
<el-popover
placement="top"
width="160"
v-if="checkPermission(['ability_import'])"
v-model="popovervisible"
>
<p>导入能力列表压缩包.</p>
<div style="text-align: left; margin: 0">
<el-upload
:action="upUrl"
:on-success="handleUploadSuccess"
accept=".zip"
:headers="upHeaders"
:show-file-list="false"
>
<el-button
size="small"
type="primary"
@click="popovervisible = false"
>上传导入</el-button
>
</el-upload>
</div>
<el-button slot="reference">导入CMA能力</el-button> <el-button slot="reference">导入CMA能力</el-button>
</el-popover> </el-popover>
<el-popover <el-popover placement="top" width="160" v-if="checkPermission(['ability_import'])" v-model="popovervisible2">
placement="top" <p>导入能力列表压缩包.</p>
width="160" <div style="text-align: left; margin: 0">
v-if="checkPermission(['ability_import'])" <el-upload :action="upUrl" :on-success="handleUploadSuccess2" accept=".zip" :headers="upHeaders"
v-model="popovervisible2" :show-file-list="false">
> <el-button size="small" type="primary" @click="popovervisible2 = false">上传导入</el-button>
<p>导入能力列表压缩包.</p> </el-upload>
<div style="text-align: left; margin: 0"> </div>
<el-upload
:action="upUrl"
:on-success="handleUploadSuccess2"
accept=".zip"
:headers="upHeaders"
:show-file-list="false"
>
<el-button
size="small"
type="primary"
@click="popovervisible2 = false"
>上传导入</el-button
>
</el-upload>
</div>
<el-button slot="reference">导入CNAS能力</el-button> <el-button slot="reference">导入CNAS能力</el-button>
</el-popover> </el-popover>
</div> </div>
</el-card> </el-card>
<el-card style="margin-top: 6px"> <el-card style="margin-top: 6px">
<div slot="header" class="clearfix"> <div slot="header" class="clearfix">
<span>资质认定CMA</span> <span>资质认定CMA</span>
</div> </div>
<el-table <el-table v-loading="listLoading" :data="cmaList.results" style="width: 100%" border fit stripe
v-loading="listLoading" highlight-current-row max-height="300" ref="filterTable" @filter-change="filterChange">
:data="cmaList.results"
style="width: 100%"
border
fit
stripe
highlight-current-row
max-height="300"
ref="filterTable"
@filter-change="filterChange"
>
<el-table-column type="index" width="50" /> <el-table-column type="index" width="50" />
<el-table-column align="center" label="大类名称"> <el-table-column align="center" label="大类名称">
<template slot-scope="scope" <template slot-scope="scope"><span v-html="showlight(scope.row.dlmc)" v-if="scope.row.dlmc"></span></template>
><span v-html="showlight(scope.row.dlmc)" v-if="scope.row.dlmc"></span
></template>
</el-table-column> </el-table-column>
<el-table-column align="header-center" label="类别名称"> <el-table-column align="header-center" label="类别名称">
<template slot-scope="scope" <template slot-scope="scope"><span v-html="showlight(scope.row.lbmc)"></span></template>
><span v-html="showlight(scope.row.lbmc)"></span
></template>
</el-table-column> </el-table-column>
<el-table-column align="header-center" label="项目序号"> <el-table-column align="header-center" label="项目序号">
<template slot-scope="scope" <template slot-scope="scope"><span v-html="showlight(scope.row.xmxh)"></span></template>
><span v-html="showlight(scope.row.xmxh)"></span
></template>
</el-table-column> </el-table-column>
<el-table-column align="header-center" label="项目名称"> <el-table-column align="header-center" label="项目名称">
<template slot-scope="scope" <template slot-scope="scope"><span v-html="showlight(scope.row.xmmc)"></span></template>
><span v-html="showlight(scope.row.xmmc)"></span
></template>
</el-table-column> </el-table-column>
<el-table-column align="header-center" label="标准名称"> <el-table-column align="header-center" label="标准名称">
<template slot-scope="scope" <template slot-scope="scope"><span v-html="showlight(scope.row.bzmc)"></span></template>
><span v-html="showlight(scope.row.bzmc)"></span
></template>
</el-table-column> </el-table-column>
<el-table-column align="header-center" label="标准编号"> <el-table-column align="header-center" label="标准编号">
<template slot-scope="scope" <template slot-scope="scope"><span v-html="showlight(scope.row.bzbh)" v-if="scope.row.bzbh"></span></template>
><span v-html="showlight(scope.row.bzbh)" v-if="scope.row.bzbh"></span
></template>
</el-table-column> </el-table-column>
<el-table-column align="header-center" label="限制范围"> <el-table-column align="header-center" label="限制范围">
<template slot-scope="scope" <template slot-scope="scope"><span v-html="showlight(scope.row.xzfw)"></span></template>
><span v-html="showlight(scope.row.xzfw)"></span
></template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column align="header-center" label="所属地点" prop="sszx" column-key="sszx" :filters="groupBy.sszx"
align="header-center" :filter-multiple="false">
label="所属中心" <template slot-scope="scope"><span v-html="showlight(scope.row.sszx)"></span></template>
prop="sszx"
column-key="sszx"
:filters="groupBy.sszx"
:filter-multiple="false"
>
<template slot-scope="scope"
><span v-html="showlight(scope.row.sszx)"></span
></template>
</el-table-column> </el-table-column>
<!-- <el-table-column align="center" label="操作"> <!-- <el-table-column align="center" label="操作">
<template slot-scope="scope"> <template slot-scope="scope">
@ -168,67 +89,37 @@
</el-table-column> --> </el-table-column> -->
</el-table> </el-table>
<pagination <pagination v-show="cmaList.count > 0" :total="cmaList.count" :page.sync="listQuery.page"
v-show="cmaList.count > 0" :limit.sync="listQuery.page_size" @pagination="getList" />
:total="cmaList.count"
:page.sync="listQuery.page"
:limit.sync="listQuery.page_size"
@pagination="getList"
/>
</el-card> </el-card>
<el-card style="margin-top: 6px"> <el-card style="margin-top: 6px">
<div slot="header" class="clearfix"> <div slot="header" class="clearfix">
<span>实验室认可CNAS</span> <span>实验室认可CNAS</span>
</div> </div>
<el-table <el-table v-loading="listLoading2" :data="cnasList.results" style="width: 100%" border fit stripe
v-loading="listLoading2" highlight-current-row max-height="300" @filter-change="filterChange2">
:data="cnasList.results"
style="width: 100%"
border
fit
stripe
highlight-current-row
max-height="300"
@filter-change="filterChange2"
>
<el-table-column type="index" width="50" /> <el-table-column type="index" width="50" />
<el-table-column align="header-center" label="类别名称"> <el-table-column align="header-center" label="类别名称">
<template slot-scope="scope" <template slot-scope="scope"><span v-html="showlight(scope.row.lbmc)"></span></template>
><span v-html="showlight(scope.row.lbmc)"></span
></template>
</el-table-column> </el-table-column>
<el-table-column align="header-center" label="项目名称"> <el-table-column align="header-center" label="项目名称">
<template slot-scope="scope" <template slot-scope="scope"><span v-html="showlight(scope.row.xmmc)"></span></template>
><span v-html="showlight(scope.row.xmmc)"></span
></template>
</el-table-column> </el-table-column>
<el-table-column align="header-center" label="标准名称"> <el-table-column align="header-center" label="标准名称">
<template slot-scope="scope" <template slot-scope="scope"><span v-html="showlight(scope.row.bzmc)"></span></template>
><span v-html="showlight(scope.row.bzmc)"></span
></template>
</el-table-column> </el-table-column>
<el-table-column align="header-center" label="标准编号"> <el-table-column align="header-center" label="标准编号">
<template slot-scope="scope" <template slot-scope="scope"><span v-html="showlight(scope.row.bzbh)"></span></template>
><span v-html="showlight(scope.row.bzbh)"></span
></template>
</el-table-column> </el-table-column>
<el-table-column align="header-center" label="标准条款"> <el-table-column align="header-center" label="标准条款">
<template slot-scope="scope" <template slot-scope="scope"><span v-html="showlight(scope.row.bztk)"></span></template>
><span v-html="showlight(scope.row.bztk)"></span
></template>
</el-table-column> </el-table-column>
<el-table-column align="header-center" label="限制范围"> <el-table-column align="header-center" label="说明">
<template slot-scope="scope" <template slot-scope="scope"><span v-html="showlight(scope.row.sm)"></span></template>
><span v-html="showlight(scope.row.xzfw)"></span
></template>
</el-table-column> </el-table-column>
<el-table-column align="header-center" label="所属地点" prop="sszx" <el-table-column align="header-center" label="所属地点" prop="sszx" column-key="sszx" :filters="groupBy2.sszx"
column-key="sszx"
:filters="groupBy2.sszx"
:filter-multiple="false"> :filter-multiple="false">
<template slot-scope="scope" <template slot-scope="scope"><span v-html="showlight(scope.row.sszx)"></span></template>
><span v-html="showlight(scope.row.sszx)"></span
></template>
</el-table-column> </el-table-column>
<!-- <el-table-column align="center" label="操作"> <!-- <el-table-column align="center" label="操作">
<template slot-scope="scope"> <template slot-scope="scope">
@ -250,24 +141,11 @@
</el-table-column> --> </el-table-column> -->
</el-table> </el-table>
<pagination <pagination v-show="cnasList.count > 0" :total="cnasList.count" :page.sync="listQuery2.page"
v-show="cnasList.count > 0" :limit.sync="listQuery2.page_size" @pagination="getList2" />
:total="cnasList.count"
:page.sync="listQuery2.page"
:limit.sync="listQuery2.page_size"
@pagination="getList2"
/>
</el-card> </el-card>
<el-dialog <el-dialog :visible.sync="dialogVisible" :title="dialogType === 'edit' ? '编辑' : '新增'">
:visible.sync="dialogVisible" <el-form ref="Form" :model="cma" label-width="80px" label-position="right">
:title="dialogType === 'edit' ? '编辑' : '新增'"
>
<el-form
ref="Form"
:model="cma"
label-width="80px"
label-position="right"
>
<el-form-item label="姓名" prop="name"> <el-form-item label="姓名" prop="name">
<el-input v-model="cma.name" placeholder="姓名" /> <el-input v-model="cma.name" placeholder="姓名" />
</el-form-item> </el-form-item>
@ -353,6 +231,9 @@ export default {
}, },
methods: { methods: {
showlight(val) { showlight(val) {
if (val == null) {
return ""
}
val = val + ""; val = val + "";
if (this.listQuery.search != "") { if (this.listQuery.search != "") {
let searchList = this.listQuery.search.split(" "); let searchList = this.listQuery.search.split(" ");
@ -360,8 +241,8 @@ export default {
val = val.replace( val = val.replace(
searchList[i], searchList[i],
'<span style="color:red;font-weight:bold">' + '<span style="color:red;font-weight:bold">' +
searchList[i] + searchList[i] +
"</span>" "</span>"
); );
} }
return val; return val;

View File

@ -1,162 +1,80 @@
<template> <template>
<div class="app-container"> <div class="app-container">
<el-card> <el-card>
<el-row :gutter="6"> <el-row :gutter="6">
<el-col :xs="24" :md="4"> <el-col :xs="24" :md="4">
<el-select <el-select v-model="listQuery.sszx" placeholder="所属公司" @change="handleFilter2" clearable style="width: 100%">
v-model="listQuery.sszx" <el-option v-for="item in groupBy.sszx" :key="item.value" :label="item.text" :value="item.value">
placeholder="所属公司" </el-option>
@change="handleFilter2" </el-select>
clearable </el-col>
style="width: 100%"
>
<el-option
v-for="item in groupBy.sszx"
:key="item.value"
:label="item.text"
:value="item.value"
>
</el-option>
</el-select>
</el-col>
<el-col :xs="24" :md="8"> <el-col :xs="24" :md="8">
<el-input <el-input v-model="listQuery.search" placeholder="项目/标准/编号/公司" style="width: 100%" class="filter-item"
v-model="listQuery.search" @keyup.enter.native="handleFilter" />
placeholder="项目/标准/编号/公司" </el-col>
style="width: 100%" <el-col :xs="24" :md="6">
class="filter-item" <el-button class="filter-item" type="primary" icon="el-icon-search" @click="handleFilter">搜索</el-button>
@keyup.enter.native="handleFilter" <el-button class="filter-item" type="primary" icon="el-icon-refresh-left" @click="resetFilter">重置</el-button>
/> </el-col>
</el-col> </el-row>
<el-col :xs="24" :md="6"> <div style="margin-top: 10px">
<el-button <el-popover placement="top" width="160" v-if="checkPermission(['ability_import'])" v-model="popovervisible">
class="filter-item" <p>导入能力列表压缩包.</p>
type="primary" <div style="text-align: left; margin: 0">
icon="el-icon-search" <el-upload :action="upUrl" :on-success="handleUploadSuccess" accept=".zip" :headers="upHeaders"
@click="handleFilter" :show-file-list="false">
>搜索</el-button <el-button size="small" type="primary" @click="popovervisible = false">上传导入</el-button>
> </el-upload>
<el-button </div>
class="filter-item" <el-button slot="reference">导入分子公司能力</el-button>
type="primary" </el-popover>
icon="el-icon-refresh-left" <el-button @click="delAll()" v-if="checkPermission(['cma_deletes'])" type="danger" plain>批量删除</el-button>
@click="resetFilter" <el-button @click="delAll2()" v-if="checkPermission(['cma_deletes'])" type="danger" plain>批量删除所属公司</el-button>
>重置</el-button </div>
>
</el-col>
</el-row>
<div style="margin-top: 10px">
<el-popover
placement="top"
width="160"
v-if="checkPermission(['ability_import'])"
v-model="popovervisible"
>
<p>导入能力列表压缩包.</p>
<div style="text-align: left; margin: 0">
<el-upload
:action="upUrl"
:on-success="handleUploadSuccess"
accept=".zip"
:headers="upHeaders"
:show-file-list="false"
>
<el-button
size="small"
type="primary"
@click="popovervisible = false"
>上传导入</el-button
>
</el-upload>
</div>
<el-button slot="reference">导入分子公司能力</el-button>
</el-popover>
<el-button @click="delAll()" v-if="checkPermission(['cma_deletes'])" type="danger" plain>批量删除</el-button>
<el-button @click="delAll2()" v-if="checkPermission(['cma_deletes'])" type="danger" plain>批量删除所属公司</el-button>
</div>
</el-card> </el-card>
<el-card style="margin-top: 10px"> <el-card style="margin-top: 10px">
<el-table <el-table v-loading="listLoading" :data="cmaList.results" style="width: 100%;" border fit stripe
v-loading="listLoading" highlight-current-row max-height="700" ref="filterTable" @selection-change="handleSelectionChange"
:data="cmaList.results" @filter-change="filterChange">
style="width: 100%;" <el-table-column type="selection" width="55">
border </el-table-column>
fit <el-table-column type="index" width="50" />
stripe <el-table-column label="大类名称">
highlight-current-row <template slot-scope="scope"><span v-html="showlight(scope.row.dlmc)" v-if="scope.row.dlmc"></span></template>
max-height="700" </el-table-column>
ref="filterTable" <el-table-column label="类别名称">
@selection-change="handleSelectionChange" <template slot-scope="scope"><span v-html="showlight(scope.row.lbmc)"></span></template>
@filter-change="filterChange" </el-table-column>
> <el-table-column label="项目序号">
<el-table-column <template slot-scope="scope"><span v-html="showlight(scope.row.xmxh)"></span></template>
type="selection" </el-table-column>
width="55"> <el-table-column label="项目名称">
</el-table-column> <template slot-scope="scope"><span v-html="showlight(scope.row.xmmc)"></span></template>
<el-table-column type="index" width="50" /> </el-table-column>
<el-table-column label="大类名称"> <el-table-column label="标准名称" width="300">
<template slot-scope="scope" <template slot-scope="scope"><span v-html="showlight(scope.row.bzmc)"></span></template>
><span v-html="showlight(scope.row.dlmc)" v-if="scope.row.dlmc"></span </el-table-column>
></template> <el-table-column label="标准编号">
</el-table-column> <template slot-scope="scope"><span v-html="showlight(scope.row.bzbh)" v-if="scope.row.bzbh"></span></template>
<el-table-column label="类别名称"> </el-table-column>
<template slot-scope="scope" <el-table-column label="说明">
><span v-html="showlight(scope.row.lbmc)"></span <template slot-scope="scope"><span v-html="showlight(scope.row.sm)" v-if="scope.row.sm"></span></template>
></template> </el-table-column>
</el-table-column> <el-table-column label="创建日期">
<el-table-column label="项目序号"> <template slot-scope="scope">{{ scope.row.create_time.substring(0, 10) }}</template>
<template slot-scope="scope" </el-table-column>
><span v-html="showlight(scope.row.xmxh)"></span <el-table-column label="变更日期">
></template> <template slot-scope="scope">{{ scope.row.update_time.substring(0, 10) }}</template>
</el-table-column> </el-table-column>
<el-table-column label="项目名称"> <el-table-column label="关联资质" prop="glzz" column-key="glzz" :filters="groupBy.glzz" :filter-multiple="false">
<template slot-scope="scope" <template slot-scope="scope">{{ scope.row.glzz }}</template>
><span v-html="showlight(scope.row.xmmc)"></span </el-table-column>
></template> <el-table-column align="header-center" label="所属中心" prop="sszx" column-key="sszx" :filters="groupBy.sszx"
</el-table-column> :filter-multiple="false" fixed="right">
<el-table-column label="标准名称" width="300"> <template slot-scope="scope">{{ scope.row.sszx }}</template>
<template slot-scope="scope" </el-table-column>
><span v-html="showlight(scope.row.bzmc)"></span <!-- <el-table-column align="center" label="操作">
></template>
</el-table-column>
<el-table-column label="标准编号">
<template slot-scope="scope"
><span v-html="showlight(scope.row.bzbh)" v-if="scope.row.bzbh"></span
></template>
</el-table-column>
<el-table-column label="限制范围">
<template slot-scope="scope"
><span v-html="showlight(scope.row.xzfw)" v-if="scope.row.xzfw"></span
></template>
</el-table-column>
<el-table-column label="创建日期">
<template slot-scope="scope">{{scope.row.create_time.substring(0, 10)}}</template>
</el-table-column>
<el-table-column label="变更日期">
<template slot-scope="scope">{{scope.row.update_time.substring(0, 10)}}</template>
</el-table-column>
<el-table-column
label="关联资质"
prop="glzz"
column-key="glzz"
:filters="groupBy.glzz"
:filter-multiple="false"
>
<template slot-scope="scope">{{ scope.row.glzz }}</template>
</el-table-column>
<el-table-column
align="header-center"
label="所属中心"
prop="sszx"
column-key="sszx"
:filters="groupBy.sszx"
:filter-multiple="false"
fixed="right"
>
<template slot-scope="scope">{{ scope.row.sszx }}</template>
</el-table-column>
<!-- <el-table-column align="center" label="操作">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button
:disabled="!checkPermission(['cma_update'])" :disabled="!checkPermission(['cma_update'])"
@ -174,25 +92,12 @@
/> />
</template> </template>
</el-table-column> --> </el-table-column> -->
</el-table> </el-table>
<pagination <pagination v-show="cmaList.count > 0" :total="cmaList.count" :page.sync="listQuery.page"
v-show="cmaList.count > 0" :limit.sync="listQuery.page_size" @pagination="getList" />
:total="cmaList.count"
:page.sync="listQuery.page"
:limit.sync="listQuery.page_size"
@pagination="getList"
/>
</el-card> </el-card>
<el-dialog <el-dialog :visible.sync="dialogVisible" :title="dialogType === 'edit' ? '编辑' : '新增'">
:visible.sync="dialogVisible" <el-form ref="Form" :model="cma" label-width="80px" label-position="right">
:title="dialogType === 'edit' ? '编辑' : '新增'"
>
<el-form
ref="Form"
:model="cma"
label-width="80px"
label-position="right"
>
<el-form-item label="姓名" prop="name"> <el-form-item label="姓名" prop="name">
<el-input v-model="cma.name" placeholder="姓名" /> <el-input v-model="cma.name" placeholder="姓名" />
</el-form-item> </el-form-item>
@ -274,7 +179,7 @@ export default {
let searchList = this.listQuery.search.split(" "); let searchList = this.listQuery.search.split(" ");
let reg = null; let reg = null;
for (let i = 0; i < searchList.length; i++) { for (let i = 0; i < searchList.length; i++) {
reg=new RegExp(searchList[i],"g"); reg = new RegExp(searchList[i], "g");
val = val.replace(reg, '<span style="color:red;font-weight:bold">' + searchList[i] + '</span>'); val = val.replace(reg, '<span style="color:red;font-weight:bold">' + searchList[i] + '</span>');
} }
return val; return val;
@ -363,64 +268,64 @@ export default {
.catch((err) => { .catch((err) => {
}); });
}, },
delAll() { delAll() {
this.$confirm("确认删除?", "警告", { this.$confirm("确认删除?", "警告", {
confirmButtonText: "确认", confirmButtonText: "确认",
cancelButtonText: "取消", cancelButtonText: "取消",
type: "error", type: "error",
}) })
.then(async () => { .then(async () => {
const length = this.multipleSelection.length; const length = this.multipleSelection.length;
for (let i = 0; i < length; i++) { for (let i = 0; i < length; i++) {
this.delarr.push(this.multipleSelection[i].id); this.delarr.push(this.multipleSelection[i].id);
} }
let data = { ids: this.delarr }; let data = { ids: this.delarr };
deletes(data) deletes(data)
.then((res) => { .then((res) => {
this.$message({ this.$message({
message: "删除成功", message: "删除成功",
type: "success", type: "success",
}); });
this.getList(); this.getList();
})
}) })
})
.catch((err) => { .catch((err) => {
}); });
}, },
delAll2() { delAll2() {
let sszx = this.listQuery.sszx let sszx = this.listQuery.sszx
if(sszx==null || sszx==='' || sszx == undefined){ if (sszx == null || sszx === '' || sszx == undefined) {
this.$message({ this.$message({
message: "请选中所属公司", message: "请选中所属公司",
type: "warning", type: "warning",
}); });
return return
} }
this.$confirm("确认删除?", "警告", { this.$confirm("确认删除?", "警告", {
confirmButtonText: "确认", confirmButtonText: "确认",
cancelButtonText: "取消", cancelButtonText: "取消",
type: "error", type: "error",
}) })
.then(async () => { .then(async () => {
let data = { sszx: sszx }; let data = { sszx: sszx };
deletes(data) deletes(data)
.then((res) => { .then((res) => {
this.$message({ this.$message({
message: "删除成功", message: "删除成功",
type: "success", type: "success",
}); });
this.getList(); this.getList();
})
}) })
})
.catch((err) => { .catch((err) => {
}); });
}, },
handleSelectionChange(val) { handleSelectionChange(val) {
this.multipleSelection = val; this.multipleSelection = val;
}, },
filterChange(obj) { filterChange(obj) {
for (let key in obj) { for (let key in obj) {
this.listQuery[key] = obj[key][0]; this.listQuery[key] = obj[key][0];

View File

@ -0,0 +1,18 @@
# Generated by Django 3.2.12 on 2024-01-24 09:11
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('ability', '0037_qtask_orgs'),
]
operations = [
migrations.AddField(
model_name='cnas',
name='sm',
field=models.TextField(blank=True, null=True, verbose_name='说明'),
),
]

View File

@ -1,194 +1,194 @@
from apps.system.models import City, Dict, Province from apps.system.models import City, Dict, Province
from django.db import models from django.db import models
from utils.model import BaseModel from utils.model import BaseModel
from apps.system.models import CommonAModel, CommonBModel, File, Organization, User from apps.system.models import CommonAModel, CommonBModel, File, Organization, User
# Create your models here. # Create your models here.
from django.contrib.postgres.fields import JSONField from django.contrib.postgres.fields import JSONField
class Ability(BaseModel): class Ability(BaseModel):
dlxh = models.TextField('大类序号', null=True, blank=True) dlxh = models.TextField("大类序号", null=True, blank=True)
dlmc = models.TextField('大类', null=True, blank=True) dlmc = models.TextField("大类", null=True, blank=True)
lbxh = models.TextField('类别序号', null=True,blank=True) lbxh = models.TextField("类别序号", null=True, blank=True)
lbmc = models.TextField('类别名称', null=True,blank=True) lbmc = models.TextField("类别名称", null=True, blank=True)
xmxh = models.TextField('项目序号', null=True,blank=True) xmxh = models.TextField("项目序号", null=True, blank=True)
xmmc = models.TextField('项目名称', null=True,blank=True) xmmc = models.TextField("项目名称", null=True, blank=True)
bzmc = models.TextField('标准名称', null=True,blank=True) bzmc = models.TextField("标准名称", null=True, blank=True)
bzbh = models.TextField('标准编号', null=True,blank=True) bzbh = models.TextField("标准编号", null=True, blank=True)
bztk = models.TextField('标准条款', null=True,blank=True) bztk = models.TextField("标准条款", null=True, blank=True)
xzfw = models.TextField('限制范围',null=True,blank=True) xzfw = models.TextField("限制范围", null=True, blank=True)
bz = models.TextField('备注',null=True,blank=True) bz = models.TextField("备注", null=True, blank=True)
cma = models.TextField('CMA中心',null=True,blank=True) cma = models.TextField("CMA中心", null=True, blank=True)
cma_ok = models.BooleanField(null=True, blank=True) cma_ok = models.BooleanField(null=True, blank=True)
cnas_ok = models.BooleanField(null=True, blank=True) cnas_ok = models.BooleanField(null=True, blank=True)
cnas = models.TextField('CNAS中心',null=True,blank=True) cnas = models.TextField("CNAS中心", null=True, blank=True)
cma_o = models.TextField('中心',null=True,blank=True) cma_o = models.TextField("中心", null=True, blank=True)
cma_oplace = models.TextField('地点',null=True,blank=True) cma_oplace = models.TextField("地点", null=True, blank=True)
class Meta:
verbose_name='记录合并'
class Meta:
verbose_name = "记录合并"
class QueryRecord(BaseModel): class QueryRecord(BaseModel):
user = models.ForeignKey(User, related_name='record_user', on_delete=models.CASCADE) user = models.ForeignKey(User, related_name="record_user", on_delete=models.CASCADE)
path = models.CharField('访问地址', max_length=200) path = models.CharField("访问地址", max_length=200)
ip = models.CharField('IP地址', max_length=200, null=True, blank=True) ip = models.CharField("IP地址", max_length=200, null=True, blank=True)
method = models.CharField('方法', max_length=100, default='GET') method = models.CharField("方法", max_length=100, default="GET")
query = JSONField(null=True,blank=True) query = JSONField(null=True, blank=True)
search = models.TextField('搜索字符', null=True, blank=True) search = models.TextField("搜索字符", null=True, blank=True)
class Meta: class Meta:
verbose_name = '查询记录' verbose_name = "查询记录"
verbose_name_plural = verbose_name verbose_name_plural = verbose_name
class Correct(BaseModel): class Correct(BaseModel):
dlxh = models.TextField('大类序号', null=True,blank=True) dlxh = models.TextField("大类序号", null=True, blank=True)
dlmc = models.TextField('大类', null=True,blank=True) dlmc = models.TextField("大类", null=True, blank=True)
lbxh = models.TextField('类别序号', null=True,blank=True) lbxh = models.TextField("类别序号", null=True, blank=True)
lbmc = models.TextField('类别名称', null=True,blank=True) lbmc = models.TextField("类别名称", null=True, blank=True)
bclxh = models.TextField('被测量序号', null=True,blank=True) bclxh = models.TextField("被测量序号", null=True, blank=True)
bclmc = models.TextField('被测量名称', null=True,blank=True) bclmc = models.TextField("被测量名称", null=True, blank=True)
jzgc = models.TextField('校准规程', null=True, blank=True) jzgc = models.TextField("校准规程", null=True, blank=True)
clfw = models.TextField('测量范围', null=True, blank=True) clfw = models.TextField("测量范围", null=True, blank=True)
zqddj = models.TextField('准确度等级', null=True, blank=True) zqddj = models.TextField("准确度等级", null=True, blank=True)
note = models.TextField('说明', null=True, blank=True) note = models.TextField("说明", null=True, blank=True)
ssgs = models.TextField('所属公司', null=True, blank=True) ssgs = models.TextField("所属公司", null=True, blank=True)
ssbm = models.ForeignKey(Organization, on_delete=models.CASCADE, null=True, blank=True, related_name='correct_ssbm') ssbm = models.ForeignKey(Organization, on_delete=models.CASCADE, null=True, blank=True, related_name="correct_ssbm")
class Meta: class Meta:
verbose_name='校验能力' verbose_name = "校验能力"
verbose_name_plural=verbose_name verbose_name_plural = verbose_name
class CMA(BaseModel): class CMA(BaseModel):
""" """
CMA检测能力表 CMA检测能力表
""" """
type_choices = (
('center', '总部'), type_choices = (("center", "总部"), ("sub", "分子公司"))
('sub', '分子公司') dlxh = models.TextField("大类序号", null=True, blank=True)
) dlmc = models.TextField("大类", null=True, blank=True)
dlxh = models.TextField('大类序号', null=True,blank=True) lbxh = models.TextField("类别序号", null=True, blank=True)
dlmc = models.TextField('大类', null=True,blank=True) lbmc = models.TextField("类别名称", null=True, blank=True)
lbxh = models.TextField('类别序号', null=True,blank=True) xmxh = models.TextField("项目序号", null=True, blank=True)
lbmc = models.TextField('类别名称', null=True,blank=True) xmmc = models.TextField("项目名称", null=True, blank=True)
xmxh = models.TextField('项目序号', null=True,blank=True) bzmc = models.TextField("标准名称", null=True, blank=True)
xmmc = models.TextField('项目名称', null=True,blank=True) bzbh = models.TextField("标准编号", null=True, blank=True)
bzmc = models.TextField('标准名称', null=True,blank=True) xzfw = models.TextField("限制范围", null=True, blank=True)
bzbh = models.TextField('标准编号', null=True,blank=True) bz = models.TextField("备注", null=True, blank=True)
xzfw = models.TextField('限制范围',null=True,blank=True) sszx = models.TextField("所属中心", null=True, blank=True)
bz = models.TextField('备注',null=True,blank=True) type = models.CharField("所属类型", max_length=50, choices=type_choices, default="center")
sszx = models.TextField('所属中心',null=True,blank=True) glzz = models.TextField("关联资质", null=True, blank=True)
type = models.CharField('所属类型', max_length=50,
choices=type_choices, default='center')
glzz = models.TextField('关联资质', null=True, blank=True)
class Inspection(BaseModel): class Inspection(BaseModel):
""" """
检验能力表 检验能力表
""" """
dlxh = models.TextField('大类序号', null=True,blank=True) dlxh = models.TextField("大类序号", null=True, blank=True)
dlmc = models.TextField('大类名称', null=True,blank=True) dlmc = models.TextField("大类名称", null=True, blank=True)
dxxh = models.TextField('对象序号', null=True,blank=True) dxxh = models.TextField("对象序号", null=True, blank=True)
jydx = models.TextField('检验对象', null=True,blank=True) jydx = models.TextField("检验对象", null=True, blank=True)
jyxmxh = models.TextField('检验项目序号', null=True,blank=True) jyxmxh = models.TextField("检验项目序号", null=True, blank=True)
jyxmmc = models.TextField('检验项目名称', null=True,blank=True) jyxmmc = models.TextField("检验项目名称", null=True, blank=True)
jybz = models.TextField('检验标准', null=True,blank=True) jybz = models.TextField("检验标准", null=True, blank=True)
sm = models.TextField('说明', null=True,blank=True) sm = models.TextField("说明", null=True, blank=True)
sxrq = models.TextField('生效日期', null=True,blank=True) sxrq = models.TextField("生效日期", null=True, blank=True)
sszx = models.TextField('所属中心',null=True,blank=True) sszx = models.TextField("所属中心", null=True, blank=True)
class CNAS(BaseModel): class CNAS(BaseModel):
""" """
CNAS检测能力表 CNAS检测能力表
""" """
lbmc = models.TextField('类别名称', null=True,blank=True)
xmmc = models.TextField('项目名称', null=True,blank=True) lbmc = models.TextField("类别名称", null=True, blank=True)
bzmc = models.TextField('标准名称', null=True,blank=True) xmmc = models.TextField("项目名称", null=True, blank=True)
bzbh = models.TextField('标准编号', null=True,blank=True) bzmc = models.TextField("标准名称", null=True, blank=True)
bztk = models.TextField('标准条款', null=True,blank=True) bzbh = models.TextField("标准编号", null=True, blank=True)
sszx = models.TextField('所属中心',null=True,blank=True) bztk = models.TextField("标准条款", null=True, blank=True)
sszx = models.TextField("所属中心", null=True, blank=True)
sm = models.TextField("说明", null=True, blank=True)
class Qualification(BaseModel): class Qualification(BaseModel):
sszx = models.TextField('所属中心', null=True, blank=True) sszx = models.TextField("所属中心", null=True, blank=True)
ssbm = models.ForeignKey(Organization, on_delete=models.CASCADE, null=True, blank=True, related_name='qualification_ssbm') ssbm = models.ForeignKey(Organization, on_delete=models.CASCADE, null=True, blank=True, related_name="qualification_ssbm")
cma = models.TextField('cma资质', null=True, blank=True) cma = models.TextField("cma资质", null=True, blank=True)
cnas = models.TextField('cnas资质', null=True, blank=True) cnas = models.TextField("cnas资质", null=True, blank=True)
other = models.TextField('检验检测相关其它资质', null=True, blank=True) other = models.TextField("检验检测相关其它资质", null=True, blank=True)
service = models.TextField('主要检验检测服务', null=True, blank=True) service = models.TextField("主要检验检测服务", null=True, blank=True)
class Qualificationother(BaseModel): class Qualificationother(BaseModel):
qualification = models.ForeignKey(Qualification, on_delete=models.CASCADE, related_name='other_qualification') qualification = models.ForeignKey(Qualification, on_delete=models.CASCADE, related_name="other_qualification")
name = models.TextField('其他资质', null=True, blank=True) name = models.TextField("其他资质", null=True, blank=True)
description = models.TextField('资质范围', null=True, blank=True) description = models.TextField("资质范围", null=True, blank=True)
class QualiLib(BaseModel): class QualiLib(BaseModel):
""" """
资质库 资质库
""" """
name = models.CharField('名称', max_length=20)
levels = JSONField('等级', default=list, null=True, blank=True) name = models.CharField("名称", max_length=20)
scopes = JSONField('范围', default=list, null=True, blank=True) levels = JSONField("等级", default=list, null=True, blank=True)
scopes = JSONField("范围", default=list, null=True, blank=True)
class Quali(CommonAModel): class Quali(CommonAModel):
""" """
资质 资质
""" """
QUALI_TYPE_CHOICES=(
('CMA', 'CMA'), QUALI_TYPE_CHOICES = (("CMA", "CMA"), ("CNAS", "CNAS"), ("OTHER", "OTHER"))
('CNAS', 'CNAS'), QUALI_GRADE_CHOICES = ((10, "国家级"), (20, "省级"), (30, "市级"), (40, "实验室"), (50, "检验机构"))
('OTHER', 'OTHER') org = models.ForeignKey(Organization, on_delete=models.CASCADE, verbose_name="所属单位")
) name = models.CharField("资质名称", max_length=20, null=True, blank=True)
QUALI_GRADE_CHOICES = ( type = models.CharField("资质类型", choices=QUALI_TYPE_CHOICES, max_length=10)
(10, '国家级'), grade = models.PositiveSmallIntegerField("等级1", null=True, blank=True, choices=QUALI_GRADE_CHOICES)
(20, '省级'), scope = models.TextField("范围", null=True, blank=True)
(30, '市级'), level = models.CharField("等级2", max_length=10, null=True, blank=True)
(40, '实验室'),
(50, '检验机构')
)
org = models.ForeignKey(Organization, on_delete=models.CASCADE, verbose_name='所属单位')
name = models.CharField('资质名称', max_length=20, null=True, blank=True)
type = models.CharField('资质类型', choices=QUALI_TYPE_CHOICES, max_length=10)
grade = models.PositiveSmallIntegerField('等级1', null=True, blank=True, choices=QUALI_GRADE_CHOICES)
scope = models.TextField('范围', null=True, blank=True)
level = models.CharField('等级2', max_length=10, null=True, blank=True)
province = models.ForeignKey(Province, on_delete=models.SET_NULL, null=True, blank=True) province = models.ForeignKey(Province, on_delete=models.SET_NULL, null=True, blank=True)
city = models.ForeignKey(City, on_delete=models.SET_NULL, null=True, blank=True, related_name='quali_city') city = models.ForeignKey(City, on_delete=models.SET_NULL, null=True, blank=True, related_name="quali_city")
citys = models.ManyToManyField(City, verbose_name='备案城市', related_name='quali_citys', blank=True) citys = models.ManyToManyField(City, verbose_name="备案城市", related_name="quali_citys", blank=True)
description = models.TextField('描述', null=True, blank=True) description = models.TextField("描述", null=True, blank=True)
qualilib = models.ForeignKey(QualiLib, verbose_name='关联资质库', qualilib = models.ForeignKey(QualiLib, verbose_name="关联资质库", null=True, blank=True, on_delete=models.SET_NULL)
null=True, blank=True, on_delete=models.SET_NULL) end_date = models.DateField("截至日期", null=True, blank=True)
end_date = models.DateField('截至日期', null=True, blank=True) file = models.ForeignKey(File, null=True, blank=True, verbose_name="关联文件", on_delete=models.CASCADE)
file = models.ForeignKey(File, null=True, blank=True, verbose_name='关联文件', on_delete=models.CASCADE)
class QTask(CommonBModel): class QTask(CommonBModel):
""" """
资质报送任务 资质报送任务
""" """
state_choices = ( state_choices = (
('待发布', '待发布'), ("待发布", "待发布"),
('进行中', '进行中'), ("进行中", "进行中"),
('已关闭', '已关闭'), ("已关闭", "已关闭"),
) )
name = models.CharField('名称', max_length=100) name = models.CharField("名称", max_length=100)
end_date = models.DateField('截止时间', null=True, blank=True) end_date = models.DateField("截止时间", null=True, blank=True)
state = models.CharField('任务状态', max_length=50, choices=state_choices, default='待发布') state = models.CharField("任务状态", max_length=50, choices=state_choices, default="待发布")
orgs = models.ManyToManyField(Organization, through='ability.qorg') orgs = models.ManyToManyField(Organization, through="ability.qorg")
class Meta: class Meta:
verbose_name = '资质报送任务' verbose_name = "资质报送任务"
verbose_name_plural = verbose_name verbose_name_plural = verbose_name
class QOrg(BaseModel): class QOrg(BaseModel):
qtask = models.ForeignKey(QTask, verbose_name='关联任务', on_delete=models.CASCADE, related_name='qorg_qtask') qtask = models.ForeignKey(QTask, verbose_name="关联任务", on_delete=models.CASCADE, related_name="qorg_qtask")
org = models.ForeignKey(Organization, verbose_name='关联公司', on_delete=models.CASCADE, related_name='qorg_org') org = models.ForeignKey(Organization, verbose_name="关联公司", on_delete=models.CASCADE, related_name="qorg_org")
count = models.PositiveIntegerField(default=0) count = models.PositiveIntegerField(default=0)
count_confirmed = models.PositiveIntegerField(default=0) count_confirmed = models.PositiveIntegerField(default=0)
class Meta: class Meta:
verbose_name = '资质报送任务部门' verbose_name = "资质报送任务部门"
verbose_name_plural = verbose_name verbose_name_plural = verbose_name
@ -196,43 +196,39 @@ class QAction(CommonBModel):
""" """
任务操作 任务操作
""" """
QACTION_CHOICE = ( QACTION_CHOICE = (
('service:update', '更新服务'), ("service:update", "更新服务"),
('quali:create', '新增资质'), ("quali:create", "新增资质"),
('quali:update', '更新资质'), ("quali:update", "更新资质"),
('ablity:create', '新增能力'), ("ablity:create", "新增能力"),
('ablity:nochange', '能力无变化'), ("ablity:nochange", "能力无变化"),
('quali:nochange', '资质无变化') ("quali:nochange", "资质无变化"),
) )
action = models.CharField('操作类型', max_length=20, choices=QACTION_CHOICE) action = models.CharField("操作类型", max_length=20, choices=QACTION_CHOICE)
quali = models.ForeignKey(Quali, null=True, blank=True, verbose_name='操作资质', on_delete=models.CASCADE) quali = models.ForeignKey(Quali, null=True, blank=True, verbose_name="操作资质", on_delete=models.CASCADE)
file = models.ForeignKey(File, null=True, blank=True, verbose_name='能力文件', on_delete=models.CASCADE) file = models.ForeignKey(File, null=True, blank=True, verbose_name="能力文件", on_delete=models.CASCADE)
atype = models.ForeignKey(Dict, null=True, blank=True, verbose_name='能力类型', atype = models.ForeignKey(Dict, null=True, blank=True, verbose_name="能力类型", on_delete=models.CASCADE, related_name="quali_atype")
on_delete=models.CASCADE, related_name='quali_atype') afield = models.ForeignKey(Dict, null=True, blank=True, verbose_name="所属领域", on_delete=models.CASCADE, related_name="quali_afield")
afield = models.ForeignKey(Dict, null=True, blank=True, verbose_name='所属领域', num = models.PositiveIntegerField("新增对象数量", null=True, blank=True)
on_delete=models.CASCADE, related_name='quali_afield') num2 = models.PositiveIntegerField("新增参数数量", null=True, blank=True)
num = models.PositiveIntegerField('新增对象数量', null=True, blank=True) num3 = models.PositiveIntegerField("新增方法标准数量", null=True, blank=True)
num2 = models.PositiveIntegerField('新增参数数量', null=True, blank=True) num4 = models.PositiveIntegerField("新增产品标准数量", null=True, blank=True)
num3 = models.PositiveIntegerField('新增方法标准数量', null=True, blank=True)
num4 = models.PositiveIntegerField('新增产品标准数量', null=True, blank=True)
qtask = models.ForeignKey(QTask, on_delete=models.CASCADE) qtask = models.ForeignKey(QTask, on_delete=models.CASCADE)
value1 = JSONField('值1', null=True, blank=True, default=dict) value1 = JSONField("值1", null=True, blank=True, default=dict)
value2 = JSONField('值2', null=True, blank=True, default=dict) value2 = JSONField("值2", null=True, blank=True, default=dict)
confirmed = models.BooleanField('是否确认',default=False) confirmed = models.BooleanField("是否确认", default=False)
class QActionItem(BaseModel): class QActionItem(BaseModel):
QACTIONITEM_CHOICE = ( QACTIONITEM_CHOICE = (
('update', '更新'), ("update", "更新"),
('citys:add', '新增备案城市'), ("citys:add", "新增备案城市"),
('citys:remove', '移除备案城市'), ("citys:remove", "移除备案城市"),
) )
action = models.CharField('操作类型', max_length=20, choices=QACTIONITEM_CHOICE) action = models.CharField("操作类型", max_length=20, choices=QACTIONITEM_CHOICE)
field = models.CharField('变动字段', max_length=20) field = models.CharField("变动字段", max_length=20)
value1 = JSONField('原值', null=True, blank=True, default=dict) value1 = JSONField("原值", null=True, blank=True, default=dict)
value2 = JSONField('新值', null=True, blank=True, default=dict) value2 = JSONField("新值", null=True, blank=True, default=dict)
city = models.ForeignKey(City, on_delete=models.SET_NULL, null=True, blank=True) city = models.ForeignKey(City, on_delete=models.SET_NULL, null=True, blank=True)
qaction = models.ForeignKey(QAction, verbose_name='关联操作', qaction = models.ForeignKey(QAction, verbose_name="关联操作", on_delete=models.CASCADE, related_name="items_qaction", null=True, blank=True)
on_delete=models.CASCADE, related_name='items_qaction', null=True, blank=True)

File diff suppressed because it is too large Load Diff