Compare commits
35 Commits
392c1ea09b
...
projects/r
| Author | SHA1 | Date | |
|---|---|---|---|
| e6e8e51b59 | |||
|
|
1b56696da9 | ||
| bbd9972761 | |||
| 8e9b2f6444 | |||
| c83a7afadb | |||
| b43876fe67 | |||
| f143c5e2d9 | |||
| 0b03e6d44b | |||
| 19dbe38458 | |||
| 43ba33062b | |||
| ca390fd764 | |||
| 8ad8e3a5b4 | |||
| 6ca512392c | |||
| a73502cda7 | |||
| e32530e459 | |||
| 64e1c1869d | |||
| 93ac1c4742 | |||
| a650f0ad9d | |||
| e237737830 | |||
| 09cce6c613 | |||
| 07dd135daa | |||
| 0757d2d47c | |||
| 4fbe72d314 | |||
| 10219fd841 | |||
| 74a2a3b8e5 | |||
| c3b4223e5b | |||
| 070e01c2c4 | |||
| 2665b6a0b0 | |||
| a71fb90e6a | |||
| ac85c83cf9 | |||
| c2e987aee4 | |||
| 0e4ed597cd | |||
| 3e7914ac91 | |||
| 9c19a6197a | |||
| 074b35b6a6 |
16
.env.dev
16
.env.dev
@@ -1,25 +1,19 @@
|
|||||||
###
|
###
|
||||||
# @Author: Do not edit
|
# @Author: Do not edit
|
||||||
# @Date: 2023-08-29 09:40:39
|
# @Date: 2023-08-29 09:40:39
|
||||||
# @LastEditTime: 2023-10-17 09:51:48
|
# @LastEditTime: 2024-11-25 14:31:39
|
||||||
# @LastEditors: zhp
|
# @LastEditors: zwq
|
||||||
# @Description:
|
# @Description:
|
||||||
###
|
###
|
||||||
# 开发环境配置
|
# 开发环境配置
|
||||||
ENV = 'development'
|
ENV = 'development'
|
||||||
|
|
||||||
# 页面标题
|
# 页面标题
|
||||||
VUE_APP_TITLE = MES系统
|
VUE_APP_TITLE = 智能监控分析系统
|
||||||
|
|
||||||
# 芋道管理系统/开发环境
|
# 芋道管理系统/开发环境
|
||||||
|
# VUE_APP_BASE_API = 'http://192.168.8.22:48080'
|
||||||
VUE_APP_BASE_API = 'http://192.168.0.33:48082'
|
VUE_APP_BASE_API = 'http://172.16.32.79: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
|
VUE_CLI_BABEL_TRANSPILE_MODULES = true
|
||||||
|
|||||||
15
.env.prod
15
.env.prod
@@ -1,15 +1,24 @@
|
|||||||
|
###
|
||||||
|
# @Author: zwq
|
||||||
|
# @Date: 2024-03-27 15:49:55
|
||||||
|
# @LastEditors: zwq
|
||||||
|
# @LastEditTime: 2024-10-30 11:08:47
|
||||||
|
# @Description:
|
||||||
|
###
|
||||||
# 生产环境配置
|
# 生产环境配置
|
||||||
ENV = 'production'
|
ENV = 'production'
|
||||||
|
|
||||||
# 页面标题
|
# 页面标题
|
||||||
VUE_APP_TITLE = 产线监控系统
|
VUE_APP_TITLE = 智能监控分析系统
|
||||||
|
|
||||||
# 芋道管理系统/生产环境
|
# 芋道管理系统/生产环境
|
||||||
VUE_APP_BASE_API = '/prod-api'
|
# VUE_APP_BASE_API = '/prod-api'
|
||||||
|
VUE_APP_BASE_API = ''
|
||||||
|
|
||||||
# 根据服务器或域名修改
|
# 根据服务器或域名修改
|
||||||
# PUBLIC_PATH = 'http://my-pi.com:8888/yudao-admin/'
|
# PUBLIC_PATH = 'http://my-pi.com:8888/yudao-admin/'
|
||||||
PUBLIC_PATH = 'http://192.168.0.33:8888/'
|
# PUBLIC_PATH = 'http://192.168.0.33:8888/'
|
||||||
|
PUBLIC_PATH = ''
|
||||||
|
|
||||||
# 二级部署路径
|
# 二级部署路径
|
||||||
VUE_APP_APP_NAME ='yudao-admin'
|
VUE_APP_APP_NAME ='yudao-admin'
|
||||||
|
|||||||
@@ -6,9 +6,9 @@
|
|||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"local": "vue-cli-service serve --mode local",
|
"local": "vue-cli-service serve --mode local",
|
||||||
"dev": "vue-cli-service serve --mode dev",
|
"dev": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve --mode dev",
|
||||||
"front": "vue-cli-service serve --mode front",
|
"front": "vue-cli-service serve --mode front",
|
||||||
"build:prod": "vue-cli-service build --mode prod",
|
"build:prod": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service build --mode prod",
|
||||||
"build:stage": "vue-cli-service build --mode stage",
|
"build:stage": "vue-cli-service build --mode stage",
|
||||||
"build:dev": "vue-cli-service build --mode dev",
|
"build:dev": "vue-cli-service build --mode dev",
|
||||||
"build:static": "vue-cli-service build --mode static",
|
"build:static": "vue-cli-service build --mode static",
|
||||||
|
|||||||
BIN
public/static/videos/login.webm
Normal file
BIN
public/static/videos/login.webm
Normal file
Binary file not shown.
@@ -1,8 +0,0 @@
|
|||||||
import request from '@/utils/request'
|
|
||||||
// 获得所有客户列表
|
|
||||||
export function getCustomerList() {
|
|
||||||
return request({
|
|
||||||
url: '/base/core-customer/listAll',
|
|
||||||
method: 'get'
|
|
||||||
})
|
|
||||||
}
|
|
||||||
86
src/api/base/energyQuantityManual.js
Normal file
86
src/api/base/energyQuantityManual.js
Normal file
@@ -0,0 +1,86 @@
|
|||||||
|
/*
|
||||||
|
* @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
|
||||||
|
})
|
||||||
|
}
|
||||||
53
src/api/base/equipmentConfig.js
Normal file
53
src/api/base/equipmentConfig.js
Normal file
@@ -0,0 +1,53 @@
|
|||||||
|
/*
|
||||||
|
* @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,3 +1,10 @@
|
|||||||
|
/*
|
||||||
|
* @Author: zwq
|
||||||
|
* @Date: 2024-10-29 09:47:40
|
||||||
|
* @LastEditors: zwq
|
||||||
|
* @LastEditTime: 2025-02-26 16:27:48
|
||||||
|
* @Description:
|
||||||
|
*/
|
||||||
import request from '@/utils/request'
|
import request from '@/utils/request'
|
||||||
|
|
||||||
// 创建实时数据采集配置
|
// 创建实时数据采集配置
|
||||||
@@ -52,3 +59,11 @@ export function exportEquipmentPlcExcel(query) {
|
|||||||
responseType: 'blob'
|
responseType: 'blob'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 获得code
|
||||||
|
export function getCode() {
|
||||||
|
return request({
|
||||||
|
url: '/base/equipment-group/getCode',
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,8 +1,15 @@
|
|||||||
|
/*
|
||||||
|
* @Author: zwq
|
||||||
|
* @Date: 2024-10-29 09:47:40
|
||||||
|
* @LastEditors: zwq
|
||||||
|
* @LastEditTime: 2025-02-12 09:25:11
|
||||||
|
* @Description:
|
||||||
|
*/
|
||||||
import request from '@/utils/request'
|
import request from '@/utils/request'
|
||||||
// 获得工厂产线工段设备树形结构
|
// 获得工厂产线工段设备树形结构
|
||||||
export function getTree() {
|
export function getTree() {
|
||||||
return request({
|
return request({
|
||||||
url: '/base/core-factory/getTree',
|
url: '/base/factory/getTree',
|
||||||
method: 'get'
|
method: 'get'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@@ -51,6 +51,13 @@ export function getCode() {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 获得可用的班次列表
|
||||||
|
export function listClassesEnabled() {
|
||||||
|
return request({
|
||||||
|
url: '/base/group-classes/listEnable',
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
// 导出班次基础信息 Excel
|
// 导出班次基础信息 Excel
|
||||||
export function exportGroupClassesExcel(query) {
|
export function exportGroupClassesExcel(query) {
|
||||||
return request({
|
return request({
|
||||||
|
|||||||
125
src/api/base/groupSchedulingPlan.js
Normal file
125
src/api/base/groupSchedulingPlan.js
Normal file
@@ -0,0 +1,125 @@
|
|||||||
|
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'
|
||||||
|
})
|
||||||
|
}
|
||||||
60
src/api/base/groupSchedulingRule.js
Normal file
60
src/api/base/groupSchedulingRule.js
Normal file
@@ -0,0 +1,60 @@
|
|||||||
|
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,7 +8,14 @@ export function getPreset(query) {
|
|||||||
params: query
|
params: query
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
// 获取某月预排班
|
||||||
|
export function getScheduling(query) {
|
||||||
|
return request({
|
||||||
|
url: '/base/group-team-scheduling/getScheduling',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
})
|
||||||
|
}
|
||||||
// 批量创建-更新排班信息
|
// 批量创建-更新排班信息
|
||||||
export function createOrUpdateList(data) {
|
export function createOrUpdateList(data) {
|
||||||
return request({
|
return request({
|
||||||
@@ -27,11 +34,21 @@ export function autoSet(query) {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// 获得排班信息分页 建议size 150
|
// 获得排班信息分页
|
||||||
export function groupTeamSchedulingPage(query) {
|
export function schedulingPage(query) {
|
||||||
return request({
|
return request({
|
||||||
url: '/base/group-team-scheduling/page',
|
url: '/base/group-team-scheduling/page',
|
||||||
method: 'get',
|
method: 'get',
|
||||||
params: query
|
params: query
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 导出Excel
|
||||||
|
export function exportSchedulingExcel(query) {
|
||||||
|
return request({
|
||||||
|
url: '/base/group-team-scheduling/export-excel',
|
||||||
|
method: 'get',
|
||||||
|
params: query,
|
||||||
|
responseType: 'blob'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|||||||
75
src/api/base/material.js
Normal file
75
src/api/base/material.js
Normal file
@@ -0,0 +1,75 @@
|
|||||||
|
/*
|
||||||
|
* @Author: zwq
|
||||||
|
* @Date: 2024-04-09 16:42:19
|
||||||
|
* @LastEditors: zwq
|
||||||
|
* @LastEditTime: 2024-04-10 14:33:52
|
||||||
|
* @Description:
|
||||||
|
*/
|
||||||
|
import request from '@/utils/request'
|
||||||
|
|
||||||
|
// 创建原料
|
||||||
|
export function createMaterial(data) {
|
||||||
|
return request({
|
||||||
|
url: '/base/material/create',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 更新原料
|
||||||
|
export function updateMaterial(data) {
|
||||||
|
return request({
|
||||||
|
url: '/base/material/update',
|
||||||
|
method: 'put',
|
||||||
|
data: 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,
|
||||||
|
method: 'delete'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获得原料
|
||||||
|
export function getMaterial(id) {
|
||||||
|
return request({
|
||||||
|
url: '/base/material/get?id=' + id,
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获得原料分页
|
||||||
|
export function getMaterialPage(query) {
|
||||||
|
return request({
|
||||||
|
url: '/base/material/page',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 获得原料列表
|
||||||
|
export function getMaterialList() {
|
||||||
|
return request({
|
||||||
|
url: '/base/material/list',
|
||||||
|
method: 'get',
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 导出原料 Excel
|
||||||
|
export function exportMaterialExcel(query) {
|
||||||
|
return request({
|
||||||
|
url: '/base/material/export-excel',
|
||||||
|
method: 'get',
|
||||||
|
params: query,
|
||||||
|
responseType: 'blob'
|
||||||
|
})
|
||||||
|
}
|
||||||
68
src/api/base/materialPricing.js
Normal file
68
src/api/base/materialPricing.js
Normal file
@@ -0,0 +1,68 @@
|
|||||||
|
/*
|
||||||
|
* @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'
|
||||||
|
})
|
||||||
|
}
|
||||||
@@ -1,68 +0,0 @@
|
|||||||
/*
|
|
||||||
* @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'
|
|
||||||
})
|
|
||||||
}
|
|
||||||
@@ -1,44 +0,0 @@
|
|||||||
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'
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
// 获得订单
|
|
||||||
export function getOrderById(query) {
|
|
||||||
return request({
|
|
||||||
url: '/base/order/get',
|
|
||||||
method: 'get',
|
|
||||||
params: query
|
|
||||||
})
|
|
||||||
}
|
|
||||||
@@ -1,92 +0,0 @@
|
|||||||
/*
|
|
||||||
* @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,
|
|
||||||
})
|
|
||||||
}
|
|
||||||
@@ -1,92 +0,0 @@
|
|||||||
/*
|
|
||||||
* @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,
|
|
||||||
})
|
|
||||||
}
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
import request from '@/utils/request'
|
|
||||||
// 获得产品列表
|
|
||||||
export function getProductAll() {
|
|
||||||
return request({
|
|
||||||
url: '/base/core-product/listAll',
|
|
||||||
method: 'get'
|
|
||||||
})
|
|
||||||
}
|
|
||||||
@@ -1,8 +1,23 @@
|
|||||||
|
/*
|
||||||
|
* @Author: zwq
|
||||||
|
* @Date: 2024-03-27 15:49:55
|
||||||
|
* @LastEditors: zwq
|
||||||
|
* @LastEditTime: 2024-09-10 14:36:19
|
||||||
|
* @Description:
|
||||||
|
*/
|
||||||
import request from '@/utils/request'
|
import request from '@/utils/request'
|
||||||
// 获得所有工厂产线列表
|
// 获得所有工厂产线列表
|
||||||
export function getLineAll() {
|
export function getLineAll() {
|
||||||
return request({
|
return request({
|
||||||
url: '/base/core-production-line/listAll',
|
url: '/base/production-line/listAll',
|
||||||
method: 'get'
|
method: 'get'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
// 获得产线分页
|
||||||
|
export function getLinePage(query) {
|
||||||
|
return request({
|
||||||
|
url: '/base/production-line/page',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,8 +0,0 @@
|
|||||||
import request from '@/utils/request'
|
|
||||||
// 获得工单列表
|
|
||||||
export function workOrderList() {
|
|
||||||
return request({
|
|
||||||
url: '/base/core-work-order/listbyfilter',
|
|
||||||
method: 'get'
|
|
||||||
})
|
|
||||||
}
|
|
||||||
@@ -14,4 +14,13 @@ export function getWorker(query) {
|
|||||||
method: 'get',
|
method: 'get',
|
||||||
params: query
|
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() {
|
export function getWorkShopAll() {
|
||||||
return request({
|
return request({
|
||||||
url: '/base/core-workshop-section/listAll',
|
url: '/base/workshop-section/listAll',
|
||||||
method: 'get'
|
method: 'get'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
/*
|
/*
|
||||||
* @Author: zhp
|
* @Author: zhp
|
||||||
* @Date: 2023-09-12 14:07:04
|
* @Date: 2023-09-12 14:07:04
|
||||||
* @LastEditTime: 2023-09-13 09:53:45
|
* @LastEditTime: 2025-01-08 15:47:17
|
||||||
* @LastEditors: zhp
|
* @LastEditors: zwq
|
||||||
* @Description:
|
* @Description:
|
||||||
*/
|
*/
|
||||||
import request from '@/utils/request'
|
import request from '@/utils/request'
|
||||||
@@ -22,3 +22,26 @@ export function getCT(data) {
|
|||||||
data: 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,3 +58,12 @@ export function exportFactoryExcel(query) {
|
|||||||
responseType: 'blob'
|
responseType: 'blob'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
// 获取产线设备状态
|
||||||
|
export function getLineEqStatus(data) {
|
||||||
|
return request({
|
||||||
|
url: '/base/production-line/getLineEqStatus',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|||||||
28
src/api/core/base/lineBindProcess.js
Normal file
28
src/api/core/base/lineBindProcess.js
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
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,6 +16,14 @@ export function switchLineBindProduct(data) {
|
|||||||
data: data
|
data: data
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
// 切换产线是否可以自动
|
||||||
|
export function switchAutoProduct(data) {
|
||||||
|
return request({
|
||||||
|
url: '/base/line-bind-product/switchAuto',
|
||||||
|
method: 'put',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
// 更新产线目前生产产品表 主要为更新
|
// 更新产线目前生产产品表 主要为更新
|
||||||
export function updateLineBindProduct(data) {
|
export function updateLineBindProduct(data) {
|
||||||
return request({
|
return request({
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
/*
|
/*
|
||||||
* @Author: Do not edit
|
* @Author: Do not edit
|
||||||
* @Date: 2023-09-12 09:44:53
|
* @Date: 2023-09-12 09:44:53
|
||||||
* @LastEditTime: 2023-09-13 16:11:41
|
* @LastEditTime: 2025-01-07 09:57:36
|
||||||
* @LastEditors: DY
|
* @LastEditors: zwq
|
||||||
* @Description:
|
* @Description:
|
||||||
*/
|
*/
|
||||||
import request from '@/utils/request'
|
import request from '@/utils/request'
|
||||||
|
|
||||||
@@ -17,9 +17,52 @@ export function getPdlAutoReport(data) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 获得所有工厂产线列表
|
// 获得所有工厂产线列表
|
||||||
export function getPdList() {
|
export function getPdList(id) {
|
||||||
return request({
|
return request({
|
||||||
url: '/base/production-line/listAll',
|
url: '/base/production-line/listAll' + (id ? '?id=' + id : ''),
|
||||||
method: 'get'
|
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
|
* @Author: Do not edit
|
||||||
* @Date: 2023-09-12 09:44:53
|
* @Date: 2023-09-12 09:44:53
|
||||||
* @LastEditTime: 2023-09-14 10:25:46
|
* @LastEditTime: 2025-03-03 10:43:34
|
||||||
* @LastEditors: DY
|
* @LastEditors: zwq
|
||||||
* @Description:
|
* @Description:
|
||||||
*/
|
*/
|
||||||
import request from '@/utils/request'
|
import request from '@/utils/request'
|
||||||
|
|
||||||
@@ -22,4 +22,22 @@ export function getPdList() {
|
|||||||
url: '/base/production-line/listAll',
|
url: '/base/production-line/listAll',
|
||||||
method: 'get'
|
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,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|||||||
54
src/api/cost/allCost.js
Normal file
54
src/api/cost/allCost.js
Normal file
@@ -0,0 +1,54 @@
|
|||||||
|
/*
|
||||||
|
* @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'
|
||||||
|
})
|
||||||
|
}
|
||||||
55
src/api/cost/costDeepRatioHis.js
Normal file
55
src/api/cost/costDeepRatioHis.js
Normal file
@@ -0,0 +1,55 @@
|
|||||||
|
/*
|
||||||
|
* @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'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
53
src/api/cost/costEnergy.js
Normal file
53
src/api/cost/costEnergy.js
Normal file
@@ -0,0 +1,53 @@
|
|||||||
|
/*
|
||||||
|
* @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'
|
||||||
|
})
|
||||||
|
}
|
||||||
54
src/api/cost/costEnergyDeep.js
Normal file
54
src/api/cost/costEnergyDeep.js
Normal file
@@ -0,0 +1,54 @@
|
|||||||
|
/*
|
||||||
|
* @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'
|
||||||
|
})
|
||||||
|
}
|
||||||
54
src/api/cost/costMaterial.js
Normal file
54
src/api/cost/costMaterial.js
Normal file
@@ -0,0 +1,54 @@
|
|||||||
|
/*
|
||||||
|
* @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'
|
||||||
|
})
|
||||||
|
}
|
||||||
36
src/api/cost/costOriginRatioHis.js
Normal file
36
src/api/cost/costOriginRatioHis.js
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
/*
|
||||||
|
* @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'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
53
src/api/cost/costOthercostHis.js
Normal file
53
src/api/cost/costOthercostHis.js
Normal file
@@ -0,0 +1,53 @@
|
|||||||
|
/*
|
||||||
|
* @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'
|
||||||
|
})
|
||||||
|
}
|
||||||
53
src/api/cost/costOthercostHisDeep.js
Normal file
53
src/api/cost/costOthercostHisDeep.js
Normal file
@@ -0,0 +1,53 @@
|
|||||||
|
/*
|
||||||
|
* @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'
|
||||||
|
})
|
||||||
|
}
|
||||||
68
src/api/cost/costOthercostLog.js
Normal file
68
src/api/cost/costOthercostLog.js
Normal file
@@ -0,0 +1,68 @@
|
|||||||
|
/*
|
||||||
|
* @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'
|
||||||
|
})
|
||||||
|
}
|
||||||
68
src/api/cost/costOthercostLogDeep.js
Normal file
68
src/api/cost/costOthercostLogDeep.js
Normal file
@@ -0,0 +1,68 @@
|
|||||||
|
/*
|
||||||
|
* @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'
|
||||||
|
})
|
||||||
|
}
|
||||||
53
src/api/cost/deepCostStatistics.js
Normal file
53
src/api/cost/deepCostStatistics.js
Normal file
@@ -0,0 +1,53 @@
|
|||||||
|
/*
|
||||||
|
* @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'
|
||||||
|
})
|
||||||
|
}
|
||||||
68
src/api/cost/deepOthercostRule.js
Normal file
68
src/api/cost/deepOthercostRule.js
Normal file
@@ -0,0 +1,68 @@
|
|||||||
|
/*
|
||||||
|
* @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'
|
||||||
|
})
|
||||||
|
}
|
||||||
54
src/api/cost/rawCostStatistics.js
Normal file
54
src/api/cost/rawCostStatistics.js
Normal file
@@ -0,0 +1,54 @@
|
|||||||
|
/*
|
||||||
|
* @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'
|
||||||
|
})
|
||||||
|
}
|
||||||
68
src/api/cost/rawOthercostRule.js
Normal file
68
src/api/cost/rawOthercostRule.js
Normal file
@@ -0,0 +1,68 @@
|
|||||||
|
/*
|
||||||
|
* @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'
|
||||||
|
})
|
||||||
|
}
|
||||||
18
src/api/material/issue.js
Normal file
18
src/api/material/issue.js
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
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,6 +43,14 @@ export function getEnergyOverlimitLogPage(data) {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 获得手动抄表记录分页
|
||||||
|
export function getEnergyManualLogPage(data) {
|
||||||
|
return request({
|
||||||
|
url: '/monitoring/energy-overlimit-log/pageManual',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
// 导出能源超限记录 Excel
|
// 导出能源超限记录 Excel
|
||||||
export function exportEnergyOverlimitLogExcel(query) {
|
export function exportEnergyOverlimitLogExcel(query) {
|
||||||
return request({
|
return request({
|
||||||
|
|||||||
@@ -1,27 +0,0 @@
|
|||||||
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
|
|
||||||
})
|
|
||||||
}
|
|
||||||
@@ -1,19 +0,0 @@
|
|||||||
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
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
45
src/api/order/index.js
Normal file
45
src/api/order/index.js
Normal file
@@ -0,0 +1,45 @@
|
|||||||
|
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'
|
||||||
|
})
|
||||||
|
}
|
||||||
14
src/assets/icons/svg/icon-upload.svg
Normal file
14
src/assets/icons/svg/icon-upload.svg
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
<?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">
|
||||||
|
<title>上传</title>
|
||||||
|
<g id="组件" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" opacity="0.65">
|
||||||
|
<g id="上传_Resources/Button" transform="translate(-12.000000, -9.000000)">
|
||||||
|
<g id="上传" transform="translate(12.000000, 9.000000)">
|
||||||
|
<g id="upload" transform="translate(0.875000, 0.875000)" fill="currentColor" fill-rule="nonzero">
|
||||||
|
<path d="M5.80371094,0.138085937 C5.8953125,0.046484375 6.01699219,0 6.13867188,0 C6.26035156,0 6.38066406,0.046484375 6.47363281,0.138085937 L8.60371094,2.26953125 C8.78828125,2.45410156 8.78828125,2.75351562 8.60371094,2.93808594 C8.51484375,3.02695312 8.39589844,3.07617188 8.27011719,3.07617188 C8.14433594,3.07617188 8.02539062,3.02695312 7.93652344,2.93808594 L6.61171875,1.61328125 L6.61171875,9.51289062 C6.61171875,9.77402344 6.39980469,9.9859375 6.13867188,9.9859375 C5.87753906,9.9859375 5.665625,9.77402344 5.665625,9.51289062 L5.665625,1.61328125 L4.34082031,2.93808594 C4.15625,3.12265625 3.85683594,3.12265625 3.67363281,2.93808594 C3.4890625,2.75351562 3.4890625,2.45410156 3.67226563,2.26953125 L5.80371094,0.138085937 Z M11.7769531,7.88046875 C11.5158203,7.88046875 11.3039063,8.09238281 11.3039063,8.35351563 L11.3039063,11.025 C11.3039063,11.1794922 11.178125,11.3066406 11.0222656,11.3066406 L1.22636719,11.3066406 C1.071875,11.3066406 0.944726562,11.1808594 0.944726562,11.025 L0.944726562,8.35214844 C0.944726562,8.09101563 0.7328125,7.87910156 0.471679688,7.87910156 C0.210546875,7.87910156 0,8.09238281 0,8.35214844 L0,11.3996094 C0,11.8685547 0.381445313,12.2486328 0.849023437,12.2486328 L11.4009766,12.2486328 C11.8699219,12.2486328 12.25,11.8671875 12.25,11.3996094 L12.25,8.35214844 C12.25,8.09238281 12.0380859,7.88046875 11.7769531,7.88046875 Z" id="Shape"></path>
|
||||||
|
</g>
|
||||||
|
<rect id="Rectangle-49" x="0" y="0" width="14" height="14"></rect>
|
||||||
|
</g>
|
||||||
|
</g>
|
||||||
|
</g>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 2.1 KiB |
BIN
src/assets/images/login-bg.png
Normal file
BIN
src/assets/images/login-bg.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 137 KiB |
BIN
src/assets/logo/cnbm.png
Normal file
BIN
src/assets/logo/cnbm.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.9 KiB |
@@ -1,10 +1,13 @@
|
|||||||
/* ===== PC DESIGN ===== */
|
/* ===== PC DESIGN ===== */
|
||||||
$W: 1000;
|
$W: 1080;
|
||||||
$H: 1920;
|
$H: 1920;
|
||||||
$picW: 438;
|
// $picW: 438;
|
||||||
$picH: 560;
|
// $picH: 560;
|
||||||
$formW: 320;
|
$picW: 1080;
|
||||||
|
$picH: 1118;
|
||||||
|
$formW: 420;
|
||||||
$tabW: $formW / 2;
|
$tabW: $formW / 2;
|
||||||
|
// $rowH: 56;
|
||||||
$rowH: 56;
|
$rowH: 56;
|
||||||
$buttonH: 50;
|
$buttonH: 50;
|
||||||
|
|
||||||
@@ -15,6 +18,7 @@ $containerBgImage: '../assets/images/bg.png';
|
|||||||
$logoWidth: 417px;
|
$logoWidth: 417px;
|
||||||
$logoHeight: 64px;
|
$logoHeight: 64px;
|
||||||
$logoImage: '../assets/logo/login-logo.png';
|
$logoImage: '../assets/logo/login-logo.png';
|
||||||
|
$cnbmLogo: '../assets/logo/cnbm.png';
|
||||||
// container-content
|
// container-content
|
||||||
$contentWidth: round($W / $H * 100) * 1vw;
|
$contentWidth: round($W / $H * 100) * 1vw;
|
||||||
$contentHeight: round($picH / $W * 100) / 100 * $contentWidth;
|
$contentHeight: round($picH / $W * 100) / 100 * $contentWidth;
|
||||||
@@ -22,7 +26,8 @@ $contentBgColor: #ffffff;
|
|||||||
// container-content-pic
|
// container-content-pic
|
||||||
$picWidth: round($picW / $H * 100) * 1vw;
|
$picWidth: round($picW / $H * 100) * 1vw;
|
||||||
$picHeight: inherit;
|
$picHeight: inherit;
|
||||||
$picImage: '../assets/images/pic.png';
|
// $picImage: '../assets/images/pic.png';
|
||||||
|
$picImage: '../assets/images/login-bg.png';
|
||||||
// container-content-field
|
// container-content-field
|
||||||
$fieldWidth: $contentWidth - $picWidth;
|
$fieldWidth: $contentWidth - $picWidth;
|
||||||
$fieldHeight: inherit;
|
$fieldHeight: inherit;
|
||||||
@@ -34,231 +39,310 @@ $buttonHeight: $buttonH * 1px;
|
|||||||
|
|
||||||
// - - - - - 页面基础设置
|
// - - - - - 页面基础设置
|
||||||
.container {
|
.container {
|
||||||
.login-code {
|
.login-code {
|
||||||
width: 33%;
|
width: 33%;
|
||||||
height: 38px;
|
height: 38px;
|
||||||
float: right;
|
float: right;
|
||||||
img {
|
img {
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
width:100%;max-width:100px; height:auto;
|
width: 100%;
|
||||||
vertical-align: middle;
|
max-width: 100px;
|
||||||
}
|
height: auto;
|
||||||
}
|
vertical-align: middle;
|
||||||
// 元素
|
}
|
||||||
width: inherit;
|
}
|
||||||
height: inherit;
|
// 元素
|
||||||
min-width: 1080px;
|
width: inherit;
|
||||||
min-height: 620px;
|
height: inherit;
|
||||||
background-color: $containerBgColor;
|
min-width: 1080px;
|
||||||
background-image: url($containerBgImage);
|
min-height: 620px;
|
||||||
background-size: cover;
|
background-color: $containerBgColor;
|
||||||
// 定位
|
// background-image: url($containerBgImage);
|
||||||
position: relative;
|
background-size: cover;
|
||||||
display: flex;
|
// 定位
|
||||||
justify-content: center;
|
position: relative;
|
||||||
align-items: center;
|
display: flex;
|
||||||
// 文字
|
justify-content: center;
|
||||||
font-size: 14px;
|
align-items: center;
|
||||||
font-family: Microsoft YaHei;
|
// 文字
|
||||||
font-weight: 400;
|
font-size: 14px;
|
||||||
.logo {
|
font-family: Microsoft YaHei;
|
||||||
// 元素
|
font-weight: 400;
|
||||||
width: $logoWidth;
|
.logo {
|
||||||
height: $logoHeight;
|
// 元素
|
||||||
// background-image: url($logoImage);
|
width: $logoWidth;
|
||||||
// background-size: contain;
|
height: $logoHeight;
|
||||||
// 定位
|
// background-image: url($logoImage);
|
||||||
position: absolute;
|
// background-size: contain;
|
||||||
top: 50px;
|
// 定位
|
||||||
left: 50%;
|
position: absolute;
|
||||||
margin-left: -$logoWidth/2;
|
top: 50px;
|
||||||
}
|
left: 50%;
|
||||||
.content {
|
margin-left: -$logoWidth/2;
|
||||||
// 元素
|
}
|
||||||
width: $contentWidth;
|
.content {
|
||||||
height: $contentHeight;
|
// 元素
|
||||||
background-color: #ffffff;
|
// width: $contentWidth;
|
||||||
box-shadow: 0px 16px 40px rgba(0, 0, 0, 0.07);
|
// height: $contentHeight;
|
||||||
border-radius: 20px;
|
width: 100%;
|
||||||
// 定位
|
height: 100%;
|
||||||
position: relative;
|
background-color: #ffffff;
|
||||||
.pic {
|
// box-shadow: 0px 16px 40px rgba(0, 0, 0, 0.07);
|
||||||
// 元素
|
// border-radius: 20px;
|
||||||
width: $picWidth;
|
// 定位
|
||||||
height: $picHeight;
|
position: relative;
|
||||||
background-image: url($picImage);
|
display: flex;
|
||||||
background-repeat: no-repeat;
|
|
||||||
background-size: cover;
|
.pic {
|
||||||
border-radius: 20px 0 0 20px;
|
// 元素
|
||||||
// 定位
|
width: $picWidth;
|
||||||
position: absolute;
|
height: $picHeight;
|
||||||
top: 0;
|
background-image: url($picImage);
|
||||||
left: 0;
|
background-repeat: no-repeat;
|
||||||
}
|
background-size: 100% 100%;
|
||||||
.field {
|
background-position: 0 0;
|
||||||
width: $fieldWidth;
|
position: relative;
|
||||||
height: $fieldHeight;
|
|
||||||
// 定位
|
&::after {
|
||||||
position: absolute;
|
content: '';
|
||||||
top: 0;
|
position: absolute;
|
||||||
left: $picWidth;
|
top: 0;
|
||||||
display:flex;
|
left: 0;
|
||||||
justify-content: center;
|
width: 100%;
|
||||||
align-items: center;
|
height: 100%;
|
||||||
.pc-title{ width: 100%; clear: both;}
|
// background: #f003;
|
||||||
.mobile-title,
|
display: inline-block;
|
||||||
.mobile-switch {
|
}
|
||||||
display: none;
|
}
|
||||||
}
|
.field {
|
||||||
.form {
|
// background: #ccc3;
|
||||||
box-sizing: border-box;
|
position: relative;
|
||||||
width: $formWidth;
|
padding-top: 196px;
|
||||||
// - - - tab
|
flex: 1;
|
||||||
:deep(.el-tabs__content) {
|
display: flex;
|
||||||
padding: 20px 0 0;
|
flex-direction: column;
|
||||||
}
|
// justify-content: center;
|
||||||
:deep(.el-tabs__item) {
|
align-items: center;
|
||||||
// 元素
|
.pc-title {
|
||||||
width: $tabWidth;
|
width: 100%;
|
||||||
height: $rowHeight;
|
text-align: center;
|
||||||
padding: 0;
|
clear: both;
|
||||||
// 文字
|
position: relative;
|
||||||
line-height: $rowHeight;
|
top: -36px;
|
||||||
color: #666666;
|
|
||||||
}
|
// h3.title {
|
||||||
:deep(.el-tabs__item.is-active) {
|
// position: relative;
|
||||||
font-weight: bold;
|
|
||||||
color: #2F53EB;
|
// &::before {
|
||||||
}
|
// content: '';
|
||||||
:deep(.el-tabs__active-bar) {
|
// background: url($cnbmLogo) 100% / 100% no-repeat;
|
||||||
height: 3px;
|
// height: 48px;
|
||||||
border-radius: 2px;
|
// width: 48px;
|
||||||
}
|
// position: absolute;
|
||||||
// - - - input
|
// left: 0px;
|
||||||
:deep(.el-input__inner) {
|
// top: 4px;
|
||||||
// 元素
|
// display: inline-block;
|
||||||
width: 100%;
|
// }
|
||||||
height: $rowHeight;
|
// }
|
||||||
background: #f5f5f5;
|
}
|
||||||
border: 0;
|
.mobile-title,
|
||||||
border-radius: 28px;
|
.mobile-switch {
|
||||||
// 文字
|
display: none;
|
||||||
text-align: center;
|
}
|
||||||
line-height: 19px;
|
.form {
|
||||||
color: #262626;
|
margin-top: 32px;
|
||||||
}
|
box-sizing: border-box;
|
||||||
.code:deep(.el-input__inner) {
|
// width: $formWidth;
|
||||||
padding: 0 24px;
|
width: 100%;
|
||||||
// 文字
|
// - - - tab
|
||||||
text-align: left;
|
:deep(.el-tabs__nav) {
|
||||||
}
|
// background: #f0f3;
|
||||||
:deep(.el-input__inner::-webkit-input-placeholder) { /* WebKit browsers */
|
}
|
||||||
font-weight: 400;
|
:deep(.el-tabs__content) {
|
||||||
color: #8C8C8C;
|
padding: 20px 0 0;
|
||||||
}
|
}
|
||||||
:deep(.el-input__inner:-moz-placeholder) { /* Mozilla Firefox 4 to 18 */
|
:deep(.el-tabs__item) {
|
||||||
font-weight: 400;
|
user-select: none;
|
||||||
color: #8C8C8C;
|
// 元素
|
||||||
}
|
width: $tabWidth;
|
||||||
:deep(.el-input__inner::-moz-placeholder) { /* Mozilla Firefox 19+ */
|
height: $rowHeight;
|
||||||
font-weight: 400;
|
padding: 0;
|
||||||
color: #8C8C8C;
|
// 文字
|
||||||
opacity:1;
|
line-height: $rowHeight;
|
||||||
}
|
color: #666666;
|
||||||
:deep(.el-input__inner:-ms-input-placeholder) { /* Internet Explorer 10+ */
|
font-size: 18px;
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
color: #8C8C8C !important;
|
text-align: center;
|
||||||
}
|
}
|
||||||
:deep(.el-form-item) {
|
:deep(.el-tabs__item.is-active) {
|
||||||
position: relative;
|
font-weight: 500;
|
||||||
.button-code {
|
color: #2f53eb;
|
||||||
// 元素
|
}
|
||||||
height: $rowHeight;
|
:deep(.el-tabs__active-bar) {
|
||||||
box-sizing: border-box;
|
height: 3px;
|
||||||
// 定位
|
border-radius: 2px;
|
||||||
position: absolute;
|
}
|
||||||
top: 0;
|
// - - - input
|
||||||
right: 20px;
|
:deep(.el-input__inner) {
|
||||||
z-index: 1;
|
// 元素
|
||||||
// 文字
|
width: 100%;
|
||||||
line-height: 20px;
|
height: $rowHeight;
|
||||||
font-size: 14px;
|
background: #f5f5f5;
|
||||||
font-family: PingFang SC;
|
border: 0;
|
||||||
font-weight: 400;
|
border-radius: 28px;
|
||||||
color: #2F53EB;
|
// 文字
|
||||||
span {
|
text-align: center;
|
||||||
padding-left: 15px;
|
line-height: 19px;
|
||||||
border-left: 2px solid #D9D9D9;
|
color: #262626;
|
||||||
}
|
}
|
||||||
}
|
.code:deep(.el-input__inner) {
|
||||||
}
|
padding: 0 24px;
|
||||||
:deep(.el-form-item__error) {
|
// 文字
|
||||||
padding-left: 24px;
|
text-align: left;
|
||||||
}
|
}
|
||||||
.button {
|
:deep(.el-input__inner::-webkit-input-placeholder) {
|
||||||
width: 100%;
|
/* WebKit browsers */
|
||||||
height: $buttonHeight;
|
font-weight: 400;
|
||||||
background: rgba(24, 144, 255, 0.2);
|
color: #8c8c8c;
|
||||||
border: 0;
|
}
|
||||||
border-radius: 24px;
|
:deep(.el-input__inner:-moz-placeholder) {
|
||||||
margin-bottom: 20px;
|
/* Mozilla Firefox 4 to 18 */
|
||||||
// 文字
|
font-weight: 400;
|
||||||
line-height: 26px;
|
color: #8c8c8c;
|
||||||
font-size: 20px;
|
}
|
||||||
color: #FFFFFF;
|
:deep(.el-input__inner::-moz-placeholder) {
|
||||||
}
|
/* Mozilla Firefox 19+ */
|
||||||
.button-active {
|
font-weight: 400;
|
||||||
background: #2F53EB;
|
color: #8c8c8c;
|
||||||
box-shadow: 0px 2px 8px rgba(0, 80, 184, 0.2);
|
opacity: 1;
|
||||||
}
|
}
|
||||||
}
|
:deep(.el-input__inner:-ms-input-placeholder) {
|
||||||
}
|
/* Internet Explorer 10+ */
|
||||||
}
|
font-weight: 400;
|
||||||
.footer {
|
color: #8c8c8c !important;
|
||||||
// 元素
|
}
|
||||||
height: 16px;
|
:deep(.el-form-item) {
|
||||||
line-height: 16px;
|
position: relative;
|
||||||
font-size: 12px;
|
.button-code {
|
||||||
color: #8c8c8c;
|
// 元素
|
||||||
// 定位
|
height: $rowHeight;
|
||||||
position: absolute;
|
box-sizing: border-box;
|
||||||
bottom: 30px;
|
// 定位
|
||||||
a,
|
position: absolute;
|
||||||
a:hover,
|
top: 0;
|
||||||
a:active {
|
right: 20px;
|
||||||
color: inherit;
|
z-index: 1;
|
||||||
text-decoration: none;
|
// 文字
|
||||||
}
|
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;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// - - - - - PC 最小尺寸设置
|
// - - - - - PC 最小尺寸设置
|
||||||
@media screen and (min-width: 599px) and (max-width: 1366px) {
|
@media screen and (min-width: 599px) and (max-width: 1366px) {
|
||||||
.container {
|
.container {
|
||||||
.content {
|
min-width: 599px;
|
||||||
width: 710px;
|
.content {
|
||||||
height: 397px;
|
// width: 710px;
|
||||||
.pic {
|
// height: 397px;
|
||||||
width: 314px;
|
width: 100%;
|
||||||
}
|
height: 100%;
|
||||||
.field {
|
.pic {
|
||||||
width: calc(710px - 314px);
|
// width: 314px;
|
||||||
left: 314px;
|
display: none;
|
||||||
.form {
|
}
|
||||||
width: 320px;
|
.field {
|
||||||
:deep(.el-input__inner) {
|
// width: calc(710px - 314px);
|
||||||
width: 320px;
|
// left: 314px;
|
||||||
height: 56px;
|
// justify-content: center;
|
||||||
}
|
width: 100%;
|
||||||
.button {
|
|
||||||
height: 50px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
.pc-title {
|
||||||
|
h3 {
|
||||||
|
font-size: 2.4rem !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.form {
|
||||||
|
// width: 320px;
|
||||||
|
:deep(.el-input__inner) {
|
||||||
|
width: 320px;
|
||||||
|
height: 56px;
|
||||||
|
}
|
||||||
|
.button {
|
||||||
|
height: 50px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* ===== MOBILE DESIGN ===== */
|
/* ===== MOBILE DESIGN ===== */
|
||||||
$mobileW: 375;
|
$mobileW: 375;
|
||||||
@@ -273,115 +357,142 @@ $mobileButtonH: 48;
|
|||||||
$mobileContainerBgImage: '../assets/images/bg-mobile.png';
|
$mobileContainerBgImage: '../assets/images/bg-mobile.png';
|
||||||
// container-content
|
// container-content
|
||||||
$mobileContentWidth: round($mobileContentW / $mobileW * 100) * 1vw;
|
$mobileContentWidth: round($mobileContentW / $mobileW * 100) * 1vw;
|
||||||
$mobileContentHeight: round($mobileContentH / $mobileW * 100) / 100 * $mobileContentWidth;
|
$mobileContentHeight: round($mobileContentH / $mobileW * 100) / 100 *
|
||||||
|
$mobileContentWidth;
|
||||||
// container-content-field-form
|
// container-content-field-form
|
||||||
$mobileFormWidth: round($mobileFormW / $mobileW *100) * 1vw;
|
$mobileFormWidth: round($mobileFormW / $mobileW * 100) * 1vw;
|
||||||
$mobileRowHeight: $mobileRowH * 1px;
|
$mobileRowHeight: $mobileRowH * 1px;
|
||||||
$mobileButtonHeight: $mobileButtonH * 1px;
|
$mobileButtonHeight: $mobileButtonH * 1px;
|
||||||
$iconBgImage: '../assets/images/icon.png';
|
$iconBgImage: '../assets/images/icon.png';
|
||||||
|
|
||||||
// - - - - - 移动端设置
|
// - - - - - 移动端设置
|
||||||
@media screen and (max-width: 599px) {
|
@media screen and (max-width: 599px) {
|
||||||
.container {
|
.container {
|
||||||
// 元素
|
// 元素
|
||||||
background-image: url($mobileContainerBgImage);
|
background-image: url($mobileContainerBgImage);
|
||||||
min-width: 280px;
|
min-width: 280px;
|
||||||
min-height: 568px;
|
min-height: 568px;
|
||||||
// 文字
|
// 文字
|
||||||
font-size: 17px;
|
font-size: 14px;
|
||||||
font-family: PingFang SC;
|
font-family: PingFang SC;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
.logo {
|
.logo {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.content {
|
.pc-title {
|
||||||
// 元素
|
display: none;
|
||||||
width: $mobileContentWidth;
|
}
|
||||||
height: $mobileContentHeight;
|
|
||||||
min-width: 250px;
|
.content {
|
||||||
min-height: 340px;
|
// 元素
|
||||||
// 定位
|
width: $mobileContentWidth;
|
||||||
display: flex;
|
height: $mobileContentHeight;
|
||||||
justify-content: center;
|
min-width: 250px;
|
||||||
align-items: center;
|
min-height: 340px;
|
||||||
.pic {
|
// 定位
|
||||||
display: none;
|
display: flex;
|
||||||
}
|
justify-content: center;
|
||||||
.field {
|
align-items: center;
|
||||||
// 元素
|
.pic {
|
||||||
width: inherit;
|
display: none;
|
||||||
min-height: inherit;
|
}
|
||||||
// 定位
|
.field {
|
||||||
left: 0;
|
padding: 0;
|
||||||
display: flex;
|
// 元素
|
||||||
flex-direction: column;
|
width: inherit;
|
||||||
.mobile-title {
|
min-height: inherit;
|
||||||
// 元素
|
// 定位
|
||||||
margin: 0 0 20px;
|
left: 0;
|
||||||
display: block;
|
display: flex;
|
||||||
}
|
flex-direction: column;
|
||||||
.form {
|
|
||||||
width: $mobileFormWidth;
|
.mobile-title {
|
||||||
// - - - tab
|
// 元素
|
||||||
:deep(.el-tabs__header) {
|
margin: 0;
|
||||||
display: none;
|
display: block;
|
||||||
}
|
}
|
||||||
:deep(.el-tabs__content) {
|
|
||||||
padding: 0;
|
.form {
|
||||||
}
|
|
||||||
// - - - 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;
|
margin: 0;
|
||||||
.icon {
|
width: $mobileFormWidth;
|
||||||
width: 14px;
|
// - - - tab
|
||||||
height: 14px;
|
:deep(.el-tabs__header) {
|
||||||
display: inline-block;
|
display: none;
|
||||||
background-image: url($iconBgImage);
|
}
|
||||||
background-size: cover;
|
:deep(.el-tabs__content) {
|
||||||
}
|
padding: 0;
|
||||||
}
|
}
|
||||||
.mobile-switch:hover {
|
// - - - input
|
||||||
cursor: pointer;
|
:deep(.el-input__inner) {
|
||||||
}
|
height: $mobileRowHeight;
|
||||||
}
|
line-height: 24px;
|
||||||
}
|
// 文字
|
||||||
.footer {
|
text-align: center;
|
||||||
// 元素
|
color: #262626;
|
||||||
font-size: 12px;
|
}
|
||||||
font-family: PingFang SC;
|
:deep(.el-form-item) {
|
||||||
font-weight: 400;
|
.button-code {
|
||||||
line-height: 17px;
|
// 元素
|
||||||
color: #333333;
|
height: $mobileRowHeight;
|
||||||
opacity: 0.6;
|
}
|
||||||
// 定位
|
}
|
||||||
position: absolute;
|
.button {
|
||||||
bottom: 20px;
|
height: $mobileButtonHeight;
|
||||||
}
|
line-height: 24px;
|
||||||
}
|
color: #ffffff;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.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;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
141
src/components/ButtonNav/index.vue
Normal file
141
src/components/ButtonNav/index.vue
Normal file
@@ -0,0 +1,141 @@
|
|||||||
|
<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
|
filename: dialogForm.vue
|
||||||
author: liubin
|
author: liubin
|
||||||
date: 2023-08-15 10:32:36
|
date: 2023-08-15 10:32:36
|
||||||
@@ -83,18 +83,22 @@
|
|||||||
:on-success="handleUploadSuccess"
|
:on-success="handleUploadSuccess"
|
||||||
v-bind="col.bind">
|
v-bind="col.bind">
|
||||||
<el-button size="mini" :disabled="col.bind?.disabled || false">
|
<el-button size="mini" :disabled="col.bind?.disabled || false">
|
||||||
|
<svg-icon
|
||||||
|
icon-class="icon-upload"
|
||||||
|
style="color: inherit"></svg-icon>
|
||||||
上传文件
|
上传文件
|
||||||
</el-button>
|
</el-button>
|
||||||
<div class="el-upload__tip" slot="tip" v-if="col.uploadTips">
|
<div class="el-upload__tip" slot="tip" v-if="col.uploadTips">
|
||||||
{{ col.uploadTips || '只能上传jpg/png文件, 大小不超过2MB' }}
|
{{ col.uploadTips || '只能上传jpg/png文件, 大小不超过2MB' }}
|
||||||
</div>
|
</div>
|
||||||
</el-upload>
|
</el-upload>
|
||||||
|
|
||||||
<uploadedFile
|
<uploadedFile
|
||||||
class="file"
|
class="file"
|
||||||
v-for="file in form[col.prop] || []"
|
v-for="file in form[col.prop] || []"
|
||||||
:file="file"
|
:file="file"
|
||||||
@delete="handleDeleteFile(file)" />
|
:key="file.fileUrl"
|
||||||
|
@delete="handleDeleteFile(file)"
|
||||||
|
@Preview="handlePreview(file)" />
|
||||||
</div>
|
</div>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
@@ -132,9 +136,11 @@ const uploadedFile = {
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
handleDelete() {
|
handleDelete() {
|
||||||
console.log('emit delete event')
|
|
||||||
this.$emit('delete', this.file);
|
this.$emit('delete', this.file);
|
||||||
},
|
},
|
||||||
|
handlePreview() {
|
||||||
|
this.$emit('Preview', this.file);
|
||||||
|
},
|
||||||
},
|
},
|
||||||
mounted() {},
|
mounted() {},
|
||||||
render: function (h) {
|
render: function (h) {
|
||||||
@@ -153,7 +159,7 @@ const uploadedFile = {
|
|||||||
cursor: 'pointer',
|
cursor: 'pointer',
|
||||||
display: 'inline-block',
|
display: 'inline-block',
|
||||||
}}>
|
}}>
|
||||||
{this.file.fileName}
|
<el-button onClick={this.handlePreview}>{this.file.fileName}</el-button>
|
||||||
<el-button
|
<el-button
|
||||||
type="text"
|
type="text"
|
||||||
icon="el-icon-close"
|
icon="el-icon-close"
|
||||||
@@ -187,6 +193,10 @@ export default {
|
|||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: false,
|
default: false,
|
||||||
},
|
},
|
||||||
|
hasFile: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false,
|
||||||
|
},
|
||||||
labelPosition: {
|
labelPosition: {
|
||||||
type: String,
|
type: String,
|
||||||
default: 'right',
|
default: 'right',
|
||||||
@@ -219,7 +229,6 @@ export default {
|
|||||||
watch: {
|
watch: {
|
||||||
rows: {
|
rows: {
|
||||||
handler() {
|
handler() {
|
||||||
console.log('watch triggered!');
|
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
this.handleOptions('watch');
|
this.handleOptions('watch');
|
||||||
});
|
});
|
||||||
@@ -230,6 +239,9 @@ export default {
|
|||||||
dataForm: {
|
dataForm: {
|
||||||
handler(val) {
|
handler(val) {
|
||||||
this.form = JSON.parse(JSON.stringify(val));
|
this.form = JSON.parse(JSON.stringify(val));
|
||||||
|
if (this.hasFile) {
|
||||||
|
this.form.files = this.form.files ?? [];
|
||||||
|
}
|
||||||
},
|
},
|
||||||
deep: true,
|
deep: true,
|
||||||
immediate: true,
|
immediate: true,
|
||||||
@@ -247,6 +259,20 @@ export default {
|
|||||||
resetFields(args) {
|
resetFields(args) {
|
||||||
return this.$refs.form.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
|
// getCode
|
||||||
async getCode(url) {
|
async getCode(url) {
|
||||||
const response = await this.$axios(url);
|
const response = await this.$axios(url);
|
||||||
@@ -346,7 +372,9 @@ export default {
|
|||||||
if (!promiseList.length) this.formLoading = false;
|
if (!promiseList.length) this.formLoading = false;
|
||||||
},
|
},
|
||||||
// 上传成功的特殊处理
|
// 上传成功的特殊处理
|
||||||
beforeUpload() {},
|
beforeUpload(file) {
|
||||||
|
console.log(file)
|
||||||
|
},
|
||||||
// 上传前的验证规则可通过 bind 属性传入
|
// 上传前的验证规则可通过 bind 属性传入
|
||||||
handleUploadSuccess(response, file, fileList) {
|
handleUploadSuccess(response, file, fileList) {
|
||||||
this.form.files.push({
|
this.form.files.push({
|
||||||
@@ -367,7 +395,9 @@ export default {
|
|||||||
},
|
},
|
||||||
|
|
||||||
handleDeleteFile(file) {
|
handleDeleteFile(file) {
|
||||||
this.form.files = this.form.files.filter(item => item.fileUrl != file.fileUrl);
|
this.form.files = this.form.files.filter(
|
||||||
|
(item) => item.fileUrl != file.fileUrl
|
||||||
|
);
|
||||||
this.$emit('update', this.form);
|
this.$emit('update', this.form);
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
94
src/filter/code-filter.js
Normal file
94
src/filter/code-filter.js
Normal file
@@ -0,0 +1,94 @@
|
|||||||
|
|
||||||
|
/*
|
||||||
|
* @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,9 +71,7 @@ import DocAlert from '@/components/DocAlert';
|
|||||||
// 头部标签插件
|
// 头部标签插件
|
||||||
import VueMeta from 'vue-meta';
|
import VueMeta from 'vue-meta';
|
||||||
import CodeBrickZj from 'code-brick-zj';
|
import CodeBrickZj from 'code-brick-zj';
|
||||||
import { hiPrintPlugin,disAutoConnect } from 'vue-plugin-hiprint'
|
|
||||||
disAutoConnect();
|
|
||||||
Vue.use(hiPrintPlugin)
|
|
||||||
Vue.use(CodeBrickZj)
|
Vue.use(CodeBrickZj)
|
||||||
Vue.use(directive);
|
Vue.use(directive);
|
||||||
Vue.use(plugins);
|
Vue.use(plugins);
|
||||||
|
|||||||
122
src/mixins/basic-add.js
Normal file
122
src/mixins/basic-add.js
Normal file
@@ -0,0 +1,122 @@
|
|||||||
|
/*
|
||||||
|
* @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();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
128
src/mixins/basic-page.js
Normal file
128
src/mixins/basic-page.js
Normal file
@@ -0,0 +1,128 @@
|
|||||||
|
/*
|
||||||
|
* @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(() => { });
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
20
src/mixins/lb/tableHeightMixin.js
Normal file
20
src/mixins/lb/tableHeightMixin.js
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
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);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
20
src/mixins/tableHeightMixin.js
Normal file
20
src/mixins/tableHeightMixin.js
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
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,17 +70,18 @@ export const constantRoutes = [
|
|||||||
hidden: true
|
hidden: true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/',
|
path: "",
|
||||||
component: Layout,
|
component: Layout,
|
||||||
// redirect: 'core/base/factory',
|
redirect: "index",
|
||||||
// children: [{
|
children: [
|
||||||
// path: 'index',
|
{
|
||||||
// redirect: 'core/base/factory',
|
path: "index",
|
||||||
// component: (resolve) => require(['@/views/index'], resolve),
|
component: (resolve) => require(["@/views/core/base/factory/index"], resolve),
|
||||||
// name: '首页',
|
name: "首页",
|
||||||
// meta: { title: '首页', icon: 'dashboard', affix: true }
|
meta: { title: "首页", icon: "dashboard", affix: true },
|
||||||
// }
|
hidden: true
|
||||||
// ]
|
},
|
||||||
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/user',
|
path: '/user',
|
||||||
|
|||||||
@@ -86,21 +86,17 @@ export const DICT_TYPE = {
|
|||||||
// ============== PRODUCT - 产品模块 =============
|
// ============== PRODUCT - 产品模块 =============
|
||||||
UNIT_DICT: 'unit_dict',
|
UNIT_DICT: 'unit_dict',
|
||||||
PRODUCT_TYPE: 'product_type',
|
PRODUCT_TYPE: 'product_type',
|
||||||
|
PROCESS_TYPE: 'process_type',
|
||||||
|
|
||||||
// ============== ENERGY - 能源模块 =============
|
// ============== ENERGY - 能源模块 =============
|
||||||
ENERGY_UNIT: 'energy_unit',
|
ENERGY_UNIT: 'energy_unit',
|
||||||
|
|
||||||
// ============== ENERGY - 能源模块 =============
|
// ============== ENERGY - 能源模块 =============
|
||||||
EQU_ALARM_LEVEL: 'equ_alarm_level',
|
EQU_ALARM_LEVEL: 'equ_alarm_level',
|
||||||
MONITOR_INDEX_TYPE: 'monitor_index_type',
|
MONITOR_INDEX_TYPE: 'monitor_index_type',
|
||||||
OBJECT_TYPE: 'object_type',
|
OBJECT_TYPE: 'object_type',
|
||||||
STATISTIC_TYPE: 'statistic_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'
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -48,6 +48,50 @@ export function parseTime(time, pattern) {
|
|||||||
return time_str
|
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) {
|
export function resetForm(refName) {
|
||||||
if (this.$refs[refName]) {
|
if (this.$refs[refName]) {
|
||||||
|
|||||||
@@ -1,65 +0,0 @@
|
|||||||
<!--
|
|
||||||
* @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>
|
|
||||||
@@ -1,411 +0,0 @@
|
|||||||
<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>
|
|
||||||
@@ -1,89 +0,0 @@
|
|||||||
<!--
|
|
||||||
* @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> -->
|
|
||||||
File diff suppressed because one or more lines are too long
@@ -1,447 +0,0 @@
|
|||||||
/* 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,7 +6,9 @@
|
|||||||
-->
|
-->
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div ref="dataBoard" class=""></div>
|
<div ref="dataBoard" class="data-board">
|
||||||
|
<el-button type="text" @click="goback" class="go-back--btn">返回</el-button>
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
@@ -24,39 +26,42 @@ export default {
|
|||||||
mainFooter: null, // dom
|
mainFooter: null, // dom
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
mounted() {
|
// mounted() {
|
||||||
this.$nextTick(() => {
|
// this.$nextTick(() => {
|
||||||
this.modify();
|
// this.modify();
|
||||||
});
|
// });
|
||||||
},
|
// },
|
||||||
activated() {
|
// activated() {
|
||||||
this.modify();
|
// this.modify();
|
||||||
},
|
// },
|
||||||
deactivated() {
|
// deactivated() {
|
||||||
this.recover();
|
// this.recover();
|
||||||
},
|
// },
|
||||||
beforeDestroy() {
|
// beforeDestroy() {
|
||||||
this.recover();
|
// this.recover();
|
||||||
},
|
// },
|
||||||
methods: {
|
methods: {
|
||||||
modify() {
|
// modify() {
|
||||||
// 在这个页面临时修改下父类的margin,结束时需还原
|
// // 在这个页面临时修改下父类的margin,结束时需还原
|
||||||
this.appMain = document.querySelector('.app-main');
|
// this.appMain = document.querySelector('.app-main');
|
||||||
// this.appMain.style.minHeight = 'calc(100vh - 90px)';
|
// // this.appMain.style.minHeight = 'calc(100vh - 90px)';
|
||||||
this.appMain.style.margin = 0;
|
// this.appMain.style.margin = 0;
|
||||||
// 在这个页面临时删除 main-footer 元素,结束时需还原
|
// // 在这个页面临时删除 main-footer 元素,结束时需还原
|
||||||
// this.mainFooter = document.querySelector('.main-footer').cloneNode(true);
|
// // this.mainFooter = document.querySelector('.main-footer').cloneNode(true);
|
||||||
// document.querySelector('.main-footer').remove();
|
// // document.querySelector('.main-footer').remove();
|
||||||
this.$refs.dataBoard.classList.add('data-board');
|
// this.$refs.dataBoard.classList.add('data-board');
|
||||||
},
|
// },
|
||||||
recover() {
|
// recover() {
|
||||||
this.$refs.dataBoard.classList.remove('data-board');
|
// this.$refs.dataBoard.classList.remove('data-board');
|
||||||
this.$nextTick(() => {
|
// this.$nextTick(() => {
|
||||||
this.appMain.style.margin = this.parentStyle.margin;
|
// this.appMain.style.margin = this.parentStyle.margin;
|
||||||
// this.appMain.style.minHeight = this.parentStyle.minHeight;
|
// // this.appMain.style.minHeight = this.parentStyle.minHeight;
|
||||||
// this.appMain.insertAdjacentElement('afterend', this.mainFooter);
|
// // this.appMain.insertAdjacentElement('afterend', this.mainFooter);
|
||||||
});
|
// });
|
||||||
},
|
// },
|
||||||
|
goback() {
|
||||||
|
this.$router.go(-1);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
@@ -71,4 +76,25 @@ export default {
|
|||||||
background: url('../../../assets/images/DataBoard.png') 100% 100% / contain
|
background: url('../../../assets/images/DataBoard.png') 100% 100% / contain
|
||||||
no-repeat;
|
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>
|
</style>
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
<!--
|
<!--
|
||||||
filename: EquipmentDrawer.vue
|
filename: EquipmentDrawer.vue
|
||||||
author: liubin
|
author: liubin
|
||||||
date: 2023-08-22 14:38:56
|
date: 2023-08-22 14:38:56
|
||||||
description:
|
description:
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
@@ -320,7 +320,7 @@ export default {
|
|||||||
|
|
||||||
// 新增属性
|
// 新增属性
|
||||||
handleAddAttr() {
|
handleAddAttr() {
|
||||||
if (!this.dataId) return this.$message.error('请先创建设备分组信息');
|
if (!this.dataId) return this.$message.warning('请先创建设备分组信息');
|
||||||
this.attrForm = {
|
this.attrForm = {
|
||||||
id: null,
|
id: null,
|
||||||
equipmentGroupId: this.dataId,
|
equipmentGroupId: this.dataId,
|
||||||
|
|||||||
@@ -38,7 +38,7 @@
|
|||||||
@close="cancel"
|
@close="cancel"
|
||||||
@cancel="cancel"
|
@cancel="cancel"
|
||||||
@confirm="submitForm">
|
@confirm="submitForm">
|
||||||
<DialogForm v-if="open" ref="form" :dataForm="form" :rows="rows" />
|
<DialogForm v-if="open" ref="form" v-model="form" :rows="rows" />
|
||||||
</base-dialog>
|
</base-dialog>
|
||||||
|
|
||||||
<!-- 抽屉 详情 -->
|
<!-- 抽屉 详情 -->
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
<!--
|
<!--
|
||||||
filename: dialogForm.vue
|
filename: dialogForm.vue
|
||||||
author: liubin
|
author: liubin
|
||||||
date: 2023-09-11 15:55:13
|
date: 2023-09-11 15:55:13
|
||||||
@@ -71,14 +71,14 @@
|
|||||||
</el-col>
|
</el-col>
|
||||||
|
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="工段排序" prop="sort">
|
<el-form-item label="工段设备排序" prop="sort">
|
||||||
<el-input-number
|
<el-input-number
|
||||||
v-model="dataForm.sort"
|
v-model="dataForm.sort"
|
||||||
filterable
|
filterable
|
||||||
min="0"
|
min="0"
|
||||||
max="100"
|
max="100"
|
||||||
@change="$emit('update', dataForm)"
|
@change="$emit('update', dataForm)"
|
||||||
placeholder="请输入工段排序" />
|
placeholder="请输入工段设备排序" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
@@ -112,6 +112,7 @@
|
|||||||
{ label: '无类型', value: 0 },
|
{ label: '无类型', value: 0 },
|
||||||
{ label: '进口统计', value: 1 },
|
{ label: '进口统计', value: 1 },
|
||||||
{ label: '出口统计', value: 2 },
|
{ label: '出口统计', value: 2 },
|
||||||
|
{ label: '进出口计数', value: 3 },
|
||||||
]"
|
]"
|
||||||
:key="opt.value"
|
:key="opt.value"
|
||||||
:label="opt.label"
|
:label="opt.label"
|
||||||
|
|||||||
@@ -4,7 +4,8 @@
|
|||||||
<SearchBar
|
<SearchBar
|
||||||
:formConfigs="searchBarFormConfig"
|
:formConfigs="searchBarFormConfig"
|
||||||
ref="search-bar"
|
ref="search-bar"
|
||||||
@headBtnClick="handleSearchBarBtnClick" />
|
@select-changed="handleSearchBarChanged"
|
||||||
|
@headBtnClick="buttonClick" />
|
||||||
|
|
||||||
<!-- 列表 -->
|
<!-- 列表 -->
|
||||||
<base-table
|
<base-table
|
||||||
@@ -52,6 +53,8 @@ import {
|
|||||||
getEquipmentBindSectionPage,
|
getEquipmentBindSectionPage,
|
||||||
exportEquipmentBindSectionExcel,
|
exportEquipmentBindSectionExcel,
|
||||||
} from '@/api/base/equipmentBindSection';
|
} from '@/api/base/equipmentBindSection';
|
||||||
|
import { getPdList } from '@/api/core/monitoring/auto';
|
||||||
|
import { getFactoryPage } from '@/api/core/base/factory';
|
||||||
import moment from 'moment';
|
import moment from 'moment';
|
||||||
import basicPageMixin from '@/mixins/lb/basicPageMixin';
|
import basicPageMixin from '@/mixins/lb/basicPageMixin';
|
||||||
import DialogForm from './dialogForm.vue';
|
import DialogForm from './dialogForm.vue';
|
||||||
@@ -61,7 +64,7 @@ export default {
|
|||||||
mixins: [basicPageMixin],
|
mixins: [basicPageMixin],
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
searchBarKeys: ['workshopSectionId', 'equipmentName'],
|
searchBarKeys: ['factoryId','productionLineId','workshopSectionId', 'equipmentName'],
|
||||||
tableBtn: [
|
tableBtn: [
|
||||||
this.$auth.hasPermi('base:equipment-bind-section:update')
|
this.$auth.hasPermi('base:equipment-bind-section:update')
|
||||||
? {
|
? {
|
||||||
@@ -84,8 +87,9 @@ export default {
|
|||||||
width: 180,
|
width: 180,
|
||||||
filter: (val) => moment(val).format('yyyy-MM-DD HH:mm:ss'),
|
filter: (val) => moment(val).format('yyyy-MM-DD HH:mm:ss'),
|
||||||
},
|
},
|
||||||
{ prop: 'productionLine', label: '产线名称' },
|
{ prop: 'factoryName', label: '工厂' },
|
||||||
{ prop: 'workshopSection', label: '工段名称' },
|
{ prop: 'productionLine', label: '产线' },
|
||||||
|
{ prop: 'workshopSection', label: '工段' },
|
||||||
{ prop: 'equipment', label: '设备名称' },
|
{ prop: 'equipment', label: '设备名称' },
|
||||||
{ prop: 'sort', label: '工段中排序' },
|
{ prop: 'sort', label: '工段中排序' },
|
||||||
{
|
{
|
||||||
@@ -98,7 +102,7 @@ export default {
|
|||||||
prop: 'sectionDataType',
|
prop: 'sectionDataType',
|
||||||
label: '工段数据类型',
|
label: '工段数据类型',
|
||||||
filter: (val) =>
|
filter: (val) =>
|
||||||
val != null ? ['无类型', '进口计数', '出口计数'][val] : '-',
|
val != null ? ['无类型', '进口计数', '出口计数', '进出口计数'][val] : '-',
|
||||||
},
|
},
|
||||||
// {
|
// {
|
||||||
// action: 'show-alert',
|
// action: 'show-alert',
|
||||||
@@ -129,6 +133,20 @@ export default {
|
|||||||
// },
|
// },
|
||||||
],
|
],
|
||||||
searchBarFormConfig: [
|
searchBarFormConfig: [
|
||||||
|
{
|
||||||
|
type: 'select',
|
||||||
|
label: '工厂',
|
||||||
|
selectOptions: [],
|
||||||
|
param: 'factoryId',
|
||||||
|
onchange: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: 'select',
|
||||||
|
label: '产线',
|
||||||
|
selectOptions: [],
|
||||||
|
param: 'productionLineId',
|
||||||
|
multiple: true,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
type: 'select',
|
type: 'select',
|
||||||
label: '工段',
|
label: '工段',
|
||||||
@@ -209,8 +227,8 @@ export default {
|
|||||||
label: '产线数据类型',
|
label: '产线数据类型',
|
||||||
options: [
|
options: [
|
||||||
{ label: '无类型', value: 0 },
|
{ label: '无类型', value: 0 },
|
||||||
{ label: '进口统计', value: 1 },
|
{ label: '进口计数', value: 1 },
|
||||||
{ label: '出口统计', value: 2 },
|
{ label: '出口计数', value: 2 },
|
||||||
],
|
],
|
||||||
prop: 'lineDataType',
|
prop: 'lineDataType',
|
||||||
},
|
},
|
||||||
@@ -219,8 +237,9 @@ export default {
|
|||||||
label: '工段数据类型',
|
label: '工段数据类型',
|
||||||
options: [
|
options: [
|
||||||
{ label: '无类型', value: 0 },
|
{ label: '无类型', value: 0 },
|
||||||
{ label: '进口统计', value: 1 },
|
{ label: '进口计数', value: 1 },
|
||||||
{ label: '出口统计', value: 2 },
|
{ label: '出口计数', value: 2 },
|
||||||
|
{ label: '进出口计数', value: 3 },
|
||||||
],
|
],
|
||||||
prop: 'sectionDataType',
|
prop: 'sectionDataType',
|
||||||
},
|
},
|
||||||
@@ -234,6 +253,9 @@ export default {
|
|||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
workshopSectionId: null,
|
workshopSectionId: null,
|
||||||
equipmentId: null,
|
equipmentId: null,
|
||||||
|
equipmentName: null,
|
||||||
|
factoryId: null,
|
||||||
|
productionLineId: [],
|
||||||
},
|
},
|
||||||
// 表单参数
|
// 表单参数
|
||||||
form: {},
|
form: {},
|
||||||
@@ -242,6 +264,7 @@ export default {
|
|||||||
created() {
|
created() {
|
||||||
this.getList();
|
this.getList();
|
||||||
this.initWorksection();
|
this.initWorksection();
|
||||||
|
this.getPdLineList();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
/** 准备工段数据 */
|
/** 准备工段数据 */
|
||||||
@@ -251,7 +274,7 @@ export default {
|
|||||||
method: 'get',
|
method: 'get',
|
||||||
});
|
});
|
||||||
if (code == 0) {
|
if (code == 0) {
|
||||||
this.searchBarFormConfig[0].selectOptions = data.map((item) => {
|
this.searchBarFormConfig[2].selectOptions = data.map((item) => {
|
||||||
return {
|
return {
|
||||||
name: item.name,
|
name: item.name,
|
||||||
id: item.id,
|
id: item.id,
|
||||||
@@ -259,6 +282,51 @@ 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() {
|
getList() {
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
<!--
|
<!--
|
||||||
filename: EquipmentDrawer.vue
|
filename: EquipmentDrawer.vue
|
||||||
author: liubin
|
author: liubin
|
||||||
date: 2023-08-22 14:38:56
|
date: 2023-08-22 14:38:56
|
||||||
description:
|
description:
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
@@ -36,7 +36,7 @@
|
|||||||
v-if="showForm"
|
v-if="showForm"
|
||||||
ref="form"
|
ref="form"
|
||||||
:disabled="mode.includes('detail')"
|
:disabled="mode.includes('detail')"
|
||||||
:dataForm="form"
|
v-model="form"
|
||||||
:rows="formRows" />
|
:rows="formRows" />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -320,7 +320,7 @@ export default {
|
|||||||
|
|
||||||
// 新增属性
|
// 新增属性
|
||||||
handleAddAttr() {
|
handleAddAttr() {
|
||||||
if (!this.dataId) return this.$message.error('请先创建设备分组信息');
|
if (!this.dataId) return this.$message.warning('请先创建设备分组信息');
|
||||||
this.attrForm = {
|
this.attrForm = {
|
||||||
id: null,
|
id: null,
|
||||||
equipmentGroupId: this.dataId,
|
equipmentGroupId: this.dataId,
|
||||||
|
|||||||
@@ -38,7 +38,7 @@
|
|||||||
@close="cancel"
|
@close="cancel"
|
||||||
@cancel="cancel"
|
@cancel="cancel"
|
||||||
@confirm="submitForm">
|
@confirm="submitForm">
|
||||||
<DialogForm v-if="open" ref="form" :dataForm="form" :rows="rows" />
|
<DialogForm v-if="open" ref="form" v-model="form" :rows="rows"/>
|
||||||
</base-dialog>
|
</base-dialog>
|
||||||
|
|
||||||
<!-- 抽屉 详情 -->
|
<!-- 抽屉 详情 -->
|
||||||
|
|||||||
@@ -280,7 +280,7 @@ export default {
|
|||||||
/** 新增按钮操作 */
|
/** 新增按钮操作 */
|
||||||
handleAdd() {
|
handleAdd() {
|
||||||
if (this.queryParams.equipmentGroupId == null)
|
if (this.queryParams.equipmentGroupId == null)
|
||||||
return this.$message.error('没有检测到设备分组信息');
|
return this.$message.warning('没有检测到设备分组信息');
|
||||||
this.reset();
|
this.reset();
|
||||||
this.open = true;
|
this.open = true;
|
||||||
this.title = '添加设备分组报警明细';
|
this.title = '添加设备分组报警明细';
|
||||||
|
|||||||
109
src/views/base/equipmentPlc/add-or-updata.vue
Normal file
109
src/views/base/equipmentPlc/add-or-updata.vue
Normal file
@@ -0,0 +1,109 @@
|
|||||||
|
<!--
|
||||||
|
* @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,59 +1,53 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="app-container">
|
<div class="app-container">
|
||||||
<!-- 搜索工作栏 -->
|
<search-bar
|
||||||
<SearchBar
|
:formConfigs="formConfig"
|
||||||
:formConfigs="searchBarFormConfig"
|
ref="searchBarForm"
|
||||||
ref="search-bar"
|
@headBtnClick="buttonClick" />
|
||||||
@headBtnClick="handleSearchBarBtnClick" />
|
|
||||||
|
|
||||||
<!-- 列表 -->
|
|
||||||
<base-table
|
<base-table
|
||||||
|
v-loading="dataListLoading"
|
||||||
:table-props="tableProps"
|
:table-props="tableProps"
|
||||||
:page="queryParams.pageNo"
|
:page="listQuery.pageNo"
|
||||||
:limit="queryParams.pageSize"
|
:limit="listQuery.pageSize"
|
||||||
:table-data="list"
|
:table-data="tableData"
|
||||||
ref="pageTable"
|
|
||||||
@emitFun="handleEmitFun">
|
@emitFun="handleEmitFun">
|
||||||
<method-btn
|
<method-btn
|
||||||
v-if="tableBtn.length"
|
v-if="tableBtn.length"
|
||||||
slot="handleBtn"
|
slot="handleBtn"
|
||||||
|
:width="120"
|
||||||
label="操作"
|
label="操作"
|
||||||
:method-list="tableBtn"
|
:method-list="tableBtn"
|
||||||
@clickBtn="handleTableBtnClick" />
|
@clickBtn="handleClick" />
|
||||||
</base-table>
|
</base-table>
|
||||||
|
|
||||||
<!-- 分页组件 -->
|
|
||||||
<pagination
|
<pagination
|
||||||
v-show="total > 0"
|
:limit.sync="listQuery.pageSize"
|
||||||
:total="total"
|
:page.sync="listQuery.pageNo"
|
||||||
:page.sync="queryParams.pageNo"
|
:total="listQuery.total"
|
||||||
:limit.sync="queryParams.pageSize"
|
@pagination="getDataList" />
|
||||||
@pagination="getList" />
|
|
||||||
|
|
||||||
<!-- 对话框(添加 / 修改) -->
|
|
||||||
<base-dialog
|
<base-dialog
|
||||||
:dialogTitle="title"
|
:dialogTitle="addOrEditTitle"
|
||||||
:dialogVisible="open"
|
:dialogVisible="addOrUpdateVisible"
|
||||||
width="700px"
|
@cancel="handleCancel"
|
||||||
@close="cancel"
|
@confirm="handleConfirm"
|
||||||
@cancel="cancel"
|
:before-close="handleCancel"
|
||||||
@confirm="submitForm">
|
width="50%">
|
||||||
<DialogForm v-if="open" ref="form" :dataForm="form" :rows="rows" />
|
<add-or-update
|
||||||
|
ref="addOrUpdate"
|
||||||
|
@refreshDataList="successSubmit"></add-or-update>
|
||||||
</base-dialog>
|
</base-dialog>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import AddOrUpdate from './add-or-updata';
|
||||||
|
import basicPage from '@/mixins/basic-page';
|
||||||
|
import { parseTime } from '@/filter/code-filter';
|
||||||
import {
|
import {
|
||||||
createEquipmentPlc,
|
|
||||||
updateEquipmentPlc,
|
|
||||||
deleteEquipmentPlc,
|
deleteEquipmentPlc,
|
||||||
getEquipmentPlc,
|
|
||||||
getEquipmentPlcPage,
|
getEquipmentPlcPage,
|
||||||
exportEquipmentPlcExcel,
|
exportEquipmentPlcExcel,
|
||||||
|
updateEquipmentPlc,
|
||||||
} from '@/api/base/equipmentPlc';
|
} from '@/api/base/equipmentPlc';
|
||||||
import moment from 'moment';
|
|
||||||
import basicPageMixin from '@/mixins/lb/basicPageMixin';
|
|
||||||
|
|
||||||
const switchBtn = {
|
const switchBtn = {
|
||||||
name: 'SwitchBtn',
|
name: 'SwitchBtn',
|
||||||
@@ -90,49 +84,45 @@ 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 {
|
export default {
|
||||||
name: 'EquipmentPlc',
|
mixins: [basicPage],
|
||||||
mixins: [basicPageMixin],
|
|
||||||
components: {},
|
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
tableKey: Math.random(),
|
urlOptions: {
|
||||||
searchBarKeys: ['name', 'plcTableName'],
|
getDataListURL: getEquipmentPlcPage,
|
||||||
|
deleteURL: deleteEquipmentPlc,
|
||||||
|
exportURL: exportEquipmentPlcExcel,
|
||||||
|
},
|
||||||
|
tableProps,
|
||||||
tableBtn: [
|
tableBtn: [
|
||||||
this.$auth.hasPermi('base:equipment-plc:update')
|
this.$auth.hasPermi(`base:equipment-plc:update`)
|
||||||
? {
|
? {
|
||||||
type: 'edit',
|
type: 'edit',
|
||||||
btnName: '修改',
|
btnName: '编辑',
|
||||||
}
|
}
|
||||||
: undefined,
|
: undefined,
|
||||||
this.$auth.hasPermi('base:equipment-plc:delete')
|
this.$auth.hasPermi(`base:equipment-plc:delete`)
|
||||||
? {
|
? {
|
||||||
type: 'delete',
|
type: 'delete',
|
||||||
btnName: '删除',
|
btnName: '删除',
|
||||||
}
|
}
|
||||||
: undefined,
|
: undefined,
|
||||||
].filter((v) => v),
|
].filter((v) => v),
|
||||||
tableProps: [
|
tableData: [],
|
||||||
// {
|
formConfig: [
|
||||||
// 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',
|
type: 'input',
|
||||||
label: '表名',
|
label: '表名',
|
||||||
@@ -147,231 +137,86 @@ export default {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
type: 'button',
|
type: 'button',
|
||||||
btnName: '查询',
|
btnName: '搜索',
|
||||||
name: 'search',
|
name: 'search',
|
||||||
color: 'primary',
|
color: 'primary',
|
||||||
},
|
},
|
||||||
|
// {
|
||||||
|
// type: 'separate',
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// type: 'button',
|
||||||
|
// btnName: '重置',
|
||||||
|
// name: 'reset',
|
||||||
|
// },
|
||||||
{
|
{
|
||||||
type: 'separate',
|
type: 'separate',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
// type: this.$auth.hasPermi('base:equipment-plc:create')
|
type: this.$auth.hasPermi('base:factory:create') ? 'button' : '',
|
||||||
// ? 'button'
|
|
||||||
// : '',
|
|
||||||
type: 'button',
|
|
||||||
btnName: '新增',
|
btnName: '新增',
|
||||||
name: 'add',
|
name: 'add',
|
||||||
plain: true,
|
|
||||||
color: 'success',
|
color: 'success',
|
||||||
|
plain: true,
|
||||||
},
|
},
|
||||||
// {
|
// {
|
||||||
// type: this.$auth.hasPermi('base:equipment-plc:export') ? 'button' : '',
|
// type: this.$auth.hasPermi('base:factory:create') ? 'separate' : '',
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// type: this.$auth.hasPermi('base:factory:export') ? 'button' : '',
|
||||||
// btnName: '导出',
|
// btnName: '导出',
|
||||||
// name: 'export',
|
// name: 'export',
|
||||||
// color: 'warning',
|
// 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: {},
|
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
created() {
|
components: {
|
||||||
this.getList();
|
AddOrUpdate,
|
||||||
},
|
},
|
||||||
|
created() {},
|
||||||
methods: {
|
methods: {
|
||||||
/** 覆盖 handleEmitFun 的默认实现 */
|
/** 覆盖 handleEmitFun 的默认实现 */
|
||||||
handleEmitFun({ action, payload }) {
|
handleEmitFun({ action, payload }) {
|
||||||
|
console.log(payload)
|
||||||
switch (action) {
|
switch (action) {
|
||||||
case 'update-collect':
|
case 'update-collect':
|
||||||
this.reset();
|
updateEquipmentPlc(payload).then((response) => {
|
||||||
const tempForm = {};
|
|
||||||
Object.keys(this.form).forEach((key) => {
|
|
||||||
tempForm[key] = payload[key];
|
|
||||||
});
|
|
||||||
updateEquipmentPlc(tempForm).then((response) => {
|
|
||||||
this.$modal.msgSuccess('修改成功');
|
this.$modal.msgSuccess('修改成功');
|
||||||
this.open = false;
|
this.getDataList();
|
||||||
this.getList();
|
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
/** 查询列表 */
|
buttonClick(val) {
|
||||||
getList() {
|
switch (val.btnName) {
|
||||||
this.loading = true;
|
case 'search':
|
||||||
// 执行查询
|
this.listQuery.pageNo = 1;
|
||||||
getEquipmentPlcPage(this.queryParams).then((response) => {
|
this.listQuery.pageSize = 10;
|
||||||
this.list = response.data.list;
|
this.listQuery.name = val.name;
|
||||||
this.total = response.data.total;
|
this.listQuery.plcTableName = val.plcTableName;
|
||||||
this.loading = false;
|
this.getDataList();
|
||||||
// this.tableKey = Math.random(); // method 1
|
break;
|
||||||
});
|
case 'reset':
|
||||||
},
|
this.$refs.searchBarForm.resetForm();
|
||||||
/** 取消按钮 */
|
this.listQuery = {
|
||||||
cancel() {
|
pageSize: 10,
|
||||||
this.open = false;
|
pageNo: 1,
|
||||||
this.reset();
|
total: 1,
|
||||||
},
|
};
|
||||||
/** 表单重置 */
|
this.getDataList();
|
||||||
reset() {
|
break;
|
||||||
this.form = {
|
case 'add':
|
||||||
id: undefined,
|
this.addOrEditTitle = '新增';
|
||||||
plcTableName: undefined,
|
this.addOrUpdateVisible = true;
|
||||||
code: undefined,
|
this.addOrUpdateHandle();
|
||||||
name: undefined,
|
break;
|
||||||
enName: undefined,
|
case 'export':
|
||||||
description: undefined,
|
this.handleExport();
|
||||||
collection: undefined,
|
break;
|
||||||
};
|
default:
|
||||||
this.resetForm('form');
|
console.log(val);
|
||||||
},
|
}
|
||||||
/** 搜索按钮操作 */
|
|
||||||
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(() => {});
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
388
src/views/base/equipmentPlcConnect/TableConfig.vue
Normal file
388
src/views/base/equipmentPlcConnect/TableConfig.vue
Normal file
@@ -0,0 +1,388 @@
|
|||||||
|
<!--
|
||||||
|
filename: TableConfig.vue
|
||||||
|
author: liubin
|
||||||
|
date: 2023-10-30 10:09:03
|
||||||
|
description:
|
||||||
|
-->
|
||||||
|
|
||||||
|
<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"
|
||||||
|
ref="pageTable"
|
||||||
|
@emitFun="handleEmitFun"
|
||||||
|
:max-height="tableH">
|
||||||
|
<method-btn
|
||||||
|
v-if="tableBtn.length"
|
||||||
|
slot="handleBtn"
|
||||||
|
label="操作"
|
||||||
|
: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"
|
||||||
|
width="700px"
|
||||||
|
@close="cancel"
|
||||||
|
@cancel="cancel"
|
||||||
|
@confirm="submitForm">
|
||||||
|
<DialogForm v-if="open" ref="form" v-model="form" :rows="rows" />
|
||||||
|
</base-dialog>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import {
|
||||||
|
createEquipmentPlc,
|
||||||
|
updateEquipmentPlc,
|
||||||
|
deleteEquipmentPlc,
|
||||||
|
getEquipmentPlc,
|
||||||
|
getEquipmentPlcPage,
|
||||||
|
exportEquipmentPlcExcel,
|
||||||
|
} from '@/api/base/equipmentPlc';
|
||||||
|
import basicPageMixin from '@/mixins/lb/basicPageMixin';
|
||||||
|
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
|
||||||
|
|
||||||
|
const switchBtn = {
|
||||||
|
name: 'SwitchBtn',
|
||||||
|
props: ['injectData'],
|
||||||
|
data() {
|
||||||
|
return {};
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
active() {
|
||||||
|
return +this.injectData[this.injectData.prop] == 1 ? true : false;
|
||||||
|
},
|
||||||
|
},
|
||||||
|
methods: {},
|
||||||
|
render: function (h) {
|
||||||
|
return h(
|
||||||
|
'el-switch',
|
||||||
|
{
|
||||||
|
props: {
|
||||||
|
value: this.active,
|
||||||
|
},
|
||||||
|
on: {
|
||||||
|
change: (newVal) => {
|
||||||
|
this.$emit('emitData', {
|
||||||
|
action: 'update-collect',
|
||||||
|
payload: {
|
||||||
|
...this.injectData,
|
||||||
|
collection: newVal ? 1 : 0,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
null
|
||||||
|
);
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'EquipmentPlc',
|
||||||
|
mixins: [basicPageMixin, tableHeightMixin],
|
||||||
|
components: {},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
tableKey: Math.random(),
|
||||||
|
searchBarKeys: ['name', 'plcTableName'],
|
||||||
|
tableBtn: [
|
||||||
|
this.$auth.hasPermiAnd([
|
||||||
|
'base:equipment-plc:update',
|
||||||
|
'base:equipment-plc:query'
|
||||||
|
])
|
||||||
|
? {
|
||||||
|
type: 'edit',
|
||||||
|
btnName: '修改',
|
||||||
|
}
|
||||||
|
: undefined,
|
||||||
|
this.$auth.hasPermi('base:equipment-plc: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: 'code', label: '编码', width: 180, showOverflowtooltip: true },
|
||||||
|
{ prop: 'plcTableName', label: '关联表名', width: 150, showOverflowtooltip: true },
|
||||||
|
{ prop: 'name', label: '标识名称', width: 150, showOverflowtooltip: true },
|
||||||
|
{ prop: 'enName', label: '英文名称', width: 150, showOverflowtooltip: true },
|
||||||
|
{
|
||||||
|
prop: 'collection',
|
||||||
|
label: '是否采集',
|
||||||
|
subcomponent: switchBtn,
|
||||||
|
},
|
||||||
|
{ prop: 'description', label: '描述', minWidth: 150, showOverflowtooltip: true },
|
||||||
|
],
|
||||||
|
searchBarFormConfig: [
|
||||||
|
{
|
||||||
|
type: 'input',
|
||||||
|
label: '表名',
|
||||||
|
placeholder: '请输入表名',
|
||||||
|
param: 'plcTableName',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: 'input',
|
||||||
|
label: '标识',
|
||||||
|
placeholder: '请输入标识',
|
||||||
|
param: 'name',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: 'button',
|
||||||
|
btnName: '查询',
|
||||||
|
name: 'search',
|
||||||
|
color: 'primary',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: this.$auth.hasPermi('base:equipment-plc:create')
|
||||||
|
? 'separate' : '',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: this.$auth.hasPermi('base:equipment-plc:create')
|
||||||
|
? 'button' : '',
|
||||||
|
btnName: '新增',
|
||||||
|
name: 'add',
|
||||||
|
plain: true,
|
||||||
|
color: 'success',
|
||||||
|
},
|
||||||
|
// {
|
||||||
|
// type: this.$auth.hasPermi('equipment:realtime-table-config: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/energy-plc/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',
|
||||||
|
bind: {
|
||||||
|
'active-value': 1,
|
||||||
|
'inactive-value': 0,
|
||||||
|
value: 1,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
[
|
||||||
|
{
|
||||||
|
textarea: true,
|
||||||
|
label: '描述',
|
||||||
|
prop: 'description',
|
||||||
|
bind: {
|
||||||
|
placeholder: '请输入备注',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
],
|
||||||
|
// 是否显示弹出
|
||||||
|
open: false,
|
||||||
|
// 查询参数
|
||||||
|
queryParams: {
|
||||||
|
pageNo: 1,
|
||||||
|
pageSize: 20,
|
||||||
|
plcTableName: null,
|
||||||
|
name: null,
|
||||||
|
},
|
||||||
|
// 表单参数
|
||||||
|
form: {},
|
||||||
|
};
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.getList();
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
/** 覆盖 handleEmitFun 的默认实现 */
|
||||||
|
handleEmitFun({ action, payload }) {
|
||||||
|
switch (action) {
|
||||||
|
case 'update-collect':
|
||||||
|
this.reset();
|
||||||
|
const tempForm = {};
|
||||||
|
Object.keys(this.form).forEach((key) => {
|
||||||
|
tempForm[key] = payload[key];
|
||||||
|
});
|
||||||
|
updateEquipmentPlc(tempForm).then((response) => {
|
||||||
|
this.$modal.msgSuccess('修改成功');
|
||||||
|
this.open = false;
|
||||||
|
this.getList();
|
||||||
|
});
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
/** 查询列表 */
|
||||||
|
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: 1,
|
||||||
|
};
|
||||||
|
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('是否确认删除该配置?')
|
||||||
|
.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(() => {});
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
151
src/views/base/equipmentPlcConnect/add-or-updata.vue
Normal file
151
src/views/base/equipmentPlcConnect/add-or-updata.vue
Normal file
@@ -0,0 +1,151 @@
|
|||||||
|
<!--
|
||||||
|
* @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>
|
||||||
@@ -0,0 +1,574 @@
|
|||||||
|
<!--
|
||||||
|
filename: EquipmentDrawer.vue
|
||||||
|
author: liubin
|
||||||
|
date: 2023-08-22 14:38:56
|
||||||
|
description:
|
||||||
|
-->
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<el-drawer
|
||||||
|
:visible="visible"
|
||||||
|
:show-close="false"
|
||||||
|
:wrapper-closable="false"
|
||||||
|
class="drawer"
|
||||||
|
custom-class="mes-drawer"
|
||||||
|
size="60%"
|
||||||
|
@closed="$emit('destroy')">
|
||||||
|
<SmallTitle slot="title">
|
||||||
|
{{
|
||||||
|
mode.includes('detail')
|
||||||
|
? '详情'
|
||||||
|
: mode.includes('edit')
|
||||||
|
? '编辑'
|
||||||
|
: '新增'
|
||||||
|
}}
|
||||||
|
</SmallTitle>
|
||||||
|
|
||||||
|
<div class="drawer-body flex">
|
||||||
|
<div class="drawer-body__content">
|
||||||
|
<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'">
|
||||||
|
<el-skeleton v-if="!showForm" animated />
|
||||||
|
<BaseInfoForm
|
||||||
|
key="drawer-dialog-form"
|
||||||
|
v-if="showForm"
|
||||||
|
ref="form"
|
||||||
|
:disabled="mode.includes('detail')"
|
||||||
|
v-model="form"
|
||||||
|
:rows="formRows" />
|
||||||
|
</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">
|
||||||
|
<method-btn
|
||||||
|
v-if="section.tableBtn"
|
||||||
|
slot="handleBtn"
|
||||||
|
label="操作"
|
||||||
|
:method-list="tableBtn"
|
||||||
|
@clickBtn="handleTableBtnClick" />
|
||||||
|
</base-table>
|
||||||
|
|
||||||
|
<!-- 分页组件 -->
|
||||||
|
<pagination
|
||||||
|
v-show="total > 0"
|
||||||
|
:total="total"
|
||||||
|
:page.sync="attrQuery.params.pageNo"
|
||||||
|
:limit.sync="attrQuery.params.pageSize"
|
||||||
|
@pagination="getAttrList" />
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="drawer-body__footer">
|
||||||
|
<el-button style="" @click="handleCancel">取消</el-button>
|
||||||
|
<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>
|
||||||
|
|
||||||
|
<!-- 属性对话框 -->
|
||||||
|
<base-dialog
|
||||||
|
v-if="sections[1].allowAdd"
|
||||||
|
:dialogTitle="attrTitle"
|
||||||
|
:dialogVisible="attrFormVisible"
|
||||||
|
width="45%"
|
||||||
|
:append-to-body="true"
|
||||||
|
custom-class="baseDialog"
|
||||||
|
@close="closeAttrForm"
|
||||||
|
@cancel="closeAttrForm"
|
||||||
|
@confirm="submitAttrForm">
|
||||||
|
<DialogForm
|
||||||
|
v-if="attrFormVisible"
|
||||||
|
ref="attrForm"
|
||||||
|
:disabled="mode.includes('detail')"
|
||||||
|
v-model="attrForm"
|
||||||
|
:rows="attrRows" />
|
||||||
|
</base-dialog>
|
||||||
|
</el-drawer>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import BaseInfoForm from '@/components/DialogForm';
|
||||||
|
|
||||||
|
const SmallTitle = {
|
||||||
|
name: 'SmallTitle',
|
||||||
|
props: ['size'],
|
||||||
|
data() {
|
||||||
|
return {};
|
||||||
|
},
|
||||||
|
methods: {},
|
||||||
|
render: function (h) {
|
||||||
|
return h(
|
||||||
|
'span',
|
||||||
|
{
|
||||||
|
class: 'small-title',
|
||||||
|
style: {
|
||||||
|
fontSize: '18px',
|
||||||
|
lineHeight:
|
||||||
|
this.size == 'lg' ? '24px' : this.size == 'sm' ? '18px' : '20px',
|
||||||
|
fontWeight: 500,
|
||||||
|
fontFamily: '微软雅黑, Microsoft YaHei, Arial, Helvetica, sans-serif',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
this.$slots.default
|
||||||
|
);
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
export default {
|
||||||
|
components: { SmallTitle, DialogForm: BaseInfoForm, BaseInfoForm },
|
||||||
|
props: ['sections', 'defaultMode', 'infoData'],
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
mode: '',
|
||||||
|
visible: false,
|
||||||
|
showForm: false,
|
||||||
|
total: 0,
|
||||||
|
form: {},
|
||||||
|
list: [],
|
||||||
|
attrTitle: '',
|
||||||
|
attrForm: {
|
||||||
|
id: null,
|
||||||
|
name: '',
|
||||||
|
plcParamName: '',
|
||||||
|
unit: '',
|
||||||
|
collection: 1,
|
||||||
|
minValue: '',
|
||||||
|
maxValue: '',
|
||||||
|
defaultValue: '',
|
||||||
|
description: '',
|
||||||
|
remark: '',
|
||||||
|
alarmContent: '',
|
||||||
|
equipmentParamType: '',
|
||||||
|
productionParamType: '',
|
||||||
|
},
|
||||||
|
attrFormVisible: false,
|
||||||
|
attrRows: [
|
||||||
|
[
|
||||||
|
{
|
||||||
|
input: true,
|
||||||
|
label: '参数列名',
|
||||||
|
prop: 'plcParamName',
|
||||||
|
rules: [{ required: true, message: '不能为空', trigger: 'blur' }],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
input: true,
|
||||||
|
label: '参数名称',
|
||||||
|
prop: 'name',
|
||||||
|
rules: [{ required: true, message: '不能为空', trigger: 'blur' }],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
[
|
||||||
|
{
|
||||||
|
select: true,
|
||||||
|
label: '单位',
|
||||||
|
prop: 'unit',
|
||||||
|
options: this.getDictDatas(this.DICT_TYPE.UNIT_DICT),
|
||||||
|
// rules: [{ required: true, message: '不能为空', trigger: 'blur' }],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
switch: true,
|
||||||
|
label: '是否采集',
|
||||||
|
prop: 'collection',
|
||||||
|
bind: {
|
||||||
|
'active-value': 1,
|
||||||
|
'inactive-value': 0,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
[
|
||||||
|
{
|
||||||
|
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,
|
||||||
|
label: '最小值',
|
||||||
|
prop: 'minValue',
|
||||||
|
rules: [
|
||||||
|
{
|
||||||
|
type: 'number',
|
||||||
|
message: '请输入正确的数字',
|
||||||
|
trigger: 'change',
|
||||||
|
transform: (val) => Number(val),
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
input: true,
|
||||||
|
label: '最大值',
|
||||||
|
prop: 'maxValue',
|
||||||
|
rules: [
|
||||||
|
{
|
||||||
|
required: false,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: 'number',
|
||||||
|
message: '请输入正确的数字',
|
||||||
|
trigger: 'change',
|
||||||
|
transform: (val) => Number(val),
|
||||||
|
},
|
||||||
|
],
|
||||||
|
// rules: [{ required: true, message: '不能为空', trigger: 'blur' }],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
[
|
||||||
|
{
|
||||||
|
input: true,
|
||||||
|
label: '标准值',
|
||||||
|
prop: 'defaultValue',
|
||||||
|
// rules: [{ required: true, message: '不能为空', trigger: 'blur' }],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
input: true,
|
||||||
|
label: '描述',
|
||||||
|
prop: 'description',
|
||||||
|
// rules: [{ required: true, message: '不能为空', trigger: 'blur' }],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
[
|
||||||
|
{
|
||||||
|
input: true,
|
||||||
|
label: '备注',
|
||||||
|
prop: 'remark',
|
||||||
|
// rules: [{ required: true, message: '不能为空', trigger: 'blur' }],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
],
|
||||||
|
attrQuery: {
|
||||||
|
params: {
|
||||||
|
pageNo: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
},
|
||||||
|
}, // 属性列表的请求
|
||||||
|
infoQuery: null, // 基本信息的请求
|
||||||
|
attrFormSubmitting: false,
|
||||||
|
attrListLoading: false,
|
||||||
|
};
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
formRows() {
|
||||||
|
return this.sections[0].rows.map((row) => {
|
||||||
|
return row.map((col) => {
|
||||||
|
return {
|
||||||
|
...col,
|
||||||
|
bind: {
|
||||||
|
// 详情 模式下,禁用各种输入
|
||||||
|
// disabled: this.mode == 'detail',
|
||||||
|
disabled: true,
|
||||||
|
},
|
||||||
|
};
|
||||||
|
});
|
||||||
|
});
|
||||||
|
},
|
||||||
|
tableBtn() {
|
||||||
|
return this.mode == 'detail' ? [] : this.sections[1].tableBtn;
|
||||||
|
},
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
this.mode = this.defaultMode || 'detail';
|
||||||
|
for (const section of this.sections) {
|
||||||
|
// 请求具体信息
|
||||||
|
if ('url' in section) {
|
||||||
|
const query = {
|
||||||
|
url: section.url,
|
||||||
|
method: section.method || 'get',
|
||||||
|
params: section.queryParams || null,
|
||||||
|
data: section.data || null,
|
||||||
|
};
|
||||||
|
// debugger;
|
||||||
|
this.$axios(query).then(({ data }) => {
|
||||||
|
if (section.key == 'base') {
|
||||||
|
this.form = data;
|
||||||
|
this.showForm = true;
|
||||||
|
this.infoQuery = query;
|
||||||
|
} else if (section.key == 'attrs') {
|
||||||
|
this.attrQuery = query;
|
||||||
|
this.list = data.list;
|
||||||
|
this.total = data.total;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} else if (section.key == 'base') {
|
||||||
|
this.form = this.infoData;
|
||||||
|
this.showForm = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
handleTableBtnClick({ type, data }) {
|
||||||
|
switch (type) {
|
||||||
|
case 'edit':
|
||||||
|
this.handleEditAttr(data.id);
|
||||||
|
break;
|
||||||
|
case 'delete':
|
||||||
|
this.handleDeleteAttr(data.id);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
handleEmitFun(val) {
|
||||||
|
console.log('handleEmitFun', val);
|
||||||
|
},
|
||||||
|
|
||||||
|
init() {
|
||||||
|
this.visible = true;
|
||||||
|
},
|
||||||
|
|
||||||
|
async getAttrList() {
|
||||||
|
this.attrListLoading = true;
|
||||||
|
const res = await this.$axios(this.attrQuery);
|
||||||
|
if (res.code == 0) {
|
||||||
|
this.list = res.data.list;
|
||||||
|
this.total = res.data.total;
|
||||||
|
}
|
||||||
|
this.attrListLoading = false;
|
||||||
|
},
|
||||||
|
|
||||||
|
// 保存表单
|
||||||
|
handleSave() {
|
||||||
|
this.$refs['form'][0].validate(async (valid) => {
|
||||||
|
if (valid) {
|
||||||
|
const isEdit = this.mode == 'edit';
|
||||||
|
await this.$axios({
|
||||||
|
url: this.sections[0][isEdit ? 'urlUpdate' : 'urlCreate'],
|
||||||
|
method: isEdit ? 'put' : 'post',
|
||||||
|
data: this.form,
|
||||||
|
});
|
||||||
|
this.$modal.msgSuccess(`${isEdit ? '更新' : '创建'}成功`);
|
||||||
|
this.visible = false;
|
||||||
|
this.$emit('refreshDataList');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
handleCancel() {
|
||||||
|
this.visible = false;
|
||||||
|
},
|
||||||
|
|
||||||
|
// 开启编辑
|
||||||
|
toggleEdit() {
|
||||||
|
this.mode = 'edit';
|
||||||
|
},
|
||||||
|
|
||||||
|
// 新增属性
|
||||||
|
handleAddAttr() {
|
||||||
|
this.attrForm = {
|
||||||
|
id: null,
|
||||||
|
name: '',
|
||||||
|
plcParamName: '',
|
||||||
|
unit: '',
|
||||||
|
collection: 1,
|
||||||
|
minValue: '',
|
||||||
|
maxValue: '',
|
||||||
|
defaultValue: '',
|
||||||
|
description: '',
|
||||||
|
remark: '',
|
||||||
|
alarmContent: '',
|
||||||
|
};
|
||||||
|
this.attrTitle = '添加设备绑定信息';
|
||||||
|
this.attrFormVisible = true;
|
||||||
|
},
|
||||||
|
|
||||||
|
// 编辑属性
|
||||||
|
async handleEditAttr(attrId) {
|
||||||
|
const res = await this.$axios({
|
||||||
|
url: this.sections[1].urlDetail,
|
||||||
|
method: 'get',
|
||||||
|
params: { id: attrId },
|
||||||
|
});
|
||||||
|
if (res.code == 0) {
|
||||||
|
this.attrForm = res.data;
|
||||||
|
this.attrTitle = '编辑设备绑定信息';
|
||||||
|
this.attrFormVisible = true;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
// 删除属性
|
||||||
|
handleDeleteAttr(attrId) {
|
||||||
|
this.$confirm('确定删除该分组报警?', '提示', {
|
||||||
|
confirmButtonText: '确定',
|
||||||
|
cancelButtonText: '取消',
|
||||||
|
type: 'warning',
|
||||||
|
})
|
||||||
|
.then(async () => {
|
||||||
|
const res = await this.$axios({
|
||||||
|
url: this.sections[1].urlDelete,
|
||||||
|
method: 'delete',
|
||||||
|
params: { id: attrId },
|
||||||
|
});
|
||||||
|
if (res.code == 0) {
|
||||||
|
this.$message({
|
||||||
|
message: '删除成功',
|
||||||
|
type: 'success',
|
||||||
|
duration: 1500,
|
||||||
|
onClose: () => {
|
||||||
|
this.getAttrList();
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch(() => {});
|
||||||
|
},
|
||||||
|
|
||||||
|
// 提交属性表
|
||||||
|
async submitAttrForm() {
|
||||||
|
this.$refs['attrForm'].validate((valid) => {
|
||||||
|
if (!valid) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
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();
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
this.attrFormSubmitting = false;
|
||||||
|
},
|
||||||
|
|
||||||
|
closeAttrForm() {
|
||||||
|
this.attrFormVisible = false;
|
||||||
|
},
|
||||||
|
|
||||||
|
handleClick(raw) {
|
||||||
|
if (raw.type === 'delete') {
|
||||||
|
this.$confirm(`确定删除该报警?`, '提示', {
|
||||||
|
confirmButtonText: '确定',
|
||||||
|
cancelButtonText: '取消',
|
||||||
|
type: 'warning',
|
||||||
|
})
|
||||||
|
.then(() => {
|
||||||
|
deleteProductAttr(raw.data.id).then(({ data }) => {
|
||||||
|
this.$message({
|
||||||
|
message: '操作成功',
|
||||||
|
type: 'success',
|
||||||
|
duration: 1500,
|
||||||
|
onClose: () => {
|
||||||
|
this.getList();
|
||||||
|
},
|
||||||
|
});
|
||||||
|
});
|
||||||
|
})
|
||||||
|
.catch(() => {});
|
||||||
|
} else {
|
||||||
|
this.addNew(raw.data.id);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
.drawer >>> .el-drawer {
|
||||||
|
border-radius: 8px 0 0 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.drawer >>> .el-drawer__header {
|
||||||
|
margin: 0;
|
||||||
|
padding: 32px 32px 24px;
|
||||||
|
border-bottom: 1px solid #dcdfe6;
|
||||||
|
margin-bottom: 0px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.small-title::before {
|
||||||
|
content: '';
|
||||||
|
display: inline-block;
|
||||||
|
vertical-align: top;
|
||||||
|
width: 4px;
|
||||||
|
height: 22px;
|
||||||
|
border-radius: 1px;
|
||||||
|
margin-right: 8px;
|
||||||
|
background-color: #0b58ff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.drawer-body {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.drawer-body__content {
|
||||||
|
flex: 1;
|
||||||
|
/* background: #eee; */
|
||||||
|
padding: 20px 30px;
|
||||||
|
overflow-y: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
.drawer-body__footer {
|
||||||
|
display: flex;
|
||||||
|
justify-content: flex-end;
|
||||||
|
padding: 18px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
<!--
|
<!--
|
||||||
filename: EquipmentDrawer.vue
|
filename: EquipmentDrawer.vue
|
||||||
author: liubin
|
author: liubin
|
||||||
date: 2023-08-22 14:38:56
|
date: 2023-08-22 14:38:56
|
||||||
description:
|
description:
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
@@ -12,7 +12,7 @@
|
|||||||
:wrapper-closable="false"
|
:wrapper-closable="false"
|
||||||
class="drawer"
|
class="drawer"
|
||||||
custom-class="mes-drawer"
|
custom-class="mes-drawer"
|
||||||
size="60%"
|
:size="size || '50%'"
|
||||||
@closed="$emit('destroy')">
|
@closed="$emit('destroy')">
|
||||||
<SmallTitle slot="title">
|
<SmallTitle slot="title">
|
||||||
{{
|
{{
|
||||||
@@ -29,29 +29,107 @@
|
|||||||
<section v-for="(section, index) in sections" :key="section.key">
|
<section v-for="(section, index) in sections" :key="section.key">
|
||||||
<SmallTitle v-if="index != 0">{{ section.name }}</SmallTitle>
|
<SmallTitle v-if="index != 0">{{ section.name }}</SmallTitle>
|
||||||
|
|
||||||
<div class="form-part" v-if="section.key == 'base'">
|
<div
|
||||||
|
class="form-part"
|
||||||
|
v-if="section.key == 'base'"
|
||||||
|
style="border-bottom: 1px solid #dfdfdf; margin-bottom: 24px">
|
||||||
<el-skeleton v-if="!showForm" animated />
|
<el-skeleton v-if="!showForm" animated />
|
||||||
<BaseInfoForm
|
<!-- <BaseInfoForm
|
||||||
key="drawer-dialog-form"
|
key="drawer-dialog-form"
|
||||||
v-if="showForm"
|
v-if="showForm"
|
||||||
ref="form"
|
ref="form"
|
||||||
:disabled="mode.includes('detail')"
|
:disabled="mode.includes('detail')"
|
||||||
:dataForm="form"
|
v-model="form"
|
||||||
:rows="formRows" />
|
: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>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div v-if="section.key == 'attrs'" style="margin-top: 12px">
|
<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>
|
||||||
<base-table
|
<base-table
|
||||||
v-loading="attrListLoading"
|
v-loading="attrListLoading"
|
||||||
:table-props="section.props"
|
:table-props="section.props"
|
||||||
:page="attrQuery?.params.pageNo || 1"
|
:page="attrQuery?.params.pageNo || 1"
|
||||||
:limit="attrQuery?.params.pageSize || 10"
|
:limit="attrQuery?.params.pageSize || 10"
|
||||||
:table-data="list"
|
:table-data="list"
|
||||||
:add-button-show="mode.includes('detail') ? null : '添加属性'"
|
|
||||||
@emitButtonClick="handleAddAttr"
|
|
||||||
@emitFun="handleEmitFun">
|
@emitFun="handleEmitFun">
|
||||||
|
<!-- :add-button-show="mode.includes('detail') ? null : '添加属性'"
|
||||||
|
@emitButtonClick="handleAddAttr" -->
|
||||||
<method-btn
|
<method-btn
|
||||||
v-if="section.tableBtn"
|
v-if="section.tableBtn && !mode.includes('detail')"
|
||||||
slot="handleBtn"
|
slot="handleBtn"
|
||||||
label="操作"
|
label="操作"
|
||||||
:method-list="tableBtn"
|
:method-list="tableBtn"
|
||||||
@@ -71,17 +149,12 @@
|
|||||||
|
|
||||||
<div class="drawer-body__footer">
|
<div class="drawer-body__footer">
|
||||||
<el-button style="" @click="handleCancel">取消</el-button>
|
<el-button style="" @click="handleCancel">取消</el-button>
|
||||||
<el-button v-if="mode == 'detail'" type="primary" @click="toggleEdit">
|
<el-button
|
||||||
编辑
|
type="primary"
|
||||||
|
v-if="!mode.includes('detail')"
|
||||||
|
@click="handleSave">
|
||||||
|
保存
|
||||||
</el-button>
|
</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>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -96,10 +169,10 @@
|
|||||||
@close="closeAttrForm"
|
@close="closeAttrForm"
|
||||||
@cancel="closeAttrForm"
|
@cancel="closeAttrForm"
|
||||||
@confirm="submitAttrForm">
|
@confirm="submitAttrForm">
|
||||||
|
<!-- :disabled="mode.includes('detail')" -->
|
||||||
<DialogForm
|
<DialogForm
|
||||||
v-if="attrFormVisible"
|
v-if="attrFormVisible"
|
||||||
ref="attrForm"
|
ref="attrForm"
|
||||||
:disabled="mode.includes('detail')"
|
|
||||||
v-model="attrForm"
|
v-model="attrForm"
|
||||||
:rows="attrRows" />
|
:rows="attrRows" />
|
||||||
</base-dialog>
|
</base-dialog>
|
||||||
@@ -136,7 +209,7 @@ const SmallTitle = {
|
|||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: { SmallTitle, DialogForm: BaseInfoForm, BaseInfoForm },
|
components: { SmallTitle, DialogForm: BaseInfoForm, BaseInfoForm },
|
||||||
props: ['sections', 'defaultMode', 'infoData'],
|
props: ['sections', 'defaultMode', 'infoData', 'size'],
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
mode: '',
|
mode: '',
|
||||||
@@ -145,6 +218,8 @@ export default {
|
|||||||
total: 0,
|
total: 0,
|
||||||
form: {},
|
form: {},
|
||||||
list: [],
|
list: [],
|
||||||
|
eqList: [],
|
||||||
|
plcList: [],
|
||||||
attrTitle: '',
|
attrTitle: '',
|
||||||
attrForm: {
|
attrForm: {
|
||||||
id: null,
|
id: null,
|
||||||
@@ -166,13 +241,17 @@ export default {
|
|||||||
input: true,
|
input: true,
|
||||||
label: '参数列名',
|
label: '参数列名',
|
||||||
prop: 'plcParamName',
|
prop: 'plcParamName',
|
||||||
rules: [{ required: true, message: '不能为空', trigger: 'blur' }],
|
rules: [
|
||||||
|
{ required: true, message: '参数列名不能为空', trigger: 'blur' },
|
||||||
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
input: true,
|
input: true,
|
||||||
label: '参数名称',
|
label: '参数名称',
|
||||||
prop: 'name',
|
prop: 'name',
|
||||||
rules: [{ required: true, message: '不能为空', trigger: 'blur' }],
|
rules: [
|
||||||
|
{ required: true, message: '参数名称不能为空', trigger: 'blur' },
|
||||||
|
],
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
@@ -181,7 +260,6 @@ export default {
|
|||||||
label: '单位',
|
label: '单位',
|
||||||
prop: 'unit',
|
prop: 'unit',
|
||||||
options: this.getDictDatas(this.DICT_TYPE.UNIT_DICT),
|
options: this.getDictDatas(this.DICT_TYPE.UNIT_DICT),
|
||||||
// rules: [{ required: true, message: '不能为空', trigger: 'blur' }],
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
switch: true,
|
switch: true,
|
||||||
@@ -193,6 +271,47 @@ 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,
|
input: true,
|
||||||
@@ -222,7 +341,6 @@ export default {
|
|||||||
transform: (val) => Number(val),
|
transform: (val) => Number(val),
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
// rules: [{ required: true, message: '不能为空', trigger: 'blur' }],
|
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
@@ -230,13 +348,11 @@ export default {
|
|||||||
input: true,
|
input: true,
|
||||||
label: '标准值',
|
label: '标准值',
|
||||||
prop: 'defaultValue',
|
prop: 'defaultValue',
|
||||||
// rules: [{ required: true, message: '不能为空', trigger: 'blur' }],
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
input: true,
|
input: true,
|
||||||
label: '描述',
|
label: '描述',
|
||||||
prop: 'description',
|
prop: 'description',
|
||||||
// rules: [{ required: true, message: '不能为空', trigger: 'blur' }],
|
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
@@ -244,7 +360,6 @@ export default {
|
|||||||
input: true,
|
input: true,
|
||||||
label: '备注',
|
label: '备注',
|
||||||
prop: 'remark',
|
prop: 'remark',
|
||||||
// rules: [{ required: true, message: '不能为空', trigger: 'blur' }],
|
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
@@ -257,6 +372,7 @@ export default {
|
|||||||
infoQuery: null, // 基本信息的请求
|
infoQuery: null, // 基本信息的请求
|
||||||
attrFormSubmitting: false,
|
attrFormSubmitting: false,
|
||||||
attrListLoading: false,
|
attrListLoading: false,
|
||||||
|
shouldRefreshPageView: false,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
@@ -275,11 +391,24 @@ export default {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
tableBtn() {
|
tableBtn() {
|
||||||
return this.mode == 'detail' ? [] : this.sections[1].tableBtn;
|
return this.sections[1].tableBtn;
|
||||||
|
// return this.mode == 'detail' ? [] : this.sections[1].tableBtn;
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
|
this.shouldRefreshPageView = false;
|
||||||
this.mode = this.defaultMode || 'detail';
|
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) {
|
for (const section of this.sections) {
|
||||||
// 请求具体信息
|
// 请求具体信息
|
||||||
if ('url' in section) {
|
if ('url' in section) {
|
||||||
@@ -341,7 +470,7 @@ export default {
|
|||||||
handleSave() {
|
handleSave() {
|
||||||
this.$refs['form'][0].validate(async (valid) => {
|
this.$refs['form'][0].validate(async (valid) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
const isEdit = this.mode == 'edit';
|
const isEdit = !this.mode.includes('detail');
|
||||||
await this.$axios({
|
await this.$axios({
|
||||||
url: this.sections[0][isEdit ? 'urlUpdate' : 'urlCreate'],
|
url: this.sections[0][isEdit ? 'urlUpdate' : 'urlCreate'],
|
||||||
method: isEdit ? 'put' : 'post',
|
method: isEdit ? 'put' : 'post',
|
||||||
@@ -355,6 +484,9 @@ export default {
|
|||||||
},
|
},
|
||||||
|
|
||||||
handleCancel() {
|
handleCancel() {
|
||||||
|
if (this.shouldRefreshPageView) {
|
||||||
|
this.$emit('refreshDataList');
|
||||||
|
}
|
||||||
this.visible = false;
|
this.visible = false;
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -376,9 +508,11 @@ export default {
|
|||||||
defaultValue: '',
|
defaultValue: '',
|
||||||
description: '',
|
description: '',
|
||||||
remark: '',
|
remark: '',
|
||||||
|
equipmentParamType: '',
|
||||||
|
productionParamType: '',
|
||||||
alarmContent: '',
|
alarmContent: '',
|
||||||
};
|
};
|
||||||
this.attrTitle = '添加设备绑定信息';
|
this.attrTitle = '添加参数绑定信息';
|
||||||
this.attrFormVisible = true;
|
this.attrFormVisible = true;
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -391,14 +525,14 @@ export default {
|
|||||||
});
|
});
|
||||||
if (res.code == 0) {
|
if (res.code == 0) {
|
||||||
this.attrForm = res.data;
|
this.attrForm = res.data;
|
||||||
this.attrTitle = '编辑设备绑定信息';
|
this.attrTitle = '编辑参数绑定信息';
|
||||||
this.attrFormVisible = true;
|
this.attrFormVisible = true;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
// 删除属性
|
// 删除属性
|
||||||
handleDeleteAttr(attrId) {
|
handleDeleteAttr(attrId) {
|
||||||
this.$confirm('确定删除该分组报警?', '提示', {
|
this.$confirm('确定删除该参数?', '提示', {
|
||||||
confirmButtonText: '确定',
|
confirmButtonText: '确定',
|
||||||
cancelButtonText: '取消',
|
cancelButtonText: '取消',
|
||||||
type: 'warning',
|
type: 'warning',
|
||||||
@@ -410,6 +544,7 @@ export default {
|
|||||||
params: { id: attrId },
|
params: { id: attrId },
|
||||||
});
|
});
|
||||||
if (res.code == 0) {
|
if (res.code == 0) {
|
||||||
|
this.shouldRefreshPageView = true;
|
||||||
this.$message({
|
this.$message({
|
||||||
message: '删除成功',
|
message: '删除成功',
|
||||||
type: 'success',
|
type: 'success',
|
||||||
@@ -424,35 +559,37 @@ export default {
|
|||||||
},
|
},
|
||||||
|
|
||||||
// 提交属性表
|
// 提交属性表
|
||||||
async submitAttrForm() {
|
submitAttrForm() {
|
||||||
this.$refs['attrForm'].validate((valid) => {
|
this.$refs['attrForm'].validate(async (valid) => {
|
||||||
if (!valid) {
|
if (!valid) {
|
||||||
return;
|
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
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
if (res.code == 0) {
|
const isEdit = this.attrForm.id != null;
|
||||||
this.closeAttrForm();
|
this.attrFormSubmitting = true;
|
||||||
this.$message({
|
const res = await this.$axios({
|
||||||
message: `${isEdit ? '更新' : '创建'}成功`,
|
url: isEdit ? this.sections[1].urlUpdate : this.sections[1].urlCreate,
|
||||||
type: 'success',
|
method: isEdit ? 'put' : 'post',
|
||||||
duration: 1500,
|
data: {
|
||||||
onClose: () => {
|
...this.attrForm,
|
||||||
this.getAttrList();
|
connectId: this.infoData.id,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
}
|
|
||||||
this.attrFormSubmitting = false;
|
if (res.code == 0) {
|
||||||
|
this.closeAttrForm();
|
||||||
|
this.$message({
|
||||||
|
message: `${isEdit ? '更新' : '创建'}成功`,
|
||||||
|
type: 'success',
|
||||||
|
duration: 1500,
|
||||||
|
onClose: () => {
|
||||||
|
this.getAttrList();
|
||||||
|
this.shouldRefreshPageView = true;
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
this.attrFormSubmitting = false;
|
||||||
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
closeAttrForm() {
|
closeAttrForm() {
|
||||||
@@ -461,7 +598,7 @@ export default {
|
|||||||
|
|
||||||
handleClick(raw) {
|
handleClick(raw) {
|
||||||
if (raw.type === 'delete') {
|
if (raw.type === 'delete') {
|
||||||
this.$confirm(`确定删除该报警?`, '提示', {
|
this.$confirm(`确定删除该参数?`, '提示', {
|
||||||
confirmButtonText: '确定',
|
confirmButtonText: '确定',
|
||||||
cancelButtonText: '取消',
|
cancelButtonText: '取消',
|
||||||
type: 'warning',
|
type: 'warning',
|
||||||
|
|||||||
100
src/views/base/equipmentPlcConnect/components/basic-add.js
Normal file
100
src/views/base/equipmentPlcConnect/components/basic-add.js
Normal file
@@ -0,0 +1,100 @@
|
|||||||
|
/*
|
||||||
|
* @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()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
535
src/views/base/equipmentPlcConnect/index-old.vue
Normal file
535
src/views/base/equipmentPlcConnect/index-old.vue
Normal file
@@ -0,0 +1,535 @@
|
|||||||
|
<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"
|
||||||
|
width="700px"
|
||||||
|
@close="cancel"
|
||||||
|
@cancel="cancel"
|
||||||
|
@confirm="submitForm">
|
||||||
|
<DialogForm v-if="open" ref="form" v-model="form" :rows="rows" />
|
||||||
|
</base-dialog>
|
||||||
|
|
||||||
|
<!-- 抽屉 详情 -->
|
||||||
|
<BasicDrawer
|
||||||
|
v-if="editVisible"
|
||||||
|
ref="drawer"
|
||||||
|
:default-mode="editMode"
|
||||||
|
:info-data="alarmForm"
|
||||||
|
:sections="[
|
||||||
|
{
|
||||||
|
name: '基本信息',
|
||||||
|
key: 'base',
|
||||||
|
rows: drawerBaseInfoRows,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: '属性列表',
|
||||||
|
key: 'attrs',
|
||||||
|
props: drawerListProps,
|
||||||
|
url: '/base/equipment-plc-param/page',
|
||||||
|
urlCreate: '/base/equipment-plc-param/create',
|
||||||
|
urlUpdate: '/base/equipment-plc-param/update',
|
||||||
|
urlDelete: '/base/equipment-plc-param/delete',
|
||||||
|
urlDetail: '/base/equipment-plc-param/get',
|
||||||
|
queryParams: {
|
||||||
|
connectId: alarmForm.id,
|
||||||
|
pageNo: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
},
|
||||||
|
tableBtn: [
|
||||||
|
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,
|
||||||
|
},
|
||||||
|
]"
|
||||||
|
@refreshDataList="getList"
|
||||||
|
@cancel="editVisible = false"
|
||||||
|
@destroy="editVisible = false" />
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import {
|
||||||
|
createEquipmentPlcConnect,
|
||||||
|
updateEquipmentPlcConnect,
|
||||||
|
deleteEquipmentPlcConnect,
|
||||||
|
getEquipmentPlcConnect,
|
||||||
|
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';
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'EquipmentPlcConnect',
|
||||||
|
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: [
|
||||||
|
{
|
||||||
|
type: 'detail',
|
||||||
|
btnName: '参数绑定',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: 'edit',
|
||||||
|
btnName: '修改',
|
||||||
|
},
|
||||||
|
// {
|
||||||
|
// type: 'params-bind',
|
||||||
|
// btnName: '参数绑定',
|
||||||
|
// },
|
||||||
|
{
|
||||||
|
type: 'delete',
|
||||||
|
btnName: '删除',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
tableProps: [
|
||||||
|
// {
|
||||||
|
// 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: '查看绑定',
|
||||||
|
// subcomponent: {
|
||||||
|
// props: ['injectData'],
|
||||||
|
// render: function (h) {
|
||||||
|
// const _this = this;
|
||||||
|
// return h(
|
||||||
|
// 'el-button',
|
||||||
|
// {
|
||||||
|
// props: { type: 'text' },
|
||||||
|
// on: {
|
||||||
|
// click: function () {
|
||||||
|
// console.log('inejctdata', _this.injectData);
|
||||||
|
// _this.$emit('emitData', {
|
||||||
|
// action: _this.injectData._action,
|
||||||
|
// payload: _this.injectData,
|
||||||
|
// });
|
||||||
|
// },
|
||||||
|
// },
|
||||||
|
// },
|
||||||
|
// '查看绑定'
|
||||||
|
// );
|
||||||
|
// },
|
||||||
|
// },
|
||||||
|
// },
|
||||||
|
],
|
||||||
|
searchBarFormConfig: [
|
||||||
|
{
|
||||||
|
type: 'select',
|
||||||
|
label: '设备名',
|
||||||
|
placeholder: '请选择设备',
|
||||||
|
param: 'equipmentId',
|
||||||
|
selectOptions: [],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: 'select',
|
||||||
|
label: '编码',
|
||||||
|
placeholder: '请选择编码',
|
||||||
|
param: 'plcId',
|
||||||
|
selectOptions: [],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: 'button',
|
||||||
|
btnName: '查询',
|
||||||
|
name: 'search',
|
||||||
|
color: 'primary',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: 'separate',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
// type: this.$auth.hasPermi('base:equipment-plc:create')
|
||||||
|
// ? 'button'
|
||||||
|
// : '',
|
||||||
|
type: 'button',
|
||||||
|
btnName: '新增',
|
||||||
|
name: 'add',
|
||||||
|
plain: true,
|
||||||
|
color: 'success',
|
||||||
|
},
|
||||||
|
// {
|
||||||
|
// type: this.$auth.hasPermi('base:equipment-plc:export') ? 'button' : '',
|
||||||
|
// btnName: '导出',
|
||||||
|
// name: 'export',
|
||||||
|
// color: 'warning',
|
||||||
|
// },
|
||||||
|
],
|
||||||
|
rows: [
|
||||||
|
[
|
||||||
|
{
|
||||||
|
select: true,
|
||||||
|
label: '关联表名',
|
||||||
|
prop: 'plcId',
|
||||||
|
labelKey: `plcTableName`,
|
||||||
|
url: '/base/equipment-plc/listAll',
|
||||||
|
rules: [{ required: true, message: '不能为空', trigger: 'blur' }],
|
||||||
|
bind: {
|
||||||
|
filterable: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
[
|
||||||
|
{
|
||||||
|
select: true,
|
||||||
|
label: '设备',
|
||||||
|
prop: 'equipmentId',
|
||||||
|
url: '/base/equipment/page?pageNo=1&pageSize=99',
|
||||||
|
rules: [{ required: true, message: '不能为空', trigger: 'blur' }],
|
||||||
|
bind: {
|
||||||
|
filterable: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
],
|
||||||
|
open: false,
|
||||||
|
// 查询参数
|
||||||
|
queryParams: {
|
||||||
|
pageNo: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
plcId: null,
|
||||||
|
equipmentId: null,
|
||||||
|
},
|
||||||
|
// 表单参数
|
||||||
|
form: {},
|
||||||
|
// 查看绑定配置
|
||||||
|
editVisible: false,
|
||||||
|
editMode: '',
|
||||||
|
drawerBaseInfoRows: [
|
||||||
|
[
|
||||||
|
{
|
||||||
|
input: true,
|
||||||
|
label: '设备名',
|
||||||
|
prop: 'equipmentName',
|
||||||
|
rules: [{ required: true, message: '不能为空', trigger: 'blur' }],
|
||||||
|
// bind: {
|
||||||
|
// disabled: this.editMode == 'detail', // some condition, like detail mode...
|
||||||
|
// }
|
||||||
|
},
|
||||||
|
{
|
||||||
|
input: true,
|
||||||
|
label: '关联表名',
|
||||||
|
prop: 'plcTableName',
|
||||||
|
// url: '/base/equipment/getCode',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
],
|
||||||
|
drawerListProps: [
|
||||||
|
{ prop: 'plcParamName', label: '参数列名' },
|
||||||
|
{ prop: 'name', label: '参数名称' },
|
||||||
|
{
|
||||||
|
prop: 'unit',
|
||||||
|
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: '是否采集',
|
||||||
|
filter: (val) => (val != null ? ['否', '是'][val] : '-'),
|
||||||
|
},
|
||||||
|
{ prop: 'minValue', label: '最小值' },
|
||||||
|
{ prop: 'maxValue', label: '最大值' },
|
||||||
|
{ prop: 'defaultValue', label: '标准值' },
|
||||||
|
{ prop: 'description', label: '描述' },
|
||||||
|
{ prop: 'remark', label: '备注' },
|
||||||
|
],
|
||||||
|
alarmForm: {
|
||||||
|
id: undefined,
|
||||||
|
equipmentName: undefined,
|
||||||
|
plcTableName: undefined,
|
||||||
|
},
|
||||||
|
};
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.getList();
|
||||||
|
this.initSearchOptions();
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
async getEquipmentOptions() {
|
||||||
|
const res = await this.$axios({
|
||||||
|
url: '/base/equipment/listAll',
|
||||||
|
method: 'get',
|
||||||
|
});
|
||||||
|
return res.data;
|
||||||
|
},
|
||||||
|
|
||||||
|
async getPlcOptions() {
|
||||||
|
const res = await this.$axios({
|
||||||
|
url: '/base/equipment-plc/listAll',
|
||||||
|
method: 'get',
|
||||||
|
});
|
||||||
|
return res.data;
|
||||||
|
},
|
||||||
|
|
||||||
|
/** 初始化查询条件 */
|
||||||
|
async initSearchOptions() {
|
||||||
|
Promise.all([this.getEquipmentOptions(), this.getPlcOptions()]).then(
|
||||||
|
([eqList, plcList]) => {
|
||||||
|
this.searchBarFormConfig[0].selectOptions = eqList.map((item) => {
|
||||||
|
return {
|
||||||
|
name: item.name,
|
||||||
|
id: item.id,
|
||||||
|
};
|
||||||
|
});
|
||||||
|
this.searchBarFormConfig[1].selectOptions = plcList.map((item) => {
|
||||||
|
return {
|
||||||
|
name: item.name,
|
||||||
|
id: item.id,
|
||||||
|
};
|
||||||
|
});
|
||||||
|
}
|
||||||
|
);
|
||||||
|
},
|
||||||
|
/** 覆盖 handleEmitFun 的默认实现 */
|
||||||
|
handleEmitFun({ action, payload }) {
|
||||||
|
switch (action) {
|
||||||
|
case 'params-bind':
|
||||||
|
this.reset();
|
||||||
|
const {
|
||||||
|
id,
|
||||||
|
equipmentName,
|
||||||
|
equipmentId,
|
||||||
|
plcId,
|
||||||
|
plcName,
|
||||||
|
plcTableName,
|
||||||
|
} = payload;
|
||||||
|
// console.log('Cha看绑定参数弹窗', id, equipmentName, plcTableName);
|
||||||
|
this.$router.push({
|
||||||
|
name: 'EquipmentPlcParam',
|
||||||
|
params: {
|
||||||
|
id,
|
||||||
|
equipmentName,
|
||||||
|
plcTableName,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
/** 查询列表 */
|
||||||
|
getList() {
|
||||||
|
this.loading = true;
|
||||||
|
// 执行查询
|
||||||
|
getEquipmentPlcConnectPage(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,
|
||||||
|
plcId: undefined,
|
||||||
|
equipmentId: 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;
|
||||||
|
getEquipmentPlcConnect(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) {
|
||||||
|
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) {
|
||||||
|
// debugger;
|
||||||
|
const {
|
||||||
|
id,
|
||||||
|
bindingParameters,
|
||||||
|
equipmentCode,
|
||||||
|
equipmentId,
|
||||||
|
equipmentName,
|
||||||
|
plcCode,
|
||||||
|
plcId,
|
||||||
|
plcName,
|
||||||
|
plcTableName,
|
||||||
|
productionLine,
|
||||||
|
workshopSection,
|
||||||
|
} = row;
|
||||||
|
// 打开抽屉
|
||||||
|
this.editMode = 'detail';
|
||||||
|
this.alarmForm.id = id;
|
||||||
|
this.alarmForm.plcTableName = plcTableName; // 关联表名
|
||||||
|
this.alarmForm.equipmentName = equipmentName;
|
||||||
|
this.editVisible = true;
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.$refs['drawer'].init();
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
/** 删除按钮操作 */
|
||||||
|
handleDelete(row) {
|
||||||
|
const id = row.id;
|
||||||
|
this.$modal
|
||||||
|
.confirm('是否删除该配置?')
|
||||||
|
.then(function () {
|
||||||
|
return deleteEquipmentPlcConnect(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 exportEquipmentPlcConnectExcel(params);
|
||||||
|
})
|
||||||
|
.then((response) => {
|
||||||
|
this.$download.excel(response, '设备与实时采集关系表(一对多).xls');
|
||||||
|
this.exportLoading = false;
|
||||||
|
})
|
||||||
|
.catch(() => {});
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
@@ -1,3 +1,10 @@
|
|||||||
|
<!--
|
||||||
|
filename: CollectionConfig.vue
|
||||||
|
author: liubin
|
||||||
|
date: 2023-10-30 10:09:03
|
||||||
|
description:
|
||||||
|
-->
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div class="app-container">
|
<div class="app-container">
|
||||||
<!-- 搜索工作栏 -->
|
<!-- 搜索工作栏 -->
|
||||||
@@ -12,7 +19,8 @@
|
|||||||
:page="queryParams.pageNo"
|
:page="queryParams.pageNo"
|
||||||
:limit="queryParams.pageSize"
|
:limit="queryParams.pageSize"
|
||||||
:table-data="list"
|
:table-data="list"
|
||||||
@emitFun="handleEmitFun">
|
@emitFun="handleEmitFun"
|
||||||
|
:max-height="tableH">
|
||||||
<method-btn
|
<method-btn
|
||||||
v-if="tableBtn.length"
|
v-if="tableBtn.length"
|
||||||
slot="handleBtn"
|
slot="handleBtn"
|
||||||
@@ -34,17 +42,21 @@
|
|||||||
<base-dialog
|
<base-dialog
|
||||||
:dialogTitle="title"
|
:dialogTitle="title"
|
||||||
:dialogVisible="open"
|
:dialogVisible="open"
|
||||||
width="700px"
|
width="30%"
|
||||||
@close="cancel"
|
@close="cancel"
|
||||||
@cancel="cancel"
|
@cancel="cancel"
|
||||||
@confirm="submitForm">
|
@confirm="submitForm">
|
||||||
<DialogForm v-if="open" ref="form" :dataForm="form" :rows="rows" />
|
<!-- <DialogForm v-if="open" ref="form" v-model="form" :rows="rows" /> -->
|
||||||
|
<add-or-update
|
||||||
|
ref="addOrUpdate"
|
||||||
|
@refreshDataList="successSubmit" />
|
||||||
</base-dialog>
|
</base-dialog>
|
||||||
|
|
||||||
<!-- 抽屉 详情 -->
|
<!-- 抽屉 详情 -->
|
||||||
<BasicDrawer
|
<BasicDrawer
|
||||||
v-if="editVisible"
|
v-if="editVisible"
|
||||||
ref="drawer"
|
ref="drawer"
|
||||||
|
size="45%"
|
||||||
:default-mode="editMode"
|
:default-mode="editMode"
|
||||||
:info-data="alarmForm"
|
:info-data="alarmForm"
|
||||||
:sections="[
|
:sections="[
|
||||||
@@ -52,9 +64,13 @@
|
|||||||
name: '基本信息',
|
name: '基本信息',
|
||||||
key: 'base',
|
key: 'base',
|
||||||
rows: drawerBaseInfoRows,
|
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',
|
key: 'attrs',
|
||||||
props: drawerListProps,
|
props: drawerListProps,
|
||||||
url: '/base/equipment-plc-param/page',
|
url: '/base/equipment-plc-param/page',
|
||||||
@@ -68,18 +84,26 @@
|
|||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
},
|
},
|
||||||
tableBtn: [
|
tableBtn: [
|
||||||
this.$auth.hasPermi('base:equipment-plc-param:update')
|
{
|
||||||
? {
|
type: 'edit',
|
||||||
type: 'edit',
|
btnName: '修改',
|
||||||
btnName: '修改',
|
},
|
||||||
}
|
{
|
||||||
: undefined,
|
type: 'delete',
|
||||||
this.$auth.hasPermi('base:equipment-plc-param:delete')
|
btnName: '删除',
|
||||||
? {
|
},
|
||||||
type: 'delete',
|
// this.$auth.hasPermi('equipment:collection-config-param:update')
|
||||||
btnName: '删除',
|
// ? {
|
||||||
}
|
// type: 'edit',
|
||||||
: undefined,
|
// btnName: '修改',
|
||||||
|
// }
|
||||||
|
// : undefined,
|
||||||
|
// this.$auth.hasPermi('equipment:collection-config-param:delete')
|
||||||
|
// ? {
|
||||||
|
// type: 'delete',
|
||||||
|
// btnName: '删除',
|
||||||
|
// }
|
||||||
|
// : undefined,
|
||||||
].filter((v) => v),
|
].filter((v) => v),
|
||||||
allowAdd: true,
|
allowAdd: true,
|
||||||
},
|
},
|
||||||
@@ -99,67 +123,60 @@ import {
|
|||||||
getEquipmentPlcConnectPage,
|
getEquipmentPlcConnectPage,
|
||||||
exportEquipmentPlcConnectExcel,
|
exportEquipmentPlcConnectExcel,
|
||||||
} from '@/api/base/equipmentPlcConnect';
|
} from '@/api/base/equipmentPlcConnect';
|
||||||
import moment from 'moment';
|
|
||||||
import basicPageMixin from '@/mixins/lb/basicPageMixin';
|
import basicPageMixin from '@/mixins/lb/basicPageMixin';
|
||||||
// import './http';
|
// import './http';
|
||||||
import BasicDrawer from './components/BasicDrawer.vue';
|
import BasicDrawer from './components/BasicDrawer.vue';
|
||||||
import { publicFormatter } from '@/utils/dict';
|
import { publicFormatter } from '@/utils/dict';
|
||||||
|
import AddOrUpdate from './add-or-updata';
|
||||||
|
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'EquipmentPlcConnect',
|
name: 'EquipmentPlcConnect',
|
||||||
mixins: [basicPageMixin],
|
mixins: [basicPageMixin, tableHeightMixin],
|
||||||
components: { BasicDrawer },
|
components: { BasicDrawer, AddOrUpdate },
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
searchBarKeys: ['equipmentId', 'plcId'],
|
searchBarKeys: ['equipmentId', 'plcId'],
|
||||||
// tableBtn: [
|
// 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),
|
// ].filter((v) => v),
|
||||||
tableBtn: [
|
tableBtn: [
|
||||||
{
|
this.$auth.hasPermiAnd([
|
||||||
type: 'detail',
|
'base:equipment-plc-connect:query',
|
||||||
btnName: '参数绑定',
|
'base:equipment-plc-param:query'
|
||||||
},
|
])
|
||||||
{
|
? {
|
||||||
type: 'edit',
|
type: 'detail',
|
||||||
btnName: '修改',
|
btnName: '参数绑定',
|
||||||
},
|
} : undefined,
|
||||||
// {
|
this.$auth.hasPermiAnd([
|
||||||
// type: 'params-bind',
|
'base:equipment-plc-connect:update',
|
||||||
// btnName: '参数绑定',
|
'base:equipment-plc-connect:query',
|
||||||
// },
|
'base:equipment-plc-param:create',
|
||||||
{
|
'base:equipment-plc-param:update',
|
||||||
type: 'delete',
|
'base:equipment-plc-param:delete',
|
||||||
btnName: '删除',
|
'base:equipment-plc-param:query'
|
||||||
},
|
])
|
||||||
],
|
? {
|
||||||
|
type: 'edit',
|
||||||
|
btnName: '修改',
|
||||||
|
}
|
||||||
|
: undefined,
|
||||||
|
this.$auth.hasPermi('base:equipment-plc-connect:delete')
|
||||||
|
? {
|
||||||
|
type: 'delete',
|
||||||
|
btnName: '删除',
|
||||||
|
}
|
||||||
|
: undefined,
|
||||||
|
].filter((v) => v),
|
||||||
tableProps: [
|
tableProps: [
|
||||||
// {
|
{ prop: 'productionLine', label: '产线', minWidth: 120, showOverflowtooltip: true },
|
||||||
// prop: 'createTime',
|
{ prop: 'workshopSection', label: '工段', minWidth: 120, showOverflowtooltip: true },
|
||||||
// label: '添加时间',
|
{ prop: 'equipmentName', label: '设备名', minWidth: 120, showOverflowtooltip: true },
|
||||||
// fixed: true,
|
{ prop: 'equipmentCode', label: '设备编码', minWidth: 200, showOverflowtooltip: true },
|
||||||
// width: 180,
|
{ prop: 'plcCode', label: '关联表编码', minWidth: 220, showOverflowtooltip: true },
|
||||||
// filter: (val) => moment(val).format('yyyy-MM-DD HH:mm:ss'),
|
{ prop: 'plcTableName', label: '关联表名', minWidth: 150, showOverflowtooltip: true },
|
||||||
// },
|
{ prop: 'plcName', label: '标识名称', minWidth: 150, showOverflowtooltip: true },
|
||||||
{ prop: 'productionLine', label: '产线' },
|
{ prop: 'bindingParameters', label: '绑定参数数量', minWidth: 120, showOverflowtooltip: true },
|
||||||
{ prop: 'workshopSection', label: '工段' },
|
|
||||||
{ prop: 'equipmentName', label: '设备名' },
|
|
||||||
{ prop: 'equipmentCode', label: '设备编码' },
|
|
||||||
{ prop: 'plcCode', label: '关联表编码' },
|
|
||||||
{ prop: 'plcTableName', label: '关联表名' },
|
|
||||||
{ prop: 'plcName', label: '标识名称' },
|
|
||||||
{ prop: 'bindingParameters', label: '绑定参数数量' },
|
|
||||||
// {
|
// {
|
||||||
// _action: 'params-bind',
|
// _action: 'params-bind',
|
||||||
// label: '查看绑定',
|
// label: '查看绑定',
|
||||||
@@ -194,13 +211,15 @@ export default {
|
|||||||
placeholder: '请选择设备',
|
placeholder: '请选择设备',
|
||||||
param: 'equipmentId',
|
param: 'equipmentId',
|
||||||
selectOptions: [],
|
selectOptions: [],
|
||||||
|
filterable: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
type: 'select',
|
type: 'select',
|
||||||
label: '编码',
|
label: '关联表编码',
|
||||||
placeholder: '请选择编码',
|
placeholder: '请选择关联表编码',
|
||||||
param: 'plcId',
|
param: 'plcId',
|
||||||
selectOptions: [],
|
selectOptions: [],
|
||||||
|
filterable: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
type: 'button',
|
type: 'button',
|
||||||
@@ -209,20 +228,21 @@ export default {
|
|||||||
color: 'primary',
|
color: 'primary',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
type: 'separate',
|
type: this.$auth.hasPermi('base:equipment-plc-connect:create')
|
||||||
|
? 'separate' : '',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
// type: this.$auth.hasPermi('base:equipment-plc:create')
|
type: this.$auth.hasPermi('base:equipment-plc-connect:create')
|
||||||
// ? 'button'
|
? 'button'
|
||||||
// : '',
|
: '',
|
||||||
type: 'button',
|
// type: 'button',
|
||||||
btnName: '新增',
|
btnName: '新增',
|
||||||
name: 'add',
|
name: 'add',
|
||||||
plain: true,
|
plain: true,
|
||||||
color: 'success',
|
color: 'success',
|
||||||
},
|
},
|
||||||
// {
|
// {
|
||||||
// type: this.$auth.hasPermi('base:equipment-plc:export') ? 'button' : '',
|
// type: this.$auth.hasPermi('equipment:collection-config:export') ? 'button' : '',
|
||||||
// btnName: '导出',
|
// btnName: '导出',
|
||||||
// name: 'export',
|
// name: 'export',
|
||||||
// color: 'warning',
|
// color: 'warning',
|
||||||
@@ -236,7 +256,9 @@ export default {
|
|||||||
prop: 'plcId',
|
prop: 'plcId',
|
||||||
labelKey: `plcTableName`,
|
labelKey: `plcTableName`,
|
||||||
url: '/base/equipment-plc/listAll',
|
url: '/base/equipment-plc/listAll',
|
||||||
rules: [{ required: true, message: '不能为空', trigger: 'blur' }],
|
rules: [
|
||||||
|
{ required: true, message: '关联表名不能为空', trigger: 'blur' },
|
||||||
|
],
|
||||||
bind: {
|
bind: {
|
||||||
filterable: true,
|
filterable: true,
|
||||||
},
|
},
|
||||||
@@ -247,8 +269,10 @@ export default {
|
|||||||
select: true,
|
select: true,
|
||||||
label: '设备',
|
label: '设备',
|
||||||
prop: 'equipmentId',
|
prop: 'equipmentId',
|
||||||
url: '/base/equipment/page?pageNo=1&pageSize=99',
|
url: '/base/core-equipment/page?pageNo=1&pageSize=99',
|
||||||
rules: [{ required: true, message: '不能为空', trigger: 'blur' }],
|
rules: [
|
||||||
|
{ required: true, message: '设备不能为空', trigger: 'blur' },
|
||||||
|
],
|
||||||
bind: {
|
bind: {
|
||||||
filterable: true,
|
filterable: true,
|
||||||
},
|
},
|
||||||
@@ -259,7 +283,7 @@ export default {
|
|||||||
// 查询参数
|
// 查询参数
|
||||||
queryParams: {
|
queryParams: {
|
||||||
pageNo: 1,
|
pageNo: 1,
|
||||||
pageSize: 10,
|
pageSize: 20,
|
||||||
plcId: null,
|
plcId: null,
|
||||||
equipmentId: null,
|
equipmentId: null,
|
||||||
},
|
},
|
||||||
@@ -274,7 +298,9 @@ export default {
|
|||||||
input: true,
|
input: true,
|
||||||
label: '设备名',
|
label: '设备名',
|
||||||
prop: 'equipmentName',
|
prop: 'equipmentName',
|
||||||
rules: [{ required: true, message: '不能为空', trigger: 'blur' }],
|
rules: [
|
||||||
|
{ required: true, message: '设备名不能为空', trigger: 'blur' },
|
||||||
|
],
|
||||||
// bind: {
|
// bind: {
|
||||||
// disabled: this.editMode == 'detail', // some condition, like detail mode...
|
// disabled: this.editMode == 'detail', // some condition, like detail mode...
|
||||||
// }
|
// }
|
||||||
@@ -283,7 +309,7 @@ export default {
|
|||||||
input: true,
|
input: true,
|
||||||
label: '关联表名',
|
label: '关联表名',
|
||||||
prop: 'plcTableName',
|
prop: 'plcTableName',
|
||||||
// url: '/base/equipment/getCode',
|
// url: '/base/core-equipment/getCode',
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
@@ -295,6 +321,23 @@ export default {
|
|||||||
label: '单位',
|
label: '单位',
|
||||||
filter: publicFormatter('unit_dict'),
|
filter: publicFormatter('unit_dict'),
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
prop: 'equipmentParamType',
|
||||||
|
label: '设备参数类型',
|
||||||
|
filter: (val) =>
|
||||||
|
val != null
|
||||||
|
? ['', '一般参数', '工艺参数', '报警参数', ''][val]
|
||||||
|
: '-',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: 'productionParamType',
|
||||||
|
label: '生产参数类型',
|
||||||
|
filter: (val) =>
|
||||||
|
val != null
|
||||||
|
? // ? ['', '进片数量', '出片数量', '破损数量', '无类型', ''][val]
|
||||||
|
['', '进口计数', '出口计数', '损耗计数', '无类型', ''][val]
|
||||||
|
: '-',
|
||||||
|
},
|
||||||
{
|
{
|
||||||
prop: 'collection',
|
prop: 'collection',
|
||||||
label: '是否采集',
|
label: '是否采集',
|
||||||
@@ -318,6 +361,10 @@ export default {
|
|||||||
this.initSearchOptions();
|
this.initSearchOptions();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
successSubmit() {
|
||||||
|
this.cancel()
|
||||||
|
this.getList()
|
||||||
|
},
|
||||||
async getEquipmentOptions() {
|
async getEquipmentOptions() {
|
||||||
const res = await this.$axios({
|
const res = await this.$axios({
|
||||||
url: '/base/equipment/listAll',
|
url: '/base/equipment/listAll',
|
||||||
@@ -325,7 +372,6 @@ export default {
|
|||||||
});
|
});
|
||||||
return res.data;
|
return res.data;
|
||||||
},
|
},
|
||||||
|
|
||||||
async getPlcOptions() {
|
async getPlcOptions() {
|
||||||
const res = await this.$axios({
|
const res = await this.$axios({
|
||||||
url: '/base/equipment-plc/listAll',
|
url: '/base/equipment-plc/listAll',
|
||||||
@@ -346,7 +392,7 @@ export default {
|
|||||||
});
|
});
|
||||||
this.searchBarFormConfig[1].selectOptions = plcList.map((item) => {
|
this.searchBarFormConfig[1].selectOptions = plcList.map((item) => {
|
||||||
return {
|
return {
|
||||||
name: item.name,
|
name: item.code,
|
||||||
id: item.id,
|
id: item.id,
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
@@ -403,6 +449,19 @@ export default {
|
|||||||
};
|
};
|
||||||
this.resetForm('form');
|
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() {
|
handleQuery() {
|
||||||
this.queryParams.pageNo = 1;
|
this.queryParams.pageNo = 1;
|
||||||
@@ -417,7 +476,10 @@ export default {
|
|||||||
handleAdd() {
|
handleAdd() {
|
||||||
this.reset();
|
this.reset();
|
||||||
this.open = true;
|
this.open = true;
|
||||||
this.title = '添加设备与实时采集关系表(一对多)';
|
this.title = '添加设备采集配置';
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.$refs.addOrUpdate.init()
|
||||||
|
})
|
||||||
},
|
},
|
||||||
/** 修改按钮操作 */
|
/** 修改按钮操作 */
|
||||||
handleUpdate(row) {
|
handleUpdate(row) {
|
||||||
@@ -426,35 +488,16 @@ export default {
|
|||||||
getEquipmentPlcConnect(id).then((response) => {
|
getEquipmentPlcConnect(id).then((response) => {
|
||||||
this.form = response.data;
|
this.form = response.data;
|
||||||
this.open = true;
|
this.open = true;
|
||||||
this.title = '修改设备与实时采集关系表(一对多)';
|
this.title = '修改设备采集配置';
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
/** 提交按钮 */
|
/** 提交按钮 */
|
||||||
submitForm() {
|
submitForm() {
|
||||||
this.$refs['form'].validate((valid) => {
|
this.$refs.addOrUpdate.dataFormSubmit()
|
||||||
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) {
|
handleDetail(row, mode = 'detail') {
|
||||||
// debugger;
|
// debugger;
|
||||||
const {
|
const {
|
||||||
id,
|
id,
|
||||||
@@ -470,7 +513,7 @@ export default {
|
|||||||
workshopSection,
|
workshopSection,
|
||||||
} = row;
|
} = row;
|
||||||
// 打开抽屉
|
// 打开抽屉
|
||||||
this.editMode = 'detail';
|
this.editMode = mode;
|
||||||
this.alarmForm.id = id;
|
this.alarmForm.id = id;
|
||||||
this.alarmForm.plcTableName = plcTableName; // 关联表名
|
this.alarmForm.plcTableName = plcTableName; // 关联表名
|
||||||
this.alarmForm.equipmentName = equipmentName;
|
this.alarmForm.equipmentName = equipmentName;
|
||||||
|
|||||||
@@ -38,7 +38,7 @@
|
|||||||
@close="cancel"
|
@close="cancel"
|
||||||
@cancel="cancel"
|
@cancel="cancel"
|
||||||
@confirm="submitForm">
|
@confirm="submitForm">
|
||||||
<DialogForm v-if="open" ref="form" :dataForm="form" :rows="rows" />
|
<DialogForm v-if="open" ref="form" v-model="form" :rows="rows" />
|
||||||
</base-dialog>
|
</base-dialog>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
94
src/views/base/material/add-or-updata.vue
Normal file
94
src/views/base/material/add-or-updata.vue
Normal file
@@ -0,0 +1,94 @@
|
|||||||
|
<!--
|
||||||
|
* @Author: zwq
|
||||||
|
* @Date: 2023-08-01 13:52:10
|
||||||
|
* @LastEditors: zwq
|
||||||
|
* @LastEditTime: 2024-04-10 09:30:06
|
||||||
|
* @Description:
|
||||||
|
-->
|
||||||
|
<template>
|
||||||
|
<el-form
|
||||||
|
:model="dataForm"
|
||||||
|
:rules="dataRule"
|
||||||
|
ref="dataForm"
|
||||||
|
v-if="visible"
|
||||||
|
@keyup.enter.native="dataFormSubmit()"
|
||||||
|
label-width="100px"
|
||||||
|
label-position="top">
|
||||||
|
<el-row :gutter="20">
|
||||||
|
<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="level">
|
||||||
|
<el-input v-model="dataForm.level" clearable
|
||||||
|
placeholder="请输入原料等级" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="原料编码" prop="code">
|
||||||
|
<el-input v-model="dataForm.code" readonly />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="单位" prop="unit">
|
||||||
|
<el-select
|
||||||
|
v-model="dataForm.unit"
|
||||||
|
filterable
|
||||||
|
clearable
|
||||||
|
:style="{ width: '100%' }"
|
||||||
|
placeholder="请选择单位">
|
||||||
|
<el-option
|
||||||
|
v-for="item in urlOptions.dictArr.dict0"
|
||||||
|
:key="item.id"
|
||||||
|
:label="item.label"
|
||||||
|
:value="item.value"></el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</el-form>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import basicAdd from '@/mixins/basic-add';
|
||||||
|
import {
|
||||||
|
createMaterial,
|
||||||
|
updateMaterial,
|
||||||
|
getMaterial,
|
||||||
|
getCode
|
||||||
|
} from '@/api/base/material';
|
||||||
|
|
||||||
|
export default {
|
||||||
|
mixins: [basicAdd],
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
urlOptions: {
|
||||||
|
createURL: createMaterial,
|
||||||
|
updateURL: updateMaterial,
|
||||||
|
infoURL: getMaterial,
|
||||||
|
codeURL: getCode, //获取code接口(返回结果为dataForm.code字段)
|
||||||
|
dictNameList: ['unit_dict'], //数据字典name数组
|
||||||
|
},
|
||||||
|
dataForm: {
|
||||||
|
id: undefined,
|
||||||
|
code: '',
|
||||||
|
name: '',
|
||||||
|
unit: '',
|
||||||
|
level: '',
|
||||||
|
},
|
||||||
|
dataRule: {
|
||||||
|
name: [
|
||||||
|
{ required: true, message: '原料不能为空', trigger: 'blur' },
|
||||||
|
],
|
||||||
|
code: [{ required: true, message: '编码不能为空', trigger: 'blur' }],
|
||||||
|
},
|
||||||
|
};
|
||||||
|
},
|
||||||
|
created() {},
|
||||||
|
methods: {
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
180
src/views/base/material/index.vue
Normal file
180
src/views/base/material/index.vue
Normal file
@@ -0,0 +1,180 @@
|
|||||||
|
<template>
|
||||||
|
<div class="app-container">
|
||||||
|
<!-- 搜索工作栏 -->
|
||||||
|
<search-bar
|
||||||
|
:formConfigs="formConfig"
|
||||||
|
ref="searchBarForm"
|
||||||
|
@headBtnClick="buttonClick" />
|
||||||
|
|
||||||
|
<!-- 列表 -->
|
||||||
|
<base-table
|
||||||
|
v-loading="dataListLoading"
|
||||||
|
:table-props="tableProps"
|
||||||
|
:page="listQuery.pageNo"
|
||||||
|
:limit="listQuery.pageSize"
|
||||||
|
:table-data="tableData">
|
||||||
|
<method-btn
|
||||||
|
v-if="tableBtn.length"
|
||||||
|
slot="handleBtn"
|
||||||
|
:width="90"
|
||||||
|
label="操作"
|
||||||
|
:method-list="tableBtn"
|
||||||
|
@clickBtn="handleClick" />
|
||||||
|
</base-table>
|
||||||
|
<pagination
|
||||||
|
:limit.sync="listQuery.pageSize"
|
||||||
|
:page.sync="listQuery.pageNo"
|
||||||
|
:total="listQuery.total"
|
||||||
|
@pagination="getDataList" />
|
||||||
|
|
||||||
|
<!-- 对话框(添加 / 修改) -->
|
||||||
|
<base-dialog
|
||||||
|
:dialogTitle="addOrEditTitle"
|
||||||
|
:dialogVisible="addOrUpdateVisible"
|
||||||
|
@cancel="handleCancel"
|
||||||
|
@confirm="handleConfirm"
|
||||||
|
:before-close="handleCancel"
|
||||||
|
width="40%">
|
||||||
|
<add-or-update
|
||||||
|
ref="addOrUpdate"
|
||||||
|
@refreshDataList="successSubmit"></add-or-update>
|
||||||
|
</base-dialog>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import AddOrUpdate from './add-or-updata';
|
||||||
|
import basicPage from '@/mixins/basic-page';
|
||||||
|
import { parseTime } from '@/filter/code-filter';
|
||||||
|
import { publicFormatter } from "@/utils/dict";
|
||||||
|
import {
|
||||||
|
deleteMaterial,
|
||||||
|
getMaterialPage,
|
||||||
|
} from '@/api/base/material';
|
||||||
|
|
||||||
|
const tableProps = [
|
||||||
|
{
|
||||||
|
prop: 'createTime',
|
||||||
|
label: '添加时间',
|
||||||
|
filter: parseTime,
|
||||||
|
minWidth: 150
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: 'name',
|
||||||
|
label: '原料名称',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: 'code',
|
||||||
|
label: '原料编码',
|
||||||
|
width: 180,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: 'unit',
|
||||||
|
label: '单位',
|
||||||
|
filter: publicFormatter('unit_dict'),
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
|
export default {
|
||||||
|
mixins: [basicPage],
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
urlOptions: {
|
||||||
|
getDataListURL: getMaterialPage,
|
||||||
|
deleteURL: deleteMaterial,
|
||||||
|
},
|
||||||
|
tableProps,
|
||||||
|
tableBtn: [
|
||||||
|
this.$auth.hasPermi(`base:material:update`)
|
||||||
|
? {
|
||||||
|
type: 'edit',
|
||||||
|
btnName: '编辑',
|
||||||
|
}
|
||||||
|
: undefined,
|
||||||
|
this.$auth.hasPermi(`base:material:delete`)
|
||||||
|
? {
|
||||||
|
type: 'delete',
|
||||||
|
btnName: '删除',
|
||||||
|
}
|
||||||
|
: undefined,
|
||||||
|
].filter((v) => v),
|
||||||
|
tableData: [],
|
||||||
|
formConfig: [
|
||||||
|
{
|
||||||
|
type: 'input',
|
||||||
|
label: '原料名称',
|
||||||
|
placeholder: '原料名称',
|
||||||
|
param: 'name'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: 'input',
|
||||||
|
label: '原料编码',
|
||||||
|
placeholder: '原料编码',
|
||||||
|
param: 'code'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: this.$auth.hasPermi('base:material:query')
|
||||||
|
? 'button'
|
||||||
|
: '',
|
||||||
|
btnName: '查询',
|
||||||
|
name: 'search',
|
||||||
|
color: 'primary',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type:
|
||||||
|
this.$auth.hasPermi('base:material:create') &&
|
||||||
|
this.$auth.hasPermi('base:material:query')
|
||||||
|
? 'separate'
|
||||||
|
: '',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: this.$auth.hasPermi('base:material:create')
|
||||||
|
? 'button'
|
||||||
|
: '',
|
||||||
|
btnName: '新增',
|
||||||
|
name: 'add',
|
||||||
|
color: 'success',
|
||||||
|
plain: true,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
};
|
||||||
|
},
|
||||||
|
components: {
|
||||||
|
AddOrUpdate,
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
buttonClick(val) {
|
||||||
|
switch (val.btnName) {
|
||||||
|
case 'search':
|
||||||
|
this.listQuery.pageNo = 1;
|
||||||
|
this.listQuery.pageSize = 10;
|
||||||
|
this.listQuery.name = val.name;
|
||||||
|
this.listQuery.code = val.code;
|
||||||
|
this.getDataList();
|
||||||
|
break;
|
||||||
|
case 'reset':
|
||||||
|
this.$refs.searchBarForm.resetForm();
|
||||||
|
this.listQuery = {
|
||||||
|
pageSize: 20,
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
156
src/views/base/materialPricing/add-or-updata.vue
Normal file
156
src/views/base/materialPricing/add-or-updata.vue
Normal file
@@ -0,0 +1,156 @@
|
|||||||
|
<!--
|
||||||
|
* @Author: zwq
|
||||||
|
* @Date: 2023-08-01 13:52:10
|
||||||
|
* @LastEditors: zwq
|
||||||
|
* @LastEditTime: 2024-04-11 09:05:16
|
||||||
|
* @Description:
|
||||||
|
-->
|
||||||
|
<template>
|
||||||
|
<el-form
|
||||||
|
:model="dataForm"
|
||||||
|
:rules="dataRule"
|
||||||
|
ref="dataForm"
|
||||||
|
v-if="visible"
|
||||||
|
@keyup.enter.native="dataFormSubmit()"
|
||||||
|
label-width="100px"
|
||||||
|
label-position="top">
|
||||||
|
<el-row :gutter="20">
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="原料名称" prop="materialId">
|
||||||
|
<el-select
|
||||||
|
v-model="dataForm.materialId"
|
||||||
|
filterable
|
||||||
|
@change="setCode"
|
||||||
|
:style="{ width: '100%' }"
|
||||||
|
placeholder="请选择原料名称">
|
||||||
|
<el-option
|
||||||
|
v-for="item in MaterialList"
|
||||||
|
:key="item.id"
|
||||||
|
:label="item.name"
|
||||||
|
:value="item.id"></el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="原料编码" prop="code">
|
||||||
|
<el-input v-model="dataForm.code" clearable readonly />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="生效开始时间" prop="startTime">
|
||||||
|
<el-date-picker
|
||||||
|
v-model="dataForm.startTime"
|
||||||
|
type="date"
|
||||||
|
value-format="timestamp"
|
||||||
|
:style="{ width: '100%' }"
|
||||||
|
placeholder="选择开始时间"></el-date-picker>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="生效结束时间" prop="endTime">
|
||||||
|
<el-date-picker
|
||||||
|
v-model="dataForm.endTime"
|
||||||
|
type="date"
|
||||||
|
value-format="timestamp"
|
||||||
|
:style="{ width: '100%' }"
|
||||||
|
placeholder="选择结束时间"></el-date-picker>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="单价" prop="price">
|
||||||
|
<el-input-number
|
||||||
|
:min="0"
|
||||||
|
style="width: 75%"
|
||||||
|
v-model="dataForm.price"
|
||||||
|
clearable
|
||||||
|
placeholder="请输入允许留存时间" />
|
||||||
|
{{ unit }}
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="备注" prop="remark">
|
||||||
|
<el-input
|
||||||
|
v-model="dataForm.remark"
|
||||||
|
clearable
|
||||||
|
placeholder="请输入备注" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</el-form>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import basicAdd from '@/mixins/basic-add';
|
||||||
|
import {
|
||||||
|
createMaterialPricing,
|
||||||
|
updateMaterialPricing,
|
||||||
|
getMaterialPricing,
|
||||||
|
} from '@/api/base/materialPricing';
|
||||||
|
import { getMaterialPage } from '@/api/base/material';
|
||||||
|
|
||||||
|
export default {
|
||||||
|
mixins: [basicAdd],
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
urlOptions: {
|
||||||
|
createURL: createMaterialPricing,
|
||||||
|
updateURL: updateMaterialPricing,
|
||||||
|
infoURL: getMaterialPricing,
|
||||||
|
optionArrUrl: [getMaterialPage], //需要获取下拉框的方法数组
|
||||||
|
dictNameList: ['unit_dict'], //数据字典name数组
|
||||||
|
},
|
||||||
|
dataForm: {
|
||||||
|
id: null,
|
||||||
|
code: '',
|
||||||
|
materialId: '',
|
||||||
|
price: '',
|
||||||
|
startTime: new Date().getTime(),
|
||||||
|
endTime: null,
|
||||||
|
remark: '',
|
||||||
|
},
|
||||||
|
setData: true,
|
||||||
|
MaterialList: [],
|
||||||
|
unit: '元/吨',
|
||||||
|
dataRule: {
|
||||||
|
materialId: [
|
||||||
|
{ required: true, message: '原料不能为空', trigger: 'blur' },
|
||||||
|
],
|
||||||
|
price: [{ required: true, message: '单价不能为空', trigger: 'blur' }],
|
||||||
|
startTime: [
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
message: '生效开始时间不能为空',
|
||||||
|
trigger: 'change',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
};
|
||||||
|
},
|
||||||
|
created() {},
|
||||||
|
methods: {
|
||||||
|
getArr() {
|
||||||
|
getMaterialPage({ pageSize: 100, pageNo: 1 }).then((response) => {
|
||||||
|
this.MaterialList = response.data.list;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
setDataForm() {
|
||||||
|
if (this.MaterialList.length > 0) {
|
||||||
|
this.setCode();
|
||||||
|
} else {
|
||||||
|
setTimeout(this.setCode(), 1000);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
setCode() {
|
||||||
|
this.MaterialList.forEach((item) => {
|
||||||
|
if (item.id === this.dataForm.materialId) {
|
||||||
|
this.dataForm.code = item.code;
|
||||||
|
this.unit =
|
||||||
|
'元/' +
|
||||||
|
this.urlOptions.dictArr.dict0.find((d) => d.value === item.unit)
|
||||||
|
.label;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
23
src/views/base/materialPricing/connectTime.vue
Normal file
23
src/views/base/materialPricing/connectTime.vue
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
<!--
|
||||||
|
* @Author: zwq
|
||||||
|
* @Date: 2023-12-05 13:45:59
|
||||||
|
* @LastEditors: zwq
|
||||||
|
* @LastEditTime: 2024-04-10 15:20:11
|
||||||
|
* @Description
|
||||||
|
-->
|
||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
<span>{{ parseTime(injectData.startTime,'{y}年{m}月{d}日') + '-' + (parseTime(injectData.endTime)?parseTime(injectData.endTime,'{y}年{m}月{d}日'):'永久') }}</span>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
name: '',
|
||||||
|
props: {
|
||||||
|
injectData: {
|
||||||
|
type: Object,
|
||||||
|
default: () => ({}),
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
182
src/views/base/materialPricing/index.vue
Normal file
182
src/views/base/materialPricing/index.vue
Normal file
@@ -0,0 +1,182 @@
|
|||||||
|
<template>
|
||||||
|
<div class="app-container">
|
||||||
|
<!-- 搜索工作栏 -->
|
||||||
|
<search-bar
|
||||||
|
:formConfigs="formConfig"
|
||||||
|
ref="searchBarForm"
|
||||||
|
@headBtnClick="buttonClick" />
|
||||||
|
|
||||||
|
<!-- 列表 -->
|
||||||
|
<base-table
|
||||||
|
v-loading="dataListLoading"
|
||||||
|
:table-props="tableProps"
|
||||||
|
:page="listQuery.pageNo"
|
||||||
|
:limit="listQuery.pageSize"
|
||||||
|
:table-data="tableData">
|
||||||
|
<method-btn
|
||||||
|
v-if="tableBtn.length"
|
||||||
|
slot="handleBtn"
|
||||||
|
:width="90"
|
||||||
|
label="操作"
|
||||||
|
:method-list="tableBtn"
|
||||||
|
@clickBtn="handleClick" />
|
||||||
|
</base-table>
|
||||||
|
<pagination
|
||||||
|
:limit.sync="listQuery.pageSize"
|
||||||
|
:page.sync="listQuery.pageNo"
|
||||||
|
:total="listQuery.total"
|
||||||
|
@pagination="getDataList" />
|
||||||
|
|
||||||
|
<!-- 对话框(添加 / 修改) -->
|
||||||
|
<base-dialog
|
||||||
|
:dialogTitle="addOrEditTitle"
|
||||||
|
:dialogVisible="addOrUpdateVisible"
|
||||||
|
@cancel="handleCancel"
|
||||||
|
@confirm="handleConfirm"
|
||||||
|
:before-close="handleCancel"
|
||||||
|
width="40%">
|
||||||
|
<add-or-update
|
||||||
|
ref="addOrUpdate"
|
||||||
|
@refreshDataList="successSubmit"></add-or-update>
|
||||||
|
</base-dialog>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import AddOrUpdate from './add-or-updata';
|
||||||
|
import connectTime from './connectTime';
|
||||||
|
import basicPage from '@/mixins/basic-page';
|
||||||
|
import { parseTime } from '@/filter/code-filter';
|
||||||
|
import {
|
||||||
|
deleteMaterialPricing,
|
||||||
|
getMaterialPricingPage,
|
||||||
|
} from '@/api/base/materialPricing';
|
||||||
|
import { getMaterialPage } from '@/api/base/material';
|
||||||
|
|
||||||
|
const tableProps = [
|
||||||
|
{
|
||||||
|
prop: 'name',
|
||||||
|
label: '原料名称',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: 'code',
|
||||||
|
label: '原料编码',
|
||||||
|
width: 180,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: 'price',
|
||||||
|
label: '单价(元/吨)',
|
||||||
|
align: 'right',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: 'createTime',
|
||||||
|
label: '生效时间',
|
||||||
|
width: 235,
|
||||||
|
subcomponent: connectTime,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: 'remark',
|
||||||
|
label: '备注',
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
|
export default {
|
||||||
|
mixins: [basicPage],
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
urlOptions: {
|
||||||
|
getDataListURL: getMaterialPricingPage,
|
||||||
|
deleteURL: deleteMaterialPricing,
|
||||||
|
},
|
||||||
|
tableProps,
|
||||||
|
tableBtn: [
|
||||||
|
this.$auth.hasPermi(`base:material-pricing:update`)
|
||||||
|
? {
|
||||||
|
type: 'edit',
|
||||||
|
btnName: '编辑',
|
||||||
|
}
|
||||||
|
: undefined,
|
||||||
|
this.$auth.hasPermi(`base:material-pricing:delete`)
|
||||||
|
? {
|
||||||
|
type: 'delete',
|
||||||
|
btnName: '删除',
|
||||||
|
}
|
||||||
|
: undefined,
|
||||||
|
].filter((v) => v),
|
||||||
|
tableData: [],
|
||||||
|
formConfig: [
|
||||||
|
{
|
||||||
|
type: 'select',
|
||||||
|
label: '原料名称',
|
||||||
|
selectOptions: [],
|
||||||
|
param: 'name',
|
||||||
|
filterable: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: this.$auth.hasPermi('base:material-pricing:query')
|
||||||
|
? 'button'
|
||||||
|
: '',
|
||||||
|
btnName: '查询',
|
||||||
|
name: 'search',
|
||||||
|
color: 'primary',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type:
|
||||||
|
this.$auth.hasPermi('base:material-pricing:create') &&
|
||||||
|
this.$auth.hasPermi('base:material-pricing:query')
|
||||||
|
? 'separate'
|
||||||
|
: '',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: this.$auth.hasPermi('base:material-pricing:create')
|
||||||
|
? 'button'
|
||||||
|
: '',
|
||||||
|
btnName: '新增',
|
||||||
|
name: 'add',
|
||||||
|
color: 'success',
|
||||||
|
plain: true,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
};
|
||||||
|
},
|
||||||
|
components: {
|
||||||
|
AddOrUpdate,
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
getMaterialPage({ pageSize: 100, pageNo: 1 }).then((response) => {
|
||||||
|
this.formConfig[0].selectOptions = response.data.list;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
buttonClick(val) {
|
||||||
|
switch (val.btnName) {
|
||||||
|
case 'search':
|
||||||
|
this.listQuery.pageNo = 1;
|
||||||
|
this.listQuery.pageSize = 10;
|
||||||
|
this.listQuery.materialId = val.name;
|
||||||
|
this.getDataList();
|
||||||
|
break;
|
||||||
|
case 'reset':
|
||||||
|
this.$refs.searchBarForm.resetForm();
|
||||||
|
this.listQuery = {
|
||||||
|
pageSize: 20,
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
@@ -1,65 +0,0 @@
|
|||||||
<!--
|
|
||||||
* @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>
|
|
||||||
@@ -1,421 +0,0 @@
|
|||||||
<!--
|
|
||||||
* @Author: zhp
|
|
||||||
* @Date: 2023-10-17 16:50:19
|
|
||||||
* @LastEditTime: 2023-10-18 15:31:12
|
|
||||||
* @LastEditors: zhp
|
|
||||||
* @Description:
|
|
||||||
-->
|
|
||||||
<template>
|
|
||||||
<el-dialog :visible.sync="visible" :show-close="false" :wrapper-closable="false" width="40%">
|
|
||||||
<small-title slot="title" :no-padding="true">
|
|
||||||
{{ !dataForm.id ? '新增' : '编辑' }}
|
|
||||||
</small-title>
|
|
||||||
|
|
||||||
<div class="content">
|
|
||||||
<div class="visual-part">
|
|
||||||
<el-form ref="dataForm" :model="dataForm" :rules="dataRule" label-width="100px"
|
|
||||||
@keyup.enter.native="dataFormSubmit">
|
|
||||||
<el-row :gutter="20">
|
|
||||||
<el-col :span="12">
|
|
||||||
<el-form-item label="包装流水号" prop="packagingCode">
|
|
||||||
<el-input v-model="dataForm.packagingCode" clearable placeholder="请输入包装流水号" />
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="12">
|
|
||||||
<el-form-item label="内容" prop="content">
|
|
||||||
<el-input v-model="dataForm.content" clearable placeholder="请输入内容" />
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
<el-row :gutter="20">
|
|
||||||
<el-col :span="12">
|
|
||||||
<el-form-item label="所属工单" prop="workOrderId">
|
|
||||||
<el-select v-model="dataForm.workOrderId" style="width: 100%;" placeholder="请选择所属工单">
|
|
||||||
<el-option v-for="dict in workOrderList" clearable :key="dict.id" :label="dict.name"
|
|
||||||
:value="dict.id" />
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="12">
|
|
||||||
<el-form-item label="客户" prop="customerId">
|
|
||||||
<el-select v-model="dataForm.customerId" style="width: 100%;" placeholder="请选择客户">
|
|
||||||
<el-option v-for="dict in customerList" clearable :key="dict.id" :label="dict.name"
|
|
||||||
:value="dict.id" />
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
<el-row :gutter="20">
|
|
||||||
<el-col :span="12">
|
|
||||||
<el-form-item label="标签模板" prop="modelId">
|
|
||||||
<el-select v-model="dataForm.modelId" style="width: 100%;" placeholder="请选择标签模板">
|
|
||||||
<el-option v-for="dict in modelList" clearable :key="dict.id"
|
|
||||||
:label="dict.name" :value="dict.id" />
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<!-- <el-col :span="12">
|
|
||||||
<el-form-item label="单位平方数" prop="area">
|
|
||||||
<el-input v-model="dataForm.area" placeholder="请输入单位平方数" />
|
|
||||||
</el-form-item>
|
|
||||||
</el-col> -->
|
|
||||||
</el-row>
|
|
||||||
<!-- <el-row :gutter="20">
|
|
||||||
<el-col :span="24">
|
|
||||||
<el-form-item label="完成单位产品用时" prop="processTime">
|
|
||||||
<el-input v-model="dataForm.processTime" placeholder="请输入完成单位产品用时" />
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
</el-row> -->
|
|
||||||
</el-form>
|
|
||||||
|
|
||||||
<!-- <small-title
|
|
||||||
style="margin: 16px 0; padding-left: 8px"
|
|
||||||
:no-padding="true">
|
|
||||||
产品属性列表
|
|
||||||
</small-title>
|
|
||||||
|
|
||||||
<div class="attr-list">
|
|
||||||
<base-table
|
|
||||||
:table-props="tableProps"
|
|
||||||
:page="listQuery.pageNo"
|
|
||||||
:limit="listQuery.pageSize"
|
|
||||||
:add-button-show="isdetail ? null : '添加属性'"
|
|
||||||
@emitButtonClick="addNew()"
|
|
||||||
:table-data="productAttributeList">
|
|
||||||
<method-btn
|
|
||||||
v-if="!isdetail"
|
|
||||||
slot="handleBtn"
|
|
||||||
:width="120"
|
|
||||||
label="操作"
|
|
||||||
:method-list="tableBtn"
|
|
||||||
@clickBtn="handleClick" />
|
|
||||||
</base-table>
|
|
||||||
<pagination
|
|
||||||
v-show="listQuery.total > 0"
|
|
||||||
:total="listQuery.total"
|
|
||||||
:page.sync="listQuery.pageNo"
|
|
||||||
:limit.sync="listQuery.pageSize"
|
|
||||||
:page-sizes="[5, 10, 15]"
|
|
||||||
@pagination="getList" />
|
|
||||||
</div> -->
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- <div style="position: absolute; bottom: 24px; right: 24px">
|
|
||||||
<el-button style="margin-right: 10px" @click="goback()">返回</el-button>
|
|
||||||
<el-button v-if="isdetail" type="primary" @click="goEdit()">
|
|
||||||
编辑
|
|
||||||
</el-button>
|
|
||||||
<span v-if="!isdetail">
|
|
||||||
<el-button type="primary" @click="dataFormSubmit()">保存</el-button>
|
|
||||||
<el-button
|
|
||||||
v-if="dataForm.id && !isdetail"
|
|
||||||
type="primary"
|
|
||||||
@click="addNew()">
|
|
||||||
添加属性
|
|
||||||
</el-button>
|
|
||||||
</span>
|
|
||||||
</div> -->
|
|
||||||
<template slot="footer">
|
|
||||||
<el-button style="" @click="goback()">取消</el-button>
|
|
||||||
<!-- <el-button v-if="isdetail" type="primary" @click="goEdit()">
|
|
||||||
编辑
|
|
||||||
</el-button> -->
|
|
||||||
<el-button type="primary" @click="dataFormSubmit()">确定</el-button>
|
|
||||||
</template>
|
|
||||||
</el-dialog>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
|
|
||||||
import {
|
|
||||||
createPacking,
|
|
||||||
updatePacking,
|
|
||||||
getPacking,
|
|
||||||
getWorkOrderList,
|
|
||||||
getCode,
|
|
||||||
getCustomerList,
|
|
||||||
getModelList
|
|
||||||
} from '@/api/base/packingInfo.js';
|
|
||||||
// import productAttrAdd from './attr-add';
|
|
||||||
import { parseTime } from '../mixins/code-filter';
|
|
||||||
import SmallTitle from './SmallTitle';
|
|
||||||
|
|
||||||
const tableBtn = [
|
|
||||||
{
|
|
||||||
type: 'edit',
|
|
||||||
btnName: '编辑',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
type: 'delete',
|
|
||||||
btnName: '删除',
|
|
||||||
},
|
|
||||||
];
|
|
||||||
const tableProps = [
|
|
||||||
{
|
|
||||||
prop: 'createTime',
|
|
||||||
label: '添加时间',
|
|
||||||
filter: parseTime,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
prop: 'name',
|
|
||||||
label: '属性名',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
prop: 'value',
|
|
||||||
label: '属性值',
|
|
||||||
},
|
|
||||||
];
|
|
||||||
|
|
||||||
export default {
|
|
||||||
components: { SmallTitle },
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
visible: false,
|
|
||||||
addOrUpdateVisible: false,
|
|
||||||
tableBtn,
|
|
||||||
tableProps,
|
|
||||||
customerList: [],
|
|
||||||
modelList:[],
|
|
||||||
workOrderList:[],
|
|
||||||
productAttributeList: [],
|
|
||||||
dataForm: {
|
|
||||||
id: null,
|
|
||||||
// name: '', // 产品名称
|
|
||||||
packagingCode: '', // 产品编码
|
|
||||||
// area: 0, // 单位平方数(float only)
|
|
||||||
modelId: null, // 产品类型id
|
|
||||||
workOrderId: null, // 单位产品用时 (s)
|
|
||||||
customerId: '', // 规格
|
|
||||||
content: '', // 单位id
|
|
||||||
},
|
|
||||||
listQuery: {
|
|
||||||
pageSize: 10,
|
|
||||||
pageNo: 1,
|
|
||||||
total: 0,
|
|
||||||
},
|
|
||||||
dataRule: {
|
|
||||||
code: [
|
|
||||||
{
|
|
||||||
required: true,
|
|
||||||
message: '产品编码不能为空',
|
|
||||||
trigger: 'blur',
|
|
||||||
},
|
|
||||||
// {
|
|
||||||
// type: 'number',
|
|
||||||
// message: '产品编码为数字类型',
|
|
||||||
// trigger: 'blur',
|
|
||||||
// transfom: 'val => Number(val)',
|
|
||||||
// },
|
|
||||||
],
|
|
||||||
name: [
|
|
||||||
{
|
|
||||||
required: true,
|
|
||||||
message: '产品名称不能为空',
|
|
||||||
trigger: 'blur',
|
|
||||||
},
|
|
||||||
],
|
|
||||||
typeDictValue: [
|
|
||||||
{
|
|
||||||
required: true,
|
|
||||||
message: '产品类型不能为空',
|
|
||||||
trigger: 'blur',
|
|
||||||
},
|
|
||||||
],
|
|
||||||
area: [
|
|
||||||
{
|
|
||||||
type: 'number',
|
|
||||||
message: '请输入正确的数值',
|
|
||||||
trigger: 'change',
|
|
||||||
transform: (val) => Number(val),
|
|
||||||
},
|
|
||||||
],
|
|
||||||
processTime: [
|
|
||||||
{
|
|
||||||
required: true,
|
|
||||||
message: '完成单位产品用时不能为空',
|
|
||||||
trigger: 'blur',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
type: 'number',
|
|
||||||
message: '请输入正确的数值',
|
|
||||||
trigger: 'blur',
|
|
||||||
transform: (val) => Number(val),
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
// isdetail: false,
|
|
||||||
};
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
// initData() {
|
|
||||||
// this.productAttributeList.splice(0);
|
|
||||||
// this.listQuery.total = 0;
|
|
||||||
// },
|
|
||||||
init(id) {
|
|
||||||
this.getDict()
|
|
||||||
// this.initData();
|
|
||||||
// this.isdetail = isdetail || false;
|
|
||||||
this.dataForm.id = id || null;
|
|
||||||
this.visible = true;
|
|
||||||
|
|
||||||
this.$nextTick(() => {
|
|
||||||
this.$refs['dataForm'].resetFields();
|
|
||||||
|
|
||||||
if (this.dataForm.id) {
|
|
||||||
// 获取产品详情
|
|
||||||
getPacking(id).then((response) => {
|
|
||||||
this.dataForm = response.data;
|
|
||||||
});
|
|
||||||
// 获取产品的属性列表
|
|
||||||
// this.getList();
|
|
||||||
} else {
|
|
||||||
getCode().then((res) => {
|
|
||||||
this.dataForm.packagingCode = res.data;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
|
|
||||||
getDict() {
|
|
||||||
// 获取产品的属性列表
|
|
||||||
getCustomerList().then((response) => {
|
|
||||||
console.log(response);
|
|
||||||
this.customerList = response.data
|
|
||||||
// this.listQuery.total = response.data.total;
|
|
||||||
})
|
|
||||||
getModelList().then((response) => {
|
|
||||||
console.log(response);
|
|
||||||
this.modelList = response.data
|
|
||||||
// this.listQuery.total = response.data.total;
|
|
||||||
})
|
|
||||||
getWorkOrderList().then((response) => {
|
|
||||||
// console.log(response);
|
|
||||||
this.workOrderList = response.data
|
|
||||||
// this.listQuery.total = response.data.total;
|
|
||||||
})
|
|
||||||
},
|
|
||||||
// handleClick(raw) {
|
|
||||||
// if (raw.type === 'delete') {
|
|
||||||
// this.$confirm(
|
|
||||||
// `确定对${
|
|
||||||
// raw.data.name
|
|
||||||
// ? '[名称=' + raw.data.name + ']'
|
|
||||||
// : '[序号=' + raw.data._pageIndex + ']'
|
|
||||||
// }进行删除操作?`,
|
|
||||||
// '提示',
|
|
||||||
// {
|
|
||||||
// confirmButtonText: '确定',
|
|
||||||
// cancelButtonText: '取消',
|
|
||||||
// type: 'warning',
|
|
||||||
// }
|
|
||||||
// )
|
|
||||||
// .then(() => {
|
|
||||||
// deleteProductAttr(raw.data.id).then(({ data }) => {
|
|
||||||
// this.$message({
|
|
||||||
// message: '操作成功',
|
|
||||||
// type: 'success',
|
|
||||||
// duration: 1500,
|
|
||||||
// onClose: () => {
|
|
||||||
// this.getList();
|
|
||||||
// },
|
|
||||||
// });
|
|
||||||
// });
|
|
||||||
// })
|
|
||||||
// .catch(() => {});
|
|
||||||
// } else {
|
|
||||||
// this.addNew(raw.data.id);
|
|
||||||
// }
|
|
||||||
// },
|
|
||||||
// 表单提交
|
|
||||||
dataFormSubmit() {
|
|
||||||
this.$refs['dataForm'].validate((valid) => {
|
|
||||||
if (valid) {
|
|
||||||
// 修改的提交
|
|
||||||
if (this.dataForm.id) {
|
|
||||||
updatePacking(this.dataForm).then((response) => {
|
|
||||||
this.$modal.msgSuccess('修改成功');
|
|
||||||
this.visible = false;
|
|
||||||
this.$emit('refreshDataList');
|
|
||||||
});
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
// 添加的提交
|
|
||||||
createPacking(this.dataForm).then((response) => {
|
|
||||||
this.$modal.msgSuccess('新增成功');
|
|
||||||
this.visible = false;
|
|
||||||
this.$emit('refreshDataList');
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
// goEdit() {
|
|
||||||
// this.isdetail = false;
|
|
||||||
// },
|
|
||||||
// // 新增 / 修改
|
|
||||||
// addNew(id) {
|
|
||||||
// this.addOrUpdateVisible = true;
|
|
||||||
// this.$nextTick(() => {
|
|
||||||
// this.$refs.addOrUpdate.init(id);
|
|
||||||
// });
|
|
||||||
// },
|
|
||||||
goback() {
|
|
||||||
this.$emit('refreshDataList');
|
|
||||||
this.visible = false;
|
|
||||||
// this.initData();
|
|
||||||
},
|
|
||||||
},
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<!-- <style scoped>
|
|
||||||
.drawer >>> .el-drawer {
|
|
||||||
border-radius: 8px 0 0 8px;
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
}
|
|
||||||
|
|
||||||
.drawer >>> .el-form-item__label {
|
|
||||||
padding: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.drawer >>> .el-drawer__header {
|
|
||||||
margin: 0;
|
|
||||||
padding: 32px 32px 24px;
|
|
||||||
border-bottom: 1px solid #dcdfe6;
|
|
||||||
}
|
|
||||||
.drawer >>> .el-drawer__body {
|
|
||||||
flex: 1;
|
|
||||||
height: 1px;
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
}
|
|
||||||
|
|
||||||
.drawer >>> .content {
|
|
||||||
padding: 30px 24px;
|
|
||||||
flex: 1;
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
/* height: 100%; */
|
|
||||||
}
|
|
||||||
|
|
||||||
.drawer >>> .visual-part {
|
|
||||||
flex: 1 auto;
|
|
||||||
max-height: 76vh;
|
|
||||||
overflow: hidden;
|
|
||||||
overflow-y: scroll;
|
|
||||||
padding-right: 10px; /* 调整滚动条样式 */
|
|
||||||
}
|
|
||||||
|
|
||||||
.drawer >>> .el-form,
|
|
||||||
.drawer >>> .attr-list {
|
|
||||||
padding: 0 16px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.drawer-body__footer {
|
|
||||||
display: flex;
|
|
||||||
justify-content: flex-end;
|
|
||||||
padding: 18px;
|
|
||||||
}
|
|
||||||
</style> -->
|
|
||||||
@@ -1,292 +0,0 @@
|
|||||||
<!--
|
|
||||||
* @Author: zwq
|
|
||||||
* @Date: 2023-08-01 14:55:51
|
|
||||||
* @LastEditors: zhp
|
|
||||||
* @LastEditTime: 2023-10-20 15:05:09
|
|
||||||
* @Description:
|
|
||||||
-->
|
|
||||||
<template>
|
|
||||||
<div class="app-container">
|
|
||||||
<search-bar
|
|
||||||
:formConfigs="formConfig"
|
|
||||||
ref="searchBarForm"
|
|
||||||
@headBtnClick="buttonClick" />
|
|
||||||
<base-table
|
|
||||||
:table-props="tableProps"
|
|
||||||
:page="listQuery.pageNo"
|
|
||||||
:limit="listQuery.pageSize"
|
|
||||||
:table-data="tableData">
|
|
||||||
<method-btn
|
|
||||||
v-if="tableBtn.length"
|
|
||||||
slot="handleBtn"
|
|
||||||
:width="120"
|
|
||||||
label="操作"
|
|
||||||
:method-list="tableBtn"
|
|
||||||
@clickBtn="handleClick" />
|
|
||||||
</base-table>
|
|
||||||
<pagination
|
|
||||||
:limit.sync="listQuery.pageSize"
|
|
||||||
:page.sync="listQuery.pageNo"
|
|
||||||
:total="listQuery.total"
|
|
||||||
@pagination="getDataList" />
|
|
||||||
<add-or-update
|
|
||||||
v-if="addOrUpdateVisible"
|
|
||||||
ref="addOrUpdate"
|
|
||||||
@refreshDataList="getDataList" />
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import AddOrUpdate from './add-or-updata';
|
|
||||||
// import unitDict from './unitDict';
|
|
||||||
import basicPage from '../mixins/basic-page';
|
|
||||||
import { parseTime } from '../mixins/code-filter';
|
|
||||||
import {
|
|
||||||
getPackingModel,
|
|
||||||
} from '@/api/base/printModel.js'
|
|
||||||
import {
|
|
||||||
deletePacking,
|
|
||||||
getPackingPage,
|
|
||||||
exportPackingExcel,
|
|
||||||
} from '@/api/base/packingInfo';
|
|
||||||
|
|
||||||
const tableProps = [
|
|
||||||
{
|
|
||||||
prop: 'packagingCode',
|
|
||||||
label: '包装流水号'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
prop: 'workOrderName',
|
|
||||||
label: '所属工单'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
prop: 'customerName',
|
|
||||||
label: '客户'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
prop: 'content',
|
|
||||||
label: '内容',
|
|
||||||
// subcomponent: unitDict,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
prop: 'modelName',
|
|
||||||
label: '标签模板',
|
|
||||||
// subcomponent: unitDict,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
prop: 'printStatus',
|
|
||||||
label: '打印状态',
|
|
||||||
// subcomponent: unitDict,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
prop: 'createTime',
|
|
||||||
label: '生成日期',
|
|
||||||
filter: parseTime
|
|
||||||
},
|
|
||||||
];
|
|
||||||
|
|
||||||
export default {
|
|
||||||
mixins: [basicPage],
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
urlOptions: {
|
|
||||||
getDataListURL: getPackingPage,
|
|
||||||
deleteURL: deletePacking,
|
|
||||||
exportURL: exportPackingExcel,
|
|
||||||
},
|
|
||||||
tableProps,
|
|
||||||
tableBtn: [
|
|
||||||
this.$auth.hasPermi(`base:packaging-print-log:update`)
|
|
||||||
? {
|
|
||||||
type: 'edit',
|
|
||||||
btnName: '编辑',
|
|
||||||
}
|
|
||||||
: undefined,
|
|
||||||
{
|
|
||||||
type: 'print',
|
|
||||||
btnName: '打印',
|
|
||||||
},
|
|
||||||
this.$auth.hasPermi(`base:packaging-print-log:delete`)
|
|
||||||
? {
|
|
||||||
type: 'delete',
|
|
||||||
btnName: '删除',
|
|
||||||
}
|
|
||||||
: undefined,
|
|
||||||
|
|
||||||
].filter((v) => v),
|
|
||||||
tableData: [],
|
|
||||||
formConfig: [
|
|
||||||
{
|
|
||||||
type: 'input',
|
|
||||||
label: '工单',
|
|
||||||
placeholder: '工单',
|
|
||||||
param: 'workOrderId',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
// parent: 'dateFilterType',
|
|
||||||
// 日期选择
|
|
||||||
type: 'datePicker',
|
|
||||||
label: '时间',
|
|
||||||
dateType: 'date',
|
|
||||||
placeholder: '选择日期',
|
|
||||||
format: 'yyyy-MM-dd',
|
|
||||||
valueFormat: 'yyyy-MM-dd',
|
|
||||||
param: 'createTime',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
type: 'button',
|
|
||||||
btnName: '搜索',
|
|
||||||
name: 'search',
|
|
||||||
color: 'primary',
|
|
||||||
},
|
|
||||||
// {
|
|
||||||
// type: 'separate',
|
|
||||||
// },
|
|
||||||
// {
|
|
||||||
// type: 'button',
|
|
||||||
// btnName: '重置',
|
|
||||||
// name: 'reset',
|
|
||||||
// },
|
|
||||||
{
|
|
||||||
type: 'separate',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
type: this.$auth.hasPermi('base:packaging-print-log:create') ? 'button' : '',
|
|
||||||
btnName: '新增',
|
|
||||||
name: 'add',
|
|
||||||
color: 'success',
|
|
||||||
plain: true,
|
|
||||||
},
|
|
||||||
// {
|
|
||||||
// type: 'separate',
|
|
||||||
// type: this.$auth.hasPermi('base:product:create') ? 'separate' : '',
|
|
||||||
// },
|
|
||||||
// {
|
|
||||||
// type: this.$auth.hasPermi('base:product:export') ? 'button' : '',
|
|
||||||
// btnName: '导出',
|
|
||||||
// name: 'export',
|
|
||||||
// color: 'warning',
|
|
||||||
// },
|
|
||||||
],
|
|
||||||
};
|
|
||||||
},
|
|
||||||
components: {
|
|
||||||
AddOrUpdate,
|
|
||||||
},
|
|
||||||
created() {},
|
|
||||||
methods: {
|
|
||||||
getDataList() {
|
|
||||||
this.dataListLoading = true;
|
|
||||||
this.urlOptions.getDataListURL(this.listQuery).then(response => {
|
|
||||||
this.tableData = response.data.records;
|
|
||||||
this.listQuery.total = response.data.total;
|
|
||||||
this.dataListLoading = false;
|
|
||||||
});
|
|
||||||
},
|
|
||||||
handlePrint(id){
|
|
||||||
getPackingModel(id).then(res => {
|
|
||||||
var obj = {
|
|
||||||
code: '11111222',
|
|
||||||
test: '11111',
|
|
||||||
test2: '3333333',
|
|
||||||
test1: '222222',
|
|
||||||
}
|
|
||||||
console.log(res);
|
|
||||||
// getPackingListInfo({
|
|
||||||
// size: 20,
|
|
||||||
// current: 1,
|
|
||||||
// boxNo: printModel.boxNo
|
|
||||||
// }).then(result => {
|
|
||||||
// this.substrateList = result.data.records
|
|
||||||
// var obj = {
|
|
||||||
// // time: this.getNewDate(),
|
|
||||||
// boxNo: this.currentData.boxNo,
|
|
||||||
// orderNum: this.currentData.orderNum,
|
|
||||||
// powerLevel: this.currentData.powerLevel,
|
|
||||||
// sapMaterial: this.currentData.sapMaterial,
|
|
||||||
// img: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAABkCAYAAABw4pVUAAAHVklEQVR4nO2dT2wUVRzHv2/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',
|
|
||||||
// // lineBody: this.currentData.lineBody == 1 ? 'F ' : 'S',
|
|
||||||
// createTime: moment(this.currentData.createTime).format('YYYY-MM-DD HH:mm:ss')
|
|
||||||
// // modul1: '20210320000012',
|
|
||||||
// // modul2: '20210320000012',
|
|
||||||
// // modul3: '20210320000012'
|
|
||||||
// }
|
|
||||||
// for (var i = 0; i < this.substrateList.length; i++) {
|
|
||||||
// var model = 'model' + Number(i + 1)
|
|
||||||
// var pmpp = 'PMPP' + Number(i + 1)
|
|
||||||
// var m = 'm' + Number(i + 1)
|
|
||||||
|
|
||||||
// console.log(model)
|
|
||||||
// // console.log(this.list[i].woSubstrateId)
|
|
||||||
// // console.log(this.list[i].woSubstrateId)
|
|
||||||
// obj['' + model + ''] = this.substrateList[i].woSubstrateId
|
|
||||||
// obj['' + pmpp + ''] = this.substrateList[i].pmpp
|
|
||||||
// obj['' + m + ''] = i + 1
|
|
||||||
// }
|
|
||||||
// console.log(obj)
|
|
||||||
// this.printPreview('预览', res.data)
|
|
||||||
const hiprintTemplate = this.$print(undefined, JSON.parse(res.data.content), obj, {}, {
|
|
||||||
// styleHandler: () => {
|
|
||||||
// const css = '<link href="http://hiprint.io/Content/hiprint/css/print-lock.css" media="print" rel="stylesheet">'
|
|
||||||
// return css
|
|
||||||
// }
|
|
||||||
})
|
|
||||||
|
|
||||||
hiprintTemplate.on('printSuccess', function () {
|
|
||||||
console.log(1111);
|
|
||||||
// that.$notification.success({
|
|
||||||
// // key: key,
|
|
||||||
// placement: 'topRight',
|
|
||||||
// message: key + ' 打印成功',
|
|
||||||
// description: 'Api单独直接打印回调',
|
|
||||||
// });
|
|
||||||
});
|
|
||||||
console.log(hiprintTemplate)
|
|
||||||
})
|
|
||||||
// })
|
|
||||||
},
|
|
||||||
closeCallback(vue) {
|
|
||||||
console.log('关闭了打印工具')
|
|
||||||
},
|
|
||||||
buttonClick(val) {
|
|
||||||
switch (val.btnName) {
|
|
||||||
case 'search':
|
|
||||||
this.listQuery.pageNo = 1;
|
|
||||||
this.listQuery.pageSize = 10;
|
|
||||||
this.listQuery.packagingCode = val.packagingCode;
|
|
||||||
this.listQuery.createTime = val.createTime;
|
|
||||||
this.getDataList();
|
|
||||||
console.log(this.tableData)
|
|
||||||
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);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
otherMethods(val) {
|
|
||||||
this.handlePrint(val.data.modelId)
|
|
||||||
// this.addOrUpdateVisible = true;
|
|
||||||
// this.addOrEditTitle = '详情';
|
|
||||||
// this.$nextTick(() => {
|
|
||||||
// this.$refs.addOrUpdate.init(val.data.id, true);
|
|
||||||
// });
|
|
||||||
},
|
|
||||||
},
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
@@ -1,15 +0,0 @@
|
|||||||
<template>
|
|
||||||
<dict-tag
|
|
||||||
:type="DICT_TYPE.UNIT_DICT"
|
|
||||||
:value="injectData.unitDictValue" />
|
|
||||||
</template>
|
|
||||||
<script>
|
|
||||||
export default {
|
|
||||||
props: {
|
|
||||||
injectData: {
|
|
||||||
type: Object,
|
|
||||||
default: () => ({}),
|
|
||||||
},
|
|
||||||
},
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
@@ -1,65 +0,0 @@
|
|||||||
<!--
|
|
||||||
* @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>
|
|
||||||
@@ -1,442 +0,0 @@
|
|||||||
<!--
|
|
||||||
* @Author: zhp
|
|
||||||
* @Date: 2023-10-17 16:50:19
|
|
||||||
* @LastEditTime: 2023-10-20 14:13:39
|
|
||||||
* @LastEditors: zhp
|
|
||||||
* @Description:
|
|
||||||
-->
|
|
||||||
<template>
|
|
||||||
<el-dialog :visible.sync="visible" :show-close="false" :wrapper-closable="false" width="30%">
|
|
||||||
<small-title slot="title" :no-padding="true">
|
|
||||||
{{ !dataForm.id ? '新增' : '编辑' }}
|
|
||||||
</small-title>
|
|
||||||
|
|
||||||
<div class="content">
|
|
||||||
<div class="visual-part">
|
|
||||||
<el-form ref="dataForm" :model="dataForm" :rules="dataRule" label-width="100px"
|
|
||||||
@keyup.enter.native="dataFormSubmit">
|
|
||||||
<el-row :gutter="20">
|
|
||||||
<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="typeId">
|
|
||||||
<el-select v-model="dataForm.typeId" style="width: 100%;" placeholder="请选择打印方式">
|
|
||||||
<el-option v-for="dict in typeList" clearable :key="dict.id" :label="dict.name" :value="dict.id" />
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
<el-row :gutter="20">
|
|
||||||
<el-col :span="12">
|
|
||||||
<el-form-item label="打印方式" prop="printModel">
|
|
||||||
<el-select v-model="dataForm.printModel" style="width: 100%;" placeholder="请选择打印方式">
|
|
||||||
<el-option v-for="dict in printModelList" clearable :key="dict.id" :label="dict.name"
|
|
||||||
:value="dict.id" />
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="12">
|
|
||||||
<el-form-item label="标签备注" prop="remark">
|
|
||||||
<el-input v-model="dataForm.remark" clearable placeholder="请输入标签备注" />
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
<el-row :gutter="20">
|
|
||||||
<el-col :span="12">
|
|
||||||
<el-form-item label="模板设计" prop="content">
|
|
||||||
<el-button type="primary" @click="btnClickDesign()">模板设计</el-button>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<!-- <el-col :span="12">
|
|
||||||
<el-form-item label="单位平方数" prop="area">
|
|
||||||
<el-input v-model="dataForm.area" placeholder="请输入单位平方数" />
|
|
||||||
</el-form-item>
|
|
||||||
</el-col> -->
|
|
||||||
</el-row>
|
|
||||||
<!-- <el-row :gutter="20">
|
|
||||||
<el-col :span="24">
|
|
||||||
<el-form-item label="完成单位产品用时" prop="processTime">
|
|
||||||
<el-input v-model="dataForm.processTime" placeholder="请输入完成单位产品用时" />
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
</el-row> -->
|
|
||||||
</el-form>
|
|
||||||
|
|
||||||
<!-- <small-title
|
|
||||||
style="margin: 16px 0; padding-left: 8px"
|
|
||||||
:no-padding="true">
|
|
||||||
产品属性列表
|
|
||||||
</small-title>
|
|
||||||
|
|
||||||
<div class="attr-list">
|
|
||||||
<base-table
|
|
||||||
:table-props="tableProps"
|
|
||||||
:page="listQuery.pageNo"
|
|
||||||
:limit="listQuery.pageSize"
|
|
||||||
:add-button-show="isdetail ? null : '添加属性'"
|
|
||||||
@emitButtonClick="addNew()"
|
|
||||||
:table-data="productAttributeList">
|
|
||||||
<method-btn
|
|
||||||
v-if="!isdetail"
|
|
||||||
slot="handleBtn"
|
|
||||||
:width="120"
|
|
||||||
label="操作"
|
|
||||||
:method-list="tableBtn"
|
|
||||||
@clickBtn="handleClick" />
|
|
||||||
</base-table>
|
|
||||||
<pagination
|
|
||||||
v-show="listQuery.total > 0"
|
|
||||||
:total="listQuery.total"
|
|
||||||
:page.sync="listQuery.pageNo"
|
|
||||||
:limit.sync="listQuery.pageSize"
|
|
||||||
:page-sizes="[5, 10, 15]"
|
|
||||||
@pagination="getList" />
|
|
||||||
</div> -->
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- <div style="position: absolute; bottom: 24px; right: 24px">
|
|
||||||
<el-button style="margin-right: 10px" @click="goback()">返回</el-button>
|
|
||||||
<el-button v-if="isdetail" type="primary" @click="goEdit()">
|
|
||||||
编辑
|
|
||||||
</el-button>
|
|
||||||
<span v-if="!isdetail">
|
|
||||||
<el-button type="primary" @click="dataFormSubmit()">保存</el-button>
|
|
||||||
<el-button
|
|
||||||
v-if="dataForm.id && !isdetail"
|
|
||||||
type="primary"
|
|
||||||
@click="addNew()">
|
|
||||||
添加属性
|
|
||||||
</el-button>
|
|
||||||
</span>
|
|
||||||
</div> -->
|
|
||||||
<template slot="footer">
|
|
||||||
<el-button style="" @click="goback()">取消</el-button>
|
|
||||||
<!-- <el-button v-if="isdetail" type="primary" @click="goEdit()">
|
|
||||||
编辑
|
|
||||||
</el-button> -->
|
|
||||||
<el-button type="primary" @click="dataFormSubmit()">确定</el-button>
|
|
||||||
</template>
|
|
||||||
<print-model-design v-if="modelShow" ref="printModelDesign" @saveData="getModelData" />
|
|
||||||
</el-dialog>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
|
|
||||||
import {
|
|
||||||
createPackingModel,
|
|
||||||
updatePackingModel,
|
|
||||||
getPackingModel,
|
|
||||||
// getWorkOrderList,
|
|
||||||
// getCode,
|
|
||||||
// getCustomerList,
|
|
||||||
getTypeList
|
|
||||||
} from '@/api/base/printModel.js';
|
|
||||||
// import productAttrAdd from './attr-add';
|
|
||||||
import { parseTime } from '../mixins/code-filter';
|
|
||||||
import SmallTitle from './SmallTitle';
|
|
||||||
import printModelDesign from '../custom/index'
|
|
||||||
|
|
||||||
const tableBtn = [
|
|
||||||
{
|
|
||||||
type: 'edit',
|
|
||||||
btnName: '编辑',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
type: 'delete',
|
|
||||||
btnName: '删除',
|
|
||||||
},
|
|
||||||
];
|
|
||||||
const tableProps = [
|
|
||||||
{
|
|
||||||
prop: 'createTime',
|
|
||||||
label: '添加时间',
|
|
||||||
filter: parseTime,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
prop: 'name',
|
|
||||||
label: '属性名',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
prop: 'value',
|
|
||||||
label: '属性值',
|
|
||||||
},
|
|
||||||
];
|
|
||||||
|
|
||||||
export default {
|
|
||||||
components: { SmallTitle, printModelDesign },
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
visible: false,
|
|
||||||
addOrUpdateVisible: false,
|
|
||||||
tableBtn,
|
|
||||||
tableProps,
|
|
||||||
modelShow:false,
|
|
||||||
typeList:[],
|
|
||||||
dataForm: {
|
|
||||||
id: null,
|
|
||||||
// name: '', // 产品名称
|
|
||||||
name: '', // 产品编码
|
|
||||||
// area: 0, // 单位平方数(float only)
|
|
||||||
typeId: null, // 产品类型id
|
|
||||||
printModel: null, // 单位产品用时 (s)
|
|
||||||
content: '', // 规格
|
|
||||||
remark: '', // 单位id
|
|
||||||
},
|
|
||||||
printModelList: [
|
|
||||||
{
|
|
||||||
id: 1,
|
|
||||||
name:'自动'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 2,
|
|
||||||
name: '手动'
|
|
||||||
},
|
|
||||||
],
|
|
||||||
listQuery: {
|
|
||||||
pageSize: 10,
|
|
||||||
pageNo: 1,
|
|
||||||
total: 0,
|
|
||||||
},
|
|
||||||
dataRule: {
|
|
||||||
typeId: [
|
|
||||||
{
|
|
||||||
required: true,
|
|
||||||
message: '打印类型不能为空',
|
|
||||||
trigger: 'blur',
|
|
||||||
},
|
|
||||||
// {
|
|
||||||
// type: 'number',
|
|
||||||
// message: '产品编码为数字类型',
|
|
||||||
// trigger: 'blur',
|
|
||||||
// transfom: 'val => Number(val)',
|
|
||||||
// },
|
|
||||||
],
|
|
||||||
name: [
|
|
||||||
{
|
|
||||||
required: true,
|
|
||||||
message: '模板名称不能为空',
|
|
||||||
trigger: 'blur',
|
|
||||||
},
|
|
||||||
],
|
|
||||||
printModel: [
|
|
||||||
{
|
|
||||||
required: true,
|
|
||||||
message: '模板类型不能为空',
|
|
||||||
trigger: 'blur',
|
|
||||||
},
|
|
||||||
],
|
|
||||||
content: [
|
|
||||||
{
|
|
||||||
required: true,
|
|
||||||
message: '模板不能为空',
|
|
||||||
trigger: 'blur',
|
|
||||||
},
|
|
||||||
],
|
|
||||||
processTime: [
|
|
||||||
{
|
|
||||||
required: true,
|
|
||||||
message: '完成单位产品用时不能为空',
|
|
||||||
trigger: 'blur',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
type: 'number',
|
|
||||||
message: '请输入正确的数值',
|
|
||||||
trigger: 'blur',
|
|
||||||
transform: (val) => Number(val),
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
// isdetail: false,
|
|
||||||
};
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
getModelData(data) {
|
|
||||||
console.log(data)
|
|
||||||
this.content = JSON.stringify(data)
|
|
||||||
this.dataForm.content = JSON.stringify(data)
|
|
||||||
},
|
|
||||||
btnClickDesign() {
|
|
||||||
console.log(11111)
|
|
||||||
this.modelShow = true
|
|
||||||
this.$nextTick(() => {
|
|
||||||
this.$refs.printModelDesign.init(this.dataForm.content)
|
|
||||||
console.log(this.dataForm.content)
|
|
||||||
})
|
|
||||||
// this.$router.push({
|
|
||||||
// path: '/printModelDesign'
|
|
||||||
// })
|
|
||||||
},
|
|
||||||
// initData() {
|
|
||||||
// this.productAttributeList.splice(0);
|
|
||||||
// this.listQuery.total = 0;
|
|
||||||
// },
|
|
||||||
init(id) {
|
|
||||||
this.getDict()
|
|
||||||
// this.initData();
|
|
||||||
// this.isdetail = isdetail || false;
|
|
||||||
this.dataForm.id = id || null;
|
|
||||||
this.visible = true;
|
|
||||||
|
|
||||||
this.$nextTick(() => {
|
|
||||||
this.$refs['dataForm'].resetFields();
|
|
||||||
|
|
||||||
if (this.dataForm.id) {
|
|
||||||
// 获取产品详情
|
|
||||||
getPackingModel(id).then((response) => {
|
|
||||||
this.dataForm = response.data;
|
|
||||||
});
|
|
||||||
// 获取产品的属性列表
|
|
||||||
// this.getList();
|
|
||||||
} else {
|
|
||||||
// getCode().then((res) => {
|
|
||||||
// this.dataForm.packagingCode = res.data;
|
|
||||||
// });
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
|
|
||||||
getDict() {
|
|
||||||
// 获取产品的属性列表
|
|
||||||
// getCustomerList().then((response) => {
|
|
||||||
// console.log(response);
|
|
||||||
// this.customerList = response.data
|
|
||||||
// // this.listQuery.total = response.data.total;
|
|
||||||
// })
|
|
||||||
getTypeList().then((response) => {
|
|
||||||
console.log(response);
|
|
||||||
this.typeList = response.data
|
|
||||||
// this.listQuery.total = response.data.total;
|
|
||||||
})
|
|
||||||
// getWorkOrderList().then((response) => {
|
|
||||||
// // console.log(response);
|
|
||||||
// this.workOrderList = response.data
|
|
||||||
// // this.listQuery.total = response.data.total;
|
|
||||||
// })
|
|
||||||
},
|
|
||||||
// handleClick(raw) {
|
|
||||||
// if (raw.type === 'delete') {
|
|
||||||
// this.$confirm(
|
|
||||||
// `确定对${
|
|
||||||
// raw.data.name
|
|
||||||
// ? '[名称=' + raw.data.name + ']'
|
|
||||||
// : '[序号=' + raw.data._pageIndex + ']'
|
|
||||||
// }进行删除操作?`,
|
|
||||||
// '提示',
|
|
||||||
// {
|
|
||||||
// confirmButtonText: '确定',
|
|
||||||
// cancelButtonText: '取消',
|
|
||||||
// type: 'warning',
|
|
||||||
// }
|
|
||||||
// )
|
|
||||||
// .then(() => {
|
|
||||||
// deleteProductAttr(raw.data.id).then(({ data }) => {
|
|
||||||
// this.$message({
|
|
||||||
// message: '操作成功',
|
|
||||||
// type: 'success',
|
|
||||||
// duration: 1500,
|
|
||||||
// onClose: () => {
|
|
||||||
// this.getList();
|
|
||||||
// },
|
|
||||||
// });
|
|
||||||
// });
|
|
||||||
// })
|
|
||||||
// .catch(() => {});
|
|
||||||
// } else {
|
|
||||||
// this.addNew(raw.data.id);
|
|
||||||
// }
|
|
||||||
// },
|
|
||||||
// 表单提交
|
|
||||||
dataFormSubmit() {
|
|
||||||
this.$refs['dataForm'].validate((valid) => {
|
|
||||||
if (valid) {
|
|
||||||
// 修改的提交
|
|
||||||
if (this.dataForm.id) {
|
|
||||||
updatePackingModel(this.dataForm).then((response) => {
|
|
||||||
this.$modal.msgSuccess('修改成功');
|
|
||||||
this.visible = false;
|
|
||||||
this.$emit('refreshDataList');
|
|
||||||
});
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
// 添加的提交
|
|
||||||
createPackingModel(this.dataForm).then((response) => {
|
|
||||||
this.$modal.msgSuccess('新增成功');
|
|
||||||
this.visible = false;
|
|
||||||
this.$emit('refreshDataList');
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
// goEdit() {
|
|
||||||
// this.isdetail = false;
|
|
||||||
// },
|
|
||||||
// // 新增 / 修改
|
|
||||||
// addNew(id) {
|
|
||||||
// this.addOrUpdateVisible = true;
|
|
||||||
// this.$nextTick(() => {
|
|
||||||
// this.$refs.addOrUpdate.init(id);
|
|
||||||
// });
|
|
||||||
// },
|
|
||||||
goback() {
|
|
||||||
this.$emit('refreshDataList');
|
|
||||||
this.visible = false;
|
|
||||||
// this.initData();
|
|
||||||
},
|
|
||||||
},
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<!-- <style scoped>
|
|
||||||
.drawer >>> .el-drawer {
|
|
||||||
border-radius: 8px 0 0 8px;
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
}
|
|
||||||
|
|
||||||
.drawer >>> .el-form-item__label {
|
|
||||||
padding: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.drawer >>> .el-drawer__header {
|
|
||||||
margin: 0;
|
|
||||||
padding: 32px 32px 24px;
|
|
||||||
border-bottom: 1px solid #dcdfe6;
|
|
||||||
}
|
|
||||||
.drawer >>> .el-drawer__body {
|
|
||||||
flex: 1;
|
|
||||||
height: 1px;
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
}
|
|
||||||
|
|
||||||
.drawer >>> .content {
|
|
||||||
padding: 30px 24px;
|
|
||||||
flex: 1;
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
/* height: 100%; */
|
|
||||||
}
|
|
||||||
|
|
||||||
.drawer >>> .visual-part {
|
|
||||||
flex: 1 auto;
|
|
||||||
max-height: 76vh;
|
|
||||||
overflow: hidden;
|
|
||||||
overflow-y: scroll;
|
|
||||||
padding-right: 10px; /* 调整滚动条样式 */
|
|
||||||
}
|
|
||||||
|
|
||||||
.drawer >>> .el-form,
|
|
||||||
.drawer >>> .attr-list {
|
|
||||||
padding: 0 16px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.drawer-body__footer {
|
|
||||||
display: flex;
|
|
||||||
justify-content: flex-end;
|
|
||||||
padding: 18px;
|
|
||||||
}
|
|
||||||
</style> -->
|
|
||||||
@@ -1,210 +0,0 @@
|
|||||||
<!--
|
|
||||||
* @Author: zwq
|
|
||||||
* @Date: 2023-08-01 14:55:51
|
|
||||||
* @LastEditors: zhp
|
|
||||||
* @LastEditTime: 2023-10-20 14:21:33
|
|
||||||
* @Description:
|
|
||||||
-->
|
|
||||||
<template>
|
|
||||||
<div class="app-container">
|
|
||||||
<search-bar :formConfigs="formConfig" ref="searchBarForm" @headBtnClick="buttonClick" />
|
|
||||||
<base-table :table-props="tableProps" :page="listQuery.pageNo" :limit="listQuery.pageSize" :table-data="tableData">
|
|
||||||
<method-btn v-if="tableBtn.length" slot="handleBtn" :width="120" label="操作" :method-list="tableBtn"
|
|
||||||
@clickBtn="handleClick" />
|
|
||||||
</base-table>
|
|
||||||
<pagination :limit.sync="listQuery.pageSize" :page.sync="listQuery.pageNo" :total="listQuery.total"
|
|
||||||
@pagination="getDataList" />
|
|
||||||
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList" />
|
|
||||||
<print-model-design v-if="modelShow" ref="printModelDesign" @saveData="getModelData" />
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import AddOrUpdate from './add-or-updata';
|
|
||||||
// import unitDict from './unitDict';
|
|
||||||
import basicPage from '../mixins/basic-page';
|
|
||||||
import { parseTime } from '../mixins/code-filter';
|
|
||||||
import printModelDesign from '../custom/index'
|
|
||||||
import { updatePackingModel,} from '@/api/base/printModel.js';
|
|
||||||
import {
|
|
||||||
deletePackingModel,
|
|
||||||
getPackingModelPage,
|
|
||||||
// exportPackingExcel,
|
|
||||||
} from '@/api/base/printModel';
|
|
||||||
|
|
||||||
const tableProps = [
|
|
||||||
{
|
|
||||||
prop: 'name',
|
|
||||||
label: '模板名称'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
prop: 'typeName',
|
|
||||||
label: '标签类型'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
prop: 'printModel',
|
|
||||||
label: '打印方式',
|
|
||||||
filter: (val) => val ==1 ? '自动打印' : '自动打印',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
prop: 'remark',
|
|
||||||
label: '备注',
|
|
||||||
// subcomponent: unitDict,
|
|
||||||
},
|
|
||||||
];
|
|
||||||
|
|
||||||
export default {
|
|
||||||
mixins: [basicPage],
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
urlOptions: {
|
|
||||||
getDataListURL: getPackingModelPage,
|
|
||||||
deleteURL: deletePackingModel,
|
|
||||||
// exportURL: exportPackingExcel,
|
|
||||||
},
|
|
||||||
tableProps,
|
|
||||||
modelShow:false,
|
|
||||||
tableBtn: [
|
|
||||||
this.$auth.hasPermi(`base:packaging-print-model:update`)
|
|
||||||
? {
|
|
||||||
type: 'edit',
|
|
||||||
btnName: '编辑',
|
|
||||||
}
|
|
||||||
: undefined,
|
|
||||||
{
|
|
||||||
type: 'print',
|
|
||||||
btnName: '打印',
|
|
||||||
},
|
|
||||||
this.$auth.hasPermi(`base:packaging-print-model:delete`)
|
|
||||||
? {
|
|
||||||
type: 'delete',
|
|
||||||
btnName: '删除',
|
|
||||||
}
|
|
||||||
: undefined,
|
|
||||||
|
|
||||||
].filter((v) => v),
|
|
||||||
tableData: [],
|
|
||||||
formConfig: [
|
|
||||||
// {
|
|
||||||
// type: 'input',
|
|
||||||
// label: '工单',
|
|
||||||
// placeholder: '工单',
|
|
||||||
// param: 'workOrderId',
|
|
||||||
// },
|
|
||||||
// {
|
|
||||||
// // parent: 'dateFilterType',
|
|
||||||
// // 日期选择
|
|
||||||
// type: 'datePicker',
|
|
||||||
// label: '时间',
|
|
||||||
// dateType: 'date',
|
|
||||||
// placeholder: '选择日期',
|
|
||||||
// format: 'yyyy-MM-dd',
|
|
||||||
// valueFormat: 'yyyy-MM-dd',
|
|
||||||
// param: 'createTime',
|
|
||||||
// },
|
|
||||||
{
|
|
||||||
type: 'button',
|
|
||||||
btnName: '搜索',
|
|
||||||
name: 'search',
|
|
||||||
color: 'primary',
|
|
||||||
},
|
|
||||||
// {
|
|
||||||
// type: 'separate',
|
|
||||||
// },
|
|
||||||
// {
|
|
||||||
// type: 'button',
|
|
||||||
// btnName: '重置',
|
|
||||||
// name: 'reset',
|
|
||||||
// },
|
|
||||||
{
|
|
||||||
type: 'separate',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
type: this.$auth.hasPermi('base:packaging-print-model:create') ? 'button' : '',
|
|
||||||
btnName: '新增',
|
|
||||||
name: 'add',
|
|
||||||
color: 'success',
|
|
||||||
plain: true,
|
|
||||||
},
|
|
||||||
// {
|
|
||||||
// type: 'separate',
|
|
||||||
// type: this.$auth.hasPermi('base:product:create') ? 'separate' : '',
|
|
||||||
// },
|
|
||||||
// {
|
|
||||||
// type: this.$auth.hasPermi('base:product:export') ? 'button' : '',
|
|
||||||
// btnName: '导出',
|
|
||||||
// name: 'export',
|
|
||||||
// color: 'warning',
|
|
||||||
// },
|
|
||||||
],
|
|
||||||
};
|
|
||||||
},
|
|
||||||
components: {
|
|
||||||
AddOrUpdate,
|
|
||||||
printModelDesign
|
|
||||||
},
|
|
||||||
created() {},
|
|
||||||
methods: {
|
|
||||||
getDataList() {
|
|
||||||
this.dataListLoading = true;
|
|
||||||
this.urlOptions.getDataListURL(this.listQuery).then(response => {
|
|
||||||
this.tableData = response.data.records;
|
|
||||||
this.listQuery.total = response.data.total;
|
|
||||||
this.dataListLoading = false;
|
|
||||||
});
|
|
||||||
},
|
|
||||||
buttonClick(val) {
|
|
||||||
switch (val.btnName) {
|
|
||||||
case 'search':
|
|
||||||
this.listQuery.pageNo = 1;
|
|
||||||
this.listQuery.pageSize = 10;
|
|
||||||
this.listQuery.packagingCode = val.packagingCode;
|
|
||||||
this.listQuery.createTime = val.createTime;
|
|
||||||
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);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
getModelData(data) {
|
|
||||||
// console.log(data)
|
|
||||||
// this.content = JSON.stringify(data)
|
|
||||||
// this.dataForm.content = JSON.stringify(data)
|
|
||||||
console.log(data)
|
|
||||||
// this.content = JSON.stringify(data)
|
|
||||||
this.obj.content = JSON.stringify(data)
|
|
||||||
updatePackingModel(this.obj).then((response) => {
|
|
||||||
this.$modal.msgSuccess('修改成功');
|
|
||||||
// this.visible = false;
|
|
||||||
// this.$emit('refreshDataList');
|
|
||||||
});
|
|
||||||
|
|
||||||
},
|
|
||||||
otherMethods(val) {
|
|
||||||
console.log(val)
|
|
||||||
this.modelShow = true
|
|
||||||
this.$nextTick(() => {
|
|
||||||
this.obj = val.data
|
|
||||||
this.$refs.printModelDesign.init(val.data.content)
|
|
||||||
})
|
|
||||||
},
|
|
||||||
},
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user