diff --git a/.env.development b/.env.development
index f2fee42..19ebebf 100644
--- a/.env.development
+++ b/.env.development
@@ -4,7 +4,7 @@
# 接口请求地址,会设置到 axios 的 baseURL 参数上
# VITE_APP_API_BASEURL = http://139.198.29.133:8089
# VITE_APP_API_BASEURL = http://111.198.10.15:21611
-VITE_APP_API_BASEURL = http://192.168.8.101:5909
+VITE_APP_API_BASEURL = http://192.168.8.100:5909
# VITE_APP_API_BASEURL = http://111.198.10.15:21611
# VITE_APP_API_BASEURL = http://192.168.8.107:5909
# VITE_APP_API_BASEURL = http://111.198.10.15:21710
diff --git a/.env.development b/.env.development
index f2fee42..19ebebf 100644
--- a/.env.development
+++ b/.env.development
@@ -4,7 +4,7 @@
# 接口请求地址,会设置到 axios 的 baseURL 参数上
# VITE_APP_API_BASEURL = http://139.198.29.133:8089
# VITE_APP_API_BASEURL = http://111.198.10.15:21611
-VITE_APP_API_BASEURL = http://192.168.8.101:5909
+VITE_APP_API_BASEURL = http://192.168.8.100:5909
# VITE_APP_API_BASEURL = http://111.198.10.15:21611
# VITE_APP_API_BASEURL = http://192.168.8.107:5909
# VITE_APP_API_BASEURL = http://111.198.10.15:21710
diff --git a/.env.production b/.env.production
index 7595683..36e6ad3 100644
--- a/.env.production
+++ b/.env.production
@@ -4,7 +4,7 @@
VITE_APP_TITLE = 计量信息系统
VITE_SYS_TITLE = 受检设备管理系统
# 接口请求地址,会设置到 axios 的 baseURL 参数上
-VITE_APP_API_BASEURL = http://127.0.0.1:5909
+VITE_APP_API_BASEURL = http://111.198.10.15:21611
# 调试工具,可设置 eruda 或 vconsole,如果不需要开启则留空
VITE_APP_DEBUG_TOOL =
diff --git a/.env.development b/.env.development
index f2fee42..19ebebf 100644
--- a/.env.development
+++ b/.env.development
@@ -4,7 +4,7 @@
# 接口请求地址,会设置到 axios 的 baseURL 参数上
# VITE_APP_API_BASEURL = http://139.198.29.133:8089
# VITE_APP_API_BASEURL = http://111.198.10.15:21611
-VITE_APP_API_BASEURL = http://192.168.8.101:5909
+VITE_APP_API_BASEURL = http://192.168.8.100:5909
# VITE_APP_API_BASEURL = http://111.198.10.15:21611
# VITE_APP_API_BASEURL = http://192.168.8.107:5909
# VITE_APP_API_BASEURL = http://111.198.10.15:21710
diff --git a/.env.production b/.env.production
index 7595683..36e6ad3 100644
--- a/.env.production
+++ b/.env.production
@@ -4,7 +4,7 @@
VITE_APP_TITLE = 计量信息系统
VITE_SYS_TITLE = 受检设备管理系统
# 接口请求地址,会设置到 axios 的 baseURL 参数上
-VITE_APP_API_BASEURL = http://127.0.0.1:5909
+VITE_APP_API_BASEURL = http://111.198.10.15:21611
# 调试工具,可设置 eruda 或 vconsole,如果不需要开启则留空
VITE_APP_DEBUG_TOOL =
diff --git a/public/config/config.json b/public/config/config.json
index 3bd0a89..169f1f6 100644
--- a/public/config/config.json
+++ b/public/config/config.json
@@ -1,4 +1,8 @@
{
"title":"计量业务系统",
+<<<<<<< HEAD
"baseUrl": "http://111.198.10.15:21611"
+=======
+ "baseUrl": "http://192.168.8.100:5909"
+>>>>>>> 5e67c355ee24dc34e26bb2fdbb5214aa66e8f137
}
diff --git a/.env.development b/.env.development
index f2fee42..19ebebf 100644
--- a/.env.development
+++ b/.env.development
@@ -4,7 +4,7 @@
# 接口请求地址,会设置到 axios 的 baseURL 参数上
# VITE_APP_API_BASEURL = http://139.198.29.133:8089
# VITE_APP_API_BASEURL = http://111.198.10.15:21611
-VITE_APP_API_BASEURL = http://192.168.8.101:5909
+VITE_APP_API_BASEURL = http://192.168.8.100:5909
# VITE_APP_API_BASEURL = http://111.198.10.15:21611
# VITE_APP_API_BASEURL = http://192.168.8.107:5909
# VITE_APP_API_BASEURL = http://111.198.10.15:21710
diff --git a/.env.production b/.env.production
index 7595683..36e6ad3 100644
--- a/.env.production
+++ b/.env.production
@@ -4,7 +4,7 @@
VITE_APP_TITLE = 计量信息系统
VITE_SYS_TITLE = 受检设备管理系统
# 接口请求地址,会设置到 axios 的 baseURL 参数上
-VITE_APP_API_BASEURL = http://127.0.0.1:5909
+VITE_APP_API_BASEURL = http://111.198.10.15:21611
# 调试工具,可设置 eruda 或 vconsole,如果不需要开启则留空
VITE_APP_DEBUG_TOOL =
diff --git a/public/config/config.json b/public/config/config.json
index 3bd0a89..169f1f6 100644
--- a/public/config/config.json
+++ b/public/config/config.json
@@ -1,4 +1,8 @@
{
"title":"计量业务系统",
+<<<<<<< HEAD
"baseUrl": "http://111.198.10.15:21611"
+=======
+ "baseUrl": "http://192.168.8.100:5909"
+>>>>>>> 5e67c355ee24dc34e26bb2fdbb5214aa66e8f137
}
diff --git a/src/api/eqpt/device/info.ts b/src/api/eqpt/device/info.ts
index f2a9176..e40366c 100644
--- a/src/api/eqpt/device/info.ts
+++ b/src/api/eqpt/device/info.ts
@@ -153,3 +153,11 @@
method: 'get',
})
}
+// 绑定参试任务
+export function bindTaskHandler(data: object) {
+ return request({
+ url: '/equipment/bindTask',
+ method: 'post',
+ data,
+ })
+}
diff --git a/.env.development b/.env.development
index f2fee42..19ebebf 100644
--- a/.env.development
+++ b/.env.development
@@ -4,7 +4,7 @@
# 接口请求地址,会设置到 axios 的 baseURL 参数上
# VITE_APP_API_BASEURL = http://139.198.29.133:8089
# VITE_APP_API_BASEURL = http://111.198.10.15:21611
-VITE_APP_API_BASEURL = http://192.168.8.101:5909
+VITE_APP_API_BASEURL = http://192.168.8.100:5909
# VITE_APP_API_BASEURL = http://111.198.10.15:21611
# VITE_APP_API_BASEURL = http://192.168.8.107:5909
# VITE_APP_API_BASEURL = http://111.198.10.15:21710
diff --git a/.env.production b/.env.production
index 7595683..36e6ad3 100644
--- a/.env.production
+++ b/.env.production
@@ -4,7 +4,7 @@
VITE_APP_TITLE = 计量信息系统
VITE_SYS_TITLE = 受检设备管理系统
# 接口请求地址,会设置到 axios 的 baseURL 参数上
-VITE_APP_API_BASEURL = http://127.0.0.1:5909
+VITE_APP_API_BASEURL = http://111.198.10.15:21611
# 调试工具,可设置 eruda 或 vconsole,如果不需要开启则留空
VITE_APP_DEBUG_TOOL =
diff --git a/public/config/config.json b/public/config/config.json
index 3bd0a89..169f1f6 100644
--- a/public/config/config.json
+++ b/public/config/config.json
@@ -1,4 +1,8 @@
{
"title":"计量业务系统",
+<<<<<<< HEAD
"baseUrl": "http://111.198.10.15:21611"
+=======
+ "baseUrl": "http://192.168.8.100:5909"
+>>>>>>> 5e67c355ee24dc34e26bb2fdbb5214aa66e8f137
}
diff --git a/src/api/eqpt/device/info.ts b/src/api/eqpt/device/info.ts
index f2a9176..e40366c 100644
--- a/src/api/eqpt/device/info.ts
+++ b/src/api/eqpt/device/info.ts
@@ -153,3 +153,11 @@
method: 'get',
})
}
+// 绑定参试任务
+export function bindTaskHandler(data: object) {
+ return request({
+ url: '/equipment/bindTask',
+ method: 'post',
+ data,
+ })
+}
diff --git a/src/api/eqpt/device/model.ts b/src/api/eqpt/device/model.ts
index a8fa0f1..04da2af 100644
--- a/src/api/eqpt/device/model.ts
+++ b/src/api/eqpt/device/model.ts
@@ -20,11 +20,10 @@
})
}
// 设备名称列表/equipment/model/listEquipmentName
-export function getDeviceNameList(params: any) {
+export function getDeviceNameList() {
return request({
url: '/equipment/model/listEquipmentName',
method: 'get',
- params,
})
}
// 导出
@@ -33,6 +32,7 @@
url: '/equipment/model/export',
method: 'post',
data,
+ responseType: 'blob',
})
}
// 新建或编辑
diff --git a/.env.development b/.env.development
index f2fee42..19ebebf 100644
--- a/.env.development
+++ b/.env.development
@@ -4,7 +4,7 @@
# 接口请求地址,会设置到 axios 的 baseURL 参数上
# VITE_APP_API_BASEURL = http://139.198.29.133:8089
# VITE_APP_API_BASEURL = http://111.198.10.15:21611
-VITE_APP_API_BASEURL = http://192.168.8.101:5909
+VITE_APP_API_BASEURL = http://192.168.8.100:5909
# VITE_APP_API_BASEURL = http://111.198.10.15:21611
# VITE_APP_API_BASEURL = http://192.168.8.107:5909
# VITE_APP_API_BASEURL = http://111.198.10.15:21710
diff --git a/.env.production b/.env.production
index 7595683..36e6ad3 100644
--- a/.env.production
+++ b/.env.production
@@ -4,7 +4,7 @@
VITE_APP_TITLE = 计量信息系统
VITE_SYS_TITLE = 受检设备管理系统
# 接口请求地址,会设置到 axios 的 baseURL 参数上
-VITE_APP_API_BASEURL = http://127.0.0.1:5909
+VITE_APP_API_BASEURL = http://111.198.10.15:21611
# 调试工具,可设置 eruda 或 vconsole,如果不需要开启则留空
VITE_APP_DEBUG_TOOL =
diff --git a/public/config/config.json b/public/config/config.json
index 3bd0a89..169f1f6 100644
--- a/public/config/config.json
+++ b/public/config/config.json
@@ -1,4 +1,8 @@
{
"title":"计量业务系统",
+<<<<<<< HEAD
"baseUrl": "http://111.198.10.15:21611"
+=======
+ "baseUrl": "http://192.168.8.100:5909"
+>>>>>>> 5e67c355ee24dc34e26bb2fdbb5214aa66e8f137
}
diff --git a/src/api/eqpt/device/info.ts b/src/api/eqpt/device/info.ts
index f2a9176..e40366c 100644
--- a/src/api/eqpt/device/info.ts
+++ b/src/api/eqpt/device/info.ts
@@ -153,3 +153,11 @@
method: 'get',
})
}
+// 绑定参试任务
+export function bindTaskHandler(data: object) {
+ return request({
+ url: '/equipment/bindTask',
+ method: 'post',
+ data,
+ })
+}
diff --git a/src/api/eqpt/device/model.ts b/src/api/eqpt/device/model.ts
index a8fa0f1..04da2af 100644
--- a/src/api/eqpt/device/model.ts
+++ b/src/api/eqpt/device/model.ts
@@ -20,11 +20,10 @@
})
}
// 设备名称列表/equipment/model/listEquipmentName
-export function getDeviceNameList(params: any) {
+export function getDeviceNameList() {
return request({
url: '/equipment/model/listEquipmentName',
method: 'get',
- params,
})
}
// 导出
@@ -33,6 +32,7 @@
url: '/equipment/model/export',
method: 'post',
data,
+ responseType: 'blob',
})
}
// 新建或编辑
diff --git a/src/api/eqpt/device/task.ts b/src/api/eqpt/device/task.ts
new file mode 100644
index 0000000..2a83db0
--- /dev/null
+++ b/src/api/eqpt/device/task.ts
@@ -0,0 +1,38 @@
+/**
+ * 参试任务管理相关
+ */
+import request from '@/api/index'
+
+// 列表
+export function getTaskList(params: any) {
+ return request({
+ url: `/equipment/task/listPage?limit=${params.limit}&offset=${params.offset}`,
+ method: 'post',
+ data: params,
+ })
+}
+// 新增
+export function addTask(params: any) {
+ return request({
+ url: '/equipment/task/add',
+ method: 'post',
+ data: params,
+ })
+}
+// 新增
+export function updateTask(params: any) {
+ return request({
+ url: '/equipment/task/update',
+ method: 'post',
+ data: params,
+ })
+}
+// 删除
+export function delTask(params: any) {
+ return request({
+ url: '/equipment/task/delete',
+ method: 'post',
+ data: params,
+ })
+}
+
diff --git a/.env.development b/.env.development
index f2fee42..19ebebf 100644
--- a/.env.development
+++ b/.env.development
@@ -4,7 +4,7 @@
# 接口请求地址,会设置到 axios 的 baseURL 参数上
# VITE_APP_API_BASEURL = http://139.198.29.133:8089
# VITE_APP_API_BASEURL = http://111.198.10.15:21611
-VITE_APP_API_BASEURL = http://192.168.8.101:5909
+VITE_APP_API_BASEURL = http://192.168.8.100:5909
# VITE_APP_API_BASEURL = http://111.198.10.15:21611
# VITE_APP_API_BASEURL = http://192.168.8.107:5909
# VITE_APP_API_BASEURL = http://111.198.10.15:21710
diff --git a/.env.production b/.env.production
index 7595683..36e6ad3 100644
--- a/.env.production
+++ b/.env.production
@@ -4,7 +4,7 @@
VITE_APP_TITLE = 计量信息系统
VITE_SYS_TITLE = 受检设备管理系统
# 接口请求地址,会设置到 axios 的 baseURL 参数上
-VITE_APP_API_BASEURL = http://127.0.0.1:5909
+VITE_APP_API_BASEURL = http://111.198.10.15:21611
# 调试工具,可设置 eruda 或 vconsole,如果不需要开启则留空
VITE_APP_DEBUG_TOOL =
diff --git a/public/config/config.json b/public/config/config.json
index 3bd0a89..169f1f6 100644
--- a/public/config/config.json
+++ b/public/config/config.json
@@ -1,4 +1,8 @@
{
"title":"计量业务系统",
+<<<<<<< HEAD
"baseUrl": "http://111.198.10.15:21611"
+=======
+ "baseUrl": "http://192.168.8.100:5909"
+>>>>>>> 5e67c355ee24dc34e26bb2fdbb5214aa66e8f137
}
diff --git a/src/api/eqpt/device/info.ts b/src/api/eqpt/device/info.ts
index f2a9176..e40366c 100644
--- a/src/api/eqpt/device/info.ts
+++ b/src/api/eqpt/device/info.ts
@@ -153,3 +153,11 @@
method: 'get',
})
}
+// 绑定参试任务
+export function bindTaskHandler(data: object) {
+ return request({
+ url: '/equipment/bindTask',
+ method: 'post',
+ data,
+ })
+}
diff --git a/src/api/eqpt/device/model.ts b/src/api/eqpt/device/model.ts
index a8fa0f1..04da2af 100644
--- a/src/api/eqpt/device/model.ts
+++ b/src/api/eqpt/device/model.ts
@@ -20,11 +20,10 @@
})
}
// 设备名称列表/equipment/model/listEquipmentName
-export function getDeviceNameList(params: any) {
+export function getDeviceNameList() {
return request({
url: '/equipment/model/listEquipmentName',
method: 'get',
- params,
})
}
// 导出
@@ -33,6 +32,7 @@
url: '/equipment/model/export',
method: 'post',
data,
+ responseType: 'blob',
})
}
// 新建或编辑
diff --git a/src/api/eqpt/device/task.ts b/src/api/eqpt/device/task.ts
new file mode 100644
index 0000000..2a83db0
--- /dev/null
+++ b/src/api/eqpt/device/task.ts
@@ -0,0 +1,38 @@
+/**
+ * 参试任务管理相关
+ */
+import request from '@/api/index'
+
+// 列表
+export function getTaskList(params: any) {
+ return request({
+ url: `/equipment/task/listPage?limit=${params.limit}&offset=${params.offset}`,
+ method: 'post',
+ data: params,
+ })
+}
+// 新增
+export function addTask(params: any) {
+ return request({
+ url: '/equipment/task/add',
+ method: 'post',
+ data: params,
+ })
+}
+// 新增
+export function updateTask(params: any) {
+ return request({
+ url: '/equipment/task/update',
+ method: 'post',
+ data: params,
+ })
+}
+// 删除
+export function delTask(params: any) {
+ return request({
+ url: '/equipment/task/delete',
+ method: 'post',
+ data: params,
+ })
+}
+
diff --git a/src/api/system/expire.ts b/src/api/system/expire.ts
index 1365711..834048e 100644
--- a/src/api/system/expire.ts
+++ b/src/api/system/expire.ts
@@ -18,3 +18,18 @@
data,
})
}
+// 新建
+export function addRemind(data: object) {
+ return request({
+ url: '/system/remind/add',
+ method: 'post',
+ data,
+ })
+}
+// 删除
+export function delRemind(id: string) {
+ return request({
+ url: `/system/remind/remove?id=${id}`,
+ method: 'post',
+ })
+}
diff --git a/.env.development b/.env.development
index f2fee42..19ebebf 100644
--- a/.env.development
+++ b/.env.development
@@ -4,7 +4,7 @@
# 接口请求地址,会设置到 axios 的 baseURL 参数上
# VITE_APP_API_BASEURL = http://139.198.29.133:8089
# VITE_APP_API_BASEURL = http://111.198.10.15:21611
-VITE_APP_API_BASEURL = http://192.168.8.101:5909
+VITE_APP_API_BASEURL = http://192.168.8.100:5909
# VITE_APP_API_BASEURL = http://111.198.10.15:21611
# VITE_APP_API_BASEURL = http://192.168.8.107:5909
# VITE_APP_API_BASEURL = http://111.198.10.15:21710
diff --git a/.env.production b/.env.production
index 7595683..36e6ad3 100644
--- a/.env.production
+++ b/.env.production
@@ -4,7 +4,7 @@
VITE_APP_TITLE = 计量信息系统
VITE_SYS_TITLE = 受检设备管理系统
# 接口请求地址,会设置到 axios 的 baseURL 参数上
-VITE_APP_API_BASEURL = http://127.0.0.1:5909
+VITE_APP_API_BASEURL = http://111.198.10.15:21611
# 调试工具,可设置 eruda 或 vconsole,如果不需要开启则留空
VITE_APP_DEBUG_TOOL =
diff --git a/public/config/config.json b/public/config/config.json
index 3bd0a89..169f1f6 100644
--- a/public/config/config.json
+++ b/public/config/config.json
@@ -1,4 +1,8 @@
{
"title":"计量业务系统",
+<<<<<<< HEAD
"baseUrl": "http://111.198.10.15:21611"
+=======
+ "baseUrl": "http://192.168.8.100:5909"
+>>>>>>> 5e67c355ee24dc34e26bb2fdbb5214aa66e8f137
}
diff --git a/src/api/eqpt/device/info.ts b/src/api/eqpt/device/info.ts
index f2a9176..e40366c 100644
--- a/src/api/eqpt/device/info.ts
+++ b/src/api/eqpt/device/info.ts
@@ -153,3 +153,11 @@
method: 'get',
})
}
+// 绑定参试任务
+export function bindTaskHandler(data: object) {
+ return request({
+ url: '/equipment/bindTask',
+ method: 'post',
+ data,
+ })
+}
diff --git a/src/api/eqpt/device/model.ts b/src/api/eqpt/device/model.ts
index a8fa0f1..04da2af 100644
--- a/src/api/eqpt/device/model.ts
+++ b/src/api/eqpt/device/model.ts
@@ -20,11 +20,10 @@
})
}
// 设备名称列表/equipment/model/listEquipmentName
-export function getDeviceNameList(params: any) {
+export function getDeviceNameList() {
return request({
url: '/equipment/model/listEquipmentName',
method: 'get',
- params,
})
}
// 导出
@@ -33,6 +32,7 @@
url: '/equipment/model/export',
method: 'post',
data,
+ responseType: 'blob',
})
}
// 新建或编辑
diff --git a/src/api/eqpt/device/task.ts b/src/api/eqpt/device/task.ts
new file mode 100644
index 0000000..2a83db0
--- /dev/null
+++ b/src/api/eqpt/device/task.ts
@@ -0,0 +1,38 @@
+/**
+ * 参试任务管理相关
+ */
+import request from '@/api/index'
+
+// 列表
+export function getTaskList(params: any) {
+ return request({
+ url: `/equipment/task/listPage?limit=${params.limit}&offset=${params.offset}`,
+ method: 'post',
+ data: params,
+ })
+}
+// 新增
+export function addTask(params: any) {
+ return request({
+ url: '/equipment/task/add',
+ method: 'post',
+ data: params,
+ })
+}
+// 新增
+export function updateTask(params: any) {
+ return request({
+ url: '/equipment/task/update',
+ method: 'post',
+ data: params,
+ })
+}
+// 删除
+export function delTask(params: any) {
+ return request({
+ url: '/equipment/task/delete',
+ method: 'post',
+ data: params,
+ })
+}
+
diff --git a/src/api/system/expire.ts b/src/api/system/expire.ts
index 1365711..834048e 100644
--- a/src/api/system/expire.ts
+++ b/src/api/system/expire.ts
@@ -18,3 +18,18 @@
data,
})
}
+// 新建
+export function addRemind(data: object) {
+ return request({
+ url: '/system/remind/add',
+ method: 'post',
+ data,
+ })
+}
+// 删除
+export function delRemind(id: string) {
+ return request({
+ url: `/system/remind/remove?id=${id}`,
+ method: 'post',
+ })
+}
diff --git a/src/assets/icons/icon-task.svg b/src/assets/icons/icon-task.svg
new file mode 100644
index 0000000..213c7cd
--- /dev/null
+++ b/src/assets/icons/icon-task.svg
@@ -0,0 +1 @@
+
diff --git a/.env.development b/.env.development
index f2fee42..19ebebf 100644
--- a/.env.development
+++ b/.env.development
@@ -4,7 +4,7 @@
# 接口请求地址,会设置到 axios 的 baseURL 参数上
# VITE_APP_API_BASEURL = http://139.198.29.133:8089
# VITE_APP_API_BASEURL = http://111.198.10.15:21611
-VITE_APP_API_BASEURL = http://192.168.8.101:5909
+VITE_APP_API_BASEURL = http://192.168.8.100:5909
# VITE_APP_API_BASEURL = http://111.198.10.15:21611
# VITE_APP_API_BASEURL = http://192.168.8.107:5909
# VITE_APP_API_BASEURL = http://111.198.10.15:21710
diff --git a/.env.production b/.env.production
index 7595683..36e6ad3 100644
--- a/.env.production
+++ b/.env.production
@@ -4,7 +4,7 @@
VITE_APP_TITLE = 计量信息系统
VITE_SYS_TITLE = 受检设备管理系统
# 接口请求地址,会设置到 axios 的 baseURL 参数上
-VITE_APP_API_BASEURL = http://127.0.0.1:5909
+VITE_APP_API_BASEURL = http://111.198.10.15:21611
# 调试工具,可设置 eruda 或 vconsole,如果不需要开启则留空
VITE_APP_DEBUG_TOOL =
diff --git a/public/config/config.json b/public/config/config.json
index 3bd0a89..169f1f6 100644
--- a/public/config/config.json
+++ b/public/config/config.json
@@ -1,4 +1,8 @@
{
"title":"计量业务系统",
+<<<<<<< HEAD
"baseUrl": "http://111.198.10.15:21611"
+=======
+ "baseUrl": "http://192.168.8.100:5909"
+>>>>>>> 5e67c355ee24dc34e26bb2fdbb5214aa66e8f137
}
diff --git a/src/api/eqpt/device/info.ts b/src/api/eqpt/device/info.ts
index f2a9176..e40366c 100644
--- a/src/api/eqpt/device/info.ts
+++ b/src/api/eqpt/device/info.ts
@@ -153,3 +153,11 @@
method: 'get',
})
}
+// 绑定参试任务
+export function bindTaskHandler(data: object) {
+ return request({
+ url: '/equipment/bindTask',
+ method: 'post',
+ data,
+ })
+}
diff --git a/src/api/eqpt/device/model.ts b/src/api/eqpt/device/model.ts
index a8fa0f1..04da2af 100644
--- a/src/api/eqpt/device/model.ts
+++ b/src/api/eqpt/device/model.ts
@@ -20,11 +20,10 @@
})
}
// 设备名称列表/equipment/model/listEquipmentName
-export function getDeviceNameList(params: any) {
+export function getDeviceNameList() {
return request({
url: '/equipment/model/listEquipmentName',
method: 'get',
- params,
})
}
// 导出
@@ -33,6 +32,7 @@
url: '/equipment/model/export',
method: 'post',
data,
+ responseType: 'blob',
})
}
// 新建或编辑
diff --git a/src/api/eqpt/device/task.ts b/src/api/eqpt/device/task.ts
new file mode 100644
index 0000000..2a83db0
--- /dev/null
+++ b/src/api/eqpt/device/task.ts
@@ -0,0 +1,38 @@
+/**
+ * 参试任务管理相关
+ */
+import request from '@/api/index'
+
+// 列表
+export function getTaskList(params: any) {
+ return request({
+ url: `/equipment/task/listPage?limit=${params.limit}&offset=${params.offset}`,
+ method: 'post',
+ data: params,
+ })
+}
+// 新增
+export function addTask(params: any) {
+ return request({
+ url: '/equipment/task/add',
+ method: 'post',
+ data: params,
+ })
+}
+// 新增
+export function updateTask(params: any) {
+ return request({
+ url: '/equipment/task/update',
+ method: 'post',
+ data: params,
+ })
+}
+// 删除
+export function delTask(params: any) {
+ return request({
+ url: '/equipment/task/delete',
+ method: 'post',
+ data: params,
+ })
+}
+
diff --git a/src/api/system/expire.ts b/src/api/system/expire.ts
index 1365711..834048e 100644
--- a/src/api/system/expire.ts
+++ b/src/api/system/expire.ts
@@ -18,3 +18,18 @@
data,
})
}
+// 新建
+export function addRemind(data: object) {
+ return request({
+ url: '/system/remind/add',
+ method: 'post',
+ data,
+ })
+}
+// 删除
+export function delRemind(id: string) {
+ return request({
+ url: `/system/remind/remove?id=${id}`,
+ method: 'post',
+ })
+}
diff --git a/src/assets/icons/icon-task.svg b/src/assets/icons/icon-task.svg
new file mode 100644
index 0000000..213c7cd
--- /dev/null
+++ b/src/assets/icons/icon-task.svg
@@ -0,0 +1 @@
+
diff --git a/src/views/dashboard.vue b/src/views/dashboard.vue
index df43894..c88bb78 100644
--- a/src/views/dashboard.vue
+++ b/src/views/dashboard.vue
@@ -40,7 +40,6 @@
const token = userStore.token
const params = `?token=${token}`
console.log(system.url + params)
-
window.open(system.url + params)
// window.open(`http://127.0.0.1:9526${params}`)
}
diff --git a/.env.development b/.env.development
index f2fee42..19ebebf 100644
--- a/.env.development
+++ b/.env.development
@@ -4,7 +4,7 @@
# 接口请求地址,会设置到 axios 的 baseURL 参数上
# VITE_APP_API_BASEURL = http://139.198.29.133:8089
# VITE_APP_API_BASEURL = http://111.198.10.15:21611
-VITE_APP_API_BASEURL = http://192.168.8.101:5909
+VITE_APP_API_BASEURL = http://192.168.8.100:5909
# VITE_APP_API_BASEURL = http://111.198.10.15:21611
# VITE_APP_API_BASEURL = http://192.168.8.107:5909
# VITE_APP_API_BASEURL = http://111.198.10.15:21710
diff --git a/.env.production b/.env.production
index 7595683..36e6ad3 100644
--- a/.env.production
+++ b/.env.production
@@ -4,7 +4,7 @@
VITE_APP_TITLE = 计量信息系统
VITE_SYS_TITLE = 受检设备管理系统
# 接口请求地址,会设置到 axios 的 baseURL 参数上
-VITE_APP_API_BASEURL = http://127.0.0.1:5909
+VITE_APP_API_BASEURL = http://111.198.10.15:21611
# 调试工具,可设置 eruda 或 vconsole,如果不需要开启则留空
VITE_APP_DEBUG_TOOL =
diff --git a/public/config/config.json b/public/config/config.json
index 3bd0a89..169f1f6 100644
--- a/public/config/config.json
+++ b/public/config/config.json
@@ -1,4 +1,8 @@
{
"title":"计量业务系统",
+<<<<<<< HEAD
"baseUrl": "http://111.198.10.15:21611"
+=======
+ "baseUrl": "http://192.168.8.100:5909"
+>>>>>>> 5e67c355ee24dc34e26bb2fdbb5214aa66e8f137
}
diff --git a/src/api/eqpt/device/info.ts b/src/api/eqpt/device/info.ts
index f2a9176..e40366c 100644
--- a/src/api/eqpt/device/info.ts
+++ b/src/api/eqpt/device/info.ts
@@ -153,3 +153,11 @@
method: 'get',
})
}
+// 绑定参试任务
+export function bindTaskHandler(data: object) {
+ return request({
+ url: '/equipment/bindTask',
+ method: 'post',
+ data,
+ })
+}
diff --git a/src/api/eqpt/device/model.ts b/src/api/eqpt/device/model.ts
index a8fa0f1..04da2af 100644
--- a/src/api/eqpt/device/model.ts
+++ b/src/api/eqpt/device/model.ts
@@ -20,11 +20,10 @@
})
}
// 设备名称列表/equipment/model/listEquipmentName
-export function getDeviceNameList(params: any) {
+export function getDeviceNameList() {
return request({
url: '/equipment/model/listEquipmentName',
method: 'get',
- params,
})
}
// 导出
@@ -33,6 +32,7 @@
url: '/equipment/model/export',
method: 'post',
data,
+ responseType: 'blob',
})
}
// 新建或编辑
diff --git a/src/api/eqpt/device/task.ts b/src/api/eqpt/device/task.ts
new file mode 100644
index 0000000..2a83db0
--- /dev/null
+++ b/src/api/eqpt/device/task.ts
@@ -0,0 +1,38 @@
+/**
+ * 参试任务管理相关
+ */
+import request from '@/api/index'
+
+// 列表
+export function getTaskList(params: any) {
+ return request({
+ url: `/equipment/task/listPage?limit=${params.limit}&offset=${params.offset}`,
+ method: 'post',
+ data: params,
+ })
+}
+// 新增
+export function addTask(params: any) {
+ return request({
+ url: '/equipment/task/add',
+ method: 'post',
+ data: params,
+ })
+}
+// 新增
+export function updateTask(params: any) {
+ return request({
+ url: '/equipment/task/update',
+ method: 'post',
+ data: params,
+ })
+}
+// 删除
+export function delTask(params: any) {
+ return request({
+ url: '/equipment/task/delete',
+ method: 'post',
+ data: params,
+ })
+}
+
diff --git a/src/api/system/expire.ts b/src/api/system/expire.ts
index 1365711..834048e 100644
--- a/src/api/system/expire.ts
+++ b/src/api/system/expire.ts
@@ -18,3 +18,18 @@
data,
})
}
+// 新建
+export function addRemind(data: object) {
+ return request({
+ url: '/system/remind/add',
+ method: 'post',
+ data,
+ })
+}
+// 删除
+export function delRemind(id: string) {
+ return request({
+ url: `/system/remind/remove?id=${id}`,
+ method: 'post',
+ })
+}
diff --git a/src/assets/icons/icon-task.svg b/src/assets/icons/icon-task.svg
new file mode 100644
index 0000000..213c7cd
--- /dev/null
+++ b/src/assets/icons/icon-task.svg
@@ -0,0 +1 @@
+
diff --git a/src/views/dashboard.vue b/src/views/dashboard.vue
index df43894..c88bb78 100644
--- a/src/views/dashboard.vue
+++ b/src/views/dashboard.vue
@@ -40,7 +40,6 @@
const token = userStore.token
const params = `?token=${token}`
console.log(system.url + params)
-
window.open(system.url + params)
// window.open(`http://127.0.0.1:9526${params}`)
}
diff --git a/src/views/system/expire/device.vue b/src/views/system/expire/device.vue
new file mode 100644
index 0000000..890d2ab
--- /dev/null
+++ b/src/views/system/expire/device.vue
@@ -0,0 +1,227 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/.env.development b/.env.development
index f2fee42..19ebebf 100644
--- a/.env.development
+++ b/.env.development
@@ -4,7 +4,7 @@
# 接口请求地址,会设置到 axios 的 baseURL 参数上
# VITE_APP_API_BASEURL = http://139.198.29.133:8089
# VITE_APP_API_BASEURL = http://111.198.10.15:21611
-VITE_APP_API_BASEURL = http://192.168.8.101:5909
+VITE_APP_API_BASEURL = http://192.168.8.100:5909
# VITE_APP_API_BASEURL = http://111.198.10.15:21611
# VITE_APP_API_BASEURL = http://192.168.8.107:5909
# VITE_APP_API_BASEURL = http://111.198.10.15:21710
diff --git a/.env.production b/.env.production
index 7595683..36e6ad3 100644
--- a/.env.production
+++ b/.env.production
@@ -4,7 +4,7 @@
VITE_APP_TITLE = 计量信息系统
VITE_SYS_TITLE = 受检设备管理系统
# 接口请求地址,会设置到 axios 的 baseURL 参数上
-VITE_APP_API_BASEURL = http://127.0.0.1:5909
+VITE_APP_API_BASEURL = http://111.198.10.15:21611
# 调试工具,可设置 eruda 或 vconsole,如果不需要开启则留空
VITE_APP_DEBUG_TOOL =
diff --git a/public/config/config.json b/public/config/config.json
index 3bd0a89..169f1f6 100644
--- a/public/config/config.json
+++ b/public/config/config.json
@@ -1,4 +1,8 @@
{
"title":"计量业务系统",
+<<<<<<< HEAD
"baseUrl": "http://111.198.10.15:21611"
+=======
+ "baseUrl": "http://192.168.8.100:5909"
+>>>>>>> 5e67c355ee24dc34e26bb2fdbb5214aa66e8f137
}
diff --git a/src/api/eqpt/device/info.ts b/src/api/eqpt/device/info.ts
index f2a9176..e40366c 100644
--- a/src/api/eqpt/device/info.ts
+++ b/src/api/eqpt/device/info.ts
@@ -153,3 +153,11 @@
method: 'get',
})
}
+// 绑定参试任务
+export function bindTaskHandler(data: object) {
+ return request({
+ url: '/equipment/bindTask',
+ method: 'post',
+ data,
+ })
+}
diff --git a/src/api/eqpt/device/model.ts b/src/api/eqpt/device/model.ts
index a8fa0f1..04da2af 100644
--- a/src/api/eqpt/device/model.ts
+++ b/src/api/eqpt/device/model.ts
@@ -20,11 +20,10 @@
})
}
// 设备名称列表/equipment/model/listEquipmentName
-export function getDeviceNameList(params: any) {
+export function getDeviceNameList() {
return request({
url: '/equipment/model/listEquipmentName',
method: 'get',
- params,
})
}
// 导出
@@ -33,6 +32,7 @@
url: '/equipment/model/export',
method: 'post',
data,
+ responseType: 'blob',
})
}
// 新建或编辑
diff --git a/src/api/eqpt/device/task.ts b/src/api/eqpt/device/task.ts
new file mode 100644
index 0000000..2a83db0
--- /dev/null
+++ b/src/api/eqpt/device/task.ts
@@ -0,0 +1,38 @@
+/**
+ * 参试任务管理相关
+ */
+import request from '@/api/index'
+
+// 列表
+export function getTaskList(params: any) {
+ return request({
+ url: `/equipment/task/listPage?limit=${params.limit}&offset=${params.offset}`,
+ method: 'post',
+ data: params,
+ })
+}
+// 新增
+export function addTask(params: any) {
+ return request({
+ url: '/equipment/task/add',
+ method: 'post',
+ data: params,
+ })
+}
+// 新增
+export function updateTask(params: any) {
+ return request({
+ url: '/equipment/task/update',
+ method: 'post',
+ data: params,
+ })
+}
+// 删除
+export function delTask(params: any) {
+ return request({
+ url: '/equipment/task/delete',
+ method: 'post',
+ data: params,
+ })
+}
+
diff --git a/src/api/system/expire.ts b/src/api/system/expire.ts
index 1365711..834048e 100644
--- a/src/api/system/expire.ts
+++ b/src/api/system/expire.ts
@@ -18,3 +18,18 @@
data,
})
}
+// 新建
+export function addRemind(data: object) {
+ return request({
+ url: '/system/remind/add',
+ method: 'post',
+ data,
+ })
+}
+// 删除
+export function delRemind(id: string) {
+ return request({
+ url: `/system/remind/remove?id=${id}`,
+ method: 'post',
+ })
+}
diff --git a/src/assets/icons/icon-task.svg b/src/assets/icons/icon-task.svg
new file mode 100644
index 0000000..213c7cd
--- /dev/null
+++ b/src/assets/icons/icon-task.svg
@@ -0,0 +1 @@
+
diff --git a/src/views/dashboard.vue b/src/views/dashboard.vue
index df43894..c88bb78 100644
--- a/src/views/dashboard.vue
+++ b/src/views/dashboard.vue
@@ -40,7 +40,6 @@
const token = userStore.token
const params = `?token=${token}`
console.log(system.url + params)
-
window.open(system.url + params)
// window.open(`http://127.0.0.1:9526${params}`)
}
diff --git a/src/views/system/expire/device.vue b/src/views/system/expire/device.vue
new file mode 100644
index 0000000..890d2ab
--- /dev/null
+++ b/src/views/system/expire/device.vue
@@ -0,0 +1,227 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/views/system/expire/edit.vue b/src/views/system/expire/edit.vue
index 72d45f9..a7a0ccf 100644
--- a/src/views/system/expire/edit.vue
+++ b/src/views/system/expire/edit.vue
@@ -3,45 +3,110 @@
import { nextTick, reactive } from 'vue'
import { ElMessage, ElMessageBox } from 'element-plus'
import type { FormInstance, FormRules } from 'element-plus'
-import { getList, updateRemind } from '@/api/system/expire'
+import dayjs from 'dayjs'
+import device from './device.vue'
+import task from './task.vue'
+import useUserStore from '@/store/modules/user'
+import { getUserDept } from '@/api/system/user'
+import { addRemind, getList, updateRemind } from '@/api/system/expire'
// ----------------------- 以下是字段定义 emits props ---------------------
const emits = defineEmits(['closeRefresh'])
const dialogVisible = ref(false)
+const dialogStatus = ref('新建')
+const userStore = useUserStore()
const data = ref({
- createDeptId: 0,
+ createDeptId: '',
createDeptName: '',
createTime: '',
createUserId: '',
createUserName: '',
id: '',
remindName: '',
- remindTime: 0,
+ remindTime: 30,
updateTime: '',
+ remindType: '1',
+ taskIds: [] as string[],
+ taskNames: [] as string[],
+ equipmentNames: [] as string[],
+ modelIds: [] as string[],
+ equipmentExt: [] as string[],
+ taskExt: [] as string[],
+
})
+const resetForm = () => {
+ for (const i in data.value) {
+ data.value[i] = ''
+ }
+ data.value.remindTime = 30
+ data.value.remindType = '1'
+ data.value.taskIds = [] as string[]
+ data.value.taskNames = [] as string[]
+ data.value.equipmentNames = [] as string[]
+ data.value.modelIds = [] as string[]
+ data.value.equipmentExt = [] as string[]
+ data.value.taskExt = [] as string[]
+}
// ---------------表单提交--------------------------------
// 表单对象
const dataFormRef = ref()
-
+const rules = ref({
+ remindName: [{ required: true, message: '提醒名称必填', trigger: ['blur', 'change'] }],
+ remindType: [{ required: true, message: '到期提醒类型必选', trigger: ['blur', 'change'] }],
+ modelIds: [{ required: true, message: '设备必选', trigger: ['blur', 'change'] }],
+ taskIds: [{ required: true, message: '任务必选', trigger: ['blur', 'change'] }],
+ remindTime: [{ required: true, message: '提醒时间必选', trigger: ['blur', 'change'] }],
+}) // 表单验证规则
// 表单提交
function submitForm() {
if (dataFormRef) {
dataFormRef.value?.validate((valid: boolean) => {
if (valid) {
- updateRemind(data.value).then((res) => {
- ElMessage.success('修改成功')
- dialogVisible.value = false
- emits('closeRefresh')
- })
+ if (dialogStatus.value === '新建') {
+ addRemind(data.value).then((res) => {
+ ElMessage.success('修改成功')
+ dialogVisible.value = false
+ emits('closeRefresh')
+ })
+ }
+ else {
+ updateRemind(data.value).then((res) => {
+ ElMessage.success('修改成功')
+ dialogVisible.value = false
+ emits('closeRefresh')
+ })
+ }
}
})
}
}
// ----------初始化、关闭对话框相关-----------------
-function initDialog(row: any) {
+function initDialog(row: any, status: string) {
dialogVisible.value = true
- data.value = row
+ resetForm()
+ if (status === 'create') {
+ dialogStatus.value = '新建'
+ nextTick(() => {
+ dataFormRef.value?.resetFields()
+ })
+
+ data.value.createTime = dayjs().format('YYYY-MM-DD HH:mm:ss') // 创建时间
+ data.value.createUserId = userStore.id
+ data.value.createUserName = userStore.name
+ // 获取当前用户所在单位
+ getUserDept().then((res) => {
+ // fullName
+ data.value.createDeptId = res.data.id
+ data.value.createDeptName = res.data.fullName
+ })
+ }
+ else {
+ data.value = JSON.parse(JSON.stringify(row))
+ dialogStatus.value = '编辑'
+ data.value.equipmentExt = JSON.parse(row.equipmentExt)
+ data.value.taskExt = JSON.parse(row.taskExt)
+ }
}
// 关闭并刷新
@@ -55,30 +120,133 @@
}
// ----------------------- 以下是暴露的方法内容 ----------------------------
defineExpose({ initDialog })
+
+// 选择设备
+const deviceRef = ref()
+const selectDevice = () => {
+ deviceRef.value.initDialog()
+}
+// 确认设备
+const confirmDevice = (list: any[]) => {
+ list.forEach((item: any) => {
+ if (!data.value.modelIds.includes(item.id)) {
+ data.value.equipmentExt.push(`${item.equipmentName}/${item.model}/${item.helpInstruction}`)
+ data.value.modelIds.push(item.id)
+ }
+ })
+}
+const removeDeviceStr = ref()
+const removeDevice = (device: string) => {
+ removeDeviceStr.value = device
+}
+watch(() => data.value.equipmentExt, (newVal, oldVal) => {
+ if (newVal && oldVal) {
+ if (newVal.length < oldVal.length) {
+ const index = oldVal.indexOf(removeDeviceStr.value)
+ data.value.modelIds = data.value.modelIds.filter((item, cindex) => cindex !== index)
+ }
+ }
+}, {
+ deep: true,
+})
+// 选择任务
+const taskRef = ref()
+const selectTask = () => {
+ taskRef.value.initDialog()
+}
+// 确认设备
+const confirmTask = (list: any[]) => {
+ list.forEach((item: any) => {
+ if (!data.value.taskIds.includes(item.id)) {
+ data.value.taskExt.push(`${item.taskName}/${item.createTime}`)
+ data.value.taskIds.push(item.id)
+ }
+ })
+}
+const removeTaskStr = ref()
+const removeTask = (task: string) => {
+ removeTaskStr.value = task
+}
+watch(() => data.value.taskExt, (newVal, oldVal) => {
+ if (newVal && oldVal) {
+ if (newVal.length < oldVal.length) {
+ const index = oldVal.indexOf(removeTaskStr.value)
+ data.value.taskIds = data.value.taskIds.filter((item, cindex) => cindex !== index)
+ }
+ }
+}, {
+ deep: true,
+})
+
+
+
-
-
+
+
-
+
+
+
+ 设备到期提醒
+
+
+ 任务到期提醒
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -98,6 +266,16 @@
diff --git a/.env.development b/.env.development
index f2fee42..19ebebf 100644
--- a/.env.development
+++ b/.env.development
@@ -4,7 +4,7 @@
# 接口请求地址,会设置到 axios 的 baseURL 参数上
# VITE_APP_API_BASEURL = http://139.198.29.133:8089
# VITE_APP_API_BASEURL = http://111.198.10.15:21611
-VITE_APP_API_BASEURL = http://192.168.8.101:5909
+VITE_APP_API_BASEURL = http://192.168.8.100:5909
# VITE_APP_API_BASEURL = http://111.198.10.15:21611
# VITE_APP_API_BASEURL = http://192.168.8.107:5909
# VITE_APP_API_BASEURL = http://111.198.10.15:21710
diff --git a/.env.production b/.env.production
index 7595683..36e6ad3 100644
--- a/.env.production
+++ b/.env.production
@@ -4,7 +4,7 @@
VITE_APP_TITLE = 计量信息系统
VITE_SYS_TITLE = 受检设备管理系统
# 接口请求地址,会设置到 axios 的 baseURL 参数上
-VITE_APP_API_BASEURL = http://127.0.0.1:5909
+VITE_APP_API_BASEURL = http://111.198.10.15:21611
# 调试工具,可设置 eruda 或 vconsole,如果不需要开启则留空
VITE_APP_DEBUG_TOOL =
diff --git a/public/config/config.json b/public/config/config.json
index 3bd0a89..169f1f6 100644
--- a/public/config/config.json
+++ b/public/config/config.json
@@ -1,4 +1,8 @@
{
"title":"计量业务系统",
+<<<<<<< HEAD
"baseUrl": "http://111.198.10.15:21611"
+=======
+ "baseUrl": "http://192.168.8.100:5909"
+>>>>>>> 5e67c355ee24dc34e26bb2fdbb5214aa66e8f137
}
diff --git a/src/api/eqpt/device/info.ts b/src/api/eqpt/device/info.ts
index f2a9176..e40366c 100644
--- a/src/api/eqpt/device/info.ts
+++ b/src/api/eqpt/device/info.ts
@@ -153,3 +153,11 @@
method: 'get',
})
}
+// 绑定参试任务
+export function bindTaskHandler(data: object) {
+ return request({
+ url: '/equipment/bindTask',
+ method: 'post',
+ data,
+ })
+}
diff --git a/src/api/eqpt/device/model.ts b/src/api/eqpt/device/model.ts
index a8fa0f1..04da2af 100644
--- a/src/api/eqpt/device/model.ts
+++ b/src/api/eqpt/device/model.ts
@@ -20,11 +20,10 @@
})
}
// 设备名称列表/equipment/model/listEquipmentName
-export function getDeviceNameList(params: any) {
+export function getDeviceNameList() {
return request({
url: '/equipment/model/listEquipmentName',
method: 'get',
- params,
})
}
// 导出
@@ -33,6 +32,7 @@
url: '/equipment/model/export',
method: 'post',
data,
+ responseType: 'blob',
})
}
// 新建或编辑
diff --git a/src/api/eqpt/device/task.ts b/src/api/eqpt/device/task.ts
new file mode 100644
index 0000000..2a83db0
--- /dev/null
+++ b/src/api/eqpt/device/task.ts
@@ -0,0 +1,38 @@
+/**
+ * 参试任务管理相关
+ */
+import request from '@/api/index'
+
+// 列表
+export function getTaskList(params: any) {
+ return request({
+ url: `/equipment/task/listPage?limit=${params.limit}&offset=${params.offset}`,
+ method: 'post',
+ data: params,
+ })
+}
+// 新增
+export function addTask(params: any) {
+ return request({
+ url: '/equipment/task/add',
+ method: 'post',
+ data: params,
+ })
+}
+// 新增
+export function updateTask(params: any) {
+ return request({
+ url: '/equipment/task/update',
+ method: 'post',
+ data: params,
+ })
+}
+// 删除
+export function delTask(params: any) {
+ return request({
+ url: '/equipment/task/delete',
+ method: 'post',
+ data: params,
+ })
+}
+
diff --git a/src/api/system/expire.ts b/src/api/system/expire.ts
index 1365711..834048e 100644
--- a/src/api/system/expire.ts
+++ b/src/api/system/expire.ts
@@ -18,3 +18,18 @@
data,
})
}
+// 新建
+export function addRemind(data: object) {
+ return request({
+ url: '/system/remind/add',
+ method: 'post',
+ data,
+ })
+}
+// 删除
+export function delRemind(id: string) {
+ return request({
+ url: `/system/remind/remove?id=${id}`,
+ method: 'post',
+ })
+}
diff --git a/src/assets/icons/icon-task.svg b/src/assets/icons/icon-task.svg
new file mode 100644
index 0000000..213c7cd
--- /dev/null
+++ b/src/assets/icons/icon-task.svg
@@ -0,0 +1 @@
+
diff --git a/src/views/dashboard.vue b/src/views/dashboard.vue
index df43894..c88bb78 100644
--- a/src/views/dashboard.vue
+++ b/src/views/dashboard.vue
@@ -40,7 +40,6 @@
const token = userStore.token
const params = `?token=${token}`
console.log(system.url + params)
-
window.open(system.url + params)
// window.open(`http://127.0.0.1:9526${params}`)
}
diff --git a/src/views/system/expire/device.vue b/src/views/system/expire/device.vue
new file mode 100644
index 0000000..890d2ab
--- /dev/null
+++ b/src/views/system/expire/device.vue
@@ -0,0 +1,227 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/views/system/expire/edit.vue b/src/views/system/expire/edit.vue
index 72d45f9..a7a0ccf 100644
--- a/src/views/system/expire/edit.vue
+++ b/src/views/system/expire/edit.vue
@@ -3,45 +3,110 @@
import { nextTick, reactive } from 'vue'
import { ElMessage, ElMessageBox } from 'element-plus'
import type { FormInstance, FormRules } from 'element-plus'
-import { getList, updateRemind } from '@/api/system/expire'
+import dayjs from 'dayjs'
+import device from './device.vue'
+import task from './task.vue'
+import useUserStore from '@/store/modules/user'
+import { getUserDept } from '@/api/system/user'
+import { addRemind, getList, updateRemind } from '@/api/system/expire'
// ----------------------- 以下是字段定义 emits props ---------------------
const emits = defineEmits(['closeRefresh'])
const dialogVisible = ref(false)
+const dialogStatus = ref('新建')
+const userStore = useUserStore()
const data = ref({
- createDeptId: 0,
+ createDeptId: '',
createDeptName: '',
createTime: '',
createUserId: '',
createUserName: '',
id: '',
remindName: '',
- remindTime: 0,
+ remindTime: 30,
updateTime: '',
+ remindType: '1',
+ taskIds: [] as string[],
+ taskNames: [] as string[],
+ equipmentNames: [] as string[],
+ modelIds: [] as string[],
+ equipmentExt: [] as string[],
+ taskExt: [] as string[],
+
})
+const resetForm = () => {
+ for (const i in data.value) {
+ data.value[i] = ''
+ }
+ data.value.remindTime = 30
+ data.value.remindType = '1'
+ data.value.taskIds = [] as string[]
+ data.value.taskNames = [] as string[]
+ data.value.equipmentNames = [] as string[]
+ data.value.modelIds = [] as string[]
+ data.value.equipmentExt = [] as string[]
+ data.value.taskExt = [] as string[]
+}
// ---------------表单提交--------------------------------
// 表单对象
const dataFormRef = ref()
-
+const rules = ref({
+ remindName: [{ required: true, message: '提醒名称必填', trigger: ['blur', 'change'] }],
+ remindType: [{ required: true, message: '到期提醒类型必选', trigger: ['blur', 'change'] }],
+ modelIds: [{ required: true, message: '设备必选', trigger: ['blur', 'change'] }],
+ taskIds: [{ required: true, message: '任务必选', trigger: ['blur', 'change'] }],
+ remindTime: [{ required: true, message: '提醒时间必选', trigger: ['blur', 'change'] }],
+}) // 表单验证规则
// 表单提交
function submitForm() {
if (dataFormRef) {
dataFormRef.value?.validate((valid: boolean) => {
if (valid) {
- updateRemind(data.value).then((res) => {
- ElMessage.success('修改成功')
- dialogVisible.value = false
- emits('closeRefresh')
- })
+ if (dialogStatus.value === '新建') {
+ addRemind(data.value).then((res) => {
+ ElMessage.success('修改成功')
+ dialogVisible.value = false
+ emits('closeRefresh')
+ })
+ }
+ else {
+ updateRemind(data.value).then((res) => {
+ ElMessage.success('修改成功')
+ dialogVisible.value = false
+ emits('closeRefresh')
+ })
+ }
}
})
}
}
// ----------初始化、关闭对话框相关-----------------
-function initDialog(row: any) {
+function initDialog(row: any, status: string) {
dialogVisible.value = true
- data.value = row
+ resetForm()
+ if (status === 'create') {
+ dialogStatus.value = '新建'
+ nextTick(() => {
+ dataFormRef.value?.resetFields()
+ })
+
+ data.value.createTime = dayjs().format('YYYY-MM-DD HH:mm:ss') // 创建时间
+ data.value.createUserId = userStore.id
+ data.value.createUserName = userStore.name
+ // 获取当前用户所在单位
+ getUserDept().then((res) => {
+ // fullName
+ data.value.createDeptId = res.data.id
+ data.value.createDeptName = res.data.fullName
+ })
+ }
+ else {
+ data.value = JSON.parse(JSON.stringify(row))
+ dialogStatus.value = '编辑'
+ data.value.equipmentExt = JSON.parse(row.equipmentExt)
+ data.value.taskExt = JSON.parse(row.taskExt)
+ }
}
// 关闭并刷新
@@ -55,30 +120,133 @@
}
// ----------------------- 以下是暴露的方法内容 ----------------------------
defineExpose({ initDialog })
+
+// 选择设备
+const deviceRef = ref()
+const selectDevice = () => {
+ deviceRef.value.initDialog()
+}
+// 确认设备
+const confirmDevice = (list: any[]) => {
+ list.forEach((item: any) => {
+ if (!data.value.modelIds.includes(item.id)) {
+ data.value.equipmentExt.push(`${item.equipmentName}/${item.model}/${item.helpInstruction}`)
+ data.value.modelIds.push(item.id)
+ }
+ })
+}
+const removeDeviceStr = ref()
+const removeDevice = (device: string) => {
+ removeDeviceStr.value = device
+}
+watch(() => data.value.equipmentExt, (newVal, oldVal) => {
+ if (newVal && oldVal) {
+ if (newVal.length < oldVal.length) {
+ const index = oldVal.indexOf(removeDeviceStr.value)
+ data.value.modelIds = data.value.modelIds.filter((item, cindex) => cindex !== index)
+ }
+ }
+}, {
+ deep: true,
+})
+// 选择任务
+const taskRef = ref()
+const selectTask = () => {
+ taskRef.value.initDialog()
+}
+// 确认设备
+const confirmTask = (list: any[]) => {
+ list.forEach((item: any) => {
+ if (!data.value.taskIds.includes(item.id)) {
+ data.value.taskExt.push(`${item.taskName}/${item.createTime}`)
+ data.value.taskIds.push(item.id)
+ }
+ })
+}
+const removeTaskStr = ref()
+const removeTask = (task: string) => {
+ removeTaskStr.value = task
+}
+watch(() => data.value.taskExt, (newVal, oldVal) => {
+ if (newVal && oldVal) {
+ if (newVal.length < oldVal.length) {
+ const index = oldVal.indexOf(removeTaskStr.value)
+ data.value.taskIds = data.value.taskIds.filter((item, cindex) => cindex !== index)
+ }
+ }
+}, {
+ deep: true,
+})
+
+
+
-
-
+
+
-
+
+
+
+ 设备到期提醒
+
+
+ 任务到期提醒
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -98,6 +266,16 @@
diff --git a/src/views/tested/device/info/components/interface.ts b/src/views/tested/device/info/components/interface.ts
index fbb1f51..73bfbf4 100644
--- a/src/views/tested/device/info/components/interface.ts
+++ b/src/views/tested/device/info/components/interface.ts
@@ -12,6 +12,17 @@
limit: number
approvalStatus?: string
formId?: string
+ model: string
+ manufactureNo: string
+ companyId: string
+ directorName: string
+ useSign: string
+ installLocation: string
+ taskId: string
+ checkOrganization: string
+ meterIdentify: string
+ checkDateStart: string
+ checkDateEnd: string
}
// 设备信息对象
export interface IlistObjType {
diff --git a/.env.development b/.env.development
index f2fee42..19ebebf 100644
--- a/.env.development
+++ b/.env.development
@@ -4,7 +4,7 @@
# 接口请求地址,会设置到 axios 的 baseURL 参数上
# VITE_APP_API_BASEURL = http://139.198.29.133:8089
# VITE_APP_API_BASEURL = http://111.198.10.15:21611
-VITE_APP_API_BASEURL = http://192.168.8.101:5909
+VITE_APP_API_BASEURL = http://192.168.8.100:5909
# VITE_APP_API_BASEURL = http://111.198.10.15:21611
# VITE_APP_API_BASEURL = http://192.168.8.107:5909
# VITE_APP_API_BASEURL = http://111.198.10.15:21710
diff --git a/.env.production b/.env.production
index 7595683..36e6ad3 100644
--- a/.env.production
+++ b/.env.production
@@ -4,7 +4,7 @@
VITE_APP_TITLE = 计量信息系统
VITE_SYS_TITLE = 受检设备管理系统
# 接口请求地址,会设置到 axios 的 baseURL 参数上
-VITE_APP_API_BASEURL = http://127.0.0.1:5909
+VITE_APP_API_BASEURL = http://111.198.10.15:21611
# 调试工具,可设置 eruda 或 vconsole,如果不需要开启则留空
VITE_APP_DEBUG_TOOL =
diff --git a/public/config/config.json b/public/config/config.json
index 3bd0a89..169f1f6 100644
--- a/public/config/config.json
+++ b/public/config/config.json
@@ -1,4 +1,8 @@
{
"title":"计量业务系统",
+<<<<<<< HEAD
"baseUrl": "http://111.198.10.15:21611"
+=======
+ "baseUrl": "http://192.168.8.100:5909"
+>>>>>>> 5e67c355ee24dc34e26bb2fdbb5214aa66e8f137
}
diff --git a/src/api/eqpt/device/info.ts b/src/api/eqpt/device/info.ts
index f2a9176..e40366c 100644
--- a/src/api/eqpt/device/info.ts
+++ b/src/api/eqpt/device/info.ts
@@ -153,3 +153,11 @@
method: 'get',
})
}
+// 绑定参试任务
+export function bindTaskHandler(data: object) {
+ return request({
+ url: '/equipment/bindTask',
+ method: 'post',
+ data,
+ })
+}
diff --git a/src/api/eqpt/device/model.ts b/src/api/eqpt/device/model.ts
index a8fa0f1..04da2af 100644
--- a/src/api/eqpt/device/model.ts
+++ b/src/api/eqpt/device/model.ts
@@ -20,11 +20,10 @@
})
}
// 设备名称列表/equipment/model/listEquipmentName
-export function getDeviceNameList(params: any) {
+export function getDeviceNameList() {
return request({
url: '/equipment/model/listEquipmentName',
method: 'get',
- params,
})
}
// 导出
@@ -33,6 +32,7 @@
url: '/equipment/model/export',
method: 'post',
data,
+ responseType: 'blob',
})
}
// 新建或编辑
diff --git a/src/api/eqpt/device/task.ts b/src/api/eqpt/device/task.ts
new file mode 100644
index 0000000..2a83db0
--- /dev/null
+++ b/src/api/eqpt/device/task.ts
@@ -0,0 +1,38 @@
+/**
+ * 参试任务管理相关
+ */
+import request from '@/api/index'
+
+// 列表
+export function getTaskList(params: any) {
+ return request({
+ url: `/equipment/task/listPage?limit=${params.limit}&offset=${params.offset}`,
+ method: 'post',
+ data: params,
+ })
+}
+// 新增
+export function addTask(params: any) {
+ return request({
+ url: '/equipment/task/add',
+ method: 'post',
+ data: params,
+ })
+}
+// 新增
+export function updateTask(params: any) {
+ return request({
+ url: '/equipment/task/update',
+ method: 'post',
+ data: params,
+ })
+}
+// 删除
+export function delTask(params: any) {
+ return request({
+ url: '/equipment/task/delete',
+ method: 'post',
+ data: params,
+ })
+}
+
diff --git a/src/api/system/expire.ts b/src/api/system/expire.ts
index 1365711..834048e 100644
--- a/src/api/system/expire.ts
+++ b/src/api/system/expire.ts
@@ -18,3 +18,18 @@
data,
})
}
+// 新建
+export function addRemind(data: object) {
+ return request({
+ url: '/system/remind/add',
+ method: 'post',
+ data,
+ })
+}
+// 删除
+export function delRemind(id: string) {
+ return request({
+ url: `/system/remind/remove?id=${id}`,
+ method: 'post',
+ })
+}
diff --git a/src/assets/icons/icon-task.svg b/src/assets/icons/icon-task.svg
new file mode 100644
index 0000000..213c7cd
--- /dev/null
+++ b/src/assets/icons/icon-task.svg
@@ -0,0 +1 @@
+
diff --git a/src/views/dashboard.vue b/src/views/dashboard.vue
index df43894..c88bb78 100644
--- a/src/views/dashboard.vue
+++ b/src/views/dashboard.vue
@@ -40,7 +40,6 @@
const token = userStore.token
const params = `?token=${token}`
console.log(system.url + params)
-
window.open(system.url + params)
// window.open(`http://127.0.0.1:9526${params}`)
}
diff --git a/src/views/system/expire/device.vue b/src/views/system/expire/device.vue
new file mode 100644
index 0000000..890d2ab
--- /dev/null
+++ b/src/views/system/expire/device.vue
@@ -0,0 +1,227 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/views/system/expire/edit.vue b/src/views/system/expire/edit.vue
index 72d45f9..a7a0ccf 100644
--- a/src/views/system/expire/edit.vue
+++ b/src/views/system/expire/edit.vue
@@ -3,45 +3,110 @@
import { nextTick, reactive } from 'vue'
import { ElMessage, ElMessageBox } from 'element-plus'
import type { FormInstance, FormRules } from 'element-plus'
-import { getList, updateRemind } from '@/api/system/expire'
+import dayjs from 'dayjs'
+import device from './device.vue'
+import task from './task.vue'
+import useUserStore from '@/store/modules/user'
+import { getUserDept } from '@/api/system/user'
+import { addRemind, getList, updateRemind } from '@/api/system/expire'
// ----------------------- 以下是字段定义 emits props ---------------------
const emits = defineEmits(['closeRefresh'])
const dialogVisible = ref(false)
+const dialogStatus = ref('新建')
+const userStore = useUserStore()
const data = ref({
- createDeptId: 0,
+ createDeptId: '',
createDeptName: '',
createTime: '',
createUserId: '',
createUserName: '',
id: '',
remindName: '',
- remindTime: 0,
+ remindTime: 30,
updateTime: '',
+ remindType: '1',
+ taskIds: [] as string[],
+ taskNames: [] as string[],
+ equipmentNames: [] as string[],
+ modelIds: [] as string[],
+ equipmentExt: [] as string[],
+ taskExt: [] as string[],
+
})
+const resetForm = () => {
+ for (const i in data.value) {
+ data.value[i] = ''
+ }
+ data.value.remindTime = 30
+ data.value.remindType = '1'
+ data.value.taskIds = [] as string[]
+ data.value.taskNames = [] as string[]
+ data.value.equipmentNames = [] as string[]
+ data.value.modelIds = [] as string[]
+ data.value.equipmentExt = [] as string[]
+ data.value.taskExt = [] as string[]
+}
// ---------------表单提交--------------------------------
// 表单对象
const dataFormRef = ref()
-
+const rules = ref({
+ remindName: [{ required: true, message: '提醒名称必填', trigger: ['blur', 'change'] }],
+ remindType: [{ required: true, message: '到期提醒类型必选', trigger: ['blur', 'change'] }],
+ modelIds: [{ required: true, message: '设备必选', trigger: ['blur', 'change'] }],
+ taskIds: [{ required: true, message: '任务必选', trigger: ['blur', 'change'] }],
+ remindTime: [{ required: true, message: '提醒时间必选', trigger: ['blur', 'change'] }],
+}) // 表单验证规则
// 表单提交
function submitForm() {
if (dataFormRef) {
dataFormRef.value?.validate((valid: boolean) => {
if (valid) {
- updateRemind(data.value).then((res) => {
- ElMessage.success('修改成功')
- dialogVisible.value = false
- emits('closeRefresh')
- })
+ if (dialogStatus.value === '新建') {
+ addRemind(data.value).then((res) => {
+ ElMessage.success('修改成功')
+ dialogVisible.value = false
+ emits('closeRefresh')
+ })
+ }
+ else {
+ updateRemind(data.value).then((res) => {
+ ElMessage.success('修改成功')
+ dialogVisible.value = false
+ emits('closeRefresh')
+ })
+ }
}
})
}
}
// ----------初始化、关闭对话框相关-----------------
-function initDialog(row: any) {
+function initDialog(row: any, status: string) {
dialogVisible.value = true
- data.value = row
+ resetForm()
+ if (status === 'create') {
+ dialogStatus.value = '新建'
+ nextTick(() => {
+ dataFormRef.value?.resetFields()
+ })
+
+ data.value.createTime = dayjs().format('YYYY-MM-DD HH:mm:ss') // 创建时间
+ data.value.createUserId = userStore.id
+ data.value.createUserName = userStore.name
+ // 获取当前用户所在单位
+ getUserDept().then((res) => {
+ // fullName
+ data.value.createDeptId = res.data.id
+ data.value.createDeptName = res.data.fullName
+ })
+ }
+ else {
+ data.value = JSON.parse(JSON.stringify(row))
+ dialogStatus.value = '编辑'
+ data.value.equipmentExt = JSON.parse(row.equipmentExt)
+ data.value.taskExt = JSON.parse(row.taskExt)
+ }
}
// 关闭并刷新
@@ -55,30 +120,133 @@
}
// ----------------------- 以下是暴露的方法内容 ----------------------------
defineExpose({ initDialog })
+
+// 选择设备
+const deviceRef = ref()
+const selectDevice = () => {
+ deviceRef.value.initDialog()
+}
+// 确认设备
+const confirmDevice = (list: any[]) => {
+ list.forEach((item: any) => {
+ if (!data.value.modelIds.includes(item.id)) {
+ data.value.equipmentExt.push(`${item.equipmentName}/${item.model}/${item.helpInstruction}`)
+ data.value.modelIds.push(item.id)
+ }
+ })
+}
+const removeDeviceStr = ref()
+const removeDevice = (device: string) => {
+ removeDeviceStr.value = device
+}
+watch(() => data.value.equipmentExt, (newVal, oldVal) => {
+ if (newVal && oldVal) {
+ if (newVal.length < oldVal.length) {
+ const index = oldVal.indexOf(removeDeviceStr.value)
+ data.value.modelIds = data.value.modelIds.filter((item, cindex) => cindex !== index)
+ }
+ }
+}, {
+ deep: true,
+})
+// 选择任务
+const taskRef = ref()
+const selectTask = () => {
+ taskRef.value.initDialog()
+}
+// 确认设备
+const confirmTask = (list: any[]) => {
+ list.forEach((item: any) => {
+ if (!data.value.taskIds.includes(item.id)) {
+ data.value.taskExt.push(`${item.taskName}/${item.createTime}`)
+ data.value.taskIds.push(item.id)
+ }
+ })
+}
+const removeTaskStr = ref()
+const removeTask = (task: string) => {
+ removeTaskStr.value = task
+}
+watch(() => data.value.taskExt, (newVal, oldVal) => {
+ if (newVal && oldVal) {
+ if (newVal.length < oldVal.length) {
+ const index = oldVal.indexOf(removeTaskStr.value)
+ data.value.taskIds = data.value.taskIds.filter((item, cindex) => cindex !== index)
+ }
+ }
+}, {
+ deep: true,
+})
+
+
+
-
-
+
+
-
+
+
+
+ 设备到期提醒
+
+
+ 任务到期提醒
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -98,6 +266,16 @@
diff --git a/src/views/tested/device/info/components/interface.ts b/src/views/tested/device/info/components/interface.ts
index fbb1f51..73bfbf4 100644
--- a/src/views/tested/device/info/components/interface.ts
+++ b/src/views/tested/device/info/components/interface.ts
@@ -12,6 +12,17 @@
limit: number
approvalStatus?: string
formId?: string
+ model: string
+ manufactureNo: string
+ companyId: string
+ directorName: string
+ useSign: string
+ installLocation: string
+ taskId: string
+ checkOrganization: string
+ meterIdentify: string
+ checkDateStart: string
+ checkDateEnd: string
}
// 设备信息对象
export interface IlistObjType {
diff --git a/src/views/tested/device/info/components/list.vue b/src/views/tested/device/info/components/list.vue
index db05d4d..d42a797 100644
--- a/src/views/tested/device/info/components/list.vue
+++ b/src/views/tested/device/info/components/list.vue
@@ -5,11 +5,14 @@
import type { IlistObjType, IlistQueryType } from './interface'
import { delTextBtn, editTextBtn } from '@/utils/applyBtns'
import ApprovalDialog from '@/components/Approval/ApprovalDialog.vue'
-import { cancelInfo, deleteInfo, editInfo, exportDevice, getInfoList, getInfoListPage, getInfoListTogether, importDevice, submitInfo } from '@/api/eqpt/device/info'
+import { bindTaskHandler, cancelInfo, deleteInfo, editInfo, exportDevice, getInfoList, getInfoListPage, getInfoListTogether, importDevice, submitInfo } from '@/api/eqpt/device/info'
import { getDictByCode } from '@/api/system/dict'
import { SCHEDULE } from '@/utils/scheduleDict'
import useTemplateDownload from '@/utils/useTemplateDownload'
import { exportFile } from '@/utils/exportUtils'
+import { getDeviceNameList, getModelAllList, getModelList } from '@/api/eqpt/device/model'
+import { getTaskList } from '@/api/eqpt/device/task'
+import task from '@/views/tested/device/task/index.vue'
const $props = defineProps({
statusName: {
type: String,
@@ -44,6 +47,17 @@
limit: 20,
approvalStatus: '',
formId: SCHEDULE.DEVICE_INFO_APPROVAL,
+ model: '', // 规格型号
+ manufactureNo: '', // 出厂编号
+ companyId: '', // 所在单位
+ directorName: '', // 负责人
+ useSign: '', // 再用信息
+ installLocation: '', // 安装位置
+ taskId: '', // 参试任务
+ checkOrganization: '', // 检定机构
+ meterIdentify: '', // 计量标识
+ checkDateEnd: '',
+ checkDateStart: '',
})
const columns = ref([
{
@@ -137,6 +151,8 @@
console.log('倒叙')
}
}
+// 切换表格标识 true:普通表格 false:聚合表格
+const tableFlage = ref(true)
// 聚合表格实例
const togetherTableRef = ref()
// 展开表格实例
@@ -164,12 +180,57 @@
}
// 获取使用状态列表
const useStatusList = ref()
+// 设备名称
+const deviceNameList = ref<{ id: string; value: string; name: string }[]>([])
+// 设备分类
+const deviceTypeList = ref<{ id: string; value: string; name: string }[]>([])
+// 再用信息
+const useSignList = ref<{ id: string; value: string; name: string }[]>([])
+// 任务列表
+const taskList = ref<{ id: string; value: string; name: string }[]>([])
+// 计量标识
+const meterIdentifyList = ref<{ id: string; value: string; name: string }[]>()
+// 规格型号
+const modelList = ref([])
+const allList = ref([])
const fetchUseStatus = () => {
getDictByCode('eqptDeviceUseStatus').then((res) => {
useStatusList.value = res.data
})
+ getDictByCode('eqptDeviceInUse').then((res) => {
+ useSignList.value = res.data
+ })
+ // 设备分类
+ getDictByCode('eqptDeviceType').then((res) => {
+ deviceTypeList.value = res.data
+ })
+ // 设备名称
+ getDeviceNameList().then((res) => {
+ deviceNameList.value = res.data
+ })
+ // 规格型号
+ getModelAllList({}).then((res) => {
+ allList.value = res.data
+ modelList.value = res.data
+ })
+ // 参试任务
+ getTaskList({ limit: 9999, offset: 1 }).then((res) => {
+ taskList.value = res.data.rows.map((item: any) => ({ name: item.taskName, value: item.id, id: item.id }))
+ })
+ getDictByCode('eqptMeterIdentify').then((res) => {
+ meterIdentifyList.value = res.data
+ })
}
fetchUseStatus()
+// 监听设备名称下拉框,修改规格型号和辅助字段
+watch(() => listQuery.equipmentName, (newVal) => {
+ if (newVal) {
+ listQuery.model = ''
+ // 修改规格型号和辅助字段列表
+ const data = allList.value.filter(item => item.equipmentName === newVal)
+ modelList.value = data
+ }
+})
// 查询数据
const search = () => {
fetchData(false)
@@ -186,16 +247,39 @@
listQuery.certificateValidEnd = ''
}
})
+const datetimerange1 = ref()
+watch(() => datetimerange1.value, (newVal) => {
+ if (newVal.length) {
+ listQuery.checkDateStart = `${newVal[0]} 00:00:00`
+ listQuery.checkDateEnd = `${newVal[1]} 23:59:59`
+ }
+ else {
+ listQuery.checkDateStart = ''
+ listQuery.checkDateEnd = ''
+ }
+})
// 重置
const reset = () => {
datetimerange.value = []
+ datetimerange1.value = []
listQuery.equipmentNo = ''
listQuery.equipmentName = ''
listQuery.usageStatus = ''
listQuery.usePosition = ''
listQuery.certificateValidEnd = ''
listQuery.certificateValidStart = ''
+ listQuery.model = ''
listQuery.deptIds = ''
+ listQuery.manufactureNo = ''
+ listQuery.companyId = ''
+ listQuery.directorName = ''
+ listQuery.useSign = ''
+ listQuery.installLocation = ''
+ listQuery.checkOrganization = ''
+ listQuery.checkDateStart = ''
+ listQuery.checkDateEnd = ''
+ listQuery.taskId = ''
+ listQuery.meterIdentify = ''
listQuery.offset = 1
listQuery.limit = 20
search()
@@ -392,6 +476,39 @@
const importList = () => {
fileRef.value.click()
}
+// 绑定参试任务
+const taskRef = ref()
+const bindTask = () => {
+ taskRef.value.initDialog()
+}
+// 确认绑定
+const bindIds = (ids: string[]) => {
+ console.log(ids, '参数任务ids')
+ // bindTaskHandler()
+ // 判断是 普通表格还是 聚合表格
+ if (tableFlage.value) {
+ // 普通表格
+ const data = {
+ equipmentIds: selectList.value.map(item => item.id),
+ taskIds: ids,
+ }
+ bindTaskHandler(data).then((res) => {
+ ElMessage.success('绑定成功')
+ fetchData()
+ })
+ }
+ else {
+ const data = {
+ equipmentNames: togetherTableRef.value.getSelectionRows().map((item: any) => item.equipmentName),
+ equipmentIds: expandTableRef.value.getSelectionRows().map((item: any) => item.id),
+ taskIds: ids,
+ }
+ bindTaskHandler(data).then((res) => {
+ ElMessage.success('绑定成功')
+ fetchTogetherData()
+ })
+ }
+}
// 详情
const detail = (row: IlistObjType) => {
if ($props.statusName === '草稿箱' || $props.statusName === '未通过' || $props.statusName === '已取消') {
@@ -507,8 +624,7 @@
const approveHandler = (row: any, type: string) => {
approvalDialogRef.value.initDialog(type, row.taskId, row.processId, row.id)
}
-// 切换表格标识 true:普通表格 false:聚合表格
-const tableFlage = ref(true)
+
const changeTable = () => {
tableFlage.value = !tableFlage.value
if (tableFlage.value) {
@@ -546,19 +662,25 @@
+
+
-
+
+
+
-
-
+
+
+
+
+
+
@@ -566,11 +688,50 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -580,6 +741,7 @@
+
@@ -660,7 +822,7 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/views/system/expire/edit.vue b/src/views/system/expire/edit.vue
index 72d45f9..a7a0ccf 100644
--- a/src/views/system/expire/edit.vue
+++ b/src/views/system/expire/edit.vue
@@ -3,45 +3,110 @@
import { nextTick, reactive } from 'vue'
import { ElMessage, ElMessageBox } from 'element-plus'
import type { FormInstance, FormRules } from 'element-plus'
-import { getList, updateRemind } from '@/api/system/expire'
+import dayjs from 'dayjs'
+import device from './device.vue'
+import task from './task.vue'
+import useUserStore from '@/store/modules/user'
+import { getUserDept } from '@/api/system/user'
+import { addRemind, getList, updateRemind } from '@/api/system/expire'
// ----------------------- 以下是字段定义 emits props ---------------------
const emits = defineEmits(['closeRefresh'])
const dialogVisible = ref(false)
+const dialogStatus = ref('新建')
+const userStore = useUserStore()
const data = ref({
- createDeptId: 0,
+ createDeptId: '',
createDeptName: '',
createTime: '',
createUserId: '',
createUserName: '',
id: '',
remindName: '',
- remindTime: 0,
+ remindTime: 30,
updateTime: '',
+ remindType: '1',
+ taskIds: [] as string[],
+ taskNames: [] as string[],
+ equipmentNames: [] as string[],
+ modelIds: [] as string[],
+ equipmentExt: [] as string[],
+ taskExt: [] as string[],
+
})
+const resetForm = () => {
+ for (const i in data.value) {
+ data.value[i] = ''
+ }
+ data.value.remindTime = 30
+ data.value.remindType = '1'
+ data.value.taskIds = [] as string[]
+ data.value.taskNames = [] as string[]
+ data.value.equipmentNames = [] as string[]
+ data.value.modelIds = [] as string[]
+ data.value.equipmentExt = [] as string[]
+ data.value.taskExt = [] as string[]
+}
// ---------------表单提交--------------------------------
// 表单对象
const dataFormRef = ref()
-
+const rules = ref({
+ remindName: [{ required: true, message: '提醒名称必填', trigger: ['blur', 'change'] }],
+ remindType: [{ required: true, message: '到期提醒类型必选', trigger: ['blur', 'change'] }],
+ modelIds: [{ required: true, message: '设备必选', trigger: ['blur', 'change'] }],
+ taskIds: [{ required: true, message: '任务必选', trigger: ['blur', 'change'] }],
+ remindTime: [{ required: true, message: '提醒时间必选', trigger: ['blur', 'change'] }],
+}) // 表单验证规则
// 表单提交
function submitForm() {
if (dataFormRef) {
dataFormRef.value?.validate((valid: boolean) => {
if (valid) {
- updateRemind(data.value).then((res) => {
- ElMessage.success('修改成功')
- dialogVisible.value = false
- emits('closeRefresh')
- })
+ if (dialogStatus.value === '新建') {
+ addRemind(data.value).then((res) => {
+ ElMessage.success('修改成功')
+ dialogVisible.value = false
+ emits('closeRefresh')
+ })
+ }
+ else {
+ updateRemind(data.value).then((res) => {
+ ElMessage.success('修改成功')
+ dialogVisible.value = false
+ emits('closeRefresh')
+ })
+ }
}
})
}
}
// ----------初始化、关闭对话框相关-----------------
-function initDialog(row: any) {
+function initDialog(row: any, status: string) {
dialogVisible.value = true
- data.value = row
+ resetForm()
+ if (status === 'create') {
+ dialogStatus.value = '新建'
+ nextTick(() => {
+ dataFormRef.value?.resetFields()
+ })
+
+ data.value.createTime = dayjs().format('YYYY-MM-DD HH:mm:ss') // 创建时间
+ data.value.createUserId = userStore.id
+ data.value.createUserName = userStore.name
+ // 获取当前用户所在单位
+ getUserDept().then((res) => {
+ // fullName
+ data.value.createDeptId = res.data.id
+ data.value.createDeptName = res.data.fullName
+ })
+ }
+ else {
+ data.value = JSON.parse(JSON.stringify(row))
+ dialogStatus.value = '编辑'
+ data.value.equipmentExt = JSON.parse(row.equipmentExt)
+ data.value.taskExt = JSON.parse(row.taskExt)
+ }
}
// 关闭并刷新
@@ -55,30 +120,133 @@
}
// ----------------------- 以下是暴露的方法内容 ----------------------------
defineExpose({ initDialog })
+
+// 选择设备
+const deviceRef = ref()
+const selectDevice = () => {
+ deviceRef.value.initDialog()
+}
+// 确认设备
+const confirmDevice = (list: any[]) => {
+ list.forEach((item: any) => {
+ if (!data.value.modelIds.includes(item.id)) {
+ data.value.equipmentExt.push(`${item.equipmentName}/${item.model}/${item.helpInstruction}`)
+ data.value.modelIds.push(item.id)
+ }
+ })
+}
+const removeDeviceStr = ref()
+const removeDevice = (device: string) => {
+ removeDeviceStr.value = device
+}
+watch(() => data.value.equipmentExt, (newVal, oldVal) => {
+ if (newVal && oldVal) {
+ if (newVal.length < oldVal.length) {
+ const index = oldVal.indexOf(removeDeviceStr.value)
+ data.value.modelIds = data.value.modelIds.filter((item, cindex) => cindex !== index)
+ }
+ }
+}, {
+ deep: true,
+})
+// 选择任务
+const taskRef = ref()
+const selectTask = () => {
+ taskRef.value.initDialog()
+}
+// 确认设备
+const confirmTask = (list: any[]) => {
+ list.forEach((item: any) => {
+ if (!data.value.taskIds.includes(item.id)) {
+ data.value.taskExt.push(`${item.taskName}/${item.createTime}`)
+ data.value.taskIds.push(item.id)
+ }
+ })
+}
+const removeTaskStr = ref()
+const removeTask = (task: string) => {
+ removeTaskStr.value = task
+}
+watch(() => data.value.taskExt, (newVal, oldVal) => {
+ if (newVal && oldVal) {
+ if (newVal.length < oldVal.length) {
+ const index = oldVal.indexOf(removeTaskStr.value)
+ data.value.taskIds = data.value.taskIds.filter((item, cindex) => cindex !== index)
+ }
+ }
+}, {
+ deep: true,
+})
+
+
+
-
-
+
+
-
+
+
+
+ 设备到期提醒
+
+
+ 任务到期提醒
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -98,6 +266,16 @@
diff --git a/src/views/tested/device/info/components/interface.ts b/src/views/tested/device/info/components/interface.ts
index fbb1f51..73bfbf4 100644
--- a/src/views/tested/device/info/components/interface.ts
+++ b/src/views/tested/device/info/components/interface.ts
@@ -12,6 +12,17 @@
limit: number
approvalStatus?: string
formId?: string
+ model: string
+ manufactureNo: string
+ companyId: string
+ directorName: string
+ useSign: string
+ installLocation: string
+ taskId: string
+ checkOrganization: string
+ meterIdentify: string
+ checkDateStart: string
+ checkDateEnd: string
}
// 设备信息对象
export interface IlistObjType {
diff --git a/src/views/tested/device/info/components/list.vue b/src/views/tested/device/info/components/list.vue
index db05d4d..d42a797 100644
--- a/src/views/tested/device/info/components/list.vue
+++ b/src/views/tested/device/info/components/list.vue
@@ -5,11 +5,14 @@
import type { IlistObjType, IlistQueryType } from './interface'
import { delTextBtn, editTextBtn } from '@/utils/applyBtns'
import ApprovalDialog from '@/components/Approval/ApprovalDialog.vue'
-import { cancelInfo, deleteInfo, editInfo, exportDevice, getInfoList, getInfoListPage, getInfoListTogether, importDevice, submitInfo } from '@/api/eqpt/device/info'
+import { bindTaskHandler, cancelInfo, deleteInfo, editInfo, exportDevice, getInfoList, getInfoListPage, getInfoListTogether, importDevice, submitInfo } from '@/api/eqpt/device/info'
import { getDictByCode } from '@/api/system/dict'
import { SCHEDULE } from '@/utils/scheduleDict'
import useTemplateDownload from '@/utils/useTemplateDownload'
import { exportFile } from '@/utils/exportUtils'
+import { getDeviceNameList, getModelAllList, getModelList } from '@/api/eqpt/device/model'
+import { getTaskList } from '@/api/eqpt/device/task'
+import task from '@/views/tested/device/task/index.vue'
const $props = defineProps({
statusName: {
type: String,
@@ -44,6 +47,17 @@
limit: 20,
approvalStatus: '',
formId: SCHEDULE.DEVICE_INFO_APPROVAL,
+ model: '', // 规格型号
+ manufactureNo: '', // 出厂编号
+ companyId: '', // 所在单位
+ directorName: '', // 负责人
+ useSign: '', // 再用信息
+ installLocation: '', // 安装位置
+ taskId: '', // 参试任务
+ checkOrganization: '', // 检定机构
+ meterIdentify: '', // 计量标识
+ checkDateEnd: '',
+ checkDateStart: '',
})
const columns = ref([
{
@@ -137,6 +151,8 @@
console.log('倒叙')
}
}
+// 切换表格标识 true:普通表格 false:聚合表格
+const tableFlage = ref(true)
// 聚合表格实例
const togetherTableRef = ref()
// 展开表格实例
@@ -164,12 +180,57 @@
}
// 获取使用状态列表
const useStatusList = ref()
+// 设备名称
+const deviceNameList = ref<{ id: string; value: string; name: string }[]>([])
+// 设备分类
+const deviceTypeList = ref<{ id: string; value: string; name: string }[]>([])
+// 再用信息
+const useSignList = ref<{ id: string; value: string; name: string }[]>([])
+// 任务列表
+const taskList = ref<{ id: string; value: string; name: string }[]>([])
+// 计量标识
+const meterIdentifyList = ref<{ id: string; value: string; name: string }[]>()
+// 规格型号
+const modelList = ref([])
+const allList = ref([])
const fetchUseStatus = () => {
getDictByCode('eqptDeviceUseStatus').then((res) => {
useStatusList.value = res.data
})
+ getDictByCode('eqptDeviceInUse').then((res) => {
+ useSignList.value = res.data
+ })
+ // 设备分类
+ getDictByCode('eqptDeviceType').then((res) => {
+ deviceTypeList.value = res.data
+ })
+ // 设备名称
+ getDeviceNameList().then((res) => {
+ deviceNameList.value = res.data
+ })
+ // 规格型号
+ getModelAllList({}).then((res) => {
+ allList.value = res.data
+ modelList.value = res.data
+ })
+ // 参试任务
+ getTaskList({ limit: 9999, offset: 1 }).then((res) => {
+ taskList.value = res.data.rows.map((item: any) => ({ name: item.taskName, value: item.id, id: item.id }))
+ })
+ getDictByCode('eqptMeterIdentify').then((res) => {
+ meterIdentifyList.value = res.data
+ })
}
fetchUseStatus()
+// 监听设备名称下拉框,修改规格型号和辅助字段
+watch(() => listQuery.equipmentName, (newVal) => {
+ if (newVal) {
+ listQuery.model = ''
+ // 修改规格型号和辅助字段列表
+ const data = allList.value.filter(item => item.equipmentName === newVal)
+ modelList.value = data
+ }
+})
// 查询数据
const search = () => {
fetchData(false)
@@ -186,16 +247,39 @@
listQuery.certificateValidEnd = ''
}
})
+const datetimerange1 = ref()
+watch(() => datetimerange1.value, (newVal) => {
+ if (newVal.length) {
+ listQuery.checkDateStart = `${newVal[0]} 00:00:00`
+ listQuery.checkDateEnd = `${newVal[1]} 23:59:59`
+ }
+ else {
+ listQuery.checkDateStart = ''
+ listQuery.checkDateEnd = ''
+ }
+})
// 重置
const reset = () => {
datetimerange.value = []
+ datetimerange1.value = []
listQuery.equipmentNo = ''
listQuery.equipmentName = ''
listQuery.usageStatus = ''
listQuery.usePosition = ''
listQuery.certificateValidEnd = ''
listQuery.certificateValidStart = ''
+ listQuery.model = ''
listQuery.deptIds = ''
+ listQuery.manufactureNo = ''
+ listQuery.companyId = ''
+ listQuery.directorName = ''
+ listQuery.useSign = ''
+ listQuery.installLocation = ''
+ listQuery.checkOrganization = ''
+ listQuery.checkDateStart = ''
+ listQuery.checkDateEnd = ''
+ listQuery.taskId = ''
+ listQuery.meterIdentify = ''
listQuery.offset = 1
listQuery.limit = 20
search()
@@ -392,6 +476,39 @@
const importList = () => {
fileRef.value.click()
}
+// 绑定参试任务
+const taskRef = ref()
+const bindTask = () => {
+ taskRef.value.initDialog()
+}
+// 确认绑定
+const bindIds = (ids: string[]) => {
+ console.log(ids, '参数任务ids')
+ // bindTaskHandler()
+ // 判断是 普通表格还是 聚合表格
+ if (tableFlage.value) {
+ // 普通表格
+ const data = {
+ equipmentIds: selectList.value.map(item => item.id),
+ taskIds: ids,
+ }
+ bindTaskHandler(data).then((res) => {
+ ElMessage.success('绑定成功')
+ fetchData()
+ })
+ }
+ else {
+ const data = {
+ equipmentNames: togetherTableRef.value.getSelectionRows().map((item: any) => item.equipmentName),
+ equipmentIds: expandTableRef.value.getSelectionRows().map((item: any) => item.id),
+ taskIds: ids,
+ }
+ bindTaskHandler(data).then((res) => {
+ ElMessage.success('绑定成功')
+ fetchTogetherData()
+ })
+ }
+}
// 详情
const detail = (row: IlistObjType) => {
if ($props.statusName === '草稿箱' || $props.statusName === '未通过' || $props.statusName === '已取消') {
@@ -507,8 +624,7 @@
const approveHandler = (row: any, type: string) => {
approvalDialogRef.value.initDialog(type, row.taskId, row.processId, row.id)
}
-// 切换表格标识 true:普通表格 false:聚合表格
-const tableFlage = ref(true)
+
const changeTable = () => {
tableFlage.value = !tableFlage.value
if (tableFlage.value) {
@@ -546,19 +662,25 @@
+
+
-
+
+
+
-
-
+
+
+
+
+
+
@@ -566,11 +688,50 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -580,6 +741,7 @@
+
@@ -660,7 +822,7 @@
-
+
>>>>>> 5e67c355ee24dc34e26bb2fdbb5214aa66e8f137
}
diff --git a/src/api/eqpt/device/info.ts b/src/api/eqpt/device/info.ts
index f2a9176..e40366c 100644
--- a/src/api/eqpt/device/info.ts
+++ b/src/api/eqpt/device/info.ts
@@ -153,3 +153,11 @@
method: 'get',
})
}
+// 绑定参试任务
+export function bindTaskHandler(data: object) {
+ return request({
+ url: '/equipment/bindTask',
+ method: 'post',
+ data,
+ })
+}
diff --git a/src/api/eqpt/device/model.ts b/src/api/eqpt/device/model.ts
index a8fa0f1..04da2af 100644
--- a/src/api/eqpt/device/model.ts
+++ b/src/api/eqpt/device/model.ts
@@ -20,11 +20,10 @@
})
}
// 设备名称列表/equipment/model/listEquipmentName
-export function getDeviceNameList(params: any) {
+export function getDeviceNameList() {
return request({
url: '/equipment/model/listEquipmentName',
method: 'get',
- params,
})
}
// 导出
@@ -33,6 +32,7 @@
url: '/equipment/model/export',
method: 'post',
data,
+ responseType: 'blob',
})
}
// 新建或编辑
diff --git a/src/api/eqpt/device/task.ts b/src/api/eqpt/device/task.ts
new file mode 100644
index 0000000..2a83db0
--- /dev/null
+++ b/src/api/eqpt/device/task.ts
@@ -0,0 +1,38 @@
+/**
+ * 参试任务管理相关
+ */
+import request from '@/api/index'
+
+// 列表
+export function getTaskList(params: any) {
+ return request({
+ url: `/equipment/task/listPage?limit=${params.limit}&offset=${params.offset}`,
+ method: 'post',
+ data: params,
+ })
+}
+// 新增
+export function addTask(params: any) {
+ return request({
+ url: '/equipment/task/add',
+ method: 'post',
+ data: params,
+ })
+}
+// 新增
+export function updateTask(params: any) {
+ return request({
+ url: '/equipment/task/update',
+ method: 'post',
+ data: params,
+ })
+}
+// 删除
+export function delTask(params: any) {
+ return request({
+ url: '/equipment/task/delete',
+ method: 'post',
+ data: params,
+ })
+}
+
diff --git a/src/api/system/expire.ts b/src/api/system/expire.ts
index 1365711..834048e 100644
--- a/src/api/system/expire.ts
+++ b/src/api/system/expire.ts
@@ -18,3 +18,18 @@
data,
})
}
+// 新建
+export function addRemind(data: object) {
+ return request({
+ url: '/system/remind/add',
+ method: 'post',
+ data,
+ })
+}
+// 删除
+export function delRemind(id: string) {
+ return request({
+ url: `/system/remind/remove?id=${id}`,
+ method: 'post',
+ })
+}
diff --git a/src/assets/icons/icon-task.svg b/src/assets/icons/icon-task.svg
new file mode 100644
index 0000000..213c7cd
--- /dev/null
+++ b/src/assets/icons/icon-task.svg
@@ -0,0 +1 @@
+
diff --git a/src/views/dashboard.vue b/src/views/dashboard.vue
index df43894..c88bb78 100644
--- a/src/views/dashboard.vue
+++ b/src/views/dashboard.vue
@@ -40,7 +40,6 @@
const token = userStore.token
const params = `?token=${token}`
console.log(system.url + params)
-
window.open(system.url + params)
// window.open(`http://127.0.0.1:9526${params}`)
}
diff --git a/src/views/system/expire/device.vue b/src/views/system/expire/device.vue
new file mode 100644
index 0000000..890d2ab
--- /dev/null
+++ b/src/views/system/expire/device.vue
@@ -0,0 +1,227 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/views/system/expire/edit.vue b/src/views/system/expire/edit.vue
index 72d45f9..a7a0ccf 100644
--- a/src/views/system/expire/edit.vue
+++ b/src/views/system/expire/edit.vue
@@ -3,45 +3,110 @@
import { nextTick, reactive } from 'vue'
import { ElMessage, ElMessageBox } from 'element-plus'
import type { FormInstance, FormRules } from 'element-plus'
-import { getList, updateRemind } from '@/api/system/expire'
+import dayjs from 'dayjs'
+import device from './device.vue'
+import task from './task.vue'
+import useUserStore from '@/store/modules/user'
+import { getUserDept } from '@/api/system/user'
+import { addRemind, getList, updateRemind } from '@/api/system/expire'
// ----------------------- 以下是字段定义 emits props ---------------------
const emits = defineEmits(['closeRefresh'])
const dialogVisible = ref(false)
+const dialogStatus = ref('新建')
+const userStore = useUserStore()
const data = ref({
- createDeptId: 0,
+ createDeptId: '',
createDeptName: '',
createTime: '',
createUserId: '',
createUserName: '',
id: '',
remindName: '',
- remindTime: 0,
+ remindTime: 30,
updateTime: '',
+ remindType: '1',
+ taskIds: [] as string[],
+ taskNames: [] as string[],
+ equipmentNames: [] as string[],
+ modelIds: [] as string[],
+ equipmentExt: [] as string[],
+ taskExt: [] as string[],
+
})
+const resetForm = () => {
+ for (const i in data.value) {
+ data.value[i] = ''
+ }
+ data.value.remindTime = 30
+ data.value.remindType = '1'
+ data.value.taskIds = [] as string[]
+ data.value.taskNames = [] as string[]
+ data.value.equipmentNames = [] as string[]
+ data.value.modelIds = [] as string[]
+ data.value.equipmentExt = [] as string[]
+ data.value.taskExt = [] as string[]
+}
// ---------------表单提交--------------------------------
// 表单对象
const dataFormRef = ref()
-
+const rules = ref({
+ remindName: [{ required: true, message: '提醒名称必填', trigger: ['blur', 'change'] }],
+ remindType: [{ required: true, message: '到期提醒类型必选', trigger: ['blur', 'change'] }],
+ modelIds: [{ required: true, message: '设备必选', trigger: ['blur', 'change'] }],
+ taskIds: [{ required: true, message: '任务必选', trigger: ['blur', 'change'] }],
+ remindTime: [{ required: true, message: '提醒时间必选', trigger: ['blur', 'change'] }],
+}) // 表单验证规则
// 表单提交
function submitForm() {
if (dataFormRef) {
dataFormRef.value?.validate((valid: boolean) => {
if (valid) {
- updateRemind(data.value).then((res) => {
- ElMessage.success('修改成功')
- dialogVisible.value = false
- emits('closeRefresh')
- })
+ if (dialogStatus.value === '新建') {
+ addRemind(data.value).then((res) => {
+ ElMessage.success('修改成功')
+ dialogVisible.value = false
+ emits('closeRefresh')
+ })
+ }
+ else {
+ updateRemind(data.value).then((res) => {
+ ElMessage.success('修改成功')
+ dialogVisible.value = false
+ emits('closeRefresh')
+ })
+ }
}
})
}
}
// ----------初始化、关闭对话框相关-----------------
-function initDialog(row: any) {
+function initDialog(row: any, status: string) {
dialogVisible.value = true
- data.value = row
+ resetForm()
+ if (status === 'create') {
+ dialogStatus.value = '新建'
+ nextTick(() => {
+ dataFormRef.value?.resetFields()
+ })
+
+ data.value.createTime = dayjs().format('YYYY-MM-DD HH:mm:ss') // 创建时间
+ data.value.createUserId = userStore.id
+ data.value.createUserName = userStore.name
+ // 获取当前用户所在单位
+ getUserDept().then((res) => {
+ // fullName
+ data.value.createDeptId = res.data.id
+ data.value.createDeptName = res.data.fullName
+ })
+ }
+ else {
+ data.value = JSON.parse(JSON.stringify(row))
+ dialogStatus.value = '编辑'
+ data.value.equipmentExt = JSON.parse(row.equipmentExt)
+ data.value.taskExt = JSON.parse(row.taskExt)
+ }
}
// 关闭并刷新
@@ -55,30 +120,133 @@
}
// ----------------------- 以下是暴露的方法内容 ----------------------------
defineExpose({ initDialog })
+
+// 选择设备
+const deviceRef = ref()
+const selectDevice = () => {
+ deviceRef.value.initDialog()
+}
+// 确认设备
+const confirmDevice = (list: any[]) => {
+ list.forEach((item: any) => {
+ if (!data.value.modelIds.includes(item.id)) {
+ data.value.equipmentExt.push(`${item.equipmentName}/${item.model}/${item.helpInstruction}`)
+ data.value.modelIds.push(item.id)
+ }
+ })
+}
+const removeDeviceStr = ref()
+const removeDevice = (device: string) => {
+ removeDeviceStr.value = device
+}
+watch(() => data.value.equipmentExt, (newVal, oldVal) => {
+ if (newVal && oldVal) {
+ if (newVal.length < oldVal.length) {
+ const index = oldVal.indexOf(removeDeviceStr.value)
+ data.value.modelIds = data.value.modelIds.filter((item, cindex) => cindex !== index)
+ }
+ }
+}, {
+ deep: true,
+})
+// 选择任务
+const taskRef = ref()
+const selectTask = () => {
+ taskRef.value.initDialog()
+}
+// 确认设备
+const confirmTask = (list: any[]) => {
+ list.forEach((item: any) => {
+ if (!data.value.taskIds.includes(item.id)) {
+ data.value.taskExt.push(`${item.taskName}/${item.createTime}`)
+ data.value.taskIds.push(item.id)
+ }
+ })
+}
+const removeTaskStr = ref()
+const removeTask = (task: string) => {
+ removeTaskStr.value = task
+}
+watch(() => data.value.taskExt, (newVal, oldVal) => {
+ if (newVal && oldVal) {
+ if (newVal.length < oldVal.length) {
+ const index = oldVal.indexOf(removeTaskStr.value)
+ data.value.taskIds = data.value.taskIds.filter((item, cindex) => cindex !== index)
+ }
+ }
+}, {
+ deep: true,
+})
+
+
+
-
-
+
+
-
+
+
+
+ 设备到期提醒
+
+
+ 任务到期提醒
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -98,6 +266,16 @@
diff --git a/src/views/tested/device/info/components/interface.ts b/src/views/tested/device/info/components/interface.ts
index fbb1f51..73bfbf4 100644
--- a/src/views/tested/device/info/components/interface.ts
+++ b/src/views/tested/device/info/components/interface.ts
@@ -12,6 +12,17 @@
limit: number
approvalStatus?: string
formId?: string
+ model: string
+ manufactureNo: string
+ companyId: string
+ directorName: string
+ useSign: string
+ installLocation: string
+ taskId: string
+ checkOrganization: string
+ meterIdentify: string
+ checkDateStart: string
+ checkDateEnd: string
}
// 设备信息对象
export interface IlistObjType {
diff --git a/src/views/tested/device/info/components/list.vue b/src/views/tested/device/info/components/list.vue
index db05d4d..d42a797 100644
--- a/src/views/tested/device/info/components/list.vue
+++ b/src/views/tested/device/info/components/list.vue
@@ -5,11 +5,14 @@
import type { IlistObjType, IlistQueryType } from './interface'
import { delTextBtn, editTextBtn } from '@/utils/applyBtns'
import ApprovalDialog from '@/components/Approval/ApprovalDialog.vue'
-import { cancelInfo, deleteInfo, editInfo, exportDevice, getInfoList, getInfoListPage, getInfoListTogether, importDevice, submitInfo } from '@/api/eqpt/device/info'
+import { bindTaskHandler, cancelInfo, deleteInfo, editInfo, exportDevice, getInfoList, getInfoListPage, getInfoListTogether, importDevice, submitInfo } from '@/api/eqpt/device/info'
import { getDictByCode } from '@/api/system/dict'
import { SCHEDULE } from '@/utils/scheduleDict'
import useTemplateDownload from '@/utils/useTemplateDownload'
import { exportFile } from '@/utils/exportUtils'
+import { getDeviceNameList, getModelAllList, getModelList } from '@/api/eqpt/device/model'
+import { getTaskList } from '@/api/eqpt/device/task'
+import task from '@/views/tested/device/task/index.vue'
const $props = defineProps({
statusName: {
type: String,
@@ -44,6 +47,17 @@
limit: 20,
approvalStatus: '',
formId: SCHEDULE.DEVICE_INFO_APPROVAL,
+ model: '', // 规格型号
+ manufactureNo: '', // 出厂编号
+ companyId: '', // 所在单位
+ directorName: '', // 负责人
+ useSign: '', // 再用信息
+ installLocation: '', // 安装位置
+ taskId: '', // 参试任务
+ checkOrganization: '', // 检定机构
+ meterIdentify: '', // 计量标识
+ checkDateEnd: '',
+ checkDateStart: '',
})
const columns = ref([
{
@@ -137,6 +151,8 @@
console.log('倒叙')
}
}
+// 切换表格标识 true:普通表格 false:聚合表格
+const tableFlage = ref(true)
// 聚合表格实例
const togetherTableRef = ref()
// 展开表格实例
@@ -164,12 +180,57 @@
}
// 获取使用状态列表
const useStatusList = ref()
+// 设备名称
+const deviceNameList = ref<{ id: string; value: string; name: string }[]>([])
+// 设备分类
+const deviceTypeList = ref<{ id: string; value: string; name: string }[]>([])
+// 再用信息
+const useSignList = ref<{ id: string; value: string; name: string }[]>([])
+// 任务列表
+const taskList = ref<{ id: string; value: string; name: string }[]>([])
+// 计量标识
+const meterIdentifyList = ref<{ id: string; value: string; name: string }[]>()
+// 规格型号
+const modelList = ref([])
+const allList = ref([])
const fetchUseStatus = () => {
getDictByCode('eqptDeviceUseStatus').then((res) => {
useStatusList.value = res.data
})
+ getDictByCode('eqptDeviceInUse').then((res) => {
+ useSignList.value = res.data
+ })
+ // 设备分类
+ getDictByCode('eqptDeviceType').then((res) => {
+ deviceTypeList.value = res.data
+ })
+ // 设备名称
+ getDeviceNameList().then((res) => {
+ deviceNameList.value = res.data
+ })
+ // 规格型号
+ getModelAllList({}).then((res) => {
+ allList.value = res.data
+ modelList.value = res.data
+ })
+ // 参试任务
+ getTaskList({ limit: 9999, offset: 1 }).then((res) => {
+ taskList.value = res.data.rows.map((item: any) => ({ name: item.taskName, value: item.id, id: item.id }))
+ })
+ getDictByCode('eqptMeterIdentify').then((res) => {
+ meterIdentifyList.value = res.data
+ })
}
fetchUseStatus()
+// 监听设备名称下拉框,修改规格型号和辅助字段
+watch(() => listQuery.equipmentName, (newVal) => {
+ if (newVal) {
+ listQuery.model = ''
+ // 修改规格型号和辅助字段列表
+ const data = allList.value.filter(item => item.equipmentName === newVal)
+ modelList.value = data
+ }
+})
// 查询数据
const search = () => {
fetchData(false)
@@ -186,16 +247,39 @@
listQuery.certificateValidEnd = ''
}
})
+const datetimerange1 = ref()
+watch(() => datetimerange1.value, (newVal) => {
+ if (newVal.length) {
+ listQuery.checkDateStart = `${newVal[0]} 00:00:00`
+ listQuery.checkDateEnd = `${newVal[1]} 23:59:59`
+ }
+ else {
+ listQuery.checkDateStart = ''
+ listQuery.checkDateEnd = ''
+ }
+})
// 重置
const reset = () => {
datetimerange.value = []
+ datetimerange1.value = []
listQuery.equipmentNo = ''
listQuery.equipmentName = ''
listQuery.usageStatus = ''
listQuery.usePosition = ''
listQuery.certificateValidEnd = ''
listQuery.certificateValidStart = ''
+ listQuery.model = ''
listQuery.deptIds = ''
+ listQuery.manufactureNo = ''
+ listQuery.companyId = ''
+ listQuery.directorName = ''
+ listQuery.useSign = ''
+ listQuery.installLocation = ''
+ listQuery.checkOrganization = ''
+ listQuery.checkDateStart = ''
+ listQuery.checkDateEnd = ''
+ listQuery.taskId = ''
+ listQuery.meterIdentify = ''
listQuery.offset = 1
listQuery.limit = 20
search()
@@ -392,6 +476,39 @@
const importList = () => {
fileRef.value.click()
}
+// 绑定参试任务
+const taskRef = ref()
+const bindTask = () => {
+ taskRef.value.initDialog()
+}
+// 确认绑定
+const bindIds = (ids: string[]) => {
+ console.log(ids, '参数任务ids')
+ // bindTaskHandler()
+ // 判断是 普通表格还是 聚合表格
+ if (tableFlage.value) {
+ // 普通表格
+ const data = {
+ equipmentIds: selectList.value.map(item => item.id),
+ taskIds: ids,
+ }
+ bindTaskHandler(data).then((res) => {
+ ElMessage.success('绑定成功')
+ fetchData()
+ })
+ }
+ else {
+ const data = {
+ equipmentNames: togetherTableRef.value.getSelectionRows().map((item: any) => item.equipmentName),
+ equipmentIds: expandTableRef.value.getSelectionRows().map((item: any) => item.id),
+ taskIds: ids,
+ }
+ bindTaskHandler(data).then((res) => {
+ ElMessage.success('绑定成功')
+ fetchTogetherData()
+ })
+ }
+}
// 详情
const detail = (row: IlistObjType) => {
if ($props.statusName === '草稿箱' || $props.statusName === '未通过' || $props.statusName === '已取消') {
@@ -507,8 +624,7 @@
const approveHandler = (row: any, type: string) => {
approvalDialogRef.value.initDialog(type, row.taskId, row.processId, row.id)
}
-// 切换表格标识 true:普通表格 false:聚合表格
-const tableFlage = ref(true)
+
const changeTable = () => {
tableFlage.value = !tableFlage.value
if (tableFlage.value) {
@@ -546,19 +662,25 @@
+
+
-
+
+
+
-
-
+
+
+
+
+
+
@@ -566,11 +688,50 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -580,6 +741,7 @@
+
@@ -660,7 +822,7 @@
-
+
{
ruleForm.value = data
+ console.log(ruleForm.value, 'ruleForm.value')
// })
}
}
@@ -203,7 +204,7 @@
-
+
diff --git a/.env.development b/.env.development
index f2fee42..19ebebf 100644
--- a/.env.development
+++ b/.env.development
@@ -4,7 +4,7 @@
# 接口请求地址,会设置到 axios 的 baseURL 参数上
# VITE_APP_API_BASEURL = http://139.198.29.133:8089
# VITE_APP_API_BASEURL = http://111.198.10.15:21611
-VITE_APP_API_BASEURL = http://192.168.8.101:5909
+VITE_APP_API_BASEURL = http://192.168.8.100:5909
# VITE_APP_API_BASEURL = http://111.198.10.15:21611
# VITE_APP_API_BASEURL = http://192.168.8.107:5909
# VITE_APP_API_BASEURL = http://111.198.10.15:21710
diff --git a/.env.production b/.env.production
index 7595683..36e6ad3 100644
--- a/.env.production
+++ b/.env.production
@@ -4,7 +4,7 @@
VITE_APP_TITLE = 计量信息系统
VITE_SYS_TITLE = 受检设备管理系统
# 接口请求地址,会设置到 axios 的 baseURL 参数上
-VITE_APP_API_BASEURL = http://127.0.0.1:5909
+VITE_APP_API_BASEURL = http://111.198.10.15:21611
# 调试工具,可设置 eruda 或 vconsole,如果不需要开启则留空
VITE_APP_DEBUG_TOOL =
diff --git a/public/config/config.json b/public/config/config.json
index 3bd0a89..169f1f6 100644
--- a/public/config/config.json
+++ b/public/config/config.json
@@ -1,4 +1,8 @@
{
"title":"计量业务系统",
+<<<<<<< HEAD
"baseUrl": "http://111.198.10.15:21611"
+=======
+ "baseUrl": "http://192.168.8.100:5909"
+>>>>>>> 5e67c355ee24dc34e26bb2fdbb5214aa66e8f137
}
diff --git a/src/api/eqpt/device/info.ts b/src/api/eqpt/device/info.ts
index f2a9176..e40366c 100644
--- a/src/api/eqpt/device/info.ts
+++ b/src/api/eqpt/device/info.ts
@@ -153,3 +153,11 @@
method: 'get',
})
}
+// 绑定参试任务
+export function bindTaskHandler(data: object) {
+ return request({
+ url: '/equipment/bindTask',
+ method: 'post',
+ data,
+ })
+}
diff --git a/src/api/eqpt/device/model.ts b/src/api/eqpt/device/model.ts
index a8fa0f1..04da2af 100644
--- a/src/api/eqpt/device/model.ts
+++ b/src/api/eqpt/device/model.ts
@@ -20,11 +20,10 @@
})
}
// 设备名称列表/equipment/model/listEquipmentName
-export function getDeviceNameList(params: any) {
+export function getDeviceNameList() {
return request({
url: '/equipment/model/listEquipmentName',
method: 'get',
- params,
})
}
// 导出
@@ -33,6 +32,7 @@
url: '/equipment/model/export',
method: 'post',
data,
+ responseType: 'blob',
})
}
// 新建或编辑
diff --git a/src/api/eqpt/device/task.ts b/src/api/eqpt/device/task.ts
new file mode 100644
index 0000000..2a83db0
--- /dev/null
+++ b/src/api/eqpt/device/task.ts
@@ -0,0 +1,38 @@
+/**
+ * 参试任务管理相关
+ */
+import request from '@/api/index'
+
+// 列表
+export function getTaskList(params: any) {
+ return request({
+ url: `/equipment/task/listPage?limit=${params.limit}&offset=${params.offset}`,
+ method: 'post',
+ data: params,
+ })
+}
+// 新增
+export function addTask(params: any) {
+ return request({
+ url: '/equipment/task/add',
+ method: 'post',
+ data: params,
+ })
+}
+// 新增
+export function updateTask(params: any) {
+ return request({
+ url: '/equipment/task/update',
+ method: 'post',
+ data: params,
+ })
+}
+// 删除
+export function delTask(params: any) {
+ return request({
+ url: '/equipment/task/delete',
+ method: 'post',
+ data: params,
+ })
+}
+
diff --git a/src/api/system/expire.ts b/src/api/system/expire.ts
index 1365711..834048e 100644
--- a/src/api/system/expire.ts
+++ b/src/api/system/expire.ts
@@ -18,3 +18,18 @@
data,
})
}
+// 新建
+export function addRemind(data: object) {
+ return request({
+ url: '/system/remind/add',
+ method: 'post',
+ data,
+ })
+}
+// 删除
+export function delRemind(id: string) {
+ return request({
+ url: `/system/remind/remove?id=${id}`,
+ method: 'post',
+ })
+}
diff --git a/src/assets/icons/icon-task.svg b/src/assets/icons/icon-task.svg
new file mode 100644
index 0000000..213c7cd
--- /dev/null
+++ b/src/assets/icons/icon-task.svg
@@ -0,0 +1 @@
+
diff --git a/src/views/dashboard.vue b/src/views/dashboard.vue
index df43894..c88bb78 100644
--- a/src/views/dashboard.vue
+++ b/src/views/dashboard.vue
@@ -40,7 +40,6 @@
const token = userStore.token
const params = `?token=${token}`
console.log(system.url + params)
-
window.open(system.url + params)
// window.open(`http://127.0.0.1:9526${params}`)
}
diff --git a/src/views/system/expire/device.vue b/src/views/system/expire/device.vue
new file mode 100644
index 0000000..890d2ab
--- /dev/null
+++ b/src/views/system/expire/device.vue
@@ -0,0 +1,227 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/views/system/expire/edit.vue b/src/views/system/expire/edit.vue
index 72d45f9..a7a0ccf 100644
--- a/src/views/system/expire/edit.vue
+++ b/src/views/system/expire/edit.vue
@@ -3,45 +3,110 @@
import { nextTick, reactive } from 'vue'
import { ElMessage, ElMessageBox } from 'element-plus'
import type { FormInstance, FormRules } from 'element-plus'
-import { getList, updateRemind } from '@/api/system/expire'
+import dayjs from 'dayjs'
+import device from './device.vue'
+import task from './task.vue'
+import useUserStore from '@/store/modules/user'
+import { getUserDept } from '@/api/system/user'
+import { addRemind, getList, updateRemind } from '@/api/system/expire'
// ----------------------- 以下是字段定义 emits props ---------------------
const emits = defineEmits(['closeRefresh'])
const dialogVisible = ref(false)
+const dialogStatus = ref('新建')
+const userStore = useUserStore()
const data = ref({
- createDeptId: 0,
+ createDeptId: '',
createDeptName: '',
createTime: '',
createUserId: '',
createUserName: '',
id: '',
remindName: '',
- remindTime: 0,
+ remindTime: 30,
updateTime: '',
+ remindType: '1',
+ taskIds: [] as string[],
+ taskNames: [] as string[],
+ equipmentNames: [] as string[],
+ modelIds: [] as string[],
+ equipmentExt: [] as string[],
+ taskExt: [] as string[],
+
})
+const resetForm = () => {
+ for (const i in data.value) {
+ data.value[i] = ''
+ }
+ data.value.remindTime = 30
+ data.value.remindType = '1'
+ data.value.taskIds = [] as string[]
+ data.value.taskNames = [] as string[]
+ data.value.equipmentNames = [] as string[]
+ data.value.modelIds = [] as string[]
+ data.value.equipmentExt = [] as string[]
+ data.value.taskExt = [] as string[]
+}
// ---------------表单提交--------------------------------
// 表单对象
const dataFormRef = ref()
-
+const rules = ref({
+ remindName: [{ required: true, message: '提醒名称必填', trigger: ['blur', 'change'] }],
+ remindType: [{ required: true, message: '到期提醒类型必选', trigger: ['blur', 'change'] }],
+ modelIds: [{ required: true, message: '设备必选', trigger: ['blur', 'change'] }],
+ taskIds: [{ required: true, message: '任务必选', trigger: ['blur', 'change'] }],
+ remindTime: [{ required: true, message: '提醒时间必选', trigger: ['blur', 'change'] }],
+}) // 表单验证规则
// 表单提交
function submitForm() {
if (dataFormRef) {
dataFormRef.value?.validate((valid: boolean) => {
if (valid) {
- updateRemind(data.value).then((res) => {
- ElMessage.success('修改成功')
- dialogVisible.value = false
- emits('closeRefresh')
- })
+ if (dialogStatus.value === '新建') {
+ addRemind(data.value).then((res) => {
+ ElMessage.success('修改成功')
+ dialogVisible.value = false
+ emits('closeRefresh')
+ })
+ }
+ else {
+ updateRemind(data.value).then((res) => {
+ ElMessage.success('修改成功')
+ dialogVisible.value = false
+ emits('closeRefresh')
+ })
+ }
}
})
}
}
// ----------初始化、关闭对话框相关-----------------
-function initDialog(row: any) {
+function initDialog(row: any, status: string) {
dialogVisible.value = true
- data.value = row
+ resetForm()
+ if (status === 'create') {
+ dialogStatus.value = '新建'
+ nextTick(() => {
+ dataFormRef.value?.resetFields()
+ })
+
+ data.value.createTime = dayjs().format('YYYY-MM-DD HH:mm:ss') // 创建时间
+ data.value.createUserId = userStore.id
+ data.value.createUserName = userStore.name
+ // 获取当前用户所在单位
+ getUserDept().then((res) => {
+ // fullName
+ data.value.createDeptId = res.data.id
+ data.value.createDeptName = res.data.fullName
+ })
+ }
+ else {
+ data.value = JSON.parse(JSON.stringify(row))
+ dialogStatus.value = '编辑'
+ data.value.equipmentExt = JSON.parse(row.equipmentExt)
+ data.value.taskExt = JSON.parse(row.taskExt)
+ }
}
// 关闭并刷新
@@ -55,30 +120,133 @@
}
// ----------------------- 以下是暴露的方法内容 ----------------------------
defineExpose({ initDialog })
+
+// 选择设备
+const deviceRef = ref()
+const selectDevice = () => {
+ deviceRef.value.initDialog()
+}
+// 确认设备
+const confirmDevice = (list: any[]) => {
+ list.forEach((item: any) => {
+ if (!data.value.modelIds.includes(item.id)) {
+ data.value.equipmentExt.push(`${item.equipmentName}/${item.model}/${item.helpInstruction}`)
+ data.value.modelIds.push(item.id)
+ }
+ })
+}
+const removeDeviceStr = ref()
+const removeDevice = (device: string) => {
+ removeDeviceStr.value = device
+}
+watch(() => data.value.equipmentExt, (newVal, oldVal) => {
+ if (newVal && oldVal) {
+ if (newVal.length < oldVal.length) {
+ const index = oldVal.indexOf(removeDeviceStr.value)
+ data.value.modelIds = data.value.modelIds.filter((item, cindex) => cindex !== index)
+ }
+ }
+}, {
+ deep: true,
+})
+// 选择任务
+const taskRef = ref()
+const selectTask = () => {
+ taskRef.value.initDialog()
+}
+// 确认设备
+const confirmTask = (list: any[]) => {
+ list.forEach((item: any) => {
+ if (!data.value.taskIds.includes(item.id)) {
+ data.value.taskExt.push(`${item.taskName}/${item.createTime}`)
+ data.value.taskIds.push(item.id)
+ }
+ })
+}
+const removeTaskStr = ref()
+const removeTask = (task: string) => {
+ removeTaskStr.value = task
+}
+watch(() => data.value.taskExt, (newVal, oldVal) => {
+ if (newVal && oldVal) {
+ if (newVal.length < oldVal.length) {
+ const index = oldVal.indexOf(removeTaskStr.value)
+ data.value.taskIds = data.value.taskIds.filter((item, cindex) => cindex !== index)
+ }
+ }
+}, {
+ deep: true,
+})
+
+
+
-
-
+
+
-
+
+
+
+ 设备到期提醒
+
+
+ 任务到期提醒
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -98,6 +266,16 @@
diff --git a/src/views/tested/device/info/components/interface.ts b/src/views/tested/device/info/components/interface.ts
index fbb1f51..73bfbf4 100644
--- a/src/views/tested/device/info/components/interface.ts
+++ b/src/views/tested/device/info/components/interface.ts
@@ -12,6 +12,17 @@
limit: number
approvalStatus?: string
formId?: string
+ model: string
+ manufactureNo: string
+ companyId: string
+ directorName: string
+ useSign: string
+ installLocation: string
+ taskId: string
+ checkOrganization: string
+ meterIdentify: string
+ checkDateStart: string
+ checkDateEnd: string
}
// 设备信息对象
export interface IlistObjType {
diff --git a/src/views/tested/device/info/components/list.vue b/src/views/tested/device/info/components/list.vue
index db05d4d..d42a797 100644
--- a/src/views/tested/device/info/components/list.vue
+++ b/src/views/tested/device/info/components/list.vue
@@ -5,11 +5,14 @@
import type { IlistObjType, IlistQueryType } from './interface'
import { delTextBtn, editTextBtn } from '@/utils/applyBtns'
import ApprovalDialog from '@/components/Approval/ApprovalDialog.vue'
-import { cancelInfo, deleteInfo, editInfo, exportDevice, getInfoList, getInfoListPage, getInfoListTogether, importDevice, submitInfo } from '@/api/eqpt/device/info'
+import { bindTaskHandler, cancelInfo, deleteInfo, editInfo, exportDevice, getInfoList, getInfoListPage, getInfoListTogether, importDevice, submitInfo } from '@/api/eqpt/device/info'
import { getDictByCode } from '@/api/system/dict'
import { SCHEDULE } from '@/utils/scheduleDict'
import useTemplateDownload from '@/utils/useTemplateDownload'
import { exportFile } from '@/utils/exportUtils'
+import { getDeviceNameList, getModelAllList, getModelList } from '@/api/eqpt/device/model'
+import { getTaskList } from '@/api/eqpt/device/task'
+import task from '@/views/tested/device/task/index.vue'
const $props = defineProps({
statusName: {
type: String,
@@ -44,6 +47,17 @@
limit: 20,
approvalStatus: '',
formId: SCHEDULE.DEVICE_INFO_APPROVAL,
+ model: '', // 规格型号
+ manufactureNo: '', // 出厂编号
+ companyId: '', // 所在单位
+ directorName: '', // 负责人
+ useSign: '', // 再用信息
+ installLocation: '', // 安装位置
+ taskId: '', // 参试任务
+ checkOrganization: '', // 检定机构
+ meterIdentify: '', // 计量标识
+ checkDateEnd: '',
+ checkDateStart: '',
})
const columns = ref([
{
@@ -137,6 +151,8 @@
console.log('倒叙')
}
}
+// 切换表格标识 true:普通表格 false:聚合表格
+const tableFlage = ref(true)
// 聚合表格实例
const togetherTableRef = ref()
// 展开表格实例
@@ -164,12 +180,57 @@
}
// 获取使用状态列表
const useStatusList = ref()
+// 设备名称
+const deviceNameList = ref<{ id: string; value: string; name: string }[]>([])
+// 设备分类
+const deviceTypeList = ref<{ id: string; value: string; name: string }[]>([])
+// 再用信息
+const useSignList = ref<{ id: string; value: string; name: string }[]>([])
+// 任务列表
+const taskList = ref<{ id: string; value: string; name: string }[]>([])
+// 计量标识
+const meterIdentifyList = ref<{ id: string; value: string; name: string }[]>()
+// 规格型号
+const modelList = ref([])
+const allList = ref([])
const fetchUseStatus = () => {
getDictByCode('eqptDeviceUseStatus').then((res) => {
useStatusList.value = res.data
})
+ getDictByCode('eqptDeviceInUse').then((res) => {
+ useSignList.value = res.data
+ })
+ // 设备分类
+ getDictByCode('eqptDeviceType').then((res) => {
+ deviceTypeList.value = res.data
+ })
+ // 设备名称
+ getDeviceNameList().then((res) => {
+ deviceNameList.value = res.data
+ })
+ // 规格型号
+ getModelAllList({}).then((res) => {
+ allList.value = res.data
+ modelList.value = res.data
+ })
+ // 参试任务
+ getTaskList({ limit: 9999, offset: 1 }).then((res) => {
+ taskList.value = res.data.rows.map((item: any) => ({ name: item.taskName, value: item.id, id: item.id }))
+ })
+ getDictByCode('eqptMeterIdentify').then((res) => {
+ meterIdentifyList.value = res.data
+ })
}
fetchUseStatus()
+// 监听设备名称下拉框,修改规格型号和辅助字段
+watch(() => listQuery.equipmentName, (newVal) => {
+ if (newVal) {
+ listQuery.model = ''
+ // 修改规格型号和辅助字段列表
+ const data = allList.value.filter(item => item.equipmentName === newVal)
+ modelList.value = data
+ }
+})
// 查询数据
const search = () => {
fetchData(false)
@@ -186,16 +247,39 @@
listQuery.certificateValidEnd = ''
}
})
+const datetimerange1 = ref()
+watch(() => datetimerange1.value, (newVal) => {
+ if (newVal.length) {
+ listQuery.checkDateStart = `${newVal[0]} 00:00:00`
+ listQuery.checkDateEnd = `${newVal[1]} 23:59:59`
+ }
+ else {
+ listQuery.checkDateStart = ''
+ listQuery.checkDateEnd = ''
+ }
+})
// 重置
const reset = () => {
datetimerange.value = []
+ datetimerange1.value = []
listQuery.equipmentNo = ''
listQuery.equipmentName = ''
listQuery.usageStatus = ''
listQuery.usePosition = ''
listQuery.certificateValidEnd = ''
listQuery.certificateValidStart = ''
+ listQuery.model = ''
listQuery.deptIds = ''
+ listQuery.manufactureNo = ''
+ listQuery.companyId = ''
+ listQuery.directorName = ''
+ listQuery.useSign = ''
+ listQuery.installLocation = ''
+ listQuery.checkOrganization = ''
+ listQuery.checkDateStart = ''
+ listQuery.checkDateEnd = ''
+ listQuery.taskId = ''
+ listQuery.meterIdentify = ''
listQuery.offset = 1
listQuery.limit = 20
search()
@@ -392,6 +476,39 @@
const importList = () => {
fileRef.value.click()
}
+// 绑定参试任务
+const taskRef = ref()
+const bindTask = () => {
+ taskRef.value.initDialog()
+}
+// 确认绑定
+const bindIds = (ids: string[]) => {
+ console.log(ids, '参数任务ids')
+ // bindTaskHandler()
+ // 判断是 普通表格还是 聚合表格
+ if (tableFlage.value) {
+ // 普通表格
+ const data = {
+ equipmentIds: selectList.value.map(item => item.id),
+ taskIds: ids,
+ }
+ bindTaskHandler(data).then((res) => {
+ ElMessage.success('绑定成功')
+ fetchData()
+ })
+ }
+ else {
+ const data = {
+ equipmentNames: togetherTableRef.value.getSelectionRows().map((item: any) => item.equipmentName),
+ equipmentIds: expandTableRef.value.getSelectionRows().map((item: any) => item.id),
+ taskIds: ids,
+ }
+ bindTaskHandler(data).then((res) => {
+ ElMessage.success('绑定成功')
+ fetchTogetherData()
+ })
+ }
+}
// 详情
const detail = (row: IlistObjType) => {
if ($props.statusName === '草稿箱' || $props.statusName === '未通过' || $props.statusName === '已取消') {
@@ -507,8 +624,7 @@
const approveHandler = (row: any, type: string) => {
approvalDialogRef.value.initDialog(type, row.taskId, row.processId, row.id)
}
-// 切换表格标识 true:普通表格 false:聚合表格
-const tableFlage = ref(true)
+
const changeTable = () => {
tableFlage.value = !tableFlage.value
if (tableFlage.value) {
@@ -546,19 +662,25 @@
+
+
-
+
+
+
-
-
+
+
+
+
+
+
@@ -566,11 +688,50 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -580,6 +741,7 @@
+
@@ -660,7 +822,7 @@
-
+
{
ruleForm.value = data
+ console.log(ruleForm.value, 'ruleForm.value')
// })
}
}
@@ -203,7 +204,7 @@
-
+
diff --git a/src/views/tested/device/model/components/list.vue b/src/views/tested/device/model/components/list.vue
index 60a0a42..45b613e 100644
--- a/src/views/tested/device/model/components/list.vue
+++ b/src/views/tested/device/model/components/list.vue
@@ -149,7 +149,7 @@
ids: selectList.value.map(item => item.id),
}
exportModelList(data).then((res) => {
- exportFile('设备规格型号')
+ exportFile(res.data, '设备规格型号')
loading.close()
})
.catch((_) => {
@@ -162,7 +162,7 @@
}
// 获取下拉列表相关
// 设备名称
-const deviceNameList = ref<{ id: string; value: string; name: string }[]>([])
+const deviceNameList = ref([])
// 设备分类
const deviceTypeList = ref<{ id: string; value: string; name: string }[]>([])
// 规格型号
@@ -183,7 +183,7 @@
getModelAllList({}).then((res) => {
allList.value = res.data
modelList.value = res.data
- helpList.value = res.data.filter(item => item.helpInstruction)
+ helpList.value = res.data.filter((item: any) => item.helpInstruction)
})
}
fetchSelect()
diff --git a/.env.development b/.env.development
index f2fee42..19ebebf 100644
--- a/.env.development
+++ b/.env.development
@@ -4,7 +4,7 @@
# 接口请求地址,会设置到 axios 的 baseURL 参数上
# VITE_APP_API_BASEURL = http://139.198.29.133:8089
# VITE_APP_API_BASEURL = http://111.198.10.15:21611
-VITE_APP_API_BASEURL = http://192.168.8.101:5909
+VITE_APP_API_BASEURL = http://192.168.8.100:5909
# VITE_APP_API_BASEURL = http://111.198.10.15:21611
# VITE_APP_API_BASEURL = http://192.168.8.107:5909
# VITE_APP_API_BASEURL = http://111.198.10.15:21710
diff --git a/.env.production b/.env.production
index 7595683..36e6ad3 100644
--- a/.env.production
+++ b/.env.production
@@ -4,7 +4,7 @@
VITE_APP_TITLE = 计量信息系统
VITE_SYS_TITLE = 受检设备管理系统
# 接口请求地址,会设置到 axios 的 baseURL 参数上
-VITE_APP_API_BASEURL = http://127.0.0.1:5909
+VITE_APP_API_BASEURL = http://111.198.10.15:21611
# 调试工具,可设置 eruda 或 vconsole,如果不需要开启则留空
VITE_APP_DEBUG_TOOL =
diff --git a/public/config/config.json b/public/config/config.json
index 3bd0a89..169f1f6 100644
--- a/public/config/config.json
+++ b/public/config/config.json
@@ -1,4 +1,8 @@
{
"title":"计量业务系统",
+<<<<<<< HEAD
"baseUrl": "http://111.198.10.15:21611"
+=======
+ "baseUrl": "http://192.168.8.100:5909"
+>>>>>>> 5e67c355ee24dc34e26bb2fdbb5214aa66e8f137
}
diff --git a/src/api/eqpt/device/info.ts b/src/api/eqpt/device/info.ts
index f2a9176..e40366c 100644
--- a/src/api/eqpt/device/info.ts
+++ b/src/api/eqpt/device/info.ts
@@ -153,3 +153,11 @@
method: 'get',
})
}
+// 绑定参试任务
+export function bindTaskHandler(data: object) {
+ return request({
+ url: '/equipment/bindTask',
+ method: 'post',
+ data,
+ })
+}
diff --git a/src/api/eqpt/device/model.ts b/src/api/eqpt/device/model.ts
index a8fa0f1..04da2af 100644
--- a/src/api/eqpt/device/model.ts
+++ b/src/api/eqpt/device/model.ts
@@ -20,11 +20,10 @@
})
}
// 设备名称列表/equipment/model/listEquipmentName
-export function getDeviceNameList(params: any) {
+export function getDeviceNameList() {
return request({
url: '/equipment/model/listEquipmentName',
method: 'get',
- params,
})
}
// 导出
@@ -33,6 +32,7 @@
url: '/equipment/model/export',
method: 'post',
data,
+ responseType: 'blob',
})
}
// 新建或编辑
diff --git a/src/api/eqpt/device/task.ts b/src/api/eqpt/device/task.ts
new file mode 100644
index 0000000..2a83db0
--- /dev/null
+++ b/src/api/eqpt/device/task.ts
@@ -0,0 +1,38 @@
+/**
+ * 参试任务管理相关
+ */
+import request from '@/api/index'
+
+// 列表
+export function getTaskList(params: any) {
+ return request({
+ url: `/equipment/task/listPage?limit=${params.limit}&offset=${params.offset}`,
+ method: 'post',
+ data: params,
+ })
+}
+// 新增
+export function addTask(params: any) {
+ return request({
+ url: '/equipment/task/add',
+ method: 'post',
+ data: params,
+ })
+}
+// 新增
+export function updateTask(params: any) {
+ return request({
+ url: '/equipment/task/update',
+ method: 'post',
+ data: params,
+ })
+}
+// 删除
+export function delTask(params: any) {
+ return request({
+ url: '/equipment/task/delete',
+ method: 'post',
+ data: params,
+ })
+}
+
diff --git a/src/api/system/expire.ts b/src/api/system/expire.ts
index 1365711..834048e 100644
--- a/src/api/system/expire.ts
+++ b/src/api/system/expire.ts
@@ -18,3 +18,18 @@
data,
})
}
+// 新建
+export function addRemind(data: object) {
+ return request({
+ url: '/system/remind/add',
+ method: 'post',
+ data,
+ })
+}
+// 删除
+export function delRemind(id: string) {
+ return request({
+ url: `/system/remind/remove?id=${id}`,
+ method: 'post',
+ })
+}
diff --git a/src/assets/icons/icon-task.svg b/src/assets/icons/icon-task.svg
new file mode 100644
index 0000000..213c7cd
--- /dev/null
+++ b/src/assets/icons/icon-task.svg
@@ -0,0 +1 @@
+
diff --git a/src/views/dashboard.vue b/src/views/dashboard.vue
index df43894..c88bb78 100644
--- a/src/views/dashboard.vue
+++ b/src/views/dashboard.vue
@@ -40,7 +40,6 @@
const token = userStore.token
const params = `?token=${token}`
console.log(system.url + params)
-
window.open(system.url + params)
// window.open(`http://127.0.0.1:9526${params}`)
}
diff --git a/src/views/system/expire/device.vue b/src/views/system/expire/device.vue
new file mode 100644
index 0000000..890d2ab
--- /dev/null
+++ b/src/views/system/expire/device.vue
@@ -0,0 +1,227 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/views/system/expire/edit.vue b/src/views/system/expire/edit.vue
index 72d45f9..a7a0ccf 100644
--- a/src/views/system/expire/edit.vue
+++ b/src/views/system/expire/edit.vue
@@ -3,45 +3,110 @@
import { nextTick, reactive } from 'vue'
import { ElMessage, ElMessageBox } from 'element-plus'
import type { FormInstance, FormRules } from 'element-plus'
-import { getList, updateRemind } from '@/api/system/expire'
+import dayjs from 'dayjs'
+import device from './device.vue'
+import task from './task.vue'
+import useUserStore from '@/store/modules/user'
+import { getUserDept } from '@/api/system/user'
+import { addRemind, getList, updateRemind } from '@/api/system/expire'
// ----------------------- 以下是字段定义 emits props ---------------------
const emits = defineEmits(['closeRefresh'])
const dialogVisible = ref(false)
+const dialogStatus = ref('新建')
+const userStore = useUserStore()
const data = ref({
- createDeptId: 0,
+ createDeptId: '',
createDeptName: '',
createTime: '',
createUserId: '',
createUserName: '',
id: '',
remindName: '',
- remindTime: 0,
+ remindTime: 30,
updateTime: '',
+ remindType: '1',
+ taskIds: [] as string[],
+ taskNames: [] as string[],
+ equipmentNames: [] as string[],
+ modelIds: [] as string[],
+ equipmentExt: [] as string[],
+ taskExt: [] as string[],
+
})
+const resetForm = () => {
+ for (const i in data.value) {
+ data.value[i] = ''
+ }
+ data.value.remindTime = 30
+ data.value.remindType = '1'
+ data.value.taskIds = [] as string[]
+ data.value.taskNames = [] as string[]
+ data.value.equipmentNames = [] as string[]
+ data.value.modelIds = [] as string[]
+ data.value.equipmentExt = [] as string[]
+ data.value.taskExt = [] as string[]
+}
// ---------------表单提交--------------------------------
// 表单对象
const dataFormRef = ref()
-
+const rules = ref({
+ remindName: [{ required: true, message: '提醒名称必填', trigger: ['blur', 'change'] }],
+ remindType: [{ required: true, message: '到期提醒类型必选', trigger: ['blur', 'change'] }],
+ modelIds: [{ required: true, message: '设备必选', trigger: ['blur', 'change'] }],
+ taskIds: [{ required: true, message: '任务必选', trigger: ['blur', 'change'] }],
+ remindTime: [{ required: true, message: '提醒时间必选', trigger: ['blur', 'change'] }],
+}) // 表单验证规则
// 表单提交
function submitForm() {
if (dataFormRef) {
dataFormRef.value?.validate((valid: boolean) => {
if (valid) {
- updateRemind(data.value).then((res) => {
- ElMessage.success('修改成功')
- dialogVisible.value = false
- emits('closeRefresh')
- })
+ if (dialogStatus.value === '新建') {
+ addRemind(data.value).then((res) => {
+ ElMessage.success('修改成功')
+ dialogVisible.value = false
+ emits('closeRefresh')
+ })
+ }
+ else {
+ updateRemind(data.value).then((res) => {
+ ElMessage.success('修改成功')
+ dialogVisible.value = false
+ emits('closeRefresh')
+ })
+ }
}
})
}
}
// ----------初始化、关闭对话框相关-----------------
-function initDialog(row: any) {
+function initDialog(row: any, status: string) {
dialogVisible.value = true
- data.value = row
+ resetForm()
+ if (status === 'create') {
+ dialogStatus.value = '新建'
+ nextTick(() => {
+ dataFormRef.value?.resetFields()
+ })
+
+ data.value.createTime = dayjs().format('YYYY-MM-DD HH:mm:ss') // 创建时间
+ data.value.createUserId = userStore.id
+ data.value.createUserName = userStore.name
+ // 获取当前用户所在单位
+ getUserDept().then((res) => {
+ // fullName
+ data.value.createDeptId = res.data.id
+ data.value.createDeptName = res.data.fullName
+ })
+ }
+ else {
+ data.value = JSON.parse(JSON.stringify(row))
+ dialogStatus.value = '编辑'
+ data.value.equipmentExt = JSON.parse(row.equipmentExt)
+ data.value.taskExt = JSON.parse(row.taskExt)
+ }
}
// 关闭并刷新
@@ -55,30 +120,133 @@
}
// ----------------------- 以下是暴露的方法内容 ----------------------------
defineExpose({ initDialog })
+
+// 选择设备
+const deviceRef = ref()
+const selectDevice = () => {
+ deviceRef.value.initDialog()
+}
+// 确认设备
+const confirmDevice = (list: any[]) => {
+ list.forEach((item: any) => {
+ if (!data.value.modelIds.includes(item.id)) {
+ data.value.equipmentExt.push(`${item.equipmentName}/${item.model}/${item.helpInstruction}`)
+ data.value.modelIds.push(item.id)
+ }
+ })
+}
+const removeDeviceStr = ref()
+const removeDevice = (device: string) => {
+ removeDeviceStr.value = device
+}
+watch(() => data.value.equipmentExt, (newVal, oldVal) => {
+ if (newVal && oldVal) {
+ if (newVal.length < oldVal.length) {
+ const index = oldVal.indexOf(removeDeviceStr.value)
+ data.value.modelIds = data.value.modelIds.filter((item, cindex) => cindex !== index)
+ }
+ }
+}, {
+ deep: true,
+})
+// 选择任务
+const taskRef = ref()
+const selectTask = () => {
+ taskRef.value.initDialog()
+}
+// 确认设备
+const confirmTask = (list: any[]) => {
+ list.forEach((item: any) => {
+ if (!data.value.taskIds.includes(item.id)) {
+ data.value.taskExt.push(`${item.taskName}/${item.createTime}`)
+ data.value.taskIds.push(item.id)
+ }
+ })
+}
+const removeTaskStr = ref()
+const removeTask = (task: string) => {
+ removeTaskStr.value = task
+}
+watch(() => data.value.taskExt, (newVal, oldVal) => {
+ if (newVal && oldVal) {
+ if (newVal.length < oldVal.length) {
+ const index = oldVal.indexOf(removeTaskStr.value)
+ data.value.taskIds = data.value.taskIds.filter((item, cindex) => cindex !== index)
+ }
+ }
+}, {
+ deep: true,
+})
+
+
+
-
-
+
+
-
+
+
+
+ 设备到期提醒
+
+
+ 任务到期提醒
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -98,6 +266,16 @@
diff --git a/src/views/tested/device/info/components/interface.ts b/src/views/tested/device/info/components/interface.ts
index fbb1f51..73bfbf4 100644
--- a/src/views/tested/device/info/components/interface.ts
+++ b/src/views/tested/device/info/components/interface.ts
@@ -12,6 +12,17 @@
limit: number
approvalStatus?: string
formId?: string
+ model: string
+ manufactureNo: string
+ companyId: string
+ directorName: string
+ useSign: string
+ installLocation: string
+ taskId: string
+ checkOrganization: string
+ meterIdentify: string
+ checkDateStart: string
+ checkDateEnd: string
}
// 设备信息对象
export interface IlistObjType {
diff --git a/src/views/tested/device/info/components/list.vue b/src/views/tested/device/info/components/list.vue
index db05d4d..d42a797 100644
--- a/src/views/tested/device/info/components/list.vue
+++ b/src/views/tested/device/info/components/list.vue
@@ -5,11 +5,14 @@
import type { IlistObjType, IlistQueryType } from './interface'
import { delTextBtn, editTextBtn } from '@/utils/applyBtns'
import ApprovalDialog from '@/components/Approval/ApprovalDialog.vue'
-import { cancelInfo, deleteInfo, editInfo, exportDevice, getInfoList, getInfoListPage, getInfoListTogether, importDevice, submitInfo } from '@/api/eqpt/device/info'
+import { bindTaskHandler, cancelInfo, deleteInfo, editInfo, exportDevice, getInfoList, getInfoListPage, getInfoListTogether, importDevice, submitInfo } from '@/api/eqpt/device/info'
import { getDictByCode } from '@/api/system/dict'
import { SCHEDULE } from '@/utils/scheduleDict'
import useTemplateDownload from '@/utils/useTemplateDownload'
import { exportFile } from '@/utils/exportUtils'
+import { getDeviceNameList, getModelAllList, getModelList } from '@/api/eqpt/device/model'
+import { getTaskList } from '@/api/eqpt/device/task'
+import task from '@/views/tested/device/task/index.vue'
const $props = defineProps({
statusName: {
type: String,
@@ -44,6 +47,17 @@
limit: 20,
approvalStatus: '',
formId: SCHEDULE.DEVICE_INFO_APPROVAL,
+ model: '', // 规格型号
+ manufactureNo: '', // 出厂编号
+ companyId: '', // 所在单位
+ directorName: '', // 负责人
+ useSign: '', // 再用信息
+ installLocation: '', // 安装位置
+ taskId: '', // 参试任务
+ checkOrganization: '', // 检定机构
+ meterIdentify: '', // 计量标识
+ checkDateEnd: '',
+ checkDateStart: '',
})
const columns = ref([
{
@@ -137,6 +151,8 @@
console.log('倒叙')
}
}
+// 切换表格标识 true:普通表格 false:聚合表格
+const tableFlage = ref(true)
// 聚合表格实例
const togetherTableRef = ref()
// 展开表格实例
@@ -164,12 +180,57 @@
}
// 获取使用状态列表
const useStatusList = ref()
+// 设备名称
+const deviceNameList = ref<{ id: string; value: string; name: string }[]>([])
+// 设备分类
+const deviceTypeList = ref<{ id: string; value: string; name: string }[]>([])
+// 再用信息
+const useSignList = ref<{ id: string; value: string; name: string }[]>([])
+// 任务列表
+const taskList = ref<{ id: string; value: string; name: string }[]>([])
+// 计量标识
+const meterIdentifyList = ref<{ id: string; value: string; name: string }[]>()
+// 规格型号
+const modelList = ref([])
+const allList = ref([])
const fetchUseStatus = () => {
getDictByCode('eqptDeviceUseStatus').then((res) => {
useStatusList.value = res.data
})
+ getDictByCode('eqptDeviceInUse').then((res) => {
+ useSignList.value = res.data
+ })
+ // 设备分类
+ getDictByCode('eqptDeviceType').then((res) => {
+ deviceTypeList.value = res.data
+ })
+ // 设备名称
+ getDeviceNameList().then((res) => {
+ deviceNameList.value = res.data
+ })
+ // 规格型号
+ getModelAllList({}).then((res) => {
+ allList.value = res.data
+ modelList.value = res.data
+ })
+ // 参试任务
+ getTaskList({ limit: 9999, offset: 1 }).then((res) => {
+ taskList.value = res.data.rows.map((item: any) => ({ name: item.taskName, value: item.id, id: item.id }))
+ })
+ getDictByCode('eqptMeterIdentify').then((res) => {
+ meterIdentifyList.value = res.data
+ })
}
fetchUseStatus()
+// 监听设备名称下拉框,修改规格型号和辅助字段
+watch(() => listQuery.equipmentName, (newVal) => {
+ if (newVal) {
+ listQuery.model = ''
+ // 修改规格型号和辅助字段列表
+ const data = allList.value.filter(item => item.equipmentName === newVal)
+ modelList.value = data
+ }
+})
// 查询数据
const search = () => {
fetchData(false)
@@ -186,16 +247,39 @@
listQuery.certificateValidEnd = ''
}
})
+const datetimerange1 = ref()
+watch(() => datetimerange1.value, (newVal) => {
+ if (newVal.length) {
+ listQuery.checkDateStart = `${newVal[0]} 00:00:00`
+ listQuery.checkDateEnd = `${newVal[1]} 23:59:59`
+ }
+ else {
+ listQuery.checkDateStart = ''
+ listQuery.checkDateEnd = ''
+ }
+})
// 重置
const reset = () => {
datetimerange.value = []
+ datetimerange1.value = []
listQuery.equipmentNo = ''
listQuery.equipmentName = ''
listQuery.usageStatus = ''
listQuery.usePosition = ''
listQuery.certificateValidEnd = ''
listQuery.certificateValidStart = ''
+ listQuery.model = ''
listQuery.deptIds = ''
+ listQuery.manufactureNo = ''
+ listQuery.companyId = ''
+ listQuery.directorName = ''
+ listQuery.useSign = ''
+ listQuery.installLocation = ''
+ listQuery.checkOrganization = ''
+ listQuery.checkDateStart = ''
+ listQuery.checkDateEnd = ''
+ listQuery.taskId = ''
+ listQuery.meterIdentify = ''
listQuery.offset = 1
listQuery.limit = 20
search()
@@ -392,6 +476,39 @@
const importList = () => {
fileRef.value.click()
}
+// 绑定参试任务
+const taskRef = ref()
+const bindTask = () => {
+ taskRef.value.initDialog()
+}
+// 确认绑定
+const bindIds = (ids: string[]) => {
+ console.log(ids, '参数任务ids')
+ // bindTaskHandler()
+ // 判断是 普通表格还是 聚合表格
+ if (tableFlage.value) {
+ // 普通表格
+ const data = {
+ equipmentIds: selectList.value.map(item => item.id),
+ taskIds: ids,
+ }
+ bindTaskHandler(data).then((res) => {
+ ElMessage.success('绑定成功')
+ fetchData()
+ })
+ }
+ else {
+ const data = {
+ equipmentNames: togetherTableRef.value.getSelectionRows().map((item: any) => item.equipmentName),
+ equipmentIds: expandTableRef.value.getSelectionRows().map((item: any) => item.id),
+ taskIds: ids,
+ }
+ bindTaskHandler(data).then((res) => {
+ ElMessage.success('绑定成功')
+ fetchTogetherData()
+ })
+ }
+}
// 详情
const detail = (row: IlistObjType) => {
if ($props.statusName === '草稿箱' || $props.statusName === '未通过' || $props.statusName === '已取消') {
@@ -507,8 +624,7 @@
const approveHandler = (row: any, type: string) => {
approvalDialogRef.value.initDialog(type, row.taskId, row.processId, row.id)
}
-// 切换表格标识 true:普通表格 false:聚合表格
-const tableFlage = ref(true)
+
const changeTable = () => {
tableFlage.value = !tableFlage.value
if (tableFlage.value) {
@@ -546,19 +662,25 @@
+
+
-
+
+
+
-
-
+
+
+
+
+
+
@@ -566,11 +688,50 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -580,6 +741,7 @@
+
@@ -660,7 +822,7 @@
-
+
{
ruleForm.value = data
+ console.log(ruleForm.value, 'ruleForm.value')
// })
}
}
@@ -203,7 +204,7 @@
-
+
diff --git a/src/views/tested/device/model/components/list.vue b/src/views/tested/device/model/components/list.vue
index 60a0a42..45b613e 100644
--- a/src/views/tested/device/model/components/list.vue
+++ b/src/views/tested/device/model/components/list.vue
@@ -149,7 +149,7 @@
ids: selectList.value.map(item => item.id),
}
exportModelList(data).then((res) => {
- exportFile('设备规格型号')
+ exportFile(res.data, '设备规格型号')
loading.close()
})
.catch((_) => {
@@ -162,7 +162,7 @@
}
// 获取下拉列表相关
// 设备名称
-const deviceNameList = ref<{ id: string; value: string; name: string }[]>([])
+const deviceNameList = ref([])
// 设备分类
const deviceTypeList = ref<{ id: string; value: string; name: string }[]>([])
// 规格型号
@@ -183,7 +183,7 @@
getModelAllList({}).then((res) => {
allList.value = res.data
modelList.value = res.data
- helpList.value = res.data.filter(item => item.helpInstruction)
+ helpList.value = res.data.filter((item: any) => item.helpInstruction)
})
}
fetchSelect()
diff --git a/src/views/tested/device/task/addDialog.vue b/src/views/tested/device/task/addDialog.vue
new file mode 100644
index 0000000..e853254
--- /dev/null
+++ b/src/views/tested/device/task/addDialog.vue
@@ -0,0 +1,184 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/.env.development b/.env.development
index f2fee42..19ebebf 100644
--- a/.env.development
+++ b/.env.development
@@ -4,7 +4,7 @@
# 接口请求地址,会设置到 axios 的 baseURL 参数上
# VITE_APP_API_BASEURL = http://139.198.29.133:8089
# VITE_APP_API_BASEURL = http://111.198.10.15:21611
-VITE_APP_API_BASEURL = http://192.168.8.101:5909
+VITE_APP_API_BASEURL = http://192.168.8.100:5909
# VITE_APP_API_BASEURL = http://111.198.10.15:21611
# VITE_APP_API_BASEURL = http://192.168.8.107:5909
# VITE_APP_API_BASEURL = http://111.198.10.15:21710
diff --git a/.env.production b/.env.production
index 7595683..36e6ad3 100644
--- a/.env.production
+++ b/.env.production
@@ -4,7 +4,7 @@
VITE_APP_TITLE = 计量信息系统
VITE_SYS_TITLE = 受检设备管理系统
# 接口请求地址,会设置到 axios 的 baseURL 参数上
-VITE_APP_API_BASEURL = http://127.0.0.1:5909
+VITE_APP_API_BASEURL = http://111.198.10.15:21611
# 调试工具,可设置 eruda 或 vconsole,如果不需要开启则留空
VITE_APP_DEBUG_TOOL =
diff --git a/public/config/config.json b/public/config/config.json
index 3bd0a89..169f1f6 100644
--- a/public/config/config.json
+++ b/public/config/config.json
@@ -1,4 +1,8 @@
{
"title":"计量业务系统",
+<<<<<<< HEAD
"baseUrl": "http://111.198.10.15:21611"
+=======
+ "baseUrl": "http://192.168.8.100:5909"
+>>>>>>> 5e67c355ee24dc34e26bb2fdbb5214aa66e8f137
}
diff --git a/src/api/eqpt/device/info.ts b/src/api/eqpt/device/info.ts
index f2a9176..e40366c 100644
--- a/src/api/eqpt/device/info.ts
+++ b/src/api/eqpt/device/info.ts
@@ -153,3 +153,11 @@
method: 'get',
})
}
+// 绑定参试任务
+export function bindTaskHandler(data: object) {
+ return request({
+ url: '/equipment/bindTask',
+ method: 'post',
+ data,
+ })
+}
diff --git a/src/api/eqpt/device/model.ts b/src/api/eqpt/device/model.ts
index a8fa0f1..04da2af 100644
--- a/src/api/eqpt/device/model.ts
+++ b/src/api/eqpt/device/model.ts
@@ -20,11 +20,10 @@
})
}
// 设备名称列表/equipment/model/listEquipmentName
-export function getDeviceNameList(params: any) {
+export function getDeviceNameList() {
return request({
url: '/equipment/model/listEquipmentName',
method: 'get',
- params,
})
}
// 导出
@@ -33,6 +32,7 @@
url: '/equipment/model/export',
method: 'post',
data,
+ responseType: 'blob',
})
}
// 新建或编辑
diff --git a/src/api/eqpt/device/task.ts b/src/api/eqpt/device/task.ts
new file mode 100644
index 0000000..2a83db0
--- /dev/null
+++ b/src/api/eqpt/device/task.ts
@@ -0,0 +1,38 @@
+/**
+ * 参试任务管理相关
+ */
+import request from '@/api/index'
+
+// 列表
+export function getTaskList(params: any) {
+ return request({
+ url: `/equipment/task/listPage?limit=${params.limit}&offset=${params.offset}`,
+ method: 'post',
+ data: params,
+ })
+}
+// 新增
+export function addTask(params: any) {
+ return request({
+ url: '/equipment/task/add',
+ method: 'post',
+ data: params,
+ })
+}
+// 新增
+export function updateTask(params: any) {
+ return request({
+ url: '/equipment/task/update',
+ method: 'post',
+ data: params,
+ })
+}
+// 删除
+export function delTask(params: any) {
+ return request({
+ url: '/equipment/task/delete',
+ method: 'post',
+ data: params,
+ })
+}
+
diff --git a/src/api/system/expire.ts b/src/api/system/expire.ts
index 1365711..834048e 100644
--- a/src/api/system/expire.ts
+++ b/src/api/system/expire.ts
@@ -18,3 +18,18 @@
data,
})
}
+// 新建
+export function addRemind(data: object) {
+ return request({
+ url: '/system/remind/add',
+ method: 'post',
+ data,
+ })
+}
+// 删除
+export function delRemind(id: string) {
+ return request({
+ url: `/system/remind/remove?id=${id}`,
+ method: 'post',
+ })
+}
diff --git a/src/assets/icons/icon-task.svg b/src/assets/icons/icon-task.svg
new file mode 100644
index 0000000..213c7cd
--- /dev/null
+++ b/src/assets/icons/icon-task.svg
@@ -0,0 +1 @@
+
diff --git a/src/views/dashboard.vue b/src/views/dashboard.vue
index df43894..c88bb78 100644
--- a/src/views/dashboard.vue
+++ b/src/views/dashboard.vue
@@ -40,7 +40,6 @@
const token = userStore.token
const params = `?token=${token}`
console.log(system.url + params)
-
window.open(system.url + params)
// window.open(`http://127.0.0.1:9526${params}`)
}
diff --git a/src/views/system/expire/device.vue b/src/views/system/expire/device.vue
new file mode 100644
index 0000000..890d2ab
--- /dev/null
+++ b/src/views/system/expire/device.vue
@@ -0,0 +1,227 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/views/system/expire/edit.vue b/src/views/system/expire/edit.vue
index 72d45f9..a7a0ccf 100644
--- a/src/views/system/expire/edit.vue
+++ b/src/views/system/expire/edit.vue
@@ -3,45 +3,110 @@
import { nextTick, reactive } from 'vue'
import { ElMessage, ElMessageBox } from 'element-plus'
import type { FormInstance, FormRules } from 'element-plus'
-import { getList, updateRemind } from '@/api/system/expire'
+import dayjs from 'dayjs'
+import device from './device.vue'
+import task from './task.vue'
+import useUserStore from '@/store/modules/user'
+import { getUserDept } from '@/api/system/user'
+import { addRemind, getList, updateRemind } from '@/api/system/expire'
// ----------------------- 以下是字段定义 emits props ---------------------
const emits = defineEmits(['closeRefresh'])
const dialogVisible = ref(false)
+const dialogStatus = ref('新建')
+const userStore = useUserStore()
const data = ref({
- createDeptId: 0,
+ createDeptId: '',
createDeptName: '',
createTime: '',
createUserId: '',
createUserName: '',
id: '',
remindName: '',
- remindTime: 0,
+ remindTime: 30,
updateTime: '',
+ remindType: '1',
+ taskIds: [] as string[],
+ taskNames: [] as string[],
+ equipmentNames: [] as string[],
+ modelIds: [] as string[],
+ equipmentExt: [] as string[],
+ taskExt: [] as string[],
+
})
+const resetForm = () => {
+ for (const i in data.value) {
+ data.value[i] = ''
+ }
+ data.value.remindTime = 30
+ data.value.remindType = '1'
+ data.value.taskIds = [] as string[]
+ data.value.taskNames = [] as string[]
+ data.value.equipmentNames = [] as string[]
+ data.value.modelIds = [] as string[]
+ data.value.equipmentExt = [] as string[]
+ data.value.taskExt = [] as string[]
+}
// ---------------表单提交--------------------------------
// 表单对象
const dataFormRef = ref()
-
+const rules = ref({
+ remindName: [{ required: true, message: '提醒名称必填', trigger: ['blur', 'change'] }],
+ remindType: [{ required: true, message: '到期提醒类型必选', trigger: ['blur', 'change'] }],
+ modelIds: [{ required: true, message: '设备必选', trigger: ['blur', 'change'] }],
+ taskIds: [{ required: true, message: '任务必选', trigger: ['blur', 'change'] }],
+ remindTime: [{ required: true, message: '提醒时间必选', trigger: ['blur', 'change'] }],
+}) // 表单验证规则
// 表单提交
function submitForm() {
if (dataFormRef) {
dataFormRef.value?.validate((valid: boolean) => {
if (valid) {
- updateRemind(data.value).then((res) => {
- ElMessage.success('修改成功')
- dialogVisible.value = false
- emits('closeRefresh')
- })
+ if (dialogStatus.value === '新建') {
+ addRemind(data.value).then((res) => {
+ ElMessage.success('修改成功')
+ dialogVisible.value = false
+ emits('closeRefresh')
+ })
+ }
+ else {
+ updateRemind(data.value).then((res) => {
+ ElMessage.success('修改成功')
+ dialogVisible.value = false
+ emits('closeRefresh')
+ })
+ }
}
})
}
}
// ----------初始化、关闭对话框相关-----------------
-function initDialog(row: any) {
+function initDialog(row: any, status: string) {
dialogVisible.value = true
- data.value = row
+ resetForm()
+ if (status === 'create') {
+ dialogStatus.value = '新建'
+ nextTick(() => {
+ dataFormRef.value?.resetFields()
+ })
+
+ data.value.createTime = dayjs().format('YYYY-MM-DD HH:mm:ss') // 创建时间
+ data.value.createUserId = userStore.id
+ data.value.createUserName = userStore.name
+ // 获取当前用户所在单位
+ getUserDept().then((res) => {
+ // fullName
+ data.value.createDeptId = res.data.id
+ data.value.createDeptName = res.data.fullName
+ })
+ }
+ else {
+ data.value = JSON.parse(JSON.stringify(row))
+ dialogStatus.value = '编辑'
+ data.value.equipmentExt = JSON.parse(row.equipmentExt)
+ data.value.taskExt = JSON.parse(row.taskExt)
+ }
}
// 关闭并刷新
@@ -55,30 +120,133 @@
}
// ----------------------- 以下是暴露的方法内容 ----------------------------
defineExpose({ initDialog })
+
+// 选择设备
+const deviceRef = ref()
+const selectDevice = () => {
+ deviceRef.value.initDialog()
+}
+// 确认设备
+const confirmDevice = (list: any[]) => {
+ list.forEach((item: any) => {
+ if (!data.value.modelIds.includes(item.id)) {
+ data.value.equipmentExt.push(`${item.equipmentName}/${item.model}/${item.helpInstruction}`)
+ data.value.modelIds.push(item.id)
+ }
+ })
+}
+const removeDeviceStr = ref()
+const removeDevice = (device: string) => {
+ removeDeviceStr.value = device
+}
+watch(() => data.value.equipmentExt, (newVal, oldVal) => {
+ if (newVal && oldVal) {
+ if (newVal.length < oldVal.length) {
+ const index = oldVal.indexOf(removeDeviceStr.value)
+ data.value.modelIds = data.value.modelIds.filter((item, cindex) => cindex !== index)
+ }
+ }
+}, {
+ deep: true,
+})
+// 选择任务
+const taskRef = ref()
+const selectTask = () => {
+ taskRef.value.initDialog()
+}
+// 确认设备
+const confirmTask = (list: any[]) => {
+ list.forEach((item: any) => {
+ if (!data.value.taskIds.includes(item.id)) {
+ data.value.taskExt.push(`${item.taskName}/${item.createTime}`)
+ data.value.taskIds.push(item.id)
+ }
+ })
+}
+const removeTaskStr = ref()
+const removeTask = (task: string) => {
+ removeTaskStr.value = task
+}
+watch(() => data.value.taskExt, (newVal, oldVal) => {
+ if (newVal && oldVal) {
+ if (newVal.length < oldVal.length) {
+ const index = oldVal.indexOf(removeTaskStr.value)
+ data.value.taskIds = data.value.taskIds.filter((item, cindex) => cindex !== index)
+ }
+ }
+}, {
+ deep: true,
+})
+
+
+
-
-
+
+
-
+
+
+
+ 设备到期提醒
+
+
+ 任务到期提醒
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -98,6 +266,16 @@
diff --git a/src/views/tested/device/info/components/interface.ts b/src/views/tested/device/info/components/interface.ts
index fbb1f51..73bfbf4 100644
--- a/src/views/tested/device/info/components/interface.ts
+++ b/src/views/tested/device/info/components/interface.ts
@@ -12,6 +12,17 @@
limit: number
approvalStatus?: string
formId?: string
+ model: string
+ manufactureNo: string
+ companyId: string
+ directorName: string
+ useSign: string
+ installLocation: string
+ taskId: string
+ checkOrganization: string
+ meterIdentify: string
+ checkDateStart: string
+ checkDateEnd: string
}
// 设备信息对象
export interface IlistObjType {
diff --git a/src/views/tested/device/info/components/list.vue b/src/views/tested/device/info/components/list.vue
index db05d4d..d42a797 100644
--- a/src/views/tested/device/info/components/list.vue
+++ b/src/views/tested/device/info/components/list.vue
@@ -5,11 +5,14 @@
import type { IlistObjType, IlistQueryType } from './interface'
import { delTextBtn, editTextBtn } from '@/utils/applyBtns'
import ApprovalDialog from '@/components/Approval/ApprovalDialog.vue'
-import { cancelInfo, deleteInfo, editInfo, exportDevice, getInfoList, getInfoListPage, getInfoListTogether, importDevice, submitInfo } from '@/api/eqpt/device/info'
+import { bindTaskHandler, cancelInfo, deleteInfo, editInfo, exportDevice, getInfoList, getInfoListPage, getInfoListTogether, importDevice, submitInfo } from '@/api/eqpt/device/info'
import { getDictByCode } from '@/api/system/dict'
import { SCHEDULE } from '@/utils/scheduleDict'
import useTemplateDownload from '@/utils/useTemplateDownload'
import { exportFile } from '@/utils/exportUtils'
+import { getDeviceNameList, getModelAllList, getModelList } from '@/api/eqpt/device/model'
+import { getTaskList } from '@/api/eqpt/device/task'
+import task from '@/views/tested/device/task/index.vue'
const $props = defineProps({
statusName: {
type: String,
@@ -44,6 +47,17 @@
limit: 20,
approvalStatus: '',
formId: SCHEDULE.DEVICE_INFO_APPROVAL,
+ model: '', // 规格型号
+ manufactureNo: '', // 出厂编号
+ companyId: '', // 所在单位
+ directorName: '', // 负责人
+ useSign: '', // 再用信息
+ installLocation: '', // 安装位置
+ taskId: '', // 参试任务
+ checkOrganization: '', // 检定机构
+ meterIdentify: '', // 计量标识
+ checkDateEnd: '',
+ checkDateStart: '',
})
const columns = ref([
{
@@ -137,6 +151,8 @@
console.log('倒叙')
}
}
+// 切换表格标识 true:普通表格 false:聚合表格
+const tableFlage = ref(true)
// 聚合表格实例
const togetherTableRef = ref()
// 展开表格实例
@@ -164,12 +180,57 @@
}
// 获取使用状态列表
const useStatusList = ref()
+// 设备名称
+const deviceNameList = ref<{ id: string; value: string; name: string }[]>([])
+// 设备分类
+const deviceTypeList = ref<{ id: string; value: string; name: string }[]>([])
+// 再用信息
+const useSignList = ref<{ id: string; value: string; name: string }[]>([])
+// 任务列表
+const taskList = ref<{ id: string; value: string; name: string }[]>([])
+// 计量标识
+const meterIdentifyList = ref<{ id: string; value: string; name: string }[]>()
+// 规格型号
+const modelList = ref([])
+const allList = ref([])
const fetchUseStatus = () => {
getDictByCode('eqptDeviceUseStatus').then((res) => {
useStatusList.value = res.data
})
+ getDictByCode('eqptDeviceInUse').then((res) => {
+ useSignList.value = res.data
+ })
+ // 设备分类
+ getDictByCode('eqptDeviceType').then((res) => {
+ deviceTypeList.value = res.data
+ })
+ // 设备名称
+ getDeviceNameList().then((res) => {
+ deviceNameList.value = res.data
+ })
+ // 规格型号
+ getModelAllList({}).then((res) => {
+ allList.value = res.data
+ modelList.value = res.data
+ })
+ // 参试任务
+ getTaskList({ limit: 9999, offset: 1 }).then((res) => {
+ taskList.value = res.data.rows.map((item: any) => ({ name: item.taskName, value: item.id, id: item.id }))
+ })
+ getDictByCode('eqptMeterIdentify').then((res) => {
+ meterIdentifyList.value = res.data
+ })
}
fetchUseStatus()
+// 监听设备名称下拉框,修改规格型号和辅助字段
+watch(() => listQuery.equipmentName, (newVal) => {
+ if (newVal) {
+ listQuery.model = ''
+ // 修改规格型号和辅助字段列表
+ const data = allList.value.filter(item => item.equipmentName === newVal)
+ modelList.value = data
+ }
+})
// 查询数据
const search = () => {
fetchData(false)
@@ -186,16 +247,39 @@
listQuery.certificateValidEnd = ''
}
})
+const datetimerange1 = ref()
+watch(() => datetimerange1.value, (newVal) => {
+ if (newVal.length) {
+ listQuery.checkDateStart = `${newVal[0]} 00:00:00`
+ listQuery.checkDateEnd = `${newVal[1]} 23:59:59`
+ }
+ else {
+ listQuery.checkDateStart = ''
+ listQuery.checkDateEnd = ''
+ }
+})
// 重置
const reset = () => {
datetimerange.value = []
+ datetimerange1.value = []
listQuery.equipmentNo = ''
listQuery.equipmentName = ''
listQuery.usageStatus = ''
listQuery.usePosition = ''
listQuery.certificateValidEnd = ''
listQuery.certificateValidStart = ''
+ listQuery.model = ''
listQuery.deptIds = ''
+ listQuery.manufactureNo = ''
+ listQuery.companyId = ''
+ listQuery.directorName = ''
+ listQuery.useSign = ''
+ listQuery.installLocation = ''
+ listQuery.checkOrganization = ''
+ listQuery.checkDateStart = ''
+ listQuery.checkDateEnd = ''
+ listQuery.taskId = ''
+ listQuery.meterIdentify = ''
listQuery.offset = 1
listQuery.limit = 20
search()
@@ -392,6 +476,39 @@
const importList = () => {
fileRef.value.click()
}
+// 绑定参试任务
+const taskRef = ref()
+const bindTask = () => {
+ taskRef.value.initDialog()
+}
+// 确认绑定
+const bindIds = (ids: string[]) => {
+ console.log(ids, '参数任务ids')
+ // bindTaskHandler()
+ // 判断是 普通表格还是 聚合表格
+ if (tableFlage.value) {
+ // 普通表格
+ const data = {
+ equipmentIds: selectList.value.map(item => item.id),
+ taskIds: ids,
+ }
+ bindTaskHandler(data).then((res) => {
+ ElMessage.success('绑定成功')
+ fetchData()
+ })
+ }
+ else {
+ const data = {
+ equipmentNames: togetherTableRef.value.getSelectionRows().map((item: any) => item.equipmentName),
+ equipmentIds: expandTableRef.value.getSelectionRows().map((item: any) => item.id),
+ taskIds: ids,
+ }
+ bindTaskHandler(data).then((res) => {
+ ElMessage.success('绑定成功')
+ fetchTogetherData()
+ })
+ }
+}
// 详情
const detail = (row: IlistObjType) => {
if ($props.statusName === '草稿箱' || $props.statusName === '未通过' || $props.statusName === '已取消') {
@@ -507,8 +624,7 @@
const approveHandler = (row: any, type: string) => {
approvalDialogRef.value.initDialog(type, row.taskId, row.processId, row.id)
}
-// 切换表格标识 true:普通表格 false:聚合表格
-const tableFlage = ref(true)
+
const changeTable = () => {
tableFlage.value = !tableFlage.value
if (tableFlage.value) {
@@ -546,19 +662,25 @@
+
+
-
+
+
+
-
-
+
+
+
+
+
+
@@ -566,11 +688,50 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -580,6 +741,7 @@
+
@@ -660,7 +822,7 @@
-
+
{
ruleForm.value = data
+ console.log(ruleForm.value, 'ruleForm.value')
// })
}
}
@@ -203,7 +204,7 @@
-
+
diff --git a/src/views/tested/device/model/components/list.vue b/src/views/tested/device/model/components/list.vue
index 60a0a42..45b613e 100644
--- a/src/views/tested/device/model/components/list.vue
+++ b/src/views/tested/device/model/components/list.vue
@@ -149,7 +149,7 @@
ids: selectList.value.map(item => item.id),
}
exportModelList(data).then((res) => {
- exportFile('设备规格型号')
+ exportFile(res.data, '设备规格型号')
loading.close()
})
.catch((_) => {
@@ -162,7 +162,7 @@
}
// 获取下拉列表相关
// 设备名称
-const deviceNameList = ref<{ id: string; value: string; name: string }[]>([])
+const deviceNameList = ref([])
// 设备分类
const deviceTypeList = ref<{ id: string; value: string; name: string }[]>([])
// 规格型号
@@ -183,7 +183,7 @@
getModelAllList({}).then((res) => {
allList.value = res.data
modelList.value = res.data
- helpList.value = res.data.filter(item => item.helpInstruction)
+ helpList.value = res.data.filter((item: any) => item.helpInstruction)
})
}
fetchSelect()
diff --git a/src/views/tested/device/task/addDialog.vue b/src/views/tested/device/task/addDialog.vue
new file mode 100644
index 0000000..e853254
--- /dev/null
+++ b/src/views/tested/device/task/addDialog.vue
@@ -0,0 +1,184 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/views/tested/device/task/index.vue b/src/views/tested/device/task/index.vue
new file mode 100644
index 0000000..48d4b1c
--- /dev/null
+++ b/src/views/tested/device/task/index.vue
@@ -0,0 +1,200 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 编辑
+
+
+
+
+
+
+
+
+
+
+
+