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] 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 @@