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

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

View File

@ -3,71 +3,28 @@
<el-card>
<el-row :gutter="6">
<el-col :xs="24" :md="4">
<el-select
v-model="listQuery.sszx"
placeholder="所属公司"
@change="handleFilter2"
clearable
style="width: 100%"
>
<el-option
v-for="item in groupBy.sszx"
:key="item.value"
:label="item.text"
:value="item.value"
>
<el-select v-model="listQuery.sszx" placeholder="所属公司" @change="handleFilter2" clearable 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-input
v-model="listQuery.search"
placeholder="项目/标准/编号/公司"
style="width: 100%"
class="filter-item"
@keyup.enter.native="handleFilter"
/>
<el-input v-model="listQuery.search" placeholder="项目/标准/编号/公司" style="width: 100%" class="filter-item"
@keyup.enter.native="handleFilter" />
</el-col>
<el-col :xs="24" :md="6">
<el-button
class="filter-item"
type="primary"
icon="el-icon-search"
@click="handleFilter"
>搜索</el-button
>
<el-button
class="filter-item"
type="primary"
icon="el-icon-refresh-left"
@click="resetFilter"
>重置</el-button
>
<el-button class="filter-item" type="primary" icon="el-icon-search" @click="handleFilter">搜索</el-button>
<el-button class="filter-item" type="primary" icon="el-icon-refresh-left" @click="resetFilter">重置</el-button>
</el-col>
</el-row>
<div style="margin-top: 10px">
<el-popover
placement="top"
width="160"
v-if="checkPermission(['ability_import'])"
v-model="popovervisible"
>
<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 :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>
@ -77,83 +34,44 @@
</div>
</el-card>
<el-card style="margin-top: 10px">
<el-table
v-loading="listLoading"
:data="cmaList.results"
style="width: 100%;"
border
fit
stripe
highlight-current-row
max-height="700"
ref="filterTable"
@selection-change="handleSelectionChange"
@filter-change="filterChange"
>
<el-table-column
type="selection"
width="55">
<el-table v-loading="listLoading" :data="cmaList.results" style="width: 100%;" border fit stripe
highlight-current-row max-height="700" ref="filterTable" @selection-change="handleSelectionChange"
@filter-change="filterChange">
<el-table-column type="selection" width="55">
</el-table-column>
<el-table-column type="index" width="50" />
<el-table-column label="大类名称">
<template slot-scope="scope"
><span v-html="showlight(scope.row.dlmc)" v-if="scope.row.dlmc"></span
></template>
<template slot-scope="scope"><span v-html="showlight(scope.row.dlmc)" v-if="scope.row.dlmc"></span></template>
</el-table-column>
<el-table-column label="类别名称">
<template slot-scope="scope"
><span v-html="showlight(scope.row.lbmc)"></span
></template>
<template slot-scope="scope"><span v-html="showlight(scope.row.lbmc)"></span></template>
</el-table-column>
<el-table-column label="项目序号">
<template slot-scope="scope"
><span v-html="showlight(scope.row.xmxh)"></span
></template>
<template slot-scope="scope"><span v-html="showlight(scope.row.xmxh)"></span></template>
</el-table-column>
<el-table-column label="项目名称">
<template slot-scope="scope"
><span v-html="showlight(scope.row.xmmc)"></span
></template>
<template slot-scope="scope"><span v-html="showlight(scope.row.xmmc)"></span></template>
</el-table-column>
<el-table-column label="标准名称" width="300">
<template slot-scope="scope"
><span v-html="showlight(scope.row.bzmc)"></span
></template>
<template slot-scope="scope"><span v-html="showlight(scope.row.bzmc)"></span></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>
<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 label="说明">
<template slot-scope="scope"><span v-html="showlight(scope.row.sm)" v-if="scope.row.sm"></span></template>
</el-table-column>
<el-table-column label="创建日期">
<template slot-scope="scope">{{scope.row.create_time.substring(0, 10)}}</template>
<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>
<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"
>
<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"
>
<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="操作">
@ -175,24 +93,11 @@
</template>
</el-table-column> -->
</el-table>
<pagination
v-show="cmaList.count > 0"
:total="cmaList.count"
:page.sync="listQuery.page"
:limit.sync="listQuery.page_size"
@pagination="getList"
/>
<pagination v-show="cmaList.count > 0" :total="cmaList.count" :page.sync="listQuery.page"
:limit.sync="listQuery.page_size" @pagination="getList" />
</el-card>
<el-dialog
:visible.sync="dialogVisible"
:title="dialogType === 'edit' ? '编辑' : '新增'"
>
<el-form
ref="Form"
:model="cma"
label-width="80px"
label-position="right"
>
<el-dialog :visible.sync="dialogVisible" :title="dialogType === 'edit' ? '编辑' : '新增'">
<el-form ref="Form" :model="cma" label-width="80px" label-position="right">
<el-form-item label="姓名" prop="name">
<el-input v-model="cma.name" placeholder="姓名" />
</el-form-item>
@ -274,7 +179,7 @@ export default {
let searchList = this.listQuery.search.split(" ");
let reg = null;
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>');
}
return val;
@ -391,7 +296,7 @@ export default {
},
delAll2() {
let sszx = this.listQuery.sszx
if(sszx==null || sszx==='' || sszx == undefined){
if (sszx == null || sszx === '' || sszx == undefined) {
this.$message({
message: "请选中所属公司",
type: "warning",

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

File diff suppressed because it is too large Load Diff