From cb2beb1d3e6486ea89456cff53da620397418c58 Mon Sep 17 00:00:00 2001
From: shilixia <2309368887@qq.com>
Date: Tue, 14 Sep 2021 14:56:17 +0800
Subject: [PATCH 1/2] shebei
---
hb_client/src/views/em/detection.vue | 184 ++++++++++++++----
hb_client/src/views/em/equipment.vue | 49 +++--
.../em/migrations/0006_auto_20210914_1335.py | 23 +++
hb_server/apps/em/models.py | 19 +-
hb_server/apps/em/views.py | 4 +-
5 files changed, 216 insertions(+), 63 deletions(-)
create mode 100644 hb_server/apps/em/migrations/0006_auto_20210914_1335.py
diff --git a/hb_client/src/views/em/detection.vue b/hb_client/src/views/em/detection.vue
index 3badc6c..5b7f1d9 100644
--- a/hb_client/src/views/em/detection.vue
+++ b/hb_client/src/views/em/detection.vue
@@ -4,7 +4,7 @@
-
- {{ scope.row.name }}
-
-
-
+
{{ scope.row.number }}
+
+
+ {{ mgmtype_[scope.row.mgmtype] }}
+
+
+ {{ waytype_[scope.row.way] }}
+
+
+ {{ scope.row.standard }}
+
+
+ {{ scope.row.cycle }}
+
+
+ {{ scope.row.name }}
+
{{ scope.row.model }}
-
- {{ type_[scope.row.type] }}
+
+
+ {{ scope.row.factory }}
-
- {{ scope.row.buy_date }}
-
-
- {{ scope.row.belong_dept_.name }}
+
+ {{ usetype_[scope.row.way] }}
{{ scope.row.keeper_.username }}
@@ -66,17 +76,15 @@
{{ scope.row.place }}
-
+
{{ scope.row.description }}
-
- {{ scope.row.create_time }}
-
+
@@ -132,16 +140,17 @@
-
-
+
+
-
-
+
+
+
-
+
-
-
+
+
+
+
+
+
+
+
+
+
@@ -180,6 +201,50 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
@@ -226,21 +290,64 @@ export default {
equipmentList: {
count: 0,
},
- type_: {
- '1':'生产设备',
- '2':'检验工具',
-
+ mgmtype_: {
+ '1':'A',
+ '2':'B',
+ '3':'C',
},
-
- options: [{
- value: 0,
- label: '运转正常'
- }, {
+ mgmoptions: [{
value: 1,
- label: '停用'
+ label: 'A'
}, {
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: '公用'
+ }],
+ options: [{
+ value: 0,
+ label: '合格'
+ }, {
+ value: 1,
+ label: '准用'
+ }, {
+ value: 2,
+ label: '限用'
+ },
+ {
+ value: 3,
+ label: '禁用'
+ }, {
+ value: 4,
+ label: '停用'
+ }, {
+ value: 5,
+ label: '封存'
}],
listQuery: {
page: 1,
@@ -273,6 +380,7 @@ export default {
//设备列表
getList() {
this.listLoading = true;
+ this.listQuery.type=2;
getpEquipmentList(this.listQuery).then((response) => {
if (response.data) {
this.equipmentList = response.data;
@@ -351,7 +459,7 @@ export default {
}
});
} else {
- this.equipment.type=1;
+ this.equipment.type=2;
createEquipment(this.equipment).then((res) => {
if (res.code >= 200) {
this.getList();
diff --git a/hb_client/src/views/em/equipment.vue b/hb_client/src/views/em/equipment.vue
index 72948e8..a7df237 100644
--- a/hb_client/src/views/em/equipment.vue
+++ b/hb_client/src/views/em/equipment.vue
@@ -4,7 +4,7 @@
{{ scope.row.model }}
-
- {{ type_[scope.row.type] }}
+
+ {{ scope.row.factory }}
+
+
+ {{ scope.row.production_date }}
{{ scope.row.buy_date }}
-
- {{ scope.row.belong_dept_.name }}
+
+ {{ scope.row.count }}
+
+
+ {{ state_[scope.row.state] }}
+
+
+ {{ scope.row.parameter }}
{{ scope.row.keeper_.username }}
@@ -66,17 +75,15 @@
{{ scope.row.place }}
-
+
{{ scope.row.description }}
-
- {{ scope.row.create_time }}
-
+
@@ -259,21 +266,24 @@ export default {
equipmentList: {
count: 0,
},
- type_: {
- '1':'生产设备',
- '2':'检验工具',
-
- },
-
+ state_:{
+ 0:'完好',
+ 1:'限用',
+ 2:'在修',
+ 3:'禁用',
+ },
options: [{
value: 0,
- label: '运转正常'
+ label: '完好'
}, {
value: 1,
- label: '停用'
+ label: '限用'
}, {
value: 2,
- label: '报废'
+ label: '在修'
+ }, {
+ value: 3,
+ label: '禁用'
}],
listQuery: {
page: 1,
@@ -306,6 +316,7 @@ export default {
//设备列表
getList() {
this.listLoading = true;
+ this.listQuery.type=1;
getpEquipmentList(this.listQuery).then((response) => {
if (response.data) {
this.equipmentList = response.data;
diff --git a/hb_server/apps/em/migrations/0006_auto_20210914_1335.py b/hb_server/apps/em/migrations/0006_auto_20210914_1335.py
new file mode 100644
index 0000000..ec193af
--- /dev/null
+++ b/hb_server/apps/em/migrations/0006_auto_20210914_1335.py
@@ -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='设备状态'),
+ ),
+ ]
diff --git a/hb_server/apps/em/models.py b/hb_server/apps/em/models.py
index eb6cc52..0b1e5a6 100644
--- a/hb_server/apps/em/models.py
+++ b/hb_server/apps/em/models.py
@@ -15,10 +15,20 @@ class Equipment(CommonBModel):
设备台账信息
"""
state_choices = (
- (1, '运转正常'),
- (0, '停用'),
- (2, '报废')
+ (0, '完好'),
+ (1, '限用'),
+ (2, '在修'),
+ (3, '禁用')
)
+ statedm_choices = (
+ (0, '合格'),
+ (1, '准用'),
+ (2, '限用'),
+ (3, '禁用'),
+ (4, '停用'),
+ (5, '封存')
+ )
+
type_choices = (
(1, '生产设备'),
(2, '检验工具')
@@ -44,7 +54,7 @@ class Equipment(CommonBModel):
factory = models.CharField('生产厂', max_length=50, null=True, blank=True)
production_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)
place = models.CharField('存放位置', max_length=50, null=True, blank=True)
count = models.IntegerField('数量', default=0)
@@ -56,6 +66,7 @@ class Equipment(CommonBModel):
standard = models.CharField('溯源标准或依据', max_length=200, blank=True, null=True)#监视,测量设备
cycle = models.IntegerField('校准或检定周期', default=0)#监视,测量设备
usetype = models.IntegerField('使用类别', choices=usetype_choices, default=1)#监视,测量设备
+ statedm = models.IntegerField('设备状态', choices=statedm_choices, default=0)#监视,测量设备
class Meta:
verbose_name = '设备信息'
diff --git a/hb_server/apps/em/views.py b/hb_server/apps/em/views.py
index 912c5ee..386ff7f 100644
--- a/hb_server/apps/em/views.py
+++ b/hb_server/apps/em/views.py
@@ -15,7 +15,7 @@ class EquipmentViewSet(CreateUpdateModelAMixin, OptimizationMixin, ModelViewSet)
'put': 'equipment_update', 'delete': 'equipment_delete'}
queryset = Equipment.objects.all()
serializer_class = EquipmentSerializer
- search_fields = ['number', 'name', 'place']
- filterset_fields = ['belong_dept', 'keeper']
+ search_fields = ['number', 'name','description']
+ filterset_fields = ['belong_dept', 'keeper', 'type']
ordering_fields = ['create_time']
ordering = ['-create_time']
From 461f3bd2ce176cf626fb722a3306ff72528d0e04 Mon Sep 17 00:00:00 2001
From: shilixia <2309368887@qq.com>
Date: Tue, 14 Sep 2021 16:52:27 +0800
Subject: [PATCH 2/2] jiaozhunjianding
---
hb_client/src/router/index.js | 12 ++++++++++++
hb_client/src/views/em/detection.vue | 12 ++++++++++++
hb_client/src/views/em/equipment.vue | 15 ++++++++++++++-
hb_client/src/views/sam/customer.vue | 13 ++++++++-----
hb_server/apps/em/models.py | 2 +-
5 files changed, 47 insertions(+), 7 deletions(-)
diff --git a/hb_client/src/router/index.js b/hb_client/src/router/index.js
index 2299d8e..8a4caec 100644
--- a/hb_client/src/router/index.js
+++ b/hb_client/src/router/index.js
@@ -141,6 +141,18 @@ export const asyncRoutes = [
name: 'detection ',
component: () => import('@/views/em/detection'),
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'] }
}
]
},
diff --git a/hb_client/src/views/em/detection.vue b/hb_client/src/views/em/detection.vue
index 5b7f1d9..d4cb95b 100644
--- a/hb_client/src/views/em/detection.vue
+++ b/hb_client/src/views/em/detection.vue
@@ -70,6 +70,10 @@
{{ usetype_[scope.row.way] }}
+
+ {{ state_[scope.row.statedm] }}
+
+ state_
{{ scope.row.keeper_.username }}
@@ -329,6 +333,14 @@ export default {
value: 2,
label: '公用'
}],
+ state_:{
+ 0:'合格',
+ 1:'准用',
+ 2:'限用',
+ 3:'禁用',
+ 4:'停用',
+ 5:'封存',
+ },
options: [{
value: 0,
label: '合格'
diff --git a/hb_client/src/views/em/equipment.vue b/hb_client/src/views/em/equipment.vue
index a7df237..18a95b5 100644
--- a/hb_client/src/views/em/equipment.vue
+++ b/hb_client/src/views/em/equipment.vue
@@ -64,7 +64,20 @@
{{ scope.row.count }}
- {{ state_[scope.row.state] }}
+
+
+ {{ state_[scope.row.state] }}
+
+
+ {{ state_[scope.row.state] }}
+
+
+ {{ state_[scope.row.state] }}
+
+
+ {{ state_[scope.row.state] }}
+
+
{{ scope.row.parameter }}
diff --git a/hb_client/src/views/sam/customer.vue b/hb_client/src/views/sam/customer.vue
index bb6bea7..66fa455 100644
--- a/hb_client/src/views/sam/customer.vue
+++ b/hb_client/src/views/sam/customer.vue
@@ -33,7 +33,7 @@
{
if (response.data) {
- this.warehouseList = response.data;
+ this.customerList = response.data;
}
this.listLoading = false;
});
diff --git a/hb_server/apps/em/models.py b/hb_server/apps/em/models.py
index 0b1e5a6..961e429 100644
--- a/hb_server/apps/em/models.py
+++ b/hb_server/apps/em/models.py
@@ -74,4 +74,4 @@ class Equipment(CommonBModel):
def __str__(self):
return self.number + '-' + self.name
-
\ No newline at end of file
+