projects/mes-test #133
							
								
								
									
										5
									
								
								.env.dev
									
									
									
									
									
								
							
							
						
						
									
										5
									
								
								.env.dev
									
									
									
									
									
								
							@@ -1,7 +1,7 @@
 | 
			
		||||
###
 | 
			
		||||
 # @Author: Do not edit
 | 
			
		||||
 # @Date: 2023-08-29 09:40:39
 | 
			
		||||
 # @LastEditTime: 2023-11-07 18:09:26
 | 
			
		||||
 # @LastEditTime: 2023-11-07 19:11:56
 | 
			
		||||
 # @LastEditors: zhp
 | 
			
		||||
 # @Description:
 | 
			
		||||
###
 | 
			
		||||
@@ -12,8 +12,9 @@ ENV = 'development'
 | 
			
		||||
VUE_APP_TITLE = MES系统
 | 
			
		||||
 | 
			
		||||
# 芋道管理系统/开发环境
 | 
			
		||||
 | 
			
		||||
# 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.4.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.8:48080'
 | 
			
		||||
 
 | 
			
		||||
@@ -2,14 +2,14 @@
 | 
			
		||||
ENV = 'production'
 | 
			
		||||
 | 
			
		||||
# 页面标题
 | 
			
		||||
VUE_APP_TITLE = 产线监控系统
 | 
			
		||||
VUE_APP_TITLE = MES系统
 | 
			
		||||
 | 
			
		||||
# 芋道管理系统/生产环境
 | 
			
		||||
VUE_APP_BASE_API = '/prod-api'
 | 
			
		||||
 | 
			
		||||
# 根据服务器或域名修改
 | 
			
		||||
# PUBLIC_PATH = 'http://my-pi.com:8888/yudao-admin/'
 | 
			
		||||
PUBLIC_PATH = 'http://192.168.0.33:8888/'
 | 
			
		||||
PUBLIC_PATH = 'http://192.168.0.33:8889/'
 | 
			
		||||
 | 
			
		||||
# 二级部署路径
 | 
			
		||||
VUE_APP_APP_NAME ='yudao-admin'
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										60
									
								
								src/api/base/coreAlarmLog.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										60
									
								
								src/api/base/coreAlarmLog.js
									
									
									
									
									
										Normal 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
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										68
									
								
								src/api/base/coreCustomer.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										68
									
								
								src/api/base/coreCustomer.js
									
									
									
									
									
										Normal 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
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										68
									
								
								src/api/base/coreDepartment.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										68
									
								
								src/api/base/coreDepartment.js
									
									
									
									
									
										Normal 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
									
								
							
							
						
						
									
										68
									
								
								src/api/base/coreMajor.js
									
									
									
									
									
										Normal 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
									
								
							
							
						
						
									
										111
									
								
								src/api/base/coreProduct.js
									
									
									
									
									
										Normal 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
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										68
									
								
								src/api/base/coreProductionLine.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										68
									
								
								src/api/base/coreProductionLine.js
									
									
									
									
									
										Normal 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
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										68
									
								
								src/api/base/coreSupplier.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										68
									
								
								src/api/base/coreSupplier.js
									
									
									
									
									
										Normal 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
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										138
									
								
								src/api/base/coreWorkOrder.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										138
									
								
								src/api/base/coreWorkOrder.js
									
									
									
									
									
										Normal 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
									
								
							
							
						
						
									
										103
									
								
								src/api/base/coreWorker.js
									
									
									
									
									
										Normal 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
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										68
									
								
								src/api/base/coreWorkshopSection.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										68
									
								
								src/api/base/coreWorkshopSection.js
									
									
									
									
									
										Normal 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
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										73
									
								
								src/api/base/delivery.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										73
									
								
								src/api/base/delivery.js
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,73 @@
 | 
			
		||||
// 成品发货
 | 
			
		||||
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
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
@@ -94,3 +94,47 @@ export function orderIssue(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
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
@@ -14,4 +14,13 @@ export function getWorker(query) {
 | 
			
		||||
    method: 'get',
 | 
			
		||||
    params: query
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// 获得该班组其他可选组员列表(除去现有组员)
 | 
			
		||||
export function otherWorkerList(query) {
 | 
			
		||||
  return request({
 | 
			
		||||
    url: '/base/group-team-det/otherWorkerList',
 | 
			
		||||
    method: 'get',
 | 
			
		||||
    params: query
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
@@ -1,17 +1,17 @@
 | 
			
		||||
/*
 | 
			
		||||
 * @Author: zhp
 | 
			
		||||
 * @Date: 2023-09-12 14:07:04
 | 
			
		||||
 * @LastEditTime: 2023-09-13 09:53:45
 | 
			
		||||
 * @LastEditors: zhp
 | 
			
		||||
 * @LastEditTime: 2023-11-07 14:17:38
 | 
			
		||||
 * @LastEditors: DY
 | 
			
		||||
 * @Description:
 | 
			
		||||
 */
 | 
			
		||||
import request from '@/utils/request'
 | 
			
		||||
 | 
			
		||||
export function getYieldAnalysisPageData(data) {
 | 
			
		||||
export function getYieldAnalysisPageData(query) {
 | 
			
		||||
  return request({
 | 
			
		||||
    url: '/analysis/production-analysis/getOutput',
 | 
			
		||||
    method: 'post',
 | 
			
		||||
    data: data
 | 
			
		||||
    url: '/base/core-production-line-rec-day/monthList',
 | 
			
		||||
    method: 'get',
 | 
			
		||||
    params: query
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -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'
 | 
			
		||||
 | 
			
		||||
// 创建工厂
 | 
			
		||||
export function createFactory(data) {
 | 
			
		||||
  return request({
 | 
			
		||||
    url: '/base/factory/create',
 | 
			
		||||
    url: '/base/core-factory/create',
 | 
			
		||||
    method: 'post',
 | 
			
		||||
    data: data
 | 
			
		||||
  })
 | 
			
		||||
@@ -12,7 +19,7 @@ export function createFactory(data) {
 | 
			
		||||
// 更新工厂
 | 
			
		||||
export function updateFactory(data) {
 | 
			
		||||
  return request({
 | 
			
		||||
    url: '/base/factory/update',
 | 
			
		||||
    url: '/base/core-factory/update',
 | 
			
		||||
    method: 'put',
 | 
			
		||||
    data: data
 | 
			
		||||
  })
 | 
			
		||||
@@ -21,7 +28,7 @@ export function updateFactory(data) {
 | 
			
		||||
// 删除工厂
 | 
			
		||||
export function deleteFactory(id) {
 | 
			
		||||
  return request({
 | 
			
		||||
    url: '/base/factory/delete?id=' + id,
 | 
			
		||||
    url: '/base/core-factory/delete?id=' + id,
 | 
			
		||||
    method: 'delete'
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
@@ -29,21 +36,30 @@ export function deleteFactory(id) {
 | 
			
		||||
// 获得工厂
 | 
			
		||||
export function getFactory(id) {
 | 
			
		||||
  return request({
 | 
			
		||||
    url: '/base/factory/get?id=' + id,
 | 
			
		||||
    url: '/base/core-factory/get?id=' + id,
 | 
			
		||||
    method: 'get'
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
// 获得工厂code
 | 
			
		||||
export function getCode() {
 | 
			
		||||
  return request({
 | 
			
		||||
    url: '/base/factory/getCode',
 | 
			
		||||
    url: '/base/core-factory/getCode',
 | 
			
		||||
    method: 'get'
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
// 获得工厂分页
 | 
			
		||||
export function getFactoryPage(query) {
 | 
			
		||||
  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',
 | 
			
		||||
    params: query
 | 
			
		||||
  })
 | 
			
		||||
@@ -52,7 +68,7 @@ export function getFactoryPage(query) {
 | 
			
		||||
// 导出工厂 Excel
 | 
			
		||||
export function exportFactoryExcel(query) {
 | 
			
		||||
  return request({
 | 
			
		||||
    url: '/base/factory/export-excel',
 | 
			
		||||
    url: '/base/core-factory/export-excel',
 | 
			
		||||
    method: 'get',
 | 
			
		||||
    params: query,
 | 
			
		||||
    responseType: 'blob'
 | 
			
		||||
 
 | 
			
		||||
@@ -1,17 +1,17 @@
 | 
			
		||||
/*
 | 
			
		||||
 * @Author: Do not edit
 | 
			
		||||
 * @Date: 2023-09-12 09:44:53
 | 
			
		||||
 * @LastEditTime: 2023-09-15 14:12:26
 | 
			
		||||
 * @LastEditTime: 2023-11-06 18:57:05
 | 
			
		||||
 * @LastEditors: DY
 | 
			
		||||
 * @Description: 
 | 
			
		||||
 */
 | 
			
		||||
import request from '@/utils/request'
 | 
			
		||||
 | 
			
		||||
// 获得近24小时产线生产数据
 | 
			
		||||
export function getPdlDataOneDay(data) {
 | 
			
		||||
export function getPdlDataOneDay(query) {
 | 
			
		||||
  return request({
 | 
			
		||||
    url: '/monitoring/production-monitor/getPdlDataOneDay',
 | 
			
		||||
    method: 'post',
 | 
			
		||||
    data: data
 | 
			
		||||
    url: '/base/core-production-line-rec-hour/list24h',
 | 
			
		||||
    method: 'get',
 | 
			
		||||
    params: query
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										106
									
								
								src/api/extend/processEquMaterialBom.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										106
									
								
								src/api/extend/processEquMaterialBom.js
									
									
									
									
									
										Normal 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
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										106
									
								
								src/api/extend/processEquValueBom.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										106
									
								
								src/api/extend/processEquValueBom.js
									
									
									
									
									
										Normal 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
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
@@ -16,4 +16,13 @@ export function getSchedulingMonitoringRecord(query) {
 | 
			
		||||
    method: 'get',
 | 
			
		||||
    params: query
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// 获得所有列表
 | 
			
		||||
export function groupClassesListAll(query) {
 | 
			
		||||
  return request({
 | 
			
		||||
    url: '/base/group-classes/listAll',
 | 
			
		||||
    method: 'get',
 | 
			
		||||
    params: query
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
@@ -1,7 +1,7 @@
 | 
			
		||||
/*
 | 
			
		||||
 * @Author: zhp
 | 
			
		||||
 * @Date: 2023-10-18 09:33:57
 | 
			
		||||
 * @LastEditTime: 2023-11-03 19:37:30
 | 
			
		||||
 * @LastEditTime: 2023-11-09 15:33:20
 | 
			
		||||
 * @LastEditors: zhp
 | 
			
		||||
 * @Description:
 | 
			
		||||
 */
 | 
			
		||||
@@ -13,7 +13,15 @@ export function getDetMaterial(query) {
 | 
			
		||||
  return request({
 | 
			
		||||
    url: '/extend/process-retrospect/getDetMaterial',
 | 
			
		||||
    method: 'post',
 | 
			
		||||
    params: query
 | 
			
		||||
    data: query
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
export function getDetValue(query) {
 | 
			
		||||
  return request({
 | 
			
		||||
    url: '/extend/process-retrospect/getDetValue',
 | 
			
		||||
    method: 'post',
 | 
			
		||||
    data: query
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										75
									
								
								src/api/warehouse/warehouse-info.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										75
									
								
								src/api/warehouse/warehouse-info.js
									
									
									
									
									
										Normal 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'
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										76
									
								
								src/api/warehouse/warehouseGoods.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										76
									
								
								src/api/warehouse/warehouseGoods.js
									
									
									
									
									
										Normal 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'
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										97
									
								
								src/api/warehouse/warehouseLocation.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										97
									
								
								src/api/warehouse/warehouseLocation.js
									
									
									
									
									
										Normal 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'
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										83
									
								
								src/api/warehouse/warehouseRealtime.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										83
									
								
								src/api/warehouse/warehouseRealtime.js
									
									
									
									
									
										Normal 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'
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										85
									
								
								src/api/warehouse/warehouseRealtimeLocation.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										85
									
								
								src/api/warehouse/warehouseRealtimeLocation.js
									
									
									
									
									
										Normal 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'
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										19
									
								
								src/assets/icons/svg/table_add.svg
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										19
									
								
								src/assets/icons/svg/table_add.svg
									
									
									
									
									
										Normal 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  | 
@@ -21,11 +21,13 @@
 | 
			
		||||
						v-model="form[col.prop]"
 | 
			
		||||
						@change="$emit('update', form)"
 | 
			
		||||
						:placeholder="`请输入${col.label}`"
 | 
			
		||||
						:disabled="disabled"
 | 
			
		||||
						v-bind="col.bind" />
 | 
			
		||||
					<el-input
 | 
			
		||||
						v-if="col.textarea"
 | 
			
		||||
						type="textarea"
 | 
			
		||||
						v-model="form[col.prop]"
 | 
			
		||||
						:disabled="disabled"
 | 
			
		||||
						@change="$emit('update', form)"
 | 
			
		||||
						:placeholder="`请输入${col.label}`"
 | 
			
		||||
						v-bind="col.bind" />
 | 
			
		||||
@@ -33,6 +35,7 @@
 | 
			
		||||
						v-if="col.select"
 | 
			
		||||
						v-model="form[col.prop]"
 | 
			
		||||
						:placeholder="`请选择${col.label}`"
 | 
			
		||||
						:disabled="disabled"
 | 
			
		||||
						@change="$emit('update', form)"
 | 
			
		||||
						v-bind="col.bind">
 | 
			
		||||
						<el-option
 | 
			
		||||
@@ -45,6 +48,7 @@
 | 
			
		||||
						v-if="col.datetime"
 | 
			
		||||
						v-model="form[col.prop]"
 | 
			
		||||
						type="datetime"
 | 
			
		||||
						:disabled="disabled"
 | 
			
		||||
						:placeholder="`请选择${col.label}`"
 | 
			
		||||
						value-format="timestamp"
 | 
			
		||||
						@change="$emit('update', form)"
 | 
			
		||||
@@ -52,6 +56,7 @@
 | 
			
		||||
					<el-switch
 | 
			
		||||
						v-if="col.switch"
 | 
			
		||||
						v-model="form[col.prop]"
 | 
			
		||||
						:disabled="disabled"
 | 
			
		||||
						active-color="#0b58ff"
 | 
			
		||||
						inactive-color="#e1e1e1"
 | 
			
		||||
						@change="$emit('update', form)"
 | 
			
		||||
@@ -59,6 +64,7 @@
 | 
			
		||||
					<component
 | 
			
		||||
						v-if="col.subcomponent"
 | 
			
		||||
						:key="col.key"
 | 
			
		||||
						:disabled="disabled"
 | 
			
		||||
						:is="col.subcomponent"
 | 
			
		||||
						:inlineStyle="col.style"></component>
 | 
			
		||||
 | 
			
		||||
@@ -81,6 +87,7 @@
 | 
			
		||||
							:headers="uploadHeaders"
 | 
			
		||||
							:show-file-list="false"
 | 
			
		||||
							icon="el-icon-upload2"
 | 
			
		||||
							:disabled="disabled"
 | 
			
		||||
							:before-upload="beforeUpload"
 | 
			
		||||
							:on-success="handleUploadSuccess"
 | 
			
		||||
							v-bind="col.bind">
 | 
			
		||||
@@ -100,7 +107,7 @@
 | 
			
		||||
							v-for="file in form[col.prop] || []"
 | 
			
		||||
							:file="file"
 | 
			
		||||
							:key="file.fileUrl"
 | 
			
		||||
							@delete="handleDeleteFile(file)" />
 | 
			
		||||
							@delete="!disabled && handleDeleteFile(file)" />
 | 
			
		||||
					</div>
 | 
			
		||||
				</el-form-item>
 | 
			
		||||
			</el-col>
 | 
			
		||||
 
 | 
			
		||||
@@ -76,6 +76,9 @@ export default {
 | 
			
		||||
		info(payload) {
 | 
			
		||||
			return this.http(this.infoUrl == '' ? this.infoPath : this.infoUrl, 'get', payload);
 | 
			
		||||
		},
 | 
			
		||||
		del(payload) {
 | 
			
		||||
			return this.http(this.deleteUrl == '' ? this.deletePath : this.deleteUrl, 'delete', payload);
 | 
			
		||||
		},
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
		// 过滤后端传回的详情数据
 | 
			
		||||
 
 | 
			
		||||
@@ -180,6 +180,7 @@ input, textarea{
 | 
			
		||||
// 抽屉head区域---start
 | 
			
		||||
.el-drawer__header {
 | 
			
		||||
  padding-bottom: 20px;
 | 
			
		||||
  padding-left: 30px;
 | 
			
		||||
  margin-bottom: 23px;
 | 
			
		||||
  font-size: 20px;
 | 
			
		||||
  font-weight: 500;
 | 
			
		||||
 
 | 
			
		||||
@@ -99,7 +99,11 @@ export const DICT_TYPE = {
 | 
			
		||||
  ORDER_STATUS: 'order_status',
 | 
			
		||||
  ORDER_ORIGIN: 'order_Origin',
 | 
			
		||||
  ORDER_PRIORITY: 'order_priority',
 | 
			
		||||
  PACK_SPEC: 'pack_spec'
 | 
			
		||||
  PACK_SPEC: 'pack_spec',
 | 
			
		||||
  
 | 
			
		||||
  // ============== EQUIPMENT - 设备模块 =============
 | 
			
		||||
  MAINTAIN_TYPE: 'maintain_type',
 | 
			
		||||
  FAULT_LEVEL: 'fault-level',
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										182
									
								
								src/views/base/coreAlarmLog/index.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										182
									
								
								src/views/base/coreAlarmLog/index.vue
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,182 @@
 | 
			
		||||
<template>
 | 
			
		||||
	<div class="app-container">
 | 
			
		||||
		<search-bar
 | 
			
		||||
			:formConfigs="formConfig"
 | 
			
		||||
			ref="searchBarForm"
 | 
			
		||||
			@headBtnClick="buttonClick" />
 | 
			
		||||
		<base-table
 | 
			
		||||
			v-loading="dataListLoading"
 | 
			
		||||
			:table-props="tableProps"
 | 
			
		||||
			:page="listQuery.pageNo"
 | 
			
		||||
			:limit="listQuery.pageSize"
 | 
			
		||||
			:table-data="tableData">
 | 
			
		||||
			<method-btn
 | 
			
		||||
				v-if="tableBtn.length"
 | 
			
		||||
				slot="handleBtn"
 | 
			
		||||
				:width="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>
 | 
			
		||||
							
								
								
									
										103
									
								
								src/views/base/coreCustomer/add-or-updata.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										103
									
								
								src/views/base/coreCustomer/add-or-updata.vue
									
									
									
									
									
										Normal 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>
 | 
			
		||||
							
								
								
									
										176
									
								
								src/views/base/coreCustomer/index.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										176
									
								
								src/views/base/coreCustomer/index.vue
									
									
									
									
									
										Normal 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>
 | 
			
		||||
							
								
								
									
										107
									
								
								src/views/base/coreDepartment/add-or-updata.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										107
									
								
								src/views/base/coreDepartment/add-or-updata.vue
									
									
									
									
									
										Normal 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>
 | 
			
		||||
							
								
								
									
										168
									
								
								src/views/base/coreDepartment/index.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										168
									
								
								src/views/base/coreDepartment/index.vue
									
									
									
									
									
										Normal 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>
 | 
			
		||||
							
								
								
									
										77
									
								
								src/views/base/coreMajor/add-or-updata.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										77
									
								
								src/views/base/coreMajor/add-or-updata.vue
									
									
									
									
									
										Normal 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>
 | 
			
		||||
							
								
								
									
										168
									
								
								src/views/base/coreMajor/index.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										168
									
								
								src/views/base/coreMajor/index.vue
									
									
									
									
									
										Normal 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>
 | 
			
		||||
							
								
								
									
										65
									
								
								src/views/base/coreProduct/SmallTitle.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										65
									
								
								src/views/base/coreProduct/SmallTitle.vue
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,65 @@
 | 
			
		||||
<!--
 | 
			
		||||
 * @Author: zwq
 | 
			
		||||
 * @Date: 2023-08-01 15:27:31
 | 
			
		||||
 * @LastEditors: zwq
 | 
			
		||||
 * @LastEditTime: 2023-08-01 16:25:54
 | 
			
		||||
 * @Description:
 | 
			
		||||
-->
 | 
			
		||||
<template>
 | 
			
		||||
	<div :class="[className, { 'p-0': noPadding }]">
 | 
			
		||||
		<slot />
 | 
			
		||||
	</div>
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script>
 | 
			
		||||
export default {
 | 
			
		||||
	props: {
 | 
			
		||||
		size: {
 | 
			
		||||
			// 取值范围:  xl lg md sm
 | 
			
		||||
			type: String,
 | 
			
		||||
			default: 'de',
 | 
			
		||||
			validator: function (val) {
 | 
			
		||||
				return ['xl', 'lg', 'de', 'md', 'sm'].indexOf(val) !== -1;
 | 
			
		||||
			},
 | 
			
		||||
		},
 | 
			
		||||
		noPadding: {
 | 
			
		||||
			type: Boolean,
 | 
			
		||||
			default: false,
 | 
			
		||||
		},
 | 
			
		||||
	},
 | 
			
		||||
	computed: {
 | 
			
		||||
		className: function () {
 | 
			
		||||
			return `${this.size}-title`;
 | 
			
		||||
		},
 | 
			
		||||
	},
 | 
			
		||||
};
 | 
			
		||||
</script>
 | 
			
		||||
 | 
			
		||||
<style lang="scss" scoped>
 | 
			
		||||
$pxls: (xl, 28px) (lg, 24px) (de, 20px) (md, 18px) (sm, 16px);
 | 
			
		||||
$mgr: 8px;
 | 
			
		||||
@each $size, $height in $pxls {
 | 
			
		||||
	.#{$size}-title {
 | 
			
		||||
		font-size: 18px;
 | 
			
		||||
		line-height: $height;
 | 
			
		||||
		color: #000;
 | 
			
		||||
		font-weight: 500;
 | 
			
		||||
		font-family: '微软雅黑', 'Microsoft YaHei', Arial, Helvetica, sans-serif;
 | 
			
		||||
 | 
			
		||||
		&::before {
 | 
			
		||||
			content: '';
 | 
			
		||||
			display: inline-block;
 | 
			
		||||
			vertical-align: top;
 | 
			
		||||
			width: 4px;
 | 
			
		||||
			height: $height + 2px;
 | 
			
		||||
			border-radius: 1px;
 | 
			
		||||
			margin-right: $mgr;
 | 
			
		||||
			background-color: #0b58ff;
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
.p-0 {
 | 
			
		||||
	padding: 0;
 | 
			
		||||
}
 | 
			
		||||
</style>
 | 
			
		||||
							
								
								
									
										417
									
								
								src/views/base/coreProduct/add-or-updata.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										417
									
								
								src/views/base/coreProduct/add-or-updata.vue
									
									
									
									
									
										Normal 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>
 | 
			
		||||
							
								
								
									
										141
									
								
								src/views/base/coreProduct/attr-add.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										141
									
								
								src/views/base/coreProduct/attr-add.vue
									
									
									
									
									
										Normal 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>
 | 
			
		||||
							
								
								
									
										186
									
								
								src/views/base/coreProduct/index.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										186
									
								
								src/views/base/coreProduct/index.vue
									
									
									
									
									
										Normal 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>
 | 
			
		||||
							
								
								
									
										114
									
								
								src/views/base/coreProductionLine/add-or-updata.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										114
									
								
								src/views/base/coreProductionLine/add-or-updata.vue
									
									
									
									
									
										Normal 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>
 | 
			
		||||
							
								
								
									
										177
									
								
								src/views/base/coreProductionLine/index.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										177
									
								
								src/views/base/coreProductionLine/index.vue
									
									
									
									
									
										Normal 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>
 | 
			
		||||
							
								
								
									
										103
									
								
								src/views/base/coreSupplier/add-or-updata.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										103
									
								
								src/views/base/coreSupplier/add-or-updata.vue
									
									
									
									
									
										Normal 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>
 | 
			
		||||
							
								
								
									
										176
									
								
								src/views/base/coreSupplier/index.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										176
									
								
								src/views/base/coreSupplier/index.vue
									
									
									
									
									
										Normal 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>
 | 
			
		||||
							
								
								
									
										65
									
								
								src/views/base/coreWorkOrder/SmallTitle.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										65
									
								
								src/views/base/coreWorkOrder/SmallTitle.vue
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,65 @@
 | 
			
		||||
<!--
 | 
			
		||||
 * @Author: zwq
 | 
			
		||||
 * @Date: 2023-08-01 15:27:31
 | 
			
		||||
 * @LastEditors: zwq
 | 
			
		||||
 * @LastEditTime: 2023-08-01 16:25:54
 | 
			
		||||
 * @Description:
 | 
			
		||||
-->
 | 
			
		||||
<template>
 | 
			
		||||
	<div :class="[className, { 'p-0': noPadding }]">
 | 
			
		||||
		<slot />
 | 
			
		||||
	</div>
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script>
 | 
			
		||||
export default {
 | 
			
		||||
	props: {
 | 
			
		||||
		size: {
 | 
			
		||||
			// 取值范围:  xl lg md sm
 | 
			
		||||
			type: String,
 | 
			
		||||
			default: 'de',
 | 
			
		||||
			validator: function (val) {
 | 
			
		||||
				return ['xl', 'lg', 'de', 'md', 'sm'].indexOf(val) !== -1;
 | 
			
		||||
			},
 | 
			
		||||
		},
 | 
			
		||||
		noPadding: {
 | 
			
		||||
			type: Boolean,
 | 
			
		||||
			default: false,
 | 
			
		||||
		},
 | 
			
		||||
	},
 | 
			
		||||
	computed: {
 | 
			
		||||
		className: function () {
 | 
			
		||||
			return `${this.size}-title`;
 | 
			
		||||
		},
 | 
			
		||||
	},
 | 
			
		||||
};
 | 
			
		||||
</script>
 | 
			
		||||
 | 
			
		||||
<style lang="scss" scoped>
 | 
			
		||||
$pxls: (xl, 28px) (lg, 24px) (de, 20px) (md, 18px) (sm, 16px);
 | 
			
		||||
$mgr: 8px;
 | 
			
		||||
@each $size, $height in $pxls {
 | 
			
		||||
	.#{$size}-title {
 | 
			
		||||
		font-size: 18px;
 | 
			
		||||
		line-height: $height;
 | 
			
		||||
		color: #000;
 | 
			
		||||
		font-weight: 500;
 | 
			
		||||
		font-family: '微软雅黑', 'Microsoft YaHei', Arial, Helvetica, sans-serif;
 | 
			
		||||
 | 
			
		||||
		&::before {
 | 
			
		||||
			content: '';
 | 
			
		||||
			display: inline-block;
 | 
			
		||||
			vertical-align: top;
 | 
			
		||||
			width: 4px;
 | 
			
		||||
			height: $height + 2px;
 | 
			
		||||
			border-radius: 1px;
 | 
			
		||||
			margin-right: $mgr;
 | 
			
		||||
			background-color: #0b58ff;
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
.p-0 {
 | 
			
		||||
	padding: 0;
 | 
			
		||||
}
 | 
			
		||||
</style>
 | 
			
		||||
							
								
								
									
										306
									
								
								src/views/base/coreWorkOrder/add-or-updata.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										306
									
								
								src/views/base/coreWorkOrder/add-or-updata.vue
									
									
									
									
									
										Normal 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>
 | 
			
		||||
							
								
								
									
										301
									
								
								src/views/base/coreWorkOrder/addWorkOrder.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										301
									
								
								src/views/base/coreWorkOrder/addWorkOrder.vue
									
									
									
									
									
										Normal 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>
 | 
			
		||||
							
								
								
									
										211
									
								
								src/views/base/coreWorkOrder/attr-add.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										211
									
								
								src/views/base/coreWorkOrder/attr-add.vue
									
									
									
									
									
										Normal 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>
 | 
			
		||||
							
								
								
									
										413
									
								
								src/views/base/coreWorkOrder/detail.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										413
									
								
								src/views/base/coreWorkOrder/detail.vue
									
									
									
									
									
										Normal 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>
 | 
			
		||||
							
								
								
									
										401
									
								
								src/views/base/coreWorkOrder/index.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										401
									
								
								src/views/base/coreWorkOrder/index.vue
									
									
									
									
									
										Normal 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>
 | 
			
		||||
							
								
								
									
										339
									
								
								src/views/base/coreWorker/add-or-updata.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										339
									
								
								src/views/base/coreWorker/add-or-updata.vue
									
									
									
									
									
										Normal 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>
 | 
			
		||||
							
								
								
									
										204
									
								
								src/views/base/coreWorker/index.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										204
									
								
								src/views/base/coreWorker/index.vue
									
									
									
									
									
										Normal 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>
 | 
			
		||||
							
								
								
									
										103
									
								
								src/views/base/coreWorkshopSection/add-or-updata.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										103
									
								
								src/views/base/coreWorkshopSection/add-or-updata.vue
									
									
									
									
									
										Normal 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>
 | 
			
		||||
							
								
								
									
										172
									
								
								src/views/base/coreWorkshopSection/index.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										172
									
								
								src/views/base/coreWorkshopSection/index.vue
									
									
									
									
									
										Normal 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>
 | 
			
		||||
@@ -2,7 +2,7 @@
 | 
			
		||||
 * @Author: zwq
 | 
			
		||||
 * @Date: 2021-11-18 14:16:25
 | 
			
		||||
 * @LastEditors: DY
 | 
			
		||||
 * @LastEditTime: 2023-10-27 15:11:02
 | 
			
		||||
 * @LastEditTime: 2023-11-06 19:44:24
 | 
			
		||||
 * @Description:
 | 
			
		||||
-->
 | 
			
		||||
<template>
 | 
			
		||||
@@ -56,6 +56,7 @@
 | 
			
		||||
									v-model="dataForm.type"
 | 
			
		||||
									filterable
 | 
			
		||||
									:disabled="isdetail"
 | 
			
		||||
									style="width: 100%"
 | 
			
		||||
									placeholder="请选择物料类型">
 | 
			
		||||
									<el-option
 | 
			
		||||
										v-for="dict in materialList"
 | 
			
		||||
@@ -83,6 +84,7 @@
 | 
			
		||||
									filterable
 | 
			
		||||
									clearable
 | 
			
		||||
									:disabled="isdetail"
 | 
			
		||||
									style="width: 100%"
 | 
			
		||||
									placeholder="请选择供应商">
 | 
			
		||||
									<el-option
 | 
			
		||||
										v-for="dict in supplierList"
 | 
			
		||||
@@ -100,9 +102,10 @@
 | 
			
		||||
									v-model="dataForm.unit"
 | 
			
		||||
									filterable
 | 
			
		||||
									:disabled="isdetail"
 | 
			
		||||
									style="width: 100%"
 | 
			
		||||
									placeholder="请选择物料单位">
 | 
			
		||||
									<el-option
 | 
			
		||||
										v-for="dict in unitList"
 | 
			
		||||
										v-for="dict in getDictDatas('unit_dict')"
 | 
			
		||||
										:key="dict.value"
 | 
			
		||||
										:label="dict.label"
 | 
			
		||||
										:value="dict.value" />
 | 
			
		||||
@@ -172,6 +175,7 @@ import { listData } from "@/api/system/dict/data";
 | 
			
		||||
import SmallTitle from './SmallTitle';
 | 
			
		||||
import { parseTime } from '../../core/mixins/code-filter';
 | 
			
		||||
import attrAdd from './attr-add';
 | 
			
		||||
import { getDictDatas } from "@/utils/dict";
 | 
			
		||||
 | 
			
		||||
const tableBtn = [
 | 
			
		||||
	{
 | 
			
		||||
@@ -265,17 +269,17 @@ export default {
 | 
			
		||||
			const supplierRes = await getSupplierList();
 | 
			
		||||
			this.supplierList = supplierRes.data;
 | 
			
		||||
			// 物料单位列表
 | 
			
		||||
			const unitRes = await listData({
 | 
			
		||||
				pageNo: 1,
 | 
			
		||||
        pageSize: 99,
 | 
			
		||||
        dictType: 'goods_unit',
 | 
			
		||||
			});
 | 
			
		||||
			this.unitList = unitRes.data.list.map(item => {
 | 
			
		||||
				return {
 | 
			
		||||
					label: item.label,
 | 
			
		||||
					value: Number(item.value)
 | 
			
		||||
				}
 | 
			
		||||
			});
 | 
			
		||||
			// const unitRes = await listData({
 | 
			
		||||
			// 	pageNo: 1,
 | 
			
		||||
      //   pageSize: 99,
 | 
			
		||||
      //   dictType: 'goods_unit',
 | 
			
		||||
			// });
 | 
			
		||||
			// this.unitList = unitRes.data.list.map(item => {
 | 
			
		||||
			// 	return {
 | 
			
		||||
			// 		label: item.label,
 | 
			
		||||
			// 		value: Number(item.value)
 | 
			
		||||
			// 	}
 | 
			
		||||
			// });
 | 
			
		||||
		},
 | 
			
		||||
		initData() {
 | 
			
		||||
			this.materialAttrList.splice(0);
 | 
			
		||||
@@ -341,6 +345,9 @@ export default {
 | 
			
		||||
					// 获取物料详情
 | 
			
		||||
					this.urlOptions.infoURL(id).then(response => {
 | 
			
		||||
            this.dataForm = response.data;
 | 
			
		||||
						if (this.dataForm.unit) {
 | 
			
		||||
							this.dataForm.unit = String(this.dataForm.unit)
 | 
			
		||||
						}
 | 
			
		||||
          });
 | 
			
		||||
					// 获取物料的属性列表
 | 
			
		||||
					this.getList();
 | 
			
		||||
 
 | 
			
		||||
@@ -58,10 +58,6 @@ const tableProps = [
 | 
			
		||||
		prop: 'engName',
 | 
			
		||||
		label: '英文名称'
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'abbr',
 | 
			
		||||
		label: '缩写'
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'materialType',
 | 
			
		||||
		label: '物料类型'
 | 
			
		||||
@@ -117,13 +113,13 @@ export default {
 | 
			
		||||
			formConfig: [
 | 
			
		||||
				{
 | 
			
		||||
					type: 'input',
 | 
			
		||||
					label: '关键字',
 | 
			
		||||
					label: '物料名称',
 | 
			
		||||
					placeholder: '物料名称',
 | 
			
		||||
					param: 'name',
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					type: 'input',
 | 
			
		||||
					label: '关键字',
 | 
			
		||||
					label: '物料编码',
 | 
			
		||||
					placeholder: '物料编码',
 | 
			
		||||
					param: 'code',
 | 
			
		||||
				},
 | 
			
		||||
@@ -228,6 +224,27 @@ export default {
 | 
			
		||||
					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>
 | 
			
		||||
 
 | 
			
		||||
@@ -2,7 +2,7 @@
 | 
			
		||||
 * @Author: zwq
 | 
			
		||||
 * @Date: 2021-11-18 14:16:25
 | 
			
		||||
 * @LastEditors: DY
 | 
			
		||||
 * @LastEditTime: 2023-10-24 18:34:07
 | 
			
		||||
 * @LastEditTime: 2023-11-06 19:55:59
 | 
			
		||||
 * @Description:
 | 
			
		||||
-->
 | 
			
		||||
<template>
 | 
			
		||||
@@ -64,7 +64,7 @@ export default {
 | 
			
		||||
	data() {
 | 
			
		||||
		return {
 | 
			
		||||
			urlOptions: {
 | 
			
		||||
			  isGetCode: true,
 | 
			
		||||
			  isGetCode: false,
 | 
			
		||||
        codeURL: getCode,
 | 
			
		||||
				createURL: createMaterialDate,
 | 
			
		||||
				updateURL: updateMaterialDate,
 | 
			
		||||
@@ -81,8 +81,8 @@ export default {
 | 
			
		||||
			materialList: [],
 | 
			
		||||
			dataRule: {
 | 
			
		||||
				materialId: [{ required: true, message: "物料不能为空", trigger: "blur" }],
 | 
			
		||||
        code: [{ required: true, message: "工厂编码不能为空", trigger: "blur" }],
 | 
			
		||||
        name: [{ required: true, message: "工厂名称不能为空", trigger: "blur" }],
 | 
			
		||||
        code: [{ required: true, message: "批次号不能为空", trigger: "blur" }],
 | 
			
		||||
        name: [{ required: true, message: "批次名称不能为空", trigger: "blur" }],
 | 
			
		||||
      }
 | 
			
		||||
		};
 | 
			
		||||
	},
 | 
			
		||||
 
 | 
			
		||||
@@ -164,6 +164,27 @@ export default {
 | 
			
		||||
					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>
 | 
			
		||||
 
 | 
			
		||||
@@ -2,7 +2,7 @@
 | 
			
		||||
 * @Author: zwq
 | 
			
		||||
 * @Date: 2021-11-18 14:16:25
 | 
			
		||||
 * @LastEditors: DY
 | 
			
		||||
 * @LastEditTime: 2023-10-27 16:06:44
 | 
			
		||||
 * @LastEditTime: 2023-11-06 20:04:03
 | 
			
		||||
 * @Description:
 | 
			
		||||
-->
 | 
			
		||||
<template>
 | 
			
		||||
@@ -30,7 +30,9 @@
 | 
			
		||||
								<el-select
 | 
			
		||||
									v-model="dataForm.productId"
 | 
			
		||||
									filterable
 | 
			
		||||
									clearable
 | 
			
		||||
									:disabled="isdetail"
 | 
			
		||||
									style="width: 100%"
 | 
			
		||||
									placeholder="请选择产品">
 | 
			
		||||
									<el-option
 | 
			
		||||
										v-for="dict in productList"
 | 
			
		||||
@@ -88,6 +90,7 @@
 | 
			
		||||
							<el-select
 | 
			
		||||
									v-model="scope.row.materialId"
 | 
			
		||||
									filterable
 | 
			
		||||
									clearable
 | 
			
		||||
									:disabled="!scope.row.isEdit"
 | 
			
		||||
									placeholder="请选择物料"
 | 
			
		||||
									@change="setCode(scope.row)">
 | 
			
		||||
@@ -125,7 +128,7 @@
 | 
			
		||||
									<!-- <span>{{ item.btnName | i18nFilter }}</span> -->
 | 
			
		||||
								</el-button>
 | 
			
		||||
							</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-button
 | 
			
		||||
									type="text"
 | 
			
		||||
@@ -256,7 +259,7 @@ export default {
 | 
			
		||||
			const unitRes = await listData({
 | 
			
		||||
				pageNo: 1,
 | 
			
		||||
        pageSize: 99,
 | 
			
		||||
        dictType: 'goods_unit',
 | 
			
		||||
        dictType: 'unit_dict',
 | 
			
		||||
			});
 | 
			
		||||
			this.unitList = unitRes.data.list.map(item => {
 | 
			
		||||
				return {
 | 
			
		||||
@@ -295,17 +298,17 @@ export default {
 | 
			
		||||
				.catch(() => {});
 | 
			
		||||
		},
 | 
			
		||||
		setCode(row) {
 | 
			
		||||
			this.materialList.filter(item => {
 | 
			
		||||
			const tempM = this.materialList.filter(item => {
 | 
			
		||||
				if (row.materialId === item.id) {
 | 
			
		||||
					row.materialCode = item.code
 | 
			
		||||
				}
 | 
			
		||||
				this.unitList.filter(u => {
 | 
			
		||||
					if (item.unit === u.value) {
 | 
			
		||||
						row.unit = u.value
 | 
			
		||||
						row.mUnit = u.label
 | 
			
		||||
					}
 | 
			
		||||
				})
 | 
			
		||||
				// return row.materialId === item.id
 | 
			
		||||
				return row.materialId === item.id
 | 
			
		||||
			})
 | 
			
		||||
			this.unitList.filter(u => {
 | 
			
		||||
				if (tempM[0].unit === u.value) {
 | 
			
		||||
					row.unit = u.value
 | 
			
		||||
					row.mUnit = u.label
 | 
			
		||||
				}
 | 
			
		||||
			})
 | 
			
		||||
			// row.materialCode = tempList[0].code
 | 
			
		||||
			// row.unit = tempList[0].unit
 | 
			
		||||
@@ -343,8 +346,7 @@ export default {
 | 
			
		||||
			// 获取产品Bom详细列表
 | 
			
		||||
			getProBomList({
 | 
			
		||||
				...this.listQuery,
 | 
			
		||||
				bomId: this.dataForm.id,
 | 
			
		||||
				createTime: ['2023-10-26 00:00:00', '2023-10-27 12:00:00']
 | 
			
		||||
				bomId: this.dataForm.id
 | 
			
		||||
			}).then((response) => {
 | 
			
		||||
				this.tableData = response.data.records.map(item => {
 | 
			
		||||
					this.unitList.filter(u => {
 | 
			
		||||
@@ -450,7 +452,7 @@ export default {
 | 
			
		||||
 | 
			
		||||
.drawer >>> .visual-part {
 | 
			
		||||
	flex: 1 auto;
 | 
			
		||||
	max-height: 76vh;
 | 
			
		||||
	max-height: 30vh;
 | 
			
		||||
	overflow: hidden;
 | 
			
		||||
	overflow-y: scroll;
 | 
			
		||||
	padding-right: 10px; /* 调整滚动条样式 */
 | 
			
		||||
 
 | 
			
		||||
@@ -97,16 +97,10 @@ export default {
 | 
			
		||||
			formConfig: [
 | 
			
		||||
				{
 | 
			
		||||
					type: 'input',
 | 
			
		||||
					label: '关键字',
 | 
			
		||||
					placeholder: '物料名称',
 | 
			
		||||
					label: '产品名称',
 | 
			
		||||
					placeholder: '产品名称',
 | 
			
		||||
					param: 'name',
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					type: 'input',
 | 
			
		||||
					label: '关键字',
 | 
			
		||||
					placeholder: '物料编码',
 | 
			
		||||
					param: 'code',
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					type: 'button',
 | 
			
		||||
					btnName: '查询',
 | 
			
		||||
@@ -158,7 +152,6 @@ export default {
 | 
			
		||||
					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':
 | 
			
		||||
 
 | 
			
		||||
@@ -2,7 +2,7 @@
 | 
			
		||||
 * @Author: zwq
 | 
			
		||||
 * @Date: 2021-11-18 14:16:25
 | 
			
		||||
 * @LastEditors: DY
 | 
			
		||||
 * @LastEditTime: 2023-10-26 09:43:51
 | 
			
		||||
 * @LastEditTime: 2023-11-06 19:27:57
 | 
			
		||||
 * @Description:
 | 
			
		||||
-->
 | 
			
		||||
<template>
 | 
			
		||||
@@ -164,7 +164,7 @@ export default {
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					id: 2,
 | 
			
		||||
					name: '自动'
 | 
			
		||||
					name: 'PDA'
 | 
			
		||||
				}
 | 
			
		||||
			],
 | 
			
		||||
			materialList: [],
 | 
			
		||||
@@ -187,7 +187,6 @@ export default {
 | 
			
		||||
		async getDictData() {
 | 
			
		||||
			const materRes = await getMaterialList()
 | 
			
		||||
			this.materialList = materRes.data
 | 
			
		||||
			console.log('你好', this.materialList)
 | 
			
		||||
			const dateRes = await getMaterDateList()
 | 
			
		||||
			this.materialDateList = dateRes.data
 | 
			
		||||
			const eqRes = await getEqListAll()
 | 
			
		||||
@@ -252,6 +251,9 @@ export default {
 | 
			
		||||
				return item.id === this.dataForm.materialId
 | 
			
		||||
			})
 | 
			
		||||
			this.dataForm.materialCode = tempMaterial[0].code
 | 
			
		||||
			getMaterDateList({materialId: this.dataForm.materialId}).then(res =>{
 | 
			
		||||
				this.materialDateList = res.data
 | 
			
		||||
			})
 | 
			
		||||
		}
 | 
			
		||||
	},
 | 
			
		||||
};
 | 
			
		||||
 
 | 
			
		||||
@@ -56,7 +56,7 @@ const tableProps = [
 | 
			
		||||
		label: '物料编码'
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'materialDateId',
 | 
			
		||||
		prop: 'materialDateName',
 | 
			
		||||
		label: '物料批次'
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
@@ -183,7 +183,6 @@ export default {
 | 
			
		||||
					} else {
 | 
			
		||||
						this.listQuery.useTime = []
 | 
			
		||||
					}
 | 
			
		||||
					console.log('222', this.listQuery, val.time)
 | 
			
		||||
					this.getDataList();
 | 
			
		||||
					break;
 | 
			
		||||
				case 'reset':
 | 
			
		||||
@@ -207,6 +206,22 @@ export default {
 | 
			
		||||
					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>
 | 
			
		||||
 
 | 
			
		||||
@@ -2,7 +2,7 @@
 | 
			
		||||
 * @Author: zwq
 | 
			
		||||
 * @Date: 2023-08-01 14:55:51
 | 
			
		||||
 * @LastEditors: zhp
 | 
			
		||||
 * @LastEditTime: 2023-11-01 15:51:50
 | 
			
		||||
 * @LastEditTime: 2023-11-07 19:28:18
 | 
			
		||||
 * @Description:
 | 
			
		||||
-->
 | 
			
		||||
<template>
 | 
			
		||||
 
 | 
			
		||||
@@ -19,7 +19,7 @@
 | 
			
		||||
// import basicPage from '../../mixins/basic-page';
 | 
			
		||||
import { parseTime } from '../../mixins/code-filter';
 | 
			
		||||
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 { getWorkshopSectionPage } from '@/api/core/base/workshopSection';
 | 
			
		||||
 | 
			
		||||
@@ -58,21 +58,20 @@ export default {
 | 
			
		||||
      dataListLoading:false,
 | 
			
		||||
      tableData: [],
 | 
			
		||||
      listQuery: {
 | 
			
		||||
        lineIds: [],
 | 
			
		||||
        time: ''
 | 
			
		||||
        // lineIds: [],
 | 
			
		||||
        recordTime: []
 | 
			
		||||
      },
 | 
			
		||||
      dateLabelList: [],
 | 
			
		||||
      optionArrUrl: [getProductionLinePage ],
 | 
			
		||||
			formConfig: [
 | 
			
		||||
				{
 | 
			
		||||
					type: 'select',
 | 
			
		||||
					label: '产线',
 | 
			
		||||
					selectOptions: [],
 | 
			
		||||
          param: 'lineIds',
 | 
			
		||||
          defaultSelect: '',
 | 
			
		||||
          multiple:true,
 | 
			
		||||
					filterable: true,
 | 
			
		||||
				},
 | 
			
		||||
				// {
 | 
			
		||||
				// 	type: 'select',
 | 
			
		||||
				// 	label: '产线',
 | 
			
		||||
				// 	selectOptions: [],
 | 
			
		||||
        //   param: 'lineIds',
 | 
			
		||||
        //   defaultSelect: '',
 | 
			
		||||
        //   multiple:true,
 | 
			
		||||
				// 	filterable: true,
 | 
			
		||||
				// },
 | 
			
		||||
				{
 | 
			
		||||
					type: 'datePicker',
 | 
			
		||||
					label: '时间',
 | 
			
		||||
@@ -94,22 +93,22 @@ export default {
 | 
			
		||||
		};
 | 
			
		||||
	},
 | 
			
		||||
	created() {
 | 
			
		||||
		this.getArr();
 | 
			
		||||
		// this.getArr();
 | 
			
		||||
	},
 | 
			
		||||
	methods: {
 | 
			
		||||
		getArr() {
 | 
			
		||||
			const params = {
 | 
			
		||||
				page: 1,
 | 
			
		||||
				limit: 500,
 | 
			
		||||
			};
 | 
			
		||||
			this.optionArrUrl.forEach((item, index) => {
 | 
			
		||||
				item(params).then((response) => {
 | 
			
		||||
					this.formConfig[index].selectOptions = response.data.list
 | 
			
		||||
          // this.formConfig[0].defaultSelect = response.data.list[0].id
 | 
			
		||||
          this.$set(this.formConfig[0], 'defaultSelect', response.data.list[0].id)
 | 
			
		||||
				});
 | 
			
		||||
			});
 | 
			
		||||
    },
 | 
			
		||||
		// getArr() {
 | 
			
		||||
		// 	const params = {
 | 
			
		||||
		// 		page: 1,
 | 
			
		||||
		// 		limit: 500,
 | 
			
		||||
		// 	};
 | 
			
		||||
		// 	this.optionArrUrl.forEach((item, index) => {
 | 
			
		||||
		// 		item(params).then((response) => {
 | 
			
		||||
		// 			this.formConfig[index].selectOptions = response.data.list
 | 
			
		||||
    //       // this.formConfig[0].defaultSelect = response.data.list[0].id
 | 
			
		||||
    //       this.$set(this.formConfig[0], 'defaultSelect', response.data.list[0].id)
 | 
			
		||||
		// 		});
 | 
			
		||||
		// 	});
 | 
			
		||||
    // },
 | 
			
		||||
    getData() {
 | 
			
		||||
      // this.listQuery.lineIds = ['1672847052717821953']
 | 
			
		||||
      // this.listQuery.productId = val.productId;
 | 
			
		||||
@@ -230,12 +229,26 @@ export default {
 | 
			
		||||
    buttonClick(val) {
 | 
			
		||||
			switch (val.btnName) {
 | 
			
		||||
        case 'search':
 | 
			
		||||
          this.listQuery.lineIds = val.lineIds ? val.lineIds :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;
 | 
			
		||||
          // this.listQuery.recordTime = val.time ? new Date(val.time).getTime() : undefined
 | 
			
		||||
          if (val.time) {
 | 
			
		||||
            const tempTtime = new Date(val.time)
 | 
			
		||||
            let day = 0
 | 
			
		||||
            switch (tempTtime.getMonth() + 1) {
 | 
			
		||||
              case 1, 3, 5, 7, 8, 10, 12:
 | 
			
		||||
                day = 31;
 | 
			
		||||
                break;
 | 
			
		||||
              case 2:
 | 
			
		||||
                day = 28;
 | 
			
		||||
                break;
 | 
			
		||||
              case 4, 6, 9, 11:
 | 
			
		||||
                day = 30;
 | 
			
		||||
                break;
 | 
			
		||||
            }
 | 
			
		||||
            console.log(parseTime(new Date(tempTtime.getFullYear(), 11, 31, 23, 59, 59)))
 | 
			
		||||
            this.listQuery.recordTime = [
 | 
			
		||||
              val.time,
 | 
			
		||||
              parseTime(new Date(tempTtime.getFullYear(), tempTtime.getMonth(), day, 23, 59, 59))
 | 
			
		||||
            ]
 | 
			
		||||
            this.getData()
 | 
			
		||||
          } else {
 | 
			
		||||
            this.$message({
 | 
			
		||||
 
 | 
			
		||||
@@ -2,7 +2,7 @@
 | 
			
		||||
 * @Author: zwq
 | 
			
		||||
 * @Date: 2021-11-18 14:16:25
 | 
			
		||||
 * @LastEditors: DY
 | 
			
		||||
 * @LastEditTime: 2023-10-16 11:16:48
 | 
			
		||||
 * @LastEditTime: 2023-11-03 16:32:52
 | 
			
		||||
 * @Description:
 | 
			
		||||
-->
 | 
			
		||||
<template>
 | 
			
		||||
@@ -13,14 +13,6 @@
 | 
			
		||||
		@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
 | 
			
		||||
@@ -29,6 +21,14 @@
 | 
			
		||||
						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">
 | 
			
		||||
 
 | 
			
		||||
@@ -43,19 +43,23 @@ import basicPage from '../../mixins/basic-page';
 | 
			
		||||
import { parseTime } from '../../mixins/code-filter';
 | 
			
		||||
import {
 | 
			
		||||
	deleteFactory,
 | 
			
		||||
	getFactoryPage,
 | 
			
		||||
	exportFactoryExcel,
 | 
			
		||||
	getFactoryPage
 | 
			
		||||
} from '@/api/core/base/factory';
 | 
			
		||||
 | 
			
		||||
const tableProps = [
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'code',
 | 
			
		||||
		label: '工厂编码'
 | 
			
		||||
	},																																																																						
 | 
			
		||||
		prop: 'createTime',
 | 
			
		||||
		label: '添加时间',
 | 
			
		||||
		filter: parseTime
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'name',
 | 
			
		||||
		label: '工厂名称'
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'code',
 | 
			
		||||
		label: '工厂编码'
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'address',
 | 
			
		||||
		label: '地址'
 | 
			
		||||
@@ -63,12 +67,7 @@ const tableProps = [
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'remark',
 | 
			
		||||
		label: '备注'
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'createTime',
 | 
			
		||||
		label: '创建时间',
 | 
			
		||||
		filter: parseTime
 | 
			
		||||
	},
 | 
			
		||||
	}
 | 
			
		||||
];
 | 
			
		||||
 | 
			
		||||
export default {
 | 
			
		||||
@@ -78,17 +77,17 @@ export default {
 | 
			
		||||
			urlOptions: {
 | 
			
		||||
				getDataListURL: getFactoryPage,
 | 
			
		||||
				deleteURL: deleteFactory,
 | 
			
		||||
				exportURL: exportFactoryExcel,
 | 
			
		||||
				// exportURL: exportFactoryExcel,
 | 
			
		||||
			},
 | 
			
		||||
			tableProps,
 | 
			
		||||
			tableBtn: [
 | 
			
		||||
				this.$auth.hasPermi(`base:factory:update`)
 | 
			
		||||
				this.$auth.hasPermi(`base:core-factory:update`)
 | 
			
		||||
					? {
 | 
			
		||||
							type: 'edit',
 | 
			
		||||
							btnName: '编辑',
 | 
			
		||||
					  }
 | 
			
		||||
					: undefined,
 | 
			
		||||
          this.$auth.hasPermi(`base:factory:delete`)
 | 
			
		||||
          this.$auth.hasPermi(`base:core-factory:delete`)
 | 
			
		||||
					? {
 | 
			
		||||
							type: 'delete',
 | 
			
		||||
							btnName: '删除',
 | 
			
		||||
@@ -97,18 +96,18 @@ export default {
 | 
			
		||||
			].filter((v)=>v),
 | 
			
		||||
			tableData: [],
 | 
			
		||||
			formConfig: [
 | 
			
		||||
				{
 | 
			
		||||
					type: 'input',
 | 
			
		||||
					label: '工厂编码',
 | 
			
		||||
					placeholder: '工厂编码',
 | 
			
		||||
					param: 'code',
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					type: 'input',
 | 
			
		||||
					label: '工厂名称',
 | 
			
		||||
					placeholder: '工厂名称',
 | 
			
		||||
					param: 'name',
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					type: 'input',
 | 
			
		||||
					label: '工厂编码',
 | 
			
		||||
					placeholder: '工厂编码',
 | 
			
		||||
					param: 'code',
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					type: 'button',
 | 
			
		||||
					btnName: '搜索',
 | 
			
		||||
@@ -127,7 +126,7 @@ export default {
 | 
			
		||||
					type: 'separate',
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					type: this.$auth.hasPermi('base:factory:create') ? 'button' : '',
 | 
			
		||||
					type: this.$auth.hasPermi('base:core-factory:create') ? 'button' : '',
 | 
			
		||||
					btnName: '新增',
 | 
			
		||||
					name: 'add',
 | 
			
		||||
					color: 'success',
 | 
			
		||||
 
 | 
			
		||||
@@ -2,7 +2,7 @@
 | 
			
		||||
    filename: index.vue
 | 
			
		||||
    author: liubin
 | 
			
		||||
    date: 2023-08-04 14:44:58
 | 
			
		||||
    description: 设备24小时生产记录
 | 
			
		||||
    description: 近24小时产线生产数据
 | 
			
		||||
-->
 | 
			
		||||
<template>
 | 
			
		||||
	<div class="app-container">
 | 
			
		||||
@@ -24,6 +24,7 @@
 | 
			
		||||
 | 
			
		||||
<script>
 | 
			
		||||
import { getPdlDataOneDay } from '@/api/core/monitoring/data24'
 | 
			
		||||
import { parseTime } from '../../mixins/code-filter';
 | 
			
		||||
 | 
			
		||||
export default {
 | 
			
		||||
	name: 'productionLineData24',
 | 
			
		||||
@@ -54,28 +55,32 @@ export default {
 | 
			
		||||
	},
 | 
			
		||||
	methods: {
 | 
			
		||||
		/** 构建tableProps - 依据第一个元素所提供的信息 */
 | 
			
		||||
		buildProps(plData) {
 | 
			
		||||
			plData.forEach(item => {
 | 
			
		||||
				this.timeList.push(item.name)
 | 
			
		||||
			})
 | 
			
		||||
			const timeArray = Array.from(new Set(this.timeList))
 | 
			
		||||
			console.log('nihc', timeArray)
 | 
			
		||||
			for (const times of timeArray) {
 | 
			
		||||
				if (times !== '投入数量' && times !== '产出数量' && times !== '报废数量' && times !== '产出面积') {
 | 
			
		||||
					const subprop = {
 | 
			
		||||
						label: times.slice(0, 10) + ' ' + times.slice(11),
 | 
			
		||||
						align: 'center',
 | 
			
		||||
						children: [
 | 
			
		||||
							{ prop: times + '_in', label: '投入数量' },
 | 
			
		||||
							{ prop: times + '_out', label: '产出数量' },
 | 
			
		||||
							{ prop: times + '_junk', label: '报废数量' },
 | 
			
		||||
							{ prop: times + '_area', label: '产出面积' }
 | 
			
		||||
						]
 | 
			
		||||
					}
 | 
			
		||||
					this.arr.push(subprop)
 | 
			
		||||
		buildProps() {
 | 
			
		||||
			// 获取当前时间
 | 
			
		||||
			var currentTime = new Date();
 | 
			
		||||
			let timeArr = []
 | 
			
		||||
 | 
			
		||||
			// 添加24小时内的整点时间--时间戳格式
 | 
			
		||||
			for (let i = 0; i < 24; i ++) {
 | 
			
		||||
				timeArr.unshift(new Date(currentTime.getFullYear(), currentTime.getMonth(), currentTime.getDate(), currentTime.getHours() - i, 0, 0).getTime())
 | 
			
		||||
			}
 | 
			
		||||
			console.log("24小时内的开始时间:" + timeArr, timeArr.length);
 | 
			
		||||
			for(const times of timeArr) {
 | 
			
		||||
				const subprop = {
 | 
			
		||||
					label: parseTime(times),
 | 
			
		||||
					align: 'center',
 | 
			
		||||
					children: [
 | 
			
		||||
						{ prop: times + '_up', label: '上片数据' },
 | 
			
		||||
						{ prop: times + '_down', label: '下片数据' },
 | 
			
		||||
						{ prop: times + '_good', label: '良品面积' },
 | 
			
		||||
						{ prop: times + '_bad', label: '报废数据' },
 | 
			
		||||
						{ prop: times + '_percent', label: '报废比例(%)' }
 | 
			
		||||
					]
 | 
			
		||||
				}
 | 
			
		||||
				this.arr.push(subprop)
 | 
			
		||||
			}
 | 
			
		||||
			this.tableProps = this.arr
 | 
			
		||||
			console.log('111', this.tableProps)
 | 
			
		||||
		},
 | 
			
		||||
		setRowSpan(arr) {
 | 
			
		||||
      let count = 0
 | 
			
		||||
@@ -101,20 +106,11 @@ export default {
 | 
			
		||||
			console.log('打印看下数据list', list)
 | 
			
		||||
			list.forEach((ele, index) => {
 | 
			
		||||
				let tempData = []
 | 
			
		||||
				ele.data.forEach(item => {
 | 
			
		||||
					item.children.forEach(params => {
 | 
			
		||||
						if (params.dynamicName === '投入数量') {
 | 
			
		||||
							tempData[item.dynamicName + '_in'] = params.dynamicValue
 | 
			
		||||
						} else if (params.dynamicName === '产出数量') {
 | 
			
		||||
							tempData[item.dynamicName + '_out'] = params.dynamicValue
 | 
			
		||||
						} else if (params.dynamicName === '报废数量') {
 | 
			
		||||
							tempData[item.dynamicName + '_junk'] = params.dynamicValue
 | 
			
		||||
						} else {
 | 
			
		||||
							tempData[item.dynamicName + '_area'] = params.dynamicValue
 | 
			
		||||
						}
 | 
			
		||||
					})
 | 
			
		||||
				})
 | 
			
		||||
				tempData['proLineName'] = ele.proLineName
 | 
			
		||||
				tempData[ele.recordTime + '_up'] = ele.inputNum
 | 
			
		||||
				tempData[ele.recordTime + '_down'] = ele.outputNum
 | 
			
		||||
				tempData[ele.recordTime + '_up'] = ele.inputNum
 | 
			
		||||
				tempData['proLineName'] = ele.lineName
 | 
			
		||||
				tempData['workOrderName'] = ele.workOrderName
 | 
			
		||||
				tempData['spec'] = ele.spec
 | 
			
		||||
				this.tableData.push(tempData)
 | 
			
		||||
				console.log('看看数据', this.tableData, tempData)
 | 
			
		||||
@@ -151,17 +147,23 @@ export default {
 | 
			
		||||
            prop: 'proLineName',
 | 
			
		||||
            label: '生产线',
 | 
			
		||||
						fixed: 'left',
 | 
			
		||||
						showOverflowTooltip: true
 | 
			
		||||
						'show-overflow-tooltip': true
 | 
			
		||||
          },
 | 
			
		||||
					{
 | 
			
		||||
            prop: 'workOrderName',
 | 
			
		||||
            label: '当前工单',
 | 
			
		||||
						fixed: 'left',
 | 
			
		||||
						'show-overflow-tooltip': true
 | 
			
		||||
          },
 | 
			
		||||
          {
 | 
			
		||||
            prop: 'spec',
 | 
			
		||||
            label: '产品规格',
 | 
			
		||||
						fixed: 'left',
 | 
			
		||||
						showOverflowTooltip: true
 | 
			
		||||
						'show-overflow-tooltip': true
 | 
			
		||||
          }
 | 
			
		||||
				]
 | 
			
		||||
				this.buildProps(res.data.nameData);
 | 
			
		||||
				this.buildData(res.data.data);
 | 
			
		||||
				this.buildProps();
 | 
			
		||||
				this.buildData(res.data);
 | 
			
		||||
      })
 | 
			
		||||
 | 
			
		||||
			// // const data = this.res.data;
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										162
									
								
								src/views/delivery/deliveryLog/components/addOrUpdate.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										162
									
								
								src/views/delivery/deliveryLog/components/addOrUpdate.vue
									
									
									
									
									
										Normal 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>
 | 
			
		||||
							
								
								
									
										172
									
								
								src/views/delivery/deliveryLog/components/deliveryLogDetail.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										172
									
								
								src/views/delivery/deliveryLog/components/deliveryLogDetail.vue
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,172 @@
 | 
			
		||||
<template>
 | 
			
		||||
  <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"
 | 
			
		||||
      />
 | 
			
		||||
      <pagination
 | 
			
		||||
        :page.sync="queryParams.pageNo"
 | 
			
		||||
        :limit.sync="queryParams.pageSize"
 | 
			
		||||
        :total="total"
 | 
			
		||||
        @pagination="getList"
 | 
			
		||||
      />
 | 
			
		||||
    </div>
 | 
			
		||||
  </el-drawer>
 | 
			
		||||
</template>
 | 
			
		||||
<script>
 | 
			
		||||
import { parseTime } from '@/utils/ruoyi'
 | 
			
		||||
import { deliveryLogDetPage } from '@/api/base/delivery'
 | 
			
		||||
const tableProps = [
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'createTime',
 | 
			
		||||
    label: '添加时间',
 | 
			
		||||
    filter: parseTime,
 | 
			
		||||
    minWidth: 150
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'deliveryCarCode',
 | 
			
		||||
    label: '装车单号',
 | 
			
		||||
    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: [],
 | 
			
		||||
      tableH: this.tableHeight(275),
 | 
			
		||||
      orderName: '',
 | 
			
		||||
      code: ''
 | 
			
		||||
    }
 | 
			
		||||
  },
 | 
			
		||||
  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
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
</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>
 | 
			
		||||
							
								
								
									
										151
									
								
								src/views/delivery/deliveryLog/components/loadedPage.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										151
									
								
								src/views/delivery/deliveryLog/components/loadedPage.vue
									
									
									
									
									
										Normal 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>
 | 
			
		||||
							
								
								
									
										308
									
								
								src/views/delivery/deliveryLog/index.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										308
									
								
								src/views/delivery/deliveryLog/index.vue
									
									
									
									
									
										Normal 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>
 | 
			
		||||
@@ -0,0 +1,464 @@
 | 
			
		||||
<template>
 | 
			
		||||
  <el-drawer
 | 
			
		||||
    title="发货进度"
 | 
			
		||||
    :visible.sync="centervisible"
 | 
			
		||||
    size="80%"
 | 
			
		||||
    class="deliveryLogDetail"
 | 
			
		||||
    @close='closeA'>
 | 
			
		||||
    <div class="box1">
 | 
			
		||||
      <div class="box_col">
 | 
			
		||||
        <div class="blodTip">订单名</div>
 | 
			
		||||
        <div class="lightTip">{{orderMsg.orderName ? orderMsg.orderName : '-'}}</div>
 | 
			
		||||
      </div>
 | 
			
		||||
      <div class="box_col">
 | 
			
		||||
        <div class="blodTip">订单数量</div>
 | 
			
		||||
        <div class="lightTip">{{orderMsg.orderNum ? orderMsg.orderNum : '-'}}</div>
 | 
			
		||||
      </div>
 | 
			
		||||
      <div class="box_col">
 | 
			
		||||
        <div class="blodTip">装货数量</div>
 | 
			
		||||
        <div class="lightTip">{{orderMsg.num ? orderMsg.num : '-'}}</div>
 | 
			
		||||
      </div>
 | 
			
		||||
      <div class="box_col">
 | 
			
		||||
        <div class="blodTip">累积占比(%)</div>
 | 
			
		||||
        <div class="lightTip">{{orderMsg.rate ? orderMsg.rate : '-'}}</div>
 | 
			
		||||
      </div>
 | 
			
		||||
      <div class="box_col">
 | 
			
		||||
        <div class="blodTip">累积运输费用</div>
 | 
			
		||||
        <div class="lightTip">{{orderMsg.cost ? orderMsg.cost : '-'}}</div>
 | 
			
		||||
      </div>
 | 
			
		||||
    </div>
 | 
			
		||||
    <div class="box2">
 | 
			
		||||
      <div class="boxTitle">
 | 
			
		||||
        <span class="blueTitle"></span>
 | 
			
		||||
        <span>发货清单</span>
 | 
			
		||||
      </div>
 | 
			
		||||
      <el-tabs v-model="activeName" @tab-click="toggleTab">
 | 
			
		||||
        <el-tab-pane label="数据列表" name="dataList">
 | 
			
		||||
          <!-- 列表 -->
 | 
			
		||||
          <div v-if="activeName === 'dataList'">
 | 
			
		||||
            <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="150"
 | 
			
		||||
                label="操作"
 | 
			
		||||
                :method-list="tableBtn"
 | 
			
		||||
                @clickBtn="viewDetDetail"
 | 
			
		||||
              />
 | 
			
		||||
            </base-table>
 | 
			
		||||
            <pagination
 | 
			
		||||
              :page.sync="queryParams.pageNo"
 | 
			
		||||
              :limit.sync="queryParams.pageSize"
 | 
			
		||||
              :total="total"
 | 
			
		||||
              @pagination="getList"
 | 
			
		||||
            />
 | 
			
		||||
          </div>
 | 
			
		||||
        </el-tab-pane>
 | 
			
		||||
        <el-tab-pane label="环形图" name="barChart">
 | 
			
		||||
          <div v-if="activeName === 'barChart'">
 | 
			
		||||
            <div 
 | 
			
		||||
              id="logDetPieBar"
 | 
			
		||||
              style="width: 100%"
 | 
			
		||||
              :style="{ height: chartHeight + 'px' }"
 | 
			
		||||
            ></div>
 | 
			
		||||
          </div>
 | 
			
		||||
        </el-tab-pane>
 | 
			
		||||
      </el-tabs>
 | 
			
		||||
    </div>
 | 
			
		||||
    <!-- 详情抽屉 -->
 | 
			
		||||
    <el-drawer
 | 
			
		||||
      title="发货详情"
 | 
			
		||||
      size="60%"
 | 
			
		||||
      :append-to-body="true"
 | 
			
		||||
      :visible.sync="innerDrawer"
 | 
			
		||||
      @close='closeB'>
 | 
			
		||||
      <div class="box3">
 | 
			
		||||
        <el-row>
 | 
			
		||||
          <el-col :span='12'>
 | 
			
		||||
            <span class="title">订单名:</span>
 | 
			
		||||
            <span class="text">{{orderMsg.orderName ? orderMsg.orderName : '-'}}</span>
 | 
			
		||||
          </el-col>
 | 
			
		||||
          <el-col :span='12'>
 | 
			
		||||
            <span class="title">发货单号:</span>
 | 
			
		||||
            <span class="text">{{logCode ? logCode : '-'}}</span>
 | 
			
		||||
          </el-col>
 | 
			
		||||
        </el-row>
 | 
			
		||||
      </div>
 | 
			
		||||
      <div class="box4">
 | 
			
		||||
        <div class="boxTitle">
 | 
			
		||||
          <span class="blueTitle"></span>
 | 
			
		||||
          <span>详情</span>
 | 
			
		||||
        </div>
 | 
			
		||||
        <base-table
 | 
			
		||||
          :page="queryParams2.pageNo"
 | 
			
		||||
          :limit="queryParams2.pageSize"
 | 
			
		||||
          :table-props="tableProps2"
 | 
			
		||||
          :table-data="tableData2"
 | 
			
		||||
          :max-height="tableH2"
 | 
			
		||||
        />
 | 
			
		||||
        <pagination
 | 
			
		||||
          :page.sync="queryParams2.pageNo"
 | 
			
		||||
          :limit.sync="queryParams2.pageSize"
 | 
			
		||||
          :total="total2"
 | 
			
		||||
          @pagination="getList2"
 | 
			
		||||
        />
 | 
			
		||||
      </div>
 | 
			
		||||
    </el-drawer>
 | 
			
		||||
  </el-drawer>
 | 
			
		||||
</template>
 | 
			
		||||
<script>
 | 
			
		||||
import { deliveryLogPage, deliveryLogDetPage } from '@/api/base/delivery'
 | 
			
		||||
import { parseTime } from '@/utils/ruoyi'
 | 
			
		||||
import * as echarts from 'echarts'
 | 
			
		||||
import resize from '@/utils/chartMixins/resize'
 | 
			
		||||
const tableProps = [
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'deliveryTime',
 | 
			
		||||
    label: '发货时间',
 | 
			
		||||
    filter: parseTime,
 | 
			
		||||
    minWidth: 150
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'code',
 | 
			
		||||
    label: '发货单号',
 | 
			
		||||
    showOverflowtooltip: true
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'orderNum',
 | 
			
		||||
    label: '订单数量'
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'num',
 | 
			
		||||
    label: '发货数量'
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'rate',
 | 
			
		||||
    label: '发货比列(%)'
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'principalCost',
 | 
			
		||||
    label: '运输费用'
 | 
			
		||||
  }
 | 
			
		||||
]
 | 
			
		||||
const tableProps2 = [
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'createTime',
 | 
			
		||||
    label: '添加时间',
 | 
			
		||||
    filter: parseTime,
 | 
			
		||||
    minWidth: 150
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'deliveryCarCode',
 | 
			
		||||
    label: '装车单号',
 | 
			
		||||
    showOverflowtooltip: true
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'loadTime',
 | 
			
		||||
    label: '装车时间',
 | 
			
		||||
    filter: parseTime,
 | 
			
		||||
    minWidth: 150
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'productName',
 | 
			
		||||
    label: '装车产品',
 | 
			
		||||
    showOverflowtooltip: true
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'packagingSize',
 | 
			
		||||
    label: '装箱规格(片/箱)'
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'packagingNum',
 | 
			
		||||
    label: '箱数'
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'quantity',
 | 
			
		||||
    label: '装车总量'
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'productDate',
 | 
			
		||||
    label: '产品批次',
 | 
			
		||||
    showOverflowtooltip: true
 | 
			
		||||
  }
 | 
			
		||||
]
 | 
			
		||||
export default {
 | 
			
		||||
  name: 'DeliveryLogDetDetail',
 | 
			
		||||
  mixins: [resize],
 | 
			
		||||
  data() {
 | 
			
		||||
    return {
 | 
			
		||||
      centervisible: false,
 | 
			
		||||
      activeName: 'dataList',
 | 
			
		||||
      // 查询参数
 | 
			
		||||
      queryParams: {
 | 
			
		||||
        pageNo: 1,
 | 
			
		||||
        pageSize: 100,
 | 
			
		||||
        orderId: ''
 | 
			
		||||
      },
 | 
			
		||||
      orderMsg: {},
 | 
			
		||||
      tableProps,
 | 
			
		||||
      tableData: [],
 | 
			
		||||
      total: 0,
 | 
			
		||||
      tableH: this.tableHeight(350),
 | 
			
		||||
      tableBtn: [
 | 
			
		||||
        this.$auth.hasPermi('base:group-team:update')
 | 
			
		||||
          ? {
 | 
			
		||||
              type: 'detDetail',
 | 
			
		||||
              btnName: '查看发货详情'
 | 
			
		||||
            }
 | 
			
		||||
          : undefined
 | 
			
		||||
      ].filter((v) => v),
 | 
			
		||||
      innerDrawer: false,
 | 
			
		||||
      // 详情
 | 
			
		||||
      queryParams2: {
 | 
			
		||||
        pageNo: 1,
 | 
			
		||||
        pageSize: 20,
 | 
			
		||||
        logId: ''
 | 
			
		||||
      },
 | 
			
		||||
      tableProps2,
 | 
			
		||||
      tableData2: [],
 | 
			
		||||
      tableH2: this.tableHeight(275),
 | 
			
		||||
      total2: 0,
 | 
			
		||||
      logCode: '',
 | 
			
		||||
      // 图
 | 
			
		||||
      chartDom: '',
 | 
			
		||||
      chart: '',
 | 
			
		||||
      chartHeight: this.tableHeight(300)
 | 
			
		||||
    }
 | 
			
		||||
  },
 | 
			
		||||
  // watch: {
 | 
			
		||||
  //   chartData: function () {
 | 
			
		||||
  //     this.getChart()
 | 
			
		||||
  //   }
 | 
			
		||||
  // },
 | 
			
		||||
  mounted() {
 | 
			
		||||
    window.addEventListener('resize', () => {
 | 
			
		||||
      this.tableH = this.tableHeight(350)
 | 
			
		||||
    })
 | 
			
		||||
    window.addEventListener('resize', () => {
 | 
			
		||||
      this.tableH2 = this.tableHeight(275)
 | 
			
		||||
    })
 | 
			
		||||
    window.addEventListener('resize', () => {
 | 
			
		||||
      this.chartHeight = this.tableHeight(300)
 | 
			
		||||
    })
 | 
			
		||||
  },
 | 
			
		||||
  methods: {
 | 
			
		||||
    init(params) {
 | 
			
		||||
      this.queryParams.orderId = params.orderId
 | 
			
		||||
      this.orderMsg = params
 | 
			
		||||
      this.centervisible = true
 | 
			
		||||
      this.getList()
 | 
			
		||||
    },
 | 
			
		||||
    getList() {
 | 
			
		||||
      deliveryLogPage({...this.queryParams}).then(res => {
 | 
			
		||||
        this.tableData = res.data.list || []
 | 
			
		||||
        this.taotal = res.data.total || 0
 | 
			
		||||
      })
 | 
			
		||||
    },
 | 
			
		||||
    toggleTab() {
 | 
			
		||||
      if (this.activeName  === 'barChart') {
 | 
			
		||||
        this.$nextTick(() => {
 | 
			
		||||
          this.getBar()
 | 
			
		||||
        })
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
    getBar() {
 | 
			
		||||
      if (
 | 
			
		||||
        this.chart !== null &&
 | 
			
		||||
        this.chart !== '' &&
 | 
			
		||||
        this.chart !== undefined
 | 
			
		||||
      ) {
 | 
			
		||||
        this.chart.dispose() // 页面多次刷新会出现警告,Dom已经初始化了一个实例,这是销毁实例
 | 
			
		||||
      }
 | 
			
		||||
      this.chartDom = document.getElementById('logDetPieBar')
 | 
			
		||||
      this.chart = echarts.init(this.chartDom)
 | 
			
		||||
      let seriesData = []
 | 
			
		||||
      let sumData = 0
 | 
			
		||||
      this.tableData && this.tableData.map(item =>{
 | 
			
		||||
        let obj = {}
 | 
			
		||||
        obj.value = item.rate
 | 
			
		||||
        obj.name = item.name
 | 
			
		||||
        seriesData.push(obj)
 | 
			
		||||
        sumData+=item.rate
 | 
			
		||||
      })
 | 
			
		||||
      if (sumData < 100) {
 | 
			
		||||
        let obj = {}
 | 
			
		||||
        obj.value = 100 - sumData
 | 
			
		||||
        obj.name = "未发货"
 | 
			
		||||
        seriesData.push(obj)
 | 
			
		||||
      }
 | 
			
		||||
      var option = {
 | 
			
		||||
        color: ['#B0EB42', '#FF9747', '#FF6860', '#7164FF', '#288AFF', '#63BDFF', '#73DE93', '#FFCE6A'],
 | 
			
		||||
        tooltip: {
 | 
			
		||||
          trigger: 'item',
 | 
			
		||||
          formatter: function(params) {
 | 
			
		||||
            let str = `<span style="display:inline-block;width:8px;height:8px;margin: 0 8px 0 -3px;border-radius:2px;background-color:${params.color};"></span>`
 | 
			
		||||
            return `<span>
 | 
			
		||||
                <span style="color:rgba(0,0,0,0.85);">${str}${params.name}</span>
 | 
			
		||||
                <span style="display:inline-block;margin-left:10px;color:rgba(0,0,0,0.45);">${params.percent}</span>
 | 
			
		||||
              </span>`
 | 
			
		||||
          }
 | 
			
		||||
        },
 | 
			
		||||
        legend: {
 | 
			
		||||
          bottom: '5%',
 | 
			
		||||
          left: 'center',
 | 
			
		||||
          icon: 'rect',
 | 
			
		||||
          itemHeight: 8,
 | 
			
		||||
          itemWidth: 8
 | 
			
		||||
        },
 | 
			
		||||
        series: [
 | 
			
		||||
          {
 | 
			
		||||
            type: 'pie',
 | 
			
		||||
            radius: ['60%', '80%'],
 | 
			
		||||
            avoidLabelOverlap: false,
 | 
			
		||||
            label: {
 | 
			
		||||
              show: false,
 | 
			
		||||
              position: 'center'
 | 
			
		||||
            },
 | 
			
		||||
            emphasis: {
 | 
			
		||||
              label: {
 | 
			
		||||
                show: true,
 | 
			
		||||
                fontSize: 40,
 | 
			
		||||
                fontWeight: 'bold'
 | 
			
		||||
              },
 | 
			
		||||
              scale: true ,
 | 
			
		||||
              scaleSize: 20 ,
 | 
			
		||||
            },
 | 
			
		||||
            labelLine: {
 | 
			
		||||
              show: false
 | 
			
		||||
            },
 | 
			
		||||
            data: seriesData
 | 
			
		||||
          }
 | 
			
		||||
        ]
 | 
			
		||||
      };
 | 
			
		||||
 | 
			
		||||
      option && this.chart.setOption(option);
 | 
			
		||||
    },
 | 
			
		||||
    viewDetDetail(val) {
 | 
			
		||||
      this.logCode = val.data.code
 | 
			
		||||
      this.innerDrawer = true
 | 
			
		||||
      this.queryParams2.logId = val.data.id
 | 
			
		||||
      this.getList2()
 | 
			
		||||
    },
 | 
			
		||||
    closeA() {
 | 
			
		||||
      // 清空数据
 | 
			
		||||
      this.activeName = 'dataList'
 | 
			
		||||
      this.queryParams.orderId = ''
 | 
			
		||||
      this.tableData = []
 | 
			
		||||
      this.orderMsg = {}
 | 
			
		||||
      this.innerDrawer = false
 | 
			
		||||
    },
 | 
			
		||||
    getList2() {
 | 
			
		||||
      deliveryLogDetPage({...this.queryParams2}).then(res => {
 | 
			
		||||
        this.tableData2 = res.data.list || []
 | 
			
		||||
        this.total2 = res.data.total || 0
 | 
			
		||||
      })
 | 
			
		||||
    },
 | 
			
		||||
    closeB() {
 | 
			
		||||
      this.logCode = ''
 | 
			
		||||
      this.queryParams2.pageNo = 1
 | 
			
		||||
      this.queryParams2.pageSize = 20
 | 
			
		||||
      this.queryParams2.logId = ''
 | 
			
		||||
      this.tableData2 = []
 | 
			
		||||
      this.total2 = 0
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
</script>
 | 
			
		||||
<style scoped lang='scss'>
 | 
			
		||||
.box1 {
 | 
			
		||||
  height: 56px;
 | 
			
		||||
  .box_col {
 | 
			
		||||
    display: inline-block;
 | 
			
		||||
    width: 20%;
 | 
			
		||||
    padding: 8px 8px 8px 40px;
 | 
			
		||||
    .blodTip {
 | 
			
		||||
      height: 16px;
 | 
			
		||||
      font-size: 14px;
 | 
			
		||||
      font-weight: 600;
 | 
			
		||||
      color: rgba(0,0,0,0.85);
 | 
			
		||||
      margin-bottom: 8px;
 | 
			
		||||
    }
 | 
			
		||||
    .lightTip {
 | 
			
		||||
      height: 16px;
 | 
			
		||||
      font-size: 14px;
 | 
			
		||||
      font-weight: 400;
 | 
			
		||||
      color: rgba(102,102,102,0.75);
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
.box2 {
 | 
			
		||||
    padding:32px 32px 30px 30px;
 | 
			
		||||
    height: calc(100vh - 150px);
 | 
			
		||||
}
 | 
			
		||||
.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;
 | 
			
		||||
}
 | 
			
		||||
.box3 {
 | 
			
		||||
  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);
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
.box4 {
 | 
			
		||||
  padding:32px 32px 30px 30px;
 | 
			
		||||
  height: calc(100vh - 125px);
 | 
			
		||||
}
 | 
			
		||||
</style>
 | 
			
		||||
<style lang='scss'>
 | 
			
		||||
.deliveryLogDetail {
 | 
			
		||||
  .el-tabs__nav::after {
 | 
			
		||||
    content: "";
 | 
			
		||||
    position: absolute;
 | 
			
		||||
    left: 0;
 | 
			
		||||
    bottom: 0;
 | 
			
		||||
    width: 100%;
 | 
			
		||||
    height: 2px;
 | 
			
		||||
    background-color: #e4e7ed;
 | 
			
		||||
    /* z-index: 1; */
 | 
			
		||||
  }
 | 
			
		||||
  .el-tabs__nav-wrap::after {
 | 
			
		||||
    width: 0;
 | 
			
		||||
  }
 | 
			
		||||
  .el-tabs__item {
 | 
			
		||||
    padding: 0 10px;
 | 
			
		||||
  }
 | 
			
		||||
  .el-tabs__item:hover {
 | 
			
		||||
    color: rgba(0, 0, 0, 0.85);
 | 
			
		||||
  }
 | 
			
		||||
  .el-tabs__item.is-active {
 | 
			
		||||
    color: rgba(0, 0, 0, 0.85);
 | 
			
		||||
  }
 | 
			
		||||
  .el-tabs__item {
 | 
			
		||||
    color: rgba(0, 0, 0, 0.45);
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
</style>
 | 
			
		||||
							
								
								
									
										130
									
								
								src/views/delivery/deliveryLogDet/index.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										130
									
								
								src/views/delivery/deliveryLogDet/index.vue
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,130 @@
 | 
			
		||||
<template>
 | 
			
		||||
  <div class="app-container">
 | 
			
		||||
    <!-- 搜索工作栏 -->
 | 
			
		||||
    <search-bar
 | 
			
		||||
      :formConfigs="formConfig"
 | 
			
		||||
      ref="searchBarForm"
 | 
			
		||||
      @headBtnClick="buttonClick"
 | 
			
		||||
    />
 | 
			
		||||
    <!-- 列表 -->
 | 
			
		||||
    <base-table
 | 
			
		||||
      :page="queryParams.pageNo"
 | 
			
		||||
      :limit="queryParams.pageSize"
 | 
			
		||||
      :table-props="tableProps"
 | 
			
		||||
      :table-data="list"
 | 
			
		||||
      :max-height="tableH"
 | 
			
		||||
    >
 | 
			
		||||
      <method-btn
 | 
			
		||||
        v-if="tableBtn.length"
 | 
			
		||||
        slot="handleBtn"
 | 
			
		||||
        :width="80"
 | 
			
		||||
        label="操作"
 | 
			
		||||
        :method-list="tableBtn"
 | 
			
		||||
        @clickBtn="handleClick"
 | 
			
		||||
      />
 | 
			
		||||
    </base-table>
 | 
			
		||||
    <pagination
 | 
			
		||||
      :page.sync="queryParams.pageNo"
 | 
			
		||||
      :limit.sync="queryParams.pageSize"
 | 
			
		||||
      :total="total"
 | 
			
		||||
      @pagination="getList"
 | 
			
		||||
    />
 | 
			
		||||
    <!-- 详情抽屉 -->
 | 
			
		||||
    <delivery-log-det-detail ref='deliveryLogDetail'/>
 | 
			
		||||
  </div>
 | 
			
		||||
</template>
 | 
			
		||||
<script>
 | 
			
		||||
import { deliveryProgressPage } from '@/api/base/delivery'
 | 
			
		||||
import DeliveryLogDetDetail from './components/deliveryLogDetDetail.vue'
 | 
			
		||||
const tableProps = [
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'orderName',
 | 
			
		||||
    label: '订单名',
 | 
			
		||||
    showOverflowtooltip: true
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'customerName',
 | 
			
		||||
    label: '客户名称',
 | 
			
		||||
    showOverflowtooltip: true
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'unit',
 | 
			
		||||
    label: '单位'
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'orderNum',
 | 
			
		||||
    label: '订单数量'
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'num',
 | 
			
		||||
    label: '发货数量'
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'rate',
 | 
			
		||||
    label: '累积发货比例(%)'
 | 
			
		||||
  }
 | 
			
		||||
]
 | 
			
		||||
export default {
 | 
			
		||||
  name: "DeliveryLogDet",
 | 
			
		||||
  data() {
 | 
			
		||||
    return {
 | 
			
		||||
      formConfig: [
 | 
			
		||||
        {
 | 
			
		||||
          type: 'input',
 | 
			
		||||
          label: '订单名',
 | 
			
		||||
          param: 'orderName'
 | 
			
		||||
        },
 | 
			
		||||
        {
 | 
			
		||||
          type: 'button',
 | 
			
		||||
          btnName: '查询',
 | 
			
		||||
          name: 'search',
 | 
			
		||||
          color: 'primary'
 | 
			
		||||
        }
 | 
			
		||||
      ],
 | 
			
		||||
      // 查询参数
 | 
			
		||||
      queryParams: {
 | 
			
		||||
        pageNo: 1,
 | 
			
		||||
        pageSize: 20,
 | 
			
		||||
        orderName: ''
 | 
			
		||||
      },
 | 
			
		||||
      tableProps,
 | 
			
		||||
      list: [],
 | 
			
		||||
      tableH: this.tableHeight(260),
 | 
			
		||||
      total: 0,
 | 
			
		||||
      tableBtn: [
 | 
			
		||||
      this.$auth.hasPermi('extend:delivery-log-det:detail')
 | 
			
		||||
          ? {
 | 
			
		||||
              type: 'detail',
 | 
			
		||||
              btnName: '详情'
 | 
			
		||||
            }
 | 
			
		||||
          : undefined
 | 
			
		||||
      ].filter((v) => v)
 | 
			
		||||
    }
 | 
			
		||||
  },
 | 
			
		||||
  components: { DeliveryLogDetDetail },
 | 
			
		||||
  created() {
 | 
			
		||||
    window.addEventListener('resize', () => {
 | 
			
		||||
      this.tableH = this.tableHeight(260)
 | 
			
		||||
    })
 | 
			
		||||
    this.getList();
 | 
			
		||||
  },
 | 
			
		||||
  methods: {
 | 
			
		||||
    getList() {
 | 
			
		||||
      deliveryProgressPage({...this.queryParams}).then(res => {
 | 
			
		||||
        this.list = res.data.list || []
 | 
			
		||||
        this.total = res.data.total || 0
 | 
			
		||||
      })
 | 
			
		||||
    },
 | 
			
		||||
    buttonClick(val) {
 | 
			
		||||
      this.queryParams.orderName = val.orderName
 | 
			
		||||
      this.getList()
 | 
			
		||||
    },
 | 
			
		||||
    handleClick(val) {
 | 
			
		||||
      console.log(val)
 | 
			
		||||
      this.$nextTick(() => {
 | 
			
		||||
        this.$refs.deliveryLogDetail.init(val.data)
 | 
			
		||||
      })
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
</script>
 | 
			
		||||
@@ -1,6 +1,6 @@
 | 
			
		||||
<template>
 | 
			
		||||
  <div>
 | 
			
		||||
    <el-drawer title="参数绑定" :visible.sync="visible" size="70%" @close='closeD'>
 | 
			
		||||
    <el-drawer :title="drawerTitle" :visible.sync="visible" size="70%" @close='closeD'>
 | 
			
		||||
      <div class="box">
 | 
			
		||||
        <el-form :inline="true">
 | 
			
		||||
          <el-form-item label="关联表名">
 | 
			
		||||
@@ -94,6 +94,7 @@ export default {
 | 
			
		||||
  data() {
 | 
			
		||||
    return {
 | 
			
		||||
      visible: false,
 | 
			
		||||
      drawerTitle: '',
 | 
			
		||||
      tableProps,
 | 
			
		||||
      tableData: [],
 | 
			
		||||
      tableBtn: [],
 | 
			
		||||
@@ -131,9 +132,11 @@ export default {
 | 
			
		||||
      this.objName = data.objName
 | 
			
		||||
      this.getList()
 | 
			
		||||
      if (title === 'detail') {
 | 
			
		||||
        this.drawerTitle = '查看参数'
 | 
			
		||||
        this.showBtn = false
 | 
			
		||||
        this.tableBtn = []
 | 
			
		||||
      } else {
 | 
			
		||||
        this.drawerTitle = '参数绑定'
 | 
			
		||||
        this.showBtn = true
 | 
			
		||||
        this.tableBtn = [
 | 
			
		||||
          {
 | 
			
		||||
 
 | 
			
		||||
@@ -92,7 +92,7 @@ export default {
 | 
			
		||||
          color: 'primary'
 | 
			
		||||
        },
 | 
			
		||||
        {
 | 
			
		||||
          type: 'separate'
 | 
			
		||||
          type: this.$auth.hasPermi('base:energy-type:create') ? 'separate' : '',
 | 
			
		||||
        },
 | 
			
		||||
        {
 | 
			
		||||
          type: this.$auth.hasPermi('base:energy-type:create') ? 'button' : '',
 | 
			
		||||
 
 | 
			
		||||
@@ -62,8 +62,9 @@
 | 
			
		||||
        </el-form-item>
 | 
			
		||||
      </el-col>
 | 
			
		||||
      <el-col :span="12">
 | 
			
		||||
        <el-form-item label="消耗量阈值" prop="limitValue">
 | 
			
		||||
          <el-input-number v-model="form.limitValue" :min="0" :max="10000000000000000" style="width: 100%;"></el-input-number>
 | 
			
		||||
        <el-form-item label="消耗量阈值">
 | 
			
		||||
          <el-input-number v-model="form.minValue" placeholder="最小值" :max="10000000000000000" style="width: 50%;"></el-input-number>
 | 
			
		||||
          <el-input-number v-model="form.maxValue" placeholder="最大值" :max="10000000000000000" style="width: 50%;"></el-input-number>
 | 
			
		||||
        </el-form-item>
 | 
			
		||||
      </el-col>
 | 
			
		||||
    </el-row>
 | 
			
		||||
@@ -96,14 +97,16 @@ export default {
 | 
			
		||||
        type: '',
 | 
			
		||||
        plcParamId: '',
 | 
			
		||||
        limitType: '',
 | 
			
		||||
        limitValue: ''
 | 
			
		||||
        minValue: null,
 | 
			
		||||
        maxValue: null
 | 
			
		||||
      },
 | 
			
		||||
      objIds: [],// 回显数组
 | 
			
		||||
      isEdit: false, //是否是编辑
 | 
			
		||||
      rules: {
 | 
			
		||||
        objectId: [{ required: true, message: '对象不能为空', trigger: 'change' }],
 | 
			
		||||
        energyTypeId: [{ required: true, message: '能源类型不能为空', trigger: 'change' }],
 | 
			
		||||
        type: [{ required: true, message: '监控模式不能为空', trigger: 'change' }]
 | 
			
		||||
        type: [{ required: true, message: '监控模式不能为空', trigger: 'change' }],
 | 
			
		||||
        limitType: [{ required: true, message: '指标类型不能为空', trigger: 'change' }]
 | 
			
		||||
      },
 | 
			
		||||
      detailList: []
 | 
			
		||||
    }
 | 
			
		||||
@@ -199,6 +202,12 @@ export default {
 | 
			
		||||
            this.$modal.msgError("监控模式为详细时,详细参数为必填");
 | 
			
		||||
            return false
 | 
			
		||||
          }
 | 
			
		||||
          if (this.form.minValue && this.form.maxValue) {
 | 
			
		||||
            if (this.form.minValue > this.form.maxValue) {
 | 
			
		||||
              this.$modal.msgError("消耗量阈值,最小值不能大于最大值");
 | 
			
		||||
              return false
 | 
			
		||||
            }
 | 
			
		||||
          }
 | 
			
		||||
          // this.form.limitType = Number(this.form.limitType)
 | 
			
		||||
          if (this.isEdit) {
 | 
			
		||||
            // 编辑
 | 
			
		||||
@@ -223,6 +232,10 @@ export default {
 | 
			
		||||
    },
 | 
			
		||||
    formClear() {
 | 
			
		||||
      this.$refs.form.resetFields()
 | 
			
		||||
      this.form.type = ''
 | 
			
		||||
      this.form.plcParamId = ''
 | 
			
		||||
      this.form.minValue = null
 | 
			
		||||
      this.form.maxValue = null
 | 
			
		||||
      this.objIds = ''
 | 
			
		||||
      this.detailList = []
 | 
			
		||||
      this.isEdit = false
 | 
			
		||||
 
 | 
			
		||||
@@ -37,6 +37,7 @@
 | 
			
		||||
      @cancel="handleCancel"
 | 
			
		||||
      @confirm="handleConfirm"
 | 
			
		||||
      :before-close="handleCancel"
 | 
			
		||||
      width='60%'
 | 
			
		||||
    >
 | 
			
		||||
      <energy-limit-add ref="energyLimit" @successSubmit="successSubmit" :energyTypeList="energyTypeList" :objList="objList"/>
 | 
			
		||||
    </base-dialog>
 | 
			
		||||
@@ -199,6 +200,15 @@ export default {
 | 
			
		||||
              item.type = i.label
 | 
			
		||||
            }
 | 
			
		||||
          })
 | 
			
		||||
          if (item.minValue && item.maxValue) {
 | 
			
		||||
            item.limitValue = item.minValue + '-' + item.maxValue
 | 
			
		||||
          } else if(item.minValue){
 | 
			
		||||
            item.limitValue = '最小值' + item.minValue
 | 
			
		||||
          }else if(item.maxValue){
 | 
			
		||||
            item.limitValue = '最大值' + item.maxValue
 | 
			
		||||
          } else {
 | 
			
		||||
            item.limitValue = ''
 | 
			
		||||
          }
 | 
			
		||||
        })
 | 
			
		||||
        this.list = arr
 | 
			
		||||
        this.total = response.data.total;
 | 
			
		||||
 
 | 
			
		||||
@@ -136,6 +136,15 @@ export default {
 | 
			
		||||
              item.type = i.name
 | 
			
		||||
            }
 | 
			
		||||
          })
 | 
			
		||||
          if (item.minValue && item.maxValue) {
 | 
			
		||||
            item.limitValue = item.minValue + '-' + item.maxValue
 | 
			
		||||
          } else if(item.minValue){
 | 
			
		||||
            item.limitValue = '最小值' + item.minValue
 | 
			
		||||
          }else if(item.maxValue){
 | 
			
		||||
            item.limitValue = '最大值' + item.maxValue
 | 
			
		||||
          } else {
 | 
			
		||||
            item.limitValue = ''
 | 
			
		||||
          }
 | 
			
		||||
        })
 | 
			
		||||
        this.list = arr
 | 
			
		||||
        this.total = response.data.total;
 | 
			
		||||
 
 | 
			
		||||
@@ -121,8 +121,9 @@ export default {
 | 
			
		||||
      this.tableH = this.tableHeight(260)
 | 
			
		||||
      this.isFold = this.searchBarWidth('energyReportSearchBox', 1180)
 | 
			
		||||
    })
 | 
			
		||||
    if (this.$route.params.startTime && this.$route.params.endTime) {
 | 
			
		||||
      this.formConfig[2].defaultSelect = [this.$route.params.startTime, this.$route.params.endTime]
 | 
			
		||||
    if (location.href.indexOf('?') > 0) {
 | 
			
		||||
      let arr = location.href.split('?')[1].split('&')
 | 
			
		||||
      this.formConfig[2].defaultSelect = [arr[0].split('=')[1], arr[1].split('=')[1]]
 | 
			
		||||
    } else {
 | 
			
		||||
      this.formConfig[2].defaultSelect = [Date.now() - 7*24*3600000, Date.now()]
 | 
			
		||||
    }
 | 
			
		||||
@@ -138,8 +139,9 @@ export default {
 | 
			
		||||
  methods: {
 | 
			
		||||
    initData(to) {
 | 
			
		||||
      if (to.name === 'EnergyReportSearch') {
 | 
			
		||||
        if (this.$route.params.startTime && this.$route.params.endTime) {
 | 
			
		||||
          this.formConfig[2].defaultSelect = [this.$route.params.startTime, this.$route.params.endTime]
 | 
			
		||||
        if (location.href.indexOf('?') > 0) {
 | 
			
		||||
          let arr = location.href.split('?')[1].split('&')
 | 
			
		||||
          this.formConfig[2].defaultSelect = [arr[0].split('=')[1], arr[1].split('=')[1]]
 | 
			
		||||
        } else {
 | 
			
		||||
          this.formConfig[2].defaultSelect = [Date.now() - 7*24*3600000, Date.now()]
 | 
			
		||||
        }
 | 
			
		||||
 
 | 
			
		||||
@@ -1,6 +1,6 @@
 | 
			
		||||
<template>
 | 
			
		||||
  <div>
 | 
			
		||||
    <el-drawer title="参数绑定" :visible.sync="visible" size="70%" @close='closeD'>
 | 
			
		||||
    <el-drawer :title="drawerTitle" :visible.sync="visible" size="70%" @close='closeD'>
 | 
			
		||||
      <div class="box">
 | 
			
		||||
        <el-form :inline="true">
 | 
			
		||||
          <el-form-item label="方案名称">
 | 
			
		||||
@@ -85,6 +85,7 @@ export default {
 | 
			
		||||
  data() {
 | 
			
		||||
    return {
 | 
			
		||||
      visible: false,
 | 
			
		||||
      drawerTitle: '',
 | 
			
		||||
      tableProps,
 | 
			
		||||
      tableData: [],
 | 
			
		||||
      tableBtn: [],
 | 
			
		||||
@@ -125,9 +126,11 @@ export default {
 | 
			
		||||
      this.energyTypeId = data.energyTypeId
 | 
			
		||||
      this.getList()
 | 
			
		||||
      if (title === 'detail') {
 | 
			
		||||
        this.drawerTitle = '查看参数'
 | 
			
		||||
        this.showBtn = false
 | 
			
		||||
        this.tableBtn = []
 | 
			
		||||
      } else {
 | 
			
		||||
        this.drawerTitle = '参数绑定'
 | 
			
		||||
        this.showBtn = true
 | 
			
		||||
        this.tableBtn = [
 | 
			
		||||
          {
 | 
			
		||||
 
 | 
			
		||||
@@ -115,7 +115,7 @@ export default {
 | 
			
		||||
          type: 'select',
 | 
			
		||||
          label: '能源类型',
 | 
			
		||||
          selectOptions: [],
 | 
			
		||||
          param: 'objType',
 | 
			
		||||
          param: 'energyTypeId',
 | 
			
		||||
          filterable: true,
 | 
			
		||||
          width: 120,
 | 
			
		||||
          clearable: false
 | 
			
		||||
@@ -126,7 +126,7 @@ export default {
 | 
			
		||||
          selectOptions: this.getDictDatas(this.DICT_TYPE.OBJECT_TYPE),
 | 
			
		||||
          labelField: 'label',
 | 
			
		||||
          valueField: 'value',
 | 
			
		||||
          param: 'energyTypeId',
 | 
			
		||||
          param: 'objType',
 | 
			
		||||
          width: 100,
 | 
			
		||||
          clearable: false
 | 
			
		||||
        },
 | 
			
		||||
 
 | 
			
		||||
@@ -6,24 +6,517 @@
 | 
			
		||||
-->
 | 
			
		||||
 | 
			
		||||
<template>
 | 
			
		||||
    <div class="equipment-collection-config">
 | 
			
		||||
        collection config
 | 
			
		||||
    </div>
 | 
			
		||||
	<div class="app-container">
 | 
			
		||||
		<!-- 搜索工作栏 -->
 | 
			
		||||
		<SearchBar
 | 
			
		||||
			:formConfigs="searchBarFormConfig"
 | 
			
		||||
			ref="search-bar"
 | 
			
		||||
			@headBtnClick="handleSearchBarBtnClick" />
 | 
			
		||||
 | 
			
		||||
		<!-- 列表 -->
 | 
			
		||||
		<base-table
 | 
			
		||||
			:table-props="tableProps"
 | 
			
		||||
			:page="queryParams.pageNo"
 | 
			
		||||
			:limit="queryParams.pageSize"
 | 
			
		||||
			:table-data="list"
 | 
			
		||||
			@emitFun="handleEmitFun">
 | 
			
		||||
			<method-btn
 | 
			
		||||
				v-if="tableBtn.length"
 | 
			
		||||
				slot="handleBtn"
 | 
			
		||||
				label="操作"
 | 
			
		||||
				:width="120"
 | 
			
		||||
				:method-list="tableBtn"
 | 
			
		||||
				@clickBtn="handleTableBtnClick" />
 | 
			
		||||
		</base-table>
 | 
			
		||||
 | 
			
		||||
		<!-- 分页组件 -->
 | 
			
		||||
		<pagination
 | 
			
		||||
			v-show="total > 0"
 | 
			
		||||
			:total="total"
 | 
			
		||||
			:page.sync="queryParams.pageNo"
 | 
			
		||||
			:limit.sync="queryParams.pageSize"
 | 
			
		||||
			@pagination="getList" />
 | 
			
		||||
 | 
			
		||||
		<!-- 对话框(添加 / 修改) -->
 | 
			
		||||
		<base-dialog
 | 
			
		||||
			:dialogTitle="title"
 | 
			
		||||
			:dialogVisible="open"
 | 
			
		||||
			width="700px"
 | 
			
		||||
			@close="cancel"
 | 
			
		||||
			@cancel="cancel"
 | 
			
		||||
			@confirm="submitForm">
 | 
			
		||||
			<DialogForm v-if="open" ref="form" v-model="form" :rows="rows" />
 | 
			
		||||
		</base-dialog>
 | 
			
		||||
 | 
			
		||||
		<!-- 抽屉 详情 -->
 | 
			
		||||
		<BasicDrawer
 | 
			
		||||
			v-if="editVisible"
 | 
			
		||||
			ref="drawer"
 | 
			
		||||
			:default-mode="editMode"
 | 
			
		||||
			:info-data="alarmForm"
 | 
			
		||||
			:sections="[
 | 
			
		||||
				{
 | 
			
		||||
					name: '基本信息',
 | 
			
		||||
					key: 'base',
 | 
			
		||||
					rows: drawerBaseInfoRows,
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					name: '属性列表',
 | 
			
		||||
					key: 'attrs',
 | 
			
		||||
					props: drawerListProps,
 | 
			
		||||
					url: '/base/equipment-plc-param/page',
 | 
			
		||||
					urlCreate: '/base/equipment-plc-param/create',
 | 
			
		||||
					urlUpdate: '/base/equipment-plc-param/update',
 | 
			
		||||
					urlDelete: '/base/equipment-plc-param/delete',
 | 
			
		||||
					urlDetail: '/base/equipment-plc-param/get',
 | 
			
		||||
					queryParams: {
 | 
			
		||||
						connectId: alarmForm.id,
 | 
			
		||||
						pageNo: 1,
 | 
			
		||||
						pageSize: 10,
 | 
			
		||||
					},
 | 
			
		||||
					tableBtn: [
 | 
			
		||||
						this.$auth.hasPermi('equipment:collection-config-param:update')
 | 
			
		||||
							? {
 | 
			
		||||
									type: 'edit',
 | 
			
		||||
									btnName: '修改',
 | 
			
		||||
							  }
 | 
			
		||||
							: undefined,
 | 
			
		||||
						this.$auth.hasPermi('equipment:collection-config-param:delete')
 | 
			
		||||
							? {
 | 
			
		||||
									type: 'delete',
 | 
			
		||||
									btnName: '删除',
 | 
			
		||||
							  }
 | 
			
		||||
							: undefined,
 | 
			
		||||
					].filter((v) => v),
 | 
			
		||||
					allowAdd: true,
 | 
			
		||||
				},
 | 
			
		||||
			]"
 | 
			
		||||
			@refreshDataList="getList"
 | 
			
		||||
			@cancel="editVisible = false"
 | 
			
		||||
			@destroy="editVisible = false" />
 | 
			
		||||
	</div>
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script>
 | 
			
		||||
import {
 | 
			
		||||
	createEquipmentPlcConnect,
 | 
			
		||||
	updateEquipmentPlcConnect,
 | 
			
		||||
	deleteEquipmentPlcConnect,
 | 
			
		||||
	getEquipmentPlcConnect,
 | 
			
		||||
	getEquipmentPlcConnectPage,
 | 
			
		||||
	exportEquipmentPlcConnectExcel,
 | 
			
		||||
} from '@/api/base/equipmentPlcConnect';
 | 
			
		||||
import moment from 'moment';
 | 
			
		||||
import basicPageMixin from '@/mixins/lb/basicPageMixin';
 | 
			
		||||
// import './http';
 | 
			
		||||
import BasicDrawer from './components/BasicDrawer.vue';
 | 
			
		||||
import { publicFormatter } from '@/utils/dict';
 | 
			
		||||
 | 
			
		||||
export default {
 | 
			
		||||
    name: "EquipmentCollectionConfig",
 | 
			
		||||
    components: {},
 | 
			
		||||
    props: {},
 | 
			
		||||
    data() {
 | 
			
		||||
        return {}
 | 
			
		||||
    },
 | 
			
		||||
    computed: {},
 | 
			
		||||
    methods: {},
 | 
			
		||||
}
 | 
			
		||||
	name: 'EquipmentPlcConnect',
 | 
			
		||||
	mixins: [basicPageMixin],
 | 
			
		||||
	components: { BasicDrawer },
 | 
			
		||||
	data() {
 | 
			
		||||
		return {
 | 
			
		||||
			searchBarKeys: ['equipmentId', 'plcId'],
 | 
			
		||||
			// tableBtn: [
 | 
			
		||||
			// ].filter((v) => v),
 | 
			
		||||
			tableBtn: [
 | 
			
		||||
				{
 | 
			
		||||
					type: 'detail',
 | 
			
		||||
					btnName: '参数绑定',
 | 
			
		||||
				},
 | 
			
		||||
				this.$auth.hasPermi('equipment:collection-config:update')
 | 
			
		||||
					? {
 | 
			
		||||
							type: 'edit',
 | 
			
		||||
							btnName: '修改',
 | 
			
		||||
					  }
 | 
			
		||||
					: undefined,
 | 
			
		||||
				this.$auth.hasPermi('equipment:collection-config:delete')
 | 
			
		||||
					? {
 | 
			
		||||
							type: 'delete',
 | 
			
		||||
							btnName: '删除',
 | 
			
		||||
					  }
 | 
			
		||||
					: undefined,
 | 
			
		||||
			].filter((v) => v),
 | 
			
		||||
			tableProps: [
 | 
			
		||||
				{ prop: 'productionLine', label: '产线' },
 | 
			
		||||
				{ prop: 'workshopSection', label: '工段' },
 | 
			
		||||
				{ prop: 'equipmentName', label: '设备名' },
 | 
			
		||||
				{ prop: 'equipmentCode', label: '设备编码' },
 | 
			
		||||
				{ prop: 'plcCode', label: '关联表编码' },
 | 
			
		||||
				{ prop: 'plcTableName', label: '关联表名' },
 | 
			
		||||
				{ prop: 'plcName', label: '标识名称' },
 | 
			
		||||
				{ prop: 'bindingParameters', label: '绑定参数数量' },
 | 
			
		||||
				// {
 | 
			
		||||
				// 	_action: 'params-bind',
 | 
			
		||||
				// 	label: '查看绑定',
 | 
			
		||||
				// 	subcomponent: {
 | 
			
		||||
				// 		props: ['injectData'],
 | 
			
		||||
				// 		render: function (h) {
 | 
			
		||||
				// 			const _this = this;
 | 
			
		||||
				// 			return h(
 | 
			
		||||
				// 				'el-button',
 | 
			
		||||
				// 				{
 | 
			
		||||
				// 					props: { type: 'text' },
 | 
			
		||||
				// 					on: {
 | 
			
		||||
				// 						click: function () {
 | 
			
		||||
				// 							console.log('inejctdata', _this.injectData);
 | 
			
		||||
				// 							_this.$emit('emitData', {
 | 
			
		||||
				// 								action: _this.injectData._action,
 | 
			
		||||
				// 								payload: _this.injectData,
 | 
			
		||||
				// 							});
 | 
			
		||||
				// 						},
 | 
			
		||||
				// 					},
 | 
			
		||||
				// 				},
 | 
			
		||||
				// 				'查看绑定'
 | 
			
		||||
				// 			);
 | 
			
		||||
				// 		},
 | 
			
		||||
				// 	},
 | 
			
		||||
				// },
 | 
			
		||||
			],
 | 
			
		||||
			searchBarFormConfig: [
 | 
			
		||||
				{
 | 
			
		||||
					type: 'select',
 | 
			
		||||
					label: '设备名',
 | 
			
		||||
					placeholder: '请选择设备',
 | 
			
		||||
					param: 'equipmentId',
 | 
			
		||||
					selectOptions: [],
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					type: 'select',
 | 
			
		||||
					label: '编码',
 | 
			
		||||
					placeholder: '请选择编码',
 | 
			
		||||
					param: 'plcId',
 | 
			
		||||
					selectOptions: [],
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					type: 'button',
 | 
			
		||||
					btnName: '查询',
 | 
			
		||||
					name: 'search',
 | 
			
		||||
					color: 'primary',
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					type: 'separate',
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					type: this.$auth.hasPermi('equipment:collection-config:create')
 | 
			
		||||
						? 'button'
 | 
			
		||||
						: '',
 | 
			
		||||
					// type: 'button',
 | 
			
		||||
					btnName: '新增',
 | 
			
		||||
					name: 'add',
 | 
			
		||||
					plain: true,
 | 
			
		||||
					color: 'success',
 | 
			
		||||
				},
 | 
			
		||||
				// {
 | 
			
		||||
				// 	type: this.$auth.hasPermi('equipment:collection-config:export') ? 'button' : '',
 | 
			
		||||
				// 	btnName: '导出',
 | 
			
		||||
				// 	name: 'export',
 | 
			
		||||
				// 	color: 'warning',
 | 
			
		||||
				// },
 | 
			
		||||
			],
 | 
			
		||||
			rows: [
 | 
			
		||||
				[
 | 
			
		||||
					{
 | 
			
		||||
						select: true,
 | 
			
		||||
						label: '关联表名',
 | 
			
		||||
						prop: 'plcId',
 | 
			
		||||
						labelKey: `plcTableName`,
 | 
			
		||||
						url: '/base/equipment-plc/listAll',
 | 
			
		||||
						rules: [{ required: true, message: '不能为空', trigger: 'blur' }],
 | 
			
		||||
						bind: {
 | 
			
		||||
							filterable: true,
 | 
			
		||||
						},
 | 
			
		||||
					},
 | 
			
		||||
				],
 | 
			
		||||
				[
 | 
			
		||||
					{
 | 
			
		||||
						select: true,
 | 
			
		||||
						label: '设备',
 | 
			
		||||
						prop: 'equipmentId',
 | 
			
		||||
						url: '/base/core-equipment/page?pageNo=1&pageSize=99',
 | 
			
		||||
						rules: [{ required: true, message: '不能为空', trigger: 'blur' }],
 | 
			
		||||
						bind: {
 | 
			
		||||
							filterable: true,
 | 
			
		||||
						},
 | 
			
		||||
					},
 | 
			
		||||
				],
 | 
			
		||||
			],
 | 
			
		||||
			open: false,
 | 
			
		||||
			// 查询参数
 | 
			
		||||
			queryParams: {
 | 
			
		||||
				pageNo: 1,
 | 
			
		||||
				pageSize: 10,
 | 
			
		||||
				plcId: null,
 | 
			
		||||
				equipmentId: null,
 | 
			
		||||
			},
 | 
			
		||||
			// 表单参数
 | 
			
		||||
			form: {},
 | 
			
		||||
			// 查看绑定配置
 | 
			
		||||
			editVisible: false,
 | 
			
		||||
			editMode: '',
 | 
			
		||||
			drawerBaseInfoRows: [
 | 
			
		||||
				[
 | 
			
		||||
					{
 | 
			
		||||
						input: true,
 | 
			
		||||
						label: '设备名',
 | 
			
		||||
						prop: 'equipmentName',
 | 
			
		||||
						rules: [{ required: true, message: '不能为空', trigger: 'blur' }],
 | 
			
		||||
						// bind: {
 | 
			
		||||
						// 	disabled: this.editMode == 'detail', // some condition, like detail mode...
 | 
			
		||||
						// }
 | 
			
		||||
					},
 | 
			
		||||
					{
 | 
			
		||||
						input: true,
 | 
			
		||||
						label: '关联表名',
 | 
			
		||||
						prop: 'plcTableName',
 | 
			
		||||
						// url: '/base/core-equipment/getCode',
 | 
			
		||||
					},
 | 
			
		||||
				],
 | 
			
		||||
			],
 | 
			
		||||
			drawerListProps: [
 | 
			
		||||
				{ prop: 'plcParamName', label: '参数列名' },
 | 
			
		||||
				{ prop: 'name', label: '参数名称' },
 | 
			
		||||
				{
 | 
			
		||||
					prop: 'unit',
 | 
			
		||||
					label: '单位',
 | 
			
		||||
					filter: publicFormatter('unit_dict'),
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					prop: 'equipment_param_type',
 | 
			
		||||
					label: '设备参数类型',
 | 
			
		||||
					filter: (val) =>
 | 
			
		||||
						val != null
 | 
			
		||||
							? ['', '一般参数', '工艺参数', '报警参数', ''][val]
 | 
			
		||||
							: '-',
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					prop: 'production_param_type',
 | 
			
		||||
					label: '生产参数类型',
 | 
			
		||||
					filter: (val) =>
 | 
			
		||||
						val != null
 | 
			
		||||
							? ['', '进片数量', '出片数量', '破损数量', '无类型', ''][val]
 | 
			
		||||
							: '-',
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					prop: 'collection',
 | 
			
		||||
					label: '是否采集',
 | 
			
		||||
					filter: (val) => (val != null ? ['否', '是'][val] : '-'),
 | 
			
		||||
				},
 | 
			
		||||
				{ prop: 'minValue', label: '最小值' },
 | 
			
		||||
				{ prop: 'maxValue', label: '最大值' },
 | 
			
		||||
				{ prop: 'defaultValue', label: '标准值' },
 | 
			
		||||
				{ prop: 'description', label: '描述' },
 | 
			
		||||
				{ prop: 'remark', label: '备注' },
 | 
			
		||||
			],
 | 
			
		||||
			alarmForm: {
 | 
			
		||||
				id: undefined,
 | 
			
		||||
				equipmentName: undefined,
 | 
			
		||||
				plcTableName: undefined,
 | 
			
		||||
			},
 | 
			
		||||
		};
 | 
			
		||||
	},
 | 
			
		||||
	created() {
 | 
			
		||||
		this.getList();
 | 
			
		||||
		this.initSearchOptions();
 | 
			
		||||
	},
 | 
			
		||||
	methods: {
 | 
			
		||||
		async getEquipmentOptions() {
 | 
			
		||||
			const res = await this.$axios({
 | 
			
		||||
				url: '/base/core-equipment/listAll',
 | 
			
		||||
				method: 'get',
 | 
			
		||||
			});
 | 
			
		||||
			return res.data;
 | 
			
		||||
		},
 | 
			
		||||
 | 
			
		||||
		async getPlcOptions() {
 | 
			
		||||
			const res = await this.$axios({
 | 
			
		||||
				url: '/base/equipment-plc/listAll',
 | 
			
		||||
				method: 'get',
 | 
			
		||||
			});
 | 
			
		||||
			return res.data;
 | 
			
		||||
		},
 | 
			
		||||
 | 
			
		||||
		/** 初始化查询条件 */
 | 
			
		||||
		async initSearchOptions() {
 | 
			
		||||
			Promise.all([this.getEquipmentOptions(), this.getPlcOptions()]).then(
 | 
			
		||||
				([eqList, plcList]) => {
 | 
			
		||||
					this.searchBarFormConfig[0].selectOptions = eqList.map((item) => {
 | 
			
		||||
						return {
 | 
			
		||||
							name: item.name,
 | 
			
		||||
							id: item.id,
 | 
			
		||||
						};
 | 
			
		||||
					});
 | 
			
		||||
					this.searchBarFormConfig[1].selectOptions = plcList.map((item) => {
 | 
			
		||||
						return {
 | 
			
		||||
							name: item.name,
 | 
			
		||||
							id: item.id,
 | 
			
		||||
						};
 | 
			
		||||
					});
 | 
			
		||||
				}
 | 
			
		||||
			);
 | 
			
		||||
		},
 | 
			
		||||
		/** 覆盖 handleEmitFun 的默认实现 */
 | 
			
		||||
		handleEmitFun({ action, payload }) {
 | 
			
		||||
			switch (action) {
 | 
			
		||||
				case 'params-bind':
 | 
			
		||||
					this.reset();
 | 
			
		||||
					const {
 | 
			
		||||
						id,
 | 
			
		||||
						equipmentName,
 | 
			
		||||
						equipmentId,
 | 
			
		||||
						plcId,
 | 
			
		||||
						plcName,
 | 
			
		||||
						plcTableName,
 | 
			
		||||
					} = payload;
 | 
			
		||||
					// console.log('Cha看绑定参数弹窗', id, equipmentName, plcTableName);
 | 
			
		||||
					this.$router.push({
 | 
			
		||||
						name: 'EquipmentPlcParam',
 | 
			
		||||
						params: {
 | 
			
		||||
							id,
 | 
			
		||||
							equipmentName,
 | 
			
		||||
							plcTableName,
 | 
			
		||||
						},
 | 
			
		||||
					});
 | 
			
		||||
					break;
 | 
			
		||||
			}
 | 
			
		||||
		},
 | 
			
		||||
 | 
			
		||||
		/** 查询列表 */
 | 
			
		||||
		getList() {
 | 
			
		||||
			this.loading = true;
 | 
			
		||||
			// 执行查询
 | 
			
		||||
			getEquipmentPlcConnectPage(this.queryParams).then((response) => {
 | 
			
		||||
				this.list = response.data.list;
 | 
			
		||||
				this.total = response.data.total;
 | 
			
		||||
				this.loading = false;
 | 
			
		||||
			});
 | 
			
		||||
		},
 | 
			
		||||
		/** 取消按钮 */
 | 
			
		||||
		cancel() {
 | 
			
		||||
			this.open = false;
 | 
			
		||||
			this.reset();
 | 
			
		||||
		},
 | 
			
		||||
		/** 表单重置 */
 | 
			
		||||
		reset() {
 | 
			
		||||
			this.form = {
 | 
			
		||||
				id: undefined,
 | 
			
		||||
				plcId: undefined,
 | 
			
		||||
				equipmentId: undefined,
 | 
			
		||||
			};
 | 
			
		||||
			this.resetForm('form');
 | 
			
		||||
		},
 | 
			
		||||
		/** 搜索按钮操作 */
 | 
			
		||||
		handleQuery() {
 | 
			
		||||
			this.queryParams.pageNo = 1;
 | 
			
		||||
			this.getList();
 | 
			
		||||
		},
 | 
			
		||||
		/** 重置按钮操作 */
 | 
			
		||||
		resetQuery() {
 | 
			
		||||
			this.resetForm('queryForm');
 | 
			
		||||
			this.handleQuery();
 | 
			
		||||
		},
 | 
			
		||||
		/** 新增按钮操作 */
 | 
			
		||||
		handleAdd() {
 | 
			
		||||
			this.reset();
 | 
			
		||||
			this.open = true;
 | 
			
		||||
			this.title = '添加设备与实时采集关系表(一对多)';
 | 
			
		||||
		},
 | 
			
		||||
		/** 修改按钮操作 */
 | 
			
		||||
		handleUpdate(row) {
 | 
			
		||||
			this.reset();
 | 
			
		||||
			const id = row.id;
 | 
			
		||||
			getEquipmentPlcConnect(id).then((response) => {
 | 
			
		||||
				this.form = response.data;
 | 
			
		||||
				this.open = true;
 | 
			
		||||
				this.title = '修改设备与实时采集关系表(一对多)';
 | 
			
		||||
			});
 | 
			
		||||
		},
 | 
			
		||||
		/** 提交按钮 */
 | 
			
		||||
		submitForm() {
 | 
			
		||||
			this.$refs['form'].validate((valid) => {
 | 
			
		||||
				if (!valid) {
 | 
			
		||||
					return;
 | 
			
		||||
				}
 | 
			
		||||
				// 修改的提交
 | 
			
		||||
				if (this.form.id != null) {
 | 
			
		||||
					updateEquipmentPlcConnect(this.form).then((response) => {
 | 
			
		||||
						this.$modal.msgSuccess('修改成功');
 | 
			
		||||
						this.open = false;
 | 
			
		||||
						this.getList();
 | 
			
		||||
					});
 | 
			
		||||
					return;
 | 
			
		||||
				}
 | 
			
		||||
				// 添加的提交
 | 
			
		||||
				createEquipmentPlcConnect(this.form).then((response) => {
 | 
			
		||||
					this.$modal.msgSuccess('新增成功');
 | 
			
		||||
					this.open = false;
 | 
			
		||||
					this.getList();
 | 
			
		||||
				});
 | 
			
		||||
			});
 | 
			
		||||
		},
 | 
			
		||||
 | 
			
		||||
		// 查看报警
 | 
			
		||||
		handleDetail(row) {
 | 
			
		||||
			// debugger;
 | 
			
		||||
			const {
 | 
			
		||||
				id,
 | 
			
		||||
				bindingParameters,
 | 
			
		||||
				equipmentCode,
 | 
			
		||||
				equipmentId,
 | 
			
		||||
				equipmentName,
 | 
			
		||||
				plcCode,
 | 
			
		||||
				plcId,
 | 
			
		||||
				plcName,
 | 
			
		||||
				plcTableName,
 | 
			
		||||
				productionLine,
 | 
			
		||||
				workshopSection,
 | 
			
		||||
			} = row;
 | 
			
		||||
			// 打开抽屉
 | 
			
		||||
			this.editMode = 'detail';
 | 
			
		||||
			this.alarmForm.id = id;
 | 
			
		||||
			this.alarmForm.plcTableName = plcTableName; // 关联表名
 | 
			
		||||
			this.alarmForm.equipmentName = equipmentName;
 | 
			
		||||
			this.editVisible = true;
 | 
			
		||||
			this.$nextTick(() => {
 | 
			
		||||
				this.$refs['drawer'].init();
 | 
			
		||||
			});
 | 
			
		||||
		},
 | 
			
		||||
 | 
			
		||||
		/** 删除按钮操作 */
 | 
			
		||||
		handleDelete(row) {
 | 
			
		||||
			const id = row.id;
 | 
			
		||||
			this.$modal
 | 
			
		||||
				.confirm('是否删除该配置?')
 | 
			
		||||
				.then(function () {
 | 
			
		||||
					return deleteEquipmentPlcConnect(id);
 | 
			
		||||
				})
 | 
			
		||||
				.then(() => {
 | 
			
		||||
					this.getList();
 | 
			
		||||
					this.$modal.msgSuccess('删除成功');
 | 
			
		||||
				})
 | 
			
		||||
				.catch(() => {});
 | 
			
		||||
		},
 | 
			
		||||
 | 
			
		||||
		/** 导出按钮操作 */
 | 
			
		||||
		handleExport() {
 | 
			
		||||
			// 处理查询参数
 | 
			
		||||
			let params = { ...this.queryParams };
 | 
			
		||||
			params.pageNo = undefined;
 | 
			
		||||
			params.pageSize = undefined;
 | 
			
		||||
			this.$modal
 | 
			
		||||
				.confirm('是否确认导出所有设备与实时采集关系表(一对多)数据项?')
 | 
			
		||||
				.then(() => {
 | 
			
		||||
					this.exportLoading = true;
 | 
			
		||||
					return exportEquipmentPlcConnectExcel(params);
 | 
			
		||||
				})
 | 
			
		||||
				.then((response) => {
 | 
			
		||||
					this.$download.excel(response, '设备与实时采集关系表(一对多).xls');
 | 
			
		||||
					this.exportLoading = false;
 | 
			
		||||
				})
 | 
			
		||||
				.catch(() => {});
 | 
			
		||||
		},
 | 
			
		||||
	},
 | 
			
		||||
};
 | 
			
		||||
</script>
 | 
			
		||||
 | 
			
		||||
<style scoped lang="scss">
 | 
			
		||||
 | 
			
		||||
</style>
 | 
			
		||||
 
 | 
			
		||||
@@ -0,0 +1,557 @@
 | 
			
		||||
<!-- 
 | 
			
		||||
    filename: EquipmentDrawer.vue
 | 
			
		||||
    author: liubin
 | 
			
		||||
    date: 2023-08-22 14:38:56
 | 
			
		||||
    description: 
 | 
			
		||||
-->
 | 
			
		||||
 | 
			
		||||
<template>
 | 
			
		||||
	<el-drawer
 | 
			
		||||
		:visible="visible"
 | 
			
		||||
		:show-close="false"
 | 
			
		||||
		:wrapper-closable="false"
 | 
			
		||||
		class="drawer"
 | 
			
		||||
		custom-class="mes-drawer"
 | 
			
		||||
		size="60%"
 | 
			
		||||
		@closed="$emit('destroy')">
 | 
			
		||||
		<SmallTitle slot="title">
 | 
			
		||||
			{{
 | 
			
		||||
				mode.includes('detail')
 | 
			
		||||
					? '详情'
 | 
			
		||||
					: mode.includes('edit')
 | 
			
		||||
					? '编辑'
 | 
			
		||||
					: '新增'
 | 
			
		||||
			}}
 | 
			
		||||
		</SmallTitle>
 | 
			
		||||
 | 
			
		||||
		<div class="drawer-body flex">
 | 
			
		||||
			<div class="drawer-body__content">
 | 
			
		||||
				<section v-for="(section, index) in sections" :key="section.key">
 | 
			
		||||
					<SmallTitle v-if="index != 0">{{ section.name }}</SmallTitle>
 | 
			
		||||
 | 
			
		||||
					<div class="form-part" v-if="section.key == 'base'">
 | 
			
		||||
						<el-skeleton v-if="!showForm" animated />
 | 
			
		||||
						<BaseInfoForm
 | 
			
		||||
							key="drawer-dialog-form"
 | 
			
		||||
							v-if="showForm"
 | 
			
		||||
							ref="form"
 | 
			
		||||
							:disabled="mode.includes('detail')"
 | 
			
		||||
							v-model="form"
 | 
			
		||||
							:rows="formRows" />
 | 
			
		||||
					</div>
 | 
			
		||||
 | 
			
		||||
					<div v-if="section.key == 'attrs'" style="margin-top: 12px">
 | 
			
		||||
						<base-table
 | 
			
		||||
							v-loading="attrListLoading"
 | 
			
		||||
							:table-props="section.props"
 | 
			
		||||
							:page="attrQuery?.params.pageNo || 1"
 | 
			
		||||
							:limit="attrQuery?.params.pageSize || 10"
 | 
			
		||||
							:table-data="list"
 | 
			
		||||
							:add-button-show="mode.includes('detail') ? null : '添加属性'"
 | 
			
		||||
							@emitButtonClick="handleAddAttr"
 | 
			
		||||
							@emitFun="handleEmitFun">
 | 
			
		||||
							<method-btn
 | 
			
		||||
								v-if="section.tableBtn"
 | 
			
		||||
								slot="handleBtn"
 | 
			
		||||
								label="操作"
 | 
			
		||||
								:method-list="tableBtn"
 | 
			
		||||
								@clickBtn="handleTableBtnClick" />
 | 
			
		||||
						</base-table>
 | 
			
		||||
 | 
			
		||||
						<!-- 分页组件 -->
 | 
			
		||||
						<pagination
 | 
			
		||||
							v-show="total > 0"
 | 
			
		||||
							:total="total"
 | 
			
		||||
							:page.sync="attrQuery.params.pageNo"
 | 
			
		||||
							:limit.sync="attrQuery.params.pageSize"
 | 
			
		||||
							@pagination="getAttrList" />
 | 
			
		||||
					</div>
 | 
			
		||||
				</section>
 | 
			
		||||
			</div>
 | 
			
		||||
 | 
			
		||||
			<div class="drawer-body__footer">
 | 
			
		||||
				<el-button style="" @click="handleCancel">取消</el-button>
 | 
			
		||||
				<el-button v-if="mode == 'detail'" type="primary" @click="toggleEdit">
 | 
			
		||||
					编辑
 | 
			
		||||
				</el-button>
 | 
			
		||||
				<el-button v-else type="primary" @click="handleCancel">确定</el-button>
 | 
			
		||||
				<!-- sections的第二项必须是 属性列表  -->
 | 
			
		||||
				<!-- <el-button
 | 
			
		||||
						v-if="sections[1].allowAdd"
 | 
			
		||||
						type="primary"
 | 
			
		||||
						@click="handleAddAttr">
 | 
			
		||||
						添加属性
 | 
			
		||||
					</el-button> -->
 | 
			
		||||
			</div>
 | 
			
		||||
		</div>
 | 
			
		||||
 | 
			
		||||
		<!-- 属性对话框 -->
 | 
			
		||||
		<base-dialog
 | 
			
		||||
			v-if="sections[1].allowAdd"
 | 
			
		||||
			:dialogTitle="attrTitle"
 | 
			
		||||
			:dialogVisible="attrFormVisible"
 | 
			
		||||
			width="45%"
 | 
			
		||||
			:append-to-body="true"
 | 
			
		||||
			custom-class="baseDialog"
 | 
			
		||||
			@close="closeAttrForm"
 | 
			
		||||
			@cancel="closeAttrForm"
 | 
			
		||||
			@confirm="submitAttrForm">
 | 
			
		||||
			<DialogForm
 | 
			
		||||
				v-if="attrFormVisible"
 | 
			
		||||
				ref="attrForm"
 | 
			
		||||
				:disabled="mode.includes('detail')"
 | 
			
		||||
				v-model="attrForm"
 | 
			
		||||
				:rows="attrRows" />
 | 
			
		||||
		</base-dialog>
 | 
			
		||||
	</el-drawer>
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script>
 | 
			
		||||
import BaseInfoForm from '@/components/DialogForm';
 | 
			
		||||
 | 
			
		||||
const SmallTitle = {
 | 
			
		||||
	name: 'SmallTitle',
 | 
			
		||||
	props: ['size'],
 | 
			
		||||
	data() {
 | 
			
		||||
		return {};
 | 
			
		||||
	},
 | 
			
		||||
	methods: {},
 | 
			
		||||
	render: function (h) {
 | 
			
		||||
		return h(
 | 
			
		||||
			'span',
 | 
			
		||||
			{
 | 
			
		||||
				class: 'small-title',
 | 
			
		||||
				style: {
 | 
			
		||||
					fontSize: '18px',
 | 
			
		||||
					lineHeight:
 | 
			
		||||
						this.size == 'lg' ? '24px' : this.size == 'sm' ? '18px' : '20px',
 | 
			
		||||
					fontWeight: 500,
 | 
			
		||||
					fontFamily: '微软雅黑, Microsoft YaHei, Arial, Helvetica, sans-serif',
 | 
			
		||||
				},
 | 
			
		||||
			},
 | 
			
		||||
			this.$slots.default
 | 
			
		||||
		);
 | 
			
		||||
	},
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
export default {
 | 
			
		||||
	components: { SmallTitle, DialogForm: BaseInfoForm, BaseInfoForm },
 | 
			
		||||
	props: ['sections', 'defaultMode', 'infoData'],
 | 
			
		||||
	data() {
 | 
			
		||||
		return {
 | 
			
		||||
			mode: '',
 | 
			
		||||
			visible: false,
 | 
			
		||||
			showForm: false,
 | 
			
		||||
			total: 0,
 | 
			
		||||
			form: {},
 | 
			
		||||
			list: [],
 | 
			
		||||
			attrTitle: '',
 | 
			
		||||
			attrForm: {
 | 
			
		||||
				id: null,
 | 
			
		||||
				name: '',
 | 
			
		||||
				plcParamName: '',
 | 
			
		||||
				unit: '',
 | 
			
		||||
				collection: 1,
 | 
			
		||||
				minValue: '',
 | 
			
		||||
				maxValue: '',
 | 
			
		||||
				defaultValue: '',
 | 
			
		||||
				description: '',
 | 
			
		||||
				remark: '',
 | 
			
		||||
				alarmContent: '',
 | 
			
		||||
			},
 | 
			
		||||
			attrFormVisible: false,
 | 
			
		||||
			attrRows: [
 | 
			
		||||
				[
 | 
			
		||||
					{
 | 
			
		||||
						input: true,
 | 
			
		||||
						label: '参数列名',
 | 
			
		||||
						prop: 'plcParamName',
 | 
			
		||||
						rules: [{ required: true, message: '不能为空', trigger: 'blur' }],
 | 
			
		||||
					},
 | 
			
		||||
					{
 | 
			
		||||
						input: true,
 | 
			
		||||
						label: '参数名称',
 | 
			
		||||
						prop: 'name',
 | 
			
		||||
						rules: [{ required: true, message: '不能为空', trigger: 'blur' }],
 | 
			
		||||
					},
 | 
			
		||||
				],
 | 
			
		||||
				[
 | 
			
		||||
					{
 | 
			
		||||
						select: true,
 | 
			
		||||
						label: '单位',
 | 
			
		||||
						prop: 'unit',
 | 
			
		||||
						options: this.getDictDatas(this.DICT_TYPE.UNIT_DICT),
 | 
			
		||||
						// rules: [{ required: true, message: '不能为空', trigger: 'blur' }],
 | 
			
		||||
					},
 | 
			
		||||
					{
 | 
			
		||||
						switch: true,
 | 
			
		||||
						label: '是否采集',
 | 
			
		||||
						prop: 'collection',
 | 
			
		||||
						bind: {
 | 
			
		||||
							'active-value': 1,
 | 
			
		||||
							'inactive-value': 0,
 | 
			
		||||
						},
 | 
			
		||||
					},
 | 
			
		||||
				],
 | 
			
		||||
				[
 | 
			
		||||
					{
 | 
			
		||||
						select: true,
 | 
			
		||||
						label: '设备参数类型',
 | 
			
		||||
						prop: 'equipment_param_type',
 | 
			
		||||
						options: [
 | 
			
		||||
                            { label: '一般参数', value: 1 },
 | 
			
		||||
                            { label: '工艺参数', value: 2 },
 | 
			
		||||
                            { label: '报警参数', value: 3 },
 | 
			
		||||
                        ],
 | 
			
		||||
						rules: [{ required: true, message: '不能为空', trigger: 'blur' }],
 | 
			
		||||
					},
 | 
			
		||||
					{
 | 
			
		||||
                        select: true,
 | 
			
		||||
						label: '生产参数类型',
 | 
			
		||||
                        prop: 'production_param_type',
 | 
			
		||||
						options: [
 | 
			
		||||
                            { label: '进片数量', value: 1 },
 | 
			
		||||
                            { label: '出片数量', value: 2 },
 | 
			
		||||
                            { label: '破损数量', value: 3 },
 | 
			
		||||
                            { label: '无类型', value: 4 },
 | 
			
		||||
 | 
			
		||||
                        ],
 | 
			
		||||
						rules: [{ required: true, message: '不能为空', trigger: 'blur' }],
 | 
			
		||||
					},
 | 
			
		||||
				],
 | 
			
		||||
				[
 | 
			
		||||
					{
 | 
			
		||||
						input: true,
 | 
			
		||||
						label: '最小值',
 | 
			
		||||
						prop: 'minValue',
 | 
			
		||||
						rules: [
 | 
			
		||||
							{
 | 
			
		||||
								type: 'number',
 | 
			
		||||
								message: '请输入正确的数字',
 | 
			
		||||
								trigger: 'change',
 | 
			
		||||
								transform: (val) => Number(val),
 | 
			
		||||
							},
 | 
			
		||||
						],
 | 
			
		||||
					},
 | 
			
		||||
					{
 | 
			
		||||
						input: true,
 | 
			
		||||
						label: '最大值',
 | 
			
		||||
						prop: 'maxValue',
 | 
			
		||||
						rules: [
 | 
			
		||||
							{
 | 
			
		||||
								required: false,
 | 
			
		||||
							},
 | 
			
		||||
							{
 | 
			
		||||
								type: 'number',
 | 
			
		||||
								message: '请输入正确的数字',
 | 
			
		||||
								trigger: 'change',
 | 
			
		||||
								transform: (val) => Number(val),
 | 
			
		||||
							},
 | 
			
		||||
						],
 | 
			
		||||
						// rules: [{ required: true, message: '不能为空', trigger: 'blur' }],
 | 
			
		||||
					},
 | 
			
		||||
				],
 | 
			
		||||
				[
 | 
			
		||||
					{
 | 
			
		||||
						input: true,
 | 
			
		||||
						label: '标准值',
 | 
			
		||||
						prop: 'defaultValue',
 | 
			
		||||
						// rules: [{ required: true, message: '不能为空', trigger: 'blur' }],
 | 
			
		||||
					},
 | 
			
		||||
					{
 | 
			
		||||
						input: true,
 | 
			
		||||
						label: '描述',
 | 
			
		||||
						prop: 'description',
 | 
			
		||||
						// rules: [{ required: true, message: '不能为空', trigger: 'blur' }],
 | 
			
		||||
					},
 | 
			
		||||
				],
 | 
			
		||||
				[
 | 
			
		||||
					{
 | 
			
		||||
						input: true,
 | 
			
		||||
						label: '备注',
 | 
			
		||||
						prop: 'remark',
 | 
			
		||||
						// rules: [{ required: true, message: '不能为空', trigger: 'blur' }],
 | 
			
		||||
					},
 | 
			
		||||
				],
 | 
			
		||||
			],
 | 
			
		||||
			attrQuery: {
 | 
			
		||||
				params: {
 | 
			
		||||
					pageNo: 1,
 | 
			
		||||
					pageSize: 10,
 | 
			
		||||
				},
 | 
			
		||||
			}, // 属性列表的请求
 | 
			
		||||
			infoQuery: null, // 基本信息的请求
 | 
			
		||||
			attrFormSubmitting: false,
 | 
			
		||||
			attrListLoading: false,
 | 
			
		||||
		};
 | 
			
		||||
	},
 | 
			
		||||
	computed: {
 | 
			
		||||
		formRows() {
 | 
			
		||||
			return this.sections[0].rows.map((row) => {
 | 
			
		||||
				return row.map((col) => {
 | 
			
		||||
					return {
 | 
			
		||||
						...col,
 | 
			
		||||
						bind: {
 | 
			
		||||
							// 详情 模式下,禁用各种输入
 | 
			
		||||
							// disabled: this.mode == 'detail',
 | 
			
		||||
							disabled: true,
 | 
			
		||||
						},
 | 
			
		||||
					};
 | 
			
		||||
				});
 | 
			
		||||
			});
 | 
			
		||||
		},
 | 
			
		||||
		tableBtn() {
 | 
			
		||||
			return this.mode == 'detail' ? [] : this.sections[1].tableBtn;
 | 
			
		||||
		},
 | 
			
		||||
	},
 | 
			
		||||
	mounted() {
 | 
			
		||||
		this.mode = this.defaultMode || 'detail';
 | 
			
		||||
		for (const section of this.sections) {
 | 
			
		||||
			// 请求具体信息
 | 
			
		||||
			if ('url' in section) {
 | 
			
		||||
				const query = {
 | 
			
		||||
					url: section.url,
 | 
			
		||||
					method: section.method || 'get',
 | 
			
		||||
					params: section.queryParams || null,
 | 
			
		||||
					data: section.data || null,
 | 
			
		||||
				};
 | 
			
		||||
				// debugger;
 | 
			
		||||
				this.$axios(query).then(({ data }) => {
 | 
			
		||||
					if (section.key == 'base') {
 | 
			
		||||
						this.form = data;
 | 
			
		||||
						this.showForm = true;
 | 
			
		||||
						this.infoQuery = query;
 | 
			
		||||
					} else if (section.key == 'attrs') {
 | 
			
		||||
						this.attrQuery = query;
 | 
			
		||||
						this.list = data.list;
 | 
			
		||||
						this.total = data.total;
 | 
			
		||||
					}
 | 
			
		||||
				});
 | 
			
		||||
			} else if (section.key == 'base') {
 | 
			
		||||
				this.form = this.infoData;
 | 
			
		||||
				this.showForm = true;
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
	},
 | 
			
		||||
	methods: {
 | 
			
		||||
		handleTableBtnClick({ type, data }) {
 | 
			
		||||
			switch (type) {
 | 
			
		||||
				case 'edit':
 | 
			
		||||
					this.handleEditAttr(data.id);
 | 
			
		||||
					break;
 | 
			
		||||
				case 'delete':
 | 
			
		||||
					this.handleDeleteAttr(data.id);
 | 
			
		||||
					break;
 | 
			
		||||
			}
 | 
			
		||||
		},
 | 
			
		||||
 | 
			
		||||
		handleEmitFun(val) {
 | 
			
		||||
			console.log('handleEmitFun', val);
 | 
			
		||||
		},
 | 
			
		||||
 | 
			
		||||
		init() {
 | 
			
		||||
			this.visible = true;
 | 
			
		||||
		},
 | 
			
		||||
 | 
			
		||||
		async getAttrList() {
 | 
			
		||||
			this.attrListLoading = true;
 | 
			
		||||
			const res = await this.$axios(this.attrQuery);
 | 
			
		||||
			if (res.code == 0) {
 | 
			
		||||
				this.list = res.data.list;
 | 
			
		||||
				this.total = res.data.total;
 | 
			
		||||
			}
 | 
			
		||||
			this.attrListLoading = false;
 | 
			
		||||
		},
 | 
			
		||||
 | 
			
		||||
		// 保存表单
 | 
			
		||||
		handleSave() {
 | 
			
		||||
			this.$refs['form'][0].validate(async (valid) => {
 | 
			
		||||
				if (valid) {
 | 
			
		||||
					const isEdit = this.mode == 'edit';
 | 
			
		||||
					await this.$axios({
 | 
			
		||||
						url: this.sections[0][isEdit ? 'urlUpdate' : 'urlCreate'],
 | 
			
		||||
						method: isEdit ? 'put' : 'post',
 | 
			
		||||
						data: this.form,
 | 
			
		||||
					});
 | 
			
		||||
					this.$modal.msgSuccess(`${isEdit ? '更新' : '创建'}成功`);
 | 
			
		||||
					this.visible = false;
 | 
			
		||||
					this.$emit('refreshDataList');
 | 
			
		||||
				}
 | 
			
		||||
			});
 | 
			
		||||
		},
 | 
			
		||||
 | 
			
		||||
		handleCancel() {
 | 
			
		||||
			this.visible = false;
 | 
			
		||||
		},
 | 
			
		||||
 | 
			
		||||
		// 开启编辑
 | 
			
		||||
		toggleEdit() {
 | 
			
		||||
			this.mode = 'edit';
 | 
			
		||||
		},
 | 
			
		||||
 | 
			
		||||
		// 新增属性
 | 
			
		||||
		handleAddAttr() {
 | 
			
		||||
			this.attrForm = {
 | 
			
		||||
				id: null,
 | 
			
		||||
				name: '',
 | 
			
		||||
				plcParamName: '',
 | 
			
		||||
				unit: '',
 | 
			
		||||
				collection: 1,
 | 
			
		||||
				minValue: '',
 | 
			
		||||
				maxValue: '',
 | 
			
		||||
				defaultValue: '',
 | 
			
		||||
				description: '',
 | 
			
		||||
				remark: '',
 | 
			
		||||
				alarmContent: '',
 | 
			
		||||
			};
 | 
			
		||||
			this.attrTitle = '添加设备绑定信息';
 | 
			
		||||
			this.attrFormVisible = true;
 | 
			
		||||
		},
 | 
			
		||||
 | 
			
		||||
		// 编辑属性
 | 
			
		||||
		async handleEditAttr(attrId) {
 | 
			
		||||
			const res = await this.$axios({
 | 
			
		||||
				url: this.sections[1].urlDetail,
 | 
			
		||||
				method: 'get',
 | 
			
		||||
				params: { id: attrId },
 | 
			
		||||
			});
 | 
			
		||||
			if (res.code == 0) {
 | 
			
		||||
				this.attrForm = res.data;
 | 
			
		||||
				this.attrTitle = '编辑设备绑定信息';
 | 
			
		||||
				this.attrFormVisible = true;
 | 
			
		||||
			}
 | 
			
		||||
		},
 | 
			
		||||
 | 
			
		||||
		// 删除属性
 | 
			
		||||
		handleDeleteAttr(attrId) {
 | 
			
		||||
			this.$confirm('确定删除该分组报警?', '提示', {
 | 
			
		||||
				confirmButtonText: '确定',
 | 
			
		||||
				cancelButtonText: '取消',
 | 
			
		||||
				type: 'warning',
 | 
			
		||||
			})
 | 
			
		||||
				.then(async () => {
 | 
			
		||||
					const res = await this.$axios({
 | 
			
		||||
						url: this.sections[1].urlDelete,
 | 
			
		||||
						method: 'delete',
 | 
			
		||||
						params: { id: attrId },
 | 
			
		||||
					});
 | 
			
		||||
					if (res.code == 0) {
 | 
			
		||||
						this.$message({
 | 
			
		||||
							message: '删除成功',
 | 
			
		||||
							type: 'success',
 | 
			
		||||
							duration: 1500,
 | 
			
		||||
							onClose: () => {
 | 
			
		||||
								this.getAttrList();
 | 
			
		||||
							},
 | 
			
		||||
						});
 | 
			
		||||
					}
 | 
			
		||||
				})
 | 
			
		||||
				.catch(() => {});
 | 
			
		||||
		},
 | 
			
		||||
 | 
			
		||||
		// 提交属性表
 | 
			
		||||
		async submitAttrForm() {
 | 
			
		||||
			this.$refs['attrForm'].validate((valid) => {
 | 
			
		||||
				if (!valid) {
 | 
			
		||||
					return;
 | 
			
		||||
				}
 | 
			
		||||
			});
 | 
			
		||||
			const isEdit = this.attrForm.id != null;
 | 
			
		||||
			this.attrFormSubmitting = true;
 | 
			
		||||
			const res = await this.$axios({
 | 
			
		||||
				url: isEdit ? this.sections[1].urlUpdate : this.sections[1].urlCreate,
 | 
			
		||||
				method: isEdit ? 'put' : 'post',
 | 
			
		||||
				data: {
 | 
			
		||||
					...this.attrForm,
 | 
			
		||||
					connectId: this.infoData.id,
 | 
			
		||||
				},
 | 
			
		||||
			});
 | 
			
		||||
 | 
			
		||||
			if (res.code == 0) {
 | 
			
		||||
				this.closeAttrForm();
 | 
			
		||||
				this.$message({
 | 
			
		||||
					message: `${isEdit ? '更新' : '创建'}成功`,
 | 
			
		||||
					type: 'success',
 | 
			
		||||
					duration: 1500,
 | 
			
		||||
					onClose: () => {
 | 
			
		||||
						this.getAttrList();
 | 
			
		||||
					},
 | 
			
		||||
				});
 | 
			
		||||
			}
 | 
			
		||||
			this.attrFormSubmitting = false;
 | 
			
		||||
		},
 | 
			
		||||
 | 
			
		||||
		closeAttrForm() {
 | 
			
		||||
			this.attrFormVisible = false;
 | 
			
		||||
		},
 | 
			
		||||
 | 
			
		||||
		handleClick(raw) {
 | 
			
		||||
			if (raw.type === 'delete') {
 | 
			
		||||
				this.$confirm(`确定删除该报警?`, '提示', {
 | 
			
		||||
					confirmButtonText: '确定',
 | 
			
		||||
					cancelButtonText: '取消',
 | 
			
		||||
					type: 'warning',
 | 
			
		||||
				})
 | 
			
		||||
					.then(() => {
 | 
			
		||||
						deleteProductAttr(raw.data.id).then(({ data }) => {
 | 
			
		||||
							this.$message({
 | 
			
		||||
								message: '操作成功',
 | 
			
		||||
								type: 'success',
 | 
			
		||||
								duration: 1500,
 | 
			
		||||
								onClose: () => {
 | 
			
		||||
									this.getList();
 | 
			
		||||
								},
 | 
			
		||||
							});
 | 
			
		||||
						});
 | 
			
		||||
					})
 | 
			
		||||
					.catch(() => {});
 | 
			
		||||
			} else {
 | 
			
		||||
				this.addNew(raw.data.id);
 | 
			
		||||
			}
 | 
			
		||||
		},
 | 
			
		||||
	},
 | 
			
		||||
};
 | 
			
		||||
</script>
 | 
			
		||||
 | 
			
		||||
<style scoped>
 | 
			
		||||
.drawer >>> .el-drawer {
 | 
			
		||||
	border-radius: 8px 0 0 8px;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
.drawer >>> .el-drawer__header {
 | 
			
		||||
	margin: 0;
 | 
			
		||||
	padding: 32px 32px 24px;
 | 
			
		||||
	border-bottom: 1px solid #dcdfe6;
 | 
			
		||||
	margin-bottom: 0px;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
.small-title::before {
 | 
			
		||||
	content: '';
 | 
			
		||||
	display: inline-block;
 | 
			
		||||
	vertical-align: top;
 | 
			
		||||
	width: 4px;
 | 
			
		||||
	height: 22px;
 | 
			
		||||
	border-radius: 1px;
 | 
			
		||||
	margin-right: 8px;
 | 
			
		||||
	background-color: #0b58ff;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
.drawer-body {
 | 
			
		||||
	display: flex;
 | 
			
		||||
	flex-direction: column;
 | 
			
		||||
	height: 100%;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
.drawer-body__content {
 | 
			
		||||
	flex: 1;
 | 
			
		||||
	/* background: #eee; */
 | 
			
		||||
	padding: 20px 30px;
 | 
			
		||||
	overflow-y: auto;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
.drawer-body__footer {
 | 
			
		||||
	display: flex;
 | 
			
		||||
	justify-content: flex-end;
 | 
			
		||||
	padding: 18px;
 | 
			
		||||
}
 | 
			
		||||
</style>
 | 
			
		||||
							
								
								
									
										307
									
								
								src/views/equipment/base/inspection/Content/index.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										307
									
								
								src/views/equipment/base/inspection/Content/index.vue
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,307 @@
 | 
			
		||||
<template>
 | 
			
		||||
	<div class="app-container">
 | 
			
		||||
		<!-- 搜索工作栏 -->
 | 
			
		||||
		<SearchBar
 | 
			
		||||
			:formConfigs="searchBarFormConfig"
 | 
			
		||||
			ref="search-bar"
 | 
			
		||||
			@headBtnClick="handleSearchBarBtnClick" />
 | 
			
		||||
 | 
			
		||||
		<!-- 列表 -->
 | 
			
		||||
		<base-table
 | 
			
		||||
			:table-props="tableProps"
 | 
			
		||||
			:page="queryParams.pageNo"
 | 
			
		||||
			:limit="queryParams.pageSize"
 | 
			
		||||
			:table-data="list"
 | 
			
		||||
			@emitFun="handleEmitFun">
 | 
			
		||||
			<method-btn
 | 
			
		||||
				v-if="tableBtn.length"
 | 
			
		||||
				slot="handleBtn"
 | 
			
		||||
				label="操作"
 | 
			
		||||
				:width="120"
 | 
			
		||||
				:method-list="tableBtn"
 | 
			
		||||
				@clickBtn="handleTableBtnClick" />
 | 
			
		||||
		</base-table>
 | 
			
		||||
 | 
			
		||||
		<!-- 分页组件 -->
 | 
			
		||||
		<pagination
 | 
			
		||||
			v-show="total > 0"
 | 
			
		||||
			:total="total"
 | 
			
		||||
			:page.sync="queryParams.pageNo"
 | 
			
		||||
			:limit.sync="queryParams.pageSize"
 | 
			
		||||
			@pagination="getList" />
 | 
			
		||||
 | 
			
		||||
		<!-- 对话框(添加 / 修改) -->
 | 
			
		||||
		<base-dialog
 | 
			
		||||
			:dialogTitle="title"
 | 
			
		||||
			:dialogVisible="open"
 | 
			
		||||
			@close="cancel"
 | 
			
		||||
			@cancel="cancel"
 | 
			
		||||
			@confirm="submitForm">
 | 
			
		||||
			<DialogForm
 | 
			
		||||
				v-if="open"
 | 
			
		||||
				ref="form"
 | 
			
		||||
				v-model="form"
 | 
			
		||||
				:disabled="mode == 'detail'"
 | 
			
		||||
				:has-files="false"
 | 
			
		||||
				:rows="rows" />
 | 
			
		||||
		</base-dialog>
 | 
			
		||||
	</div>
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script>
 | 
			
		||||
import moment from 'moment';
 | 
			
		||||
import basicPageMixin from '@/mixins/lb/basicPageMixin';
 | 
			
		||||
import { publicFormatter } from '@/utils/dict';
 | 
			
		||||
 | 
			
		||||
const timeFilter = (val) => moment(val).format('yyyy-MM-DD HH:mm:ss');
 | 
			
		||||
 | 
			
		||||
export default {
 | 
			
		||||
	name: 'EquipmentCheck',
 | 
			
		||||
	components: {},
 | 
			
		||||
	mixins: [basicPageMixin],
 | 
			
		||||
	data() {
 | 
			
		||||
		return {
 | 
			
		||||
			searchBarKeys: ['content'],
 | 
			
		||||
			tableBtn: [
 | 
			
		||||
				// this.$auth.hasPermi('equipment:check:update')
 | 
			
		||||
				// 	? {
 | 
			
		||||
				// 			type: 'detail',
 | 
			
		||||
				// 			btnName: '详情',
 | 
			
		||||
				// 	  }
 | 
			
		||||
				// 	: undefined,
 | 
			
		||||
				this.$auth.hasPermi('equipment:check:update')
 | 
			
		||||
					? {
 | 
			
		||||
							type: 'edit',
 | 
			
		||||
							btnName: '修改',
 | 
			
		||||
					  }
 | 
			
		||||
					: undefined,
 | 
			
		||||
				this.$auth.hasPermi('equipment:check:delete')
 | 
			
		||||
					? {
 | 
			
		||||
							type: 'delete',
 | 
			
		||||
							btnName: '删除',
 | 
			
		||||
					  }
 | 
			
		||||
					: undefined,
 | 
			
		||||
			].filter((v) => v),
 | 
			
		||||
			tableProps: [
 | 
			
		||||
				{ prop: 'program', label: '巡检项目' },
 | 
			
		||||
				{ prop: 'content', label: '巡检内容' },
 | 
			
		||||
				{ prop: 'code', label: '巡检内容编码' },
 | 
			
		||||
				{ prop: 'remark', label: '备注' },
 | 
			
		||||
			],
 | 
			
		||||
			searchBarFormConfig: [
 | 
			
		||||
				{
 | 
			
		||||
					type: 'input',
 | 
			
		||||
					label: '巡检内容',
 | 
			
		||||
					placeholder: '请输入巡检内容',
 | 
			
		||||
					param: 'content',
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					type: 'button',
 | 
			
		||||
					btnName: '查询',
 | 
			
		||||
					name: 'search',
 | 
			
		||||
					color: 'primary',
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					type: 'separate',
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					type: this.$auth.hasPermi('equipment:check:create') ? 'button' : '',
 | 
			
		||||
					btnName: '新增',
 | 
			
		||||
					name: 'add',
 | 
			
		||||
					plain: true,
 | 
			
		||||
					color: 'success',
 | 
			
		||||
				},
 | 
			
		||||
				// {
 | 
			
		||||
				// 	type: this.$auth.hasPermi('equipment:check:export')
 | 
			
		||||
				// 		? 'button'
 | 
			
		||||
				// 		: '',
 | 
			
		||||
				// 	btnName: '导出',
 | 
			
		||||
				// 	name: 'export',
 | 
			
		||||
				// 	color: 'warning',
 | 
			
		||||
				// },
 | 
			
		||||
			],
 | 
			
		||||
			rows: [
 | 
			
		||||
				[
 | 
			
		||||
					{
 | 
			
		||||
						input: true,
 | 
			
		||||
						label: '巡检内容编号',
 | 
			
		||||
						prop: 'code',
 | 
			
		||||
						url: '/base/equipment-check/getCode',
 | 
			
		||||
						rules: [{ required: true, message: '不能为空', trigger: 'blur' }],
 | 
			
		||||
					},
 | 
			
		||||
				],
 | 
			
		||||
				[
 | 
			
		||||
					{
 | 
			
		||||
						input: true,
 | 
			
		||||
						label: '巡检项目',
 | 
			
		||||
						prop: 'program',
 | 
			
		||||
						rules: [{ required: true, message: '不能为空', trigger: 'blur' }],
 | 
			
		||||
					},
 | 
			
		||||
				],
 | 
			
		||||
				[
 | 
			
		||||
					{
 | 
			
		||||
						input: true,
 | 
			
		||||
						label: '巡检内容',
 | 
			
		||||
						prop: 'content',
 | 
			
		||||
						rules: [{ required: true, message: '不能为空', trigger: 'blur' }],
 | 
			
		||||
					},
 | 
			
		||||
				],
 | 
			
		||||
				[
 | 
			
		||||
					{
 | 
			
		||||
						input: true,
 | 
			
		||||
						label: '备注',
 | 
			
		||||
						prop: 'remark',
 | 
			
		||||
					},
 | 
			
		||||
				],
 | 
			
		||||
			],
 | 
			
		||||
			// 是否显示弹出层
 | 
			
		||||
			open: false,
 | 
			
		||||
			// 查询参数
 | 
			
		||||
			queryParams: {
 | 
			
		||||
				pageNo: 1,
 | 
			
		||||
				pageSize: 10,
 | 
			
		||||
				content: null,
 | 
			
		||||
			},
 | 
			
		||||
			// 表单参数
 | 
			
		||||
			form: {},
 | 
			
		||||
			basePath: '/base/equipment-check',
 | 
			
		||||
			mode: null,
 | 
			
		||||
		};
 | 
			
		||||
	},
 | 
			
		||||
	created() {
 | 
			
		||||
		// this.initSearchBar();
 | 
			
		||||
		this.getList();
 | 
			
		||||
	},
 | 
			
		||||
	methods: {
 | 
			
		||||
		// initSearchBar() {
 | 
			
		||||
		// 	this.http('/base/core-equipment/listAll', 'get').then(({ data }) => {
 | 
			
		||||
		// 		this.$set(
 | 
			
		||||
		// 			this.searchBarFormConfig[0],
 | 
			
		||||
		// 			'selectOptions',
 | 
			
		||||
		// 			data.map((item) => ({
 | 
			
		||||
		// 				name: item.name,
 | 
			
		||||
		// 				id: item.id,
 | 
			
		||||
		// 			}))
 | 
			
		||||
		// 		);
 | 
			
		||||
		// 	});
 | 
			
		||||
		// },
 | 
			
		||||
		/** 查询列表 */
 | 
			
		||||
		getList() {
 | 
			
		||||
			this.loading = true;
 | 
			
		||||
			// 执行查询
 | 
			
		||||
			this.recv(this.queryParams).then((response) => {
 | 
			
		||||
				this.list = response.data.list;
 | 
			
		||||
				this.total = response.data.total;
 | 
			
		||||
				this.loading = false;
 | 
			
		||||
			});
 | 
			
		||||
		},
 | 
			
		||||
		/** 取消按钮 */
 | 
			
		||||
		cancel() {
 | 
			
		||||
			this.open = false;
 | 
			
		||||
			this.mode = null;
 | 
			
		||||
			this.reset();
 | 
			
		||||
		},
 | 
			
		||||
		/** 表单重置 */
 | 
			
		||||
		reset() {
 | 
			
		||||
			this.form = {
 | 
			
		||||
				id: null,
 | 
			
		||||
				name: null,
 | 
			
		||||
				content: null,
 | 
			
		||||
				program: null,
 | 
			
		||||
				remark: null,
 | 
			
		||||
			};
 | 
			
		||||
			this.resetForm('form');
 | 
			
		||||
		},
 | 
			
		||||
		/** 搜索按钮操作 */
 | 
			
		||||
		handleQuery() {
 | 
			
		||||
			this.queryParams.pageNo = 1;
 | 
			
		||||
			this.getList();
 | 
			
		||||
		},
 | 
			
		||||
		/** 重置按钮操作 */
 | 
			
		||||
		resetQuery() {
 | 
			
		||||
			this.resetForm('queryForm');
 | 
			
		||||
			this.handleQuery();
 | 
			
		||||
		},
 | 
			
		||||
		/** 新增按钮操作 */
 | 
			
		||||
		handleAdd() {
 | 
			
		||||
			this.reset();
 | 
			
		||||
			this.open = true;
 | 
			
		||||
			this.title = '添加巡检内容';
 | 
			
		||||
		},
 | 
			
		||||
		/** 修改按钮操作 */
 | 
			
		||||
		handleUpdate(row) {
 | 
			
		||||
			this.reset();
 | 
			
		||||
			const id = row.id;
 | 
			
		||||
			this.info({ id }).then((response) => {
 | 
			
		||||
				this.form = response.data;
 | 
			
		||||
				this.open = true;
 | 
			
		||||
				this.title = '修改巡检内容';
 | 
			
		||||
			});
 | 
			
		||||
		},
 | 
			
		||||
		/** 提交按钮 */
 | 
			
		||||
		submitForm() {
 | 
			
		||||
			this.$refs['form'].validate((valid) => {
 | 
			
		||||
				if (!valid) {
 | 
			
		||||
					return;
 | 
			
		||||
				}
 | 
			
		||||
				// 修改的提交
 | 
			
		||||
				if (this.form.id != null) {
 | 
			
		||||
					this.put(this.form).then((response) => {
 | 
			
		||||
						this.$modal.msgSuccess('修改成功');
 | 
			
		||||
						this.open = false;
 | 
			
		||||
						this.getList();
 | 
			
		||||
					});
 | 
			
		||||
					return;
 | 
			
		||||
				}
 | 
			
		||||
				// 添加的提交
 | 
			
		||||
				this.post(this.form).then((response) => {
 | 
			
		||||
					this.$modal.msgSuccess('新增成功');
 | 
			
		||||
					this.open = false;
 | 
			
		||||
					this.getList();
 | 
			
		||||
				});
 | 
			
		||||
			});
 | 
			
		||||
		},
 | 
			
		||||
		/** 删除按钮操作 */
 | 
			
		||||
		handleDelete(row) {
 | 
			
		||||
			const id = row.id;
 | 
			
		||||
			this.$modal
 | 
			
		||||
				.confirm('是否确认删除记录"' + row.name + '"?')
 | 
			
		||||
				.then(function () {
 | 
			
		||||
					return this.delete({ id });
 | 
			
		||||
				})
 | 
			
		||||
				.then(() => {
 | 
			
		||||
					this.getList();
 | 
			
		||||
					this.$modal.msgSuccess('删除成功');
 | 
			
		||||
				})
 | 
			
		||||
				.catch(() => {});
 | 
			
		||||
		},
 | 
			
		||||
		handleDetail({ id }) {
 | 
			
		||||
			this.reset();
 | 
			
		||||
			this.mode = 'detail';
 | 
			
		||||
			this.info({ id }).then((response) => {
 | 
			
		||||
				this.form = response.data;
 | 
			
		||||
				this.open = true;
 | 
			
		||||
				this.title = '修改巡检内容';
 | 
			
		||||
			});
 | 
			
		||||
		},
 | 
			
		||||
		/** 导出按钮操作 */
 | 
			
		||||
		handleExport() {
 | 
			
		||||
			// 处理查询参数
 | 
			
		||||
			let params = { ...this.queryParams };
 | 
			
		||||
			params.pageNo = undefined;
 | 
			
		||||
			params.pageSize = undefined;
 | 
			
		||||
			this.$modal
 | 
			
		||||
				.confirm('是否确认导出所有巡检内容?')
 | 
			
		||||
				.then(() => {
 | 
			
		||||
					this.exportLoading = true;
 | 
			
		||||
					return exportEquipmentTypeExcel(params);
 | 
			
		||||
				})
 | 
			
		||||
				.then((response) => {
 | 
			
		||||
					this.$download.excel(response, '巡检内容.xls');
 | 
			
		||||
					this.exportLoading = false;
 | 
			
		||||
				})
 | 
			
		||||
				.catch(() => {});
 | 
			
		||||
		},
 | 
			
		||||
	},
 | 
			
		||||
};
 | 
			
		||||
</script>
 | 
			
		||||
							
								
								
									
										371
									
								
								src/views/equipment/base/inspection/Record/index.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										371
									
								
								src/views/equipment/base/inspection/Record/index.vue
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,371 @@
 | 
			
		||||
<template>
 | 
			
		||||
	<div class="app-container">
 | 
			
		||||
		<!-- 搜索工作栏 -->
 | 
			
		||||
		<SearchBar
 | 
			
		||||
			:formConfigs="searchBarFormConfig"
 | 
			
		||||
			ref="search-bar"
 | 
			
		||||
			@headBtnClick="handleSearchBarBtnClick" />
 | 
			
		||||
 | 
			
		||||
		<!-- 列表 -->
 | 
			
		||||
		<base-table
 | 
			
		||||
			:table-props="tableProps"
 | 
			
		||||
			:page="queryParams.pageNo"
 | 
			
		||||
			:limit="queryParams.pageSize"
 | 
			
		||||
			:table-data="list"
 | 
			
		||||
			@emitFun="handleEmitFun">
 | 
			
		||||
			<method-btn
 | 
			
		||||
				v-if="tableBtn.length"
 | 
			
		||||
				slot="handleBtn"
 | 
			
		||||
				label="操作"
 | 
			
		||||
				:width="120"
 | 
			
		||||
				:method-list="tableBtn"
 | 
			
		||||
				@clickBtn="handleTableBtnClick" />
 | 
			
		||||
		</base-table>
 | 
			
		||||
 | 
			
		||||
		<!-- 分页组件 -->
 | 
			
		||||
		<pagination
 | 
			
		||||
			v-show="total > 0"
 | 
			
		||||
			:total="total"
 | 
			
		||||
			:page.sync="queryParams.pageNo"
 | 
			
		||||
			:limit.sync="queryParams.pageSize"
 | 
			
		||||
			@pagination="getList" />
 | 
			
		||||
 | 
			
		||||
		<!-- 对话框(添加 / 修改) -->
 | 
			
		||||
		<base-dialog
 | 
			
		||||
			:dialogTitle="title"
 | 
			
		||||
			:dialogVisible="open"
 | 
			
		||||
			@close="cancel"
 | 
			
		||||
			@cancel="cancel"
 | 
			
		||||
			@confirm="submitForm">
 | 
			
		||||
			<DialogForm
 | 
			
		||||
				v-if="open"
 | 
			
		||||
				ref="form"
 | 
			
		||||
				v-model="form"
 | 
			
		||||
				:disabled="mode == 'detail'"
 | 
			
		||||
				:has-files="true"
 | 
			
		||||
				:rows="rows" />
 | 
			
		||||
		</base-dialog>
 | 
			
		||||
	</div>
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script>
 | 
			
		||||
import moment from 'moment';
 | 
			
		||||
import basicPageMixin from '@/mixins/lb/basicPageMixin';
 | 
			
		||||
 | 
			
		||||
const timeFilter = (val) => moment(val).format('yyyy-MM-DD HH:mm:ss');
 | 
			
		||||
 | 
			
		||||
export default {
 | 
			
		||||
	name: 'EquipmentRepair',
 | 
			
		||||
	components: {},
 | 
			
		||||
	mixins: [basicPageMixin],
 | 
			
		||||
	data() {
 | 
			
		||||
		return {
 | 
			
		||||
			searchBarKeys: ['equipmentId', 'createTime'],
 | 
			
		||||
			tableBtn: [
 | 
			
		||||
				this.$auth.hasPermi('equipment:check-record:update')
 | 
			
		||||
					? {
 | 
			
		||||
							type: 'detail',
 | 
			
		||||
							btnName: '详情',
 | 
			
		||||
					  }
 | 
			
		||||
					: undefined,
 | 
			
		||||
				this.$auth.hasPermi('equipment:check-record:update')
 | 
			
		||||
					? {
 | 
			
		||||
							type: 'edit',
 | 
			
		||||
							btnName: '修改',
 | 
			
		||||
					  }
 | 
			
		||||
					: undefined,
 | 
			
		||||
				this.$auth.hasPermi('equipment:check-record:delete')
 | 
			
		||||
					? {
 | 
			
		||||
							type: 'delete',
 | 
			
		||||
							btnName: '删除',
 | 
			
		||||
					  }
 | 
			
		||||
					: undefined,
 | 
			
		||||
			].filter((v) => v),
 | 
			
		||||
			tableProps: [
 | 
			
		||||
				{ prop: 'repairOrderNumber', label: '配置名称' },
 | 
			
		||||
				{ prop: 'maintenanceDuration', label: '设备名称' },
 | 
			
		||||
				{ prop: 'lineName', label: '数据来源' },
 | 
			
		||||
				{ prop: 'sectionName', label: '计划巡检时间' },
 | 
			
		||||
				{ prop: 'equipmentName', label: '实际巡检时间' },
 | 
			
		||||
				{ prop: 'maintenanceDetail', label: '完成状态' },
 | 
			
		||||
				{ prop: 'repairman', label: '巡检人' },
 | 
			
		||||
			],
 | 
			
		||||
			searchBarFormConfig: [
 | 
			
		||||
				{
 | 
			
		||||
					type: 'select',
 | 
			
		||||
					label: '设备',
 | 
			
		||||
					placeholder: '请选择设备',
 | 
			
		||||
					param: 'equipmentId',
 | 
			
		||||
				},
 | 
			
		||||
				// 开始结束时间 
 | 
			
		||||
				{
 | 
			
		||||
					type: 'datePicker',
 | 
			
		||||
					label: '时间段',
 | 
			
		||||
					dateType: 'daterange', // datetimerange
 | 
			
		||||
					format: 'yyyy-MM-dd',
 | 
			
		||||
					valueFormat: 'timestamp',
 | 
			
		||||
					rangeSeparator: '-',
 | 
			
		||||
					startPlaceholder: '开始日期',
 | 
			
		||||
					endPlaceholder: '结束日期',
 | 
			
		||||
					defaultTime: ['00:00:00', '23:59:59'],
 | 
			
		||||
					param: 'startTime',
 | 
			
		||||
					// width: 350,
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					type: 'button',
 | 
			
		||||
					btnName: '查询',
 | 
			
		||||
					name: 'search',
 | 
			
		||||
					color: 'primary',
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					type: 'separate',
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					type: this.$auth.hasPermi('equipment:check-record:create')
 | 
			
		||||
						? 'button'
 | 
			
		||||
						: '',
 | 
			
		||||
					btnName: '新增',
 | 
			
		||||
					name: 'add',
 | 
			
		||||
					plain: true,
 | 
			
		||||
					color: 'success',
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					type: this.$auth.hasPermi('equipment:check-record:export')
 | 
			
		||||
						? 'button'
 | 
			
		||||
						: '',
 | 
			
		||||
					btnName: '导出',
 | 
			
		||||
					name: 'export',
 | 
			
		||||
					color: 'warning',
 | 
			
		||||
				},
 | 
			
		||||
			],
 | 
			
		||||
			rows: [
 | 
			
		||||
				[
 | 
			
		||||
					{
 | 
			
		||||
						input: true,
 | 
			
		||||
						label: '维修单号',
 | 
			
		||||
						prop: 'repairOrderNumber',
 | 
			
		||||
					},
 | 
			
		||||
					{
 | 
			
		||||
						select: true,
 | 
			
		||||
						label: '设备名称',
 | 
			
		||||
						prop: 'equipmentId',
 | 
			
		||||
						url: '/base/core-equipment/listAll',
 | 
			
		||||
						bind: {
 | 
			
		||||
							filterable: true,
 | 
			
		||||
							clearable: true,
 | 
			
		||||
						},
 | 
			
		||||
						rules: [{ required: true, message: '不能为空', trigger: 'blur' }],
 | 
			
		||||
					},
 | 
			
		||||
				],
 | 
			
		||||
				[
 | 
			
		||||
					{
 | 
			
		||||
						// TODO: 和班组联动
 | 
			
		||||
						select: true,
 | 
			
		||||
						label: '维修工',
 | 
			
		||||
						prop: 'repairman',
 | 
			
		||||
						// url: '/base/core-equipment/listAll',
 | 
			
		||||
						bind: {
 | 
			
		||||
							filterable: true,
 | 
			
		||||
							clearable: true,
 | 
			
		||||
							multiple: true,
 | 
			
		||||
						},
 | 
			
		||||
						options: [{ label: 'test', value: 'test' }],
 | 
			
		||||
						rules: [{ required: true, message: '不能为空', trigger: 'blur' }],
 | 
			
		||||
					},
 | 
			
		||||
					{
 | 
			
		||||
						input: true,
 | 
			
		||||
						label: '联系方式',
 | 
			
		||||
						prop: 'repairmanPhone',
 | 
			
		||||
					},
 | 
			
		||||
				],
 | 
			
		||||
				[
 | 
			
		||||
					{
 | 
			
		||||
						datetime: true,
 | 
			
		||||
						label: '故障发生时间',
 | 
			
		||||
						prop: 'faultTime',
 | 
			
		||||
						rules: [{ required: true, message: '不能为空', trigger: 'blur' }],
 | 
			
		||||
						bind: {
 | 
			
		||||
							format: 'yyyy-MM-dd HH:mm:ss',
 | 
			
		||||
							'value-format': 'timestamp',
 | 
			
		||||
							// 'value-format': 'yyyy-MM-dd HH:mm:ss',
 | 
			
		||||
							clearable: true,
 | 
			
		||||
						},
 | 
			
		||||
					},
 | 
			
		||||
					{
 | 
			
		||||
						select: true,
 | 
			
		||||
						label: '故障级别',
 | 
			
		||||
						prop: 'faultLevel', // 数据字典
 | 
			
		||||
						options: this.getDictDatas(this.DICT_TYPE.FAULT_LEVEL),
 | 
			
		||||
					},
 | 
			
		||||
				],
 | 
			
		||||
			],
 | 
			
		||||
			// 是否显示弹出层
 | 
			
		||||
			open: false,
 | 
			
		||||
			// 查询参数
 | 
			
		||||
			queryParams: {
 | 
			
		||||
				pageNo: 1,
 | 
			
		||||
				pageSize: 10,
 | 
			
		||||
				maintenanceStatus: null,
 | 
			
		||||
				createTime: null,
 | 
			
		||||
				equipmentId: null,
 | 
			
		||||
			},
 | 
			
		||||
			// 表单参数
 | 
			
		||||
			form: {},
 | 
			
		||||
			basePath: '/base/equipment-repair-log',
 | 
			
		||||
			mode: null,
 | 
			
		||||
		};
 | 
			
		||||
	},
 | 
			
		||||
	created() {
 | 
			
		||||
		this.initSearchBar();
 | 
			
		||||
		this.getList();
 | 
			
		||||
	},
 | 
			
		||||
	methods: {
 | 
			
		||||
		initSearchBar() {
 | 
			
		||||
			this.http('/base/core-equipment/listAll', 'get').then(({ data }) => {
 | 
			
		||||
				this.$set(
 | 
			
		||||
					this.searchBarFormConfig[0],
 | 
			
		||||
					'selectOptions',
 | 
			
		||||
					data.map((item) => ({
 | 
			
		||||
						name: item.name,
 | 
			
		||||
						id: item.id,
 | 
			
		||||
					}))
 | 
			
		||||
				);
 | 
			
		||||
			});
 | 
			
		||||
		},
 | 
			
		||||
		/** 查询列表 */
 | 
			
		||||
		getList() {
 | 
			
		||||
			this.loading = true;
 | 
			
		||||
			// 执行查询
 | 
			
		||||
			this.recv(this.queryParams).then((response) => {
 | 
			
		||||
				this.list = response.data.list;
 | 
			
		||||
				this.total = response.data.total;
 | 
			
		||||
				this.loading = false;
 | 
			
		||||
			});
 | 
			
		||||
		},
 | 
			
		||||
		/** 取消按钮 */
 | 
			
		||||
		cancel() {
 | 
			
		||||
			this.open = false;
 | 
			
		||||
			this.mode = null;
 | 
			
		||||
			this.reset();
 | 
			
		||||
		},
 | 
			
		||||
		/** 表单重置 */
 | 
			
		||||
		reset() {
 | 
			
		||||
			this.form = {
 | 
			
		||||
				id: null,
 | 
			
		||||
				repairOrderNumber: null,
 | 
			
		||||
				equipmentId: null,
 | 
			
		||||
				repairman: null,
 | 
			
		||||
				repairmanPhone: null,
 | 
			
		||||
				faultTime: null,
 | 
			
		||||
				faultLevel: null,
 | 
			
		||||
				maintenanceStartTime: null,
 | 
			
		||||
				maintenanceFinishTime: null,
 | 
			
		||||
				faultType: null,
 | 
			
		||||
				repairMode: null,
 | 
			
		||||
				maintenanceStatus: null,
 | 
			
		||||
				faultDetail: null,
 | 
			
		||||
				maintenanceDetail: null,
 | 
			
		||||
				remark: null,
 | 
			
		||||
				files: [
 | 
			
		||||
					// {
 | 
			
		||||
					// 	fileName: '',
 | 
			
		||||
					// 	fileType: '',
 | 
			
		||||
					// 	fileUrl: '',
 | 
			
		||||
					// },
 | 
			
		||||
				],
 | 
			
		||||
			};
 | 
			
		||||
			this.resetForm('form');
 | 
			
		||||
		},
 | 
			
		||||
		/** 搜索按钮操作 */
 | 
			
		||||
		handleQuery() {
 | 
			
		||||
			this.queryParams.pageNo = 1;
 | 
			
		||||
			this.getList();
 | 
			
		||||
		},
 | 
			
		||||
		/** 重置按钮操作 */
 | 
			
		||||
		resetQuery() {
 | 
			
		||||
			this.resetForm('queryForm');
 | 
			
		||||
			this.handleQuery();
 | 
			
		||||
		},
 | 
			
		||||
		/** 新增按钮操作 */
 | 
			
		||||
		handleAdd() {
 | 
			
		||||
			this.reset();
 | 
			
		||||
			this.open = true;
 | 
			
		||||
			this.title = '添加维修记录';
 | 
			
		||||
		},
 | 
			
		||||
		/** 修改按钮操作 */
 | 
			
		||||
		handleUpdate(row) {
 | 
			
		||||
			this.reset();
 | 
			
		||||
			const id = row.id;
 | 
			
		||||
			this.info({ id }).then((response) => {
 | 
			
		||||
				this.form = response.data;
 | 
			
		||||
				this.open = true;
 | 
			
		||||
				this.title = '修改维修记录';
 | 
			
		||||
			});
 | 
			
		||||
		},
 | 
			
		||||
		/** 提交按钮 */
 | 
			
		||||
		submitForm() {
 | 
			
		||||
			this.$refs['form'].validate((valid) => {
 | 
			
		||||
				if (!valid) {
 | 
			
		||||
					return;
 | 
			
		||||
				}
 | 
			
		||||
				// 修改的提交
 | 
			
		||||
				if (this.form.id != null) {
 | 
			
		||||
					this.put(this.form).then((response) => {
 | 
			
		||||
						this.$modal.msgSuccess('修改成功');
 | 
			
		||||
						this.open = false;
 | 
			
		||||
						this.getList();
 | 
			
		||||
					});
 | 
			
		||||
					return;
 | 
			
		||||
				}
 | 
			
		||||
				// 添加的提交
 | 
			
		||||
				this.post(this.form).then((response) => {
 | 
			
		||||
					this.$modal.msgSuccess('新增成功');
 | 
			
		||||
					this.open = false;
 | 
			
		||||
					this.getList();
 | 
			
		||||
				});
 | 
			
		||||
			});
 | 
			
		||||
		},
 | 
			
		||||
		/** 删除按钮操作 */
 | 
			
		||||
		handleDelete(row) {
 | 
			
		||||
			const id = row.id;
 | 
			
		||||
			this.$modal
 | 
			
		||||
				.confirm('是否确认删除记录"' + row.name + '"?')
 | 
			
		||||
				.then(function () {
 | 
			
		||||
					return this.delete({ id });
 | 
			
		||||
				})
 | 
			
		||||
				.then(() => {
 | 
			
		||||
					this.getList();
 | 
			
		||||
					this.$modal.msgSuccess('删除成功');
 | 
			
		||||
				})
 | 
			
		||||
				.catch(() => {});
 | 
			
		||||
		},
 | 
			
		||||
		handleDetail({ id }) {
 | 
			
		||||
			this.reset();
 | 
			
		||||
			this.mode = 'detail';
 | 
			
		||||
			this.info({ id }).then((response) => {
 | 
			
		||||
				this.form = response.data;
 | 
			
		||||
				this.open = true;
 | 
			
		||||
				this.title = '修改维修记录';
 | 
			
		||||
			});
 | 
			
		||||
		},
 | 
			
		||||
		/** 导出按钮操作 */
 | 
			
		||||
		handleExport() {
 | 
			
		||||
			// 处理查询参数
 | 
			
		||||
			let params = { ...this.queryParams };
 | 
			
		||||
			params.pageNo = undefined;
 | 
			
		||||
			params.pageSize = undefined;
 | 
			
		||||
			this.$modal
 | 
			
		||||
				.confirm('是否确认导出所有维修记录?')
 | 
			
		||||
				.then(() => {
 | 
			
		||||
					this.exportLoading = true;
 | 
			
		||||
					return exportEquipmentTypeExcel(params);
 | 
			
		||||
				})
 | 
			
		||||
				.then((response) => {
 | 
			
		||||
					this.$download.excel(response, '维修记录.xls');
 | 
			
		||||
					this.exportLoading = false;
 | 
			
		||||
				})
 | 
			
		||||
				.catch(() => {});
 | 
			
		||||
		},
 | 
			
		||||
	},
 | 
			
		||||
};
 | 
			
		||||
</script>
 | 
			
		||||
							
								
								
									
										317
									
								
								src/views/equipment/base/inspection/Settings/index.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										317
									
								
								src/views/equipment/base/inspection/Settings/index.vue
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,317 @@
 | 
			
		||||
<template>
 | 
			
		||||
	<div class="app-container">
 | 
			
		||||
		<!-- 搜索工作栏 -->
 | 
			
		||||
		<SearchBar
 | 
			
		||||
			:formConfigs="searchBarFormConfig"
 | 
			
		||||
			ref="search-bar"
 | 
			
		||||
			@headBtnClick="handleSearchBarBtnClick" />
 | 
			
		||||
 | 
			
		||||
		<!-- 列表 -->
 | 
			
		||||
		<base-table
 | 
			
		||||
			:table-props="tableProps"
 | 
			
		||||
			:page="queryParams.pageNo"
 | 
			
		||||
			:limit="queryParams.pageSize"
 | 
			
		||||
			:table-data="list"
 | 
			
		||||
			@emitFun="handleEmitFun">
 | 
			
		||||
			<method-btn
 | 
			
		||||
				v-if="tableBtn.length"
 | 
			
		||||
				slot="handleBtn"
 | 
			
		||||
				label="操作"
 | 
			
		||||
				:width="120"
 | 
			
		||||
				:method-list="tableBtn"
 | 
			
		||||
				@clickBtn="handleTableBtnClick" />
 | 
			
		||||
		</base-table>
 | 
			
		||||
 | 
			
		||||
		<!-- 分页组件 -->
 | 
			
		||||
		<pagination
 | 
			
		||||
			v-show="total > 0"
 | 
			
		||||
			:total="total"
 | 
			
		||||
			:page.sync="queryParams.pageNo"
 | 
			
		||||
			:limit.sync="queryParams.pageSize"
 | 
			
		||||
			@pagination="getList" />
 | 
			
		||||
 | 
			
		||||
		<!-- 对话框(添加 / 修改) -->
 | 
			
		||||
		<base-dialog
 | 
			
		||||
			:dialogTitle="title"
 | 
			
		||||
			:dialogVisible="open"
 | 
			
		||||
			@close="cancel"
 | 
			
		||||
			@cancel="cancel"
 | 
			
		||||
			@confirm="submitForm">
 | 
			
		||||
			<DialogForm
 | 
			
		||||
				v-if="open"
 | 
			
		||||
				ref="form"
 | 
			
		||||
				v-model="form"
 | 
			
		||||
				:disabled="mode == 'detail'"
 | 
			
		||||
				:has-files="false"
 | 
			
		||||
				:rows="rows" />
 | 
			
		||||
		</base-dialog>
 | 
			
		||||
	</div>
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script>
 | 
			
		||||
import moment from 'moment';
 | 
			
		||||
import basicPageMixin from '@/mixins/lb/basicPageMixin';
 | 
			
		||||
// import { publicFormatter } from '@/utils/dict';
 | 
			
		||||
// const timeFilter = (val) => moment(val).format('yyyy-MM-DD HH:mm:ss');
 | 
			
		||||
 | 
			
		||||
export default {
 | 
			
		||||
	name: 'EquipmentCheckSetting',
 | 
			
		||||
	components: {},
 | 
			
		||||
	mixins: [basicPageMixin],
 | 
			
		||||
	data() {
 | 
			
		||||
		return {
 | 
			
		||||
			searchBarKeys: ['equipmentId', 'name'],
 | 
			
		||||
			tableBtn: [
 | 
			
		||||
				// this.$auth.hasPermi('equipment:check-setting:update')
 | 
			
		||||
				// 	? {
 | 
			
		||||
				// 			type: 'detail',
 | 
			
		||||
				// 			btnName: '详情',
 | 
			
		||||
				// 	  }
 | 
			
		||||
				// 	: undefined,
 | 
			
		||||
				this.$auth.hasPermi('equipment:check-setting:update')
 | 
			
		||||
					? {
 | 
			
		||||
							type: 'edit',
 | 
			
		||||
							btnName: '修改',
 | 
			
		||||
					  }
 | 
			
		||||
					: undefined,
 | 
			
		||||
				this.$auth.hasPermi('equipment:check-setting:delete')
 | 
			
		||||
					? {
 | 
			
		||||
							type: 'delete',
 | 
			
		||||
							btnName: '删除',
 | 
			
		||||
					  }
 | 
			
		||||
					: undefined,
 | 
			
		||||
			].filter((v) => v),
 | 
			
		||||
			tableProps: [
 | 
			
		||||
				{ prop: 'name', label: '配置名' },
 | 
			
		||||
				{ prop: 'code', label: '编码' },
 | 
			
		||||
				{ prop: 'lineName', label: '产线' },
 | 
			
		||||
				{ prop: 'sectionName', label: '工段' },
 | 
			
		||||
				{ prop: 'equipmentName', label: '设备' },
 | 
			
		||||
				{ prop: 'responsible', label: '负责人' },
 | 
			
		||||
				{ prop: 'equipmentCode', label: '描述' },
 | 
			
		||||
				{ prop: 'checkNumber', label: '巡检条数' }, // TODO: 操作 选项,四个,群里询问
 | 
			
		||||
				{ prop: 'remark', label: '备注' },
 | 
			
		||||
			],
 | 
			
		||||
			searchBarFormConfig: [
 | 
			
		||||
				{
 | 
			
		||||
					type: 'input',
 | 
			
		||||
					label: '配置名称',
 | 
			
		||||
					placeholder: '请输入配置名称',
 | 
			
		||||
					param: 'name',
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					type: 'select',
 | 
			
		||||
					label: '设备名称',
 | 
			
		||||
					placeholder: '请选择设备',
 | 
			
		||||
					param: 'equipmentId',
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					type: 'button',
 | 
			
		||||
					btnName: '查询',
 | 
			
		||||
					name: 'search',
 | 
			
		||||
					color: 'primary',
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					type: 'separate',
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					type: this.$auth.hasPermi('equipment:check-setting:create')
 | 
			
		||||
						? 'button'
 | 
			
		||||
						: '',
 | 
			
		||||
					btnName: '新增',
 | 
			
		||||
					name: 'add',
 | 
			
		||||
					plain: true,
 | 
			
		||||
					color: 'success',
 | 
			
		||||
				},
 | 
			
		||||
				// {
 | 
			
		||||
				// 	type: this.$auth.hasPermi('equipment:check-setting:export')
 | 
			
		||||
				// 		? 'button'
 | 
			
		||||
				// 		: '',
 | 
			
		||||
				// 	btnName: '导出',
 | 
			
		||||
				// 	name: 'export',
 | 
			
		||||
				// 	color: 'warning',
 | 
			
		||||
				// },
 | 
			
		||||
			],
 | 
			
		||||
			rows: [
 | 
			
		||||
				[
 | 
			
		||||
					{
 | 
			
		||||
						input: true,
 | 
			
		||||
						label: '配置名称',
 | 
			
		||||
						prop: 'name',
 | 
			
		||||
						rules: [{ required: true, message: '不能为空', trigger: 'blur' }],
 | 
			
		||||
					},
 | 
			
		||||
					{
 | 
			
		||||
						input: true,
 | 
			
		||||
						label: '配置编码',
 | 
			
		||||
						prop: 'code',
 | 
			
		||||
						url: '/base/equipment-check-config/getCode',
 | 
			
		||||
						rules: [{ required: true, message: '不能为空', trigger: 'blur' }],
 | 
			
		||||
					},
 | 
			
		||||
				],
 | 
			
		||||
				[
 | 
			
		||||
					{
 | 
			
		||||
						select: true,
 | 
			
		||||
						label: '设备名称',
 | 
			
		||||
						prop: 'equipmentId',
 | 
			
		||||
						url: '/base/core-equipment/listAll',
 | 
			
		||||
						rules: [{ required: true, message: '不能为空', trigger: 'blur' }],
 | 
			
		||||
					},
 | 
			
		||||
					{
 | 
			
		||||
						input: true,
 | 
			
		||||
						label: '设备编码', // TODO: 和设备名称联动估计
 | 
			
		||||
						prop: 'equipmentCode',
 | 
			
		||||
					},
 | 
			
		||||
				],
 | 
			
		||||
			],
 | 
			
		||||
			// 是否显示弹出层
 | 
			
		||||
			open: false,
 | 
			
		||||
			// 查询参数
 | 
			
		||||
			queryParams: {
 | 
			
		||||
				pageNo: 1,
 | 
			
		||||
				pageSize: 10,
 | 
			
		||||
				equipmentId: null,
 | 
			
		||||
				name: null,
 | 
			
		||||
			},
 | 
			
		||||
			// 表单参数
 | 
			
		||||
			form: {},
 | 
			
		||||
			basePath: '/base/equipment-check-config',
 | 
			
		||||
			mode: null,
 | 
			
		||||
		};
 | 
			
		||||
	},
 | 
			
		||||
	created() {
 | 
			
		||||
		this.initSearchBar();
 | 
			
		||||
		this.getList();
 | 
			
		||||
	},
 | 
			
		||||
	methods: {
 | 
			
		||||
		initSearchBar() {
 | 
			
		||||
			this.http('/base/core-equipment/listAll', 'get').then(({ data }) => {
 | 
			
		||||
				this.$set(
 | 
			
		||||
					this.searchBarFormConfig[1],
 | 
			
		||||
					'selectOptions',
 | 
			
		||||
					data.map((item) => ({
 | 
			
		||||
						name: item.name,
 | 
			
		||||
						id: item.id,
 | 
			
		||||
					}))
 | 
			
		||||
				);
 | 
			
		||||
			});
 | 
			
		||||
		},
 | 
			
		||||
		/** 查询列表 */
 | 
			
		||||
		getList() {
 | 
			
		||||
			this.loading = true;
 | 
			
		||||
			// 执行查询
 | 
			
		||||
			this.recv(this.queryParams).then((response) => {
 | 
			
		||||
				this.list = response.data.list;
 | 
			
		||||
				this.total = response.data.total;
 | 
			
		||||
				this.loading = false;
 | 
			
		||||
			});
 | 
			
		||||
		},
 | 
			
		||||
		/** 取消按钮 */
 | 
			
		||||
		cancel() {
 | 
			
		||||
			this.open = false;
 | 
			
		||||
			this.mode = null;
 | 
			
		||||
			this.reset();
 | 
			
		||||
		},
 | 
			
		||||
		/** 表单重置 */
 | 
			
		||||
		reset() {
 | 
			
		||||
			this.form = {
 | 
			
		||||
				id: null,
 | 
			
		||||
				name: null,
 | 
			
		||||
				content: null,
 | 
			
		||||
				program: null,
 | 
			
		||||
				remark: null,
 | 
			
		||||
			};
 | 
			
		||||
			this.resetForm('form');
 | 
			
		||||
		},
 | 
			
		||||
		/** 搜索按钮操作 */
 | 
			
		||||
		handleQuery() {
 | 
			
		||||
			this.queryParams.pageNo = 1;
 | 
			
		||||
			this.getList();
 | 
			
		||||
		},
 | 
			
		||||
		/** 重置按钮操作 */
 | 
			
		||||
		resetQuery() {
 | 
			
		||||
			this.resetForm('queryForm');
 | 
			
		||||
			this.handleQuery();
 | 
			
		||||
		},
 | 
			
		||||
		/** 新增按钮操作 */
 | 
			
		||||
		handleAdd() {
 | 
			
		||||
			this.reset();
 | 
			
		||||
			this.open = true;
 | 
			
		||||
			this.title = '添加巡检设置';
 | 
			
		||||
		},
 | 
			
		||||
		/** 修改按钮操作 */
 | 
			
		||||
		handleUpdate(row) {
 | 
			
		||||
			this.reset();
 | 
			
		||||
			const id = row.id;
 | 
			
		||||
			this.info({ id }).then((response) => {
 | 
			
		||||
				this.form = response.data;
 | 
			
		||||
				this.open = true;
 | 
			
		||||
				this.title = '修改巡检设置';
 | 
			
		||||
			});
 | 
			
		||||
		},
 | 
			
		||||
		/** 提交按钮 */
 | 
			
		||||
		submitForm() {
 | 
			
		||||
			this.$refs['form'].validate((valid) => {
 | 
			
		||||
				if (!valid) {
 | 
			
		||||
					return;
 | 
			
		||||
				}
 | 
			
		||||
				// 修改的提交
 | 
			
		||||
				if (this.form.id != null) {
 | 
			
		||||
					this.put(this.form).then((response) => {
 | 
			
		||||
						this.$modal.msgSuccess('修改成功');
 | 
			
		||||
						this.open = false;
 | 
			
		||||
						this.getList();
 | 
			
		||||
					});
 | 
			
		||||
					return;
 | 
			
		||||
				}
 | 
			
		||||
				// 添加的提交
 | 
			
		||||
				this.post(this.form).then((response) => {
 | 
			
		||||
					this.$modal.msgSuccess('新增成功');
 | 
			
		||||
					this.open = false;
 | 
			
		||||
					this.getList();
 | 
			
		||||
				});
 | 
			
		||||
			});
 | 
			
		||||
		},
 | 
			
		||||
		/** 删除按钮操作 */
 | 
			
		||||
		handleDelete(row) {
 | 
			
		||||
			const id = row.id;
 | 
			
		||||
			this.$modal
 | 
			
		||||
				.confirm('是否确认删除记录"' + row.name + '"?')
 | 
			
		||||
				.then(function () {
 | 
			
		||||
					return this.delete({ id });
 | 
			
		||||
				})
 | 
			
		||||
				.then(() => {
 | 
			
		||||
					this.getList();
 | 
			
		||||
					this.$modal.msgSuccess('删除成功');
 | 
			
		||||
				})
 | 
			
		||||
				.catch(() => {});
 | 
			
		||||
		},
 | 
			
		||||
		handleDetail({ id }) {
 | 
			
		||||
			this.reset();
 | 
			
		||||
			this.mode = 'detail';
 | 
			
		||||
			this.info({ id }).then((response) => {
 | 
			
		||||
				this.form = response.data;
 | 
			
		||||
				this.open = true;
 | 
			
		||||
				this.title = '修改巡检设置';
 | 
			
		||||
			});
 | 
			
		||||
		},
 | 
			
		||||
		/** 导出按钮操作 */
 | 
			
		||||
		handleExport() {
 | 
			
		||||
			// 处理查询参数
 | 
			
		||||
			let params = { ...this.queryParams };
 | 
			
		||||
			params.pageNo = undefined;
 | 
			
		||||
			params.pageSize = undefined;
 | 
			
		||||
			this.$modal
 | 
			
		||||
				.confirm('是否确认导出所有巡检设置?')
 | 
			
		||||
				.then(() => {
 | 
			
		||||
					this.exportLoading = true;
 | 
			
		||||
					return exportEquipmentTypeExcel(params);
 | 
			
		||||
				})
 | 
			
		||||
				.then((response) => {
 | 
			
		||||
					this.$download.excel(response, '巡检设置.xls');
 | 
			
		||||
					this.exportLoading = false;
 | 
			
		||||
				})
 | 
			
		||||
				.catch(() => {});
 | 
			
		||||
		},
 | 
			
		||||
	},
 | 
			
		||||
};
 | 
			
		||||
</script>
 | 
			
		||||
							
								
								
									
										336
									
								
								src/views/equipment/base/maintain/Monitor/index.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										336
									
								
								src/views/equipment/base/maintain/Monitor/index.vue
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,336 @@
 | 
			
		||||
<template>
 | 
			
		||||
	<div class="app-container">
 | 
			
		||||
		<!-- 搜索工作栏 -->
 | 
			
		||||
		<SearchBar
 | 
			
		||||
			:formConfigs="searchBarFormConfig"
 | 
			
		||||
			ref="search-bar"
 | 
			
		||||
			@headBtnClick="handleSearchBarBtnClick" />
 | 
			
		||||
 | 
			
		||||
		<!-- 列表 -->
 | 
			
		||||
		<base-table
 | 
			
		||||
			:table-props="tableProps"
 | 
			
		||||
			:page="queryParams.pageNo"
 | 
			
		||||
			:limit="queryParams.pageSize"
 | 
			
		||||
			:table-data="list"
 | 
			
		||||
			@emitFun="handleEmitFun">
 | 
			
		||||
			<!-- <method-btn
 | 
			
		||||
				v-if="tableBtn.length"
 | 
			
		||||
				slot="handleBtn"
 | 
			
		||||
				label="操作"
 | 
			
		||||
				:width="120"
 | 
			
		||||
				:method-list="tableBtn"
 | 
			
		||||
				@clickBtn="handleTableBtnClick" /> -->
 | 
			
		||||
		</base-table>
 | 
			
		||||
 | 
			
		||||
		<!-- 分页组件 -->
 | 
			
		||||
		<pagination
 | 
			
		||||
			v-show="total > 0"
 | 
			
		||||
			:total="total"
 | 
			
		||||
			:page.sync="queryParams.pageNo"
 | 
			
		||||
			:limit.sync="queryParams.pageSize"
 | 
			
		||||
			@pagination="getList" />
 | 
			
		||||
 | 
			
		||||
		<!-- 对话框(添加 / 修改) -->
 | 
			
		||||
		<base-dialog
 | 
			
		||||
			:dialogTitle="title"
 | 
			
		||||
			:dialogVisible="open"
 | 
			
		||||
			@close="cancel"
 | 
			
		||||
			@cancel="cancel"
 | 
			
		||||
			@confirm="submitForm">
 | 
			
		||||
			<DialogForm
 | 
			
		||||
				v-if="open"
 | 
			
		||||
				ref="form"
 | 
			
		||||
				v-model="form"
 | 
			
		||||
				:has-files="false"
 | 
			
		||||
				:rows="rows" />
 | 
			
		||||
		</base-dialog>
 | 
			
		||||
	</div>
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script>
 | 
			
		||||
import { publicFormatter } from '@/utils/dict';
 | 
			
		||||
import moment from 'moment';
 | 
			
		||||
import basicPageMixin from '@/mixins/lb/basicPageMixin';
 | 
			
		||||
 | 
			
		||||
const remainBox = {
 | 
			
		||||
	name: 'RemainBox',
 | 
			
		||||
	props: ['injectData'],
 | 
			
		||||
	data() {
 | 
			
		||||
		return {};
 | 
			
		||||
	},
 | 
			
		||||
	computed: {
 | 
			
		||||
		value() {
 | 
			
		||||
			return this.injectData[this.injectData.prop] || null;
 | 
			
		||||
		},
 | 
			
		||||
		color() {
 | 
			
		||||
			if (this.value) {
 | 
			
		||||
				const v = +this.value;
 | 
			
		||||
				return v < 0 ? 'red' : v >= 0 && v < 2 ? 'yellow' : 'green';
 | 
			
		||||
			}
 | 
			
		||||
			return 'unset';
 | 
			
		||||
		},
 | 
			
		||||
	},
 | 
			
		||||
	render: function (h) {
 | 
			
		||||
		return (
 | 
			
		||||
			<div
 | 
			
		||||
				style={`background: ${
 | 
			
		||||
					this.color
 | 
			
		||||
				}; position:absolute; inset: 0; padding: 0 10px; display: flex; align-items: center; color: ${
 | 
			
		||||
					this.color == 'red' ? '#fff' : 'unset'
 | 
			
		||||
				}`}>
 | 
			
		||||
				{this.injectData[this.injectData.prop] || ''}
 | 
			
		||||
			</div>
 | 
			
		||||
		);
 | 
			
		||||
	},
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
const btn = {
 | 
			
		||||
	name: 'tableBtn',
 | 
			
		||||
	props: ['injectData'],
 | 
			
		||||
	data() {
 | 
			
		||||
		return {};
 | 
			
		||||
	},
 | 
			
		||||
	methods: {
 | 
			
		||||
		handleClick() {
 | 
			
		||||
			this.$emit('emitData', { action: this.injectData.label, value: null });
 | 
			
		||||
		},
 | 
			
		||||
	},
 | 
			
		||||
	render: function (h) {
 | 
			
		||||
		return (
 | 
			
		||||
			<el-button type="text" onClick={this.handleClick}>
 | 
			
		||||
				{this.injectData.label}
 | 
			
		||||
			</el-button>
 | 
			
		||||
		);
 | 
			
		||||
	},
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
export default {
 | 
			
		||||
	name: 'PlanConfig',
 | 
			
		||||
	components: {},
 | 
			
		||||
	mixins: [basicPageMixin],
 | 
			
		||||
	data() {
 | 
			
		||||
		return {
 | 
			
		||||
			searchBarKeys: ['planId', 'equipmentId'],
 | 
			
		||||
			tableProps: [
 | 
			
		||||
				{
 | 
			
		||||
					prop: 'createTime',
 | 
			
		||||
					label: '添加时间',
 | 
			
		||||
					fixed: true,
 | 
			
		||||
					width: 180,
 | 
			
		||||
					filter: (val) => moment(val).format('yyyy-MM-DD HH:mm:ss'),
 | 
			
		||||
				},
 | 
			
		||||
				{ prop: 'name', label: '保养计划' },
 | 
			
		||||
				{ prop: 'lineName', label: '产线' },
 | 
			
		||||
				{ prop: 'sectionName', label: '工段' },
 | 
			
		||||
				{ prop: 'equipmentName', label: '设备名称' },
 | 
			
		||||
				{ prop: 'equipmentCode', label: '设备编码' },
 | 
			
		||||
				{ prop: 'maintainDuration', label: '保养频率' },
 | 
			
		||||
				{
 | 
			
		||||
					prop: 'maintainType',
 | 
			
		||||
					label: '保养类型',
 | 
			
		||||
					filter: publicFormatter(this.DICT_TYPE.MAINTAIN_TYPE),
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					prop: 'lastMaintainTime',
 | 
			
		||||
					label: '上次保养时间',
 | 
			
		||||
					filter: (val) => moment(val).format('yyyy-MM-DD HH:mm:ss'),
 | 
			
		||||
				},
 | 
			
		||||
				{ prop: 'nextMaintainTime', label: '计划下次保养时间' },
 | 
			
		||||
				{
 | 
			
		||||
					prop: 'remainDays',
 | 
			
		||||
					label: '距离保养时间(天)',
 | 
			
		||||
					subcomponent: remainBox,
 | 
			
		||||
				},
 | 
			
		||||
				{ prop: 'opt1', label: '设备保养', subcomponent: btn },
 | 
			
		||||
				{ prop: 'opt2', label: '保养记录', subcomponent: btn },
 | 
			
		||||
			],
 | 
			
		||||
			searchBarFormConfig: [
 | 
			
		||||
				{
 | 
			
		||||
					type: 'select',
 | 
			
		||||
					label: '保养计划',
 | 
			
		||||
					placeholder: '请选择保养计划',
 | 
			
		||||
					param: 'planId',
 | 
			
		||||
					filterable: true,
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					type: 'select',
 | 
			
		||||
					label: '设备名',
 | 
			
		||||
					placeholder: '请选择设备',
 | 
			
		||||
					param: 'equipmentId',
 | 
			
		||||
					filterable: true,
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					type: 'button',
 | 
			
		||||
					btnName: '查询',
 | 
			
		||||
					name: 'search',
 | 
			
		||||
					color: 'primary',
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					type: 'separate',
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					type: this.$auth.hasPermi('base:quality-inspection-type:export')
 | 
			
		||||
						? 'button'
 | 
			
		||||
						: '',
 | 
			
		||||
					btnName: '导出',
 | 
			
		||||
					name: 'export',
 | 
			
		||||
					color: 'warning',
 | 
			
		||||
				},
 | 
			
		||||
			],
 | 
			
		||||
			// 是否显示弹出层
 | 
			
		||||
			open: false,
 | 
			
		||||
			// 查询参数
 | 
			
		||||
			queryParams: {
 | 
			
		||||
				pageNo: 1,
 | 
			
		||||
				pageSize: 10,
 | 
			
		||||
				equipmentName: null,
 | 
			
		||||
				createTime: null,
 | 
			
		||||
			},
 | 
			
		||||
			// 表单参数
 | 
			
		||||
			form: {},
 | 
			
		||||
		};
 | 
			
		||||
	},
 | 
			
		||||
	created() {
 | 
			
		||||
		this.initSearchBar();
 | 
			
		||||
		this.getList();
 | 
			
		||||
	},
 | 
			
		||||
	methods: {
 | 
			
		||||
		initSearchBar() {
 | 
			
		||||
			this.http('/base/core-equipment/listAll', 'get').then(({ data }) => {
 | 
			
		||||
				this.$set(
 | 
			
		||||
					this.searchBarFormConfig[1],
 | 
			
		||||
					'selectOptions',
 | 
			
		||||
					data.map((item) => ({
 | 
			
		||||
						name: item.name,
 | 
			
		||||
						id: item.id,
 | 
			
		||||
					}))
 | 
			
		||||
				);
 | 
			
		||||
			});
 | 
			
		||||
			this.http('/base/equipment-maintain-plan/page', 'get', {
 | 
			
		||||
				pageNo: 1,
 | 
			
		||||
				pageSize: 100,
 | 
			
		||||
			}).then(({ data }) => {
 | 
			
		||||
				this.$set(
 | 
			
		||||
					this.searchBarFormConfig[0],
 | 
			
		||||
					'selectOptions',
 | 
			
		||||
					(data?.list || []).map((item) => ({
 | 
			
		||||
						name: item.name,
 | 
			
		||||
						id: item.id,
 | 
			
		||||
					}))
 | 
			
		||||
				);
 | 
			
		||||
			});
 | 
			
		||||
		},
 | 
			
		||||
		handleEmitFun({action, value}) {
 | 
			
		||||
 			switch (action) {
 | 
			
		||||
				// 查看详情
 | 
			
		||||
				case '设备保养':
 | 
			
		||||
					alert('设备保养');
 | 
			
		||||
					break;
 | 
			
		||||
				case '保养记录':
 | 
			
		||||
					alert('保养记录');
 | 
			
		||||
					break;
 | 
			
		||||
			}
 | 
			
		||||
		},
 | 
			
		||||
		/** 查询列表 */
 | 
			
		||||
		getList() {
 | 
			
		||||
			this.loading = true;
 | 
			
		||||
			// 执行查询
 | 
			
		||||
			this.http(
 | 
			
		||||
				'/base/equipment-maintain-plan/monitor',
 | 
			
		||||
				'get',
 | 
			
		||||
				this.queryParams
 | 
			
		||||
			).then((response) => {
 | 
			
		||||
				this.list = response.data.list;
 | 
			
		||||
				this.total = response.data.total;
 | 
			
		||||
				this.loading = false;
 | 
			
		||||
			});
 | 
			
		||||
		},
 | 
			
		||||
		/** 取消按钮 */
 | 
			
		||||
		cancel() {
 | 
			
		||||
			this.open = false;
 | 
			
		||||
			this.reset();
 | 
			
		||||
		},
 | 
			
		||||
		/** 表单重置 */
 | 
			
		||||
		reset() {
 | 
			
		||||
			this.form = {
 | 
			
		||||
				code: null,
 | 
			
		||||
				name: null,
 | 
			
		||||
				equipmentId: null,
 | 
			
		||||
				enabled: null,
 | 
			
		||||
				maintenancePeriod: null,
 | 
			
		||||
				maintainDuration: null,
 | 
			
		||||
				maintainType: null,
 | 
			
		||||
				remark: null,
 | 
			
		||||
				enabled: 1,
 | 
			
		||||
			};
 | 
			
		||||
			this.resetForm('form');
 | 
			
		||||
		},
 | 
			
		||||
		/** 搜索按钮操作 */
 | 
			
		||||
		handleQuery() {
 | 
			
		||||
			this.queryParams.pageNo = 1;
 | 
			
		||||
			this.getList();
 | 
			
		||||
		},
 | 
			
		||||
		/** 重置按钮操作 */
 | 
			
		||||
		resetQuery() {
 | 
			
		||||
			this.resetForm('queryForm');
 | 
			
		||||
			this.handleQuery();
 | 
			
		||||
		},
 | 
			
		||||
		/** 新增按钮操作 */
 | 
			
		||||
		handleAdd() {
 | 
			
		||||
			this.reset();
 | 
			
		||||
			this.open = true;
 | 
			
		||||
			this.title = '添加保养计划';
 | 
			
		||||
		},
 | 
			
		||||
		handleDetail(id) {
 | 
			
		||||
			alert('跳转到 保养记录');
 | 
			
		||||
		},
 | 
			
		||||
		/** 修改按钮操作 */
 | 
			
		||||
		handleUpdate(row) {
 | 
			
		||||
			this.reset();
 | 
			
		||||
			const id = row.id;
 | 
			
		||||
			this.info({ id }).then((response) => {
 | 
			
		||||
				this.form = response.data;
 | 
			
		||||
				this.open = true;
 | 
			
		||||
				this.title = '修改保养计划';
 | 
			
		||||
			});
 | 
			
		||||
		},
 | 
			
		||||
		/** 提交按钮 */
 | 
			
		||||
		submitForm() {
 | 
			
		||||
			this.$refs['form'].validate((valid) => {
 | 
			
		||||
				if (!valid) {
 | 
			
		||||
					return;
 | 
			
		||||
				}
 | 
			
		||||
				// 修改的提交
 | 
			
		||||
				if (this.form.id != null) {
 | 
			
		||||
					this.put(this.form).then((response) => {
 | 
			
		||||
						this.$modal.msgSuccess('修改成功');
 | 
			
		||||
						this.open = false;
 | 
			
		||||
						this.getList();
 | 
			
		||||
					});
 | 
			
		||||
					return;
 | 
			
		||||
				}
 | 
			
		||||
				// 添加的提交
 | 
			
		||||
				this.post(this.form).then((response) => {
 | 
			
		||||
					this.$modal.msgSuccess('新增成功');
 | 
			
		||||
					this.open = false;
 | 
			
		||||
					this.getList();
 | 
			
		||||
				});
 | 
			
		||||
			});
 | 
			
		||||
		},
 | 
			
		||||
		/** 删除按钮操作 */
 | 
			
		||||
		handleDelete(row) {
 | 
			
		||||
			const id = row.id;
 | 
			
		||||
			this.$modal
 | 
			
		||||
				.confirm('是否确认删除设备类型"' + row.name + '"?')
 | 
			
		||||
				.then(function () {
 | 
			
		||||
					return this.del(id);
 | 
			
		||||
				})
 | 
			
		||||
				.then(() => {
 | 
			
		||||
					this.getList();
 | 
			
		||||
					this.$modal.msgSuccess('删除成功');
 | 
			
		||||
				})
 | 
			
		||||
				.catch(() => {});
 | 
			
		||||
		},
 | 
			
		||||
	},
 | 
			
		||||
};
 | 
			
		||||
</script>
 | 
			
		||||
							
								
								
									
										347
									
								
								src/views/equipment/base/maintain/PlanConfig/index.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										347
									
								
								src/views/equipment/base/maintain/PlanConfig/index.vue
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,347 @@
 | 
			
		||||
<template>
 | 
			
		||||
	<div class="app-container">
 | 
			
		||||
		<!-- 搜索工作栏 -->
 | 
			
		||||
		<SearchBar
 | 
			
		||||
			:formConfigs="searchBarFormConfig"
 | 
			
		||||
			ref="search-bar"
 | 
			
		||||
			@headBtnClick="handleSearchBarBtnClick" />
 | 
			
		||||
 | 
			
		||||
		<!-- 列表 -->
 | 
			
		||||
		<base-table
 | 
			
		||||
			:table-props="tableProps"
 | 
			
		||||
			:page="queryParams.pageNo"
 | 
			
		||||
			:limit="queryParams.pageSize"
 | 
			
		||||
			:table-data="list"
 | 
			
		||||
			@emitFun="handleEmitFun">
 | 
			
		||||
			<method-btn
 | 
			
		||||
				v-if="tableBtn.length"
 | 
			
		||||
				slot="handleBtn"
 | 
			
		||||
				label="操作"
 | 
			
		||||
				:width="120"
 | 
			
		||||
				:method-list="tableBtn"
 | 
			
		||||
				@clickBtn="handleTableBtnClick" />
 | 
			
		||||
		</base-table>
 | 
			
		||||
 | 
			
		||||
		<!-- 分页组件 -->
 | 
			
		||||
		<pagination
 | 
			
		||||
			v-show="total > 0"
 | 
			
		||||
			:total="total"
 | 
			
		||||
			:page.sync="queryParams.pageNo"
 | 
			
		||||
			:limit.sync="queryParams.pageSize"
 | 
			
		||||
			@pagination="getList" />
 | 
			
		||||
 | 
			
		||||
		<!-- 对话框(添加 / 修改) -->
 | 
			
		||||
		<base-dialog
 | 
			
		||||
			:dialogTitle="title"
 | 
			
		||||
			:dialogVisible="open"
 | 
			
		||||
			@close="cancel"
 | 
			
		||||
			@cancel="cancel"
 | 
			
		||||
			@confirm="submitForm">
 | 
			
		||||
			<DialogForm
 | 
			
		||||
				v-if="open"
 | 
			
		||||
				ref="form"
 | 
			
		||||
				v-model="form"
 | 
			
		||||
				:has-files="false"
 | 
			
		||||
				:rows="rows" />
 | 
			
		||||
		</base-dialog>
 | 
			
		||||
	</div>
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script>
 | 
			
		||||
import moment from 'moment';
 | 
			
		||||
import basicPageMixin from '@/mixins/lb/basicPageMixin';
 | 
			
		||||
 | 
			
		||||
export default {
 | 
			
		||||
	name: 'PlanConfig',
 | 
			
		||||
	components: {},
 | 
			
		||||
	mixins: [basicPageMixin],
 | 
			
		||||
	data() {
 | 
			
		||||
		const t = new Date();
 | 
			
		||||
		const [y, m, d] = [t.getFullYear(), t.getMonth(), t.getDate()];
 | 
			
		||||
		return {
 | 
			
		||||
			searchBarKeys: ['equipmentName', 'createTime'],
 | 
			
		||||
			tableBtn: [
 | 
			
		||||
				{
 | 
			
		||||
					type: 'detail',
 | 
			
		||||
					btnName: '保养记录',
 | 
			
		||||
				},
 | 
			
		||||
				this.$auth.hasPermi('equipment:plan-config:update')
 | 
			
		||||
					? {
 | 
			
		||||
							type: 'edit',
 | 
			
		||||
							btnName: '修改',
 | 
			
		||||
					  }
 | 
			
		||||
					: undefined,
 | 
			
		||||
				this.$auth.hasPermi('equipment:plan-config:delete')
 | 
			
		||||
					? {
 | 
			
		||||
							type: 'delete',
 | 
			
		||||
							btnName: '删除',
 | 
			
		||||
					  }
 | 
			
		||||
					: undefined,
 | 
			
		||||
			].filter((v) => v),
 | 
			
		||||
			tableProps: [
 | 
			
		||||
				{
 | 
			
		||||
					prop: 'createTime',
 | 
			
		||||
					label: '添加时间',
 | 
			
		||||
					fixed: true,
 | 
			
		||||
					width: 180,
 | 
			
		||||
					filter: (val) => moment(val).format('yyyy-MM-DD HH:mm:ss'),
 | 
			
		||||
				},
 | 
			
		||||
				{ prop: 'name', label: '计划名称' },
 | 
			
		||||
				{ prop: 'code', label: '计划编号' },
 | 
			
		||||
				{ prop: 'enabled', label: '启用状态' },
 | 
			
		||||
				{ prop: 'lineName', label: '产线' },
 | 
			
		||||
				{ prop: 'sectionName', label: '工段' },
 | 
			
		||||
				{ prop: 'equipmentName', label: '设备名称' },
 | 
			
		||||
				{ prop: 'maintainDuration', label: '计划保养用时(h)' },
 | 
			
		||||
				{ prop: 'maintenancePeriod', label: '保养频率(天/次)' },
 | 
			
		||||
				{ prop: 'maintainType', label: '保养类型' },
 | 
			
		||||
				{ prop: 'remark', label: '备注' },
 | 
			
		||||
			],
 | 
			
		||||
			searchBarFormConfig: [
 | 
			
		||||
				{
 | 
			
		||||
					type: 'input',
 | 
			
		||||
					label: '设备名',
 | 
			
		||||
					placeholder: '请输入设备名称',
 | 
			
		||||
					param: 'equipmentName',
 | 
			
		||||
				},
 | 
			
		||||
				// 时间段
 | 
			
		||||
				{
 | 
			
		||||
					type: 'datePicker',
 | 
			
		||||
					label: '时间段',
 | 
			
		||||
					dateType: 'daterange', // datetimerange
 | 
			
		||||
					format: 'yyyy-MM-dd',
 | 
			
		||||
					// valueFormat: 'yyyy-MM-dd HH:mm:ss',
 | 
			
		||||
					valueFormat: 'timestamp',
 | 
			
		||||
					rangeSeparator: '-',
 | 
			
		||||
					startPlaceholder: '开始日期',
 | 
			
		||||
					endPlaceholder: '结束日期',
 | 
			
		||||
					defaultTime: ['00:00:00', '23:59:59'],
 | 
			
		||||
					param: 'createTime',
 | 
			
		||||
					// defaultSelect: [
 | 
			
		||||
					// 	new Date(y, m, d)
 | 
			
		||||
					// 		.toLocaleString()
 | 
			
		||||
					// 		.split('/')
 | 
			
		||||
					// 		.map((item, index) => {
 | 
			
		||||
					// 			if (index == 1 || index == 2) return item.padStart(2, '0');
 | 
			
		||||
					// 			return item;
 | 
			
		||||
					// 		})
 | 
			
		||||
					// 		.join('-'),
 | 
			
		||||
					// 	new Date(y, m, d, 23, 59, 59)
 | 
			
		||||
					// 		.toLocaleString()
 | 
			
		||||
					// 		.split('/')
 | 
			
		||||
					// 		.map((item, index) => {
 | 
			
		||||
					// 			if (index == 1 || index == 2) return item.padStart(2, '0');
 | 
			
		||||
					// 			return item;
 | 
			
		||||
					// 		})
 | 
			
		||||
					// 		.join('-'),
 | 
			
		||||
					// ],
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					type: 'button',
 | 
			
		||||
					btnName: '查询',
 | 
			
		||||
					name: 'search',
 | 
			
		||||
					color: 'primary',
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					type: 'separate',
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					type: this.$auth.hasPermi('equipment:plan-config:create')
 | 
			
		||||
						? 'button'
 | 
			
		||||
						: '',
 | 
			
		||||
					btnName: '新增',
 | 
			
		||||
					name: 'add',
 | 
			
		||||
					plain: true,
 | 
			
		||||
					color: 'success',
 | 
			
		||||
				},
 | 
			
		||||
				// {
 | 
			
		||||
				// 	type: this.$auth.hasPermi('base:quality-inspection-type:export')
 | 
			
		||||
				// 		? 'button'
 | 
			
		||||
				// 		: '',
 | 
			
		||||
				// 	btnName: '导出',
 | 
			
		||||
				// 	name: 'export',
 | 
			
		||||
				// 	color: 'warning',
 | 
			
		||||
				// },
 | 
			
		||||
			],
 | 
			
		||||
			rows: [
 | 
			
		||||
				[
 | 
			
		||||
					{
 | 
			
		||||
						input: true,
 | 
			
		||||
						label: '计划名称',
 | 
			
		||||
						prop: 'name',
 | 
			
		||||
						rules: [{ required: true, message: '不能为空', trigger: 'blur' }],
 | 
			
		||||
					},
 | 
			
		||||
					{
 | 
			
		||||
						input: true,
 | 
			
		||||
						label: '计划编号',
 | 
			
		||||
						prop: 'code',
 | 
			
		||||
						url: '/base/equipment-maintain-plan/getCode',
 | 
			
		||||
						rules: [{ required: true, message: '不能为空', trigger: 'blur' }],
 | 
			
		||||
					},
 | 
			
		||||
				],
 | 
			
		||||
				[
 | 
			
		||||
					{
 | 
			
		||||
						select: true,
 | 
			
		||||
						label: '设备名称',
 | 
			
		||||
						prop: 'equipmentId',
 | 
			
		||||
						url: '/base/core-equipment/listAll',
 | 
			
		||||
						rules: [{ required: true, message: '不能为空', trigger: 'blur' }],
 | 
			
		||||
					},
 | 
			
		||||
					{
 | 
			
		||||
						select: true,
 | 
			
		||||
						label: '保养类型',
 | 
			
		||||
						prop: 'maintainType',
 | 
			
		||||
						options: this.getDictDatas(this.DICT_TYPE.MAINTAIN_TYPE),
 | 
			
		||||
					},
 | 
			
		||||
				],
 | 
			
		||||
				[
 | 
			
		||||
					{
 | 
			
		||||
						input: true,
 | 
			
		||||
						label: '保养时长(h)',
 | 
			
		||||
						prop: 'maintainDuration',
 | 
			
		||||
						rules: [
 | 
			
		||||
							{
 | 
			
		||||
								type: 'number',
 | 
			
		||||
								trigger: 'blur',
 | 
			
		||||
								message: '请输入正确的数字',
 | 
			
		||||
								transform: (val) => Number(val),
 | 
			
		||||
							},
 | 
			
		||||
						],
 | 
			
		||||
					},
 | 
			
		||||
					{
 | 
			
		||||
						input: true,
 | 
			
		||||
						label: '保养频率(天/次)',
 | 
			
		||||
						prop: 'maintenancePeriod',
 | 
			
		||||
						rules: [
 | 
			
		||||
							{
 | 
			
		||||
								type: 'number',
 | 
			
		||||
								trigger: 'blur',
 | 
			
		||||
								message: '请输入正确的数字',
 | 
			
		||||
								transform: (val) => Number(val),
 | 
			
		||||
							},
 | 
			
		||||
						],
 | 
			
		||||
					},
 | 
			
		||||
				],
 | 
			
		||||
				[{ input: true, label: '备注', prop: 'remark' }],
 | 
			
		||||
			],
 | 
			
		||||
			// 是否显示弹出层
 | 
			
		||||
			open: false,
 | 
			
		||||
			// 查询参数
 | 
			
		||||
			queryParams: {
 | 
			
		||||
				pageNo: 1,
 | 
			
		||||
				pageSize: 10,
 | 
			
		||||
				equipmentName: null,
 | 
			
		||||
				createTime: null,
 | 
			
		||||
			},
 | 
			
		||||
			// 表单参数
 | 
			
		||||
			form: {},
 | 
			
		||||
			basePath: '/base/equipment-maintain-plan',
 | 
			
		||||
		};
 | 
			
		||||
	},
 | 
			
		||||
	created() {
 | 
			
		||||
		this.getList();
 | 
			
		||||
	},
 | 
			
		||||
	methods: {
 | 
			
		||||
		/** 查询列表 */
 | 
			
		||||
		getList() {
 | 
			
		||||
			this.loading = true;
 | 
			
		||||
			// 执行查询
 | 
			
		||||
			this.recv(this.queryParams).then((response) => {
 | 
			
		||||
				this.list = response.data.list;
 | 
			
		||||
				this.total = response.data.total;
 | 
			
		||||
				this.loading = false;
 | 
			
		||||
			});
 | 
			
		||||
		},
 | 
			
		||||
		/** 取消按钮 */
 | 
			
		||||
		cancel() {
 | 
			
		||||
			this.open = false;
 | 
			
		||||
			this.reset();
 | 
			
		||||
		},
 | 
			
		||||
		/** 表单重置 */
 | 
			
		||||
		reset() {
 | 
			
		||||
			this.form = {
 | 
			
		||||
				code: null,
 | 
			
		||||
				name: null,
 | 
			
		||||
				equipmentId: null,
 | 
			
		||||
				enabled: null,
 | 
			
		||||
				maintenancePeriod: null,
 | 
			
		||||
				maintainDuration: null,
 | 
			
		||||
				maintainType: null,
 | 
			
		||||
				remark: null,
 | 
			
		||||
                enabled: 1
 | 
			
		||||
			};
 | 
			
		||||
			this.resetForm('form');
 | 
			
		||||
		},
 | 
			
		||||
		/** 搜索按钮操作 */
 | 
			
		||||
		handleQuery() {
 | 
			
		||||
			this.queryParams.pageNo = 1;
 | 
			
		||||
			this.getList();
 | 
			
		||||
		},
 | 
			
		||||
		/** 重置按钮操作 */
 | 
			
		||||
		resetQuery() {
 | 
			
		||||
			this.resetForm('queryForm');
 | 
			
		||||
			this.handleQuery();
 | 
			
		||||
		},
 | 
			
		||||
		/** 新增按钮操作 */
 | 
			
		||||
		handleAdd() {
 | 
			
		||||
			this.reset();
 | 
			
		||||
			this.open = true;
 | 
			
		||||
			this.title = '添加保养计划';
 | 
			
		||||
		},
 | 
			
		||||
		handleDetail(id){
 | 
			
		||||
				// alert('跳转到 保养记录')
 | 
			
		||||
				this.$router.push({
 | 
			
		||||
					name: 'Record',
 | 
			
		||||
					// params: { startTime: this.chooseObj.startTime, endTime: this.chooseObj.endTime }
 | 
			
		||||
				})
 | 
			
		||||
		},
 | 
			
		||||
		/** 修改按钮操作 */
 | 
			
		||||
		handleUpdate(row) {
 | 
			
		||||
			this.reset();
 | 
			
		||||
			const id = row.id;
 | 
			
		||||
			this.info({ id }).then((response) => {
 | 
			
		||||
				this.form = response.data;
 | 
			
		||||
				this.open = true;
 | 
			
		||||
				this.title = '修改保养计划';
 | 
			
		||||
			});
 | 
			
		||||
		},
 | 
			
		||||
		/** 提交按钮 */
 | 
			
		||||
		submitForm() {
 | 
			
		||||
			this.$refs['form'].validate((valid) => {
 | 
			
		||||
				if (!valid) {
 | 
			
		||||
					return;
 | 
			
		||||
				}
 | 
			
		||||
				// 修改的提交
 | 
			
		||||
				if (this.form.id != null) {
 | 
			
		||||
					this.put(this.form).then((response) => {
 | 
			
		||||
						this.$modal.msgSuccess('修改成功');
 | 
			
		||||
						this.open = false;
 | 
			
		||||
						this.getList();
 | 
			
		||||
					});
 | 
			
		||||
					return;
 | 
			
		||||
				}
 | 
			
		||||
				// 添加的提交
 | 
			
		||||
				this.post(this.form).then((response) => {
 | 
			
		||||
					this.$modal.msgSuccess('新增成功');
 | 
			
		||||
					this.open = false;
 | 
			
		||||
					this.getList();
 | 
			
		||||
				});
 | 
			
		||||
			});
 | 
			
		||||
		},
 | 
			
		||||
		/** 删除按钮操作 */
 | 
			
		||||
		handleDelete(row) {
 | 
			
		||||
			const id = row.id;
 | 
			
		||||
			this.$modal
 | 
			
		||||
				.confirm('是否确认删除设备类型"' + row.name + '"?')
 | 
			
		||||
				.then(function () {
 | 
			
		||||
					return this.del(id);
 | 
			
		||||
				})
 | 
			
		||||
				.then(() => {
 | 
			
		||||
					this.getList();
 | 
			
		||||
					this.$modal.msgSuccess('删除成功');
 | 
			
		||||
				})
 | 
			
		||||
				.catch(() => {});
 | 
			
		||||
		},
 | 
			
		||||
	},
 | 
			
		||||
};
 | 
			
		||||
</script>
 | 
			
		||||
							
								
								
									
										452
									
								
								src/views/equipment/base/maintain/Record/index.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										452
									
								
								src/views/equipment/base/maintain/Record/index.vue
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,452 @@
 | 
			
		||||
<template>
 | 
			
		||||
	<div class="app-container">
 | 
			
		||||
		<!-- 搜索工作栏 -->
 | 
			
		||||
		<SearchBar
 | 
			
		||||
			:formConfigs="searchBarFormConfig"
 | 
			
		||||
			ref="search-bar"
 | 
			
		||||
			@headBtnClick="handleSearchBarBtnClick" />
 | 
			
		||||
 | 
			
		||||
		<!-- 列表 -->
 | 
			
		||||
		<base-table
 | 
			
		||||
			:table-props="tableProps"
 | 
			
		||||
			:page="queryParams.pageNo"
 | 
			
		||||
			:limit="queryParams.pageSize"
 | 
			
		||||
			:table-data="list"
 | 
			
		||||
			@emitFun="handleEmitFun">
 | 
			
		||||
			<method-btn
 | 
			
		||||
				v-if="tableBtn.length"
 | 
			
		||||
				slot="handleBtn"
 | 
			
		||||
				label="操作"
 | 
			
		||||
				:width="120"
 | 
			
		||||
				:method-list="tableBtn"
 | 
			
		||||
				@clickBtn="handleTableBtnClick" />
 | 
			
		||||
		</base-table>
 | 
			
		||||
 | 
			
		||||
		<!-- 分页组件 -->
 | 
			
		||||
		<pagination
 | 
			
		||||
			v-show="total > 0"
 | 
			
		||||
			:total="total"
 | 
			
		||||
			:page.sync="queryParams.pageNo"
 | 
			
		||||
			:limit.sync="queryParams.pageSize"
 | 
			
		||||
			@pagination="getList" />
 | 
			
		||||
 | 
			
		||||
		<!-- 对话框(添加 / 修改) -->
 | 
			
		||||
		<base-dialog
 | 
			
		||||
			:dialogTitle="title"
 | 
			
		||||
			:dialogVisible="open"
 | 
			
		||||
			width="60%"
 | 
			
		||||
			@close="cancel"
 | 
			
		||||
			@cancel="cancel"
 | 
			
		||||
			@confirm="submitForm">
 | 
			
		||||
			<DialogForm
 | 
			
		||||
				v-if="open"
 | 
			
		||||
				ref="form"
 | 
			
		||||
				v-model="form"
 | 
			
		||||
                :disabled="mode == 'detail'"
 | 
			
		||||
				:has-files="true"
 | 
			
		||||
				:rows="rows" />
 | 
			
		||||
		</base-dialog>
 | 
			
		||||
	</div>
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script>
 | 
			
		||||
import moment from 'moment';
 | 
			
		||||
import basicPageMixin from '@/mixins/lb/basicPageMixin';
 | 
			
		||||
 | 
			
		||||
const timeFilter = (val) => moment(val).format('yyyy-MM-DD HH:mm:ss');
 | 
			
		||||
 | 
			
		||||
export default {
 | 
			
		||||
	name: 'EquipmentMaintainRecord',
 | 
			
		||||
	components: {},
 | 
			
		||||
	mixins: [basicPageMixin],
 | 
			
		||||
	data() {
 | 
			
		||||
		return {
 | 
			
		||||
			searchBarKeys: [
 | 
			
		||||
				'maintainPlanId',
 | 
			
		||||
				'maintainPlanId',
 | 
			
		||||
				'startTime',
 | 
			
		||||
				'relatePlan',
 | 
			
		||||
				'equipmentId',
 | 
			
		||||
			],
 | 
			
		||||
			tableBtn: [
 | 
			
		||||
				this.$auth.hasPermi('equipment:maintain-record:update')
 | 
			
		||||
					? {
 | 
			
		||||
							type: 'detail',
 | 
			
		||||
							btnName: '详情',
 | 
			
		||||
					  }
 | 
			
		||||
					: undefined,
 | 
			
		||||
				this.$auth.hasPermi('equipment:maintain-record:update')
 | 
			
		||||
					? {
 | 
			
		||||
							type: 'edit',
 | 
			
		||||
							btnName: '修改',
 | 
			
		||||
					  }
 | 
			
		||||
					: undefined,
 | 
			
		||||
				this.$auth.hasPermi('equipment:maintain-record:delete')
 | 
			
		||||
					? {
 | 
			
		||||
							type: 'delete',
 | 
			
		||||
							btnName: '删除',
 | 
			
		||||
					  }
 | 
			
		||||
					: undefined,
 | 
			
		||||
			].filter((v) => v),
 | 
			
		||||
			tableProps: [
 | 
			
		||||
				{
 | 
			
		||||
					prop: 'createTime',
 | 
			
		||||
					label: '添加时间',
 | 
			
		||||
					fixed: true,
 | 
			
		||||
					width: 180,
 | 
			
		||||
					filter: timeFilter,
 | 
			
		||||
				},
 | 
			
		||||
				{ prop: 'maintainOrderNumber', label: '设备保养单号' },
 | 
			
		||||
				{ prop: 'startTime', label: '开始时间', filter: timeFilter },
 | 
			
		||||
				{ prop: 'endTime', label: '结束时间', filter: timeFilter },
 | 
			
		||||
				{ prop: 'equipmentName', label: '设备名称' },
 | 
			
		||||
				{ prop: 'maintainWorker', label: '保养人员' },
 | 
			
		||||
				{
 | 
			
		||||
					prop: 'relatePlan',
 | 
			
		||||
					label: '是否计划保养',
 | 
			
		||||
					filter: (v) => (v != null ? ['', '是', '否'][v] : ''),
 | 
			
		||||
				},
 | 
			
		||||
				{ prop: 'planName', label: '保养计划名称' },
 | 
			
		||||
				{ prop: 'maintainDuration', label: '计划保养用时(h)' },
 | 
			
		||||
				{ prop: 'timeUsed', label: '实际保养用时(h)' },
 | 
			
		||||
				{ prop: 'remark', label: '备注' },
 | 
			
		||||
			],
 | 
			
		||||
			searchBarFormConfig: [
 | 
			
		||||
				{
 | 
			
		||||
					type: 'select',
 | 
			
		||||
					label: '设备',
 | 
			
		||||
					placeholder: '请选择设备',
 | 
			
		||||
					param: 'equipmentId',
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					type: 'select',
 | 
			
		||||
					label: '保养计划',
 | 
			
		||||
					placeholder: '请选择保养计划',
 | 
			
		||||
					param: 'maintainPlanId',
 | 
			
		||||
				},
 | 
			
		||||
				// 开始结束时间
 | 
			
		||||
				{
 | 
			
		||||
					type: 'datePicker',
 | 
			
		||||
					label: '时间段',
 | 
			
		||||
					dateType: 'daterange', // datetimerange
 | 
			
		||||
					format: 'yyyy-MM-dd',
 | 
			
		||||
					valueFormat: 'timestamp',
 | 
			
		||||
					rangeSeparator: '-',
 | 
			
		||||
					startPlaceholder: '开始日期',
 | 
			
		||||
					endPlaceholder: '结束日期',
 | 
			
		||||
					defaultTime: ['00:00:00', '23:59:59'],
 | 
			
		||||
					param: 'startTime',
 | 
			
		||||
					// width: 350,
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					type: 'select',
 | 
			
		||||
					label: '是否计划保养',
 | 
			
		||||
					selectOptions: [
 | 
			
		||||
						{ name: '是', id: 1 },
 | 
			
		||||
						{ name: '否', id: 2 },
 | 
			
		||||
					],
 | 
			
		||||
					param: 'relatePlan',
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					type: 'button',
 | 
			
		||||
					btnName: '查询',
 | 
			
		||||
					name: 'search',
 | 
			
		||||
					color: 'primary',
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					type: 'separate',
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					type: this.$auth.hasPermi('equipment:maintain-record:create')
 | 
			
		||||
						? 'button'
 | 
			
		||||
						: '',
 | 
			
		||||
					btnName: '新增',
 | 
			
		||||
					name: 'add',
 | 
			
		||||
					plain: true,
 | 
			
		||||
					color: 'success',
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					type: this.$auth.hasPermi('equipment:maintain-record:export')
 | 
			
		||||
						? 'button'
 | 
			
		||||
						: '',
 | 
			
		||||
					btnName: '导出',
 | 
			
		||||
					name: 'export',
 | 
			
		||||
					color: 'warning',
 | 
			
		||||
				},
 | 
			
		||||
			],
 | 
			
		||||
			rows: [
 | 
			
		||||
				[
 | 
			
		||||
					{
 | 
			
		||||
						select: true,
 | 
			
		||||
						label: '保养设备',
 | 
			
		||||
						prop: 'equipmentId',
 | 
			
		||||
						url: '/base/core-equipment/listAll',
 | 
			
		||||
						bind: {
 | 
			
		||||
							filterable: true,
 | 
			
		||||
							clearable: true,
 | 
			
		||||
						},
 | 
			
		||||
						rules: [{ required: true, message: '不能为空', trigger: 'blur' }],
 | 
			
		||||
					},
 | 
			
		||||
					{
 | 
			
		||||
						// TODO: 和班组联动
 | 
			
		||||
						select: true,
 | 
			
		||||
						label: '保养人员',
 | 
			
		||||
						prop: 'maintainWorker',
 | 
			
		||||
						// url: '/base/core-equipment/listAll',
 | 
			
		||||
						bind: {
 | 
			
		||||
							filterable: true,
 | 
			
		||||
							clearable: true,
 | 
			
		||||
							multiple: true,
 | 
			
		||||
						},
 | 
			
		||||
						selectOptions: [{ name: 'test', id: 'test' }],
 | 
			
		||||
						rules: [{ required: true, message: '不能为空', trigger: 'blur' }],
 | 
			
		||||
					},
 | 
			
		||||
					{
 | 
			
		||||
						input: true,
 | 
			
		||||
						label: '保养单号',
 | 
			
		||||
						prop: 'maintainOrderNumber',
 | 
			
		||||
					},
 | 
			
		||||
				],
 | 
			
		||||
				[
 | 
			
		||||
					{
 | 
			
		||||
						switch: true,
 | 
			
		||||
						label: '是否计划保养',
 | 
			
		||||
						prop: 'relatePlan',
 | 
			
		||||
					},
 | 
			
		||||
					{},
 | 
			
		||||
					{
 | 
			
		||||
						// TODO: 和计划联动
 | 
			
		||||
						select: true,
 | 
			
		||||
						label: '所属计划',
 | 
			
		||||
						prop: 'maintainPlanId',
 | 
			
		||||
						url: '',
 | 
			
		||||
						bind: {
 | 
			
		||||
							filterable: true,
 | 
			
		||||
							clearable: true,
 | 
			
		||||
						},
 | 
			
		||||
					},
 | 
			
		||||
				],
 | 
			
		||||
				[
 | 
			
		||||
					{
 | 
			
		||||
						datetime: true,
 | 
			
		||||
						label: '开始时间',
 | 
			
		||||
						prop: 'startTime',
 | 
			
		||||
						rules: [{ required: true, message: '不能为空', trigger: 'blur' }],
 | 
			
		||||
						bind: {
 | 
			
		||||
							format: 'yyyy-MM-dd HH:mm:ss',
 | 
			
		||||
							'value-format': 'timestamp',
 | 
			
		||||
							// 'value-format': 'yyyy-MM-dd HH:mm:ss',
 | 
			
		||||
							clearable: true,
 | 
			
		||||
						},
 | 
			
		||||
					},
 | 
			
		||||
					{
 | 
			
		||||
						datetime: true,
 | 
			
		||||
						label: '结束时间',
 | 
			
		||||
						prop: 'endTime',
 | 
			
		||||
						rules: [{ required: true, message: '不能为空', trigger: 'blur' }],
 | 
			
		||||
						bind: {
 | 
			
		||||
							format: 'yyyy-MM-dd HH:mm:ss',
 | 
			
		||||
							'value-format': 'timestamp',
 | 
			
		||||
							// 'value-format': 'yyyy-MM-dd HH:mm:ss',
 | 
			
		||||
							clearable: true,
 | 
			
		||||
						},
 | 
			
		||||
					},
 | 
			
		||||
					{
 | 
			
		||||
						input: true,
 | 
			
		||||
						label: '保养用时',
 | 
			
		||||
						prop: 'timeUsed',
 | 
			
		||||
					},
 | 
			
		||||
				],
 | 
			
		||||
 | 
			
		||||
				[
 | 
			
		||||
					{
 | 
			
		||||
						upload: true,
 | 
			
		||||
						label: '上传资料',
 | 
			
		||||
						prop: 'files',
 | 
			
		||||
					},
 | 
			
		||||
				],
 | 
			
		||||
				// TODO: 富文本
 | 
			
		||||
				[{ input: true, label: '保养描述', prop: 'maintenanceDes' }],
 | 
			
		||||
				[{ input: true, label: '备注', prop: 'remark' }],
 | 
			
		||||
			],
 | 
			
		||||
			// 是否显示弹出层
 | 
			
		||||
			open: false,
 | 
			
		||||
			// 查询参数
 | 
			
		||||
			queryParams: {
 | 
			
		||||
				pageNo: 1,
 | 
			
		||||
				pageSize: 10,
 | 
			
		||||
				maintainPlanId: null,
 | 
			
		||||
				maintainPlanId: null,
 | 
			
		||||
				startTime: null,
 | 
			
		||||
				relatePlan: null,
 | 
			
		||||
				equipmentId: null,
 | 
			
		||||
			},
 | 
			
		||||
			// 表单参数
 | 
			
		||||
			form: {},
 | 
			
		||||
			basePath: '/base/equipment-maintain-log',
 | 
			
		||||
            mode: null
 | 
			
		||||
		};
 | 
			
		||||
	},
 | 
			
		||||
	created() {
 | 
			
		||||
		this.initSearchBar();
 | 
			
		||||
		this.getList();
 | 
			
		||||
	},
 | 
			
		||||
	methods: {
 | 
			
		||||
		initSearchBar() {
 | 
			
		||||
			this.http('/base/core-equipment/listAll', 'get').then(({ data }) => {
 | 
			
		||||
				this.$set(
 | 
			
		||||
					this.searchBarFormConfig[0],
 | 
			
		||||
					'selectOptions',
 | 
			
		||||
					data.map((item) => ({
 | 
			
		||||
						name: item.name,
 | 
			
		||||
						id: item.id,
 | 
			
		||||
					}))
 | 
			
		||||
				);
 | 
			
		||||
			});
 | 
			
		||||
			this.http('/base/equipment-maintain-plan/page', 'get', {
 | 
			
		||||
				pageNo: 1,
 | 
			
		||||
				pageSize: 100,
 | 
			
		||||
			}).then(({ data }) => {
 | 
			
		||||
				this.$set(
 | 
			
		||||
					this.searchBarFormConfig[1],
 | 
			
		||||
					'selectOptions',
 | 
			
		||||
					(data?.list || []).map((item) => ({
 | 
			
		||||
						name: item.name,
 | 
			
		||||
						id: item.id,
 | 
			
		||||
					}))
 | 
			
		||||
				);
 | 
			
		||||
			});
 | 
			
		||||
		},
 | 
			
		||||
		/** 查询列表 */
 | 
			
		||||
		getList() {
 | 
			
		||||
			this.loading = true;
 | 
			
		||||
			// 执行查询
 | 
			
		||||
			this.recv(this.queryParams).then((response) => {
 | 
			
		||||
				this.list = response.data.list;
 | 
			
		||||
				this.total = response.data.total;
 | 
			
		||||
				this.loading = false;
 | 
			
		||||
			});
 | 
			
		||||
		},
 | 
			
		||||
		/** 取消按钮 */
 | 
			
		||||
		cancel() {
 | 
			
		||||
			this.open = false;
 | 
			
		||||
            this.mode = null;
 | 
			
		||||
			this.reset();
 | 
			
		||||
		},
 | 
			
		||||
		/** 表单重置 */
 | 
			
		||||
		reset() {
 | 
			
		||||
			this.form = {
 | 
			
		||||
				id: null,
 | 
			
		||||
				relatePlan: null,
 | 
			
		||||
				maintainPlanId: null,
 | 
			
		||||
				equipmentId: null,
 | 
			
		||||
				maintainWorker: null,
 | 
			
		||||
				maintainOrderNumber: null,
 | 
			
		||||
				startTime: null,
 | 
			
		||||
				endTime: null,
 | 
			
		||||
				timeUsed: null,
 | 
			
		||||
				remark: null,
 | 
			
		||||
				maintenanceDes: null,
 | 
			
		||||
				files: [
 | 
			
		||||
					// {
 | 
			
		||||
					// 	fileName: '',
 | 
			
		||||
					// 	fileType: '',
 | 
			
		||||
					// 	fileUrl: '',
 | 
			
		||||
					// },
 | 
			
		||||
				],
 | 
			
		||||
			};
 | 
			
		||||
			this.resetForm('form');
 | 
			
		||||
		},
 | 
			
		||||
		/** 搜索按钮操作 */
 | 
			
		||||
		handleQuery() {
 | 
			
		||||
			this.queryParams.pageNo = 1;
 | 
			
		||||
			this.getList();
 | 
			
		||||
		},
 | 
			
		||||
		/** 重置按钮操作 */
 | 
			
		||||
		resetQuery() {
 | 
			
		||||
			this.resetForm('queryForm');
 | 
			
		||||
			this.handleQuery();
 | 
			
		||||
		},
 | 
			
		||||
		/** 新增按钮操作 */
 | 
			
		||||
		handleAdd() {
 | 
			
		||||
			this.reset();
 | 
			
		||||
			this.open = true;
 | 
			
		||||
			this.title = '添加保养记录';
 | 
			
		||||
		},
 | 
			
		||||
		/** 修改按钮操作 */
 | 
			
		||||
		handleUpdate(row) {
 | 
			
		||||
			this.reset();
 | 
			
		||||
			const id = row.id;
 | 
			
		||||
			this.info({ id }).then((response) => {
 | 
			
		||||
				this.form = response.data;
 | 
			
		||||
				this.open = true;
 | 
			
		||||
				this.title = '修改保养记录';
 | 
			
		||||
			});
 | 
			
		||||
		},
 | 
			
		||||
		/** 提交按钮 */
 | 
			
		||||
		submitForm() {
 | 
			
		||||
			this.$refs['form'].validate((valid) => {
 | 
			
		||||
				if (!valid) {
 | 
			
		||||
					return;
 | 
			
		||||
				}
 | 
			
		||||
				// 修改的提交
 | 
			
		||||
				if (this.form.id != null) {
 | 
			
		||||
					this.put(this.form).then((response) => {
 | 
			
		||||
						this.$modal.msgSuccess('修改成功');
 | 
			
		||||
						this.open = false;
 | 
			
		||||
						this.getList();
 | 
			
		||||
					});
 | 
			
		||||
					return;
 | 
			
		||||
				}
 | 
			
		||||
				// 添加的提交
 | 
			
		||||
				this.post(this.form).then((response) => {
 | 
			
		||||
					this.$modal.msgSuccess('新增成功');
 | 
			
		||||
					this.open = false;
 | 
			
		||||
					this.getList();
 | 
			
		||||
				});
 | 
			
		||||
			});
 | 
			
		||||
		},
 | 
			
		||||
		/** 删除按钮操作 */
 | 
			
		||||
		handleDelete(row) {
 | 
			
		||||
			const id = row.id;
 | 
			
		||||
			this.$modal
 | 
			
		||||
				.confirm('是否确认删除记录"' + row.name + '"?')
 | 
			
		||||
				.then(function () {
 | 
			
		||||
					return this.delete({ id });
 | 
			
		||||
				})
 | 
			
		||||
				.then(() => {
 | 
			
		||||
					this.getList();
 | 
			
		||||
					this.$modal.msgSuccess('删除成功');
 | 
			
		||||
				})
 | 
			
		||||
				.catch(() => {});
 | 
			
		||||
		},
 | 
			
		||||
		handleDetail({ id }) {
 | 
			
		||||
			this.reset();
 | 
			
		||||
            this.mode = 'detail'
 | 
			
		||||
			this.info({ id }).then((response) => {
 | 
			
		||||
				this.form = response.data;
 | 
			
		||||
				this.open = true;
 | 
			
		||||
				this.title = '修改保养记录';
 | 
			
		||||
			});
 | 
			
		||||
		},
 | 
			
		||||
		/** 导出按钮操作 */
 | 
			
		||||
		handleExport() {
 | 
			
		||||
			// 处理查询参数
 | 
			
		||||
			let params = { ...this.queryParams };
 | 
			
		||||
			params.pageNo = undefined;
 | 
			
		||||
			params.pageSize = undefined;
 | 
			
		||||
			this.$modal
 | 
			
		||||
				.confirm('是否确认导出所有保养记录?')
 | 
			
		||||
				.then(() => {
 | 
			
		||||
					this.exportLoading = true;
 | 
			
		||||
					return exportEquipmentTypeExcel(params);
 | 
			
		||||
				})
 | 
			
		||||
				.then((response) => {
 | 
			
		||||
					this.$download.excel(response, '保养记录.xls');
 | 
			
		||||
					this.exportLoading = false;
 | 
			
		||||
				})
 | 
			
		||||
				.catch(() => {});
 | 
			
		||||
		},
 | 
			
		||||
	},
 | 
			
		||||
};
 | 
			
		||||
</script>
 | 
			
		||||
							
								
								
									
										216
									
								
								src/views/equipment/base/repair/CustomDialogForm.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										216
									
								
								src/views/equipment/base/repair/CustomDialogForm.vue
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,216 @@
 | 
			
		||||
<!-- 
 | 
			
		||||
    filename: dialogForm.vue
 | 
			
		||||
    author: liubin
 | 
			
		||||
    date: 2023-10-31 15:55:13
 | 
			
		||||
    description: 
 | 
			
		||||
-->
 | 
			
		||||
 | 
			
		||||
<template>
 | 
			
		||||
	<el-form
 | 
			
		||||
		ref="form"
 | 
			
		||||
		:model="dataForm"
 | 
			
		||||
		label-width="100px"
 | 
			
		||||
		v-loading="formLoading">
 | 
			
		||||
		<el-row :gutter="20">
 | 
			
		||||
			<el-col :span="8">
 | 
			
		||||
				<el-form-item label="维修单号" prop="code">
 | 
			
		||||
					<span>{{ dataForm.code }}</span>
 | 
			
		||||
				</el-form-item>
 | 
			
		||||
			</el-col>
 | 
			
		||||
			<el-col :span="8">
 | 
			
		||||
				<el-form-item label="设备名称" prop="code">
 | 
			
		||||
					<span>{{ dataForm.code }}</span>
 | 
			
		||||
				</el-form-item>
 | 
			
		||||
			</el-col>
 | 
			
		||||
			<el-col :span="8">
 | 
			
		||||
				<el-form-item label="维修工" prop="code">
 | 
			
		||||
					<span>{{ dataForm.code }}</span>
 | 
			
		||||
				</el-form-item>
 | 
			
		||||
			</el-col>
 | 
			
		||||
		</el-row>
 | 
			
		||||
		<el-row :gutter="20">
 | 
			
		||||
			<el-col :span="8">
 | 
			
		||||
				<el-form-item label="故障发生时间" prop="code">
 | 
			
		||||
					<span>{{ dataForm.code }}</span>
 | 
			
		||||
				</el-form-item>
 | 
			
		||||
			</el-col>
 | 
			
		||||
			<el-col :span="8">
 | 
			
		||||
				<el-form-item label="故障级别" prop="code">
 | 
			
		||||
					<span>{{ dataForm.code }}</span>
 | 
			
		||||
				</el-form-item>
 | 
			
		||||
			</el-col>
 | 
			
		||||
			<el-col :span="8">
 | 
			
		||||
				<el-form-item label="联系方式" prop="code">
 | 
			
		||||
					<span>{{ dataForm.code }}</span>
 | 
			
		||||
				</el-form-item>
 | 
			
		||||
			</el-col>
 | 
			
		||||
		</el-row>
 | 
			
		||||
		<el-row :gutter="20">
 | 
			
		||||
			<el-col :span="8">
 | 
			
		||||
				<el-form-item
 | 
			
		||||
					label="维修开始时间"
 | 
			
		||||
					prop="alarmCode"
 | 
			
		||||
					:rules="[{ required: true, message: '不能为空', trigger: 'blur' }]">
 | 
			
		||||
					<el-date-picker
 | 
			
		||||
						v-model="dataForm.startTIme"
 | 
			
		||||
						type="datetime"
 | 
			
		||||
						:disabled="disabled"
 | 
			
		||||
						:placeholder="请选择维修开始时间"
 | 
			
		||||
						value-format="timestamp"
 | 
			
		||||
						@change="$emit('update', form)"></el-date-picker>
 | 
			
		||||
				</el-form-item>
 | 
			
		||||
			</el-col>
 | 
			
		||||
 | 
			
		||||
			<el-col :span="8">
 | 
			
		||||
				<el-form-item
 | 
			
		||||
					label="维修结束时间"
 | 
			
		||||
					prop="alarmCode"
 | 
			
		||||
					:rules="[{ required: true, message: '不能为空', trigger: 'blur' }]">
 | 
			
		||||
					<el-date-picker
 | 
			
		||||
						v-model="dataForm.startTIme"
 | 
			
		||||
						type="datetime"
 | 
			
		||||
						:disabled="disabled"
 | 
			
		||||
						:placeholder="请选择维修开始时间"
 | 
			
		||||
						value-format="timestamp"
 | 
			
		||||
						@change="$emit('update', form)"></el-date-picker>
 | 
			
		||||
				</el-form-item>
 | 
			
		||||
			</el-col>
 | 
			
		||||
 | 
			
		||||
			<el-col :span="8">
 | 
			
		||||
				<el-form-item
 | 
			
		||||
					label="维修方式"
 | 
			
		||||
					prop="grade"
 | 
			
		||||
					:rules="[{ required: true, message: '不能为空', trigger: 'blur' }]">
 | 
			
		||||
					<el-select
 | 
			
		||||
						:disabled="disabled"
 | 
			
		||||
						v-model="dataForm.grade"
 | 
			
		||||
						placeholder="请选择报警级别"
 | 
			
		||||
						@change="$emit('update', dataForm)">
 | 
			
		||||
						<el-option
 | 
			
		||||
							v-for="opt in getDictDatas(DICT_TYPE.EQU_ALARM_LEVEL)"
 | 
			
		||||
							:key="opt.value"
 | 
			
		||||
							:label="opt.label"
 | 
			
		||||
							:value="opt.value" />
 | 
			
		||||
					</el-select>
 | 
			
		||||
				</el-form-item>
 | 
			
		||||
			</el-col>
 | 
			
		||||
		</el-row>
 | 
			
		||||
		<el-row :gutter="20">
 | 
			
		||||
			<el-col :span="8">
 | 
			
		||||
				<el-form-item label="故障类型" prop="alarmCode">
 | 
			
		||||
					<el-select
 | 
			
		||||
						:disabled="disabled"
 | 
			
		||||
						v-model="dataForm.grade"
 | 
			
		||||
						placeholder="请选择报警级别"
 | 
			
		||||
						@change="$emit('update', dataForm)">
 | 
			
		||||
						<el-option
 | 
			
		||||
							v-for="opt in getDictDatas(DICT_TYPE.EQU_ALARM_LEVEL)"
 | 
			
		||||
							:key="opt.value"
 | 
			
		||||
							:label="opt.label"
 | 
			
		||||
							:value="opt.value" />
 | 
			
		||||
					</el-select>
 | 
			
		||||
				</el-form-item>
 | 
			
		||||
			</el-col>
 | 
			
		||||
		</el-row>
 | 
			
		||||
 | 
			
		||||
		<el-row :gutter="20">
 | 
			
		||||
			<el-col>
 | 
			
		||||
				<el-form-item
 | 
			
		||||
					label="故障明细"
 | 
			
		||||
					prop="dsfsdfasd"
 | 
			
		||||
					:rules="[{ required: true, message: '不能为空', trigger: 'blur' }]">
 | 
			
		||||
					<!-- // 富文本 -->
 | 
			
		||||
				</el-form-item>
 | 
			
		||||
			</el-col>
 | 
			
		||||
		</el-row>
 | 
			
		||||
 | 
			
		||||
		<el-row :gutter="20">
 | 
			
		||||
			<el-col>
 | 
			
		||||
				<el-form-item label="维修记录" prop="dsfsdfasd">
 | 
			
		||||
					<!-- // 富文本 -->
 | 
			
		||||
				</el-form-item>
 | 
			
		||||
			</el-col>
 | 
			
		||||
		</el-row>
 | 
			
		||||
 | 
			
		||||
		<el-row :gutter="20">
 | 
			
		||||
			<el-col>
 | 
			
		||||
				<el-form-item label="维修附件" prop="dsfsdfasd">
 | 
			
		||||
					<el-upload></el-upload>
 | 
			
		||||
				</el-form-item>
 | 
			
		||||
			</el-col>
 | 
			
		||||
		</el-row>
 | 
			
		||||
 | 
			
		||||
		<el-row :gutter="20">
 | 
			
		||||
			<el-col>
 | 
			
		||||
				<el-form-item label="备注" prop="remark">
 | 
			
		||||
					<el-input
 | 
			
		||||
						v-model="dataForm.remark"
 | 
			
		||||
						@change="$emit('update', form)"
 | 
			
		||||
						:placeholder="`请输入备注`"
 | 
			
		||||
						:disabled="disabled" />
 | 
			
		||||
				</el-form-item>
 | 
			
		||||
			</el-col>
 | 
			
		||||
		</el-row>
 | 
			
		||||
	</el-form>
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script>
 | 
			
		||||
export default {
 | 
			
		||||
	name: 'DialogForm',
 | 
			
		||||
	model: {
 | 
			
		||||
		prop: 'dataForm',
 | 
			
		||||
		event: 'update',
 | 
			
		||||
	},
 | 
			
		||||
	emits: ['update'],
 | 
			
		||||
	components: {},
 | 
			
		||||
	props: {
 | 
			
		||||
		dataForm: {
 | 
			
		||||
			type: Object,
 | 
			
		||||
			default: () => ({}),
 | 
			
		||||
		},
 | 
			
		||||
		disabled: {
 | 
			
		||||
			type: Boolean,
 | 
			
		||||
			default: false,
 | 
			
		||||
		},
 | 
			
		||||
	},
 | 
			
		||||
	data() {
 | 
			
		||||
		return {
 | 
			
		||||
			formLoading: true,
 | 
			
		||||
		};
 | 
			
		||||
	},
 | 
			
		||||
	mounted() {
 | 
			
		||||
		this.getCode('/base/equipment-group-alarm/getCode').then((code) => {
 | 
			
		||||
			this.formLoading = false;
 | 
			
		||||
			this.$emit('update', {
 | 
			
		||||
				...this.dataForm,
 | 
			
		||||
				code,
 | 
			
		||||
			});
 | 
			
		||||
		});
 | 
			
		||||
	},
 | 
			
		||||
	methods: {
 | 
			
		||||
		/** 模拟透传 ref  */
 | 
			
		||||
		validate(cb) {
 | 
			
		||||
			return this.$refs.form.validate(cb);
 | 
			
		||||
		},
 | 
			
		||||
		resetFields(args) {
 | 
			
		||||
			return this.$refs.form.resetFields(args);
 | 
			
		||||
		},
 | 
			
		||||
		async handleTypeChange(id) {
 | 
			
		||||
			// debugger;
 | 
			
		||||
			this.dataForm.alarmCode = '';
 | 
			
		||||
			this.$emit('update', this.dataForm);
 | 
			
		||||
		},
 | 
			
		||||
		async getCode(url) {
 | 
			
		||||
			const response = await this.$axios(url);
 | 
			
		||||
			return response.data;
 | 
			
		||||
		},
 | 
			
		||||
	},
 | 
			
		||||
};
 | 
			
		||||
</script>
 | 
			
		||||
 | 
			
		||||
<style scoped lang="scss">
 | 
			
		||||
.el-date-editor,
 | 
			
		||||
.el-select {
 | 
			
		||||
	width: 100%;
 | 
			
		||||
}
 | 
			
		||||
</style>
 | 
			
		||||
							
								
								
									
										383
									
								
								src/views/equipment/base/repair/index.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										383
									
								
								src/views/equipment/base/repair/index.vue
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,383 @@
 | 
			
		||||
<template>
 | 
			
		||||
	<div class="app-container">
 | 
			
		||||
		<!-- 搜索工作栏 -->
 | 
			
		||||
		<SearchBar
 | 
			
		||||
			:formConfigs="searchBarFormConfig"
 | 
			
		||||
			ref="search-bar"
 | 
			
		||||
			@headBtnClick="handleSearchBarBtnClick" />
 | 
			
		||||
 | 
			
		||||
		<!-- 列表 -->
 | 
			
		||||
		<base-table
 | 
			
		||||
			:table-props="tableProps"
 | 
			
		||||
			:page="queryParams.pageNo"
 | 
			
		||||
			:limit="queryParams.pageSize"
 | 
			
		||||
			:table-data="list"
 | 
			
		||||
			@emitFun="handleEmitFun">
 | 
			
		||||
			<method-btn
 | 
			
		||||
				v-if="tableBtn.length"
 | 
			
		||||
				slot="handleBtn"
 | 
			
		||||
				label="操作"
 | 
			
		||||
				:width="120"
 | 
			
		||||
				:method-list="tableBtn"
 | 
			
		||||
				@clickBtn="handleTableBtnClick" />
 | 
			
		||||
		</base-table>
 | 
			
		||||
 | 
			
		||||
		<!-- 分页组件 -->
 | 
			
		||||
		<pagination
 | 
			
		||||
			v-show="total > 0"
 | 
			
		||||
			:total="total"
 | 
			
		||||
			:page.sync="queryParams.pageNo"
 | 
			
		||||
			:limit.sync="queryParams.pageSize"
 | 
			
		||||
			@pagination="getList" />
 | 
			
		||||
 | 
			
		||||
		<!-- 对话框(添加 / 修改) -->
 | 
			
		||||
		<base-dialog
 | 
			
		||||
			:dialogTitle="title"
 | 
			
		||||
			:dialogVisible="open"
 | 
			
		||||
			@close="cancel"
 | 
			
		||||
			@cancel="cancel"
 | 
			
		||||
			@confirm="submitForm">
 | 
			
		||||
			<DialogForm
 | 
			
		||||
				v-if="open"
 | 
			
		||||
				ref="form"
 | 
			
		||||
				v-model="form"
 | 
			
		||||
				:disabled="mode == 'detail'"
 | 
			
		||||
				:has-files="true"
 | 
			
		||||
				:rows="rows" />
 | 
			
		||||
		</base-dialog>
 | 
			
		||||
	</div>
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script>
 | 
			
		||||
import moment from 'moment';
 | 
			
		||||
import basicPageMixin from '@/mixins/lb/basicPageMixin';
 | 
			
		||||
 | 
			
		||||
const timeFilter = (val) => moment(val).format('yyyy-MM-DD HH:mm:ss');
 | 
			
		||||
 | 
			
		||||
export default {
 | 
			
		||||
	name: 'EquipmentRepair',
 | 
			
		||||
	components: {},
 | 
			
		||||
	mixins: [basicPageMixin],
 | 
			
		||||
	data() {
 | 
			
		||||
		return {
 | 
			
		||||
			searchBarKeys: ['maintenanceStatus', 'createTime', 'equipmentId'],
 | 
			
		||||
			tableBtn: [
 | 
			
		||||
				this.$auth.hasPermi('equipment:repair:update')
 | 
			
		||||
					? {
 | 
			
		||||
							type: 'detail',
 | 
			
		||||
							btnName: '详情',
 | 
			
		||||
					  }
 | 
			
		||||
					: undefined,
 | 
			
		||||
				this.$auth.hasPermi('equipment:repair:update')
 | 
			
		||||
					? {
 | 
			
		||||
							type: 'edit',
 | 
			
		||||
							btnName: '修改',
 | 
			
		||||
					  }
 | 
			
		||||
					: undefined,
 | 
			
		||||
				this.$auth.hasPermi('equipment:repair:delete')
 | 
			
		||||
					? {
 | 
			
		||||
							type: 'delete',
 | 
			
		||||
							btnName: '删除',
 | 
			
		||||
					  }
 | 
			
		||||
					: undefined,
 | 
			
		||||
			].filter((v) => v),
 | 
			
		||||
			tableProps: [
 | 
			
		||||
				{
 | 
			
		||||
					prop: 'createTime',
 | 
			
		||||
					label: '添加时间',
 | 
			
		||||
					fixed: true,
 | 
			
		||||
					width: 180,
 | 
			
		||||
					filter: timeFilter,
 | 
			
		||||
				},
 | 
			
		||||
				{ prop: 'repairOrderNumber', label: '设备维修单号' },
 | 
			
		||||
				{ prop: 'maintenanceStartTime', label: '开始时间', filter: timeFilter },
 | 
			
		||||
				{
 | 
			
		||||
					prop: 'maintenanceFinishTime',
 | 
			
		||||
					label: '结束时间',
 | 
			
		||||
					filter: timeFilter,
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					prop: 'maintenanceStatus',
 | 
			
		||||
					label: '维修状态',
 | 
			
		||||
					filter: (v) => (v != null ? ['未完成', '完成'][v] : ''),
 | 
			
		||||
				},
 | 
			
		||||
				{ prop: 'maintenanceDuration', label: '维修时长(h)' },
 | 
			
		||||
				{ prop: 'lineName', label: '产线' },
 | 
			
		||||
				{ prop: 'sectionName', label: '工段' },
 | 
			
		||||
				{ prop: 'equipmentName', label: '设备名称' },
 | 
			
		||||
				{ prop: 'maintenanceDetail', label: '维修明细' },
 | 
			
		||||
				{ prop: 'repairman', label: '维修工' },
 | 
			
		||||
				{ prop: 'repairmanPhone', label: '联系方式' },
 | 
			
		||||
				{ prop: 'remark', label: '备注' },
 | 
			
		||||
			],
 | 
			
		||||
			searchBarFormConfig: [
 | 
			
		||||
				{
 | 
			
		||||
					type: 'select',
 | 
			
		||||
					label: '设备',
 | 
			
		||||
					placeholder: '请选择设备',
 | 
			
		||||
					param: 'equipmentId',
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					type: 'select',
 | 
			
		||||
					label: '状态',
 | 
			
		||||
					placeholder: '请选择状态',
 | 
			
		||||
					param: 'maintenanceStatus',
 | 
			
		||||
					selectOptions: [
 | 
			
		||||
						{ name: '未完成', id: '0' },
 | 
			
		||||
						{ name: '完成', id: '1' },
 | 
			
		||||
					],
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					type: 'button',
 | 
			
		||||
					btnName: '查询',
 | 
			
		||||
					name: 'search',
 | 
			
		||||
					color: 'primary',
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					type: 'separate',
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					type: this.$auth.hasPermi('equipment:repair:create') ? 'button' : '',
 | 
			
		||||
					btnName: '新增',
 | 
			
		||||
					name: 'add',
 | 
			
		||||
					plain: true,
 | 
			
		||||
					color: 'success',
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					type: this.$auth.hasPermi('equipment:repair:export') ? 'button' : '',
 | 
			
		||||
					btnName: '导出',
 | 
			
		||||
					name: 'export',
 | 
			
		||||
					color: 'warning',
 | 
			
		||||
				},
 | 
			
		||||
			],
 | 
			
		||||
			rows: [
 | 
			
		||||
				[
 | 
			
		||||
					{
 | 
			
		||||
						input: true,
 | 
			
		||||
						label: '维修单号',
 | 
			
		||||
						prop: 'repairOrderNumber',
 | 
			
		||||
					},
 | 
			
		||||
					{
 | 
			
		||||
						select: true,
 | 
			
		||||
						label: '设备名称',
 | 
			
		||||
						prop: 'equipmentId',
 | 
			
		||||
						url: '/base/core-equipment/listAll',
 | 
			
		||||
						bind: {
 | 
			
		||||
							filterable: true,
 | 
			
		||||
							clearable: true,
 | 
			
		||||
						},
 | 
			
		||||
						rules: [{ required: true, message: '不能为空', trigger: 'blur' }],
 | 
			
		||||
					},
 | 
			
		||||
				],
 | 
			
		||||
				[
 | 
			
		||||
					{
 | 
			
		||||
						// TODO: 和班组联动
 | 
			
		||||
						select: true,
 | 
			
		||||
						label: '维修工',
 | 
			
		||||
						prop: 'repairman',
 | 
			
		||||
						// url: '/base/core-equipment/listAll',
 | 
			
		||||
						bind: {
 | 
			
		||||
							filterable: true,
 | 
			
		||||
							clearable: true,
 | 
			
		||||
							multiple: true,
 | 
			
		||||
						},
 | 
			
		||||
						options: [{ label: 'test', value: 'test' }],
 | 
			
		||||
						rules: [{ required: true, message: '不能为空', trigger: 'blur' }],
 | 
			
		||||
					},
 | 
			
		||||
					{
 | 
			
		||||
						input: true,
 | 
			
		||||
						label: '联系方式',
 | 
			
		||||
						prop: 'repairmanPhone',
 | 
			
		||||
					},
 | 
			
		||||
				],
 | 
			
		||||
				[
 | 
			
		||||
					{
 | 
			
		||||
						datetime: true,
 | 
			
		||||
						label: '故障发生时间',
 | 
			
		||||
						prop: 'faultTime',
 | 
			
		||||
						rules: [{ required: true, message: '不能为空', trigger: 'blur' }],
 | 
			
		||||
						bind: {
 | 
			
		||||
							format: 'yyyy-MM-dd HH:mm:ss',
 | 
			
		||||
							'value-format': 'timestamp',
 | 
			
		||||
							// 'value-format': 'yyyy-MM-dd HH:mm:ss',
 | 
			
		||||
							clearable: true,
 | 
			
		||||
						},
 | 
			
		||||
					},
 | 
			
		||||
					{
 | 
			
		||||
						select: true,
 | 
			
		||||
						label: '故障级别',
 | 
			
		||||
						prop: 'faultLevel', // 数据字典
 | 
			
		||||
						options: this.getDictDatas(this.DICT_TYPE.FAULT_LEVEL),
 | 
			
		||||
					},
 | 
			
		||||
				],
 | 
			
		||||
			],
 | 
			
		||||
			// 是否显示弹出层
 | 
			
		||||
			open: false,
 | 
			
		||||
			// 查询参数
 | 
			
		||||
			queryParams: {
 | 
			
		||||
				pageNo: 1,
 | 
			
		||||
				pageSize: 10,
 | 
			
		||||
				maintenanceStatus: null,
 | 
			
		||||
				createTime: null,
 | 
			
		||||
				equipmentId: null,
 | 
			
		||||
			},
 | 
			
		||||
			// 表单参数
 | 
			
		||||
			form: {},
 | 
			
		||||
			basePath: '/base/equipment-repair-log',
 | 
			
		||||
			mode: null,
 | 
			
		||||
		};
 | 
			
		||||
	},
 | 
			
		||||
	created() {
 | 
			
		||||
		this.initSearchBar();
 | 
			
		||||
		this.getList();
 | 
			
		||||
	},
 | 
			
		||||
	methods: {
 | 
			
		||||
		initSearchBar() {
 | 
			
		||||
			this.http('/base/core-equipment/listAll', 'get').then(({ data }) => {
 | 
			
		||||
				this.$set(
 | 
			
		||||
					this.searchBarFormConfig[0],
 | 
			
		||||
					'selectOptions',
 | 
			
		||||
					data.map((item) => ({
 | 
			
		||||
						name: item.name,
 | 
			
		||||
						id: item.id,
 | 
			
		||||
					}))
 | 
			
		||||
				);
 | 
			
		||||
			});
 | 
			
		||||
		},
 | 
			
		||||
		/** 查询列表 */
 | 
			
		||||
		getList() {
 | 
			
		||||
			this.loading = true;
 | 
			
		||||
			// 执行查询
 | 
			
		||||
			this.recv(this.queryParams).then((response) => {
 | 
			
		||||
				this.list = response.data.list;
 | 
			
		||||
				this.total = response.data.total;
 | 
			
		||||
				this.loading = false;
 | 
			
		||||
			});
 | 
			
		||||
		},
 | 
			
		||||
		/** 取消按钮 */
 | 
			
		||||
		cancel() {
 | 
			
		||||
			this.open = false;
 | 
			
		||||
			this.mode = null;
 | 
			
		||||
			this.reset();
 | 
			
		||||
		},
 | 
			
		||||
		/** 表单重置 */
 | 
			
		||||
		reset() {
 | 
			
		||||
			this.form = {
 | 
			
		||||
				id: null,
 | 
			
		||||
				repairOrderNumber: null,
 | 
			
		||||
				equipmentId: null,
 | 
			
		||||
				repairman: null,
 | 
			
		||||
				repairmanPhone: null,
 | 
			
		||||
				faultTime: null,
 | 
			
		||||
				faultLevel: null,
 | 
			
		||||
				maintenanceStartTime: null,
 | 
			
		||||
				maintenanceFinishTime: null,
 | 
			
		||||
				faultType: null,
 | 
			
		||||
				repairMode: null,
 | 
			
		||||
				maintenanceStatus: null,
 | 
			
		||||
				faultDetail: null,
 | 
			
		||||
				maintenanceDetail: null,
 | 
			
		||||
				remark: null,
 | 
			
		||||
				files: [
 | 
			
		||||
					// {
 | 
			
		||||
					// 	fileName: '',
 | 
			
		||||
					// 	fileType: '',
 | 
			
		||||
					// 	fileUrl: '',
 | 
			
		||||
					// },
 | 
			
		||||
				],
 | 
			
		||||
			};
 | 
			
		||||
			this.resetForm('form');
 | 
			
		||||
		},
 | 
			
		||||
		/** 搜索按钮操作 */
 | 
			
		||||
		handleQuery() {
 | 
			
		||||
			this.queryParams.pageNo = 1;
 | 
			
		||||
			this.getList();
 | 
			
		||||
		},
 | 
			
		||||
		/** 重置按钮操作 */
 | 
			
		||||
		resetQuery() {
 | 
			
		||||
			this.resetForm('queryForm');
 | 
			
		||||
			this.handleQuery();
 | 
			
		||||
		},
 | 
			
		||||
		/** 新增按钮操作 */
 | 
			
		||||
		handleAdd() {
 | 
			
		||||
			this.reset();
 | 
			
		||||
			this.open = true;
 | 
			
		||||
			this.title = '添加维修记录';
 | 
			
		||||
		},
 | 
			
		||||
		/** 修改按钮操作 */
 | 
			
		||||
		handleUpdate(row) {
 | 
			
		||||
			this.reset();
 | 
			
		||||
			const id = row.id;
 | 
			
		||||
			this.info({ id }).then((response) => {
 | 
			
		||||
				this.form = response.data;
 | 
			
		||||
				this.open = true;
 | 
			
		||||
				this.title = '修改维修记录';
 | 
			
		||||
			});
 | 
			
		||||
		},
 | 
			
		||||
		/** 提交按钮 */
 | 
			
		||||
		submitForm() {
 | 
			
		||||
			this.$refs['form'].validate((valid) => {
 | 
			
		||||
				if (!valid) {
 | 
			
		||||
					return;
 | 
			
		||||
				}
 | 
			
		||||
				// 修改的提交
 | 
			
		||||
				if (this.form.id != null) {
 | 
			
		||||
					this.put(this.form).then((response) => {
 | 
			
		||||
						this.$modal.msgSuccess('修改成功');
 | 
			
		||||
						this.open = false;
 | 
			
		||||
						this.getList();
 | 
			
		||||
					});
 | 
			
		||||
					return;
 | 
			
		||||
				}
 | 
			
		||||
				// 添加的提交
 | 
			
		||||
				this.post(this.form).then((response) => {
 | 
			
		||||
					this.$modal.msgSuccess('新增成功');
 | 
			
		||||
					this.open = false;
 | 
			
		||||
					this.getList();
 | 
			
		||||
				});
 | 
			
		||||
			});
 | 
			
		||||
		},
 | 
			
		||||
		/** 删除按钮操作 */
 | 
			
		||||
		handleDelete(row) {
 | 
			
		||||
			const id = row.id;
 | 
			
		||||
			this.$modal
 | 
			
		||||
				.confirm('是否确认删除记录"' + row.name + '"?')
 | 
			
		||||
				.then(function () {
 | 
			
		||||
					return this.delete({ id });
 | 
			
		||||
				})
 | 
			
		||||
				.then(() => {
 | 
			
		||||
					this.getList();
 | 
			
		||||
					this.$modal.msgSuccess('删除成功');
 | 
			
		||||
				})
 | 
			
		||||
				.catch(() => {});
 | 
			
		||||
		},
 | 
			
		||||
		handleDetail({ id }) {
 | 
			
		||||
			this.reset();
 | 
			
		||||
			this.mode = 'detail';
 | 
			
		||||
			this.info({ id }).then((response) => {
 | 
			
		||||
				this.form = response.data;
 | 
			
		||||
				this.open = true;
 | 
			
		||||
				this.title = '修改维修记录';
 | 
			
		||||
			});
 | 
			
		||||
		},
 | 
			
		||||
		/** 导出按钮操作 */
 | 
			
		||||
		handleExport() {
 | 
			
		||||
			// 处理查询参数
 | 
			
		||||
			let params = { ...this.queryParams };
 | 
			
		||||
			params.pageNo = undefined;
 | 
			
		||||
			params.pageSize = undefined;
 | 
			
		||||
			this.$modal
 | 
			
		||||
				.confirm('是否确认导出所有维修记录?')
 | 
			
		||||
				.then(() => {
 | 
			
		||||
					this.exportLoading = true;
 | 
			
		||||
					return exportEquipmentTypeExcel(params);
 | 
			
		||||
				})
 | 
			
		||||
				.then((response) => {
 | 
			
		||||
					this.$download.excel(response, '维修记录.xls');
 | 
			
		||||
					this.exportLoading = false;
 | 
			
		||||
				})
 | 
			
		||||
				.catch(() => {});
 | 
			
		||||
		},
 | 
			
		||||
	},
 | 
			
		||||
};
 | 
			
		||||
</script>
 | 
			
		||||
							
								
								
									
										331
									
								
								src/views/equipment/base/spareParts/Config/index.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										331
									
								
								src/views/equipment/base/spareParts/Config/index.vue
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,331 @@
 | 
			
		||||
<template>
 | 
			
		||||
	<div class="app-container">
 | 
			
		||||
		<!-- 搜索工作栏 -->
 | 
			
		||||
		<SearchBar
 | 
			
		||||
			:formConfigs="searchBarFormConfig"
 | 
			
		||||
			ref="search-bar"
 | 
			
		||||
			@headBtnClick="handleSearchBarBtnClick" />
 | 
			
		||||
 | 
			
		||||
		<!-- 列表 -->
 | 
			
		||||
		<base-table
 | 
			
		||||
			:table-props="tableProps"
 | 
			
		||||
			:page="queryParams.pageNo"
 | 
			
		||||
			:limit="queryParams.pageSize"
 | 
			
		||||
			:table-data="list"
 | 
			
		||||
			@emitFun="handleEmitFun">
 | 
			
		||||
			<method-btn
 | 
			
		||||
				v-if="tableBtn.length"
 | 
			
		||||
				slot="handleBtn"
 | 
			
		||||
				label="操作"
 | 
			
		||||
				:width="120"
 | 
			
		||||
				:method-list="tableBtn"
 | 
			
		||||
				@clickBtn="handleTableBtnClick" />
 | 
			
		||||
		</base-table>
 | 
			
		||||
 | 
			
		||||
		<!-- 分页组件 -->
 | 
			
		||||
		<pagination
 | 
			
		||||
			v-show="total > 0"
 | 
			
		||||
			:total="total"
 | 
			
		||||
			:page.sync="queryParams.pageNo"
 | 
			
		||||
			:limit.sync="queryParams.pageSize"
 | 
			
		||||
			@pagination="getList" />
 | 
			
		||||
 | 
			
		||||
		<!-- 对话框(添加 / 修改) -->
 | 
			
		||||
		<base-dialog
 | 
			
		||||
			:dialogTitle="title"
 | 
			
		||||
			:dialogVisible="open"
 | 
			
		||||
			width="35%"
 | 
			
		||||
			@close="cancel"
 | 
			
		||||
			@cancel="cancel"
 | 
			
		||||
			@confirm="submitForm">
 | 
			
		||||
			<DialogForm
 | 
			
		||||
				v-if="open"
 | 
			
		||||
				ref="form"
 | 
			
		||||
				v-model="form"
 | 
			
		||||
				:disabled="mode == 'detail'"
 | 
			
		||||
				:has-files="false"
 | 
			
		||||
				:rows="rows" />
 | 
			
		||||
		</base-dialog>
 | 
			
		||||
	</div>
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script>
 | 
			
		||||
import moment from 'moment';
 | 
			
		||||
import basicPageMixin from '@/mixins/lb/basicPageMixin';
 | 
			
		||||
import { publicFormatter } from '@/utils/dict';
 | 
			
		||||
 | 
			
		||||
const timeFilter = (val) => moment(val).format('yyyy-MM-DD HH:mm:ss');
 | 
			
		||||
 | 
			
		||||
export default {
 | 
			
		||||
	name: 'EquipmentSparePartsConfig',
 | 
			
		||||
	components: {},
 | 
			
		||||
	mixins: [basicPageMixin],
 | 
			
		||||
	data() {
 | 
			
		||||
		return {
 | 
			
		||||
			searchBarKeys: ['name', 'equipmentId', 'equipmentIdList'],
 | 
			
		||||
			tableBtn: [
 | 
			
		||||
				// this.$auth.hasPermi('equipment:spare-parts-config:update')
 | 
			
		||||
				// 	? {
 | 
			
		||||
				// 			type: 'detail',
 | 
			
		||||
				// 			btnName: '详情',
 | 
			
		||||
				// 	  }
 | 
			
		||||
				// 	: undefined,
 | 
			
		||||
				this.$auth.hasPermi('equipment:spare-parts-config:update')
 | 
			
		||||
					? {
 | 
			
		||||
							type: 'edit',
 | 
			
		||||
							btnName: '修改',
 | 
			
		||||
					  }
 | 
			
		||||
					: undefined,
 | 
			
		||||
				this.$auth.hasPermi('equipment:spare-parts-config:delete')
 | 
			
		||||
					? {
 | 
			
		||||
							type: 'delete',
 | 
			
		||||
							btnName: '删除',
 | 
			
		||||
					  }
 | 
			
		||||
					: undefined,
 | 
			
		||||
			].filter((v) => v),
 | 
			
		||||
			tableProps: [
 | 
			
		||||
				{ prop: 'name', label: '配置名' },
 | 
			
		||||
				{ prop: 'lineName', label: '产线' },
 | 
			
		||||
				{ prop: 'sectionName', label: '工段' },
 | 
			
		||||
				{ prop: 'equipmentName', label: '设备名' },
 | 
			
		||||
				{ prop: 'equipmentCode', label: '设备编码' },
 | 
			
		||||
				{ prop: 'responsible', label: '负责人' },
 | 
			
		||||
				// { prop: 'unit', label: '单位', filter: publicFormatter('unit_dict') },
 | 
			
		||||
				{ prop: 'description', label: '描述' },
 | 
			
		||||
				{ prop: 'sparePartNumber', label: '备品备件数量' },
 | 
			
		||||
				// { prop: 'remark', label: '备注' },
 | 
			
		||||
			],
 | 
			
		||||
			searchBarFormConfig: [
 | 
			
		||||
				{
 | 
			
		||||
					type: 'input',
 | 
			
		||||
					label: '配置名称',
 | 
			
		||||
					placeholder: '请输入配置名称',
 | 
			
		||||
					param: 'name',
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					type: 'select',
 | 
			
		||||
					label: '设备名称',
 | 
			
		||||
					placeholder: '请输选择设备称',
 | 
			
		||||
					param: 'equipmentId',
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					type: 'button',
 | 
			
		||||
					btnName: '查询',
 | 
			
		||||
					name: 'search',
 | 
			
		||||
					color: 'primary',
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					type: 'separate',
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					type: this.$auth.hasPermi('equipment:spare-parts-config:create')
 | 
			
		||||
						? 'button'
 | 
			
		||||
						: '',
 | 
			
		||||
					btnName: '新增',
 | 
			
		||||
					name: 'add',
 | 
			
		||||
					plain: true,
 | 
			
		||||
					color: 'success',
 | 
			
		||||
				},
 | 
			
		||||
				// {
 | 
			
		||||
				// 	type: this.$auth.hasPermi('equipment:spare-parts-config:export')
 | 
			
		||||
				// 		? 'button'
 | 
			
		||||
				// 		: '',
 | 
			
		||||
				// 	btnName: '导出',
 | 
			
		||||
				// 	name: 'export',
 | 
			
		||||
				// 	color: 'warning',
 | 
			
		||||
				// },
 | 
			
		||||
			],
 | 
			
		||||
			rows: [
 | 
			
		||||
				[
 | 
			
		||||
					{
 | 
			
		||||
						input: true,
 | 
			
		||||
						label: '配置名称',
 | 
			
		||||
						prop: 'name',
 | 
			
		||||
						rules: [{ required: true, message: '不能为空', trigger: 'blur' }],
 | 
			
		||||
					},
 | 
			
		||||
				],
 | 
			
		||||
				[
 | 
			
		||||
					{
 | 
			
		||||
						select: true,
 | 
			
		||||
						label: '设备名称',
 | 
			
		||||
						prop: 'equipmentId',
 | 
			
		||||
						url: '/base/core-equipment/listAll',
 | 
			
		||||
						bind: {
 | 
			
		||||
							filterable: true,
 | 
			
		||||
							clearable: true,
 | 
			
		||||
						},
 | 
			
		||||
						rules: [{ required: true, message: '不能为空', trigger: 'blur' }],
 | 
			
		||||
					},
 | 
			
		||||
				],
 | 
			
		||||
				[
 | 
			
		||||
					{
 | 
			
		||||
						select: true, // TODO: or INPUT instead of SELECT
 | 
			
		||||
						label: '负责人',
 | 
			
		||||
						prop: 'responsible',
 | 
			
		||||
						url: '/base/core-equipment/listAll', // TODO: 班组
 | 
			
		||||
						bind: {
 | 
			
		||||
							filterable: true,
 | 
			
		||||
							clearable: true,
 | 
			
		||||
						},
 | 
			
		||||
					},
 | 
			
		||||
				],
 | 
			
		||||
				[
 | 
			
		||||
					{
 | 
			
		||||
						input: true,
 | 
			
		||||
						label: '描述',
 | 
			
		||||
						prop: 'description', // TODO: 富文本
 | 
			
		||||
					},
 | 
			
		||||
				],
 | 
			
		||||
			],
 | 
			
		||||
			// 是否显示弹出层
 | 
			
		||||
			open: false,
 | 
			
		||||
			// 查询参数
 | 
			
		||||
			queryParams: {
 | 
			
		||||
				pageNo: 1,
 | 
			
		||||
				pageSize: 10,
 | 
			
		||||
				name: null,
 | 
			
		||||
				equipmentId: null,
 | 
			
		||||
			},
 | 
			
		||||
			// 表单参数
 | 
			
		||||
			form: {},
 | 
			
		||||
			basePath: '/base/equipment-spare-part-config',
 | 
			
		||||
			mode: null,
 | 
			
		||||
		};
 | 
			
		||||
	},
 | 
			
		||||
	created() {
 | 
			
		||||
		this.initSearchBar();
 | 
			
		||||
		this.getList();
 | 
			
		||||
	},
 | 
			
		||||
	methods: {
 | 
			
		||||
		initSearchBar() {
 | 
			
		||||
			this.http('/base/core-equipment/listAll', 'get').then(({ data }) => {
 | 
			
		||||
				this.$set(
 | 
			
		||||
					this.searchBarFormConfig[1],
 | 
			
		||||
					'selectOptions',
 | 
			
		||||
					data.map((item) => ({
 | 
			
		||||
						name: item.name,
 | 
			
		||||
						id: item.id,
 | 
			
		||||
					}))
 | 
			
		||||
				);
 | 
			
		||||
			});
 | 
			
		||||
		},
 | 
			
		||||
		/** 查询列表 */
 | 
			
		||||
		getList() {
 | 
			
		||||
			this.loading = true;
 | 
			
		||||
			// 执行查询
 | 
			
		||||
			this.recv(this.queryParams).then((response) => {
 | 
			
		||||
				this.list = response.data.list;
 | 
			
		||||
				this.total = response.data.total;
 | 
			
		||||
				this.loading = false;
 | 
			
		||||
			});
 | 
			
		||||
		},
 | 
			
		||||
		/** 取消按钮 */
 | 
			
		||||
		cancel() {
 | 
			
		||||
			this.open = false;
 | 
			
		||||
			this.mode = null;
 | 
			
		||||
			this.reset();
 | 
			
		||||
		},
 | 
			
		||||
		/** 表单重置 */
 | 
			
		||||
		reset() {
 | 
			
		||||
			this.form = {
 | 
			
		||||
				id: null,
 | 
			
		||||
				name: null,
 | 
			
		||||
				equipmentId: null,
 | 
			
		||||
				description: null,
 | 
			
		||||
				responsible: null
 | 
			
		||||
			};
 | 
			
		||||
			this.resetForm('form');
 | 
			
		||||
		},
 | 
			
		||||
		/** 搜索按钮操作 */
 | 
			
		||||
		handleQuery() {
 | 
			
		||||
			this.queryParams.pageNo = 1;
 | 
			
		||||
			this.getList();
 | 
			
		||||
		},
 | 
			
		||||
		/** 重置按钮操作 */
 | 
			
		||||
		resetQuery() {
 | 
			
		||||
			this.resetForm('queryForm');
 | 
			
		||||
			this.handleQuery();
 | 
			
		||||
		},
 | 
			
		||||
		/** 新增按钮操作 */
 | 
			
		||||
		handleAdd() {
 | 
			
		||||
			this.reset();
 | 
			
		||||
			this.open = true;
 | 
			
		||||
			this.title = '添加备品备件配置';
 | 
			
		||||
		},
 | 
			
		||||
		/** 修改按钮操作 */
 | 
			
		||||
		handleUpdate(row) {
 | 
			
		||||
			this.reset();
 | 
			
		||||
			const id = row.id;
 | 
			
		||||
			this.info({ id }).then((response) => {
 | 
			
		||||
				this.form = response.data;
 | 
			
		||||
				this.open = true;
 | 
			
		||||
				this.title = '修改备品备件配置';
 | 
			
		||||
			});
 | 
			
		||||
		},
 | 
			
		||||
		/** 提交按钮 */
 | 
			
		||||
		submitForm() {
 | 
			
		||||
			this.$refs['form'].validate((valid) => {
 | 
			
		||||
				if (!valid) {
 | 
			
		||||
					return;
 | 
			
		||||
				}
 | 
			
		||||
				// 修改的提交
 | 
			
		||||
				if (this.form.id != null) {
 | 
			
		||||
					this.put(this.form).then((response) => {
 | 
			
		||||
						this.$modal.msgSuccess('修改成功');
 | 
			
		||||
						this.open = false;
 | 
			
		||||
						this.getList();
 | 
			
		||||
					});
 | 
			
		||||
					return;
 | 
			
		||||
				}
 | 
			
		||||
				// 添加的提交
 | 
			
		||||
				this.post(this.form).then((response) => {
 | 
			
		||||
					this.$modal.msgSuccess('新增成功');
 | 
			
		||||
					this.open = false;
 | 
			
		||||
					this.getList();
 | 
			
		||||
				});
 | 
			
		||||
			});
 | 
			
		||||
		},
 | 
			
		||||
		/** 删除按钮操作 */
 | 
			
		||||
		handleDelete(row) {
 | 
			
		||||
			const id = row.id;
 | 
			
		||||
			this.$modal
 | 
			
		||||
				.confirm('是否确认删除记录"' + row.name + '"?')
 | 
			
		||||
				.then(function () {
 | 
			
		||||
					return this.delete({ id });
 | 
			
		||||
				})
 | 
			
		||||
				.then(() => {
 | 
			
		||||
					this.getList();
 | 
			
		||||
					this.$modal.msgSuccess('删除成功');
 | 
			
		||||
				})
 | 
			
		||||
				.catch(() => {});
 | 
			
		||||
		},
 | 
			
		||||
		handleDetail({ id }) {
 | 
			
		||||
			this.reset();
 | 
			
		||||
			this.mode = 'detail';
 | 
			
		||||
			this.info({ id }).then((response) => {
 | 
			
		||||
				this.form = response.data;
 | 
			
		||||
				this.open = true;
 | 
			
		||||
				this.title = '修改备品备件配置';
 | 
			
		||||
			});
 | 
			
		||||
		},
 | 
			
		||||
		/** 导出按钮操作 */
 | 
			
		||||
		handleExport() {
 | 
			
		||||
			// 处理查询参数
 | 
			
		||||
			let params = { ...this.queryParams };
 | 
			
		||||
			params.pageNo = undefined;
 | 
			
		||||
			params.pageSize = undefined;
 | 
			
		||||
			this.$modal
 | 
			
		||||
				.confirm('是否确认导出所有备品备件配置?')
 | 
			
		||||
				.then(() => {
 | 
			
		||||
					this.exportLoading = true;
 | 
			
		||||
					return exportEquipmentTypeExcel(params);
 | 
			
		||||
				})
 | 
			
		||||
				.then((response) => {
 | 
			
		||||
					this.$download.excel(response, '备品备件配置.xls');
 | 
			
		||||
					this.exportLoading = false;
 | 
			
		||||
				})
 | 
			
		||||
				.catch(() => {});
 | 
			
		||||
		},
 | 
			
		||||
	},
 | 
			
		||||
};
 | 
			
		||||
</script>
 | 
			
		||||
							
								
								
									
										369
									
								
								src/views/equipment/base/spareParts/List/index.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										369
									
								
								src/views/equipment/base/spareParts/List/index.vue
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,369 @@
 | 
			
		||||
<template>
 | 
			
		||||
	<div class="app-container">
 | 
			
		||||
		<!-- 搜索工作栏 -->
 | 
			
		||||
		<SearchBar
 | 
			
		||||
			:formConfigs="searchBarFormConfig"
 | 
			
		||||
			ref="search-bar"
 | 
			
		||||
			@headBtnClick="handleSearchBarBtnClick" />
 | 
			
		||||
 | 
			
		||||
		<!-- 列表 -->
 | 
			
		||||
		<base-table
 | 
			
		||||
			:table-props="tableProps"
 | 
			
		||||
			:page="queryParams.pageNo"
 | 
			
		||||
			:limit="queryParams.pageSize"
 | 
			
		||||
			:table-data="list"
 | 
			
		||||
			@emitFun="handleEmitFun">
 | 
			
		||||
			<method-btn
 | 
			
		||||
				v-if="tableBtn.length"
 | 
			
		||||
				slot="handleBtn"
 | 
			
		||||
				label="操作"
 | 
			
		||||
				:width="120"
 | 
			
		||||
				:method-list="tableBtn"
 | 
			
		||||
				@clickBtn="handleTableBtnClick" />
 | 
			
		||||
		</base-table>
 | 
			
		||||
 | 
			
		||||
		<!-- 分页组件 -->
 | 
			
		||||
		<pagination
 | 
			
		||||
			v-show="total > 0"
 | 
			
		||||
			:total="total"
 | 
			
		||||
			:page.sync="queryParams.pageNo"
 | 
			
		||||
			:limit.sync="queryParams.pageSize"
 | 
			
		||||
			@pagination="getList" />
 | 
			
		||||
 | 
			
		||||
		<!-- 对话框(添加 / 修改) -->
 | 
			
		||||
		<base-dialog
 | 
			
		||||
			:dialogTitle="title"
 | 
			
		||||
			:dialogVisible="open"
 | 
			
		||||
			@close="cancel"
 | 
			
		||||
			@cancel="cancel"
 | 
			
		||||
			@confirm="submitForm">
 | 
			
		||||
			<DialogForm
 | 
			
		||||
				v-if="open"
 | 
			
		||||
				ref="form"
 | 
			
		||||
				v-model="form"
 | 
			
		||||
				:disabled="mode == 'detail'"
 | 
			
		||||
				:has-files="false"
 | 
			
		||||
				:rows="rows" />
 | 
			
		||||
		</base-dialog>
 | 
			
		||||
	</div>
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script>
 | 
			
		||||
import moment from 'moment';
 | 
			
		||||
import basicPageMixin from '@/mixins/lb/basicPageMixin';
 | 
			
		||||
import { publicFormatter } from '@/utils/dict';
 | 
			
		||||
 | 
			
		||||
const timeFilter = (val) => moment(val).format('yyyy-MM-DD HH:mm:ss');
 | 
			
		||||
 | 
			
		||||
export default {
 | 
			
		||||
	name: 'EquipmentSparePartsList',
 | 
			
		||||
	components: {},
 | 
			
		||||
	mixins: [basicPageMixin],
 | 
			
		||||
	data() {
 | 
			
		||||
		return {
 | 
			
		||||
			searchBarKeys: ['name'],
 | 
			
		||||
			tableBtn: [
 | 
			
		||||
				// this.$auth.hasPermi('equipment:spare-parts:update')
 | 
			
		||||
				// 	? {
 | 
			
		||||
				// 			type: 'detail',
 | 
			
		||||
				// 			btnName: '详情',
 | 
			
		||||
				// 	  }
 | 
			
		||||
				// 	: undefined,
 | 
			
		||||
				this.$auth.hasPermi('equipment:spare-parts:update')
 | 
			
		||||
					? {
 | 
			
		||||
							type: 'edit',
 | 
			
		||||
							btnName: '修改',
 | 
			
		||||
					  }
 | 
			
		||||
					: undefined,
 | 
			
		||||
				this.$auth.hasPermi('equipment:spare-parts:delete')
 | 
			
		||||
					? {
 | 
			
		||||
							type: 'delete',
 | 
			
		||||
							btnName: '删除',
 | 
			
		||||
					  }
 | 
			
		||||
					: undefined,
 | 
			
		||||
			].filter((v) => v),
 | 
			
		||||
			tableProps: [
 | 
			
		||||
				{ prop: 'code', label: '备件编码' },
 | 
			
		||||
				{ prop: 'name', label: '备件名称' },
 | 
			
		||||
				{ prop: 'model', label: '备件型号' },
 | 
			
		||||
				{ prop: 'unit', label: '单位', filter: publicFormatter('unit_dict') },
 | 
			
		||||
				{ prop: 'life', label: '使用寿命' },
 | 
			
		||||
				{ prop: 'specifications', label: '规格' },
 | 
			
		||||
				{ prop: 'remark', label: '备注' },
 | 
			
		||||
			],
 | 
			
		||||
			searchBarFormConfig: [
 | 
			
		||||
				{
 | 
			
		||||
					type: 'input',
 | 
			
		||||
					label: '关键字',
 | 
			
		||||
					placeholder: '请输入备件名称',
 | 
			
		||||
					param: 'name',
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					type: 'button',
 | 
			
		||||
					btnName: '查询',
 | 
			
		||||
					name: 'search',
 | 
			
		||||
					color: 'primary',
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					type: 'separate',
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					type: this.$auth.hasPermi('equipment:spare-parts:create')
 | 
			
		||||
						? 'button'
 | 
			
		||||
						: '',
 | 
			
		||||
					btnName: '新增',
 | 
			
		||||
					name: 'add',
 | 
			
		||||
					plain: true,
 | 
			
		||||
					color: 'success',
 | 
			
		||||
				},
 | 
			
		||||
				// {
 | 
			
		||||
				// 	type: this.$auth.hasPermi('equipment:spare-parts:export')
 | 
			
		||||
				// 		? 'button'
 | 
			
		||||
				// 		: '',
 | 
			
		||||
				// 	btnName: '导出',
 | 
			
		||||
				// 	name: 'export',
 | 
			
		||||
				// 	color: 'warning',
 | 
			
		||||
				// },
 | 
			
		||||
			],
 | 
			
		||||
			rows: [
 | 
			
		||||
				[
 | 
			
		||||
					{
 | 
			
		||||
						input: true,
 | 
			
		||||
						label: '备件名称',
 | 
			
		||||
						prop: 'name',
 | 
			
		||||
					},
 | 
			
		||||
					{
 | 
			
		||||
						input: true,
 | 
			
		||||
						label: '备件型号',
 | 
			
		||||
						prop: 'model',
 | 
			
		||||
					},
 | 
			
		||||
				],
 | 
			
		||||
				[
 | 
			
		||||
					{
 | 
			
		||||
						input: true,
 | 
			
		||||
						label: '规格',
 | 
			
		||||
						prop: 'specifications',
 | 
			
		||||
					},
 | 
			
		||||
					{
 | 
			
		||||
						select: true,
 | 
			
		||||
						label: '供应商',
 | 
			
		||||
						prop: 'supplierId',
 | 
			
		||||
						url: '/base/core-supplier/listAll', // TODO: 课上关系
 | 
			
		||||
						bind: {
 | 
			
		||||
							filterable: true,
 | 
			
		||||
							clearable: true,
 | 
			
		||||
						},
 | 
			
		||||
						rules: [{ required: true, message: '不能为空', trigger: 'blur' }],
 | 
			
		||||
					},
 | 
			
		||||
				],
 | 
			
		||||
				[
 | 
			
		||||
					{
 | 
			
		||||
						select: true,
 | 
			
		||||
						label: '物料类型',
 | 
			
		||||
						prop: 'type',
 | 
			
		||||
						url: '/base/core-equipment/listAll', // TODO: 物料
 | 
			
		||||
						bind: {
 | 
			
		||||
							filterable: true,
 | 
			
		||||
							clearable: true,
 | 
			
		||||
						},
 | 
			
		||||
						rules: [{ required: true, message: '不能为空', trigger: 'blur' }],
 | 
			
		||||
					},
 | 
			
		||||
					{
 | 
			
		||||
						input: true,
 | 
			
		||||
						label: '使用寿命',
 | 
			
		||||
						prop: 'life',
 | 
			
		||||
						rules: [
 | 
			
		||||
							{
 | 
			
		||||
								type: 'number',
 | 
			
		||||
								message: '请输入正确的数字类型',
 | 
			
		||||
								trigger: 'blur',
 | 
			
		||||
								transform: (v) => Number(v),
 | 
			
		||||
							},
 | 
			
		||||
						],
 | 
			
		||||
					},
 | 
			
		||||
				],
 | 
			
		||||
				[
 | 
			
		||||
					{
 | 
			
		||||
						select: true,
 | 
			
		||||
						label: '单位',
 | 
			
		||||
						prop: 'unit', // 数据字典
 | 
			
		||||
						options: this.getDictDatas(this.DICT_TYPE.UNIT_DICT),
 | 
			
		||||
					},
 | 
			
		||||
					{
 | 
			
		||||
						input: true,
 | 
			
		||||
						label: '备注',
 | 
			
		||||
						prop: 'remark',
 | 
			
		||||
					},
 | 
			
		||||
				],
 | 
			
		||||
				// [
 | 
			
		||||
				// {
 | 
			
		||||
				// 	datetime: true,
 | 
			
		||||
				// 	label: '故障发生时间',
 | 
			
		||||
				// 	prop: 'faultTime',
 | 
			
		||||
				// 	rules: [{ required: true, message: '不能为空', trigger: 'blur' }],
 | 
			
		||||
				// 	bind: {
 | 
			
		||||
				// 		format: 'yyyy-MM-dd HH:mm:ss',
 | 
			
		||||
				// 		'value-format': 'timestamp',
 | 
			
		||||
				// 		// 'value-format': 'yyyy-MM-dd HH:mm:ss',
 | 
			
		||||
				// 		clearable: true,
 | 
			
		||||
				// 	},
 | 
			
		||||
				// },
 | 
			
		||||
 | 
			
		||||
				// ],
 | 
			
		||||
			],
 | 
			
		||||
			// 是否显示弹出层
 | 
			
		||||
			open: false,
 | 
			
		||||
			// 查询参数
 | 
			
		||||
			queryParams: {
 | 
			
		||||
				pageNo: 1,
 | 
			
		||||
				pageSize: 10,
 | 
			
		||||
				name: null,
 | 
			
		||||
			},
 | 
			
		||||
			// 表单参数
 | 
			
		||||
			form: {},
 | 
			
		||||
			basePath: '/base/equipment-spare-part',
 | 
			
		||||
			mode: null,
 | 
			
		||||
		};
 | 
			
		||||
	},
 | 
			
		||||
	created() {
 | 
			
		||||
		// this.initSearchBar();
 | 
			
		||||
		this.getList();
 | 
			
		||||
	},
 | 
			
		||||
	methods: {
 | 
			
		||||
		// initSearchBar() {
 | 
			
		||||
		// 	this.http('/base/core-equipment/listAll', 'get').then(({ data }) => {
 | 
			
		||||
		// 		this.$set(
 | 
			
		||||
		// 			this.searchBarFormConfig[0],
 | 
			
		||||
		// 			'selectOptions',
 | 
			
		||||
		// 			data.map((item) => ({
 | 
			
		||||
		// 				name: item.name,
 | 
			
		||||
		// 				id: item.id,
 | 
			
		||||
		// 			}))
 | 
			
		||||
		// 		);
 | 
			
		||||
		// 	});
 | 
			
		||||
		// },
 | 
			
		||||
		/** 查询列表 */
 | 
			
		||||
		getList() {
 | 
			
		||||
			this.loading = true;
 | 
			
		||||
			// 执行查询
 | 
			
		||||
			this.recv(this.queryParams).then((response) => {
 | 
			
		||||
				this.list = response.data.list;
 | 
			
		||||
				this.total = response.data.total;
 | 
			
		||||
				this.loading = false;
 | 
			
		||||
			});
 | 
			
		||||
		},
 | 
			
		||||
		/** 取消按钮 */
 | 
			
		||||
		cancel() {
 | 
			
		||||
			this.open = false;
 | 
			
		||||
			this.mode = null;
 | 
			
		||||
			this.reset();
 | 
			
		||||
		},
 | 
			
		||||
		/** 表单重置 */
 | 
			
		||||
		reset() {
 | 
			
		||||
			this.form = {
 | 
			
		||||
				id: null,
 | 
			
		||||
				code: null,
 | 
			
		||||
				name: null,
 | 
			
		||||
				model: null,
 | 
			
		||||
				specifications: null,
 | 
			
		||||
				life: null,
 | 
			
		||||
				type: null,
 | 
			
		||||
				supplierId: null,
 | 
			
		||||
				unit: null,
 | 
			
		||||
				remark: null,
 | 
			
		||||
			};
 | 
			
		||||
			this.resetForm('form');
 | 
			
		||||
		},
 | 
			
		||||
		/** 搜索按钮操作 */
 | 
			
		||||
		handleQuery() {
 | 
			
		||||
			this.queryParams.pageNo = 1;
 | 
			
		||||
			this.getList();
 | 
			
		||||
		},
 | 
			
		||||
		/** 重置按钮操作 */
 | 
			
		||||
		resetQuery() {
 | 
			
		||||
			this.resetForm('queryForm');
 | 
			
		||||
			this.handleQuery();
 | 
			
		||||
		},
 | 
			
		||||
		/** 新增按钮操作 */
 | 
			
		||||
		handleAdd() {
 | 
			
		||||
			this.reset();
 | 
			
		||||
			this.open = true;
 | 
			
		||||
			this.title = '添加备品备件';
 | 
			
		||||
		},
 | 
			
		||||
		/** 修改按钮操作 */
 | 
			
		||||
		handleUpdate(row) {
 | 
			
		||||
			this.reset();
 | 
			
		||||
			const id = row.id;
 | 
			
		||||
			this.info({ id }).then((response) => {
 | 
			
		||||
				this.form = response.data;
 | 
			
		||||
				this.open = true;
 | 
			
		||||
				this.title = '修改备品备件';
 | 
			
		||||
			});
 | 
			
		||||
		},
 | 
			
		||||
		/** 提交按钮 */
 | 
			
		||||
		submitForm() {
 | 
			
		||||
			this.$refs['form'].validate((valid) => {
 | 
			
		||||
				if (!valid) {
 | 
			
		||||
					return;
 | 
			
		||||
				}
 | 
			
		||||
				// 修改的提交
 | 
			
		||||
				if (this.form.id != null) {
 | 
			
		||||
					this.put(this.form).then((response) => {
 | 
			
		||||
						this.$modal.msgSuccess('修改成功');
 | 
			
		||||
						this.open = false;
 | 
			
		||||
						this.getList();
 | 
			
		||||
					});
 | 
			
		||||
					return;
 | 
			
		||||
				}
 | 
			
		||||
				// 添加的提交
 | 
			
		||||
				this.post(this.form).then((response) => {
 | 
			
		||||
					this.$modal.msgSuccess('新增成功');
 | 
			
		||||
					this.open = false;
 | 
			
		||||
					this.getList();
 | 
			
		||||
				});
 | 
			
		||||
			});
 | 
			
		||||
		},
 | 
			
		||||
		/** 删除按钮操作 */
 | 
			
		||||
		handleDelete(row) {
 | 
			
		||||
			const id = row.id;
 | 
			
		||||
			this.$modal
 | 
			
		||||
				.confirm('是否确认删除记录"' + row.name + '"?')
 | 
			
		||||
				.then(function () {
 | 
			
		||||
					return this.delete({ id });
 | 
			
		||||
				})
 | 
			
		||||
				.then(() => {
 | 
			
		||||
					this.getList();
 | 
			
		||||
					this.$modal.msgSuccess('删除成功');
 | 
			
		||||
				})
 | 
			
		||||
				.catch(() => {});
 | 
			
		||||
		},
 | 
			
		||||
		handleDetail({ id }) {
 | 
			
		||||
			this.reset();
 | 
			
		||||
			this.mode = 'detail';
 | 
			
		||||
			this.info({ id }).then((response) => {
 | 
			
		||||
				this.form = response.data;
 | 
			
		||||
				this.open = true;
 | 
			
		||||
				this.title = '修改备品备件';
 | 
			
		||||
			});
 | 
			
		||||
		},
 | 
			
		||||
		/** 导出按钮操作 */
 | 
			
		||||
		handleExport() {
 | 
			
		||||
			// 处理查询参数
 | 
			
		||||
			let params = { ...this.queryParams };
 | 
			
		||||
			params.pageNo = undefined;
 | 
			
		||||
			params.pageSize = undefined;
 | 
			
		||||
			this.$modal
 | 
			
		||||
				.confirm('是否确认导出所有备品备件?')
 | 
			
		||||
				.then(() => {
 | 
			
		||||
					this.exportLoading = true;
 | 
			
		||||
					return exportEquipmentTypeExcel(params);
 | 
			
		||||
				})
 | 
			
		||||
				.then((response) => {
 | 
			
		||||
					this.$download.excel(response, '备品备件.xls');
 | 
			
		||||
					this.exportLoading = false;
 | 
			
		||||
				})
 | 
			
		||||
				.catch(() => {});
 | 
			
		||||
		},
 | 
			
		||||
	},
 | 
			
		||||
};
 | 
			
		||||
</script>
 | 
			
		||||
							
								
								
									
										385
									
								
								src/views/equipment/base/spareParts/Monitor/index.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										385
									
								
								src/views/equipment/base/spareParts/Monitor/index.vue
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,385 @@
 | 
			
		||||
<template>
 | 
			
		||||
	<div class="app-container">
 | 
			
		||||
		<!-- 搜索工作栏 -->
 | 
			
		||||
		<SearchBar
 | 
			
		||||
			:formConfigs="searchBarFormConfig"
 | 
			
		||||
			ref="search-bar"
 | 
			
		||||
			@headBtnClick="handleSearchBarBtnClick" />
 | 
			
		||||
 | 
			
		||||
		<!-- 列表 -->
 | 
			
		||||
		<base-table
 | 
			
		||||
			:table-props="tableProps"
 | 
			
		||||
			:page="queryParams.pageNo"
 | 
			
		||||
			:limit="queryParams.pageSize"
 | 
			
		||||
			:table-data="list"
 | 
			
		||||
			@emitFun="handleEmitFun">
 | 
			
		||||
			<method-btn
 | 
			
		||||
				v-if="tableBtn.length"
 | 
			
		||||
				slot="handleBtn"
 | 
			
		||||
				label="操作"
 | 
			
		||||
				:width="120"
 | 
			
		||||
				:method-list="tableBtn"
 | 
			
		||||
				@clickBtn="handleTableBtnClick" />
 | 
			
		||||
		</base-table>
 | 
			
		||||
 | 
			
		||||
		<!-- 分页组件 -->
 | 
			
		||||
		<pagination
 | 
			
		||||
			v-show="total > 0"
 | 
			
		||||
			:total="total"
 | 
			
		||||
			:page.sync="queryParams.pageNo"
 | 
			
		||||
			:limit.sync="queryParams.pageSize"
 | 
			
		||||
			@pagination="getList" />
 | 
			
		||||
 | 
			
		||||
		<!-- 对话框(添加 / 修改) -->
 | 
			
		||||
		<base-dialog
 | 
			
		||||
			:dialogTitle="title"
 | 
			
		||||
			:dialogVisible="open"
 | 
			
		||||
			width="35%"
 | 
			
		||||
			@close="cancel"
 | 
			
		||||
			@cancel="cancel"
 | 
			
		||||
			@confirm="submitForm">
 | 
			
		||||
			<DialogForm
 | 
			
		||||
				v-if="open"
 | 
			
		||||
				ref="form"
 | 
			
		||||
				v-model="form"
 | 
			
		||||
				:disabled="mode == 'detail'"
 | 
			
		||||
				:has-files="false"
 | 
			
		||||
				:rows="rows" />
 | 
			
		||||
		</base-dialog>
 | 
			
		||||
	</div>
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script>
 | 
			
		||||
import moment from 'moment';
 | 
			
		||||
import basicPageMixin from '@/mixins/lb/basicPageMixin';
 | 
			
		||||
// import { publicFormatter } from '@/utils/dict';
 | 
			
		||||
// const timeFilter = (val) => moment(val).format('yyyy-MM-DD HH:mm:ss');
 | 
			
		||||
 | 
			
		||||
// TODO: 该组件缺乏对应的后端接口
 | 
			
		||||
 | 
			
		||||
const remainBox = {
 | 
			
		||||
	name: 'RemainBox',
 | 
			
		||||
	props: ['injectData'],
 | 
			
		||||
	data() {
 | 
			
		||||
		return {};
 | 
			
		||||
	},
 | 
			
		||||
	computed: {
 | 
			
		||||
		value() {
 | 
			
		||||
			return this.injectData[this.injectData.prop] || null;
 | 
			
		||||
		},
 | 
			
		||||
		color() {
 | 
			
		||||
			if (this.value) {
 | 
			
		||||
				const v = +this.value;
 | 
			
		||||
				return v < 0 ? 'red' : v >= 0 && v < 2 ? 'yellow' : 'green';
 | 
			
		||||
			}
 | 
			
		||||
			return 'unset';
 | 
			
		||||
		},
 | 
			
		||||
	},
 | 
			
		||||
	render: function (h) {
 | 
			
		||||
		return (
 | 
			
		||||
			<div
 | 
			
		||||
				style={`background: ${
 | 
			
		||||
					this.color
 | 
			
		||||
				}; position:absolute; inset: 0; padding: 0 10px; display: flex; align-items: center; color: ${
 | 
			
		||||
					this.color == 'red' ? '#fff' : 'unset'
 | 
			
		||||
				}`}>
 | 
			
		||||
				{this.injectData[this.injectData.prop] || ''}
 | 
			
		||||
			</div>
 | 
			
		||||
		);
 | 
			
		||||
	},
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
const btn = {
 | 
			
		||||
	name: 'tableBtn',
 | 
			
		||||
	props: ['injectData'],
 | 
			
		||||
	data() {
 | 
			
		||||
		return {};
 | 
			
		||||
	},
 | 
			
		||||
	methods: {
 | 
			
		||||
		handleClick() {
 | 
			
		||||
			this.$emit('emitData', { action: this.injectData.label, value: null });
 | 
			
		||||
		},
 | 
			
		||||
	},
 | 
			
		||||
	render: function (h) {
 | 
			
		||||
		return (
 | 
			
		||||
			<el-button type="text" onClick={this.handleClick}>
 | 
			
		||||
				{this.injectData.label}
 | 
			
		||||
			</el-button>
 | 
			
		||||
		);
 | 
			
		||||
	},
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
export default {
 | 
			
		||||
	name: 'EquipmentSparePartsMonitor',
 | 
			
		||||
	components: {},
 | 
			
		||||
	mixins: [basicPageMixin],
 | 
			
		||||
	data() {
 | 
			
		||||
		return {
 | 
			
		||||
			searchBarKeys: ['name', 'equipmentId', 'equipmentIdList'],
 | 
			
		||||
			tableBtn: [
 | 
			
		||||
				// this.$auth.hasPermi('equipment:spare-parts-config:update')
 | 
			
		||||
				// 	? {
 | 
			
		||||
				// 			type: 'detail',
 | 
			
		||||
				// 			btnName: '详情',
 | 
			
		||||
				// 	  }
 | 
			
		||||
				// 	: undefined,
 | 
			
		||||
				this.$auth.hasPermi('equipment:spare-parts-config:update')
 | 
			
		||||
					? {
 | 
			
		||||
							type: 'edit',
 | 
			
		||||
							btnName: '修改',
 | 
			
		||||
					  }
 | 
			
		||||
					: undefined,
 | 
			
		||||
				this.$auth.hasPermi('equipment:spare-parts-config:delete')
 | 
			
		||||
					? {
 | 
			
		||||
							type: 'delete',
 | 
			
		||||
							btnName: '删除',
 | 
			
		||||
					  }
 | 
			
		||||
					: undefined,
 | 
			
		||||
			].filter((v) => v),
 | 
			
		||||
			tableProps: [
 | 
			
		||||
				{ prop: 'name', label: '配置名' },
 | 
			
		||||
				{ prop: 'lineName', label: '产线' },
 | 
			
		||||
				{ prop: 'sectionName', label: '工段' },
 | 
			
		||||
				{ prop: 'equipmentName', label: '设备' },
 | 
			
		||||
				{ prop: 'responsible', label: '负责人' },
 | 
			
		||||
				{ prop: 'equipmentCode', label: '是否超期', subcomonent: remainBox },
 | 
			
		||||
				{ prop: 'opt1', label: '备件更换' },
 | 
			
		||||
				{ prop: 'opt2', label: '更新记录' },  // TODO: 是否换成按钮, 群里问
 | 
			
		||||
				// { prop: 'remark', label: '备注' },
 | 
			
		||||
			],
 | 
			
		||||
			searchBarFormConfig: [
 | 
			
		||||
				{
 | 
			
		||||
					type: 'input',
 | 
			
		||||
					label: '产线',
 | 
			
		||||
					placeholder: '请选择产线',
 | 
			
		||||
					param: 'name',
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					type: 'select',
 | 
			
		||||
					label: '设备',
 | 
			
		||||
					placeholder: '请选择设备',
 | 
			
		||||
					param: 'equipmentId',
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					type: 'button',
 | 
			
		||||
					btnName: '查询',
 | 
			
		||||
					name: 'search',
 | 
			
		||||
					color: 'primary',
 | 
			
		||||
				},
 | 
			
		||||
				// {
 | 
			
		||||
				// 	type: 'separate',
 | 
			
		||||
				// },
 | 
			
		||||
				// {
 | 
			
		||||
				// 	type: this.$auth.hasPermi('equipment:spare-parts-config:create')
 | 
			
		||||
				// 		? 'button'
 | 
			
		||||
				// 		: '',
 | 
			
		||||
				// 	btnName: '新增',
 | 
			
		||||
				// 	name: 'add',
 | 
			
		||||
				// 	plain: true,
 | 
			
		||||
				// 	color: 'success',
 | 
			
		||||
				// },
 | 
			
		||||
				// {
 | 
			
		||||
				// 	type: this.$auth.hasPermi('equipment:spare-parts-config:export')
 | 
			
		||||
				// 		? 'button'
 | 
			
		||||
				// 		: '',
 | 
			
		||||
				// 	btnName: '导出',
 | 
			
		||||
				// 	name: 'export',
 | 
			
		||||
				// 	color: 'warning',
 | 
			
		||||
				// },
 | 
			
		||||
			],
 | 
			
		||||
			rows: [
 | 
			
		||||
				[
 | 
			
		||||
					{
 | 
			
		||||
						input: true,
 | 
			
		||||
						label: '配置名称',
 | 
			
		||||
						prop: 'name',
 | 
			
		||||
						rules: [{ required: true, message: '不能为空', trigger: 'blur' }],
 | 
			
		||||
					},
 | 
			
		||||
				],
 | 
			
		||||
				[
 | 
			
		||||
					{
 | 
			
		||||
						select: true,
 | 
			
		||||
						label: '设备名称',
 | 
			
		||||
						prop: 'equipmentId',
 | 
			
		||||
						url: '/base/core-equipment/listAll',
 | 
			
		||||
						bind: {
 | 
			
		||||
							filterable: true,
 | 
			
		||||
							clearable: true,
 | 
			
		||||
						},
 | 
			
		||||
						rules: [{ required: true, message: '不能为空', trigger: 'blur' }],
 | 
			
		||||
					},
 | 
			
		||||
				],
 | 
			
		||||
				[
 | 
			
		||||
					{
 | 
			
		||||
						select: true, // TODO: or INPUT instead of SELECT
 | 
			
		||||
						label: '负责人',
 | 
			
		||||
						prop: 'responsible',
 | 
			
		||||
						url: '/base/core-equipment/listAll', // TODO: 班组
 | 
			
		||||
						bind: {
 | 
			
		||||
							filterable: true,
 | 
			
		||||
							clearable: true,
 | 
			
		||||
						},
 | 
			
		||||
					},
 | 
			
		||||
				],
 | 
			
		||||
				[
 | 
			
		||||
					{
 | 
			
		||||
						input: true,
 | 
			
		||||
						label: '描述',
 | 
			
		||||
						prop: 'description', // TODO: 富文本
 | 
			
		||||
					},
 | 
			
		||||
				],
 | 
			
		||||
			],
 | 
			
		||||
			// 是否显示弹出层
 | 
			
		||||
			open: false,
 | 
			
		||||
			// 查询参数
 | 
			
		||||
			queryParams: {
 | 
			
		||||
				pageNo: 1,
 | 
			
		||||
				pageSize: 10,
 | 
			
		||||
				name: null,
 | 
			
		||||
				equipmentId: null,
 | 
			
		||||
			},
 | 
			
		||||
			// 表单参数
 | 
			
		||||
			form: {},
 | 
			
		||||
			basePath: '/base/equipment-spare-part-config',
 | 
			
		||||
			mode: null,
 | 
			
		||||
		};
 | 
			
		||||
	},
 | 
			
		||||
	created() {
 | 
			
		||||
		this.initSearchBar();
 | 
			
		||||
		this.getList();
 | 
			
		||||
	},
 | 
			
		||||
	methods: {
 | 
			
		||||
		initSearchBar() {
 | 
			
		||||
			this.http('/base/core-equipment/listAll', 'get').then(({ data }) => {
 | 
			
		||||
				this.$set(
 | 
			
		||||
					this.searchBarFormConfig[1],
 | 
			
		||||
					'selectOptions',
 | 
			
		||||
					data.map((item) => ({
 | 
			
		||||
						name: item.name,
 | 
			
		||||
						id: item.id,
 | 
			
		||||
					}))
 | 
			
		||||
				);
 | 
			
		||||
			});
 | 
			
		||||
		},
 | 
			
		||||
		/** 查询列表 */
 | 
			
		||||
		getList() {
 | 
			
		||||
			this.loading = true;
 | 
			
		||||
			// 执行查询
 | 
			
		||||
			this.recv(this.queryParams).then((response) => {
 | 
			
		||||
				this.list = response.data.list;
 | 
			
		||||
				this.total = response.data.total;
 | 
			
		||||
				this.loading = false;
 | 
			
		||||
			});
 | 
			
		||||
		},
 | 
			
		||||
		/** 取消按钮 */
 | 
			
		||||
		cancel() {
 | 
			
		||||
			this.open = false;
 | 
			
		||||
			this.mode = null;
 | 
			
		||||
			this.reset();
 | 
			
		||||
		},
 | 
			
		||||
		/** 表单重置 */
 | 
			
		||||
		reset() {
 | 
			
		||||
			this.form = {
 | 
			
		||||
				id: null,
 | 
			
		||||
				name: null,
 | 
			
		||||
				equipmentId: null,
 | 
			
		||||
				description: null,
 | 
			
		||||
				responsible: null
 | 
			
		||||
			};
 | 
			
		||||
			this.resetForm('form');
 | 
			
		||||
		},
 | 
			
		||||
		/** 搜索按钮操作 */
 | 
			
		||||
		handleQuery() {
 | 
			
		||||
			this.queryParams.pageNo = 1;
 | 
			
		||||
			this.getList();
 | 
			
		||||
		},
 | 
			
		||||
		/** 重置按钮操作 */
 | 
			
		||||
		resetQuery() {
 | 
			
		||||
			this.resetForm('queryForm');
 | 
			
		||||
			this.handleQuery();
 | 
			
		||||
		},
 | 
			
		||||
		/** 新增按钮操作 */
 | 
			
		||||
		handleAdd() {
 | 
			
		||||
			this.reset();
 | 
			
		||||
			this.open = true;
 | 
			
		||||
			this.title = '添加备品备件配置';
 | 
			
		||||
		},
 | 
			
		||||
		/** 修改按钮操作 */
 | 
			
		||||
		handleUpdate(row) {
 | 
			
		||||
			this.reset();
 | 
			
		||||
			const id = row.id;
 | 
			
		||||
			this.info({ id }).then((response) => {
 | 
			
		||||
				this.form = response.data;
 | 
			
		||||
				this.open = true;
 | 
			
		||||
				this.title = '修改备品备件配置';
 | 
			
		||||
			});
 | 
			
		||||
		},
 | 
			
		||||
		/** 提交按钮 */
 | 
			
		||||
		submitForm() {
 | 
			
		||||
			this.$refs['form'].validate((valid) => {
 | 
			
		||||
				if (!valid) {
 | 
			
		||||
					return;
 | 
			
		||||
				}
 | 
			
		||||
				// 修改的提交
 | 
			
		||||
				if (this.form.id != null) {
 | 
			
		||||
					this.put(this.form).then((response) => {
 | 
			
		||||
						this.$modal.msgSuccess('修改成功');
 | 
			
		||||
						this.open = false;
 | 
			
		||||
						this.getList();
 | 
			
		||||
					});
 | 
			
		||||
					return;
 | 
			
		||||
				}
 | 
			
		||||
				// 添加的提交
 | 
			
		||||
				this.post(this.form).then((response) => {
 | 
			
		||||
					this.$modal.msgSuccess('新增成功');
 | 
			
		||||
					this.open = false;
 | 
			
		||||
					this.getList();
 | 
			
		||||
				});
 | 
			
		||||
			});
 | 
			
		||||
		},
 | 
			
		||||
		/** 删除按钮操作 */
 | 
			
		||||
		handleDelete(row) {
 | 
			
		||||
			const id = row.id;
 | 
			
		||||
			this.$modal
 | 
			
		||||
				.confirm('是否确认删除记录"' + row.name + '"?')
 | 
			
		||||
				.then(function () {
 | 
			
		||||
					return this.delete({ id });
 | 
			
		||||
				})
 | 
			
		||||
				.then(() => {
 | 
			
		||||
					this.getList();
 | 
			
		||||
					this.$modal.msgSuccess('删除成功');
 | 
			
		||||
				})
 | 
			
		||||
				.catch(() => {});
 | 
			
		||||
		},
 | 
			
		||||
		handleDetail({ id }) {
 | 
			
		||||
			this.reset();
 | 
			
		||||
			this.mode = 'detail';
 | 
			
		||||
			this.info({ id }).then((response) => {
 | 
			
		||||
				this.form = response.data;
 | 
			
		||||
				this.open = true;
 | 
			
		||||
				this.title = '修改备品备件配置';
 | 
			
		||||
			});
 | 
			
		||||
		},
 | 
			
		||||
		/** 导出按钮操作 */
 | 
			
		||||
		handleExport() {
 | 
			
		||||
			// 处理查询参数
 | 
			
		||||
			let params = { ...this.queryParams };
 | 
			
		||||
			params.pageNo = undefined;
 | 
			
		||||
			params.pageSize = undefined;
 | 
			
		||||
			this.$modal
 | 
			
		||||
				.confirm('是否确认导出所有备品备件配置?')
 | 
			
		||||
				.then(() => {
 | 
			
		||||
					this.exportLoading = true;
 | 
			
		||||
					return exportEquipmentTypeExcel(params);
 | 
			
		||||
				})
 | 
			
		||||
				.then((response) => {
 | 
			
		||||
					this.$download.excel(response, '备品备件配置.xls');
 | 
			
		||||
					this.exportLoading = false;
 | 
			
		||||
				})
 | 
			
		||||
				.catch(() => {});
 | 
			
		||||
		},
 | 
			
		||||
	},
 | 
			
		||||
};
 | 
			
		||||
</script>
 | 
			
		||||
							
								
								
									
										65
									
								
								src/views/extend/processEquMaterialBom/SmallTitle.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										65
									
								
								src/views/extend/processEquMaterialBom/SmallTitle.vue
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,65 @@
 | 
			
		||||
<!--
 | 
			
		||||
 * @Author: zhp
 | 
			
		||||
 * @Date: 2023-11-07 19:28:13
 | 
			
		||||
 * @LastEditTime: 2023-11-08 14:11:43
 | 
			
		||||
 * @LastEditors: zhp
 | 
			
		||||
 * @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>
 | 
			
		||||
							
								
								
									
										379
									
								
								src/views/extend/processEquMaterialBom/add-or-updata.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										379
									
								
								src/views/extend/processEquMaterialBom/add-or-updata.vue
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,379 @@
 | 
			
		||||
<!--
 | 
			
		||||
 * @Author: zwq
 | 
			
		||||
 * @Date: 2021-11-18 14:16:25
 | 
			
		||||
 * @LastEditors: zhp
 | 
			
		||||
 * @LastEditTime: 2023-11-10 16:26:08
 | 
			
		||||
 * @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="equipmentId">
 | 
			
		||||
                <el-select v-model="dataForm.equipmentId" filterable :disabled="isdetail" style="width: 100%"
 | 
			
		||||
                  @change="getCode" placeholder="请选择设备名称">
 | 
			
		||||
                  <el-option v-for="dict in equipmentList" :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="equipmentCode">
 | 
			
		||||
                <el-input v-model="dataForm.equipmentCode" clearable :disabled="isdetail" placeholder="请输入设备编码" />
 | 
			
		||||
              </el-form-item>
 | 
			
		||||
            </el-col>
 | 
			
		||||
          </el-row>
 | 
			
		||||
          <el-row :gutter="20">
 | 
			
		||||
            <el-col :span="12">
 | 
			
		||||
              <el-form-item label="设备Bom编码" prop="code">
 | 
			
		||||
                <el-input v-model="dataForm.code" clearable :disabled="isdetail" placeholder="请输入设备Bom编码" />
 | 
			
		||||
              </el-form-item>
 | 
			
		||||
            </el-col>
 | 
			
		||||
            <el-col :span="12">
 | 
			
		||||
              <el-form-item label="设备物料BOM名称" prop="name">
 | 
			
		||||
                <el-input v-model="dataForm.name" clearable :disabled="isdetail" placeholder="请输入设备物料BOM名称" />
 | 
			
		||||
              </el-form-item>
 | 
			
		||||
            </el-col>
 | 
			
		||||
          </el-row>
 | 
			
		||||
          <el-row :gutter="20">
 | 
			
		||||
            <el-col :span="12">
 | 
			
		||||
              <el-form-item label="当前状态" prop="enabled">
 | 
			
		||||
                <el-switch v-model="dataForm.enabled" :active-value="1" :inactive-value="0" />
 | 
			
		||||
              </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;">
 | 
			
		||||
              <el-button type="text" @click="addNew()" icon="el-icon-plus">新增</el-button>
 | 
			
		||||
            </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 {
 | 
			
		||||
  getProcessEquMaterialBom,
 | 
			
		||||
  createProcessEquMaterialBom,
 | 
			
		||||
  updateProcessEquMaterialBom,
 | 
			
		||||
  getEquipmentList,
 | 
			
		||||
  processEquMaterialBomDetPage,
 | 
			
		||||
  deleteProcessEquMaterialBomDet
 | 
			
		||||
} from '@/api/extend/processEquMaterialBom';
 | 
			
		||||
import SmallTitle from './SmallTitle';
 | 
			
		||||
import { parseTime } from '../../core/mixins/code-filter';
 | 
			
		||||
import attrAdd from './attr-add';
 | 
			
		||||
// import {DICT_TYPE, getDictDatas} from "@/utils/dict";
 | 
			
		||||
import { publicFormatter } from '@/utils/dict';
 | 
			
		||||
const tableBtn = [
 | 
			
		||||
	{
 | 
			
		||||
		type: 'edit',
 | 
			
		||||
		btnName: '编辑',
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		type: 'delete',
 | 
			
		||||
		btnName: '删除',
 | 
			
		||||
	},
 | 
			
		||||
];
 | 
			
		||||
const tableProps = [
 | 
			
		||||
	{
 | 
			
		||||
    prop: 'materialName',
 | 
			
		||||
		label: '物料名称',
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
    prop: 'materialCode',
 | 
			
		||||
    label: '物料编码',
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
    prop: 'unit',
 | 
			
		||||
    label: '单位',
 | 
			
		||||
    filter: publicFormatter('unit_dict')
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'num',
 | 
			
		||||
    label: '数量',
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'remark',
 | 
			
		||||
    label: '备注',
 | 
			
		||||
  },
 | 
			
		||||
];
 | 
			
		||||
 | 
			
		||||
const topBtnConfig = [
 | 
			
		||||
  {
 | 
			
		||||
    type: 'add',
 | 
			
		||||
    btnName: 'btn.add'
 | 
			
		||||
  }
 | 
			
		||||
]
 | 
			
		||||
 | 
			
		||||
export default {
 | 
			
		||||
	mixins: [basicAdd],
 | 
			
		||||
	components: { SmallTitle, attrAdd },
 | 
			
		||||
	data() {
 | 
			
		||||
		return {
 | 
			
		||||
			tableBtn,
 | 
			
		||||
			tableProps,
 | 
			
		||||
			topBtnConfig,
 | 
			
		||||
			addOrUpdateVisible: false,
 | 
			
		||||
			urlOptions: {
 | 
			
		||||
			  isGetCode: false,
 | 
			
		||||
        // codeURL: getCode,
 | 
			
		||||
        createURL:createProcessEquMaterialBom,
 | 
			
		||||
        updateURL: updateProcessEquMaterialBom,
 | 
			
		||||
        infoURL: getProcessEquMaterialBom,
 | 
			
		||||
			},
 | 
			
		||||
			listQuery: {
 | 
			
		||||
				pageSize: 10,
 | 
			
		||||
				pageNo: 1,
 | 
			
		||||
				total: 0,
 | 
			
		||||
      },
 | 
			
		||||
      equipmentList:[],
 | 
			
		||||
			dataForm: {
 | 
			
		||||
        id: undefined,
 | 
			
		||||
        code: undefined,
 | 
			
		||||
        name: '',
 | 
			
		||||
				equipmentId: undefined,
 | 
			
		||||
        equipmentCode: undefined,
 | 
			
		||||
        enabled: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" }],
 | 
			
		||||
				equipmentId: [{ required: true, message: "设备名称不能为空", trigger: "change" }],
 | 
			
		||||
				// : [{ required: true, message: "产品类型不能为空", trigger: "change" }],
 | 
			
		||||
				// processTime: [{ required: true, message: "产线生产单位用时不能为空", trigger: "blur" }]
 | 
			
		||||
      }
 | 
			
		||||
		};
 | 
			
		||||
	},
 | 
			
		||||
  mounted() {
 | 
			
		||||
    this.getDict()
 | 
			
		||||
  },
 | 
			
		||||
  methods: {
 | 
			
		||||
    getCode(val) {
 | 
			
		||||
      this.equipmentList.forEach((ele) => {
 | 
			
		||||
        if (val === ele.id) {
 | 
			
		||||
          this.dataForm.equipmentCode = ele.code
 | 
			
		||||
        }
 | 
			
		||||
      })
 | 
			
		||||
    },
 | 
			
		||||
    // clickTopBtn(val) {
 | 
			
		||||
    //   if (val === 'add') {
 | 
			
		||||
    //     this.addNew()
 | 
			
		||||
    //   }
 | 
			
		||||
    // },
 | 
			
		||||
		initData() {
 | 
			
		||||
			this.productAttrList.splice(0);
 | 
			
		||||
			this.listQuery.total = 0;
 | 
			
		||||
    },
 | 
			
		||||
    getDict() {
 | 
			
		||||
      getEquipmentList().then((res) => {
 | 
			
		||||
 | 
			
		||||
        // console.log(res);
 | 
			
		||||
        // console.log(response);
 | 
			
		||||
        this.equipmentList = res.data
 | 
			
		||||
      })
 | 
			
		||||
    },
 | 
			
		||||
		handleClick(raw) {
 | 
			
		||||
			if (raw.type === 'delete') {
 | 
			
		||||
				this.$confirm(
 | 
			
		||||
					`确定对${
 | 
			
		||||
          raw.data.materialName
 | 
			
		||||
            ? '[物料名称为' + raw.data.materialName + ']'
 | 
			
		||||
            : '[序号为' + raw.data.materialName + ']'
 | 
			
		||||
					}进行删除操作?`,
 | 
			
		||||
					'提示',
 | 
			
		||||
					{
 | 
			
		||||
						confirmButtonText: '确定',
 | 
			
		||||
						cancelButtonText: '取消',
 | 
			
		||||
						type: 'warning',
 | 
			
		||||
					}
 | 
			
		||||
				)
 | 
			
		||||
					.then(() => {
 | 
			
		||||
            deleteProcessEquMaterialBomDet(raw.data.id).then(({ data }) => {
 | 
			
		||||
							this.$message({
 | 
			
		||||
								message: '操作成功',
 | 
			
		||||
								type: 'success',
 | 
			
		||||
								duration: 1500,
 | 
			
		||||
								onClose: () => {
 | 
			
		||||
									this.getList();
 | 
			
		||||
								},
 | 
			
		||||
							});
 | 
			
		||||
						});
 | 
			
		||||
					})
 | 
			
		||||
					.catch(() => {});
 | 
			
		||||
			} else {
 | 
			
		||||
				this.addNew(raw.data.id);
 | 
			
		||||
			}
 | 
			
		||||
		},
 | 
			
		||||
		getList() {
 | 
			
		||||
			// 获取产品属性列表
 | 
			
		||||
      processEquMaterialBomDetPage({
 | 
			
		||||
				...this.listQuery,
 | 
			
		||||
				bomId: 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({
 | 
			
		||||
            bomId: id,
 | 
			
		||||
            pageNo: 1,
 | 
			
		||||
            pageSize:10
 | 
			
		||||
          }).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,this.dataForm.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>
 | 
			
		||||
							
								
								
									
										149
									
								
								src/views/extend/processEquMaterialBom/attr-add.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										149
									
								
								src/views/extend/processEquMaterialBom/attr-add.vue
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,149 @@
 | 
			
		||||
<!--
 | 
			
		||||
 * @Author: zhp
 | 
			
		||||
 * @Date: 2023-11-08 15:30:27
 | 
			
		||||
 * @LastEditTime: 2023-11-09 14:11:02
 | 
			
		||||
 * @LastEditors: zhp
 | 
			
		||||
 * @Description:
 | 
			
		||||
-->
 | 
			
		||||
<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="materialId">
 | 
			
		||||
        <el-select v-model="dataForm.materialId" filterable placeholder="请选择物料名称">
 | 
			
		||||
          <el-option v-for="dict in materialList" :key=" dict.id" :label="dict.name" :value="dict.id" />
 | 
			
		||||
        </el-select>
 | 
			
		||||
      </el-form-item>
 | 
			
		||||
      <el-form-item label="数量" prop="num">
 | 
			
		||||
        <el-input v-model="dataForm.num" 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 {
 | 
			
		||||
  getProcessEquMaterialBomDet,
 | 
			
		||||
  createProcessEquMaterialBomDet,
 | 
			
		||||
  updateProcessEquMaterialBomDet,
 | 
			
		||||
  getMaterialList
 | 
			
		||||
} from '@/api/extend/processEquMaterialBom';
 | 
			
		||||
 | 
			
		||||
export default {
 | 
			
		||||
	props: {
 | 
			
		||||
		productId: {
 | 
			
		||||
			type: String,
 | 
			
		||||
			default: '',
 | 
			
		||||
		},
 | 
			
		||||
	},
 | 
			
		||||
	data() {
 | 
			
		||||
		return {
 | 
			
		||||
      visible: false,
 | 
			
		||||
      materialList:[],
 | 
			
		||||
			dataForm: {
 | 
			
		||||
				id: undefined,
 | 
			
		||||
        bomId: undefined,
 | 
			
		||||
        materialId:null,
 | 
			
		||||
        num: undefined,
 | 
			
		||||
			},
 | 
			
		||||
			dataRule: {
 | 
			
		||||
				attrName: [{ required: true, message: '名称不能为空', trigger: 'blur' }],
 | 
			
		||||
			},
 | 
			
		||||
		};
 | 
			
		||||
  },
 | 
			
		||||
  mounted () {
 | 
			
		||||
    this.getDict();
 | 
			
		||||
  },
 | 
			
		||||
	methods: {
 | 
			
		||||
		init(id,bomId) {
 | 
			
		||||
      this.dataForm.id = id || '';
 | 
			
		||||
      this.dataForm.bomId = bomId || '';
 | 
			
		||||
      console.log(bomId);
 | 
			
		||||
			this.visible = true;
 | 
			
		||||
			this.$nextTick(() => {
 | 
			
		||||
				this.$refs['dataForm'].resetFields();
 | 
			
		||||
				if (this.dataForm.id) {
 | 
			
		||||
          getProcessEquMaterialBomDet({
 | 
			
		||||
						id: this.dataForm.id
 | 
			
		||||
					}).then((res) => {
 | 
			
		||||
            this.dataForm = res.data;
 | 
			
		||||
            // this.dataForm.materialId = materialId;
 | 
			
		||||
						// this.dataForm.value = value;
 | 
			
		||||
					});
 | 
			
		||||
				}
 | 
			
		||||
			});
 | 
			
		||||
    },
 | 
			
		||||
    getDict() {
 | 
			
		||||
      getMaterialList().then((res) => [
 | 
			
		||||
        this.materialList = res.data,
 | 
			
		||||
        console.log(res)
 | 
			
		||||
      ])
 | 
			
		||||
    },
 | 
			
		||||
		// 表单提交
 | 
			
		||||
		dataFormSubmit() {
 | 
			
		||||
			this.$refs['dataForm'].validate((valid) => {
 | 
			
		||||
				if (valid) {
 | 
			
		||||
					// 修改的提交
 | 
			
		||||
					if (this.dataForm.id) {
 | 
			
		||||
						updateProcessEquMaterialBomDet({
 | 
			
		||||
							...this.dataForm,
 | 
			
		||||
							productId: this.productId,
 | 
			
		||||
						}).then((response) => {
 | 
			
		||||
							this.$modal.msgSuccess('修改成功');
 | 
			
		||||
							this.visible = false;
 | 
			
		||||
							this.$emit('refreshDataList');
 | 
			
		||||
						});
 | 
			
		||||
						return;
 | 
			
		||||
					}
 | 
			
		||||
					// 添加的提交
 | 
			
		||||
					createProcessEquMaterialBomDet({
 | 
			
		||||
						...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>
 | 
			
		||||
Some files were not shown because too many files have changed in this diff Show More
		Reference in New Issue
	
	Block a user