Merge branch 'develop' of https://e.coding.net/ctcdevteam/hberp/hberp into develop
This commit is contained in:
commit
30c4006252
|
@ -141,6 +141,18 @@ export const asyncRoutes = [
|
||||||
name: 'detection ',
|
name: 'detection ',
|
||||||
component: () => import('@/views/em/detection'),
|
component: () => import('@/views/em/detection'),
|
||||||
meta: { title: '监视和测量设备', icon: 'example', perms: ['index_manage'] }
|
meta: { title: '监视和测量设备', icon: 'example', perms: ['index_manage'] }
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: 'equipment',
|
||||||
|
name: 'equipment',
|
||||||
|
component: () => import('@/views/em/equipment'),
|
||||||
|
meta: { title: '校准检定记录', icon: 'example', perms: ['index_manage'] }
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: 'detection ',
|
||||||
|
name: 'detection ',
|
||||||
|
component: () => import('@/views/em/detection'),
|
||||||
|
meta: { title: '运维记录', icon: 'example', perms: ['index_manage'] }
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
<div>
|
<div>
|
||||||
<el-input
|
<el-input
|
||||||
v-model="listQuery.search"
|
v-model="listQuery.search"
|
||||||
placeholder="设备名称/设备型号"
|
placeholder="设备名称/设备编号/备注"
|
||||||
style="width: 300px"
|
style="width: 300px"
|
||||||
class="filter-item"
|
class="filter-item"
|
||||||
@keyup.enter.native="handleFilter"
|
@keyup.enter.native="handleFilter"
|
||||||
|
@ -41,42 +41,54 @@
|
||||||
max-height="600"
|
max-height="600"
|
||||||
>
|
>
|
||||||
<el-table-column type="index" width="50" />
|
<el-table-column type="index" width="50" />
|
||||||
<el-table-column label="设备名称">
|
<el-table-column label="设备编号">
|
||||||
<template slot-scope="scope">{{ scope.row.name }}</template>
|
|
||||||
</el-table-column>
|
|
||||||
|
|
||||||
<el-table-column label="设备编号">
|
|
||||||
<template slot-scope="scope">{{ scope.row.number }}</template>
|
<template slot-scope="scope">{{ scope.row.number }}</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
|
||||||
|
<el-table-column label="管理类别">
|
||||||
|
<template slot-scope="scope">{{ mgmtype_[scope.row.mgmtype] }}</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="校/检方式">
|
||||||
|
<template slot-scope="scope">{{ waytype_[scope.row.way] }}</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="标准/依据">
|
||||||
|
<template slot-scope="scope">{{ scope.row.standard }}</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="校/检周期">
|
||||||
|
<template slot-scope="scope">{{ scope.row.cycle }}</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="设备名称">
|
||||||
|
<template slot-scope="scope">{{ scope.row.name }}</template>
|
||||||
|
</el-table-column>
|
||||||
<el-table-column label="型号规格">
|
<el-table-column label="型号规格">
|
||||||
<template slot-scope="scope">{{ scope.row.model }}</template>
|
<template slot-scope="scope">{{ scope.row.model }}</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="类型">
|
|
||||||
<template slot-scope="scope">{{ type_[scope.row.type] }}</template>
|
<el-table-column label="生产厂家">
|
||||||
|
<template slot-scope="scope">{{ scope.row.factory }}</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="购置日期">
|
<el-table-column label="使用类别">
|
||||||
<template slot-scope="scope">{{ scope.row.buy_date }}</template>
|
<template slot-scope="scope">{{ usetype_[scope.row.way] }}</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="所属部门">
|
<el-table-column label="校/检状态">
|
||||||
<template slot-scope="scope" v-if="scope.row.belong_dept_">{{ scope.row.belong_dept_.name }}</template>
|
<template slot-scope="scope">{{ state_[scope.row.statedm] }}</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
state_
|
||||||
<el-table-column label="保管人">
|
<el-table-column label="保管人">
|
||||||
<template slot-scope="scope" v-if="scope.row.keeper_">{{ scope.row.keeper_.username }}</template>
|
<template slot-scope="scope" v-if="scope.row.keeper_">{{ scope.row.keeper_.username }}</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="存放位置">
|
<el-table-column label="存放位置">
|
||||||
<template slot-scope="scope">{{ scope.row.place }}</template>
|
<template slot-scope="scope">{{ scope.row.place }}</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="任务备注">
|
<el-table-column label="备注">
|
||||||
<template slot-scope="scope">{{ scope.row.description }}</template>
|
<template slot-scope="scope">{{ scope.row.description }}</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="创建时间">
|
|
||||||
<template slot-scope="scope">{{ scope.row.create_time }}</template>
|
|
||||||
</el-table-column>
|
|
||||||
|
|
||||||
<el-table-column
|
<el-table-column
|
||||||
align="center"
|
align="center"
|
||||||
label="操作"
|
label="操作"
|
||||||
width="220px"
|
width="120px"
|
||||||
>
|
>
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
|
|
||||||
|
@ -132,16 +144,17 @@
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="生产厂家" prop="factory">
|
<el-form-item label="标准/依据" prop="standard">
|
||||||
<el-input v-model="equipment.factory" placeholder="生产厂商及国别" />
|
<el-input v-model="equipment.standard" placeholder="溯源标准或依据" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
|
||||||
|
<el-row>
|
||||||
<el-form-item label="状态" prop="state">
|
<el-col :span="12">
|
||||||
|
<el-form-item label="校/检状态" prop="statedm">
|
||||||
|
|
||||||
<el-select style="width: 100%" v-model="equipment.state" placeholder="请选择">
|
<el-select style="width: 100%" v-model="equipment.statedm" placeholder="请选择">
|
||||||
<el-option
|
<el-option
|
||||||
v-for="item in options"
|
v-for="item in options"
|
||||||
:key="item.value"
|
:key="item.value"
|
||||||
|
@ -150,8 +163,20 @@
|
||||||
</el-option>
|
</el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="管理类别" prop="mgmtype">
|
||||||
|
<el-select style="width: 100%" v-model="equipment.mgmtype" placeholder="请选择">
|
||||||
|
<el-option
|
||||||
|
v-for="item in mgmoptions"
|
||||||
|
:key="item.value"
|
||||||
|
:label="item.label"
|
||||||
|
:value="item.value">
|
||||||
|
</el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="存放位置" prop="place">
|
<el-form-item label="存放位置" prop="place">
|
||||||
|
@ -180,6 +205,50 @@
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="校/检方式" prop="way">
|
||||||
|
<el-select style="width: 100%" v-model="equipment.way" placeholder="请选择">
|
||||||
|
<el-option
|
||||||
|
v-for="item in wayoptions"
|
||||||
|
:key="item.value"
|
||||||
|
:label="item.label"
|
||||||
|
:value="item.value">
|
||||||
|
</el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="存放位置" prop="place">
|
||||||
|
<el-input v-model="equipment.place" placeholder="存放位置" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="使用类别" prop="usetype">
|
||||||
|
<el-select style="width: 100%" v-model="equipment.usetype" placeholder="请选择">
|
||||||
|
<el-option
|
||||||
|
v-for="item in useoptions"
|
||||||
|
:key="item.value"
|
||||||
|
:label="item.label"
|
||||||
|
:value="item.value">
|
||||||
|
</el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="校/检周期" prop="cycle">
|
||||||
|
<el-input v-model="equipment.cycle" placeholder="校准或检定周期" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
|
||||||
|
<el-form-item label="生产厂家" prop="factory">
|
||||||
|
<el-input v-model="equipment.factory" placeholder="生产厂商及国别" />
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
<el-form-item label="备注" prop="description">
|
<el-form-item label="备注" prop="description">
|
||||||
<el-input
|
<el-input
|
||||||
type="textarea"
|
type="textarea"
|
||||||
|
@ -188,7 +257,6 @@
|
||||||
placeholder="备注"
|
placeholder="备注"
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -226,21 +294,72 @@ export default {
|
||||||
equipmentList: {
|
equipmentList: {
|
||||||
count: 0,
|
count: 0,
|
||||||
},
|
},
|
||||||
type_: {
|
mgmtype_: {
|
||||||
'1':'生产设备',
|
'1':'A',
|
||||||
'2':'检验工具',
|
'2':'B',
|
||||||
|
'3':'C',
|
||||||
},
|
},
|
||||||
|
mgmoptions: [{
|
||||||
options: [{
|
|
||||||
value: 0,
|
|
||||||
label: '运转正常'
|
|
||||||
}, {
|
|
||||||
value: 1,
|
value: 1,
|
||||||
label: '停用'
|
label: 'A'
|
||||||
}, {
|
}, {
|
||||||
value: 2,
|
value: 2,
|
||||||
label: '报废'
|
label: 'B'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: 3,
|
||||||
|
label: 'C'
|
||||||
|
}],
|
||||||
|
waytype_: {
|
||||||
|
'1':'外检',
|
||||||
|
'2':'自检',
|
||||||
|
|
||||||
|
},
|
||||||
|
wayoptions: [{
|
||||||
|
value: 1,
|
||||||
|
label: '外检'
|
||||||
|
}, {
|
||||||
|
value: 2,
|
||||||
|
label: '自检'
|
||||||
|
}],
|
||||||
|
usetype_:{
|
||||||
|
'1':'专用',
|
||||||
|
'2':'公用',
|
||||||
|
},
|
||||||
|
useoptions: [{
|
||||||
|
value: 1,
|
||||||
|
label: '专用'
|
||||||
|
}, {
|
||||||
|
value: 2,
|
||||||
|
label: '公用'
|
||||||
|
}],
|
||||||
|
state_:{
|
||||||
|
0:'合格',
|
||||||
|
1:'准用',
|
||||||
|
2:'限用',
|
||||||
|
3:'禁用',
|
||||||
|
4:'停用',
|
||||||
|
5:'封存',
|
||||||
|
},
|
||||||
|
options: [{
|
||||||
|
value: 0,
|
||||||
|
label: '合格'
|
||||||
|
}, {
|
||||||
|
value: 1,
|
||||||
|
label: '准用'
|
||||||
|
}, {
|
||||||
|
value: 2,
|
||||||
|
label: '限用'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: 3,
|
||||||
|
label: '禁用'
|
||||||
|
}, {
|
||||||
|
value: 4,
|
||||||
|
label: '停用'
|
||||||
|
}, {
|
||||||
|
value: 5,
|
||||||
|
label: '封存'
|
||||||
}],
|
}],
|
||||||
listQuery: {
|
listQuery: {
|
||||||
page: 1,
|
page: 1,
|
||||||
|
@ -273,6 +392,7 @@ export default {
|
||||||
//设备列表
|
//设备列表
|
||||||
getList() {
|
getList() {
|
||||||
this.listLoading = true;
|
this.listLoading = true;
|
||||||
|
this.listQuery.type=2;
|
||||||
getpEquipmentList(this.listQuery).then((response) => {
|
getpEquipmentList(this.listQuery).then((response) => {
|
||||||
if (response.data) {
|
if (response.data) {
|
||||||
this.equipmentList = response.data;
|
this.equipmentList = response.data;
|
||||||
|
@ -351,7 +471,7 @@ export default {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
this.equipment.type=1;
|
this.equipment.type=2;
|
||||||
createEquipment(this.equipment).then((res) => {
|
createEquipment(this.equipment).then((res) => {
|
||||||
if (res.code >= 200) {
|
if (res.code >= 200) {
|
||||||
this.getList();
|
this.getList();
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
<div>
|
<div>
|
||||||
<el-input
|
<el-input
|
||||||
v-model="listQuery.search"
|
v-model="listQuery.search"
|
||||||
placeholder="设备名称/设备型号"
|
placeholder="设备名称/设备编号/备注"
|
||||||
style="width: 300px"
|
style="width: 300px"
|
||||||
class="filter-item"
|
class="filter-item"
|
||||||
@keyup.enter.native="handleFilter"
|
@keyup.enter.native="handleFilter"
|
||||||
|
@ -51,14 +51,36 @@
|
||||||
<el-table-column label="型号规格">
|
<el-table-column label="型号规格">
|
||||||
<template slot-scope="scope">{{ scope.row.model }}</template>
|
<template slot-scope="scope">{{ scope.row.model }}</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="类型">
|
<el-table-column label="生产厂及国别">
|
||||||
<template slot-scope="scope">{{ type_[scope.row.type] }}</template>
|
<template slot-scope="scope">{{ scope.row.factory }}</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="生产日期">
|
||||||
|
<template slot-scope="scope">{{ scope.row.production_date }}</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="购置日期">
|
<el-table-column label="购置日期">
|
||||||
<template slot-scope="scope">{{ scope.row.buy_date }}</template>
|
<template slot-scope="scope">{{ scope.row.buy_date }}</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="所属部门">
|
<el-table-column label="数量">
|
||||||
<template slot-scope="scope" v-if="scope.row.belong_dept_">{{ scope.row.belong_dept_.name }}</template>
|
<template slot-scope="scope">{{ scope.row.count }}</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="状态">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-tag v-if="scope.row.state===0" type="success">
|
||||||
|
{{ state_[scope.row.state] }}
|
||||||
|
</el-tag>
|
||||||
|
<el-tag v-else-if="scope.row.state===1" type="warning">
|
||||||
|
{{ state_[scope.row.state] }}
|
||||||
|
</el-tag>
|
||||||
|
<el-tag v-else-if="scope.row.state===2" >
|
||||||
|
{{ state_[scope.row.state] }}
|
||||||
|
</el-tag>
|
||||||
|
<el-tag v-else type="danger">
|
||||||
|
{{ state_[scope.row.state] }}
|
||||||
|
</el-tag>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="技术指标">
|
||||||
|
<template slot-scope="scope">{{ scope.row.parameter }}</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="保管人">
|
<el-table-column label="保管人">
|
||||||
<template slot-scope="scope" v-if="scope.row.keeper_">{{ scope.row.keeper_.username }}</template>
|
<template slot-scope="scope" v-if="scope.row.keeper_">{{ scope.row.keeper_.username }}</template>
|
||||||
|
@ -66,17 +88,15 @@
|
||||||
<el-table-column label="存放位置">
|
<el-table-column label="存放位置">
|
||||||
<template slot-scope="scope">{{ scope.row.place }}</template>
|
<template slot-scope="scope">{{ scope.row.place }}</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="任务备注">
|
<el-table-column label="备注">
|
||||||
<template slot-scope="scope">{{ scope.row.description }}</template>
|
<template slot-scope="scope">{{ scope.row.description }}</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="创建时间">
|
|
||||||
<template slot-scope="scope">{{ scope.row.create_time }}</template>
|
|
||||||
</el-table-column>
|
|
||||||
|
|
||||||
<el-table-column
|
<el-table-column
|
||||||
align="center"
|
align="center"
|
||||||
label="操作"
|
label="操作"
|
||||||
width="220px"
|
width="120px"
|
||||||
>
|
>
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
|
|
||||||
|
@ -259,21 +279,24 @@ export default {
|
||||||
equipmentList: {
|
equipmentList: {
|
||||||
count: 0,
|
count: 0,
|
||||||
},
|
},
|
||||||
type_: {
|
state_:{
|
||||||
'1':'生产设备',
|
0:'完好',
|
||||||
'2':'检验工具',
|
1:'限用',
|
||||||
|
2:'在修',
|
||||||
},
|
3:'禁用',
|
||||||
|
},
|
||||||
options: [{
|
options: [{
|
||||||
value: 0,
|
value: 0,
|
||||||
label: '运转正常'
|
label: '完好'
|
||||||
}, {
|
}, {
|
||||||
value: 1,
|
value: 1,
|
||||||
label: '停用'
|
label: '限用'
|
||||||
}, {
|
}, {
|
||||||
value: 2,
|
value: 2,
|
||||||
label: '报废'
|
label: '在修'
|
||||||
|
}, {
|
||||||
|
value: 3,
|
||||||
|
label: '禁用'
|
||||||
}],
|
}],
|
||||||
listQuery: {
|
listQuery: {
|
||||||
page: 1,
|
page: 1,
|
||||||
|
@ -306,6 +329,7 @@ export default {
|
||||||
//设备列表
|
//设备列表
|
||||||
getList() {
|
getList() {
|
||||||
this.listLoading = true;
|
this.listLoading = true;
|
||||||
|
this.listQuery.type=1;
|
||||||
getpEquipmentList(this.listQuery).then((response) => {
|
getpEquipmentList(this.listQuery).then((response) => {
|
||||||
if (response.data) {
|
if (response.data) {
|
||||||
this.equipmentList = response.data;
|
this.equipmentList = response.data;
|
||||||
|
|
|
@ -33,7 +33,7 @@
|
||||||
<el-card style="margin-top: 10px">
|
<el-card style="margin-top: 10px">
|
||||||
<el-table
|
<el-table
|
||||||
v-loading="listLoading"
|
v-loading="listLoading"
|
||||||
:data="warehouseList.results"
|
:data="customerList.results"
|
||||||
border
|
border
|
||||||
fit
|
fit
|
||||||
stripe
|
stripe
|
||||||
|
@ -82,8 +82,8 @@
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
<pagination
|
<pagination
|
||||||
v-show="warehouseList.count > 0"
|
v-show="customerList.count > 0"
|
||||||
:total="warehouseList.count"
|
:total="customerList.count"
|
||||||
:page.sync="listQuery.page"
|
:page.sync="listQuery.page"
|
||||||
:limit.sync="listQuery.page_size"
|
:limit.sync="listQuery.page_size"
|
||||||
@pagination="getList"
|
@pagination="getList"
|
||||||
|
@ -141,7 +141,10 @@ export default {
|
||||||
customerList: {
|
customerList: {
|
||||||
count: 0,
|
count: 0,
|
||||||
},
|
},
|
||||||
|
listQuery: {
|
||||||
|
page: 1,
|
||||||
|
page_size: 20,
|
||||||
|
},
|
||||||
listLoading: true,
|
listLoading: true,
|
||||||
dialogVisible: false,
|
dialogVisible: false,
|
||||||
dialogType: "new",
|
dialogType: "new",
|
||||||
|
@ -162,7 +165,7 @@ export default {
|
||||||
this.listLoading = true;
|
this.listLoading = true;
|
||||||
getCustomerList(this.listQuery).then((response) => {
|
getCustomerList(this.listQuery).then((response) => {
|
||||||
if (response.data) {
|
if (response.data) {
|
||||||
this.warehouseList = response.data;
|
this.customerList = response.data;
|
||||||
}
|
}
|
||||||
this.listLoading = false;
|
this.listLoading = false;
|
||||||
});
|
});
|
||||||
|
|
|
@ -0,0 +1,23 @@
|
||||||
|
# Generated by Django 3.2.6 on 2021-09-14 05:35
|
||||||
|
|
||||||
|
from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('em', '0005_auto_20210914_1049'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.AddField(
|
||||||
|
model_name='equipment',
|
||||||
|
name='statedm',
|
||||||
|
field=models.IntegerField(choices=[(0, '合格'), (1, '准用'), (2, '限用'), (3, '禁用'), (4, '停用'), (5, '封存')], default=0, verbose_name='设备状态'),
|
||||||
|
),
|
||||||
|
migrations.AlterField(
|
||||||
|
model_name='equipment',
|
||||||
|
name='state',
|
||||||
|
field=models.CharField(choices=[(0, '完好'), (1, '限用'), (2, '在修'), (3, '禁用')], default=0, max_length=11, verbose_name='设备状态'),
|
||||||
|
),
|
||||||
|
]
|
|
@ -15,10 +15,20 @@ class Equipment(CommonBModel):
|
||||||
设备台账信息
|
设备台账信息
|
||||||
"""
|
"""
|
||||||
state_choices = (
|
state_choices = (
|
||||||
(1, '运转正常'),
|
(0, '完好'),
|
||||||
(0, '停用'),
|
(1, '限用'),
|
||||||
(2, '报废')
|
(2, '在修'),
|
||||||
|
(3, '禁用')
|
||||||
)
|
)
|
||||||
|
statedm_choices = (
|
||||||
|
(0, '合格'),
|
||||||
|
(1, '准用'),
|
||||||
|
(2, '限用'),
|
||||||
|
(3, '禁用'),
|
||||||
|
(4, '停用'),
|
||||||
|
(5, '封存')
|
||||||
|
)
|
||||||
|
|
||||||
type_choices = (
|
type_choices = (
|
||||||
(1, '生产设备'),
|
(1, '生产设备'),
|
||||||
(2, '检验工具')
|
(2, '检验工具')
|
||||||
|
@ -44,7 +54,7 @@ class Equipment(CommonBModel):
|
||||||
factory = models.CharField('生产厂', max_length=50, null=True, blank=True)
|
factory = models.CharField('生产厂', max_length=50, null=True, blank=True)
|
||||||
production_date = models.DateField('生产日期', null=True, blank=True)
|
production_date = models.DateField('生产日期', null=True, blank=True)
|
||||||
buy_date = models.DateField('购置日期', null=True, blank=True)
|
buy_date = models.DateField('购置日期', null=True, blank=True)
|
||||||
state = models.CharField('设备状态', max_length=11, choices=state_choices, default=1)
|
state = models.CharField('设备状态', max_length=11, choices=state_choices, default=0)
|
||||||
parameter = models.TextField('技术参数', null=True, blank=True)
|
parameter = models.TextField('技术参数', null=True, blank=True)
|
||||||
place = models.CharField('存放位置', max_length=50, null=True, blank=True)
|
place = models.CharField('存放位置', max_length=50, null=True, blank=True)
|
||||||
count = models.IntegerField('数量', default=0)
|
count = models.IntegerField('数量', default=0)
|
||||||
|
@ -56,6 +66,7 @@ class Equipment(CommonBModel):
|
||||||
standard = models.CharField('溯源标准或依据', max_length=200, blank=True, null=True)#监视,测量设备
|
standard = models.CharField('溯源标准或依据', max_length=200, blank=True, null=True)#监视,测量设备
|
||||||
cycle = models.IntegerField('校准或检定周期', default=0)#监视,测量设备
|
cycle = models.IntegerField('校准或检定周期', default=0)#监视,测量设备
|
||||||
usetype = models.IntegerField('使用类别', choices=usetype_choices, default=1)#监视,测量设备
|
usetype = models.IntegerField('使用类别', choices=usetype_choices, default=1)#监视,测量设备
|
||||||
|
statedm = models.IntegerField('设备状态', choices=statedm_choices, default=0)#监视,测量设备
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
verbose_name = '设备信息'
|
verbose_name = '设备信息'
|
||||||
|
@ -63,4 +74,4 @@ class Equipment(CommonBModel):
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
return self.number + '-' + self.name
|
return self.number + '-' + self.name
|
||||||
|
|
||||||
|
|
|
@ -15,7 +15,7 @@ class EquipmentViewSet(CreateUpdateModelAMixin, OptimizationMixin, ModelViewSet)
|
||||||
'put': 'equipment_update', 'delete': 'equipment_delete'}
|
'put': 'equipment_update', 'delete': 'equipment_delete'}
|
||||||
queryset = Equipment.objects.all()
|
queryset = Equipment.objects.all()
|
||||||
serializer_class = EquipmentSerializer
|
serializer_class = EquipmentSerializer
|
||||||
search_fields = ['number', 'name', 'place']
|
search_fields = ['number', 'name','description']
|
||||||
filterset_fields = ['belong_dept', 'keeper']
|
filterset_fields = ['belong_dept', 'keeper', 'type']
|
||||||
ordering_fields = ['create_time']
|
ordering_fields = ['create_time']
|
||||||
ordering = ['-create_time']
|
ordering = ['-create_time']
|
||||||
|
|
Loading…
Reference in New Issue