Merge branch 'projects/mes-test' into projects/mes-lb

This commit is contained in:
lb 2023-11-13 16:56:07 +08:00
commit 7f6fa0af96
315 changed files with 43038 additions and 1012 deletions

View File

@ -1,8 +1,8 @@
### ###
# @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-30 10:49:39 # @LastEditTime: 2023-11-11 20:50:30
# @LastEditors: zhp # @LastEditors: DY
# @Description: # @Description:
### ###
# 开发环境配置 # 开发环境配置
@ -13,14 +13,14 @@ VUE_APP_TITLE = MES系统
# 芋道管理系统/开发环境 # 芋道管理系统/开发环境
# VUE_APP_BASE_API = 'http://100.64.0.26:48082' # VUE_APP_BASE_API = 'http://100.64.0.26:48082'
VUE_APP_BASE_API = 'http://192.168.0.33:48082' # VUE_APP_BASE_API = 'http://192.168.0.33:48082'
# VUE_APP_BASE_API = 'http://192.168.4.173:48080'
# VUE_APP_BASE_API = 'http://192.168.2.173:48080' # 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.0.33:48082'
# VUE_APP_BASE_API = 'http://192.168.1.56:48080' # VUE_APP_BASE_API = 'http://192.168.1.56:48080'
# VUE_APP_BASE_API = 'http://192.168.1.188:48080' # VUE_APP_BASE_API = 'http://192.168.4.159:48080'
# 路由懒加载 # 路由懒加载
VUE_CLI_BABEL_TRANSPILE_MODULES = true VUE_CLI_BABEL_TRANSPILE_MODULES = true
@ -35,3 +35,4 @@ VUE_APP_DOC_ENABLE = true
# 百度统计 # 百度统计
# VUE_APP_BAIDU_CODE = fadc1bd5db1a1d6f581df60a1807f8ab # VUE_APP_BAIDU_CODE = fadc1bd5db1a1d6f581df60a1807f8ab

View File

@ -1,3 +1,4 @@
# 开发环境配置 # 开发环境配置
ENV = 'development' ENV = 'development'

View File

@ -2,14 +2,14 @@
ENV = 'production' ENV = 'production'
# 页面标题 # 页面标题
VUE_APP_TITLE = 产线监控系统 VUE_APP_TITLE = MES系统
# 芋道管理系统/生产环境 # 芋道管理系统/生产环境
VUE_APP_BASE_API = '/prod-api' VUE_APP_BASE_API = '/prod-api'
# 根据服务器或域名修改 # 根据服务器或域名修改
# PUBLIC_PATH = 'http://my-pi.com:8888/yudao-admin/' # PUBLIC_PATH = 'http://my-pi.com:8888/yudao-admin/'
PUBLIC_PATH = 'http://192.168.0.33:8888/' PUBLIC_PATH = 'http://192.168.0.33:8889/'
# 二级部署路径 # 二级部署路径
VUE_APP_APP_NAME ='yudao-admin' VUE_APP_APP_NAME ='yudao-admin'

12
.env.production Normal file
View File

@ -0,0 +1,12 @@
###
# @Author: zhp
# @Date: 2023-10-30 14:18:30
# @LastEditTime: 2023-11-02 16:16:09
# @LastEditors: zhp
# @Description:
###
# just a flag
ENV = 'production'
# base api
# VUE_APP_BASE_API = '/api'

View File

@ -23,3 +23,4 @@ VUE_APP_DOC_ENABLE = false
# 百度统计 # 百度统计
VUE_APP_BAIDU_CODE = fadc1bd5db1a1d6f581df60a1807f8ab VUE_APP_BAIDU_CODE = fadc1bd5db1a1d6f581df60a1807f8ab

View File

@ -0,0 +1,60 @@
/*
* @Author: Do not edit
* @Date: 2023-10-21 11:50:46
* @LastEditTime: 2023-11-03 15:25:55
* @LastEditors: DY
* @Description:
*/
import request from '@/utils/request'
// 创建异常警告
export function createcoreAlarmLog(data) {
return request({
url: '/base/core-alarm-log/create',
method: 'post',
data: data
})
}
// 更新异常警告
export function updatecoreAlarmLog(data) {
return request({
url: '/base/core-alarm-log/update',
method: 'put',
data: data
})
}
// 删除异常警告
export function deletecoreAlarmLog(id) {
return request({
url: '/base/core-alarm-log/delete?id=' + id,
method: 'delete'
})
}
// 获得异常警告
export function getcoreAlarmLog(id) {
return request({
url: '/base/core-alarm-log/get?id=' + id,
method: 'get'
})
}
// 获得警告分页
export function getcoreAlarmLogPage(query) {
return request({
url: '/base/core-alarm-log/page',
method: 'get',
params: query
})
}
// 获得所有列表
export function getcoreAlarmLogList(query) {
return request({
url: '/base/core-alarm-log/list',
method: 'get',
params: query
})
}

View File

@ -0,0 +1,68 @@
/*
* @Author: Do not edit
* @Date: 2023-10-21 11:50:46
* @LastEditTime: 2023-11-02 20:25:36
* @LastEditors: DY
* @Description:
*/
import request from '@/utils/request'
// 创建客户
export function createCustomer(data) {
return request({
url: '/base/core-customer/create',
method: 'post',
data: data
})
}
// 更新客户
export function updateCustomer(data) {
return request({
url: '/base/core-customer/update',
method: 'put',
data: data
})
}
// 删除客户
export function deleteCustomer(id) {
return request({
url: '/base/core-customer/delete?id=' + id,
method: 'delete'
})
}
// 获得客户
export function getCustomer(id) {
return request({
url: '/base/core-customer/get?id=' + id,
method: 'get'
})
}
// 获得客户code
export function getCode() {
return request({
url: '/base/core-customer/getCode',
method: 'get'
})
}
// 获得客户分页
export function getCustomerPage(query) {
return request({
url: '/base/core-customer/page',
method: 'get',
params: query
})
}
// 获得所有列表
export function getCustomerList(query) {
return request({
url: '/base/core-customer/listAll',
method: 'get',
params: query
})
}

View File

@ -0,0 +1,68 @@
/*
* @Author: Do not edit
* @Date: 2023-10-21 11:50:46
* @LastEditTime: 2023-10-30 14:37:28
* @LastEditors: DY
* @Description:
*/
import request from '@/utils/request'
// 创建部门
export function createCoreDepartment(data) {
return request({
url: '/base/core-department/create',
method: 'post',
data: data
})
}
// 更新部门
export function updateCoreDepartment(data) {
return request({
url: '/base/core-department/update',
method: 'put',
data: data
})
}
// 删除部门
export function deleteCoreDepartment(id) {
return request({
url: '/base/core-department/delete?id=' + id,
method: 'delete'
})
}
// 获得部门
export function getCoreDepartment(id) {
return request({
url: '/base/core-department/get?id=' + id,
method: 'get'
})
}
// 获得部门code
export function getCode() {
return request({
url: '/base/core-department/getCode',
method: 'get'
})
}
// 获得部门分页
export function getCoreDepartmentPage(query) {
return request({
url: '/base/core-department/page',
method: 'get',
params: query
})
}
// 获得所有列表
export function getCoreDepartmentList(query) {
return request({
url: '/base/core-department/listAll',
method: 'get',
params: query
})
}

68
src/api/base/coreMajor.js Normal file
View File

@ -0,0 +1,68 @@
/*
* @Author: Do not edit
* @Date: 2023-10-21 11:50:46
* @LastEditTime: 2023-10-31 15:11:25
* @LastEditors: DY
* @Description:
*/
import request from '@/utils/request'
// 创建专业
export function createCoreMajor(data) {
return request({
url: '/base/core-major/create',
method: 'post',
data: data
})
}
// 更新专业
export function updateCoreMajor(data) {
return request({
url: '/base/core-major/update',
method: 'put',
data: data
})
}
// 删除专业
export function deleteCoreMajor(id) {
return request({
url: '/base/core-major/delete?id=' + id,
method: 'delete'
})
}
// 获得专业
export function getCoreMajor(id) {
return request({
url: '/base/core-major/get?id=' + id,
method: 'get'
})
}
// 获得专业code
export function getCode() {
return request({
url: '/base/core-major/getCode',
method: 'get'
})
}
// 获得专业分页
export function getCoreMajorPage(query) {
return request({
url: '/base/core-major/page',
method: 'get',
params: query
})
}
// 获得所有列表
export function getCoreMajorList(query) {
return request({
url: '/base/core-major/listAll',
method: 'get',
params: query
})
}

111
src/api/base/coreProduct.js Normal file
View File

@ -0,0 +1,111 @@
/*
* @Author: Do not edit
* @Date: 2023-10-21 11:50:46
* @LastEditTime: 2023-11-04 10:42:50
* @LastEditors: DY
* @Description:
*/
import request from '@/utils/request'
// 创建产品
export function createCoreProduct(data) {
return request({
url: '/base/core-product/create',
method: 'post',
data: data
})
}
// 更新产品
export function updateCoreProduct(data) {
return request({
url: '/base/core-product/update',
method: 'put',
data: data
})
}
// 删除产品
export function deleteCoreProduct(id) {
return request({
url: '/base/core-product/delete?id=' + id,
method: 'delete'
})
}
// 获得产品
export function getCoreProduct(id) {
return request({
url: '/base/core-product/get?id=' + id,
method: 'get'
})
}
// 获得产品code
export function getCode() {
return request({
url: '/base/core-product/getCode',
method: 'get'
})
}
// 获得产品分页
export function getCoreProductPage(query) {
return request({
url: '/base/core-product/page',
method: 'get',
params: query
})
}
// 获得所有列表
export function getCoreProductList(query) {
return request({
url: '/base/core-product/listAll',
method: 'get',
params: query
})
}
// 创建产品属性
export function createCoreProductAttr(data) {
return request({
url: '/base/core-product-attr/create',
method: 'post',
data: data
})
}
// 更新产品属性
export function updateCoreProductAttr(data) {
return request({
url: '/base/core-product-attr/update',
method: 'put',
data: data
})
}
// 删除产品属性
export function deleteCoreProductAttr(id) {
return request({
url: '/base/core-product-attr/delete?id=' + id,
method: 'delete'
})
}
// 获得产品属性
export function getCoreProductAttr(id) {
return request({
url: '/base/core-product-attr/get?id=' + id,
method: 'get'
})
}
// 获得产品属性分页
export function getCoreProductAttrPage(query) {
return request({
url: '/base/core-product-attr/page',
method: 'get',
params: query
})
}

View File

@ -0,0 +1,68 @@
/*
* @Author: Do not edit
* @Date: 2023-10-21 11:50:46
* @LastEditTime: 2023-11-03 19:06:15
* @LastEditors: DY
* @Description:
*/
import request from '@/utils/request'
// 创建产线
export function createCorePL(data) {
return request({
url: '/base/core-production-line/create',
method: 'post',
data: data
})
}
// 更新产线
export function updateCorePL(data) {
return request({
url: '/base/core-production-line/update',
method: 'put',
data: data
})
}
// 删除产线
export function deleteCorePL(id) {
return request({
url: '/base/core-production-line/delete?id=' + id,
method: 'delete'
})
}
// 获得产线
export function getCorePL(id) {
return request({
url: '/base/core-production-line/get?id=' + id,
method: 'get'
})
}
// 获得产线code
export function getCode() {
return request({
url: '/base/core-production-line/getCode',
method: 'get'
})
}
// 获得产线分页
export function getCorePLPage(query) {
return request({
url: '/base/core-production-line/page',
method: 'get',
params: query
})
}
// 获得所有列表
export function getCorePLList(query) {
return request({
url: '/base/core-production-line/listAll',
method: 'get',
params: query
})
}

View File

@ -0,0 +1,68 @@
/*
* @Author: Do not edit
* @Date: 2023-10-21 11:50:46
* @LastEditTime: 2023-11-03 10:39:44
* @LastEditors: DY
* @Description:
*/
import request from '@/utils/request'
// 创建供应商
export function createCoreSupplier(data) {
return request({
url: '/base/core-supplier/create',
method: 'post',
data: data
})
}
// 更新供应商
export function updateCoreSupplier(data) {
return request({
url: '/base/core-supplier/update',
method: 'put',
data: data
})
}
// 删除供应商
export function deleteCoreSupplier(id) {
return request({
url: '/base/core-supplier/delete?id=' + id,
method: 'delete'
})
}
// 获得供应商
export function getCoreSupplier(id) {
return request({
url: '/base/core-supplier/get?id=' + id,
method: 'get'
})
}
// 获得供应商code
export function getCode() {
return request({
url: '/base/core-supplier/getCode',
method: 'get'
})
}
// 获得供应商分页
export function getCoreSupplierPage(query) {
return request({
url: '/base/core-supplier/page',
method: 'get',
params: query
})
}
// 获得所有列表
export function getCoreSupplierList(query) {
return request({
url: '/base/core-supplier/listAll',
method: 'get',
params: query
})
}

View File

@ -0,0 +1,138 @@
/*
* @Author: Do not edit
* @Date: 2023-10-21 11:50:46
* @LastEditTime: 2023-11-06 17:49:42
* @LastEditors: DY
* @Description:
*/
import request from '@/utils/request'
// 创建工单
export function createCoreWO(data) {
return request({
url: '/base/core-work-order/create',
method: 'post',
data: data
})
}
// 更新工单
export function updateCoreWO(data) {
return request({
url: '/base/core-work-order/update',
method: 'put',
data: data
})
}
// 删除工单
export function deleteCoreWO(id) {
return request({
url: '/base/core-work-order/delete?id=' + id,
method: 'delete'
})
}
// 获得工单
export function getCoreWO(id) {
return request({
url: '/base/core-work-order/get?id=' + id,
method: 'get'
})
}
// 获得工单code
export function getCode() {
return request({
url: '/base/core-work-order/getCode',
method: 'get'
})
}
// 获得工单分页
export function getCoreWOPage(query) {
return request({
url: '/base/core-work-order/page',
method: 'get',
params: query
})
}
// 获得所有列表
export function getCoreWOList(query) {
return request({
url: '/base/core-work-order/listbyfilter',
method: 'get',
params: query
})
}
// 创建工单预使用原料
export function createCoreWOMa(data) {
return request({
url: '/base/core-work-order-material/create',
method: 'post',
data: data
})
}
// 更新工单预使用原料
export function updateCoreWOMa(data) {
return request({
url: '/base/core-work-order-material/update',
method: 'put',
data: data
})
}
// 删除工单预使用原料
export function deleteCoreWOMa(id) {
return request({
url: '/base/core-work-order-material/delete?id=' + id,
method: 'delete'
})
}
// 获得工单预使用原料
export function getCoreWOMa(id) {
return request({
url: '/base/core-work-order-material/get?id=' + id,
method: 'get'
})
}
// 获得工单预使用原料分页
export function getCoreWOMaPage(query) {
return request({
url: '/base/core-work-order-material/page',
method: 'get',
params: query
})
}
// 获得预计用料信息分页
export function getMaterialBomPage(query) {
return request({
url: '/base/material-product-bom/bomUseNum',
method: 'get',
params: query
})
}
// 获得订单分页
export function getConOrderList(query) {
return request({
url: '/base/order/listConOrder',
method: 'get',
params: query
})
}
// 改变工单状态 激活暂停完成作废
export function statusChange(data) {
return request({
url: '/base/core-work-order/statusChange',
method: 'post',
data: data
})
}

103
src/api/base/coreWorker.js Normal file
View File

@ -0,0 +1,103 @@
/*
* @Author: Do not edit
* @Date: 2023-10-21 11:50:46
* @LastEditTime: 2023-11-02 19:49:52
* @LastEditors: DY
* @Description:
*/
import request from '@/utils/request'
// 创建员工
export function createCoreWorker(data) {
return request({
url: '/base/core-worker/create',
method: 'post',
data: data
})
}
// 更新员工
export function updateCoreWorker(data) {
return request({
url: '/base/core-worker/update',
method: 'put',
data: data
})
}
// 删除员工
export function deleteCoreWorker(id) {
return request({
url: '/base/core-worker/delete?id=' + id,
method: 'delete'
})
}
// 获得员工
export function getCoreWorker(id) {
return request({
url: '/base/core-worker/get?id=' + id,
method: 'get'
})
}
// 获得员工code
export function getCode() {
return request({
url: '/base/core-worker/getCode',
method: 'get'
})
}
// 获得员工分页
export function getCoreWorkerPage(query) {
return request({
url: '/base/core-worker/page',
method: 'get',
params: query
})
}
// 获得所有列表
export function getCoreWorkerList(query) {
return request({
url: '/base/core-worker/listAll',
method: 'get',
params: query
})
}
// 创建员工--专业
export function createWoBindMa(data) {
return request({
url: '/base/core-worker-bind-major/create',
method: 'post',
data: data
})
}
// 更新员工--专业
export function updateWoBindMa(data) {
return request({
url: '/base/core-worker-bind-major/update',
method: 'put',
data: data
})
}
// 删除员工--专业
export function deleteWoBindMa(id) {
return request({
url: '/base/core-worker-bind-major/delete?id=' + id,
method: 'delete'
})
}
// 获得员工--专业分页
export function getWoBindMaPage(query) {
return request({
url: '/base/core-worker-bind-major/page',
method: 'get',
params: query
})
}

View File

@ -0,0 +1,68 @@
/*
* @Author: Do not edit
* @Date: 2023-10-21 11:50:46
* @LastEditTime: 2023-11-03 19:18:00
* @LastEditors: DY
* @Description:
*/
import request from '@/utils/request'
// 创建工段
export function createCWSection(data) {
return request({
url: '/base/core-workshop-section/create',
method: 'post',
data: data
})
}
// 更新工段
export function updateCWSection(data) {
return request({
url: '/base/core-workshop-section/update',
method: 'put',
data: data
})
}
// 删除工段
export function deleteCWSection(id) {
return request({
url: '/base/core-workshop-section/delete?id=' + id,
method: 'delete'
})
}
// 获得工段
export function getCWSection(id) {
return request({
url: '/base/core-workshop-section/get?id=' + id,
method: 'get'
})
}
// 获得工段code
export function getCode() {
return request({
url: '/base/core-workshop-section/getCode',
method: 'get'
})
}
// 获得工段分页
export function getCWSectionPage(query) {
return request({
url: '/base/core-workshop-section/page',
method: 'get',
params: query
})
}
// 获得所有列表
export function getCWSectionList(query) {
return request({
url: '/base/core-workshop-section/listAll',
method: 'get',
params: query
})
}

91
src/api/base/delivery.js Normal file
View File

@ -0,0 +1,91 @@
// 成品发货
import request from '@/utils/request'
// 获得成品发货清单分页
export function deliveryLogPage(data) {
return request({
url: '/extend/delivery-log/page',
method: 'post',
data: data
})
}
// 获取发货进度分页
export function deliveryProgressPage(data) {
return request({
url: '/extend/delivery-progress/page',
method: 'post',
data: data
})
}
// 获取发货进度分页
export function deliveryLogDetPage(data) {
return request({
url: '/extend/delivery-log-det/page',
method: 'post',
data: data
})
}
// 创建成品发货清单
export function deliveryLogCreate(data) {
return request({
url: '/extend/delivery-log/create',
method: 'post',
data: data
})
}
// 更新成品发货清单
export function deliveryLogUpdate(data) {
return request({
url: '/extend/delivery-log/update',
method: 'put',
data: data
})
}
// 获得成品发货清单
export function getDeliveryLog(query) {
return request({
url: '/extend/delivery-log/get',
method: 'get',
params: query
})
}
// 删除成品发货清单
export function deliveryLogDelete(query) {
return request({
url: '/extend/delivery-log/delete',
method: 'delete',
params: query
})
}
// 装车
export function deliveryLogDetCreate(data) {
return request({
url: '/extend/delivery-log-det/create',
method: 'post',
data: data
})
}
// 获得一条发货详细
export function deliveryLogDetGet(query) {
return request({
url: '/extend/delivery-log-det/get',
method: 'get',
params: query
})
}
// 编辑发货详情
export function deliveryLogDetUpdate(data) {
return request({
url: '/extend/delivery-log-det/update',
method: 'put',
data: data
})
}

View File

@ -94,3 +94,56 @@ export function orderIssue(data) {
data: data data: data
}) })
} }
// 获得工单
export function getWorkOrderById(query) {
return request({
url: '/base/core-work-order/get',
method: 'get',
params: query
})
}
// 订单监控
export function orderMonitor(query) {
return request({
url: '/base/order/orderMonitor',
method: 'get',
params: query
})
}
// 获得所有客户列表
export function customerList() {
return request({
url: '/base/core-customer/listAll',
method: 'get'
})
}
// 获得订单详情
export function orderDetail(query) {
return request({
url: '/base/order/getDetail',
method: 'get',
params: query
})
}
// 产品bom消耗信息
export function bomUseNum(query) {
return request({
url: '/base/material-product-bom/bomUseNum',
method: 'get',
params: query
})
}
// 完成订单
export function orderFinish(query) {
return request({
url: '/base/order/finish',
method: 'post',
params: query
})
}

View File

@ -0,0 +1,69 @@
/*
* @Author: zhp
* @Date: 2023-11-06 15:38:12
* @LastEditTime: 2023-11-06 15:39:39
* @LastEditors: zhp
* @Description:
*/
import request from '@/utils/request'
// 创建质量检测类型基础
export function createQualityScrapDet(data) {
return request({
url: '/base/quality-scrap-det/create',
method: 'post',
data: data
})
}
// 更新质量检测类型基础
export function updateQualityScrapDet(data) {
return request({
url: '/base/quality-scrap-det/update',
method: 'put',
data: data
})
}
// 删除质量检测类型基础
export function deleteQualityScrapDet(id) {
return request({
url: '/base/quality-scrap-det/delete?id=' + id,
method: 'delete'
})
}
// 获得质量检测类型基础
export function getQualityScrapDet(id) {
return request({
url: '/base/quality-scrap-det/get?id=' + id,
method: 'get'
})
}
// 获得质量检测类型基础分页
export function getQualityScrapDetPage(query) {
return request({
url: '/base/quality-scrap-det/page',
method: 'get',
params: query
})
}
// 导出质量检测类型基础 Excel
export function exportQualityScrapTypeExcel(query) {
return request({
url: '/base/quality-scrap-type/export-excel',
method: 'get',
params: query,
responseType: 'blob'
})
}
export function getCode(query) {
return request({
url: '/base/quality-scrap-det/getCode',
method: 'get',
params: query
})
}

View File

@ -0,0 +1,100 @@
/*
* @Author: zhp
* @Date: 2023-11-07 15:02:37
* @LastEditTime: 2023-11-07 18:32:07
* @LastEditors: zhp
* @Description:
*/
import request from '@/utils/request'
// 创建质量检测类型基础
export function createQualityScrapLog(data) {
return request({
url: '/base/quality-scrap-log/create',
method: 'post',
data: data
})
}
// 更新质量检测类型基础
export function updateQualityScrapLog(data) {
return request({
url: '/base/quality-scrap-log/update',
method: 'put',
data: data
})
}
// 删除质量检测类型基础
export function deleteQualityScrapLog(id) {
return request({
url: '/base/quality-scrap-log/delete?id=' + id,
method: 'delete'
})
}
// 获得质量检测类型基础
export function getQualityScrapLog(id) {
return request({
url: '/base/quality-scrap-log/get?id=' + id,
method: 'get'
})
}
// 获得质量检测类型基础分页
export function getQualityScrapLogPage(query) {
return request({
url: '/base/quality-scrap-log/page',
method: 'get',
params: query
})
}
// 导出质量检测类型基础 Excel
export function exportQualityScrapTypeExcel(query) {
return request({
url: '/base/quality-scrap-type/export-excel',
method: 'get',
params: query,
responseType: 'blob'
})
}
export function getCode(query) {
return request({
url: '/base/quality-scrap-log/getCode',
method: 'get',
params: query
})
}
export function getWorkOrderList(query) {
return request({
url: '/base/core-work-order/listbyfilter',
method: 'get',
params: query,
})
}
export function getTeamList(query) {
return request({
url: '/base/group-team/listAll',
method: 'get',
params: query,
})
}
export function getLineList(query) {
return request({
url: '/base/core-production-line/listAll',
method: 'get',
params: query,
})
}
export function getDetList(query) {
return request({
url: '/base/quality-scrap-det/listAll',
method: 'get',
params: query,
})
}

View File

@ -0,0 +1,76 @@
/*
* @Author: zhp
* @Date: 2023-11-04 18:27:11
* @LastEditTime: 2023-11-06 15:55:24
* @LastEditors: zhp
* @Description:
*/
import request from '@/utils/request'
// 创建质量检测类型基础
export function createQualityScrapType(data) {
return request({
url: '/base/quality-scrap-type/create',
method: 'post',
data: data
})
}
// 更新质量检测类型基础
export function updateQualityScrapType(data) {
return request({
url: '/base/quality-scrap-type/update',
method: 'put',
data: data
})
}
// 删除质量检测类型基础
export function deleteQualityScrapType(id) {
return request({
url: '/base/quality-scrap-type/delete?id=' + id,
method: 'delete'
})
}
// 获得质量检测类型基础
export function getQualityScrapType(id) {
return request({
url: '/base/quality-scrap-type/get?id=' + id,
method: 'get'
})
}
// 获得质量检测类型基础分页
export function getQualityScrapTypePage(query) {
return request({
url: '/base/quality-scrap-type/page',
method: 'get',
params: query
})
}
// 导出质量检测类型基础 Excel
export function exportQualityScrapTypeExcel(query) {
return request({
url: '/base/quality-scrap-type/export-excel',
method: 'get',
params: query,
responseType: 'blob'
})
}
export function getCode(query) {
return request({
url: '/base/quality-scrap-type/getCode',
method: 'get',
params: query
})
}
export function getList(query) {
return request({
url: 'base/quality-scrap-type/listAll',
method: 'get',
params: query
})
}

View File

@ -15,3 +15,12 @@ export function getWorker(query) {
params: query params: query
}) })
} }
// 获得该班组其他可选组员列表(除去现有组员)
export function otherWorkerList(query) {
return request({
url: '/base/group-team-det/otherWorkerList',
method: 'get',
params: query
})
}

View File

@ -1,23 +1,24 @@
/* /*
* @Author: zhp * @Author: zhp
* @Date: 2023-09-12 14:07:04 * @Date: 2023-09-12 14:07:04
* @LastEditTime: 2023-09-13 09:53:45 * @LastEditTime: 2023-11-10 10:23:43
* @LastEditors: zhp * @LastEditors: DY
* @Description: * @Description:
*/ */
import request from '@/utils/request' import request from '@/utils/request'
export function getYieldAnalysisPageData(data) { export function getYieldAnalysisPageData(query) {
return request({ return request({
url: '/analysis/production-analysis/getOutput', url: '/base/core-production-line-rec-day/monthList',
method: 'post', method: 'get',
data: data params: query
}) })
} }
// 产线平衡分析
export function getCT(data) { export function getCT(data) {
return request({ return request({
url: '/analysis/production-analysis/getCT', url: '/analysis/equipment-analysis/getCT',
method: 'post', method: 'post',
data: data data: data
}) })

View File

@ -1,9 +1,16 @@
/*
* @Author: Do not edit
* @Date: 2023-10-21 10:11:01
* @LastEditTime: 2023-11-03 19:03:44
* @LastEditors: DY
* @Description:
*/
import request from '@/utils/request' import request from '@/utils/request'
// 创建工厂 // 创建工厂
export function createFactory(data) { export function createFactory(data) {
return request({ return request({
url: '/base/factory/create', url: '/base/core-factory/create',
method: 'post', method: 'post',
data: data data: data
}) })
@ -12,7 +19,7 @@ export function createFactory(data) {
// 更新工厂 // 更新工厂
export function updateFactory(data) { export function updateFactory(data) {
return request({ return request({
url: '/base/factory/update', url: '/base/core-factory/update',
method: 'put', method: 'put',
data: data data: data
}) })
@ -21,7 +28,7 @@ export function updateFactory(data) {
// 删除工厂 // 删除工厂
export function deleteFactory(id) { export function deleteFactory(id) {
return request({ return request({
url: '/base/factory/delete?id=' + id, url: '/base/core-factory/delete?id=' + id,
method: 'delete' method: 'delete'
}) })
} }
@ -29,21 +36,30 @@ export function deleteFactory(id) {
// 获得工厂 // 获得工厂
export function getFactory(id) { export function getFactory(id) {
return request({ return request({
url: '/base/factory/get?id=' + id, url: '/base/core-factory/get?id=' + id,
method: 'get' method: 'get'
}) })
} }
// 获得工厂code // 获得工厂code
export function getCode() { export function getCode() {
return request({ return request({
url: '/base/factory/getCode', url: '/base/core-factory/getCode',
method: 'get' method: 'get'
}) })
} }
// 获得工厂分页 // 获得工厂分页
export function getFactoryPage(query) { export function getFactoryPage(query) {
return request({ return request({
url: '/base/factory/page', url: '/base/core-factory/page',
method: 'get',
params: query
})
}
// 获得所有列表
export function getFactoryList(query) {
return request({
url: '/base/core-factory/listAll',
method: 'get', method: 'get',
params: query params: query
}) })
@ -52,7 +68,7 @@ export function getFactoryPage(query) {
// 导出工厂 Excel // 导出工厂 Excel
export function exportFactoryExcel(query) { export function exportFactoryExcel(query) {
return request({ return request({
url: '/base/factory/export-excel', url: '/base/core-factory/export-excel',
method: 'get', method: 'get',
params: query, params: query,
responseType: 'blob' responseType: 'blob'

View File

@ -1,17 +1,17 @@
/* /*
* @Author: Do not edit * @Author: Do not edit
* @Date: 2023-09-12 09:44:53 * @Date: 2023-09-12 09:44:53
* @LastEditTime: 2023-09-15 14:12:26 * @LastEditTime: 2023-11-06 18:57:05
* @LastEditors: DY * @LastEditors: DY
* @Description: * @Description:
*/ */
import request from '@/utils/request' import request from '@/utils/request'
// 获得近24小时产线生产数据 // 获得近24小时产线生产数据
export function getPdlDataOneDay(data) { export function getPdlDataOneDay(query) {
return request({ return request({
url: '/monitoring/production-monitor/getPdlDataOneDay', url: '/base/core-production-line-rec-hour/list24h',
method: 'post', method: 'get',
data: data params: query
}) })
} }

View File

@ -0,0 +1,27 @@
/*
* @Author: Do not edit
* @Date: 2023-11-10 09:27:39
* @LastEditTime: 2023-11-10 09:30:00
* @LastEditors: DY
* @Description:
*/
import request from '@/utils/request'
// 获得设备统计分析
export function getEqAnalysis(query) {
return request({
url: '/analysis/equipment-analysis/statistics',
method: 'get',
params: query
})
}
// 导出设备统计分析
export function exportEqAnalysisExcel(query) {
return request({
url: '/analysis/equipment-analysis/export-excel',
method: 'get',
params: query,
responseType: 'blob'
})
}

View File

@ -0,0 +1,60 @@
/*
* @Author: Do not edit
* @Date: 2023-11-08 15:56:52
* @LastEditTime: 2023-11-09 17:42:27
* @LastEditors: DY
* @Description:
*/
import request from '@/utils/request'
// 创建设备报警处理
export function createAlarmHand(data) {
return request({
url: '/base/equipment-alarm-hand/create',
method: 'post',
data: data
})
}
// 更新设备报警处理
export function updateAlarmHand(data) {
return request({
url: '/base/equipment-alarm-hand/update',
method: 'put',
data: data
})
}
// 删除设备报警处理
export function deleteAlarmHand(id) {
return request({
url: '/base/equipment-alarm-hand/delete?id=' + id,
method: 'delete'
})
}
//获得设备报警处理
export function getAlarmHand(id) {
return request({
url: '/base/equipment-alarm-hand/get?id=' + id,
method: 'get'
})
}
// 获得设备报警处理分页
export function getAlarmHandPage(query) {
return request({
url: '/base/equipment-alarm-hand/page',
method: 'get',
params: query
})
}
//获得设备报警记录
export function getAlarmLog(id) {
return request({
url: '/base/equipment-alarm-log/get?id=' + id,
method: 'get'
})
}

View File

@ -0,0 +1,62 @@
/*
* @Author: Do not edit
* @Date: 2023-11-08 15:56:52
* @LastEditTime: 2023-11-11 19:52:54
* @LastEditors: DY
* @Description:
*/
import request from '@/utils/request'
// 根据设备获得所有巡检内容列表
export function getcheckAllList(query) {
return request({
url: '/base/equipment-check/listAll',
method: 'get',
params: query
})
}
// 创建设备巡检计划记录
export function createCheckLog(data) {
return request({
url: '/base/equipment-check-log/create',
method: 'post',
data: data
})
}
// 更新设备巡检计划记录
export function updateCheckLog(data) {
return request({
url: '/base/equipment-check-log/update',
method: 'put',
data: data
})
}
// 获得设备巡检计划记录
export function getEqCheckLog(id) {
return request({
url: '/base/equipment-check-log/get?id=' + id,
method: 'get'
})
}
// 导出设备巡检计划记录
export function exportCheckLogExcel(query) {
return request({
url: '/base/equipment-check-log/export-excel',
method: 'get',
params: query,
responseType: 'blob'
})
}
// 根据设备获得所有巡检配置列表
export function getcheckConfigByEqList(query) {
return request({
url: '/base/equipment-check-config/list',
method: 'get',
params: query
})
}

View File

@ -0,0 +1,68 @@
/*
* @Author: Do not edit
* @Date: 2023-11-08 15:56:52
* @LastEditTime: 2023-11-10 09:04:50
* @LastEditors: DY
* @Description:
*/
import request from '@/utils/request'
// 获得设备巡检设置
export function getEqCheck(id) {
return request({
url: '/base/equipment-check-config/get?id=' + id,
method: 'get'
})
}
// 创建巡检项目
export function createCheckDet(data) {
return request({
url: '/base/equipment-check-config-det/create',
method: 'post',
data: data
})
}
// 更新巡检项目
export function updateCheckDet(data) {
return request({
url: '/base/equipment-check-config-det/update',
method: 'put',
data: data
})
}
// 删除巡检项目
export function deleteCheckDet(id) {
return request({
url: '/base/equipment-check-config-det/delete?id=' + id,
method: 'delete'
})
}
//巡检项目
export function getCheckDet(id) {
return request({
url: '/base/equipment-check-config-det/get?id=' + id,
method: 'get'
})
}
// 获得巡检项目分页
export function getCheckDetPage(query) {
return request({
url: '/base/equipment-check-config-det/page',
method: 'get',
params: query
})
}
// 获得x巡检所有列表
export function getcheckList(query) {
return request({
url: '/base/equipment-check/list',
method: 'get',
params: query
})
}

View File

@ -0,0 +1,25 @@
/*
* @Author: Do not edit
* @Date: 2023-11-10 16:09:33
* @LastEditTime: 2023-11-10 16:50:08
* @LastEditors: DY
* @Description:
*/
import request from '@/utils/request'
//获得设备维修
export function getEqRepair(id) {
return request({
url: '/base/equipment-repair-log/get?id=' + id,
method: 'get'
})
}
// 更新设备维修记录
export function updateEqRepair(data) {
return request({
url: '/base/equipment-repair-log/update',
method: 'put',
data: data
})
}

View File

@ -0,0 +1,51 @@
/*
* @Author: Do not edit
* @Date: 2023-11-11 16:18:57
* @LastEditTime: 2023-11-11 17:28:54
* @LastEditors: DY
* @Description:
*/
import request from '@/utils/request'
//获得备品备件配置
export function getSparePartConfig(id) {
return request({
url: '/base/equipment-spare-part-config/get?id=' + id,
method: 'get'
})
}
// 创建设备备品备件配置--抽屉
export function createConfigDet(data) {
return request({
url: '/base/equipment-spare-part-config-det/create',
method: 'post',
data: data
})
}
// 删除设备备品备件配置--抽屉
export function deleteConfigDet(id) {
return request({
url: '/base/equipment-spare-part-config-det/delete?id=' + id,
method: 'delete'
})
}
// 获得抽屉表格分页
export function getConfigDetPage(query) {
return request({
url: '/base/equipment-spare-part-config-det/page',
method: 'get',
params: query
})
}
// 获得备品备件列表
export function getSparePartList(query) {
return request({
url: '/base/equipment-spare-part/list',
method: 'get',
params: query
})
}

View File

@ -0,0 +1,45 @@
/*
* @Author: Do not edit
* @Date: 2023-11-11 16:18:57
* @LastEditTime: 2023-11-11 18:44:51
* @LastEditors: DY
* @Description:
*/
import request from '@/utils/request'
// 获得抽屉表格分页
export function getConfigDetMonitorPage(query) {
return request({
url: '/base/equipment-spare-part-config-det/monitor',
method: 'get',
params: query
})
}
// 创建设备备品备件更换log
export function createSparePartLog(data) {
return request({
url: '/base/equipment-spare-part-log/create',
method: 'post',
data: data
})
}
// 获得设备备品备件更换log分页
export function getSparePartLogPage(query) {
return request({
url: '/base/equipment-spare-part-log/page',
method: 'get',
params: query
})
}
// 导出设备备品备件更换log
export function exportSparePartLogExcel(query) {
return request({
url: '/base/equipment-spare-part-log/export-excel',
method: 'get',
params: query,
responseType: 'blob'
})
}

View File

@ -0,0 +1,106 @@
/*
* @Author: zhp
* @Date: 2023-11-07 19:47:48
* @LastEditTime: 2023-11-08 16:59:32
* @LastEditors: zhp
* @Description:
*/
import request from '@/utils/request'
// 获得能耗统计查询分页
export function processEquMaterialBomPage(data) {
return request({
url: '/extend/process-equ-material-bom/page',
method: 'get',
data: data
})
}
export function updateProcessEquMaterialBom(data) {
return request({
url: '/extend/process-equ-material-bom/update',
method: 'put',
data: data
})
}
export function createProcessEquMaterialBom(data) {
return request({
url: '/extend/process-equ-material-bom/create',
method: 'post',
data: data
})
}
export function getProcessEquMaterialBom(data) {
return request({
url: '/extend/process-equ-material-bom/get',
method: 'get',
params: data
})
}
export function deleteProcessEquMaterialBom(id) {
return request({
url: '/extend/process-equ-material-bom/delete?id=' + id,
method: 'delete',
// data: data
})
}
export function getEquipmentList(data) {
return request({
url: '/base/core-equipment/listAll',
method: 'get',
data: data
})
}
export function deleteProcessEquMaterialBomDet(id) {
return request({
url: '/extend/process-equ-material-bom-det/delete?id=' + id,
method: 'delete',
// data: data
})
}
export function processEquMaterialBomDetPage(data) {
return request({
url: '/extend/process-equ-material-bom-det/page',
method: 'get',
params: data
})
}
export function updateProcessEquMaterialBomDet(data) {
return request({
url: '/extend/process-equ-material-bom-det/update',
method: 'put',
data: data
})
}
export function createProcessEquMaterialBomDet(data) {
return request({
url: '/extend/process-equ-material-bom-det/create',
method: 'post',
data: data
})
}
export function getProcessEquMaterialBomDet(data) {
return request({
url: '/extend/process-equ-material-bom-det/get',
method: 'get',
params: data
})
}
export function getMaterialList(data) {
return request({
url: '/base/material/listbyfilter',
method: 'get',
data: data
})
}

View File

@ -0,0 +1,106 @@
/*
* @Author: zhp
* @Date: 2023-11-09 09:37:14
* @LastEditTime: 2023-11-09 14:20:02
* @LastEditors: zhp
* @Description:
*/
import request from '@/utils/request'
// 获得能耗统计查询分页
export function processEquValueBomPage(data) {
return request({
url: '/extend/process-equ-value-bom/page',
method: 'get',
data: data
})
}
export function updateProcessEquValueBom(data) {
return request({
url: '/extend/process-equ-value-bom/update',
method: 'put',
data: data
})
}
export function createProcessEquValueBom(data) {
return request({
url: '/extend/process-equ-value-bom/create',
method: 'post',
data: data
})
}
export function getProcessEquValueBom(data) {
return request({
url: '/extend/process-equ-value-bom/get',
method: 'get',
params: data
})
}
export function deleteProcessEquValueBom(id) {
return request({
url: '/extend/process-equ-value-bom/delete?id=' + id,
method: 'delete',
// data: data
})
}
export function getEquipmentList(data) {
return request({
url: '/base/core-equipment/listAll',
method: 'get',
data: data
})
}
export function deleteProcessEquValueBomDet(id) {
return request({
url: '/extend/process-equ-value-bom-det/delete?id=' + id,
method: 'delete',
// data: data
})
}
export function processEquValueBomDetPage(data) {
return request({
url: '/extend/process-equ-value-bom-det/page',
method: 'get',
params: data
})
}
export function updateProcessEquValueBomDet(data) {
return request({
url: '/extend/process-equ-value-bom-det/update',
method: 'put',
data: data
})
}
export function createProcessEquValueBomDet(data) {
return request({
url: '/extend/process-equ-value-bom-det/create',
method: 'post',
data: data
})
}
export function getProcessEquValueBomDet(data) {
return request({
url: '/extend/process-equ-value-bom-det/get',
method: 'get',
params: data
})
}
export function getValueList(data) {
return request({
url: '/extend/process-equ-value-bom-det/getEnableValuesByEquId',
method: 'get',
params: data
})
}

View File

@ -1,9 +1,16 @@
/*
* @Author: zhp
* @Date: 2023-10-17 09:26:38
* @LastEditTime: 2023-11-02 17:00:17
* @LastEditors: zhp
* @Description:
*/
import request from '@/utils/request' import request from '@/utils/request'
// 创建质量检查信息记录表 // 创建质量检查信息记录表
export function createQualityInspectionRecord(data) { export function createQualityInspectionRecord(data) {
return request({ return request({
url: '/monitoring/quality-inspection-record/create', url: '/base/quality-inspection-record/create',
method: 'post', method: 'post',
data: data data: data
}) })
@ -12,7 +19,7 @@ export function createQualityInspectionRecord(data) {
// 更新质量检查信息记录表 // 更新质量检查信息记录表
export function updateQualityInspectionRecord(data) { export function updateQualityInspectionRecord(data) {
return request({ return request({
url: '/monitoring/quality-inspection-record/update', url: '/base/quality-inspection-record/update',
method: 'put', method: 'put',
data: data data: data
}) })
@ -21,7 +28,7 @@ export function updateQualityInspectionRecord(data) {
// 删除质量检查信息记录表 // 删除质量检查信息记录表
export function deleteQualityInspectionRecord(id) { export function deleteQualityInspectionRecord(id) {
return request({ return request({
url: '/monitoring/quality-inspection-record/delete?id=' + id, url: '/base/quality-inspection-record/delete?id=' + id,
method: 'delete' method: 'delete'
}) })
} }
@ -29,7 +36,7 @@ export function deleteQualityInspectionRecord(id) {
// 获得质量检查信息记录表 // 获得质量检查信息记录表
export function getQualityInspectionRecord(id) { export function getQualityInspectionRecord(id) {
return request({ return request({
url: '/monitoring/quality-inspection-record/get?id=' + id, url: '/base/quality-inspection-record/get?id=' + id,
method: 'get' method: 'get'
}) })
} }
@ -37,7 +44,7 @@ export function getQualityInspectionRecord(id) {
// 获得质量检查信息记录表分页 // 获得质量检查信息记录表分页
export function getQualityInspectionRecordPage(query) { export function getQualityInspectionRecordPage(query) {
return request({ return request({
url: '/monitoring/quality-inspection-record/page', url: '/base/quality-inspection-record/page',
method: 'get', method: 'get',
params: query params: query
}) })
@ -46,7 +53,7 @@ export function getQualityInspectionRecordPage(query) {
// 导出质量检查信息记录表 Excel // 导出质量检查信息记录表 Excel
export function exportQualityInspectionRecordExcel(query) { export function exportQualityInspectionRecordExcel(query) {
return request({ return request({
url: '/monitoring/quality-inspection-record/export-excel', url: '/base/quality-inspection-record/export-excel',
method: 'get', method: 'get',
params: query, params: query,
responseType: 'blob' responseType: 'blob'

View File

@ -0,0 +1,40 @@
/*
* @Author: zhp
* @Date: 2023-11-07 14:10:18
* @LastEditTime: 2023-11-07 16:29:55
* @LastEditors: zhp
* @Description:
*/
import request from '@/utils/request'
// 获得质量检查信息记录表分页
export function getStatisticalDataPage(query) {
return request({
url: '/base/statistical-data/getStatisticData',
method: 'get',
data: query
})
}
export function getWorkOrderList(query) {
return request({
url: '/base/core-work-order/listbyfilter',
method: 'get',
params: query,
})
}
export function getProductList(query) {
return request({
url: '/base/core-product/listAll',
method: 'get',
params: query,
})
}
export function getInspectionData(query) {
return request({
url: '/base/statistical-data/getInspectionData',
method: 'get',
params: query,
})
}

View File

@ -17,3 +17,12 @@ export function getSchedulingMonitoringRecord(query) {
params: query params: query
}) })
} }
// 获得所有列表
export function groupClassesListAll(query) {
return request({
url: '/base/group-classes/listAll',
method: 'get',
params: query
})
}

View File

@ -0,0 +1,35 @@
/*
* @Author: zhp
* @Date: 2023-10-18 09:33:57
* @LastEditTime: 2023-11-03 09:31:17
* @LastEditors: zhp
* @Description:
*/
import request from '@/utils/request'
// 获得物料信息追溯page
export function getTreeData(query) {
return request({
url: '/base/core-factory/getTreeByWorkOrder',
method: 'get',
params: query
})
}
export function getWorkOrderList(query) {
return request({
url: '/base/core-work-order/listbyfilter',
method: 'get',
params: query,
})
}
// 导出物料信息
export function exportEnergyPlcExcel(query) {
return request({
url: '/base/material-use-log/materialTraceExport',
method: 'get',
params: query,
responseType: 'blob'
})
}

View File

@ -0,0 +1,35 @@
/*
* @Author: zhp
* @Date: 2023-10-18 09:33:57
* @LastEditTime: 2023-10-31 10:28:51
* @LastEditors: zhp
* @Description:
*/
import request from '@/utils/request'
// 获得物料信息追溯page
export function getMaterialUseLogPage(query) {
return request({
url: '/base/material-use-log/materialTrace',
method: 'get',
params: query
})
}
export function getWorkOrderList(query) {
return request({
url: '/base/core-work-order/listbyfilter',
method: 'get',
params: query,
})
}
// 导出物料信息
export function exportEnergyPlcExcel(query) {
return request({
url: '/base/material-use-log/materialTraceExport',
method: 'get',
params: query,
responseType: 'blob'
})
}

View File

@ -0,0 +1,35 @@
/*
* @Author: zhp
* @Date: 2023-10-31 15:05:06
* @LastEditTime: 2023-11-03 09:05:50
* @LastEditors: zhp
* @Description:
*/
import request from '@/utils/request'
// 获得工艺信息追溯page
export function getProcessTraceabilityPage(query) {
return request({
url: '/extend/process-retrospect/get',
method: 'post',
data: query
})
}
export function getWorkOrderList(query) {
return request({
url: '/base/core-work-order/listbyfilter',
method: 'get',
params: query,
})
}
// 导出物料信息
// export function exportEnergyPlcExcel(query) {
// return request({
// url: '/base/material-use-log/materialTraceExport',
// method: 'get',
// params: query,
// responseType: 'blob'
// })
// }

View File

@ -0,0 +1,43 @@
/*
* @Author: zhp
* @Date: 2023-10-18 09:33:57
* @LastEditTime: 2023-11-09 15:33:20
* @LastEditors: zhp
* @Description:
*/
import request from '@/utils/request'
// 获得物料信息追溯page
export function getDetMaterial(query) {
return request({
url: '/extend/process-retrospect/getDetMaterial',
method: 'post',
data: query
})
}
export function getDetValue(query) {
return request({
url: '/extend/process-retrospect/getDetValue',
method: 'post',
data: query
})
}
// export function getWorkOrderList(query) {
// return request({
// url: '/base/core-work-order/listbyfilter',
// method: 'get',
// params: query,
// })
// }
// // 导出物料信息
// export function exportEnergyPlcExcel(query) {
// return request({
// url: '/base/material-use-log/materialTraceExport',
// method: 'get',
// params: query,
// responseType: 'blob'
// })
// }

View File

@ -0,0 +1,35 @@
/*
* @Author: zhp
* @Date: 2023-10-31 10:55:20
* @LastEditTime: 2023-10-31 15:05:30
* @LastEditors: zhp
* @Description:
*/
import request from '@/utils/request'
// 获得原料信息追溯page
export function getRawMaterialPage(query) {
return request({
url: '/base/core-work-order-material/page',
method: 'get',
params: query
})
}
export function getWorkOrderList(query) {
return request({
url: '/base/core-work-order/listbyfilter',
method: 'get',
params: query,
})
}
// 导出物料信息
export function exportEnergyPlcExcel(query) {
return request({
url: '/base/material-use-log/materialTraceExport',
method: 'get',
params: query,
responseType: 'blob'
})
}

View File

@ -0,0 +1,75 @@
/*
* @Author: zwq
* @Date: 2023-11-02 14:21:18
* @LastEditors: zwq
* @LastEditTime: 2023-11-02 14:34:29
* @Description:
*/
import request from '@/utils/request'
// 创建仓库
export function createWarehouse(data) {
return request({
url: '/extend/warehouse/create',
method: 'post',
data: data
})
}
// 更新仓库
export function updateWarehouse(data) {
return request({
url: '/extend/warehouse/update',
method: 'put',
data: data
})
}
// 删除仓库
export function deleteWarehouse(id) {
return request({
url: '/extend/warehouse/delete?id=' + id,
method: 'delete'
})
}
// 获得仓库
export function getWarehouse(id) {
return request({
url: '/extend/warehouse/get?id=' + id,
method: 'get'
})
}
// 获得仓库列表
export function getWarehouseList() {
return request({
url: '/extend/warehouse/listAll',
method: 'get'
})
}
// 获得仓库code
export function getCode() {
return request({
url: '/extend/warehouse/getCode',
method: 'get'
})
}
// 获得仓库分页
export function getWarehousePage(query) {
return request({
url: '/extend/warehouse/page',
method: 'get',
params: query
})
}
// 导出仓库 Excel
export function exportWarehouseExcel(query) {
return request({
url: '/extend/warehouse/export-excel',
method: 'get',
params: query,
responseType: 'blob'
})
}

View File

@ -0,0 +1,76 @@
/*
* @Author: zwq
* @Date: 2023-11-02 16:20:15
* @LastEditors: zwq
* @LastEditTime: 2023-11-03 15:26:05
* @Description:
*/
import request from '@/utils/request'
// 创建物品
export function createWarehouseGoods(data) {
return request({
url: '/extend/warehouse-goods/create',
method: 'post',
data: data
})
}
// 更新物品
export function updateWarehouseGoods(data) {
return request({
url: '/extend/warehouse-goods/update',
method: 'put',
data: data
})
}
// 删除物品
export function deleteWarehouseGoods(id) {
return request({
url: '/extend/warehouse-goods/delete?id=' + id,
method: 'delete'
})
}
// 获得物品
export function getWarehouseGoods(id) {
return request({
url: '/extend/warehouse-goods/get?id=' + id,
method: 'get'
})
}
// 获得物品列表
export function getListByType(id) {
return request({
url: '/extend/warehouse-goods/getListByType?type=' + id,
method: 'get'
})
}
// 获得物品分页
export function getWarehouseGoodsPage(data) {
return request({
url: '/extend/warehouse-goods/page',
method: 'POST',
data: data
})
}
// 获得code
export function getCode() {
return request({
url: '/extend/warehouse-goods/getCode',
method: 'get'
})
}
// 导出物品 Excel
export function exportWarehouseGoodsExcel(query) {
return request({
url: '/extend/warehouse-goods/export-excel',
method: 'get',
params: query,
responseType: 'blob'
})
}

View File

@ -0,0 +1,97 @@
/*
* @Author: zwq
* @Date: 2023-11-02 14:31:42
* @LastEditors: zwq
* @LastEditTime: 2023-11-04 14:56:10
* @Description:
*/
import request from '@/utils/request'
// 创建库位
export function createWarehouseLocation(data) {
return request({
url: '/extend/warehouse-location/create',
method: 'post',
data: data
})
}
// 更新库位
export function updateWarehouseLocation(data) {
return request({
url: '/extend/warehouse-location/update',
method: 'put',
data: data
})
}
// 删除库位
export function deleteWarehouseLocation(id) {
return request({
url: '/extend/warehouse-location/delete?id=' + id,
method: 'delete'
})
}
// 获得库位
export function getWarehouseLocation(id) {
return request({
url: '/extend/warehouse-location/get?id=' + id,
method: 'get'
})
}
// 获得库位列表(通过仓库id)
export function listByWarehouse(id) {
return request({
url: '/extend/warehouse-location/listByWarehouse?warehouseId=' + id,
method: 'get'
})
}
// 获得库位列表(All)
export function listAll() {
return request({
url: '/extend/warehouse-location/listAll',
method: 'get'
})
}
// 获得库位code
export function getCode() {
return request({
url: '/extend/warehouse-location/getCode',
method: 'get'
})
}
// 获得库位分页
export function getWarehouseLocationPage(data) {
return request({
url: '/extend/warehouse-location/page',
method: 'POST',
data: data
})
}
// 获得库存总览数据
export function getOverview(data) {
return request({
url: '/extend/warehouse-monitoring/getOverview',
method: 'POST',
data: data
})
}
// 获得库位占用率数据
export function getRate(data) {
return request({
url: '/extend/warehouse-monitoring/getRate',
method: 'POST',
data: data
})
}
// 导出库位 Excel
export function exportWarehouseLocationExcel(query) {
return request({
url: '/extend/warehouse-location/export-excel',
method: 'get',
params: query,
responseType: 'blob'
})
}

View File

@ -0,0 +1,83 @@
import request from '@/utils/request'
// 创建出入库-无库位-入库
export function createWarehouseRealtime(data) {
return request({
url: '/extend/warehouse-realtime/create',
method: 'post',
data: data
})
}
// 创建出入库-无库位-出库
export function outWarehouseRealtime(data) {
return request({
url: '/extend/warehouse-realtime/out',
method: 'post',
data: data
})
}
// 更新出入库-无库位
export function updateWarehouseRealtime(data) {
return request({
url: '/extend/warehouse-realtime/update',
method: 'put',
data: data
})
}
// 删除出入库-无库位
export function deleteWarehouseRealtime(id) {
return request({
url: '/extend/warehouse-realtime/delete?id=' + id,
method: 'delete'
})
}
// 获得出入库-无库位
export function getWarehouseRealtime(id) {
return request({
url: '/extend/warehouse-realtime/get?id=' + id,
method: 'get'
})
}
// 获得出入库-无库位-展开详情
export function getWarehouseRealtimeDet(id) {
return request({
url: '/extend/warehouse-realtime/getDet?id=' + id,
method: 'get'
})
}
// 获得出入库-无库位-批次列表
export function getBatchList(id) {
return request({
url: '/extend/warehouse-realtime/getBatchList?id=' + id,
method: 'get'
})
}
// 获得出入库-无库位分页
export function getWarehouseRealtimePage(data) {
return request({
url: '/extend/warehouse-realtime/page',
method: 'post',
data: data
})
}
// 获得出入库-无库位-历史分页
export function getWarehouseRealtimeHisPage(data) {
return request({
url: '/extend/warehouse-his/page',
method: 'post',
data: data
})
}
// 导出出入库-无库位 Excel
export function exportWarehouseRealtimeExcel(query) {
return request({
url: '/extend/warehouse-realtime/export-excel',
method: 'get',
params: query,
responseType: 'blob'
})
}

View File

@ -0,0 +1,85 @@
import request from '@/utils/request'
// 创建出入库-有库位
export function createWarehouseRealtimeLocation(data) {
return request({
url: '/extend/warehouse-realtime-location/create',
method: 'post',
data: data
})
}
// 更新出入库-有库位
export function updateWarehouseRealtimeLocation(data) {
return request({
url: '/extend/warehouse-realtime-location/update',
method: 'put',
data: data
})
}
// 出入库-有库位 > 出库操作
export function outWarehouseRealtimeLocation(data) {
return request({
url: '/extend/warehouse-realtime-location/out',
method: 'post',
data: data
})
}
// 出入库-有库位 > 入库操作
export function inWarehouseRealtimeLocation(data) {
return request({
url: '/extend/warehouse-realtime-location/in',
method: 'post',
data: data
})
}
// 删除出入库-有库位
export function deleteWarehouseRealtimeLocation(id) {
return request({
url: '/extend/warehouse-realtime-location/delete?id=' + id,
method: 'delete'
})
}
// 获得出入库-有库位
export function getWarehouseRealtimeLocation(id) {
return request({
url: '/extend/warehouse-realtime-location/get?id=' + id,
method: 'get'
})
}
// 获得出入库历史-有库位详情列表
export function getWarehouseLocationHisDet(id) {
return request({
url: '/extend/warehouse-location-his-det/list?hisId=' + id,
method: 'get'
})
}
// 获得出入库-有库位分页
export function getWarehouseRealtimeLocationPage(data) {
return request({
url: '/extend/warehouse-realtime-location/page',
method: 'post',
data: data
})
}
// 获得出入库历史-有库位分页
export function getWarehouseLocationHisPage(data) {
return request({
url: '/extend/warehouse-location-his/page',
method: 'post',
data: data
})
}
// 导出出入库-有库位 Excel
export function exportWarehouseRealtimeLocationExcel(query) {
return request({
url: '/extend/warehouse-realtime-location/export-excel',
method: 'get',
params: query,
responseType: 'blob'
})
}

View File

@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="10px" height="10px" viewBox="0 0 10 10" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<!-- Generator: Sketch 60 (88103) - https://sketch.com -->
<desc>Created with Sketch.</desc>
<g id="11_系统管理" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="11-1用户管理" transform="translate(-1764.000000, -160.000000)">
<g id="编组-15" transform="translate(1763.000000, 158.000000)">
<g id="编组-18">
<g id="icon/界面内/新增" transform="translate(0.000000, 1.000000)">
<g id="编组">
<rect id="矩形" stroke="#979797" fill="#D8D8D8" opacity="0" x="0.5" y="0.5" width="11" height="11"></rect>
<path d="M10.0813953,6.42885117 L6.37790698,6.42885117 L6.37790698,10.0770235 C6.37790698,10.3108355 6.19069767,10.5 5.95930233,10.5 L5.95930233,10.5 C5.72790698,10.5 5.54069767,10.3108355 5.54069767,10.0770235 L5.54069767,6.42885117 L1.91860465,6.42885117 C1.6872093,6.42885117 1.5,6.23968668 1.5,6.00587467 L1.5,6.00587467 C1.5,5.77206266 1.6872093,5.58289817 1.91860465,5.58289817 L5.54069767,5.58289817 L5.54069767,1.9229765 C5.54069767,1.68916449 5.72790698,1.5 5.95930233,1.5 L5.95930233,1.5 C6.19069767,1.5 6.37790698,1.68916449 6.37790698,1.9229765 L6.37790698,5.58289817 L10.0813953,5.58289817 C10.3127907,5.58289817 10.5,5.77206266 10.5,6.00587467 L10.5,6.00587467 C10.5,6.23968668 10.3127907,6.42885117 10.0813953,6.42885117 L10.0813953,6.42885117 Z" id="Shape" fill="#0B58FF" transform="translate(6.000000, 6.000000) scale(1, -1) translate(-6.000000, -6.000000) "></path>
</g>
</g>
</g>
</g>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.8 KiB

View File

@ -66,7 +66,10 @@
:key="col.key" :key="col.key"
:disabled="disabled" :disabled="disabled"
:is="col.subcomponent" :is="col.subcomponent"
:inlineStyle="col.style"></component> v-model="form[col.prop]"
:inlineStyle="col.style"
@on-change="$emit('update', form)"
v-bind="col.bind"></component>
<div <div
class="upload-area" class="upload-area"

View File

@ -15,7 +15,7 @@
ref="fileUpload" ref="fileUpload"
> >
<!-- 上传按钮 --> <!-- 上传按钮 -->
<el-button size="mini" type="primary">选取文件</el-button> <el-button size="mini" :disabled="disabled" type="primary">选取文件</el-button>
<!-- 上传提示 --> <!-- 上传提示 -->
<div class="el-upload__tip" slot="tip" v-if="showTip"> <div class="el-upload__tip" slot="tip" v-if="showTip">
请上传 请上传
@ -66,6 +66,11 @@ export default {
isShowTip: { isShowTip: {
type: Boolean, type: Boolean,
default: true default: true
},
//
disabled: {
type: Boolean,
default: false
} }
}, },
data() { data() {
@ -179,6 +184,7 @@ export default {
}, },
// //
getFileName(name) { getFileName(name) {
console.log('你好', name)
if (name.lastIndexOf("/") > -1) { if (name.lastIndexOf("/") > -1) {
return name.slice(name.lastIndexOf("/") + 1); return name.slice(name.lastIndexOf("/") + 1);
} else { } else {

View File

@ -180,6 +180,7 @@ input, textarea{
// 抽屉head区域---start // 抽屉head区域---start
.el-drawer__header { .el-drawer__header {
padding-bottom: 20px; padding-bottom: 20px;
padding-left: 30px;
margin-bottom: 23px; margin-bottom: 23px;
font-size: 20px; font-size: 20px;
font-weight: 500; font-weight: 500;

View File

@ -0,0 +1,182 @@
<template>
<div class="app-container">
<search-bar
:formConfigs="formConfig"
ref="searchBarForm"
@headBtnClick="buttonClick" />
<base-table
v-loading="dataListLoading"
:table-props="tableProps"
:page="listQuery.pageNo"
:limit="listQuery.pageSize"
:table-data="tableData">
<method-btn
v-if="tableBtn.length"
slot="handleBtn"
:width="120"
label="操作"
:method-list="tableBtn"
@clickBtn="handleClick" />
</base-table>
<pagination
:limit.sync="listQuery.pageSize"
:page.sync="listQuery.pageNo"
:total="listQuery.total"
@pagination="getDataList" />
</div>
</template>
<script>
import basicPage from '../../core/mixins/basic-page';
import { parseTime } from '../../core/mixins/code-filter';
import {
getcoreAlarmLogPage
} from '@/api/base/coreAlarmLog';
import {DICT_TYPE, getDictDatas} from "@/utils/dict";
const tableProps = [
{
prop: 'alarmTime',
label: '报警时间',
filter: parseTime
},
{
prop: 'alarmSource',
label: '报警来源'
},
{
prop: 'alarmType',
label: '报警类型'
},
{
prop: 'alarmGrade',
label: '报警级别'
},
{
prop: 'alarmReason',
label: '报警原因'
},
{
prop: 'alarmContent',
label: '报警详细'
}
];
export default {
mixins: [basicPage],
data() {
return {
urlOptions: {
getDataListURL: getcoreAlarmLogPage
},
tableProps,
tableBtn: [].filter((v)=>v),
tableData: [],
listQuery: {
pageSize: 10,
pageNo: 1,
total: 0,
alarmSource: undefined,
alarmGrade: undefined,
alarmTime: []
},
formConfig: [
{
type: 'input',
label: '报警来源',
placeholder: '报警来源',
param: 'name',
},
{
type: 'datePicker',
label: '时间段',
dateType: 'datetimerange',
format: 'yyyy-MM-dd',
valueFormat: 'yyyy-MM-dd HH:mm:ss',
rangeSeparator: '-',
startPlaceholder: '开始时间',
endPlaceholder: '结束时间',
width: 350,
param: 'time'
},
{
type: 'select',
label: '报警级别',
placeholder: '请选择报警级别',
param: 'alarmGrade',
selectOptions: [],
filterable: true,
},
{
type: 'button',
btnName: '查询',
name: 'search',
color: 'primary',
}
// {
// type: 'separate',
// },
// {
// type: this.$auth.hasPermi('base:core-alarm-log:create') ? 'button' : '',
// btnName: '',
// name: 'add',
// color: 'success',
// plain: true
// },
],
};
},
created() {
this.getDict()
},
methods: {
//
async getDict() {
const res = await getDictDatas(this.DICT_TYPE.EQU_ALARM_LEVEL)
console.log('111', res)
this.formConfig[2].selectOptions = res.map(item => {
return {
id: item.value,
name: item.label
}
})
},
buttonClick(val) {
switch (val.btnName) {
case 'search':
this.listQuery.pageNo = 1;
this.listQuery.pageSize = 10;
this.listQuery.alarmSource = val.name ? val.name : undefined;
this.listQuery.alarmGrade = val.alarmGrade ? val.alarmGrade : undefined;
if (val.time) {
this.listQuery.alarmTime[0] = val.time[0]
this.listQuery.alarmTime[1] = val.time[1]
} else {
this.listQuery.alarmTime = []
}
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);
}
},
},
};
</script>

View File

@ -0,0 +1,103 @@
<!--
* @Author: zwq
* @Date: 2021-11-18 14:16:25
* @LastEditors: DY
* @LastEditTime: 2023-11-03 10:53:43
* @Description:
-->
<template>
<el-form
:model="dataForm"
:rules="dataRule"
ref="dataForm"
@keyup.enter.native="dataFormSubmit()"
label-width="80px">
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="客户编号" prop="code">
<el-input v-model="dataForm.code" clearable placeholder="请输入客户编号" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="客户名称" prop="name">
<el-input v-model="dataForm.name" clearable placeholder="请输入客户名称" />
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="联系人" prop="contact">
<el-input v-model="dataForm.contact" clearable placeholder="请输入联系人" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="联系电话" prop="telephone">
<el-input
v-model="dataForm.telephone"
maxlength="11"
placeholder="请输入联系电话" />
</el-form-item>
</el-col>
</el-row>
<el-form-item label="地址" prop="address">
<el-input
v-model="dataForm.address"
placeholder="请输入地址" />
</el-form-item>
<el-form-item label="备注" prop="remark">
<el-input
v-model="dataForm.remark"
placeholder="请输入备注" />
</el-form-item>
</el-form>
</template>
<script>
import basicAdd from '../../core/mixins/basic-add';
import { createCustomer, updateCustomer, getCustomer, getCode } from "@/api/base/coreCustomer";
export default {
mixins: [basicAdd],
data() {
return {
urlOptions: {
isGetCode: true,
codeURL: getCode,
createURL: createCustomer,
updateURL: updateCustomer,
infoURL: getCustomer
},
dataForm: {
id: undefined,
code: undefined,
name: undefined,
telephone: undefined,
contact: undefined,
address: undefined,
remark: undefined
},
dataRule: {
code: [{ required: true, message: "专业编码不能为空", trigger: "blur" }],
name: [{ required: true, message: "专业名称不能为空", trigger: "blur" }],
contact: [{ required: true, message: "联系人不能为空", trigger: "blur" }],
telephone: [
{ required: false, trigger: "blur", message: "手机号不能为空" },
{
validator: function (rule, value, callback) {
if (value) {
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) {
callback(new Error("手机号格式错误"));
}
} else {
callback();
}
}, trigger: "blur"
}
]
}
};
},
mounted() {},
methods: {}
};
</script>

View File

@ -0,0 +1,176 @@
<template>
<div class="app-container">
<search-bar
:formConfigs="formConfig"
ref="searchBarForm"
@headBtnClick="buttonClick" />
<base-table
v-loading="dataListLoading"
:table-props="tableProps"
:page="listQuery.pageNo"
:limit="listQuery.pageSize"
:table-data="tableData">
<method-btn
v-if="tableBtn.length"
slot="handleBtn"
:width="120"
label="操作"
:method-list="tableBtn"
@clickBtn="handleClick" />
</base-table>
<pagination
:limit.sync="listQuery.pageSize"
:page.sync="listQuery.pageNo"
:total="listQuery.total"
@pagination="getDataList" />
<base-dialog
:dialogTitle="addOrEditTitle"
:dialogVisible="addOrUpdateVisible"
@cancel="handleCancel"
@confirm="handleConfirm"
:before-close="handleCancel"
width="50%">
<add-or-update
ref="addOrUpdate"
@refreshDataList="successSubmit"></add-or-update>
</base-dialog>
</div>
</template>
<script>
import AddOrUpdate from './add-or-updata';
import basicPage from '../../core/mixins/basic-page';
import { parseTime } from '../../core/mixins/code-filter';
import {
getCustomerPage,
deleteCustomer
} from '@/api/base/coreCustomer';
const tableProps = [
{
prop: 'createTime',
label: '添加时间',
filter: parseTime
},
{
prop: 'name',
label: '客户名称'
},
{
prop: 'code',
label: '客户编码'
},
{
prop: 'contact',
label: '联系人'
},
{
prop: 'telephone',
label: '联系电话'
},
{
prop: 'address',
label: '地址'
},
{
prop: 'remark',
label: '备注'
},
];
export default {
mixins: [basicPage],
data() {
return {
urlOptions: {
getDataListURL: getCustomerPage,
deleteURL: deleteCustomer
},
tableProps,
tableBtn: [
this.$auth.hasPermi(`base:core-customer:update`)
? {
type: 'edit',
btnName: '编辑',
}
: undefined,
this.$auth.hasPermi(`base:core-customer:delete`)
? {
type: 'delete',
btnName: '删除',
}
: undefined,
].filter((v)=>v),
tableData: [],
formConfig: [
{
type: 'input',
label: '名称',
placeholder: '专业',
param: 'name',
},
{
type: 'button',
btnName: '查询',
name: 'search',
color: 'primary',
},
{
type: 'separate',
},
{
type: this.$auth.hasPermi('base:core-customer:create') ? 'button' : '',
btnName: '新增',
name: 'add',
color: 'success',
plain: true
},
],
};
},
components: {
AddOrUpdate,
},
created() {},
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;
// });
// },
buttonClick(val) {
switch (val.btnName) {
case 'search':
this.listQuery.pageNo = 1;
this.listQuery.pageSize = 10;
this.listQuery.name = val.name ? val.name : undefined;
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);
}
},
},
};
</script>

View File

@ -0,0 +1,107 @@
<!--
* @Author: zwq
* @Date: 2021-11-18 14:16:25
* @LastEditors: DY
* @LastEditTime: 2023-11-02 14:16:30
* @Description:
-->
<template>
<el-form
:model="dataForm"
:rules="dataRule"
ref="dataForm"
@keyup.enter.native="dataFormSubmit()"
label-width="80px">
<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="code">
<el-input v-model="dataForm.code" clearable placeholder="请输入部门编码" />
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="上级部门" prop="parentId">
<treeselect v-model="dataForm.parentId" :options="menuOptions" :normalizer="normalizer" :show-count="true" placeholder="选择上级部门"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="备注" prop="remark">
<el-input
v-model="dataForm.remark"
placeholder="请输入备注" />
</el-form-item>
</el-col>
</el-row>
</el-form>
</template>
<script>
import basicAdd from '../../core/mixins/basic-add';
import { createCoreDepartment, updateCoreDepartment, getCoreDepartment, getCode, getCoreDepartmentList } from "@/api/base/coreDepartment";
import Treeselect from "@riophae/vue-treeselect";
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
export default {
mixins: [basicAdd],
components: { Treeselect },
data() {
return {
urlOptions: {
isGetCode: true,
codeURL: getCode,
createURL: createCoreDepartment,
updateURL: updateCoreDepartment,
infoURL: getCoreDepartment,
},
dataForm: {
id: undefined,
code: undefined,
name: undefined,
parentId: undefined,
remark: undefined,
},
departmentlList: [],
menuOptions: [],
dataRule: {
code: [{ required: true, message: "部门编码不能为空", trigger: "blur" }],
name: [{ required: true, message: "部门名称不能为空", trigger: "blur" }],
}
};
},
mounted() {
this.getDict()
},
methods: {
async getDict() {
//
this.menuOptions = []
const res = await getCoreDepartmentList();
this.departmentlList = res.data.map(item => {
item.parentId = item.parentId ? item.parentId : 0
return item
});
const menu = { id: 0, name: '总部门', children: [] };
menu.children = this.handleTree(this.departmentlList, "id")
this.menuOptions.push(menu)
console.log('你好', this.menuOptions)
},
/** 转换菜单数据结构 */
normalizer(node) {
if (node.children && !node.children.length) {
delete node.children;
}
return {
id: node.id,
label: node.name,
children: node.children
};
}
},
};
</script>

View File

@ -0,0 +1,168 @@
<template>
<div class="app-container">
<search-bar
:formConfigs="formConfig"
ref="searchBarForm"
@headBtnClick="buttonClick" />
<base-table
v-loading="dataListLoading"
:table-props="tableProps"
:page="listQuery.pageNo"
:limit="listQuery.pageSize"
:table-data="tableData">
<method-btn
v-if="tableBtn.length"
slot="handleBtn"
:width="120"
label="操作"
:method-list="tableBtn"
@clickBtn="handleClick" />
</base-table>
<pagination
:limit.sync="listQuery.pageSize"
:page.sync="listQuery.pageNo"
:total="listQuery.total"
@pagination="getDataList" />
<base-dialog
:dialogTitle="addOrEditTitle"
:dialogVisible="addOrUpdateVisible"
@cancel="handleCancel"
@confirm="handleConfirm"
:before-close="handleCancel"
width="50%">
<add-or-update
ref="addOrUpdate"
@refreshDataList="successSubmit"></add-or-update>
</base-dialog>
</div>
</template>
<script>
import AddOrUpdate from './add-or-updata';
import basicPage from '../../core/mixins/basic-page';
import { parseTime } from '../../core/mixins/code-filter';
import {
getCoreDepartmentPage,
deleteCoreDepartment
} from '@/api/base/coreDepartment';
const tableProps = [
{
prop: 'createTime',
label: '添加时间',
filter: parseTime
},
{
prop: 'name',
label: '部门名称'
},
{
prop: 'code',
label: '部门编码'
},
{
prop: 'parentName',
label: '上级部门'
},
{
prop: 'remark',
label: '备注'
},
];
export default {
mixins: [basicPage],
data() {
return {
urlOptions: {
getDataListURL: getCoreDepartmentPage,
deleteURL: deleteCoreDepartment
},
tableProps,
tableBtn: [
this.$auth.hasPermi(`base:core-department:update`)
? {
type: 'edit',
btnName: '编辑',
}
: undefined,
this.$auth.hasPermi(`base:core-department:delete`)
? {
type: 'delete',
btnName: '删除',
}
: undefined,
].filter((v)=>v),
tableData: [],
formConfig: [
{
type: 'input',
label: '部门名',
placeholder: '部门名',
param: 'name',
},
{
type: 'button',
btnName: '查询',
name: 'search',
color: 'primary',
},
{
type: 'separate',
},
{
type: this.$auth.hasPermi('base:core-department:create') ? 'button' : '',
btnName: '新增',
name: 'add',
color: 'success',
plain: true
},
],
};
},
components: {
AddOrUpdate,
},
created() {},
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;
// });
// },
buttonClick(val) {
switch (val.btnName) {
case 'search':
this.listQuery.pageNo = 1;
this.listQuery.pageSize = 10;
this.listQuery.name = val.name ? val.name : undefined;
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);
}
},
},
};
</script>

View File

@ -0,0 +1,77 @@
<!--
* @Author: zwq
* @Date: 2021-11-18 14:16:25
* @LastEditors: DY
* @LastEditTime: 2023-11-02 14:24:12
* @Description:
-->
<template>
<el-form
:model="dataForm"
:rules="dataRule"
ref="dataForm"
@keyup.enter.native="dataFormSubmit()"
label-width="80px">
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="专业编号" prop="code">
<el-input v-model="dataForm.code" clearable placeholder="请输入专业编号" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="专业名称" prop="name">
<el-input v-model="dataForm.name" clearable placeholder="请输入专业名称" />
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="缩写" prop="abbreviation">
<el-input v-model="dataForm.abbreviation" clearable placeholder="请输入缩写" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="备注" prop="remark">
<el-input
v-model="dataForm.remark"
placeholder="请输入备注" />
</el-form-item>
</el-col>
</el-row>
</el-form>
</template>
<script>
import basicAdd from '../../core/mixins/basic-add';
import { createCoreMajor, updateCoreMajor, getCoreMajor, getCode } from "@/api/base/coreMajor";
export default {
mixins: [basicAdd],
data() {
return {
urlOptions: {
isGetCode: true,
codeURL: getCode,
createURL: createCoreMajor,
updateURL: updateCoreMajor,
infoURL: getCoreMajor,
},
dataForm: {
id: undefined,
code: undefined,
name: undefined,
abbreviation: undefined,
remark: undefined,
},
departmentlList: [],
menuOptions: [],
dataRule: {
code: [{ required: true, message: "专业编码不能为空", trigger: "blur" }],
name: [{ required: true, message: "专业名称不能为空", trigger: "blur" }]
}
};
},
mounted() {},
methods: {}
};
</script>

View File

@ -0,0 +1,168 @@
<template>
<div class="app-container">
<search-bar
:formConfigs="formConfig"
ref="searchBarForm"
@headBtnClick="buttonClick" />
<base-table
v-loading="dataListLoading"
:table-props="tableProps"
:page="listQuery.pageNo"
:limit="listQuery.pageSize"
:table-data="tableData">
<method-btn
v-if="tableBtn.length"
slot="handleBtn"
:width="120"
label="操作"
:method-list="tableBtn"
@clickBtn="handleClick" />
</base-table>
<pagination
:limit.sync="listQuery.pageSize"
:page.sync="listQuery.pageNo"
:total="listQuery.total"
@pagination="getDataList" />
<base-dialog
:dialogTitle="addOrEditTitle"
:dialogVisible="addOrUpdateVisible"
@cancel="handleCancel"
@confirm="handleConfirm"
:before-close="handleCancel"
width="50%">
<add-or-update
ref="addOrUpdate"
@refreshDataList="successSubmit"></add-or-update>
</base-dialog>
</div>
</template>
<script>
import AddOrUpdate from './add-or-updata';
import basicPage from '../../core/mixins/basic-page';
import { parseTime } from '../../core/mixins/code-filter';
import {
getCoreMajorPage,
deleteCoreMajor
} from '@/api/base/coreMajor';
const tableProps = [
{
prop: 'createTime',
label: '添加时间',
filter: parseTime
},
{
prop: 'code',
label: '专业编码'
},
{
prop: 'name',
label: '专业名称'
},
{
prop: 'abbreviation',
label: '缩写'
},
{
prop: 'remark',
label: '备注'
},
];
export default {
mixins: [basicPage],
data() {
return {
urlOptions: {
getDataListURL: getCoreMajorPage,
deleteURL: deleteCoreMajor
},
tableProps,
tableBtn: [
this.$auth.hasPermi(`base:core-major:update`)
? {
type: 'edit',
btnName: '编辑',
}
: undefined,
this.$auth.hasPermi(`base:core-major:delete`)
? {
type: 'delete',
btnName: '删除',
}
: undefined,
].filter((v)=>v),
tableData: [],
formConfig: [
{
type: 'input',
label: '名称',
placeholder: '专业',
param: 'name',
},
{
type: 'button',
btnName: '查询',
name: 'search',
color: 'primary',
},
{
type: 'separate',
},
{
type: this.$auth.hasPermi('base:core-major:create') ? 'button' : '',
btnName: '新增',
name: 'add',
color: 'success',
plain: true
},
],
};
},
components: {
AddOrUpdate,
},
created() {},
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;
// });
// },
buttonClick(val) {
switch (val.btnName) {
case 'search':
this.listQuery.pageNo = 1;
this.listQuery.pageSize = 10;
this.listQuery.name = val.name ? val.name : undefined;
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);
}
},
},
};
</script>

View File

@ -0,0 +1,65 @@
<!--
* @Author: zwq
* @Date: 2023-08-01 15:27:31
* @LastEditors: zwq
* @LastEditTime: 2023-08-01 16:25:54
* @Description:
-->
<template>
<div :class="[className, { 'p-0': noPadding }]">
<slot />
</div>
</template>
<script>
export default {
props: {
size: {
// : xl lg md sm
type: String,
default: 'de',
validator: function (val) {
return ['xl', 'lg', 'de', 'md', 'sm'].indexOf(val) !== -1;
},
},
noPadding: {
type: Boolean,
default: false,
},
},
computed: {
className: function () {
return `${this.size}-title`;
},
},
};
</script>
<style lang="scss" scoped>
$pxls: (xl, 28px) (lg, 24px) (de, 20px) (md, 18px) (sm, 16px);
$mgr: 8px;
@each $size, $height in $pxls {
.#{$size}-title {
font-size: 18px;
line-height: $height;
color: #000;
font-weight: 500;
font-family: '微软雅黑', 'Microsoft YaHei', Arial, Helvetica, sans-serif;
&::before {
content: '';
display: inline-block;
vertical-align: top;
width: 4px;
height: $height + 2px;
border-radius: 1px;
margin-right: $mgr;
background-color: #0b58ff;
}
}
}
.p-0 {
padding: 0;
}
</style>

View File

@ -0,0 +1,417 @@
<!--
* @Author: zwq
* @Date: 2021-11-18 14:16:25
* @LastEditors: DY
* @LastEditTime: 2023-11-04 17:57:18
* @Description:
-->
<template>
<el-drawer
:visible.sync="visible"
:show-close="false"
:wrapper-closable="false"
class="drawer"
size="50%">
<small-title slot="title" :no-padding="true">
{{ isdetail ? '详情' : !dataForm.id ? '新增' : '编辑' }}
</small-title>
<div class="content">
<div class="visual-part">
<el-form
:model="dataForm"
:rules="dataRule"
ref="dataForm"
@keyup.enter.native="dataFormSubmit()"
label-width="100px"
label-position="top">
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="产品名称" prop="name">
<el-input v-model="dataForm.name" :disabled="isdetail" clearable placeholder="请输入产品名称" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="产品编码" prop="code">
<el-input
v-model="dataForm.code"
clearable
:disabled="isdetail"
placeholder="请输入产品编码" />
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="物料类型" prop="materialType">
<el-select
v-model="dataForm.materialType"
filterable
:disabled="isdetail"
style="width: 100%"
placeholder="请选择物料类型">
<el-option
v-for="dict in getDictDatas('material_type')"
:key="dict.value"
:label="dict.label"
:value="dict.value" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="产品类型" prop="productType">
<el-select
v-model="dataForm.productType"
filterable
:disabled="isdetail"
style="width: 100%"
placeholder="请选择产品类型">
<el-option
v-for="dict in getDictDatas(DICT_TYPE.PRODUCT_TYPE)"
:key="dict.value"
:label="dict.label"
:value="dict.value" />
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="单位" prop="unit">
<el-select
v-model="dataForm.unit"
filterable
:disabled="isdetail"
style="width: 100%"
placeholder="请选择单位">
<el-option
v-for="dict in getDictDatas(DICT_TYPE.UNIT_DICT)"
:key="dict.value"
:label="dict.label"
:value="dict.value" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="单位平方数" prop="area">
<el-input-number v-model="dataForm.area" :precision="2" style="width: 100%" :disabled="isdetail" clearable placeholder="请输入单位平方数" />
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="规格" prop="specifications">
<el-input v-model="dataForm.specifications" :disabled="isdetail" clearable placeholder="请输入规格" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="产线生产单位用时(S)" prop="processTime">
<el-input v-model.number="dataForm.processTime" type="number" :disabled="isdetail" clearable placeholder="请输入产线生产单位用时" />
</el-form-item>
</el-col>
</el-row>
<el-form-item label="备注" prop="remark">
<el-input v-model="dataForm.remark" :disabled="isdetail" clearable placeholder="请输入备注" />
</el-form-item>
</el-form>
</div>
<div class="drawer-body__footer">
<el-button style="" @click="goback()">取消</el-button>
<el-button v-if="isdetail" type="primary" @click="goEdit()">
编辑
</el-button>
<el-button v-else type="primary" @click="dataFormSubmit()">确定</el-button>
</div>
<div class="attr-list" v-if="idAttrShow">
<small-title
style="margin: 16px 0; padding-left: 8px"
:no-padding="true">
产品属性
</small-title>
<div v-if="!isdetail" class="action_btn">
<template>
<span style="display: inline-block;" @click="addNew()">
<svg-icon style="width: 14px; height: 14px" class="item-icon" icon-class="table_add" />
<span class="add">添加</span>
</span>
</template>
</div>
<base-table
:table-props="tableProps"
:page="listQuery.pageNo"
:limit="listQuery.pageSize"
:table-data="productAttrList">
<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 class="drawer-body__footer">
<el-button type="primary" @click="goback()">关闭</el-button>
</div>
</div>
</div>
<attr-add
v-if="addOrUpdateVisible"
ref="addOrUpdate"
:product-id="dataForm.id"
@refreshDataList="getList" />
</el-drawer>
</template>
<script>
import basicAdd from '../../core/mixins/basic-add';
import { createCoreProduct, updateCoreProduct, getCoreProduct, getCode, getCoreProductAttrPage, deleteCoreProductAttr } from "@/api/base/coreProduct";
import SmallTitle from './SmallTitle';
import { parseTime } from '../../core/mixins/code-filter';
import attrAdd from './attr-add';
import {DICT_TYPE, getDictDatas} from "@/utils/dict";
const tableBtn = [
{
type: 'edit',
btnName: '编辑',
},
{
type: 'delete',
btnName: '删除',
},
];
const tableProps = [
{
prop: 'createTime',
label: '添加时间',
filter: parseTime,
},
{
prop: 'name',
label: '属性名',
},
{
prop: 'value',
label: '属性值',
},
];
const topBtnConfig = [
{
type: 'add',
btnName: 'btn.add'
}
]
export default {
mixins: [basicAdd],
components: { SmallTitle, attrAdd },
data() {
return {
tableBtn,
tableProps,
topBtnConfig,
addOrUpdateVisible: false,
urlOptions: {
isGetCode: true,
codeURL: getCode,
createURL: createCoreProduct,
updateURL: updateCoreProduct,
infoURL: getCoreProduct,
},
listQuery: {
pageSize: 10,
pageNo: 1,
total: 0,
},
dataForm: {
id: undefined,
code: undefined,
name: '',
materialType: undefined,
productType: undefined,
area: undefined,
specifications: undefined,
processTime: 0,
remark: undefined,
unit: undefined
},
productAttrList: [],
visible: false,
isdetail: false,
idAttrShow: false,
dataRule: {
code: [{ required: true, message: "物料编码不能为空", trigger: "blur" }],
name: [{ required: true, message: "物料名称不能为空", trigger: "blur" }],
materialType: [{ required: true, message: "物料类型不能为空", trigger: "change" }],
productType: [{ required: true, message: "产品类型不能为空", trigger: "change" }],
processTime: [{ required: true, message: "产线生产单位用时不能为空", trigger: "blur" }]
}
};
},
mounted() {},
methods: {
initData() {
this.productAttrList.splice(0);
this.listQuery.total = 0;
},
handleClick(raw) {
if (raw.type === 'delete') {
this.$confirm(
`确定对${
raw.data.attrName
? '[名称=' + raw.data.attrName + ']'
: '[序号=' + raw.data._pageIndex + ']'
}进行删除操作?`,
'提示',
{
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
}
)
.then(() => {
deleteCoreProductAttr(raw.data.id).then(({ data }) => {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.getList();
},
});
});
})
.catch(() => {});
} else {
this.addNew(raw.data.id);
}
},
getList() {
//
getCoreProductAttrPage({
...this.listQuery,
productId: this.dataForm.id,
}).then((response) => {
this.productAttrList = response.data.list;
this.listQuery.total = response.data.total;
});
},
init(id, isdetail) {
this.initData();
this.isdetail = isdetail || false;
this.dataForm.id = id || undefined;
this.visible = true;
if (id) {
this.idAttrShow = true
} else {
this.idAttrShow = false
}
this.$nextTick(() => {
this.$refs['dataForm'].resetFields();
if (this.dataForm.id) {
//
this.urlOptions.infoURL(id).then(response => {
this.dataForm = response.data
this.dataForm.unit = String(this.dataForm.unit)
this.dataForm.materialType = String(this.dataForm.materialType)
this.dataForm.productType = String(this.dataForm.productType)
});
//
this.getList();
} else {
if (this.urlOptions.isGetCode) {
this.getCode()
}
}
});
},
goback() {
this.$emit('refreshDataList');
this.visible = false;
// this.initData();
},
goEdit() {
this.isdetail = false;
},
// /
addNew(id) {
this.addOrUpdateVisible = true;
this.$nextTick(() => {
this.$refs.addOrUpdate.init(id);
});
}
}
};
</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;
}
.action_btn {
float: right;
margin: 5px 15px;
font-size: 14px;
}
.add {
color: #0b58ff;
}
</style>

View File

@ -0,0 +1,141 @@
<template>
<el-dialog
:visible.sync="visible"
:width="'35%'"
:append-to-body="true"
:close-on-click-modal="false"
class="dialog">
<template #title>
<slot name="title">
<div class="titleStyle">
{{ !dataForm.id ? '新增' : '编辑' }}
</div>
</slot>
</template>
<el-form
ref="dataForm"
:model="dataForm"
:rules="dataRule"
label-width="100px"
@keyup.enter.native="dataFormSubmit()">
<el-form-item label="属性名" prop="name">
<el-input
v-model="dataForm.name"
placeholder="请输入属性名"
clearable />
</el-form-item>
<el-form-item label="属性值" prop="value">
<el-input
v-model="dataForm.value"
placeholder="请输入属性值"
clearable />
</el-form-item>
</el-form>
<el-row style="text-align: right">
<el-button @click="visible = false">取消</el-button>
<el-button type="primary" @click="dataFormSubmit()">确定</el-button>
</el-row>
</el-dialog>
</template>
<script>
import {
createCoreProductAttr,
updateCoreProductAttr,
getCoreProductAttr
} from '@/api/base/coreProduct';
export default {
props: {
productId: {
type: String,
default: '',
},
},
data() {
return {
visible: false,
dataForm: {
id: undefined,
name: '',
value: '',
},
dataRule: {
attrName: [{ required: true, message: '名称不能为空', trigger: 'blur' }],
},
};
},
methods: {
init(id) {
this.dataForm.id = id || '';
this.visible = true;
this.$nextTick(() => {
this.$refs['dataForm'].resetFields();
if (this.dataForm.id) {
getCoreProductAttr({
id: this.dataForm.id
}).then((res) => {
const { name, value } = res.data;
this.dataForm.name = name;
this.dataForm.value = value;
});
}
});
},
//
dataFormSubmit() {
this.$refs['dataForm'].validate((valid) => {
if (valid) {
//
if (this.dataForm.id) {
updateCoreProductAttr({
...this.dataForm,
productId: this.productId,
}).then((response) => {
this.$modal.msgSuccess('修改成功');
this.visible = false;
this.$emit('refreshDataList');
});
return;
}
//
createCoreProductAttr({
...this.dataForm,
productId: this.productId,
}).then((response) => {
this.$modal.msgSuccess('新增成功');
this.visible = false;
this.$emit('refreshDataList');
});
}
});
},
},
};
</script>
<style scoped>
.dialog >>> .el-dialog__body {
padding: 30px 24px;
}
.dialog >>> .el-dialog__header {
font-size: 16px;
color: rgba(0, 0, 0, 0.85);
font-weight: 500;
padding: 13px 24px;
border-bottom: 1px solid #e9e9e9;
}
.dialog >>> .el-dialog__header .titleStyle::before {
content: '';
display: inline-block;
width: 4px;
height: 16px;
background-color: #0b58ff;
border-radius: 1px;
margin-right: 8px;
position: relative;
top: 2px;
}
</style>

View File

@ -0,0 +1,186 @@
<template>
<div class="app-container">
<search-bar
:formConfigs="formConfig"
ref="searchBarForm"
@headBtnClick="buttonClick" />
<base-table
v-loading="dataListLoading"
:table-props="tableProps"
:page="listQuery.pageNo"
:limit="listQuery.pageSize"
:table-data="tableData">
<method-btn
v-if="tableBtn.length"
slot="handleBtn"
:width="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="successSubmit" />
</div>
</template>
<script>
import AddOrUpdate from './add-or-updata';
import basicPage from '../../core/mixins/basic-page';
import { parseTime } from '../../core/mixins/code-filter';
import { publicFormatter } from '@/utils/dict';
import {
getCoreProductPage,
deleteCoreProduct
} from '@/api/base/coreProduct';
const tableProps = [
{
prop: 'createTime',
label: '添加时间',
filter: parseTime
},
{
prop: 'name',
label: '产品名称'
},
{
prop: 'code',
label: '产品编码'
},
{
prop: 'productType',
label: '产品类型',
filter: publicFormatter('product_type')
},
{
prop: 'specifications',
label: '规格'
},
{
prop: 'unit',
label: '单位',
filter: publicFormatter('unit_dict')
},
{
prop: 'remark',
label: '备注',
},
];
export default {
mixins: [basicPage],
data() {
return {
urlOptions: {
getDataListURL: getCoreProductPage,
deleteURL: deleteCoreProduct
},
tableProps,
tableBtn: [
this.$auth.hasPermi(`base:core-product:update`)
? {
type: 'edit',
btnName: '编辑',
}
: undefined,
this.$auth.hasPermi(`base:core-product:detail`)
? {
type: 'detail',
btnName: '查看详情',
}
: undefined,
this.$auth.hasPermi(`base:core-product:delete`)
? {
type: 'delete',
btnName: '删除',
}
: undefined,
].filter((v)=>v),
tableData: [],
formConfig: [
{
type: 'input',
label: '工单名称',
placeholder: '工单名称',
param: 'name'
},
{
type: 'input',
label: '产品编号',
placeholder: '产品编号',
param: 'code'
},
{
type: 'button',
btnName: '查询',
name: 'search',
color: 'primary',
},
{
type: 'separate',
},
{
type: this.$auth.hasPermi('base:core-product:create') ? 'button' : '',
btnName: '新增',
name: 'add',
color: 'success',
plain: true
},
],
};
},
components: {
AddOrUpdate
},
created() {},
methods: {
//
otherMethods(val) {
if (val.type === 'detail') {
this.addOrUpdateVisible = true;
this.addOrEditTitle = "详情";
this.$nextTick(() => {
this.$refs.addOrUpdate.init(val.data.id, true);
});
}
},
buttonClick(val) {
switch (val.btnName) {
case 'search':
this.listQuery.pageNo = 1;
this.listQuery.pageSize = 10;
this.listQuery.name = val.name ? val.name : undefined;
this.listQuery.code = val.code ? val.code : undefined;
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);
}
},
},
};
</script>

View File

@ -0,0 +1,114 @@
<!--
* @Author: zwq
* @Date: 2021-11-18 14:16:25
* @LastEditors: DY
* @LastEditTime: 2023-11-03 19:28:06
* @Description:
-->
<template>
<el-form
:model="dataForm"
:rules="dataRule"
ref="dataForm"
@keyup.enter.native="dataFormSubmit()"
label-width="80px">
<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="code">
<el-input v-model="dataForm.code" clearable placeholder="请输入产线编号" />
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="工厂名称" prop="factoryId">
<el-select
v-model="dataForm.factoryId"
filterable
placeholder="请选择工厂">
<el-option
v-for="dict in factoryList"
:key="dict.id"
:label="dict.name"
:value="dict.id" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="产线TT值(h)" prop="tvalue">
<el-input
v-model.number="dataForm.tvalue"
type="number"
placeholder="TT值" />
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="描述信息" prop="description">
<el-input
v-model="dataForm.description"
placeholder="请输入描述信息" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="备注" prop="remark">
<el-input
v-model="dataForm.remark"
placeholder="请输入备注" />
</el-form-item>
</el-col>
</el-row>
</el-form>
</template>
<script>
import basicAdd from '../../core/mixins/basic-add';
import { createCorePL, updateCorePL, getCorePL, getCode } from "@/api/base/coreProductionLine";
import { getFactoryList } from '@/api/core/base/factory';
export default {
mixins: [basicAdd],
data() {
return {
urlOptions: {
isGetCode: true,
codeURL: getCode,
createURL: createCorePL,
updateURL: updateCorePL,
infoURL: getCorePL,
},
dataForm: {
id: undefined,
code: undefined,
name: undefined,
description: undefined,
tvalue: 0,
factoryId: undefined,
remark: undefined,
},
factoryList: [],
dataRule: {
code: [{ required: true, message: "专业编码不能为空", trigger: "blur" }],
name: [{ required: true, message: "专业名称不能为空", trigger: "blur" }],
factoryId: [{ required: true, message: "工厂不能为空", trigger: "blur" }]
}
};
},
mounted() {
this.getDict()
},
methods: {
async getDict() {
//
const factoryRes = await getFactoryList();
this.factoryList = factoryRes.data;
},
}
};
</script>

View File

@ -0,0 +1,177 @@
<template>
<div class="app-container">
<search-bar
:formConfigs="formConfig"
ref="searchBarForm"
@headBtnClick="buttonClick" />
<base-table
v-loading="dataListLoading"
:table-props="tableProps"
:page="listQuery.pageNo"
:limit="listQuery.pageSize"
:table-data="tableData">
<method-btn
v-if="tableBtn.length"
slot="handleBtn"
:width="120"
label="操作"
:method-list="tableBtn"
@clickBtn="handleClick" />
</base-table>
<pagination
:limit.sync="listQuery.pageSize"
:page.sync="listQuery.pageNo"
:total="listQuery.total"
@pagination="getDataList" />
<base-dialog
:dialogTitle="addOrEditTitle"
:dialogVisible="addOrUpdateVisible"
@cancel="handleCancel"
@confirm="handleConfirm"
:before-close="handleCancel"
width="50%">
<add-or-update
ref="addOrUpdate"
@refreshDataList="successSubmit"></add-or-update>
</base-dialog>
</div>
</template>
<script>
import AddOrUpdate from './add-or-updata';
import basicPage from '../../core/mixins/basic-page';
import { parseTime } from '../../core/mixins/code-filter';
import {
getCorePLPage,
deleteCorePL
} from '@/api/base/coreProductionLine';
const tableProps = [
{
prop: 'createTime',
label: '添加时间',
filter: parseTime
},
{
prop: 'factoryName',
label: '工厂'
},
{
prop: 'name',
label: '产线名称'
},
{
prop: 'code',
label: '产线编码'
},
{
prop: 'enabled',
label: '当前状态',
filter: (val) => ['停用', '启用'][val]
},
{
prop: 'description',
label: '描述'
},
{
prop: 'remark',
label: '备注'
},
];
export default {
mixins: [basicPage],
data() {
return {
urlOptions: {
getDataListURL: getCorePLPage,
deleteURL: deleteCorePL
},
tableProps,
tableBtn: [
this.$auth.hasPermi(`base:core-production-line:update`)
? {
type: 'edit',
btnName: '编辑',
}
: undefined,
this.$auth.hasPermi(`base:core-production-line:delete`)
? {
type: 'delete',
btnName: '删除',
}
: undefined,
].filter((v)=>v),
tableData: [],
formConfig: [
{
type: 'input',
label: '产线名称',
placeholder: '产线名称',
param: 'name'
},
{
type: 'button',
btnName: '查询',
name: 'search',
color: 'primary',
},
{
type: 'separate',
},
{
type: this.$auth.hasPermi('base:core-production-line:create') ? 'button' : '',
btnName: '新增',
name: 'add',
color: 'success',
plain: true
},
],
};
},
components: {
AddOrUpdate,
},
created() {},
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;
// });
// },
buttonClick(val) {
switch (val.btnName) {
case 'search':
this.listQuery.pageNo = 1;
this.listQuery.pageSize = 10;
this.listQuery.name = val.name ? val.name : undefined;
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);
}
},
},
};
</script>

View File

@ -0,0 +1,103 @@
<!--
* @Author: zwq
* @Date: 2021-11-18 14:16:25
* @LastEditors: DY
* @LastEditTime: 2023-11-03 11:00:47
* @Description:
-->
<template>
<el-form
:model="dataForm"
:rules="dataRule"
ref="dataForm"
@keyup.enter.native="dataFormSubmit()"
label-width="100px">
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="供应商编号" prop="code">
<el-input v-model="dataForm.code" clearable placeholder="请输入供应商编号" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="供应商名称" prop="name">
<el-input v-model="dataForm.name" clearable placeholder="请输入供应商名称" />
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="联系人" prop="contact">
<el-input v-model="dataForm.contact" clearable placeholder="请输入联系人" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="联系电话" prop="telephone">
<el-input
v-model="dataForm.telephone"
maxlength="11"
placeholder="请输入联系电话" />
</el-form-item>
</el-col>
</el-row>
<el-form-item label="地址" prop="address">
<el-input
v-model="dataForm.address"
placeholder="请输入地址" />
</el-form-item>
<el-form-item label="备注" prop="remark">
<el-input
v-model="dataForm.remark"
placeholder="请输入备注" />
</el-form-item>
</el-form>
</template>
<script>
import basicAdd from '../../core/mixins/basic-add';
import { createCoreSupplier, updateCoreSupplier, getCoreSupplier, getCode } from "@/api/base/coreSupplier";
export default {
mixins: [basicAdd],
data() {
return {
urlOptions: {
isGetCode: true,
codeURL: getCode,
createURL: createCoreSupplier,
updateURL: updateCoreSupplier,
infoURL: getCoreSupplier
},
dataForm: {
id: undefined,
code: undefined,
name: undefined,
telephone: undefined,
contact: undefined,
address: undefined,
remark: undefined
},
dataRule: {
code: [{ required: true, message: "专业编码不能为空", trigger: "blur" }],
name: [{ required: true, message: "专业名称不能为空", trigger: "blur" }],
contact: [{ required: true, message: "联系人不能为空", trigger: "blur" }],
telephone: [
{ required: false, trigger: "blur", message: "手机号不能为空" },
{
validator: function (rule, value, callback) {
if (value) {
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) {
callback(new Error("手机号格式错误"));
}
} else {
callback();
}
}, trigger: "blur"
}
]
}
};
},
mounted() {},
methods: {}
};
</script>

View File

@ -0,0 +1,176 @@
<template>
<div class="app-container">
<search-bar
:formConfigs="formConfig"
ref="searchBarForm"
@headBtnClick="buttonClick" />
<base-table
v-loading="dataListLoading"
:table-props="tableProps"
:page="listQuery.pageNo"
:limit="listQuery.pageSize"
:table-data="tableData">
<method-btn
v-if="tableBtn.length"
slot="handleBtn"
:width="120"
label="操作"
:method-list="tableBtn"
@clickBtn="handleClick" />
</base-table>
<pagination
:limit.sync="listQuery.pageSize"
:page.sync="listQuery.pageNo"
:total="listQuery.total"
@pagination="getDataList" />
<base-dialog
:dialogTitle="addOrEditTitle"
:dialogVisible="addOrUpdateVisible"
@cancel="handleCancel"
@confirm="handleConfirm"
:before-close="handleCancel"
width="50%">
<add-or-update
ref="addOrUpdate"
@refreshDataList="successSubmit"></add-or-update>
</base-dialog>
</div>
</template>
<script>
import AddOrUpdate from './add-or-updata';
import basicPage from '../../core/mixins/basic-page';
import { parseTime } from '../../core/mixins/code-filter';
import {
getCoreSupplierPage,
deleteCoreSupplier
} from '@/api/base/coreSupplier';
const tableProps = [
{
prop: 'createTime',
label: '添加时间',
filter: parseTime
},
{
prop: 'code',
label: '供应商编码'
},
{
prop: 'name',
label: '供应商名称'
},
{
prop: 'contact',
label: '联系人'
},
{
prop: 'telephone',
label: '联系电话'
},
{
prop: 'address',
label: '地址'
},
{
prop: 'remark',
label: '备注'
},
];
export default {
mixins: [basicPage],
data() {
return {
urlOptions: {
getDataListURL: getCoreSupplierPage,
deleteURL: deleteCoreSupplier
},
tableProps,
tableBtn: [
this.$auth.hasPermi(`base:core-supplier:update`)
? {
type: 'edit',
btnName: '编辑',
}
: undefined,
this.$auth.hasPermi(`base:core-supplier:delete`)
? {
type: 'delete',
btnName: '删除',
}
: undefined,
].filter((v)=>v),
tableData: [],
formConfig: [
{
type: 'input',
label: '关键字',
placeholder: '供应商名称',
param: 'name',
},
{
type: 'button',
btnName: '查询',
name: 'search',
color: 'primary',
},
{
type: 'separate',
},
{
type: this.$auth.hasPermi('base:core-supplier:create') ? 'button' : '',
btnName: '新增',
name: 'add',
color: 'success',
plain: true
},
],
};
},
components: {
AddOrUpdate,
},
created() {},
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;
// });
// },
buttonClick(val) {
switch (val.btnName) {
case 'search':
this.listQuery.pageNo = 1;
this.listQuery.pageSize = 10;
this.listQuery.name = val.name ? val.name : undefined;
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);
}
},
},
};
</script>

View File

@ -0,0 +1,65 @@
<!--
* @Author: zwq
* @Date: 2023-08-01 15:27:31
* @LastEditors: zwq
* @LastEditTime: 2023-08-01 16:25:54
* @Description:
-->
<template>
<div :class="[className, { 'p-0': noPadding }]">
<slot />
</div>
</template>
<script>
export default {
props: {
size: {
// : xl lg md sm
type: String,
default: 'de',
validator: function (val) {
return ['xl', 'lg', 'de', 'md', 'sm'].indexOf(val) !== -1;
},
},
noPadding: {
type: Boolean,
default: false,
},
},
computed: {
className: function () {
return `${this.size}-title`;
},
},
};
</script>
<style lang="scss" scoped>
$pxls: (xl, 28px) (lg, 24px) (de, 20px) (md, 18px) (sm, 16px);
$mgr: 8px;
@each $size, $height in $pxls {
.#{$size}-title {
font-size: 18px;
line-height: $height;
color: #000;
font-weight: 500;
font-family: '微软雅黑', 'Microsoft YaHei', Arial, Helvetica, sans-serif;
&::before {
content: '';
display: inline-block;
vertical-align: top;
width: 4px;
height: $height + 2px;
border-radius: 1px;
margin-right: $mgr;
background-color: #0b58ff;
}
}
}
.p-0 {
padding: 0;
}
</style>

View File

@ -0,0 +1,306 @@
<!--
* @Author: zwq
* @Date: 2021-11-18 14:16:25
* @LastEditors: DY
* @LastEditTime: 2023-11-06 14:38:20
* @Description:
-->
<template>
<el-drawer
:visible.sync="visible"
:show-close="false"
:wrapper-closable="false"
class="drawer"
size="50%">
<small-title slot="title" :no-padding="true">
{{ '预使用主原料信息' }}
</small-title>
<div class="content">
<div style="height: 10vh">
<div style="font-size: 18px;">工单名{{ dataForm.name }}</div>
</div>
<div class="attr-list">
<small-title
style="margin: 16px 0; padding-left: 8px"
:no-padding="true">
批次信息
</small-title>
<div class="action_btn">
<template>
<span style="display: inline-block;" @click="addNew()">
<svg-icon style="width: 14px; height: 14px" class="item-icon" icon-class="table_add" />
<span class="add">添加</span>
</span>
</template>
</div>
<base-table
:table-props="tableProps"
:page="listQuery.pageNo"
:limit="listQuery.pageSize"
:table-data="materialList">
<method-btn
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 class="drawer-body__footer">
<el-button type="primary" @click="goback()">关闭</el-button>
</div>
</div>
<attr-add
v-if="addOrUpdateVisible"
ref="addOrUpdate"
:work-order-id="dataForm.id"
@refreshDataList="getList" />
</el-drawer>
</template>
<script>
import basicAdd from '../../core/mixins/basic-add';
import { getCoreWOMaPage, deleteCoreWOMa } from "@/api/base/coreWorkOrder";
import SmallTitle from './SmallTitle';
import { parseTime } from '../../core/mixins/code-filter';
import attrAdd from './attr-add';
import { publicFormatter } from "@/utils/dict";
const tableBtn = [
{
type: 'edit',
btnName: '编辑',
},
{
type: 'delete',
btnName: '删除',
}
];
const tableProps = [
{
prop: 'createTime',
label: '添加时间',
filter: parseTime,
},
{
prop: 'material',
label: '原料名称'
},
{
prop: 'origin',
label: '来源',
filter: (val) => ['', '内部', '采购'][val]
},
{
prop: 'supplierId',
label: '供应商',
},
{
prop: 'batch',
label: '批次',
},
{
prop: 'num',
label: '数量',
},
{
prop: 'unit',
label: '单位',
filter: publicFormatter('unit_dict')
},
];
const topBtnConfig = [
{
type: 'add',
btnName: 'btn.add'
}
]
export default {
mixins: [basicAdd],
components: { SmallTitle, attrAdd },
data() {
return {
tableBtn,
tableProps,
topBtnConfig,
addOrUpdateVisible: false,
listQuery: {
pageSize: 10,
pageNo: 1,
total: 0,
},
dataForm: {
id: undefined,
name: ''
},
materialList: [],
visible: false,
isdetail: false
};
},
mounted() {},
methods: {
initData() {
this.materialList.splice(0);
this.listQuery.total = 0;
},
handleClick(raw) {
if (raw.type === 'delete') {
this.$confirm(
`确定对${
raw.data.attrName
? '[名称=' + raw.data.attrName + ']'
: '[序号=' + raw.data._pageIndex + ']'
}进行删除操作?`,
'提示',
{
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
}
)
.then(() => {
deleteCoreWOMa(raw.data.id).then(({ data }) => {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.getList();
},
});
});
})
.catch(() => {});
} else {
this.addNew(raw.data.id);
}
},
getList() {
// 使
getCoreWOMaPage({
...this.listQuery,
workOrderId: this.dataForm.id,
}).then((response) => {
this.materialList = response.data.list;
this.listQuery.total = response.data.total;
});
},
init(row, isdetail) {
this.initData();
this.isdetail = isdetail || false;
this.dataForm.id = row.id || undefined;
this.dataForm.name = row.name || '';
this.visible = true;
this.getList()
// this.$nextTick(() => {
// this.$refs['dataForm'].resetFields();
// if (this.dataForm.id) {
// //
// this.urlOptions.infoURL(id).then(response => {
// this.dataForm = response.data
// this.dataForm.unit = String(this.dataForm.unit)
// this.dataForm.materialType = String(this.dataForm.materialType)
// this.dataForm.productType = String(this.dataForm.productType)
// });
// //
// this.getList();
// } else {
// if (this.urlOptions.isGetCode) {
// this.getCode()
// }
// }
// });
},
goback() {
this.visible = false;
this.$emit('refreshDataList');
// this.initData();
},
goEdit() {
this.isdetail = false;
},
// /
addNew(id) {
this.addOrUpdateVisible = true;
console.log('22', id)
this.$nextTick(() => {
this.$refs.addOrUpdate.init(id);
});
}
}
};
</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;
}
.action_btn {
float: right;
margin: 5px 15px;
font-size: 14px;
}
.add {
color: #0b58ff;
}
</style>

View File

@ -0,0 +1,301 @@
<template>
<el-form ref="dataForm" :rules="rules" label-width="130px" :model="dataForm">
<el-row>
<el-col :span='12'>
<el-form-item label="工单名称" prop="name">
<el-input v-model="dataForm.name"></el-input>
</el-form-item>
</el-col>
<el-col :span='12'>
<el-form-item label="工单编码" prop="code">
<el-input v-model="dataForm.code" disabled></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span='12'>
<el-form-item label="产品名称" prop="planProductId">
<el-select v-model="dataForm.planProductId" placeholder="请选择" style="width: 100%;" @change="selectProduct">
<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-col :span='12'>
<el-form-item label="产品规格" prop="productSpec">
<el-input v-model="dataForm.productSpec" disabled></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span='12'>
<el-form-item label="计划开始时间">
<el-date-picker
v-model="planStartTime"
type="datetime"
value-format="yyyy-MM-dd HH:mm:ss"
style="width: 100%;"
placeholder="选择日期">
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span='12'>
<el-form-item label="计划完成时间">
<el-date-picker
v-model="planFinishTime"
type="datetime"
value-format="yyyy-MM-dd HH:mm:ss"
style="width: 100%;"
placeholder="选择日期">
</el-date-picker>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span='12'>
<el-form-item label="计划投入数量" prop="planAssignQuantity">
<el-input-number v-model="dataForm.planAssignQuantity" :min="0" :max="9999999999999" style="width: 100%;"></el-input-number>
</el-form-item>
</el-col>
<el-col :span='12'>
<el-form-item label="计划生产数量" prop="planQuantity">
<el-input-number v-model="dataForm.planQuantity" :min="0" :max="9999999999999" style="width: 100%;"></el-input-number>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span='12'>
<el-form-item label="关联工艺" prop="processFlowId">
<el-select v-model="dataForm.processFlowId" placeholder="请选择" style="width: 100%;">
<el-option
v-for="item in processFlowList"
: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="dataForm.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="priority">
<el-select v-model="dataForm.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-col :span='12'>
<el-form-item label="工单类型" prop="type">
<el-select v-model="dataForm.type" placeholder="请选择" style="width: 100%;">
<el-option
v-for="item in workOrderTypeList"
: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="productLineIds">
<el-select v-model="dataForm.productLineIds" placeholder="请选择" multiple style="width: 100%;">
<el-option
v-for="item in productLineList"
: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="workers">
<el-input v-model="dataForm.workers"></el-input>
</el-form-item>
</el-col>
</el-row>
<!-- <el-row>
<el-col :span='12'>
<el-form-item label="计划分配订单量" prop="planAssignmentQuantity">
<el-input-number v-model="form.planAssignmentQuantity" :min="0" :max="9999999999999" style="width: 100%;"></el-input-number>
</el-form-item>
</el-col>
</el-row> -->
</el-form>
</template>
<script>
import { getProductAll } from '@/api/base/product'
import { getProcessFlowList, workOrderList } from '@/api/base/orderManage'
import { createCoreWO, updateCoreWO, getCode, getCoreWO } from '@/api/base/coreWorkOrder'
import { getLineAll } from '@/api/base/productionLine'
import basicAdd from '../../core/mixins/basic-add';
export default {
name: 'AddWorkOrder',
mixins: [basicAdd],
data() {
return {
urlOptions: {
isGetCode: true,
codeURL: getCode,
createURL: createCoreWO,
updateURL: updateCoreWO,
infoURL: getCoreWO
},
dataForm: {
id: undefined,
workOrderId: '',
name: '',
code: '',
planProductId: '',
productSpec: '',
planStartTime: '',
planFinishTime: '',
planAssignQuantity: 0,
planQuantity: 0,
processFlowId: '',
materialMethod: 1,
priority: '',
productLineIds: [],
type: '',
workers: '',
status: 1
},
rules: {
name: [{ required: true, message: "工单名称不能为空", trigger: "blur" }],
planProductId: [{ required: true, message: "产品名称不能为空", trigger: "change" }],
planAssignQuantity: [{ required: true, message: "计划投入数量不能为空", trigger: "blur" }],
planQuantity: [{ required: true, message: "计划生产数量不能为空", trigger: "blur" }],
productLineIds: [{ required: true, message: "产品不能为空", trigger: "change" }]
},
productList: [],
processFlowList: [],
productLineList: [],
workOrderTypeList: [
{id: 1,name:'标准工单'},
{id: 2, name:'特殊工单'}
],
planStartTime: '',
planFinishTime: '',
isBind: false,
workOrderList: []
}
},
mounted() {
this.getDict()
},
methods: {
init(id) {
this.dataForm.id = id || "";
this.visible = true;
if (this.urlOptions.getOption) {
this.getArr()
}
this.$nextTick(() => {
this.$refs["dataForm"].resetFields();
this.planStartTime = ''
this.planFinishTime = ''
if (this.dataForm.id) {
getCoreWO(id).then(response => {
this.dataForm = response.data;
});
} else {
if (this.urlOptions.isGetCode) {
this.getCode()
}
}
});
},
//
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.$confirm('是否添加预使用主原料信息?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$emit("refreshDataList", true);
}).catch(() => {
this.$emit("refreshDataList");
});
});
});
},
getCode() {
this.urlOptions.codeURL()
.then(({ data: res }) => {
this.dataForm.code = res;
})
.catch(() => {});
},
getDict() {
//
getProductAll().then(res => {
this.productList = res.data || []
})
// 线
getLineAll().then(res => {
this.productLineList = res.data || []
})
//
getProcessFlowList().then(res => {
this.processFlowList = res.data || []
})
// list
workOrderList({
status: 1
}).then(res => {
this.workOrderList = res.data || []
})
},
//
selectProduct(val) {
if (val) {
this.productList.map(item => {
if (val === item.id) {
this.dataForm.productSpec = item.specifications
}
})
} else {
this.dataForm.productSpec = ''
}
}
}
}
</script>

View File

@ -0,0 +1,211 @@
<template>
<el-dialog
:visible.sync="visible"
:width="'35%'"
:append-to-body="true"
:close-on-click-modal="false"
class="dialog">
<template #title>
<slot name="title">
<div class="titleStyle">
{{ !dataForm.id ? '新增' : '编辑' }}
</div>
</slot>
</template>
<el-form
ref="dataForm"
:model="dataForm"
:rules="dataRule"
label-width="100px"
@keyup.enter.native="dataFormSubmit()">
<el-form-item label="原料" prop="material">
<el-select
v-model="dataForm.material"
filterable
style="width: 100%"
placeholder="请选择原料">
<el-option
v-for="dict in getDictDatas('material')"
:key="dict.value"
:label="dict.label"
:value="dict.value" />
</el-select>
</el-form-item>
<el-form-item label="来源" prop="origin">
<el-select
v-model="dataForm.origin"
filterable
style="width: 100%"
placeholder="请选择来源">
<el-option
v-for="dict in originList"
:key="dict.value"
:label="dict.label"
:value="dict.value" />
</el-select>
</el-form-item>
<el-form-item label="供应商" prop="supplierId">
<el-select
v-model="dataForm.supplierId"
filterable
style="width: 100%"
placeholder="请选择供应商">
<el-option
v-for="dict in supplierList"
:key="dict.id"
:label="dict.name"
:value="dict.id" />
</el-select>
</el-form-item>
<el-form-item label="批次号" prop="batch">
<el-input
v-model="dataForm.batch"
clearable
placeholder="请输入规格" />
</el-form-item>
<el-form-item label="数量" prop="num">
<el-input-number
v-model="dataForm.num"
clearable
style="width: 100%"
placeholder="请输入数量" />
</el-form-item>
<el-form-item label="单位" prop="unit">
<el-select
v-model="dataForm.unit"
filterable
style="width: 100%"
placeholder="请选择单位">
<el-option
v-for="dict in getDictDatas('unit_dict')"
:key="dict.value"
:label="dict.label"
:value="dict.value" />
</el-select>
</el-form-item>
</el-form>
<el-row style="text-align: right">
<el-button @click="visible = false">取消</el-button>
<el-button type="primary" @click="dataFormSubmit()">确定</el-button>
</el-row>
</el-dialog>
</template>
<script>
import {
createCoreWOMa,
updateCoreWOMa,
getCoreWOMa
} from '@/api/base/coreWorkOrder';
import { getSupplierList } from "@/api/base/material";
import { getDictDatas} from "@/utils/dict";
export default {
props: {
workOrderId: {
type: String,
default: '',
},
},
data() {
return {
visible: false,
dataForm: {
id: undefined,
material: '',
origin: undefined,
supplierId: undefined,
batch: undefined,
num: 0,
unit: undefined
},
originList: [
{ label: '内部', value: 1},
{ label: '采购', value: 2}
],
supplierList: [],
dataRule: {
material: [{ required: true, message: '物料不能为空', trigger: 'blur' }],
num: [{ required: true, message: '数量不能为空', trigger: 'blur' }]
},
};
},
mounted() {
this.getDict()
},
methods: {
async getDict() {
//
const supplierRes = await getSupplierList();
this.supplierList = supplierRes.data;
},
init(id) {
this.dataForm.id = id || '';
console.log('1', this.dataForm.id)
this.visible = true;
this.$nextTick(() => {
this.$refs['dataForm'].resetFields();
if (this.dataForm.id) {
getCoreWOMa(this.dataForm.id).then((res) => {
this.dataForm = res.data
});
}
});
},
//
dataFormSubmit() {
this.$refs['dataForm'].validate((valid) => {
if (valid) {
//
if (this.dataForm.id) {
updateCoreWOMa({
...this.dataForm,
workOrderId: this.workOrderId,
}).then((response) => {
this.$modal.msgSuccess('修改成功');
this.visible = false;
this.$emit('refreshDataList');
});
return;
}
//
createCoreWOMa({
...this.dataForm,
workOrderId: this.workOrderId,
}).then((response) => {
this.$modal.msgSuccess('新增成功');
this.visible = false;
this.$emit('refreshDataList');
});
}
});
},
},
};
</script>
<style scoped>
.dialog >>> .el-dialog__body {
padding: 30px 24px;
}
.dialog >>> .el-dialog__header {
font-size: 16px;
color: rgba(0, 0, 0, 0.85);
font-weight: 500;
padding: 13px 24px;
border-bottom: 1px solid #e9e9e9;
}
.dialog >>> .el-dialog__header .titleStyle::before {
content: '';
display: inline-block;
width: 4px;
height: 16px;
background-color: #0b58ff;
border-radius: 1px;
margin-right: 8px;
position: relative;
top: 2px;
}
</style>

View File

@ -0,0 +1,413 @@
<!--
* @Author: zwq
* @Date: 2021-11-18 14:16:25
* @LastEditors: DY
* @LastEditTime: 2023-11-06 17:08:22
* @Description:
-->
<template>
<el-drawer
:visible.sync="visible"
:show-close="false"
:wrapper-closable="false"
class="drawer"
size="50%">
<small-title slot="title" :no-padding="true">
{{ isdetail ? '详情' : !dataForm.id ? '新增' : '编辑' }}
</small-title>
<div class="content">
<div>
<h2>工单编码{{ dataForm.code }}</h2>
</div>
<small-title
style="margin: 16px 0; padding-left: 8px"
:no-padding="true">
基本信息
</small-title>
<div class="formContent">
<el-row :gutter="20">
<el-col :span="8">工单名称:{{ dataForm.name }}</el-col>
<el-col :span="8">工单来源:{{ dataForm.triggerOrigin === 1 ? 'MES' : dataForm.triggerOrigin === 2 ? 'ERP' : ''}}</el-col>
<el-col :span="8">所属订单:
<span v-for="(item, index) in orderArray" :key="index" style="margin-right: 10px">{{ item.name }}</span>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="8">产品名称:{{ dataForm.productName }}</el-col>
<el-col :span="8"> :{{ dataForm.specifications }}</el-col>
<el-col :span="8">计划生产数量:{{ dataForm.planQuantity }}</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="8">预计用时(小时):{{ dataForm.expectedTime }}</el-col>
<el-col :span="8">计划投入数量:{{ dataForm.planAssignQuantity }}</el-col>
<el-col :span="8">优先级:{{ fitlerP(dataForm.priority) }}</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="8">负责人:{{ dataForm.workers }}</el-col>
<el-col :span="8">关联产线:{{ dataForm.productLineNames }}</el-col>
<el-col :span="8">物料计算方式:{{ dataForm.materialMethod === 1 ? '产品基础' : dataForm.materialMethod === 2 ? '工艺扩展' : '' }}</el-col>
</el-row>
</div>
<small-title
style="margin: 16px 0; padding-left: 8px"
:no-padding="true">
生产信息
</small-title>
<div class="formContent">
<el-row :gutter="20">
<el-col :span="8">订单创建时间:
<span v-for="(item, index) in orderArray" :key="index" style="margin-right: 10px">{{ item.createTime }}</span>
</el-col>
<el-col :span="8">计划开始时间:{{ dataForm.planStartTime }}</el-col>
<el-col :span="8">计划完成时间:{{ dataForm.planFinishTime }}</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="8">预计结束时间:{{ dataForm.computeFinishTime }}</el-col>
<el-col :span="8">实际开始时间:{{ dataForm.startProduceTime }}</el-col>
<el-col :span="8">实际完成时间:{{ dataForm.finishProduceTime }}</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="8">工单状态:{{ fitlerS(dataForm.status) }}</el-col>
<el-col :span="8">实际投入数量:{{ dataForm.assignQuantity }}</el-col>
<el-col :span="8">实际生产数量:{{ dataForm.actualQuantity }}</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="8">废片数量:{{ dataForm.nokQuantity }}</el-col>
<el-col :span="8">检测瑕疵数:{{ 0 }}</el-col>
</el-row>
</div>
<div class="attr-list">
<small-title
style="margin: 16px 0; padding-left: 8px"
:no-padding="true">
订单相关信息
</small-title>
<base-table
:table-props="tableProps"
:page="listQuery.pageNo"
:limit="listQuery.pageSize"
:table-data="orderList">
<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 class="attr-list">
<small-title
style="margin: 16px 0; padding-left: 8px"
:no-padding="true">
预计用料信息
</small-title>
<base-table
:table-props="tableProps1"
:page="listQuery1.pageNo"
:limit="listQuery1.pageSize"
:table-data="materialList" />
<!-- <pagination
v-show="listQuery1.total > 0"
:total="listQuery1.total"
:page.sync="listQuery1.pageNo"
:limit.sync="listQuery1.pageSize"
:page-sizes="[5, 10, 15]"
@pagination="getList" /> -->
</div>
<div class="drawer-body__footer">
<el-button type="primary" @click="goback()">关闭</el-button>
</div>
</div>
</el-drawer>
</template>
<script>
// import basicAdd from '../../core/mixins/basic-add';
import { getCoreWO, getMaterialBomPage, getConOrderList } from "@/api/base/coreWorkOrder";
import { orderList } from "@/api/base/orderManage";
import SmallTitle from './SmallTitle';
import { publicFormatter } from "@/utils/dict";
const tableBtn = [
{
type: 'edit',
btnName: '编辑',
},
{
type: 'delete',
btnName: '删除',
},
];
const tableProps = [
{
prop: 'orderName',
label: '订单名称',
},
{
prop: 'orderCode',
label: '订单编码',
},
{
prop: 'priority',
label: '优先级',
filter: (val) => ['', '低', '正常', '高'][val]
},
{
prop: 'planAssignmentQuantity',
label: '计划分配数量',
},
{
prop: 'actualAssignmentQuantity',
label: '实际分配数量',
}
];
const tableProps1 = [
{
prop: 'materialName',
label: '原料名称'
},
{
prop: 'unit',
label: '单位',
filter: publicFormatter('unit_dict')
},
{
prop: 'num',
label: '剩余生产预计消耗'
},
];
export default {
components: { SmallTitle },
data() {
return {
tableBtn,
tableProps,
tableProps1,
addOrUpdateVisible: false,
urlOptions: {
infoURL: getCoreWO
},
listQuery: {
pageSize: 10,
pageNo: 1,
total: 0,
},
listQuery1: {
pageSize: 10,
pageNo: 1,
total: 0,
},
dataForm: {},
orderList: [],
materialList: [],
orderArray: [],
visible: false,
isdetail: false,
};
},
mounted() {},
methods: {
fitlerP(val) {
if (val) {
if (val === 1) {
return '低'
} else if (val === 2) {
return '正常'
} else {
return '高'
}
}
},
fitlerS(val) {
if (val) {
if (val === 1) {
return '等待'
} else if (val === 2) {
return '激活'
} else if (val === 3) {
return '暂停'
} else if (val === 4) {
return '完成'
} else {
return '作废'
}
}
},
initData() {
this.orderList.splice(0);
this.materialList.splice(0);
},
handleClick(raw) {
if (raw.type === 'delete') {
this.$confirm(
`确定对${
raw.data.attrName
? '[名称=' + raw.data.attrName + ']'
: '[序号=' + raw.data._pageIndex + ']'
}进行删除操作?`,
'提示',
{
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
}
)
.then(() => {
deleteCoreProductAttr(raw.data.id).then(({ data }) => {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.getList();
},
});
});
})
.catch(() => {});
} else {
this.addNew(raw.data.id);
}
},
getList() {
//
getConOrderList({
workOrderId: this.dataForm.id,
}).then((response) => {
this.orderList = response.data;
// this.listQuery.total = response.data.total;
});
// 使
if (this.dataForm.planProductId) {
getMaterialBomPage({
productId: this.dataForm.planProductId,
}).then((response) => {
this.materialList = response.data;
// this.listQuery.total = response.data.length;
});
}
//
orderList({
workOrderId: this.dataForm.id
}).then((response) => {
this.orderArray = response.data;
// this.listQuery.total = response.data.total;
});
},
init(id, isdetail) {
this.initData();
this.isdetail = isdetail || false;
this.dataForm.id = id || undefined;
this.visible = true;
this.$nextTick(() => {
if (this.dataForm.id) {
//
this.urlOptions.infoURL(id).then(response => {
this.dataForm = response.data
//
this.getList();
});
} else {
if (this.urlOptions.isGetCode) {
this.getCode()
}
}
});
},
goback() {
this.visible = false;
this.$emit('refreshDataList');
// this.initData();
},
goEdit() {
this.isdetail = false;
},
// /
addNew(id) {
this.addOrUpdateVisible = true;
this.$nextTick(() => {
this.$refs.addOrUpdate.init(id);
});
}
}
};
</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: 10px 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;
}
.formContent {
font-size: 16px;
line-height: 1.5;
margin-bottom: 10px;
}
.action_btn {
float: right;
margin: 5px 15px;
font-size: 14px;
}
.add {
color: #0b58ff;
}
</style>

View File

@ -0,0 +1,401 @@
<template>
<div class="app-container">
<search-bar
:formConfigs="formConfig"
ref="searchBarForm"
@headBtnClick="buttonClick" />
<base-table
v-loading="dataListLoading"
:table-props="tableProps"
:page="listQuery.pageNo"
:limit="listQuery.pageSize"
:table-data="tableData">
<method-btn
v-if="tableBtn.length"
slot="handleBtn"
:width="300"
label="操作"
:method-list="tableBtn"
@clickBtn="handleClick" />
</base-table>
<pagination
:limit.sync="listQuery.pageSize"
:page.sync="listQuery.pageNo"
:total="listQuery.total"
@pagination="getDataList" />
<base-dialog
:dialogTitle="addOrEditTitle"
:dialogVisible="addOrUpdateVisible"
@cancel="handleCancel"
@confirm="handleConfirm"
:before-close="handleCancel"
width="70%">
<add-work-order
ref="addOrUpdate"
@refreshDataList="refreshWorkOrder"></add-work-order>
</base-dialog>
<!-- 预使用原料信息 -->
<add-or-update
v-if="materialVisible"
ref="material"
@refreshDataList="closeDetail"></add-or-update>
<!-- 查看详情 -->
<detail
v-if="detailVisible"
ref="detail"
@refreshDataList="closeDetail"></detail>
</div>
</template>
<script>
import AddOrUpdate from './add-or-updata';
import AddWorkOrder from './addWorkOrder'
import Detail from './detail.vue';
import basicPage from '../../core/mixins/basic-page';
import { parseTime } from '../../core/mixins/code-filter';
import {
getCoreWOPage,
deleteCoreWO,
statusChange
} from '@/api/base/coreWorkOrder';
const tableProps = [
{
prop: 'createTime',
label: '创建时间',
filter: parseTime
},
{
prop: 'name',
label: '工单名称'
},
{
prop: 'code',
label: '工单编码'
},
{
prop: 'workers',
label: '负责人'
},
{
prop: 'priority',
label: '优先级',
filter: (val) => ['', '低', '正常', '高'][val]
},
{
prop: 'triggerOrigin',
label: '来源',
filter: (val) => ['', 'MES', 'ERP'][val]
},
{
prop: 'status',
label: '工单状态',
filter: (val) => ['', '等待', '激活', '暂停', '完成', '', '', '', '', '作废'][val]
},
{
prop: 'planFinishTime',
label: '计划完成时间',
filter: parseTime
},
{
prop: 'planQuantity',
label: '计划生产数量'
},
{
prop: 'actualQuantity',
label: '实际生产数量'
}
];
export default {
mixins: [basicPage],
components: {
AddWorkOrder,
AddOrUpdate,
Detail
},
data() {
return {
urlOptions: {
getDataListURL: getCoreWOPage,
deleteURL: deleteCoreWO
},
detailVisible: false,
materialVisible: false,
tableProps,
tableBtn: [
this.$auth.hasPermi(`base:core-work-order:update`)
? {
type: 'edit',
btnName: '编辑',
showParam: {
type: '&',
data: [
{
name: 'status',
type: 'equal',
value: 1
}
]
}
}
: undefined,
this.$auth.hasPermi(`base:core-work-order:material`)
? {
type: 'material',
btnName: '预使用原料信息',
}
: undefined,
this.$auth.hasPermi(`base:core-work-order:detail`)
? {
type: 'detail',
btnName: '查看详情',
}
: undefined,
this.$auth.hasPermi(`base:core-work-order:delete`)
? {
type: 'delete',
btnName: '删除',
showParam: {
type: '|',
data: [
{
name: 'status',
type: 'equal',
value: 1
}
]
}
}
: undefined,
{
type: 'active',
btnName: '激活',
showParam: {
type: '|',
data: [
{
name: 'status',
type: 'equal',
value: 1
},
{
name: 'status',
type: 'equal',
value: 3
}
]
}
},
{
type: 'pause',
btnName: '暂停',
showParam: {
type: '|',
data: [
{
name: 'status',
type: 'equal',
value: 2
}
]
}
},
{
type: 'nullify',
btnName: '作废',
showParam: {
type: '|',
data: [
{
name: 'status',
type: 'equal',
value: 3
},
{
name: 'status',
type: 'equal',
value: 3
},
{
name: 'status',
type: 'equal',
value: 4
}
]
}
},
{
type: 'finish',
btnName: '完成',
showParam: {
type: '|',
data: [
{
name: 'status',
type: 'equal',
value: 2
},
{
name: 'status',
type: 'equal',
value: 3
}
]
}
}
].filter((v)=>v),
tableData: [],
formConfig: [
{
type: 'input',
label: '工单名称',
placeholder: '工单名称',
param: 'name'
},
{
type: 'select',
label: '状态',
selectOptions: [
{ id: 1, name: '等待' },
{ id: 2, name: '激活' },
{ id: 3, name: '暂停' },
{ id: 4, name: '完成' },
{ id: 9, name: '作废' }
],
param: 'status',
clearable: true
},
{
type: 'datePicker',
label: '工单实际开始时间',
dateType: 'datetimerange',
format: 'yyyy-MM-dd',
valueFormat: 'yyyy-MM-dd HH:mm:ss',
rangeSeparator: '-',
startPlaceholder: '开始时间',
endPlaceholder: '结束时间',
width: 350,
param: 'time'
},
{
type: 'button',
btnName: '查询',
name: 'search',
color: 'primary',
},
{
type: 'separate',
},
{
type: this.$auth.hasPermi('base:core-work-order:create') ? 'button' : '',
btnName: '新增',
name: 'add',
color: 'success',
plain: true
},
],
};
},
created() {},
methods: {
refreshWorkOrder(val) {
console.log(val)
if (val) {
console.log('打印')
} else {
this.successSubmit()
}
},
closeDetail() {
this.detailVisible = false
this.materialVisible = false
this.getDataList()
},
//
otherMethods(val) {
if (val.type === 'material') {
this.materialVisible = true;
this.addOrEditTitle = "预使用主原料信息";
this.$nextTick(() => {
this.$refs.material.init(val.data, true);
});
} else if (val.type === 'detail') {
this.detailVisible = true;
this.addOrEditTitle = "详情";
this.$nextTick(() => {
this.$refs.detail.init(val.data.id, true);
});
} else {
const param = {
id: val.data.id,
status: undefined
}
if (val.type === 'active') {
param.status = 2
}
if (val.type === 'pause') {
param.status = 3
}
if (val.type === 'nullify') {
param.status = 9
}
if (val.type === 'finish') {
param.status = 4
}
console.log('22',val)
this.$confirm(`确定对${'[工单名称=' + val.data.name + ']'}进行${val.type}操作?`, "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
statusChange(param).then(({ data }) => {
this.$message({
message: '暂停成功!',
type: 'success',
duration: 1500,
onClose: () => {
this.getDataList();
},
});
});
})
.catch(() => { });
}
},
buttonClick(val) {
switch (val.btnName) {
case 'search':
this.listQuery.pageNo = 1;
this.listQuery.pageSize = 10;
this.listQuery.name = val.name ? val.name : undefined;
this.listQuery.status = val.status ? val.status : undefined;
this.listQuery.startProduceTime = val.time ? val.time : undefined
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);
}
},
},
};
</script>

View File

@ -0,0 +1,339 @@
<!--
* @Author: zwq
* @Date: 2021-11-18 14:16:25
* @LastEditors: DY
* @LastEditTime: 2023-11-03 11:01:24
* @Description:
-->
<template>
<el-form
:model="dataForm"
:rules="dataRule"
ref="dataForm"
@keyup.enter.native="dataFormSubmit()"
label-width="80px">
<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="fileUrl">
<imageUpload v-model="dataForm.fileUrl" :limit="1"/>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="员工号" prop="code">
<el-input v-model="dataForm.code" clearable placeholder="请输入员工号" />
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="性别" prop="sex">
<el-select
v-model="dataForm.sex"
filterable
placeholder="请选择性别">
<el-option
v-for="dict in sexList"
: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="telephone">
<el-input v-model="dataForm.telephone" maxlength="11" clearable placeholder="请输入电话" />
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="部门" prop="departmentId">
<treeselect v-model="dataForm.departmentId" :options="menuOptions" :normalizer="normalizer" :show-count="true" placeholder="选择部门"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="职位" prop="position">
<el-input v-model="dataForm.position" clearable placeholder="请输入职位" />
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="专业" prop="majorIdList">
<el-select
v-model="majorIdList"
filterable
multiple
placeholder="请选择专业">
<el-option
v-for="dict in majorList"
: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="entryTime">
<el-date-picker
v-model="dataForm.entryTime"
type="date"
format='yyyy-MM-dd'
value-format='timestamp'
placeholder="选择入职时间" />
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="状态" prop="status">
<el-radio-group v-model="dataForm.status" @input="setOut">
<el-radio :label="1">在职</el-radio>
<el-radio :label="2">离职</el-radio>
</el-radio-group>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="离职时间" prop="outTime">
<el-date-picker
v-model="dataForm.outTime"
type="date"
:disabled="isOut"
format='yyyy-MM-dd'
value-format='timestamp'
placeholder="选择离职时间" />
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="教育程度" prop="education">
<el-select
v-model="dataForm.education"
filterable
placeholder="请选择教育程度">
<el-option
v-for="dict in educationList"
: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="workCost">
<el-input type="number" v-model.number="dataForm.workCost" clearable placeholder="请输入劳务成本" />
</el-form-item>
</el-col>
</el-row>
<el-form-item label="备注" prop="remark">
<el-input
v-model="dataForm.remark"
placeholder="请输入备注" />
</el-form-item>
</el-form>
</template>
<script>
import basicAdd from '../../core/mixins/basic-add';
import { createCoreWorker, updateCoreWorker, getCoreWorker, getCode, createWoBindMa, getWoBindMaPage, deleteWoBindMa } from "@/api/base/coreWorker";
import { getCoreDepartmentList } from "@/api/base/coreDepartment";
import { getCoreMajorList } from "@/api/base/coreMajor";
import ImageUpload from '@/components/ImageUpload';
import Treeselect from "@riophae/vue-treeselect";
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
export default {
mixins: [basicAdd],
components: {
ImageUpload,
Treeselect
},
data() {
return {
urlOptions: {
isGetCode: true,
codeURL: getCode,
createURL: createCoreWorker,
updateURL: updateCoreWorker,
infoURL: getCoreWorker,
},
sexList: [
{ id: 0, name: '男' },
{ id: 1, name: '女' }
],
educationList: [
{ id: '1', name: '初中' },
{ id: '2', name: '高中' },
{ id: '3', name: '中专' },
{ id: '5', name: '大专' },
{ id: '6', name: '大学本科' },
{ id: '7', name: '研究生及以上' }
],
departmentList: [],
majorList: [],
isOut: true,
dataForm: {
id: undefined,
code: undefined,
name: undefined,
fileUrl: undefined,
sex: 0,
telephone: undefined,
departmentId: undefined,
position: undefined,
entryTime: new Date().getTime(),
status: 1,
outTime: undefined,
education: undefined,
workCost: undefined,
remark: undefined,
},
majorIdList: undefined,
departmentlList: [],
menuOptions: [],
bindIds: [],
workerId: '',
dataRule: {
code: [{ required: true, message: "员工编码不能为空", trigger: "blur" }],
name: [{ required: true, message: "员工姓名不能为空", trigger: "blur" }],
telephone: [
{ required: false, trigger: "blur", message: "手机号不能为空" },
{
validator: function (rule, value, callback) {
if (value) {
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) {
callback(new Error("手机号格式错误"));
}
} else {
callback();
}
}, trigger: "blur"
}
],
}
};
},
mounted() {
this.getDict()
},
methods: {
async getDict() {
//
this.menuOptions = []
const res = await getCoreDepartmentList();
this.departmentlList = res.data.map(item => {
item.parentId = item.parentId ? item.parentId : 0
return item
});
// const menu = { id: 0, name: '', children: [] };
// menu.children = this.handleTree(this.departmentlList, "id")
this.menuOptions = this.handleTree(this.departmentlList, "id")
//
const majorRes = await getCoreMajorList();
this.majorList = majorRes.data;
},
setOut(val) {
if (val === 1) {
this.isOut = true
} else {
this.isOut = false
}
},
//
dataFormSubmit() {
console.log('111', this.dataForm)
this.$refs["dataForm"].validate((valid) => {
if (!valid) {
return false;
}
// --
this.bindIds.forEach(id => {
deleteWoBindMa(id).then(res => {})
});
//
if (this.dataForm.id) {
this.urlOptions.updateURL(this.dataForm).then(response => {
this.$modal.msgSuccess("修改成功");
this.visible = false;
this.$emit("refreshDataList");
});
this.majorIdList.forEach(majorId => {
createWoBindMa({
workerId: this.dataForm.id,
majorId: majorId
}).then(res => {})
});
return;
}
//
this.urlOptions.createURL(this.dataForm).then(response => {
// response.data = id
this.workerId = response.data
this.majorIdList.forEach(majorId => {
createWoBindMa({
workerId: this.workerId,
majorId: majorId
}).then(res => {})
});
this.$modal.msgSuccess("新增成功");
this.visible = false;
this.$emit("refreshDataList");
});
});
},
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;
});
// --
getWoBindMaPage({
pageSize: 99,
pageNo: 1,
workerId: id
}).then(res => {
this.majorIdList = res.data.list.map(item => {
return item.majorId
})
this.bindIds = res.data.list.map(item => {
return item.id
})
})
} else {
if (this.urlOptions.isGetCode) {
this.getCode()
}
}
});
},
/** 转换菜单数据结构 */
normalizer(node) {
if (node.children && !node.children.length) {
delete node.children;
}
return {
id: node.id,
label: node.name,
children: node.children
};
}
}
};
</script>

View File

@ -0,0 +1,204 @@
<template>
<div class="app-container">
<search-bar
:formConfigs="formConfig"
ref="searchBarForm"
@headBtnClick="buttonClick" />
<base-table
v-loading="dataListLoading"
:table-props="tableProps"
:page="listQuery.pageNo"
:limit="listQuery.pageSize"
:table-data="tableData">
<method-btn
v-if="tableBtn.length"
slot="handleBtn"
:width="120"
label="操作"
:method-list="tableBtn"
@clickBtn="handleClick" />
</base-table>
<pagination
:limit.sync="listQuery.pageSize"
:page.sync="listQuery.pageNo"
:total="listQuery.total"
@pagination="getDataList" />
<base-dialog
:dialogTitle="addOrEditTitle"
:dialogVisible="addOrUpdateVisible"
@cancel="handleCancel"
@confirm="handleConfirm"
:before-close="handleCancel"
width="50%">
<add-or-update
ref="addOrUpdate"
@refreshDataList="successSubmit"></add-or-update>
</base-dialog>
</div>
</template>
<script>
import AddOrUpdate from './add-or-updata';
import basicPage from '../../core/mixins/basic-page';
import { parseTime } from '../../core/mixins/code-filter';
import {
getCoreWorkerPage,
deleteCoreWorker
} from '@/api/base/coreWorker';
import moment from 'moment';
const tableProps = [
{
prop: 'createTime',
label: '创建时间',
filter: parseTime
},
{
prop: 'name',
label: '姓名'
},
{
prop: 'code',
label: '员工号'
},
{
prop: 'sex',
label: '性别',
filter: (val) => ['男', '女'][val]
},
{
prop: 'entryTime',
label: '入职时间',
filter: (val) => val ? moment(val).format('yyyy-MM-DD') : '',
},
{
prop: 'telephone',
label: '联系电话'
},
{
prop: 'status',
label: '状态',
filter: (val) => ['', '在职', '离职'][val]
},
{
prop: 'departmentName',
label: '部门'
},
{
prop: 'majorName',
label: '专业'
},
{
prop: 'remark',
label: '备注'
},
];
export default {
mixins: [basicPage],
data() {
return {
urlOptions: {
getDataListURL: getCoreWorkerPage,
deleteURL: deleteCoreWorker
},
tableProps,
tableBtn: [
this.$auth.hasPermi(`base:core-worker:update`)
? {
type: 'edit',
btnName: '编辑',
}
: undefined,
this.$auth.hasPermi(`base:core-worker:delete`)
? {
type: 'delete',
btnName: '删除',
}
: undefined,
].filter((v)=>v),
tableData: [],
formConfig: [
{
type: 'input',
label: '员工姓名',
placeholder: '员工姓名',
param: 'name',
},
{
type: 'select',
label: '状态',
placeholder: '请选择状态',
param: 'status',
selectOptions: [
{ id: 1, name: '在职' },
{ id: 2, name: '离职' }
],
filterable: true
},
{
type: 'button',
btnName: '查询',
name: 'search',
color: 'primary',
},
{
type: 'separate',
},
{
type: this.$auth.hasPermi('base:core-worker:create') ? 'button' : '',
btnName: '新增',
name: 'add',
color: 'success',
plain: true
},
],
};
},
components: {
AddOrUpdate,
},
created() {},
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;
// });
// },
buttonClick(val) {
switch (val.btnName) {
case 'search':
this.listQuery.pageNo = 1;
this.listQuery.pageSize = 10;
this.listQuery.name = val.name ? val.name : undefined;
this.listQuery.status = val.status ? val.status : undefined;
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);
}
},
},
};
</script>

