From 36478034fdd392afa091947083224d3ebeaf34f6 Mon Sep 17 00:00:00 2001
From: shilixia <2309368887@qq.com>
Date: Wed, 15 Sep 2021 13:39:15 +0800
Subject: [PATCH 1/7] shebeihetong
---
hb_client/.env.development | 4 +-
hb_client/src/api/equipment.js | 34 ++
hb_client/src/router/index.js | 28 +-
hb_client/src/views/em/detection.vue | 2 +-
hb_client/src/views/em/record.vue | 336 ++++++++++++++++++
hb_client/src/views/sam/contract.vue | 63 +++-
.../em/migrations/0007_equipmentrecord.py | 37 ++
hb_server/apps/em/models.py | 5 +
hb_server/apps/em/serializers.py | 18 +-
hb_server/apps/em/urls.py | 3 +-
hb_server/apps/em/views.py | 43 ++-
hb_server/apps/mtm/serializers.py | 2 +-
hb_server/apps/sam/serializers.py | 3 +-
13 files changed, 548 insertions(+), 30 deletions(-)
create mode 100644 hb_client/src/views/em/record.vue
create mode 100644 hb_server/apps/em/migrations/0007_equipmentrecord.py
diff --git a/hb_client/.env.development b/hb_client/.env.development
index 003a43c..ef83e12 100644
--- a/hb_client/.env.development
+++ b/hb_client/.env.development
@@ -2,8 +2,8 @@
ENV = 'development'
# base api
-#VUE_APP_BASE_API = 'http://127.0.0.1:8000/api'
-VUE_APP_BASE_API = 'http://47.95.0.242:2222/api'
+VUE_APP_BASE_API = 'http://127.0.0.1:8000/api'
+#VUE_APP_BASE_API = 'http://47.95.0.242:2222/api'
# vue-cli uses the VUE_CLI_BABEL_TRANSPILE_MODULES environment variable,
diff --git a/hb_client/src/api/equipment.js b/hb_client/src/api/equipment.js
index 0256eb9..2eadc6b 100644
--- a/hb_client/src/api/equipment.js
+++ b/hb_client/src/api/equipment.js
@@ -34,3 +34,37 @@ export function deleteEquipment(id, data) {
data
})
}
+export function getEquipmentrecordList(query) {
+ return request({
+ url: '/em/equipmentrecord/',
+ method: 'get',
+ params: query
+ })
+}
+export function getEquipmentrecordAll() {
+ return request({
+ url: '/em/equipmentrecord/',
+ method: 'get'
+ })
+}
+export function createEquipmentrecord(data) {
+ return request({
+ url: '/em/equipmentrecord/',
+ method: 'post',
+ data
+ })
+}
+export function updateEquipmentrecord(id, data) {
+ return request({
+ url: `/em/equipmentrecord/${id}/`,
+ method: 'put',
+ data
+ })
+}
+export function deleteEquipmentrecord(id, data) {
+ return request({
+ url: `/em/equipmentrecord/${id}/`,
+ method: 'delete',
+ data
+ })
+}
\ No newline at end of file
diff --git a/hb_client/src/router/index.js b/hb_client/src/router/index.js
index 8a4caec..45838b2 100644
--- a/hb_client/src/router/index.js
+++ b/hb_client/src/router/index.js
@@ -143,9 +143,9 @@ export const asyncRoutes = [
meta: { title: '监视和测量设备', icon: 'example', perms: ['index_manage'] }
},
{
- path: 'equipment',
- name: 'equipment',
- component: () => import('@/views/em/equipment'),
+ path: 'record',
+ name: 'record',
+ component: () => import('@/views/em/record'),
meta: { title: '校准检定记录', icon: 'example', perms: ['index_manage'] }
},
{
@@ -176,6 +176,28 @@ export const asyncRoutes = [
meta: { title: '合同信息', icon: 'example', perms: ['index_manage'] }
}
]
+ }
+ ,
+ {
+ path: '/sam',
+ component: Layout,
+ redirect: '/sam/customer',
+ name: 'sam',
+ meta: { title: '质量管理', icon: 'example', perms: ['equipment_set'] },
+ children: [
+ {
+ path: 'customer',
+ name: 'customer',
+ component: () => import('@/views/sam/customer'),
+ meta: { title: '标准', icon: 'example', perms: ['index_manage'] }
+ },
+ {
+ path: 'contract',
+ name: 'contract',
+ component: () => import('@/views/sam/contract'),
+ meta: { title: '检测项目', icon: 'example', perms: ['index_manage'] }
+ }
+ ]
},
{
path: '/inm',
diff --git a/hb_client/src/views/em/detection.vue b/hb_client/src/views/em/detection.vue
index d4cb95b..e46d5f6 100644
--- a/hb_client/src/views/em/detection.vue
+++ b/hb_client/src/views/em/detection.vue
@@ -73,7 +73,7 @@
{{ state_[scope.row.statedm] }}
- state_
+
{{ scope.row.keeper_.username }}
diff --git a/hb_client/src/views/em/record.vue b/hb_client/src/views/em/record.vue
new file mode 100644
index 0000000..a862578
--- /dev/null
+++ b/hb_client/src/views/em/record.vue
@@ -0,0 +1,336 @@
+
+
+
+
+
+ 搜索
+ 重置
+
+
+ 新增校准或检定
+
+
+
+
+
+
+
+ {{ scope.row.equipment_.name }}
+
+
+ {{ scope.row.equipment_.number }}
+
+
+ {{ scope.row.equipment_.model }}
+
+
+ {{ state_[scope.row.equipment_.statedm] }}
+
+
+ {{ scope.row.recentlydate }}
+
+
+ {{ scope.row.nextdate }}
+
+
+ {{ scope.row.description }}
+
+
+
+
+
+ 编辑
+ 删除
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 取消
+ 确认
+
+
+
+
+
diff --git a/hb_client/src/views/sam/contract.vue b/hb_client/src/views/sam/contract.vue
index 0ceeb5d..a268f51 100644
--- a/hb_client/src/views/sam/contract.vue
+++ b/hb_client/src/views/sam/contract.vue
@@ -33,7 +33,7 @@
-
+
{{ scope.row.name }}
-
- {{ scope.row.address }}
+
+ {{ scope.row.number }}
-
- {{ scope.row.contact }}
+
+ {{ scope.row.amount }}
-
- {{ scope.row.contact_phone }}
+
+ {{ scope.row.customer_.name }}
+
+
+ {{ scope.row.sign_date }}
{{ scope.row.description }}
@@ -82,8 +85,8 @@
-
+
+
+
+
+
+
+
+
@@ -126,7 +146,7 @@
diff --git a/hb_client/src/views/qm/testitem.vue b/hb_client/src/views/qm/testitem.vue
new file mode 100644
index 0000000..1c92b00
--- /dev/null
+++ b/hb_client/src/views/qm/testitem.vue
@@ -0,0 +1,258 @@
+
+
+
+
+
+ 搜索
+ 重置
+
+
+ 新增项目
+
+
+
+
+
+
+ {{ scope.row.name }}
+
+
+
+ {{ scope.row.term_number }}
+
+
+ {{ scope.row.standard_.name }}
+
+
+ {{ scope.row.standard_.number }}
+
+
+
+ {{ scope.row.create_time }}
+
+
+
+
+ 编辑
+ 删除
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 取消
+ 确认
+
+
+
+
+
From c9f448616b2ea7d362bd3a06cd93b5c460d8d968 Mon Sep 17 00:00:00 2001
From: shilixia <2309368887@qq.com>
Date: Thu, 16 Sep 2021 15:36:13 +0800
Subject: [PATCH 5/7] dingdan
---
hb_client/src/api/sam.js | 30 ++
hb_client/src/router/index.js | 7 +
hb_client/src/views/sam/order.vue | 317 ++++++++++++++++++
.../em/migrations/0008_auto_20210916_1054.py | 32 ++
.../em/migrations/0009_auto_20210916_1108.py | 31 ++
hb_server/apps/em/views.py | 2 +-
.../0002_alter_analysisitem_rules.py | 18 +
hb_server/apps/sam/serializers.py | 3 +
hb_server/apps/sam/urls.py | 3 +-
9 files changed, 441 insertions(+), 2 deletions(-)
create mode 100644 hb_client/src/views/sam/order.vue
create mode 100644 hb_server/apps/em/migrations/0008_auto_20210916_1054.py
create mode 100644 hb_server/apps/em/migrations/0009_auto_20210916_1108.py
create mode 100644 hb_server/apps/qm/migrations/0002_alter_analysisitem_rules.py
diff --git a/hb_client/src/api/sam.js b/hb_client/src/api/sam.js
index 67998a3..451942a 100644
--- a/hb_client/src/api/sam.js
+++ b/hb_client/src/api/sam.js
@@ -57,3 +57,33 @@ export function deleteContract(id, data) {
data
})
}
+//订单
+//合同
+export function getOrderList(query) {
+ return request({
+ url: '/sam/order/',
+ method: 'get',
+ params: query
+ })
+}
+export function createOrder(data) {
+ return request({
+ url: '/sam/order/',
+ method: 'post',
+ data
+ })
+}
+export function updateOrder(id, data) {
+ return request({
+ url: `/sam/order/${id}/`,
+ method: 'put',
+ data
+ })
+}
+export function deleteOrder(id, data) {
+ return request({
+ url: `/sam/order/${id}/`,
+ method: 'delete',
+ data
+ })
+}
diff --git a/hb_client/src/router/index.js b/hb_client/src/router/index.js
index d2325df..6ab730e 100644
--- a/hb_client/src/router/index.js
+++ b/hb_client/src/router/index.js
@@ -175,6 +175,13 @@ export const asyncRoutes = [
component: () => import('@/views/sam/contract'),
meta: { title: '合同信息', icon: 'example', perms: ['index_manage'] }
}
+ ,
+ {
+ path: 'order',
+ name: 'order',
+ component: () => import('@/views/sam/order'),
+ meta: { title: '订单信息', icon: 'example', perms: ['index_manage'] }
+ }
]
}
,
diff --git a/hb_client/src/views/sam/order.vue b/hb_client/src/views/sam/order.vue
new file mode 100644
index 0000000..a316672
--- /dev/null
+++ b/hb_client/src/views/sam/order.vue
@@ -0,0 +1,317 @@
+
+
+
+
+
+ 搜索
+ 重置
+
+
+ 新增订单
+
+
+
+
+
+
+
+ {{ scope.row.number }}
+
+
+ {{ scope.row.customer_.name }}
+
+
+ {{ scope.row.contract_.name }}
+
+
+ {{ scope.row.product_.name }}
+
+
+ {{ scope.row.count }}
+
+
+ {{ scope.row.delivery_date }}
+
+
+ {{ scope.row.create_time }}
+
+
+
+
+ 编辑
+ 删除
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 取消
+ 确认
+
+
+
+
+
diff --git a/hb_server/apps/em/migrations/0008_auto_20210916_1054.py b/hb_server/apps/em/migrations/0008_auto_20210916_1054.py
new file mode 100644
index 0000000..902de86
--- /dev/null
+++ b/hb_server/apps/em/migrations/0008_auto_20210916_1054.py
@@ -0,0 +1,32 @@
+# Generated by Django 3.2.6 on 2021-09-16 02:54
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ('em', '0007_equipmentrecord'),
+ ]
+
+ operations = [
+ migrations.RemoveField(
+ model_name='equipmentrecord',
+ name='nextdate',
+ ),
+ migrations.AddField(
+ model_name='equipment',
+ name='nextdate',
+ field=models.DateField(blank=True, null=True, verbose_name='下次应校准或检定日期'),
+ ),
+ migrations.AddField(
+ model_name='equipment',
+ name='recentlydate',
+ field=models.DateField(blank=True, null=True, verbose_name='最近一次校准/检定日期'),
+ ),
+ migrations.AlterField(
+ model_name='equipmentrecord',
+ name='recentlydate',
+ field=models.DateField(blank=True, null=True, verbose_name='校准/检定日期'),
+ ),
+ ]
diff --git a/hb_server/apps/em/migrations/0009_auto_20210916_1108.py b/hb_server/apps/em/migrations/0009_auto_20210916_1108.py
new file mode 100644
index 0000000..c451677
--- /dev/null
+++ b/hb_server/apps/em/migrations/0009_auto_20210916_1108.py
@@ -0,0 +1,31 @@
+# Generated by Django 3.2.6 on 2021-09-16 03:08
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ('em', '0008_auto_20210916_1054'),
+ ]
+
+ operations = [
+ migrations.RemoveField(
+ model_name='equipment',
+ name='nextdate',
+ ),
+ migrations.RemoveField(
+ model_name='equipment',
+ name='recentlydate',
+ ),
+ migrations.AddField(
+ model_name='equipmentrecord',
+ name='nextdate',
+ field=models.DateField(blank=True, null=True, verbose_name='下次应校准或检定日期'),
+ ),
+ migrations.AlterField(
+ model_name='equipmentrecord',
+ name='recentlydate',
+ field=models.DateField(blank=True, null=True, verbose_name='最近一次校准/检定日期'),
+ ),
+ ]
diff --git a/hb_server/apps/em/views.py b/hb_server/apps/em/views.py
index 387dcca..64ad57d 100644
--- a/hb_server/apps/em/views.py
+++ b/hb_server/apps/em/views.py
@@ -26,7 +26,7 @@ class EquipmentViewSet(CreateUpdateModelAMixin, OptimizationMixin, ModelViewSet)
# Create your views here.
class EquipmentrecordViewSet(CreateUpdateModelAMixin, OptimizationMixin, ModelViewSet):
"""
- 设备台账-增删改查
+ 设备校准-增删改查
"""
perms_map = {'get': '*', 'post': 'equipmentrecord_create',
'put': 'equipmentrecord_update', 'delete': 'equipmentrecord_delete'}
diff --git a/hb_server/apps/qm/migrations/0002_alter_analysisitem_rules.py b/hb_server/apps/qm/migrations/0002_alter_analysisitem_rules.py
new file mode 100644
index 0000000..d0899af
--- /dev/null
+++ b/hb_server/apps/qm/migrations/0002_alter_analysisitem_rules.py
@@ -0,0 +1,18 @@
+# Generated by Django 3.2.6 on 2021-09-16 02:54
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ('qm', '0001_initial'),
+ ]
+
+ operations = [
+ migrations.AlterField(
+ model_name='analysisitem',
+ name='rules',
+ field=models.JSONField(default=list, verbose_name='判定规则'),
+ ),
+ ]
diff --git a/hb_server/apps/sam/serializers.py b/hb_server/apps/sam/serializers.py
index 0d24387..00efa54 100644
--- a/hb_server/apps/sam/serializers.py
+++ b/hb_server/apps/sam/serializers.py
@@ -2,6 +2,8 @@ from rest_framework import serializers
from .models import Contract, Customer, Order
+from apps.mtm.serializers import MaterialSimpleSerializer
+
class CustomerSerializer(serializers.ModelSerializer):
class Meta:
model = Customer
@@ -42,6 +44,7 @@ class OrderCreateUpdateSerializer(serializers.ModelSerializer):
class OrderSerializer(serializers.ModelSerializer):
contract_ = ContractSimpleSerializer(source='contract', read_only=True)
customer_ = CustomerSimpleSerializer(source='customer', read_only=True)
+ product_ = MaterialSimpleSerializer(source='product', read_only=True)
class Meta:
model = Order
fields = '__all__'
diff --git a/hb_server/apps/sam/urls.py b/hb_server/apps/sam/urls.py
index fda60b5..4aa607f 100644
--- a/hb_server/apps/sam/urls.py
+++ b/hb_server/apps/sam/urls.py
@@ -1,12 +1,13 @@
from django.db.models import base
from rest_framework import urlpatterns
-from apps.sam.views import CustomerViewSet,ContractViewSet
+from apps.sam.views import CustomerViewSet,ContractViewSet,OrderViewSet
from django.urls import path, include
from rest_framework.routers import DefaultRouter
router = DefaultRouter()
router.register('customer', CustomerViewSet, basename='customer')
router.register('contract', ContractViewSet, basename='contract')
+router.register('order', OrderViewSet, basename='order')
urlpatterns = [
path('', include(router.urls)),
From 64c4a4884ede2f7ed2e457db713159323fd5db17 Mon Sep 17 00:00:00 2001
From: shilixia <2309368887@qq.com>
Date: Thu, 16 Sep 2021 16:32:05 +0800
Subject: [PATCH 6/7] wuliao
---
hb_server/apps/mtm/models.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/hb_server/apps/mtm/models.py b/hb_server/apps/mtm/models.py
index e3f77ed..20eae86 100644
--- a/hb_server/apps/mtm/models.py
+++ b/hb_server/apps/mtm/models.py
@@ -29,7 +29,7 @@ class Material(CommonAModel):
specification = models.CharField('型号', max_length=100, null=True, blank=True)
type = models.CharField('物料类型', choices= type_choices, max_length=20, default=1)
sort_str = models.CharField('排序字符', max_length=100, null=True, blank=True)
- processes = models.JSONField('工艺流程', default=list, blank=True)
+ processes = models.JSONField('工艺流程', default=list, null=True,blank=True)
unit = models.CharField('基准计量单位', choices=unit_choices, default='块', max_length=10)
class Meta:
From 92823553cbc325a9029cfeafea35a071752bd675 Mon Sep 17 00:00:00 2001
From: shilixia <2309368887@qq.com>
Date: Fri, 17 Sep 2021 09:06:50 +0800
Subject: [PATCH 7/7] wuliao
---
hb_client/src/views/mtm/material.vue | 1 +
.../0014_alter_material_processes.py | 18 ++++++++++++++
.../migrations/0015_alter_material_name.py | 18 ++++++++++++++
.../mtm/migrations/0016_auto_20210917_0900.py | 24 +++++++++++++++++++
hb_server/apps/mtm/models.py | 2 +-
5 files changed, 62 insertions(+), 1 deletion(-)
create mode 100644 hb_server/apps/mtm/migrations/0014_alter_material_processes.py
create mode 100644 hb_server/apps/mtm/migrations/0015_alter_material_name.py
create mode 100644 hb_server/apps/mtm/migrations/0016_auto_20210917_0900.py
diff --git a/hb_client/src/views/mtm/material.vue b/hb_client/src/views/mtm/material.vue
index 921507d..f56d69b 100644
--- a/hb_client/src/views/mtm/material.vue
+++ b/hb_client/src/views/mtm/material.vue
@@ -170,6 +170,7 @@ import Pagination from "@/components/Pagination"; // secondary package based on
const defaultmaterial = {
name: "",
number: "",
+ processes:[],
};
export default {
components: { Pagination },
diff --git a/hb_server/apps/mtm/migrations/0014_alter_material_processes.py b/hb_server/apps/mtm/migrations/0014_alter_material_processes.py
new file mode 100644
index 0000000..3d10764
--- /dev/null
+++ b/hb_server/apps/mtm/migrations/0014_alter_material_processes.py
@@ -0,0 +1,18 @@
+# Generated by Django 3.2.6 on 2021-09-16 08:42
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ('mtm', '0013_auto_20210914_1049'),
+ ]
+
+ operations = [
+ migrations.AlterField(
+ model_name='material',
+ name='processes',
+ field=models.JSONField(blank=True, default=list, null=True, verbose_name='工艺流程'),
+ ),
+ ]
diff --git a/hb_server/apps/mtm/migrations/0015_alter_material_name.py b/hb_server/apps/mtm/migrations/0015_alter_material_name.py
new file mode 100644
index 0000000..64cddd6
--- /dev/null
+++ b/hb_server/apps/mtm/migrations/0015_alter_material_name.py
@@ -0,0 +1,18 @@
+# Generated by Django 3.2.6 on 2021-09-17 00:57
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ('mtm', '0014_alter_material_processes'),
+ ]
+
+ operations = [
+ migrations.AlterField(
+ model_name='material',
+ name='name',
+ field=models.CharField(blank=True, max_length=100, null=True, unique=True, verbose_name='物料名称'),
+ ),
+ ]
diff --git a/hb_server/apps/mtm/migrations/0016_auto_20210917_0900.py b/hb_server/apps/mtm/migrations/0016_auto_20210917_0900.py
new file mode 100644
index 0000000..a4555f9
--- /dev/null
+++ b/hb_server/apps/mtm/migrations/0016_auto_20210917_0900.py
@@ -0,0 +1,24 @@
+# Generated by Django 3.2.6 on 2021-09-17 01:00
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ('mtm', '0015_alter_material_name'),
+ ]
+
+ operations = [
+ migrations.AlterField(
+ model_name='material',
+ name='name',
+ field=models.CharField(default=1, max_length=100, unique=True, verbose_name='物料名称'),
+ preserve_default=False,
+ ),
+ migrations.AlterField(
+ model_name='material',
+ name='processes',
+ field=models.JSONField(blank=True, default=list, verbose_name='工艺流程'),
+ ),
+ ]
diff --git a/hb_server/apps/mtm/models.py b/hb_server/apps/mtm/models.py
index 20eae86..e3f77ed 100644
--- a/hb_server/apps/mtm/models.py
+++ b/hb_server/apps/mtm/models.py
@@ -29,7 +29,7 @@ class Material(CommonAModel):
specification = models.CharField('型号', max_length=100, null=True, blank=True)
type = models.CharField('物料类型', choices= type_choices, max_length=20, default=1)
sort_str = models.CharField('排序字符', max_length=100, null=True, blank=True)
- processes = models.JSONField('工艺流程', default=list, null=True,blank=True)
+ processes = models.JSONField('工艺流程', default=list, blank=True)
unit = models.CharField('基准计量单位', choices=unit_choices, default='块', max_length=10)
class Meta: