Compare commits
45 Commits
projects/r
...
fe29043ab1
| Author | SHA1 | Date | |
|---|---|---|---|
| fe29043ab1 | |||
| 2075b42427 | |||
| c851188989 | |||
|
|
0fa310609e | ||
| 57a4ca96e7 | |||
| af868a7cd7 | |||
| cb1ad9edec | |||
|
|
34e8178ddc | ||
|
|
6c094b2a2e | ||
| 4a796130d0 | |||
| 60f65e6f85 | |||
| 3bf8150764 | |||
| bacf2eab0b | |||
| 8155a78649 | |||
| 013c08710c | |||
| 00fba0a83b | |||
| c71613f3fc | |||
|
|
4615e975e8 | ||
|
|
e961bf6cfa | ||
| 216aa6291d | |||
| 66660bfef7 | |||
| d25261b256 | |||
| 583b934511 | |||
| 55e023d0a8 | |||
| 503e988f7b | |||
| 06e8a72f80 | |||
| 6c348202a1 | |||
| 5ba186b0c6 | |||
| e153d7e077 | |||
| 3c31e5d63a | |||
| 619cf9e1ce | |||
| 392c1ea09b | |||
| ac4565e587 | |||
| 6006ae13d9 | |||
| 74d5646d65 | |||
|
|
2c3bdde403 | ||
| 106d0ed89c | |||
| cfbd00b560 | |||
| a787935263 | |||
| 15da20fac7 | |||
| 6b4e906e75 | |||
| d121e408af | |||
| f8baaa8955 | |||
| 416d4bb390 | |||
| fe7821cbd8 |
16
.env.dev
16
.env.dev
@@ -1,19 +1,25 @@
|
||||
###
|
||||
# @Author: Do not edit
|
||||
# @Date: 2023-08-29 09:40:39
|
||||
# @LastEditTime: 2024-11-25 14:31:39
|
||||
# @LastEditors: zwq
|
||||
# @LastEditTime: 2023-10-30 10:49:39
|
||||
# @LastEditors: zhp
|
||||
# @Description:
|
||||
###
|
||||
# 开发环境配置
|
||||
ENV = 'development'
|
||||
|
||||
# 页面标题
|
||||
VUE_APP_TITLE = 智能监控分析系统
|
||||
VUE_APP_TITLE = MES系统
|
||||
|
||||
# 芋道管理系统/开发环境
|
||||
# VUE_APP_BASE_API = 'http://192.168.8.22:48080'
|
||||
VUE_APP_BASE_API = 'http://172.16.32.79:48082'
|
||||
# VUE_APP_BASE_API = 'http://100.64.0.26:48082'
|
||||
VUE_APP_BASE_API = 'http://192.168.0.33:48082'
|
||||
# VUE_APP_BASE_API = 'http://192.168.2.173:48080'
|
||||
# VUE_APP_BASE_API = 'http://192.168.1.49:48080'
|
||||
# VUE_APP_BASE_API = 'http://192.168.1.8:48080'
|
||||
# VUE_APP_BASE_API = 'http://192.168.1.56:48080'
|
||||
# VUE_APP_BASE_API = 'http://192.168.1.188:48080'
|
||||
|
||||
|
||||
# 路由懒加载
|
||||
VUE_CLI_BABEL_TRANSPILE_MODULES = true
|
||||
|
||||
15
.env.prod
15
.env.prod
@@ -1,24 +1,15 @@
|
||||
###
|
||||
# @Author: zwq
|
||||
# @Date: 2024-03-27 15:49:55
|
||||
# @LastEditors: zwq
|
||||
# @LastEditTime: 2024-10-30 11:08:47
|
||||
# @Description:
|
||||
###
|
||||
# 生产环境配置
|
||||
ENV = 'production'
|
||||
|
||||
# 页面标题
|
||||
VUE_APP_TITLE = 智能监控分析系统
|
||||
VUE_APP_TITLE = 产线监控系统
|
||||
|
||||
# 芋道管理系统/生产环境
|
||||
# VUE_APP_BASE_API = '/prod-api'
|
||||
VUE_APP_BASE_API = ''
|
||||
VUE_APP_BASE_API = '/prod-api'
|
||||
|
||||
# 根据服务器或域名修改
|
||||
# PUBLIC_PATH = 'http://my-pi.com:8888/yudao-admin/'
|
||||
# PUBLIC_PATH = 'http://192.168.0.33:8888/'
|
||||
PUBLIC_PATH = ''
|
||||
PUBLIC_PATH = 'http://192.168.0.33:8888/'
|
||||
|
||||
# 二级部署路径
|
||||
VUE_APP_APP_NAME ='yudao-admin'
|
||||
|
||||
@@ -6,9 +6,9 @@
|
||||
"license": "MIT",
|
||||
"scripts": {
|
||||
"local": "vue-cli-service serve --mode local",
|
||||
"dev": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve --mode dev",
|
||||
"dev": "vue-cli-service serve --mode dev",
|
||||
"front": "vue-cli-service serve --mode front",
|
||||
"build:prod": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service build --mode prod",
|
||||
"build:prod": "vue-cli-service build --mode prod",
|
||||
"build:stage": "vue-cli-service build --mode stage",
|
||||
"build:dev": "vue-cli-service build --mode dev",
|
||||
"build:static": "vue-cli-service build --mode static",
|
||||
@@ -41,6 +41,7 @@
|
||||
"url": "https://github.com/YunaiV/ruoyi-vue-pro"
|
||||
},
|
||||
"dependencies": {
|
||||
"@antv/x6": "^2.15.3",
|
||||
"@babel/parser": "7.18.4",
|
||||
"@riophae/vue-treeselect": "0.4.0",
|
||||
"axios": "0.27.2",
|
||||
@@ -70,6 +71,7 @@
|
||||
"screenfull": "5.0.2",
|
||||
"sortablejs": "1.10.2",
|
||||
"throttle-debounce": "2.1.0",
|
||||
"uuid": "^9.0.1",
|
||||
"video.js": "^8.5.2",
|
||||
"vue": "2.7.14",
|
||||
"vue-count-to": "1.0.13",
|
||||
|
||||
Binary file not shown.
8
src/api/base/customer.js
Normal file
8
src/api/base/customer.js
Normal file
@@ -0,0 +1,8 @@
|
||||
import request from '@/utils/request'
|
||||
// 获得所有客户列表
|
||||
export function getCustomerList() {
|
||||
return request({
|
||||
url: '/base/core-customer/listAll',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
@@ -1,86 +0,0 @@
|
||||
/*
|
||||
* @Author: zwq
|
||||
* @Date: 2024-04-11 15:00:03
|
||||
* @LastEditors: zwq
|
||||
* @LastEditTime: 2024-04-12 10:25:30
|
||||
* @Description:
|
||||
*/
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 获得分页数据
|
||||
export function energyQuantityManualPage(query) {
|
||||
return request({
|
||||
url: '/base/energy-quantity-manual/page',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 创建
|
||||
export function energyQuantityManualCreate(data) {
|
||||
return request({
|
||||
url: '/base/energy-quantity-manual/create',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 更新
|
||||
export function energyQuantityManualUpdate(data) {
|
||||
return request({
|
||||
url: '/base/energy-quantity-manual/update',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
//获得能源抄表(手动)
|
||||
export function energyQuantityManualGet(query) {
|
||||
return request({
|
||||
url: '/base/energy-quantity-manual/get',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
//删除
|
||||
export function energyQuantityManualDelete(query) {
|
||||
return request({
|
||||
url: '/base/energy-quantity-manual/delete',
|
||||
method: 'delete',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
//导出
|
||||
export function energyQuantityManualExport(query) {
|
||||
return request({
|
||||
url: '/base/energy-quantity-manual/export-excel',
|
||||
method: 'get',
|
||||
params: query,
|
||||
responseType: 'blob'
|
||||
})
|
||||
}
|
||||
// 获得能源表名配置分页
|
||||
export function energyTablePage() {
|
||||
return request({
|
||||
url: '/base/energy-type-meter-bind/list',
|
||||
method: 'get',
|
||||
})
|
||||
}
|
||||
// 获得能源表名配置
|
||||
export function energyTableGet(query) {
|
||||
return request({
|
||||
url: '/base/energy-type-meter-bind/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
// 更新能源表名配置
|
||||
export function energyTableUpdate(data) {
|
||||
return request({
|
||||
url: '/base/energy-type-meter-bind/update',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
@@ -3,7 +3,7 @@ import request from '@/utils/request'
|
||||
// 创建设备
|
||||
export function createEquipment(data) {
|
||||
return request({
|
||||
url: '/base/equipment/create',
|
||||
url: '/base/core-equipment/create',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
@@ -12,7 +12,7 @@ export function createEquipment(data) {
|
||||
// 更新设备
|
||||
export function updateEquipment(data) {
|
||||
return request({
|
||||
url: '/base/equipment/update',
|
||||
url: '/base/core-equipment/update',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
@@ -21,7 +21,7 @@ export function updateEquipment(data) {
|
||||
// 删除设备
|
||||
export function deleteEquipment(id) {
|
||||
return request({
|
||||
url: '/base/equipment/delete?id=' + id,
|
||||
url: '/base/core-equipment/delete?id=' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
@@ -29,7 +29,7 @@ export function deleteEquipment(id) {
|
||||
// 获得设备
|
||||
export function getEquipment(id) {
|
||||
return request({
|
||||
url: '/base/equipment/get?id=' + id,
|
||||
url: '/base/core-equipment/get?id=' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
@@ -37,7 +37,7 @@ export function getEquipment(id) {
|
||||
// 获得设备分页
|
||||
export function getEquipmentPage(query) {
|
||||
return request({
|
||||
url: '/base/equipment/page',
|
||||
url: '/base/core-equipment/page',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
@@ -46,7 +46,7 @@ export function getEquipmentPage(query) {
|
||||
// 导出设备 Excel
|
||||
export function exportEquipmentExcel(query) {
|
||||
return request({
|
||||
url: '/base/equipment/export-excel',
|
||||
url: '/base/core-equipment/export-excel',
|
||||
method: 'get',
|
||||
params: query,
|
||||
responseType: 'blob'
|
||||
@@ -55,7 +55,7 @@ export function exportEquipmentExcel(query) {
|
||||
// 获得所有设备列表
|
||||
export function getEquipmentAll() {
|
||||
return request({
|
||||
url: '/base/equipment/listAll',
|
||||
url: '/base/core-equipment/listAll',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
@@ -1,53 +0,0 @@
|
||||
/*
|
||||
* @Author: Do not edit
|
||||
* @Date: 2024-02-21 13:43:02
|
||||
* @LastEditTime: 2024-04-30 10:07:59
|
||||
* @LastEditors: zwq
|
||||
* @Description:
|
||||
*/
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 获得关联表名
|
||||
export function getplcAllList(query) {
|
||||
return request({
|
||||
url: '/base/equipment-plc/listAll',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 获得设备
|
||||
export function getEquipmentList(query) {
|
||||
return request({
|
||||
url: '/base/core-equipment/page',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 根据产线获得工段
|
||||
export function listByParentId(query) {
|
||||
return request({
|
||||
url: '/base/core-workshop-section/listByParentId',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 获得产线工段设备树形结构
|
||||
export function getTree(query) {
|
||||
return request({
|
||||
url: '/base/factory/getTree',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 获得设备分组列表
|
||||
export function getgroupAllList(query) {
|
||||
return request({
|
||||
url: '/base/equipment-group/listAll',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
@@ -1,10 +1,3 @@
|
||||
/*
|
||||
* @Author: zwq
|
||||
* @Date: 2024-10-29 09:47:40
|
||||
* @LastEditors: zwq
|
||||
* @LastEditTime: 2025-02-26 16:27:48
|
||||
* @Description:
|
||||
*/
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 创建实时数据采集配置
|
||||
@@ -59,11 +52,3 @@ export function exportEquipmentPlcExcel(query) {
|
||||
responseType: 'blob'
|
||||
})
|
||||
}
|
||||
|
||||
// 获得code
|
||||
export function getCode() {
|
||||
return request({
|
||||
url: '/base/equipment-group/getCode',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@ import request from '@/utils/request'
|
||||
// 创建设备类型
|
||||
export function createEquipmentType(data) {
|
||||
return request({
|
||||
url: '/base/equipment-type/create',
|
||||
url: '/base/core-equipment-type/create',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
@@ -12,7 +12,7 @@ export function createEquipmentType(data) {
|
||||
// 更新设备类型
|
||||
export function updateEquipmentType(data) {
|
||||
return request({
|
||||
url: '/base/equipment-type/update',
|
||||
url: '/base/core-equipment-type/update',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
@@ -21,7 +21,7 @@ export function updateEquipmentType(data) {
|
||||
// 删除设备类型
|
||||
export function deleteEquipmentType(id) {
|
||||
return request({
|
||||
url: '/base/equipment-type/delete?id=' + id,
|
||||
url: '/base/core-equipment-type/delete?id=' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
@@ -29,7 +29,7 @@ export function deleteEquipmentType(id) {
|
||||
// 获得设备类型
|
||||
export function getEquipmentType(id) {
|
||||
return request({
|
||||
url: '/base/equipment-type/get?id=' + id,
|
||||
url: '/base/core-equipment-type/get?id=' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
@@ -37,7 +37,7 @@ export function getEquipmentType(id) {
|
||||
// 获得设备类型分页
|
||||
export function getEquipmentTypePage(query) {
|
||||
return request({
|
||||
url: '/base/equipment-type/page',
|
||||
url: '/base/core-equipment-type/page',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
@@ -46,7 +46,7 @@ export function getEquipmentTypePage(query) {
|
||||
// 导出设备类型 Excel
|
||||
export function exportEquipmentTypeExcel(query) {
|
||||
return request({
|
||||
url: '/base/equipment-type/export-excel',
|
||||
url: '/base/core-equipment-type/export-excel',
|
||||
method: 'get',
|
||||
params: query,
|
||||
responseType: 'blob'
|
||||
|
||||
@@ -1,15 +1,8 @@
|
||||
/*
|
||||
* @Author: zwq
|
||||
* @Date: 2024-10-29 09:47:40
|
||||
* @LastEditors: zwq
|
||||
* @LastEditTime: 2025-02-12 09:25:11
|
||||
* @Description:
|
||||
*/
|
||||
import request from '@/utils/request'
|
||||
// 获得工厂产线工段设备树形结构
|
||||
export function getTree() {
|
||||
return request({
|
||||
url: '/base/factory/getTree',
|
||||
url: '/base/core-factory/getTree',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
@@ -51,13 +51,6 @@ export function getCode() {
|
||||
})
|
||||
}
|
||||
|
||||
// 获得可用的班次列表
|
||||
export function listClassesEnabled() {
|
||||
return request({
|
||||
url: '/base/group-classes/listEnable',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
// 导出班次基础信息 Excel
|
||||
export function exportGroupClassesExcel(query) {
|
||||
return request({
|
||||
|
||||
@@ -1,125 +0,0 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 创建排班计划配置基础信息
|
||||
export function createGroupPlan(data) {
|
||||
return request({
|
||||
url: '/base/group-scheduling-plan/create',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 更新排班计划配置基础信息
|
||||
export function updateGroupPlan(data) {
|
||||
return request({
|
||||
url: '/base/group-scheduling-plan/update',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除排班计划配置基础信息
|
||||
export function deleteGroupPlan(id) {
|
||||
return request({
|
||||
url: '/base/group-scheduling-plan/delete?id=' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
||||
// 获得排班计划配置基础信息
|
||||
export function getGroupPlan(id) {
|
||||
return request({
|
||||
url: '/base/group-scheduling-plan/get?id=' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 获得排班计划配置基础信息分页
|
||||
export function getGroupPlanPage(query) {
|
||||
return request({
|
||||
url: '/base/group-scheduling-plan/page',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 获得所有排班计划列表
|
||||
export function groupPlanList() {
|
||||
return request({
|
||||
url: '/base/group-scheduling-plan/listAll',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
// 获得排班计划相关班组列表
|
||||
export function groupPlanTeamList(id) {
|
||||
return request({
|
||||
url: '/base/group-scheduling-plan-team/teamListByPlanId?planId=' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
// 获得排班计划相关班次列表
|
||||
export function groupPlanClassesList(id) {
|
||||
return request({
|
||||
url: '/base/group-scheduling-plan-classes/classesListByPlanId?planId=' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
// 获取code
|
||||
export function getCode() {
|
||||
return request({
|
||||
url: '/base/group-scheduling-plan/getCode',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 导出排班计划配置基础信息 Excel
|
||||
export function exportGroupPlanExcel(query) {
|
||||
return request({
|
||||
url: '/base/group-scheduling-plan/export-excel',
|
||||
method: 'get',
|
||||
params: query,
|
||||
responseType: 'blob'
|
||||
})
|
||||
}
|
||||
|
||||
// 获得产线工段树形结构
|
||||
export function getGroupPlanTree() {
|
||||
return request({
|
||||
url: '/base/group-scheduling-plan/getLineSectionTree',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 创建排班计划产线工段
|
||||
export function createGroupPlanLine(data) {
|
||||
return request({
|
||||
url: '/base/group-scheduling-plan-line-section/createPlanLineSection',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 更新排班计划产线工段
|
||||
export function updateGroupPlanLine(data) {
|
||||
return request({
|
||||
url: '/base/group-scheduling-plan-line-section/updatePlanLineSection',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 获得排班计划配置基础信息
|
||||
export function getGroupPlanLine(id) {
|
||||
return request({
|
||||
url: '/base/group-scheduling-plan-line-section/getLineSectionByPlanId?planId=' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 获得当前登录用户所在部门id
|
||||
export function getLoginUserDeptId() {
|
||||
return request({
|
||||
url: '/base/group-scheduling-plan-line-section/getLoginUserDeptId',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
@@ -1,60 +0,0 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 创建排班规则基础信息
|
||||
export function createGroupRule(data) {
|
||||
return request({
|
||||
url: '/base/group-scheduling-rule/create',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
// 作废排班规则
|
||||
export function disableGroupRule(id) {
|
||||
return request({
|
||||
url: '/base/group-scheduling-rule/disable?id=' + id,
|
||||
method: 'post',
|
||||
})
|
||||
}
|
||||
// 更新排班规则基础信息
|
||||
export function updateGroupRule(data) {
|
||||
return request({
|
||||
url: '/base/group-scheduling-rule/update',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除排班规则基础信息
|
||||
export function deleteGroupRule(id) {
|
||||
return request({
|
||||
url: '/base/group-scheduling-rule/delete?id=' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
||||
// 获得排班规则基础信息
|
||||
export function getGroupRule(id) {
|
||||
return request({
|
||||
url: '/base/group-scheduling-rule/get?id=' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 获得排班规则基础信息分页
|
||||
export function getGroupRulePage(query) {
|
||||
return request({
|
||||
url: '/base/group-scheduling-rule/page',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 导出排班规则基础信息 Excel
|
||||
export function exportGroupRuleExcel(query) {
|
||||
return request({
|
||||
url: '/base/group-scheduling-rule/export-excel',
|
||||
method: 'get',
|
||||
params: query,
|
||||
responseType: 'blob'
|
||||
})
|
||||
}
|
||||
@@ -8,14 +8,7 @@ export function getPreset(query) {
|
||||
params: query
|
||||
})
|
||||
}
|
||||
// 获取某月预排班
|
||||
export function getScheduling(query) {
|
||||
return request({
|
||||
url: '/base/group-team-scheduling/getScheduling',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 批量创建-更新排班信息
|
||||
export function createOrUpdateList(data) {
|
||||
return request({
|
||||
@@ -33,22 +26,3 @@ export function autoSet(query) {
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 获得排班信息分页
|
||||
export function schedulingPage(query) {
|
||||
return request({
|
||||
url: '/base/group-team-scheduling/page',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 导出Excel
|
||||
export function exportSchedulingExcel(query) {
|
||||
return request({
|
||||
url: '/base/group-team-scheduling/export-excel',
|
||||
method: 'get',
|
||||
params: query,
|
||||
responseType: 'blob'
|
||||
})
|
||||
}
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
/*
|
||||
* @Author: zwq
|
||||
* @Date: 2024-04-09 16:42:19
|
||||
* @LastEditors: zwq
|
||||
* @LastEditTime: 2024-04-10 14:33:52
|
||||
* @Description:
|
||||
* @Author: Do not edit
|
||||
* @Date: 2023-10-21 11:50:46
|
||||
* @LastEditTime: 2023-10-24 11:22:28
|
||||
* @LastEditors: DY
|
||||
* @Description:
|
||||
*/
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 创建原料
|
||||
// 创建物料
|
||||
export function createMaterial(data) {
|
||||
return request({
|
||||
url: '/base/material/create',
|
||||
@@ -16,7 +16,7 @@ export function createMaterial(data) {
|
||||
})
|
||||
}
|
||||
|
||||
// 更新原料
|
||||
// 更新物料
|
||||
export function updateMaterial(data) {
|
||||
return request({
|
||||
url: '/base/material/update',
|
||||
@@ -25,14 +25,7 @@ export function updateMaterial(data) {
|
||||
})
|
||||
}
|
||||
|
||||
// 获取code
|
||||
export function getCode() {
|
||||
return request({
|
||||
url: '/base/material/autoCode',
|
||||
method: 'POST'
|
||||
})
|
||||
}
|
||||
// 删除原料
|
||||
// 删除物料
|
||||
export function deleteMaterial(id) {
|
||||
return request({
|
||||
url: '/base/material/delete?id=' + id,
|
||||
@@ -40,7 +33,7 @@ export function deleteMaterial(id) {
|
||||
})
|
||||
}
|
||||
|
||||
// 获得原料
|
||||
// 获得物料
|
||||
export function getMaterial(id) {
|
||||
return request({
|
||||
url: '/base/material/get?id=' + id,
|
||||
@@ -48,7 +41,15 @@ export function getMaterial(id) {
|
||||
})
|
||||
}
|
||||
|
||||
// 获得原料分页
|
||||
// 获得物料code
|
||||
export function getCode() {
|
||||
return request({
|
||||
url: '/base/material/getMaterialCode',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 获得物料分页
|
||||
export function getMaterialPage(query) {
|
||||
return request({
|
||||
url: '/base/material/page',
|
||||
@@ -56,20 +57,65 @@ export function getMaterialPage(query) {
|
||||
params: query
|
||||
})
|
||||
}
|
||||
// 获得原料列表
|
||||
export function getMaterialList() {
|
||||
|
||||
// 获得物料列表
|
||||
export function getMaterialList(query) {
|
||||
return request({
|
||||
url: '/base/material/list',
|
||||
url: '/base/material/listbyfilter',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 导出原料 Excel
|
||||
export function exportMaterialExcel(query) {
|
||||
// 获得供应商所有列表
|
||||
export function getSupplierList(query) {
|
||||
return request({
|
||||
url: '/base/material/export-excel',
|
||||
url: '/base/core-supplier/listAll',
|
||||
method: 'get',
|
||||
params: query,
|
||||
responseType: 'blob'
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 获得物料属性列表
|
||||
export function getMaterialAttrList(query) {
|
||||
return request({
|
||||
url: '/base/material-attr/page',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 创建物料属性
|
||||
export function createMaterialAttr(data) {
|
||||
return request({
|
||||
url: '/base/material-attr/create',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 更新物料属性
|
||||
export function updateMaterialAttr(data) {
|
||||
return request({
|
||||
url: '/base/material-attr/update',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除物料属性
|
||||
export function deleteMaterialAttr(id) {
|
||||
return request({
|
||||
url: '/base/material-attr/delete?id=' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
||||
// 获得物料属性
|
||||
export function getMaterialAttr(query) {
|
||||
return request({
|
||||
url: '/base/material-attr/get',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
68
src/api/base/materialDate.js
Normal file
68
src/api/base/materialDate.js
Normal file
@@ -0,0 +1,68 @@
|
||||
/*
|
||||
* @Author: Do not edit
|
||||
* @Date: 2023-10-21 11:50:46
|
||||
* @LastEditTime: 2023-10-24 17:09:59
|
||||
* @LastEditors: DY
|
||||
* @Description:
|
||||
*/
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 创建物料批次
|
||||
export function createMaterialDate(data) {
|
||||
return request({
|
||||
url: '/base/material-date/create',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 更新物料批次
|
||||
export function updateMaterialDate(data) {
|
||||
return request({
|
||||
url: '/base/material-date/update',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除物料批次
|
||||
export function deleteMaterialDate(id) {
|
||||
return request({
|
||||
url: '/base/material-date/delete?id=' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
||||
// 获得物料批次
|
||||
export function getMaterialDate(id) {
|
||||
return request({
|
||||
url: '/base/material-date/getDetail?id=' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 获得物料批次code
|
||||
export function getCode() {
|
||||
return request({
|
||||
url: '/base/material-date/getMaterialDateCode',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 获得物料批次分页
|
||||
export function getMaterDatePage(query) {
|
||||
return request({
|
||||
url: '/base/material-date/page',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 获得物料批次列表
|
||||
export function getMaterDateList(query) {
|
||||
return request({
|
||||
url: '/base/material-date/listbyfilter',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
@@ -1,68 +0,0 @@
|
||||
/*
|
||||
* @Author: zwq
|
||||
* @Date: 2024-04-09 16:42:19
|
||||
* @LastEditors: zwq
|
||||
* @LastEditTime: 2024-04-10 14:31:46
|
||||
* @Description:
|
||||
*/
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 创建原料
|
||||
export function createMaterialPricing(data) {
|
||||
return request({
|
||||
url: '/base/material-pricing/create',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 更新原料
|
||||
export function updateMaterialPricing(data) {
|
||||
return request({
|
||||
url: '/base/material-pricing/update',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 获取code
|
||||
export function getCode() {
|
||||
return request({
|
||||
url: '/base/material-pricing/autoCode',
|
||||
method: 'POST'
|
||||
})
|
||||
}
|
||||
// 删除原料
|
||||
export function deleteMaterialPricing(id) {
|
||||
return request({
|
||||
url: '/base/material-pricing/delete?id=' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
||||
// 获得原料
|
||||
export function getMaterialPricing(id) {
|
||||
return request({
|
||||
url: '/base/material-pricing/get?id=' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 获得原料分页
|
||||
export function getMaterialPricingPage(query) {
|
||||
return request({
|
||||
url: '/base/material-pricing/page',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 导出原料 Excel
|
||||
export function exportMaterialPricingExcel(query) {
|
||||
return request({
|
||||
url: '/base/material-pricing/export-excel',
|
||||
method: 'get',
|
||||
params: query,
|
||||
responseType: 'blob'
|
||||
})
|
||||
}
|
||||
112
src/api/base/materialProductBom.js
Normal file
112
src/api/base/materialProductBom.js
Normal file
@@ -0,0 +1,112 @@
|
||||
/*
|
||||
* @Author: Do not edit
|
||||
* @Date: 2023-10-21 11:50:46
|
||||
* @LastEditTime: 2023-10-26 20:06:29
|
||||
* @LastEditors: DY
|
||||
* @Description:
|
||||
*/
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 创建产品Bom
|
||||
export function createMaterialPB(data) {
|
||||
return request({
|
||||
url: '/base/material-product-bom/create',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 更新产品Bom
|
||||
export function updateMaterialPB(data) {
|
||||
return request({
|
||||
url: '/base/material-product-bom/update',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除产品Bom
|
||||
export function deleteMaterialPB(id) {
|
||||
return request({
|
||||
url: '/base/material-product-bom/delete?id=' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
||||
// 获得产品Bom
|
||||
export function getMaterialPB(id) {
|
||||
return request({
|
||||
url: '/base/material-product-bom/get?id=' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 获得产品Bomcode
|
||||
export function getCode() {
|
||||
return request({
|
||||
url: '/base/material-product-bom/getMaterialProductBomCode',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 获得产品Bom分页
|
||||
export function getMaterialPBPage(query) {
|
||||
return request({
|
||||
url: '/base/material-product-bom/page',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 获得产品Bom列表
|
||||
export function getMaterialPBList(query) {
|
||||
return request({
|
||||
url: '/base/material-product-bom/listbyfilter',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 获得产品列表
|
||||
export function getProList(query) {
|
||||
return request({
|
||||
url: '/base/core-product/listAll',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 获得产品Bom详细分页
|
||||
export function getProBomList(query) {
|
||||
return request({
|
||||
url: '/base/material-product-bom-det/page',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 创建产品Bom详细
|
||||
export function createMaterialPBDet(data) {
|
||||
return request({
|
||||
url: '/base/material-product-bom-det/create',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 更新产品Bom详细
|
||||
export function updateMaterialPBDet(data) {
|
||||
return request({
|
||||
url: '/base/material-product-bom-det/update',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除产品Bom详细
|
||||
export function deleteMaterialPBDet(id) {
|
||||
return request({
|
||||
url: '/base/material-product-bom-det/delete?id=' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
69
src/api/base/materialUseLog.js
Normal file
69
src/api/base/materialUseLog.js
Normal file
@@ -0,0 +1,69 @@
|
||||
/*
|
||||
* @Author: Do not edit
|
||||
* @Date: 2023-10-21 11:50:46
|
||||
* @LastEditTime: 2023-10-26 09:32:21
|
||||
* @LastEditors: DY
|
||||
* @Description:
|
||||
*/
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 创建物料使用记录
|
||||
export function createMaterialLog(data) {
|
||||
return request({
|
||||
url: '/base/material-use-log/create',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 更新物料使用记录
|
||||
export function updateMaterialLog(data) {
|
||||
return request({
|
||||
url: '/base/material-use-log/update',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 获得物料使用记录
|
||||
export function getMaterialLog(id) {
|
||||
return request({
|
||||
url: '/base/material-use-log/getDetail?id=' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 获得物料使用记录分页
|
||||
export function getMaterialLogPage(query) {
|
||||
return request({
|
||||
url: '/base/material-use-log/page',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 获得所有设备列表
|
||||
export function getEqListAll(query) {
|
||||
return request({
|
||||
url: '/base/core-equipment/listAll',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 获得所有员工列表
|
||||
export function getworkerAll(query) {
|
||||
return request({
|
||||
url: '/base/core-worker/listAll',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 删除物料使用记录
|
||||
export function deleteMaterialLog(id) {
|
||||
return request({
|
||||
url: '/base/material-use-log/delete?id=' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
68
src/api/base/modelType.js
Normal file
68
src/api/base/modelType.js
Normal file
@@ -0,0 +1,68 @@
|
||||
/*
|
||||
* @Author: zhp
|
||||
* @Date: 2023-10-18 09:33:57
|
||||
* @LastEditTime: 2023-10-18 16:02:09
|
||||
* @LastEditors: zhp
|
||||
* @Description:
|
||||
*/
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 创建包装
|
||||
export function createPackingType(data) {
|
||||
return request({
|
||||
url: '/base/packaging-print-type/create',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 获得包装code
|
||||
export function getCode() {
|
||||
return request({
|
||||
url: '/base/packaging-print-log/getPackagingSerialCode',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
// 更新包装
|
||||
export function updatePackingType(data) {
|
||||
return request({
|
||||
url: '/base/packaging-print-type/update',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除包装
|
||||
export function deletePackingType(id) {
|
||||
return request({
|
||||
url: '/base/packaging-print-type/delete?id=' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
||||
// 获得包装
|
||||
export function getPackingType(id) {
|
||||
return request({
|
||||
url: '/base/packaging-print-type/get?id=' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 获得包装分页
|
||||
export function getPackingTypePage(query) {
|
||||
return request({
|
||||
url: '/base/packaging-print-type/page',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 导出包装 Excel
|
||||
export function exportPackingExcel(query) {
|
||||
return request({
|
||||
url: '/base/packaging-print-type/export-excel',
|
||||
method: 'get',
|
||||
params: query,
|
||||
responseType: 'blob'
|
||||
})
|
||||
}
|
||||
96
src/api/base/orderManage.js
Normal file
96
src/api/base/orderManage.js
Normal file
@@ -0,0 +1,96 @@
|
||||
import request from '@/utils/request'
|
||||
// 条件获得订单列表
|
||||
export function orderList(query) {
|
||||
return request({
|
||||
url: '/base/order/listbyfilter',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 条件获得工单列表
|
||||
export function workOrderList(query) {
|
||||
return request({
|
||||
url: '/base/core-work-order/listbyfilter',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 获得订单分页
|
||||
export function getOrderPage(query) {
|
||||
return request({
|
||||
url: '/base/order/page',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 获取订单code
|
||||
export function getOrderCode() {
|
||||
return request({
|
||||
url: '/base/order/getOrderCode',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 获取工单code
|
||||
export function getWorkOrderCode() {
|
||||
return request({
|
||||
url: '/base/order/getWorkOrderCode',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 获得订单
|
||||
export function getOrderById(query) {
|
||||
return request({
|
||||
url: '/base/order/get',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 获得工艺流程列表
|
||||
export function getProcessFlowList() {
|
||||
return request({
|
||||
url: '/extend/process-flow/listAll',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 创建订单
|
||||
export function orderCreate(data) {
|
||||
return request({
|
||||
url: '/base/order/create',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 更新订单
|
||||
export function orderUpdate(data) {
|
||||
return request({
|
||||
url: '/base/order/update',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除订单
|
||||
export function orderDelete(query) {
|
||||
return request({
|
||||
url: '/base/order/delete',
|
||||
method: 'delete',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 下发订单,绑定的穿工单id,新建不传
|
||||
export function orderIssue(data) {
|
||||
return request({
|
||||
url: '/base/order/issue',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
92
src/api/base/packingInfo.js
Normal file
92
src/api/base/packingInfo.js
Normal file
@@ -0,0 +1,92 @@
|
||||
/*
|
||||
* @Author: zhp
|
||||
* @Date: 2023-10-18 09:33:57
|
||||
* @LastEditTime: 2023-10-18 16:18:12
|
||||
* @LastEditors: zhp
|
||||
* @Description:
|
||||
*/
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 创建包装
|
||||
export function createPacking(data) {
|
||||
return request({
|
||||
url: '/base/packaging-print-log/create',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 获得包装code
|
||||
export function getCode() {
|
||||
return request({
|
||||
url: '/base/packaging-print-log/getPackagingSerialCode',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
// 更新包装
|
||||
export function updatePacking(data) {
|
||||
return request({
|
||||
url: '/base/packaging-print-log/update',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除包装
|
||||
export function deletePacking(id) {
|
||||
return request({
|
||||
url: '/base/packaging-print-log/delete?id=' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
||||
// 获得包装
|
||||
export function getPacking(id) {
|
||||
return request({
|
||||
url: '/base/packaging-print-log/get?id=' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 获得包装分页
|
||||
export function getPackingPage(query) {
|
||||
return request({
|
||||
url: '/base/packaging-print-log/page',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 导出包装 Excel
|
||||
export function exportPackingExcel(query) {
|
||||
return request({
|
||||
url: '/base/packaging-print-log/export-excel',
|
||||
method: 'get',
|
||||
params: query,
|
||||
responseType: 'blob'
|
||||
})
|
||||
}
|
||||
|
||||
export function getWorkOrderList(query) {
|
||||
return request({
|
||||
url: '/base/core-work-order/listbyfilter',
|
||||
method: 'get',
|
||||
params: query,
|
||||
})
|
||||
}
|
||||
|
||||
export function getCustomerList(query) {
|
||||
return request({
|
||||
url: '/base/core-customer/listAll',
|
||||
method: 'get',
|
||||
params: query,
|
||||
})
|
||||
}
|
||||
|
||||
export function getModelList(query) {
|
||||
return request({
|
||||
url: '/base/packaging-print-model/listbyfilter',
|
||||
method: 'get',
|
||||
params: query,
|
||||
})
|
||||
}
|
||||
92
src/api/base/printModel.js
Normal file
92
src/api/base/printModel.js
Normal file
@@ -0,0 +1,92 @@
|
||||
/*
|
||||
* @Author: zhp
|
||||
* @Date: 2023-10-18 09:33:57
|
||||
* @LastEditTime: 2023-10-19 15:28:00
|
||||
* @LastEditors: zhp
|
||||
* @Description:
|
||||
*/
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 创建包装
|
||||
export function createPackingModel(data) {
|
||||
return request({
|
||||
url: '/base/packaging-print-model/create',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 获得包装code
|
||||
// export function getCode() {
|
||||
// return request({
|
||||
// url: '/base/packaging-print-log/getPackagingSerialCode',
|
||||
// method: 'get'
|
||||
// })
|
||||
// }
|
||||
// 更新包装
|
||||
export function updatePackingModel(data) {
|
||||
return request({
|
||||
url: '/base/packaging-print-model/update',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除包装
|
||||
export function deletePackingModel(id) {
|
||||
return request({
|
||||
url: '/base/packaging-print-model/delete?id=' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
||||
// 获得包装
|
||||
export function getPackingModel(id) {
|
||||
return request({
|
||||
url: '/base/packaging-print-model/get?id=' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 获得包装分页
|
||||
export function getPackingModelPage(query) {
|
||||
return request({
|
||||
url: '/base/packaging-print-model/page',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 导出包装 Excel
|
||||
// export function exportPackingExcel(query) {
|
||||
// return request({
|
||||
// url: '/base/packaging-print-log/export-excel',
|
||||
// method: 'get',
|
||||
// params: query,
|
||||
// responseType: 'blob'
|
||||
// })
|
||||
// }
|
||||
|
||||
// export function getWorkOrderList(query) {
|
||||
// return request({
|
||||
// url: '/base/core-work-order/listbyfilter',
|
||||
// method: 'get',
|
||||
// params: query,
|
||||
// })
|
||||
// }
|
||||
|
||||
// export function getCustomerList(query) {
|
||||
// return request({
|
||||
// url: '/base/core-customer/listAll',
|
||||
// method: 'get',
|
||||
// params: query,
|
||||
// })
|
||||
// }
|
||||
|
||||
export function getTypeList(query) {
|
||||
return request({
|
||||
url: '/base/packaging-print-type/listbyfilter',
|
||||
method: 'get',
|
||||
params: query,
|
||||
})
|
||||
}
|
||||
8
src/api/base/product.js
Normal file
8
src/api/base/product.js
Normal file
@@ -0,0 +1,8 @@
|
||||
import request from '@/utils/request'
|
||||
// 获得产品列表
|
||||
export function getProductAll() {
|
||||
return request({
|
||||
url: '/base/core-product/listAll',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
@@ -1,23 +1,8 @@
|
||||
/*
|
||||
* @Author: zwq
|
||||
* @Date: 2024-03-27 15:49:55
|
||||
* @LastEditors: zwq
|
||||
* @LastEditTime: 2024-09-10 14:36:19
|
||||
* @Description:
|
||||
*/
|
||||
import request from '@/utils/request'
|
||||
// 获得所有工厂产线列表
|
||||
export function getLineAll() {
|
||||
return request({
|
||||
url: '/base/production-line/listAll',
|
||||
url: '/base/core-production-line/listAll',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
// 获得产线分页
|
||||
export function getLinePage(query) {
|
||||
return request({
|
||||
url: '/base/production-line/page',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
}
|
||||
8
src/api/base/workOrder.js
Normal file
8
src/api/base/workOrder.js
Normal file
@@ -0,0 +1,8 @@
|
||||
import request from '@/utils/request'
|
||||
// 获得工单列表
|
||||
export function workOrderList() {
|
||||
return request({
|
||||
url: '/base/core-work-order/listbyfilter',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
@@ -14,13 +14,4 @@ export function getWorker(query) {
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 获得该班组其他可选组员列表(除去现有组员)
|
||||
export function otherWorkerList(query) {
|
||||
return request({
|
||||
url: '/base/group-team-det/otherWorkerList',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
@@ -2,7 +2,7 @@ import request from '@/utils/request'
|
||||
// 获得所有产线工段列表
|
||||
export function getWorkShopAll() {
|
||||
return request({
|
||||
url: '/base/workshop-section/listAll',
|
||||
url: '/base/core-workshop-section/listAll',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
@@ -1,8 +1,8 @@
|
||||
/*
|
||||
* @Author: zhp
|
||||
* @Date: 2023-09-12 14:07:04
|
||||
* @LastEditTime: 2025-01-08 15:47:17
|
||||
* @LastEditors: zwq
|
||||
* @LastEditTime: 2023-09-13 09:53:45
|
||||
* @LastEditors: zhp
|
||||
* @Description:
|
||||
*/
|
||||
import request from '@/utils/request'
|
||||
@@ -22,26 +22,3 @@ export function getCT(data) {
|
||||
data: data
|
||||
})
|
||||
}
|
||||
// 获取产线平衡分析数据(new)
|
||||
export function getNewCTNow(data) {
|
||||
return request({
|
||||
url: '/analysis/production-analysis/getNewCTNow',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
// 获取产线平衡分析数据趋势图(new)
|
||||
export function getNewCTCharts(data) {
|
||||
return request({
|
||||
url: '/analysis/production-analysis/getNewCTCharts',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
// 获取产线平衡分析数据设备list(new)
|
||||
export function getNewCTDet(id) {
|
||||
return request({
|
||||
url: '/analysis/production-analysis/getNewCTDet?lineId='+id,
|
||||
method: 'get',
|
||||
})
|
||||
}
|
||||
|
||||
@@ -58,12 +58,3 @@ export function exportFactoryExcel(query) {
|
||||
responseType: 'blob'
|
||||
})
|
||||
}
|
||||
// 获取产线设备状态
|
||||
export function getLineEqStatus(data) {
|
||||
return request({
|
||||
url: '/base/production-line/getLineEqStatus',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
@@ -1,28 +0,0 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
|
||||
// 切换工艺
|
||||
export function switchLineBindProcess(data) {
|
||||
return request({
|
||||
url: '/base/line-bind-process/switch',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
// 获得产线工艺目前生产工艺
|
||||
export function getLineBindProcessPage(query) {
|
||||
return request({
|
||||
url: '/base/line-bind-process/nowList',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 获得产线工艺log分页
|
||||
export function getLineBindProcessLogPage(query) {
|
||||
return request({
|
||||
url: '/base/line-bind-process/logPage',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
@@ -16,14 +16,6 @@ export function switchLineBindProduct(data) {
|
||||
data: data
|
||||
})
|
||||
}
|
||||
// 切换产线是否可以自动
|
||||
export function switchAutoProduct(data) {
|
||||
return request({
|
||||
url: '/base/line-bind-product/switchAuto',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
// 更新产线目前生产产品表 主要为更新
|
||||
export function updateLineBindProduct(data) {
|
||||
return request({
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
/*
|
||||
* @Author: Do not edit
|
||||
* @Date: 2023-09-12 09:44:53
|
||||
* @LastEditTime: 2025-01-07 09:57:36
|
||||
* @LastEditors: zwq
|
||||
* @Description:
|
||||
* @LastEditTime: 2023-09-13 16:11:41
|
||||
* @LastEditors: DY
|
||||
* @Description:
|
||||
*/
|
||||
import request from '@/utils/request'
|
||||
|
||||
@@ -17,52 +17,9 @@ export function getPdlAutoReport(data) {
|
||||
}
|
||||
|
||||
// 获得所有工厂产线列表
|
||||
export function getPdList(id) {
|
||||
export function getPdList() {
|
||||
return request({
|
||||
url: '/base/production-line/listAll' + (id ? '?id=' + id : ''),
|
||||
url: '/base/production-line/listAll',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
// 获得产线自动报表
|
||||
export function getLineAuto(data) {
|
||||
return request({
|
||||
url: '/monitoring/production-monitor/getPdlAutoReportNew',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 获得产品自动报表
|
||||
export function getProductAuto(data) {
|
||||
return request({
|
||||
url: '/monitoring/production-monitor/getProcessAutoReportNew',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 班组自动报表分页
|
||||
export function getTeamReportPage(data) {
|
||||
return request({
|
||||
url: '/monitoring/group-off-record/page',
|
||||
method: 'post',
|
||||
data: data,
|
||||
});
|
||||
}
|
||||
|
||||
// 班组自动报表分页详细
|
||||
export function getTeamReportPageDet(id) {
|
||||
return request({
|
||||
url: '/monitoring/group-off-record/get?id=' + id,
|
||||
method: 'get',
|
||||
})
|
||||
}
|
||||
|
||||
export function exportGroupProductReportExcel(data) {
|
||||
return request({
|
||||
url: '/monitoring/group-off-record/export-det-excel',
|
||||
method: 'get',
|
||||
params: data,
|
||||
responseType: 'blob',
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -1,9 +1,9 @@
|
||||
/*
|
||||
* @Author: Do not edit
|
||||
* @Date: 2023-09-12 09:44:53
|
||||
* @LastEditTime: 2025-03-03 10:43:34
|
||||
* @LastEditors: zwq
|
||||
* @Description:
|
||||
* @LastEditTime: 2023-09-14 10:25:46
|
||||
* @LastEditors: DY
|
||||
* @Description:
|
||||
*/
|
||||
import request from '@/utils/request'
|
||||
|
||||
@@ -22,22 +22,4 @@ export function getPdList() {
|
||||
url: '/base/production-line/listAll',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
// 产线统计数据查询-历史
|
||||
export function getPdlAutoReportNewSearch(data) {
|
||||
return request({
|
||||
url: '/monitoring/production-monitor/getPdlAutoReportNewSearch',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 产线统计数据查询-当前
|
||||
export function getPdlAutoReportNewSearchNow(data) {
|
||||
return request({
|
||||
url: '/monitoring/production-monitor/getPdlAutoReportNewSearchNow',
|
||||
method: 'post',
|
||||
data: data,
|
||||
timeout: 60000,
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -1,54 +0,0 @@
|
||||
/*
|
||||
* @Author: zwq
|
||||
* @Date: 2024-04-18 16:53:17
|
||||
* @LastEditors: zwq
|
||||
* @LastEditTime: 2024-09-06 14:35:13
|
||||
* @Description:
|
||||
*/
|
||||
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 获得总成本统计-按日期分页
|
||||
export function getCostSumPage(query) {
|
||||
return request({
|
||||
url: '/monitoring/cost-sum/page',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
// 更新总成本统计-按日期
|
||||
export function updateCostSum(data) {
|
||||
return request({
|
||||
url: '/monitoring/cost-sum/update',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
// 获得原片成本统计成本查询分页
|
||||
export function getRawCostStatisticsRealtimePage(query) {
|
||||
return request({
|
||||
url: '/monitoring/cost-sum/page',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 导出总成本统计-按日期 Excel
|
||||
export function exportCostSumExcel(query) {
|
||||
return request({
|
||||
url: '/monitoring/cost-sum/export-excel',
|
||||
method: 'get',
|
||||
params: query,
|
||||
responseType: 'blob'
|
||||
})
|
||||
}
|
||||
|
||||
// 导出原片成本统计-历史成本 Excel
|
||||
export function exportRawCostStatisticsHisExcel(query) {
|
||||
return request({
|
||||
url: '/monitoring/cost-sum/export-excel',
|
||||
method: 'get',
|
||||
params: query,
|
||||
responseType: 'blob'
|
||||
})
|
||||
}
|
||||
@@ -1,55 +0,0 @@
|
||||
/*
|
||||
* @Author: zwq
|
||||
* @Date: 2024-04-18 16:53:17
|
||||
* @LastEditors: zwq
|
||||
* @LastEditTime: 2024-09-06 15:00:09
|
||||
* @Description:
|
||||
*/
|
||||
|
||||
import request from '@/utils/request'
|
||||
// 更新深加工良品率
|
||||
export function updateDeepRatioHis(data) {
|
||||
return request({
|
||||
url: '/monitoring/cost-deep-ratio-his/update',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
// 获得深加工产线良品率
|
||||
export function getDeepPDRatioHisPage(query) {
|
||||
return request({
|
||||
url: '/monitoring/cost-deep-ratio-his/page-pd',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
// 获得深加工工段良品率
|
||||
export function getDeepWSRatioHisPage(query) {
|
||||
return request({
|
||||
url: '/monitoring/cost-deep-ratio-his/page-ws',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 导出深加工工段良品率 Excel
|
||||
export function exportDeepWSRatioHisExcel(query) {
|
||||
return request({
|
||||
url: '/monitoring/cost-deep-ratio-his/export-excel-ws',
|
||||
method: 'get',
|
||||
params: query,
|
||||
responseType: 'blob'
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
// 导出深加工产线良品率 Excel
|
||||
export function exportDeepPDRatioHisExcel(query) {
|
||||
return request({
|
||||
url: '/monitoring/cost-deep-ratio-his/export-excel-pd',
|
||||
method: 'get',
|
||||
params: query,
|
||||
responseType: 'blob'
|
||||
})
|
||||
}
|
||||
|
||||
@@ -1,53 +0,0 @@
|
||||
/*
|
||||
* @Author: zwq
|
||||
* @Date: 2024-04-18 16:53:17
|
||||
* @LastEditors: zwq
|
||||
* @LastEditTime: 2024-04-19 16:11:19
|
||||
* @Description:
|
||||
*/
|
||||
|
||||
import request from '@/utils/request'
|
||||
// 更新原片能源历史
|
||||
export function updateEnergyHis(data) {
|
||||
return request({
|
||||
url: '/monitoring/cost-energy-his/update',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
// 获得原片能源历史分页
|
||||
export function getEnergyHisPage(query) {
|
||||
return request({
|
||||
url: '/monitoring/cost-energy-his/page',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 获得原片能源-成本查询分页
|
||||
export function getEnergyRealtimePage(query) {
|
||||
return request({
|
||||
url: '/monitoring/cost-energy-realtime/page',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
// 导出能源成本成本查询 Excel
|
||||
export function exportEnergyRealtimeExcel(query) {
|
||||
return request({
|
||||
url: '/monitoring/cost-energy-realtime/export-excel',
|
||||
method: 'get',
|
||||
params: query,
|
||||
responseType: 'blob'
|
||||
})
|
||||
}
|
||||
|
||||
// 导出能源成本历史 Excel
|
||||
export function exportEnergyHisExcel(query) {
|
||||
return request({
|
||||
url: '/monitoring/cost-energy-his/export-excel',
|
||||
method: 'get',
|
||||
params: query,
|
||||
responseType: 'blob'
|
||||
})
|
||||
}
|
||||
@@ -1,54 +0,0 @@
|
||||
/*
|
||||
* @Author: zwq
|
||||
* @Date: 2024-04-18 16:53:17
|
||||
* @LastEditors: zwq
|
||||
* @LastEditTime: 2024-09-06 15:19:24
|
||||
* @Description:
|
||||
*/
|
||||
|
||||
import request from '@/utils/request'
|
||||
// 更新深加工能源历史
|
||||
export function updateEnergyHis(data) {
|
||||
return request({
|
||||
url: '/monitoring/cost-deep-energy-his/update',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
// 获得深加工能源历史分页
|
||||
export function getEnergyHisPage(query) {
|
||||
return request({
|
||||
url: '/monitoring/cost-deep-energy-his/page',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 获得深加工能源-成本查询分页
|
||||
export function getEnergyRealtimePage(query) {
|
||||
return request({
|
||||
url: '/monitoring/cost-deep-energy-realtime/page',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 导出深加工能源成本成本查询 Excel
|
||||
export function exportEnergyRealtimeExcel(query) {
|
||||
return request({
|
||||
url: '/monitoring/cost-deep-energy-realtime/export-excel',
|
||||
method: 'get',
|
||||
params: query,
|
||||
responseType: 'blob'
|
||||
})
|
||||
}
|
||||
|
||||
// 导出深加工能源成本历史 Excel
|
||||
export function exportEnergyHisExcel(query) {
|
||||
return request({
|
||||
url: '/monitoring/cost-deep-energy-his/export-excel',
|
||||
method: 'get',
|
||||
params: query,
|
||||
responseType: 'blob'
|
||||
})
|
||||
}
|
||||
@@ -1,54 +0,0 @@
|
||||
/*
|
||||
* @Author: zwq
|
||||
* @Date: 2024-04-18 16:53:17
|
||||
* @LastEditors: zwq
|
||||
* @LastEditTime: 2024-09-05 13:55:30
|
||||
* @Description:
|
||||
*/
|
||||
|
||||
import request from '@/utils/request'
|
||||
// 更新原料成本-历史
|
||||
export function updateMaterialHis(data) {
|
||||
return request({
|
||||
url: '/monitoring/cost-material-his/update',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
// 获得原料成本-历史分页
|
||||
export function getMaterialHisPage(query) {
|
||||
return request({
|
||||
url: '/monitoring/cost-material-his/page',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 获得原料成本-成本查询分页
|
||||
export function getMaterialRealtimePage(query) {
|
||||
return request({
|
||||
url: '/monitoring/cost-material-realtime/page',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 导出原料成本成本查询 Excel
|
||||
export function exportMaterialRealtimeExcel(query) {
|
||||
return request({
|
||||
url: '/monitoring/cost-material-realtime/export-excel',
|
||||
method: 'get',
|
||||
params: query,
|
||||
responseType: 'blob'
|
||||
})
|
||||
}
|
||||
|
||||
// 导出原料成本历史 Excel
|
||||
export function exportMaterialHisExcel(query) {
|
||||
return request({
|
||||
url: '/monitoring/cost-material-his/export-excel',
|
||||
method: 'get',
|
||||
params: query,
|
||||
responseType: 'blob'
|
||||
})
|
||||
}
|
||||
@@ -1,36 +0,0 @@
|
||||
/*
|
||||
* @Author: zwq
|
||||
* @Date: 2024-04-18 16:53:17
|
||||
* @LastEditors: zwq
|
||||
* @LastEditTime: 2024-04-22 10:53:55
|
||||
* @Description:
|
||||
*/
|
||||
|
||||
import request from '@/utils/request'
|
||||
// 更新原片良品率
|
||||
export function updatecostOriginRatioHis(data) {
|
||||
return request({
|
||||
url: '/monitoring/cost-origin-ratio-his/update',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
// 获得原片良品率
|
||||
export function getcostOriginRatioHisPage(query) {
|
||||
return request({
|
||||
url: '/monitoring/cost-origin-ratio-his/page',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 导出原片良品率 Excel
|
||||
export function exportcostOriginRatioHisExcel(query) {
|
||||
return request({
|
||||
url: '/monitoring/cost-origin-ratio-his/export-excel',
|
||||
method: 'get',
|
||||
params: query,
|
||||
responseType: 'blob'
|
||||
})
|
||||
}
|
||||
|
||||
@@ -1,53 +0,0 @@
|
||||
/*
|
||||
* @Author: zwq
|
||||
* @Date: 2024-04-18 16:53:17
|
||||
* @LastEditors: zwq
|
||||
* @LastEditTime: 2024-04-19 14:24:17
|
||||
* @Description:
|
||||
*/
|
||||
|
||||
import request from '@/utils/request'
|
||||
// 更新原片其他成本-历史
|
||||
export function updateRawOthercostHis(data) {
|
||||
return request({
|
||||
url: '/monitoring/cost-othercost-his/update',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
// 获得原片其他成本-历史分页
|
||||
export function getRawOthercostHisPage(query) {
|
||||
return request({
|
||||
url: '/monitoring/cost-othercost-his/page',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 获得原片其他成本-成本查询分页
|
||||
export function getRawOthercostSunPage(query) {
|
||||
return request({
|
||||
url: '/monitoring/cost-othercost-log/page-sum',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
// 导出原片其他成本-成本查询 Excel
|
||||
export function exportRawOthercostSunExcel(query) {
|
||||
return request({
|
||||
url: '/monitoring/cost-othercost-log/export-excel',
|
||||
method: 'get',
|
||||
params: query,
|
||||
responseType: 'blob'
|
||||
})
|
||||
}
|
||||
|
||||
// 导出原片其他成本-历史 Excel
|
||||
export function exportRawOthercostHisExcel(query) {
|
||||
return request({
|
||||
url: '/monitoring/cost-othercost-his/export-excel',
|
||||
method: 'get',
|
||||
params: query,
|
||||
responseType: 'blob'
|
||||
})
|
||||
}
|
||||
@@ -1,53 +0,0 @@
|
||||
/*
|
||||
* @Author: zwq
|
||||
* @Date: 2024-04-18 16:53:17
|
||||
* @LastEditors: zwq
|
||||
* @LastEditTime: 2024-09-06 15:13:20
|
||||
* @Description:
|
||||
*/
|
||||
|
||||
import request from '@/utils/request'
|
||||
// 更新深加工其他成本-历史
|
||||
export function updateRawOthercostHis(data) {
|
||||
return request({
|
||||
url: '/monitoring/cost-deep-othercost-his/update',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
// 获得深加工其他成本-历史分页
|
||||
export function getRawOthercostHisPage(query) {
|
||||
return request({
|
||||
url: '/monitoring/cost-deep-othercost-his/page',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 获得深加工其他成本-成本查询分页
|
||||
export function getRawOthercostSunPage(query) {
|
||||
return request({
|
||||
url: '/monitoring/cost-deep-othercost-log/page-sum',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
// 导出深加工其他成本-成本查询 Excel
|
||||
export function exportRawOthercostSunExcel(query) {
|
||||
return request({
|
||||
url: '/monitoring/cost-deep-othercost-log/export-excel',
|
||||
method: 'get',
|
||||
params: query,
|
||||
responseType: 'blob'
|
||||
})
|
||||
}
|
||||
|
||||
// 导出深加工其他成本-历史 Excel
|
||||
export function exportRawOthercostHisExcel(query) {
|
||||
return request({
|
||||
url: '/monitoring/cost-deep-othercost-his/export-excel',
|
||||
method: 'get',
|
||||
params: query,
|
||||
responseType: 'blob'
|
||||
})
|
||||
}
|
||||
@@ -1,68 +0,0 @@
|
||||
/*
|
||||
* @Author: zwq
|
||||
* @Date: 2024-04-15 17:01:20
|
||||
* @LastEditors: zwq
|
||||
* @LastEditTime: 2024-09-06 14:12:09
|
||||
* @Description:
|
||||
*/
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 创建原片其他成本-记录
|
||||
export function createRawOthercostLog(data) {
|
||||
return request({
|
||||
url: '/monitoring/cost-othercost-log/create',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 更新原片其他成本-记录
|
||||
export function updateRawOthercostLog(data) {
|
||||
return request({
|
||||
url: '/monitoring/cost-othercost-log/update',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除原片其他成本-记录
|
||||
export function deleteRawOthercostLog(id) {
|
||||
return request({
|
||||
url: '/monitoring/cost-othercost-log/delete?id=' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
||||
// 获得原片其他成本-记录
|
||||
export function getRawOthercostLog(id) {
|
||||
return request({
|
||||
url: '/monitoring/cost-othercost-log/get?id=' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 获得原片其他成本-记录分页
|
||||
export function getRawOthercostLogPage(query) {
|
||||
return request({
|
||||
url: '/monitoring/cost-othercost-log/page',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 导出原片其他成本-记录 Excel
|
||||
export function exportRawOthercostLogExcel(query) {
|
||||
return request({
|
||||
url: '/monitoring/cost-othercost-log/export-log-excel',
|
||||
method: 'get',
|
||||
params: query,
|
||||
responseType: 'blob'
|
||||
})
|
||||
}
|
||||
// 获得所有原片其他成本-记录列表
|
||||
export function getRawOthercostLogAll() {
|
||||
return request({
|
||||
url: '/monitoring/cost-othercost-log/listAll',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
@@ -1,68 +0,0 @@
|
||||
/*
|
||||
* @Author: zwq
|
||||
* @Date: 2024-04-15 17:01:20
|
||||
* @LastEditors: zwq
|
||||
* @LastEditTime: 2024-04-22 14:59:35
|
||||
* @Description:
|
||||
*/
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 创建深加工其他成本-记录
|
||||
export function createRawOthercostLog(data) {
|
||||
return request({
|
||||
url: '/monitoring/cost-deep-othercost-log/create',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 更新深加工其他成本-记录
|
||||
export function updateRawOthercostLog(data) {
|
||||
return request({
|
||||
url: '/monitoring/cost-deep-othercost-log/update',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除深加工其他成本-记录
|
||||
export function deleteRawOthercostLog(id) {
|
||||
return request({
|
||||
url: '/monitoring/cost-deep-othercost-log/delete?id=' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
||||
// 获得深加工其他成本-记录
|
||||
export function getRawOthercostLog(id) {
|
||||
return request({
|
||||
url: '/monitoring/cost-deep-othercost-log/get?id=' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 获得深加工其他成本-记录分页
|
||||
export function getRawOthercostLogPage(query) {
|
||||
return request({
|
||||
url: '/monitoring/cost-deep-othercost-log/page',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 导出深加工其他成本-记录 Excel
|
||||
export function exportRawOthercostLogExcel(query) {
|
||||
return request({
|
||||
url: '/monitoring/cost-deep-othercost-log/export-log-excel',
|
||||
method: 'get',
|
||||
params: query,
|
||||
responseType: 'blob'
|
||||
})
|
||||
}
|
||||
// 获得所有深加工其他成本-记录列表
|
||||
export function getRawOthercostLogAll() {
|
||||
return request({
|
||||
url: '/monitoring/cost-deep-othercost-log/listAll',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
@@ -1,53 +0,0 @@
|
||||
/*
|
||||
* @Author: zwq
|
||||
* @Date: 2024-04-18 16:53:17
|
||||
* @LastEditors: zwq
|
||||
* @LastEditTime: 2024-09-02 14:43:30
|
||||
* @Description:
|
||||
*/
|
||||
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 获得深加工成本分页
|
||||
export function getDeepCostStatisticsPage(query) {
|
||||
return request({
|
||||
url: '/monitoring/cost-deep-cost-his/page',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
// 更新深加工成本-历史
|
||||
export function updateDeepCostStatistics(data) {
|
||||
return request({
|
||||
url: '/monitoring/cost-deep-cost-his/update',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
// 获得深加工成本统计成本查询分页
|
||||
export function getDeepCostStatisticsRealtimePage(query) {
|
||||
return request({
|
||||
url: '/monitoring/cost-deep-cost-realtime/page',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 导出深加工成本统计成本查询 Excel
|
||||
export function exportDeepStatisticsRealtimeExcel(query) {
|
||||
return request({
|
||||
url: '/monitoring/cost-deep-cost-realtime/export-excel',
|
||||
method: 'get',
|
||||
params: query,
|
||||
responseType: 'blob'
|
||||
})
|
||||
}
|
||||
// 导出深加工成本统计-历史成本 Excel
|
||||
export function exportDeepCostStatisticsHisExcel(query) {
|
||||
return request({
|
||||
url: '/monitoring/cost-deep-cost-his/export-excel',
|
||||
method: 'get',
|
||||
params: query,
|
||||
responseType: 'blob'
|
||||
})
|
||||
}
|
||||
@@ -1,68 +0,0 @@
|
||||
/*
|
||||
* @Author: zwq
|
||||
* @Date: 2024-04-15 17:01:20
|
||||
* @LastEditors: zwq
|
||||
* @LastEditTime: 2024-04-22 14:55:00
|
||||
* @Description:
|
||||
*/
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 创建深加工其他成本-配置
|
||||
export function createRawOthercostRule(data) {
|
||||
return request({
|
||||
url: '/monitoring/cost-deep-othercost-rule/create',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 更新深加工其他成本-配置
|
||||
export function updateRawOthercostRule(data) {
|
||||
return request({
|
||||
url: '/monitoring/cost-deep-othercost-rule/update',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除深加工其他成本-配置
|
||||
export function deleteRawOthercostRule(id) {
|
||||
return request({
|
||||
url: '/monitoring/cost-deep-othercost-rule/delete?id=' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
||||
// 获得深加工其他成本-配置
|
||||
export function getRawOthercostRule(id) {
|
||||
return request({
|
||||
url: '/monitoring/cost-deep-othercost-rule/get?id=' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 获得深加工其他成本-配置分页
|
||||
export function getRawOthercostRulePage(query) {
|
||||
return request({
|
||||
url: '/monitoring/cost-deep-othercost-rule/page',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 导出深加工其他成本-配置 Excel
|
||||
export function exportRawOthercostRuleExcel(query) {
|
||||
return request({
|
||||
url: '/monitoring/cost-deep-othercost-rule/export-excel',
|
||||
method: 'get',
|
||||
params: query,
|
||||
responseType: 'blob'
|
||||
})
|
||||
}
|
||||
// 获得所有深加工其他成本-配置列表
|
||||
export function getRawOthercostRuleAll() {
|
||||
return request({
|
||||
url: '/monitoring/cost-deep-othercost-rule/listAll',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
@@ -1,54 +0,0 @@
|
||||
/*
|
||||
* @Author: zwq
|
||||
* @Date: 2024-04-18 16:53:17
|
||||
* @LastEditors: zwq
|
||||
* @LastEditTime: 2024-09-06 14:35:13
|
||||
* @Description:
|
||||
*/
|
||||
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 获得原片成本分页
|
||||
export function getRawCostStatisticsPage(query) {
|
||||
return request({
|
||||
url: '/monitoring/cost-origincost-his/page',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
// 更新原片成本-历史
|
||||
export function updateRawCostStatistics(data) {
|
||||
return request({
|
||||
url: '/monitoring/cost-origincost-his/update',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
// 获得原片成本统计成本查询分页
|
||||
export function getRawCostStatisticsRealtimePage(query) {
|
||||
return request({
|
||||
url: '/monitoring/cost-origin-cost-realtime/page',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 导出原片成本统计成本查询 Excel
|
||||
export function exportRawStatisticsRealtimeExcel(query) {
|
||||
return request({
|
||||
url: '/monitoring/cost-origin-cost-realtime/export-excel',
|
||||
method: 'get',
|
||||
params: query,
|
||||
responseType: 'blob'
|
||||
})
|
||||
}
|
||||
|
||||
// 导出原片成本统计-历史成本 Excel
|
||||
export function exportRawCostStatisticsHisExcel(query) {
|
||||
return request({
|
||||
url: '/monitoring/cost-origincost-his/export-excel',
|
||||
method: 'get',
|
||||
params: query,
|
||||
responseType: 'blob'
|
||||
})
|
||||
}
|
||||
@@ -1,68 +0,0 @@
|
||||
/*
|
||||
* @Author: zwq
|
||||
* @Date: 2024-04-15 17:01:20
|
||||
* @LastEditors: zwq
|
||||
* @LastEditTime: 2024-04-18 15:39:12
|
||||
* @Description:
|
||||
*/
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 创建原片其他成本-配置
|
||||
export function createRawOthercostRule(data) {
|
||||
return request({
|
||||
url: '/monitoring/cost-othercost-rule/create',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 更新原片其他成本-配置
|
||||
export function updateRawOthercostRule(data) {
|
||||
return request({
|
||||
url: '/monitoring/cost-othercost-rule/update',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除原片其他成本-配置
|
||||
export function deleteRawOthercostRule(id) {
|
||||
return request({
|
||||
url: '/monitoring/cost-othercost-rule/delete?id=' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
||||
// 获得原片其他成本-配置
|
||||
export function getRawOthercostRule(id) {
|
||||
return request({
|
||||
url: '/monitoring/cost-othercost-rule/get?id=' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 获得原片其他成本-配置分页
|
||||
export function getRawOthercostRulePage(query) {
|
||||
return request({
|
||||
url: '/monitoring/cost-othercost-rule/page',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 导出原片其他成本-配置 Excel
|
||||
export function exportRawOthercostRuleExcel(query) {
|
||||
return request({
|
||||
url: '/monitoring/cost-othercost-rule/export-excel',
|
||||
method: 'get',
|
||||
params: query,
|
||||
responseType: 'blob'
|
||||
})
|
||||
}
|
||||
// 获得所有原片其他成本-配置列表
|
||||
export function getRawOthercostRuleAll() {
|
||||
return request({
|
||||
url: '/monitoring/cost-othercost-rule/listAll',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
@@ -1,18 +0,0 @@
|
||||
import request from '@/utils/request'
|
||||
// 获得工厂分页
|
||||
export function getMaterialReceiptIssuePageData(data) {
|
||||
return request({
|
||||
url: '/base/material-warehouse-his/page',
|
||||
method: 'post',
|
||||
data: data,
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
export function createMaterialIssue(data) {
|
||||
return request({
|
||||
url: '/base/material-warehouse-his/create',
|
||||
method: 'post',
|
||||
data: data,
|
||||
});
|
||||
}
|
||||
@@ -43,14 +43,6 @@ export function getEnergyOverlimitLogPage(data) {
|
||||
})
|
||||
}
|
||||
|
||||
// 获得手动抄表记录分页
|
||||
export function getEnergyManualLogPage(data) {
|
||||
return request({
|
||||
url: '/monitoring/energy-overlimit-log/pageManual',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
// 导出能源超限记录 Excel
|
||||
export function exportEnergyOverlimitLogExcel(query) {
|
||||
return request({
|
||||
|
||||
27
src/api/monitoring/groupTeamView.js
Normal file
27
src/api/monitoring/groupTeamView.js
Normal file
@@ -0,0 +1,27 @@
|
||||
import request from '@/utils/request'
|
||||
// 执行班组追溯 根据工单
|
||||
export function getByWorkOrder(query) {
|
||||
return request({
|
||||
url: '/monitoring/schedulingmonitoring/getByWorkOrder',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 执行班组追溯详情 根据工单班组
|
||||
export function getByTeam(query) {
|
||||
return request({
|
||||
url: '/monitoring/schedulingmonitoring/getByTeam',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 获取某次排班的生产情况详情
|
||||
export function getByScheduling(query) {
|
||||
return request({
|
||||
url: '/monitoring/schedulingmonitoring/getByScheduling',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
19
src/api/monitoring/orderEnergy.js
Normal file
19
src/api/monitoring/orderEnergy.js
Normal file
@@ -0,0 +1,19 @@
|
||||
import request from '@/utils/request'
|
||||
// 获取工单信息
|
||||
export function getWorkOrderMsg(data) {
|
||||
return request({
|
||||
url: '/monitoring/energy-work-order/getWorkOrderMsg',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 获取工单能源消耗数据
|
||||
export function getOrderEnergyData(data) {
|
||||
return request({
|
||||
url: '/monitoring/energy-work-order/getData',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
19
src/api/monitoring/teamProduction.js
Normal file
19
src/api/monitoring/teamProduction.js
Normal file
@@ -0,0 +1,19 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 获得排班信息分页 建议size 150
|
||||
export function groupTeamSchedulingPage(query) {
|
||||
return request({
|
||||
url: '/base/group-team-scheduling/page',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 获得不同产线每小时报废数据,用于班组检测 班组生产情况详情(动态结构)
|
||||
export function getSchedulingMonitoringRecord(query) {
|
||||
return request({
|
||||
url: '/base/quality-inspection-record/getSchedulingMonitoringRecord',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
@@ -1,45 +0,0 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
export function getOrderPage(data) {
|
||||
return request({
|
||||
url: '/base/core-work-order/page',
|
||||
method: 'post',
|
||||
data: data,
|
||||
});
|
||||
}
|
||||
|
||||
export function updateOrderData(data) {
|
||||
return request({
|
||||
url: '/base/core-work-order/updatee',
|
||||
method: 'put',
|
||||
data: data,
|
||||
});
|
||||
}
|
||||
|
||||
export function createOrderData(data) {
|
||||
return request({
|
||||
url: '/base/core-work-order/create',
|
||||
method: 'post',
|
||||
data: data,
|
||||
});
|
||||
}
|
||||
export function getOrderData(id) {
|
||||
return request({
|
||||
url: '/base/core-work-order/get?id=' + id,
|
||||
method: 'get',
|
||||
});
|
||||
}
|
||||
export function getOrderCode(data) {
|
||||
return request({
|
||||
url: '/base/core-work-order/getCode',
|
||||
method: 'get',
|
||||
data: data,
|
||||
});
|
||||
}
|
||||
|
||||
export function deleteOrder(id) {
|
||||
return request({
|
||||
url: '/base/core-work-order/delete?id=' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
15
src/assets/icons/svg/table_delete.svg
Normal file
15
src/assets/icons/svg/table_delete.svg
Normal file
@@ -0,0 +1,15 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg width="14px" height="14px" viewBox="0 0 14 14" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<!-- Generator: Sketch 60 (88103) - https://sketch.com -->
|
||||
<desc>Created with Sketch.</desc>
|
||||
<g id="11_系统管理" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
||||
<g id="11-1用户管理" transform="translate(-1822.000000, -159.000000)" fill="#FF5454" fill-rule="nonzero">
|
||||
<g id="编组-10" transform="translate(1821.000000, 158.000000)">
|
||||
<g id="删除">
|
||||
<rect id="矩形" opacity="0" x="0" y="0" width="16" height="16"></rect>
|
||||
<path d="M9.39137788,11.7149165 C9.13431614,11.7149165 8.92716929,11.5077697 8.92716929,11.2507079 L8.92716929,6.14191781 C8.92716929,5.88485607 9.13431613,5.67770922 9.39137788,5.67770922 C9.64843963,5.67770922 9.85558647,5.88485606 9.85558647,6.14191781 L9.85558647,11.2482122 C9.85558647,11.5052739 9.64843961,11.7149165 9.39137788,11.7149165 Z M6.60612639,11.7149165 C6.34906466,11.7149165 6.1419178,11.5077697 6.1419178,11.2507079 L6.1419178,6.14191781 C6.1419178,5.88485607 6.34906466,5.67770922 6.60612641,5.67770922 C6.86318814,5.67770922 7.07033499,5.88485606 7.07033499,6.14191781 L7.07033499,11.2482122 C7.07033499,11.5052739 6.86318814,11.7149165 6.60612639,11.7149165 Z M14.0359594,3.82087491 L11.7149165,3.82087491 L11.7149165,2.89245775 C11.7149165,2.12376827 11.0959718,1.499832 10.3322738,1.499832 L5.67770923,1.499832 C4.90901976,1.499832 4.28508349,2.12376827 4.28508349,2.89245775 L4.28508349,3.82087491 L1.96404059,3.82087491 C1.70697885,3.82087491 1.499832,4.02802174 1.499832,4.28508349 C1.499832,4.54214524 1.70697884,4.74929208 1.96404059,4.74929208 L14.0359594,4.74929208 C14.2930211,4.74929208 14.500168,4.54214524 14.500168,4.28508349 C14.500168,4.02802174 14.2930212,3.82087491 14.0359594,3.82087491 Z M5.21350066,2.89245775 C5.21350066,2.63789175 5.42314324,2.42824916 5.67770925,2.42824916 L10.3322738,2.42824916 C10.5868398,2.42824916 10.7864994,2.63290025 10.7864994,2.89245775 L10.7864994,3.82087491 L5.21350066,3.82087491 L5.21350066,2.89245775 L5.21350066,2.89245775 Z M11.2507079,14.500168 L4.75178782,14.500168 C3.98309834,14.500168 3.35916207,13.8762317 3.35916207,13.1075423 L3.35916207,6.13692631 C3.35916207,5.87986457 3.56630891,5.67271772 3.82337066,5.67271772 C4.08043241,5.67271772 4.28757925,5.87986456 4.28757925,6.13692631 L4.28757925,13.1075423 C4.28757925,13.364604 4.49722183,13.5717508 4.75178783,13.5717508 L11.2532037,13.5717508 C11.5102654,13.5717508 11.7174123,13.364604 11.7174123,13.1075423 L11.7174123,6.15439653 C11.7174123,5.89733479 11.9245591,5.69018794 12.1816209,5.69018794 C12.4386826,5.69018794 12.6458294,5.89733478 12.6458294,6.15439653 L12.6458294,13.1075423 C12.6433337,13.873736 12.0193974,14.500168 11.2507079,14.500168 Z" id="形状"></path>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 2.9 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 137 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 1.9 KiB |
@@ -1,13 +1,10 @@
|
||||
/* ===== PC DESIGN ===== */
|
||||
$W: 1080;
|
||||
$W: 1000;
|
||||
$H: 1920;
|
||||
// $picW: 438;
|
||||
// $picH: 560;
|
||||
$picW: 1080;
|
||||
$picH: 1118;
|
||||
$formW: 420;
|
||||
$picW: 438;
|
||||
$picH: 560;
|
||||
$formW: 320;
|
||||
$tabW: $formW / 2;
|
||||
// $rowH: 56;
|
||||
$rowH: 56;
|
||||
$buttonH: 50;
|
||||
|
||||
@@ -18,7 +15,6 @@ $containerBgImage: '../assets/images/bg.png';
|
||||
$logoWidth: 417px;
|
||||
$logoHeight: 64px;
|
||||
$logoImage: '../assets/logo/login-logo.png';
|
||||
$cnbmLogo: '../assets/logo/cnbm.png';
|
||||
// container-content
|
||||
$contentWidth: round($W / $H * 100) * 1vw;
|
||||
$contentHeight: round($picH / $W * 100) / 100 * $contentWidth;
|
||||
@@ -26,8 +22,7 @@ $contentBgColor: #ffffff;
|
||||
// container-content-pic
|
||||
$picWidth: round($picW / $H * 100) * 1vw;
|
||||
$picHeight: inherit;
|
||||
// $picImage: '../assets/images/pic.png';
|
||||
$picImage: '../assets/images/login-bg.png';
|
||||
$picImage: '../assets/images/pic.png';
|
||||
// container-content-field
|
||||
$fieldWidth: $contentWidth - $picWidth;
|
||||
$fieldHeight: inherit;
|
||||
@@ -39,311 +34,232 @@ $buttonHeight: $buttonH * 1px;
|
||||
|
||||
// - - - - - 页面基础设置
|
||||
.container {
|
||||
.login-code {
|
||||
width: 33%;
|
||||
height: 38px;
|
||||
float: right;
|
||||
img {
|
||||
cursor: pointer;
|
||||
width: 100%;
|
||||
max-width: 100px;
|
||||
height: auto;
|
||||
vertical-align: middle;
|
||||
}
|
||||
}
|
||||
// 元素
|
||||
width: inherit;
|
||||
height: inherit;
|
||||
min-width: 1080px;
|
||||
min-height: 620px;
|
||||
background-color: $containerBgColor;
|
||||
// background-image: url($containerBgImage);
|
||||
background-size: cover;
|
||||
// 定位
|
||||
position: relative;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
// 文字
|
||||
font-size: 14px;
|
||||
font-family: Microsoft YaHei;
|
||||
font-weight: 400;
|
||||
.logo {
|
||||
// 元素
|
||||
width: $logoWidth;
|
||||
height: $logoHeight;
|
||||
// background-image: url($logoImage);
|
||||
// background-size: contain;
|
||||
// 定位
|
||||
position: absolute;
|
||||
top: 50px;
|
||||
left: 50%;
|
||||
margin-left: -$logoWidth/2;
|
||||
}
|
||||
.content {
|
||||
// 元素
|
||||
// width: $contentWidth;
|
||||
// height: $contentHeight;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background-color: #ffffff;
|
||||
// box-shadow: 0px 16px 40px rgba(0, 0, 0, 0.07);
|
||||
// border-radius: 20px;
|
||||
// 定位
|
||||
position: relative;
|
||||
display: flex;
|
||||
|
||||
.pic {
|
||||
// 元素
|
||||
width: $picWidth;
|
||||
height: $picHeight;
|
||||
background-image: url($picImage);
|
||||
background-repeat: no-repeat;
|
||||
background-size: 100% 100%;
|
||||
background-position: 0 0;
|
||||
position: relative;
|
||||
|
||||
&::after {
|
||||
content: '';
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
// background: #f003;
|
||||
display: inline-block;
|
||||
}
|
||||
}
|
||||
.field {
|
||||
// background: #ccc3;
|
||||
position: relative;
|
||||
padding-top: 196px;
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
// justify-content: center;
|
||||
align-items: center;
|
||||
.pc-title {
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
clear: both;
|
||||
position: relative;
|
||||
top: -36px;
|
||||
|
||||
// h3.title {
|
||||
// position: relative;
|
||||
|
||||
// &::before {
|
||||
// content: '';
|
||||
// background: url($cnbmLogo) 100% / 100% no-repeat;
|
||||
// height: 48px;
|
||||
// width: 48px;
|
||||
// position: absolute;
|
||||
// left: 0px;
|
||||
// top: 4px;
|
||||
// display: inline-block;
|
||||
// }
|
||||
// }
|
||||
}
|
||||
.mobile-title,
|
||||
.mobile-switch {
|
||||
display: none;
|
||||
}
|
||||
.form {
|
||||
margin-top: 32px;
|
||||
box-sizing: border-box;
|
||||
// width: $formWidth;
|
||||
width: 100%;
|
||||
// - - - tab
|
||||
:deep(.el-tabs__nav) {
|
||||
// background: #f0f3;
|
||||
}
|
||||
:deep(.el-tabs__content) {
|
||||
padding: 20px 0 0;
|
||||
}
|
||||
:deep(.el-tabs__item) {
|
||||
user-select: none;
|
||||
// 元素
|
||||
width: $tabWidth;
|
||||
height: $rowHeight;
|
||||
padding: 0;
|
||||
// 文字
|
||||
line-height: $rowHeight;
|
||||
color: #666666;
|
||||
font-size: 18px;
|
||||
font-weight: 400;
|
||||
text-align: center;
|
||||
}
|
||||
:deep(.el-tabs__item.is-active) {
|
||||
font-weight: 500;
|
||||
color: #2f53eb;
|
||||
}
|
||||
:deep(.el-tabs__active-bar) {
|
||||
height: 3px;
|
||||
border-radius: 2px;
|
||||
}
|
||||
// - - - input
|
||||
:deep(.el-input__inner) {
|
||||
// 元素
|
||||
width: 100%;
|
||||
height: $rowHeight;
|
||||
background: #f5f5f5;
|
||||
border: 0;
|
||||
border-radius: 28px;
|
||||
// 文字
|
||||
text-align: center;
|
||||
line-height: 19px;
|
||||
color: #262626;
|
||||
}
|
||||
.code:deep(.el-input__inner) {
|
||||
padding: 0 24px;
|
||||
// 文字
|
||||
text-align: left;
|
||||
}
|
||||
:deep(.el-input__inner::-webkit-input-placeholder) {
|
||||
/* WebKit browsers */
|
||||
font-weight: 400;
|
||||
color: #8c8c8c;
|
||||
}
|
||||
:deep(.el-input__inner:-moz-placeholder) {
|
||||
/* Mozilla Firefox 4 to 18 */
|
||||
font-weight: 400;
|
||||
color: #8c8c8c;
|
||||
}
|
||||
:deep(.el-input__inner::-moz-placeholder) {
|
||||
/* Mozilla Firefox 19+ */
|
||||
font-weight: 400;
|
||||
color: #8c8c8c;
|
||||
opacity: 1;
|
||||
}
|
||||
:deep(.el-input__inner:-ms-input-placeholder) {
|
||||
/* Internet Explorer 10+ */
|
||||
font-weight: 400;
|
||||
color: #8c8c8c !important;
|
||||
}
|
||||
:deep(.el-form-item) {
|
||||
position: relative;
|
||||
.button-code {
|
||||
// 元素
|
||||
height: $rowHeight;
|
||||
box-sizing: border-box;
|
||||
// 定位
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 20px;
|
||||
z-index: 1;
|
||||
// 文字
|
||||
line-height: 20px;
|
||||
font-size: 14px;
|
||||
font-family: PingFang SC;
|
||||
font-weight: 400;
|
||||
color: #2f53eb;
|
||||
span {
|
||||
padding-left: 15px;
|
||||
border-left: 2px solid #d9d9d9;
|
||||
}
|
||||
}
|
||||
}
|
||||
:deep(.el-form-item__error) {
|
||||
padding-left: 24px;
|
||||
}
|
||||
.button {
|
||||
width: 100%;
|
||||
height: $buttonHeight;
|
||||
background: rgba(24, 144, 255, 0.2);
|
||||
border: 0;
|
||||
border-radius: 24px;
|
||||
margin-bottom: 20px;
|
||||
// 文字
|
||||
line-height: 26px;
|
||||
font-size: 20px;
|
||||
color: #ffffff;
|
||||
}
|
||||
.button-active {
|
||||
background: #2f53eb;
|
||||
box-shadow: 0px 2px 8px rgba(0, 80, 184, 0.2);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.login-form {
|
||||
* {
|
||||
user-select: none;
|
||||
}
|
||||
// - - - input
|
||||
:deep(.el-input__inner) {
|
||||
// 元素
|
||||
width: 420px;
|
||||
height: 66px;
|
||||
color: #262626;
|
||||
font-size: 18px;
|
||||
}
|
||||
:deep(.el-checkbox__label) {
|
||||
font-size: 18px;
|
||||
line-height: 14px;
|
||||
}
|
||||
}
|
||||
|
||||
.footer {
|
||||
user-select: none;
|
||||
// 元素
|
||||
height: 16px;
|
||||
line-height: 16px;
|
||||
font-size: 12px;
|
||||
color: #8c8c8c;
|
||||
// 定位
|
||||
position: absolute;
|
||||
bottom: 30px;
|
||||
a,
|
||||
a:hover,
|
||||
a:active {
|
||||
color: inherit;
|
||||
text-decoration: none;
|
||||
}
|
||||
}
|
||||
.login-code {
|
||||
width: 33%;
|
||||
height: 38px;
|
||||
float: right;
|
||||
img {
|
||||
cursor: pointer;
|
||||
width:100%;max-width:100px; height:auto;
|
||||
vertical-align: middle;
|
||||
}
|
||||
}
|
||||
// 元素
|
||||
width: inherit;
|
||||
height: inherit;
|
||||
min-width: 1080px;
|
||||
min-height: 620px;
|
||||
background-color: $containerBgColor;
|
||||
background-image: url($containerBgImage);
|
||||
background-size: cover;
|
||||
// 定位
|
||||
position: relative;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
// 文字
|
||||
font-size: 14px;
|
||||
font-family: Microsoft YaHei;
|
||||
font-weight: 400;
|
||||
.logo {
|
||||
// 元素
|
||||
width: $logoWidth;
|
||||
height: $logoHeight;
|
||||
// background-image: url($logoImage);
|
||||
// background-size: contain;
|
||||
// 定位
|
||||
position: absolute;
|
||||
top: 50px;
|
||||
left: 50%;
|
||||
margin-left: -$logoWidth/2;
|
||||
}
|
||||
.content {
|
||||
// 元素
|
||||
width: $contentWidth;
|
||||
height: $contentHeight;
|
||||
background-color: #ffffff;
|
||||
box-shadow: 0px 16px 40px rgba(0, 0, 0, 0.07);
|
||||
border-radius: 20px;
|
||||
// 定位
|
||||
position: relative;
|
||||
.pic {
|
||||
// 元素
|
||||
width: $picWidth;
|
||||
height: $picHeight;
|
||||
background-image: url($picImage);
|
||||
background-repeat: no-repeat;
|
||||
background-size: cover;
|
||||
border-radius: 20px 0 0 20px;
|
||||
// 定位
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
}
|
||||
.field {
|
||||
width: $fieldWidth;
|
||||
height: $fieldHeight;
|
||||
// 定位
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: $picWidth;
|
||||
display:flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
.pc-title{ width: 100%; clear: both;}
|
||||
.mobile-title,
|
||||
.mobile-switch {
|
||||
display: none;
|
||||
}
|
||||
.form {
|
||||
box-sizing: border-box;
|
||||
width: $formWidth;
|
||||
// - - - tab
|
||||
:deep(.el-tabs__content) {
|
||||
padding: 20px 0 0;
|
||||
}
|
||||
:deep(.el-tabs__item) {
|
||||
// 元素
|
||||
width: $tabWidth;
|
||||
height: $rowHeight;
|
||||
padding: 0;
|
||||
// 文字
|
||||
line-height: $rowHeight;
|
||||
color: #666666;
|
||||
}
|
||||
:deep(.el-tabs__item.is-active) {
|
||||
font-weight: bold;
|
||||
color: #2F53EB;
|
||||
}
|
||||
:deep(.el-tabs__active-bar) {
|
||||
height: 3px;
|
||||
border-radius: 2px;
|
||||
}
|
||||
// - - - input
|
||||
:deep(.el-input__inner) {
|
||||
// 元素
|
||||
width: 100%;
|
||||
height: $rowHeight;
|
||||
background: #f5f5f5;
|
||||
border: 0;
|
||||
border-radius: 28px;
|
||||
// 文字
|
||||
text-align: center;
|
||||
line-height: 19px;
|
||||
color: #262626;
|
||||
}
|
||||
.code:deep(.el-input__inner) {
|
||||
padding: 0 24px;
|
||||
// 文字
|
||||
text-align: left;
|
||||
}
|
||||
:deep(.el-input__inner::-webkit-input-placeholder) { /* WebKit browsers */
|
||||
font-weight: 400;
|
||||
color: #8C8C8C;
|
||||
}
|
||||
:deep(.el-input__inner:-moz-placeholder) { /* Mozilla Firefox 4 to 18 */
|
||||
font-weight: 400;
|
||||
color: #8C8C8C;
|
||||
}
|
||||
:deep(.el-input__inner::-moz-placeholder) { /* Mozilla Firefox 19+ */
|
||||
font-weight: 400;
|
||||
color: #8C8C8C;
|
||||
opacity:1;
|
||||
}
|
||||
:deep(.el-input__inner:-ms-input-placeholder) { /* Internet Explorer 10+ */
|
||||
font-weight: 400;
|
||||
color: #8C8C8C !important;
|
||||
}
|
||||
:deep(.el-form-item) {
|
||||
position: relative;
|
||||
.button-code {
|
||||
// 元素
|
||||
height: $rowHeight;
|
||||
box-sizing: border-box;
|
||||
// 定位
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 20px;
|
||||
z-index: 1;
|
||||
// 文字
|
||||
line-height: 20px;
|
||||
font-size: 14px;
|
||||
font-family: PingFang SC;
|
||||
font-weight: 400;
|
||||
color: #2F53EB;
|
||||
span {
|
||||
padding-left: 15px;
|
||||
border-left: 2px solid #D9D9D9;
|
||||
}
|
||||
}
|
||||
}
|
||||
:deep(.el-form-item__error) {
|
||||
padding-left: 24px;
|
||||
}
|
||||
.button {
|
||||
width: 100%;
|
||||
height: $buttonHeight;
|
||||
background: rgba(24, 144, 255, 0.2);
|
||||
border: 0;
|
||||
border-radius: 24px;
|
||||
margin-bottom: 20px;
|
||||
// 文字
|
||||
line-height: 26px;
|
||||
font-size: 20px;
|
||||
color: #FFFFFF;
|
||||
}
|
||||
.button-active {
|
||||
background: #2F53EB;
|
||||
box-shadow: 0px 2px 8px rgba(0, 80, 184, 0.2);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.footer {
|
||||
// 元素
|
||||
height: 16px;
|
||||
line-height: 16px;
|
||||
font-size: 12px;
|
||||
color: #8c8c8c;
|
||||
// 定位
|
||||
position: absolute;
|
||||
bottom: 30px;
|
||||
a,
|
||||
a:hover,
|
||||
a:active {
|
||||
color: inherit;
|
||||
text-decoration: none;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// - - - - - PC 最小尺寸设置
|
||||
@media screen and (min-width: 599px) and (max-width: 1366px) {
|
||||
.container {
|
||||
min-width: 599px;
|
||||
.content {
|
||||
// width: 710px;
|
||||
// height: 397px;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
.pic {
|
||||
// width: 314px;
|
||||
display: none;
|
||||
}
|
||||
.field {
|
||||
// width: calc(710px - 314px);
|
||||
// left: 314px;
|
||||
// justify-content: center;
|
||||
width: 100%;
|
||||
|
||||
.pc-title {
|
||||
h3 {
|
||||
font-size: 2.4rem !important;
|
||||
}
|
||||
}
|
||||
|
||||
.form {
|
||||
// width: 320px;
|
||||
:deep(.el-input__inner) {
|
||||
width: 320px;
|
||||
height: 56px;
|
||||
}
|
||||
.button {
|
||||
height: 50px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.container {
|
||||
.content {
|
||||
width: 710px;
|
||||
height: 397px;
|
||||
.pic {
|
||||
width: 314px;
|
||||
}
|
||||
.field {
|
||||
width: calc(710px - 314px);
|
||||
left: 314px;
|
||||
.form {
|
||||
width: 320px;
|
||||
:deep(.el-input__inner) {
|
||||
width: 320px;
|
||||
height: 56px;
|
||||
}
|
||||
.button {
|
||||
height: 50px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* ===== MOBILE DESIGN ===== */
|
||||
$mobileW: 375;
|
||||
$mobileH: 812;
|
||||
@@ -357,142 +273,115 @@ $mobileButtonH: 48;
|
||||
$mobileContainerBgImage: '../assets/images/bg-mobile.png';
|
||||
// container-content
|
||||
$mobileContentWidth: round($mobileContentW / $mobileW * 100) * 1vw;
|
||||
$mobileContentHeight: round($mobileContentH / $mobileW * 100) / 100 *
|
||||
$mobileContentWidth;
|
||||
$mobileContentHeight: round($mobileContentH / $mobileW * 100) / 100 * $mobileContentWidth;
|
||||
// container-content-field-form
|
||||
$mobileFormWidth: round($mobileFormW / $mobileW * 100) * 1vw;
|
||||
$mobileFormWidth: round($mobileFormW / $mobileW *100) * 1vw;
|
||||
$mobileRowHeight: $mobileRowH * 1px;
|
||||
$mobileButtonHeight: $mobileButtonH * 1px;
|
||||
$iconBgImage: '../assets/images/icon.png';
|
||||
|
||||
// - - - - - 移动端设置
|
||||
@media screen and (max-width: 599px) {
|
||||
.container {
|
||||
// 元素
|
||||
background-image: url($mobileContainerBgImage);
|
||||
min-width: 280px;
|
||||
min-height: 568px;
|
||||
// 文字
|
||||
font-size: 14px;
|
||||
font-family: PingFang SC;
|
||||
font-weight: bold;
|
||||
.logo {
|
||||
display: none;
|
||||
}
|
||||
.container {
|
||||
// 元素
|
||||
background-image: url($mobileContainerBgImage);
|
||||
min-width: 280px;
|
||||
min-height: 568px;
|
||||
// 文字
|
||||
font-size: 17px;
|
||||
font-family: PingFang SC;
|
||||
font-weight: bold;
|
||||
.logo {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.pc-title {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.content {
|
||||
// 元素
|
||||
width: $mobileContentWidth;
|
||||
height: $mobileContentHeight;
|
||||
min-width: 250px;
|
||||
min-height: 340px;
|
||||
// 定位
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
.pic {
|
||||
display: none;
|
||||
}
|
||||
.field {
|
||||
padding: 0;
|
||||
// 元素
|
||||
width: inherit;
|
||||
min-height: inherit;
|
||||
// 定位
|
||||
left: 0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
||||
.mobile-title {
|
||||
// 元素
|
||||
margin: 0;
|
||||
display: block;
|
||||
}
|
||||
|
||||
.form {
|
||||
.content {
|
||||
// 元素
|
||||
width: $mobileContentWidth;
|
||||
height: $mobileContentHeight;
|
||||
min-width: 250px;
|
||||
min-height: 340px;
|
||||
// 定位
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
.pic {
|
||||
display: none;
|
||||
}
|
||||
.field {
|
||||
// 元素
|
||||
width: inherit;
|
||||
min-height: inherit;
|
||||
// 定位
|
||||
left: 0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
.mobile-title {
|
||||
// 元素
|
||||
margin: 0 0 20px;
|
||||
display: block;
|
||||
}
|
||||
.form {
|
||||
width: $mobileFormWidth;
|
||||
// - - - tab
|
||||
:deep(.el-tabs__header) {
|
||||
display: none;
|
||||
}
|
||||
:deep(.el-tabs__content) {
|
||||
padding: 0;
|
||||
}
|
||||
// - - - input
|
||||
:deep(.el-input__inner) {
|
||||
height: $mobileRowHeight;
|
||||
line-height: 24px;
|
||||
// 文字
|
||||
text-align: center;
|
||||
color: #262626;
|
||||
}
|
||||
:deep(.el-form-item) {
|
||||
.button-code {
|
||||
// 元素
|
||||
height: $mobileRowHeight;
|
||||
}
|
||||
}
|
||||
.button {
|
||||
height: $mobileButtonHeight;
|
||||
line-height: 24px;
|
||||
color: #FFFFFF;
|
||||
}
|
||||
}
|
||||
.mobile-switch {
|
||||
display: block;
|
||||
line-height: 20px;
|
||||
font-size: 14px;
|
||||
font-weight: 400;
|
||||
color: #595959;
|
||||
margin: 0;
|
||||
width: $mobileFormWidth;
|
||||
// - - - tab
|
||||
:deep(.el-tabs__header) {
|
||||
display: none;
|
||||
}
|
||||
:deep(.el-tabs__content) {
|
||||
padding: 0;
|
||||
}
|
||||
// - - - input
|
||||
:deep(.el-input__inner) {
|
||||
height: $mobileRowHeight;
|
||||
line-height: 24px;
|
||||
// 文字
|
||||
text-align: center;
|
||||
color: #262626;
|
||||
}
|
||||
:deep(.el-form-item) {
|
||||
.button-code {
|
||||
// 元素
|
||||
height: $mobileRowHeight;
|
||||
}
|
||||
}
|
||||
.button {
|
||||
height: $mobileButtonHeight;
|
||||
line-height: 24px;
|
||||
color: #ffffff;
|
||||
}
|
||||
}
|
||||
.icon {
|
||||
width: 14px;
|
||||
height: 14px;
|
||||
display: inline-block;
|
||||
background-image: url($iconBgImage);
|
||||
background-size: cover;
|
||||
}
|
||||
}
|
||||
.mobile-switch:hover {
|
||||
cursor: pointer;
|
||||
}
|
||||
}
|
||||
}
|
||||
.footer {
|
||||
// 元素
|
||||
font-size: 12px;
|
||||
font-family: PingFang SC;
|
||||
font-weight: 400;
|
||||
line-height: 17px;
|
||||
color: #333333;
|
||||
opacity: 0.6;
|
||||
// 定位
|
||||
position: absolute;
|
||||
bottom: 20px;
|
||||
}
|
||||
}
|
||||
|
||||
.login-form {
|
||||
:deep(.el-input__inner) {
|
||||
height: $mobileRowHeight;
|
||||
line-height: 24px;
|
||||
// 文字
|
||||
text-align: center;
|
||||
color: #262626;
|
||||
}
|
||||
|
||||
:deep(#button-form-item) {
|
||||
margin: 0 !important;
|
||||
button {
|
||||
// 元素
|
||||
height: $mobileRowHeight;
|
||||
}
|
||||
}
|
||||
}
|
||||
.mobile-switch {
|
||||
display: block;
|
||||
line-height: 20px;
|
||||
font-size: 14px;
|
||||
font-weight: 400;
|
||||
color: #595959;
|
||||
margin: 0;
|
||||
.icon {
|
||||
width: 14px;
|
||||
height: 14px;
|
||||
display: inline-block;
|
||||
background-image: url($iconBgImage);
|
||||
background-size: cover;
|
||||
}
|
||||
}
|
||||
.mobile-switch:hover {
|
||||
cursor: pointer;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.footer {
|
||||
// 元素
|
||||
font-size: 12px;
|
||||
font-family: PingFang SC;
|
||||
font-weight: 400;
|
||||
line-height: 17px;
|
||||
color: #333333;
|
||||
opacity: 0.6;
|
||||
// 定位
|
||||
// position: absolute;
|
||||
bottom: -32px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,141 +0,0 @@
|
||||
<template>
|
||||
<!-- 按钮切换 -->
|
||||
<div v-if="buttonMode" class="button-nav">
|
||||
<button v-for="m in menus" :key="m" @click="handleClick(m)"
|
||||
:data-text="m"
|
||||
:class="[m === currentMenu ? 'active' : '']"
|
||||
></button>
|
||||
</div>
|
||||
<!-- 标签切换 -->
|
||||
<div v-else class="custom-tabs" style="height: 100%; width: 100%">
|
||||
<el-tabs class="tag-nav" v-model="currentMenu" style="height: 100%" @tab-click="handleTabClick">
|
||||
<el-tab-pane v-for="(m, idx) in menus" :key="m" :label="idx == 0 ? `\u2002${m}\u2002` : `\u3000${m}\u3000`"
|
||||
:name="m">
|
||||
<slot :name="`tab${idx + 1}`"></slot>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: "ButtonNav",
|
||||
props: {
|
||||
menus: {
|
||||
type: Array,
|
||||
required: true,
|
||||
default: () => [],
|
||||
validator: (val) => val.length > 0,
|
||||
},
|
||||
buttonMode: {
|
||||
type: Boolean,
|
||||
default: true,
|
||||
},
|
||||
// 新增:支持外部传入选中值(v-model 绑定)
|
||||
value: {
|
||||
type: String,
|
||||
default: "",
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
currentMenu: "",
|
||||
};
|
||||
},
|
||||
created() {
|
||||
// 优先使用外部传入的 value,否则默认第一个
|
||||
this.currentMenu = this.value || this.menus[0];
|
||||
},
|
||||
watch: {
|
||||
// 监听外部 value 变化,同步到内部 currentMenu
|
||||
value(newVal) {
|
||||
this.currentMenu = newVal;
|
||||
},
|
||||
// 监听内部 currentMenu 变化,通知外部
|
||||
currentMenu(val) {
|
||||
this.$emit("input", val); // 触发 v-model 同步
|
||||
this.$emit("change", val); // 保留原 change 事件
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
// 按钮点击事件
|
||||
handleClick(m) {
|
||||
this.currentMenu = m;
|
||||
},
|
||||
// 标签点击事件(el-tabs 自带)
|
||||
handleTabClick(tab) {
|
||||
this.currentMenu = tab.name;
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<!-- 样式不变 -->
|
||||
<style scoped lang="scss">
|
||||
.button-nav {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
gap: 12px;
|
||||
|
||||
* {
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
button {
|
||||
cursor: pointer;
|
||||
appearance: none;
|
||||
outline: none;
|
||||
border: none;
|
||||
background: #fff;
|
||||
border-radius: 8px;
|
||||
padding: 15px;
|
||||
color: #888;
|
||||
letter-spacing: 2px;
|
||||
flex: 1;
|
||||
box-sizing: padding-box;
|
||||
position: relative;
|
||||
|
||||
&::after {
|
||||
content: attr(data-text);
|
||||
position: absolute;
|
||||
top: 5px;
|
||||
left: 50%;
|
||||
font-size: 16px;
|
||||
font-weight: 500;
|
||||
transform: translate(-50%);
|
||||
}
|
||||
|
||||
&.active {
|
||||
color: #111;
|
||||
//border-bottom: 2px solid #0b58ff;
|
||||
box-shadow: 0px 2px 1px 1px #0b58ff;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
<style scoped>
|
||||
.custom-tabs>>>.el-tabs__header {
|
||||
margin-bottom: 8px;
|
||||
display: inline-block;
|
||||
/* transform: translateY(-12px); */
|
||||
}
|
||||
|
||||
.custom-tabs>>>.el-tabs__item {
|
||||
padding-left: 0px !important;
|
||||
padding-right: 0px !important;
|
||||
line-height: 36px !important;
|
||||
height: 36px;
|
||||
}
|
||||
|
||||
.custom-tabs>>>.el-tabs__content {
|
||||
height: calc(100% - 42px);
|
||||
}
|
||||
|
||||
.custom-tabs>>>.el-tab-pane {
|
||||
box-sizing: border-box;
|
||||
height: 100%;
|
||||
padding: 20px;
|
||||
border: 10px solid #f002;
|
||||
}
|
||||
</style>
|
||||
@@ -1,4 +1,4 @@
|
||||
<!--
|
||||
<!--
|
||||
filename: dialogForm.vue
|
||||
author: liubin
|
||||
date: 2023-08-15 10:32:36
|
||||
@@ -21,11 +21,13 @@
|
||||
v-model="form[col.prop]"
|
||||
@change="$emit('update', form)"
|
||||
:placeholder="`请输入${col.label}`"
|
||||
:disabled="disabled"
|
||||
v-bind="col.bind" />
|
||||
<el-input
|
||||
v-if="col.textarea"
|
||||
type="textarea"
|
||||
v-model="form[col.prop]"
|
||||
:disabled="disabled"
|
||||
@change="$emit('update', form)"
|
||||
:placeholder="`请输入${col.label}`"
|
||||
v-bind="col.bind" />
|
||||
@@ -33,6 +35,7 @@
|
||||
v-if="col.select"
|
||||
v-model="form[col.prop]"
|
||||
:placeholder="`请选择${col.label}`"
|
||||
:disabled="disabled"
|
||||
@change="$emit('update', form)"
|
||||
v-bind="col.bind">
|
||||
<el-option
|
||||
@@ -45,18 +48,23 @@
|
||||
v-if="col.datetime"
|
||||
v-model="form[col.prop]"
|
||||
type="datetime"
|
||||
:disabled="disabled"
|
||||
:placeholder="`请选择${col.label}`"
|
||||
value-format="timestamp"
|
||||
@change="$emit('update', form)"
|
||||
v-bind="col.bind"></el-date-picker>
|
||||
<el-switch
|
||||
v-if="col.switch"
|
||||
v-model="form[col.prop]"
|
||||
:disabled="disabled"
|
||||
active-color="#0b58ff"
|
||||
inactive-color="#e1e1e1"
|
||||
@change="$emit('update', form)"
|
||||
v-bind="col.bind"></el-switch>
|
||||
<component
|
||||
v-if="col.subcomponent"
|
||||
:key="col.key"
|
||||
:disabled="disabled"
|
||||
:is="col.subcomponent"
|
||||
:inlineStyle="col.style"></component>
|
||||
|
||||
@@ -79,6 +87,7 @@
|
||||
:headers="uploadHeaders"
|
||||
:show-file-list="false"
|
||||
icon="el-icon-upload2"
|
||||
:disabled="disabled"
|
||||
:before-upload="beforeUpload"
|
||||
:on-success="handleUploadSuccess"
|
||||
v-bind="col.bind">
|
||||
@@ -92,13 +101,13 @@
|
||||
{{ col.uploadTips || '只能上传jpg/png文件, 大小不超过2MB' }}
|
||||
</div>
|
||||
</el-upload>
|
||||
|
||||
<uploadedFile
|
||||
class="file"
|
||||
v-for="file in form[col.prop] || []"
|
||||
:file="file"
|
||||
:key="file.fileUrl"
|
||||
@delete="handleDeleteFile(file)"
|
||||
@Preview="handlePreview(file)" />
|
||||
@delete="!disabled && handleDeleteFile(file)" />
|
||||
</div>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
@@ -109,6 +118,7 @@
|
||||
<script>
|
||||
import { getAccessToken } from '@/utils/auth';
|
||||
import tupleImg from '@/assets/images/tuple.png';
|
||||
import cache from '@/utils/cache';
|
||||
|
||||
/**
|
||||
* 找到最长的label
|
||||
@@ -138,9 +148,6 @@ const uploadedFile = {
|
||||
handleDelete() {
|
||||
this.$emit('delete', this.file);
|
||||
},
|
||||
handlePreview() {
|
||||
this.$emit('Preview', this.file);
|
||||
},
|
||||
},
|
||||
mounted() {},
|
||||
render: function (h) {
|
||||
@@ -159,7 +166,7 @@ const uploadedFile = {
|
||||
cursor: 'pointer',
|
||||
display: 'inline-block',
|
||||
}}>
|
||||
<el-button onClick={this.handlePreview}>{this.file.fileName}</el-button>
|
||||
{this.file.fileName}
|
||||
<el-button
|
||||
type="text"
|
||||
icon="el-icon-close"
|
||||
@@ -193,7 +200,7 @@ export default {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
hasFile: {
|
||||
hasFiles: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
@@ -239,7 +246,7 @@ export default {
|
||||
dataForm: {
|
||||
handler(val) {
|
||||
this.form = JSON.parse(JSON.stringify(val));
|
||||
if (this.hasFile) {
|
||||
if (this.hasFiles) {
|
||||
this.form.files = this.form.files ?? [];
|
||||
}
|
||||
},
|
||||
@@ -259,20 +266,6 @@ export default {
|
||||
resetFields(args) {
|
||||
return this.$refs.form.resetFields(args);
|
||||
},
|
||||
async handlePreview(file) {
|
||||
const data = await this.$axios({
|
||||
url: file.fileUrl,
|
||||
method: 'get',
|
||||
responseType: 'blob',
|
||||
});
|
||||
const link = document.createElement('a');
|
||||
link.href = window.URL.createObjectURL(new Blob([data]));
|
||||
link.download = file.fileName;
|
||||
document.body.appendChild(link);
|
||||
link.click();
|
||||
document.body.removeChild(link);
|
||||
window.URL.revokeObjectURL(link.href);
|
||||
},
|
||||
// getCode
|
||||
async getCode(url) {
|
||||
const response = await this.$axios(url);
|
||||
@@ -293,7 +286,6 @@ export default {
|
||||
} else if (opt.url) {
|
||||
// 如果有 depends,则暂时先不获取,注册一个watcher
|
||||
if (opt.depends) {
|
||||
console.log('[handleOptions] setting watch');
|
||||
this.$watch(
|
||||
() => this.form[opt.depends],
|
||||
(id) => {
|
||||
@@ -316,7 +308,7 @@ export default {
|
||||
});
|
||||
},
|
||||
{
|
||||
immediate: true,
|
||||
immediate: false,
|
||||
}
|
||||
);
|
||||
return;
|
||||
@@ -334,6 +326,11 @@ export default {
|
||||
'list' in response.data
|
||||
? response.data.list
|
||||
: response.data;
|
||||
|
||||
if (opt.cache) {
|
||||
cache.store(opt.cache, list);
|
||||
}
|
||||
|
||||
this.$set(
|
||||
this.optionListOf,
|
||||
opt.prop,
|
||||
@@ -372,9 +369,7 @@ export default {
|
||||
if (!promiseList.length) this.formLoading = false;
|
||||
},
|
||||
// 上传成功的特殊处理
|
||||
beforeUpload(file) {
|
||||
console.log(file)
|
||||
},
|
||||
beforeUpload() {},
|
||||
// 上传前的验证规则可通过 bind 属性传入
|
||||
handleUploadSuccess(response, file, fileList) {
|
||||
this.form.files.push({
|
||||
|
||||
@@ -1,94 +0,0 @@
|
||||
|
||||
/*
|
||||
* @Date: 2020-12-29 16:49:28
|
||||
* @LastEditors: zwq
|
||||
* @LastEditTime: 2024-09-11 13:40:48
|
||||
* @FilePath: \basic-admin\src\filters\basicData\index.js
|
||||
* @Description:
|
||||
*/
|
||||
|
||||
const table = {
|
||||
lineStatus: {
|
||||
1: '生产中',
|
||||
2: '停止',
|
||||
3: '未知',
|
||||
},
|
||||
deactivate: {
|
||||
1: '启用',
|
||||
0: '停用',
|
||||
},
|
||||
wareType: {
|
||||
1: '缓存',
|
||||
2: '活动',
|
||||
3: '其它',
|
||||
},
|
||||
reportType: {
|
||||
2: '日',
|
||||
3: '周',
|
||||
4: '月',
|
||||
5: '年',
|
||||
},
|
||||
manual: {
|
||||
1: '手动',
|
||||
0: '自动',
|
||||
},
|
||||
}
|
||||
|
||||
// 日期格式化
|
||||
export function parseTime(time, pattern) {
|
||||
if (arguments.length === 0 || !time) {
|
||||
return null
|
||||
}
|
||||
const format = pattern || '{y}-{m}-{d} {h}:{i}:{s}'
|
||||
let date
|
||||
if (typeof time === 'object') {
|
||||
date = time
|
||||
} else {
|
||||
if ((typeof time === 'string') && (/^[0-9]+$/.test(time))) {
|
||||
time = parseInt(time)
|
||||
} else if (typeof time === 'string') {
|
||||
time = time.replace(new RegExp(/-/gm), '/').replace('T', ' ').replace(new RegExp(/\.\d{3}/gm), '');
|
||||
}
|
||||
if ((typeof time === 'number') && (time.toString().length === 10)) {
|
||||
time = time * 1000
|
||||
}
|
||||
date = new Date(time)
|
||||
}
|
||||
const formatObj = {
|
||||
y: date.getFullYear(),
|
||||
m: date.getMonth() + 1,
|
||||
d: date.getDate(),
|
||||
h: date.getHours(),
|
||||
i: date.getMinutes(),
|
||||
s: date.getSeconds(),
|
||||
a: date.getDay(),
|
||||
w: '',
|
||||
}
|
||||
const time_str = format.replace(/{([ymdhisaw])+}/g, (result, key) => {
|
||||
let value = formatObj[key]
|
||||
// Note: getDay() returns 0 on Sunday
|
||||
if (key === 'a') {
|
||||
return ['日', '一', '二', '三', '四', '五', '六'][value]
|
||||
}
|
||||
if (key === 'w') {
|
||||
const current = new Date(time);
|
||||
current.setHours(0, 0, 0);
|
||||
current.setDate(current.getDate() + 4 - (current.getDay() || 7));
|
||||
const firstThursday = new Date(current.getFullYear(), 0, 4);
|
||||
firstThursday.setDate(firstThursday.getDate() + 4 - (firstThursday.getDay() || 7));
|
||||
const time1 = current.getTime() - firstThursday.getTime();
|
||||
const weeks = Math.ceil(time1 / (7 * 24 * 3600 * 1000));
|
||||
return (weeks + 1)
|
||||
}
|
||||
if (result.length > 0 && value < 10) {
|
||||
value = '0' + value
|
||||
}
|
||||
return value || 0
|
||||
})
|
||||
return time_str
|
||||
}
|
||||
export default function (dictTable) {
|
||||
return function (val) {
|
||||
return table?.[dictTable]?.[val]
|
||||
}
|
||||
}
|
||||
@@ -71,7 +71,9 @@ import DocAlert from '@/components/DocAlert';
|
||||
// 头部标签插件
|
||||
import VueMeta from 'vue-meta';
|
||||
import CodeBrickZj from 'code-brick-zj';
|
||||
|
||||
import { hiPrintPlugin,disAutoConnect } from 'vue-plugin-hiprint'
|
||||
disAutoConnect();
|
||||
Vue.use(hiPrintPlugin)
|
||||
Vue.use(CodeBrickZj)
|
||||
Vue.use(directive);
|
||||
Vue.use(plugins);
|
||||
|
||||
@@ -1,122 +0,0 @@
|
||||
/*
|
||||
* @Author: zwq
|
||||
* @Date: 2022-08-24 11:19:43
|
||||
* @LastEditors: zwq
|
||||
* @LastEditTime: 2024-04-10 15:46:19
|
||||
* @Description:
|
||||
*/
|
||||
import { listData } from "@/api/system/dict/data"; //数据字典接口
|
||||
export default {
|
||||
data() {
|
||||
/* eslint-disable */
|
||||
return {
|
||||
urlOptions: {
|
||||
createURL: '', //新增接口
|
||||
updateURL: '', //编辑提交接口
|
||||
infoURL: '', //编辑时获取单条数据接口
|
||||
codeURL: '', //获取code接口(返回结果为dataForm.code字段)
|
||||
optionArrUrl: [], //需要获取下拉框的方法数组
|
||||
optionArr: {}, //需要获取下拉框的方法数组的返回结果
|
||||
dictNameList: [], //数据字典name数组
|
||||
dictArr: {}, //需要获取数据字典的方法数组的返回结果
|
||||
},
|
||||
visible: false,
|
||||
setData: false, // 是否需要【编辑时获取单条数据接口】返回的数据操作
|
||||
}
|
||||
},
|
||||
created() {
|
||||
},
|
||||
activated() {
|
||||
},
|
||||
methods: {
|
||||
init(id) {
|
||||
this.dataForm.id = id || null;
|
||||
this.visible = true;
|
||||
if (this.urlOptions.optionArrUrl.length > 0) {
|
||||
this.getArr()
|
||||
}
|
||||
if (this.urlOptions.dictNameList.length > 0) {
|
||||
this.getDict()
|
||||
}
|
||||
this.$nextTick(() => {
|
||||
this.$refs["dataForm"].resetFields();
|
||||
if (this.dataForm.id) {
|
||||
this.urlOptions.infoURL(id).then(response => {
|
||||
this.dataForm = response.data;
|
||||
if (this.setData) {
|
||||
this.setDataForm()
|
||||
}
|
||||
});
|
||||
} else {
|
||||
if (this.urlOptions.codeURL) {
|
||||
this.getCode()
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
/** 获取code */
|
||||
getCode() {
|
||||
this.urlOptions.codeURL()
|
||||
.then(({ data: res }) => {
|
||||
this.dataForm.code = res;
|
||||
})
|
||||
.catch(() => {});
|
||||
},
|
||||
/** 获取下拉框数组 */
|
||||
getArr() {
|
||||
const params = {
|
||||
pageSize: 100,
|
||||
pageNo: 1,
|
||||
}
|
||||
this.urlOptions.optionArrUrl.forEach((item, index) => {
|
||||
item(params).then(({ data: res }) => {
|
||||
this.$set(this.urlOptions.optionArr, `arr${index}`, res.list)
|
||||
})
|
||||
.catch(() => {
|
||||
});
|
||||
});
|
||||
},
|
||||
/** 查询字典数据列表 */
|
||||
getDict() {
|
||||
this.urlOptions.dictNameList.forEach((item,index)=>{
|
||||
const queryParams = {
|
||||
pageNo: 1,
|
||||
pageSize: 99,
|
||||
dictType: item,
|
||||
}
|
||||
listData(queryParams).then(response => {
|
||||
this.$set(this.urlOptions.dictArr, `dict${index}`, response.data.list)
|
||||
});
|
||||
})
|
||||
},
|
||||
// 表单提交
|
||||
dataFormSubmit() {
|
||||
this.$refs["dataForm"].validate((valid) => {
|
||||
if (!valid) {
|
||||
return false;
|
||||
}
|
||||
// 修改的提交
|
||||
if (this.dataForm.id) {
|
||||
this.urlOptions.updateURL(this.dataForm).then(response => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.visible = false;
|
||||
this.$emit("refreshDataList");
|
||||
});
|
||||
return;
|
||||
}
|
||||
// 添加的提交
|
||||
this.urlOptions.createURL(this.dataForm).then(response => {
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.visible = false;
|
||||
this.$emit("refreshDataList");
|
||||
});
|
||||
});
|
||||
},
|
||||
/** 清空form */
|
||||
formClear() {
|
||||
if (this.$refs.dataForm!==undefined) {
|
||||
this.$refs.dataForm.resetFields();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,128 +0,0 @@
|
||||
/*
|
||||
* @Author: zwq
|
||||
* @Date: 2022-08-24 11:19:43
|
||||
* @LastEditors: zwq
|
||||
* @LastEditTime: 2024-04-02 09:33:29
|
||||
* @Description:
|
||||
*/
|
||||
export default {
|
||||
data() {
|
||||
/* eslint-disable */
|
||||
return {
|
||||
urlOptions: {
|
||||
getDataListURL: '', //获取table接口
|
||||
deleteURL: '', //删除接口
|
||||
exportURL: '' //导出接口
|
||||
},
|
||||
tableData: [], //table数据
|
||||
listQuery: { //分页
|
||||
pageSize: 10,
|
||||
pageNo: 1,
|
||||
total: 1,
|
||||
},
|
||||
exportLoading: false, //导出完成的加载状态是否开启
|
||||
dataListLoading: false, //获取table的加载状态是否开启
|
||||
addOrEditTitle: '', //dialog的title
|
||||
addOrUpdateVisible: false, //dialog状态
|
||||
}
|
||||
},
|
||||
created() {
|
||||
},
|
||||
mounted() {
|
||||
this.getDataList()
|
||||
},
|
||||
methods: {
|
||||
// 获取数据列表
|
||||
getDataList() {
|
||||
this.dataListLoading = true;
|
||||
this.urlOptions.getDataListURL(this.listQuery).then(response => {
|
||||
this.tableData = response.data.list;
|
||||
this.listQuery.total = response.data.total;
|
||||
this.dataListLoading = false;
|
||||
});
|
||||
},
|
||||
// 每页数
|
||||
sizeChangeHandle(val) {
|
||||
this.listQuery.pageSize = val;
|
||||
this.listQuery.pageNo = 1;
|
||||
this.getDataList();
|
||||
},
|
||||
// 当前页
|
||||
currentChangeHandle(val) {
|
||||
this.listQuery.pageNo = val;
|
||||
this.getDataList();
|
||||
},
|
||||
// 新增
|
||||
addOrUpdateHandle(id) {
|
||||
this.addOrEditTitle = "新增";
|
||||
this.addOrUpdateVisible = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.addOrUpdate.init(id);
|
||||
});
|
||||
},
|
||||
//tableBtn点击
|
||||
handleClick(val) {
|
||||
if (val.type === "edit") {
|
||||
this.addOrUpdateVisible = true;
|
||||
this.addOrEditTitle = "编辑";
|
||||
this.$nextTick(() => {
|
||||
this.$refs.addOrUpdate.init(val.data.id);
|
||||
});
|
||||
} else if (val.type === "delete") {
|
||||
this.deleteHandle(val.data.id, val.data.name, val.data._pageIndex)
|
||||
} else {
|
||||
this.otherMethods(val)
|
||||
}
|
||||
},
|
||||
// 删除
|
||||
deleteHandle(id, name, index) {
|
||||
this.$confirm(`是否确认删除${name ? '名称为"' + name + '"' : '序号为"' + index + '"'}的数据项?`, "系统提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning",
|
||||
})
|
||||
.then(() => {
|
||||
this.urlOptions.deleteURL(id).then(({ data }) => {
|
||||
this.$message({
|
||||
message: "操作成功",
|
||||
type: "success",
|
||||
duration: 1500,
|
||||
onClose: () => {
|
||||
this.getDataList();
|
||||
},
|
||||
});
|
||||
});
|
||||
})
|
||||
.catch(() => { });
|
||||
},
|
||||
// dialog取消
|
||||
handleCancel() {
|
||||
this.$refs.addOrUpdate.formClear()
|
||||
this.addOrUpdateVisible = false
|
||||
this.addOrEditTitle = ''
|
||||
},
|
||||
// dialog确定
|
||||
handleConfirm() {
|
||||
this.$refs.addOrUpdate.dataFormSubmit()
|
||||
},
|
||||
// dialog的父组件方法this.$emit("refreshDataList");
|
||||
successSubmit() {
|
||||
this.handleCancel()
|
||||
this.getDataList()
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
// 处理查询参数
|
||||
let params = { ...this.queryParams };
|
||||
params.pageNo = undefined;
|
||||
params.pageSize = undefined;
|
||||
this.$modal.confirm('是否确认导出所有数据项?').then(() => {
|
||||
this.exportLoading = true;
|
||||
return this.urlOptions.exportURL(params);
|
||||
}).then(response => {
|
||||
this.$download.excel(response, '报表.xls');
|
||||
this.exportLoading = false;
|
||||
}).catch(() => { });
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -28,10 +28,59 @@ export default {
|
||||
// tableBtn: [], // 占位
|
||||
// searchBarFormConfig: [], // 占位
|
||||
// // 弹窗表单配置
|
||||
// dialogFormConfig: [], // 占位
|
||||
// dialogFormConfig: [], //
|
||||
updateUrl: '',
|
||||
addUrl: '',
|
||||
pageUrl: '',
|
||||
infoUrl: '',
|
||||
basePath: '',
|
||||
form: {}
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
addPath() {
|
||||
return this.basePath + '/create'
|
||||
},
|
||||
updatePath() {
|
||||
return this.basePath + '/update'
|
||||
},
|
||||
deletePath() {
|
||||
return this.basePath + '/delete'
|
||||
},
|
||||
infoPath() {
|
||||
return this.basePath + '/get'
|
||||
},
|
||||
pagePath() {
|
||||
return this.basePath + '/page'
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// utils
|
||||
http(url, method, payload) {
|
||||
return this.$axios({
|
||||
url,
|
||||
method,
|
||||
params: method === 'get' ? payload : null,
|
||||
data: method !== 'get' ? payload : null,
|
||||
})
|
||||
},
|
||||
put(payload) {
|
||||
return this.http(this.updateUrl == '' ? this.updatePath : this.updateUrl, 'put', payload);
|
||||
},
|
||||
post(payload) {
|
||||
return this.http(this.addUrl == '' ? this.addPath : this.addUrl, 'post', payload);
|
||||
},
|
||||
recv(payload) {
|
||||
return this.http(this.pageUrl == '' ? this.pagePath : this.pageUrl, 'get', payload);
|
||||
},
|
||||
info(payload) {
|
||||
return this.http(this.infoUrl == '' ? this.infoPath : this.infoUrl, 'get', payload);
|
||||
},
|
||||
del(payload) {
|
||||
return this.http(this.deleteUrl == '' ? this.deletePath : this.deleteUrl, 'delete', payload);
|
||||
},
|
||||
|
||||
|
||||
// 过滤后端传回的详情数据
|
||||
filterData(data, keys) {
|
||||
const obj = {};
|
||||
|
||||
@@ -1,20 +0,0 @@
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
tableH: this.tableHeight(260),
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.tableH = this?.heightNum ? this.tableHeight(this.heightNum) : this.tableHeight(260);
|
||||
window.addEventListener('resize', this._setTableHeight);
|
||||
},
|
||||
destroyed() {
|
||||
window.removeEventListener('resize', this._setTableHeight);
|
||||
},
|
||||
methods: {
|
||||
_setTableHeight() {
|
||||
this.tableH = this?.heightNum ? this.tableHeight(this.heightNum) : this.tableHeight(260);
|
||||
// this.tableH = this.tableHeight(260);
|
||||
},
|
||||
},
|
||||
};
|
||||
@@ -1,20 +0,0 @@
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
tableH: this.tableHeight(260),
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.tableH = this?.heightNum ? this.tableHeight(this.heightNum) : this.tableHeight(260);
|
||||
window.addEventListener('resize', this._setTableHeight);
|
||||
},
|
||||
destroyed() {
|
||||
window.removeEventListener('resize', this._setTableHeight);
|
||||
},
|
||||
methods: {
|
||||
_setTableHeight() {
|
||||
this.tableH = this?.heightNum ? this.tableHeight(this.heightNum) : this.tableHeight(260);
|
||||
// this.tableH = this.tableHeight(260);
|
||||
},
|
||||
},
|
||||
};
|
||||
@@ -70,18 +70,17 @@ export const constantRoutes = [
|
||||
hidden: true
|
||||
},
|
||||
{
|
||||
path: "",
|
||||
path: '/',
|
||||
component: Layout,
|
||||
redirect: "index",
|
||||
children: [
|
||||
{
|
||||
path: "index",
|
||||
component: (resolve) => require(["@/views/core/base/factory/index"], resolve),
|
||||
name: "首页",
|
||||
meta: { title: "首页", icon: "dashboard", affix: true },
|
||||
hidden: true
|
||||
},
|
||||
],
|
||||
// redirect: 'core/base/factory',
|
||||
// children: [{
|
||||
// path: 'index',
|
||||
// redirect: 'core/base/factory',
|
||||
// component: (resolve) => require(['@/views/index'], resolve),
|
||||
// name: '首页',
|
||||
// meta: { title: '首页', icon: 'dashboard', affix: true }
|
||||
// }
|
||||
// ]
|
||||
},
|
||||
{
|
||||
path: '/user',
|
||||
|
||||
53
src/utils/cache.js
Normal file
53
src/utils/cache.js
Normal file
@@ -0,0 +1,53 @@
|
||||
let timers = [];
|
||||
|
||||
export default {
|
||||
|
||||
exists(key) {
|
||||
const _ = localStorage.getItem('stored_keys');
|
||||
return _ ? _.split(',')?.indexOf(key) != -1 : false;
|
||||
},
|
||||
|
||||
store(key, value, duration = null) {
|
||||
if (!localStorage.getItem('stored_keys')) localStorage.setItem('stored_keys', key);
|
||||
else localStorage.setItem('stored_keys', localStorage.getItem('stored_keys') + ',' + key);
|
||||
|
||||
localStorage.setItem(key, JSON.stringify(value));
|
||||
console.log('store duration', duration)
|
||||
if (duration) {
|
||||
if (timers[key]) clearTimeout(timers[key]);
|
||||
timers[key] = setTimeout(() => {
|
||||
console.log("clear cache", key)
|
||||
this.clear([key]);
|
||||
}, duration * 1000);
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
*
|
||||
* @param {*} key
|
||||
* @param {*} cb
|
||||
* @param {*} param2 force 强制更新,调用cb
|
||||
* @returns
|
||||
*/
|
||||
async getList(key, cb = null, { force = false, duration = null } = {}) {
|
||||
if (this.exists(key) && !force) {
|
||||
return JSON.parse(localStorage.getItem(key))
|
||||
} else {
|
||||
const list = await cb();
|
||||
this.store(key, list, duration);
|
||||
return list;
|
||||
}
|
||||
},
|
||||
|
||||
clear(keys) {
|
||||
if (keys && keys.length) {
|
||||
let stored_keys = localStorage.getItem('stored_keys').split(',');
|
||||
keys.forEach((key) => {
|
||||
stored_keys = stored_keys.filter((item) => item != key);
|
||||
});
|
||||
localStorage.setItem('stored_keys', stored_keys);
|
||||
return;
|
||||
}
|
||||
localStorage.removeItem('stored_keys');
|
||||
},
|
||||
}
|
||||
@@ -86,17 +86,24 @@ export const DICT_TYPE = {
|
||||
// ============== PRODUCT - 产品模块 =============
|
||||
UNIT_DICT: 'unit_dict',
|
||||
PRODUCT_TYPE: 'product_type',
|
||||
PROCESS_TYPE: 'process_type',
|
||||
|
||||
// ============== ENERGY - 能源模块 =============
|
||||
ENERGY_UNIT: 'energy_unit',
|
||||
|
||||
// ============== ENERGY - 能源模块 =============
|
||||
EQU_ALARM_LEVEL: 'equ_alarm_level',
|
||||
MONITOR_INDEX_TYPE: 'monitor_index_type',
|
||||
OBJECT_TYPE: 'object_type',
|
||||
STATISTIC_TYPE: 'statistic_type',
|
||||
TIME_DIM: 'time_dim'
|
||||
TIME_DIM: 'time_dim',
|
||||
|
||||
// ============== ORDER - 订单模块 =============
|
||||
ORDER_STATUS: 'order_status',
|
||||
ORDER_ORIGIN: 'order_Origin',
|
||||
ORDER_PRIORITY: 'order_priority',
|
||||
PACK_SPEC: 'pack_spec',
|
||||
|
||||
// ============== EQUIPMENT - 设备模块 =============
|
||||
MAINTAIN_TYPE: 'maintain_type',
|
||||
FAULT_LEVEL: 'fault-level',
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -217,7 +217,7 @@ export function getTime(type) {
|
||||
export function debounce(func, wait, immediate) {
|
||||
let timeout, args, context, timestamp, result
|
||||
|
||||
const later = function() {
|
||||
const later = function () {
|
||||
// 据上一次触发时间间隔
|
||||
const last = +new Date() - timestamp
|
||||
|
||||
@@ -234,7 +234,7 @@ export function debounce(func, wait, immediate) {
|
||||
}
|
||||
}
|
||||
|
||||
return function(...args) {
|
||||
return function (...args) {
|
||||
context = this
|
||||
timestamp = +new Date()
|
||||
const callNow = immediate && !timeout
|
||||
@@ -438,3 +438,7 @@ export function toCamelCase(str, upperCaseFirst) {
|
||||
|
||||
return str;
|
||||
}
|
||||
|
||||
export function IdToName(targetId, source, prop = 'name') {
|
||||
return source.find(item => item.id === targetId)?.[prop]
|
||||
}
|
||||
@@ -48,50 +48,6 @@ export function parseTime(time, pattern) {
|
||||
return time_str
|
||||
}
|
||||
|
||||
// 日期格式化(仅适用表格)
|
||||
export function parseTimeTable(pattern) {
|
||||
return function(time){
|
||||
if (arguments.length === 0 || !time) {
|
||||
return null
|
||||
}
|
||||
const format = pattern || '{y}-{m}-{d} {h}:{i}:{s}'
|
||||
let date
|
||||
if (typeof time === 'object') {
|
||||
date = time
|
||||
} else {
|
||||
if ((typeof time === 'string') && (/^[0-9]+$/.test(time))) {
|
||||
time = parseInt(time)
|
||||
} else if (typeof time === 'string') {
|
||||
time = time.replace(new RegExp(/-/gm), '/').replace('T', ' ').replace(new RegExp(/\.\d{3}/gm),'');
|
||||
}
|
||||
if ((typeof time === 'number') && (time.toString().length === 10)) {
|
||||
time = time * 1000
|
||||
}
|
||||
date = new Date(time)
|
||||
}
|
||||
const formatObj = {
|
||||
y: date.getFullYear(),
|
||||
m: date.getMonth() + 1,
|
||||
d: date.getDate(),
|
||||
h: date.getHours(),
|
||||
i: date.getMinutes(),
|
||||
s: date.getSeconds(),
|
||||
a: date.getDay()
|
||||
}
|
||||
const time_str = format.replace(/{([ymdhisa])+}/g, (result, key) => {
|
||||
let value = formatObj[key]
|
||||
// Note: getDay() returns 0 on Sunday
|
||||
if (key === 'a') {
|
||||
return ['日', '一', '二', '三', '四', '五', '六'][value]
|
||||
}
|
||||
if (result.length > 0 && value < 10) {
|
||||
value = '0' + value
|
||||
}
|
||||
return value || 0
|
||||
})
|
||||
return time_str
|
||||
}
|
||||
}
|
||||
// 表单重置
|
||||
export function resetForm(refName) {
|
||||
if (this.$refs[refName]) {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<!--
|
||||
<!--
|
||||
filename: AssetsUpload.vue
|
||||
author: liubin
|
||||
date: 2023-10-12 16:40:14
|
||||
@@ -27,7 +27,6 @@
|
||||
}">
|
||||
<el-upload
|
||||
class="equipment-upload"
|
||||
:style="{ marginBottom: isPicMode ? '48px' : '24px' }"
|
||||
:disabled="disabled"
|
||||
drag
|
||||
:action="uploadUrl"
|
||||
@@ -59,43 +58,31 @@
|
||||
<i class="el-icon-delete"></i>
|
||||
</div> -->
|
||||
<div
|
||||
class="file-list__item"
|
||||
v-for="(file, index) in files"
|
||||
:key="file.fileName"
|
||||
style="width: 100%">
|
||||
<div
|
||||
class="file-list__item"
|
||||
v-if="!isPicMode"
|
||||
:style="{
|
||||
background: isPicMode
|
||||
? `url(${file.fileUrl}) no-repeat`
|
||||
: `url(${defaultBg}) no-repeat`,
|
||||
backgroundSize: isPicMode ? '100% 100%' : '64px',
|
||||
backgroundPosition: isPicMode ? '0% 0%' : 'center',
|
||||
}"
|
||||
@click="handleDownload(file)"
|
||||
:data-name="file.fileName">
|
||||
<el-button
|
||||
v-if="!disabled"
|
||||
type="text"
|
||||
class="el-icon-delete"
|
||||
style="padding: 0"
|
||||
@click="(e) => handleDelete(file)" />
|
||||
</div>
|
||||
|
||||
<el-image
|
||||
v-else
|
||||
class="file-list__item"
|
||||
style="width: 100%"
|
||||
:src="file.fileUrl"
|
||||
:preview-src-list="files.map((item) => item.fileUrl)"></el-image>
|
||||
</div>
|
||||
:style="{
|
||||
background: isPicMode
|
||||
? `url(${file.fileUrl}) no-repeat`
|
||||
: `url(${defaultBg}) no-repeat`,
|
||||
backgroundSize: isPicMode ? '100% 100%' : '64px',
|
||||
backgroundPosition: isPicMode ? '0% 0%' : 'center',
|
||||
}"
|
||||
:data-name="file.fileName">
|
||||
<el-button
|
||||
v-if="!disabled"
|
||||
type="text"
|
||||
class="el-icon-delete"
|
||||
style="padding: 0"
|
||||
@click="(e) => handleDelete(file)" />
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getAccessToken } from '@/utils/auth';
|
||||
import defaultBg from '../../../../../assets/images/default-file-icon.png';
|
||||
import defaultBg from '../../../../assets/images/default-file-icon.png';
|
||||
|
||||
function checkSize(file, message) {
|
||||
const isLt2M = file.size / 1024 / 1024 < 2;
|
||||
@@ -152,56 +139,7 @@ export default {
|
||||
headers: { Authorization: 'Bearer ' + getAccessToken() }, // 设置上传的请求头部
|
||||
fileList: [],
|
||||
uploadUrl: process.env.VUE_APP_BASE_API + '/admin-api/infra/file/upload',
|
||||
files: [
|
||||
// 服务器返回的结构
|
||||
// {
|
||||
// fileName: 'sf.docs',
|
||||
// fileType: 'asset',
|
||||
// fileUrl:
|
||||
// 'https://hbimg.b0.upaiyun.com/cc7475787bd08ed926b68eaf53fa1f2c5473259115e3c-gJdObd_fw658',
|
||||
// },
|
||||
// {
|
||||
// fileName: 'sddf.docs',
|
||||
// fileType: 'asset',
|
||||
// fileUrl: 'https://img0.sc115.com/wm/xqx/pic1/1501xofo4ssolji.jpg',
|
||||
// },
|
||||
// {
|
||||
// fileName: 'jjj.docs',
|
||||
// fileType: 'asset',
|
||||
// fileUrl:
|
||||
// 'https://www.mms591.com/www.mms591.com-photo/2013081823/1-130QR34544.jpg',
|
||||
// },
|
||||
// {
|
||||
// fileName: 'asdfasdf.docs',
|
||||
// fileType: 'asset',
|
||||
// fileUrl:
|
||||
// 'https://hbimg.b0.upaiyun.com/8f6bced5f2e38d3a021b2c48d5a98dfb6317e3e12c6a0-QmhJ5v_fw658',
|
||||
// },
|
||||
// {
|
||||
// fileName: 'asdkj.docs',
|
||||
// fileType: 'asset',
|
||||
// fileUrl:
|
||||
// 'https://www.mms591.com/www.mms591.com-photo/2013013021/1-130130212034.jpg',
|
||||
// },
|
||||
// {
|
||||
// fileName: 'lkasjdf.docs',
|
||||
// fileType: 'asset',
|
||||
// fileUrl:
|
||||
// 'https://www.mms591.com/www.mms591.com-photo/2013072122/1-130H1223057.jpg',
|
||||
// },
|
||||
// {
|
||||
// fileName: 'asdf.docs',
|
||||
// fileType: 'asset',
|
||||
// fileUrl:
|
||||
// 'https://img.1ppt.com/uploads/allimg/1212/1-1212101ZH5A2.jpg',
|
||||
// },
|
||||
// {
|
||||
// fileName: 'afdffff.docs',
|
||||
// fileType: 'asset',
|
||||
// fileUrl:
|
||||
// 'https://www.mms591.com/www.mms591.com-photo/2013051721/1-13051H11945.jpg',
|
||||
// },
|
||||
],
|
||||
files: [],
|
||||
updateTimer: null,
|
||||
};
|
||||
},
|
||||
@@ -229,7 +167,7 @@ export default {
|
||||
response.data == null ||
|
||||
response.data.trim() == ''
|
||||
) {
|
||||
this.$message.warning('上传出错了!');
|
||||
this.$message.error('上传出错了!');
|
||||
return;
|
||||
}
|
||||
this.files.push({
|
||||
@@ -289,32 +227,6 @@ export default {
|
||||
// Array
|
||||
this.$emit('update-filelist', this.appendFilelist);
|
||||
},
|
||||
|
||||
async handleDownload(file) {
|
||||
if (this.isPicMode) {
|
||||
// this.$emit('preview', file);
|
||||
const link = document.createElement('a');
|
||||
link.href = file.fileUrl;
|
||||
link.target = '_blank';
|
||||
document.body.appendChild(link);
|
||||
link.click();
|
||||
document.body.removeChild(link);
|
||||
} else {
|
||||
// this.$emit('download', file);
|
||||
const data = await this.$axios({
|
||||
url: file.fileUrl,
|
||||
method: 'get',
|
||||
responseType: 'blob',
|
||||
});
|
||||
const link = document.createElement('a');
|
||||
link.href = window.URL.createObjectURL(new Blob([data]));
|
||||
link.download = file.fileName;
|
||||
document.body.appendChild(link);
|
||||
link.click();
|
||||
document.body.removeChild(link);
|
||||
window.URL.revokeObjectURL(link.href);
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
@@ -453,7 +365,7 @@ export default {
|
||||
}
|
||||
|
||||
.default-icon {
|
||||
background: url(../../../../../assets/images/default-file-icon.png) no-repeat;
|
||||
background: url(../../../../assets/images/default-file-icon.png) no-repeat;
|
||||
background-position: center;
|
||||
background-size: 64px;
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
<!--
|
||||
<!--
|
||||
filename: dialogForm.vue
|
||||
author: liubin
|
||||
date: 2023-08-15 10:32:36
|
||||
@@ -44,7 +44,7 @@
|
||||
<el-date-picker
|
||||
v-if="col.datetime"
|
||||
v-model="form[col.prop]"
|
||||
type="date"
|
||||
type="datetime"
|
||||
:placeholder="`请选择${col.label}`"
|
||||
value-format="timestamp"
|
||||
v-bind="col.bind"></el-date-picker>
|
||||
@@ -1,8 +1,8 @@
|
||||
<!--
|
||||
<!--
|
||||
filename: EquipmentDrawer.vue
|
||||
author: liubin
|
||||
date: 2023-08-22 14:38:56
|
||||
description:
|
||||
description:
|
||||
-->
|
||||
|
||||
<template>
|
||||
@@ -308,7 +308,6 @@ export default {
|
||||
});
|
||||
if (code == 0) {
|
||||
this.$modal.msgSuccess('更新成功');
|
||||
this.$emit('refreshDataList');
|
||||
}
|
||||
|
||||
this.btnLoading = false;
|
||||
@@ -362,7 +361,7 @@ export default {
|
||||
|
||||
// 新增属性
|
||||
handleAddAttr() {
|
||||
if (!this.dataId) return this.$message.warning('请先创建设备信息');
|
||||
if (!this.dataId) return this.$message.error('请先创建设备信息');
|
||||
this.attrForm = {
|
||||
id: null,
|
||||
equipmentId: this.dataId,
|
||||
@@ -1,4 +1,4 @@
|
||||
<!--
|
||||
<!--
|
||||
filename: dialogForm.vue
|
||||
author: liubin
|
||||
date: 2023-08-15 10:32:36
|
||||
@@ -6,151 +6,105 @@
|
||||
-->
|
||||
|
||||
<template>
|
||||
<el-form
|
||||
class="equipment-info-form"
|
||||
ref="form"
|
||||
:model="form"
|
||||
label-width="200px"
|
||||
label-position="top"
|
||||
<el-form class="equipment-info-form" ref="form" :model="form" label-width="200px" label-position="top"
|
||||
v-loading="formLoading">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="8">
|
||||
<el-form-item
|
||||
label="设备名称"
|
||||
prop="name"
|
||||
:rules="[{ required: true, message: '不能为空', trigger: 'blur' }]">
|
||||
<el-input
|
||||
v-model="form.name"
|
||||
:disabled="disabled"
|
||||
placeholder="请输入设备名称"></el-input>
|
||||
<el-form-item label="设备名称" prop="name" :rules="[{ required: true, message: '不能为空', trigger: 'blur' }]">
|
||||
<el-input v-model="form.name" :disabled="disabled" placeholder="请输入设备名称"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="设备编码" prop="code" :rules="[]">
|
||||
<el-input
|
||||
v-model="form.code"
|
||||
:disabled="disabled"
|
||||
placeholder="请输入设备编码"></el-input>
|
||||
<el-input v-model="form.code" :disabled="disabled" placeholder="请输入设备编码"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="英文名称" prop="enName" :rules="[]">
|
||||
<el-input
|
||||
v-model="form.enName"
|
||||
:disabled="disabled"
|
||||
placeholder="请输入英文名称"></el-input>
|
||||
<el-input v-model="form.enName" :disabled="disabled" placeholder="请输入英文名称"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="缩写" prop="abbr" :rules="[]">
|
||||
<el-input
|
||||
v-model="form.abbr"
|
||||
:disabled="disabled"
|
||||
placeholder="请输入名称缩写"></el-input>
|
||||
<el-input v-model="form.abbr" :disabled="disabled" placeholder="请输入名称缩写"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="设备类型" prop="equipmentTypeId" :rules="[]">
|
||||
<el-select
|
||||
v-model="form.equipmentTypeId"
|
||||
:disabled="disabled"
|
||||
filterable
|
||||
clearable
|
||||
placeholder="请选择设备类型">
|
||||
<el-option
|
||||
v-for="eqType in eqTypeList"
|
||||
:key="eqType.id"
|
||||
:label="eqType.name"
|
||||
<el-form-item label="设备类型" prop="equipmentTypeId"
|
||||
:rules="[{ required: true, message: '不能为空', trigger: 'blur' }]">
|
||||
<el-select v-model="form.equipmentTypeId" :disabled="disabled" filterable placeholder="请选择设备类型">
|
||||
<el-option v-for="eqType in eqTypeList" :key="eqType.id" :label="eqType.name"
|
||||
:value="eqType.id"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="8">
|
||||
<el-form-item label="备注" prop="remark" :rules="[]">
|
||||
<el-input
|
||||
v-model="form.remark"
|
||||
:disabled="disabled"
|
||||
placeholder="请输入备注"></el-input>
|
||||
<el-form-item label="预计生产时间(min/天)" prop="workTime" :rules="[
|
||||
{ required: true, message: '不能为空', trigger: 'blur' },
|
||||
{
|
||||
type: 'number',
|
||||
message: '请输入正确的数字值',
|
||||
trigger: 'blur',
|
||||
transform: (val) => Number(val),
|
||||
},
|
||||
]">
|
||||
<el-input v-model="form.workTime" :disabled="disabled" placeholder="请输入预计生产时间"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="生产日期" prop="productionTime" :rules="[]">
|
||||
<el-date-picker
|
||||
v-model="form.productionTime"
|
||||
:disabled="disabled"
|
||||
type="date"
|
||||
placeholder="请选择生产日期"
|
||||
<el-date-picker v-model="form.enterTime" :disabled="disabled" type="datetime" placeholder="请选择生产日期"
|
||||
value-format="timestamp"></el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="进场日期" prop="enterTime" :rules="[]">
|
||||
<el-date-picker
|
||||
v-model="form.enterTime"
|
||||
:disabled="disabled"
|
||||
type="date"
|
||||
placeholder="请选择进场日期"
|
||||
<el-date-picker v-model="form.enterTime" :disabled="disabled" type="datetime" placeholder="请选择进场日期"
|
||||
value-format="timestamp"></el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item
|
||||
label="设备理论生产能效(片/min)"
|
||||
prop="tvalue"
|
||||
:rules="[
|
||||
{ required: true, message: '不能为空', trigger: 'blur' },
|
||||
{
|
||||
type: 'number',
|
||||
message: '请输入正确的数字值',
|
||||
trigger: 'blur',
|
||||
transform: (val) => Number(val),
|
||||
},
|
||||
]">
|
||||
<el-input
|
||||
v-model="form.tvalue"
|
||||
:disabled="disabled"
|
||||
placeholder="请输入"></el-input>
|
||||
<el-form-item label="设备TT值" prop="tvalue" :rules="[
|
||||
{ required: true, message: '不能为空', trigger: 'blur' },
|
||||
{
|
||||
type: 'number',
|
||||
message: '请输入正确的数字值',
|
||||
trigger: 'blur',
|
||||
transform: (val) => Number(val),
|
||||
},
|
||||
]">
|
||||
<el-input v-model="form.tvalue" :disabled="disabled" placeholder="请输入设备TT值"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="8">
|
||||
<el-form-item
|
||||
label="产品加工时间(s)"
|
||||
prop="processingTime"
|
||||
:rules="[
|
||||
{ required: true, message: '不能为空', trigger: 'blur' },
|
||||
{
|
||||
type: 'number',
|
||||
message: '请输入正确的数字值',
|
||||
trigger: 'blur',
|
||||
transform: (val) => Number(val),
|
||||
},
|
||||
]">
|
||||
<el-input
|
||||
v-model="form.processingTime"
|
||||
:disabled="disabled"
|
||||
placeholder="请输入产品加工时间"></el-input>
|
||||
<el-form-item label="产品加工时间(s)" prop="processingTime" :rules="[
|
||||
{ required: true, message: '不能为空', trigger: 'blur' },
|
||||
{
|
||||
type: 'number',
|
||||
message: '请输入正确的数字值',
|
||||
trigger: 'blur',
|
||||
transform: (val) => Number(val),
|
||||
},
|
||||
]">
|
||||
<el-input v-model="form.processingTime" :disabled="disabled" placeholder="请输入产品加工时间"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="制造商" prop="manufacturer" :rules="[]">
|
||||
<el-input
|
||||
v-model="form.manufacturer"
|
||||
:disabled="disabled"
|
||||
placeholder="请输入制造商"></el-input>
|
||||
<el-input v-model="form.manufacturer" :disabled="disabled" placeholder="请输入制造商"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="设备规格" prop="spec" :rules="[]">
|
||||
<el-input
|
||||
v-model="form.spec"
|
||||
:disabled="disabled"
|
||||
placeholder="请输入设备规格"></el-input>
|
||||
<el-input v-model="form.spec" :disabled="disabled" placeholder="请输入设备规格"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
@@ -158,14 +112,19 @@
|
||||
<!-- 功能描述 -->
|
||||
<el-col>
|
||||
<el-form-item label="功能描述" prop="description" :rules="[]">
|
||||
<el-input
|
||||
type="textarea"
|
||||
:disabled="disabled"
|
||||
v-model="form.description"
|
||||
<el-input type="textarea" :disabled="disabled" v-model="form.description"
|
||||
placeholder="请填写功能描述"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<!-- 功能描述 -->
|
||||
<el-col>
|
||||
<el-form-item label="备注" prop="remark" :rules="[]">
|
||||
<el-input v-model="form.remark" :disabled="disabled" placeholder="请输入备注"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<!-- 上传资料 -->
|
||||
<el-col>
|
||||
@@ -178,10 +137,7 @@
|
||||
<!-- 上传图片 -->
|
||||
<el-col>
|
||||
<el-form-item label="上传图片" prop="pics" :rules="[]">
|
||||
<AssetsUpload
|
||||
:is-pic-mode="true"
|
||||
v-model="form.pics"
|
||||
:disabled="disabled" />
|
||||
<AssetsUpload :is-pic-mode="true" v-model="form.pics" :disabled="disabled" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
@@ -230,6 +186,7 @@ export default {
|
||||
equipmentTypeId: '',
|
||||
remark: '',
|
||||
productionTime: '',
|
||||
workTime: '',
|
||||
enterTime: '',
|
||||
tvalue: '',
|
||||
processingTime: '',
|
||||
@@ -284,7 +241,7 @@ export default {
|
||||
async getEqTypeList() {
|
||||
this.formLoading = true;
|
||||
const { code, data } = await this.$axios(
|
||||
'/base/equipment-type/page?pageNo=1&pageSize=100'
|
||||
'/base/core-equipment-type/page?pageNo=1&pageSize=100'
|
||||
);
|
||||
// debugger;
|
||||
if (code == 0) {
|
||||
@@ -306,18 +263,11 @@ export default {
|
||||
return response.data;
|
||||
},
|
||||
// 上传成功的特殊处理
|
||||
beforeUpload() {},
|
||||
beforeUpload() { },
|
||||
// 上传前的验证规则可通过 bind 属性传入
|
||||
handleUploadSuccess(response, file, fileList) {
|
||||
console.log(
|
||||
'[dialogForm:handleUploadSuccess]',
|
||||
response,
|
||||
file,
|
||||
fileList,
|
||||
this.form
|
||||
);
|
||||
// 保存原始文件名
|
||||
if ('fileNames' in this.form) this.form.fileNames.push(file.name+Date.now());
|
||||
if ('fileNames' in this.form) this.form.fileNames.push(file.name);
|
||||
// 保存完整地址
|
||||
if ('fileUrls' in this.form) this.form.fileUrls.push(response.data);
|
||||
this.$modal.msgSuccess('上传成功');
|
||||
@@ -1,105 +1,69 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<!-- 搜索工作栏 -->
|
||||
<SearchBar
|
||||
:formConfigs="searchBarFormConfig"
|
||||
ref="search-bar"
|
||||
@headBtnClick="handleSearchBarBtnClick" />
|
||||
<SearchBar :formConfigs="searchBarFormConfig" ref="search-bar" @headBtnClick="handleSearchBarBtnClick" />
|
||||
|
||||
<!-- 列表 -->
|
||||
<base-table
|
||||
:table-props="tableProps"
|
||||
:page="queryParams.pageNo"
|
||||
:limit="queryParams.pageSize"
|
||||
:table-data="list"
|
||||
<base-table :table-props="tableProps" :page="queryParams.pageNo" :limit="queryParams.pageSize" :table-data="list"
|
||||
@emitFun="handleEmitFun">
|
||||
<method-btn
|
||||
v-if="tableBtn.length"
|
||||
slot="handleBtn"
|
||||
:width="120"
|
||||
label="操作"
|
||||
:method-list="tableBtn"
|
||||
<method-btn v-if="tableBtn.length" slot="handleBtn" :width="120" label="操作" :method-list="tableBtn"
|
||||
@clickBtn="handleTableBtnClick" />
|
||||
</base-table>
|
||||
|
||||
<!-- 分页组件 -->
|
||||
<pagination
|
||||
v-show="total > 0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNo"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize"
|
||||
@pagination="getList" />
|
||||
|
||||
<!-- 对话框(添加) -->
|
||||
<base-dialog
|
||||
:dialogTitle="title"
|
||||
:dialogVisible="open"
|
||||
@close="cancel"
|
||||
@cancel="cancel"
|
||||
width="60%"
|
||||
<base-dialog :dialogTitle="title" :dialogVisible="open" @close="cancel" @cancel="cancel" width="60%"
|
||||
@confirm="submitForm">
|
||||
<DialogForm1
|
||||
v-if="open"
|
||||
key="index-dialog-form"
|
||||
ref="form"
|
||||
label-position="top"
|
||||
size="small"
|
||||
v-model="form"
|
||||
:rows="computedRows"
|
||||
:has-file="true" />
|
||||
<DialogForm v-if="open" key="index-dialog-form" ref="form" label-position="top" size="small" :dataForm="form"
|
||||
:rows="computedRows" />
|
||||
</base-dialog>
|
||||
|
||||
<!-- 设备 详情 - 编辑 -->
|
||||
<EquipmentDrawer
|
||||
v-if="editVisible"
|
||||
ref="drawer"
|
||||
:mode="editMode"
|
||||
@update-mode="editMode = $event"
|
||||
:data-id="form.id"
|
||||
:sections="[
|
||||
<EquipmentDrawer v-if="editVisible" ref="drawer" :mode="editMode" @update-mode="editMode = $event"
|
||||
:data-id="form.id" :sections="[
|
||||
{
|
||||
name: '基本信息',
|
||||
key: 'base',
|
||||
rows: computedRows,
|
||||
url: '/base/equipment/get',
|
||||
urlUpdate: '/base/equipment/update',
|
||||
urlCreate: '/base/equipment/create',
|
||||
url: '/base/core-equipment/get',
|
||||
urlUpdate: '/base/core-equipment/update',
|
||||
urlCreate: '/base/core-equipment/create',
|
||||
queryParams: { id: form.id },
|
||||
},
|
||||
{
|
||||
name: '属性列表',
|
||||
key: 'attrs',
|
||||
props: drawerListProps,
|
||||
url: '/base/equipment-attr/page',
|
||||
urlCreate: '/base/equipment-attr/create',
|
||||
urlUpdate: '/base/equipment-attr/update',
|
||||
urlDelete: '/base/equipment-attr/delete',
|
||||
urlDetail: '/base/equipment-attr/get',
|
||||
url: '/base/core-equipment-attr/page',
|
||||
urlCreate: '/base/core-equipment-attr/create',
|
||||
urlUpdate: '/base/core-equipment-attr/update',
|
||||
urlDelete: '/base/core-equipment-attr/delete',
|
||||
urlDetail: '/base/core-equipment-attr/get',
|
||||
queryParams: {
|
||||
equipmentId: form.id,
|
||||
pageNo: 1,
|
||||
pageSize: 20,
|
||||
pageSize: 10,
|
||||
},
|
||||
tableBtn: [
|
||||
this.$auth.hasPermi('base:equipment-attr:update')
|
||||
this.$auth.hasPermi('base:core-equipment-attr:update')
|
||||
? {
|
||||
type: 'edit',
|
||||
btnName: '修改',
|
||||
}
|
||||
type: 'edit',
|
||||
btnName: '修改',
|
||||
}
|
||||
: undefined,
|
||||
this.$auth.hasPermi('base:equipment-attr:delete')
|
||||
this.$auth.hasPermi('base:core-equipment-attr:delete')
|
||||
? {
|
||||
type: 'delete',
|
||||
btnName: '删除',
|
||||
}
|
||||
type: 'delete',
|
||||
btnName: '删除',
|
||||
}
|
||||
: undefined,
|
||||
].filter((v) => v),
|
||||
allowAdd: true,
|
||||
},
|
||||
]"
|
||||
@refreshDataList="getList"
|
||||
@cancel="cancelEdit"
|
||||
@destroy="cancelEdit" />
|
||||
]" @refreshDataList="getList" @cancel="cancelEdit" @destroy="cancelEdit" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -107,7 +71,6 @@
|
||||
import moment from 'moment';
|
||||
import basicPageMixin from '@/mixins/lb/basicPageMixin';
|
||||
import EquipmentDrawer from './components/EquipmentDrawer';
|
||||
import DialogForm1 from './components/DialogForm';
|
||||
|
||||
import {
|
||||
createEquipment,
|
||||
@@ -125,30 +88,29 @@ export default {
|
||||
components: {
|
||||
Editor,
|
||||
EquipmentDrawer,
|
||||
DialogForm1,
|
||||
},
|
||||
mixins: [basicPageMixin],
|
||||
data() {
|
||||
return {
|
||||
searchBarKeys: ['name', 'code'],
|
||||
tableBtn: [
|
||||
this.$auth.hasPermi(`base:equipment:update`)
|
||||
this.$auth.hasPermi(`base:core-equipment:update`)
|
||||
? {
|
||||
type: 'detail',
|
||||
btnName: '详情',
|
||||
}
|
||||
type: 'detail',
|
||||
btnName: '详情',
|
||||
}
|
||||
: undefined,
|
||||
this.$auth.hasPermi('base:equipment:update')
|
||||
this.$auth.hasPermi('base:core-equipment:update')
|
||||
? {
|
||||
type: 'edit',
|
||||
btnName: '修改',
|
||||
}
|
||||
type: 'edit',
|
||||
btnName: '修改',
|
||||
}
|
||||
: undefined,
|
||||
this.$auth.hasPermi('base:equipment:delete')
|
||||
this.$auth.hasPermi('base:core-equipment:delete')
|
||||
? {
|
||||
type: 'delete',
|
||||
btnName: '删除',
|
||||
}
|
||||
type: 'delete',
|
||||
btnName: '删除',
|
||||
}
|
||||
: undefined,
|
||||
].filter((v) => v),
|
||||
tableProps: [
|
||||
@@ -159,12 +121,7 @@ export default {
|
||||
width: 180,
|
||||
filter: (val) => moment(val).format('yyyy-MM-DD HH:mm:ss'),
|
||||
},
|
||||
{
|
||||
width: 200,
|
||||
showOverflowtooltip: true,
|
||||
prop: 'name',
|
||||
label: '设备名称',
|
||||
},
|
||||
{ prop: 'name', label: '设备名称' },
|
||||
{ width: 256, prop: 'code', label: '设备编码' },
|
||||
{ prop: 'equipmentType', label: '设备类型' },
|
||||
{ prop: 'enName', label: '英文名称' },
|
||||
@@ -219,13 +176,14 @@ export default {
|
||||
type: 'separate',
|
||||
},
|
||||
{
|
||||
type: this.$auth.hasPermi('base:equipment:export') ? 'button' : '',
|
||||
type: this.$auth.hasPermi('base:core-equipment:export') ? 'button' : '',
|
||||
btnName: '导出',
|
||||
name: 'export',
|
||||
color: 'warning',
|
||||
plain: true,
|
||||
color: 'primary',
|
||||
},
|
||||
{
|
||||
type: this.$auth.hasPermi('base:equipment:create') ? 'button' : '',
|
||||
type: this.$auth.hasPermi('base:core-equipment:create') ? 'button' : '',
|
||||
btnName: '新增',
|
||||
name: 'add',
|
||||
plain: true,
|
||||
@@ -247,7 +205,7 @@ export default {
|
||||
input: true,
|
||||
label: '设备编码',
|
||||
prop: 'code',
|
||||
url: '/base/equipment/getCode',
|
||||
url: '/base/core-equipment/getCode',
|
||||
},
|
||||
{
|
||||
input: true,
|
||||
@@ -274,19 +232,32 @@ export default {
|
||||
select: true,
|
||||
label: '设备类型',
|
||||
prop: 'equipmentTypeId',
|
||||
url: '/base/equipment-type/page?pageNo=1&pageSize=100',
|
||||
url: '/base/core-equipment-type/page?pageNo=1&pageSize=100',
|
||||
rules: [{ required: true, message: '不能为空', trigger: 'blur' }],
|
||||
bind: {
|
||||
filterable: true,
|
||||
clearable: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
input: true,
|
||||
label: '预计生产时间(min/天)',
|
||||
prop: 'workTime',
|
||||
rules: [
|
||||
{ required: true, message: '不能为空', trigger: 'blur' },
|
||||
{
|
||||
type: 'number',
|
||||
message: '请输入正确的数字值',
|
||||
trigger: 'blur',
|
||||
transform: (val) => Number(val),
|
||||
},
|
||||
],
|
||||
},
|
||||
// {
|
||||
// select: true,
|
||||
// label: '设备分组',
|
||||
// prop: 'groupId',
|
||||
// url: '/base/equipment-group/page?pageNo=1&pageSize=100',
|
||||
// url: '/base/core-equipment-group/page?pageNo=1&pageSize=100',
|
||||
// },
|
||||
{ input: true, label: '备注', prop: 'remark' },
|
||||
],
|
||||
[
|
||||
{
|
||||
@@ -302,7 +273,7 @@ export default {
|
||||
{
|
||||
input: true,
|
||||
prop: 'tvalue',
|
||||
label: '设备理论生产能效(片/min)',
|
||||
label: '设备TT值',
|
||||
rules: [
|
||||
{ required: true, message: '不能为空', trigger: 'blur' },
|
||||
{
|
||||
@@ -317,7 +288,7 @@ export default {
|
||||
[
|
||||
{
|
||||
input: true,
|
||||
label: '产品加工时间(s)',
|
||||
label: '产品加工时间(s)',
|
||||
prop: 'processingTime',
|
||||
rules: [
|
||||
{ required: true, message: '不能为空', trigger: 'blur' },
|
||||
@@ -338,7 +309,7 @@ export default {
|
||||
},
|
||||
{
|
||||
input: true,
|
||||
label: '设备规格',
|
||||
label: '规格描述',
|
||||
prop: 'spec',
|
||||
},
|
||||
],
|
||||
@@ -350,6 +321,9 @@ export default {
|
||||
prop: 'description',
|
||||
},
|
||||
],
|
||||
[
|
||||
{ input: true, label: '备注', prop: 'remark' }
|
||||
]
|
||||
// [
|
||||
// {
|
||||
// assetUpload: true,
|
||||
@@ -443,7 +417,7 @@ export default {
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNo: 1,
|
||||
pageSize: 20,
|
||||
pageSize: 10,
|
||||
code: '',
|
||||
name: '',
|
||||
},
|
||||
@@ -461,36 +435,36 @@ export default {
|
||||
computedRows() {
|
||||
return this.showUploadComponents
|
||||
? [
|
||||
...this.rows,
|
||||
[
|
||||
{
|
||||
assetUpload: true,
|
||||
key: 'eq-assets', // 用于区分不同的上传组件
|
||||
label: '上传资料',
|
||||
fieldName: 'assets',
|
||||
subcomponent: AssetsUpload,
|
||||
prop: 'uploadedAssets',
|
||||
default: [],
|
||||
bind: {
|
||||
'is-pic-mode': false,
|
||||
},
|
||||
...this.rows,
|
||||
[
|
||||
{
|
||||
assetUpload: true,
|
||||
key: 'eq-assets', // 用于区分不同的上传组件
|
||||
label: '上传资料',
|
||||
fieldName: 'assets',
|
||||
subcomponent: AssetsUpload,
|
||||
prop: 'uploadedAssets',
|
||||
default: [],
|
||||
bind: {
|
||||
'is-pic-mode': false,
|
||||
},
|
||||
],
|
||||
[
|
||||
{
|
||||
assetUpload: true,
|
||||
key: 'eq-pics', // 用于区分不同的上传组件
|
||||
label: '上传图片',
|
||||
fieldName: 'images',
|
||||
subcomponent: AssetsUpload,
|
||||
// prop: '',
|
||||
// default: [],
|
||||
bind: {
|
||||
'is-pic-mode': true,
|
||||
},
|
||||
},
|
||||
],
|
||||
[
|
||||
{
|
||||
assetUpload: true,
|
||||
key: 'eq-pics', // 用于区分不同的上传组件
|
||||
label: '上传图片',
|
||||
fieldName: 'images',
|
||||
subcomponent: AssetsUpload,
|
||||
// prop: '',
|
||||
// default: [],
|
||||
bind: {
|
||||
'is-pic-mode': true,
|
||||
},
|
||||
],
|
||||
]
|
||||
},
|
||||
],
|
||||
]
|
||||
: this.rows;
|
||||
},
|
||||
},
|
||||
@@ -569,7 +543,6 @@ export default {
|
||||
return;
|
||||
}
|
||||
// 添加的提交
|
||||
this.form.files = [];
|
||||
createEquipment(this.form).then((response) => {
|
||||
this.$modal.msgSuccess('新增成功');
|
||||
this.open = false;
|
||||
@@ -589,7 +562,7 @@ export default {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess('删除成功');
|
||||
})
|
||||
.catch(() => {});
|
||||
.catch(() => { });
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
@@ -607,7 +580,7 @@ export default {
|
||||
this.$download.excel(response, '设备.xls');
|
||||
this.exportLoading = false;
|
||||
})
|
||||
.catch(() => {});
|
||||
.catch(() => { });
|
||||
},
|
||||
// 查看详情
|
||||
viewDetail(id) {
|
||||
360
src/views/base/coreEquipmentLineBind/index.vue
Normal file
360
src/views/base/coreEquipmentLineBind/index.vue
Normal file
@@ -0,0 +1,360 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<!-- 搜索工作栏 -->
|
||||
<SearchBar
|
||||
:formConfigs="searchBarFormConfig"
|
||||
ref="search-bar"
|
||||
@headBtnClick="handleSearchBarBtnClick" />
|
||||
|
||||
<!-- 列表 -->
|
||||
<base-table
|
||||
:table-props="tableProps"
|
||||
:page="queryParams.pageNo"
|
||||
:limit="queryParams.pageSize"
|
||||
:table-data="list"
|
||||
@emitFun="handleEmitFun">
|
||||
<method-btn
|
||||
v-if="tableBtn.length"
|
||||
slot="handleBtn"
|
||||
label="操作"
|
||||
:width="120"
|
||||
:method-list="tableBtn"
|
||||
@clickBtn="handleTableBtnClick" />
|
||||
</base-table>
|
||||
|
||||
<!-- 分页组件 -->
|
||||
<pagination
|
||||
v-show="total > 0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNo"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList" />
|
||||
|
||||
<!-- 对话框(添加 / 修改) -->
|
||||
<base-dialog
|
||||
:dialogTitle="title"
|
||||
:dialogVisible="open"
|
||||
@close="cancel"
|
||||
@cancel="cancel"
|
||||
@confirm="submitForm">
|
||||
<DialogForm
|
||||
v-if="open"
|
||||
ref="form"
|
||||
v-model="form"
|
||||
:has-files="false"
|
||||
:rows="rows" />
|
||||
</base-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import moment from 'moment';
|
||||
import basicPageMixin from '@/mixins/lb/basicPageMixin';
|
||||
|
||||
// import { getAccessToken } from '@/utils/auth';
|
||||
|
||||
export default {
|
||||
name: 'EquipmentLineBind',
|
||||
components: {},
|
||||
mixins: [basicPageMixin],
|
||||
data() {
|
||||
return {
|
||||
basePath: '/base/core-equipment-bind-section',
|
||||
searchBarKeys: ['equipmentName', 'productionLineId'],
|
||||
tableBtn: [
|
||||
this.$auth.hasPermi('base:core-equipment-bind-section:update')
|
||||
? {
|
||||
type: 'edit',
|
||||
btnName: '修改',
|
||||
}
|
||||
: undefined,
|
||||
this.$auth.hasPermi('base:core-equipment-bind-section:delete')
|
||||
? {
|
||||
type: 'delete',
|
||||
btnName: '删除',
|
||||
}
|
||||
: undefined,
|
||||
].filter((v) => v),
|
||||
tableProps: [
|
||||
{
|
||||
prop: 'createTime',
|
||||
label: '添加时间',
|
||||
fixed: true,
|
||||
width: 180,
|
||||
filter: (val) => moment(val).format('yyyy-MM-DD HH:mm:ss'),
|
||||
},
|
||||
{ prop: 'productionLineName', label: '产线名称' },
|
||||
{ prop: 'workshopSectionName', label: '工段名称' },
|
||||
{ prop: 'equipmentName', label: '设备名称' },
|
||||
{ prop: 'sort', label: '工段中排序' },
|
||||
{
|
||||
prop: 'lineDataType',
|
||||
label: '产线统计类型',
|
||||
filter: (val) =>
|
||||
val != null ? ['无类型', '进片数量统计', '出片数量统计'][val] : '',
|
||||
},
|
||||
{
|
||||
prop: 'sectionDataType',
|
||||
label: '工段统计类型',
|
||||
filter: (val) =>
|
||||
val != null ? ['无类型', '进片数量统计', '出片数量统计'][val] : '',
|
||||
},
|
||||
// { prop: 'remark', label: '备注' },
|
||||
],
|
||||
searchBarFormConfig: [
|
||||
{
|
||||
type: 'select',
|
||||
label: '产线',
|
||||
placeholder: '请选择产线',
|
||||
param: 'productionLineId',
|
||||
selectOptions: [],
|
||||
filterable: true,
|
||||
},
|
||||
{
|
||||
type: 'input',
|
||||
label: '设备名',
|
||||
placeholder: '请输入设备名称',
|
||||
param: 'equipmentName',
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
btnName: '查询',
|
||||
name: 'search',
|
||||
color: 'primary',
|
||||
},
|
||||
{
|
||||
type: 'separate',
|
||||
},
|
||||
{
|
||||
type: this.$auth.hasPermi('base:core-equipment-bind-section:create')
|
||||
? 'button'
|
||||
: '',
|
||||
btnName: '新增',
|
||||
name: 'add',
|
||||
plain: true,
|
||||
color: 'success',
|
||||
},
|
||||
// {
|
||||
// type: this.$auth.hasPermi('base:quality-inspection-type:export')
|
||||
// ? 'button'
|
||||
// : '',
|
||||
// btnName: '导出',
|
||||
// name: 'export',
|
||||
// color: 'warning',
|
||||
// },
|
||||
],
|
||||
rows: [
|
||||
[
|
||||
{
|
||||
select: true,
|
||||
label: '产线',
|
||||
prop: 'productionLineId',
|
||||
rules: [{ required: true, message: '不能为空', trigger: 'blur' }],
|
||||
url: '/base/core-production-line/listAll',
|
||||
bind: { clearable: true, filterable: true },
|
||||
// watch: 'workshopSectionId'
|
||||
},
|
||||
{
|
||||
select: true,
|
||||
label: '工段',
|
||||
prop: 'workshopSectionId',
|
||||
depends: 'productionLineId',
|
||||
rules: [{ required: true, message: '不能为空', trigger: 'blur' }],
|
||||
bind: { clearable: true, filterable: true },
|
||||
url: '/base/core-workshop-section/listByParentId',
|
||||
},
|
||||
],
|
||||
[
|
||||
{
|
||||
select: true,
|
||||
label: '设备',
|
||||
prop: 'equipmentId',
|
||||
rules: [{ required: true, message: '不能为空', trigger: 'blur' }],
|
||||
bind: { clearable: true, filterable: true },
|
||||
url: '/base/core-equipment/listAll',
|
||||
},
|
||||
{
|
||||
input: true,
|
||||
label: '工段排序',
|
||||
prop: 'sort',
|
||||
},
|
||||
],
|
||||
[
|
||||
{
|
||||
select: true,
|
||||
options: [
|
||||
{ label: '无类型', value: 0 },
|
||||
{ label: '进片数量统计', value: 1 },
|
||||
{ label: '出片数量统计', value: 2 },
|
||||
],
|
||||
label: '产线统计类型',
|
||||
prop: 'lineDataType',
|
||||
},
|
||||
{
|
||||
select: true,
|
||||
options: [
|
||||
{ label: '无类型', value: 0 },
|
||||
{ label: '进片数量统计', value: 1 },
|
||||
{ label: '出片数量统计', value: 2 },
|
||||
],
|
||||
label: '工段统计类型',
|
||||
prop: 'sectionDataType',
|
||||
},
|
||||
],
|
||||
],
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNo: 1,
|
||||
pageSize: 10,
|
||||
equipmentName: null,
|
||||
productionLineId: null,
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.initSearchOptions();
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
/** 初始化查询条件 */
|
||||
async initSearchOptions() {
|
||||
this.http('/base/core-production-line/listAll', 'get').then(
|
||||
({ code, data }) => {
|
||||
if (code == 0) {
|
||||
this.searchBarFormConfig[0].selectOptions = data.map((item) => {
|
||||
return {
|
||||
name: item.name,
|
||||
id: item.id,
|
||||
};
|
||||
});
|
||||
}
|
||||
}
|
||||
);
|
||||
},
|
||||
/** 查询列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
// 执行查询
|
||||
this.recv(this.queryParams).then(({ code, data }) => {
|
||||
// if (code == 0) {
|
||||
this.list = data.list;
|
||||
this.total = data.total;
|
||||
this.loading = false;
|
||||
// }
|
||||
});
|
||||
// .catch(err => {
|
||||
// this.list = [];
|
||||
// this.total = 0;
|
||||
// this.loading = false;
|
||||
// })
|
||||
},
|
||||
/** 取消按钮 */
|
||||
cancel() {
|
||||
this.open = false;
|
||||
this.reset();
|
||||
},
|
||||
/** 表单重置 */
|
||||
reset() {
|
||||
this.form = {
|
||||
id: undefined,
|
||||
productionLineId: undefined,
|
||||
// 工段
|
||||
workshopSectionId: undefined,
|
||||
// 设备
|
||||
equipmentId: undefined,
|
||||
// 工段排序
|
||||
sort: undefined,
|
||||
// 产线统计类型
|
||||
lineDataType: undefined,
|
||||
// 工段统计类型
|
||||
sectionDataType: undefined,
|
||||
};
|
||||
this.resetForm('form');
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNo = 1;
|
||||
this.getList();
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.resetForm('queryForm');
|
||||
this.handleQuery();
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.reset();
|
||||
this.open = true;
|
||||
this.title = '添加设备工段绑定';
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.reset();
|
||||
const id = row.id;
|
||||
this.info({ id }).then(({ code, data }) => {
|
||||
this.form = data;
|
||||
this.open = true;
|
||||
this.title = '修改设备工段绑定';
|
||||
});
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
this.$refs['form'].validate((valid) => {
|
||||
if (!valid) {
|
||||
return;
|
||||
}
|
||||
// 修改的提交
|
||||
if (this.form.id != null) {
|
||||
this.put(this.form).then(({ code, data }) => {
|
||||
this.$modal.msgSuccess('修改成功');
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
return;
|
||||
}
|
||||
this.post(this.form).then(({ code, data }) => {
|
||||
this.$modal.msgSuccess('修改成功');
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
});
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const id = row.id;
|
||||
this.$modal
|
||||
.confirm('是否确认删除绑定"' + row.name + '"?')
|
||||
.then(function () {
|
||||
return deleteEquipmentType(id);
|
||||
})
|
||||
.then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess('删除成功');
|
||||
})
|
||||
.catch(() => {});
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
// 处理查询参数
|
||||
let params = { ...this.queryParams };
|
||||
params.pageNo = undefined;
|
||||
params.pageSize = undefined;
|
||||
this.$modal
|
||||
.confirm('是否确认导出所有设备工段绑定?')
|
||||
.then(() => {
|
||||
this.exportLoading = true;
|
||||
// return exportEquipmentTypeExcel(params);
|
||||
})
|
||||
.then((response) => {
|
||||
this.$download.excel(response, '设备工段绑定.xls');
|
||||
this.exportLoading = false;
|
||||
})
|
||||
.catch(() => {});
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
@@ -41,8 +41,8 @@
|
||||
v-if="open"
|
||||
ref="form"
|
||||
v-model="form"
|
||||
:rows="rows"
|
||||
:has-file="true" />
|
||||
:has-files="true"
|
||||
:rows="rows" />
|
||||
</base-dialog>
|
||||
</div>
|
||||
</template>
|
||||
@@ -70,13 +70,13 @@ export default {
|
||||
return {
|
||||
searchBarKeys: ['name'],
|
||||
tableBtn: [
|
||||
this.$auth.hasPermi('base:equipment-type:update')
|
||||
this.$auth.hasPermi('base:core-equipment-type:update')
|
||||
? {
|
||||
type: 'edit',
|
||||
btnName: '修改',
|
||||
}
|
||||
: undefined,
|
||||
this.$auth.hasPermi('base:equipment-type:delete')
|
||||
this.$auth.hasPermi('base:core-equipment-type:delete')
|
||||
? {
|
||||
type: 'delete',
|
||||
btnName: '删除',
|
||||
@@ -112,7 +112,7 @@ export default {
|
||||
type: 'separate',
|
||||
},
|
||||
{
|
||||
type: this.$auth.hasPermi('base:equipment-type:create')
|
||||
type: this.$auth.hasPermi('base:core-equipment-type:create')
|
||||
? 'button'
|
||||
: '',
|
||||
btnName: '新增',
|
||||
@@ -144,7 +144,7 @@ export default {
|
||||
input: true,
|
||||
label: '设备类型编码',
|
||||
prop: 'code',
|
||||
url: '/base/equipment-type/getCode',
|
||||
url: '/base/core-equipment-type/getCode',
|
||||
},
|
||||
],
|
||||
[
|
||||
@@ -152,10 +152,7 @@ export default {
|
||||
select: true,
|
||||
label: '父类',
|
||||
prop: 'parentId',
|
||||
url: '/base/equipment-type/page?pageNo=1&pageSize=100',
|
||||
bind: {
|
||||
clearable: true, // some condition, like detail mode...
|
||||
}
|
||||
url: '/base/core-equipment-type/page?pageNo=1&pageSize=100',
|
||||
},
|
||||
{},
|
||||
],
|
||||
65
src/views/base/custom/SmallTitle.vue
Normal file
65
src/views/base/custom/SmallTitle.vue
Normal file
@@ -0,0 +1,65 @@
|
||||
<!--
|
||||
* @Author: zwq
|
||||
* @Date: 2023-08-01 15:27:31
|
||||
* @LastEditors: zwq
|
||||
* @LastEditTime: 2023-08-01 16:25:54
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<div :class="[className, { 'p-0': noPadding }]">
|
||||
<slot />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
props: {
|
||||
size: {
|
||||
// 取值范围: xl lg md sm
|
||||
type: String,
|
||||
default: 'de',
|
||||
validator: function (val) {
|
||||
return ['xl', 'lg', 'de', 'md', 'sm'].indexOf(val) !== -1;
|
||||
},
|
||||
},
|
||||
noPadding: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
},
|
||||
computed: {
|
||||
className: function () {
|
||||
return `${this.size}-title`;
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
$pxls: (xl, 28px) (lg, 24px) (de, 20px) (md, 18px) (sm, 16px);
|
||||
$mgr: 8px;
|
||||
@each $size, $height in $pxls {
|
||||
.#{$size}-title {
|
||||
font-size: 18px;
|
||||
line-height: $height;
|
||||
color: #000;
|
||||
font-weight: 500;
|
||||
font-family: '微软雅黑', 'Microsoft YaHei', Arial, Helvetica, sans-serif;
|
||||
|
||||
&::before {
|
||||
content: '';
|
||||
display: inline-block;
|
||||
vertical-align: top;
|
||||
width: 4px;
|
||||
height: $height + 2px;
|
||||
border-radius: 1px;
|
||||
margin-right: $mgr;
|
||||
background-color: #0b58ff;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.p-0 {
|
||||
padding: 0;
|
||||
}
|
||||
</style>
|
||||
411
src/views/base/custom/index.vue
Normal file
411
src/views/base/custom/index.vue
Normal file
@@ -0,0 +1,411 @@
|
||||
<template>
|
||||
<el-drawer :visible.sync="drawer" :append-to-body="true" size="80%">
|
||||
<small-title slot="title" :no-padding="true">
|
||||
<!-- <template v-for="demo in demoList"> -->
|
||||
<!-- <el-button :key="demo.name" :type="demo.name === curDemo ? 'primary' : ' '" @click="curDemo = demo.name"> -->
|
||||
<!-- {{ $t('module.packingManage.printModelDesign') }} -->
|
||||
模板设计
|
||||
<!-- </el-button> -->
|
||||
<!-- </template> -->
|
||||
</small-title>
|
||||
<el-card>
|
||||
<el-row style="margin-bottom: 10px">
|
||||
<el-col :span="4">
|
||||
<!-- 模板选择 -->
|
||||
|
||||
<!-- <el-select
|
||||
v-model="mode"
|
||||
filterable
|
||||
:default-value="0"
|
||||
option-label-prop="label"
|
||||
style="width: 100%;"
|
||||
@change="changeMode"
|
||||
>
|
||||
<el-option v-for="(opt,idx) in modeList" :key="idx" :label="opt.name" :value="idx">
|
||||
{{ opt.name }}
|
||||
</el-option>
|
||||
</el-select> -->
|
||||
</el-col>
|
||||
<el-col :span="20">
|
||||
<!-- 纸张设置 -->
|
||||
<el-button-group style="margin:0 10px">
|
||||
<el-button
|
||||
v-for="(value,type) in paperTypes"
|
||||
:key="type"
|
||||
:type="curPaperType === type ? 'primary' : ' '"
|
||||
@click="setPaper(type,value)"
|
||||
>
|
||||
{{ type }}
|
||||
</el-button>
|
||||
</el-button-group>
|
||||
<el-input-number
|
||||
style="margin:0 10px"
|
||||
:value="scaleValue "
|
||||
:precision="2"
|
||||
:step="0.1"
|
||||
:min="scaleMin"
|
||||
:max="scaleMax"
|
||||
@change="changeScale"
|
||||
/>
|
||||
<el-popover v-model="paperPopVisible" placement="bottom" width="300" title="设置纸张宽高(mm)">
|
||||
<div style="display: flex;align-items: center;justify-content: space-between;margin-bottom: 10px">
|
||||
<el-input v-model="paperWidth" type="number" style=" width: 100px; text-align: center" place="宽(mm)" />~
|
||||
<el-input v-model="paperHeight" type="number" style=" width: 100px; text-align: center" place="高(mm)" />
|
||||
</div>
|
||||
<div>
|
||||
<el-button type="primary" style="width: 100%" size="mini" @click="otherPaper">确定</el-button>
|
||||
</div>
|
||||
<el-button slot="reference" type="primary" style="margin:0 10px">自定义宽高</el-button>
|
||||
</el-popover>
|
||||
|
||||
<!-- <a-button-group>-->
|
||||
<!-- <template v-for="(value,type) in paperTypes">-->
|
||||
<!-- <a-button :type="curPaperType === type ? 'primary' : 'info'" @click="setPaper(type,value)" :key="type">-->
|
||||
<!-- {{ type }}-->
|
||||
<!-- </a-button>-->
|
||||
<!-- </template>-->
|
||||
<!-- <a-popover v-model="paperPopVisible" title="设置纸张宽高(mm)" trigger="click">-->
|
||||
<!-- <div slot="content">-->
|
||||
<!-- <a-input-group compact style="margin: 10px 10px">-->
|
||||
<!-- <a-input type="number" v-model="paperWidth" style=" width: 100px; text-align: center"-->
|
||||
<!-- placeholder="宽(mm)"/>-->
|
||||
<!-- <a-input style=" width: 30px; border-left: 0; pointer-events: none; backgroundColor: #fff"-->
|
||||
<!-- placeholder="~" disabled-->
|
||||
<!-- />-->
|
||||
<!-- <a-input type="number" v-model="paperHeight" style="width: 100px; text-align: center; border-left: 0"-->
|
||||
<!-- placeholder="高(mm)"/>-->
|
||||
<!-- </a-input-group>-->
|
||||
<!-- <a-button type="primary" style="width: 100%" @click="otherPaper">确定</a-button>-->
|
||||
<!-- </div>-->
|
||||
<!-- <a-button :type="'other'==curPaperType?'primary':''">自定义纸张</a-button>-->
|
||||
<!-- </a-popover>-->
|
||||
<!-- </a-button-group>-->
|
||||
|
||||
<!-- 预览/打印 -->
|
||||
<el-button-group>
|
||||
<el-button type="primary" icon="redo" @click="rotatePaper()">旋转</el-button>
|
||||
<el-button type="primary" icon="el-icon-view" @click="preView">
|
||||
预览
|
||||
</el-button>
|
||||
<!-- <el-button type="primary" icon="el-icon-printer" @click="print">
|
||||
直接打印
|
||||
</el-button> -->
|
||||
<el-button type="primary" icon="el-icon-s-management" @click="save">
|
||||
保存
|
||||
</el-button>
|
||||
<el-button type="danger" icon="el-icon-delete" @click="clearPaper">
|
||||
清空
|
||||
</el-button>
|
||||
</el-button-group>
|
||||
<!-- 保存/清空 -->
|
||||
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="24">
|
||||
<el-col :span="4">
|
||||
<el-card style="height: 100vh">
|
||||
<el-row>
|
||||
<el-col :span="24" class="rect-printElement-types hiprintEpContainer" />
|
||||
</el-row>
|
||||
</el-card>
|
||||
</el-col>
|
||||
<el-col :span="16">
|
||||
<el-card class="card-design">
|
||||
<div id="hiprint-printTemplate" class="hiprint-printTemplate" />
|
||||
</el-card>
|
||||
</el-col>
|
||||
<el-col :span="4" class="params_setting_container">
|
||||
<el-card>
|
||||
<el-row class="hinnn-layout-sider">
|
||||
<div id="PrintElementOptionSetting" />
|
||||
</el-row>
|
||||
</el-card>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<!-- 预览 -->
|
||||
<print-preview ref="preView" />
|
||||
</el-card>
|
||||
</el-drawer>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
import printPreview from './preview'
|
||||
import { MessageBox } from 'element-ui'
|
||||
import { hiprint } from 'vue-plugin-hiprint'
|
||||
import providers from './providers'
|
||||
import printData from './print-data'
|
||||
import $ from 'jquery'
|
||||
import SmallTitle from './SmallTitle.vue'
|
||||
let hiprintTemplate = null
|
||||
export default {
|
||||
name: 'PrintCustom',
|
||||
components: { printPreview, SmallTitle },
|
||||
// props: {
|
||||
// modelData: {
|
||||
// type: String,
|
||||
// default: ''
|
||||
// }
|
||||
// },
|
||||
data() {
|
||||
return {
|
||||
// paperPopVisible: false,
|
||||
// 模板选择
|
||||
mode: 0,
|
||||
template: null,
|
||||
modeList: [],
|
||||
// 当前纸张
|
||||
curPaper: {
|
||||
// type: 'other',
|
||||
// width: 220,
|
||||
// height: 80
|
||||
},
|
||||
drawer: false,
|
||||
// 纸张类型
|
||||
paperTypes: {
|
||||
'A3': {
|
||||
width: 420,
|
||||
height: 296.6
|
||||
},
|
||||
'A4': {
|
||||
width: 210,
|
||||
height: 297
|
||||
},
|
||||
'A5': {
|
||||
width: 210,
|
||||
height: 147.6
|
||||
},
|
||||
'B3': {
|
||||
width: 500,
|
||||
height: 352.6
|
||||
},
|
||||
'B4': {
|
||||
width: 250,
|
||||
height: 352.6
|
||||
},
|
||||
'B5': {
|
||||
width: 250,
|
||||
height: 175.6
|
||||
}
|
||||
},
|
||||
scaleValue: 1,
|
||||
scaleMax: 5,
|
||||
scaleMin: 0.5,
|
||||
// 自定义纸张
|
||||
paperPopVisible: false,
|
||||
paperWidth: '210',
|
||||
paperHeight: '297'
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
curPaperType() {
|
||||
let type = 'other'
|
||||
const types = this.paperTypes
|
||||
for (const key in types) {
|
||||
const item = types[key]
|
||||
const { width, height } = this.curPaper
|
||||
if (item.width === width && item.height === height) {
|
||||
type = key
|
||||
}
|
||||
}
|
||||
return type
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.init()
|
||||
// console.log('aaaaaa')
|
||||
// this.otherPaper()
|
||||
},
|
||||
destroyed () {
|
||||
$('.hiprintEpContainer').empty()
|
||||
},
|
||||
methods: {
|
||||
// handleClose() {
|
||||
// $('.hiprintEpContainer').empty()
|
||||
// },
|
||||
init(data) {
|
||||
this.drawer = true
|
||||
this.modelData = data
|
||||
this.modeList = providers.map((e) => {
|
||||
return { type: e.type, name: e.name, value: e.value }
|
||||
})
|
||||
this.changeMode()
|
||||
},
|
||||
changeMode() {
|
||||
// hiprintTemplate.clear()
|
||||
// console.log(this.modelData)
|
||||
const { mode } = this
|
||||
const provider = providers[mode]
|
||||
hiprint.init({
|
||||
providers: [provider.f]
|
||||
})
|
||||
|
||||
// $('#hiprint-printTemplate').empty()
|
||||
// console.log(JSON.parse(this.modelData))
|
||||
hiprint.setConfig()
|
||||
// 替换配置
|
||||
hiprint.setConfig({
|
||||
movingDistance: 2.5,
|
||||
text: {
|
||||
supportOptions: [
|
||||
{
|
||||
name: 'styler',
|
||||
hidden: true
|
||||
},
|
||||
{
|
||||
name: 'formatter',
|
||||
hidden: true
|
||||
}
|
||||
]
|
||||
}
|
||||
})
|
||||
|
||||
// console.log(this.modelData)
|
||||
// console.log($('#hiprint-printTemplate').empty())
|
||||
if (this.modelData) {
|
||||
$('.hiprintEpContainer').empty()
|
||||
hiprint.PrintElementTypeManager.build('.hiprintEpContainer', provider.value)
|
||||
$('.hiprint-printTemplate').empty()
|
||||
hiprintTemplate = new hiprint.PrintTemplate({
|
||||
template: JSON.parse(this.modelData),
|
||||
settingContainer: '#PrintElementOptionSetting',
|
||||
paginationContainer: '.hiprint-printPagination'
|
||||
})
|
||||
} else {
|
||||
$('.hiprintEpContainer').empty()
|
||||
hiprint.PrintElementTypeManager.build('.hiprintEpContainer', provider.value)
|
||||
$('.hiprint-printTemplate').empty()
|
||||
// const templates = this.$ls.get('KEY_TEMPLATES', {})
|
||||
const template = provider.value
|
||||
console.log(template)
|
||||
hiprintTemplate = new hiprint.PrintTemplate({
|
||||
template: template,
|
||||
settingContainer: '#PrintElementOptionSetting',
|
||||
paginationContainer: '.hiprint-printPagination'
|
||||
})
|
||||
}
|
||||
// hiprintTemplate.design('#hiprint-printTemplate')
|
||||
// console.log(hiprintTemplate)
|
||||
hiprintTemplate.design('#hiprint-printTemplate', { grid: true })
|
||||
// 获取当前放大比例, 当zoom时传true 才会有
|
||||
this.scaleValue = hiprintTemplate.editingPanel.scale || 1
|
||||
// this.scaleValue = hiprintTemplate.editingPanel.scale || 1
|
||||
},
|
||||
/**
|
||||
* 设置纸张大小
|
||||
* @param type [A3, A4, A5, B3, B4, B5, other]
|
||||
* @param value {width,height} mm
|
||||
*/
|
||||
setPaper(type, value) {
|
||||
try {
|
||||
if (Object.keys(this.paperTypes).includes(type)) {
|
||||
this.curPaper = { type: type, width: value.width, height: value.height }
|
||||
hiprintTemplate.setPaper(value.width, value.height)
|
||||
} else {
|
||||
this.curPaper = { type: 'other', width: value.width, height: value.height }
|
||||
hiprintTemplate.setPaper(value.width, value.height)
|
||||
}
|
||||
} catch (error) {
|
||||
this.$message.error(`操作失败: ${error}`)
|
||||
}
|
||||
},
|
||||
changeScale(currentValue, oldValue) {
|
||||
let big = false
|
||||
currentValue <= oldValue ? big = false : big = true
|
||||
let scaleValue = this.scaleValue
|
||||
if (big) {
|
||||
scaleValue += 0.1
|
||||
if (scaleValue > this.scaleMax) scaleValue = 5
|
||||
} else {
|
||||
scaleValue -= 0.1
|
||||
if (scaleValue < this.scaleMin) scaleValue = 0.5
|
||||
}
|
||||
if (hiprintTemplate) {
|
||||
// scaleValue: 放大缩小值, false: 不保存(不传也一样), 如果传 true, 打印时也会放大
|
||||
hiprintTemplate.zoom(scaleValue)
|
||||
this.scaleValue = scaleValue
|
||||
}
|
||||
},
|
||||
clearPaper() {
|
||||
MessageBox.confirm('是否确认清空模板信息?', '警告', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
try {
|
||||
hiprintTemplate.clear()
|
||||
} catch (error) {
|
||||
this.$message.error(`操作失败: ${error}`)
|
||||
}
|
||||
}).catch((err) => {
|
||||
console.log(err)
|
||||
})
|
||||
},
|
||||
otherPaper() {
|
||||
const value = {}
|
||||
value.width = this.paperWidth
|
||||
value.height = this.paperHeight
|
||||
this.paperPopVisible = false
|
||||
this.setPaper('other', value)
|
||||
},
|
||||
rotatePaper() {
|
||||
if (hiprintTemplate) {
|
||||
hiprintTemplate.rotatePaper()
|
||||
}
|
||||
},
|
||||
preView() {
|
||||
const { width } = this.curPaper
|
||||
this.$refs.preView.show(hiprintTemplate, printData, width)
|
||||
},
|
||||
print() {
|
||||
// if (window.hiwebSocket.opened) {
|
||||
const printerList = hiprintTemplate.getPrinterList()
|
||||
console.log(printerList)
|
||||
hiprintTemplate.print2(printData, { printer: '', title: '预览打印' })
|
||||
// return
|
||||
// }
|
||||
// this.$message.error('客户端未连接,无法直接打印')
|
||||
},
|
||||
save() {
|
||||
// console.log(hiprintTemplate.getJson())
|
||||
const { mode } = this
|
||||
const provider = providers[mode]
|
||||
// console.log(hiprintTemplate.getJson())
|
||||
this.setTemplate({
|
||||
name: provider.value,
|
||||
json: hiprintTemplate.getJson()
|
||||
})
|
||||
},
|
||||
setTemplate(payload) {
|
||||
// const templates = this.$ls.get('KEY_TEMPLATES', {})
|
||||
// console.log(payload.json)
|
||||
// templates[payload.name] = payload.json
|
||||
// this.$ls.set('KEY_TEMPLATES', templates)
|
||||
this.$message.info('保存成功')
|
||||
// console.log(JSON.stringify(payload.json))
|
||||
this.drawer = false
|
||||
this.$emit('saveData', payload.json)
|
||||
$('.hiprintEpContainer').empty()
|
||||
// this.$parent.$parent.getModelData(payload.json)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
// build 拖拽
|
||||
::v-deep .hiprint-printElement-type >li>ul>li>a {
|
||||
padding: 4px 4px;
|
||||
color: #1296db;
|
||||
line-height: 1;
|
||||
height: auto;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
// 设计容器
|
||||
.card-design {
|
||||
// overflow: hidden;
|
||||
overflow-x: auto;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
</style>
|
||||
89
src/views/base/custom/preview.vue
Normal file
89
src/views/base/custom/preview.vue
Normal file
@@ -0,0 +1,89 @@
|
||||
<!--
|
||||
* @Author: zhp
|
||||
* @Date: 2023-09-27 14:23:54
|
||||
* @LastEditTime: 2023-10-19 11:20:36
|
||||
* @LastEditors: zhp
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<el-dialog :visible="visible" :mask-closable="false" width="50%" @close="hideModal" :append-to-body="true">
|
||||
<div id="preview_content" />
|
||||
<template slot="title">
|
||||
<div style="margin-right: 20px">打印预览</div>
|
||||
<el-button :loading="waitShowPrinter" type="primary" icon="printer" @click.stop="print">打印</el-button>
|
||||
<el-button type="primary" icon="printer" @click.stop="toPdf">pdf</el-button>
|
||||
</template>
|
||||
<template slot="footer">
|
||||
<el-button key="close" type="info" @click="hideModal">
|
||||
关闭
|
||||
</el-button>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'PrintPreview',
|
||||
props: {},
|
||||
data() {
|
||||
return {
|
||||
visible: false,
|
||||
spinning: true,
|
||||
waitShowPrinter: false,
|
||||
// 纸张宽 mm
|
||||
width: 0,
|
||||
// 模板
|
||||
hiprintTemplate: {},
|
||||
// 数据
|
||||
printData: {}
|
||||
}
|
||||
},
|
||||
computed: {},
|
||||
watch: {},
|
||||
created() {
|
||||
},
|
||||
mounted() {
|
||||
},
|
||||
methods: {
|
||||
hideModal() {
|
||||
this.visible = false
|
||||
},
|
||||
show(hiprintTemplate, printData, width = '210') {
|
||||
this.visible = true
|
||||
this.spinning = true
|
||||
this.width = width
|
||||
this.hiprintTemplate = hiprintTemplate
|
||||
this.printData = printData
|
||||
console.log(hiprintTemplate)
|
||||
console.log(printData)
|
||||
setTimeout(() => {
|
||||
// eslint-disable-next-line no-undef
|
||||
$('#preview_content').html(hiprintTemplate.getHtml(printData))
|
||||
this.spinning = false
|
||||
}, 500)
|
||||
},
|
||||
print() {
|
||||
this.waitShowPrinter = true
|
||||
this.hiprintTemplate.print(this.printData, {}, {
|
||||
callback: () => {
|
||||
console.log('callback')
|
||||
this.waitShowPrinter = false
|
||||
}
|
||||
})
|
||||
},
|
||||
toPdf() {
|
||||
this.hiprintTemplate.toPdf({}, '打印预览')
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
<!-- <style lang="less" scoped>
|
||||
/deep/ .ant-modal-body {
|
||||
padding: 0px;
|
||||
}
|
||||
|
||||
/deep/ .ant-modal-content {
|
||||
margin-bottom: 24px;
|
||||
}
|
||||
</style> -->
|
||||
90
src/views/base/custom/print-data.js
Normal file
90
src/views/base/custom/print-data.js
Normal file
File diff suppressed because one or more lines are too long
447
src/views/base/custom/providers.js
Normal file
447
src/views/base/custom/providers.js
Normal file
@@ -0,0 +1,447 @@
|
||||
/* eslint-disable */
|
||||
import {hiprint} from 'vue-plugin-hiprint'
|
||||
|
||||
/* eslint-disable */
|
||||
// import {hiprint} from '../../index'
|
||||
|
||||
// 自定义设计元素1
|
||||
export const aProvider = function (ops) {
|
||||
var addElementTypes = function (context) {
|
||||
context.removePrintElementTypes("aProviderModule");
|
||||
context.addPrintElementTypes(
|
||||
"aProviderModule",
|
||||
[
|
||||
new hiprint.PrintElementTypeGroup("平台", [
|
||||
{
|
||||
tid: 'aProviderModule.header', title: '单据表头', data: '单据表头', type: 'text',
|
||||
options: {
|
||||
testData: '单据表头',
|
||||
height: 17,
|
||||
fontSize: 16.5,
|
||||
fontWeight: "700",
|
||||
textAlign: "center",
|
||||
hideTitle: true
|
||||
}
|
||||
},
|
||||
{
|
||||
tid: 'aProviderModule.type', title: '单据类型', data: '单据类型', type: 'text',
|
||||
options: {
|
||||
testData: '单据类型',
|
||||
height: 16,
|
||||
fontSize: 15,
|
||||
fontWeight: "700",
|
||||
textAlign: "center",
|
||||
hideTitle: true
|
||||
}
|
||||
},
|
||||
{
|
||||
tid: 'aProviderModule.order', title: '订单编号', data: 'XS888888888', type: 'text',
|
||||
options: {
|
||||
field: 'orderId',
|
||||
testData: 'XS888888888',
|
||||
height: 16,
|
||||
fontSize: 6.75,
|
||||
fontWeight: "700",
|
||||
textAlign: "left",
|
||||
textContentVerticalAlign: "middle"
|
||||
}
|
||||
},
|
||||
{
|
||||
tid: 'aProviderModule.date', title: '业务日期', data: '2020-01-01', type: 'text',
|
||||
options: {
|
||||
field: 'date',
|
||||
testData: '2020-01-01',
|
||||
height: 16,
|
||||
fontSize: 6.75,
|
||||
fontWeight: "700",
|
||||
textAlign: "left",
|
||||
textContentVerticalAlign: "middle"
|
||||
}
|
||||
},
|
||||
{
|
||||
tid: 'aProviderModule.barcode', title: '条形码', data: 'XS888888888', type: 'text',
|
||||
options: {
|
||||
field: 'barcode',
|
||||
testData: 'XS888888888',
|
||||
height: 32,
|
||||
fontSize: 12,
|
||||
lineHeight: 18,
|
||||
textType: "barcode"
|
||||
}
|
||||
},
|
||||
{
|
||||
tid: 'aProviderModule.qrcode', title: '二维码', data: 'XS888888888', type: 'text',
|
||||
options: {
|
||||
field: 'qrcode',
|
||||
testData: 'XS888888888',
|
||||
height: 32,
|
||||
fontSize: 12,
|
||||
lineHeight: 18,
|
||||
textType: "qrcode"
|
||||
}
|
||||
},
|
||||
{
|
||||
tid: 'aProviderModule.platform', title: '平台名称', data: '平台名称', type: 'text',
|
||||
options: {
|
||||
testData: '平台名称',
|
||||
height: 17,
|
||||
fontSize: 16.5,
|
||||
fontWeight: "700",
|
||||
textAlign: "center",
|
||||
hideTitle: true
|
||||
}
|
||||
},
|
||||
{tid: 'aProviderModule.logo', title: 'Logo', data: '', type: 'image'},
|
||||
]),
|
||||
new hiprint.PrintElementTypeGroup("库管", [
|
||||
{
|
||||
tid: 'aProviderModule.creater', title: '制单人', data: '李四', type: 'text',
|
||||
options: {
|
||||
field: 'creater',
|
||||
testData: '李四',
|
||||
height: 16,
|
||||
fontSize: 6.75,
|
||||
fontWeight: "700",
|
||||
textAlign: "left",
|
||||
textContentVerticalAlign: "middle"
|
||||
}
|
||||
},
|
||||
{
|
||||
tid: 'aProviderModule.printDate', title: '打印时间', data: '2022-01-01 09:00', type: 'text',
|
||||
options: {
|
||||
field: 'printDate',
|
||||
testData: '2022-01-01 09:00',
|
||||
height: 16,
|
||||
fontSize: 6.75,
|
||||
fontWeight: "700",
|
||||
textAlign: "left",
|
||||
textContentVerticalAlign: "middle"
|
||||
}
|
||||
},
|
||||
{
|
||||
tid: 'aProviderModule.signer', title: '库管签字', data: '', type: 'text',
|
||||
options: {
|
||||
title: '库管签字:',
|
||||
height: 16,
|
||||
fontSize: 6.75,
|
||||
fontWeight: "700",
|
||||
textAlign: "left",
|
||||
textContentVerticalAlign: "middle"
|
||||
}
|
||||
},
|
||||
]),
|
||||
new hiprint.PrintElementTypeGroup("表格/其他", [
|
||||
{
|
||||
tid: 'aProviderModule.table', title: '订单数据',
|
||||
type: 'table',
|
||||
options: {
|
||||
field: 'table',
|
||||
tableHeaderRepeat: 'first',
|
||||
tableFooterRepeat: 'last',
|
||||
fields: [
|
||||
{text: '名称', field: 'NAME'},
|
||||
{text: '数量', field: 'SL'},
|
||||
{text: '规格', field: 'GG'},
|
||||
{text: '条码', field: 'TM'},
|
||||
{text: '单价', field: 'DJ'},
|
||||
{text: '金额', field: 'JE'},
|
||||
],
|
||||
},
|
||||
editable: true,
|
||||
columnDisplayEditable: true,//列显示是否能编辑
|
||||
columnDisplayIndexEditable: true,//列顺序显示是否能编辑
|
||||
columnTitleEditable: true,//列标题是否能编辑
|
||||
columnResizable: true, //列宽是否能调整
|
||||
columnAlignEditable: true,//列对齐是否调整
|
||||
isEnableEditField: true, //编辑字段
|
||||
isEnableContextMenu: true, //开启右键菜单 默认true
|
||||
isEnableInsertRow: true, //插入行
|
||||
isEnableDeleteRow: true, //删除行
|
||||
isEnableInsertColumn: true, //插入列
|
||||
isEnableDeleteColumn: true, //删除列
|
||||
isEnableMergeCell: true, //合并单元格
|
||||
columns: [
|
||||
[
|
||||
{title: '名称', align: 'center', field: 'NAME', width: 150},
|
||||
{title: '数量', align: 'center', field: 'SL', width: 80},
|
||||
{title: '规格', align: 'center', field: 'GG', width: 80, checked: false},
|
||||
{title: '条码', align: 'center', field: 'TM', width: 100, checked: false},
|
||||
{title: '单价', align: 'center', field: 'DJ', width: 100},
|
||||
{title: '金额', align: 'center', field: 'JE', width: 100, checked: false},
|
||||
],
|
||||
],
|
||||
rowsColumnsMerge: function (data, col, index) {
|
||||
// 返回一个数组,参数一为行(rowspan)合并数,参数二为列(colspan)合并数, 被合并的行或者列值设为0
|
||||
if (index == 0) {
|
||||
return [1, data.INDEX % 2 == 1 ? 2 : 1]
|
||||
} else if (index > 0 && index < 2) {
|
||||
return [data.INDEX % 2 == 1 ? 0 : 1, 1]
|
||||
} else {
|
||||
return [data.INDEX % 2 == 1 ? 2 : 0, 1]
|
||||
}
|
||||
},
|
||||
footerFormatter: function (options, rows, data, currentPageGridRowsData) {
|
||||
if (data && data['totalCap']) {
|
||||
return `<td style="padding:0 10px" colspan="100">${'应收金额大写: ' + data['totalCap']}</td>`
|
||||
}
|
||||
return '<td style="padding:0 10px" colspan="100">应收金额大写: </td>'
|
||||
},
|
||||
},
|
||||
{tid: 'aProviderModule.customText', title: '文本', customText: '自定义文本', custom: true, type: 'text'},
|
||||
{
|
||||
tid: 'aProviderModule.longText', title: '长文本', type: 'longText', options: {
|
||||
field: 'test.longText',
|
||||
width: 200,
|
||||
testData: '长文本分页/不分页测试'
|
||||
},
|
||||
}
|
||||
]),
|
||||
new hiprint.PrintElementTypeGroup("辅助", [
|
||||
{
|
||||
tid: 'aProviderModule.hline',
|
||||
title: '横线',
|
||||
type: 'hline'
|
||||
},
|
||||
{
|
||||
tid: 'aProviderModule.vline',
|
||||
title: '竖线',
|
||||
type: 'vline'
|
||||
},
|
||||
{
|
||||
tid: 'aProviderModule.rect',
|
||||
title: '矩形',
|
||||
type: 'rect'
|
||||
},
|
||||
{
|
||||
tid: 'aProviderModule.oval',
|
||||
title: '椭圆',
|
||||
type: 'oval'
|
||||
},
|
||||
{
|
||||
tid: 'aProviderModule.barcode',
|
||||
title: '条形码',
|
||||
type: 'barcode',
|
||||
},
|
||||
{
|
||||
tid: 'aProviderModule.qrcode',
|
||||
title: '二维码',
|
||||
type: 'qrcode',
|
||||
}
|
||||
])
|
||||
]
|
||||
);
|
||||
};
|
||||
return {
|
||||
addElementTypes: addElementTypes
|
||||
};
|
||||
};
|
||||
|
||||
// 自定义设计元素2
|
||||
export const bProvider = function (ops) {
|
||||
var addElementTypes = function (context) {
|
||||
context.removePrintElementTypes("bProviderModule");
|
||||
context.addPrintElementTypes(
|
||||
"bProviderModule",
|
||||
[
|
||||
new hiprint.PrintElementTypeGroup("常规", [
|
||||
{
|
||||
tid: 'bProviderModule.header', title: '单据表头', data: '单据表头', type: 'text',
|
||||
options: {
|
||||
testData: '单据表头',
|
||||
height: 17,
|
||||
fontSize: 16.5,
|
||||
fontWeight: "700",
|
||||
textAlign: "center",
|
||||
hideTitle: true
|
||||
}
|
||||
},
|
||||
{
|
||||
tid: 'bProviderModule.type', title: '单据类型', data: '单据类型', type: 'text',
|
||||
options: {
|
||||
testData: '单据类型',
|
||||
height: 16,
|
||||
fontSize: 15,
|
||||
fontWeight: "700",
|
||||
textAlign: "center",
|
||||
hideTitle: true
|
||||
}
|
||||
},
|
||||
{
|
||||
tid: 'bProviderModule.order', title: '订单编号', data: 'XS888888888', type: 'text',
|
||||
options: {
|
||||
field: 'orderId',
|
||||
testData: 'XS888888888',
|
||||
height: 16,
|
||||
fontSize: 6.75,
|
||||
fontWeight: "700",
|
||||
textAlign: "left",
|
||||
textContentVerticalAlign: "middle"
|
||||
}
|
||||
},
|
||||
{
|
||||
tid: 'bProviderModule.date', title: '业务日期', data: '2020-01-01', type: 'text',
|
||||
options: {
|
||||
field: 'date',
|
||||
testData: '2020-01-01',
|
||||
height: 16,
|
||||
fontSize: 6.75,
|
||||
fontWeight: "700",
|
||||
textAlign: "left",
|
||||
textContentVerticalAlign: "middle"
|
||||
}
|
||||
},
|
||||
{
|
||||
tid: 'bProviderModule.barcode', title: '条形码', data: 'XS888888888', type: 'text',
|
||||
options: {
|
||||
field: 'barcode',
|
||||
testData: 'XS888888888',
|
||||
height: 32,
|
||||
fontSize: 12,
|
||||
lineHeight: 18,
|
||||
textType: "barcode"
|
||||
}
|
||||
},
|
||||
{
|
||||
tid: 'bProviderModule.qrcode', title: '二维码', data: 'XS888888888', type: 'text',
|
||||
options: {
|
||||
field: 'qrcode',
|
||||
testData: 'XS888888888',
|
||||
height: 32,
|
||||
fontSize: 12,
|
||||
lineHeight: 18,
|
||||
textType: "qrcode"
|
||||
}
|
||||
},
|
||||
{
|
||||
tid: 'bProviderModule.platform', title: '平台名称', data: '平台名称', type: 'text',
|
||||
options: {
|
||||
testData: '平台名称',
|
||||
height: 17,
|
||||
fontSize: 16.5,
|
||||
fontWeight: "700",
|
||||
textAlign: "center",
|
||||
hideTitle: true
|
||||
}
|
||||
},
|
||||
{tid: 'bProviderModule.image', title: 'Logo', data: 'data: image/png;base64iVBORw0KGgoAAAANSUhEUgAAAGQAAABkCAYAAABw4pVUAAAHVklEQVR4nO2dT2wUVRzHv2/2T5eSAlvFilwgQUH+eLACaUxEiJLAxdh44MDZi2ChUIrSFtoCgbbSP4GDdwgeEA8kRTAI0iIGBL1ITLxgLAlCsCKBYndnx7zd35pl2+7On/de387OJ9l00515/z7z/szMmzfs7869mD0yCjw2gZAB4VhAiln4/dUaRGdU18aOnzw9dn24ioGJj0soFsJr1z2yNm+qN2/fvRFL8XyMYqTmFfxZ+TwMc1xKDsL/f2Ms8xGeLwuIRpCKx99MHf/i4uPrw5GQ9jIAfsCMXfw2HkuOX03Wb1qLh4+uIGFJjzecPoS5iEhUTg1hDMaM2GuRk6cGMTQUCYmPQQq86CMAkkPDkQirGAzXf7Du34ejN9IHmETCRjQGPL6D+4NnYDEJDQmXbaY6on/dm2Vm/jHdZe0Almm6Ll+YNQbzasX7765BNHI1o0sOYRghwExg7MG9dDQSiqsdwHuZmlFKMjLwQ3QcFtjlSxHTenLO3Lp7vfU09AOS41Ka+HC6CjIDIaqmguvIPgBtIgOcDhjVlMTQtarKOScumR/teCdpxoeNZGJCapjFt7Rcywrb2MYtnQBatCpZTzCkYCF+5suKRXf+6EvOmv0GSzwrhB/QpmGkBYZSpqvIZAlp8ZeMLFwKUH3z2gqWyd/+3F/5b1yRQQMCN8gQspeaKt+SAItSCxCiPjIjhDEkjRAMxmCZSbgZkYke537qdxl57KM8C0OkkD0ADohMXIlwgPIuBFFC9uS3p2XGflFSRAgpdxlZeBl84jUQr0ImjDTKGWZZBwE0eCkCL0J20UgjgGCwEDHNPjB86PbiilshfGRxOBCRD0tLCSWTnzMLO9yE4EbIzjIdTdmGpc8/rB4qK0c4FcKbqe7pyWZJ0k1lZhsnQnZq3EzV00dHDjupKXaFNGtcM7YA+Io+WzRIz2R0UxkWxY6QJgCHlCbfPlzAsZytj2ks5RCVZUGKCdkOoEt+Wl3RkCcjyzGv5wIS6aIynZJCQni7d0TTjPFaMFDg9wGNa8qRQn3KVEI+1rjPmKpm5KNzTemmMp7AZEK2AehXmz7bbC1SM/IZoH10pJ/K+hnyhXBrvZpmoBHAURf7HaV9daQ3v6Zk7hhWVr4AYDOAzzRNeKPHAyW7r459Yj/deUynMcyqqpY9/fXW+RTwkiF/ms5pADcd7nMbwAkBcfMM3wOwwOF+rys46TxCt+T72d2NG0YSg2fnC58ANDkbAZyVH41QNgAYVBTXNiMxeLYG6qawvagmGqGoTHOfwcAe6T8TvWwYlTC7OsALgRDNCIRoRiBEMwIhmhEI0YxAiGYEQjRDtZCY9iUyEaVpVi3kvuL4RKA0zSqF8Ad5TimMTxSnKO1KUCWEZ6hDVaYk0KFKigohbSUuI0uHiieKZQtp89kM+U7ZUmQKafHp4wpSH/eWJaTT5zPkD8g62GQI8cXqDTZok/HEsWgh+3Of2y4D2kU/0idKyEOaJdgqKLxSotXlfLFJESXkicKZGTrys6g0iRIyD8AvAFYLCq+UWC1yACOyD+Hrf1wAUCcwTN2pozzXiEqn6E59JoBvANQKDldHaimvM0WmTcawlydw2Oc1pY7yKFQGJJ4YxqiTXyEp/OlkBeVNyn0SmZdO5gC47rOOfjXlaY6sCGRfXKwA8LVP+pRaykuFzEhUXH7nR9P3AFYqiEsWKykP0mpGFlU3qKI0IlmlKD6RrKK0R1VEpvIW7uwSHXnVUdqVoHqSwz+K4xOB0jQH87I0IxCiGYEQzQiEaEYgRDMCIZoRCNGMQIhmBEI0gwuJK0xScKZemHiY1mzqUxThYgBLHO7zQOAzGnMBPOdwn8WC4rbDNjaSWVajQaEUp9wBsB7ALY/hLAVwHsB89VmwRXrhuGwf0q/xIl/z6f6105qVyxIKQ1cZjdlV/HI79V6N1yjk/dxlAMtc7LuM9lXZVzqhIXdxtvxR1kCxZUynkbl0o2ihgyQspH3mapqn7flrSE427O3TuKbwGZI/AlhuY9vltO08Belyw6T99lTnIQN2VmGeJqppskGhpfoW0DbVmuahaarVVQudGPZo3tH/RCOnfJbSbzp34D1T/VjsTL3X6esWFMJngJwDsCgnykX0P+mzQ1yyq9jqqtnzkGI0a7wgPz9pfJm+/6ZxB77bzus+7L7pkwdkarr8OBdwJee7jjQVaqZysVtDsuwK3j3lmGYnb5hwerW3S+PRl440OX3dh5vL7z0iXzXqY/bYbaZycXs/5KDdV/iUKc1URo7xcoOqq0yfui1Gq5e3EoUava1qzS/aJQGs8xKIj2jx+gCoVyGcoUBKGs8yIEgIAiliZEDwJAehL3ovIYS+2F9UDckyRH/fFhmoxuwTvdaJaCGc7+gyi9+br1YZSzTJEAIaffHrZG/JCFwDpK16JEsI5yK9uMdvzVe7zAUxZQrhXKKBwxqZkSikQ8aiZbnIFgKS4oea0i5bBhQJgQ+kKJEBhUJAUkqxo+cduJqVrQH8B6xBgBhvJFNDAAAAAElFTkSuQmCC', type: 'image', options: {
|
||||
src: 'data: image/png;base64iVBORw0KGgoAAAANSUhEUgAAAGQAAABkCAYAAABw4pVUAAAHVklEQVR4nO2dT2wUVRzHv2/2T5eSAlvFilwgQUH+eLACaUxEiJLAxdh44MDZi2ChUIrSFtoCgbbSP4GDdwgeEA8kRTAI0iIGBL1ITLxgLAlCsCKBYndnx7zd35pl2+7On/de387OJ9l00515/z7z/szMmzfs7869mD0yCjw2gZAB4VhAiln4/dUaRGdU18aOnzw9dn24ioGJj0soFsJr1z2yNm+qN2/fvRFL8XyMYqTmFfxZ+TwMc1xKDsL/f2Ms8xGeLwuIRpCKx99MHf/i4uPrw5GQ9jIAfsCMXfw2HkuOX03Wb1qLh4+uIGFJjzecPoS5iEhUTg1hDMaM2GuRk6cGMTQUCYmPQQq86CMAkkPDkQirGAzXf7Du34ejN9IHmETCRjQGPL6D+4NnYDEJDQmXbaY6on/dm2Vm/jHdZe0Almm6Ll+YNQbzasX7765BNHI1o0sOYRghwExg7MG9dDQSiqsdwHuZmlFKMjLwQ3QcFtjlSxHTenLO3Lp7vfU09AOS41Ka+HC6CjIDIaqmguvIPgBtIgOcDhjVlMTQtarKOScumR/teCdpxoeNZGJCapjFt7Rcywrb2MYtnQBatCpZTzCkYCF+5suKRXf+6EvOmv0GSzwrhB/QpmGkBYZSpqvIZAlp8ZeMLFwKUH3z2gqWyd/+3F/5b1yRQQMCN8gQspeaKt+SAItSCxCiPjIjhDEkjRAMxmCZSbgZkYke537qdxl57KM8C0OkkD0ADohMXIlwgPIuBFFC9uS3p2XGflFSRAgpdxlZeBl84jUQr0ImjDTKGWZZBwE0eCkCL0J20UgjgGCwEDHNPjB86PbiilshfGRxOBCRD0tLCSWTnzMLO9yE4EbIzjIdTdmGpc8/rB4qK0c4FcKbqe7pyWZJ0k1lZhsnQnZq3EzV00dHDjupKXaFNGtcM7YA+Io+WzRIz2R0UxkWxY6QJgCHlCbfPlzAsZytj2ks5RCVZUGKCdkOoEt+Wl3RkCcjyzGv5wIS6aIynZJCQni7d0TTjPFaMFDg9wGNa8qRQn3KVEI+1rjPmKpm5KNzTemmMp7AZEK2AehXmz7bbC1SM/IZoH10pJ/K+hnyhXBrvZpmoBHAURf7HaV9daQ3v6Zk7hhWVr4AYDOAzzRNeKPHAyW7r459Yj/deUynMcyqqpY9/fXW+RTwkiF/ms5pADcd7nMbwAkBcfMM3wOwwOF+rys46TxCt+T72d2NG0YSg2fnC58ANDkbAZyVH41QNgAYVBTXNiMxeLYG6qawvagmGqGoTHOfwcAe6T8TvWwYlTC7OsALgRDNCIRoRiBEMwIhmhEI0YxAiGYEQjRDtZCY9iUyEaVpVi3kvuL4RKA0zSqF8Ad5TimMTxSnKO1KUCWEZ6hDVaYk0KFKigohbSUuI0uHiieKZQtp89kM+U7ZUmQKafHp4wpSH/eWJaTT5zPkD8g62GQI8cXqDTZok/HEsWgh+3Of2y4D2kU/0idKyEOaJdgqKLxSotXlfLFJESXkicKZGTrys6g0iRIyD8AvAFYLCq+UWC1yACOyD+Hrf1wAUCcwTN2pozzXiEqn6E59JoBvANQKDldHaimvM0WmTcawlydw2Oc1pY7yKFQGJJ4YxqiTXyEp/OlkBeVNyn0SmZdO5gC47rOOfjXlaY6sCGRfXKwA8LVP+pRaykuFzEhUXH7nR9P3AFYqiEsWKykP0mpGFlU3qKI0IlmlKD6RrKK0R1VEpvIW7uwSHXnVUdqVoHqSwz+K4xOB0jQH87I0IxCiGYEQzQiEaEYgRDMCIZoRCNGMQIhmBEI0gwuJK0xScKZemHiY1mzqUxThYgBLHO7zQOAzGnMBPOdwn8WC4rbDNjaSWVajQaEUp9wBsB7ALY/hLAVwHsB89VmwRXrhuGwf0q/xIl/z6f6105qVyxIKQ1cZjdlV/HI79V6N1yjk/dxlAMtc7LuM9lXZVzqhIXdxtvxR1kCxZUynkbl0o2ihgyQspH3mapqn7flrSE427O3TuKbwGZI/AlhuY9vltO08Belyw6T99lTnIQN2VmGeJqppskGhpfoW0DbVmuahaarVVQudGPZo3tH/RCOnfJbSbzp34D1T/VjsTL3X6esWFMJngJwDsCgnykX0P+mzQ1yyq9jqqtnzkGI0a7wgPz9pfJm+/6ZxB77bzus+7L7pkwdkarr8OBdwJee7jjQVaqZysVtDsuwK3j3lmGYnb5hwerW3S+PRl440OX3dh5vL7z0iXzXqY/bYbaZycXs/5KDdV/iUKc1URo7xcoOqq0yfui1Gq5e3EoUava1qzS/aJQGs8xKIj2jx+gCoVyGcoUBKGs8yIEgIAiliZEDwJAehL3ovIYS+2F9UDckyRH/fFhmoxuwTvdaJaCGc7+gyi9+br1YZSzTJEAIaffHrZG/JCFwDpK16JEsI5yK9uMdvzVe7zAUxZQrhXKKBwxqZkSikQ8aiZbnIFgKS4oea0i5bBhQJgQ+kKJEBhUJAUkqxo+cduJqVrQH8B6xBgBhvJFNDAAAAAElFTkSuQmCC',
|
||||
fit: 'none'
|
||||
}},
|
||||
]),
|
||||
new hiprint.PrintElementTypeGroup("客户", [
|
||||
{
|
||||
tid: 'bProviderModule.khname', title: '客户名称', data: '高级客户', type: 'text',
|
||||
options: {
|
||||
field: 'name',
|
||||
testData: '高级客户',
|
||||
height: 16,
|
||||
fontSize: 6.75,
|
||||
fontWeight: "700",
|
||||
textAlign: "left",
|
||||
textContentVerticalAlign: "middle"
|
||||
}
|
||||
},
|
||||
{
|
||||
tid: 'bProviderModule.tel', title: '客户电话', data: '18888888888', type: 'text',
|
||||
options: {
|
||||
field: 'tel',
|
||||
testData: '18888888888',
|
||||
height: 16,
|
||||
fontSize: 6.75,
|
||||
fontWeight: "700",
|
||||
textAlign: "left",
|
||||
textContentVerticalAlign: "middle"
|
||||
}
|
||||
},
|
||||
]),
|
||||
new hiprint.PrintElementTypeGroup("表格/其他", [
|
||||
{
|
||||
tid: 'bProviderModule.table', title: '订单数据',
|
||||
type: 'table',
|
||||
options: {
|
||||
field: 'table',
|
||||
fields: [
|
||||
{text: '名称', field: 'NAME'},
|
||||
{text: '数量', field: 'SL'},
|
||||
{text: '规格', field: 'GG'},
|
||||
{text: '条码', field: 'TM'},
|
||||
{text: '单价', field: 'DJ'},
|
||||
{text: '金额', field: 'JE'},
|
||||
{text: '备注', field: 'DETAIL'},
|
||||
],
|
||||
},
|
||||
editable: true,
|
||||
columnDisplayEditable: true,//列显示是否能编辑
|
||||
columnDisplayIndexEditable: true,//列顺序显示是否能编辑
|
||||
columnTitleEditable: true,//列标题是否能编辑
|
||||
columnResizable: true, //列宽是否能调整
|
||||
columnAlignEditable: true,//列对齐是否调整
|
||||
columns: [
|
||||
[
|
||||
{title: '名称', align: 'center', field: 'NAME', width: 100},
|
||||
{title: '数量', align: 'center', field: 'SL', width: 100},
|
||||
{title: '条码', align: 'center', field: 'TM', width: 100},
|
||||
{title: '规格', align: 'center', field: 'GG', width: 100},
|
||||
{title: '单价', align: 'center', field: 'DJ', width: 100},
|
||||
{title: '金额', align: 'center', field: 'JE', width: 100},
|
||||
{title: '备注', align: 'center', field: 'DETAIL', width: 100},
|
||||
]
|
||||
],
|
||||
footerFormatter: function (options, rows, data, currentPageGridRowsData) {
|
||||
if (data && data['totalCap']) {
|
||||
return `<td style="padding:0 10px" colspan="100">${'应收金额大写: ' + data['totalCap']}</td>`
|
||||
}
|
||||
return '<td style="padding:0 10px" colspan="100">应收金额大写: </td>'
|
||||
},
|
||||
},
|
||||
{tid: 'bProviderModule.customText', title: '文本', customText: '自定义文本', custom: true, type: 'text'},
|
||||
{
|
||||
tid: 'bProviderModule.longText', title: '长文本', type: 'longText', options: {
|
||||
field: 'test.longText',
|
||||
width: 200,
|
||||
testData: '长文本分页/不分页测试'
|
||||
},
|
||||
}
|
||||
]),
|
||||
new hiprint.PrintElementTypeGroup("辅助", [
|
||||
{
|
||||
tid: 'bProviderModule.hline',
|
||||
title: '横线',
|
||||
type: 'hline'
|
||||
},
|
||||
{
|
||||
tid: 'bProviderModule.vline',
|
||||
title: '竖线',
|
||||
type: 'vline'
|
||||
},
|
||||
{
|
||||
tid: 'bProviderModule.rect',
|
||||
title: '矩形',
|
||||
type: 'rect'
|
||||
},
|
||||
{
|
||||
tid: 'bProviderModule.oval',
|
||||
title: '椭圆',
|
||||
type: 'oval'
|
||||
}
|
||||
])
|
||||
]
|
||||
);
|
||||
};
|
||||
return {
|
||||
addElementTypes: addElementTypes
|
||||
};
|
||||
};
|
||||
|
||||
// type: 1供货商 2经销商
|
||||
export default [{
|
||||
name: 'A设计',
|
||||
value: 'aProviderModule',
|
||||
type: 1,
|
||||
f: aProvider()
|
||||
}, {
|
||||
name: 'B设计',
|
||||
value: 'bProviderModule',
|
||||
type: 2,
|
||||
f: bProvider()
|
||||
}]
|
||||
@@ -6,9 +6,7 @@
|
||||
-->
|
||||
|
||||
<template>
|
||||
<div ref="dataBoard" class="data-board">
|
||||
<el-button type="text" @click="goback" class="go-back--btn">返回</el-button>
|
||||
</div>
|
||||
<div ref="dataBoard" class=""></div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
@@ -26,42 +24,39 @@ export default {
|
||||
mainFooter: null, // dom
|
||||
};
|
||||
},
|
||||
// mounted() {
|
||||
// this.$nextTick(() => {
|
||||
// this.modify();
|
||||
// });
|
||||
// },
|
||||
// activated() {
|
||||
// this.modify();
|
||||
// },
|
||||
// deactivated() {
|
||||
// this.recover();
|
||||
// },
|
||||
// beforeDestroy() {
|
||||
// this.recover();
|
||||
// },
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
this.modify();
|
||||
});
|
||||
},
|
||||
activated() {
|
||||
this.modify();
|
||||
},
|
||||
deactivated() {
|
||||
this.recover();
|
||||
},
|
||||
beforeDestroy() {
|
||||
this.recover();
|
||||
},
|
||||
methods: {
|
||||
// modify() {
|
||||
// // 在这个页面临时修改下父类的margin,结束时需还原
|
||||
// this.appMain = document.querySelector('.app-main');
|
||||
// // this.appMain.style.minHeight = 'calc(100vh - 90px)';
|
||||
// this.appMain.style.margin = 0;
|
||||
// // 在这个页面临时删除 main-footer 元素,结束时需还原
|
||||
// // this.mainFooter = document.querySelector('.main-footer').cloneNode(true);
|
||||
// // document.querySelector('.main-footer').remove();
|
||||
// this.$refs.dataBoard.classList.add('data-board');
|
||||
// },
|
||||
// recover() {
|
||||
// this.$refs.dataBoard.classList.remove('data-board');
|
||||
// this.$nextTick(() => {
|
||||
// this.appMain.style.margin = this.parentStyle.margin;
|
||||
// // this.appMain.style.minHeight = this.parentStyle.minHeight;
|
||||
// // this.appMain.insertAdjacentElement('afterend', this.mainFooter);
|
||||
// });
|
||||
// },
|
||||
goback() {
|
||||
this.$router.go(-1);
|
||||
}
|
||||
modify() {
|
||||
// 在这个页面临时修改下父类的margin,结束时需还原
|
||||
this.appMain = document.querySelector('.app-main');
|
||||
// this.appMain.style.minHeight = 'calc(100vh - 90px)';
|
||||
this.appMain.style.margin = 0;
|
||||
// 在这个页面临时删除 main-footer 元素,结束时需还原
|
||||
// this.mainFooter = document.querySelector('.main-footer').cloneNode(true);
|
||||
// document.querySelector('.main-footer').remove();
|
||||
this.$refs.dataBoard.classList.add('data-board');
|
||||
},
|
||||
recover() {
|
||||
this.$refs.dataBoard.classList.remove('data-board');
|
||||
this.$nextTick(() => {
|
||||
this.appMain.style.margin = this.parentStyle.margin;
|
||||
// this.appMain.style.minHeight = this.parentStyle.minHeight;
|
||||
// this.appMain.insertAdjacentElement('afterend', this.mainFooter);
|
||||
});
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
@@ -76,25 +71,4 @@ export default {
|
||||
background: url('../../../assets/images/DataBoard.png') 100% 100% / contain
|
||||
no-repeat;
|
||||
}
|
||||
|
||||
.go-back--btn {
|
||||
position: fixed;
|
||||
top: 28px;
|
||||
left: 24px;
|
||||
color: #fff;
|
||||
font-size: 18px;
|
||||
letter-spacing: 6px;
|
||||
|
||||
&:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
&::after {
|
||||
content: "\2BAA";
|
||||
position: absolute;
|
||||
top: 6px;
|
||||
right: -26px;
|
||||
font-size: 24px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -1,214 +0,0 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
|
||||
<!-- 搜索工作栏 -->
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<el-form-item label="设备id" prop="equipmentId">
|
||||
<el-input v-model="queryParams.equipmentId" placeholder="请输入设备id" clearable @keyup.enter.native="handleQuery"/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<!-- 操作工具栏 -->
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd"
|
||||
v-hasPermi="['base:equipment-attr:create']">新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport" :loading="exportLoading"
|
||||
v-hasPermi="['base:equipment-attr:export']">导出</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<!-- 列表 -->
|
||||
<el-table v-loading="loading" :data="list">
|
||||
<el-table-column label="ID" align="center" prop="id" />
|
||||
<el-table-column label="设备id" align="center" prop="equipmentId" />
|
||||
<el-table-column label="属性名称" align="center" prop="name" />
|
||||
<el-table-column label="属性值" align="center" prop="value" />
|
||||
<el-table-column label="创建时间" align="center" prop="createTime" width="180">
|
||||
<template v-slot="scope">
|
||||
<span>{{ parseTime(scope.row.createTime) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template v-slot="scope">
|
||||
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['base:equipment-attr:update']">修改</el-button>
|
||||
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"
|
||||
v-hasPermi="['base:equipment-attr:delete']">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!-- 分页组件 -->
|
||||
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"/>
|
||||
|
||||
<!-- 对话框(添加 / 修改) -->
|
||||
<el-dialog :title="title" :visible.sync="open" width="500px" v-dialogDrag append-to-body>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||
<el-form-item label="设备id" prop="equipmentId">
|
||||
<el-input v-model="form.equipmentId" placeholder="请输入设备id" />
|
||||
</el-form-item>
|
||||
<el-form-item label="属性名称" prop="name">
|
||||
<el-input v-model="form.name" placeholder="请输入属性名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="属性值" prop="value">
|
||||
<el-input v-model="form.value" placeholder="请输入属性值" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { createEquipmentAttr, updateEquipmentAttr, deleteEquipmentAttr, getEquipmentAttr, getEquipmentAttrPage, exportEquipmentAttrExcel } from "@/api/base/equipmentAttr";
|
||||
|
||||
export default {
|
||||
name: "EquipmentAttr",
|
||||
components: {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 导出遮罩层
|
||||
exportLoading: false,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 设备属性列表
|
||||
list: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNo: 1,
|
||||
pageSize: 10,
|
||||
equipmentId: null,
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
rules: {
|
||||
equipmentId: [{ required: true, message: "设备id不能为空", trigger: "blur" }],
|
||||
}
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
/** 查询列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
// 执行查询
|
||||
getEquipmentAttrPage(this.queryParams).then(response => {
|
||||
this.list = response.data.list;
|
||||
this.total = response.data.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
/** 取消按钮 */
|
||||
cancel() {
|
||||
this.open = false;
|
||||
this.reset();
|
||||
},
|
||||
/** 表单重置 */
|
||||
reset() {
|
||||
this.form = {
|
||||
id: undefined,
|
||||
equipmentId: undefined,
|
||||
name: undefined,
|
||||
value: undefined,
|
||||
};
|
||||
this.resetForm("form");
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNo = 1;
|
||||
this.getList();
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.resetForm("queryForm");
|
||||
this.handleQuery();
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.reset();
|
||||
this.open = true;
|
||||
this.title = "添加设备属性";
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.reset();
|
||||
const id = row.id;
|
||||
getEquipmentAttr(id).then(response => {
|
||||
this.form = response.data;
|
||||
this.open = true;
|
||||
this.title = "修改设备属性";
|
||||
});
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (!valid) {
|
||||
return;
|
||||
}
|
||||
// 修改的提交
|
||||
if (this.form.id != null) {
|
||||
updateEquipmentAttr(this.form).then(response => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
return;
|
||||
}
|
||||
// 添加的提交
|
||||
createEquipmentAttr(this.form).then(response => {
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
});
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const id = row.id;
|
||||
this.$modal.confirm('是否确认删除设备属性编号为"' + id + '"的数据项?').then(function() {
|
||||
return deleteEquipmentAttr(id);
|
||||
}).then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => {});
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
// 处理查询参数
|
||||
let params = {...this.queryParams};
|
||||
params.pageNo = undefined;
|
||||
params.pageSize = undefined;
|
||||
this.$modal.confirm('是否确认导出所有设备属性数据项?').then(() => {
|
||||
this.exportLoading = true;
|
||||
return exportEquipmentAttrExcel(params);
|
||||
}).then(response => {
|
||||
this.$download.excel(response, '设备属性.xls');
|
||||
this.exportLoading = false;
|
||||
}).catch(() => {});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
@@ -1,4 +1,4 @@
|
||||
<!--
|
||||
<!--
|
||||
filename: dialogForm.vue
|
||||
author: liubin
|
||||
date: 2023-09-11 15:55:13
|
||||
@@ -71,14 +71,14 @@
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12">
|
||||
<el-form-item label="工段设备排序" prop="sort">
|
||||
<el-form-item label="工段排序" prop="sort">
|
||||
<el-input-number
|
||||
v-model="dataForm.sort"
|
||||
filterable
|
||||
min="0"
|
||||
max="100"
|
||||
@change="$emit('update', dataForm)"
|
||||
placeholder="请输入工段设备排序" />
|
||||
placeholder="请输入工段排序" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
@@ -112,7 +112,6 @@
|
||||
{ label: '无类型', value: 0 },
|
||||
{ label: '进口统计', value: 1 },
|
||||
{ label: '出口统计', value: 2 },
|
||||
{ label: '进出口计数', value: 3 },
|
||||
]"
|
||||
:key="opt.value"
|
||||
:label="opt.label"
|
||||
@@ -192,7 +191,7 @@ export default {
|
||||
// 获取设备列表
|
||||
async getEquipmentList() {
|
||||
const response = await this.$axios(
|
||||
'/base/equipment/page?pageNo=1&pageSize=100'
|
||||
'/base/core-equipment/page?pageNo=1&pageSize=100'
|
||||
);
|
||||
this.equipmentList = response.data.list.map((item) => ({
|
||||
label: item.name,
|
||||
|
||||
@@ -4,8 +4,7 @@
|
||||
<SearchBar
|
||||
:formConfigs="searchBarFormConfig"
|
||||
ref="search-bar"
|
||||
@select-changed="handleSearchBarChanged"
|
||||
@headBtnClick="buttonClick" />
|
||||
@headBtnClick="handleSearchBarBtnClick" />
|
||||
|
||||
<!-- 列表 -->
|
||||
<base-table
|
||||
@@ -53,8 +52,6 @@ import {
|
||||
getEquipmentBindSectionPage,
|
||||
exportEquipmentBindSectionExcel,
|
||||
} from '@/api/base/equipmentBindSection';
|
||||
import { getPdList } from '@/api/core/monitoring/auto';
|
||||
import { getFactoryPage } from '@/api/core/base/factory';
|
||||
import moment from 'moment';
|
||||
import basicPageMixin from '@/mixins/lb/basicPageMixin';
|
||||
import DialogForm from './dialogForm.vue';
|
||||
@@ -64,7 +61,7 @@ export default {
|
||||
mixins: [basicPageMixin],
|
||||
data() {
|
||||
return {
|
||||
searchBarKeys: ['factoryId','productionLineId','workshopSectionId', 'equipmentName'],
|
||||
searchBarKeys: ['workshopSectionId', 'equipmentName'],
|
||||
tableBtn: [
|
||||
this.$auth.hasPermi('base:equipment-bind-section:update')
|
||||
? {
|
||||
@@ -87,9 +84,8 @@ export default {
|
||||
width: 180,
|
||||
filter: (val) => moment(val).format('yyyy-MM-DD HH:mm:ss'),
|
||||
},
|
||||
{ prop: 'factoryName', label: '工厂' },
|
||||
{ prop: 'productionLine', label: '产线' },
|
||||
{ prop: 'workshopSection', label: '工段' },
|
||||
{ prop: 'productionLine', label: '产线名称' },
|
||||
{ prop: 'workshopSection', label: '工段名称' },
|
||||
{ prop: 'equipment', label: '设备名称' },
|
||||
{ prop: 'sort', label: '工段中排序' },
|
||||
{
|
||||
@@ -102,7 +98,7 @@ export default {
|
||||
prop: 'sectionDataType',
|
||||
label: '工段数据类型',
|
||||
filter: (val) =>
|
||||
val != null ? ['无类型', '进口计数', '出口计数', '进出口计数'][val] : '-',
|
||||
val != null ? ['无类型', '进口计数', '出口计数'][val] : '-',
|
||||
},
|
||||
// {
|
||||
// action: 'show-alert',
|
||||
@@ -133,20 +129,6 @@ export default {
|
||||
// },
|
||||
],
|
||||
searchBarFormConfig: [
|
||||
{
|
||||
type: 'select',
|
||||
label: '工厂',
|
||||
selectOptions: [],
|
||||
param: 'factoryId',
|
||||
onchange: true,
|
||||
},
|
||||
{
|
||||
type: 'select',
|
||||
label: '产线',
|
||||
selectOptions: [],
|
||||
param: 'productionLineId',
|
||||
multiple: true,
|
||||
},
|
||||
{
|
||||
type: 'select',
|
||||
label: '工段',
|
||||
@@ -210,7 +192,7 @@ export default {
|
||||
{
|
||||
select: true,
|
||||
label: '设备',
|
||||
url: '/base/equipment/page?pageNo=1&pageSize=100',
|
||||
url: '/base/core-equipment/page?pageNo=1&pageSize=100',
|
||||
prop: 'equipmentId',
|
||||
rules: [{ required: true, message: '不能为空', trigger: 'blur' }],
|
||||
},
|
||||
@@ -227,8 +209,8 @@ export default {
|
||||
label: '产线数据类型',
|
||||
options: [
|
||||
{ label: '无类型', value: 0 },
|
||||
{ label: '进口计数', value: 1 },
|
||||
{ label: '出口计数', value: 2 },
|
||||
{ label: '进口统计', value: 1 },
|
||||
{ label: '出口统计', value: 2 },
|
||||
],
|
||||
prop: 'lineDataType',
|
||||
},
|
||||
@@ -237,9 +219,8 @@ export default {
|
||||
label: '工段数据类型',
|
||||
options: [
|
||||
{ label: '无类型', value: 0 },
|
||||
{ label: '进口计数', value: 1 },
|
||||
{ label: '出口计数', value: 2 },
|
||||
{ label: '进出口计数', value: 3 },
|
||||
{ label: '进口统计', value: 1 },
|
||||
{ label: '出口统计', value: 2 },
|
||||
],
|
||||
prop: 'sectionDataType',
|
||||
},
|
||||
@@ -253,9 +234,6 @@ export default {
|
||||
pageSize: 10,
|
||||
workshopSectionId: null,
|
||||
equipmentId: null,
|
||||
equipmentName: null,
|
||||
factoryId: null,
|
||||
productionLineId: [],
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
@@ -264,7 +242,6 @@ export default {
|
||||
created() {
|
||||
this.getList();
|
||||
this.initWorksection();
|
||||
this.getPdLineList();
|
||||
},
|
||||
methods: {
|
||||
/** 准备工段数据 */
|
||||
@@ -274,7 +251,7 @@ export default {
|
||||
method: 'get',
|
||||
});
|
||||
if (code == 0) {
|
||||
this.searchBarFormConfig[2].selectOptions = data.map((item) => {
|
||||
this.searchBarFormConfig[0].selectOptions = data.map((item) => {
|
||||
return {
|
||||
name: item.name,
|
||||
id: item.id,
|
||||
@@ -282,51 +259,6 @@ export default {
|
||||
});
|
||||
}
|
||||
},
|
||||
getPdLineList() {
|
||||
getPdList().then((res) => {
|
||||
this.searchBarFormConfig[1].selectOptions = res.data || [];
|
||||
});
|
||||
const params = {
|
||||
pageSize: 100,
|
||||
pageNo: 1,
|
||||
};
|
||||
getFactoryPage(params).then((res) => {
|
||||
this.searchBarFormConfig[0].selectOptions = res.data.list || [];
|
||||
});
|
||||
},
|
||||
handleSearchBarChanged({ param, value }) {
|
||||
this.queryParams.productionLineId = [];
|
||||
this.$refs['search-bar'].formInline.productionLineId = undefined;
|
||||
getPdList(value).then((res) => {
|
||||
this.searchBarFormConfig[1].selectOptions = res.data || [];
|
||||
});
|
||||
},
|
||||
buttonClick(val) {
|
||||
switch (val.btnName) {
|
||||
case 'search':
|
||||
this.queryParams.pageNo = 1;
|
||||
this.queryParams.pageSize = 10;
|
||||
this.queryParams.name = val.name;
|
||||
this.queryParams.workshopSectionId = val.workshopSectionId || undefined;
|
||||
this.queryParams.equipmentName = val.equipmentName || undefined;
|
||||
this.queryParams.factoryId = val.factoryId || undefined;
|
||||
this.queryParams.productionLineId = val.productionLineId || [];
|
||||
this.handleQuery();
|
||||
break;
|
||||
case 'add':
|
||||
this.handleAdd();
|
||||
break;
|
||||
case 'export':
|
||||
this.handleExport();
|
||||
break;
|
||||
case 'reset':
|
||||
this.$refs['search-bar'].resetForm();
|
||||
this.resetQuery();
|
||||
break;
|
||||
default:
|
||||
console.log(val);
|
||||
}
|
||||
},
|
||||
/** 查询列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
|
||||
@@ -1,225 +0,0 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
|
||||
<!-- 搜索工作栏 -->
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<el-form-item label="设备ID" prop="equipmentId">
|
||||
<el-input v-model="queryParams.equipmentId" placeholder="请输入设备ID" clearable @keyup.enter.native="handleQuery"/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<!-- 操作工具栏 -->
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd"
|
||||
v-hasPermi="['base:equipment-file:create']">新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport" :loading="exportLoading"
|
||||
v-hasPermi="['base:equipment-file:export']">导出</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<!-- 列表 -->
|
||||
<el-table v-loading="loading" :data="list">
|
||||
<el-table-column label="id" align="center" prop="id" />
|
||||
<el-table-column label="设备ID" align="center" prop="equipmentId" />
|
||||
<el-table-column label="文件类型 1.图片 2.设备资料" align="center" prop="fileType">
|
||||
<template v-slot="scope">
|
||||
<dict-tag :type="DICT_TYPE.EQU_FILE_TYPE" :value="scope.row.fileType" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="原始文件名" align="center" prop="fileName" />
|
||||
<el-table-column label="文件url" align="center" prop="fileUrl" />
|
||||
<el-table-column label="创建时间" align="center" prop="createTime" width="180">
|
||||
<template v-slot="scope">
|
||||
<span>{{ parseTime(scope.row.createTime) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template v-slot="scope">
|
||||
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['base:equipment-file:update']">修改</el-button>
|
||||
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"
|
||||
v-hasPermi="['base:equipment-file:delete']">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!-- 分页组件 -->
|
||||
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"/>
|
||||
|
||||
<!-- 对话框(添加 / 修改) -->
|
||||
<el-dialog :title="title" :visible.sync="open" width="500px" v-dialogDrag append-to-body>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||
<el-form-item label="设备ID" prop="equipmentId">
|
||||
<el-input v-model="form.equipmentId" placeholder="请输入设备ID" />
|
||||
</el-form-item>
|
||||
<el-form-item label="文件类型 1.图片 2.设备资料" prop="fileType">
|
||||
<el-select v-model="form.fileType" placeholder="请选择文件类型 1.图片 2.设备资料">
|
||||
<el-option v-for="dict in this.getDictDatas(DICT_TYPE.EQU_FILE_TYPE)"
|
||||
:key="dict.value" :label="dict.label" :value="dict.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="原始文件名" prop="fileName">
|
||||
<el-input v-model="form.fileName" placeholder="请输入原始文件名" />
|
||||
</el-form-item>
|
||||
<el-form-item label="文件url" prop="fileUrl">
|
||||
<el-input v-model="form.fileUrl" placeholder="请输入文件url" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { createEquipmentFile, updateEquipmentFile, deleteEquipmentFile, getEquipmentFile, getEquipmentFilePage, exportEquipmentFileExcel } from "@/api/base/equipmentFile";
|
||||
|
||||
export default {
|
||||
name: "EquipmentFile",
|
||||
components: {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 导出遮罩层
|
||||
exportLoading: false,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 设备文件对应列表
|
||||
list: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNo: 1,
|
||||
pageSize: 10,
|
||||
equipmentId: null,
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
rules: {
|
||||
}
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
/** 查询列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
// 执行查询
|
||||
getEquipmentFilePage(this.queryParams).then(response => {
|
||||
this.list = response.data.list;
|
||||
this.total = response.data.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
/** 取消按钮 */
|
||||
cancel() {
|
||||
this.open = false;
|
||||
this.reset();
|
||||
},
|
||||
/** 表单重置 */
|
||||
reset() {
|
||||
this.form = {
|
||||
id: undefined,
|
||||
equipmentId: undefined,
|
||||
fileType: undefined,
|
||||
fileName: undefined,
|
||||
fileUrl: undefined,
|
||||
};
|
||||
this.resetForm("form");
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNo = 1;
|
||||
this.getList();
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.resetForm("queryForm");
|
||||
this.handleQuery();
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.reset();
|
||||
this.open = true;
|
||||
this.title = "添加设备文件对应";
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.reset();
|
||||
const id = row.id;
|
||||
getEquipmentFile(id).then(response => {
|
||||
this.form = response.data;
|
||||
this.open = true;
|
||||
this.title = "修改设备文件对应";
|
||||
});
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (!valid) {
|
||||
return;
|
||||
}
|
||||
// 修改的提交
|
||||
if (this.form.id != null) {
|
||||
updateEquipmentFile(this.form).then(response => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
return;
|
||||
}
|
||||
// 添加的提交
|
||||
createEquipmentFile(this.form).then(response => {
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
});
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const id = row.id;
|
||||
this.$modal.confirm('是否确认删除设备文件对应编号为"' + id + '"的数据项?').then(function() {
|
||||
return deleteEquipmentFile(id);
|
||||
}).then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => {});
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
// 处理查询参数
|
||||
let params = {...this.queryParams};
|
||||
params.pageNo = undefined;
|
||||
params.pageSize = undefined;
|
||||
this.$modal.confirm('是否确认导出所有设备文件对应数据项?').then(() => {
|
||||
this.exportLoading = true;
|
||||
return exportEquipmentFileExcel(params);
|
||||
}).then(response => {
|
||||
this.$download.excel(response, '设备文件对应.xls');
|
||||
this.exportLoading = false;
|
||||
}).catch(() => {});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
@@ -280,7 +280,7 @@ export default {
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
if (this.queryParams.equipmentGroupId == null)
|
||||
return this.$message.warning('没有检测到设备分组信息');
|
||||
return this.$message.error('没有检测到设备分组信息');
|
||||
this.reset();
|
||||
this.open = true;
|
||||
this.title = '添加设备分组报警明细';
|
||||
|
||||
@@ -1,109 +0,0 @@
|
||||
<!--
|
||||
* @Author: zwq
|
||||
* @Date: 2021-11-18 14:16:25
|
||||
* @LastEditors: zwq
|
||||
* @LastEditTime: 2025-02-26 16:37:29
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<el-row :gutter="20">
|
||||
<el-form
|
||||
:model="dataForm"
|
||||
:rules="dataRule"
|
||||
ref="dataForm"
|
||||
@keyup.enter.native="dataFormSubmit()"
|
||||
label-width="80px">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="关联表名" prop="plcTableName">
|
||||
<el-input
|
||||
v-model="dataForm.plcTableName"
|
||||
clearable
|
||||
placeholder="请输入关联表名" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="编码" prop="code">
|
||||
<el-input
|
||||
v-model="dataForm.code"
|
||||
clearable
|
||||
placeholder="请输入编码" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="标识" prop="name">
|
||||
<el-input
|
||||
v-model="dataForm.name"
|
||||
clearable
|
||||
placeholder="请输入标识" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="英文名" prop="enName">
|
||||
<el-input
|
||||
v-model="dataForm.enName"
|
||||
clearable
|
||||
placeholder="请输入英文名" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="是否采集" prop="collection">
|
||||
<el-switch
|
||||
v-model="dataForm.collection"
|
||||
:active-value="1"
|
||||
:inactive-value="0"></el-switch>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="描述" prop="description">
|
||||
<el-input
|
||||
v-model="dataForm.description"
|
||||
clearable
|
||||
placeholder="请输入描述" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-form>
|
||||
</el-row>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import basicAdd from '@/mixins/basic-add';
|
||||
|
||||
import {
|
||||
createEquipmentPlc,
|
||||
updateEquipmentPlc,
|
||||
getEquipmentPlc,
|
||||
getCode,
|
||||
} from '@/api/base/equipmentPlc';
|
||||
|
||||
export default {
|
||||
mixins: [basicAdd],
|
||||
data() {
|
||||
return {
|
||||
urlOptions: {
|
||||
isGetCode: true,
|
||||
codeURL: getCode,
|
||||
createURL: createEquipmentPlc,
|
||||
updateURL: updateEquipmentPlc,
|
||||
infoURL: getEquipmentPlc,
|
||||
},
|
||||
dataForm: {
|
||||
id: undefined,
|
||||
plcTableName: undefined,
|
||||
code: undefined,
|
||||
name: undefined,
|
||||
enName: undefined,
|
||||
collection: 1,
|
||||
description: undefined,
|
||||
},
|
||||
dataRule: {
|
||||
plcTableName: [
|
||||
{ required: true, message: '关联表名不能为空', trigger: 'blur' },
|
||||
],
|
||||
code: [{ required: true, message: '编码不能为空', trigger: 'blur' }],
|
||||
name: [{ required: true, message: '标识不能为空', trigger: 'blur' }],
|
||||
},
|
||||
};
|
||||
},
|
||||
methods: {},
|
||||
};
|
||||
</script>
|
||||
@@ -1,53 +1,59 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<search-bar
|
||||
:formConfigs="formConfig"
|
||||
ref="searchBarForm"
|
||||
@headBtnClick="buttonClick" />
|
||||
<!-- 搜索工作栏 -->
|
||||
<SearchBar
|
||||
:formConfigs="searchBarFormConfig"
|
||||
ref="search-bar"
|
||||
@headBtnClick="handleSearchBarBtnClick" />
|
||||
|
||||
<!-- 列表 -->
|
||||
<base-table
|
||||
v-loading="dataListLoading"
|
||||
:table-props="tableProps"
|
||||
:page="listQuery.pageNo"
|
||||
:limit="listQuery.pageSize"
|
||||
:table-data="tableData"
|
||||
:page="queryParams.pageNo"
|
||||
:limit="queryParams.pageSize"
|
||||
:table-data="list"
|
||||
ref="pageTable"
|
||||
@emitFun="handleEmitFun">
|
||||
<method-btn
|
||||
v-if="tableBtn.length"
|
||||
slot="handleBtn"
|
||||
:width="120"
|
||||
label="操作"
|
||||
:method-list="tableBtn"
|
||||
@clickBtn="handleClick" />
|
||||
@clickBtn="handleTableBtnClick" />
|
||||
</base-table>
|
||||
|
||||
<!-- 分页组件 -->
|
||||
<pagination
|
||||
:limit.sync="listQuery.pageSize"
|
||||
:page.sync="listQuery.pageNo"
|
||||
:total="listQuery.total"
|
||||
@pagination="getDataList" />
|
||||
v-show="total > 0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNo"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList" />
|
||||
|
||||
<!-- 对话框(添加 / 修改) -->
|
||||
<base-dialog
|
||||
:dialogTitle="addOrEditTitle"
|
||||
:dialogVisible="addOrUpdateVisible"
|
||||
@cancel="handleCancel"
|
||||
@confirm="handleConfirm"
|
||||
:before-close="handleCancel"
|
||||
width="50%">
|
||||
<add-or-update
|
||||
ref="addOrUpdate"
|
||||
@refreshDataList="successSubmit"></add-or-update>
|
||||
:dialogTitle="title"
|
||||
:dialogVisible="open"
|
||||
width="700px"
|
||||
@close="cancel"
|
||||
@cancel="cancel"
|
||||
@confirm="submitForm">
|
||||
<DialogForm v-if="open" ref="form" :dataForm="form" :rows="rows" />
|
||||
</base-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import AddOrUpdate from './add-or-updata';
|
||||
import basicPage from '@/mixins/basic-page';
|
||||
import { parseTime } from '@/filter/code-filter';
|
||||
import {
|
||||
createEquipmentPlc,
|
||||
updateEquipmentPlc,
|
||||
deleteEquipmentPlc,
|
||||
getEquipmentPlc,
|
||||
getEquipmentPlcPage,
|
||||
exportEquipmentPlcExcel,
|
||||
updateEquipmentPlc,
|
||||
} from '@/api/base/equipmentPlc';
|
||||
import moment from 'moment';
|
||||
import basicPageMixin from '@/mixins/lb/basicPageMixin';
|
||||
|
||||
const switchBtn = {
|
||||
name: 'SwitchBtn',
|
||||
@@ -84,45 +90,49 @@ const switchBtn = {
|
||||
);
|
||||
},
|
||||
};
|
||||
const tableProps = [
|
||||
{ prop: 'code', label: '编码', width: 220 },
|
||||
{ prop: 'plcTableName', label: '关联表名' },
|
||||
{ prop: 'name', label: '标识名称' },
|
||||
{ prop: 'enName', label: '英文名称' },
|
||||
{
|
||||
prop: 'collection',
|
||||
label: '是否采集',
|
||||
subcomponent: switchBtn,
|
||||
},
|
||||
{ prop: 'description', label: '描述' },
|
||||
];
|
||||
|
||||
export default {
|
||||
mixins: [basicPage],
|
||||
name: 'EquipmentPlc',
|
||||
mixins: [basicPageMixin],
|
||||
components: {},
|
||||
data() {
|
||||
return {
|
||||
urlOptions: {
|
||||
getDataListURL: getEquipmentPlcPage,
|
||||
deleteURL: deleteEquipmentPlc,
|
||||
exportURL: exportEquipmentPlcExcel,
|
||||
},
|
||||
tableProps,
|
||||
tableKey: Math.random(),
|
||||
searchBarKeys: ['name', 'plcTableName'],
|
||||
tableBtn: [
|
||||
this.$auth.hasPermi(`base:equipment-plc:update`)
|
||||
this.$auth.hasPermi('base:equipment-plc:update')
|
||||
? {
|
||||
type: 'edit',
|
||||
btnName: '编辑',
|
||||
btnName: '修改',
|
||||
}
|
||||
: undefined,
|
||||
this.$auth.hasPermi(`base:equipment-plc:delete`)
|
||||
this.$auth.hasPermi('base:equipment-plc:delete')
|
||||
? {
|
||||
type: 'delete',
|
||||
btnName: '删除',
|
||||
}
|
||||
: undefined,
|
||||
].filter((v) => v),
|
||||
tableData: [],
|
||||
formConfig: [
|
||||
tableProps: [
|
||||
// {
|
||||
// prop: 'createTime',
|
||||
// label: '添加时间',
|
||||
// fixed: true,
|
||||
// width: 180,
|
||||
// filter: (val) => moment(val).format('yyyy-MM-DD HH:mm:ss'),
|
||||
// },
|
||||
{ prop: 'code', label: '编码' },
|
||||
{ prop: 'plcTableName', label: '关联表名' },
|
||||
{ prop: 'name', label: '标识名称' },
|
||||
{ prop: 'enName', label: '英文名称' },
|
||||
{
|
||||
prop: 'collection',
|
||||
label: '是否采集',
|
||||
subcomponent: switchBtn,
|
||||
},
|
||||
{ prop: 'description', label: '描述' },
|
||||
],
|
||||
searchBarFormConfig: [
|
||||
{
|
||||
type: 'input',
|
||||
label: '表名',
|
||||
@@ -137,86 +147,231 @@ export default {
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
btnName: '搜索',
|
||||
btnName: '查询',
|
||||
name: 'search',
|
||||
color: 'primary',
|
||||
},
|
||||
// {
|
||||
// type: 'separate',
|
||||
// },
|
||||
// {
|
||||
// type: 'button',
|
||||
// btnName: '重置',
|
||||
// name: 'reset',
|
||||
// },
|
||||
{
|
||||
type: 'separate',
|
||||
},
|
||||
{
|
||||
type: this.$auth.hasPermi('base:factory:create') ? 'button' : '',
|
||||
// type: this.$auth.hasPermi('base:equipment-plc:create')
|
||||
// ? 'button'
|
||||
// : '',
|
||||
type: 'button',
|
||||
btnName: '新增',
|
||||
name: 'add',
|
||||
color: 'success',
|
||||
plain: true,
|
||||
color: 'success',
|
||||
},
|
||||
// {
|
||||
// type: this.$auth.hasPermi('base:factory:create') ? 'separate' : '',
|
||||
// },
|
||||
// {
|
||||
// type: this.$auth.hasPermi('base:factory:export') ? 'button' : '',
|
||||
// type: this.$auth.hasPermi('base:equipment-plc:export') ? 'button' : '',
|
||||
// btnName: '导出',
|
||||
// name: 'export',
|
||||
// color: 'warning',
|
||||
// },
|
||||
],
|
||||
rows: [
|
||||
[
|
||||
{
|
||||
input: true,
|
||||
label: '关联表名',
|
||||
prop: 'plcTableName',
|
||||
rules: [{ required: true, message: '不能为空', trigger: 'blur' }],
|
||||
// bind: {
|
||||
// disabled: true, // some condition, like detail mode...
|
||||
// }
|
||||
},
|
||||
{
|
||||
input: true,
|
||||
label: '编码',
|
||||
prop: 'code',
|
||||
url: '/base/equipment-group/getCode',
|
||||
rules: [{ required: true, message: '不能为空', trigger: 'blur' }],
|
||||
},
|
||||
],
|
||||
[
|
||||
{
|
||||
input: true,
|
||||
label: '标识',
|
||||
prop: 'name',
|
||||
rules: [{ required: true, message: '不能为空', trigger: 'blur' }],
|
||||
// bind: {
|
||||
// disabled: true, // some condition, like detail mode...
|
||||
// }
|
||||
},
|
||||
{
|
||||
input: true,
|
||||
label: '英文名',
|
||||
prop: 'enName',
|
||||
},
|
||||
],
|
||||
[
|
||||
{
|
||||
switch: true,
|
||||
label: '是否采集', // 是否采集 0 代表不采集, 1 代表采集
|
||||
prop: 'collection',
|
||||
value: 1,
|
||||
bind: {
|
||||
'active-value': 1,
|
||||
'inactive-value': 0,
|
||||
},
|
||||
},
|
||||
],
|
||||
[
|
||||
{
|
||||
textarea: true,
|
||||
label: '描述',
|
||||
prop: 'description',
|
||||
bind: {
|
||||
placeholder: '请输入备注',
|
||||
},
|
||||
},
|
||||
],
|
||||
],
|
||||
// 是否显示弹出
|
||||
open: false,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNo: 1,
|
||||
pageSize: 10,
|
||||
plcTableName: null,
|
||||
name: null,
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
};
|
||||
},
|
||||
components: {
|
||||
AddOrUpdate,
|
||||
created() {
|
||||
this.getList();
|
||||
},
|
||||
created() {},
|
||||
methods: {
|
||||
/** 覆盖 handleEmitFun 的默认实现 */
|
||||
handleEmitFun({ action, payload }) {
|
||||
console.log(payload)
|
||||
switch (action) {
|
||||
case 'update-collect':
|
||||
updateEquipmentPlc(payload).then((response) => {
|
||||
this.reset();
|
||||
const tempForm = {};
|
||||
Object.keys(this.form).forEach((key) => {
|
||||
tempForm[key] = payload[key];
|
||||
});
|
||||
updateEquipmentPlc(tempForm).then((response) => {
|
||||
this.$modal.msgSuccess('修改成功');
|
||||
this.getDataList();
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
break;
|
||||
}
|
||||
},
|
||||
buttonClick(val) {
|
||||
switch (val.btnName) {
|
||||
case 'search':
|
||||
this.listQuery.pageNo = 1;
|
||||
this.listQuery.pageSize = 10;
|
||||
this.listQuery.name = val.name;
|
||||
this.listQuery.plcTableName = val.plcTableName;
|
||||
this.getDataList();
|
||||
break;
|
||||
case 'reset':
|
||||
this.$refs.searchBarForm.resetForm();
|
||||
this.listQuery = {
|
||||
pageSize: 10,
|
||||
pageNo: 1,
|
||||
total: 1,
|
||||
};
|
||||
this.getDataList();
|
||||
break;
|
||||
case 'add':
|
||||
this.addOrEditTitle = '新增';
|
||||
this.addOrUpdateVisible = true;
|
||||
this.addOrUpdateHandle();
|
||||
break;
|
||||
case 'export':
|
||||
this.handleExport();
|
||||
break;
|
||||
default:
|
||||
console.log(val);
|
||||
}
|
||||
/** 查询列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
// 执行查询
|
||||
getEquipmentPlcPage(this.queryParams).then((response) => {
|
||||
this.list = response.data.list;
|
||||
this.total = response.data.total;
|
||||
this.loading = false;
|
||||
// this.tableKey = Math.random(); // method 1
|
||||
});
|
||||
},
|
||||
/** 取消按钮 */
|
||||
cancel() {
|
||||
this.open = false;
|
||||
this.reset();
|
||||
},
|
||||
/** 表单重置 */
|
||||
reset() {
|
||||
this.form = {
|
||||
id: undefined,
|
||||
plcTableName: undefined,
|
||||
code: undefined,
|
||||
name: undefined,
|
||||
enName: undefined,
|
||||
description: undefined,
|
||||
collection: undefined,
|
||||
};
|
||||
this.resetForm('form');
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNo = 1;
|
||||
this.getList();
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.resetForm('queryForm');
|
||||
this.handleQuery();
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.reset();
|
||||
this.open = true;
|
||||
this.title = '添加实时数据采集配置';
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.reset();
|
||||
const id = row.id;
|
||||
getEquipmentPlc(id).then((response) => {
|
||||
this.form = response.data;
|
||||
this.open = true;
|
||||
this.title = '修改实时数据采集配置';
|
||||
});
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
this.$refs['form'].validate((valid) => {
|
||||
if (!valid) {
|
||||
return;
|
||||
}
|
||||
// 修改的提交
|
||||
if (this.form.id != null) {
|
||||
updateEquipmentPlc(this.form).then((response) => {
|
||||
this.$modal.msgSuccess('修改成功');
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
return;
|
||||
}
|
||||
// 添加的提交
|
||||
createEquipmentPlc(this.form).then((response) => {
|
||||
this.$modal.msgSuccess('新增成功');
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
});
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const id = row.id;
|
||||
this.$modal
|
||||
.confirm('是否确认删除实时数据采集配置编号为"' + id + '"的数据项?')
|
||||
.then(function () {
|
||||
return deleteEquipmentPlc(id);
|
||||
})
|
||||
.then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess('删除成功');
|
||||
})
|
||||
.catch(() => {});
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
// 处理查询参数
|
||||
let params = { ...this.queryParams };
|
||||
params.pageNo = undefined;
|
||||
params.pageSize = undefined;
|
||||
this.$modal
|
||||
.confirm('是否确认导出所有实时数据采集配置数据项?')
|
||||
.then(() => {
|
||||
this.exportLoading = true;
|
||||
return exportEquipmentPlcExcel(params);
|
||||
})
|
||||
.then((response) => {
|
||||
this.$download.excel(response, '实时数据采集配置.xls');
|
||||
this.exportLoading = false;
|
||||
})
|
||||
.catch(() => {});
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
@@ -1,151 +0,0 @@
|
||||
<!--
|
||||
* @Author: zwq
|
||||
* @Date: 2021-11-18 14:16:25
|
||||
* @LastEditors: zwq
|
||||
* @LastEditTime: 2025-02-25 16:11:14
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<el-form
|
||||
:model="dataForm"
|
||||
:rules="dataRule"
|
||||
ref="dataForm"
|
||||
@keyup.enter.native="dataFormSubmit()"
|
||||
label-width="100px">
|
||||
<el-form-item label="设备" prop="equipmentId">
|
||||
<el-cascader
|
||||
placeholder="请选择设备"
|
||||
v-model="dataForm.equipmentId"
|
||||
:options="plLineList"
|
||||
:props="{value: 'id', label: 'name', children: 'children'}"
|
||||
style="width: 100%"
|
||||
filterable />
|
||||
</el-form-item>
|
||||
<el-form-item label="关联表名" prop="plcId">
|
||||
<el-select
|
||||
v-model="dataForm.plcId"
|
||||
filterable
|
||||
placeholder="请选择关联表"
|
||||
style="width: 100%">
|
||||
<el-option
|
||||
v-for="dict in plcList"
|
||||
:key="dict.id"
|
||||
:label="dict.plcTableName"
|
||||
:value="dict.id" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import basicAdd from './components/basic-add';
|
||||
import { createEquipmentPlcConnect, updateEquipmentPlcConnect } from '@/api/base/equipmentPlcConnect';
|
||||
import { getplcAllList, getTree } from "@/api/base/equipmentConfig";
|
||||
|
||||
export default {
|
||||
mixins: [basicAdd],
|
||||
data() {
|
||||
return {
|
||||
urlOptions: {
|
||||
createURL: createEquipmentPlcConnect,
|
||||
updateURL: updateEquipmentPlcConnect,
|
||||
},
|
||||
dataForm: {
|
||||
id: undefined,
|
||||
equipmentId: undefined,
|
||||
plcId: undefined
|
||||
},
|
||||
plcList: [],
|
||||
plLineList: [],
|
||||
dataRule: {
|
||||
equipmentId: [{ required: true, message: "设备不能为空", trigger: "blur" }],
|
||||
plcId: [{ required: true, message: "关联表名不能为空", trigger: "blur" }]
|
||||
},
|
||||
options: [{
|
||||
value: 'zhinan',
|
||||
label: '指南',
|
||||
children: [{
|
||||
value: 'shejiyuanze',
|
||||
label: '设计原则',
|
||||
children: [{
|
||||
value: 'yizhi',
|
||||
label: '一致'
|
||||
}, {
|
||||
value: 'fankui',
|
||||
label: '反馈'
|
||||
}, {
|
||||
value: 'xiaolv',
|
||||
label: '效率'
|
||||
}, {
|
||||
value: 'kekong',
|
||||
label: '可控'
|
||||
}]
|
||||
}, {
|
||||
value: 'daohang',
|
||||
label: '导航'
|
||||
}]
|
||||
}]
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getDict()
|
||||
},
|
||||
methods: {
|
||||
init() {
|
||||
this.$nextTick(() => {
|
||||
this.$refs['dataForm'].resetFields()
|
||||
})
|
||||
},
|
||||
async getDict() {
|
||||
// 关联表名列表
|
||||
const res = await getplcAllList();
|
||||
this.plcList = res.data;
|
||||
// 树形结构
|
||||
const res1 = await getTree();
|
||||
this.plLineList = res1.data;
|
||||
// const res1 = await getCorePLList();
|
||||
// this.plLineList = res1.data;
|
||||
// this.plLineList.forEach(item => {
|
||||
// listByParentId({ id: item.id }).then(resp => {
|
||||
// if (resp.data.length > 0) {
|
||||
// // item.children = resp.data
|
||||
// this.$set(item, 'children', resp.data)
|
||||
// // this.$forceUpdate()
|
||||
// }
|
||||
// })
|
||||
// })
|
||||
},
|
||||
// 表单提交
|
||||
dataFormSubmit() {
|
||||
this.$refs["dataForm"].validate((valid) => {
|
||||
if (!valid) {
|
||||
return false;
|
||||
}
|
||||
// 修改的提交
|
||||
if (this.dataForm.id) {
|
||||
updateEquipmentPlcConnect({
|
||||
id: this.dataForm.id,
|
||||
equipmentId: this.dataForm.equipmentId[this.dataForm.equipmentId.length],
|
||||
plcId: this.dataForm.plcId
|
||||
}).then(response => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.visible = false;
|
||||
this.$emit("refreshDataList");
|
||||
});
|
||||
return;
|
||||
}
|
||||
// 添加的提交
|
||||
createEquipmentPlcConnect({
|
||||
id: this.dataForm.id,
|
||||
equipmentId: this.dataForm.equipmentId[this.dataForm.equipmentId.length - 1],
|
||||
plcId: this.dataForm.plcId
|
||||
}).then(response => {
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.visible = false;
|
||||
this.$emit("refreshDataList");
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
@@ -1,8 +1,8 @@
|
||||
<!--
|
||||
<!--
|
||||
filename: EquipmentDrawer.vue
|
||||
author: liubin
|
||||
date: 2023-08-22 14:38:56
|
||||
description:
|
||||
description:
|
||||
-->
|
||||
|
||||
<template>
|
||||
@@ -12,7 +12,7 @@
|
||||
:wrapper-closable="false"
|
||||
class="drawer"
|
||||
custom-class="mes-drawer"
|
||||
:size="size || '50%'"
|
||||
size="60%"
|
||||
@closed="$emit('destroy')">
|
||||
<SmallTitle slot="title">
|
||||
{{
|
||||
@@ -29,107 +29,29 @@
|
||||
<section v-for="(section, index) in sections" :key="section.key">
|
||||
<SmallTitle v-if="index != 0">{{ section.name }}</SmallTitle>
|
||||
|
||||
<div
|
||||
class="form-part"
|
||||
v-if="section.key == 'base'"
|
||||
style="border-bottom: 1px solid #dfdfdf; margin-bottom: 24px">
|
||||
<div class="form-part" v-if="section.key == 'base'">
|
||||
<el-skeleton v-if="!showForm" animated />
|
||||
<!-- <BaseInfoForm
|
||||
<BaseInfoForm
|
||||
key="drawer-dialog-form"
|
||||
v-if="showForm"
|
||||
ref="form"
|
||||
:disabled="mode.includes('detail')"
|
||||
v-model="form"
|
||||
:rows="formRows" /> -->
|
||||
|
||||
<!-- if -->
|
||||
<el-row v-if="mode.includes('detail')" style="margin-bottom: 24px">
|
||||
<el-col :span="8">
|
||||
<div
|
||||
class="title"
|
||||
style="font-weight: 700; font-size: 16px; margin: 8px 0">
|
||||
设备名
|
||||
</div>
|
||||
<div class="value" style="font-size: 14px">
|
||||
{{ form.equipmentName }}
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<div
|
||||
class="title"
|
||||
style="font-weight: 700; font-size: 16px; margin: 8px 0">
|
||||
关联表名
|
||||
</div>
|
||||
<div class="value" style="font-size: 14px">
|
||||
{{ form.plcName }}
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<!-- else -->
|
||||
<el-row v-else style="margin-bottom: 24px" :gutter="20">
|
||||
<el-form ref="form" :model="form">
|
||||
<el-col :span="8">
|
||||
<el-form-item
|
||||
class="title"
|
||||
label="设备名"
|
||||
style="font-size: 16px; margin: 8px 0">
|
||||
<el-select
|
||||
v-model="form.equipmentId"
|
||||
filterable
|
||||
clearable
|
||||
placeholder="请选择设备">
|
||||
<el-option
|
||||
v-for="eq in eqList"
|
||||
:key="eq.id"
|
||||
:label="eq.name"
|
||||
:value="eq.id"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item
|
||||
class="title"
|
||||
label="设备关联表名"
|
||||
style="font-size: 16px; margin: 8px 0">
|
||||
<el-select
|
||||
v-model="form.plcId"
|
||||
filterable
|
||||
clearable
|
||||
placeholder="请选择关联表">
|
||||
<el-option
|
||||
v-for="plc in plcList"
|
||||
:key="plc.id"
|
||||
:label="plc.plcTableName"
|
||||
:value="plc.id"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-form>
|
||||
</el-row>
|
||||
:dataForm="form"
|
||||
:rows="formRows" />
|
||||
</div>
|
||||
|
||||
<div
|
||||
v-if="section.key == 'attrs'"
|
||||
style="position: relative; margin-top: 12px">
|
||||
<div
|
||||
v-if="!mode.includes('detail')"
|
||||
style="position: absolute; top: -40px; right: 0">
|
||||
<el-button @click="handleAddAttr" type="text">
|
||||
<i class="el-icon-plus"></i>
|
||||
添加参数
|
||||
</el-button>
|
||||
</div>
|
||||
<div v-if="section.key == 'attrs'" style="margin-top: 12px">
|
||||
<base-table
|
||||
v-loading="attrListLoading"
|
||||
:table-props="section.props"
|
||||
:page="attrQuery?.params.pageNo || 1"
|
||||
:limit="attrQuery?.params.pageSize || 10"
|
||||
:table-data="list"
|
||||
:add-button-show="mode.includes('detail') ? null : '添加属性'"
|
||||
@emitButtonClick="handleAddAttr"
|
||||
@emitFun="handleEmitFun">
|
||||
<!-- :add-button-show="mode.includes('detail') ? null : '添加属性'"
|
||||
@emitButtonClick="handleAddAttr" -->
|
||||
<method-btn
|
||||
v-if="section.tableBtn && !mode.includes('detail')"
|
||||
v-if="section.tableBtn"
|
||||
slot="handleBtn"
|
||||
label="操作"
|
||||
:method-list="tableBtn"
|
||||
@@ -149,12 +71,17 @@
|
||||
|
||||
<div class="drawer-body__footer">
|
||||
<el-button style="" @click="handleCancel">取消</el-button>
|
||||
<el-button
|
||||
type="primary"
|
||||
v-if="!mode.includes('detail')"
|
||||
@click="handleSave">
|
||||
保存
|
||||
<el-button v-if="mode == 'detail'" type="primary" @click="toggleEdit">
|
||||
编辑
|
||||
</el-button>
|
||||
<el-button v-else type="primary" @click="handleCancel">确定</el-button>
|
||||
<!-- sections的第二项必须是 属性列表 -->
|
||||
<!-- <el-button
|
||||
v-if="sections[1].allowAdd"
|
||||
type="primary"
|
||||
@click="handleAddAttr">
|
||||
添加属性
|
||||
</el-button> -->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -169,10 +96,10 @@
|
||||
@close="closeAttrForm"
|
||||
@cancel="closeAttrForm"
|
||||
@confirm="submitAttrForm">
|
||||
<!-- :disabled="mode.includes('detail')" -->
|
||||
<DialogForm
|
||||
v-if="attrFormVisible"
|
||||
ref="attrForm"
|
||||
:disabled="mode.includes('detail')"
|
||||
v-model="attrForm"
|
||||
:rows="attrRows" />
|
||||
</base-dialog>
|
||||
@@ -209,7 +136,7 @@ const SmallTitle = {
|
||||
|
||||
export default {
|
||||
components: { SmallTitle, DialogForm: BaseInfoForm, BaseInfoForm },
|
||||
props: ['sections', 'defaultMode', 'infoData', 'size'],
|
||||
props: ['sections', 'defaultMode', 'infoData'],
|
||||
data() {
|
||||
return {
|
||||
mode: '',
|
||||
@@ -218,8 +145,6 @@ export default {
|
||||
total: 0,
|
||||
form: {},
|
||||
list: [],
|
||||
eqList: [],
|
||||
plcList: [],
|
||||
attrTitle: '',
|
||||
attrForm: {
|
||||
id: null,
|
||||
@@ -241,17 +166,13 @@ export default {
|
||||
input: true,
|
||||
label: '参数列名',
|
||||
prop: 'plcParamName',
|
||||
rules: [
|
||||
{ required: true, message: '参数列名不能为空', trigger: 'blur' },
|
||||
],
|
||||
rules: [{ required: true, message: '不能为空', trigger: 'blur' }],
|
||||
},
|
||||
{
|
||||
input: true,
|
||||
label: '参数名称',
|
||||
prop: 'name',
|
||||
rules: [
|
||||
{ required: true, message: '参数名称不能为空', trigger: 'blur' },
|
||||
],
|
||||
rules: [{ required: true, message: '不能为空', trigger: 'blur' }],
|
||||
},
|
||||
],
|
||||
[
|
||||
@@ -260,6 +181,7 @@ export default {
|
||||
label: '单位',
|
||||
prop: 'unit',
|
||||
options: this.getDictDatas(this.DICT_TYPE.UNIT_DICT),
|
||||
// rules: [{ required: true, message: '不能为空', trigger: 'blur' }],
|
||||
},
|
||||
{
|
||||
switch: true,
|
||||
@@ -271,47 +193,6 @@ export default {
|
||||
},
|
||||
},
|
||||
],
|
||||
[
|
||||
{
|
||||
select: true,
|
||||
label: '设备参数类型',
|
||||
prop: 'equipmentParamType',
|
||||
options: [
|
||||
{ label: '一般参数', value: 1 },
|
||||
{ label: '工艺参数', value: 2 },
|
||||
{ label: '报警参数', value: 3 },
|
||||
],
|
||||
rules: [
|
||||
{
|
||||
required: true,
|
||||
message: '设备参数类型不能为空',
|
||||
trigger: 'blur',
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
select: true,
|
||||
label: '生产参数类型',
|
||||
prop: 'productionParamType',
|
||||
options: [
|
||||
// { label: '进片数量', value: 1 },
|
||||
// { label: '出片数量', value: 2 },
|
||||
// { label: '破损数量', value: 3 },
|
||||
// { label: '无类型', value: 4 },
|
||||
{ label: '进口计数', value: 1 },
|
||||
{ label: '出口计数', value: 2 },
|
||||
{ label: '损耗计数', value: 3 },
|
||||
{ label: '无类型', value: 4 },
|
||||
],
|
||||
rules: [
|
||||
{
|
||||
required: true,
|
||||
message: '生产参数类型不能为空',
|
||||
trigger: 'blur',
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
[
|
||||
{
|
||||
input: true,
|
||||
@@ -341,6 +222,7 @@ export default {
|
||||
transform: (val) => Number(val),
|
||||
},
|
||||
],
|
||||
// rules: [{ required: true, message: '不能为空', trigger: 'blur' }],
|
||||
},
|
||||
],
|
||||
[
|
||||
@@ -348,11 +230,13 @@ export default {
|
||||
input: true,
|
||||
label: '标准值',
|
||||
prop: 'defaultValue',
|
||||
// rules: [{ required: true, message: '不能为空', trigger: 'blur' }],
|
||||
},
|
||||
{
|
||||
input: true,
|
||||
label: '描述',
|
||||
prop: 'description',
|
||||
// rules: [{ required: true, message: '不能为空', trigger: 'blur' }],
|
||||
},
|
||||
],
|
||||
[
|
||||
@@ -360,6 +244,7 @@ export default {
|
||||
input: true,
|
||||
label: '备注',
|
||||
prop: 'remark',
|
||||
// rules: [{ required: true, message: '不能为空', trigger: 'blur' }],
|
||||
},
|
||||
],
|
||||
],
|
||||
@@ -372,7 +257,6 @@ export default {
|
||||
infoQuery: null, // 基本信息的请求
|
||||
attrFormSubmitting: false,
|
||||
attrListLoading: false,
|
||||
shouldRefreshPageView: false,
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
@@ -391,24 +275,11 @@ export default {
|
||||
});
|
||||
},
|
||||
tableBtn() {
|
||||
return this.sections[1].tableBtn;
|
||||
// return this.mode == 'detail' ? [] : this.sections[1].tableBtn;
|
||||
return this.mode == 'detail' ? [] : this.sections[1].tableBtn;
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
this.shouldRefreshPageView = false;
|
||||
this.mode = this.defaultMode || 'detail';
|
||||
|
||||
if (this.mode != 'detail') {
|
||||
this.$axios('/base/equipment/listAll').then(({ code, data }) => {
|
||||
this.eqList = data;
|
||||
});
|
||||
this.$axios({
|
||||
url: '/base/equipment-plc/listAll',
|
||||
}).then(({ code, data }) => {
|
||||
this.plcList = data;
|
||||
});
|
||||
}
|
||||
for (const section of this.sections) {
|
||||
// 请求具体信息
|
||||
if ('url' in section) {
|
||||
@@ -470,7 +341,7 @@ export default {
|
||||
handleSave() {
|
||||
this.$refs['form'][0].validate(async (valid) => {
|
||||
if (valid) {
|
||||
const isEdit = !this.mode.includes('detail');
|
||||
const isEdit = this.mode == 'edit';
|
||||
await this.$axios({
|
||||
url: this.sections[0][isEdit ? 'urlUpdate' : 'urlCreate'],
|
||||
method: isEdit ? 'put' : 'post',
|
||||
@@ -484,9 +355,6 @@ export default {
|
||||
},
|
||||
|
||||
handleCancel() {
|
||||
if (this.shouldRefreshPageView) {
|
||||
this.$emit('refreshDataList');
|
||||
}
|
||||
this.visible = false;
|
||||
},
|
||||
|
||||
@@ -508,11 +376,9 @@ export default {
|
||||
defaultValue: '',
|
||||
description: '',
|
||||
remark: '',
|
||||
equipmentParamType: '',
|
||||
productionParamType: '',
|
||||
alarmContent: '',
|
||||
};
|
||||
this.attrTitle = '添加参数绑定信息';
|
||||
this.attrTitle = '添加设备绑定信息';
|
||||
this.attrFormVisible = true;
|
||||
},
|
||||
|
||||
@@ -525,14 +391,14 @@ export default {
|
||||
});
|
||||
if (res.code == 0) {
|
||||
this.attrForm = res.data;
|
||||
this.attrTitle = '编辑参数绑定信息';
|
||||
this.attrTitle = '编辑设备绑定信息';
|
||||
this.attrFormVisible = true;
|
||||
}
|
||||
},
|
||||
|
||||
// 删除属性
|
||||
handleDeleteAttr(attrId) {
|
||||
this.$confirm('确定删除该参数?', '提示', {
|
||||
this.$confirm('确定删除该分组报警?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning',
|
||||
@@ -544,7 +410,6 @@ export default {
|
||||
params: { id: attrId },
|
||||
});
|
||||
if (res.code == 0) {
|
||||
this.shouldRefreshPageView = true;
|
||||
this.$message({
|
||||
message: '删除成功',
|
||||
type: 'success',
|
||||
@@ -559,37 +424,35 @@ export default {
|
||||
},
|
||||
|
||||
// 提交属性表
|
||||
submitAttrForm() {
|
||||
this.$refs['attrForm'].validate(async (valid) => {
|
||||
async submitAttrForm() {
|
||||
this.$refs['attrForm'].validate((valid) => {
|
||||
if (!valid) {
|
||||
return;
|
||||
}
|
||||
});
|
||||
const isEdit = this.attrForm.id != null;
|
||||
this.attrFormSubmitting = true;
|
||||
const res = await this.$axios({
|
||||
url: isEdit ? this.sections[1].urlUpdate : this.sections[1].urlCreate,
|
||||
method: isEdit ? 'put' : 'post',
|
||||
data: {
|
||||
...this.attrForm,
|
||||
connectId: this.infoData.id
|
||||
},
|
||||
});
|
||||
|
||||
const isEdit = this.attrForm.id != null;
|
||||
this.attrFormSubmitting = true;
|
||||
const res = await this.$axios({
|
||||
url: isEdit ? this.sections[1].urlUpdate : this.sections[1].urlCreate,
|
||||
method: isEdit ? 'put' : 'post',
|
||||
data: {
|
||||
...this.attrForm,
|
||||
connectId: this.infoData.id,
|
||||
if (res.code == 0) {
|
||||
this.closeAttrForm();
|
||||
this.$message({
|
||||
message: `${isEdit ? '更新' : '创建'}成功`,
|
||||
type: 'success',
|
||||
duration: 1500,
|
||||
onClose: () => {
|
||||
this.getAttrList();
|
||||
},
|
||||
});
|
||||
|
||||
if (res.code == 0) {
|
||||
this.closeAttrForm();
|
||||
this.$message({
|
||||
message: `${isEdit ? '更新' : '创建'}成功`,
|
||||
type: 'success',
|
||||
duration: 1500,
|
||||
onClose: () => {
|
||||
this.getAttrList();
|
||||
this.shouldRefreshPageView = true;
|
||||
},
|
||||
});
|
||||
}
|
||||
this.attrFormSubmitting = false;
|
||||
});
|
||||
}
|
||||
this.attrFormSubmitting = false;
|
||||
},
|
||||
|
||||
closeAttrForm() {
|
||||
@@ -598,7 +461,7 @@ export default {
|
||||
|
||||
handleClick(raw) {
|
||||
if (raw.type === 'delete') {
|
||||
this.$confirm(`确定删除该参数?`, '提示', {
|
||||
this.$confirm(`确定删除该报警?`, '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning',
|
||||
|
||||
@@ -1,100 +0,0 @@
|
||||
/*
|
||||
* @Author: zwq
|
||||
* @Date: 2022-08-24 11:19:43
|
||||
* @LastEditors: zhp
|
||||
* @LastEditTime: 2023-12-13 15:52:53
|
||||
* @Description:
|
||||
*/
|
||||
export default {
|
||||
data() {
|
||||
/* eslint-disable */
|
||||
return {
|
||||
urlOptions: {
|
||||
createURL: '',
|
||||
updateURL: '',
|
||||
infoURL: '',
|
||||
codeURL: '',
|
||||
getOption: false,
|
||||
isGetCode: false,
|
||||
optionArrUrl: [],
|
||||
optionArr: {}
|
||||
},
|
||||
visible: false,
|
||||
setData: false
|
||||
}
|
||||
},
|
||||
created() {
|
||||
},
|
||||
activated() {
|
||||
},
|
||||
methods: {
|
||||
init(id) {
|
||||
this.dataForm.id = id || "";
|
||||
this.visible = true;
|
||||
if (this.urlOptions.getOption) {
|
||||
this.getArr()
|
||||
}
|
||||
this.$nextTick(() => {
|
||||
this.$refs["dataForm"].resetFields();
|
||||
if (this.dataForm.id) {
|
||||
this.urlOptions.infoURL(id).then(response => {
|
||||
this.dataForm = response.data
|
||||
if (this.setData) {
|
||||
this.setDataForm()
|
||||
}
|
||||
});
|
||||
} else {
|
||||
if (this.urlOptions.isGetCode) {
|
||||
this.getCode()
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
getCode() {
|
||||
this.urlOptions.codeURL()
|
||||
.then(({ data: res }) => {
|
||||
this.dataForm.code = res;
|
||||
})
|
||||
.catch(() => {});
|
||||
},
|
||||
getArr() {
|
||||
const params = {
|
||||
pageSize: 100,
|
||||
pageNo: 1,
|
||||
}
|
||||
this.urlOptions.optionArrUrl.forEach((item, index) => {
|
||||
item(params).then(({ data: res }) => {
|
||||
this.$set(this.urlOptions.optionArr, `arr${index}`, res.list)
|
||||
})
|
||||
.catch(() => {
|
||||
});
|
||||
});
|
||||
},
|
||||
// 表单提交
|
||||
dataFormSubmit() {
|
||||
this.$refs["dataForm"].validate((valid) => {
|
||||
if (!valid) {
|
||||
return false;
|
||||
}
|
||||
// 修改的提交
|
||||
if (this.dataForm.id) {
|
||||
this.urlOptions.updateURL(this.dataForm).then(response => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.visible = false;
|
||||
this.$emit("refreshDataList");
|
||||
});
|
||||
return;
|
||||
}
|
||||
// 添加的提交
|
||||
this.urlOptions.createURL(this.dataForm).then(response => {
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.visible = false;
|
||||
this.$emit("refreshDataList");
|
||||
});
|
||||
});
|
||||
},
|
||||
formClear() {
|
||||
this.$refs.dataForm.resetFields()
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,10 +1,3 @@
|
||||
<!--
|
||||
filename: CollectionConfig.vue
|
||||
author: liubin
|
||||
date: 2023-10-30 10:09:03
|
||||
description:
|
||||
-->
|
||||
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<!-- 搜索工作栏 -->
|
||||
@@ -19,8 +12,7 @@
|
||||
:page="queryParams.pageNo"
|
||||
:limit="queryParams.pageSize"
|
||||
:table-data="list"
|
||||
@emitFun="handleEmitFun"
|
||||
:max-height="tableH">
|
||||
@emitFun="handleEmitFun">
|
||||
<method-btn
|
||||
v-if="tableBtn.length"
|
||||
slot="handleBtn"
|
||||
@@ -42,21 +34,17 @@
|
||||
<base-dialog
|
||||
:dialogTitle="title"
|
||||
:dialogVisible="open"
|
||||
width="30%"
|
||||
width="700px"
|
||||
@close="cancel"
|
||||
@cancel="cancel"
|
||||
@confirm="submitForm">
|
||||
<!-- <DialogForm v-if="open" ref="form" v-model="form" :rows="rows" /> -->
|
||||
<add-or-update
|
||||
ref="addOrUpdate"
|
||||
@refreshDataList="successSubmit" />
|
||||
<DialogForm v-if="open" ref="form" :dataForm="form" :rows="rows" />
|
||||
</base-dialog>
|
||||
|
||||
<!-- 抽屉 详情 -->
|
||||
<BasicDrawer
|
||||
v-if="editVisible"
|
||||
ref="drawer"
|
||||
size="45%"
|
||||
:default-mode="editMode"
|
||||
:info-data="alarmForm"
|
||||
:sections="[
|
||||
@@ -64,13 +52,9 @@
|
||||
name: '基本信息',
|
||||
key: 'base',
|
||||
rows: drawerBaseInfoRows,
|
||||
url: '/base/equipment-plc-connect/get',
|
||||
urlUpdate: '/base/equipment-plc-connect/update',
|
||||
urlCreate: '/base/equipment-plc-connect/create',
|
||||
queryParams: { id: alarmForm.id },
|
||||
},
|
||||
{
|
||||
name: '采集参数',
|
||||
name: '属性列表',
|
||||
key: 'attrs',
|
||||
props: drawerListProps,
|
||||
url: '/base/equipment-plc-param/page',
|
||||
@@ -84,26 +68,18 @@
|
||||
pageSize: 10,
|
||||
},
|
||||
tableBtn: [
|
||||
{
|
||||
type: 'edit',
|
||||
btnName: '修改',
|
||||
},
|
||||
{
|
||||
type: 'delete',
|
||||
btnName: '删除',
|
||||
},
|
||||
// this.$auth.hasPermi('equipment:collection-config-param:update')
|
||||
// ? {
|
||||
// type: 'edit',
|
||||
// btnName: '修改',
|
||||
// }
|
||||
// : undefined,
|
||||
// this.$auth.hasPermi('equipment:collection-config-param:delete')
|
||||
// ? {
|
||||
// type: 'delete',
|
||||
// btnName: '删除',
|
||||
// }
|
||||
// : undefined,
|
||||
this.$auth.hasPermi('base:equipment-plc-param:update')
|
||||
? {
|
||||
type: 'edit',
|
||||
btnName: '修改',
|
||||
}
|
||||
: undefined,
|
||||
this.$auth.hasPermi('base:equipment-plc-param:delete')
|
||||
? {
|
||||
type: 'delete',
|
||||
btnName: '删除',
|
||||
}
|
||||
: undefined,
|
||||
].filter((v) => v),
|
||||
allowAdd: true,
|
||||
},
|
||||
@@ -123,60 +99,67 @@ import {
|
||||
getEquipmentPlcConnectPage,
|
||||
exportEquipmentPlcConnectExcel,
|
||||
} from '@/api/base/equipmentPlcConnect';
|
||||
import moment from 'moment';
|
||||
import basicPageMixin from '@/mixins/lb/basicPageMixin';
|
||||
// import './http';
|
||||
import BasicDrawer from './components/BasicDrawer.vue';
|
||||
import { publicFormatter } from '@/utils/dict';
|
||||
import AddOrUpdate from './add-or-updata';
|
||||
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
|
||||
|
||||
export default {
|
||||
name: 'EquipmentPlcConnect',
|
||||
mixins: [basicPageMixin, tableHeightMixin],
|
||||
components: { BasicDrawer, AddOrUpdate },
|
||||
mixins: [basicPageMixin],
|
||||
components: { BasicDrawer },
|
||||
data() {
|
||||
return {
|
||||
searchBarKeys: ['equipmentId', 'plcId'],
|
||||
// tableBtn: [
|
||||
// this.$auth.hasPermi('base:equipment-plc:update')
|
||||
// ? {
|
||||
// type: 'edit',
|
||||
// btnName: '修改',
|
||||
// }
|
||||
// : undefined,
|
||||
// this.$auth.hasPermi('base:equipment-plc:delete')
|
||||
// ? {
|
||||
// type: 'delete',
|
||||
// btnName: '删除',
|
||||
// }
|
||||
// : undefined,
|
||||
// ].filter((v) => v),
|
||||
tableBtn: [
|
||||
this.$auth.hasPermiAnd([
|
||||
'base:equipment-plc-connect:query',
|
||||
'base:equipment-plc-param:query'
|
||||
])
|
||||
? {
|
||||
type: 'detail',
|
||||
btnName: '参数绑定',
|
||||
} : undefined,
|
||||
this.$auth.hasPermiAnd([
|
||||
'base:equipment-plc-connect:update',
|
||||
'base:equipment-plc-connect:query',
|
||||
'base:equipment-plc-param:create',
|
||||
'base:equipment-plc-param:update',
|
||||
'base:equipment-plc-param:delete',
|
||||
'base:equipment-plc-param:query'
|
||||
])
|
||||
? {
|
||||
type: 'edit',
|
||||
btnName: '修改',
|
||||
}
|
||||
: undefined,
|
||||
this.$auth.hasPermi('base:equipment-plc-connect:delete')
|
||||
? {
|
||||
type: 'delete',
|
||||
btnName: '删除',
|
||||
}
|
||||
: undefined,
|
||||
].filter((v) => v),
|
||||
{
|
||||
type: 'detail',
|
||||
btnName: '参数绑定',
|
||||
},
|
||||
{
|
||||
type: 'edit',
|
||||
btnName: '修改',
|
||||
},
|
||||
// {
|
||||
// type: 'params-bind',
|
||||
// btnName: '参数绑定',
|
||||
// },
|
||||
{
|
||||
type: 'delete',
|
||||
btnName: '删除',
|
||||
},
|
||||
],
|
||||
tableProps: [
|
||||
{ prop: 'productionLine', label: '产线', minWidth: 120, showOverflowtooltip: true },
|
||||
{ prop: 'workshopSection', label: '工段', minWidth: 120, showOverflowtooltip: true },
|
||||
{ prop: 'equipmentName', label: '设备名', minWidth: 120, showOverflowtooltip: true },
|
||||
{ prop: 'equipmentCode', label: '设备编码', minWidth: 200, showOverflowtooltip: true },
|
||||
{ prop: 'plcCode', label: '关联表编码', minWidth: 220, showOverflowtooltip: true },
|
||||
{ prop: 'plcTableName', label: '关联表名', minWidth: 150, showOverflowtooltip: true },
|
||||
{ prop: 'plcName', label: '标识名称', minWidth: 150, showOverflowtooltip: true },
|
||||
{ prop: 'bindingParameters', label: '绑定参数数量', minWidth: 120, showOverflowtooltip: true },
|
||||
// {
|
||||
// prop: 'createTime',
|
||||
// label: '添加时间',
|
||||
// fixed: true,
|
||||
// width: 180,
|
||||
// filter: (val) => moment(val).format('yyyy-MM-DD HH:mm:ss'),
|
||||
// },
|
||||
{ prop: 'productionLine', label: '产线' },
|
||||
{ prop: 'workshopSection', label: '工段' },
|
||||
{ prop: 'equipmentName', label: '设备名' },
|
||||
{ prop: 'equipmentCode', label: '设备编码' },
|
||||
{ prop: 'plcCode', label: '关联表编码' },
|
||||
{ prop: 'plcTableName', label: '关联表名' },
|
||||
{ prop: 'plcName', label: '标识名称' },
|
||||
{ prop: 'bindingParameters', label: '绑定参数数量' },
|
||||
// {
|
||||
// _action: 'params-bind',
|
||||
// label: '查看绑定',
|
||||
@@ -211,15 +194,13 @@ export default {
|
||||
placeholder: '请选择设备',
|
||||
param: 'equipmentId',
|
||||
selectOptions: [],
|
||||
filterable: true,
|
||||
},
|
||||
{
|
||||
type: 'select',
|
||||
label: '关联表编码',
|
||||
placeholder: '请选择关联表编码',
|
||||
label: '编码',
|
||||
placeholder: '请选择编码',
|
||||
param: 'plcId',
|
||||
selectOptions: [],
|
||||
filterable: true,
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
@@ -228,21 +209,20 @@ export default {
|
||||
color: 'primary',
|
||||
},
|
||||
{
|
||||
type: this.$auth.hasPermi('base:equipment-plc-connect:create')
|
||||
? 'separate' : '',
|
||||
type: 'separate',
|
||||
},
|
||||
{
|
||||
type: this.$auth.hasPermi('base:equipment-plc-connect:create')
|
||||
? 'button'
|
||||
: '',
|
||||
// type: 'button',
|
||||
// type: this.$auth.hasPermi('base:equipment-plc:create')
|
||||
// ? 'button'
|
||||
// : '',
|
||||
type: 'button',
|
||||
btnName: '新增',
|
||||
name: 'add',
|
||||
plain: true,
|
||||
color: 'success',
|
||||
},
|
||||
// {
|
||||
// type: this.$auth.hasPermi('equipment:collection-config:export') ? 'button' : '',
|
||||
// type: this.$auth.hasPermi('base:equipment-plc:export') ? 'button' : '',
|
||||
// btnName: '导出',
|
||||
// name: 'export',
|
||||
// color: 'warning',
|
||||
@@ -256,9 +236,7 @@ export default {
|
||||
prop: 'plcId',
|
||||
labelKey: `plcTableName`,
|
||||
url: '/base/equipment-plc/listAll',
|
||||
rules: [
|
||||
{ required: true, message: '关联表名不能为空', trigger: 'blur' },
|
||||
],
|
||||
rules: [{ required: true, message: '不能为空', trigger: 'blur' }],
|
||||
bind: {
|
||||
filterable: true,
|
||||
},
|
||||
@@ -270,9 +248,7 @@ export default {
|
||||
label: '设备',
|
||||
prop: 'equipmentId',
|
||||
url: '/base/core-equipment/page?pageNo=1&pageSize=99',
|
||||
rules: [
|
||||
{ required: true, message: '设备不能为空', trigger: 'blur' },
|
||||
],
|
||||
rules: [{ required: true, message: '不能为空', trigger: 'blur' }],
|
||||
bind: {
|
||||
filterable: true,
|
||||
},
|
||||
@@ -283,7 +259,7 @@ export default {
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNo: 1,
|
||||
pageSize: 20,
|
||||
pageSize: 10,
|
||||
plcId: null,
|
||||
equipmentId: null,
|
||||
},
|
||||
@@ -298,9 +274,7 @@ export default {
|
||||
input: true,
|
||||
label: '设备名',
|
||||
prop: 'equipmentName',
|
||||
rules: [
|
||||
{ required: true, message: '设备名不能为空', trigger: 'blur' },
|
||||
],
|
||||
rules: [{ required: true, message: '不能为空', trigger: 'blur' }],
|
||||
// bind: {
|
||||
// disabled: this.editMode == 'detail', // some condition, like detail mode...
|
||||
// }
|
||||
@@ -321,23 +295,6 @@ export default {
|
||||
label: '单位',
|
||||
filter: publicFormatter('unit_dict'),
|
||||
},
|
||||
{
|
||||
prop: 'equipmentParamType',
|
||||
label: '设备参数类型',
|
||||
filter: (val) =>
|
||||
val != null
|
||||
? ['', '一般参数', '工艺参数', '报警参数', ''][val]
|
||||
: '-',
|
||||
},
|
||||
{
|
||||
prop: 'productionParamType',
|
||||
label: '生产参数类型',
|
||||
filter: (val) =>
|
||||
val != null
|
||||
? // ? ['', '进片数量', '出片数量', '破损数量', '无类型', ''][val]
|
||||
['', '进口计数', '出口计数', '损耗计数', '无类型', ''][val]
|
||||
: '-',
|
||||
},
|
||||
{
|
||||
prop: 'collection',
|
||||
label: '是否采集',
|
||||
@@ -361,17 +318,14 @@ export default {
|
||||
this.initSearchOptions();
|
||||
},
|
||||
methods: {
|
||||
successSubmit() {
|
||||
this.cancel()
|
||||
this.getList()
|
||||
},
|
||||
async getEquipmentOptions() {
|
||||
const res = await this.$axios({
|
||||
url: '/base/equipment/listAll',
|
||||
url: '/base/core-equipment/listAll',
|
||||
method: 'get',
|
||||
});
|
||||
return res.data;
|
||||
},
|
||||
|
||||
async getPlcOptions() {
|
||||
const res = await this.$axios({
|
||||
url: '/base/equipment-plc/listAll',
|
||||
@@ -392,7 +346,7 @@ export default {
|
||||
});
|
||||
this.searchBarFormConfig[1].selectOptions = plcList.map((item) => {
|
||||
return {
|
||||
name: item.code,
|
||||
name: item.name,
|
||||
id: item.id,
|
||||
};
|
||||
});
|
||||
@@ -449,19 +403,6 @@ export default {
|
||||
};
|
||||
this.resetForm('form');
|
||||
},
|
||||
handleTableBtnClick({ data, type }) {
|
||||
switch (type) {
|
||||
case 'edit':
|
||||
this.handleDetail(data, 'edit');
|
||||
break;
|
||||
case 'delete':
|
||||
this.handleDelete(data);
|
||||
break;
|
||||
case 'detail':
|
||||
this.handleDetail(data);
|
||||
break;
|
||||
}
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNo = 1;
|
||||
@@ -476,10 +417,7 @@ export default {
|
||||
handleAdd() {
|
||||
this.reset();
|
||||
this.open = true;
|
||||
this.title = '添加设备采集配置';
|
||||
this.$nextTick(() => {
|
||||
this.$refs.addOrUpdate.init()
|
||||
})
|
||||
this.title = '添加设备与实时采集关系表(一对多)';
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
@@ -488,16 +426,35 @@ export default {
|
||||
getEquipmentPlcConnect(id).then((response) => {
|
||||
this.form = response.data;
|
||||
this.open = true;
|
||||
this.title = '修改设备采集配置';
|
||||
this.title = '修改设备与实时采集关系表(一对多)';
|
||||
});
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
this.$refs.addOrUpdate.dataFormSubmit()
|
||||
this.$refs['form'].validate((valid) => {
|
||||
if (!valid) {
|
||||
return;
|
||||
}
|
||||
// 修改的提交
|
||||
if (this.form.id != null) {
|
||||
updateEquipmentPlcConnect(this.form).then((response) => {
|
||||
this.$modal.msgSuccess('修改成功');
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
return;
|
||||
}
|
||||
// 添加的提交
|
||||
createEquipmentPlcConnect(this.form).then((response) => {
|
||||
this.$modal.msgSuccess('新增成功');
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
// 查看报警
|
||||
handleDetail(row, mode = 'detail') {
|
||||
handleDetail(row) {
|
||||
// debugger;
|
||||
const {
|
||||
id,
|
||||
@@ -513,7 +470,7 @@ export default {
|
||||
workshopSection,
|
||||
} = row;
|
||||
// 打开抽屉
|
||||
this.editMode = mode;
|
||||
this.editMode = 'detail';
|
||||
this.alarmForm.id = id;
|
||||
this.alarmForm.plcTableName = plcTableName; // 关联表名
|
||||
this.alarmForm.equipmentName = equipmentName;
|
||||
|
||||
@@ -38,7 +38,7 @@
|
||||
@close="cancel"
|
||||
@cancel="cancel"
|
||||
@confirm="submitForm">
|
||||
<DialogForm v-if="open" ref="form" v-model="form" :rows="rows" />
|
||||
<DialogForm v-if="open" ref="form" :dataForm="form" :rows="rows" />
|
||||
</base-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -1,277 +0,0 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
|
||||
<!-- 搜索工作栏 -->
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<el-form-item label="设备id" prop="equipmentId">
|
||||
<el-input v-model="queryParams.equipmentId" placeholder="请输入设备id" clearable @keyup.enter.native="handleQuery"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="设备名称" prop="equipmentName">
|
||||
<el-input v-model="queryParams.equipmentName" placeholder="请输入设备名称" clearable @keyup.enter.native="handleQuery"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="进入设备的数量" prop="inQuantity">
|
||||
<el-input v-model="queryParams.inQuantity" placeholder="请输入进入设备的数量" clearable @keyup.enter.native="handleQuery"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="离开设备的数量,若plc只记录一个生产数量,也写入该字段" prop="outQuantity">
|
||||
<el-input v-model="queryParams.outQuantity" placeholder="请输入离开设备的数量,若plc只记录一个生产数量,也写入该字段" clearable @keyup.enter.native="handleQuery"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="正常生产量" prop="okQuantity">
|
||||
<el-input v-model="queryParams.okQuantity" placeholder="请输入正常生产量" clearable @keyup.enter.native="handleQuery"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="设备上报的报废数量" prop="nokQuantity">
|
||||
<el-input v-model="queryParams.nokQuantity" placeholder="请输入设备上报的报废数量" clearable @keyup.enter.native="handleQuery"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="生产数量的记录时间" prop="recordTime">
|
||||
<el-date-picker v-model="queryParams.recordTime" style="width: 240px" value-format="yyyy-MM-dd HH:mm:ss" type="daterange"
|
||||
range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期" :default-time="['00:00:00', '23:59:59']" />
|
||||
</el-form-item>
|
||||
<el-form-item label="版本号" prop="version">
|
||||
<el-input v-model="queryParams.version" placeholder="请输入版本号" clearable @keyup.enter.native="handleQuery"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="创建时间" prop="createTime">
|
||||
<el-date-picker v-model="queryParams.createTime" style="width: 240px" value-format="yyyy-MM-dd HH:mm:ss" type="daterange"
|
||||
range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期" :default-time="['00:00:00', '23:59:59']" />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<!-- 操作工具栏 -->
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd"
|
||||
v-hasPermi="['base:equipment-quantity-log:create']">新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport" :loading="exportLoading"
|
||||
v-hasPermi="['base:equipment-quantity-log:export']">导出</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<!-- 列表 -->
|
||||
<el-table v-loading="loading" :data="list">
|
||||
<el-table-column label="id" align="center" prop="id" />
|
||||
<el-table-column label="设备id" align="center" prop="equipmentId" />
|
||||
<el-table-column label="设备名称" align="center" prop="equipmentName" />
|
||||
<el-table-column label="进入设备的数量" align="center" prop="inQuantity" />
|
||||
<el-table-column label="离开设备的数量,若plc只记录一个生产数量,也写入该字段" align="center" prop="outQuantity" />
|
||||
<el-table-column label="正常生产量" align="center" prop="okQuantity" />
|
||||
<el-table-column label="设备上报的报废数量" align="center" prop="nokQuantity" />
|
||||
<el-table-column label="生产数量的记录时间" align="center" prop="recordTime" width="180">
|
||||
<template v-slot="scope">
|
||||
<span>{{ parseTime(scope.row.recordTime) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="版本号" align="center" prop="version" />
|
||||
<el-table-column label="创建时间" align="center" prop="createTime" width="180">
|
||||
<template v-slot="scope">
|
||||
<span>{{ parseTime(scope.row.createTime) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template v-slot="scope">
|
||||
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['base:equipment-quantity-log:update']">修改</el-button>
|
||||
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"
|
||||
v-hasPermi="['base:equipment-quantity-log:delete']">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!-- 分页组件 -->
|
||||
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"/>
|
||||
|
||||
<!-- 对话框(添加 / 修改) -->
|
||||
<el-dialog :title="title" :visible.sync="open" width="500px" v-dialogDrag append-to-body>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||
<el-form-item label="设备id" prop="equipmentId">
|
||||
<el-input v-model="form.equipmentId" placeholder="请输入设备id" />
|
||||
</el-form-item>
|
||||
<el-form-item label="设备名称" prop="equipmentName">
|
||||
<el-input v-model="form.equipmentName" placeholder="请输入设备名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="进入设备的数量" prop="inQuantity">
|
||||
<el-input v-model="form.inQuantity" placeholder="请输入进入设备的数量" />
|
||||
</el-form-item>
|
||||
<el-form-item label="离开设备的数量,若plc只记录一个生产数量,也写入该字段" prop="outQuantity">
|
||||
<el-input v-model="form.outQuantity" placeholder="请输入离开设备的数量,若plc只记录一个生产数量,也写入该字段" />
|
||||
</el-form-item>
|
||||
<el-form-item label="正常生产量" prop="okQuantity">
|
||||
<el-input v-model="form.okQuantity" placeholder="请输入正常生产量" />
|
||||
</el-form-item>
|
||||
<el-form-item label="设备上报的报废数量" prop="nokQuantity">
|
||||
<el-input v-model="form.nokQuantity" placeholder="请输入设备上报的报废数量" />
|
||||
</el-form-item>
|
||||
<el-form-item label="生产数量的记录时间" prop="recordTime">
|
||||
<el-date-picker clearable v-model="form.recordTime" type="date" value-format="timestamp" placeholder="选择生产数量的记录时间" />
|
||||
</el-form-item>
|
||||
<el-form-item label="版本号" prop="version">
|
||||
<el-input v-model="form.version" placeholder="请输入版本号" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { createEquipmentQuantityLog, updateEquipmentQuantityLog, deleteEquipmentQuantityLog, getEquipmentQuantityLog, getEquipmentQuantityLogPage, exportEquipmentQuantityLogExcel } from "@/api/base/equipmentQuantityLog";
|
||||
|
||||
export default {
|
||||
name: "EquipmentQuantityLog",
|
||||
components: {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 导出遮罩层
|
||||
exportLoading: false,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 后端用 设备生产数量统计表(按一定时间段写入)列表
|
||||
list: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNo: 1,
|
||||
pageSize: 10,
|
||||
equipmentId: null,
|
||||
equipmentName: null,
|
||||
inQuantity: null,
|
||||
outQuantity: null,
|
||||
okQuantity: null,
|
||||
nokQuantity: null,
|
||||
recordTime: [],
|
||||
version: null,
|
||||
createTime: [],
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
rules: {
|
||||
equipmentName: [{ required: true, message: "设备名称不能为空", trigger: "blur" }],
|
||||
}
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
/** 查询列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
// 执行查询
|
||||
getEquipmentQuantityLogPage(this.queryParams).then(response => {
|
||||
this.list = response.data.list;
|
||||
this.total = response.data.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
/** 取消按钮 */
|
||||
cancel() {
|
||||
this.open = false;
|
||||
this.reset();
|
||||
},
|
||||
/** 表单重置 */
|
||||
reset() {
|
||||
this.form = {
|
||||
id: undefined,
|
||||
equipmentId: undefined,
|
||||
equipmentName: undefined,
|
||||
inQuantity: undefined,
|
||||
outQuantity: undefined,
|
||||
okQuantity: undefined,
|
||||
nokQuantity: undefined,
|
||||
recordTime: undefined,
|
||||
version: undefined,
|
||||
};
|
||||
this.resetForm("form");
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNo = 1;
|
||||
this.getList();
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.resetForm("queryForm");
|
||||
this.handleQuery();
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.reset();
|
||||
this.open = true;
|
||||
this.title = "添加后端用 设备生产数量统计表(按一定时间段写入)";
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.reset();
|
||||
const id = row.id;
|
||||
getEquipmentQuantityLog(id).then(response => {
|
||||
this.form = response.data;
|
||||
this.open = true;
|
||||
this.title = "修改后端用 设备生产数量统计表(按一定时间段写入)";
|
||||
});
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (!valid) {
|
||||
return;
|
||||
}
|
||||
// 修改的提交
|
||||
if (this.form.id != null) {
|
||||
updateEquipmentQuantityLog(this.form).then(response => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
return;
|
||||
}
|
||||
// 添加的提交
|
||||
createEquipmentQuantityLog(this.form).then(response => {
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
});
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const id = row.id;
|
||||
this.$modal.confirm('是否确认删除后端用 设备生产数量统计表(按一定时间段写入)编号为"' + id + '"的数据项?').then(function() {
|
||||
return deleteEquipmentQuantityLog(id);
|
||||
}).then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => {});
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
// 处理查询参数
|
||||
let params = {...this.queryParams};
|
||||
params.pageNo = undefined;
|
||||
params.pageSize = undefined;
|
||||
this.$modal.confirm('是否确认导出所有后端用 设备生产数量统计表(按一定时间段写入)数据项?').then(() => {
|
||||
this.exportLoading = true;
|
||||
return exportEquipmentQuantityLogExcel(params);
|
||||
}).then(response => {
|
||||
this.$download.excel(response, '后端用 设备生产数量统计表(按一定时间段写入).xls');
|
||||
this.exportLoading = false;
|
||||
}).catch(() => {});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user