View File

@ -0,0 +1,103 @@
<!--
* @Author: zwq
* @Date: 2021-11-18 14:16:25
* @LastEditors: DY
* @LastEditTime: 2023-11-03 19:31:25
* @Description:
-->
<template>
<el-form
:model="dataForm"
:rules="dataRule"
ref="dataForm"
@keyup.enter.native="dataFormSubmit()"
label-width="80px">
<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="code">
<el-input v-model="dataForm.code" clearable placeholder="请输入工段编号" />
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="产线" prop="productionLineId">
<el-select
v-model="dataForm.productionLineId"
filterable
placeholder="请选择产线">
<el-option
v-for="dict in proLineList"
: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="sort">
<el-input-number
v-model="dataForm.sort"
placeholder="排序" />
</el-form-item>
</el-col>
</el-row>
<el-form-item label="备注" prop="remark">
<el-input
v-model="dataForm.remark"
placeholder="请输入备注" />
</el-form-item>
</el-form>
</template>
<script>
import basicAdd from '../../core/mixins/basic-add';
import { createCWSection, updateCWSection, getCWSection, getCode } from "@/api/base/coreWorkshopSection";
import { getCorePLList } from '@/api/base/coreProductionLine';
export default {
mixins: [basicAdd],
data() {
return {
urlOptions: {
isGetCode: true,
codeURL: getCode,
createURL: createCWSection,
updateURL: updateCWSection,
infoURL: getCWSection
},
dataForm: {
id: undefined,
code: undefined,
name: undefined,
description: undefined,
sort: 0,
productionLineId: undefined,
remark: undefined,
},
proLineList: [],
dataRule: {
code: [{ required: true, message: "专业编码不能为空", trigger: "blur" }],
name: [{ required: true, message: "专业名称不能为空", trigger: "blur" }],
productionLineId: [{ required: true, message: "产线不能为空", trigger: "blur" }],
sort: [{ required: true, message: "排序不能为空", trigger: "blur" }]
}
};
},
mounted() {
this.getDict()
},
methods: {
async getDict() {
// 线
const res = await getCorePLList();
this.proLineList = res.data;
},
}
};
</script>

