Compare commits
12 Commits
55e023d0a8
...
projects/z
| Author | SHA1 | Date | |
|---|---|---|---|
| 10219fd841 | |||
| 74a2a3b8e5 | |||
| c3b4223e5b | |||
| 070e01c2c4 | |||
| 2665b6a0b0 | |||
| a71fb90e6a | |||
| ac85c83cf9 | |||
| c2e987aee4 | |||
| 0e4ed597cd | |||
| 3e7914ac91 | |||
| 9c19a6197a | |||
| 074b35b6a6 |
12
.env.dev
12
.env.dev
@@ -1,26 +1,22 @@
|
|||||||
###
|
###
|
||||||
# @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: 2023-10-16 09:22:52
|
||||||
# @LastEditors: zhp
|
# @LastEditors: DY
|
||||||
# @Description:
|
# @Description:
|
||||||
###
|
###
|
||||||
# 开发环境配置
|
# 开发环境配置
|
||||||
ENV = 'development'
|
ENV = 'development'
|
||||||
|
|
||||||
# 页面标题
|
# 页面标题
|
||||||
VUE_APP_TITLE = MES系统
|
VUE_APP_TITLE = 产线监控系统
|
||||||
|
|
||||||
# 芋道管理系统/开发环境
|
# 芋道管理系统/开发环境
|
||||||
|
|
||||||
VUE_APP_BASE_API = 'http://192.168.0.33:48082'
|
|
||||||
# VUE_APP_BASE_API = 'http://192.168.2.173:48080'
|
|
||||||
# VUE_APP_BASE_API = 'http://192.168.1.49:48080'
|
# VUE_APP_BASE_API = 'http://192.168.1.49:48080'
|
||||||
# VUE_APP_BASE_API = 'http://192.168.1.8: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.0.33:48080'
|
||||||
# VUE_APP_BASE_API = 'http://192.168.1.188:48080'
|
# VUE_APP_BASE_API = 'http://192.168.1.188:48080'
|
||||||
|
|
||||||
|
|
||||||
# 路由懒加载
|
# 路由懒加载
|
||||||
VUE_CLI_BABEL_TRANSPILE_MODULES = true
|
VUE_CLI_BABEL_TRANSPILE_MODULES = true
|
||||||
|
|
||||||
|
|||||||
@@ -41,7 +41,6 @@
|
|||||||
"url": "https://github.com/YunaiV/ruoyi-vue-pro"
|
"url": "https://github.com/YunaiV/ruoyi-vue-pro"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@antv/x6": "^2.15.3",
|
|
||||||
"@babel/parser": "7.18.4",
|
"@babel/parser": "7.18.4",
|
||||||
"@riophae/vue-treeselect": "0.4.0",
|
"@riophae/vue-treeselect": "0.4.0",
|
||||||
"axios": "0.27.2",
|
"axios": "0.27.2",
|
||||||
@@ -71,7 +70,6 @@
|
|||||||
"screenfull": "5.0.2",
|
"screenfull": "5.0.2",
|
||||||
"sortablejs": "1.10.2",
|
"sortablejs": "1.10.2",
|
||||||
"throttle-debounce": "2.1.0",
|
"throttle-debounce": "2.1.0",
|
||||||
"uuid": "^9.0.1",
|
|
||||||
"video.js": "^8.5.2",
|
"video.js": "^8.5.2",
|
||||||
"vue": "2.7.14",
|
"vue": "2.7.14",
|
||||||
"vue-count-to": "1.0.13",
|
"vue-count-to": "1.0.13",
|
||||||
|
|||||||
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'
|
|
||||||
})
|
|
||||||
}
|
|
||||||
@@ -3,7 +3,7 @@ import request from '@/utils/request'
|
|||||||
// 创建设备
|
// 创建设备
|
||||||
export function createEquipment(data) {
|
export function createEquipment(data) {
|
||||||
return request({
|
return request({
|
||||||
url: '/base/core-equipment/create',
|
url: '/base/equipment/create',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data: data
|
data: data
|
||||||
})
|
})
|
||||||
@@ -12,7 +12,7 @@ export function createEquipment(data) {
|
|||||||
// 更新设备
|
// 更新设备
|
||||||
export function updateEquipment(data) {
|
export function updateEquipment(data) {
|
||||||
return request({
|
return request({
|
||||||
url: '/base/core-equipment/update',
|
url: '/base/equipment/update',
|
||||||
method: 'put',
|
method: 'put',
|
||||||
data: data
|
data: data
|
||||||
})
|
})
|
||||||
@@ -21,7 +21,7 @@ export function updateEquipment(data) {
|
|||||||
// 删除设备
|
// 删除设备
|
||||||
export function deleteEquipment(id) {
|
export function deleteEquipment(id) {
|
||||||
return request({
|
return request({
|
||||||
url: '/base/core-equipment/delete?id=' + id,
|
url: '/base/equipment/delete?id=' + id,
|
||||||
method: 'delete'
|
method: 'delete'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@@ -29,7 +29,7 @@ export function deleteEquipment(id) {
|
|||||||
// 获得设备
|
// 获得设备
|
||||||
export function getEquipment(id) {
|
export function getEquipment(id) {
|
||||||
return request({
|
return request({
|
||||||
url: '/base/core-equipment/get?id=' + id,
|
url: '/base/equipment/get?id=' + id,
|
||||||
method: 'get'
|
method: 'get'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@@ -37,7 +37,7 @@ export function getEquipment(id) {
|
|||||||
// 获得设备分页
|
// 获得设备分页
|
||||||
export function getEquipmentPage(query) {
|
export function getEquipmentPage(query) {
|
||||||
return request({
|
return request({
|
||||||
url: '/base/core-equipment/page',
|
url: '/base/equipment/page',
|
||||||
method: 'get',
|
method: 'get',
|
||||||
params: query
|
params: query
|
||||||
})
|
})
|
||||||
@@ -46,7 +46,7 @@ export function getEquipmentPage(query) {
|
|||||||
// 导出设备 Excel
|
// 导出设备 Excel
|
||||||
export function exportEquipmentExcel(query) {
|
export function exportEquipmentExcel(query) {
|
||||||
return request({
|
return request({
|
||||||
url: '/base/core-equipment/export-excel',
|
url: '/base/equipment/export-excel',
|
||||||
method: 'get',
|
method: 'get',
|
||||||
params: query,
|
params: query,
|
||||||
responseType: 'blob'
|
responseType: 'blob'
|
||||||
@@ -55,7 +55,7 @@ export function exportEquipmentExcel(query) {
|
|||||||
// 获得所有设备列表
|
// 获得所有设备列表
|
||||||
export function getEquipmentAll() {
|
export function getEquipmentAll() {
|
||||||
return request({
|
return request({
|
||||||
url: '/base/core-equipment/listAll',
|
url: '/base/equipment/listAll',
|
||||||
method: 'get'
|
method: 'get'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import request from '@/utils/request'
|
|||||||
// 创建设备类型
|
// 创建设备类型
|
||||||
export function createEquipmentType(data) {
|
export function createEquipmentType(data) {
|
||||||
return request({
|
return request({
|
||||||
url: '/base/core-equipment-type/create',
|
url: '/base/equipment-type/create',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data: data
|
data: data
|
||||||
})
|
})
|
||||||
@@ -12,7 +12,7 @@ export function createEquipmentType(data) {
|
|||||||
// 更新设备类型
|
// 更新设备类型
|
||||||
export function updateEquipmentType(data) {
|
export function updateEquipmentType(data) {
|
||||||
return request({
|
return request({
|
||||||
url: '/base/core-equipment-type/update',
|
url: '/base/equipment-type/update',
|
||||||
method: 'put',
|
method: 'put',
|
||||||
data: data
|
data: data
|
||||||
})
|
})
|
||||||
@@ -21,7 +21,7 @@ export function updateEquipmentType(data) {
|
|||||||
// 删除设备类型
|
// 删除设备类型
|
||||||
export function deleteEquipmentType(id) {
|
export function deleteEquipmentType(id) {
|
||||||
return request({
|
return request({
|
||||||
url: '/base/core-equipment-type/delete?id=' + id,
|
url: '/base/equipment-type/delete?id=' + id,
|
||||||
method: 'delete'
|
method: 'delete'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@@ -29,7 +29,7 @@ export function deleteEquipmentType(id) {
|
|||||||
// 获得设备类型
|
// 获得设备类型
|
||||||
export function getEquipmentType(id) {
|
export function getEquipmentType(id) {
|
||||||
return request({
|
return request({
|
||||||
url: '/base/core-equipment-type/get?id=' + id,
|
url: '/base/equipment-type/get?id=' + id,
|
||||||
method: 'get'
|
method: 'get'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@@ -37,7 +37,7 @@ export function getEquipmentType(id) {
|
|||||||
// 获得设备类型分页
|
// 获得设备类型分页
|
||||||
export function getEquipmentTypePage(query) {
|
export function getEquipmentTypePage(query) {
|
||||||
return request({
|
return request({
|
||||||
url: '/base/core-equipment-type/page',
|
url: '/base/equipment-type/page',
|
||||||
method: 'get',
|
method: 'get',
|
||||||
params: query
|
params: query
|
||||||
})
|
})
|
||||||
@@ -46,7 +46,7 @@ export function getEquipmentTypePage(query) {
|
|||||||
// 导出设备类型 Excel
|
// 导出设备类型 Excel
|
||||||
export function exportEquipmentTypeExcel(query) {
|
export function exportEquipmentTypeExcel(query) {
|
||||||
return request({
|
return request({
|
||||||
url: '/base/core-equipment-type/export-excel',
|
url: '/base/equipment-type/export-excel',
|
||||||
method: 'get',
|
method: 'get',
|
||||||
params: query,
|
params: query,
|
||||||
responseType: 'blob'
|
responseType: 'blob'
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ 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'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@@ -58,49 +58,3 @@ export function listEnabled() {
|
|||||||
method: 'get'
|
method: 'get'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// 获得班组组员信息分页
|
|
||||||
export function groupTeamPage(query) {
|
|
||||||
return request({
|
|
||||||
url: '/base/group-team-det/page',
|
|
||||||
method: 'get',
|
|
||||||
params: query
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
// 获得班组组员信息
|
|
||||||
export function groupTeamDet(query) {
|
|
||||||
return request({
|
|
||||||
url: '/base/group-team-det/get',
|
|
||||||
method: 'get',
|
|
||||||
params: query
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// 创建班组组员信息
|
|
||||||
export function teamDetCreate(data) {
|
|
||||||
return request({
|
|
||||||
url: '/base/group-team-det/create',
|
|
||||||
method: 'post',
|
|
||||||
data: data
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
// 更新班组组员信息
|
|
||||||
export function teamDetUpdate(data) {
|
|
||||||
return request({
|
|
||||||
url: '/base/group-team-det/update',
|
|
||||||
method: 'put',
|
|
||||||
data: data
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
// 删除班组组员信息
|
|
||||||
export function teamDetDelete(query) {
|
|
||||||
return request({
|
|
||||||
url: '/base/group-team-det/delete',
|
|
||||||
method: 'delete',
|
|
||||||
params: query
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -26,12 +26,3 @@ export function autoSet(query) {
|
|||||||
params: query
|
params: query
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// 获得排班信息分页 建议size 150
|
|
||||||
export function groupTeamSchedulingPage(query) {
|
|
||||||
return request({
|
|
||||||
url: '/base/group-team-scheduling/page',
|
|
||||||
method: 'get',
|
|
||||||
params: query
|
|
||||||
})
|
|
||||||
}
|
|
||||||
@@ -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'
|
|
||||||
})
|
|
||||||
}
|
|
||||||
@@ -2,7 +2,7 @@ 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'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
import request from '@/utils/request'
|
|
||||||
// 获得工单列表
|
|
||||||
export function workOrderList() {
|
|
||||||
return request({
|
|
||||||
url: '/base/core-work-order/listbyfilter',
|
|
||||||
method: 'get'
|
|
||||||
})
|
|
||||||
}
|
|
||||||
@@ -1,17 +0,0 @@
|
|||||||
import request from '@/utils/request'
|
|
||||||
// 获得所有员工列表
|
|
||||||
export function getWorkerList() {
|
|
||||||
return request({
|
|
||||||
url: '/base/core-worker/listAll',
|
|
||||||
method: 'get'
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
// 获得员工
|
|
||||||
export function getWorker(query) {
|
|
||||||
return request({
|
|
||||||
url: '/base/core-worker/get',
|
|
||||||
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,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
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
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;
|
||||||
@@ -40,7 +45,9 @@ $buttonHeight: $buttonH * 1px;
|
|||||||
float: right;
|
float: right;
|
||||||
img {
|
img {
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
width:100%;max-width:100px; height:auto;
|
width: 100%;
|
||||||
|
max-width: 100px;
|
||||||
|
height: auto;
|
||||||
vertical-align: middle;
|
vertical-align: middle;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -50,7 +57,7 @@ $buttonHeight: $buttonH * 1px;
|
|||||||
min-width: 1080px;
|
min-width: 1080px;
|
||||||
min-height: 620px;
|
min-height: 620px;
|
||||||
background-color: $containerBgColor;
|
background-color: $containerBgColor;
|
||||||
background-image: url($containerBgImage);
|
// background-image: url($containerBgImage);
|
||||||
background-size: cover;
|
background-size: cover;
|
||||||
// 定位
|
// 定位
|
||||||
position: relative;
|
position: relative;
|
||||||
@@ -75,49 +82,87 @@ $buttonHeight: $buttonH * 1px;
|
|||||||
}
|
}
|
||||||
.content {
|
.content {
|
||||||
// 元素
|
// 元素
|
||||||
width: $contentWidth;
|
// width: $contentWidth;
|
||||||
height: $contentHeight;
|
// height: $contentHeight;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
background-color: #ffffff;
|
background-color: #ffffff;
|
||||||
box-shadow: 0px 16px 40px rgba(0, 0, 0, 0.07);
|
// box-shadow: 0px 16px 40px rgba(0, 0, 0, 0.07);
|
||||||
border-radius: 20px;
|
// border-radius: 20px;
|
||||||
// 定位
|
// 定位
|
||||||
position: relative;
|
position: relative;
|
||||||
|
display: flex;
|
||||||
|
|
||||||
.pic {
|
.pic {
|
||||||
// 元素
|
// 元素
|
||||||
width: $picWidth;
|
width: $picWidth;
|
||||||
height: $picHeight;
|
height: $picHeight;
|
||||||
background-image: url($picImage);
|
background-image: url($picImage);
|
||||||
background-repeat: no-repeat;
|
background-repeat: no-repeat;
|
||||||
background-size: cover;
|
background-size: 100% 100%;
|
||||||
border-radius: 20px 0 0 20px;
|
background-position: 0 0;
|
||||||
// 定位
|
position: relative;
|
||||||
|
|
||||||
|
&::after {
|
||||||
|
content: '';
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 0;
|
top: 0;
|
||||||
left: 0;
|
left: 0;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
// background: #f003;
|
||||||
|
display: inline-block;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
.field {
|
.field {
|
||||||
width: $fieldWidth;
|
// background: #ccc3;
|
||||||
height: $fieldHeight;
|
position: relative;
|
||||||
// 定位
|
padding-top: 196px;
|
||||||
position: absolute;
|
flex: 1;
|
||||||
top: 0;
|
display: flex;
|
||||||
left: $picWidth;
|
flex-direction: column;
|
||||||
display:flex;
|
// justify-content: center;
|
||||||
justify-content: center;
|
|
||||||
align-items: center;
|
align-items: center;
|
||||||
.pc-title{ width: 100%; clear: both;}
|
.pc-title {
|
||||||
|
width: 100%;
|
||||||
|
text-align: center;
|
||||||
|
clear: both;
|
||||||
|
position: relative;
|
||||||
|
top: -36px;
|
||||||
|
|
||||||
|
// h3.title {
|
||||||
|
// position: relative;
|
||||||
|
|
||||||
|
// &::before {
|
||||||
|
// content: '';
|
||||||
|
// background: url($cnbmLogo) 100% / 100% no-repeat;
|
||||||
|
// height: 48px;
|
||||||
|
// width: 48px;
|
||||||
|
// position: absolute;
|
||||||
|
// left: 0px;
|
||||||
|
// top: 4px;
|
||||||
|
// display: inline-block;
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
}
|
||||||
.mobile-title,
|
.mobile-title,
|
||||||
.mobile-switch {
|
.mobile-switch {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
.form {
|
.form {
|
||||||
|
margin-top: 32px;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
width: $formWidth;
|
// width: $formWidth;
|
||||||
|
width: 100%;
|
||||||
// - - - tab
|
// - - - tab
|
||||||
|
:deep(.el-tabs__nav) {
|
||||||
|
// background: #f0f3;
|
||||||
|
}
|
||||||
:deep(.el-tabs__content) {
|
:deep(.el-tabs__content) {
|
||||||
padding: 20px 0 0;
|
padding: 20px 0 0;
|
||||||
}
|
}
|
||||||
:deep(.el-tabs__item) {
|
:deep(.el-tabs__item) {
|
||||||
|
user-select: none;
|
||||||
// 元素
|
// 元素
|
||||||
width: $tabWidth;
|
width: $tabWidth;
|
||||||
height: $rowHeight;
|
height: $rowHeight;
|
||||||
@@ -125,10 +170,13 @@ $buttonHeight: $buttonH * 1px;
|
|||||||
// 文字
|
// 文字
|
||||||
line-height: $rowHeight;
|
line-height: $rowHeight;
|
||||||
color: #666666;
|
color: #666666;
|
||||||
|
font-size: 18px;
|
||||||
|
font-weight: 400;
|
||||||
|
text-align: center;
|
||||||
}
|
}
|
||||||
:deep(.el-tabs__item.is-active) {
|
:deep(.el-tabs__item.is-active) {
|
||||||
font-weight: bold;
|
font-weight: 500;
|
||||||
color: #2F53EB;
|
color: #2f53eb;
|
||||||
}
|
}
|
||||||
:deep(.el-tabs__active-bar) {
|
:deep(.el-tabs__active-bar) {
|
||||||
height: 3px;
|
height: 3px;
|
||||||
@@ -152,22 +200,26 @@ $buttonHeight: $buttonH * 1px;
|
|||||||
// 文字
|
// 文字
|
||||||
text-align: left;
|
text-align: left;
|
||||||
}
|
}
|
||||||
:deep(.el-input__inner::-webkit-input-placeholder) { /* WebKit browsers */
|
:deep(.el-input__inner::-webkit-input-placeholder) {
|
||||||
|
/* WebKit browsers */
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
color: #8C8C8C;
|
color: #8c8c8c;
|
||||||
}
|
}
|
||||||
:deep(.el-input__inner:-moz-placeholder) { /* Mozilla Firefox 4 to 18 */
|
:deep(.el-input__inner:-moz-placeholder) {
|
||||||
|
/* Mozilla Firefox 4 to 18 */
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
color: #8C8C8C;
|
color: #8c8c8c;
|
||||||
}
|
}
|
||||||
:deep(.el-input__inner::-moz-placeholder) { /* Mozilla Firefox 19+ */
|
:deep(.el-input__inner::-moz-placeholder) {
|
||||||
|
/* Mozilla Firefox 19+ */
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
color: #8C8C8C;
|
color: #8c8c8c;
|
||||||
opacity:1;
|
opacity: 1;
|
||||||
}
|
}
|
||||||
:deep(.el-input__inner:-ms-input-placeholder) { /* Internet Explorer 10+ */
|
:deep(.el-input__inner:-ms-input-placeholder) {
|
||||||
|
/* Internet Explorer 10+ */
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
color: #8C8C8C !important;
|
color: #8c8c8c !important;
|
||||||
}
|
}
|
||||||
:deep(.el-form-item) {
|
:deep(.el-form-item) {
|
||||||
position: relative;
|
position: relative;
|
||||||
@@ -185,10 +237,10 @@ $buttonHeight: $buttonH * 1px;
|
|||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
font-family: PingFang SC;
|
font-family: PingFang SC;
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
color: #2F53EB;
|
color: #2f53eb;
|
||||||
span {
|
span {
|
||||||
padding-left: 15px;
|
padding-left: 15px;
|
||||||
border-left: 2px solid #D9D9D9;
|
border-left: 2px solid #d9d9d9;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -205,16 +257,36 @@ $buttonHeight: $buttonH * 1px;
|
|||||||
// 文字
|
// 文字
|
||||||
line-height: 26px;
|
line-height: 26px;
|
||||||
font-size: 20px;
|
font-size: 20px;
|
||||||
color: #FFFFFF;
|
color: #ffffff;
|
||||||
}
|
}
|
||||||
.button-active {
|
.button-active {
|
||||||
background: #2F53EB;
|
background: #2f53eb;
|
||||||
box-shadow: 0px 2px 8px rgba(0, 80, 184, 0.2);
|
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 {
|
.footer {
|
||||||
|
user-select: none;
|
||||||
// 元素
|
// 元素
|
||||||
height: 16px;
|
height: 16px;
|
||||||
line-height: 16px;
|
line-height: 16px;
|
||||||
@@ -235,17 +307,30 @@ $buttonHeight: $buttonH * 1px;
|
|||||||
// - - - - - PC 最小尺寸设置
|
// - - - - - PC 最小尺寸设置
|
||||||
@media screen and (min-width: 599px) and (max-width: 1366px) {
|
@media screen and (min-width: 599px) and (max-width: 1366px) {
|
||||||
.container {
|
.container {
|
||||||
|
min-width: 599px;
|
||||||
.content {
|
.content {
|
||||||
width: 710px;
|
// width: 710px;
|
||||||
height: 397px;
|
// height: 397px;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
.pic {
|
.pic {
|
||||||
width: 314px;
|
// width: 314px;
|
||||||
|
display: none;
|
||||||
}
|
}
|
||||||
.field {
|
.field {
|
||||||
width: calc(710px - 314px);
|
// width: calc(710px - 314px);
|
||||||
left: 314px;
|
// left: 314px;
|
||||||
|
// justify-content: center;
|
||||||
|
width: 100%;
|
||||||
|
|
||||||
|
.pc-title {
|
||||||
|
h3 {
|
||||||
|
font-size: 2.4rem !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.form {
|
.form {
|
||||||
width: 320px;
|
// width: 320px;
|
||||||
:deep(.el-input__inner) {
|
:deep(.el-input__inner) {
|
||||||
width: 320px;
|
width: 320px;
|
||||||
height: 56px;
|
height: 56px;
|
||||||
@@ -259,7 +344,6 @@ $buttonHeight: $buttonH * 1px;
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* ===== MOBILE DESIGN ===== */
|
/* ===== MOBILE DESIGN ===== */
|
||||||
$mobileW: 375;
|
$mobileW: 375;
|
||||||
$mobileH: 812;
|
$mobileH: 812;
|
||||||
@@ -273,9 +357,10 @@ $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';
|
||||||
@@ -288,13 +373,17 @@ $iconBgImage: '../assets/images/icon.png';
|
|||||||
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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.pc-title {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
.content {
|
.content {
|
||||||
// 元素
|
// 元素
|
||||||
width: $mobileContentWidth;
|
width: $mobileContentWidth;
|
||||||
@@ -309,6 +398,7 @@ $iconBgImage: '../assets/images/icon.png';
|
|||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
.field {
|
.field {
|
||||||
|
padding: 0;
|
||||||
// 元素
|
// 元素
|
||||||
width: inherit;
|
width: inherit;
|
||||||
min-height: inherit;
|
min-height: inherit;
|
||||||
@@ -316,12 +406,15 @@ $iconBgImage: '../assets/images/icon.png';
|
|||||||
left: 0;
|
left: 0;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
|
|
||||||
.mobile-title {
|
.mobile-title {
|
||||||
// 元素
|
// 元素
|
||||||
margin: 0 0 20px;
|
margin: 0;
|
||||||
display: block;
|
display: block;
|
||||||
}
|
}
|
||||||
|
|
||||||
.form {
|
.form {
|
||||||
|
margin: 0;
|
||||||
width: $mobileFormWidth;
|
width: $mobileFormWidth;
|
||||||
// - - - tab
|
// - - - tab
|
||||||
:deep(.el-tabs__header) {
|
:deep(.el-tabs__header) {
|
||||||
@@ -347,7 +440,25 @@ $iconBgImage: '../assets/images/icon.png';
|
|||||||
.button {
|
.button {
|
||||||
height: $mobileButtonHeight;
|
height: $mobileButtonHeight;
|
||||||
line-height: 24px;
|
line-height: 24px;
|
||||||
color: #FFFFFF;
|
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 {
|
.mobile-switch {
|
||||||
@@ -370,6 +481,7 @@ $iconBgImage: '../assets/images/icon.png';
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.footer {
|
.footer {
|
||||||
// 元素
|
// 元素
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
@@ -379,9 +491,8 @@ $iconBgImage: '../assets/images/icon.png';
|
|||||||
color: #333333;
|
color: #333333;
|
||||||
opacity: 0.6;
|
opacity: 0.6;
|
||||||
// 定位
|
// 定位
|
||||||
position: absolute;
|
// position: absolute;
|
||||||
bottom: 20px;
|
bottom: -32px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -109,7 +109,6 @@
|
|||||||
<script>
|
<script>
|
||||||
import { getAccessToken } from '@/utils/auth';
|
import { getAccessToken } from '@/utils/auth';
|
||||||
import tupleImg from '@/assets/images/tuple.png';
|
import tupleImg from '@/assets/images/tuple.png';
|
||||||
import cache from '@/utils/cache';
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 找到最长的label
|
* 找到最长的label
|
||||||
@@ -191,7 +190,7 @@ export default {
|
|||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: false,
|
default: false,
|
||||||
},
|
},
|
||||||
hasFiles: {
|
hasFile: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: false,
|
default: false,
|
||||||
},
|
},
|
||||||
@@ -237,7 +236,7 @@ export default {
|
|||||||
dataForm: {
|
dataForm: {
|
||||||
handler(val) {
|
handler(val) {
|
||||||
this.form = JSON.parse(JSON.stringify(val));
|
this.form = JSON.parse(JSON.stringify(val));
|
||||||
if (this.hasFiles) {
|
if (this.hasFile) {
|
||||||
this.form.files = this.form.files ?? [];
|
this.form.files = this.form.files ?? [];
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -318,11 +317,6 @@ export default {
|
|||||||
'list' in response.data
|
'list' in response.data
|
||||||
? response.data.list
|
? response.data.list
|
||||||
: response.data;
|
: response.data;
|
||||||
|
|
||||||
if (opt.cache) {
|
|
||||||
cache.store(opt.cache, list);
|
|
||||||
}
|
|
||||||
|
|
||||||
this.$set(
|
this.$set(
|
||||||
this.optionListOf,
|
this.optionListOf,
|
||||||
opt.prop,
|
opt.prop,
|
||||||
|
|||||||
@@ -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);
|
||||||
|
|||||||
@@ -28,37 +28,10 @@ export default {
|
|||||||
// tableBtn: [], // 占位
|
// tableBtn: [], // 占位
|
||||||
// searchBarFormConfig: [], // 占位
|
// searchBarFormConfig: [], // 占位
|
||||||
// // 弹窗表单配置
|
// // 弹窗表单配置
|
||||||
// dialogFormConfig: [], //
|
// dialogFormConfig: [], // 占位
|
||||||
updateUrl: '',
|
|
||||||
addUrl: '',
|
|
||||||
pageUrl: '',
|
|
||||||
form: {}
|
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
// utils
|
|
||||||
http(url, method, payload) {
|
|
||||||
return this.$axios({
|
|
||||||
url,
|
|
||||||
method,
|
|
||||||
params: method === 'get' ? payload : null,
|
|
||||||
data: method !== 'get' ? payload : null,
|
|
||||||
})
|
|
||||||
},
|
|
||||||
put(payload) {
|
|
||||||
return this.http(this.updateUrl, 'put', payload);
|
|
||||||
},
|
|
||||||
post(payload) {
|
|
||||||
return this.http(this.addUrl, 'post', payload);
|
|
||||||
},
|
|
||||||
recv(payload) {
|
|
||||||
return this.http(this.pageUrl, 'get', payload);
|
|
||||||
},
|
|
||||||
info(payload) {
|
|
||||||
return this.http(this.infoUrl, 'get', payload);
|
|
||||||
},
|
|
||||||
|
|
||||||
|
|
||||||
// 过滤后端传回的详情数据
|
// 过滤后端传回的详情数据
|
||||||
filterData(data, keys) {
|
filterData(data, keys) {
|
||||||
const obj = {};
|
const obj = {};
|
||||||
|
|||||||
@@ -72,7 +72,7 @@ export const constantRoutes = [
|
|||||||
{
|
{
|
||||||
path: '/',
|
path: '/',
|
||||||
component: Layout,
|
component: Layout,
|
||||||
// redirect: 'core/base/factory',
|
redirect: 'core/base/factory',
|
||||||
// children: [{
|
// children: [{
|
||||||
// path: 'index',
|
// path: 'index',
|
||||||
// redirect: 'core/base/factory',
|
// redirect: 'core/base/factory',
|
||||||
|
|||||||
@@ -1,53 +0,0 @@
|
|||||||
let timers = [];
|
|
||||||
|
|
||||||
export default {
|
|
||||||
|
|
||||||
exists(key) {
|
|
||||||
const _ = localStorage.getItem('stored_keys');
|
|
||||||
return _ ? _.split(',')?.indexOf(key) != -1 : false;
|
|
||||||
},
|
|
||||||
|
|
||||||
store(key, value, duration = null) {
|
|
||||||
if (!localStorage.getItem('stored_keys')) localStorage.setItem('stored_keys', key);
|
|
||||||
else localStorage.setItem('stored_keys', localStorage.getItem('stored_keys') + ',' + key);
|
|
||||||
|
|
||||||
localStorage.setItem(key, JSON.stringify(value));
|
|
||||||
console.log('store duration', duration)
|
|
||||||
if (duration) {
|
|
||||||
if (timers[key]) clearTimeout(timers[key]);
|
|
||||||
timers[key] = setTimeout(() => {
|
|
||||||
console.log("clear cache", key)
|
|
||||||
this.clear([key]);
|
|
||||||
}, duration * 1000);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @param {*} key
|
|
||||||
* @param {*} cb
|
|
||||||
* @param {*} param2 force 强制更新,调用cb
|
|
||||||
* @returns
|
|
||||||
*/
|
|
||||||
async getList(key, cb = null, { force = false, duration = null } = {}) {
|
|
||||||
if (this.exists(key) && !force) {
|
|
||||||
return JSON.parse(localStorage.getItem(key))
|
|
||||||
} else {
|
|
||||||
const list = await cb();
|
|
||||||
this.store(key, list, duration);
|
|
||||||
return list;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
clear(keys) {
|
|
||||||
if (keys && keys.length) {
|
|
||||||
let stored_keys = localStorage.getItem('stored_keys').split(',');
|
|
||||||
keys.forEach((key) => {
|
|
||||||
stored_keys = stored_keys.filter((item) => item != key);
|
|
||||||
});
|
|
||||||
localStorage.setItem('stored_keys', stored_keys);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
localStorage.removeItem('stored_keys');
|
|
||||||
},
|
|
||||||
}
|
|
||||||
@@ -95,12 +95,7 @@ export const DICT_TYPE = {
|
|||||||
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'
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -217,7 +217,7 @@ export function getTime(type) {
|
|||||||
export function debounce(func, wait, immediate) {
|
export function debounce(func, wait, immediate) {
|
||||||
let timeout, args, context, timestamp, result
|
let timeout, args, context, timestamp, result
|
||||||
|
|
||||||
const later = function () {
|
const later = function() {
|
||||||
// 据上一次触发时间间隔
|
// 据上一次触发时间间隔
|
||||||
const last = +new Date() - timestamp
|
const last = +new Date() - timestamp
|
||||||
|
|
||||||
@@ -234,7 +234,7 @@ export function debounce(func, wait, immediate) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return function (...args) {
|
return function(...args) {
|
||||||
context = this
|
context = this
|
||||||
timestamp = +new Date()
|
timestamp = +new Date()
|
||||||
const callNow = immediate && !timeout
|
const callNow = immediate && !timeout
|
||||||
@@ -438,7 +438,3 @@ export function toCamelCase(str, upperCaseFirst) {
|
|||||||
|
|
||||||
return str;
|
return str;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function IdToName(targetId, source, prop = 'name') {
|
|
||||||
return source.find(item => item.id === targetId)?.[prop]
|
|
||||||
}
|
|
||||||
@@ -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>
|
||||||
|
|||||||
@@ -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>
|
||||||
|
|
||||||
<!-- 抽屉 详情 -->
|
<!-- 抽屉 详情 -->
|
||||||
@@ -219,7 +219,7 @@ export default {
|
|||||||
{
|
{
|
||||||
select: true,
|
select: true,
|
||||||
label: '设备',
|
label: '设备',
|
||||||
url: '/base/core-equipment/page?pageNo=1&pageSize=100',
|
url: '/base/equipment/page?pageNo=1&pageSize=100',
|
||||||
prop: 'equipmentId',
|
prop: 'equipmentId',
|
||||||
bind: {
|
bind: {
|
||||||
filterable: true,
|
filterable: true,
|
||||||
@@ -278,7 +278,7 @@ export default {
|
|||||||
input: true,
|
input: true,
|
||||||
label: '设备分组编码',
|
label: '设备分组编码',
|
||||||
prop: 'code',
|
prop: 'code',
|
||||||
// url: '/base/core-equipment/getCode',
|
// url: '/base/equipment/getCode',
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -191,7 +191,7 @@ export default {
|
|||||||
// 获取设备列表
|
// 获取设备列表
|
||||||
async getEquipmentList() {
|
async getEquipmentList() {
|
||||||
const response = await this.$axios(
|
const response = await this.$axios(
|
||||||
'/base/core-equipment/page?pageNo=1&pageSize=100'
|
'/base/equipment/page?pageNo=1&pageSize=100'
|
||||||
);
|
);
|
||||||
this.equipmentList = response.data.list.map((item) => ({
|
this.equipmentList = response.data.list.map((item) => ({
|
||||||
label: item.name,
|
label: item.name,
|
||||||
|
|||||||
@@ -192,7 +192,7 @@ export default {
|
|||||||
{
|
{
|
||||||
select: true,
|
select: true,
|
||||||
label: '设备',
|
label: '设备',
|
||||||
url: '/base/core-equipment/page?pageNo=1&pageSize=100',
|
url: '/base/equipment/page?pageNo=1&pageSize=100',
|
||||||
prop: 'equipmentId',
|
prop: 'equipmentId',
|
||||||
rules: [{ required: true, message: '不能为空', trigger: 'blur' }],
|
rules: [{ required: true, message: '不能为空', trigger: 'blur' }],
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -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>
|
||||||
|
|
||||||
|
|||||||
@@ -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>
|
||||||
|
|
||||||
<!-- 抽屉 详情 -->
|
<!-- 抽屉 详情 -->
|
||||||
@@ -192,7 +192,7 @@ export default {
|
|||||||
input: true,
|
input: true,
|
||||||
label: '设备分组编码',
|
label: '设备分组编码',
|
||||||
prop: 'code',
|
prop: 'code',
|
||||||
// url: '/base/core-equipment/getCode',
|
// url: '/base/equipment/getCode',
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -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>
|
||||||
|
|||||||
@@ -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>
|
||||||
|
|
||||||
|
|||||||
@@ -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>
|
||||||
|
|
||||||
<!-- 抽屉 详情 -->
|
<!-- 抽屉 详情 -->
|
||||||
@@ -247,7 +247,7 @@ export default {
|
|||||||
select: true,
|
select: true,
|
||||||
label: '设备',
|
label: '设备',
|
||||||
prop: 'equipmentId',
|
prop: 'equipmentId',
|
||||||
url: '/base/core-equipment/page?pageNo=1&pageSize=99',
|
url: '/base/equipment/page?pageNo=1&pageSize=99',
|
||||||
rules: [{ required: true, message: '不能为空', trigger: 'blur' }],
|
rules: [{ required: true, message: '不能为空', trigger: 'blur' }],
|
||||||
bind: {
|
bind: {
|
||||||
filterable: true,
|
filterable: true,
|
||||||
@@ -283,7 +283,7 @@ export default {
|
|||||||
input: true,
|
input: true,
|
||||||
label: '关联表名',
|
label: '关联表名',
|
||||||
prop: 'plcTableName',
|
prop: 'plcTableName',
|
||||||
// url: '/base/core-equipment/getCode',
|
// url: '/base/equipment/getCode',
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
@@ -320,7 +320,7 @@ export default {
|
|||||||
methods: {
|
methods: {
|
||||||
async getEquipmentOptions() {
|
async getEquipmentOptions() {
|
||||||
const res = await this.$axios({
|
const res = await this.$axios({
|
||||||
url: '/base/core-equipment/listAll',
|
url: '/base/equipment/listAll',
|
||||||
method: 'get',
|
method: 'get',
|
||||||
});
|
});
|
||||||
return res.data;
|
return res.data;
|
||||||
|
|||||||
@@ -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>
|
||||||
|
|||||||
@@ -1,100 +0,0 @@
|
|||||||
/*
|
|
||||||
* @Author: zwq
|
|
||||||
* @Date: 2022-08-24 11:19:43
|
|
||||||
* @LastEditors: zwq
|
|
||||||
* @LastEditTime: 2023-08-03 14:21:04
|
|
||||||
* @Description:
|
|
||||||
*/
|
|
||||||
export default {
|
|
||||||
data() {
|
|
||||||
/* eslint-disable */
|
|
||||||
return {
|
|
||||||
urlOptions: {
|
|
||||||
createURL: '',
|
|
||||||
updateURL: '',
|
|
||||||
infoURL: '',
|
|
||||||
codeURL: '',
|
|
||||||
getOption: false,
|
|
||||||
isGetCode: false,
|
|
||||||
optionArrUrl: [],
|
|
||||||
optionArr: {}
|
|
||||||
},
|
|
||||||
visible: false,
|
|
||||||
setData: false
|
|
||||||
}
|
|
||||||
},
|
|
||||||
created() {
|
|
||||||
},
|
|
||||||
activated() {
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
init(id) {
|
|
||||||
this.dataForm.id = id || "";
|
|
||||||
this.visible = true;
|
|
||||||
if (this.urlOptions.getOption) {
|
|
||||||
this.getArr()
|
|
||||||
}
|
|
||||||
this.$nextTick(() => {
|
|
||||||
this.$refs["dataForm"].resetFields();
|
|
||||||
if (this.dataForm.id) {
|
|
||||||
this.urlOptions.infoURL(id).then(response => {
|
|
||||||
this.dataForm = response.data;
|
|
||||||
if (this.setData) {
|
|
||||||
this.setDataForm()
|
|
||||||
}
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
if (this.urlOptions.isGetCode) {
|
|
||||||
this.getCode()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
getCode() {
|
|
||||||
this.urlOptions.codeURL()
|
|
||||||
.then(({ data: res }) => {
|
|
||||||
this.dataForm.code = res;
|
|
||||||
})
|
|
||||||
.catch(() => {});
|
|
||||||
},
|
|
||||||
getArr() {
|
|
||||||
const params = {
|
|
||||||
pageSize: 100,
|
|
||||||
pageNo: 1,
|
|
||||||
}
|
|
||||||
this.urlOptions.optionArrUrl.forEach((item, index) => {
|
|
||||||
item(params).then(({ data: res }) => {
|
|
||||||
this.$set(this.urlOptions.optionArr, `arr${index}`, res.list)
|
|
||||||
})
|
|
||||||
.catch(() => {
|
|
||||||
});
|
|
||||||
});
|
|
||||||
},
|
|
||||||
// 表单提交
|
|
||||||
dataFormSubmit() {
|
|
||||||
this.$refs["dataForm"].validate((valid) => {
|
|
||||||
if (!valid) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
// 修改的提交
|
|
||||||
if (this.dataForm.id) {
|
|
||||||
this.urlOptions.updateURL(this.dataForm).then(response => {
|
|
||||||
this.$modal.msgSuccess("修改成功");
|
|
||||||
this.visible = false;
|
|
||||||
this.$emit("refreshDataList");
|
|
||||||
});
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
// 添加的提交
|
|
||||||
this.urlOptions.createURL(this.dataForm).then(response => {
|
|
||||||
this.$modal.msgSuccess("新增成功");
|
|
||||||
this.visible = false;
|
|
||||||
this.$emit("refreshDataList");
|
|
||||||
});
|
|
||||||
});
|
|
||||||
},
|
|
||||||
formClear() {
|
|
||||||
this.$refs.dataForm.resetFields()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,168 +0,0 @@
|
|||||||
/*
|
|
||||||
* @Author: zwq
|
|
||||||
* @Date: 2022-08-24 11:19:43
|
|
||||||
* @LastEditors: DY
|
|
||||||
* @LastEditTime: 2023-09-21 16:02:07
|
|
||||||
* @Description:
|
|
||||||
*/
|
|
||||||
export default {
|
|
||||||
data() {
|
|
||||||
/* eslint-disable */
|
|
||||||
return {
|
|
||||||
urlOptions: {
|
|
||||||
getDataListURL: '',
|
|
||||||
deleteURL: '',
|
|
||||||
statusUrl: '',
|
|
||||||
exportURL: ''
|
|
||||||
},
|
|
||||||
tableData: [],
|
|
||||||
listQuery: {
|
|
||||||
pageSize: 10,
|
|
||||||
pageNo: 1,
|
|
||||||
total: 1,
|
|
||||||
},
|
|
||||||
exportLoading: false,
|
|
||||||
dataListLoading: false,
|
|
||||||
addOrEditTitle: '',
|
|
||||||
addOrUpdateVisible: false,
|
|
||||||
}
|
|
||||||
},
|
|
||||||
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.addOrUpdateVisible = true;
|
|
||||||
this.$nextTick(() => {
|
|
||||||
this.$refs.addOrUpdate.init(id);
|
|
||||||
});
|
|
||||||
},
|
|
||||||
cancel(id) {
|
|
||||||
this.$refs["popover-" + id].showPopper = false;
|
|
||||||
},
|
|
||||||
//改变状态
|
|
||||||
changeStatus(id) {
|
|
||||||
this.$http
|
|
||||||
.post(this.urlOptions.statusUrl, { id })
|
|
||||||
.then(({ data: res }) => {
|
|
||||||
if (res.code !== 0) {
|
|
||||||
return this.$message.error(res.msg);
|
|
||||||
}
|
|
||||||
this.$refs["popover-" + id].showPopper = false;
|
|
||||||
this.$message({
|
|
||||||
message: this.$t("prompt.success"),
|
|
||||||
type: "success",
|
|
||||||
duration: 500,
|
|
||||||
onClose: () => {
|
|
||||||
this.getDataList();
|
|
||||||
},
|
|
||||||
});
|
|
||||||
})
|
|
||||||
.catch(() => { });
|
|
||||||
},
|
|
||||||
//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 if (val.type === "change") {
|
|
||||||
this.changeStatus(val.data.id)
|
|
||||||
} 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(() => { });
|
|
||||||
},
|
|
||||||
//search-bar点击
|
|
||||||
buttonClick(val) {
|
|
||||||
switch (val.btnName) {
|
|
||||||
case "search":
|
|
||||||
this.listQuery.xm1 = val.xm1;
|
|
||||||
this.listQuery.xm2 = val.xm2;
|
|
||||||
this.listQuery.pageNo = 1;
|
|
||||||
this.getDataList();
|
|
||||||
break;
|
|
||||||
case "add":
|
|
||||||
this.addOrEditTitle = '新增'
|
|
||||||
this.addOrUpdateVisible = true;
|
|
||||||
this.addOrUpdateHandle()
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
console.log(val)
|
|
||||||
}
|
|
||||||
},
|
|
||||||
handleCancel() {
|
|
||||||
this.$refs.addOrUpdate.formClear()
|
|
||||||
this.addOrUpdateVisible = false
|
|
||||||
this.addOrEditTitle = ''
|
|
||||||
},
|
|
||||||
handleConfirm() {
|
|
||||||
this.$refs.addOrUpdate.dataFormSubmit()
|
|
||||||
},
|
|
||||||
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(() => { });
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,69 +0,0 @@
|
|||||||
|
|
||||||
/*
|
|
||||||
* @Date: 2020-12-29 16:49:28
|
|
||||||
* @LastEditors: DY
|
|
||||||
* @LastEditTime: 2023-09-12 11:13:34
|
|
||||||
* @FilePath: \basic-admin\src\filters\basicData\index.js
|
|
||||||
* @Description:
|
|
||||||
*/
|
|
||||||
|
|
||||||
const table = {
|
|
||||||
lineStatus: {
|
|
||||||
1: '生产中',
|
|
||||||
2: '停止',
|
|
||||||
3: '未知',
|
|
||||||
},
|
|
||||||
reportType: {
|
|
||||||
1: '日',
|
|
||||||
2: '周',
|
|
||||||
3: '月'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 日期格式化
|
|
||||||
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()
|
|
||||||
}
|
|
||||||
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 default function (dictTable) {
|
|
||||||
return function (val) {
|
|
||||||
return table?.[dictTable]?.[val]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -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>
|
|
||||||
@@ -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,347 +0,0 @@
|
|||||||
<!--
|
|
||||||
* @Author: zhp
|
|
||||||
* @Date: 2023-10-17 16:50:19
|
|
||||||
* @LastEditTime: 2023-10-18 16:07:39
|
|
||||||
* @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="name">
|
|
||||||
<el-input v-model="dataForm.name" clearable placeholder="名称" />
|
|
||||||
</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-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 {
|
|
||||||
createPackingType,
|
|
||||||
updatePackingType,
|
|
||||||
getPackingType,
|
|
||||||
// getWorkOrderList,
|
|
||||||
// getCode,
|
|
||||||
// getCustomerList,
|
|
||||||
// getModelList
|
|
||||||
} from '@/api/base/modelType.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: '', // 产品名称
|
|
||||||
name: '', // 产品编码
|
|
||||||
// area: 0, // 单位平方数(float only)
|
|
||||||
description: null, // 产品类型id
|
|
||||||
// workOrderId: null, // 单位产品用时 (s)
|
|
||||||
// customerId: '', // 规格
|
|
||||||
// content: '', // 单位id
|
|
||||||
},
|
|
||||||
listQuery: {
|
|
||||||
pageSize: 10,
|
|
||||||
pageNo: 1,
|
|
||||||
total: 0,
|
|
||||||
},
|
|
||||||
dataRule: {
|
|
||||||
name: [
|
|
||||||
{
|
|
||||||
required: true,
|
|
||||||
message: '名称不能为空',
|
|
||||||
trigger: 'blur',
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
// 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) {
|
|
||||||
// 获取产品详情
|
|
||||||
getPackingType(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) {
|
|
||||||
updatePackingType(this.dataForm).then((response) => {
|
|
||||||
this.$modal.msgSuccess('修改成功');
|
|
||||||
this.visible = false;
|
|
||||||
this.$emit('refreshDataList');
|
|
||||||
});
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
// 添加的提交
|
|
||||||
createPackingType(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,191 +0,0 @@
|
|||||||
<!--
|
|
||||||
* @Author: zwq
|
|
||||||
* @Date: 2023-08-01 14:55:51
|
|
||||||
* @LastEditors: zhp
|
|
||||||
* @LastEditTime: 2023-10-18 16:11:22
|
|
||||||
* @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 {
|
|
||||||
deletePackingType,
|
|
||||||
getPackingTypePage,
|
|
||||||
// exportPackingExcel,
|
|
||||||
} from '@/api/base/modelType';
|
|
||||||
|
|
||||||
const tableProps = [
|
|
||||||
{
|
|
||||||
prop: 'name',
|
|
||||||
label: '名称'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
prop: 'description',
|
|
||||||
label: '描述'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
prop: 'createTime',
|
|
||||||
label: '生成日期',
|
|
||||||
filter: parseTime
|
|
||||||
},
|
|
||||||
];
|
|
||||||
|
|
||||||
export default {
|
|
||||||
mixins: [basicPage],
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
urlOptions: {
|
|
||||||
getDataListURL: getPackingTypePage,
|
|
||||||
deleteURL: deletePackingType,
|
|
||||||
// exportURL: exportPackingExcel,
|
|
||||||
},
|
|
||||||
tableProps,
|
|
||||||
tableBtn: [
|
|
||||||
this.$auth.hasPermi(`base:packaging-print-log:update`)
|
|
||||||
? {
|
|
||||||
type: 'edit',
|
|
||||||
btnName: '编辑',
|
|
||||||
}
|
|
||||||
: undefined,
|
|
||||||
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: {
|
|
||||||
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);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
otherMethods(val) {
|
|
||||||
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>
|
|
||||||
@@ -27,6 +27,7 @@
|
|||||||
}">
|
}">
|
||||||
<el-upload
|
<el-upload
|
||||||
class="equipment-upload"
|
class="equipment-upload"
|
||||||
|
:style="{ marginBottom: isPicMode ? '48px' : '24px' }"
|
||||||
:disabled="disabled"
|
:disabled="disabled"
|
||||||
drag
|
drag
|
||||||
:action="uploadUrl"
|
:action="uploadUrl"
|
||||||
|
|||||||
@@ -283,7 +283,7 @@ export default {
|
|||||||
async getEqTypeList() {
|
async getEqTypeList() {
|
||||||
this.formLoading = true;
|
this.formLoading = true;
|
||||||
const { code, data } = await this.$axios(
|
const { code, data } = await this.$axios(
|
||||||
'/base/core-equipment-type/page?pageNo=1&pageSize=100'
|
'/base/equipment-type/page?pageNo=1&pageSize=100'
|
||||||
);
|
);
|
||||||
// debugger;
|
// debugger;
|
||||||
if (code == 0) {
|
if (code == 0) {
|
||||||
|
|||||||
@@ -44,8 +44,9 @@
|
|||||||
ref="form"
|
ref="form"
|
||||||
label-position="top"
|
label-position="top"
|
||||||
size="small"
|
size="small"
|
||||||
:dataForm="form"
|
v-model="form"
|
||||||
:rows="computedRows" />
|
:rows="computedRows"
|
||||||
|
:has-file="true" />
|
||||||
</base-dialog>
|
</base-dialog>
|
||||||
|
|
||||||
<!-- 设备 详情 - 编辑 -->
|
<!-- 设备 详情 - 编辑 -->
|
||||||
@@ -60,9 +61,9 @@
|
|||||||
name: '基本信息',
|
name: '基本信息',
|
||||||
key: 'base',
|
key: 'base',
|
||||||
rows: computedRows,
|
rows: computedRows,
|
||||||
url: '/base/core-equipment/get',
|
url: '/base/equipment/get',
|
||||||
urlUpdate: '/base/core-equipment/update',
|
urlUpdate: '/base/equipment/update',
|
||||||
urlCreate: '/base/core-equipment/create',
|
urlCreate: '/base/equipment/create',
|
||||||
queryParams: { id: form.id },
|
queryParams: { id: form.id },
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -240,7 +241,7 @@ export default {
|
|||||||
input: true,
|
input: true,
|
||||||
label: '设备编码',
|
label: '设备编码',
|
||||||
prop: 'code',
|
prop: 'code',
|
||||||
url: '/base/core-equipment/getCode',
|
url: '/base/equipment/getCode',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
input: true,
|
input: true,
|
||||||
@@ -267,7 +268,7 @@ export default {
|
|||||||
select: true,
|
select: true,
|
||||||
label: '设备类型',
|
label: '设备类型',
|
||||||
prop: 'equipmentTypeId',
|
prop: 'equipmentTypeId',
|
||||||
url: '/base/core-equipment-type/page?pageNo=1&pageSize=100',
|
url: '/base/equipment-type/page?pageNo=1&pageSize=100',
|
||||||
bind: {
|
bind: {
|
||||||
filterable: true,
|
filterable: true,
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -41,8 +41,8 @@
|
|||||||
v-if="open"
|
v-if="open"
|
||||||
ref="form"
|
ref="form"
|
||||||
v-model="form"
|
v-model="form"
|
||||||
:has-files="true"
|
:rows="rows"
|
||||||
:rows="rows" />
|
:has-file="true" />
|
||||||
</base-dialog>
|
</base-dialog>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@@ -144,7 +144,7 @@ export default {
|
|||||||
input: true,
|
input: true,
|
||||||
label: '设备类型编码',
|
label: '设备类型编码',
|
||||||
prop: 'code',
|
prop: 'code',
|
||||||
url: '/base/core-equipment-type/getCode',
|
url: '/base/equipment-type/getCode',
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
@@ -152,7 +152,7 @@ export default {
|
|||||||
select: true,
|
select: true,
|
||||||
label: '父类',
|
label: '父类',
|
||||||
prop: 'parentId',
|
prop: 'parentId',
|
||||||
url: '/base/core-equipment-type/page?pageNo=1&pageSize=100',
|
url: '/base/equipment-type/page?pageNo=1&pageSize=100',
|
||||||
},
|
},
|
||||||
{},
|
{},
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -20,6 +20,9 @@
|
|||||||
@change="selectObj"
|
@change="selectObj"
|
||||||
clearable></el-cascader>
|
clearable></el-cascader>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
<el-form-item label="对象备注" prop="remark">
|
||||||
|
<el-input v-model="form.remark"/>
|
||||||
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
@@ -39,7 +42,8 @@ export default {
|
|||||||
id: '',
|
id: '',
|
||||||
plcId: '',
|
plcId: '',
|
||||||
bindObjectId: '',
|
bindObjectId: '',
|
||||||
bindObjectType: ''
|
bindObjectType: '',
|
||||||
|
remark: ''
|
||||||
},
|
},
|
||||||
objIds: [],// 回显数组
|
objIds: [],// 回显数组
|
||||||
plcList: [],
|
plcList: [],
|
||||||
@@ -126,6 +130,7 @@ export default {
|
|||||||
this.form.plcId = ''
|
this.form.plcId = ''
|
||||||
this.form.bindObjectId = ''
|
this.form.bindObjectId = ''
|
||||||
this.form.bindObjectType = ''
|
this.form.bindObjectType = ''
|
||||||
|
this.form.remark = ''
|
||||||
this.objIds = []
|
this.objIds = []
|
||||||
this.isEdit = false
|
this.isEdit = false
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -61,6 +61,10 @@ const tableProps = [
|
|||||||
prop: 'objCode',
|
prop: 'objCode',
|
||||||
label: '对象编码'
|
label: '对象编码'
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
prop: 'remark',
|
||||||
|
label: '对象备注'
|
||||||
|
},
|
||||||
{
|
{
|
||||||
prop: 'plcTableName',
|
prop: 'plcTableName',
|
||||||
label: '关联表名'
|
label: '关联表名'
|
||||||
|
|||||||
@@ -38,8 +38,8 @@ const tableProps = [
|
|||||||
label: '统计对象'
|
label: '统计对象'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'objCode',
|
prop: 'objRemark',
|
||||||
label: '对象编码'
|
label: '对象备注'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'energyTypeName',
|
prop: 'energyTypeName',
|
||||||
|
|||||||
@@ -55,8 +55,9 @@ const tableProps = [
|
|||||||
label: '监控对象'
|
label: '监控对象'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'objCode',
|
prop: 'objectType',
|
||||||
label: '对象编码'
|
label: '对象备注',
|
||||||
|
filter: publicFormatter('object_type')
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'energyType',
|
prop: 'energyType',
|
||||||
|
|||||||
@@ -34,8 +34,8 @@ const tableProps = [
|
|||||||
label: '监控对象'
|
label: '监控对象'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'objCode',
|
prop: 'objRemark',
|
||||||
label: '对象编码'
|
label: '对象备注'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'energyType',
|
prop: 'energyType',
|
||||||
|
|||||||
@@ -54,8 +54,8 @@ const tableProps = [
|
|||||||
label: '所属对象'
|
label: '所属对象'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'objCode',
|
prop: 'objRemark',
|
||||||
label: '对象编码'
|
label: '对象备注'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'paramName',
|
prop: 'paramName',
|
||||||
|
|||||||
@@ -41,8 +41,8 @@ const tableProps = [
|
|||||||
label: '所属对象'
|
label: '所属对象'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'objCode',
|
prop: 'objRemark',
|
||||||
label: '对象编码'
|
label: '对象备注'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'paramName',
|
prop: 'paramName',
|
||||||
|
|||||||
@@ -1,93 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div
|
|
||||||
id="orderEnergyChart"
|
|
||||||
style="width: 100%"
|
|
||||||
:style="{ height: chartHeight + 'px' }"
|
|
||||||
></div>
|
|
||||||
</template>
|
|
||||||
<script>
|
|
||||||
import * as echarts from 'echarts'
|
|
||||||
import resize from '@/utils/chartMixins/resize'
|
|
||||||
export default {
|
|
||||||
name: "BarChart",
|
|
||||||
mixins: [resize],
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
chartDom: '',
|
|
||||||
chart: '',
|
|
||||||
chartHeight: this.tableHeight(430)
|
|
||||||
}
|
|
||||||
},
|
|
||||||
props: {
|
|
||||||
chartData: {
|
|
||||||
type: Array,
|
|
||||||
required: true,
|
|
||||||
default: () => {
|
|
||||||
return []
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
watch: {
|
|
||||||
chartData: function () {
|
|
||||||
this.getChart()
|
|
||||||
}
|
|
||||||
},
|
|
||||||
mounted() {
|
|
||||||
window.addEventListener('resize', () => {
|
|
||||||
this.chartHeight = this.tableHeight(430)
|
|
||||||
})
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
getChart() {
|
|
||||||
if (
|
|
||||||
this.chart !== null &&
|
|
||||||
this.chart !== '' &&
|
|
||||||
this.chart !== undefined
|
|
||||||
) {
|
|
||||||
this.chart.dispose() // 页面多次刷新会出现警告,Dom已经初始化了一个实例,这是销毁实例
|
|
||||||
}
|
|
||||||
this.chartDom = document.getElementById('orderEnergyChart')
|
|
||||||
this.chart = echarts.init(this.chartDom)
|
|
||||||
console.log(this.chartData)
|
|
||||||
let xData = []
|
|
||||||
let yData = []
|
|
||||||
this.chartData && this.chartData.map(item =>{
|
|
||||||
xData.push(item.objName)
|
|
||||||
yData.push(item.useNum)
|
|
||||||
})
|
|
||||||
var option = {
|
|
||||||
color:['#288AFF'],
|
|
||||||
grid: {
|
|
||||||
left: '2%',
|
|
||||||
right: '1%',
|
|
||||||
bottom: '1%',
|
|
||||||
containLabel: true
|
|
||||||
},
|
|
||||||
xAxis: {
|
|
||||||
type: 'category',
|
|
||||||
data: xData,
|
|
||||||
axisLabel: {
|
|
||||||
rotate: "45"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
yAxis: {
|
|
||||||
type: 'value'
|
|
||||||
},
|
|
||||||
series: [
|
|
||||||
{
|
|
||||||
data: yData,
|
|
||||||
type: 'bar',
|
|
||||||
barMaxWidth: 20,
|
|
||||||
label: {
|
|
||||||
show: true,
|
|
||||||
position: 'top'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
};
|
|
||||||
|
|
||||||
option && this.chart.setOption(option);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
@@ -1,269 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div class="orderEnergyContainer">
|
|
||||||
<div class="box1">
|
|
||||||
<!-- 搜索工作栏 -->
|
|
||||||
<search-bar
|
|
||||||
:formConfigs="formConfig"
|
|
||||||
ref="searchBarForm"
|
|
||||||
@headBtnClick="buttonClick"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
<div class="box2">
|
|
||||||
<div class="boxTitle">
|
|
||||||
<span class="blueTitle"></span>
|
|
||||||
<span>工单信息</span>
|
|
||||||
</div>
|
|
||||||
<el-row>
|
|
||||||
<el-col :span='4'>
|
|
||||||
<div class="blodTip">工单名称</div>
|
|
||||||
<div class="lightTip">{{ orderMsg.name }}</div>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span='4'>
|
|
||||||
<div class="blodTip">产品名称</div>
|
|
||||||
<div class="lightTip">{{orderMsg.productName }}</div>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span='4'>
|
|
||||||
<div class="blodTip">计划完成数量</div>
|
|
||||||
<div class="lightTip">{{orderMsg.planQuantity }}</div>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span='4'>
|
|
||||||
<div class="blodTip">实际开始时间</div>
|
|
||||||
<div class="lightTip">{{ parseTime(orderMsg.startProduceTime) }}</div>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span='4'>
|
|
||||||
<div class="blodTip">实际完成时间</div>
|
|
||||||
<div class="lightTip">{{ parseTime(orderMsg.finishProduceTime) }}</div>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span='4'>
|
|
||||||
<div class="blodTip">实际加工数量</div>
|
|
||||||
<div class="lightTip">{{orderMsg.actualQuantity }}</div>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
</div>
|
|
||||||
<div class="box3">
|
|
||||||
<div class="boxTitle">
|
|
||||||
<span class="blueTitle"></span>
|
|
||||||
<span>能耗信息</span>
|
|
||||||
</div>
|
|
||||||
<div class="toggleTabBox">
|
|
||||||
<div :class="{ active: activeModule === 'dataList' }" @click="toggleTab('dataList')">数据列表</div>
|
|
||||||
<div :class="{ active: activeModule === 'barChart' }" @click="toggleTab('barChart')">柱状图</div>
|
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
<div v-show="activeModule === 'dataList'">
|
|
||||||
<!-- 表格 -->
|
|
||||||
<base-table
|
|
||||||
:page="queryParams.pageNo"
|
|
||||||
:limit="queryParams.pageSize"
|
|
||||||
:table-props="tableProps"
|
|
||||||
:table-data="tableData"
|
|
||||||
:max-height="tableH"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
<!-- 图形 -->
|
|
||||||
<div v-show="activeModule === 'barChart'">
|
|
||||||
<bar-chart ref="orderEnergyChart" :chartData="chartData"/>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
<script>
|
|
||||||
const tableProps = [
|
|
||||||
{
|
|
||||||
prop: 'objName',
|
|
||||||
label: '对象名称'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
prop: 'objCode',
|
|
||||||
label: '对象编码'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
prop: 'energyType',
|
|
||||||
label: '能源类型'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
prop: 'startNum',
|
|
||||||
label: '工单开始值'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
prop: 'endNum',
|
|
||||||
label: '工单结束值/当前值'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
prop: 'useNum',
|
|
||||||
label: '使用量'
|
|
||||||
}
|
|
||||||
]
|
|
||||||
import { getEnergyTypeListAll } from '@/api/base/energyType'
|
|
||||||
import { orderList, workOrderList } from '@/api/base/orderManage'
|
|
||||||
import { getWorkOrderMsg, getOrderEnergyData } from '@/api/monitoring/orderEnergy'
|
|
||||||
import BarChart from "./components/barChart"
|
|
||||||
export default {
|
|
||||||
name: 'OrderEnergy',
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
formConfig: [
|
|
||||||
{
|
|
||||||
type: 'select',
|
|
||||||
label: '订单',
|
|
||||||
selectOptions: [],
|
|
||||||
param: 'energyTypeId'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
type: 'select',
|
|
||||||
label: '工单',
|
|
||||||
selectOptions: [],
|
|
||||||
param: 'energyTypeId1'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
type: 'select',
|
|
||||||
label: '能源类型',
|
|
||||||
selectOptions: [],
|
|
||||||
param: 'energyTypeId2',
|
|
||||||
filterable: true,
|
|
||||||
width: 120
|
|
||||||
},
|
|
||||||
{
|
|
||||||
type: 'select',
|
|
||||||
label: '对象维度',
|
|
||||||
selectOptions: this.getDictDatas(this.DICT_TYPE.OBJECT_TYPE),
|
|
||||||
labelField: 'label',
|
|
||||||
valueField: 'value',
|
|
||||||
param: 'energyTypeId3',
|
|
||||||
width: 100
|
|
||||||
},
|
|
||||||
{
|
|
||||||
type: 'button',
|
|
||||||
btnName: '查询',
|
|
||||||
name: 'search',
|
|
||||||
color: 'primary'
|
|
||||||
}
|
|
||||||
],
|
|
||||||
tableProps,
|
|
||||||
tableData: [],
|
|
||||||
tableH: this.tableHeight(400),
|
|
||||||
// 查询参数
|
|
||||||
queryParams: {
|
|
||||||
pageNo: 1,
|
|
||||||
pageSize: 10000
|
|
||||||
},
|
|
||||||
orderMsg: {},
|
|
||||||
chartData: [],
|
|
||||||
activeModule: 'dataList'
|
|
||||||
}
|
|
||||||
},
|
|
||||||
components: { BarChart },
|
|
||||||
mounted() {
|
|
||||||
window.addEventListener('resize', () => {
|
|
||||||
this.tableH = this.tableHeight(400)
|
|
||||||
})
|
|
||||||
this.getListArr()
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
getListArr() {
|
|
||||||
getEnergyTypeListAll().then(res => {
|
|
||||||
this.formConfig[2].selectOptions = res.data || []
|
|
||||||
})
|
|
||||||
orderList().then(res => {
|
|
||||||
console.log(res)
|
|
||||||
})
|
|
||||||
workOrderList().then(res => {
|
|
||||||
console.log(res)
|
|
||||||
})
|
|
||||||
},
|
|
||||||
buttonClick() {
|
|
||||||
getWorkOrderMsg({
|
|
||||||
"workOrderId": 1,
|
|
||||||
"objType": "3",
|
|
||||||
"energyTypeId": '1681183397517406210'
|
|
||||||
}).then(res => {
|
|
||||||
console.log(res)
|
|
||||||
this.orderMsg = res.data || {}
|
|
||||||
getOrderEnergyData({
|
|
||||||
"workOrderId": 1,
|
|
||||||
"objType": "3",
|
|
||||||
"energyTypeId": '1681183397517406210',
|
|
||||||
"startProduceTime": "1694239523000",
|
|
||||||
"finishProduceTime": "1694498723000"
|
|
||||||
}).then(res => {
|
|
||||||
console.log(res)
|
|
||||||
this.tableData = res.data || []
|
|
||||||
this.chartData = res.data || []
|
|
||||||
})
|
|
||||||
})
|
|
||||||
},
|
|
||||||
toggleTab(val) {
|
|
||||||
this.activeModule = val
|
|
||||||
if (this.activeModule === 'barChart') {
|
|
||||||
this.$nextTick((res) => {
|
|
||||||
this.$refs.orderEnergyChart.getChart()
|
|
||||||
})
|
|
||||||
}
|
|
||||||
},
|
|
||||||
headBtnClick() {}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
<style lang='scss' scoped>
|
|
||||||
.orderEnergyContainer {
|
|
||||||
background-color: rgb(242, 244, 249);
|
|
||||||
.box1, .box2, .box3 {
|
|
||||||
background-color: #fff;
|
|
||||||
border-radius: 9px;
|
|
||||||
}
|
|
||||||
.box1 {
|
|
||||||
height: 64px;
|
|
||||||
padding: 12px 16px 0;
|
|
||||||
}
|
|
||||||
.box2 {
|
|
||||||
height: 122px;
|
|
||||||
margin: 8px 0;
|
|
||||||
padding: 16px;
|
|
||||||
.blodTip {
|
|
||||||
font-weight: 600;
|
|
||||||
color: rgba(0,0,0,0.85);
|
|
||||||
margin-bottom: 8px;
|
|
||||||
}
|
|
||||||
.lightTip {
|
|
||||||
font-weight: 400;
|
|
||||||
color: rgba(102,102,102,0.75);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.box3 {
|
|
||||||
padding: 16px;
|
|
||||||
height: calc(100vh - 330px);
|
|
||||||
.toggleTabBox {
|
|
||||||
display: inline-block;
|
|
||||||
div {
|
|
||||||
display: inline-block;
|
|
||||||
padding:0 8px 4px;
|
|
||||||
color: rgba(102, 102, 102, 0.5);
|
|
||||||
border-bottom: 2px solid rgba(242, 244, 249, 1);
|
|
||||||
cursor: pointer;
|
|
||||||
}
|
|
||||||
.active {
|
|
||||||
color: rgba(0,0,0,0.85);
|
|
||||||
border-bottom-color: #0B58FF;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.boxTitle {
|
|
||||||
display: inline-block;
|
|
||||||
font-size: 16px;
|
|
||||||
font-weight: 400;
|
|
||||||
color: #000000;
|
|
||||||
margin:0 10px 20px 0;
|
|
||||||
}
|
|
||||||
.blueTitle {
|
|
||||||
content: '';
|
|
||||||
display: inline-block;
|
|
||||||
width: 4px;
|
|
||||||
height: 18px;
|
|
||||||
background-color: #0B58FF;
|
|
||||||
border-radius: 1px;
|
|
||||||
margin-right: 8px;
|
|
||||||
vertical-align: bottom;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@@ -416,7 +416,7 @@ export default {
|
|||||||
/** 准备设备数据 */
|
/** 准备设备数据 */
|
||||||
async initEquipment() {
|
async initEquipment() {
|
||||||
const { code, data } = await this.$axios({
|
const { code, data } = await this.$axios({
|
||||||
url: '/base/core-equipment/listAll',
|
url: '/base/equipment/listAll',
|
||||||
method: 'get',
|
method: 'get',
|
||||||
});
|
});
|
||||||
if (code == 0) {
|
if (code == 0) {
|
||||||
|
|||||||
@@ -223,7 +223,7 @@ export default {
|
|||||||
/** 准备设备数据 */
|
/** 准备设备数据 */
|
||||||
async initEquipment() {
|
async initEquipment() {
|
||||||
const { code, data } = await this.$axios({
|
const { code, data } = await this.$axios({
|
||||||
url: '/base/core-equipment/listAll',
|
url: '/base/equipment/listAll',
|
||||||
method: 'get',
|
method: 'get',
|
||||||
});
|
});
|
||||||
if (code == 0) {
|
if (code == 0) {
|
||||||
|
|||||||
@@ -1,367 +0,0 @@
|
|||||||
<!--
|
|
||||||
filename: index.vue
|
|
||||||
author: liubin
|
|
||||||
date: 2023-10-19 10:03:42
|
|
||||||
description:
|
|
||||||
-->
|
|
||||||
|
|
||||||
<template>
|
|
||||||
<div class="app-container">
|
|
||||||
<!-- 搜索工作栏 -->
|
|
||||||
<SearchBar :formConfigs="searchBarFormConfig" ref="search-bar" />
|
|
||||||
|
|
||||||
<section class="process-flow">
|
|
||||||
<el-button class="process-item__add-btn" @click="handleAdd">
|
|
||||||
+ 新增工艺
|
|
||||||
</el-button>
|
|
||||||
<ProcessItem
|
|
||||||
v-for="item in list"
|
|
||||||
:key="item.id"
|
|
||||||
:id="item.id"
|
|
||||||
:name="item.name"
|
|
||||||
:line="item.lineName"
|
|
||||||
:desc="item.remark"
|
|
||||||
:isActive="item.enabled"
|
|
||||||
@edit="handleUpdate" />
|
|
||||||
</section>
|
|
||||||
|
|
||||||
<base-dialog
|
|
||||||
:dialogTitle="title"
|
|
||||||
:dialogVisible="open"
|
|
||||||
@close="cancel"
|
|
||||||
@cancel="cancel"
|
|
||||||
width="45%"
|
|
||||||
@confirm="submitForm">
|
|
||||||
<DialogForm
|
|
||||||
v-if="open"
|
|
||||||
key="index-dialog-form"
|
|
||||||
ref="form"
|
|
||||||
v-model="form"
|
|
||||||
:rows="rows" />
|
|
||||||
</base-dialog>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import basicPageMixin from '@/mixins/lb/basicPageMixin';
|
|
||||||
// import cache from '@/utils/cache';
|
|
||||||
|
|
||||||
const ProcessItem = {
|
|
||||||
name: 'ProcessItem',
|
|
||||||
components: {},
|
|
||||||
props: ['id', 'name', 'line', 'desc', 'isActive'],
|
|
||||||
data() {
|
|
||||||
return {};
|
|
||||||
},
|
|
||||||
computed: {},
|
|
||||||
methods: {
|
|
||||||
handleEdit() {
|
|
||||||
this.$emit('edit', this.id);
|
|
||||||
},
|
|
||||||
handleViewDetail(e) {
|
|
||||||
this.$router.push({
|
|
||||||
name: 'ProcessFlowView',
|
|
||||||
params: {
|
|
||||||
id: this.id,
|
|
||||||
},
|
|
||||||
});
|
|
||||||
},
|
|
||||||
},
|
|
||||||
render: function (h) {
|
|
||||||
return (
|
|
||||||
<div
|
|
||||||
class={'process-item' + (this.isActive ? ' active' : '')}
|
|
||||||
style="display: flex; flex-direction: column; position: relative;">
|
|
||||||
<div
|
|
||||||
class="process-item__content"
|
|
||||||
style="flex: 1; display: flex; align-items: center; cursor: pointer;"
|
|
||||||
title="点击查看详细工序列表"
|
|
||||||
onClick={this.handleViewDetail}>
|
|
||||||
{this.isActive ? (
|
|
||||||
<span style="display: inline-block; width: 10px; height: 10px; border-radius: 100%; background: #0ebe3a; position: absolute; top: 20px; right: 20px;" />
|
|
||||||
) : (
|
|
||||||
''
|
|
||||||
)}
|
|
||||||
<svg-icon
|
|
||||||
icon-class="tree-table"
|
|
||||||
style="margin-left: 12px; width: 48px; height: 48px; color: #0858ff33"
|
|
||||||
/>
|
|
||||||
<div
|
|
||||||
class="info"
|
|
||||||
style="margin-left: 12px; display: flex; flex-direction: column;">
|
|
||||||
<h2 style="margin: 20px 0 0; font-weight: 600; font-size: 18px; ">
|
|
||||||
{this.name}
|
|
||||||
</h2>
|
|
||||||
<h3 style="margin: 0; font-weight: 400; font-size: 14px; line-height: 2; color: #888;">
|
|
||||||
{this.line || '/'}
|
|
||||||
</h3>
|
|
||||||
<p style="margin: 0; text-overflow: ellipse; white-space: nowrap; font-weight: 400; font-size: 14px; line-height: 1.25; color: #888;">
|
|
||||||
{this.desc}
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div
|
|
||||||
class="process-item__footer"
|
|
||||||
style="background: #f7f9fa; border-top: 1px solid #0001;">
|
|
||||||
<el-row gutter={20}>
|
|
||||||
<el-col
|
|
||||||
span={8}
|
|
||||||
style="text-align: center; border-right: 1px solid #0001">
|
|
||||||
<el-button
|
|
||||||
type="text"
|
|
||||||
style="color: #0007; line-height: 1.75"
|
|
||||||
onClick={this.handleEdit}>
|
|
||||||
编辑
|
|
||||||
</el-button>
|
|
||||||
</el-col>
|
|
||||||
<el-col
|
|
||||||
span={8}
|
|
||||||
style="text-align: center; border-right: 1px solid #0001">
|
|
||||||
<el-button type="text" style="color: #0007; line-height: 1.75">
|
|
||||||
复制
|
|
||||||
</el-button>
|
|
||||||
</el-col>
|
|
||||||
<el-col span={8} style="text-align: center;">
|
|
||||||
<el-button type="text" style="color: #0007; line-height: 1.75">
|
|
||||||
删除
|
|
||||||
</el-button>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
||||||
export default {
|
|
||||||
name: 'ProcessFlow',
|
|
||||||
components: { ProcessItem },
|
|
||||||
mixins: [basicPageMixin],
|
|
||||||
props: {},
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
updateUrl: '/extend/process-flow/update',
|
|
||||||
addUrl: '/extend/process-flow/create',
|
|
||||||
pageUrl: '/extend/process-flow/page',
|
|
||||||
infoUrl: '/extend/process-flow/get',
|
|
||||||
searchBarKeys: ['name', 'code', 'lineId', 'productId'],
|
|
||||||
searchBarFormConfig: [
|
|
||||||
{
|
|
||||||
label: '工艺流程列表',
|
|
||||||
},
|
|
||||||
],
|
|
||||||
queryParams: {
|
|
||||||
pageNo: 1,
|
|
||||||
pageSize: 10,
|
|
||||||
code: null,
|
|
||||||
name: null,
|
|
||||||
productId: null,
|
|
||||||
lineId: null,
|
|
||||||
},
|
|
||||||
lineList: null,
|
|
||||||
list: [],
|
|
||||||
rows: [
|
|
||||||
[
|
|
||||||
{
|
|
||||||
input: true,
|
|
||||||
label: '工艺名称',
|
|
||||||
prop: 'name',
|
|
||||||
rules: [{ required: true, message: '不能为空', trigger: 'blur' }],
|
|
||||||
// bind: {
|
|
||||||
// disabled: this.editMode == 'detail', // some condition, like detail mode...
|
|
||||||
// }
|
|
||||||
},
|
|
||||||
{
|
|
||||||
input: true,
|
|
||||||
label: '工艺编码',
|
|
||||||
prop: 'code',
|
|
||||||
// url: '/base/core-equipment/getCode',
|
|
||||||
},
|
|
||||||
],
|
|
||||||
[
|
|
||||||
{
|
|
||||||
select: true,
|
|
||||||
label: '产线',
|
|
||||||
prop: 'lineId',
|
|
||||||
// cache: 'processFlow::lineList',
|
|
||||||
url: '/base/core-production-line/listAll',
|
|
||||||
bind: {
|
|
||||||
filterable: true,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
|
|
||||||
{
|
|
||||||
switch: true,
|
|
||||||
label: '是否启用',
|
|
||||||
prop: 'enabled',
|
|
||||||
bind: {
|
|
||||||
'active-value': 1,
|
|
||||||
'inactive-value': 0,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
],
|
|
||||||
[
|
|
||||||
{
|
|
||||||
textarea: true,
|
|
||||||
label: '功能描述',
|
|
||||||
prop: 'remark',
|
|
||||||
},
|
|
||||||
],
|
|
||||||
],
|
|
||||||
form: {
|
|
||||||
id: null,
|
|
||||||
code: null,
|
|
||||||
name: null,
|
|
||||||
productId: null,
|
|
||||||
lineId: null,
|
|
||||||
enabled: 1,
|
|
||||||
remark: null,
|
|
||||||
externalCode: null,
|
|
||||||
},
|
|
||||||
};
|
|
||||||
},
|
|
||||||
computed: {},
|
|
||||||
mounted() {
|
|
||||||
this.getList();
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
cancel() {
|
|
||||||
this.open = false;
|
|
||||||
this.reset();
|
|
||||||
},
|
|
||||||
reset() {
|
|
||||||
this.form = {
|
|
||||||
id: null,
|
|
||||||
code: null,
|
|
||||||
name: null,
|
|
||||||
productId: null,
|
|
||||||
lineId: null,
|
|
||||||
enabled: 1,
|
|
||||||
remark: null,
|
|
||||||
externalCode: null,
|
|
||||||
};
|
|
||||||
this.resetForm('form');
|
|
||||||
},
|
|
||||||
handleAdd() {
|
|
||||||
this.reset();
|
|
||||||
this.open = true;
|
|
||||||
this.showUploadComponents = false;
|
|
||||||
this.title = '添加工艺';
|
|
||||||
},
|
|
||||||
async handleUpdate(id) {
|
|
||||||
this.reset();
|
|
||||||
const { data } = await this.info({ id });
|
|
||||||
this.form = data;
|
|
||||||
this.open = true;
|
|
||||||
this.title = '修改工艺';
|
|
||||||
},
|
|
||||||
submitForm() {
|
|
||||||
this.$refs['form'].validate((valid) => {
|
|
||||||
if (!valid) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
// 修改的提交
|
|
||||||
if (this.form.id != null) {
|
|
||||||
this.put(this.form).then((response) => {
|
|
||||||
this.$modal.msgSuccess('修改成功');
|
|
||||||
this.open = false;
|
|
||||||
this.getList();
|
|
||||||
});
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
// 添加的提交
|
|
||||||
this.post(this.form).then((response) => {
|
|
||||||
this.$modal.msgSuccess('新增成功');
|
|
||||||
this.open = false;
|
|
||||||
this.getList();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
},
|
|
||||||
|
|
||||||
async getList() {
|
|
||||||
this.loading = true;
|
|
||||||
const { code, data } = await this.recv(this.queryParams);
|
|
||||||
if (code == 0) {
|
|
||||||
this.list = data.list;
|
|
||||||
this.total = data.total;
|
|
||||||
this.loading = false;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
this.loading = false;
|
|
||||||
},
|
|
||||||
|
|
||||||
// async getList() {
|
|
||||||
// this.loading = true;
|
|
||||||
// const { code, data } = await this.recv(this.queryParams);
|
|
||||||
// if (code == 0) {
|
|
||||||
// const list = [];
|
|
||||||
// for (const item of data.list) {
|
|
||||||
// const newItem = await this.itemAttachName(item);
|
|
||||||
// list.push(newItem);
|
|
||||||
// }
|
|
||||||
// this.list = list;
|
|
||||||
// this.total = data.total;
|
|
||||||
// this.loading = false;
|
|
||||||
// return;
|
|
||||||
// }
|
|
||||||
// this.loading = false;
|
|
||||||
// },
|
|
||||||
|
|
||||||
// async itemAttachName(item) {
|
|
||||||
// if (!this.lineList) {
|
|
||||||
// this.lineList = await cache.getList(
|
|
||||||
// 'processFlow::lineList',
|
|
||||||
// async () => {
|
|
||||||
// const { code, data } = await this.$axios(
|
|
||||||
// '/base/core-production-line/listAll'
|
|
||||||
// );
|
|
||||||
// if (code == 0) {
|
|
||||||
// return data;
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// );
|
|
||||||
// }
|
|
||||||
// return {
|
|
||||||
// ...item,
|
|
||||||
// lineName: this.lineList.find((line) => line.id == item.lineId)?.name,
|
|
||||||
// };
|
|
||||||
// },
|
|
||||||
},
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style scoped lang="scss">
|
|
||||||
.process-flow {
|
|
||||||
display: grid;
|
|
||||||
grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
|
|
||||||
grid-auto-rows: 200px;
|
|
||||||
gap: 24px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.process-item__add-btn {
|
|
||||||
display: grid;
|
|
||||||
border: 1px solid #ccc;
|
|
||||||
font-size: 20px;
|
|
||||||
color: #ccc;
|
|
||||||
border-style: dashed;
|
|
||||||
border-radius: 6px;
|
|
||||||
place-items: center;
|
|
||||||
cursor: pointer;
|
|
||||||
transition: all 0.2s ease-in;
|
|
||||||
|
|
||||||
&:hover {
|
|
||||||
color: #555;
|
|
||||||
border-color: #555;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.process-item {
|
|
||||||
border-radius: 4px;
|
|
||||||
box-shadow: 0 0 6px 1px #ccc;
|
|
||||||
overflow: hidden;
|
|
||||||
|
|
||||||
// &.active {
|
|
||||||
// box-shadow: 0 0 6px 1px #18c8bf66;
|
|
||||||
// }
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@@ -1,138 +0,0 @@
|
|||||||
<!--
|
|
||||||
filename: ProcessBomList.vue
|
|
||||||
author: liubin
|
|
||||||
date: 2023-10-20 15:00:58
|
|
||||||
description:
|
|
||||||
-->
|
|
||||||
|
|
||||||
<template>
|
|
||||||
<section class="process-bom">
|
|
||||||
<SearchBar :formConfigs="searchBarFormConfig" ref="search-bar" />
|
|
||||||
|
|
||||||
<div class="btns" style="
|
|
||||||
text-align: right;
|
|
||||||
position: absolute;
|
|
||||||
top: 20px;
|
|
||||||
right: 20px;
|
|
||||||
display: flex;
|
|
||||||
">
|
|
||||||
<el-button type="primary" plain :disabled="currentDet == null" class="btn-create" icon="el-icon-plus">
|
|
||||||
分配设备
|
|
||||||
</el-button>
|
|
||||||
<el-input icon="el-icon-search" placeholder="搜索" v-model="searchText" style="margin-left: 20px">
|
|
||||||
<i slot="prefix" class="el-input__icon el-icon-search"></i>
|
|
||||||
</el-input>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- 列表 -->
|
|
||||||
<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" />
|
|
||||||
</section>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
export default {
|
|
||||||
name: 'ProcessBom',
|
|
||||||
components: {},
|
|
||||||
props: {
|
|
||||||
currentDet: {
|
|
||||||
type: Object,
|
|
||||||
default: null
|
|
||||||
}
|
|
||||||
},
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
searchBarFormConfig: [{ label: '工序下设备' }],
|
|
||||||
tableProps: [
|
|
||||||
// {
|
|
||||||
// prop: 'createTime',
|
|
||||||
// label: '添加时间',
|
|
||||||
// fixed: true,
|
|
||||||
// width: 180,
|
|
||||||
// filter: (val) => moment(val).format('yyyy-MM-DD HH:mm:ss'),
|
|
||||||
// },
|
|
||||||
{ prop: 'name', label: '设备名称' },
|
|
||||||
{ prop: 'code', label: '物料BOM' },
|
|
||||||
{ prop: 'remark', label: '参数BOM' },
|
|
||||||
],
|
|
||||||
list: [],
|
|
||||||
total: 0,
|
|
||||||
tableBtn: [],
|
|
||||||
queryParams: {
|
|
||||||
pageNo: 1,
|
|
||||||
pageSize: 10,
|
|
||||||
},
|
|
||||||
searchText: ''
|
|
||||||
};
|
|
||||||
},
|
|
||||||
watch: {
|
|
||||||
currentDet: {
|
|
||||||
handler(val) {
|
|
||||||
if (val != null) {
|
|
||||||
this.getList(val);
|
|
||||||
} else {
|
|
||||||
this.clearList();
|
|
||||||
}
|
|
||||||
},
|
|
||||||
immediate: true,
|
|
||||||
deep: true
|
|
||||||
}
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
handleEmitFun() { },
|
|
||||||
handleTableBtnClick() { },
|
|
||||||
put(payload) {
|
|
||||||
return this.http(this.updateUrl, 'put', payload);
|
|
||||||
},
|
|
||||||
post(payload) {
|
|
||||||
return this.http(this.addUrl, 'post', payload);
|
|
||||||
},
|
|
||||||
recv(payload) {
|
|
||||||
return this.http(this.pageUrl, 'get', payload);
|
|
||||||
},
|
|
||||||
info(payload) {
|
|
||||||
return this.http(this.infoUrl, 'get', payload);
|
|
||||||
},
|
|
||||||
http(url, method, payload) {
|
|
||||||
return this.$axios({
|
|
||||||
url,
|
|
||||||
method,
|
|
||||||
params: method === 'get' ? payload : null,
|
|
||||||
data: method !== 'get' ? payload : null,
|
|
||||||
})
|
|
||||||
},
|
|
||||||
|
|
||||||
getList({ detId, detName, detDesc, flowId, sectionName } = {}) {
|
|
||||||
console.log('get list')
|
|
||||||
|
|
||||||
},
|
|
||||||
getList() {
|
|
||||||
this.list = [
|
|
||||||
{ name: '1', code: 'bomg-1', remark: 'Tochter' },
|
|
||||||
{ name: '2', code: 'bomg-2', remark: 'Bruder' },
|
|
||||||
{ name: '3', code: 'bomg-3', remark: 'Kalt' },
|
|
||||||
]
|
|
||||||
},
|
|
||||||
clearList() {
|
|
||||||
this.list = [];
|
|
||||||
}
|
|
||||||
},
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style scoped lang="scss">
|
|
||||||
.process-bom {
|
|
||||||
position: relative;
|
|
||||||
flex: 1;
|
|
||||||
padding: 12px 20px;
|
|
||||||
background: #fff;
|
|
||||||
border-radius: 8px;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@@ -1,474 +0,0 @@
|
|||||||
<!--
|
|
||||||
filename: ProcessGraph.vue
|
|
||||||
author: liubin
|
|
||||||
date: 2023-10-20 15:00:58
|
|
||||||
description:
|
|
||||||
-->
|
|
||||||
|
|
||||||
<template>
|
|
||||||
<section class="process-graph">
|
|
||||||
<SearchBar :formConfigs="searchBarFormConfig" ref="search-bar" />
|
|
||||||
|
|
||||||
<div class="btns" style="text-align: right; position: absolute; top: 20px; right: 20px">
|
|
||||||
<el-button type="warning" @click="undo" plain v-if="allowUndo" :disabled="!allowUndo" icon="el-icon-back">
|
|
||||||
撤销
|
|
||||||
</el-button>
|
|
||||||
<el-button type="warning" @click="redo" plain v-if="allowRedo" :disabled="!allowRedo">
|
|
||||||
下一步
|
|
||||||
<i class="el-icon-right el-icon--right"></i>
|
|
||||||
</el-button>
|
|
||||||
<el-button class="btn-refresh" @click="handleUpdateLayout" icon="el-icon-refresh">
|
|
||||||
刷新布局</el-button>
|
|
||||||
<el-button type="primary" plain class="btn-create" icon="el-icon-plus" @click="handleAdd">
|
|
||||||
新建工序
|
|
||||||
</el-button>
|
|
||||||
<el-button class="btn-edit" :disabled="currentDet == null" @click="handleEdit">编辑</el-button>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="process-graph__panel" ref="panel"></div>
|
|
||||||
|
|
||||||
<base-dialog :dialogTitle="title" :dialogVisible="open" width="35%" @close="cancel" @cancel="cancel"
|
|
||||||
@confirm="submitForm">
|
|
||||||
<DialogForm v-if="open" ref="form" v-model="form" :rows="rows" />
|
|
||||||
</base-dialog>
|
|
||||||
</section>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import { Graph } from '@antv/x6';
|
|
||||||
import ProcessNode, { createProcessNode, CACHE_NAME, getSectionFrom } from './ProcessNode';
|
|
||||||
import DialogForm from '@/components/DialogForm';
|
|
||||||
// import { IdToName } from '@/utils'
|
|
||||||
|
|
||||||
Graph.registerNode('process-node', ProcessNode);
|
|
||||||
|
|
||||||
export default {
|
|
||||||
name: 'ProcessGraph',
|
|
||||||
components: { DialogForm },
|
|
||||||
props: {},
|
|
||||||
inject: ['getFlowId'],
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
allowRedo: false,
|
|
||||||
allowUndo: false,
|
|
||||||
graph: null,
|
|
||||||
searchBarFormConfig: [{ label: '工序列表' }],
|
|
||||||
title: '',
|
|
||||||
open: false,
|
|
||||||
form: {
|
|
||||||
name: '', // 工序名称
|
|
||||||
sectionId: '', // 工段id
|
|
||||||
remark: '', // 描述
|
|
||||||
},
|
|
||||||
rows: [
|
|
||||||
[
|
|
||||||
{
|
|
||||||
input: true,
|
|
||||||
label: '工序名称',
|
|
||||||
prop: 'name',
|
|
||||||
rules: [{ required: true, message: '不能为空', trigger: 'blur' }],
|
|
||||||
},
|
|
||||||
],
|
|
||||||
[
|
|
||||||
{
|
|
||||||
select: true,
|
|
||||||
label: '工段',
|
|
||||||
prop: 'sectionId',
|
|
||||||
url: '/base/core-workshop-section/listAll',
|
|
||||||
rules: [{ required: true, message: '不能为空', trigger: 'blur' }],
|
|
||||||
bind: {
|
|
||||||
filterable: true,
|
|
||||||
},
|
|
||||||
cache: CACHE_NAME
|
|
||||||
},
|
|
||||||
],
|
|
||||||
[
|
|
||||||
{
|
|
||||||
textarea: true,
|
|
||||||
label: '工序说明',
|
|
||||||
prop: 'remark',
|
|
||||||
},
|
|
||||||
],
|
|
||||||
],
|
|
||||||
updateUrl: '/extend/process-flow-det/update',
|
|
||||||
deleteUrl: '/extend/process-flow-det/delete',
|
|
||||||
addUrl: '/extend/process-flow-det/create',
|
|
||||||
// pageUrl: '/extend/process-flow-det/get',
|
|
||||||
infoUrl: '/extend/process-flow-view/getByFlowId',
|
|
||||||
layout: {
|
|
||||||
id: null,
|
|
||||||
flowId: null,
|
|
||||||
content: '',
|
|
||||||
createTime: null
|
|
||||||
},
|
|
||||||
currentDet: null,
|
|
||||||
currentNode: null
|
|
||||||
|
|
||||||
};
|
|
||||||
},
|
|
||||||
watch: {
|
|
||||||
'form.sectionId': {
|
|
||||||
handler(id) {
|
|
||||||
},
|
|
||||||
immediate: false,
|
|
||||||
},
|
|
||||||
currentDet: {
|
|
||||||
handler(val) {
|
|
||||||
this.$emit('det-selected', val)
|
|
||||||
},
|
|
||||||
deep: true,
|
|
||||||
immediate: true
|
|
||||||
}
|
|
||||||
},
|
|
||||||
activated() {
|
|
||||||
this.loadLayout().then(json => {
|
|
||||||
this.initGraph(json)
|
|
||||||
})
|
|
||||||
},
|
|
||||||
deactivated() {
|
|
||||||
this.graph.dispose();
|
|
||||||
this.$nextTick(() => {
|
|
||||||
this.resetLayout();
|
|
||||||
this.graph = null;
|
|
||||||
})
|
|
||||||
},
|
|
||||||
computed: {},
|
|
||||||
methods: {
|
|
||||||
|
|
||||||
initGraph(json) {
|
|
||||||
const graph = new Graph({
|
|
||||||
container: this.$refs.panel,
|
|
||||||
grid: {
|
|
||||||
size: 10,
|
|
||||||
visible: true,
|
|
||||||
},
|
|
||||||
history: true,
|
|
||||||
selecting: {
|
|
||||||
className: 'my-select'
|
|
||||||
},
|
|
||||||
connecting: {
|
|
||||||
snap: true,
|
|
||||||
allowBlank: false,
|
|
||||||
allowLoop: false,
|
|
||||||
allowNode: false,
|
|
||||||
allowPort: true,
|
|
||||||
allowEdge: false,
|
|
||||||
},
|
|
||||||
panning: true,
|
|
||||||
// scroller: {
|
|
||||||
// enabled: true,
|
|
||||||
// pannable: true,
|
|
||||||
// cursor: '',
|
|
||||||
// width: 800,
|
|
||||||
// height: 200
|
|
||||||
// },
|
|
||||||
mousewheel: {
|
|
||||||
enabled: true,
|
|
||||||
modifiers: ['ctrl', 'meta']
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
graph.fromJSON(json)
|
|
||||||
this.graph = graph;
|
|
||||||
this.$nextTick(() => {
|
|
||||||
this.registerGraphEvents();
|
|
||||||
})
|
|
||||||
},
|
|
||||||
|
|
||||||
registerGraphEvents() {
|
|
||||||
const reset = () => {
|
|
||||||
const nodes = this.graph.getNodes();
|
|
||||||
const edges = this.graph.getEdges();
|
|
||||||
this.currentDet = null;
|
|
||||||
this.currentNode = null;
|
|
||||||
|
|
||||||
nodes.forEach(node => {
|
|
||||||
node.attr('container/stroke', '#ccc');
|
|
||||||
});
|
|
||||||
edges.forEach(edge => {
|
|
||||||
edge.attr('line/stroke', '#ccc')
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
this.graph.on('node:click', ({ e, x, y, node, view }) => {
|
|
||||||
reset();
|
|
||||||
node.attr('container/stroke', '#0b58ff');
|
|
||||||
const { detId, detName, detDesc, processId, sectionId, sectionName } = node.attrs;
|
|
||||||
this.currentDet = {}
|
|
||||||
this.$set(this.currentDet, 'detId', detId.text)
|
|
||||||
this.$set(this.currentDet, 'sectionId', sectionId.text)
|
|
||||||
this.$set(this.currentDet, 'detName', detName.text)
|
|
||||||
this.$set(this.currentDet, 'detDesc', detDesc.text)
|
|
||||||
this.$set(this.currentDet, 'flowId', processId.text)
|
|
||||||
this.$set(this.currentDet, 'sectionName', sectionName.text)
|
|
||||||
this.currentNode = node
|
|
||||||
});
|
|
||||||
this.graph.on('edge:click', ({ e, x, y, edge, view }) => {
|
|
||||||
// console.log('edge clicked!', edge)
|
|
||||||
reset();
|
|
||||||
edge.attr('line/stroke', '#0b58ff')
|
|
||||||
});
|
|
||||||
this.graph.on('blank:click', ({ e, x, y }) => {
|
|
||||||
reset();
|
|
||||||
});
|
|
||||||
this.graph.on('node:mouseenter', ({ node }) => {
|
|
||||||
node.addTools({
|
|
||||||
name: 'button-remove',
|
|
||||||
args: {
|
|
||||||
x: '100%',
|
|
||||||
y: 0,
|
|
||||||
offset: { x: 0, y: 0 },
|
|
||||||
onClick: ({ e, cell, view }) => {
|
|
||||||
this.$confirm(
|
|
||||||
'确定删除这个工序吗?',
|
|
||||||
'提示',
|
|
||||||
{
|
|
||||||
confirmButtonText: '确定',
|
|
||||||
cancelButtonText: '取消',
|
|
||||||
type: 'warning'
|
|
||||||
}
|
|
||||||
).then(() => {
|
|
||||||
view.cell.remove()
|
|
||||||
}).catch(err => {
|
|
||||||
return;
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
});
|
|
||||||
this.graph.on('node:mouseleave', ({ node }) => {
|
|
||||||
node.removeTools();
|
|
||||||
})
|
|
||||||
},
|
|
||||||
|
|
||||||
resetLayout() {
|
|
||||||
this.layout = {
|
|
||||||
id: null,
|
|
||||||
flowId: null,
|
|
||||||
content: '',
|
|
||||||
createTime: null
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
async loadLayout() {
|
|
||||||
const flowId = this.$route.params.id;
|
|
||||||
if (!flowId) return { cells: [] }
|
|
||||||
const { code, data } = await this.info({ id: flowId });
|
|
||||||
if (code == 0) {
|
|
||||||
if (data) {
|
|
||||||
this.layout = data;
|
|
||||||
return JSON.parse(data?.content) || { cells: [] };
|
|
||||||
}
|
|
||||||
return { cells: [] };
|
|
||||||
}
|
|
||||||
this.resetLayout();
|
|
||||||
return Promise.reject(this.infoUrl + ' 接口出错!');
|
|
||||||
},
|
|
||||||
|
|
||||||
handleToJson() { },
|
|
||||||
|
|
||||||
handleLoadJson() { },
|
|
||||||
|
|
||||||
handleDumpJson() {
|
|
||||||
if (this.graph) {
|
|
||||||
console.log(JSON.stringify(this.graph.toJSON(), null, 2));
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
async handleUpdateLayout() {
|
|
||||||
this.layout.content = JSON.stringify(this.graph.toJSON());
|
|
||||||
let code, data;
|
|
||||||
console.table([this.layout, this.$route.params.id])
|
|
||||||
// 手动刷新布局
|
|
||||||
if (this.layout.id) {
|
|
||||||
({ code, data } = await this.http('/extend/process-flow-view/update', 'put', this.layout));
|
|
||||||
} else {
|
|
||||||
this.layout.flowId = this.$route.params.id;
|
|
||||||
({ code, data } = await this.http('/extend/process-flow-view/create', 'post', this.layout));
|
|
||||||
}
|
|
||||||
|
|
||||||
if (code == 0) {
|
|
||||||
this.$modal.msgSuccess('布局已刷新!')
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
reset() {
|
|
||||||
this.form = {
|
|
||||||
name: '', // 工序名称
|
|
||||||
sectionId: '', // 工段id
|
|
||||||
remark: '', // 描述
|
|
||||||
};
|
|
||||||
this.resetForm('form');
|
|
||||||
},
|
|
||||||
|
|
||||||
/** 取消按钮 */
|
|
||||||
cancel() {
|
|
||||||
this.open = false;
|
|
||||||
this.reset();
|
|
||||||
},
|
|
||||||
|
|
||||||
handleAdd() {
|
|
||||||
this.reset();
|
|
||||||
this.open = true;
|
|
||||||
this.title = '添加工序';
|
|
||||||
},
|
|
||||||
|
|
||||||
handleEdit() {
|
|
||||||
this.form.name = this.currentDet.detName;
|
|
||||||
this.form.sectionId = this.currentDet.sectionId;
|
|
||||||
this.form.remark = this.currentDet.detDesc;
|
|
||||||
this.form.id = this.currentDet.detId;
|
|
||||||
this.title = '编辑工序';
|
|
||||||
this.$nextTick(() => {
|
|
||||||
this.open = true;
|
|
||||||
})
|
|
||||||
},
|
|
||||||
|
|
||||||
async handleDelete(id) {
|
|
||||||
const { code, data } = await this.delete({ id });
|
|
||||||
if (code == 0) {
|
|
||||||
this.$msgSuccess('成功删除一个工序!');
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
},
|
|
||||||
|
|
||||||
/** 提交按钮 */
|
|
||||||
submitForm() {
|
|
||||||
this.$refs['form'].validate((valid) => {
|
|
||||||
if (!valid) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
// 修改的提交
|
|
||||||
if (this.form.id != null) {
|
|
||||||
this.updateProcess()
|
|
||||||
.then((form) => {
|
|
||||||
const { name, sectionId, remark } = form;
|
|
||||||
getSectionFrom(sectionId).then(sectionName => {
|
|
||||||
// 修改当前node的信息
|
|
||||||
this.currentNode.setAttrs({
|
|
||||||
detName: { text: name },
|
|
||||||
sectionId: { text: sectionId },
|
|
||||||
sectionName: { text: sectionName },
|
|
||||||
detDesc: { text: remark }
|
|
||||||
})
|
|
||||||
})
|
|
||||||
})
|
|
||||||
.catch(err => { });
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
this.createProcess()
|
|
||||||
.then(({ id, name, sectionId, remark, flowId }) => {
|
|
||||||
if (!id) return null;
|
|
||||||
return createProcessNode({
|
|
||||||
flowId: flowId,
|
|
||||||
name, sectionId, remark,
|
|
||||||
id,
|
|
||||||
})
|
|
||||||
}).then(node => {
|
|
||||||
if (!node) {
|
|
||||||
this.$modal.msgError('创建节点失败');
|
|
||||||
return;
|
|
||||||
};
|
|
||||||
this.graph.addNode(node);
|
|
||||||
}).catch(err => {
|
|
||||||
return;
|
|
||||||
});
|
|
||||||
|
|
||||||
});
|
|
||||||
},
|
|
||||||
|
|
||||||
updateProcess() {
|
|
||||||
const flowId = this.getFlowId();
|
|
||||||
if (!flowId) {
|
|
||||||
this.$modal.msgError('工艺ID不能为空');
|
|
||||||
return Promise.reject('工艺ID不能为空');
|
|
||||||
}
|
|
||||||
return this.put({ flowId, ...this.form })
|
|
||||||
.then(({ code, data }) => {
|
|
||||||
if (code == 0) {
|
|
||||||
this.$modal.msgSuccess('修改成功');
|
|
||||||
} else {
|
|
||||||
this.$modal.msgError('修改失败');
|
|
||||||
}
|
|
||||||
const formCopy = { ...this.form }
|
|
||||||
this.open = false;
|
|
||||||
return formCopy;
|
|
||||||
});
|
|
||||||
},
|
|
||||||
|
|
||||||
createProcess() {
|
|
||||||
// const flowId = this.$route.params.id;
|
|
||||||
const flowId = this.getFlowId(); // it also works
|
|
||||||
if (!flowId) {
|
|
||||||
this.$modal.msgError('工艺ID不能为空');
|
|
||||||
return Promise.reject('工艺ID不能为空');
|
|
||||||
}
|
|
||||||
console.log('create process', this.form)
|
|
||||||
// 添加的提交
|
|
||||||
return this.post({ flowId, ...this.form }).then(
|
|
||||||
({ code, data }) => {
|
|
||||||
this.$modal.msgSuccess('新增成功');
|
|
||||||
this.open = false;
|
|
||||||
// this.getList();
|
|
||||||
return {
|
|
||||||
id: data, // 服务器返回的新建的工段id
|
|
||||||
...this.form, // 保存一份 this.form 副本,当 open->false 时 this.form 里的信息就清空了
|
|
||||||
flowId
|
|
||||||
};
|
|
||||||
}
|
|
||||||
).catch(err => {
|
|
||||||
this.$msgError(err)
|
|
||||||
});
|
|
||||||
},
|
|
||||||
|
|
||||||
put(payload) {
|
|
||||||
return this.http(this.updateUrl, 'put', payload);
|
|
||||||
},
|
|
||||||
post(payload) {
|
|
||||||
return this.http(this.addUrl, 'post', payload);
|
|
||||||
},
|
|
||||||
recv(payload) {
|
|
||||||
return this.http(this.pageUrl, 'get', payload);
|
|
||||||
},
|
|
||||||
info(payload) {
|
|
||||||
return this.http(this.infoUrl, 'get', payload);
|
|
||||||
},
|
|
||||||
delete(payload) {
|
|
||||||
return this.http(this.deleteUrl, 'delete', payload);
|
|
||||||
},
|
|
||||||
http(url, method, payload) {
|
|
||||||
return this.$axios({
|
|
||||||
url,
|
|
||||||
method,
|
|
||||||
params: method === 'get' ? payload : null,
|
|
||||||
data: method !== 'get' ? payload : null,
|
|
||||||
})
|
|
||||||
},
|
|
||||||
},
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style scoped lang="scss">
|
|
||||||
.process-graph {
|
|
||||||
padding: 12px 20px 20px;
|
|
||||||
background: #fff;
|
|
||||||
border-radius: 8px;
|
|
||||||
position: relative;
|
|
||||||
}
|
|
||||||
|
|
||||||
.process-graph__panel {
|
|
||||||
height: 300px;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
|
|
||||||
<style>
|
|
||||||
.x6-widget-selection-selected {
|
|
||||||
border: 1px solid red;
|
|
||||||
}
|
|
||||||
|
|
||||||
.my-select {
|
|
||||||
border: 1px solid red;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@@ -1,133 +0,0 @@
|
|||||||
<!--
|
|
||||||
filename: ProcessInfo.vue
|
|
||||||
author: liubin
|
|
||||||
date: 2023-10-20 15:00:58
|
|
||||||
description:
|
|
||||||
-->
|
|
||||||
|
|
||||||
<template>
|
|
||||||
<section class="process-info">
|
|
||||||
<SearchBar :formConfigs="searchBarFormConfig" ref="search-bar" />
|
|
||||||
|
|
||||||
<el-row :gutter="20">
|
|
||||||
<el-col :span="6">
|
|
||||||
<InfoItem label="工艺名称" :value="form.name" />
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="6">
|
|
||||||
<InfoItem label="产线" :value="form.lineName" />
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="12">
|
|
||||||
<InfoItem label="工艺描述" :value="form.remark" />
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
|
|
||||||
<el-row :gutter="20" style="margin-top: 12px;">
|
|
||||||
<el-col :span="6">
|
|
||||||
<!-- <InfoItem label="创建人" value="xxse" /> -->
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="6">
|
|
||||||
<InfoItem label="创建时间" :value="form.createTime" />
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="6">
|
|
||||||
<!-- <InfoItem label="更新人" value="xxse" /> -->
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="6">
|
|
||||||
<!-- <InfoItem label="更新时间" value="2023-10-22 10:11:00" /> -->
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
</section>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
|
|
||||||
const InfoItem = {
|
|
||||||
name: 'InfoItem',
|
|
||||||
components: {},
|
|
||||||
props: ['label', 'value'],
|
|
||||||
data() {
|
|
||||||
return {};
|
|
||||||
},
|
|
||||||
computed: {},
|
|
||||||
methods: {},
|
|
||||||
render: function (h) {
|
|
||||||
return (
|
|
||||||
<div style="display: flex; align-items: center; font-size: 14px; line-height: 1.5">
|
|
||||||
<span style="width: 100px; text-align: left; font-weight: 700">{this.label}:</span>
|
|
||||||
<span style="width: 200px; text-align: left; text-overflow: ellipse; white-space: nowrap">
|
|
||||||
{this.value}
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
||||||
export default {
|
|
||||||
name: 'ProcessInfo',
|
|
||||||
components: { InfoItem },
|
|
||||||
props: {},
|
|
||||||
inject: ['getFlowId'],
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
infoUrl: '/extend/process-flow/get',
|
|
||||||
searchBarFormConfig: [{ label: '工艺详情' }],
|
|
||||||
form: {
|
|
||||||
id: null,
|
|
||||||
name: null,
|
|
||||||
lineName: null,
|
|
||||||
createTime: null,
|
|
||||||
remark: null,
|
|
||||||
enable: null,
|
|
||||||
code: null
|
|
||||||
},
|
|
||||||
};
|
|
||||||
},
|
|
||||||
activated() {
|
|
||||||
this.getInfo()
|
|
||||||
},
|
|
||||||
computed: {},
|
|
||||||
methods: {
|
|
||||||
// utils
|
|
||||||
http(url, method, payload) {
|
|
||||||
return this.$axios({
|
|
||||||
url,
|
|
||||||
method,
|
|
||||||
params: method === 'get' ? payload : null,
|
|
||||||
data: method !== 'get' ? payload : null,
|
|
||||||
})
|
|
||||||
},
|
|
||||||
put(payload) {
|
|
||||||
return this.http(this.updateUrl, 'put', payload);
|
|
||||||
},
|
|
||||||
post(payload) {
|
|
||||||
return this.http(this.addUrl, 'post', payload);
|
|
||||||
},
|
|
||||||
recv(payload) {
|
|
||||||
return this.http(this.pageUrl, 'get', payload);
|
|
||||||
},
|
|
||||||
info(payload) {
|
|
||||||
return this.http(this.infoUrl, 'get', payload);
|
|
||||||
},
|
|
||||||
async getInfo() {
|
|
||||||
const flowId = this.$route.params.id;
|
|
||||||
if (!flowId) this.$router.go(-1);
|
|
||||||
const { code, data } = await this.info({ id: flowId });
|
|
||||||
// debugger;
|
|
||||||
if (code == 0) {
|
|
||||||
this.form = {
|
|
||||||
...data
|
|
||||||
};
|
|
||||||
} else {
|
|
||||||
this.$modal.msgError('工艺信息获取失败')
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style scoped lang="scss">
|
|
||||||
.process-info {
|
|
||||||
padding: 12px 20px 20px;
|
|
||||||
background: #fff;
|
|
||||||
border-radius: 8px;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@@ -1,170 +0,0 @@
|
|||||||
import { Node, ObjectExt, Shape } from '@antv/x6';
|
|
||||||
import { IdToName } from '@/utils'
|
|
||||||
import cache from '@/utils/cache'
|
|
||||||
import axios from '@/utils/request'
|
|
||||||
import { v4 } from 'uuid'
|
|
||||||
|
|
||||||
Shape.Edge.config({
|
|
||||||
attrs: {
|
|
||||||
line: {
|
|
||||||
stroke: '#ccc',
|
|
||||||
strokeWidth: 1,
|
|
||||||
targetMarker: {
|
|
||||||
name: 'block',
|
|
||||||
width: 1,
|
|
||||||
height: 1
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
|
|
||||||
export default class ProcessNode extends Node { }
|
|
||||||
ProcessNode.config({
|
|
||||||
width: 200,
|
|
||||||
height: 100,
|
|
||||||
markup: [
|
|
||||||
{
|
|
||||||
tagName: 'rect',
|
|
||||||
selector: 'container',
|
|
||||||
attrs: {
|
|
||||||
x: 0,
|
|
||||||
y: 0,
|
|
||||||
width: 200,
|
|
||||||
height: 100,
|
|
||||||
fill: 'transparent',
|
|
||||||
stroke: '#ccc'
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
tagName: 'rect',
|
|
||||||
attrs: {
|
|
||||||
x: 0,
|
|
||||||
y: 0,
|
|
||||||
width: 200,
|
|
||||||
height: 50,
|
|
||||||
fill: '#ffffff',
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
tagName: 'rect',
|
|
||||||
attrs: {
|
|
||||||
x: 0,
|
|
||||||
y: 50,
|
|
||||||
width: 200,
|
|
||||||
height: 50,
|
|
||||||
fill: '#f8f8f8',
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
tagName: 'text',
|
|
||||||
selector: 'detName',
|
|
||||||
attrs: {
|
|
||||||
x: 20,
|
|
||||||
y: 30,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
tagName: 'text',
|
|
||||||
selector: 'sectionName',
|
|
||||||
attrs: {
|
|
||||||
x: 115,
|
|
||||||
y: 30,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
tagName: 'text',
|
|
||||||
selector: 'detDesc',
|
|
||||||
attrs: {
|
|
||||||
x: 26,
|
|
||||||
y: 80,
|
|
||||||
fill: '#777',
|
|
||||||
fontSize: 14,
|
|
||||||
fill: '#1a90fc',
|
|
||||||
},
|
|
||||||
},
|
|
||||||
],
|
|
||||||
attrs: {
|
|
||||||
line: {
|
|
||||||
fill: 'red'
|
|
||||||
}
|
|
||||||
},
|
|
||||||
ports: {
|
|
||||||
groups: {
|
|
||||||
in: {
|
|
||||||
position: 'left',
|
|
||||||
attrs: {
|
|
||||||
circle: {
|
|
||||||
r: 2,
|
|
||||||
magnet: true,
|
|
||||||
stroke: '#0b58ff',
|
|
||||||
strokeWidth: 1,
|
|
||||||
fill: '#0b58ff'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
out: {
|
|
||||||
position: 'right',
|
|
||||||
attrs: {
|
|
||||||
circle: {
|
|
||||||
r: 2,
|
|
||||||
magnet: true,
|
|
||||||
stroke: '#0b58ff',
|
|
||||||
strokeWidth: 1,
|
|
||||||
fill: '#0b58ff'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
propHooks(metadata) {
|
|
||||||
const { detId, detName, detDesc, sectionName, processId, sectionId, ...others } = metadata;
|
|
||||||
// debugger;
|
|
||||||
if (detName) ObjectExt.setByPath(others, 'attrs/detName/text', detName);
|
|
||||||
if (detDesc) ObjectExt.setByPath(others, 'attrs/detDesc/text', detDesc);
|
|
||||||
if (sectionName) ObjectExt.setByPath(others, 'attrs/sectionName/text', sectionName);
|
|
||||||
if (detId) ObjectExt.setByPath(others, 'attrs/detId/text', detId);
|
|
||||||
if (processId) ObjectExt.setByPath(others, 'attrs/processId/text', processId);
|
|
||||||
if (sectionId) ObjectExt.setByPath(others, 'attrs/sectionId/text', sectionId);
|
|
||||||
return others;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
export const CACHE_NAME = 'ProcessDetail::section';
|
|
||||||
|
|
||||||
export async function getSectionFrom(sectionId) {
|
|
||||||
const sectionList = await cache.getList(
|
|
||||||
CACHE_NAME,
|
|
||||||
async () => {
|
|
||||||
const { code, data } = await axios(
|
|
||||||
'/base/core-production-line/listAll'
|
|
||||||
);
|
|
||||||
if (code == 0) {
|
|
||||||
return data;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
);
|
|
||||||
return IdToName(sectionId, sectionList);
|
|
||||||
}
|
|
||||||
|
|
||||||
export async function createProcessNode({ flowId, id, name, sectionId, remark }) {
|
|
||||||
const sectionName = await getSectionFrom(sectionId);
|
|
||||||
return {
|
|
||||||
shape: 'process-node',
|
|
||||||
x: 0,
|
|
||||||
y: 0,
|
|
||||||
detName: name, // 工序名称
|
|
||||||
sectionName, // 工段
|
|
||||||
sectionId,
|
|
||||||
detDesc: remark, // 工序说明
|
|
||||||
processId: flowId, // 工艺ID
|
|
||||||
detId: id, // 工序ID
|
|
||||||
tools: [],
|
|
||||||
ports: [
|
|
||||||
{ id: v4(), group: 'in' },
|
|
||||||
{ id: v4(), group: 'out' },
|
|
||||||
]
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
export async function createEdge(src, dest) { }
|
|
||||||
@@ -1,63 +0,0 @@
|
|||||||
<!--
|
|
||||||
filename: index.vue
|
|
||||||
author: liubin
|
|
||||||
date: 2023-10-18 12:25:46
|
|
||||||
description:
|
|
||||||
-->
|
|
||||||
|
|
||||||
<template>
|
|
||||||
<div class="app-container process-flow-view">
|
|
||||||
<ProcessInfo />
|
|
||||||
<ProcessDetail style="margin-top: 16px" @det-selected="handleDetSelected" />
|
|
||||||
<ProcessBomList style="margin-top: 16px" :current-det="currentDet" />
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import ProcessInfo from './components/ProcessInfo.vue';
|
|
||||||
import ProcessBomList from './components/ProcessBomList.vue';
|
|
||||||
import ProcessDetail from './components/ProcessDetail.vue';
|
|
||||||
|
|
||||||
export default {
|
|
||||||
name: 'ProcessFlowView',
|
|
||||||
components: { ProcessInfo, ProcessDetail, ProcessBomList },
|
|
||||||
props: {},
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
flowId: null,
|
|
||||||
currentDet: null
|
|
||||||
};
|
|
||||||
},
|
|
||||||
provide() {
|
|
||||||
const that = this;
|
|
||||||
return {
|
|
||||||
getFlowId() {
|
|
||||||
return that.flowId;
|
|
||||||
},
|
|
||||||
};
|
|
||||||
},
|
|
||||||
activated() {
|
|
||||||
console.log('activated...', this.$route.params);
|
|
||||||
this.flowId = this.$route.params.id;
|
|
||||||
},
|
|
||||||
computed: {},
|
|
||||||
methods: {
|
|
||||||
handleDetSelected(det) {
|
|
||||||
if (det != null) {
|
|
||||||
this.currentDet = { ...det }
|
|
||||||
}
|
|
||||||
else this.currentDet = null;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style scoped lang="scss">
|
|
||||||
.process-flow-view {
|
|
||||||
padding: 8px;
|
|
||||||
flex: 1;
|
|
||||||
background: #f2f4f9;
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@@ -108,8 +108,7 @@ export default {
|
|||||||
],
|
],
|
||||||
tableProps,
|
tableProps,
|
||||||
tableBtn: [
|
tableBtn: [
|
||||||
this.$auth.hasPermi('base:group-classes:cancel')
|
{
|
||||||
? {
|
|
||||||
type: 'cancel',
|
type: 'cancel',
|
||||||
btnName: '作废',
|
btnName: '作废',
|
||||||
showParam: {
|
showParam: {
|
||||||
@@ -122,8 +121,7 @@ export default {
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
: undefined,
|
|
||||||
this.$auth.hasPermi('base:group-classes:update')
|
this.$auth.hasPermi('base:group-classes:update')
|
||||||
? {
|
? {
|
||||||
type: 'edit',
|
type: 'edit',
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<el-form ref="form" :rules="rules" label-width="100px" :model="form">
|
<el-form ref="form" :rules="rules" label-width="80px" :model="form">
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="班组名称" prop="name">
|
<el-form-item label="班组名称" prop="name">
|
||||||
@@ -14,20 +14,13 @@
|
|||||||
</el-row>
|
</el-row>
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="班组组长" prop="leaderId">
|
<el-form-item label="班组人数" prop="num">
|
||||||
<el-select v-model="form.leaderId" placeholder="请选择" style="width: 100%;" @change="selectLeader">
|
<el-input-number v-model="form.num" :min="1" :max="99999999" style="width: 100%;"></el-input-number>
|
||||||
<el-option
|
|
||||||
v-for="item in workerList"
|
|
||||||
:key="item.id"
|
|
||||||
:label="item.name"
|
|
||||||
:value="item.id">
|
|
||||||
</el-option>
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="手机号" prop="telephone">
|
<el-form-item label="班组组长" prop="leaderName">
|
||||||
<el-input v-model="form.telephone" disabled></el-input>
|
<el-input v-model="form.leaderName"></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
@@ -35,7 +28,6 @@
|
|||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import { getGroupTeam, updateGroupTeam, createGroupTeam, getCode } from '@/api/base/groupTeam'
|
import { getGroupTeam, updateGroupTeam, createGroupTeam, getCode } from '@/api/base/groupTeam'
|
||||||
import { getWorkerList } from '@/api/base/worker'
|
|
||||||
export default {
|
export default {
|
||||||
name: 'groupTeamAdd',
|
name: 'groupTeamAdd',
|
||||||
data() {
|
data() {
|
||||||
@@ -44,28 +36,23 @@ export default {
|
|||||||
id: '',
|
id: '',
|
||||||
name: '',
|
name: '',
|
||||||
code: '',
|
code: '',
|
||||||
leaderId: '',
|
num: null,
|
||||||
telephone: ''
|
leaderName: ''
|
||||||
},
|
},
|
||||||
isEdit: false, //是否是编辑
|
isEdit: false, //是否是编辑
|
||||||
rules: {
|
rules: {
|
||||||
name: [{ required: true, message: '请输入班组名称', trigger: 'blur' }],
|
name: [{ required: true, message: '请输入班组名称', trigger: 'blur' }]
|
||||||
code: [{ required: true, message: '请输入班组编码', trigger: 'blur' }],
|
}
|
||||||
leaderId: [{ required: true, message: '请选择组长', trigger: 'select' }]
|
|
||||||
},
|
|
||||||
workerList: []
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
init(id) {
|
init(id) {
|
||||||
this.getWorkerList()
|
|
||||||
if (id) {
|
if (id) {
|
||||||
this.isEdit = true
|
this.isEdit = true
|
||||||
this.form.id = id
|
this.form.id = id
|
||||||
getGroupTeam( id ).then((res) => {
|
getGroupTeam( id ).then((res) => {
|
||||||
if (res.code === 0) {
|
if (res.code === 0) {
|
||||||
this.form = res.data
|
this.form = res.data
|
||||||
this.selectLeader()
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
@@ -76,24 +63,6 @@ export default {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// 获取员工list
|
|
||||||
getWorkerList() {
|
|
||||||
getWorkerList().then(res => {
|
|
||||||
this.workerList = res.data
|
|
||||||
})
|
|
||||||
},
|
|
||||||
// 获取手机号
|
|
||||||
selectLeader() {
|
|
||||||
if (this.form.leaderId) {
|
|
||||||
this.workerList.map(item => {
|
|
||||||
if (item.id === this.form.leaderId) {
|
|
||||||
this.form.telephone = item.telephone || ''
|
|
||||||
}
|
|
||||||
})
|
|
||||||
} else {
|
|
||||||
this.form.telephone = ''
|
|
||||||
}
|
|
||||||
},
|
|
||||||
submitForm() {
|
submitForm() {
|
||||||
this.$refs['form'].validate((valid) => {
|
this.$refs['form'].validate((valid) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
|
|||||||
@@ -12,7 +12,8 @@ export default {
|
|||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
state: false
|
state: false,
|
||||||
|
payload: {}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
@@ -30,16 +31,9 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
changeHandler() {
|
changeHandler() {
|
||||||
let params = {}
|
this.payload.id = this.injectData.id
|
||||||
let payload = {}
|
this.payload.enabled = this.state ? '1' : '0'
|
||||||
params.name = 'state'
|
this.$emit('emitData', this.payload)
|
||||||
payload.id = this.injectData.id
|
|
||||||
payload.enabled = this.state ? '1' : '0'
|
|
||||||
payload.code = this.injectData.code
|
|
||||||
payload.name = this.injectData.name
|
|
||||||
payload.leaderId = this.injectData.leaderId
|
|
||||||
params.payload = payload
|
|
||||||
this.$emit('emitData', params)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,298 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div>
|
|
||||||
<el-drawer :title="title" :visible.sync="visible" size="70%" @close='closeD'>
|
|
||||||
<div class="box">
|
|
||||||
<el-row class="topBox">
|
|
||||||
<el-col :span="6">
|
|
||||||
<p class="boldTitle">班组名称</p>
|
|
||||||
<p class="lightText">{{ teamData.teamName }}</p>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="6">
|
|
||||||
<p class="boldTitle">班组长</p>
|
|
||||||
<p class="lightText">{{ teamData.leaderName }}</p>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="6">
|
|
||||||
<p class="boldTitle">班组人数</p>
|
|
||||||
<p class="lightText">{{ teamData.teamNum }}</p>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="6">
|
|
||||||
<p class="boldTitle">手机号</p>
|
|
||||||
<p class="lightText">{{ teamData.leaderTelephone }}</p>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
<div class="bottomBox">
|
|
||||||
<!-- 搜索工作栏 -->
|
|
||||||
<search-bar
|
|
||||||
v-if="visible"
|
|
||||||
:formConfigs="formConfig"
|
|
||||||
@headBtnClick="buttonClick"
|
|
||||||
/>
|
|
||||||
<base-table
|
|
||||||
:page="queryParams.pageNo"
|
|
||||||
:limit="queryParams.pageSize"
|
|
||||||
:table-props="tableProps"
|
|
||||||
:table-data="tableData"
|
|
||||||
:max-height="tableH"
|
|
||||||
>
|
|
||||||
<method-btn
|
|
||||||
v-if="tableBtn.length"
|
|
||||||
slot="handleBtn"
|
|
||||||
:width="100"
|
|
||||||
label="操作"
|
|
||||||
:method-list="tableBtn"
|
|
||||||
@clickBtn="handleClick"
|
|
||||||
/>
|
|
||||||
</base-table>
|
|
||||||
<pagination
|
|
||||||
:page.sync="queryParams.pageNo"
|
|
||||||
:limit.sync="queryParams.pageSize"
|
|
||||||
:total="total"
|
|
||||||
@pagination="getList"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</el-drawer>
|
|
||||||
<!-- 新增编辑组员 -->
|
|
||||||
<base-dialog
|
|
||||||
:dialogTitle="addOrEditTitle"
|
|
||||||
:dialogVisible="centervisible"
|
|
||||||
@cancel="handleCancel"
|
|
||||||
@confirm="handleConfirm"
|
|
||||||
:before-close="handleCancel"
|
|
||||||
>
|
|
||||||
<worker-team-add ref="workerTeamAdd" @successSubmit="successSubmit" />
|
|
||||||
</base-dialog>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
<script>
|
|
||||||
const tableProps = [
|
|
||||||
{
|
|
||||||
prop: 'workerName',
|
|
||||||
label: '人员姓名'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
prop: 'workerMajorName',
|
|
||||||
label: '专业'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
prop: 'workerTelephone',
|
|
||||||
label: '手机'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
prop: 'remark',
|
|
||||||
label: '备注'
|
|
||||||
}
|
|
||||||
]
|
|
||||||
import { groupTeamPage, teamDetDelete } from '@/api/base/groupTeam'
|
|
||||||
import { getWorker } from '@/api/base/worker'
|
|
||||||
import WorkerTeamAdd from './workerTeamAdd.vue'
|
|
||||||
export default {
|
|
||||||
name: 'WorkerEdit',
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
visible: false,
|
|
||||||
title: '',
|
|
||||||
formConfig: [],
|
|
||||||
teamData: {
|
|
||||||
teamName: '',
|
|
||||||
leaderName: '',
|
|
||||||
teamNum: '',
|
|
||||||
leaderTelephone: '-',
|
|
||||||
teamId: ''
|
|
||||||
},
|
|
||||||
queryParams: {
|
|
||||||
pageNo: 1,
|
|
||||||
pageSize: 20,
|
|
||||||
teamId: '',
|
|
||||||
workerName: ''
|
|
||||||
},
|
|
||||||
tableProps,
|
|
||||||
tableData: [],
|
|
||||||
tableBtn: [],
|
|
||||||
tableH: this.tableHeight(320),
|
|
||||||
total: 0,
|
|
||||||
// 弹出层标题
|
|
||||||
addOrEditTitle: "",
|
|
||||||
// 是否显示弹出层
|
|
||||||
centervisible: false
|
|
||||||
}
|
|
||||||
},
|
|
||||||
components: { WorkerTeamAdd },
|
|
||||||
created() {
|
|
||||||
window.addEventListener('resize', () => {
|
|
||||||
this.tableH = this.tableHeight(320)
|
|
||||||
})
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
init(val) {
|
|
||||||
this.visible = true
|
|
||||||
this.teamData.teamName = val.payload.name
|
|
||||||
this.teamData.leaderName = val.payload.leaderName
|
|
||||||
this.teamData.teamNum = val.payload.num
|
|
||||||
this.teamData.teamId = val.payload.teamId
|
|
||||||
this.queryParams.teamId = val.payload.id
|
|
||||||
getWorker({id:val.payload.leaderId}).then(res => {// 获取组长手机号
|
|
||||||
this.teamData.leaderTelephone = res.data.telephone || '-'
|
|
||||||
})
|
|
||||||
this.getList()
|
|
||||||
if (val.name === 'view') {
|
|
||||||
this.title = '查看组员'
|
|
||||||
this.tableBtn = []
|
|
||||||
this.formConfig = [
|
|
||||||
{
|
|
||||||
type: 'input',
|
|
||||||
label: '关键字',
|
|
||||||
placeholder: '关键字',
|
|
||||||
param: 'workerName'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
type: 'button',
|
|
||||||
btnName: '查询',
|
|
||||||
name: 'search',
|
|
||||||
color: 'primary'
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}else{
|
|
||||||
this.title = '编辑组员'
|
|
||||||
this.tableBtn = [
|
|
||||||
{
|
|
||||||
type: 'edit',
|
|
||||||
btnName: '编辑'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
type: 'delete',
|
|
||||||
btnName: '删除'
|
|
||||||
}
|
|
||||||
]
|
|
||||||
this.formConfig = [
|
|
||||||
{
|
|
||||||
type: 'input',
|
|
||||||
label: '关键字',
|
|
||||||
placeholder: '关键字',
|
|
||||||
param: 'workerName'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
type: 'button',
|
|
||||||
btnName: '查询',
|
|
||||||
name: 'search',
|
|
||||||
color: 'primary'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
type: 'separate'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
type: 'button',
|
|
||||||
btnName: '新增',
|
|
||||||
name: 'add',
|
|
||||||
color: 'success',
|
|
||||||
plain: true
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
},
|
|
||||||
getList() {
|
|
||||||
groupTeamPage({ ...this.queryParams }).then(res => {
|
|
||||||
if (res.code === 0 && res.data.list.length > 0) {
|
|
||||||
let arr = []
|
|
||||||
res.data.list.map(item => {
|
|
||||||
let obj = {}
|
|
||||||
obj.workerName = item.worker.name
|
|
||||||
obj.workerMajorName = item.worker.majorName
|
|
||||||
obj.workerTelephone = item.worker.telephone
|
|
||||||
obj.remark = item.remark
|
|
||||||
obj.id = item.id
|
|
||||||
arr.push(obj)
|
|
||||||
})
|
|
||||||
this.tableData = arr
|
|
||||||
this.total = res.data.total
|
|
||||||
} else {
|
|
||||||
this.tableData = []
|
|
||||||
this.total = 0
|
|
||||||
}
|
|
||||||
})
|
|
||||||
},
|
|
||||||
buttonClick(val) {
|
|
||||||
console.log(val)
|
|
||||||
if (val.btnName === 'search') {
|
|
||||||
this.queryParams.workerName = val.workerName
|
|
||||||
this.queryParams.pageNo = 1
|
|
||||||
this.getList()
|
|
||||||
}else if (val.btnName === 'add') {
|
|
||||||
this.addNew()
|
|
||||||
}
|
|
||||||
},
|
|
||||||
// 新增
|
|
||||||
addNew() {
|
|
||||||
this.addOrEditTitle = '新增'
|
|
||||||
this.centervisible = true
|
|
||||||
this.$nextTick(() => {
|
|
||||||
this.$refs.workerTeamAdd.init({'teamId': this.queryParams.teamId, id: ''})
|
|
||||||
})
|
|
||||||
},
|
|
||||||
handleCancel() {
|
|
||||||
this.$refs.workerTeamAdd.formClear()
|
|
||||||
this.centervisible = false
|
|
||||||
this.addOrEditTitle = ''
|
|
||||||
},
|
|
||||||
handleConfirm() {
|
|
||||||
this.$refs.workerTeamAdd.submitForm()
|
|
||||||
},
|
|
||||||
successSubmit() {
|
|
||||||
this.handleCancel()
|
|
||||||
this.getList()
|
|
||||||
},
|
|
||||||
handleClick(val) {
|
|
||||||
switch (val.type) {
|
|
||||||
case 'edit':
|
|
||||||
this.addOrEditTitle = '编辑'
|
|
||||||
this.centervisible = true
|
|
||||||
this.$nextTick(() => {
|
|
||||||
this.$refs.workerTeamAdd.init({'teamId': this.queryParams.teamId, id: val.data.id})
|
|
||||||
})
|
|
||||||
break
|
|
||||||
default:
|
|
||||||
this.handleDelete(val.data)
|
|
||||||
}
|
|
||||||
},
|
|
||||||
/** 删除按钮操作 */
|
|
||||||
handleDelete(row) {
|
|
||||||
console.log(row)
|
|
||||||
this.$modal.confirm('是否确认删除人员"' + row.workerName + '"的数据项?').then(function() {
|
|
||||||
return teamDetDelete({id: row.id});
|
|
||||||
}).then(() => {
|
|
||||||
this.queryParams.pageNo = 1;
|
|
||||||
this.getList();
|
|
||||||
this.$modal.msgSuccess("删除成功");
|
|
||||||
}).catch(() => {});
|
|
||||||
},
|
|
||||||
closeD() {
|
|
||||||
this.$emit('closeDrawer')
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
<style lang='scss' scoped>
|
|
||||||
.box {
|
|
||||||
padding:0 30px;
|
|
||||||
.topBox {
|
|
||||||
padding-bottom: 30px;
|
|
||||||
border-bottom: 1px solid #E9E9E9;
|
|
||||||
.boldTitle {
|
|
||||||
font-size: 14px;
|
|
||||||
font-weight: 600;
|
|
||||||
color: rgba(0,0,0,0.85);
|
|
||||||
margin: 0;
|
|
||||||
margin-bottom: 10px;
|
|
||||||
}
|
|
||||||
.lightText {
|
|
||||||
font-size: 14px;
|
|
||||||
font-weight: 400;
|
|
||||||
color: rgba(102,102,102,0.75);
|
|
||||||
margin: 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.bottomBox {
|
|
||||||
padding-top: 30px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@@ -1,41 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div class="workerOperate">
|
|
||||||
<div class="operateBtn">
|
|
||||||
<span class="view" v-if="this.$auth.hasPermi('base:group-team:view-worker')" @click="emitParams('view')">查看</span>
|
|
||||||
<span class="edit" v-if="this.$auth.hasPermi('base:group-team:edit-worker')" @click="emitParams('edit')">编辑</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
<script>
|
|
||||||
export default {
|
|
||||||
name: 'WorkerOperate',
|
|
||||||
props: {
|
|
||||||
injectData: {
|
|
||||||
type: Object,
|
|
||||||
default: () => ({})
|
|
||||||
}
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
emitParams(data) {
|
|
||||||
let params = {}
|
|
||||||
params.name = data
|
|
||||||
params.payload = this.injectData
|
|
||||||
this.$emit('emitData', params)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
<style lang='scss' scoped>
|
|
||||||
.workerOperate {
|
|
||||||
.operateBtn{
|
|
||||||
color: #0B58FF;
|
|
||||||
.view {
|
|
||||||
margin-right: 10px;
|
|
||||||
cursor: pointer;
|
|
||||||
}
|
|
||||||
.edit {
|
|
||||||
cursor: pointer;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@@ -1,113 +0,0 @@
|
|||||||
<template>
|
|
||||||
<el-form ref="form" :rules="rules" label-width="100px" :model="form">
|
|
||||||
<el-form-item label="员工" prop="workerId">
|
|
||||||
<el-select v-model="form.workerId" placeholder="请选择" filterable style="width: 100%;" @change="selectWorker()">
|
|
||||||
<el-option
|
|
||||||
v-for="item in workerList"
|
|
||||||
:key="item.id"
|
|
||||||
:label="item.name"
|
|
||||||
:value="item.id">
|
|
||||||
</el-option>
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="专业" prop="majorName">
|
|
||||||
<el-input v-model="form.majorName" disabled></el-input>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="备注" prop="remark">
|
|
||||||
<el-input v-model="form.remark"></el-input>
|
|
||||||
</el-form-item>
|
|
||||||
</el-form>
|
|
||||||
</template>
|
|
||||||
<script>
|
|
||||||
import { getWorkerList } from '@/api/base/worker'
|
|
||||||
import { teamDetCreate, teamDetUpdate, groupTeamDet } from '@/api/base/groupTeam'
|
|
||||||
export default {
|
|
||||||
name: 'WorkerTeamAdd',
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
workerList: [],
|
|
||||||
form: {
|
|
||||||
teamId: '',
|
|
||||||
workerId: '',
|
|
||||||
remark: '',
|
|
||||||
majorName: '',
|
|
||||||
id: ''
|
|
||||||
},
|
|
||||||
rules: {
|
|
||||||
workerId: [{ required: true, message: '员工不能为空', trigger: 'change' }]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
init(param) {
|
|
||||||
this.form.teamId = param.teamId
|
|
||||||
getWorkerList().then(res => {
|
|
||||||
this.workerList = res.data || []
|
|
||||||
if (param.id) {
|
|
||||||
this.isEdit = true
|
|
||||||
this.form.id = param.id
|
|
||||||
groupTeamDet({id: this.form.id}).then((res) => {
|
|
||||||
if (res.code === 0) {
|
|
||||||
this.form.workerId = res.data.workerId
|
|
||||||
this.selectWorker()
|
|
||||||
this.form.remark = res.data.remark
|
|
||||||
}
|
|
||||||
})
|
|
||||||
} else {
|
|
||||||
this.isEdit = false
|
|
||||||
this.form.id = ''
|
|
||||||
}
|
|
||||||
})
|
|
||||||
},
|
|
||||||
selectWorker() {
|
|
||||||
if (this.form.workerId) {
|
|
||||||
this.workerList.map(item => {
|
|
||||||
if (item.id === this.form.workerId) {
|
|
||||||
this.form.majorName = item.majorName
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}else{
|
|
||||||
this.form.majorName = ''
|
|
||||||
}
|
|
||||||
},
|
|
||||||
// 确定
|
|
||||||
submitForm() {
|
|
||||||
this.$refs['form'].validate((valid) => {
|
|
||||||
if (valid) {
|
|
||||||
if (this.isEdit) {
|
|
||||||
// 编辑
|
|
||||||
teamDetUpdate({
|
|
||||||
teamId: this.form.teamId,
|
|
||||||
workerId: this.form.workerId,
|
|
||||||
remark: this.form.remark,
|
|
||||||
id: this.form.id
|
|
||||||
}).then((res) => {
|
|
||||||
if (res.code === 0) {
|
|
||||||
this.$modal.msgSuccess("操作成功");
|
|
||||||
this.$emit('successSubmit')
|
|
||||||
}
|
|
||||||
})
|
|
||||||
} else {
|
|
||||||
teamDetCreate({
|
|
||||||
teamId: this.form.teamId,
|
|
||||||
workerId: this.form.workerId,
|
|
||||||
remark: this.form.remark
|
|
||||||
}).then((res) => {
|
|
||||||
if (res.code === 0) {
|
|
||||||
this.$modal.msgSuccess("操作成功");
|
|
||||||
this.$emit('successSubmit')
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
})
|
|
||||||
},
|
|
||||||
formClear() {
|
|
||||||
this.$refs.form.resetFields()
|
|
||||||
this.isEdit = false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
@@ -41,18 +41,14 @@
|
|||||||
>
|
>
|
||||||
<group-team-add ref="groupList" @successSubmit="successSubmit" />
|
<group-team-add ref="groupList" @successSubmit="successSubmit" />
|
||||||
</base-dialog>
|
</base-dialog>
|
||||||
<!-- 组员编辑 -->
|
|
||||||
<worker-edit v-if='paramVisible' ref='workerEditParam' @closeDrawer="closeDrawer"></worker-edit>
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { getGroupTeamPage, deleteGroupTeam, updateGroupTeam } from "@/api/base/groupTeam";
|
import { getGroupTeamPage, deleteGroupTeam, updateGroupTeam } from "@/api/base/groupTeam";
|
||||||
import { parseTime } from '@/utils/ruoyi'
|
import { parseTime } from '@/utils/ruoyi'
|
||||||
import GroupTeamAdd from './components/groupTeamAdd'
|
import GroupTeamAdd from './components/groupTeamAdd.vue'
|
||||||
import StatusBtn from './components/statusBtn.vue'
|
import StatusBtn from './components/statusBtn.vue'
|
||||||
import WorkerOperate from './components/workerOperate.vue'
|
|
||||||
import WorkerEdit from './components/workerEdit.vue';
|
|
||||||
const tableProps = [
|
const tableProps = [
|
||||||
{
|
{
|
||||||
prop: 'createTime',
|
prop: 'createTime',
|
||||||
@@ -66,7 +62,7 @@ const tableProps = [
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'code',
|
prop: 'code',
|
||||||
label: '编码',
|
label: '班组编码',
|
||||||
minWidth: 220
|
minWidth: 220
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -75,22 +71,17 @@ const tableProps = [
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'leaderName',
|
prop: 'leaderName',
|
||||||
label: '组长'
|
label: '班组组长'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'enabled',
|
prop: 'enabled',
|
||||||
label: '班组状态',
|
label: '班组状态',
|
||||||
subcomponent: StatusBtn
|
subcomponent: StatusBtn
|
||||||
},
|
}
|
||||||
{
|
|
||||||
prop: 'workerName',
|
|
||||||
label: '组员',
|
|
||||||
subcomponent: WorkerOperate
|
|
||||||
},
|
|
||||||
]
|
]
|
||||||
export default {
|
export default {
|
||||||
name: "GroupTeam",
|
name: "GroupTeam",
|
||||||
components: { GroupTeamAdd, WorkerEdit },
|
components: { GroupTeamAdd },
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
formConfig: [
|
formConfig: [
|
||||||
@@ -102,9 +93,9 @@ export default {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
type: 'input',
|
type: 'input',
|
||||||
label: '组长',
|
label: '班组编码',
|
||||||
placeholder: '组长',
|
placeholder: '班组编码',
|
||||||
param: 'leaderName'
|
param: 'code'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
type: 'button',
|
type: 'button',
|
||||||
@@ -153,8 +144,7 @@ export default {
|
|||||||
pageSize: 20,
|
pageSize: 20,
|
||||||
name: null,
|
name: null,
|
||||||
code: null
|
code: null
|
||||||
},
|
}
|
||||||
paramVisible: false
|
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
@@ -168,8 +158,8 @@ export default {
|
|||||||
switch (val.btnName) {
|
switch (val.btnName) {
|
||||||
case 'search':
|
case 'search':
|
||||||
this.queryParams.pageNo = 1;
|
this.queryParams.pageNo = 1;
|
||||||
this.queryParams.leaderName = val.leaderName
|
|
||||||
this.queryParams.name = val.name
|
this.queryParams.name = val.name
|
||||||
|
this.queryParams.code = val.code
|
||||||
this.getList()
|
this.getList()
|
||||||
break
|
break
|
||||||
default:
|
default:
|
||||||
@@ -201,20 +191,12 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
// 班组状态
|
// 班组状态
|
||||||
handleTableEvents(params) {
|
handleTableEvents(data) {
|
||||||
console.log(params)
|
updateGroupTeam({ ...data }).then((res) => {
|
||||||
if (params.name === 'state') {// 班组状态
|
|
||||||
updateGroupTeam({ ...params.payload }).then((res) => {
|
|
||||||
if (res.code === 0) {
|
if (res.code === 0) {
|
||||||
this.$modal.msgSuccess("操作成功");
|
this.$modal.msgSuccess("操作成功");
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}else {// 编辑&查看
|
|
||||||
this.paramVisible = true
|
|
||||||
this.$nextTick(() => {
|
|
||||||
this.$refs.workerEditParam.init(params)
|
|
||||||
})
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
handleCancel() {
|
handleCancel() {
|
||||||
this.$refs.groupList.formClear()
|
this.$refs.groupList.formClear()
|
||||||
@@ -237,9 +219,6 @@ export default {
|
|||||||
this.getList();
|
this.getList();
|
||||||
this.$modal.msgSuccess("删除成功");
|
this.$modal.msgSuccess("删除成功");
|
||||||
}).catch(() => {});
|
}).catch(() => {});
|
||||||
},
|
|
||||||
closeDrawer() {
|
|
||||||
this.getList()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,46 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div>
|
|
||||||
<el-drawer title="查看详情" :visible.sync="visible" size="70%">
|
|
||||||
<div class="box">
|
|
||||||
<base-table
|
|
||||||
:table-props="tableProps"
|
|
||||||
:table-data="tableData"
|
|
||||||
:max-height="tableH"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</el-drawer>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
<script>
|
|
||||||
import { getByScheduling } from '@/api/monitoring/groupTeamView'
|
|
||||||
export default {
|
|
||||||
name: 'schedulingMonitoringDetail',
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
visible: false,
|
|
||||||
tableProps: [],
|
|
||||||
tableData: [],
|
|
||||||
tableH: this.tableHeight(200)
|
|
||||||
}
|
|
||||||
},
|
|
||||||
created() {
|
|
||||||
window.addEventListener('resize', () => {
|
|
||||||
this.tableH = this.tableHeight(200)
|
|
||||||
})
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
init(id) {
|
|
||||||
this.visible = true
|
|
||||||
console.log(id)
|
|
||||||
getByScheduling({id}).then(res => {
|
|
||||||
console.log(res)
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
<style lang="scss" scoped>
|
|
||||||
.box {
|
|
||||||
padding: 0 32px;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@@ -1,154 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div class="app-container">
|
|
||||||
<!-- 搜索工作栏 -->
|
|
||||||
<search-bar
|
|
||||||
:formConfigs="formConfig"
|
|
||||||
ref="searchBarForm"
|
|
||||||
@headBtnClick="buttonClick"
|
|
||||||
/>
|
|
||||||
<!-- 列表 -->
|
|
||||||
<base-table
|
|
||||||
:page="queryParams.pageNo"
|
|
||||||
:limit="queryParams.pageSize"
|
|
||||||
:table-props="tableProps"
|
|
||||||
:table-data="list"
|
|
||||||
:max-height="tableH"
|
|
||||||
>
|
|
||||||
<method-btn
|
|
||||||
v-if="tableBtn.length"
|
|
||||||
slot="handleBtn"
|
|
||||||
:width="160"
|
|
||||||
label="操作"
|
|
||||||
:method-list="tableBtn"
|
|
||||||
@clickBtn="handleClick"
|
|
||||||
/>
|
|
||||||
</base-table>
|
|
||||||
<pagination
|
|
||||||
:page.sync="queryParams.pageNo"
|
|
||||||
:limit.sync="queryParams.pageSize"
|
|
||||||
:total="total"
|
|
||||||
@pagination="getList"
|
|
||||||
/>
|
|
||||||
<!-- 查看生产情况 -->
|
|
||||||
<scheduling-monitoring-detail v-if='paramVisible' ref='schedulingMonitoringDetail'/>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
<script>
|
|
||||||
import { groupTeamSchedulingPage } from '@/api/base/groupTeamScheduling'
|
|
||||||
import { parseTime } from '@/utils/ruoyi'
|
|
||||||
import SchedulingMonitoringDetail from './components/schedulingMonitoringDetail'
|
|
||||||
const tableProps = [
|
|
||||||
{
|
|
||||||
prop: 'createTime',
|
|
||||||
label: '排班创建时间',
|
|
||||||
filter: parseTime
|
|
||||||
},
|
|
||||||
{
|
|
||||||
prop: 'startDay',
|
|
||||||
label: '上班日期'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
prop: 'startTime',
|
|
||||||
label: '上班时间',
|
|
||||||
filter: parseTime
|
|
||||||
},
|
|
||||||
{
|
|
||||||
prop: 'endTime',
|
|
||||||
label: '下班时间',
|
|
||||||
filter: parseTime
|
|
||||||
},
|
|
||||||
{
|
|
||||||
prop: 'classesName',
|
|
||||||
label: '班次名称'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
prop: 'teamName',
|
|
||||||
label: '班组名称'
|
|
||||||
}
|
|
||||||
]
|
|
||||||
const tableBtn = [
|
|
||||||
{
|
|
||||||
type: 'viewDetail',
|
|
||||||
btnName: '查看生产情况'
|
|
||||||
}
|
|
||||||
]
|
|
||||||
export default {
|
|
||||||
name: 'GroupTeamScheduling',
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
formConfig: [
|
|
||||||
{
|
|
||||||
type: 'select',
|
|
||||||
label: '班次信息',
|
|
||||||
selectOptions: [],
|
|
||||||
param: 'classesId'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
type: 'input',
|
|
||||||
label: '班组信息',
|
|
||||||
placeholder: '班组信息',
|
|
||||||
param: 'teamName'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
type: 'datePicker',
|
|
||||||
label: '上班日期',
|
|
||||||
dateType: 'date',
|
|
||||||
format: 'yyyy-MM-dd HH:mm:ss',
|
|
||||||
valueFormat: "timestamp",
|
|
||||||
param: 'startDay',
|
|
||||||
defaultSelect: '',
|
|
||||||
width: 200
|
|
||||||
},
|
|
||||||
{
|
|
||||||
type: 'button',
|
|
||||||
btnName: '查询',
|
|
||||||
name: 'search',
|
|
||||||
color: 'primary'
|
|
||||||
}
|
|
||||||
],
|
|
||||||
// 查询参数
|
|
||||||
queryParams: {
|
|
||||||
pageNo: 1,
|
|
||||||
pageSize: 20,
|
|
||||||
classesId: '',
|
|
||||||
teamName: '',
|
|
||||||
startDay: ''
|
|
||||||
},
|
|
||||||
tableProps,
|
|
||||||
tableBtn,
|
|
||||||
list: [],
|
|
||||||
tableH: this.tableHeight(220),
|
|
||||||
total: 0,
|
|
||||||
paramVisible: false
|
|
||||||
}
|
|
||||||
},
|
|
||||||
components: { SchedulingMonitoringDetail },
|
|
||||||
mounted() {
|
|
||||||
window.addEventListener('resize', () => {
|
|
||||||
this.tableH = this.tableHeight(220)
|
|
||||||
})
|
|
||||||
this.getList()
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
buttonClick(val) {
|
|
||||||
this.queryParams.pageNo = 1;
|
|
||||||
this.queryParams.cnName = val.cnName
|
|
||||||
this.getList()
|
|
||||||
},
|
|
||||||
getList() {
|
|
||||||
groupTeamSchedulingPage().then(res => {
|
|
||||||
console.log(res)
|
|
||||||
this.list = res.data.list || []
|
|
||||||
this.total = res.data.total || 0
|
|
||||||
})
|
|
||||||
},
|
|
||||||
handleClick(val) {
|
|
||||||
console.log(val)
|
|
||||||
this.paramVisible = true
|
|
||||||
this.$nextTick(() => {
|
|
||||||
this.$refs.schedulingMonitoringDetail.init(val.data.id)
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
@@ -1,85 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div>
|
|
||||||
<el-drawer title="查看详情" :visible.sync="visible" size="70%">
|
|
||||||
<div class="box">
|
|
||||||
<el-form :inline="true">
|
|
||||||
<el-form-item label="工单名称">
|
|
||||||
<el-input v-model="queryParams.workOrderName" size='small' readonly></el-input>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="班组名称">
|
|
||||||
<el-input v-model="queryParams.teamName" size='small' readonly></el-input>
|
|
||||||
</el-form-item>
|
|
||||||
</el-form>
|
|
||||||
<base-table
|
|
||||||
:table-props="tableProps"
|
|
||||||
:table-data="tableData"
|
|
||||||
:max-height="tableH"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</el-drawer>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
<script>
|
|
||||||
import { getByTeam } from '@/api/monitoring/groupTeamView'
|
|
||||||
import { parseTime } from '@/utils/ruoyi'
|
|
||||||
const tableProps = [
|
|
||||||
{
|
|
||||||
prop: 'startTime',
|
|
||||||
label: '开始时间',
|
|
||||||
filter: parseTime,
|
|
||||||
minWidth: 150
|
|
||||||
},
|
|
||||||
{
|
|
||||||
prop: 'endTime',
|
|
||||||
label: '结束时间',
|
|
||||||
filter: parseTime,
|
|
||||||
minWidth: 150
|
|
||||||
},
|
|
||||||
{
|
|
||||||
prop: 'num',
|
|
||||||
label: '人数'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
prop: 'workTime',
|
|
||||||
label: '工作时长'
|
|
||||||
}
|
|
||||||
]
|
|
||||||
export default {
|
|
||||||
name: 'GroupTeamViewDetail',
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
visible: false,
|
|
||||||
workOrderName: '',
|
|
||||||
teamName: '',
|
|
||||||
tableProps,
|
|
||||||
tableData: [],
|
|
||||||
tableH: this.tableHeight(200),
|
|
||||||
queryParams: {}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
created() {
|
|
||||||
window.addEventListener('resize', () => {
|
|
||||||
this.tableH = this.tableHeight(200)
|
|
||||||
})
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
init(params) {
|
|
||||||
console.log(params)
|
|
||||||
this.visible = true
|
|
||||||
this.queryParams = params
|
|
||||||
getByTeam({
|
|
||||||
teamId: this.queryParams.teamId,
|
|
||||||
workOrderId: this.queryParams.workOrderId
|
|
||||||
}).then(res => {
|
|
||||||
console.log(res)
|
|
||||||
this.tableData = res.data || []
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
<style lang="scss" scoped>
|
|
||||||
.box {
|
|
||||||
padding: 0 32px;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@@ -1,130 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div class="app-container">
|
|
||||||
<!-- 搜索工作栏 -->
|
|
||||||
<search-bar
|
|
||||||
:formConfigs="formConfig"
|
|
||||||
ref="searchBarForm"
|
|
||||||
@headBtnClick="buttonClick"
|
|
||||||
/>
|
|
||||||
<!-- 列表 -->
|
|
||||||
<base-table
|
|
||||||
:page="queryParams.pageNo"
|
|
||||||
:limit="queryParams.pageSize"
|
|
||||||
:table-props="tableProps"
|
|
||||||
:table-data="list"
|
|
||||||
:max-height="tableH"
|
|
||||||
>
|
|
||||||
<method-btn
|
|
||||||
v-if="tableBtn.length"
|
|
||||||
slot="handleBtn"
|
|
||||||
:width="160"
|
|
||||||
label="操作"
|
|
||||||
:method-list="tableBtn"
|
|
||||||
@clickBtn="handleClick"
|
|
||||||
/>
|
|
||||||
</base-table>
|
|
||||||
<!-- 查看详情 -->
|
|
||||||
<group-team-view-detail v-if="paramVisible" ref="groupTeamViewDetail"/>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
<script>
|
|
||||||
import { getByWorkOrder } from '@/api/monitoring/groupTeamView'
|
|
||||||
import { workOrderList } from '@/api/base/workOrder'
|
|
||||||
import GroupTeamViewDetail from './components/groupTeamViewDetail.vue'
|
|
||||||
const tableProps = [
|
|
||||||
{
|
|
||||||
prop: 'name',
|
|
||||||
label: '班组名称'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
prop: 'leaderName',
|
|
||||||
label: '班组长'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
prop: 'num',
|
|
||||||
label: '人数'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
prop: 'workCount',
|
|
||||||
label: '上班次数'
|
|
||||||
}
|
|
||||||
]
|
|
||||||
const tableBtn = [
|
|
||||||
{
|
|
||||||
type: 'detail',
|
|
||||||
btnName: '详情'
|
|
||||||
}
|
|
||||||
]
|
|
||||||
export default {
|
|
||||||
name: 'GroupTeamView',
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
formConfig: [
|
|
||||||
{
|
|
||||||
type: 'input',
|
|
||||||
label: '工单名称',
|
|
||||||
placeholder: '工单名称',
|
|
||||||
param: 'cnName'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
type: 'button',
|
|
||||||
btnName: '查询',
|
|
||||||
name: 'search',
|
|
||||||
color: 'primary'
|
|
||||||
}
|
|
||||||
],
|
|
||||||
// 查询参数
|
|
||||||
queryParams: {
|
|
||||||
pageNo: 1,
|
|
||||||
pageSize: 1000,
|
|
||||||
workOrderId: ''
|
|
||||||
},
|
|
||||||
workOrderName: '工单名称ddd',
|
|
||||||
tableBtn,
|
|
||||||
tableProps,
|
|
||||||
tableH: this.tableHeight(220),
|
|
||||||
list: [],
|
|
||||||
paramVisible: false
|
|
||||||
}
|
|
||||||
},
|
|
||||||
components: { GroupTeamViewDetail },
|
|
||||||
mounted() {
|
|
||||||
window.addEventListener('resize', () => {
|
|
||||||
this.tableH = this.tableHeight(220)
|
|
||||||
})
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
// 获取工单list
|
|
||||||
getOrderList() {
|
|
||||||
workOrderList().then(res => {
|
|
||||||
|
|
||||||
})
|
|
||||||
},
|
|
||||||
// 查询
|
|
||||||
buttonClick(val) {
|
|
||||||
// this.queryParams.workOrderId = val.id
|
|
||||||
this.queryParams.workOrderId = 1
|
|
||||||
this.getList()
|
|
||||||
},
|
|
||||||
// 获取table数据
|
|
||||||
getList() {
|
|
||||||
getByWorkOrder({ id: this.queryParams.workOrderId }).then(res => {
|
|
||||||
console.log(res)
|
|
||||||
this.list = res.data
|
|
||||||
})
|
|
||||||
},
|
|
||||||
handleClick(val) {
|
|
||||||
console.log(val)
|
|
||||||
this.paramVisible = true
|
|
||||||
let params = {}
|
|
||||||
params.teamId = val.data.id
|
|
||||||
params.teamName = val.data.name
|
|
||||||
params.workOrderId = this.queryParams.workOrderId
|
|
||||||
params.workOrderName = this.workOrderName
|
|
||||||
this.$nextTick(() => {
|
|
||||||
this.$refs.groupTeamViewDetail.init(params)
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
@@ -4,70 +4,227 @@
|
|||||||
<!-- 登录区域 -->
|
<!-- 登录区域 -->
|
||||||
<div class="content">
|
<div class="content">
|
||||||
<!-- 配图 -->
|
<!-- 配图 -->
|
||||||
<div class="pic"></div>
|
<div class="pic">
|
||||||
|
<div
|
||||||
|
class="welcome"
|
||||||
|
style="
|
||||||
|
position: absolute;
|
||||||
|
top: 15%;
|
||||||
|
left: 20%;
|
||||||
|
user-select: none;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: flex-start;
|
||||||
|
">
|
||||||
|
<strong
|
||||||
|
style="
|
||||||
|
letter-spacing: 1px;
|
||||||
|
font-family: Arial, Helvetica, sans-serif;
|
||||||
|
font-weight: 500;
|
||||||
|
font-size: 88px;
|
||||||
|
">
|
||||||
|
<span style="color: #26b9de">Wel</span>
|
||||||
|
<span style="color: #fff">come</span>
|
||||||
|
</strong>
|
||||||
|
<p
|
||||||
|
style="
|
||||||
|
margin: 0;
|
||||||
|
font-size: 26px;
|
||||||
|
letter-spacing: 1px;
|
||||||
|
color: #26b9de;
|
||||||
|
opacity: 75%;
|
||||||
|
">
|
||||||
|
<span
|
||||||
|
style="
|
||||||
|
display: inline-block;
|
||||||
|
height: 20px;
|
||||||
|
width: 20px;
|
||||||
|
margin-left: 8px;
|
||||||
|
margin-right: 12px;
|
||||||
|
border-radius: 100%;
|
||||||
|
background: #26b9de;
|
||||||
|
"></span>
|
||||||
|
产线生产监控系统
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
<video
|
||||||
|
src="/static/videos/login.webm"
|
||||||
|
muted
|
||||||
|
autoplay
|
||||||
|
loop
|
||||||
|
style="
|
||||||
|
user-select: none;
|
||||||
|
position: absolute;
|
||||||
|
top: 28%;
|
||||||
|
width: 100%;
|
||||||
|
height: 70%;
|
||||||
|
"></video>
|
||||||
|
</div>
|
||||||
<!-- 表单 -->
|
<!-- 表单 -->
|
||||||
<div class="field">
|
<div class="field">
|
||||||
<!-- [移动端]标题 -->
|
<!-- [移动端]标题 -->
|
||||||
<h2 class="mobile-title">
|
<h2 class="mobile-title">
|
||||||
<h3 class="title">芋道后台管理系统</h3>
|
<h3 class="title">中建材智能自动化研究院有限公司</h3>
|
||||||
|
</h2>
|
||||||
|
<h2 class="pc-title" style="">
|
||||||
|
<h3
|
||||||
|
class="title"
|
||||||
|
style="
|
||||||
|
margin: 0;
|
||||||
|
margin-left: 32px;
|
||||||
|
font-weight: 400;
|
||||||
|
user-select: none;
|
||||||
|
color: #000;
|
||||||
|
font-size: 36px;
|
||||||
|
line-height: 54px;
|
||||||
|
letter-spacing: 2px;
|
||||||
|
">
|
||||||
|
<img
|
||||||
|
src="../assets/logo/cnbm.png"
|
||||||
|
alt="cnbm_logo"
|
||||||
|
style="
|
||||||
|
height: 48px;
|
||||||
|
width: 48px;
|
||||||
|
position: relative;
|
||||||
|
top: 12px;
|
||||||
|
right: 8px;
|
||||||
|
" />
|
||||||
|
<span>中建材智能自动化研究院有限公司</span>
|
||||||
|
</h3>
|
||||||
|
<h3
|
||||||
|
class="sub-title"
|
||||||
|
style="
|
||||||
|
margin: 0;
|
||||||
|
margin-left: 32px;
|
||||||
|
font-weight: 400;
|
||||||
|
user-select: none;
|
||||||
|
color: #000;
|
||||||
|
font-size: 36px;
|
||||||
|
line-height: 54px;
|
||||||
|
letter-spacing: 2px;
|
||||||
|
">
|
||||||
|
产线生产监控系统
|
||||||
|
</h3>
|
||||||
</h2>
|
</h2>
|
||||||
|
|
||||||
<!-- 表单 -->
|
<!-- 表单 -->
|
||||||
<div class="form-cont">
|
<div class="form-cont">
|
||||||
<el-tabs class="form" v-model="loginForm.loginType" style=" float:none;">
|
<el-tabs
|
||||||
<el-tab-pane label="账号密码登录" name="uname">
|
class="form"
|
||||||
</el-tab-pane>
|
v-model="loginForm.loginType"
|
||||||
<el-tab-pane label="短信验证码登录" name="sms">
|
style="float: none">
|
||||||
</el-tab-pane>
|
<el-tab-pane label="账号密码登录" name="uname"></el-tab-pane>
|
||||||
|
<el-tab-pane label="短信验证码登录" name="sms"></el-tab-pane>
|
||||||
</el-tabs>
|
</el-tabs>
|
||||||
<div>
|
<div style="">
|
||||||
<el-form ref="loginForm" :model="loginForm" :rules="LoginRules" class="login-form">
|
<el-form
|
||||||
|
ref="loginForm"
|
||||||
|
:model="loginForm"
|
||||||
|
:rules="LoginRules"
|
||||||
|
class="login-form">
|
||||||
<el-form-item prop="tenantName" v-if="tenantEnable">
|
<el-form-item prop="tenantName" v-if="tenantEnable">
|
||||||
<el-input v-model="loginForm.tenantName" type="text" auto-complete="off" placeholder='租户'>
|
<el-input
|
||||||
<svg-icon slot="prefix" icon-class="tree" class="el-input__icon input-icon" />
|
v-model="loginForm.tenantName"
|
||||||
|
type="text"
|
||||||
|
auto-complete="off"
|
||||||
|
placeholder="租户">
|
||||||
|
<!-- <svg-icon
|
||||||
|
slot="prefix"
|
||||||
|
icon-class="tree"
|
||||||
|
class="el-input__icon input-icon" /> -->
|
||||||
</el-input>
|
</el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<!-- 账号密码登录 -->
|
<!-- 账号密码登录 -->
|
||||||
<div v-if="loginForm.loginType === 'uname'">
|
<div v-if="loginForm.loginType === 'uname'">
|
||||||
<el-form-item prop="username">
|
<el-form-item prop="username">
|
||||||
<el-input v-model="loginForm.username" type="text" auto-complete="off" placeholder="账号">
|
<el-input
|
||||||
<svg-icon slot="prefix" icon-class="user" class="el-input__icon input-icon" />
|
v-model="loginForm.username"
|
||||||
|
type="text"
|
||||||
|
auto-complete="off"
|
||||||
|
placeholder="账号">
|
||||||
|
<!-- <svg-icon
|
||||||
|
slot="prefix"
|
||||||
|
icon-class="user"
|
||||||
|
class="el-input__icon input-icon" /> -->
|
||||||
</el-input>
|
</el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item prop="password">
|
<el-form-item prop="password">
|
||||||
<el-input v-model="loginForm.password" type="password" auto-complete="off" placeholder="密码"
|
<el-input
|
||||||
|
v-model="loginForm.password"
|
||||||
|
type="password"
|
||||||
|
auto-complete="off"
|
||||||
|
placeholder="密码"
|
||||||
@keyup.enter.native="getCode">
|
@keyup.enter.native="getCode">
|
||||||
<svg-icon slot="prefix" icon-class="password" class="el-input__icon input-icon" />
|
<!-- <svg-icon
|
||||||
|
slot="prefix"
|
||||||
|
icon-class="password"
|
||||||
|
class="el-input__icon input-icon" /> -->
|
||||||
</el-input>
|
</el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-checkbox v-model="loginForm.rememberMe" style="margin:0 0 25px 0;">记住密码</el-checkbox>
|
<el-checkbox
|
||||||
|
v-model="loginForm.rememberMe"
|
||||||
|
style="margin: 0 0 25px 0">
|
||||||
|
记住密码
|
||||||
|
</el-checkbox>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- 短信验证码登录 -->
|
<!-- 短信验证码登录 -->
|
||||||
<div v-if="loginForm.loginType === 'sms'">
|
<div v-if="loginForm.loginType === 'sms'">
|
||||||
<el-form-item prop="mobile">
|
<el-form-item prop="mobile">
|
||||||
<el-input v-model="loginForm.mobile" type="text" auto-complete="off" placeholder="请输入手机号">
|
<el-input
|
||||||
<svg-icon slot="prefix" icon-class="phone" class="el-input__icon input-icon" />
|
v-model="loginForm.mobile"
|
||||||
|
type="text"
|
||||||
|
auto-complete="off"
|
||||||
|
placeholder="请输入手机号">
|
||||||
|
<!-- <svg-icon
|
||||||
|
slot="prefix"
|
||||||
|
icon-class="phone"
|
||||||
|
class="el-input__icon input-icon" /> -->
|
||||||
</el-input>
|
</el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item prop="mobileCode">
|
<el-form-item prop="mobileCode">
|
||||||
<el-input v-model="loginForm.mobileCode" type="text" auto-complete="off" placeholder="短信验证码"
|
<el-input
|
||||||
class="sms-login-mobile-code-prefix" @keyup.enter.native="handleLogin">
|
v-model="loginForm.mobileCode"
|
||||||
<template>
|
type="text"
|
||||||
<svg-icon slot="prefix" icon-class="password" class="el-input__icon input-icon" />
|
auto-complete="off"
|
||||||
</template>
|
placeholder="短信验证码"
|
||||||
<template slot="append">
|
class="sms-login-mobile-code-prefix"
|
||||||
<span v-if="mobileCodeTimer <= 0" class="getMobileCode" @click="getSmsCode"
|
@keyup.enter.native="handleLogin">
|
||||||
style="cursor: pointer;">获取验证码</span>
|
<!-- <template>
|
||||||
<span v-if="mobileCodeTimer > 0" class="getMobileCode">{{ mobileCodeTimer }}秒后可重新获取</span>
|
<svg-icon
|
||||||
|
slot="prefix"
|
||||||
|
icon-class="password"
|
||||||
|
class="el-input__icon input-icon" />
|
||||||
|
</template> -->
|
||||||
|
<template slot="suffix">
|
||||||
|
<span
|
||||||
|
v-if="mobileCodeTimer <= 0"
|
||||||
|
class="getMobileCode"
|
||||||
|
@click="getSmsCode"
|
||||||
|
style="
|
||||||
|
cursor: pointer;
|
||||||
|
color: #0b58ff;
|
||||||
|
font-size: 18px;
|
||||||
|
line-height: 66px;
|
||||||
|
padding-right: 12px;
|
||||||
|
">
|
||||||
|
获取验证码
|
||||||
|
</span>
|
||||||
|
<span v-if="mobileCodeTimer > 0" class="getMobileCode">
|
||||||
|
{{ mobileCodeTimer }}秒后可重新获取
|
||||||
|
</span>
|
||||||
</template>
|
</template>
|
||||||
</el-input>
|
</el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- 下方的登录按钮 -->
|
<!-- 下方的登录按钮 -->
|
||||||
<el-form-item style="width:100%;">
|
<el-form-item id="button-form-item" style="width: 100%; margin-top: 32px">
|
||||||
<el-button :loading="loading" size="medium" type="primary" style="width:100%;"
|
<el-button
|
||||||
|
:loading="loading"
|
||||||
|
size="medium"
|
||||||
|
type="primary"
|
||||||
|
style="width: 100%; height: 66px; font-size: 18px;"
|
||||||
@click.native.prevent="getCode">
|
@click.native.prevent="getCode">
|
||||||
<span v-if="!loading">登 录</span>
|
<span v-if="!loading">登 录</span>
|
||||||
<span v-else>登 录 中...</span>
|
<span v-else>登 录 中...</span>
|
||||||
@@ -86,99 +243,113 @@
|
|||||||
</el-form>
|
</el-form>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- 图形验证码 -->
|
|
||||||
<Verify ref="verify" :captcha-type="'blockPuzzle'" :img-size="{ width: '400px', height: '200px' }"
|
|
||||||
@success="handleLogin" />
|
|
||||||
|
|
||||||
<!-- footer -->
|
<!-- footer -->
|
||||||
<div class="footer">
|
<div class="footer">
|
||||||
Copyright © 2023 中建材智能自动化院 All Rights Reserved.
|
Copyright © 2023 中建材智能自动化院 All Rights Reserved.
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- 图形验证码 -->
|
||||||
|
<Verify
|
||||||
|
ref="verify"
|
||||||
|
:captcha-type="'blockPuzzle'"
|
||||||
|
:img-size="{ width: '400px', height: '200px' }"
|
||||||
|
@success="handleLogin" />
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { sendSmsCode, socialAuthRedirect } from "@/api/login";
|
import { sendSmsCode, socialAuthRedirect } from '@/api/login';
|
||||||
import { getTenantIdByName } from "@/api/system/tenant";
|
import { getTenantIdByName } from '@/api/system/tenant';
|
||||||
import { SystemUserSocialTypeEnum } from "@/utils/constants";
|
import { SystemUserSocialTypeEnum } from '@/utils/constants';
|
||||||
import { getCaptchaEnable, getTenantEnable } from "@/utils/ruoyi";
|
import { getCaptchaEnable, getTenantEnable } from '@/utils/ruoyi';
|
||||||
import {
|
import {
|
||||||
getPassword,
|
getPassword,
|
||||||
getRememberMe, getTenantName,
|
getRememberMe,
|
||||||
|
getTenantName,
|
||||||
getUsername,
|
getUsername,
|
||||||
removePassword, removeRememberMe, removeTenantName,
|
removePassword,
|
||||||
|
removeRememberMe,
|
||||||
|
removeTenantName,
|
||||||
removeUsername,
|
removeUsername,
|
||||||
setPassword, setRememberMe, setTenantId, setTenantName,
|
setPassword,
|
||||||
setUsername
|
setRememberMe,
|
||||||
} from "@/utils/auth";
|
setTenantId,
|
||||||
|
setTenantName,
|
||||||
|
setUsername,
|
||||||
|
} from '@/utils/auth';
|
||||||
|
|
||||||
import Verify from '@/components/Verifition/Verify';
|
import Verify from '@/components/Verifition/Verify';
|
||||||
import { resetUserPwd } from "@/api/system/user";
|
import { resetUserPwd } from '@/api/system/user';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "Login",
|
name: 'Login',
|
||||||
components: {
|
components: {
|
||||||
Verify
|
Verify,
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
codeUrl: "",
|
codeUrl: '',
|
||||||
captchaEnable: true,
|
captchaEnable: true,
|
||||||
tenantEnable: true,
|
tenantEnable: true,
|
||||||
mobileCodeTimer: 0,
|
mobileCodeTimer: 0,
|
||||||
loginForm: {
|
loginForm: {
|
||||||
loginType: "uname",
|
loginType: 'uname',
|
||||||
username: "admin",
|
username: 'admin',
|
||||||
password: "admin123",
|
password: 'admin123',
|
||||||
captchaVerification: "",
|
captchaVerification: '',
|
||||||
mobile: "",
|
mobile: '',
|
||||||
mobileCode: "",
|
mobileCode: '',
|
||||||
rememberMe: false,
|
rememberMe: false,
|
||||||
tenantName: "技术中心",
|
tenantName: '技术中心',
|
||||||
},
|
},
|
||||||
scene: 21,
|
scene: 21,
|
||||||
|
|
||||||
LoginRules: {
|
LoginRules: {
|
||||||
username: [
|
username: [
|
||||||
{ required: true, trigger: "blur", message: "用户名不能为空" }
|
{ required: true, trigger: 'blur', message: '用户名不能为空' },
|
||||||
],
|
],
|
||||||
password: [
|
password: [
|
||||||
{ required: true, trigger: "blur", message: "密码不能为空" }
|
{ required: true, trigger: 'blur', message: '密码不能为空' },
|
||||||
],
|
],
|
||||||
mobile: [
|
mobile: [
|
||||||
{ required: true, trigger: "blur", message: "手机号不能为空" },
|
{ required: true, trigger: 'blur', message: '手机号不能为空' },
|
||||||
{
|
{
|
||||||
validator: function (rule, value, callback) {
|
validator: function (rule, value, callback) {
|
||||||
if (/^(?:(?:\+|00)86)?1(?:3[\d]|4[5-79]|5[0-35-9]|6[5-7]|7[0-8]|8[\d]|9[189])\d{8}$/.test(value) === false) {
|
if (
|
||||||
callback(new Error("手机号格式错误"));
|
/^(?:(?:\+|00)86)?1(?:3[\d]|4[5-79]|5[0-35-9]|6[5-7]|7[0-8]|8[\d]|9[189])\d{8}$/.test(
|
||||||
|
value
|
||||||
|
) === false
|
||||||
|
) {
|
||||||
|
callback(new Error('手机号格式错误'));
|
||||||
} else {
|
} else {
|
||||||
callback();
|
callback();
|
||||||
}
|
}
|
||||||
}, trigger: "blur"
|
},
|
||||||
}
|
trigger: 'blur',
|
||||||
|
},
|
||||||
],
|
],
|
||||||
tenantName: [
|
tenantName: [
|
||||||
{ required: true, trigger: "blur", message: "租户不能为空" },
|
{ required: true, trigger: 'blur', message: '租户不能为空' },
|
||||||
{
|
{
|
||||||
validator: (rule, value, callback) => {
|
validator: (rule, value, callback) => {
|
||||||
// debugger
|
// debugger
|
||||||
getTenantIdByName(value).then(res => {
|
getTenantIdByName(value).then((res) => {
|
||||||
const tenantId = res.data;
|
const tenantId = res.data;
|
||||||
if (tenantId && tenantId >= 0) {
|
if (tenantId && tenantId >= 0) {
|
||||||
// 设置租户
|
// 设置租户
|
||||||
setTenantId(tenantId)
|
setTenantId(tenantId);
|
||||||
callback();
|
callback();
|
||||||
} else {
|
} else {
|
||||||
callback('租户不存在');
|
callback('租户不存在');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
trigger: 'blur'
|
trigger: 'blur',
|
||||||
}
|
},
|
||||||
]
|
],
|
||||||
},
|
},
|
||||||
loading: false,
|
loading: false,
|
||||||
redirect: undefined,
|
redirect: undefined,
|
||||||
@@ -190,30 +361,33 @@ export default {
|
|||||||
// 租户开关
|
// 租户开关
|
||||||
this.tenantEnable = getTenantEnable();
|
this.tenantEnable = getTenantEnable();
|
||||||
if (this.tenantEnable) {
|
if (this.tenantEnable) {
|
||||||
getTenantIdByName(this.loginForm.tenantName).then(res => { // 设置租户
|
getTenantIdByName(this.loginForm.tenantName).then((res) => {
|
||||||
|
// 设置租户
|
||||||
const tenantId = res.data;
|
const tenantId = res.data;
|
||||||
if (tenantId && tenantId >= 0) {
|
if (tenantId && tenantId >= 0) {
|
||||||
setTenantId(tenantId)
|
setTenantId(tenantId);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
// 验证码开关
|
// 验证码开关
|
||||||
this.captchaEnable = getCaptchaEnable();
|
this.captchaEnable = getCaptchaEnable();
|
||||||
// 重定向地址
|
// 重定向地址
|
||||||
this.redirect = this.$route.query.redirect ? decodeURIComponent(this.$route.query.redirect) : undefined;
|
this.redirect = this.$route.query.redirect
|
||||||
|
? decodeURIComponent(this.$route.query.redirect)
|
||||||
|
: undefined;
|
||||||
this.getCookie();
|
this.getCookie();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
getCode() {
|
getCode() {
|
||||||
// 情况一,未开启:则直接登录
|
// 情况一,未开启:则直接登录
|
||||||
if (!this.captchaEnable) {
|
if (!this.captchaEnable) {
|
||||||
this.handleLogin({})
|
this.handleLogin({});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 情况二,已开启:则展示验证码;只有完成验证码的情况,才进行登录
|
// 情况二,已开启:则展示验证码;只有完成验证码的情况,才进行登录
|
||||||
// 弹出验证码
|
// 弹出验证码
|
||||||
this.$refs.verify.show()
|
this.$refs.verify.show();
|
||||||
},
|
},
|
||||||
getCookie() {
|
getCookie() {
|
||||||
const username = getUsername();
|
const username = getUsername();
|
||||||
@@ -229,28 +403,34 @@ export default {
|
|||||||
};
|
};
|
||||||
},
|
},
|
||||||
handleLogin(captchaParams) {
|
handleLogin(captchaParams) {
|
||||||
this.$refs.loginForm.validate(valid => {
|
this.$refs.loginForm.validate((valid) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
// 设置 Cookie
|
// 设置 Cookie
|
||||||
if (this.loginForm.rememberMe) {
|
if (this.loginForm.rememberMe) {
|
||||||
setUsername(this.loginForm.username)
|
setUsername(this.loginForm.username);
|
||||||
setPassword(this.loginForm.password)
|
setPassword(this.loginForm.password);
|
||||||
setRememberMe(this.loginForm.rememberMe)
|
setRememberMe(this.loginForm.rememberMe);
|
||||||
setTenantName(this.loginForm.tenantName)
|
setTenantName(this.loginForm.tenantName);
|
||||||
} else {
|
} else {
|
||||||
removeUsername()
|
removeUsername();
|
||||||
removePassword()
|
removePassword();
|
||||||
removeRememberMe()
|
removeRememberMe();
|
||||||
removeTenantName()
|
removeTenantName();
|
||||||
}
|
}
|
||||||
this.loginForm.captchaVerification = captchaParams.captchaVerification
|
this.loginForm.captchaVerification =
|
||||||
|
captchaParams.captchaVerification;
|
||||||
// 发起登陆
|
// 发起登陆
|
||||||
// console.log("发起登录", this.loginForm);
|
// console.log("发起登录", this.loginForm);
|
||||||
this.$store.dispatch(this.loginForm.loginType === "sms" ? "SmsLogin" : "Login", this.loginForm).then(() => {
|
this.$store
|
||||||
this.$router.push({ path: this.redirect || "/" }).catch(() => {
|
.dispatch(
|
||||||
});
|
this.loginForm.loginType === 'sms' ? 'SmsLogin' : 'Login',
|
||||||
}).catch(() => {
|
this.loginForm
|
||||||
|
)
|
||||||
|
.then(() => {
|
||||||
|
this.$router.push({ path: this.redirect || '/' }).catch(() => {});
|
||||||
|
})
|
||||||
|
.catch(() => {
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -261,34 +441,46 @@ export default {
|
|||||||
this.loading = true;
|
this.loading = true;
|
||||||
let tenant = false;
|
let tenant = false;
|
||||||
if (this.tenantEnable) {
|
if (this.tenantEnable) {
|
||||||
await this.$prompt('请输入租户名称', "提示", {
|
await this.$prompt('请输入租户名称', '提示', {
|
||||||
confirmButtonText: "确定",
|
confirmButtonText: '确定',
|
||||||
cancelButtonText: "取消"
|
cancelButtonText: '取消',
|
||||||
}).then(async ({ value }) => {
|
})
|
||||||
await getTenantIdByName(value).then(res => {
|
.then(async ({ value }) => {
|
||||||
|
await getTenantIdByName(value).then((res) => {
|
||||||
const tenantId = res.data;
|
const tenantId = res.data;
|
||||||
tenant = true
|
tenant = true;
|
||||||
if (tenantId && tenantId >= 0) {
|
if (tenantId && tenantId >= 0) {
|
||||||
setTenantId(tenantId)
|
setTenantId(tenantId);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}).catch(() => {
|
})
|
||||||
|
.catch(() => {
|
||||||
// 取消登录按钮 loading状态
|
// 取消登录按钮 loading状态
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
|
|
||||||
return false
|
return false;
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
tenant = true
|
tenant = true;
|
||||||
}
|
}
|
||||||
if (tenant) {
|
if (tenant) {
|
||||||
// 计算 redirectUri
|
// 计算 redirectUri
|
||||||
const redirectUri = location.origin + '/social-login?'
|
const redirectUri =
|
||||||
+ encodeURIComponent('type=' + socialTypeEnum.type + '&redirect=' + (this.redirect || "/")); // 重定向不能丢
|
location.origin +
|
||||||
|
'/social-login?' +
|
||||||
|
encodeURIComponent(
|
||||||
|
'type=' +
|
||||||
|
socialTypeEnum.type +
|
||||||
|
'&redirect=' +
|
||||||
|
(this.redirect || '/')
|
||||||
|
); // 重定向不能丢
|
||||||
// const redirectUri = 'http://127.0.0.1:48080/api/gitee/callback';
|
// const redirectUri = 'http://127.0.0.1:48080/api/gitee/callback';
|
||||||
// const redirectUri = 'http://127.0.0.1:48080/api/dingtalk/callback';
|
// const redirectUri = 'http://127.0.0.1:48080/api/dingtalk/callback';
|
||||||
// 进行跳转
|
// 进行跳转
|
||||||
socialAuthRedirect(socialTypeEnum.type, encodeURIComponent(redirectUri)).then((res) => {
|
socialAuthRedirect(
|
||||||
|
socialTypeEnum.type,
|
||||||
|
encodeURIComponent(redirectUri)
|
||||||
|
).then((res) => {
|
||||||
// console.log(res.url);
|
// console.log(res.url);
|
||||||
window.location.href = res.data;
|
window.location.href = res.data;
|
||||||
});
|
});
|
||||||
@@ -297,10 +489,15 @@ export default {
|
|||||||
/** ========== 以下为升级短信登录 ========== */
|
/** ========== 以下为升级短信登录 ========== */
|
||||||
getSmsCode() {
|
getSmsCode() {
|
||||||
if (this.mobileCodeTimer > 0) return;
|
if (this.mobileCodeTimer > 0) return;
|
||||||
this.$refs.loginForm.validate(valid => {
|
this.$refs.loginForm.validate((valid) => {
|
||||||
if (!valid) return;
|
if (!valid) return;
|
||||||
sendSmsCode(this.loginForm.mobile, this.scene, this.loginForm.uuid, this.loginForm.code).then(res => {
|
sendSmsCode(
|
||||||
this.$modal.msgSuccess("获取验证码成功")
|
this.loginForm.mobile,
|
||||||
|
this.scene,
|
||||||
|
this.loginForm.uuid,
|
||||||
|
this.loginForm.code
|
||||||
|
).then((res) => {
|
||||||
|
this.$modal.msgSuccess('获取验证码成功');
|
||||||
this.mobileCodeTimer = 60;
|
this.mobileCodeTimer = 60;
|
||||||
let msgTimer = setInterval(() => {
|
let msgTimer = setInterval(() => {
|
||||||
this.mobileCodeTimer = this.mobileCodeTimer - 1;
|
this.mobileCodeTimer = this.mobileCodeTimer - 1;
|
||||||
@@ -310,13 +507,12 @@ export default {
|
|||||||
}, 1000);
|
}, 1000);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
@import "~@/assets/styles/login.scss";
|
@import '~@/assets/styles/login.scss';
|
||||||
|
|
||||||
|
|
||||||
.oauth-login {
|
.oauth-login {
|
||||||
display: flex;
|
display: flex;
|
||||||
@@ -344,4 +540,5 @@ export default {
|
|||||||
:deep(.el-input__prefix) {
|
:deep(.el-input__prefix) {
|
||||||
top: 22%;
|
top: 22%;
|
||||||
}
|
}
|
||||||
}</style>
|
}
|
||||||
|
</style>
|
||||||
|
|||||||
@@ -77,7 +77,6 @@ export default {
|
|||||||
label: '设备名称',
|
label: '设备名称',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
width: 128,
|
|
||||||
prop: 'equipmentCode',
|
prop: 'equipmentCode',
|
||||||
label: '设备编码',
|
label: '设备编码',
|
||||||
},
|
},
|
||||||
@@ -216,7 +215,7 @@ export default {
|
|||||||
/** 根据产线获取设备 */
|
/** 根据产线获取设备 */
|
||||||
async getEquipmentList(id) {
|
async getEquipmentList(id) {
|
||||||
const { data } = await this.$axios({
|
const { data } = await this.$axios({
|
||||||
url: '/base/core-equipment/listByLine',
|
url: '/base/equipment/listByLine',
|
||||||
method: 'get',
|
method: 'get',
|
||||||
params: { id },
|
params: { id },
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,243 +0,0 @@
|
|||||||
<template>
|
|
||||||
<el-form ref="orderAddForm" :rules="rules" label-width="130px" :model="form">
|
|
||||||
<el-row>
|
|
||||||
<el-col :span='12'>
|
|
||||||
<el-form-item label="订单名称" prop="name">
|
|
||||||
<el-input v-model="form.name"></el-input>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span='12'>
|
|
||||||
<el-form-item label="订单号" prop="code">
|
|
||||||
<el-input v-model="form.code" disabled></el-input>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
<el-row>
|
|
||||||
<el-col :span='12'>
|
|
||||||
<el-form-item label="计划加工数量" prop="planQuantity">
|
|
||||||
<el-input-number v-model="form.planQuantity" :min="0" :max="9999999999999" style="width: 100%;"></el-input-number>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span='12'>
|
|
||||||
<el-form-item label="产品名称" prop="planProductId">
|
|
||||||
<el-select v-model="form.planProductId" placeholder="请选择" style="width: 100%;">
|
|
||||||
<el-option
|
|
||||||
v-for="item in productList"
|
|
||||||
:key="item.id"
|
|
||||||
:label="item.name"
|
|
||||||
:value="item.id">
|
|
||||||
</el-option>
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
<el-row>
|
|
||||||
<el-col :span='12'>
|
|
||||||
<el-form-item label="单价" prop="price">
|
|
||||||
<el-input-number v-model="form.price" :min="0" :max="9999999999999" :precision='2' style="width: 100%;"></el-input-number>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span='12'>
|
|
||||||
<el-form-item label="产品规格" prop="productSpec">
|
|
||||||
<el-input v-model="form.productSpec" disabled></el-input>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
<el-row>
|
|
||||||
<el-col :span='12'>
|
|
||||||
<el-form-item label="客户" prop="customerId">
|
|
||||||
<el-select v-model="form.customerId" placeholder="请选择" style="width: 100%;">
|
|
||||||
<el-option
|
|
||||||
v-for="item in customerList"
|
|
||||||
:key="item.value"
|
|
||||||
:label="item.label"
|
|
||||||
:value="item.value">
|
|
||||||
</el-option>
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span='12'>
|
|
||||||
<el-form-item label="优先级" prop="priority">
|
|
||||||
<el-select v-model="form.priority" placeholder="请选择" style="width: 100%;">
|
|
||||||
<el-option
|
|
||||||
v-for="item in getDictDatas(DICT_TYPE.ORDER_PRIORITY)"
|
|
||||||
:key="item.value"
|
|
||||||
:label="item.label"
|
|
||||||
:value="item.value">
|
|
||||||
</el-option>
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
<el-row>
|
|
||||||
<el-col :span='12'>
|
|
||||||
<el-form-item label="包装规格" prop="packSpec">
|
|
||||||
<el-input v-model="form.packSpec" disabled></el-input>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span='12'>
|
|
||||||
<el-form-item label="负责人" prop="workers">
|
|
||||||
<el-input v-model="form.workers"></el-input>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
<el-row>
|
|
||||||
<el-col :span='12'>
|
|
||||||
<el-form-item label="关联工艺" prop="processFlowId">
|
|
||||||
<el-select v-model="form.processFlowId" placeholder="请选择" style="width: 100%;">
|
|
||||||
<el-option
|
|
||||||
v-for="item in customerList"
|
|
||||||
: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="materialMethod">
|
|
||||||
<el-radio-group v-model="form.materialMethod">
|
|
||||||
<el-radio :label="1">产品基础</el-radio>
|
|
||||||
<el-radio :label="2">工艺扩展</el-radio>
|
|
||||||
</el-radio-group>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
<el-row>
|
|
||||||
<el-col :span='12'>
|
|
||||||
<el-form-item label="订单计划开始时间" prop="planStartTime">
|
|
||||||
<el-date-picker
|
|
||||||
v-model="form.planStartTime"
|
|
||||||
type="date"
|
|
||||||
style="width: 100%;"
|
|
||||||
placeholder="选择日期">
|
|
||||||
</el-date-picker>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span='12'>
|
|
||||||
<el-form-item label="订单计划完成时间" prop="planFinishTime">
|
|
||||||
<el-date-picker
|
|
||||||
v-model="form.planFinishTime"
|
|
||||||
type="date"
|
|
||||||
style="width: 100%;"
|
|
||||||
placeholder="选择日期">
|
|
||||||
</el-date-picker>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
<el-row>
|
|
||||||
<el-col :span='24'>
|
|
||||||
<el-form-item label="备注" prop="remark">
|
|
||||||
<el-input v-model="form.remark"></el-input>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
<el-row>
|
|
||||||
<el-col :span='24'>
|
|
||||||
<el-form-item label="描述信息" prop="description">
|
|
||||||
<el-input v-model="form.description"></el-input>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
</el-form>
|
|
||||||
</template>
|
|
||||||
<script>
|
|
||||||
import { getOrderCode, getOrderById } from '@/api/base/orderManage'
|
|
||||||
import { getProductAll } from '@/api/base/product'
|
|
||||||
import { getCustomerList } from '@/api/base/customer'
|
|
||||||
export default {
|
|
||||||
name: 'OrderAdd',
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
form: {
|
|
||||||
id: '',
|
|
||||||
name: '',
|
|
||||||
code: '',
|
|
||||||
planQuantity: '',
|
|
||||||
planProductId: '',
|
|
||||||
price: '',
|
|
||||||
productSpec: '',
|
|
||||||
customerId: '',
|
|
||||||
priority: '',
|
|
||||||
packSpec: '',
|
|
||||||
workers: '',
|
|
||||||
processFlowId: '',
|
|
||||||
materialMethod: '1',
|
|
||||||
planStartTime: '',
|
|
||||||
planFinishTime: '',
|
|
||||||
remark: '',
|
|
||||||
description: ''
|
|
||||||
},
|
|
||||||
rules: {
|
|
||||||
name: [{ required: true, message: "订单名称不能为空", trigger: "blur" }],
|
|
||||||
planQuantity: [{ required: true, message: "计划加工数量不能为空", trigger: "blur" }],
|
|
||||||
planProductId: [{ required: true, message: "产品名称不能为空", trigger: "change" }]
|
|
||||||
},
|
|
||||||
productList: [],
|
|
||||||
customerList: [],
|
|
||||||
isEdit: false //是否是编辑
|
|
||||||
}
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
init(id) {
|
|
||||||
this.getList()
|
|
||||||
if (id) {
|
|
||||||
this.isEdit = true
|
|
||||||
this.form.id = id
|
|
||||||
getOrderById(id).then(res => {
|
|
||||||
if (res.code === 0) {
|
|
||||||
this.form = res.data
|
|
||||||
// this.selectLeader()
|
|
||||||
}
|
|
||||||
})
|
|
||||||
} else {
|
|
||||||
this.isEdit = false
|
|
||||||
this.form.id = ''
|
|
||||||
// 订单号
|
|
||||||
getOrderCode().then(res => {
|
|
||||||
this.form.code = res.data || ''
|
|
||||||
})
|
|
||||||
}
|
|
||||||
},
|
|
||||||
getList() {
|
|
||||||
// 产品
|
|
||||||
getProductAll().then(res => {
|
|
||||||
this.productList = res.data || []
|
|
||||||
})
|
|
||||||
// 客户
|
|
||||||
getCustomerList().then(res => {
|
|
||||||
this.customerList = res.data || []
|
|
||||||
})
|
|
||||||
// 工艺
|
|
||||||
},
|
|
||||||
submitForm() {
|
|
||||||
this.$refs['orderAddForm'].validate((valid) => {
|
|
||||||
if (valid) {
|
|
||||||
if (this.isEdit) {
|
|
||||||
//编辑
|
|
||||||
updateGroupTeam({ ...this.form }).then((res) => {
|
|
||||||
if (res.code === 0) {
|
|
||||||
this.$modal.msgSuccess("操作成功");
|
|
||||||
this.$emit('successSubmit')
|
|
||||||
}
|
|
||||||
})
|
|
||||||
} else {
|
|
||||||
createGroupTeam({ ...this.form }).then((res) => {
|
|
||||||
if (res.code === 0) {
|
|
||||||
this.$modal.msgSuccess("操作成功");
|
|
||||||
this.$emit('successSubmit')
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
})
|
|
||||||
},
|
|
||||||
formClear() {
|
|
||||||
this.$refs.orderAddForm.resetFields()
|
|
||||||
this.isEdit = false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
@@ -1,244 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div class="app-container">
|
|
||||||
<!-- 搜索工作栏 -->
|
|
||||||
<search-bar
|
|
||||||
:formConfigs="formConfig"
|
|
||||||
ref="searchBarForm"
|
|
||||||
@headBtnClick="buttonClick"
|
|
||||||
/>
|
|
||||||
<!-- 列表 -->
|
|
||||||
<base-table
|
|
||||||
:page="queryParams.pageNo"
|
|
||||||
:limit="queryParams.pageSize"
|
|
||||||
:table-props="tableProps"
|
|
||||||
:table-data="list"
|
|
||||||
:max-height="tableH"
|
|
||||||
>
|
|
||||||
<method-btn
|
|
||||||
v-if="tableBtn.length"
|
|
||||||
slot="handleBtn"
|
|
||||||
:width="80"
|
|
||||||
label="操作"
|
|
||||||
:method-list="tableBtn"
|
|
||||||
@clickBtn="handleClick"
|
|
||||||
/>
|
|
||||||
</base-table>
|
|
||||||
<pagination
|
|
||||||
:page.sync="queryParams.pageNo"
|
|
||||||
:limit.sync="queryParams.pageSize"
|
|
||||||
:total="total"
|
|
||||||
@pagination="getList"
|
|
||||||
/>
|
|
||||||
<!-- 新增&编辑 -->
|
|
||||||
<base-dialog
|
|
||||||
:dialogTitle="addOrEditTitle"
|
|
||||||
:dialogVisible="centervisible"
|
|
||||||
@cancel="handleCancel"
|
|
||||||
@confirm="handleConfirm"
|
|
||||||
:before-close="handleCancel"
|
|
||||||
width='70%'
|
|
||||||
>
|
|
||||||
<order-add ref="orderAdd" @successSubmit="successSubmit" />
|
|
||||||
</base-dialog>
|
|
||||||
<!-- 查看详情 -->
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
<script>
|
|
||||||
import { parseTime } from '@/utils/ruoyi'
|
|
||||||
import { getOrderPage } from '@/api/base/orderManage'
|
|
||||||
import OrderAdd from './components/orderAdd.vue'
|
|
||||||
const tableProps = [
|
|
||||||
{
|
|
||||||
prop: 'createTime',
|
|
||||||
label: '添加时间',
|
|
||||||
filter: parseTime,
|
|
||||||
minWidth: 150
|
|
||||||
},
|
|
||||||
{
|
|
||||||
prop: 'name',
|
|
||||||
label: '订单名称'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
prop: 'code',
|
|
||||||
label: '订单编码',
|
|
||||||
minWidth: 220
|
|
||||||
},
|
|
||||||
{
|
|
||||||
prop: 'num',
|
|
||||||
label: '客户'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
prop: 'leaderName',
|
|
||||||
label: '来源'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
prop: 'leaderName1',
|
|
||||||
label: '优先级'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
prop: 'leaderNam1e',
|
|
||||||
label: '订单状态'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
prop: 'leaderName3',
|
|
||||||
label: '计划加工量'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
prop: 'leaderName9',
|
|
||||||
label: '实际加工量'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
prop: 'leaderN4ame',
|
|
||||||
label: '产品'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
prop: 'leade2rName',
|
|
||||||
label: '单位'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
prop: 'leaderN11ame',
|
|
||||||
label: '单价(元)'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
prop: 'leaderName22',
|
|
||||||
label: '工单数量'
|
|
||||||
}
|
|
||||||
]
|
|
||||||
export default {
|
|
||||||
name: 'OrderManage',
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
formConfig: [
|
|
||||||
{
|
|
||||||
type: 'input',
|
|
||||||
label: '订单名称',
|
|
||||||
placeholder: '订单名称',
|
|
||||||
param: 'name'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
type: 'select',
|
|
||||||
label: '状态',
|
|
||||||
selectOptions: this.getDictDatas(this.DICT_TYPE.ORDER_STATUS),
|
|
||||||
labelField: 'label',
|
|
||||||
valueField: 'value',
|
|
||||||
param: 'status'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
type: 'datePicker',
|
|
||||||
label: '时间段',
|
|
||||||
dateType: 'daterange',
|
|
||||||
format: 'yyyy-MM-dd',
|
|
||||||
valueFormat: "yyyy-MM-dd",
|
|
||||||
rangeSeparator: '-',
|
|
||||||
startPlaceholder: '开始时间',
|
|
||||||
endPlaceholder: '结束时间',
|
|
||||||
param: 'timeVal',
|
|
||||||
defaultSelect: [],
|
|
||||||
width: 250
|
|
||||||
},
|
|
||||||
{
|
|
||||||
type: 'button',
|
|
||||||
btnName: '查询',
|
|
||||||
name: 'search',
|
|
||||||
color: 'primary'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
type: 'separate'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
type: 'button',
|
|
||||||
btnName: '新增',
|
|
||||||
name: 'add',
|
|
||||||
color: 'success',
|
|
||||||
plain: true
|
|
||||||
}
|
|
||||||
],
|
|
||||||
// 查询参数
|
|
||||||
queryParams: {
|
|
||||||
pageNo: 1,
|
|
||||||
pageSize: 20,
|
|
||||||
name: null,
|
|
||||||
status: null,
|
|
||||||
lastIssuedTime: []
|
|
||||||
},
|
|
||||||
total: 0,
|
|
||||||
tableProps,
|
|
||||||
list: [],
|
|
||||||
tableH: this.tableHeight(260),
|
|
||||||
tableBtn: [
|
|
||||||
this.$auth.hasPermi('base:group-team:update')
|
|
||||||
? {
|
|
||||||
type: 'edit',
|
|
||||||
btnName: '编辑'
|
|
||||||
}
|
|
||||||
: undefined,
|
|
||||||
this.$auth.hasPermi('base:group-team:delete')
|
|
||||||
? {
|
|
||||||
type: 'delete',
|
|
||||||
btnName: '删除'
|
|
||||||
}
|
|
||||||
: undefined
|
|
||||||
].filter((v) => v),
|
|
||||||
addOrEditTitle: '',
|
|
||||||
centervisible: false
|
|
||||||
}
|
|
||||||
},
|
|
||||||
components: { OrderAdd },
|
|
||||||
created() {
|
|
||||||
window.addEventListener('resize', () => {
|
|
||||||
this.tableH = this.tableHeight(260)
|
|
||||||
})
|
|
||||||
this.getList();
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
getList() {
|
|
||||||
getOrderPage({...this.queryParams}).then(res => {
|
|
||||||
console.log(res)
|
|
||||||
})
|
|
||||||
},
|
|
||||||
buttonClick(val) {
|
|
||||||
console.log(val)
|
|
||||||
if (val.btnName === 'search') {
|
|
||||||
this.queryParams.name = val.name
|
|
||||||
this.queryParams.status = val.status
|
|
||||||
if (val.timeVal.length > 0) {
|
|
||||||
this.queryParams.lastIssuedTime[0] = val.timeVal[0] + ' 00:00:00'
|
|
||||||
this.queryParams.lastIssuedTime[1] = val.timeVal[1] + ' 23:59:59'
|
|
||||||
} else {
|
|
||||||
this.queryParams.lastIssuedTime = []
|
|
||||||
}
|
|
||||||
this.getList()
|
|
||||||
} else {
|
|
||||||
this.addOrEditTitle = '新增'
|
|
||||||
this.centervisible = true
|
|
||||||
}
|
|
||||||
},
|
|
||||||
handleClick(val) {
|
|
||||||
switch (val.type) {
|
|
||||||
case 'edit':
|
|
||||||
this.addOrEditTitle = '编辑'
|
|
||||||
this.$nextTick(() => {
|
|
||||||
this.$refs.groupList.init(val.data.id)
|
|
||||||
})
|
|
||||||
this.centervisible = true
|
|
||||||
break
|
|
||||||
default:
|
|
||||||
this.handleDelete(val.data)
|
|
||||||
}
|
|
||||||
},
|
|
||||||
// 新增
|
|
||||||
handleCancel() {
|
|
||||||
this.$refs.orderAdd.formClear()
|
|
||||||
this.centervisible = false
|
|
||||||
this.addOrEditTitle = ''
|
|
||||||
},
|
|
||||||
handleConfirm() {
|
|
||||||
this.$refs.orderAdd.submitForm()
|
|
||||||
},
|
|
||||||
successSubmit() {
|
|
||||||
this.handleCancel()
|
|
||||||
this.getList()
|
|
||||||
},
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
@@ -42,7 +42,7 @@
|
|||||||
<DialogForm
|
<DialogForm
|
||||||
v-if="open"
|
v-if="open"
|
||||||
ref="form"
|
ref="form"
|
||||||
:dataForm="form"
|
v-model="form"
|
||||||
:rows="[
|
:rows="[
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -40,7 +40,7 @@
|
|||||||
<DialogForm
|
<DialogForm
|
||||||
v-if="open"
|
v-if="open"
|
||||||
ref="form"
|
ref="form"
|
||||||
:dataForm="form"
|
v-model="form"
|
||||||
:rows="[
|
:rows="[
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ module.exports = {
|
|||||||
proxy: {
|
proxy: {
|
||||||
// detail: https://cli.vuejs.org/config/#devserver-proxy
|
// detail: https://cli.vuejs.org/config/#devserver-proxy
|
||||||
['/proxy-api']: {
|
['/proxy-api']: {
|
||||||
target: `http://localhost:80`,
|
target: `http://localhost:48080`,
|
||||||
// target: `http://api-dashboard.yudao.iocoder.cn`,
|
// target: `http://api-dashboard.yudao.iocoder.cn`,
|
||||||
changeOrigin: true,
|
changeOrigin: true,
|
||||||
pathRewrite: {
|
pathRewrite: {
|
||||||
|
|||||||
37
yarn.lock
37
yarn.lock
@@ -19,28 +19,6 @@
|
|||||||
"@jridgewell/gen-mapping" "^0.3.0"
|
"@jridgewell/gen-mapping" "^0.3.0"
|
||||||
"@jridgewell/trace-mapping" "^0.3.9"
|
"@jridgewell/trace-mapping" "^0.3.9"
|
||||||
|
|
||||||
"@antv/x6-common@^2.0.15":
|
|
||||||
"integrity" "sha512-9ghYsxbT7WjQ0thqjcQwnjuBdL8DSTptEubf0DvBZOJ0wmapclXqYPOM+XYPNtC1dcKDqqxsw5mdcbcAmQ224Q=="
|
|
||||||
"resolved" "https://registry.npmmirror.com/@antv/x6-common/-/x6-common-2.0.15.tgz"
|
|
||||||
"version" "2.0.15"
|
|
||||||
dependencies:
|
|
||||||
"lodash-es" "^4.17.15"
|
|
||||||
"utility-types" "^3.10.0"
|
|
||||||
|
|
||||||
"@antv/x6-geometry@^2.0.5":
|
|
||||||
"integrity" "sha512-MId6riEQkxphBpVeTcL4ZNXL4lScyvDEPLyIafvWMcWNTGK0jgkK7N20XSzqt8ltJb0mGUso5s56mrk8ysHu2A=="
|
|
||||||
"resolved" "https://registry.npmmirror.com/@antv/x6-geometry/-/x6-geometry-2.0.5.tgz"
|
|
||||||
"version" "2.0.5"
|
|
||||||
|
|
||||||
"@antv/x6@^2.15.3":
|
|
||||||
"integrity" "sha512-mI8Aqc/0+/ZlXguibnKovGkKy3w7UFg+CMwAq5oYdBrMEgwgvQ/Rw9tK2LOTgKAINv+5QQ9zJTY058Kv1UfeRA=="
|
|
||||||
"resolved" "https://registry.npmmirror.com/@antv/x6/-/x6-2.15.3.tgz"
|
|
||||||
"version" "2.15.3"
|
|
||||||
dependencies:
|
|
||||||
"@antv/x6-common" "^2.0.15"
|
|
||||||
"@antv/x6-geometry" "^2.0.5"
|
|
||||||
"utility-types" "^3.10.0"
|
|
||||||
|
|
||||||
"@babel/code-frame@^7.0.0", "@babel/code-frame@^7.22.5":
|
"@babel/code-frame@^7.0.0", "@babel/code-frame@^7.22.5":
|
||||||
"integrity" "sha512-Xmwn266vad+6DAqEB2A6V/CcZVp62BbwVmcOJc2RPuwih1kw02TjQvWVWlcKGbBPd+8/0V5DEkOcizRGYsspYQ=="
|
"integrity" "sha512-Xmwn266vad+6DAqEB2A6V/CcZVp62BbwVmcOJc2RPuwih1kw02TjQvWVWlcKGbBPd+8/0V5DEkOcizRGYsspYQ=="
|
||||||
"resolved" "https://registry.npmmirror.com/@babel/code-frame/-/code-frame-7.22.5.tgz"
|
"resolved" "https://registry.npmmirror.com/@babel/code-frame/-/code-frame-7.22.5.tgz"
|
||||||
@@ -7005,11 +6983,6 @@
|
|||||||
dependencies:
|
dependencies:
|
||||||
"p-locate" "^4.1.0"
|
"p-locate" "^4.1.0"
|
||||||
|
|
||||||
"lodash-es@^4.17.15":
|
|
||||||
"integrity" "sha512-mKnC+QJ9pWVzv+C4/U3rRsHapFfHvQFoFB92e52xeyGMcX6/OlIl78je1u8vePzYZSkkogMPJ2yjxxsb89cxyw=="
|
|
||||||
"resolved" "https://registry.npmmirror.com/lodash-es/-/lodash-es-4.17.21.tgz"
|
|
||||||
"version" "4.17.21"
|
|
||||||
|
|
||||||
"lodash.debounce@^4.0.8":
|
"lodash.debounce@^4.0.8":
|
||||||
"integrity" "sha512-FT1yDzDYEoYWhnSGnpE/4Kj1fLZkDFyqRb7fNt6FdYOSxlUWAtp42Eh6Wb0rGIv/m9Bgo7x4GhQbm5Ys4SG5ow=="
|
"integrity" "sha512-FT1yDzDYEoYWhnSGnpE/4Kj1fLZkDFyqRb7fNt6FdYOSxlUWAtp42Eh6Wb0rGIv/m9Bgo7x4GhQbm5Ys4SG5ow=="
|
||||||
"resolved" "https://registry.npmmirror.com/lodash.debounce/-/lodash.debounce-4.0.8.tgz"
|
"resolved" "https://registry.npmmirror.com/lodash.debounce/-/lodash.debounce-4.0.8.tgz"
|
||||||
@@ -11017,11 +10990,6 @@
|
|||||||
"resolved" "https://registry.npmmirror.com/utila/-/utila-0.4.0.tgz"
|
"resolved" "https://registry.npmmirror.com/utila/-/utila-0.4.0.tgz"
|
||||||
"version" "0.4.0"
|
"version" "0.4.0"
|
||||||
|
|
||||||
"utility-types@^3.10.0":
|
|
||||||
"integrity" "sha512-O11mqxmi7wMKCo6HKFt5AhO4BwY3VV68YU07tgxfz8zJTIxr4BpsezN49Ffwy9j3ZpwwJp4fkRwjRzq3uWE6Rg=="
|
|
||||||
"resolved" "https://registry.npmmirror.com/utility-types/-/utility-types-3.10.0.tgz"
|
|
||||||
"version" "3.10.0"
|
|
||||||
|
|
||||||
"utils-merge@1.0.1":
|
"utils-merge@1.0.1":
|
||||||
"integrity" "sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA=="
|
"integrity" "sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA=="
|
||||||
"resolved" "https://registry.npmmirror.com/utils-merge/-/utils-merge-1.0.1.tgz"
|
"resolved" "https://registry.npmmirror.com/utils-merge/-/utils-merge-1.0.1.tgz"
|
||||||
@@ -11044,11 +11012,6 @@
|
|||||||
"resolved" "https://registry.npmmirror.com/uuid/-/uuid-8.3.2.tgz"
|
"resolved" "https://registry.npmmirror.com/uuid/-/uuid-8.3.2.tgz"
|
||||||
"version" "8.3.2"
|
"version" "8.3.2"
|
||||||
|
|
||||||
"uuid@^9.0.1":
|
|
||||||
"integrity" "sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA=="
|
|
||||||
"resolved" "https://registry.npmmirror.com/uuid/-/uuid-9.0.1.tgz"
|
|
||||||
"version" "9.0.1"
|
|
||||||
|
|
||||||
"v8-compile-cache@^2.0.3":
|
"v8-compile-cache@^2.0.3":
|
||||||
"integrity" "sha512-l8lCEmLcLYZh4nbunNZvQCJc5pv7+RCwa8q/LdUx8u7lsWvPDKmpodJAJNwkAhJC//dFY48KuIEmjtd4RViDrA=="
|
"integrity" "sha512-l8lCEmLcLYZh4nbunNZvQCJc5pv7+RCwa8q/LdUx8u7lsWvPDKmpodJAJNwkAhJC//dFY48KuIEmjtd4RViDrA=="
|
||||||
"resolved" "https://registry.npmmirror.com/v8-compile-cache/-/v8-compile-cache-2.3.0.tgz"
|
"resolved" "https://registry.npmmirror.com/v8-compile-cache/-/v8-compile-cache-2.3.0.tgz"
|
||||||
|
|||||||
Reference in New Issue
Block a user