View File

@ -0,0 +1,172 @@
<template>
<div class="app-container">
<search-bar
:formConfigs="formConfig"
ref="searchBarForm"
@headBtnClick="buttonClick" />
<base-table
v-loading="dataListLoading"
:table-props="tableProps"
:page="listQuery.pageNo"
:limit="listQuery.pageSize"
:table-data="tableData">
<method-btn
v-if="tableBtn.length"
slot="handleBtn"
:width="120"
label="操作"
:method-list="tableBtn"
@clickBtn="handleClick" />
</base-table>
<pagination
:limit.sync="listQuery.pageSize"
:page.sync="listQuery.pageNo"
:total="listQuery.total"
@pagination="getDataList" />
<base-dialog
:dialogTitle="addOrEditTitle"
:dialogVisible="addOrUpdateVisible"
@cancel="handleCancel"
@confirm="handleConfirm"
:before-close="handleCancel"
width="50%">
<add-or-update
ref="addOrUpdate"
@refreshDataList="successSubmit"></add-or-update>
</base-dialog>
</div>
</template>
<script>
import AddOrUpdate from './add-or-updata';
import basicPage from '../../core/mixins/basic-page';
import { parseTime } from '../../core/mixins/code-filter';
import {
getCWSectionPage,
deleteCWSection
} from '@/api/base/coreWorkshopSection';
const tableProps = [
{
prop: 'createTime',
label: '添加时间',
filter: parseTime
},
{
prop: 'code',
label: '工段编码'
},
{
prop: 'name',
label: '工段名称'
},
{
prop: 'productionLineName',
label: '产线名'
},
{
prop: 'sort',
label: '排序'
},
{
prop: 'remark',
label: '备注'
},
];
export default {
mixins: [basicPage],
data() {
return {
urlOptions: {
getDataListURL: getCWSectionPage,
deleteURL: deleteCWSection
},
tableProps,
tableBtn: [
this.$auth.hasPermi(`base:core-workshop-section:update`)
? {
type: 'edit',
btnName: '编辑',
}
: undefined,
this.$auth.hasPermi(`base:core-workshop-section:delete`)
? {
type: 'delete',
btnName: '删除',
}
: undefined,
].filter((v)=>v),
tableData: [],
formConfig: [
{
type: 'input',
label: '工段名称',
placeholder: '工段名称',
param: 'name'
},
{
type: 'button',
btnName: '查询',
name: 'search',
color: 'primary',
},
{
type: 'separate',
},
{
type: this.$auth.hasPermi('base:core-workshop-section:create') ? 'button' : '',
btnName: '新增',
name: 'add',
color: 'success',
plain: true
},
],
};
},
components: {
AddOrUpdate,
},
created() {},
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;
// });
// },
buttonClick(val) {
switch (val.btnName) {
case 'search':
this.listQuery.pageNo = 1;
this.listQuery.pageSize = 10;
this.listQuery.name = val.name ? val.name : undefined;
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);
}
},
},
};
</script>

View File

@ -134,7 +134,7 @@ import printPreview from './preview'
import { MessageBox } from 'element-ui' import { MessageBox } from 'element-ui'
import { hiprint } from 'vue-plugin-hiprint' import { hiprint } from 'vue-plugin-hiprint'
import providers from './providers' import providers from './providers'
import printData from './print-data' // import printData from './print-data'
import $ from 'jquery' import $ from 'jquery'
import SmallTitle from './SmallTitle.vue' import SmallTitle from './SmallTitle.vue'
let hiprintTemplate = null let hiprintTemplate = null
@ -160,6 +160,7 @@ export default {
// width: 220, // width: 220,
// height: 80 // height: 80
}, },
printData:{},
drawer: false, drawer: false,
// //
paperTypes: { paperTypes: {
@ -355,13 +356,13 @@ export default {
}, },
preView() { preView() {
const { width } = this.curPaper const { width } = this.curPaper
this.$refs.preView.show(hiprintTemplate, printData, width) this.$refs.preView.show(hiprintTemplate, this.printData, width)
}, },
print() { print() {
// if (window.hiwebSocket.opened) { // if (window.hiwebSocket.opened) {
const printerList = hiprintTemplate.getPrinterList() const printerList = hiprintTemplate.getPrinterList()
console.log(printerList) console.log(printerList)
hiprintTemplate.print2(printData, { printer: '', title: '预览打印' }) hiprintTemplate.print2(this.printData, { printer: '', title: '预览打印' })
// return // return
// } // }
// this.$message.error(',') // this.$message.error(',')

View File

@ -2,7 +2,7 @@
* @Author: zwq * @Author: zwq
* @Date: 2021-11-18 14:16:25 * @Date: 2021-11-18 14:16:25
* @LastEditors: DY * @LastEditors: DY
* @LastEditTime: 2023-10-27 15:11:02 * @LastEditTime: 2023-11-06 19:44:24
* @Description: * @Description:
--> -->
<template> <template>
@ -56,6 +56,7 @@
v-model="dataForm.type" v-model="dataForm.type"
filterable filterable
:disabled="isdetail" :disabled="isdetail"
style="width: 100%"
placeholder="请选择物料类型"> placeholder="请选择物料类型">
<el-option <el-option
v-for="dict in materialList" v-for="dict in materialList"
@ -83,6 +84,7 @@
filterable filterable
clearable clearable
:disabled="isdetail" :disabled="isdetail"
style="width: 100%"
placeholder="请选择供应商"> placeholder="请选择供应商">
<el-option <el-option
v-for="dict in supplierList" v-for="dict in supplierList"
@ -100,9 +102,10 @@
v-model="dataForm.unit" v-model="dataForm.unit"
filterable filterable
:disabled="isdetail" :disabled="isdetail"
style="width: 100%"
placeholder="请选择物料单位"> placeholder="请选择物料单位">
<el-option <el-option
v-for="dict in unitList" v-for="dict in getDictDatas('unit_dict')"
:key="dict.value" :key="dict.value"
:label="dict.label" :label="dict.label"
:value="dict.value" /> :value="dict.value" />
@ -172,6 +175,7 @@ import { listData } from "@/api/system/dict/data";
import SmallTitle from './SmallTitle'; import SmallTitle from './SmallTitle';
import { parseTime } from '../../core/mixins/code-filter'; import { parseTime } from '../../core/mixins/code-filter';
import attrAdd from './attr-add'; import attrAdd from './attr-add';
import { getDictDatas } from "@/utils/dict";
const tableBtn = [ const tableBtn = [
{ {
@ -265,17 +269,17 @@ export default {
const supplierRes = await getSupplierList(); const supplierRes = await getSupplierList();
this.supplierList = supplierRes.data; this.supplierList = supplierRes.data;
// //
const unitRes = await listData({ // const unitRes = await listData({
pageNo: 1, // pageNo: 1,
pageSize: 99, // pageSize: 99,
dictType: 'goods_unit', // dictType: 'goods_unit',
}); // });
this.unitList = unitRes.data.list.map(item => { // this.unitList = unitRes.data.list.map(item => {
return { // return {
label: item.label, // label: item.label,
value: Number(item.value) // value: Number(item.value)
} // }
}); // });
}, },
initData() { initData() {
this.materialAttrList.splice(0); this.materialAttrList.splice(0);
@ -341,6 +345,9 @@ export default {
// //
this.urlOptions.infoURL(id).then(response => { this.urlOptions.infoURL(id).then(response => {
this.dataForm = response.data; this.dataForm = response.data;
if (this.dataForm.unit) {
this.dataForm.unit = String(this.dataForm.unit)
}
}); });
// //
this.getList(); this.getList();

View File

@ -58,10 +58,6 @@ const tableProps = [
prop: 'engName', prop: 'engName',
label: '英文名称' label: '英文名称'
}, },
{
prop: 'abbr',
label: '缩写'
},
{ {
prop: 'materialType', prop: 'materialType',
label: '物料类型' label: '物料类型'
@ -117,13 +113,13 @@ export default {
formConfig: [ formConfig: [
{ {
type: 'input', type: 'input',
label: '关键字', label: '物料名称',
placeholder: '物料名称', placeholder: '物料名称',
param: 'name', param: 'name',
}, },
{ {
type: 'input', type: 'input',
label: '关键字', label: '物料编码',
placeholder: '物料编码', placeholder: '物料编码',
param: 'code', param: 'code',
}, },
@ -228,6 +224,27 @@ export default {
console.log(val); console.log(val);
} }
}, },
//
deleteHandle(id, name, index) {
this.$confirm(`是否删除物料名称为"${name}"的数据项?`, "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
this.urlOptions.deleteURL(id).then(({ data }) => {
this.$message({
message: "操作成功",
type: "success",
duration: 1500,
onClose: () => {
this.getDataList();
},
});
});
})
.catch(() => { });
}
}, },
}; };
</script> </script>

View File

@ -2,7 +2,7 @@
* @Author: zwq * @Author: zwq
* @Date: 2021-11-18 14:16:25 * @Date: 2021-11-18 14:16:25
* @LastEditors: DY * @LastEditors: DY
* @LastEditTime: 2023-10-24 18:34:07 * @LastEditTime: 2023-11-06 19:55:59
* @Description: * @Description:
--> -->
<template> <template>
@ -64,7 +64,7 @@ export default {
data() { data() {
return { return {
urlOptions: { urlOptions: {
isGetCode: true, isGetCode: false,
codeURL: getCode, codeURL: getCode,
createURL: createMaterialDate, createURL: createMaterialDate,
updateURL: updateMaterialDate, updateURL: updateMaterialDate,
@ -81,8 +81,8 @@ export default {
materialList: [], materialList: [],
dataRule: { dataRule: {
materialId: [{ required: true, message: "物料不能为空", trigger: "blur" }], materialId: [{ required: true, message: "物料不能为空", trigger: "blur" }],
code: [{ required: true, message: "工厂编码不能为空", trigger: "blur" }], code: [{ required: true, message: "批次号不能为空", trigger: "blur" }],
name: [{ required: true, message: "工厂名称不能为空", trigger: "blur" }], name: [{ required: true, message: "批次名称不能为空", trigger: "blur" }],
} }
}; };
}, },

View File

@ -164,6 +164,27 @@ export default {
console.log(val); console.log(val);
} }
}, },
//
deleteHandle(id, name, index) {
this.$confirm(`是否删除物料批次名称为"${name}"的数据项?`, "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
this.urlOptions.deleteURL(id).then(({ data }) => {
this.$message({
message: "操作成功",
type: "success",
duration: 1500,
onClose: () => {
this.getDataList();
},
});
});
})
.catch(() => { });
}
}, },
}; };
</script> </script>

View File

@ -2,7 +2,7 @@
* @Author: zwq * @Author: zwq
* @Date: 2021-11-18 14:16:25 * @Date: 2021-11-18 14:16:25
* @LastEditors: DY * @LastEditors: DY
* @LastEditTime: 2023-10-27 16:06:44 * @LastEditTime: 2023-11-06 20:04:03
* @Description: * @Description:
--> -->
<template> <template>
@ -30,7 +30,9 @@
<el-select <el-select
v-model="dataForm.productId" v-model="dataForm.productId"
filterable filterable
clearable
:disabled="isdetail" :disabled="isdetail"
style="width: 100%"
placeholder="请选择产品"> placeholder="请选择产品">
<el-option <el-option
v-for="dict in productList" v-for="dict in productList"
@ -88,6 +90,7 @@
<el-select <el-select
v-model="scope.row.materialId" v-model="scope.row.materialId"
filterable filterable
clearable
:disabled="!scope.row.isEdit" :disabled="!scope.row.isEdit"
placeholder="请选择物料" placeholder="请选择物料"
@change="setCode(scope.row)"> @change="setCode(scope.row)">
@ -125,7 +128,7 @@
<!-- <span>{{ item.btnName | i18nFilter }}</span> --> <!-- <span>{{ item.btnName | i18nFilter }}</span> -->
</el-button> </el-button>
</el-tooltip> </el-tooltip>
<el-button v-else type="primary" size="small" @click="saveData(scope.row)">保存</el-button> <el-button v-else type="text" size="small" @click="saveData(scope.row)">保存</el-button>
<el-tooltip placement="top" content="删除"> <el-tooltip placement="top" content="删除">
<el-button <el-button
type="text" type="text"
@ -256,7 +259,7 @@ export default {
const unitRes = await listData({ const unitRes = await listData({
pageNo: 1, pageNo: 1,
pageSize: 99, pageSize: 99,
dictType: 'goods_unit', dictType: 'unit_dict',
}); });
this.unitList = unitRes.data.list.map(item => { this.unitList = unitRes.data.list.map(item => {
return { return {
@ -295,17 +298,17 @@ export default {
.catch(() => {}); .catch(() => {});
}, },
setCode(row) { setCode(row) {
this.materialList.filter(item => { const tempM = this.materialList.filter(item => {
if (row.materialId === item.id) { if (row.materialId === item.id) {
row.materialCode = item.code row.materialCode = item.code
} }
this.unitList.filter(u => { return row.materialId === item.id
if (item.unit === u.value) { })
row.unit = u.value this.unitList.filter(u => {
row.mUnit = u.label if (tempM[0].unit === u.value) {
} row.unit = u.value
}) row.mUnit = u.label
// return row.materialId === item.id }
}) })
// row.materialCode = tempList[0].code // row.materialCode = tempList[0].code
// row.unit = tempList[0].unit // row.unit = tempList[0].unit
@ -343,8 +346,7 @@ export default {
// Bom // Bom
getProBomList({ getProBomList({
...this.listQuery, ...this.listQuery,
bomId: this.dataForm.id, bomId: this.dataForm.id
createTime: ['2023-10-26 00:00:00', '2023-10-27 12:00:00']
}).then((response) => { }).then((response) => {
this.tableData = response.data.records.map(item => { this.tableData = response.data.records.map(item => {
this.unitList.filter(u => { this.unitList.filter(u => {
@ -450,7 +452,7 @@ export default {
.drawer >>> .visual-part { .drawer >>> .visual-part {
flex: 1 auto; flex: 1 auto;
max-height: 76vh; max-height: 30vh;
overflow: hidden; overflow: hidden;
overflow-y: scroll; overflow-y: scroll;
padding-right: 10px; /* 调整滚动条样式 */ padding-right: 10px; /* 调整滚动条样式 */

View File

@ -97,16 +97,10 @@ export default {
formConfig: [ formConfig: [
{ {
type: 'input', type: 'input',
label: '关键字', label: '产品名称',
placeholder: '物料名称', placeholder: '产品名称',
param: 'name', param: 'name',
}, },
{
type: 'input',
label: '关键字',
placeholder: '物料编码',
param: 'code',
},
{ {
type: 'button', type: 'button',
btnName: '查询', btnName: '查询',
@ -158,7 +152,6 @@ export default {
this.listQuery.pageNo = 1; this.listQuery.pageNo = 1;
this.listQuery.pageSize = 10; this.listQuery.pageSize = 10;
this.listQuery.name = val.name ? val.name : undefined; this.listQuery.name = val.name ? val.name : undefined;
this.listQuery.code = val.code ? val.code : undefined;
this.getDataList(); this.getDataList();
break; break;
case 'reset': case 'reset':

View File

@ -2,7 +2,7 @@
* @Author: zwq * @Author: zwq
* @Date: 2021-11-18 14:16:25 * @Date: 2021-11-18 14:16:25
* @LastEditors: DY * @LastEditors: DY
* @LastEditTime: 2023-10-26 09:43:51 * @LastEditTime: 2023-11-06 19:27:57
* @Description: * @Description:
--> -->
<template> <template>
@ -164,7 +164,7 @@ export default {
}, },
{ {
id: 2, id: 2,
name: '自动' name: 'PDA'
} }
], ],
materialList: [], materialList: [],
@ -187,7 +187,6 @@ export default {
async getDictData() { async getDictData() {
const materRes = await getMaterialList() const materRes = await getMaterialList()
this.materialList = materRes.data this.materialList = materRes.data
console.log('你好', this.materialList)
const dateRes = await getMaterDateList() const dateRes = await getMaterDateList()
this.materialDateList = dateRes.data this.materialDateList = dateRes.data
const eqRes = await getEqListAll() const eqRes = await getEqListAll()
@ -252,6 +251,9 @@ export default {
return item.id === this.dataForm.materialId return item.id === this.dataForm.materialId
}) })
this.dataForm.materialCode = tempMaterial[0].code this.dataForm.materialCode = tempMaterial[0].code
getMaterDateList({materialId: this.dataForm.materialId}).then(res =>{
this.materialDateList = res.data
})
} }
}, },
}; };

View File

@ -56,7 +56,7 @@ const tableProps = [
label: '物料编码' label: '物料编码'
}, },
{ {
prop: 'materialDateId', prop: 'materialDateName',
label: '物料批次' label: '物料批次'
}, },
{ {
@ -183,7 +183,6 @@ export default {
} else { } else {
this.listQuery.useTime = [] this.listQuery.useTime = []
} }
console.log('222', this.listQuery, val.time)
this.getDataList(); this.getDataList();
break; break;
case 'reset': case 'reset':
@ -207,6 +206,22 @@ export default {
console.log(val); console.log(val);
} }
}, },
//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.materialName, val.data._pageIndex)
} else if (val.type === "change") {
this.changeStatus(val.data.id)
} else {
this.otherMethods(val)
}
}
}, },
}; };
</script> </script>

View File

@ -1,8 +1,8 @@
/* /*
* @Author: zwq * @Author: zwq
* @Date: 2022-08-24 11:19:43 * @Date: 2022-08-24 11:19:43
* @LastEditors: DY * @LastEditors: zhp
* @LastEditTime: 2023-09-21 16:02:07 * @LastEditTime: 2023-11-01 10:30:12
* @Description: * @Description:
*/ */
export default { export default {
@ -101,7 +101,7 @@ export default {
}, },
// 删除 // 删除
deleteHandle(id, name, index) { deleteHandle(id, name, index) {
this.$confirm(`确定对${name ? '[名称=' + name + ']' : '[序号=' + index + ']'}进行删除操作?`, "提示", { this.$confirm(`是否确认删除${name ? '[' + name + ']' : '[' + index + ']'}数据项?`, "提示", {
confirmButtonText: "确定", confirmButtonText: "确定",
cancelButtonText: "取消", cancelButtonText: "取消",
type: "warning", type: "warning",

View File

@ -2,7 +2,7 @@
* @Author: zwq * @Author: zwq
* @Date: 2023-08-01 14:55:51 * @Date: 2023-08-01 14:55:51
* @LastEditors: zhp * @LastEditors: zhp
* @LastEditTime: 2023-10-30 10:44:48 * @LastEditTime: 2023-11-07 19:28:18
* @Description: * @Description:
--> -->
<template> <template>
@ -47,6 +47,7 @@ import {
import { import {
deletePacking, deletePacking,
getPackingPage, getPackingPage,
getWorkOrderList,
exportPackingExcel, exportPackingExcel,
} from '@/api/base/packingInfo'; } from '@/api/base/packingInfo';
@ -102,37 +103,41 @@ export default {
btnName: '编辑', btnName: '编辑',
} }
: undefined, : undefined,
{
type: 'print',
btnName: '打印',
},
this.$auth.hasPermi(`base:packaging-print-log:delete`) this.$auth.hasPermi(`base:packaging-print-log:delete`)
? { ? {
type: 'delete', type: 'delete',
btnName: '删除', btnName: '删除',
} }
: undefined, : undefined,
{
type: 'print',
btnName: '打印',
},
].filter((v) => v), ].filter((v) => v),
tableData: [], tableData: [],
formConfig: [ formConfig: [
{ {
type: 'input', type: 'select',
label: '工单', label: '工单',
placeholder: '工单', selectOptions: [],
param: 'workOrderId', labelField: 'name',
}, valueField: 'id',
{ param: 'workOrderId'
},
{
// parent: 'dateFilterType', // parent: 'dateFilterType',
// //
type: 'datePicker', type: 'datePicker',
label: '时间', // label: '',
dateType: 'date', dateType: 'daterange',
placeholder: '选择日期', format: 'yyyy-MM-dd HH:mm:ss',
format: 'yyyy-MM-dd', valueFormat: 'yyyy-MM-dd HH:mm:ss',
valueFormat: 'yyyy-MM-dd', defaultTime: ['00:00:00', '00:00:00'],
rangeSeparator: '-',
startPlaceholder: '开始时间',
endPlaceholder: '结束时间',
param: 'createTime', param: 'createTime',
}, },
{ {
type: 'button', type: 'button',
btnName: '搜索', btnName: '搜索',
@ -173,7 +178,9 @@ export default {
components: { components: {
AddOrUpdate, AddOrUpdate,
}, },
created() {}, created() {
this.getDict()
},
methods: { methods: {
getDataList() { getDataList() {
this.dataListLoading = true; this.dataListLoading = true;
@ -183,6 +190,30 @@ export default {
this.dataListLoading = false; this.dataListLoading = false;
}); });
}, },
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.formConfig[0].selectOptions = response.data.map((item) => {
return {
name: item.name,
id: item.id
}
})
console.log(this.formConfig[0].selectOptions);
// this.listQuery.total = response.data.total;
})
},
handlePrint(id) { handlePrint(id) {
if (id) { if (id) {
getPackingModel(id).then(res => { getPackingModel(id).then(res => {
@ -259,8 +290,14 @@ export default {
case 'search': case 'search':
this.listQuery.pageNo = 1; this.listQuery.pageNo = 1;
this.listQuery.pageSize = 10; this.listQuery.pageSize = 10;
this.listQuery.packagingCode = val.packagingCode; this.listQuery.workOrderId = val.workOrderId;
this.listQuery.createTime = val.createTime; if (val.createTime && val.createTime.length != 0) {
this.listQuery.createTime = val.createTime
// this.listQuery.createTime[1] = val.timeVal[1]
} else {
this.listQuery.createTime = undefined
// this.listQuery.endTime = undefined
}
this.getDataList(); this.getDataList();
console.log(this.tableData) console.log(this.tableData)
break; break;

View File

@ -2,7 +2,7 @@
* @Author: zwq * @Author: zwq
* @Date: 2023-08-01 14:55:51 * @Date: 2023-08-01 14:55:51
* @LastEditors: zhp * @LastEditors: zhp
* @LastEditTime: 2023-10-30 10:45:23 * @LastEditTime: 2023-11-01 10:28:29
* @Description: * @Description:
--> -->
<template> <template>
@ -44,7 +44,7 @@ const tableProps = [
{ {
prop: 'printModel', prop: 'printModel',
label: '打印方式', label: '打印方式',
filter: (val) => val ==1 ? '自动打印' : '动打印', filter: (val) => val ==1 ? '自动打印' : '动打印',
}, },
{ {
prop: 'remark', prop: 'remark',
@ -71,17 +71,16 @@ export default {
btnName: '编辑', btnName: '编辑',
} }
: undefined, : undefined,
{
type: 'print',
btnName: '打印',
},
this.$auth.hasPermi(`base:packaging-print-model:delete`) this.$auth.hasPermi(`base:packaging-print-model:delete`)
? { ? {
type: 'delete', type: 'delete',
btnName: '删除', btnName: '删除',
} }
: undefined, : undefined,
{
type: 'print',
btnName: '查看',
},
].filter((v) => v), ].filter((v) => v),
tableData: [], tableData: [],
formConfig: [ formConfig: [
@ -102,12 +101,12 @@ export default {
// valueFormat: 'yyyy-MM-dd', // valueFormat: 'yyyy-MM-dd',
// param: 'createTime', // param: 'createTime',
// }, // },
{ // {
type: 'button', // type: 'button',
btnName: '搜索', // btnName: '',
name: 'search', // name: 'search',
color: 'primary', // color: 'primary',
}, // },
// { // {
// type: 'separate', // type: 'separate',
// }, // },
@ -121,7 +120,7 @@ export default {
}, },
{ {
type: this.$auth.hasPermi('base:packaging-print-model:create') ? 'button' : '', type: this.$auth.hasPermi('base:packaging-print-model:create') ? 'button' : '',
btnName: '新增', btnName: '新增模板',
name: 'add', name: 'add',
color: 'success', color: 'success',
plain: true, plain: true,

View File

@ -4,7 +4,7 @@
<div v-if="tableData.length"> <div v-if="tableData.length">
<base-table v-loading="dataListLoading" :span-method="mergeColumnHandler" :table-props="tableProps" :table-data="tableData" /> <base-table v-loading="dataListLoading" :span-method="mergeColumnHandler" :table-props="tableProps" :table-data="tableData" />
<SearchBar :formConfigs="[{ label: '产线平衡分析图', type: 'title' }]" /> <SearchBar :formConfigs="[{ label: '产线平衡分析图', type: 'title' }]" />
<balance-chart ref="lineChart" /> <BalanceChart ref="lineChart" />
</div> </div>
<div v-else class="no-data-bg"></div> <div v-else class="no-data-bg"></div>
<!-- <pagination <!-- <pagination
@ -19,7 +19,7 @@
// import basicPage from '../../mixins/basic-page'; // import basicPage from '../../mixins/basic-page';
import { parseTime } from '../../mixins/code-filter'; import { parseTime } from '../../mixins/code-filter';
import { getCT } from '@/api/core/analysis/index'; import { getCT } from '@/api/core/analysis/index';
import { getProductionLinePage } from '@/api/core/base/productionLine'; import { getCorePLList } from '@/api/base/coreProductionLine';
import BalanceChart from '../balanceChart' import BalanceChart from '../balanceChart'
import { time } from 'echarts'; import { time } from 'echarts';
// import { getWorkshopSectionPage } from '@/api/core/base/workshopSection'; // import { getWorkshopSectionPage } from '@/api/core/base/workshopSection';
@ -68,7 +68,7 @@ export default {
spanArr: [], spanArr: [],
xData: [], xData: [],
yData: [], yData: [],
optionArrUrl: [getProductionLinePage], optionArrUrl: [getCorePLList],
formConfig: [ formConfig: [
{ {
type: 'select', type: 'select',
@ -111,7 +111,7 @@ export default {
} }
this.optionArrUrl.forEach((item, index) => { this.optionArrUrl.forEach((item, index) => {
item(params).then((response) => { item(params).then((response) => {
this.formConfig[index].selectOptions = response.data.list this.formConfig[index].selectOptions = response.data
}); });
}); });
}, },
@ -212,8 +212,10 @@ export default {
} }
this.tableProps = arr this.tableProps = arr
console.log('表格横坐标', this.xData) console.log('表格横坐标', this.xData, this.yData)
this.$refs.lineChart.initChart(this.xData, this.yData) this.$nextTick(() => {
this.$refs.lineChart.initChart(this.xData, this.yData)
})
// this.total = response.data.total; // this.total = response.data.total;
// this.dataListLoading = false; // this.dataListLoading = false;
}); });

View File

@ -1,7 +1,7 @@
<!-- <!--
* @Author: zhp * @Author: zhp
* @Date: 2023-09-13 09:02:25 * @Date: 2023-09-13 09:02:25
* @LastEditTime: 2023-10-08 16:36:37 * @LastEditTime: 2023-11-10 10:48:09
* @LastEditors: DY * @LastEditors: DY
* @Description: * @Description:
--> -->
@ -10,7 +10,7 @@
<div style="margin: 20px"> <div style="margin: 20px">
<el-button v-for="(item, index) in buttonList" :key="index" :class="[item.actived ? 'activeButton': 'normalButton']" @click="changeChart(index)">{{ item.name }}</el-button> <el-button v-for="(item, index) in buttonList" :key="index" :class="[item.actived ? 'activeButton': 'normalButton']" @click="changeChart(index)">{{ item.name }}</el-button>
</div> </div>
<div ref="chartDiv" :class="className" :style="{height:height,width:width}" /> <div id="chart" ref="chartDiv" :class="className" :style="{height:height,width:width}" />
</div> </div>
</template> </template>
@ -48,6 +48,7 @@ export default {
} }
}, },
mounted() { mounted() {
// this.initChart()
}, },
methods: { methods: {
changeChart(index) { changeChart(index) {
@ -81,7 +82,8 @@ export default {
console.log('看一下数据', this.dataArray) console.log('看一下数据', this.dataArray)
this.xDatas = xData this.xDatas = xData
this.chart = echarts.init(this.$refs.chartDiv, 'macarons') this.chart = echarts.init(this.$refs.chartDiv, 'macarons')
this.setOptions(xData, yData[0], lineName) // this.chart = echarts.init(document.getElementById('chart'), 'macarons')
// this.setOptions(xData, yData[0], lineName)
}, },
setOptions(xData, dataList, lineName) { setOptions(xData, dataList, lineName) {
// let seriesData = [] // let seriesData = []

View File

@ -19,8 +19,9 @@
// import basicPage from '../../mixins/basic-page'; // import basicPage from '../../mixins/basic-page';
import { parseTime } from '../../mixins/code-filter'; import { parseTime } from '../../mixins/code-filter';
import { getYieldAnalysisPageData } from '@/api/core/analysis/index'; import { getYieldAnalysisPageData } from '@/api/core/analysis/index';
import { getProductionLinePage } from '@/api/core/base/productionLine'; // import { getProductionLinePage } from '@/api/core/base/productionLine';
import lineChart from '../LineChart' import lineChart from '../LineChart'
import moment from 'moment';
// import { getWorkshopSectionPage } from '@/api/core/base/workshopSection'; // import { getWorkshopSectionPage } from '@/api/core/base/workshopSection';
// const tableProps = [ // const tableProps = [
@ -58,21 +59,23 @@ export default {
dataListLoading:false, dataListLoading:false,
tableData: [], tableData: [],
listQuery: { listQuery: {
lineIds: [], // lineIds: [],
time: '' recordTime: []
}, },
dateLabelList: [], dateLabelList: [],
optionArrUrl: [getProductionLinePage ], tempTtime: '',
day: 0,
xData: [],
formConfig: [ formConfig: [
{ // {
type: 'select', // type: 'select',
label: '产线', // label: '线',
selectOptions: [], // selectOptions: [],
param: 'lineIds', // param: 'lineIds',
defaultSelect: '', // defaultSelect: '',
multiple:true, // multiple:true,
filterable: true, // filterable: true,
}, // },
{ {
type: 'datePicker', type: 'datePicker',
label: '时间', label: '时间',
@ -94,127 +97,93 @@ export default {
}; };
}, },
created() { created() {
this.getArr(); // this.getArr();
}, },
methods: { methods: {
getArr() { // getArr() {
const params = { // const params = {
page: 1, // page: 1,
limit: 500, // limit: 500,
}; // };
this.optionArrUrl.forEach((item, index) => { // this.optionArrUrl.forEach((item, index) => {
item(params).then((response) => { // item(params).then((response) => {
this.formConfig[index].selectOptions = response.data.list // this.formConfig[index].selectOptions = response.data.list
// this.formConfig[0].defaultSelect = response.data.list[0].id // // this.formConfig[0].defaultSelect = response.data.list[0].id
this.$set(this.formConfig[0], 'defaultSelect', response.data.list[0].id) // this.$set(this.formConfig[0], 'defaultSelect', response.data.list[0].id)
}); // });
}); // });
// },
//
setHeader() {
const month = this.tempTtime.getMonth() + 1
let arr = [
{
prop: 'proName',
label: '产品名称',
fixed: 'left'
},
{
prop: 'specifications',
label: '产品规格',
fixed: 'left'
},
{
prop: 'sum',
label: '合计',
fixed: 'left'
},
{
label: this.tempTtime.getFullYear() + '年' + month + '月',
align: 'center',
children: []
}
]
for (let d = 1; d <= this.day; d ++) {
arr[3].children.push({
prop: 'value' + d, label: month + '-' + d
})
//
this.xData.push(month + '-' + d)
}
this.tableProps = arr
}, },
getData() { getData() {
// this.listQuery.lineIds = ['1672847052717821953']
// this.listQuery.productId = val.productId;
// this.listQuery.time = '1694486098000';
this.urlOptions.getDataListURL(this.listQuery).then(res => { this.urlOptions.getDataListURL(this.listQuery).then(res => {
let arr = [ //
{
prop: 'lineName',
label: '产线',
fixed: 'left'
},
{
prop: 'sum',
label: '合计',
fixed: 'left'
},
{
prop: res.data ? res.data.nameData[0].name : undefined,
label: res.data ? res.data.nameData[0].name : undefined,
align: 'center',
children:[
]
}
]
// console.log(res.data.nameData.slice(1))
let xData = []
let yAllData = []
let lineName = []
if (res.data) { if (res.data) {
let tempDateList = [] this.setHeader()
res.data.nameData.forEach(date => { res.data.forEach(item => {
tempDateList.push(date.name) console.log('111', item.recordTime, moment(item.recordTime).format('DD'))
}) this.tableData.push({
this.dateLabelList = Array.from(new Set(tempDateList)) proName: item.proName,
specifications: item.specifications
this.dateLabelList.forEach(item => {
if (item.indexOf('年') === -1) {
//
const props = {
'prop': item,
'label': item
}
arr[2].children.push(props)
// echarts
xData.push(item)
}
})
// res.data.nameData.slice(1).forEach(item => {
// const props = {
// 'prop': item.name,
// 'label': item.name,
// 'align': 'center'
// }
// arr[2].children.push(props)
// })
let tableDataArr =[]
res.data.data.forEach(item => {
let obj = {}
obj.lineName= item.lineName,
obj.sum= item.sum,
item.data.forEach((ele, index) => {
// console.log(ele)
ele.children.forEach((e) => {
console.log(e.dynamicName)
obj['' + e.dynamicName + ''] = e.dynamicValue
console.log(obj['' + e.dynamicName + '']);
})
}) })
tableDataArr.push(obj) })
});
this.tableData = tableDataArr
this.tableProps = arr
// let tempList = []
// res.data.nameData.slice(1).forEach(item => {
// tempList.push(item.name)
// // arr[2].children.push(props)
// })
// xData = Array.from(new Set(tempList))
res.data.data.forEach(item => {
let yData = []
lineName.push(item.lineName)
// let obj = {}
// obj.lineName = item.lineName,
// obj.sum = item.sum,
item.data.forEach((ele, index) => {
// console.log(ele)
ele.children.forEach((e) => {
// let yData = []
yData.push(e.dynamicValue)
})
})
yAllData.push(yData)
});
console.log(lineName)
} else {
this.tableProps = arr
this.tableData = []
xData = []
yAllData = []
lineName = []
} }
console.log('饿', this.tableData)
// res.data.data.forEach(item => {
// let yData = []
// lineName.push(item.lineName)
// // let obj = {}
// // obj.lineName = item.lineName,
// // obj.sum = item.sum,
// item.data.forEach((ele, index) => {
// // console.log(ele)
// ele.children.forEach((e) => {
// // let yData = []
// yData.push(e.dynamicValue)
// })
// })
// yAllData.push(yData)
// });
// console.log(lineName)
// } else {
// this.tableProps = arr
// this.tableData = []
// xData = []
// yAllData = []
// lineName = []
// }
// res.data.data[0].data[0].children.forEach((item, index) => { // res.data.data[0].data[0].children.forEach((item, index) => {
// // console.log(item) // // console.log(item)
// yData.push(item.dynamicValue) // yData.push(item.dynamicValue)
@ -222,7 +191,7 @@ export default {
// // obj['' + item.dynamicName + ''] = item.dynamicValue // // obj['' + item.dynamicName + ''] = item.dynamicValue
// }) // })
// console.log(this.yData) // console.log(this.yData)
this.$refs.lineChart.initChart(xData, yAllData, lineName) // this.$refs.lineChart.initChart(this.xData, yAllData, lineName)
// this.total = response.data.total; // this.total = response.data.total;
// this.dataListLoading = false; // this.dataListLoading = false;
}); });
@ -230,12 +199,24 @@ export default {
buttonClick(val) { buttonClick(val) {
switch (val.btnName) { switch (val.btnName) {
case 'search': case 'search':
this.listQuery.lineIds = val.lineIds ? val.lineIds :undefined // this.listQuery.recordTime = val.time ? new Date(val.time).getTime() : undefined
// this.listQuery.productId = val.productId;
this.listQuery.time = val.time ? new Date(val.time).getTime() : undefined
// this.listQuery.pageNo = 1;
// this.listQuery.pageSize = 10;
if (val.time) { if (val.time) {
this.tempTtime = new Date(val.time)
switch (this.tempTtime.getMonth() + 1) {
case 1, 3, 5, 7, 8, 10, 12:
this.day = 31;
break;
case 2:
this.day = 28;
break;
case 4, 6, 9, 11:
this.day = 30;
break;
}
this.listQuery.recordTime = [
val.time,
parseTime(new Date(this.tempTtime.getFullYear(), this.tempTtime.getMonth(), this.day, 23, 59, 59))
]
this.getData() this.getData()
} else { } else {
this.$message({ this.$message({

View File

@ -2,7 +2,7 @@
* @Author: zwq * @Author: zwq
* @Date: 2021-11-18 14:16:25 * @Date: 2021-11-18 14:16:25
* @LastEditors: DY * @LastEditors: DY
* @LastEditTime: 2023-10-16 11:16:48 * @LastEditTime: 2023-11-03 16:32:52
* @Description: * @Description:
--> -->
<template> <template>
@ -13,14 +13,6 @@
@keyup.enter.native="dataFormSubmit()" @keyup.enter.native="dataFormSubmit()"
label-width="80px"> label-width="80px">
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="12">
<el-form-item label="工厂编码" prop="code">
<el-input
v-model="dataForm.code"
clearable
placeholder="请输入工厂编码" />
</el-form-item>
</el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="工厂名称" prop="name"> <el-form-item label="工厂名称" prop="name">
<el-input <el-input
@ -29,6 +21,14 @@
placeholder="请输入工厂名称" /> placeholder="请输入工厂名称" />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12">
<el-form-item label="工厂编码" prop="code">
<el-input
v-model="dataForm.code"
clearable
placeholder="请输入工厂编码" />
</el-form-item>
</el-col>
</el-row> </el-row>
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="12"> <el-col :span="12">

View File

@ -43,19 +43,23 @@ import basicPage from '../../mixins/basic-page';
import { parseTime } from '../../mixins/code-filter'; import { parseTime } from '../../mixins/code-filter';
import { import {
deleteFactory, deleteFactory,
getFactoryPage, getFactoryPage
exportFactoryExcel,
} from '@/api/core/base/factory'; } from '@/api/core/base/factory';
const tableProps = [ const tableProps = [
{ {
prop: 'code', prop: 'createTime',
label: '工厂编码' label: '添加时间',
filter: parseTime
}, },
{ {
prop: 'name', prop: 'name',
label: '工厂名称' label: '工厂名称'
}, },
{
prop: 'code',
label: '工厂编码'
},
{ {
prop: 'address', prop: 'address',
label: '地址' label: '地址'
@ -63,12 +67,7 @@ const tableProps = [
{ {
prop: 'remark', prop: 'remark',
label: '备注' label: '备注'
}, }
{
prop: 'createTime',
label: '创建时间',
filter: parseTime
},
]; ];
export default { export default {
@ -78,17 +77,17 @@ export default {
urlOptions: { urlOptions: {
getDataListURL: getFactoryPage, getDataListURL: getFactoryPage,
deleteURL: deleteFactory, deleteURL: deleteFactory,
exportURL: exportFactoryExcel, // exportURL: exportFactoryExcel,
}, },
tableProps, tableProps,
tableBtn: [ tableBtn: [
this.$auth.hasPermi(`base:factory:update`) this.$auth.hasPermi(`base:core-factory:update`)
? { ? {
type: 'edit', type: 'edit',
btnName: '编辑', btnName: '编辑',
} }
: undefined, : undefined,
this.$auth.hasPermi(`base:factory:delete`) this.$auth.hasPermi(`base:core-factory:delete`)
? { ? {
type: 'delete', type: 'delete',
btnName: '删除', btnName: '删除',
@ -97,18 +96,18 @@ export default {
].filter((v)=>v), ].filter((v)=>v),
tableData: [], tableData: [],
formConfig: [ formConfig: [
{
type: 'input',
label: '工厂编码',
placeholder: '工厂编码',
param: 'code',
},
{ {
type: 'input', type: 'input',
label: '工厂名称', label: '工厂名称',
placeholder: '工厂名称', placeholder: '工厂名称',
param: 'name', param: 'name',
}, },
{
type: 'input',
label: '工厂编码',
placeholder: '工厂编码',
param: 'code',
},
{ {
type: 'button', type: 'button',
btnName: '搜索', btnName: '搜索',
@ -127,7 +126,7 @@ export default {
type: 'separate', type: 'separate',
}, },
{ {
type: this.$auth.hasPermi('base:factory:create') ? 'button' : '', type: this.$auth.hasPermi('base:core-factory:create') ? 'button' : '',
btnName: '新增', btnName: '新增',
name: 'add', name: 'add',
color: 'success', color: 'success',

View File

@ -1,8 +1,8 @@
/* /*
* @Author: zwq * @Author: zwq
* @Date: 2022-08-24 11:19:43 * @Date: 2022-08-24 11:19:43
* @LastEditors: zwq * @LastEditors: zhp
* @LastEditTime: 2023-08-03 14:21:04 * @LastEditTime: 2023-11-06 15:59:53
* @Description: * @Description:
*/ */
export default { export default {

View File

@ -1,7 +1,7 @@
<!-- <!--
* @Author: Do not edit * @Author: Do not edit
* @Date: 2023-08-29 14:59:29 * @Date: 2023-08-29 14:59:29
* @LastEditTime: 2023-10-16 15:10:42 * @LastEditTime: 2023-11-07 18:48:35
* @LastEditors: DY * @LastEditors: DY
* @Description: * @Description:
--> -->
@ -175,7 +175,7 @@ export default {
label: '统计开始时间', label: '统计开始时间',
dateType: 'datetimerange', dateType: 'datetimerange',
format: 'yyyy-MM-dd HH:mm:ss', format: 'yyyy-MM-dd HH:mm:ss',
valueFormat: "yyyy-MM-ddTHH:mm:ss", valueFormat: "yyyy-MM-dd HH:mm:ss",
rangeSeparator: '-', rangeSeparator: '-',
startPlaceholder: '开始时间', startPlaceholder: '开始时间',
endPlaceholder: '结束时间', endPlaceholder: '结束时间',

View File

@ -2,7 +2,7 @@
filename: index.vue filename: index.vue
author: liubin author: liubin
date: 2023-08-04 14:44:58 date: 2023-08-04 14:44:58
description: 设备24小时生产记录 description: 近24小时产线生产数据
--> -->
<template> <template>
<div class="app-container"> <div class="app-container">
@ -24,6 +24,8 @@
<script> <script>
import { getPdlDataOneDay } from '@/api/core/monitoring/data24' import { getPdlDataOneDay } from '@/api/core/monitoring/data24'
import { parseTime } from '../../mixins/code-filter';
import { Loading } from 'element-ui';
export default { export default {
name: 'productionLineData24', name: 'productionLineData24',
@ -54,28 +56,32 @@ export default {
}, },
methods: { methods: {
/** 构建tableProps - 依据第一个元素所提供的信息 */ /** 构建tableProps - 依据第一个元素所提供的信息 */
buildProps(plData) { buildProps() {
plData.forEach(item => { //
this.timeList.push(item.name) var currentTime = new Date();
}) let timeArr = []
const timeArray = Array.from(new Set(this.timeList))
console.log('nihc', timeArray) // 24--
for (const times of timeArray) { for (let i = 0; i < 24; i ++) {
if (times !== '投入数量' && times !== '产出数量' && times !== '报废数量' && times !== '产出面积') { timeArr.unshift(new Date(currentTime.getFullYear(), currentTime.getMonth(), currentTime.getDate(), currentTime.getHours() - i, 0, 0).getTime())
const subprop = { }
label: times.slice(0, 10) + ' ' + times.slice(11), console.log("24小时内的开始时间" + timeArr, timeArr.length);
align: 'center', for(const times of timeArr) {
children: [ const subprop = {
{ prop: times + '_in', label: '投入数量' }, label: parseTime(times),
{ prop: times + '_out', label: '产出数量' }, align: 'center',
{ prop: times + '_junk', label: '报废数量' }, children: [
{ prop: times + '_area', label: '产出面积' } { prop: times + '_up', label: '上片数据' },
] { prop: times + '_down', label: '下片数据' },
} { prop: times + '_good', label: '良品面积' },
this.arr.push(subprop) { prop: times + '_bad', label: '报废数据' },
{ prop: times + '_percent', label: '报废比例(%)' }
]
} }
this.arr.push(subprop)
} }
this.tableProps = this.arr this.tableProps = this.arr
console.log('111', this.tableProps)
}, },
setRowSpan(arr) { setRowSpan(arr) {
let count = 0 let count = 0
@ -100,22 +106,13 @@ export default {
let sectionArr= [] let sectionArr= []
console.log('打印看下数据list', list) console.log('打印看下数据list', list)
list.forEach((ele, index) => { list.forEach((ele, index) => {
let tempData = [] let tempData = {}
ele.data.forEach(item => { tempData[ele.recordTime + '_up'] = ele.inputNum
item.children.forEach(params => { tempData[ele.recordTime + '_down'] = ele.outputNum
if (params.dynamicName === '投入数量') { tempData[ele.recordTime + '_up'] = ele.inputNum
tempData[item.dynamicName + '_in'] = params.dynamicValue tempData['proLineName'] = ele.lineName
} else if (params.dynamicName === '产出数量') { tempData['workOrderName'] = ele.workOrderName
tempData[item.dynamicName + '_out'] = params.dynamicValue tempData['spec'] = ele.specifications
} else if (params.dynamicName === '报废数量') {
tempData[item.dynamicName + '_junk'] = params.dynamicValue
} else {
tempData[item.dynamicName + '_area'] = params.dynamicValue
}
})
})
tempData['proLineName'] = ele.proLineName
tempData['spec'] = ele.spec
this.tableData.push(tempData) this.tableData.push(tempData)
console.log('看看数据', this.tableData, tempData) console.log('看看数据', this.tableData, tempData)
const { proLineName } = tempData const { proLineName } = tempData
@ -151,17 +148,23 @@ export default {
prop: 'proLineName', prop: 'proLineName',
label: '生产线', label: '生产线',
fixed: 'left', fixed: 'left',
showOverflowTooltip: true 'show-overflow-tooltip': true
},
{
prop: 'workOrderName',
label: '当前工单',
fixed: 'left',
'show-overflow-tooltip': true
}, },
{ {
prop: 'spec', prop: 'spec',
label: '产品规格', label: '产品规格',
fixed: 'left', fixed: 'left',
showOverflowTooltip: true 'show-overflow-tooltip': true
} }
] ]
this.buildProps(res.data.nameData); this.buildProps();
this.buildData(res.data.data); this.buildData(res.data);
}) })
// // const data = this.res.data; // // const data = this.res.data;

View File

@ -0,0 +1,162 @@
<template>
<el-form ref="addOrUpdate" :rules="rules" label-width="130px" :model="form">
<el-row>
<el-col :span='12'>
<el-form-item label="订单名" prop="orderId">
<el-select v-model="form.orderId" placeholder="请选择" style="width: 100%;">
<el-option
v-for="item in orderList"
: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="name">
<el-input v-model="form.name"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span='12'>
<el-form-item label="发货时间" prop="deliveryTime">
<el-date-picker
v-model="form.deliveryTime"
type="datetime"
format='yyyy-MM-dd HH:mm:ss'
value-format="timestamp"
style="width: 100%;"
placeholder="选择日期">
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span='12'>
<el-form-item label="发货单号" prop="code">
<el-input v-model="form.code"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span='12'>
<el-form-item label="发货负责人" prop="deliveryPersonId">
<el-select v-model="form.deliveryPersonId" placeholder="请选择" style="width: 100%;">
<el-option
v-for="item in personList"
: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="principal">
<el-input v-model="form.principal"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span='12'>
<el-form-item label="运输联系方式" prop="principalCall">
<el-input v-model="form.principalCall"></el-input>
</el-form-item>
</el-col>
<el-col :span='12'>
<el-form-item label="运输费用" prop="principalCost">
<el-input-number v-model="form.principalCost" :min="0" :max='9999999999' :precision='2'></el-input-number>
</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-form>
</template>
<script>
import { orderList } from '@/api/base/orderManage'
import { getWorkerList } from '@/api/base/worker'
import { deliveryLogCreate, deliveryLogUpdate, getDeliveryLog } from '@/api/base/delivery'
export default {
name: 'AddOrUpdate',
data() {
return {
form: {
id: '',
orderId: '',
name: '',
code: '',
deliveryTime: null,
deliveryPersonId: '',
principal: '',
principalCall: '',
principalCost: 0.00,
remark: ''
},
isEdit: false,
rules: {
orderId: [{ required: true, message: "订单名不能为空", trigger: "change" }],
name: [{ required: true, message: "发货单名称不能为空", trigger: "blur" }],
code: [{ required: true, message: "发货单号不能为空", trigger: "blur" }]
},
orderList: [],
personList: []
}
},
methods: {
init(id) {
this.getSelectList()
if (id) {
this.form.id = id
this.isEdit = true
getDeliveryLog({id}).then(res => {
this.form = res.data || {}
})
}
},
getSelectList() {
orderList().then(res => {
this.orderList = res.data || []
})
getWorkerList().then(res => {
this.personList = res.data || []
})
},
submitForm() {
this.$refs['addOrUpdate'].validate((valid) => {
if (valid) {
console.log(this.form)
if (this.isEdit) {
//
deliveryLogUpdate({ ...this.form }).then((res) => {
if (res.code === 0) {
this.$modal.msgSuccess("操作成功");
this.$emit('successSubmit')
}
})
} else {
deliveryLogCreate({ ...this.form }).then((res) => {
if (res.code === 0) {
this.$modal.msgSuccess("操作成功");
this.$emit('successSubmit')
}
})
}
} else {
return false
}
})
},
formClear() {
this.$refs.addOrUpdate.resetFields()
this.form.principalCost = 0.00
this.isEdit = false
}
}
}
</script>

View File

@ -0,0 +1,223 @@
<template>
<div>
<el-drawer
title="发货清单详情"
size="60%"
:append-to-body="true"
:visible.sync="centervisible"
@close='close'>
<div class="box1">
<el-row>
<el-col :span='12'>
<span class="title">订单名</span>
<span class="text">{{orderName ? orderName : '-'}}</span>
</el-col>
<el-col :span='12'>
<span class="title">发货单号</span>
<span class="text">{{code ? code : '-'}}</span>
</el-col>
</el-row>
</div>
<div class="box2">
<div class="boxTitle">
<span class="blueTitle"></span>
<span>详情</span>
</div>
<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="80"
label="操作"
:method-list="tableBtn"
@clickBtn="editDetDetail"
/>
</base-table>
<pagination
:page.sync="queryParams.pageNo"
:limit.sync="queryParams.pageSize"
:total="total"
@pagination="getList"
/>
</div>
</el-drawer>
<!-- 编辑详情 -->
<base-dialog
dialogTitle="编辑"
:dialogVisible="detailEditVisible"
@cancel="handleCancel"
@confirm="handleConfirm"
:before-close="handleCancel"
width="50%"
>
<edit-detail ref="editDetail" @successSubmit="successSubmit" />
</base-dialog>
</div>
</template>
<script>
import { parseTime } from '@/utils/ruoyi'
import { deliveryLogDetPage } from '@/api/base/delivery'
import EditDetail from './editDetail.vue'
const tableProps = [
{
prop: 'createTime',
label: '添加时间',
filter: parseTime,
minWidth: 150
},
{
prop: 'deliveryCarCode',
label: '装车单号',
minWidth: 100,
showOverflowtooltip: true
},
{
prop: 'loadTime',
label: '装车时间',
filter: parseTime,
minWidth: 150
},
{
prop: 'productName',
label: '装车产品'
},
{
prop: 'packagingSize',
label: '装箱规格(片/箱)',
width: 120
},
{
prop: 'packagingNum',
label: '箱数'
},
{
prop: 'quantity',
label: '装车总量'
},
{
prop: 'productDate',
label: '产品批次',
minWidth: 150,
showOverflowtooltip: true
}
]
export default {
name: 'DeliveryLogDetail',
data() {
return {
centervisible: false,
queryParams: {
pageNo: 1,
pageSize: 20,
logId: ''
},
total: 0,
tableProps,
tableData: [],
tableBtn: [
this.$auth.hasPermi('extend:delivery-log:update')
? {
type: 'edit',
btnName: '编辑'
}
: undefined
].filter((v) => v),
tableH: this.tableHeight(275),
orderName: '',
code: '',
detailEditVisible: false
}
},
components: { EditDetail },
mounted() {
window.addEventListener('resize', () => {
this.tableH = this.tableHeight(275)
})
},
methods: {
init(param) {
this.orderName = param.orderName
this.code = param.code
this.queryParams.logId = param.id
this.centervisible = true
this.getList()
},
getList() {
deliveryLogDetPage({...this.queryParams}).then(res => {
this.tableData = res.data.list || []
this.total = res.data.total || 0
})
},
close() {
this.orderName = ''
this.code = ''
this.queryParams.pageNo = 1
this.queryParams.pageSize = 20
this.queryParams.logId = ''
this.tableData = []
this.total = 0
},
editDetDetail(val) {
this.detailEditVisible = true
this.$nextTick(() => {
this.$refs.editDetail.init(val.data.id)
})
},
handleCancel() {
this.$refs.editDetail.formClear()
this.detailEditVisible = false
},
handleConfirm() {
this.$refs.editDetail.submitForm()
},
successSubmit() {
this.handleCancel()
this.getList()
}
}
}
</script>
<style scoped lang='scss'>
.boxTitle {
display: inline-block;
font-size: 16px;
font-weight: 400;
color: #000000;
margin:0 10px 10px 0;
}
.blueTitle {
content: '';
display: inline-block;
width: 4px;
height: 18px;
background-color: #0B58FF;
border-radius: 1px;
margin-right: 8px;
vertical-align: bottom;
}
.box1 {
padding: 8px 8px 8px 40px;
.title {
height: 16px;
font-size: 14px;
font-weight: 600;
color: rgba(0,0,0,0.85);
}
.text {
height: 16px;
font-size: 14px;
font-weight: 400;
color: rgba(102,102,102,0.75);
}
}
.box2 {
padding:32px 32px 30px 30px;
height: calc(100vh - 125px);
}
</style>

View File

@ -0,0 +1,124 @@
<template>
<el-form ref="addOrUpdate" :rules="rules" label-width="130px" :model="form">
<el-row>
<el-col :span='12'>
<el-form-item label="装车单号" prop="deliveryCarCode">
<el-input v-model="form.deliveryCarCode"></el-input>
</el-form-item>
</el-col>
<el-col :span='12'>
<el-form-item label="装车时间" prop="loadTime">
<el-date-picker
v-model="form.loadTime"
type="datetime"
format='yyyy-MM-dd HH:mm:ss'
value-format="timestamp"
style="width: 100%;"
placeholder="选择日期">
</el-date-picker>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span='12'>
<el-form-item label="装车产品" prop="productId">
<el-select v-model="form.productId" disabled 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-col :span='12'>
<el-form-item label="装箱规格(片/箱)" prop="packagingSize">
<el-input-number v-model="form.packagingSize" :min="0" :max='9999999999' style="width:100%"></el-input-number>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span='12'>
<el-form-item label="产品批次" prop="productDate">
<el-input v-model="form.productDate" placeholder="多个批次用','隔开"></el-input>
</el-form-item>
</el-col>
<el-col :span='12'>
<el-form-item label="箱/托数" prop="packagingNum">
<el-input-number v-model="form.packagingNum" :min="0" :max='9999999999' style="width:100%"></el-input-number>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span='12'>
<el-form-item label="装车总量" prop="quantity">
<el-input-number v-model="form.quantity" :min="0" :max='9999999999' style="width:100%"></el-input-number>
</el-form-item>
</el-col>
</el-row>
</el-form>
</template>
<script>
import { getProductAll } from '@/api/base/product'
import { deliveryLogDetGet, deliveryLogDetUpdate } from '@/api/base/delivery'
export default {
name: 'editDetail',
data() {
return {
form: {
logId: '',
deliveryCarCode: '',
loadTime: null,
productId: '',
packagingSize: null,
productDate: '',
packagingNum: null,
quantity: null
},
rules: {
deliveryCarCode: [{ required: true, message: "装车单号不能为空", trigger: "blur" }],
productId: [{ required: true, message: "装车产品不能为空", trigger: "change" }],
packagingSize: [{ required: true, message: "装箱规格不能为空", trigger: "blur" }],
packagingNum: [{ required: true, message: "箱/托数不能为空", trigger: "blur" }],
quantity: [{ required: true, message: "装车总量不能为空", trigger: "blur" }]
},
productList: []
}
},
mounted() {
this.getSelectList()
},
methods: {
init(id) {
deliveryLogDetGet({id}).then(res => {
console.log(res)
this.form = res.data
})
},
getSelectList() {
getProductAll().then(res => {
this.productList = res.data || []
})
},
submitForm() {
this.$refs['addOrUpdate'].validate((valid) => {
if (valid) {
console.log(this.form)
deliveryLogDetUpdate({ ...this.form }).then((res) => {
if (res.code === 0) {
this.$modal.msgSuccess("操作成功");
this.$emit('successSubmit')
}
})
} else {
return false
}
})
},
formClear() {
this.$refs.addOrUpdate.resetFields()
}
}
}
</script>

View File

@ -0,0 +1,151 @@
<template>
<el-form ref="addOrUpdate" :rules="rules" label-width="130px" :model="form">
<el-row>
<el-col :span='12'>
<el-form-item label="发货单号">
<el-input v-model="code" disabled></el-input>
</el-form-item>
</el-col>
<el-col :span='12'>
<el-form-item label="装车单号" prop="deliveryCarCode">
<el-input v-model="form.deliveryCarCode"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span='12'>
<el-form-item label="装车时间" prop="loadTime">
<el-date-picker
v-model="form.loadTime"
type="datetime"
format='yyyy-MM-dd HH:mm:ss'
value-format="timestamp"
style="width: 100%;"
placeholder="选择日期">
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span='12'>
<el-form-item label="车辆联系人" prop="contactPerson">
<el-input v-model="form.contactPerson"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span='12'>
<el-form-item label="联系方式" prop="contactPersonCall">
<el-input v-model="form.contactPersonCall"></el-input>
</el-form-item>
</el-col>
<el-col :span='12'>
<el-form-item label="装车产品" prop="productId">
<el-select v-model="form.productId" disabled 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="packagingSize">
<el-input-number v-model="form.packagingSize" :min="0" :max='9999999999' style="width:100%"></el-input-number>
</el-form-item>
</el-col>
<el-col :span='12'>
<el-form-item label="产品批次" prop="productDate">
<el-input v-model="form.productDate" placeholder="多个批次用','隔开"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span='12'>
<el-form-item label="箱/托数" prop="packagingNum">
<el-input-number v-model="form.packagingNum" :min="0" :max='9999999999' style="width:100%"></el-input-number>
</el-form-item>
</el-col>
<el-col :span='12'>
<el-form-item label="装车总量" prop="quantity">
<el-input-number v-model="form.quantity" :min="0" :max='9999999999' style="width:100%"></el-input-number>
</el-form-item>
</el-col>
</el-row>
</el-form>
</template>
<script>
import { getProductAll } from '@/api/base/product'
import { deliveryLogDetCreate } from '@/api/base/delivery'
import { orderDetail } from '@/api/base/orderManage'
export default {
name: 'LoadedPage',
data() {
return {
form: {
logId: '',
deliveryCarCode: '',
loadTime: null,
contactPerson: '',
contactPersonCall: '',
productId: '',
packagingSize: null,
productDate: '',
packagingNum: null,
quantity: null
},
code: '',
rules: {
deliveryCarCode: [{ required: true, message: "装车单号不能为空", trigger: "blur" }],
productId: [{ required: true, message: "装车产品不能为空", trigger: "change" }],
packagingSize: [{ required: true, message: "装箱规格不能为空", trigger: "blur" }],
packagingNum: [{ required: true, message: "箱/托数不能为空", trigger: "blur" }],
quantity: [{ required: true, message: "装车总量不能为空", trigger: "blur" }]
},
productList: []
}
},
methods: {
init(id, code, orderId) {
this.getSelectList()
this.form.logId = id
this.code = code
this.getProductId(orderId)
},
getSelectList() {
getProductAll().then(res => {
this.productList = res.data || []
})
},
//
getProductId(orderId) {
orderDetail({
id: orderId
}).then(res => {
this.form.productId = res.data.planProductId || ''
})
},
submitForm() {
this.$refs['addOrUpdate'].validate((valid) => {
if (valid) {
console.log(this.form)
deliveryLogDetCreate({ ...this.form }).then((res) => {
if (res.code === 0) {
this.$modal.msgSuccess("操作成功");
this.$emit('successSubmit')
}
})
} else {
return false
}
})
},
formClear() {
this.$refs.addOrUpdate.resetFields()
this.code = ''
}
}
}
</script>

View File

@ -0,0 +1,308 @@
<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"
/>
<!-- 新增 -->
<base-dialog
:dialogTitle="addOrEditTitle"
:dialogVisible="centervisible"
@cancel="handleCancel"
@confirm="handleConfirm"
:before-close="handleCancel"
width="50%"
>
<add-or-update ref="addOrUpdate" @successSubmit="successSubmit" />
</base-dialog>
<!-- 装车 -->
<base-dialog
dialogTitle="装车"
:dialogVisible="centervisible2"
@cancel="handleCancel2"
@confirm="handleConfirm2"
:before-close="handleCancel2"
width="50%"
>
<loaded-page ref="loadedPage" @successSubmit="successSubmit2" />
</base-dialog>
<!-- 发货详情 -->
<delivery-log-detail ref='deliveryLogDetail' v-if='showDetail' />
</div>
</template>
<script>
import { parseTime } from '@/utils/ruoyi'
import { deliveryLogPage, deliveryLogDelete } from '@/api/base/delivery'
import AddOrUpdate from './components/addOrUpdate'
import LoadedPage from './components/loadedPage'
import DeliveryLogDetail from './components/deliveryLogDetail.vue'
const tableProps = [
{
prop: 'orderName',
label: '订单名',
minWidth: 100,
showOverflowtooltip: true
},
{
prop: 'name',
label: '发货单名称',
minWidth: 100,
showOverflowtooltip: true
},
{
prop: 'deliveryTime',
label: '发货时间',
filter: parseTime,
minWidth: 150
},
{
prop: 'code',
label: '发货单号',
showOverflowtooltip: true
},
{
prop: 'deliverPerName',
label: '发货负责人',
minWidth: 100
},
{
prop: 'principal',
label: '运输负责人',
minWidth: 100
},
{
prop: 'principalCall',
label: '运输联系方式',
minWidth: 110,
showOverflowtooltip: true
},
{
prop: 'principalCost',
label: '运输费用'
},
{
prop: 'remark',
label: '备注',
showOverflowtooltip: true
}
]
export default {
name: "DeliveryLog",
data() {
return {
formConfig: [
{
type: 'input',
label: '订单名',
param: 'orderName',
defaultSelect: ''
},
{
type: 'input',
label: '发货单名称',
param: 'name'
},
{
type: 'input',
label: '发货单号',
param: 'code'
},
{
type: 'button',
btnName: '查询',
name: 'search',
color: 'primary'
},
{
type: this.$auth.hasPermi('extend:delivery-log:create') ? 'separate' : '',
},
{
type: this.$auth.hasPermi('extend:delivery-log:create') ? 'button' : '',
btnName: '新增',
name: 'add',
color: 'success',
plain: true
}
],
//
queryParams: {
pageNo: 1,
pageSize: 20,
orderName: '',
code: '',
name: ''
},
tableProps,
list: [],
tableH: this.tableHeight(260),
total: 0,
tableBtn: [
this.$auth.hasPermi('extend:delivery-log:loaded')
? {
type: 'loaded',
btnName: '装车'
}
: undefined,
this.$auth.hasPermi('extend:delivery-log:detail')
? {
type: 'detail',
btnName: '详情'
}
: undefined,
this.$auth.hasPermi('extend:delivery-log:update')
? {
type: 'edit',
btnName: '编辑'
}
: undefined,
this.$auth.hasPermi('extend:delivery-log:delete')
? {
type: 'delete',
btnName: '删除'
}
: undefined
].filter((v) => v),
addOrEditTitle: '',
centervisible: false,
centervisible2: false,
showDetail: false
}
},
created() {
window.addEventListener('resize', () => {
this.tableH = this.tableHeight(260)
})
if (location.href.indexOf('?') > 0) {
let arr = location.href.split('?')[1]
this.formConfig[0].defaultSelect = decodeURI(arr.split('=')[1])
} else {
this.formConfig[0].defaultSelect = ''
}
this.queryParams.orderName = this.formConfig[0].defaultSelect
this.getList();
},
components: { AddOrUpdate, LoadedPage, DeliveryLogDetail },
watch: {
$route: 'initData'
},
methods: {
initData(to) {
if (to.name === 'DeliveryLog') {
if (location.href.indexOf('?') > 0) {
let arr = location.href.split('?')[1]
this.formConfig[0].defaultSelect = decodeURI(arr.split('=')[1])
} else {
this.formConfig[0].defaultSelect = ''
}
this.queryParams.orderName = this.formConfig[0].defaultSelect
this.getList()
}
},
getList() {
deliveryLogPage({...this.queryParams}).then(res => {
this.list = res.data.list || []
this.total = res.data.total || 0
})
},
buttonClick(val) {
if (val.btnName === 'search') {
this.queryParams.name = val.name
this.queryParams.orderName = val.orderName
this.queryParams.code = val.code
this.getList()
} else {
this.addOrEditTitle = '新增'
this.centervisible = true
this.$nextTick(() => {
this.$refs.addOrUpdate.init()
})
}
},
handleClick(val) {
console.log(val)
switch (val.type) {
case 'edit':
this.addOrEditTitle = '编辑'
this.centervisible = true
this.$nextTick(() => {
this.$refs.addOrUpdate.init(val.data.id)
})
break
case 'delete':
this.handleDelete(val.data)
break
case 'loaded':
this.centervisible2 = true
this.$nextTick(() => {
this.$refs.loadedPage.init(val.data.id, val.data.code, val.data.orderId)
})
break
default:
this.showDetail = true
this.$nextTick(() => {
this.$refs.deliveryLogDetail.init(val.data)
})
}
},
//
handleCancel() {
this.$refs.addOrUpdate.formClear()
this.centervisible = false
this.addOrEditTitle = ''
},
handleConfirm() {
this.$refs.addOrUpdate.submitForm()
},
successSubmit() {
this.handleCancel()
this.getList()
},
//
handleDelete(val) {
this.$modal.confirm('是否确认删除发货单名为"' + val.name + '"的数据项?').then(function() {
return deliveryLogDelete({ id: val.id })
}).then(() => {
this.getList();
this.$modal.msgSuccess("操作成功");
}).catch(() => {});
},
//
handleCancel2() {
this.$refs.loadedPage.formClear()
this.centervisible2 = false
},
handleConfirm2() {
this.$refs.loadedPage.submitForm()
},
successSubmit2() {
this.handleCancel2()
this.getList()
}
}
}
</script>

Some files were not shown because too many files have changed in this diff Show More