Compare commits
	
		
			122 Commits
		
	
	
		
			c8fb8d7589
			...
			projects/m
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| be430ebbff | |||
| eb063779b4 | |||
| 
						 | 
					a2672c1742 | ||
| 4e97989ede | |||
| 
						 | 
					67200710c9 | ||
| 7e2b75aaa5 | |||
| 8ad9b9d717 | |||
| 3bf2757e42 | |||
| 
						 | 
					2267444b4a | ||
| 
						 | 
					fa5a303c08 | ||
| 
						 | 
					37586a31c5 | ||
| 
						 | 
					40b023cd8d | ||
| 5dce57e4bb | |||
| 50a75dcb74 | |||
| 9ed4c944c5 | |||
| 6702521f31 | |||
| 61b4bf784b | |||
| b0f10b9002 | |||
| f37bba6747 | |||
| 365aafc21a | |||
| de65afef11 | |||
| a135877df1 | |||
| 
						 | 
					8d26a9e487 | ||
| 
						 | 
					76771489da | ||
| 
						 | 
					27faa04c7a | ||
| c0daa74a84 | |||
| 6e7339bca3 | |||
| 
						 | 
					904350a4d8 | ||
| 
						 | 
					4873f750d8 | ||
| 13b522475e | |||
| 1a7e8cfc19 | |||
| a0790a6e19 | |||
| b76b8f4fe9 | |||
| 978291e68a | |||
| a5c17d2276 | |||
| a7b4e72bc2 | |||
| 99f771a445 | |||
| 7201c26792 | |||
| ad56aaf359 | |||
| 
						 | 
					5033bbb206 | ||
| 
						 | 
					6fc4794300 | ||
| 
						 | 
					79c9f1ca66 | ||
| c74269b282 | |||
| 57deff3875 | |||
| 68d3b46bab | |||
| e6b9d75f16 | |||
| 4323982b89 | |||
| 
						 | 
					c76078214e | ||
| 
						 | 
					b527589e0f | ||
| 375273419d | |||
| a18929a261 | |||
| 6d465c17c2 | |||
| 669345c983 | |||
| b86094c630 | |||
| 2fdee9cafd | |||
| 4348d66e53 | |||
| 76c2f50bf3 | |||
| 888b5aa91f | |||
| 
						 | 
					a7f1087775 | ||
| 
						 | 
					b0efd66a75 | ||
| d9f3434712 | |||
| 51f72ea5d2 | |||
| d5507ec4c0 | |||
| 8802c932e2 | |||
| ee26741e62 | |||
| 
						 | 
					7f5b9d5228 | ||
| 
						 | 
					9eea7e049a | ||
| 328b3ff560 | |||
| b3a117f6c6 | |||
| 8929e53724 | |||
| a8fa98cb91 | |||
| db081c1bd1 | |||
| 3e9540bcc9 | |||
| 69ceadab69 | |||
| 601387184e | |||
| 54b63a7f53 | |||
| b625ef0118 | |||
| 
						 | 
					8004c85c32 | ||
| 
						 | 
					9041428003 | ||
| 39d06cd902 | |||
| d79ba71bd7 | |||
| 0225be1c94 | |||
| 265024d989 | |||
| 960751a264 | |||
| 978aa3a1d1 | |||
| 2eb1afe9b2 | |||
| 8cd53915c1 | |||
| 571d204d68 | |||
| 
						 | 
					8dbc1d512d | ||
| 
						 | 
					8af06c6c42 | ||
| 
						 | 
					afafbccc0c | ||
| 
						 | 
					0948737f1a | ||
| 0ce6bc07a0 | |||
| e318aa4f59 | |||
| ab09a2b08c | |||
| d2d5503792 | |||
| 6940155e4f | |||
| dfc758bfae | |||
| de15716b7c | |||
| ec2994e928 | |||
| c736992a34 | |||
| 
						 | 
					5492666b53 | ||
| cd55b4c860 | |||
| 
						 | 
					a7f811aa3e | ||
| 33188481bf | |||
| dcbb2c719b | |||
| 0200fc08f1 | |||
| 
						 | 
					a22da566c3 | ||
| 
						 | 
					3c99ddc4c0 | ||
| 96705bd4d9 | |||
| ac28476024 | |||
| 1299a56e22 | |||
| b348a31b24 | |||
| bc2940ca99 | |||
| 67d639c413 | |||
| c6d618b2b8 | |||
| aa79d15f52 | |||
| 76938951ed | |||
| 8b91e7812f | |||
| 9cffa01414 | |||
| 905479d5f4 | |||
| c1ae248234 | 
							
								
								
									
										13
									
								
								.env.dev
									
									
									
									
									
								
							
							
						
						
									
										13
									
								
								.env.dev
									
									
									
									
									
								
							@@ -1,7 +1,7 @@
 | 
			
		||||
###
 | 
			
		||||
 # @Author: Do not edit
 | 
			
		||||
 # @Date: 2023-08-29 09:40:39
 | 
			
		||||
 # @LastEditTime: 2023-11-16 14:07:34
 | 
			
		||||
 # @LastEditTime: 2023-11-21 10:36:47
 | 
			
		||||
 # @LastEditors: DY
 | 
			
		||||
 # @Description:
 | 
			
		||||
###
 | 
			
		||||
@@ -13,13 +13,13 @@ 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.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:48082'
 | 
			
		||||
# VUE_APP_BASE_API = 'http://192.168.1.49:48082'
 | 
			
		||||
# VUE_APP_BASE_API = 'http://192.168.1.8:48082'
 | 
			
		||||
# VUE_APP_BASE_API = 'http://192.168.4.159:48080'
 | 
			
		||||
# VUE_APP_BASE_API = 'http://192.168.1.56:48080'
 | 
			
		||||
# VUE_APP_BASE_API = 'http://192.168.1.56:48082'
 | 
			
		||||
# VUE_APP_BASE_API = 'http://192.168.4.159:48080'
 | 
			
		||||
 | 
			
		||||
# 积木报表指向地址
 | 
			
		||||
@@ -31,9 +31,6 @@ VUE_CLI_BABEL_TRANSPILE_MODULES = true
 | 
			
		||||
# 多租户的开关
 | 
			
		||||
VUE_APP_TENANT_ENABLE = true
 | 
			
		||||
 | 
			
		||||
# 验证码的开关
 | 
			
		||||
VUE_APP_CAPTCHA_ENABLE = true
 | 
			
		||||
 | 
			
		||||
# 文档的开关
 | 
			
		||||
VUE_APP_DOC_ENABLE = true
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -14,9 +14,6 @@ VUE_CLI_BABEL_TRANSPILE_MODULES = true
 | 
			
		||||
# 多租户的开关
 | 
			
		||||
VUE_APP_TENANT_ENABLE = true
 | 
			
		||||
 | 
			
		||||
# 验证码的开关
 | 
			
		||||
VUE_APP_CAPTCHA_ENABLE = true
 | 
			
		||||
 | 
			
		||||
# 文档的开关
 | 
			
		||||
VUE_APP_DOC_ENABLE = true
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										10
									
								
								.env.prod
									
									
									
									
									
								
							
							
						
						
									
										10
									
								
								.env.prod
									
									
									
									
									
								
							@@ -15,22 +15,18 @@ VUE_APP_TITLE = MES系统
 | 
			
		||||
VUE_APP_BASE_API = '/prod-api'
 | 
			
		||||
 | 
			
		||||
# 积木报表指向地址
 | 
			
		||||
VUE_APP_JIMU_API = 'http://192.168.0.33:48082'
 | 
			
		||||
VUE_APP_JIMU_API = 'http://10.70.2.2:8080'
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# 根据服务器或域名修改
 | 
			
		||||
# PUBLIC_PATH = 'http://my-pi.com:8888/yudao-admin/'
 | 
			
		||||
PUBLIC_PATH = 'http://192.168.0.33:8889/'
 | 
			
		||||
PUBLIC_PATH = 'http://10.70.2.32'
 | 
			
		||||
 | 
			
		||||
# 二级部署路径
 | 
			
		||||
VUE_APP_APP_NAME ='yudao-admin'
 | 
			
		||||
# VUE_APP_APP_NAME ='yudao-admin'
 | 
			
		||||
 | 
			
		||||
# 多租户的开关
 | 
			
		||||
VUE_APP_TENANT_ENABLE = true
 | 
			
		||||
 | 
			
		||||
# 验证码的开关
 | 
			
		||||
VUE_APP_CAPTCHA_ENABLE = true
 | 
			
		||||
 | 
			
		||||
# 文档的开关
 | 
			
		||||
VUE_APP_DOC_ENABLE = false
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										25
									
								
								.env.stage
									
									
									
									
									
								
							
							
						
						
									
										25
									
								
								.env.stage
									
									
									
									
									
								
							@@ -1,26 +1,27 @@
 | 
			
		||||
NODE_ENV = production
 | 
			
		||||
# 生产环境配置
 | 
			
		||||
ENV = 'production'
 | 
			
		||||
 | 
			
		||||
# 页面标题
 | 
			
		||||
VUE_APP_TITLE = 产线监控系统
 | 
			
		||||
VUE_APP_TITLE = MES系统
 | 
			
		||||
 | 
			
		||||
# 测试环境配置
 | 
			
		||||
ENV = 'staging'
 | 
			
		||||
# 芋道管理系统/生产环境
 | 
			
		||||
VUE_APP_BASE_API = '/prod-api'
 | 
			
		||||
 | 
			
		||||
# 芋道管理系统/测试环境
 | 
			
		||||
VUE_APP_BASE_API = 'http://api-dashboard.yudao.iocoder.cn'
 | 
			
		||||
# 积木报表指向地址
 | 
			
		||||
VUE_APP_JIMU_API = 'http://192.168.0.33:48082'
 | 
			
		||||
 | 
			
		||||
# 静态资源地址
 | 
			
		||||
PUBLIC_PATH = 'http://static.yudao.iocoder.cn/'
 | 
			
		||||
 | 
			
		||||
# 根据服务器或域名修改
 | 
			
		||||
PUBLIC_PATH = 'http://192.168.0.33:8889/'
 | 
			
		||||
 | 
			
		||||
# 二级部署路径
 | 
			
		||||
# VUE_APP_APP_NAME ='yudao-admin'
 | 
			
		||||
 | 
			
		||||
# 多租户的开关
 | 
			
		||||
VUE_APP_TENANT_ENABLE = true
 | 
			
		||||
 | 
			
		||||
# 验证码的开关
 | 
			
		||||
VUE_APP_CAPTCHA_ENABLE = true
 | 
			
		||||
 | 
			
		||||
# 文档的开关
 | 
			
		||||
VUE_APP_DOC_ENABLE = false
 | 
			
		||||
 | 
			
		||||
# 百度统计
 | 
			
		||||
VUE_APP_BAIDU_CODE = fadc1bd5db1a1d6f581df60a1807f8ab
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -17,9 +17,6 @@ VUE_APP_APP_NAME ='/admin-ui-vue2/'
 | 
			
		||||
# 多租户的开关
 | 
			
		||||
VUE_APP_TENANT_ENABLE = true
 | 
			
		||||
 | 
			
		||||
# 验证码的开关
 | 
			
		||||
VUE_APP_CAPTCHA_ENABLE = true
 | 
			
		||||
 | 
			
		||||
# 文档的开关
 | 
			
		||||
VUE_APP_DOC_ENABLE = true
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
										
											Binary file not shown.
										
									
								
							| 
		 Before Width: | Height: | Size: 2.0 KiB After Width: | Height: | Size: 4.2 KiB  | 
@@ -18,6 +18,15 @@ export function deliveryProgressPage(data) {
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// 获取订单列表
 | 
			
		||||
export function listOrderList(query) {
 | 
			
		||||
  return request({
 | 
			
		||||
    url: '/extend/delivery-log/listOrderList',
 | 
			
		||||
    method: 'get',
 | 
			
		||||
    params: query
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// 获取发货进度分页
 | 
			
		||||
export function deliveryLogDetPage(data) {
 | 
			
		||||
  return request({
 | 
			
		||||
 
 | 
			
		||||
@@ -1,7 +1,7 @@
 | 
			
		||||
/*
 | 
			
		||||
 * @Author: Do not edit
 | 
			
		||||
 * @Date: 2023-10-21 11:50:46
 | 
			
		||||
 * @LastEditTime: 2023-10-26 20:06:29
 | 
			
		||||
 * @LastEditTime: 2023-11-27 17:54:28
 | 
			
		||||
 * @LastEditors: DY
 | 
			
		||||
 * @Description: 
 | 
			
		||||
 */
 | 
			
		||||
@@ -110,3 +110,11 @@ export function deleteMaterialPBDet(id) {
 | 
			
		||||
    method: 'delete'
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// 获得产品Bom详细
 | 
			
		||||
export function getMaterialPBDet(id) {
 | 
			
		||||
  return request({
 | 
			
		||||
    url: '/base/material-product-bom-det/get?id=' + id,
 | 
			
		||||
    method: 'get'
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -113,6 +113,15 @@ export function orderMonitor(query) {
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// 获取订单绑定的工单和数量信息,可传订单id列表,map索引为订单id
 | 
			
		||||
export function orderAssignmentList(query) {
 | 
			
		||||
  return request({
 | 
			
		||||
    url: '/base/order/orderAssignmentList',
 | 
			
		||||
    method: 'get',
 | 
			
		||||
    params: query
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// 获得所有客户列表
 | 
			
		||||
export function customerList() {
 | 
			
		||||
  return request({
 | 
			
		||||
 
 | 
			
		||||
@@ -1,3 +1,10 @@
 | 
			
		||||
/*
 | 
			
		||||
 * @Author: zhp
 | 
			
		||||
 * @Date: 2023-10-17 09:26:38
 | 
			
		||||
 * @LastEditTime: 2023-11-20 15:50:08
 | 
			
		||||
 * @LastEditors: zhp
 | 
			
		||||
 * @Description:
 | 
			
		||||
 */
 | 
			
		||||
import request from '@/utils/request'
 | 
			
		||||
 | 
			
		||||
// 创建质量检测信息基础
 | 
			
		||||
@@ -52,3 +59,11 @@ export function exportQualityInspectionDetExcel(query) {
 | 
			
		||||
    responseType: 'blob'
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
export function getQualityInspectionDetList(query) {
 | 
			
		||||
  return request({
 | 
			
		||||
    url: '/base/quality-inspection-det/listAll',
 | 
			
		||||
    method: 'get',
 | 
			
		||||
    params: query
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -1,7 +1,7 @@
 | 
			
		||||
/*
 | 
			
		||||
 * @Author: Do not edit
 | 
			
		||||
 * @Date: 2023-11-08 15:56:52
 | 
			
		||||
 * @LastEditTime: 2023-11-13 08:52:12
 | 
			
		||||
 * @LastEditTime: 2023-11-25 16:22:49
 | 
			
		||||
 * @LastEditors: DY
 | 
			
		||||
 * @Description: 
 | 
			
		||||
 */
 | 
			
		||||
@@ -66,3 +66,37 @@ export function getcheckList(query) {
 | 
			
		||||
    params: query
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// 删除巡检内容
 | 
			
		||||
export function deleteCheck(id) {
 | 
			
		||||
  return request({
 | 
			
		||||
    url: '/base/equipment-check/delete?id=' + id,
 | 
			
		||||
    method: 'delete'
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// 获得设备巡检设置code
 | 
			
		||||
export function getCode() {
 | 
			
		||||
  return request({
 | 
			
		||||
    url: '/base/equipment-check-config/getCode',
 | 
			
		||||
    method: 'get'
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// 创建巡检配置
 | 
			
		||||
export function createCheckConfig(data) {
 | 
			
		||||
  return request({
 | 
			
		||||
    url: '/base/equipment-check-config/create',
 | 
			
		||||
    method: 'post',
 | 
			
		||||
    data: data
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// 更新巡检配置
 | 
			
		||||
export function updateCheckConfig(data) {
 | 
			
		||||
  return request({
 | 
			
		||||
    url: '/base/equipment-check-config/update',
 | 
			
		||||
    method: 'put',
 | 
			
		||||
    data: data
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -1,7 +1,7 @@
 | 
			
		||||
/*
 | 
			
		||||
 * @Author: Do not edit
 | 
			
		||||
 * @Date: 2023-11-08 15:56:52
 | 
			
		||||
 * @LastEditTime: 2023-11-16 20:22:12
 | 
			
		||||
 * @LastEditTime: 2023-11-23 19:10:07
 | 
			
		||||
 * @LastEditors: DY
 | 
			
		||||
 * @Description: 
 | 
			
		||||
 */
 | 
			
		||||
@@ -14,3 +14,31 @@ export function deleteEqMaintainLog(id) {
 | 
			
		||||
    method: 'delete'
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// 删除设备保养计划配置
 | 
			
		||||
export function deleteEqMaintainPlan(id) {
 | 
			
		||||
  return request({
 | 
			
		||||
    url: '/base/equipment-maintain-plan/delete?id=' + id,
 | 
			
		||||
    method: 'delete'
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// 导出设备保养监控
 | 
			
		||||
export function exportMaintainMonitorExcel(query) {
 | 
			
		||||
  return request({
 | 
			
		||||
    url: '/base/equipment-maintain-plan/monitor-export',
 | 
			
		||||
    method: 'get',
 | 
			
		||||
    params: query,
 | 
			
		||||
    responseType: 'blob'
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// 导出设备保养记录
 | 
			
		||||
export function exportMaintainLogExcel(query) {
 | 
			
		||||
  return request({
 | 
			
		||||
    url: '/base/equipment-maintain-log/export-excel',
 | 
			
		||||
    method: 'get',
 | 
			
		||||
    params: query,
 | 
			
		||||
    responseType: 'blob'
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -1,7 +1,7 @@
 | 
			
		||||
/*
 | 
			
		||||
 * @Author: Do not edit
 | 
			
		||||
 * @Date: 2023-11-10 16:09:33
 | 
			
		||||
 * @LastEditTime: 2023-11-16 18:57:08
 | 
			
		||||
 * @LastEditTime: 2023-11-23 20:29:28
 | 
			
		||||
 * @LastEditors: DY
 | 
			
		||||
 * @Description: 
 | 
			
		||||
 */
 | 
			
		||||
@@ -31,3 +31,13 @@ export function deleteRepair(id) {
 | 
			
		||||
    method: 'delete'
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// 导出设备维修
 | 
			
		||||
export function exportRepairLogExcel(query) {
 | 
			
		||||
  return request({
 | 
			
		||||
    url: '/base/equipment-repair-log/export-excel',
 | 
			
		||||
    method: 'get',
 | 
			
		||||
    params: query,
 | 
			
		||||
    responseType: 'blob'
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										16
									
								
								src/api/equipment/base/spare-parts/list.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										16
									
								
								src/api/equipment/base/spare-parts/list.js
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,16 @@
 | 
			
		||||
/*
 | 
			
		||||
 * @Author: Do not edit
 | 
			
		||||
 * @Date: 2023-11-22 13:59:17
 | 
			
		||||
 * @LastEditTime: 2023-11-22 13:59:45
 | 
			
		||||
 * @LastEditors: DY
 | 
			
		||||
 * @Description: 
 | 
			
		||||
 */
 | 
			
		||||
import request from '@/utils/request'
 | 
			
		||||
 | 
			
		||||
// 删除设备备品备件
 | 
			
		||||
export function deleteSparePart(id) {
 | 
			
		||||
  return request({
 | 
			
		||||
    url: '/base/equipment-spare-part/delete?id=' + id,
 | 
			
		||||
    method: 'delete'
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
@@ -1,7 +1,7 @@
 | 
			
		||||
/*
 | 
			
		||||
 * @Author: zhp
 | 
			
		||||
 * @Date: 2023-11-07 19:47:48
 | 
			
		||||
 * @LastEditTime: 2023-11-16 17:49:23
 | 
			
		||||
 * @LastEditTime: 2023-11-23 13:57:41
 | 
			
		||||
 * @LastEditors: zhp
 | 
			
		||||
 * @Description:
 | 
			
		||||
 */
 | 
			
		||||
@@ -104,3 +104,18 @@ export function getMaterialList(data) {
 | 
			
		||||
    data: data
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
export function getMaterialCode(data) {
 | 
			
		||||
  return request({
 | 
			
		||||
    url: '/extend/process-equ-material-bom/getCode',
 | 
			
		||||
    method: 'get',
 | 
			
		||||
    params: data
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
export function createProcessEquMaterialBomDetList(data) {
 | 
			
		||||
  return request({
 | 
			
		||||
    url: '/extend/process-equ-material-bom-det/createByList',
 | 
			
		||||
    method: 'post',
 | 
			
		||||
    data: data
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -1,7 +1,7 @@
 | 
			
		||||
/*
 | 
			
		||||
 * @Author: zhp
 | 
			
		||||
 * @Date: 2023-11-09 09:37:14
 | 
			
		||||
 * @LastEditTime: 2023-11-16 17:47:21
 | 
			
		||||
 * @LastEditTime: 2023-11-23 14:15:45
 | 
			
		||||
 * @LastEditors: zhp
 | 
			
		||||
 * @Description:
 | 
			
		||||
 */
 | 
			
		||||
@@ -104,3 +104,19 @@ export function getValueList(data) {
 | 
			
		||||
    params: data
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
export function getValueCode(data) {
 | 
			
		||||
  return request({
 | 
			
		||||
    url: '/extend/process-equ-value-bom/getCode',
 | 
			
		||||
    method: 'get',
 | 
			
		||||
    params: data
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
export function createProcessEquValueBomDetList(data) {
 | 
			
		||||
  return request({
 | 
			
		||||
    url: '/extend/process-equ-value-bom-det/createByList',
 | 
			
		||||
    method: 'post',
 | 
			
		||||
    data: data
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -1,7 +1,7 @@
 | 
			
		||||
/*
 | 
			
		||||
 * @Author: zhp
 | 
			
		||||
 * @Date: 2023-10-31 15:05:06
 | 
			
		||||
 * @LastEditTime: 2023-11-03 09:05:50
 | 
			
		||||
 * @LastEditTime: 2023-11-28 09:28:05
 | 
			
		||||
 * @LastEditors: zhp
 | 
			
		||||
 * @Description:
 | 
			
		||||
 */
 | 
			
		||||
@@ -24,6 +24,14 @@ export function getWorkOrderList(query) {
 | 
			
		||||
    params: query,
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
export function getCoreProduct(id) {
 | 
			
		||||
  return request({
 | 
			
		||||
    url: '/base/core-product/get?id=' + id,
 | 
			
		||||
    method: 'get'
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// 导出物料信息
 | 
			
		||||
// export function exportEnergyPlcExcel(query) {
 | 
			
		||||
//   return request({
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										20
									
								
								src/assets/icons/svg/order-monitoring.svg
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										20
									
								
								src/assets/icons/svg/order-monitoring.svg
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,20 @@
 | 
			
		||||
<?xml version="1.0" encoding="UTF-8"?>
 | 
			
		||||
<svg width="16px" height="16px" viewBox="0 0 16 16" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
 | 
			
		||||
    <title>编组 17</title>
 | 
			
		||||
    <g id="页面" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" opacity="0.695141">
 | 
			
		||||
        <g id="最新参考" transform="translate(-1780.000000, -57.000000)" fill="#000000" fill-rule="nonzero">
 | 
			
		||||
            <g id="编组-4" transform="translate(1772.000000, 48.000000)">
 | 
			
		||||
                <g id="编组-17" transform="translate(8.000000, 9.000000)">
 | 
			
		||||
                    <rect id="矩形备份-2" opacity="0" x="0" y="0" width="16" height="16"></rect>
 | 
			
		||||
                    <g id="文档" transform="translate(2.436519, 1.472460)">
 | 
			
		||||
                        <path d="M9.61879642,0.990942446 C9.83682412,0.990942446 10.0548518,1.18867806 10.0548518,1.38641367 L10.0548518,11.6686655 C10.0548518,11.8664011 9.83682412,12.0641367 9.61879642,12.0641367 L3.60123204,12.0641367 L1.02850524,9.69130935 L1.02850524,1.38641367 C1.02850524,1.18867806 1.24653294,0.990942446 1.46456063,0.990942446 L9.61879642,0.990942446 M9.61879642,0.2 L1.50816617,0.2 C0.810477546,0.2 0.2,0.753659712 0.2,1.38641367 L0.2,10.0076863 L3.25238773,12.8550791 L9.61879642,12.8550791 C10.316485,12.8550791 10.9269626,12.3014194 10.9269626,11.6686655 L10.9269626,1.38641367 C10.9269626,0.753659712 10.316485,0.2 9.61879642,0.2 Z" id="形状"></path>
 | 
			
		||||
                        <path d="M9.61879642,0 C10.4228194,0 11.1269626,0.638607809 11.1269626,1.38641367 L11.1269626,11.6686655 C11.1269626,12.4164713 10.4228194,13.0550791 9.61879642,13.0550791 L3.25238773,13.0550791 L3.11596256,13.0013261 L0.0635748259,10.1539333 L0,10.0076863 L0,1.38641367 C0,0.638607809 0.704143212,0 1.50816617,0 L9.61879642,0 Z M9.61879642,0.4 L1.50816617,0.4 C0.91681188,0.4 0.4,0.868711615 0.4,1.38641367 L0.4,9.921 L3.331,12.6550791 L9.61879642,12.6550791 C10.1707271,12.6550791 10.657723,12.2467792 10.7202028,11.7714283 L10.7269626,11.6686655 L10.7269626,1.38641367 C10.7269626,0.868711615 10.2101507,0.4 9.61879642,0.4 Z M9.61879642,0.790942446 C9.94315845,0.790942446 10.2548518,1.07362615 10.2548518,1.38641367 L10.2548518,11.6686655 C10.2548518,11.981453 9.94315845,12.2641367 9.61879642,12.2641367 L3.60123204,12.2641367 L3.46563766,12.2111542 L0.892910861,9.83832691 L0.828505241,9.69130935 L0.828505241,1.38641367 C0.828505241,1.07362615 1.1401986,0.790942446 1.46456063,0.790942446 L9.61879642,0.790942446 Z M9.69667678,1.08901006 L1.38668992,1.08901006 C1.27286315,1.08901006 1.14612572,1.20395189 1.14612572,1.28821491 L1.14561083,9.66174324 L3.64342649,11.9659298 L9.69667678,11.9660691 C9.79153243,11.9660691 9.8953538,11.8862484 9.92732605,11.8108781 L9.93724098,11.7668642 L9.93724098,1.28821491 C9.93724098,1.20395189 9.81050356,1.08901006 9.69667678,1.08901006 Z" id="形状"></path>
 | 
			
		||||
                        <path d="M4.54092961,3.67913093 L2.25985278,3.67913093 C2.22052387,3.67913093 2.22052387,3.65291165 2.22052387,3.65291165 L2.22052387,2.91877199 C2.22052387,2.89255271 2.22052387,2.89255271 2.25985278,2.89255271 L4.54092961,2.89255271 C4.58025852,2.89255271 4.58025852,2.89255271 4.58025852,2.91877199 L4.58025852,3.65291165 L4.54092961,3.67913093 Z M8.86710981,5.44893192 L2.25985278,5.44893192 C2.22052387,5.44893192 2.22052387,5.44893192 2.22052387,5.40960301 L2.22052387,4.70168261 C2.22052387,4.6623537 2.22052387,4.6623537 2.25985278,4.6623537 L8.86710981,4.6623537 C8.90643872,4.6623537 8.90643872,4.6623537 8.90643872,4.70168261 L8.90643872,5.40960301 L8.86710981,5.44893192 Z M8.86710981,7.41537746 L2.25985278,7.41537746 C2.22052387,7.41537746 2.22052387,7.41537746 2.22052387,7.37604855 L2.22052387,6.66812815 C2.22052387,6.62879924 2.22052387,6.62879924 2.25985278,6.62879924 L8.86710981,6.62879924 C8.90643872,6.62879924 8.90643872,6.62879924 8.90643872,6.66812815 L8.90643872,7.37604855 L8.86710981,7.41537746 Z" id="形状"></path>
 | 
			
		||||
                        <path d="M8.86710981,6.44841431 C9.00606257,6.44841431 9.08682365,6.5291754 9.08682365,6.66812815 L9.08682365,7.37604855 L9.03399013,7.50359996 L8.99466122,7.54292887 L8.86710981,7.59576239 L2.25985278,7.59576239 C2.12090003,7.59576239 2.04013894,7.51500131 2.04013894,7.37604855 L2.04013894,6.66812815 C2.04013894,6.5291754 2.12090003,6.44841431 2.25985278,6.44841431 L8.86710981,6.44841431 Z M8.72520451,6.80870958 L2.40090881,6.80870958 L2.40090881,7.23441802 L8.72520451,7.23441802 L8.72520451,6.80870958 Z M8.86710981,4.48196877 C9.00606257,4.48196877 9.08682365,4.56272985 9.08682365,4.70168261 L9.08682365,5.40960301 L9.03399013,5.53715441 L8.99466122,5.57648333 L8.86710981,5.62931685 L2.25985278,5.62931685 C2.12090003,5.62931685 2.04013894,5.54855576 2.04013894,5.40960301 L2.04013894,4.70168261 C2.04013894,4.56272985 2.12090003,4.48196877 2.25985278,4.48196877 L8.86710981,4.48196877 Z M8.72520451,4.84251382 L2.40090881,4.84251382 L2.40090881,5.26822226 L8.72520451,5.26822226 L8.72520451,4.84251382 Z M4.54092961,2.71216778 C4.66811215,2.71216778 4.76064346,2.77385532 4.76064346,2.91877199 L4.76064346,3.65291165 L4.68031808,3.80300099 L4.64098917,3.82922026 L4.54092961,3.85951586 L2.25985278,3.85951586 C2.18859958,3.85951586 2.12331983,3.83050264 2.08113204,3.77425225 C2.04130723,3.6964836 2.04130723,3.6964836 2.04013894,3.65291165 L2.04013894,2.91877199 C2.04013894,2.77385532 2.13267025,2.71216778 2.25985278,2.71216778 L4.54092961,2.71216778 Z M4.39957385,3.07293764 L2.40090881,3.07293764 L2.40090881,3.49864608 L4.39957385,3.49864608 L4.39957385,3.07293764 Z" id="形状"></path>
 | 
			
		||||
                        <path d="M3.50158987,12.5394187 L3.50158987,9.83587533 L0.88525753,9.83587533 L0.88525753,8.96376455 L3.93764526,8.96376455 C4.19927849,8.96376455 4.37370065,9.1381867 4.37370065,9.39981994 L4.37370065,12.5394187 L3.50158987,12.5394187 Z" id="路径"></path>
 | 
			
		||||
                    </g>
 | 
			
		||||
                </g>
 | 
			
		||||
            </g>
 | 
			
		||||
        </g>
 | 
			
		||||
    </g>
 | 
			
		||||
</svg>
 | 
			
		||||
| 
		 After Width: | Height: | Size: 5.8 KiB  | 
							
								
								
									
										14
									
								
								src/assets/icons/svg/return.svg
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										14
									
								
								src/assets/icons/svg/return.svg
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,14 @@
 | 
			
		||||
<?xml version="1.0" encoding="UTF-8"?>
 | 
			
		||||
<svg width="16px" height="16px" viewBox="0 0 16 16" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
 | 
			
		||||
    <title>rollback</title>
 | 
			
		||||
    <g id="页面" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
 | 
			
		||||
        <g id="按钮与选择" transform="translate(-135.000000, -282.000000)" fill-rule="nonzero">
 | 
			
		||||
            <g id="编组-3" transform="translate(127.000000, 274.000000)">
 | 
			
		||||
                <g id="rollback" transform="translate(8.000000, 8.000000)">
 | 
			
		||||
                    <rect id="矩形" fill="#000000" opacity="0" x="0" y="0" width="16" height="16"></rect>
 | 
			
		||||
                    <path d="M11.390625,3.78125 L5.71875,3.78125 L5.71875,2.625 C5.71875,2.5203125 5.5984375,2.4625 5.5171875,2.5265625 L3.2984375,4.2765625 C3.234375,4.3265625 3.234375,4.4234375 3.2984375,4.4734375 L5.5171875,6.2234375 C5.5984375,6.2875 5.71875,6.2296875 5.71875,6.125 L5.71875,4.96875 L11.203125,4.96875 C11.7554097,4.96875 12.203125,5.41646525 12.203125,5.96875 L12.203125,11.3125 C12.203125,11.8647847 11.7554097,12.3125 11.203125,12.3125 L2.93775156,12.3125 L2.93775156,12.3125 C2.55569144,12.3125 2.36466138,12.4938859 2.36466138,12.8566576 C2.36466138,13.5 2.93775156,13.5 2.93775156,13.5 C2.93775156,13.5 5.75537604,13.5 11.390625,13.5 C13,13.5 13.390625,12.8986083 13.390625,11.9909216 L13.390625,4.96875 C13.390625,4.06071182 13,3.78125 11.390625,3.78125 Z" id="路径" fill="currentColor"></path>
 | 
			
		||||
                </g>
 | 
			
		||||
            </g>
 | 
			
		||||
        </g>
 | 
			
		||||
    </g>
 | 
			
		||||
</svg>
 | 
			
		||||
| 
		 After Width: | Height: | Size: 1.5 KiB  | 
							
								
								
									
										14
									
								
								src/assets/icons/svg/table_edit.svg
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										14
									
								
								src/assets/icons/svg/table_edit.svg
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,14 @@
 | 
			
		||||
<?xml version="1.0" encoding="UTF-8"?>
 | 
			
		||||
<svg width="16px" height="16px" viewBox="0 0 16 16" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
 | 
			
		||||
    <g id="1_基础资料" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
 | 
			
		||||
        <g id="1-1工厂信息" transform="translate(-1834.000000, -253.000000)">
 | 
			
		||||
            <g id="icon/界面内/编辑" transform="translate(1834.000000, 253.000000)">
 | 
			
		||||
                <rect id="矩形" x="0" y="0" width="16" height="16"></rect>
 | 
			
		||||
                <g id="常用购票人/编辑32" fill-rule="nonzero">
 | 
			
		||||
                    <rect id="矩形" fill="#000000" opacity="0" x="0" y="0" width="16" height="16"></rect>
 | 
			
		||||
                    <path d="M13.5,7.8285 C13.5,7.55235763 13.7238576,7.3285 14,7.3285 C14.2761424,7.3285 14.5,7.55235763 14.5,7.8285 L14.5,12 C14.5,13.3807119 13.3807119,14.5 12,14.5 L4,14.5 C2.61928813,14.5 1.5,13.3807119 1.5,12 L1.5,4 C1.5,2.61928813 2.61928813,1.5 4,1.5 L8.759,1.5 C8.9376328,1.5 9.10269631,1.59529946 9.19201271,1.75 C9.28132911,1.90470054 9.28132911,2.09529946 9.19201271,2.25 C9.10269631,2.40470054 8.9376328,2.5 8.759,2.5 L4,2.5 C3.17157288,2.5 2.5,3.17157288 2.5,4 L2.5,12 C2.5,12.8284271 3.17157288,13.5 4,13.5 L12,13.5 C12.8284271,13.5 13.5,12.8284271 13.5,12 L13.5,7.8285 Z M13.284,2.312 C13.4738226,2.11757837 13.784168,2.11034095 13.9828473,2.2957025 C14.1815266,2.48106405 14.1958051,2.79116533 14.015,2.994 L8.56,8.845 C8.43817243,8.97566989 8.25588756,9.03141962 8.08181033,8.9912488 C7.90773311,8.95107798 7.76830999,8.82108951 7.71606033,8.65024879 C7.66381067,8.47940808 7.70667243,8.29366989 7.8285,8.163 L13.284,2.312 Z" id="形状" stroke="#0B58FF" stroke-width="0.1" fill="#0B58FF"></path>
 | 
			
		||||
                </g>
 | 
			
		||||
            </g>
 | 
			
		||||
        </g>
 | 
			
		||||
    </g>
 | 
			
		||||
</svg>
 | 
			
		||||
| 
		 After Width: | Height: | Size: 1.8 KiB  | 
@@ -37,6 +37,9 @@ $tabWidth: $tabW * 1px;
 | 
			
		||||
$rowHeight: $rowH * 1px;
 | 
			
		||||
$buttonHeight: $buttonH * 1px;
 | 
			
		||||
 | 
			
		||||
// 1080px 高度为基准的 1px
 | 
			
		||||
$base1px: 0.15vh; // 1px / 1080px;
 | 
			
		||||
 | 
			
		||||
// - - - - - 页面基础设置
 | 
			
		||||
.container {
 | 
			
		||||
	.login-code {
 | 
			
		||||
@@ -87,7 +90,7 @@ $buttonHeight: $buttonH * 1px;
 | 
			
		||||
		width: 100%;
 | 
			
		||||
		height: 100%;
 | 
			
		||||
		background-color: #ffffff;
 | 
			
		||||
		// box-shadow: 0px 16px 40px rgba(0, 0, 0, 0.07);
 | 
			
		||||
		// box-shadow: 0px calc(16 * 0.12vh) 40px rgba(0, 0, 0, 0.07);
 | 
			
		||||
		// border-radius: 20px;
 | 
			
		||||
		// 定位
 | 
			
		||||
		position: relative;
 | 
			
		||||
@@ -100,6 +103,7 @@ $buttonHeight: $buttonH * 1px;
 | 
			
		||||
			// 元素
 | 
			
		||||
			// width: $picWidth;
 | 
			
		||||
			height: $picHeight;
 | 
			
		||||
			// height: 10vh;
 | 
			
		||||
			background-image: url($picImage);
 | 
			
		||||
			background-repeat: no-repeat;
 | 
			
		||||
			background-size: 100% 100%;
 | 
			
		||||
@@ -118,7 +122,7 @@ $buttonHeight: $buttonH * 1px;
 | 
			
		||||
		}
 | 
			
		||||
		.field {
 | 
			
		||||
			position: relative;
 | 
			
		||||
			margin-top: 8%;
 | 
			
		||||
			margin-top: 14vh;
 | 
			
		||||
			flex: 2;
 | 
			
		||||
			// width: 800px;
 | 
			
		||||
			display: flex;
 | 
			
		||||
@@ -130,17 +134,36 @@ $buttonHeight: $buttonH * 1px;
 | 
			
		||||
				text-align: center;
 | 
			
		||||
				clear: both;
 | 
			
		||||
				position: relative;
 | 
			
		||||
				top: -36px;
 | 
			
		||||
				height: 128px;
 | 
			
		||||
				top: calc(-32 * $base1px);
 | 
			
		||||
				height: calc(128 * $base1px);
 | 
			
		||||
 | 
			
		||||
				.title {
 | 
			
		||||
					margin: 0;
 | 
			
		||||
					margin-left: 32px;
 | 
			
		||||
					margin-left: calc(28 * 0.12vh);
 | 
			
		||||
					font-weight: 400;
 | 
			
		||||
					user-select: none;
 | 
			
		||||
					color: #000;
 | 
			
		||||
					font-size: 36px;
 | 
			
		||||
					line-height: 54px;
 | 
			
		||||
					font-size: calc(28 * 0.12vh);
 | 
			
		||||
					line-height: calc(40 * 0.12vh);
 | 
			
		||||
					letter-spacing: calc(2 * 0.12vh);
 | 
			
		||||
 | 
			
		||||
					.cnbm_logo {
 | 
			
		||||
						height: calc(40 * 0.12vh);
 | 
			
		||||
						width: calc(40 * 0.12vh);
 | 
			
		||||
						position: relative;
 | 
			
		||||
						top: calc(8 * 0.12vh);
 | 
			
		||||
						right: calc(8 * 0.12vh);
 | 
			
		||||
					}
 | 
			
		||||
				}
 | 
			
		||||
 | 
			
		||||
				.sub-title {
 | 
			
		||||
					margin: 0;
 | 
			
		||||
					margin-left: calc(28 * 0.12vh);
 | 
			
		||||
					font-weight: 400;
 | 
			
		||||
					user-select: none;
 | 
			
		||||
					color: #000;
 | 
			
		||||
					font-size: calc(28 * 0.12vh);
 | 
			
		||||
					line-height: calc(48 * 0.12vh);
 | 
			
		||||
					letter-spacing: 2px;
 | 
			
		||||
				}
 | 
			
		||||
			}
 | 
			
		||||
@@ -159,10 +182,10 @@ $buttonHeight: $buttonH * 1px;
 | 
			
		||||
			.footer {
 | 
			
		||||
				user-select: none;
 | 
			
		||||
				// 元素
 | 
			
		||||
				margin: 12px 0;
 | 
			
		||||
				height: 16px;
 | 
			
		||||
				line-height: 16px;
 | 
			
		||||
				font-size: 12px;
 | 
			
		||||
				margin: calc(12 * 0.12vh) 0;
 | 
			
		||||
				height: calc(16 * 0.12vh);
 | 
			
		||||
				line-height: calc(16 * 0.12vh);
 | 
			
		||||
				font-size: calc(12 * 0.12vh);
 | 
			
		||||
				color: #8c8c8c;
 | 
			
		||||
 | 
			
		||||
				a,
 | 
			
		||||
@@ -176,12 +199,8 @@ $buttonHeight: $buttonH * 1px;
 | 
			
		||||
			.form {
 | 
			
		||||
				margin-top: 0;
 | 
			
		||||
				box-sizing: border-box;
 | 
			
		||||
				// width: $formWidth;
 | 
			
		||||
				width: 100%;
 | 
			
		||||
				// - - - tab
 | 
			
		||||
				:deep(.el-tabs__nav) {
 | 
			
		||||
					// background: #f0f3;
 | 
			
		||||
				}
 | 
			
		||||
 | 
			
		||||
				:deep(.el-tabs__content) {
 | 
			
		||||
					padding: 20px 0 0;
 | 
			
		||||
				}
 | 
			
		||||
@@ -189,12 +208,13 @@ $buttonHeight: $buttonH * 1px;
 | 
			
		||||
					user-select: none;
 | 
			
		||||
					// 元素
 | 
			
		||||
					width: $tabWidth;
 | 
			
		||||
					height: $rowHeight;
 | 
			
		||||
					// height: $rowHeight;
 | 
			
		||||
					height: calc(54 * 0.12vh);
 | 
			
		||||
					padding: 0;
 | 
			
		||||
					// 文字
 | 
			
		||||
					line-height: $rowHeight;
 | 
			
		||||
					color: #666666;
 | 
			
		||||
					font-size: 18px;
 | 
			
		||||
					font-size: calc(14 * 0.12vh);
 | 
			
		||||
					font-weight: 400;
 | 
			
		||||
					text-align: center;
 | 
			
		||||
				}
 | 
			
		||||
@@ -210,7 +230,8 @@ $buttonHeight: $buttonH * 1px;
 | 
			
		||||
				:deep(.el-input__inner) {
 | 
			
		||||
					// 元素
 | 
			
		||||
					width: 100%;
 | 
			
		||||
					height: $rowHeight;
 | 
			
		||||
					// height: $rowHeight;
 | 
			
		||||
					height: calc(72 * 0.12vh);
 | 
			
		||||
					background: #f5f5f5;
 | 
			
		||||
					border: 0;
 | 
			
		||||
					border-radius: 28px;
 | 
			
		||||
@@ -280,7 +301,7 @@ $buttonHeight: $buttonH * 1px;
 | 
			
		||||
					margin-bottom: 20px;
 | 
			
		||||
					// 文字
 | 
			
		||||
					line-height: 26px;
 | 
			
		||||
					font-size: 20px;
 | 
			
		||||
					font-size: calc(18 * 0.12vh);
 | 
			
		||||
					color: #ffffff;
 | 
			
		||||
				}
 | 
			
		||||
				.button-active {
 | 
			
		||||
@@ -299,13 +320,14 @@ $buttonHeight: $buttonH * 1px;
 | 
			
		||||
		:deep(.el-input__inner) {
 | 
			
		||||
			// 元素
 | 
			
		||||
			width: 420px;
 | 
			
		||||
			height: 66px;
 | 
			
		||||
			height: calc(52 * 0.12vh);
 | 
			
		||||
			// height: 66px;
 | 
			
		||||
			color: #262626;
 | 
			
		||||
			font-size: 18px;
 | 
			
		||||
			font-size: calc(14 * 0.12vh);
 | 
			
		||||
		}
 | 
			
		||||
		:deep(.el-checkbox__label) {
 | 
			
		||||
			font-size: 18px;
 | 
			
		||||
			line-height: 14px;
 | 
			
		||||
			font-size: calc(14 * 0.12vh);
 | 
			
		||||
			line-height: calc(12 * 0.12vh);
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
@@ -314,19 +336,42 @@ $buttonHeight: $buttonH * 1px;
 | 
			
		||||
@media screen and (min-width: 1920px) {
 | 
			
		||||
	.container {
 | 
			
		||||
		.content {
 | 
			
		||||
 | 
			
		||||
			.field {
 | 
			
		||||
				flex: initial;
 | 
			
		||||
				width: 800px;
 | 
			
		||||
				// width: 800px;
 | 
			
		||||
				width: 40vw;
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@media screen and (min-height: 1024px) {
 | 
			
		||||
	.container {
 | 
			
		||||
		.content {
 | 
			
		||||
			.field {
 | 
			
		||||
				margin-top: 16vh;
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@media screen and (max-height: 1024px) {
 | 
			
		||||
	.container {
 | 
			
		||||
		.content {
 | 
			
		||||
			.field {
 | 
			
		||||
				margin-top: 8vh;
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@media screen and (min-width: 599px) and (max-width: 1366px) {
 | 
			
		||||
	.container {
 | 
			
		||||
		min-width: 599px;
 | 
			
		||||
		// min-width: 599px;
 | 
			
		||||
		min-width: 42vw;
 | 
			
		||||
 | 
			
		||||
		.content {
 | 
			
		||||
			// width: 710px;
 | 
			
		||||
			// height: 397px;
 | 
			
		||||
@@ -337,6 +382,7 @@ $buttonHeight: $buttonH * 1px;
 | 
			
		||||
				display: none;
 | 
			
		||||
			}
 | 
			
		||||
			.field {
 | 
			
		||||
				// margin-top: 6vh;
 | 
			
		||||
				// width: calc(710px - 314px);
 | 
			
		||||
				// left: 314px;
 | 
			
		||||
				// justify-content: center;
 | 
			
		||||
@@ -363,6 +409,14 @@ $buttonHeight: $buttonH * 1px;
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// @media screen and (max-height: 1080px) {
 | 
			
		||||
// 	.container {
 | 
			
		||||
// 		.field {
 | 
			
		||||
// 			transform: scale(0.74);
 | 
			
		||||
// 		}
 | 
			
		||||
// 	}
 | 
			
		||||
// }
 | 
			
		||||
 | 
			
		||||
/* ===== MOBILE DESIGN ===== */
 | 
			
		||||
$mobileW: 375;
 | 
			
		||||
$mobileH: 812;
 | 
			
		||||
@@ -503,7 +557,7 @@ $iconBgImage: '../assets/images/icon.png';
 | 
			
		||||
 | 
			
		||||
		.footer {
 | 
			
		||||
			// 元素
 | 
			
		||||
			font-size: 12px;
 | 
			
		||||
			font-size: calc(12 * 0.12vh);
 | 
			
		||||
			font-family: PingFang SC;
 | 
			
		||||
			font-weight: 400;
 | 
			
		||||
			line-height: 17px;
 | 
			
		||||
@@ -511,7 +565,7 @@ $iconBgImage: '../assets/images/icon.png';
 | 
			
		||||
			opacity: 0.6;
 | 
			
		||||
			// 定位
 | 
			
		||||
			// position: absolute;
 | 
			
		||||
			bottom: -32px;
 | 
			
		||||
			bottom: -calc(32 * 0.12vh);
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -65,6 +65,7 @@
 | 
			
		||||
						v-if="col.subcomponent"
 | 
			
		||||
						:key="col.key"
 | 
			
		||||
						:disabled="disabled"
 | 
			
		||||
						:read-only="disabled"
 | 
			
		||||
						:is="col.subcomponent"
 | 
			
		||||
						v-model="form[col.prop]"
 | 
			
		||||
						:inlineStyle="col.style"
 | 
			
		||||
@@ -75,6 +76,7 @@
 | 
			
		||||
						class="upload-area"
 | 
			
		||||
						:class="uploadOpen ? '' : 'height-48'"
 | 
			
		||||
						ref="uploadArea"
 | 
			
		||||
						:key="col.prop"
 | 
			
		||||
						v-if="col.upload">
 | 
			
		||||
						<span class="close-icon" :class="uploadOpen ? 'open' : ''">
 | 
			
		||||
							<el-button
 | 
			
		||||
@@ -86,13 +88,18 @@
 | 
			
		||||
						<el-upload
 | 
			
		||||
							class="upload-in-dialog"
 | 
			
		||||
							v-if="col.upload"
 | 
			
		||||
							:key="col.prop + '__el-upload'"
 | 
			
		||||
							:action="uploadUrl"
 | 
			
		||||
							:headers="uploadHeaders"
 | 
			
		||||
							:show-file-list="false"
 | 
			
		||||
							icon="el-icon-upload2"
 | 
			
		||||
							:disabled="disabled"
 | 
			
		||||
							:before-upload="beforeUpload"
 | 
			
		||||
							:on-success="handleUploadSuccess"
 | 
			
		||||
							:on-success="
 | 
			
		||||
								(response, file, fileList) => {
 | 
			
		||||
									handleUploadSuccess(response, file, col.prop);
 | 
			
		||||
								}
 | 
			
		||||
							"
 | 
			
		||||
							v-bind="col.bind">
 | 
			
		||||
							<el-button size="mini" :disabled="col.bind?.disabled || false">
 | 
			
		||||
								<svg-icon
 | 
			
		||||
@@ -107,10 +114,10 @@
 | 
			
		||||
 | 
			
		||||
						<uploadedFile
 | 
			
		||||
							class="file"
 | 
			
		||||
							v-for="file in form[col.prop] || []"
 | 
			
		||||
							v-for="file in form[col.prop]"
 | 
			
		||||
							:file="file"
 | 
			
		||||
							:key="file.fileUrl"
 | 
			
		||||
							@delete="!disabled && handleDeleteFile(file)" />
 | 
			
		||||
							@delete="!disabled && handleDeleteFile(file, col.prop)" />
 | 
			
		||||
					</div>
 | 
			
		||||
				</el-form-item>
 | 
			
		||||
			</el-col>
 | 
			
		||||
@@ -135,6 +142,9 @@ function findMaxLabelWidth(rows) {
 | 
			
		||||
			if (!opt.label) return 0;
 | 
			
		||||
			if (opt.label.length > max) {
 | 
			
		||||
				max = opt.label.length;
 | 
			
		||||
				if (opt.label.includes('(')) {
 | 
			
		||||
					max = max - 3
 | 
			
		||||
				}
 | 
			
		||||
			}
 | 
			
		||||
		});
 | 
			
		||||
	});
 | 
			
		||||
@@ -151,12 +161,30 @@ const uploadedFile = {
 | 
			
		||||
		handleDelete() {
 | 
			
		||||
			this.$emit('delete', this.file);
 | 
			
		||||
		},
 | 
			
		||||
		async handleDownload() {
 | 
			
		||||
			const data = await this.$axios({
 | 
			
		||||
				url: this.file.fileUrl,
 | 
			
		||||
				method: 'get',
 | 
			
		||||
				responseType: 'blob',
 | 
			
		||||
			});
 | 
			
		||||
 | 
			
		||||
			await this.$message.success('开始下载');
 | 
			
		||||
			// create download link
 | 
			
		||||
			const url = window.URL.createObjectURL(data);
 | 
			
		||||
			const link = document.createElement('a');
 | 
			
		||||
			link.href = url;
 | 
			
		||||
			link.download = this.file.fileName;
 | 
			
		||||
			document.body.appendChild(link);
 | 
			
		||||
			link.click();
 | 
			
		||||
			document.body.removeChild(link);
 | 
			
		||||
		},
 | 
			
		||||
	},
 | 
			
		||||
	mounted() {},
 | 
			
		||||
	render: function (h) {
 | 
			
		||||
		return (
 | 
			
		||||
			<div
 | 
			
		||||
				title={this.file.fileName}
 | 
			
		||||
				onClick={this.handleDownload}
 | 
			
		||||
				style={{
 | 
			
		||||
					background: `url(${tupleImg}) no-repeat`,
 | 
			
		||||
					backgroundSize: '14px',
 | 
			
		||||
@@ -204,7 +232,7 @@ export default {
 | 
			
		||||
			default: false,
 | 
			
		||||
		},
 | 
			
		||||
		hasFiles: {
 | 
			
		||||
			type: Boolean,
 | 
			
		||||
			type: Boolean | Array,
 | 
			
		||||
			default: false,
 | 
			
		||||
		},
 | 
			
		||||
		labelPosition: {
 | 
			
		||||
@@ -214,7 +242,7 @@ export default {
 | 
			
		||||
		size: {
 | 
			
		||||
			type: String,
 | 
			
		||||
			default: '',
 | 
			
		||||
		},
 | 
			
		||||
		}
 | 
			
		||||
	},
 | 
			
		||||
	data() {
 | 
			
		||||
		return {
 | 
			
		||||
@@ -250,7 +278,13 @@ export default {
 | 
			
		||||
			handler(val) {
 | 
			
		||||
				this.form = JSON.parse(JSON.stringify(val));
 | 
			
		||||
				if (this.hasFiles) {
 | 
			
		||||
					if (typeof this.hasFiles == 'boolean' && this.hasFiles) {
 | 
			
		||||
						this.form.files = this.form.files ?? [];
 | 
			
		||||
					} else if (Array.isArray(this.hasFiles)) {
 | 
			
		||||
						this.hasFiles.forEach((prop) => {
 | 
			
		||||
							this.form[prop] = this.form[prop] ?? [];
 | 
			
		||||
						});
 | 
			
		||||
					}
 | 
			
		||||
				}
 | 
			
		||||
			},
 | 
			
		||||
			deep: true,
 | 
			
		||||
@@ -346,6 +380,8 @@ export default {
 | 
			
		||||
									console.log('setting code: ', response.data);
 | 
			
		||||
									// 处理输入框数据
 | 
			
		||||
									this.form[opt.prop] = response.data;
 | 
			
		||||
									// 更新下外部的 dataForm,防止code字段有数据也报空的bug
 | 
			
		||||
									this.$emit('update', this.form);
 | 
			
		||||
								}
 | 
			
		||||
							});
 | 
			
		||||
						}
 | 
			
		||||
@@ -374,11 +410,12 @@ export default {
 | 
			
		||||
		// 上传成功的特殊处理
 | 
			
		||||
		beforeUpload() {},
 | 
			
		||||
		// 上传前的验证规则可通过 bind 属性传入
 | 
			
		||||
		handleUploadSuccess(response, file, fileList) {
 | 
			
		||||
			this.form.files.push({
 | 
			
		||||
		handleUploadSuccess(response, file, prop) {
 | 
			
		||||
			console.log('[handleUploadSuccess]', response, file, prop);
 | 
			
		||||
			this.form[prop].push({
 | 
			
		||||
				fileName: file.name,
 | 
			
		||||
				fileUrl: response.data,
 | 
			
		||||
				fileType: 2,
 | 
			
		||||
				fileType: prop == 'files' ? 2 : 1,
 | 
			
		||||
			});
 | 
			
		||||
			this.$modal.msgSuccess('上传成功');
 | 
			
		||||
			this.$emit('update', this.form);
 | 
			
		||||
@@ -392,8 +429,8 @@ export default {
 | 
			
		||||
			this.uploadOpen = !this.uploadOpen;
 | 
			
		||||
		},
 | 
			
		||||
 | 
			
		||||
		handleDeleteFile(file) {
 | 
			
		||||
			this.form.files = this.form.files.filter(
 | 
			
		||||
		handleDeleteFile(file, prop) {
 | 
			
		||||
			this.form[prop] = this.form[prop].filter(
 | 
			
		||||
				(item) => item.fileUrl != file.fileUrl
 | 
			
		||||
			);
 | 
			
		||||
			this.$emit('update', this.form);
 | 
			
		||||
 
 | 
			
		||||
@@ -1,5 +1,5 @@
 | 
			
		||||
<template>
 | 
			
		||||
  <div>
 | 
			
		||||
	<div :class="[readOnly ? 'editor-wrapper' : '']">
 | 
			
		||||
		<el-upload
 | 
			
		||||
			:action="uploadFileUrl"
 | 
			
		||||
			:before-upload="handleBeforeUpload"
 | 
			
		||||
@@ -10,27 +10,25 @@
 | 
			
		||||
			:headers="headers"
 | 
			
		||||
			style="display: none"
 | 
			
		||||
			ref="upload"
 | 
			
		||||
      v-if="this.type === 'url'"
 | 
			
		||||
    >
 | 
			
		||||
    </el-upload>
 | 
			
		||||
			v-if="this.type === 'url'"></el-upload>
 | 
			
		||||
		<div class="editor" ref="editor" :style="styles"></div>
 | 
			
		||||
	</div>
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script>
 | 
			
		||||
import Quill from "quill";
 | 
			
		||||
import "quill/dist/quill.core.css";
 | 
			
		||||
import "quill/dist/quill.snow.css";
 | 
			
		||||
import "quill/dist/quill.bubble.css";
 | 
			
		||||
import { getAccessToken } from "@/utils/auth";
 | 
			
		||||
import Quill from 'quill';
 | 
			
		||||
import 'quill/dist/quill.core.css';
 | 
			
		||||
import 'quill/dist/quill.snow.css';
 | 
			
		||||
import 'quill/dist/quill.bubble.css';
 | 
			
		||||
import { getAccessToken } from '@/utils/auth';
 | 
			
		||||
 | 
			
		||||
export default {
 | 
			
		||||
  name: "Editor",
 | 
			
		||||
	name: 'Editor',
 | 
			
		||||
	props: {
 | 
			
		||||
		/* 编辑器的内容 */
 | 
			
		||||
		value: {
 | 
			
		||||
			type: String,
 | 
			
		||||
      default: "",
 | 
			
		||||
			default: '',
 | 
			
		||||
		},
 | 
			
		||||
		/* 高度 */
 | 
			
		||||
		height: {
 | 
			
		||||
@@ -55,36 +53,37 @@ export default {
 | 
			
		||||
		/* 类型(base64格式、url格式) */
 | 
			
		||||
		type: {
 | 
			
		||||
			type: String,
 | 
			
		||||
      default: "url",
 | 
			
		||||
    }
 | 
			
		||||
			default: 'url',
 | 
			
		||||
		},
 | 
			
		||||
	},
 | 
			
		||||
	data() {
 | 
			
		||||
		return {
 | 
			
		||||
      uploadFileUrl: process.env.VUE_APP_BASE_API + "/admin-api/infra/file/upload", // 请求地址
 | 
			
		||||
      headers: { Authorization: "Bearer " + getAccessToken() }, // 设置上传的请求头部
 | 
			
		||||
			uploadFileUrl:
 | 
			
		||||
				process.env.VUE_APP_BASE_API + '/admin-api/infra/file/upload', // 请求地址
 | 
			
		||||
			headers: { Authorization: 'Bearer ' + getAccessToken() }, // 设置上传的请求头部
 | 
			
		||||
			Quill: null,
 | 
			
		||||
      currentValue: "",
 | 
			
		||||
			currentValue: '',
 | 
			
		||||
			options: {
 | 
			
		||||
        theme: "snow",
 | 
			
		||||
				theme: 'snow',
 | 
			
		||||
				bounds: document.body,
 | 
			
		||||
        debug: "warn",
 | 
			
		||||
				debug: 'warn',
 | 
			
		||||
				modules: {
 | 
			
		||||
					// 工具栏配置
 | 
			
		||||
					toolbar: [
 | 
			
		||||
            ["bold", "italic", "underline", "strike"],       // 加粗 斜体 下划线 删除线
 | 
			
		||||
            ["blockquote", "code-block"],                    // 引用  代码块
 | 
			
		||||
            [{ list: "ordered" }, { list: "bullet" }],       // 有序、无序列表
 | 
			
		||||
            [{ indent: "-1" }, { indent: "+1" }],            // 缩进
 | 
			
		||||
            [{ size: ["small", false, "large", "huge"] }],   // 字体大小
 | 
			
		||||
						['bold', 'italic', 'underline', 'strike'], // 加粗 斜体 下划线 删除线
 | 
			
		||||
						['blockquote', 'code-block'], // 引用  代码块
 | 
			
		||||
						[{ list: 'ordered' }, { list: 'bullet' }], // 有序、无序列表
 | 
			
		||||
						[{ indent: '-1' }, { indent: '+1' }], // 缩进
 | 
			
		||||
						[{ size: ['small', false, 'large', 'huge'] }], // 字体大小
 | 
			
		||||
						[{ header: [1, 2, 3, 4, 5, 6, false] }], // 标题
 | 
			
		||||
						[{ color: [] }, { background: [] }], // 字体颜色、字体背景颜色
 | 
			
		||||
						[{ align: [] }], // 对齐方式
 | 
			
		||||
            ["clean"],                                       // 清除文本格式
 | 
			
		||||
            ["link", "image", "video"]                       // 链接、图片、视频
 | 
			
		||||
						['clean'], // 清除文本格式
 | 
			
		||||
						['link', 'image', 'video'], // 链接、图片、视频
 | 
			
		||||
					],
 | 
			
		||||
				},
 | 
			
		||||
        placeholder: "请输入内容",
 | 
			
		||||
        readOnly: true,
 | 
			
		||||
				placeholder: '请输入内容',
 | 
			
		||||
				// readOnly: false,
 | 
			
		||||
			},
 | 
			
		||||
		};
 | 
			
		||||
	},
 | 
			
		||||
@@ -104,7 +103,7 @@ export default {
 | 
			
		||||
		value: {
 | 
			
		||||
			handler(val) {
 | 
			
		||||
				if (val !== this.currentValue) {
 | 
			
		||||
          this.currentValue = val === null ? "" : val;
 | 
			
		||||
					this.currentValue = val === null ? '' : val;
 | 
			
		||||
					if (this.Quill) {
 | 
			
		||||
						this.Quill.pasteHTML(this.currentValue);
 | 
			
		||||
					}
 | 
			
		||||
@@ -124,41 +123,43 @@ export default {
 | 
			
		||||
			const editor = this.$refs.editor;
 | 
			
		||||
			this.Quill = new Quill(editor, this.options);
 | 
			
		||||
			// 取消自动聚焦 start
 | 
			
		||||
      this.$nextTick(()=>{
 | 
			
		||||
        this.Quill.blur();
 | 
			
		||||
        if(!this.readOnly){
 | 
			
		||||
          this.Quill.enable();
 | 
			
		||||
        }
 | 
			
		||||
			this.Quill?.enable(false);
 | 
			
		||||
			this.$nextTick(() => {
 | 
			
		||||
				this.Quill?.enable(true);
 | 
			
		||||
				this.Quill?.blur();
 | 
			
		||||
				// if (!this.readOnly) {
 | 
			
		||||
				// 	this.Quill?.enable();
 | 
			
		||||
				// }
 | 
			
		||||
			});
 | 
			
		||||
			// 如果设置了上传地址则自定义图片上传事件
 | 
			
		||||
			if (this.type === 'url') {
 | 
			
		||||
        let toolbar = this.Quill.getModule("toolbar");
 | 
			
		||||
        toolbar.addHandler("image", (value) => {
 | 
			
		||||
          this.uploadType = "image";
 | 
			
		||||
				let toolbar = this.Quill.getModule('toolbar');
 | 
			
		||||
				toolbar.addHandler('image', (value) => {
 | 
			
		||||
					this.uploadType = 'image';
 | 
			
		||||
					if (value) {
 | 
			
		||||
						this.$refs.upload.$children[0].$refs.input.click();
 | 
			
		||||
					} else {
 | 
			
		||||
            this.quill.format("image", false);
 | 
			
		||||
						this.quill.format('image', false);
 | 
			
		||||
					}
 | 
			
		||||
				});
 | 
			
		||||
			}
 | 
			
		||||
			this.Quill.pasteHTML(this.currentValue);
 | 
			
		||||
      this.Quill.on("text-change", (delta, oldDelta, source) => {
 | 
			
		||||
			this.Quill.on('text-change', (delta, oldDelta, source) => {
 | 
			
		||||
				const html = this.$refs.editor.children[0].innerHTML;
 | 
			
		||||
				const text = this.Quill.getText();
 | 
			
		||||
				const quill = this.Quill;
 | 
			
		||||
				this.currentValue = html;
 | 
			
		||||
        this.$emit("input", html);
 | 
			
		||||
        this.$emit("on-change", { html, text, quill });
 | 
			
		||||
				this.$emit('input', html);
 | 
			
		||||
				this.$emit('on-change', { html, text, quill });
 | 
			
		||||
			});
 | 
			
		||||
      this.Quill.on("text-change", (delta, oldDelta, source) => {
 | 
			
		||||
        this.$emit("on-text-change", delta, oldDelta, source);
 | 
			
		||||
			this.Quill.on('text-change', (delta, oldDelta, source) => {
 | 
			
		||||
				this.$emit('on-text-change', delta, oldDelta, source);
 | 
			
		||||
			});
 | 
			
		||||
      this.Quill.on("selection-change", (range, oldRange, source) => {
 | 
			
		||||
        this.$emit("on-selection-change", range, oldRange, source);
 | 
			
		||||
			this.Quill.on('selection-change', (range, oldRange, source) => {
 | 
			
		||||
				this.$emit('on-selection-change', range, oldRange, source);
 | 
			
		||||
			});
 | 
			
		||||
      this.Quill.on("editor-change", (eventName, ...args) => {
 | 
			
		||||
        this.$emit("on-editor-change", eventName, ...args);
 | 
			
		||||
			this.Quill.on('editor-change', (eventName, ...args) => {
 | 
			
		||||
				this.$emit('on-editor-change', eventName, ...args);
 | 
			
		||||
			});
 | 
			
		||||
		},
 | 
			
		||||
		// 上传前校检格式和大小
 | 
			
		||||
@@ -183,97 +184,112 @@ export default {
 | 
			
		||||
				let length = quill.getSelection().index;
 | 
			
		||||
				// 插入图片  res.url为服务器返回的图片地址
 | 
			
		||||
				// edit by 芋道源码
 | 
			
		||||
        quill.insertEmbed(length, "image", res.data);
 | 
			
		||||
				quill.insertEmbed(length, 'image', res.data);
 | 
			
		||||
				// 调整光标到最后
 | 
			
		||||
				quill.setSelection(length + 1);
 | 
			
		||||
			} else {
 | 
			
		||||
        this.$message.error("图片插入失败");
 | 
			
		||||
				this.$message.error('图片插入失败');
 | 
			
		||||
			}
 | 
			
		||||
		},
 | 
			
		||||
		handleUploadError() {
 | 
			
		||||
      this.$message.error("图片插入失败");
 | 
			
		||||
			this.$message.error('图片插入失败');
 | 
			
		||||
		},
 | 
			
		||||
	},
 | 
			
		||||
};
 | 
			
		||||
</script>
 | 
			
		||||
 | 
			
		||||
<style>
 | 
			
		||||
.editor, .ql-toolbar {
 | 
			
		||||
<style lang="scss" scoped>
 | 
			
		||||
.editor-wrapper {
 | 
			
		||||
	position: relative;
 | 
			
		||||
  cursor: not-allowed;
 | 
			
		||||
 | 
			
		||||
	&::after {
 | 
			
		||||
		content: '';
 | 
			
		||||
		position: absolute;
 | 
			
		||||
		top: 0;
 | 
			
		||||
		left: 0;
 | 
			
		||||
		width: 100%;
 | 
			
		||||
		height: 100%;
 | 
			
		||||
		background: #f5f7fa77;
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
.editor,
 | 
			
		||||
.ql-toolbar {
 | 
			
		||||
	white-space: pre-wrap !important;
 | 
			
		||||
	line-height: normal !important;
 | 
			
		||||
}
 | 
			
		||||
.quill-img {
 | 
			
		||||
	display: none;
 | 
			
		||||
}
 | 
			
		||||
.ql-snow .ql-tooltip[data-mode="link"]::before {
 | 
			
		||||
  content: "请输入链接地址:";
 | 
			
		||||
.ql-snow .ql-tooltip[data-mode='link']::before {
 | 
			
		||||
	content: '请输入链接地址:';
 | 
			
		||||
}
 | 
			
		||||
.ql-snow .ql-tooltip.ql-editing a.ql-action::after {
 | 
			
		||||
	border-right: 0px;
 | 
			
		||||
  content: "保存";
 | 
			
		||||
	content: '保存';
 | 
			
		||||
	padding-right: 0px;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
.ql-snow .ql-tooltip[data-mode="video"]::before {
 | 
			
		||||
  content: "请输入视频地址:";
 | 
			
		||||
.ql-snow .ql-tooltip[data-mode='video']::before {
 | 
			
		||||
	content: '请输入视频地址:';
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
.ql-snow .ql-picker.ql-size .ql-picker-label::before,
 | 
			
		||||
.ql-snow .ql-picker.ql-size .ql-picker-item::before {
 | 
			
		||||
  content: "14px";
 | 
			
		||||
	content: '14px';
 | 
			
		||||
}
 | 
			
		||||
.ql-snow .ql-picker.ql-size .ql-picker-label[data-value="small"]::before,
 | 
			
		||||
.ql-snow .ql-picker.ql-size .ql-picker-item[data-value="small"]::before {
 | 
			
		||||
  content: "10px";
 | 
			
		||||
.ql-snow .ql-picker.ql-size .ql-picker-label[data-value='small']::before,
 | 
			
		||||
.ql-snow .ql-picker.ql-size .ql-picker-item[data-value='small']::before {
 | 
			
		||||
	content: '10px';
 | 
			
		||||
}
 | 
			
		||||
.ql-snow .ql-picker.ql-size .ql-picker-label[data-value="large"]::before,
 | 
			
		||||
.ql-snow .ql-picker.ql-size .ql-picker-item[data-value="large"]::before {
 | 
			
		||||
  content: "18px";
 | 
			
		||||
.ql-snow .ql-picker.ql-size .ql-picker-label[data-value='large']::before,
 | 
			
		||||
.ql-snow .ql-picker.ql-size .ql-picker-item[data-value='large']::before {
 | 
			
		||||
	content: '18px';
 | 
			
		||||
}
 | 
			
		||||
.ql-snow .ql-picker.ql-size .ql-picker-label[data-value="huge"]::before,
 | 
			
		||||
.ql-snow .ql-picker.ql-size .ql-picker-item[data-value="huge"]::before {
 | 
			
		||||
  content: "32px";
 | 
			
		||||
.ql-snow .ql-picker.ql-size .ql-picker-label[data-value='huge']::before,
 | 
			
		||||
.ql-snow .ql-picker.ql-size .ql-picker-item[data-value='huge']::before {
 | 
			
		||||
	content: '32px';
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
.ql-snow .ql-picker.ql-header .ql-picker-label::before,
 | 
			
		||||
.ql-snow .ql-picker.ql-header .ql-picker-item::before {
 | 
			
		||||
  content: "文本";
 | 
			
		||||
	content: '文本';
 | 
			
		||||
}
 | 
			
		||||
.ql-snow .ql-picker.ql-header .ql-picker-label[data-value="1"]::before,
 | 
			
		||||
.ql-snow .ql-picker.ql-header .ql-picker-item[data-value="1"]::before {
 | 
			
		||||
  content: "标题1";
 | 
			
		||||
.ql-snow .ql-picker.ql-header .ql-picker-label[data-value='1']::before,
 | 
			
		||||
.ql-snow .ql-picker.ql-header .ql-picker-item[data-value='1']::before {
 | 
			
		||||
	content: '标题1';
 | 
			
		||||
}
 | 
			
		||||
.ql-snow .ql-picker.ql-header .ql-picker-label[data-value="2"]::before,
 | 
			
		||||
.ql-snow .ql-picker.ql-header .ql-picker-item[data-value="2"]::before {
 | 
			
		||||
  content: "标题2";
 | 
			
		||||
.ql-snow .ql-picker.ql-header .ql-picker-label[data-value='2']::before,
 | 
			
		||||
.ql-snow .ql-picker.ql-header .ql-picker-item[data-value='2']::before {
 | 
			
		||||
	content: '标题2';
 | 
			
		||||
}
 | 
			
		||||
.ql-snow .ql-picker.ql-header .ql-picker-label[data-value="3"]::before,
 | 
			
		||||
.ql-snow .ql-picker.ql-header .ql-picker-item[data-value="3"]::before {
 | 
			
		||||
  content: "标题3";
 | 
			
		||||
.ql-snow .ql-picker.ql-header .ql-picker-label[data-value='3']::before,
 | 
			
		||||
.ql-snow .ql-picker.ql-header .ql-picker-item[data-value='3']::before {
 | 
			
		||||
	content: '标题3';
 | 
			
		||||
}
 | 
			
		||||
.ql-snow .ql-picker.ql-header .ql-picker-label[data-value="4"]::before,
 | 
			
		||||
.ql-snow .ql-picker.ql-header .ql-picker-item[data-value="4"]::before {
 | 
			
		||||
  content: "标题4";
 | 
			
		||||
.ql-snow .ql-picker.ql-header .ql-picker-label[data-value='4']::before,
 | 
			
		||||
.ql-snow .ql-picker.ql-header .ql-picker-item[data-value='4']::before {
 | 
			
		||||
	content: '标题4';
 | 
			
		||||
}
 | 
			
		||||
.ql-snow .ql-picker.ql-header .ql-picker-label[data-value="5"]::before,
 | 
			
		||||
.ql-snow .ql-picker.ql-header .ql-picker-item[data-value="5"]::before {
 | 
			
		||||
  content: "标题5";
 | 
			
		||||
.ql-snow .ql-picker.ql-header .ql-picker-label[data-value='5']::before,
 | 
			
		||||
.ql-snow .ql-picker.ql-header .ql-picker-item[data-value='5']::before {
 | 
			
		||||
	content: '标题5';
 | 
			
		||||
}
 | 
			
		||||
.ql-snow .ql-picker.ql-header .ql-picker-label[data-value="6"]::before,
 | 
			
		||||
.ql-snow .ql-picker.ql-header .ql-picker-item[data-value="6"]::before {
 | 
			
		||||
  content: "标题6";
 | 
			
		||||
.ql-snow .ql-picker.ql-header .ql-picker-label[data-value='6']::before,
 | 
			
		||||
.ql-snow .ql-picker.ql-header .ql-picker-item[data-value='6']::before {
 | 
			
		||||
	content: '标题6';
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
.ql-snow .ql-picker.ql-font .ql-picker-label::before,
 | 
			
		||||
.ql-snow .ql-picker.ql-font .ql-picker-item::before {
 | 
			
		||||
  content: "标准字体";
 | 
			
		||||
	content: '标准字体';
 | 
			
		||||
}
 | 
			
		||||
.ql-snow .ql-picker.ql-font .ql-picker-label[data-value="serif"]::before,
 | 
			
		||||
.ql-snow .ql-picker.ql-font .ql-picker-item[data-value="serif"]::before {
 | 
			
		||||
  content: "衬线字体";
 | 
			
		||||
.ql-snow .ql-picker.ql-font .ql-picker-label[data-value='serif']::before,
 | 
			
		||||
.ql-snow .ql-picker.ql-font .ql-picker-item[data-value='serif']::before {
 | 
			
		||||
	content: '衬线字体';
 | 
			
		||||
}
 | 
			
		||||
.ql-snow .ql-picker.ql-font .ql-picker-label[data-value="monospace"]::before,
 | 
			
		||||
.ql-snow .ql-picker.ql-font .ql-picker-item[data-value="monospace"]::before {
 | 
			
		||||
  content: "等宽字体";
 | 
			
		||||
.ql-snow .ql-picker.ql-font .ql-picker-label[data-value='monospace']::before,
 | 
			
		||||
.ql-snow .ql-picker.ql-font .ql-picker-item[data-value='monospace']::before {
 | 
			
		||||
	content: '等宽字体';
 | 
			
		||||
}
 | 
			
		||||
</style>
 | 
			
		||||
 
 | 
			
		||||
@@ -29,10 +29,10 @@
 | 
			
		||||
    <transition-group class="upload-file-list el-upload-list el-upload-list--text" name="el-fade-in-linear" tag="ul">
 | 
			
		||||
      <li :key="file.url" class="el-upload-list__item ele-upload-list__item-content" v-for="(file, index) in fileList">
 | 
			
		||||
        <el-link :href="`${file.url}`" :underline="false" target="_blank">
 | 
			
		||||
          <span class="el-icon-document"> {{ getFileName(file.name) }} </span>
 | 
			
		||||
          <span class="el-icon-document"> {{ fileName }} </span>
 | 
			
		||||
        </el-link>
 | 
			
		||||
        <div class="ele-upload-list__item-content-action">
 | 
			
		||||
          <el-link :underline="false" @click="handleDelete(index)" type="danger">删除</el-link>
 | 
			
		||||
          <el-link :underline="false" @click="handleDelete(index)" :disabled="disabled" type="danger">删除</el-link>
 | 
			
		||||
        </div>
 | 
			
		||||
      </li>
 | 
			
		||||
    </transition-group>
 | 
			
		||||
@@ -71,6 +71,11 @@ export default {
 | 
			
		||||
    disabled: {
 | 
			
		||||
      type: Boolean,
 | 
			
		||||
      default: false
 | 
			
		||||
    },
 | 
			
		||||
    //文件名称
 | 
			
		||||
    fName: {
 | 
			
		||||
      type: String,
 | 
			
		||||
      default: ''
 | 
			
		||||
    }
 | 
			
		||||
  },
 | 
			
		||||
  data() {
 | 
			
		||||
@@ -81,6 +86,7 @@ export default {
 | 
			
		||||
      uploadFileUrl: process.env.VUE_APP_BASE_API + "/admin-api/infra/file/upload", // 请求地址
 | 
			
		||||
      headers: { Authorization: "Bearer " + getAccessToken() }, // 设置上传的请求头部
 | 
			
		||||
      fileList: [],
 | 
			
		||||
      fileName: ''
 | 
			
		||||
    };
 | 
			
		||||
  },
 | 
			
		||||
  watch: {
 | 
			
		||||
@@ -105,6 +111,14 @@ export default {
 | 
			
		||||
      },
 | 
			
		||||
      deep: true,
 | 
			
		||||
      immediate: true
 | 
			
		||||
    },
 | 
			
		||||
    fName: {
 | 
			
		||||
      handler(val) {
 | 
			
		||||
        if (val) {
 | 
			
		||||
          console.log('11', val)
 | 
			
		||||
          this.fileName = val
 | 
			
		||||
        }
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
  },
 | 
			
		||||
  computed: {
 | 
			
		||||
@@ -117,6 +131,7 @@ export default {
 | 
			
		||||
    // 上传前校检格式和大小
 | 
			
		||||
    handleBeforeUpload(file) {
 | 
			
		||||
      // 校检文件类型
 | 
			
		||||
      this.fileName = file.name
 | 
			
		||||
      if (this.fileType) {
 | 
			
		||||
        let fileExtension = "";
 | 
			
		||||
        if (file.name.lastIndexOf(".") > -1) {
 | 
			
		||||
@@ -150,7 +165,7 @@ export default {
 | 
			
		||||
    },
 | 
			
		||||
    // 上传失败
 | 
			
		||||
    handleUploadError(err) {
 | 
			
		||||
      this.$modal.msgError("上传图片失败,请重试");
 | 
			
		||||
      this.$modal.msgError("上传文件失败,请重试");
 | 
			
		||||
      this.$modal.closeLoading()
 | 
			
		||||
    },
 | 
			
		||||
    // 上传成功回调
 | 
			
		||||
@@ -180,8 +195,12 @@ export default {
 | 
			
		||||
        this.number = 0;
 | 
			
		||||
        this.$emit("input", this.listToString(this.fileList));
 | 
			
		||||
        this.$modal.closeLoading();
 | 
			
		||||
        this.returnFileName()
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
    returnFileName() {
 | 
			
		||||
      this.$emit('name', this.fileName)
 | 
			
		||||
    },
 | 
			
		||||
    // 获取文件名称
 | 
			
		||||
    getFileName(name) {
 | 
			
		||||
      console.log('你好', name)
 | 
			
		||||
 
 | 
			
		||||
@@ -360,6 +360,7 @@ export default {
 | 
			
		||||
        ts: Date.now(), // 现在的时间戳
 | 
			
		||||
      }
 | 
			
		||||
      reqGet(data).then(res => {
 | 
			
		||||
        console.log(1)
 | 
			
		||||
        if (res.repCode === '0000') {
 | 
			
		||||
          this.backImgBase = res.repData.originalImageBase64
 | 
			
		||||
          this.blockBackImgBase = res.repData.jigsawImageBase64
 | 
			
		||||
 
 | 
			
		||||
@@ -1,978 +0,0 @@
 | 
			
		||||
<template>
 | 
			
		||||
  <el-dialog class="dialog-with-menu" :visible="dialogVisible" :destroy-on-close="false" @close="handleClose"
 | 
			
		||||
    :close-on-click-modal="configs.clickModalToClose ?? true">
 | 
			
		||||
    <!-- title  -->
 | 
			
		||||
    <div slot="title" class="dialog-title">
 | 
			
		||||
      <h1 class="">
 | 
			
		||||
        {{ detailMode ? "查看详情" : dataForm.id ? "编辑" : "新增" }}
 | 
			
		||||
      </h1>
 | 
			
		||||
    </div>
 | 
			
		||||
 | 
			
		||||
    <div class="dialog-body__inner relative">
 | 
			
		||||
      <!-- v-if="dataForm.id && !detailMode && /属性|详情/.test(activeMenu) && $hasPermission()" -->
 | 
			
		||||
      <el-button v-if="configs.allowAdd ?? (dataForm.id && !detailMode && /属性|详情|参数/.test(activeMenu))" plain
 | 
			
		||||
        type="primary" size="small" class="at-right-top" style="margin-bottom: 16px" @click="handleAddParam()">+
 | 
			
		||||
        添加</el-button>
 | 
			
		||||
      <template v-if="dataForm.id && !detailMode && /附件/.test(activeMenu)">
 | 
			
		||||
        <el-upload style="position: absolute; width: 100%; height: 0" name="files" :action="uploadUrl"
 | 
			
		||||
          :show-file-list="false" :headers="uploadHeaders" :on-success="handleUploadSuccess"
 | 
			
		||||
          :before-upload="handleUploadCheck">
 | 
			
		||||
          <el-button plain type="primary" size="small" class="at-right-top" style=""> <i class="el-icon-upload"></i> 上传
 | 
			
		||||
          </el-button>
 | 
			
		||||
        </el-upload>
 | 
			
		||||
      </template>
 | 
			
		||||
 | 
			
		||||
      <!-- menu  -->
 | 
			
		||||
      <el-tabs v-model="activeMenu" type="card" @tab-click="handleTabClick">
 | 
			
		||||
        <!-- <el-tab-pane v-for="(tab, index) in configs.menu" :key="index" :label="tab.name" :name="tab.name"> -->
 | 
			
		||||
        <el-tab-pane v-for="(tab, index) in actualMenus" :key="index" :name="tab.name">
 | 
			
		||||
          <span class="slot" slot="label">
 | 
			
		||||
            <i :class="{
 | 
			
		||||
              'el-icon-edit': tab.key === 'info',
 | 
			
		||||
              'el-icon-s-data': tab.key === 'attr',
 | 
			
		||||
              'el-icon-folder-opened': tab.key === 'attachment',
 | 
			
		||||
            }"></i>
 | 
			
		||||
            {{ tab.name }}
 | 
			
		||||
          </span>
 | 
			
		||||
 | 
			
		||||
          <!-- 表单标签页 -->
 | 
			
		||||
          <div v-if="tab.key === 'info'">
 | 
			
		||||
            <!-- form  -->
 | 
			
		||||
            <el-form ref="dataForm" :model="dataForm" v-loading="loadingStatus">
 | 
			
		||||
              <el-row v-for="(row, rowIndex) in configs.form.rows" :key="'row_' + rowIndex" :gutter="20">
 | 
			
		||||
                <el-col v-for="(col, colIndex) in row" :key="colIndex" :span="24 / row.length">
 | 
			
		||||
                  <el-form-item :label="col.label" :prop="col.prop" :rules="col.rules || null"
 | 
			
		||||
                    v-show="!col.forceDisabled || (col.forceDisabled && dataForm.id)">
 | 
			
		||||
                    <div v-if="col.forceDisabled && dataForm.id" class="force-disabled">
 | 
			
		||||
                      <el-tag :key="col.key" :type="col.type">{{ dataForm[col.prop] || "-" }}</el-tag>
 | 
			
		||||
                    </div>
 | 
			
		||||
                    <el-input v-if="col.input" v-model="dataForm[col.prop]" clearable
 | 
			
		||||
                      :disabled="disableCondition(col.prop)" v-bind="col.elparams" />
 | 
			
		||||
                    <el-cascader v-if="col.cascader" v-model="dataForm[col.prop]" :options="col.options"
 | 
			
		||||
                      :disabled="detailMode" v-bind="col.elparams"></el-cascader>
 | 
			
		||||
                    <el-select v-if="col.select" v-model="dataForm[col.prop]" clearable
 | 
			
		||||
                      :disabled="disableCondition(col.prop)" v-bind="col.elparams"
 | 
			
		||||
                      @change="handleSelectChange(col, $event)">
 | 
			
		||||
                      <el-option v-for="(opt, optIdx) in col.options" :key="'option_' + optIdx" :label="opt.label"
 | 
			
		||||
                        :value="opt.value" />
 | 
			
		||||
                    </el-select>
 | 
			
		||||
                    <el-switch v-if="col.switch" v-model="dataForm[col.prop]" :active-value="1" :inactive-value="0"
 | 
			
		||||
                      @change="handleSwitchChange" :disabled="disableCondition(col.prop)" />
 | 
			
		||||
                    <el-input v-if="col.textarea" type="textarea" v-model="dataForm[col.prop]"
 | 
			
		||||
                      :disabled="disableCondition(col.prop)" v-bind="col.elparams" />
 | 
			
		||||
                    <quillEditor v-if="col.richInput" ref="quill-editor" v-model="dataForm[col.prop]"
 | 
			
		||||
                      :options="col.quillConfig ?? defaultQuillConfig" style="margin-top: 42px"
 | 
			
		||||
                      :disabled="disableCondition(col.prop)" />
 | 
			
		||||
 | 
			
		||||
                    <div class="" v-if="col.component" style="margin: 42px 0 0">
 | 
			
		||||
                      <!-- 下面这个 component 几乎是为 富文本 quill 定制的了... TODO:后续可能会根据业务需求创建新的版本  -->
 | 
			
		||||
                      <component :is="col.component" :key="'component_' + col.prop"
 | 
			
		||||
                        @update:modelValue="handleComponentModelUpdate(col.prop, $event)" :modelValue="dataForm[col.prop]"
 | 
			
		||||
                        :mode="detailMode ? 'detail' : dataForm.id ? 'edit' : 'create'" />
 | 
			
		||||
                    </div>
 | 
			
		||||
                    <!-- add more...  -->
 | 
			
		||||
                  </el-form-item>
 | 
			
		||||
                </el-col>
 | 
			
		||||
              </el-row>
 | 
			
		||||
            </el-form>
 | 
			
		||||
          </div>
 | 
			
		||||
 | 
			
		||||
          <!-- 表格标签页 -->
 | 
			
		||||
          <div v-if="dataForm.id && tab.key === 'attr'" key="attr-list">
 | 
			
		||||
            <BaseListTable :table-config="null" :column-config="filteredTableProps" :table-data="subList"
 | 
			
		||||
              @operate-event="handleTableRowOperate" :current-page="attrPage" :current-size="attrSize"
 | 
			
		||||
              :refresh-layout-key="Math.random()" v-loading="loadingStatus" />
 | 
			
		||||
            <!-- paginator  -->
 | 
			
		||||
            <el-pagination class="" style="text-align: left" background @size-change="handleSizeChange"
 | 
			
		||||
              @current-change="handlePageChange" :current-page.sync="attrPage" :page-sizes="[5, 10, 20]"
 | 
			
		||||
              :page-size="attrSize" :total="attrTotal" layout="total, sizes, prev, next"></el-pagination>
 | 
			
		||||
          </div>
 | 
			
		||||
 | 
			
		||||
          <!-- 附件标签页 -->
 | 
			
		||||
          <div v-if="dataForm.id && tab.key === 'attachment'" key="attachment">
 | 
			
		||||
            <div class="upload-tips" style="font-size: 0.8em; margin-bottom: 12px">文件大小不要超过 2MB</div>
 | 
			
		||||
            <!-- 附件列表 -->
 | 
			
		||||
            <div class="" v-loading="loadingStatus">
 | 
			
		||||
              <ul class="file-list">
 | 
			
		||||
                <li v-for="(file, index) in fileList" :key="index">
 | 
			
		||||
                  <span class="file-name">{{ file.name }}</span>
 | 
			
		||||
                  <span class="file-operations">
 | 
			
		||||
                    <span class="file-icon preview" @click="handleFileClick('view', file)">
 | 
			
		||||
                      <i class="el-icon-view" style="cursor: pointer"></i>
 | 
			
		||||
                    </span>
 | 
			
		||||
                    <span class="file-icon download" @click="handleFileClick('download', file)">
 | 
			
		||||
                      <i class="el-icon-download" style="color: #0b58ff; cursor: pointer"></i>
 | 
			
		||||
                    </span>
 | 
			
		||||
                    <span class="file-icon delete" @click="handleFileClick('delete', file)">
 | 
			
		||||
                      <i class="el-icon-delete" style="color: red; cursor: pointer"></i>
 | 
			
		||||
                    </span>
 | 
			
		||||
                  </span>
 | 
			
		||||
                </li>
 | 
			
		||||
              </ul>
 | 
			
		||||
            </div>
 | 
			
		||||
            <!-- img preview dialog  -->
 | 
			
		||||
            <el-dialog key="image-preview-dialog" class="image-preview-dialog" :visible.sync="imgPreviewDialogVisible"
 | 
			
		||||
              :append-to-body="true">
 | 
			
		||||
              <div class="img-container">
 | 
			
		||||
                <img width="100%" :src="currentImgUrl" alt="" />
 | 
			
		||||
              </div>
 | 
			
		||||
            </el-dialog>
 | 
			
		||||
          </div>
 | 
			
		||||
        </el-tab-pane>
 | 
			
		||||
      </el-tabs>
 | 
			
		||||
    </div>
 | 
			
		||||
 | 
			
		||||
    <!-- sub dialog  -->
 | 
			
		||||
    <small-dialog :append-to-body="true" v-if="showSubDialog" ref="subDialog" :url="urls.subase"
 | 
			
		||||
      :configs="configs.subDialog" :related-id="dataForm.id" @refreshDataList="getSubList"></small-dialog>
 | 
			
		||||
 | 
			
		||||
    <!-- footer  -->
 | 
			
		||||
    <div slot="footer">
 | 
			
		||||
      <template v-for="(operate, index) in configs.form.operations">
 | 
			
		||||
        <el-button v-if="showButton(operate)" :key="'operation_' + index" :type="operate.type"
 | 
			
		||||
          @click="handleBtnClick(operate)"
 | 
			
		||||
          :loading="(operate.name === 'add' || operate.name === 'update') && btnLoading">{{ operate.label }}</el-button>
 | 
			
		||||
      </template>
 | 
			
		||||
      <el-button @click="handleBtnClick({ name: 'cancel' })">取消</el-button>
 | 
			
		||||
    </div>
 | 
			
		||||
  </el-dialog>
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script>
 | 
			
		||||
import { pick as __pick } from "@/utils/filters";
 | 
			
		||||
import SmallDialog from "@/components/SmallDialog.vue";
 | 
			
		||||
import BaseListTable from "@/components/BaseListTable.vue";
 | 
			
		||||
import Cookies from "js-cookie";
 | 
			
		||||
import "quill/dist/quill.core.css";
 | 
			
		||||
import "quill/dist/quill.snow.css";
 | 
			
		||||
import "quill/dist/quill.bubble.css";
 | 
			
		||||
 | 
			
		||||
import { quillEditor } from "vue-quill-editor";
 | 
			
		||||
 | 
			
		||||
function reConstructTreeData(listObj) {
 | 
			
		||||
  const entry = [];
 | 
			
		||||
  Object.keys(listObj).map((key) => {
 | 
			
		||||
    const currentNode = listObj[key];
 | 
			
		||||
    currentNode.label = currentNode.name;
 | 
			
		||||
    currentNode.value = currentNode.id;
 | 
			
		||||
    if (currentNode.parentId === "0") {
 | 
			
		||||
      entry.push(listObj[key]);
 | 
			
		||||
      return; // return { label: currentNode.name, value: currentNode.id, children: currentNode.children ?? [] };
 | 
			
		||||
    }
 | 
			
		||||
    const parentNode = listObj[currentNode.parentId];
 | 
			
		||||
    if (!parentNode.children) {
 | 
			
		||||
      parentNode.children = [];
 | 
			
		||||
    }
 | 
			
		||||
    parentNode.children.push(currentNode);
 | 
			
		||||
  });
 | 
			
		||||
  return entry;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
export default {
 | 
			
		||||
  name: "DialogWithMenu",
 | 
			
		||||
  components: { SmallDialog, BaseListTable, quillEditor },
 | 
			
		||||
  props: {
 | 
			
		||||
    configs: {
 | 
			
		||||
      type: Object,
 | 
			
		||||
      default: () => ({}),
 | 
			
		||||
    },
 | 
			
		||||
    dialogVisible: {
 | 
			
		||||
      type: Boolean,
 | 
			
		||||
      default: false,
 | 
			
		||||
    },
 | 
			
		||||
  },
 | 
			
		||||
  inject: ["urls"],
 | 
			
		||||
  data() {
 | 
			
		||||
    const dataForm = {};
 | 
			
		||||
    const autoDisabledQueue = [];
 | 
			
		||||
    const watingToRefreshQueue = [];
 | 
			
		||||
    const cached = {}
 | 
			
		||||
 | 
			
		||||
    this.configs.form.rows.forEach((row) => {
 | 
			
		||||
      row.forEach((col) => {
 | 
			
		||||
        if (col.upload) dataForm[col.prop] = col.default ?? [];
 | 
			
		||||
        else dataForm[col.prop] = col.default ?? null;
 | 
			
		||||
 | 
			
		||||
        if (col.autoDisabled) autoDisabledQueue.push(col.prop);
 | 
			
		||||
        if (!!col.refreshOptionsAfterConfirm) watingToRefreshQueue.push(col);
 | 
			
		||||
 | 
			
		||||
        if (col.fetchData)
 | 
			
		||||
          col.fetchData().then(({ data: res }) => {
 | 
			
		||||
            console.log("[Fetch Data]", "list" in res.data, res.data, res.data.list);
 | 
			
		||||
            if (res.code === 0) {
 | 
			
		||||
              if (col.cacheFetchedData) {
 | 
			
		||||
                // cache fetched data
 | 
			
		||||
                cached[col.prop] = 'list' in res.data ? res.data.list : (Array.isArray(res.data) ? res.data : [])
 | 
			
		||||
              }
 | 
			
		||||
 | 
			
		||||
              if (!col.options || !col.options.length) {
 | 
			
		||||
                this.$set(
 | 
			
		||||
                  col,
 | 
			
		||||
                  "options",
 | 
			
		||||
                  "list" in res.data
 | 
			
		||||
                    ? res.data.list.map((i) => ({
 | 
			
		||||
                      label: col.optionLabel ? i[col.optionLabel] : i.name,
 | 
			
		||||
                      value: col.optionValue ? i[col.optionValue] : i.id,
 | 
			
		||||
                    }))
 | 
			
		||||
                    : res.data.map((i) => ({
 | 
			
		||||
                      label: col.optionLabel ? i[col.optionLabel] : i.name,
 | 
			
		||||
                      value: col.optionValue ? i[col.optionValue] : i.id,
 | 
			
		||||
                    }))
 | 
			
		||||
                );
 | 
			
		||||
              }
 | 
			
		||||
              // col.options = res.data.list;
 | 
			
		||||
              else if (col.options.length) {
 | 
			
		||||
                "list" in res.data ? res.data.list.unshift(...col.options) : res.data.unshift(...col.options);
 | 
			
		||||
                this.$set(
 | 
			
		||||
                  col,
 | 
			
		||||
                  "options",
 | 
			
		||||
                  "list" in res.data
 | 
			
		||||
                    ? res.data.list.map((i) => ({
 | 
			
		||||
                      label: col.optionLabel ? i[col.optionLabel] : i.name,
 | 
			
		||||
                      value: col.optionValue ? i[col.optionValue] : i.id,
 | 
			
		||||
                    }))
 | 
			
		||||
                    : res.data.map((i) => ({
 | 
			
		||||
                      label: col.optionLabel ? i[col.optionLabel] : i.name,
 | 
			
		||||
                      value: col.optionValue ? i[col.optionValue] : i.id,
 | 
			
		||||
                    }))
 | 
			
		||||
                );
 | 
			
		||||
              }
 | 
			
		||||
            } else {
 | 
			
		||||
              col.options.splice(0);
 | 
			
		||||
            }
 | 
			
		||||
            // dataForm[col.prop] = col.default ?? null; // not perfect!
 | 
			
		||||
          });
 | 
			
		||||
        else if (col.fetchTreeData) {
 | 
			
		||||
          // 获取设备类型时触发的,用于前端构建属性结构,约定,parentId 为0时是顶级节点
 | 
			
		||||
          col.fetchTreeData().then(({ data: res }) => {
 | 
			
		||||
            console.log("[Fetch Tree Data]", res.data);
 | 
			
		||||
            if (res.code === 0) {
 | 
			
		||||
              // 先把数据先重构成一个对象
 | 
			
		||||
              const obj = {};
 | 
			
		||||
 | 
			
		||||
              if ("list" in res.data) {
 | 
			
		||||
                res.data.list.map((item) => {
 | 
			
		||||
                  obj[item.id] = item;
 | 
			
		||||
                });
 | 
			
		||||
              } else if (Array.isArray(res.data)) {
 | 
			
		||||
                res.data.map((item) => {
 | 
			
		||||
                  obj[item.id] = item;
 | 
			
		||||
                });
 | 
			
		||||
              }
 | 
			
		||||
              // 再过滤这个对象
 | 
			
		||||
              let filteredList = reConstructTreeData(obj);
 | 
			
		||||
              console.log("** filteredList **", filteredList);
 | 
			
		||||
              // 最后设置 options
 | 
			
		||||
              this.$set(col, "options", filteredList);
 | 
			
		||||
            } else {
 | 
			
		||||
              col.options.splice(0);
 | 
			
		||||
              this.$message.error(res.msg);
 | 
			
		||||
            }
 | 
			
		||||
          });
 | 
			
		||||
        }
 | 
			
		||||
      });
 | 
			
		||||
    });
 | 
			
		||||
 | 
			
		||||
    return {
 | 
			
		||||
      // configs,
 | 
			
		||||
      btnLoading: false,
 | 
			
		||||
      loadingStatus: false,
 | 
			
		||||
      activeMenu: this.configs.menu[0].name,
 | 
			
		||||
      dataForm,
 | 
			
		||||
      detailMode: false,
 | 
			
		||||
      autoDisabledQueue,
 | 
			
		||||
      watingToRefreshQueue,
 | 
			
		||||
      cached,
 | 
			
		||||
      showBaseDialog: false,
 | 
			
		||||
      baseDialogConfig: null,
 | 
			
		||||
      subList: [],
 | 
			
		||||
      showSubDialog: false,
 | 
			
		||||
      disableXXX: false,
 | 
			
		||||
      defaultQuillConfig: {
 | 
			
		||||
        modules: {
 | 
			
		||||
          toolbar: [
 | 
			
		||||
            [{ font: [] }],
 | 
			
		||||
            [{ size: ["small", false, "large", "huge"] }], // custom dropdown
 | 
			
		||||
            ["bold", "italic", "underline", "strike"], // toggled buttons
 | 
			
		||||
            [{ color: [] }, { background: [] }], // dropdown with defaults from theme
 | 
			
		||||
            ["blockquote", "code-block"],
 | 
			
		||||
            [{ header: 1 }, { header: 2 }], // custom button values
 | 
			
		||||
            [{ list: "ordered" }, { list: "bullet" }],
 | 
			
		||||
            // [{ 'script': 'sub'}, { 'script': 'super' }],      // superscript/subscript
 | 
			
		||||
            [{ indent: "-1" }, { indent: "+1" }], // outdent/indent
 | 
			
		||||
            // [{ 'direction': 'rtl' }],                         // text direction
 | 
			
		||||
            // [{ 'header': [1, 2, 3, 4, 5, 6, false] }],
 | 
			
		||||
            // [{ 'align': [] }],
 | 
			
		||||
            // ['clean']                                         // remove formatting button
 | 
			
		||||
          ],
 | 
			
		||||
        },
 | 
			
		||||
        theme: "snow",
 | 
			
		||||
        readOnly: false,
 | 
			
		||||
        placeholder: "在这里输入描述信息...",
 | 
			
		||||
        scrollingContainer: null,
 | 
			
		||||
      },
 | 
			
		||||
      attrPage: 1,
 | 
			
		||||
      attrSize: 10,
 | 
			
		||||
      attrTotal: 0,
 | 
			
		||||
      fileList: [],
 | 
			
		||||
      imgPreviewDialogVisible: false,
 | 
			
		||||
      currentImgUrl: "",
 | 
			
		||||
    };
 | 
			
		||||
  },
 | 
			
		||||
  mounted() {
 | 
			
		||||
    this.configs.form.rows.forEach((row) => {
 | 
			
		||||
      row.forEach((col) => {
 | 
			
		||||
        if (col.changeReflects && typeof col.changeReflects === 'object' && 'fromKey' in col.changeReflects && 'toProp' in col.changeReflects) {
 | 
			
		||||
          this.$watch(
 | 
			
		||||
            () => this.dataForm[col.prop],
 | 
			
		||||
            val => {
 | 
			
		||||
              if (val && (col.prop in this.cached)) {
 | 
			
		||||
                console.log("here changeReflects", col.prop, col.changeReflects.toProp, this.cached[col.prop])
 | 
			
		||||
                if (typeof col.changeReflects.fromKey === 'string') {
 | 
			
		||||
                  this.dataForm[col.changeReflects.toProp] = this.cached[col.prop].find(item => item.id === val)?.[col.changeReflects.fromKey]
 | 
			
		||||
                } else if (Array.isArray(col.changeReflects.fromKey) && col.changeReflects.delimiter) {
 | 
			
		||||
                  const foundItem = this.dataForm[col.changeReflects.toProp] = this.cached[col.prop].find(item => item.id === val)
 | 
			
		||||
                  if (foundItem) {
 | 
			
		||||
                    const values = col.changeReflects.fromKey.map(key => foundItem[key])
 | 
			
		||||
                    this.dataForm[col.changeReflects.toProp] = values.join(col.changeReflects.delimiter)
 | 
			
		||||
                  } else {
 | 
			
		||||
                    this.dataForm[col.changeReflects.toProp] = col.changeReflects.delimiter
 | 
			
		||||
                    console.log("[DialogWithMenu] mounted() 没找到对应数据")
 | 
			
		||||
                  }
 | 
			
		||||
                }
 | 
			
		||||
              }
 | 
			
		||||
            },
 | 
			
		||||
            {
 | 
			
		||||
              immediate: false
 | 
			
		||||
            }
 | 
			
		||||
          )
 | 
			
		||||
        }
 | 
			
		||||
      });
 | 
			
		||||
    });
 | 
			
		||||
  },
 | 
			
		||||
 | 
			
		||||
  watch: {
 | 
			
		||||
    dialogVisible: function (val) {
 | 
			
		||||
      if (!!val) {
 | 
			
		||||
        this.attrPage = 1
 | 
			
		||||
        this.attrSize = 10
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
  },
 | 
			
		||||
  computed: {
 | 
			
		||||
    actualMenus() {
 | 
			
		||||
      return this.configs.menu.filter((m) => {
 | 
			
		||||
        if (m.onlyEditMode && !this.dataForm.id) {
 | 
			
		||||
          return false;
 | 
			
		||||
        }
 | 
			
		||||
        return true;
 | 
			
		||||
      });
 | 
			
		||||
    },
 | 
			
		||||
    filteredTableProps() {
 | 
			
		||||
      return this.detailMode ? this.configs.table.props.filter((v) => v.prop !== "operations") : this.configs.table.props;
 | 
			
		||||
    },
 | 
			
		||||
    uploadHeaders() {
 | 
			
		||||
      return {
 | 
			
		||||
        token: Cookies.get("token") || "",
 | 
			
		||||
      };
 | 
			
		||||
    },
 | 
			
		||||
    uploadUrl() {
 | 
			
		||||
      return this.configs.menu.find((item) => item.key === "attachment")?.actionUrl || "#";
 | 
			
		||||
    },
 | 
			
		||||
  },
 | 
			
		||||
 | 
			
		||||
  methods: {
 | 
			
		||||
    disableCondition(prop) {
 | 
			
		||||
      return this.detailMode || (this.disableXXX && this.autoDisabledQueue.indexOf(prop) !== -1);
 | 
			
		||||
    },
 | 
			
		||||
    /** utitilities */
 | 
			
		||||
    showButton(operate) {
 | 
			
		||||
      const notDetailMode = !this.detailMode;
 | 
			
		||||
      const showAlways = operate.showAlways ?? false;
 | 
			
		||||
      const editMode = operate.showOnEdit && this.dataForm.id;
 | 
			
		||||
      const addMode = !operate.showOnEdit && !this.dataForm.id;
 | 
			
		||||
      const permission = operate.permission ? this.$hasPermission(operate.permission) : true;
 | 
			
		||||
      const currentMenuKey = this.configs.menu.find((item) => item.name === this.activeMenu)?.key;
 | 
			
		||||
      return notDetailMode && (showAlways || ((editMode || addMode) && permission)) && currentMenuKey === "info";
 | 
			
		||||
    },
 | 
			
		||||
 | 
			
		||||
    resetForm(excludeId = false, immediate = false) {
 | 
			
		||||
      setTimeout(
 | 
			
		||||
        () => {
 | 
			
		||||
          Object.keys(this.dataForm).forEach((key) => {
 | 
			
		||||
            if (excludeId && key === "id") return;
 | 
			
		||||
            if ("files" in this.dataForm) this.dataForm.files = [];
 | 
			
		||||
            if ("fileIds" in this.dataForm) this.dataForm.fileIds = [];
 | 
			
		||||
            else this.dataForm[key] = null;
 | 
			
		||||
            if (Array.isArray(this.fileList)) {
 | 
			
		||||
              this.fileList = [];
 | 
			
		||||
            }
 | 
			
		||||
          });
 | 
			
		||||
          this.activeMenu = this.configs.menu[0].name;
 | 
			
		||||
          this.$refs.dataForm[0].clearValidate();
 | 
			
		||||
        },
 | 
			
		||||
        immediate ? 0 : 200
 | 
			
		||||
      );
 | 
			
		||||
    },
 | 
			
		||||
 | 
			
		||||
    updateOptions() {
 | 
			
		||||
      return new Promise((resolve, reject) => {
 | 
			
		||||
        if (this.watingToRefreshQueue.length) {
 | 
			
		||||
          this.watingToRefreshQueue.forEach((opt) => {
 | 
			
		||||
            console.log("[刷新数据, ", opt, "]");
 | 
			
		||||
            if ("fetchData" in opt) {
 | 
			
		||||
              opt.fetchData(this.dataForm.id ? this.dataForm.id : -1).then(({ data: res }) => {
 | 
			
		||||
                if (res.code === 0) {
 | 
			
		||||
                  this.$set(
 | 
			
		||||
                    opt,
 | 
			
		||||
                    "options",
 | 
			
		||||
                    "list" in res.data
 | 
			
		||||
                      ? res.data.list.map((i) => ({ label: i.code, value: i.id }))
 | 
			
		||||
                      : res.data.map((i) => ({ label: i.code, value: i.id }))
 | 
			
		||||
                  );
 | 
			
		||||
 | 
			
		||||
                  resolve({ done: true });
 | 
			
		||||
                } else {
 | 
			
		||||
                  this.$message({
 | 
			
		||||
                    message: `${res.code}: ${res.msg}`,
 | 
			
		||||
                    type: "error",
 | 
			
		||||
                    duration: 1500,
 | 
			
		||||
                  });
 | 
			
		||||
 | 
			
		||||
                  resolve({ done: false });
 | 
			
		||||
                }
 | 
			
		||||
              });
 | 
			
		||||
            }
 | 
			
		||||
          });
 | 
			
		||||
        } else resolve(null);
 | 
			
		||||
      });
 | 
			
		||||
    },
 | 
			
		||||
 | 
			
		||||
    /** init **/
 | 
			
		||||
    init(id, detailMode, menu) {
 | 
			
		||||
      // this.dialogVisible = true;
 | 
			
		||||
      if (this.$refs.dataForm && this.$refs.dataForm.length) {
 | 
			
		||||
        // 当不是首次渲染dialog的时候,一开始就清空验证信息,本组件的循环里只有一个 dataForm 所以只用取 [0] 即可
 | 
			
		||||
        this.$refs.dataForm[0].clearValidate();
 | 
			
		||||
      }
 | 
			
		||||
      console.log("[dialog] DialogWithHead init():", id, detailMode);
 | 
			
		||||
 | 
			
		||||
      this.detailMode = detailMode ?? false;
 | 
			
		||||
      this.$nextTick(() => {
 | 
			
		||||
        this.dataForm.id = id || null;
 | 
			
		||||
        if (this.dataForm.id) {
 | 
			
		||||
          // 如果是编辑
 | 
			
		||||
          this.loadingStatus = true;
 | 
			
		||||
          // 提前获取属性列表
 | 
			
		||||
          this.getSubList();
 | 
			
		||||
          // 获取详情
 | 
			
		||||
          this.updateOptions().then((result) => {
 | 
			
		||||
            if (result === null || (typeof result === "object" && result.done)) {
 | 
			
		||||
              this.$http.get(this.urls.base + `/${this.dataForm.id}`).then(({ data: res }) => {
 | 
			
		||||
                if (res && res.code === 0) {
 | 
			
		||||
                  const dataFormKeys = Object.keys(this.dataForm);
 | 
			
		||||
                  this.dataForm = __pick(res.data, dataFormKeys);
 | 
			
		||||
                  if ("files" in res.data) {
 | 
			
		||||
                    console.log("[DialogWithMenu] fileList===>", res.data.files, this.fileList);
 | 
			
		||||
                    /** 返回的文件列表 */
 | 
			
		||||
                    this.fileList = res.data.files
 | 
			
		||||
                      ? res.data.files.map((file) => ({
 | 
			
		||||
                        id: file.id,
 | 
			
		||||
                        name: file.fileUrl.split("/").pop(),
 | 
			
		||||
                        url: file.fileUrl,
 | 
			
		||||
                        typeCode: file.typeCode,
 | 
			
		||||
                      }))
 | 
			
		||||
                      : [];
 | 
			
		||||
                  }
 | 
			
		||||
                }
 | 
			
		||||
                this.loadingStatus = false;
 | 
			
		||||
                // 是否要跳转到附件页
 | 
			
		||||
                if (menu && menu.key) {
 | 
			
		||||
                  this.activeMenu = this.configs.menu.find((item) => item.key === menu.key)?.name;
 | 
			
		||||
                }
 | 
			
		||||
              });
 | 
			
		||||
            }
 | 
			
		||||
          });
 | 
			
		||||
        } else {
 | 
			
		||||
          // 如果不是编辑
 | 
			
		||||
          this.updateOptions();
 | 
			
		||||
        }
 | 
			
		||||
      });
 | 
			
		||||
    },
 | 
			
		||||
 | 
			
		||||
    /** handlers */
 | 
			
		||||
    handleFileClick(type, file) {
 | 
			
		||||
      switch (type) {
 | 
			
		||||
        case "view": {
 | 
			
		||||
          // 加载图片
 | 
			
		||||
          this.$http
 | 
			
		||||
            .get("/pms/attachment/downloadFile", {
 | 
			
		||||
              params: {
 | 
			
		||||
                attachmentId: file.id,
 | 
			
		||||
                type: 0, // 0 预览,1 下载
 | 
			
		||||
              },
 | 
			
		||||
              responseType: "blob",
 | 
			
		||||
            })
 | 
			
		||||
            .then(({ data: res }) => {
 | 
			
		||||
              console.log("preivew", res);
 | 
			
		||||
              if (/image/i.test(res.type)) {
 | 
			
		||||
                // 显示图片
 | 
			
		||||
                this.currentImgUrl = URL.createObjectURL(res);
 | 
			
		||||
                this.imgPreviewDialogVisible = true;
 | 
			
		||||
              } else if (/pdf/i.test(res.type)) {
 | 
			
		||||
                // 预览pdf 
 | 
			
		||||
                let a = document.createElement('a')
 | 
			
		||||
                a.setAttribute('target', '_blank')
 | 
			
		||||
                a.href = URL.createObjectURL(res)
 | 
			
		||||
                a.click()
 | 
			
		||||
                console.log('before remove a ', a)
 | 
			
		||||
                a.remove()
 | 
			
		||||
                console.log('removed a ', a)
 | 
			
		||||
              } else {
 | 
			
		||||
                this.$message({
 | 
			
		||||
                  message: "非图片和PDF文件请下载后预览",
 | 
			
		||||
                  type: "error",
 | 
			
		||||
                  duration: 1500,
 | 
			
		||||
                });
 | 
			
		||||
              }
 | 
			
		||||
            });
 | 
			
		||||
          break;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        case "download": {
 | 
			
		||||
          // 下载图片
 | 
			
		||||
          this.$http
 | 
			
		||||
            .get("/pms/attachment/downloadFile", {
 | 
			
		||||
              params: {
 | 
			
		||||
                attachmentId: file.id,
 | 
			
		||||
                type: 1, // 0 预览,1 下载
 | 
			
		||||
              },
 | 
			
		||||
              responseType: "blob",
 | 
			
		||||
            })
 | 
			
		||||
            .then(({ data: res }) => {
 | 
			
		||||
              const blob = new Blob([res]);
 | 
			
		||||
 | 
			
		||||
              /** 通知 */
 | 
			
		||||
              this.$notify({
 | 
			
		||||
                title: "成功",
 | 
			
		||||
                message: "开始下载",
 | 
			
		||||
                type: "success",
 | 
			
		||||
                duration: 1200,
 | 
			
		||||
              });
 | 
			
		||||
 | 
			
		||||
              if ("download" in document.createElement("a")) {
 | 
			
		||||
                const alink = document.createElement("a");
 | 
			
		||||
                alink.download = file.name;
 | 
			
		||||
                alink.style.display = "none";
 | 
			
		||||
                alink.target = "_blank";
 | 
			
		||||
                alink.href = URL.createObjectURL(blob);
 | 
			
		||||
                document.body.appendChild(alink);
 | 
			
		||||
                alink.click();
 | 
			
		||||
                URL.revokeObjectURL(alink.href);
 | 
			
		||||
                document.body.removeChild(alink);
 | 
			
		||||
              } else {
 | 
			
		||||
                navigator.msSaveBlob(blob, fileName);
 | 
			
		||||
              }
 | 
			
		||||
            });
 | 
			
		||||
 | 
			
		||||
          break;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        case "delete": {
 | 
			
		||||
          return this.$confirm(`确定删除图片: ${file.name}`, "提示", {
 | 
			
		||||
            confirmButtonText: "确认",
 | 
			
		||||
            cancelButtonText: "我再想想",
 | 
			
		||||
            type: "warning",
 | 
			
		||||
          })
 | 
			
		||||
            .then(() => {
 | 
			
		||||
              this.loadingStatus = true;
 | 
			
		||||
              const newFilelist = this.fileList.filter((f) => f.id !== file.id);
 | 
			
		||||
              this.updateRemoteFiles(newFilelist).then((msg) => {
 | 
			
		||||
                if (msg && msg === "success") {
 | 
			
		||||
                  this.fileList = newFilelist;
 | 
			
		||||
                  this.loadingStatus = false;
 | 
			
		||||
                  /** 通知 */
 | 
			
		||||
                  this.$notify({
 | 
			
		||||
                    title: "成功",
 | 
			
		||||
                    message: "已删除",
 | 
			
		||||
                    type: "success",
 | 
			
		||||
                    duration: 1200,
 | 
			
		||||
                  });
 | 
			
		||||
                }
 | 
			
		||||
              });
 | 
			
		||||
            })
 | 
			
		||||
            .catch((err) => { });
 | 
			
		||||
        }
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
 | 
			
		||||
    handleUploadSuccess(response, file, fileList) {
 | 
			
		||||
      console.log("[DialogWithMenu] uploadedFileList", response, file, fileList);
 | 
			
		||||
 | 
			
		||||
      if (response.code === 0) {
 | 
			
		||||
        const uploadedFile = response.data[0];
 | 
			
		||||
        const fileItem = {
 | 
			
		||||
          id: uploadedFile.id,
 | 
			
		||||
          name: uploadedFile.fileUrl.split("/").pop(),
 | 
			
		||||
          url: uploadedFile.fileUrl,
 | 
			
		||||
          typeCode: file.typeCode,
 | 
			
		||||
        };
 | 
			
		||||
 | 
			
		||||
        this.loadingStatus = true;
 | 
			
		||||
        this.updateRemoteFiles([...this.fileList, fileItem]).then((msg) => {
 | 
			
		||||
          if (msg && msg === "success") {
 | 
			
		||||
            this.fileList.push(fileItem);
 | 
			
		||||
            this.loadingStatus = false;
 | 
			
		||||
            /** 通知 */
 | 
			
		||||
            this.$notify({
 | 
			
		||||
              title: "成功",
 | 
			
		||||
              message: "上传成功",
 | 
			
		||||
              type: "success",
 | 
			
		||||
              duration: 1200,
 | 
			
		||||
            });
 | 
			
		||||
          }
 | 
			
		||||
        });
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
 | 
			
		||||
    updateRemoteFiles(filelist) {
 | 
			
		||||
      return this.$http
 | 
			
		||||
        .put("/pms/product", {
 | 
			
		||||
          id: "id" in this.dataForm ? this.dataForm.id : "DEFAULT_ID",
 | 
			
		||||
          fileIds: filelist.map((f) => f.id),
 | 
			
		||||
        })
 | 
			
		||||
        .then(({ data: res }) => {
 | 
			
		||||
          if (res.code === 0) return "success";
 | 
			
		||||
        });
 | 
			
		||||
    },
 | 
			
		||||
 | 
			
		||||
    handleUploadCheck(file) {
 | 
			
		||||
      console.log("[before upload]", file);
 | 
			
		||||
      const LIMIT = 2 * 1024 * 1024; // bytes
 | 
			
		||||
      if (file.size > LIMIT) {
 | 
			
		||||
        this.$message({
 | 
			
		||||
          message: "文件大小不能超过 2MB",
 | 
			
		||||
          type: "error",
 | 
			
		||||
          duration: 1500,
 | 
			
		||||
        });
 | 
			
		||||
        return false;
 | 
			
		||||
      } else return true;
 | 
			
		||||
    },
 | 
			
		||||
 | 
			
		||||
    handleComponentModelUpdate(propName, { subject, payload: { data } }) {
 | 
			
		||||
      this.dataForm[propName] = JSON.stringify(data);
 | 
			
		||||
      console.log("[DialogJustForm] handleComponentModelUpdate", this.dataForm[propName]);
 | 
			
		||||
    },
 | 
			
		||||
    handleSelectChange(col, eventValue) {
 | 
			
		||||
      console.log("[dialog] select change: ", col, eventValue);
 | 
			
		||||
    },
 | 
			
		||||
    handleSwitchChange(val) {
 | 
			
		||||
      console.log("[dialog] switch change: ", val, this.dataForm);
 | 
			
		||||
    },
 | 
			
		||||
    handleBtnClick(payload) {
 | 
			
		||||
      console.log("btn click payload: ", payload);
 | 
			
		||||
 | 
			
		||||
      if ("name" in payload) {
 | 
			
		||||
        switch (payload.name) {
 | 
			
		||||
          case "cancel":
 | 
			
		||||
            this.handleClose();
 | 
			
		||||
            break;
 | 
			
		||||
          case "reset":
 | 
			
		||||
            this.resetForm(true, true); // true means exclude id
 | 
			
		||||
            break;
 | 
			
		||||
          case "add":
 | 
			
		||||
          case "update": {
 | 
			
		||||
            this.$refs.dataForm[0].validate((passed, result) => {
 | 
			
		||||
              if (passed) {
 | 
			
		||||
                // 如果通过验证
 | 
			
		||||
                this.btnLoading = true
 | 
			
		||||
                this.loadingStatus = true;
 | 
			
		||||
                const method = payload.name === "add" ? "POST" : "PUT";
 | 
			
		||||
 | 
			
		||||
                // 判断是否有附件选项
 | 
			
		||||
                const hasAttachment = !!this.configs.menu.find((item) => item.key === "attachment");
 | 
			
		||||
                if (hasAttachment) {
 | 
			
		||||
                  const fileIds = this.fileList.map((item) => item.id);
 | 
			
		||||
                  this.$set(this.dataForm, "fileIds", fileIds);
 | 
			
		||||
                }
 | 
			
		||||
 | 
			
		||||
                // 加载额外需要的 id
 | 
			
		||||
                let extraIds = {};
 | 
			
		||||
                if (this.configs.extraIds && typeof this.configs.extraIds === "object") {
 | 
			
		||||
                  // 如果配置里,有 extraIds 选项
 | 
			
		||||
                  Object.entries(this.configs.extraIds).forEach(([key, value]) => {
 | 
			
		||||
                    extraIds[key] = value;
 | 
			
		||||
                  });
 | 
			
		||||
                }
 | 
			
		||||
 | 
			
		||||
                // 实际发送请求
 | 
			
		||||
                this.btnLoading = true
 | 
			
		||||
                this.$http({
 | 
			
		||||
                  url: this.urls.base,
 | 
			
		||||
                  method,
 | 
			
		||||
                  data: {
 | 
			
		||||
                    ...extraIds,
 | 
			
		||||
                    ...this.dataForm,
 | 
			
		||||
                  },
 | 
			
		||||
                })
 | 
			
		||||
                  .then(({ data: res }) => {
 | 
			
		||||
                    this.btnLoading = false
 | 
			
		||||
                    this.loadingStatus = false;
 | 
			
		||||
                    console.log("[add&update] res is: ", res);
 | 
			
		||||
                    if (res.code === 0) {
 | 
			
		||||
                      this.$message.success(payload.name === "add" ? "添加成功" : "更新成功");
 | 
			
		||||
                      this.$emit("refreshDataList");
 | 
			
		||||
 | 
			
		||||
                      // 如果 watingToRefreshQueue 队列里有数据
 | 
			
		||||
                      // if (this.watingToRefreshQueue.length) {
 | 
			
		||||
                      //   // 刷新队列
 | 
			
		||||
                      //   this.watingToRefreshQueue.forEach((opt) => {
 | 
			
		||||
                      //     console.log("[刷新数据, ", opt, "]");
 | 
			
		||||
                      //     if ("fetchData" in opt) {
 | 
			
		||||
                      //       opt.fetchData().then(({ data: res }) => {
 | 
			
		||||
                      //         if (res.code === 0) {
 | 
			
		||||
                      //           this.$set(
 | 
			
		||||
                      //             opt,
 | 
			
		||||
                      //             "options",
 | 
			
		||||
                      //             "list" in res.data
 | 
			
		||||
                      //               ? res.data.list.map((i) => ({ label: i.name, value: i.id }))
 | 
			
		||||
                      //               : res.data.map((i) => ({ label: i.name, value: i.id }))
 | 
			
		||||
                      //           );
 | 
			
		||||
                      //         }
 | 
			
		||||
                      //       });
 | 
			
		||||
                      //     }
 | 
			
		||||
                      //   });
 | 
			
		||||
                      // }
 | 
			
		||||
 | 
			
		||||
                      this.handleClose();
 | 
			
		||||
                    } else {
 | 
			
		||||
                      this.$message({
 | 
			
		||||
                        message: `${res.code}: ${res.msg}`,
 | 
			
		||||
                        type: "error",
 | 
			
		||||
                        duration: 2000,
 | 
			
		||||
                      });
 | 
			
		||||
                      if (this.btnLoading) this.btnLoading = false
 | 
			
		||||
                    }
 | 
			
		||||
                  })
 | 
			
		||||
                  .catch((errMsg) => {
 | 
			
		||||
                    this.$message.error("参数错误:" + errMsg);
 | 
			
		||||
                    if (this.loadingStatus) this.loadingStatus = false;
 | 
			
		||||
                    if (this.btnLoading) this.btnLoading = false
 | 
			
		||||
                  });
 | 
			
		||||
              } else {
 | 
			
		||||
                this.$message.error("请核查字段信息");
 | 
			
		||||
              }
 | 
			
		||||
            });
 | 
			
		||||
          }
 | 
			
		||||
        }
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
    handleTabClick(payload) {
 | 
			
		||||
      //   console.log("tab click payload: ", this.activeMenu);
 | 
			
		||||
      //   if (this.activeMenu === this.configs.menu[1].name) {
 | 
			
		||||
      //     // 获取数据
 | 
			
		||||
      //     this.getSubList();
 | 
			
		||||
      //   }
 | 
			
		||||
    },
 | 
			
		||||
 | 
			
		||||
    handlePageChange(val) {
 | 
			
		||||
      this.getSubList(val, this.attrSize);
 | 
			
		||||
    },
 | 
			
		||||
    handleSizeChange(val) {
 | 
			
		||||
      this.attrPage = 1;
 | 
			
		||||
      this.attrSize = val
 | 
			
		||||
      this.getSubList(1, val);
 | 
			
		||||
    },
 | 
			
		||||
 | 
			
		||||
    getSubList(page, size) {
 | 
			
		||||
      const params = {};
 | 
			
		||||
      params.page = page ?? this.attrPage;
 | 
			
		||||
      params.limit = size ?? this.attrSize;
 | 
			
		||||
 | 
			
		||||
      const requiredParams = this.configs.table.extraParams;
 | 
			
		||||
      if (requiredParams) {
 | 
			
		||||
        if (Array.isArray(requiredParams)) {
 | 
			
		||||
          requiredParams.forEach((str) => {
 | 
			
		||||
            if (/id/i.test(str)) {
 | 
			
		||||
              params[str] = this.dataForm.id;
 | 
			
		||||
            } else {
 | 
			
		||||
              params[str] = "";
 | 
			
		||||
            }
 | 
			
		||||
          });
 | 
			
		||||
        } else if (typeof requiredParams === "string") {
 | 
			
		||||
          // 如果需要额外参数,一般肯定需要
 | 
			
		||||
          params[this.configs.table.extraParams] = this.dataForm.id;
 | 
			
		||||
          // 此时 dataForm.id 一定是存在的
 | 
			
		||||
        }
 | 
			
		||||
      }
 | 
			
		||||
      this.$http.get(this.urls.subpage, { params }).then(({ data: res }) => {
 | 
			
		||||
        console.log("[DialogWithMenu] getSubList:", res);
 | 
			
		||||
        if (res.code === 0 && res.data?.list) {
 | 
			
		||||
          // 有数据
 | 
			
		||||
          this.subList = res.data.list;
 | 
			
		||||
          this.attrTotal = res.data.total;
 | 
			
		||||
        } else {
 | 
			
		||||
          this.subList.splice(0);
 | 
			
		||||
          this.attrTotal = 0;
 | 
			
		||||
        }
 | 
			
		||||
      });
 | 
			
		||||
    },
 | 
			
		||||
 | 
			
		||||
    handleAddParam(id) {
 | 
			
		||||
      this.showSubDialog = true;
 | 
			
		||||
      this.$nextTick(() => {
 | 
			
		||||
        this.$refs.subDialog.init(id ?? null);
 | 
			
		||||
      });
 | 
			
		||||
    },
 | 
			
		||||
 | 
			
		||||
    handleClose() {
 | 
			
		||||
      this.resetForm();
 | 
			
		||||
      this.$emit("update:dialogVisible", false);
 | 
			
		||||
    },
 | 
			
		||||
 | 
			
		||||
    /** 列表handlers */
 | 
			
		||||
    handleAddItem() {
 | 
			
		||||
      // console.log('[dialog] handleAddItem ot list...');
 | 
			
		||||
      this.showBaseDialog = true;
 | 
			
		||||
      this.$nextTick(() => {
 | 
			
		||||
        console.log("[sub-dialog] ", this.$refs["sub-dialog"].init());
 | 
			
		||||
      });
 | 
			
		||||
    },
 | 
			
		||||
    handleTableRowOperate({ type, data }) {
 | 
			
		||||
      console.log("handleTableRowOperate", type, data);
 | 
			
		||||
 | 
			
		||||
      switch (type) {
 | 
			
		||||
        case "delete": {
 | 
			
		||||
          // 确认是否删除
 | 
			
		||||
          console.log('delete....', data)
 | 
			
		||||
          const itemName = typeof data === 'object' ? (data.attrName || data.name || data.material || data.id) : data
 | 
			
		||||
          return this.$confirm(`是否删除条目: ${itemName}`, "提示", {
 | 
			
		||||
            confirmButtonText: "确认",
 | 
			
		||||
            cancelButtonText: "我再想想",
 | 
			
		||||
            type: "warning",
 | 
			
		||||
          })
 | 
			
		||||
            .then(() => {
 | 
			
		||||
              // this.$http.delete(this.urls.base + `/${data}`).then((res) => {
 | 
			
		||||
              this.$http({
 | 
			
		||||
                url: this.urls.subase,
 | 
			
		||||
                method: "DELETE",
 | 
			
		||||
                data: [`${data.id}`],
 | 
			
		||||
              }).then(({ data: res }) => {
 | 
			
		||||
                if (res.code === 0) {
 | 
			
		||||
                  this.$message.success({
 | 
			
		||||
                    message: "删除成功!",
 | 
			
		||||
                    duration: 1000,
 | 
			
		||||
                    onClose: () => {
 | 
			
		||||
                      this.getSubList(1, 20);
 | 
			
		||||
                    },
 | 
			
		||||
                  });
 | 
			
		||||
                }
 | 
			
		||||
              });
 | 
			
		||||
            })
 | 
			
		||||
            .catch((err) => { });
 | 
			
		||||
        }
 | 
			
		||||
        case "edit": {
 | 
			
		||||
          this.handleAddParam(data); /** data is ==> id */
 | 
			
		||||
          break;
 | 
			
		||||
        }
 | 
			
		||||
        // case 'view-detail-action':
 | 
			
		||||
        // 	this.openDialog(data, true);
 | 
			
		||||
        // 	break;
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
  },
 | 
			
		||||
};
 | 
			
		||||
</script>
 | 
			
		||||
 | 
			
		||||
<style scoped>
 | 
			
		||||
.el-menu {
 | 
			
		||||
  margin: 16px 0 !important;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
.el-menu.el-menu--horizontal {
 | 
			
		||||
  border: none !important;
 | 
			
		||||
  /* background: #0f02 !important; */
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/* .el-menu--horizontal > .el-menu-item.is-active { */
 | 
			
		||||
/* border-bottom-color: #0b58ff; */
 | 
			
		||||
/* } */
 | 
			
		||||
 | 
			
		||||
.dialog-with-menu>>>.el-dialog__body {
 | 
			
		||||
  /* padding-top: 16px !important;
 | 
			
		||||
  padding-bottom: 16px !important; */
 | 
			
		||||
  padding-top: 0 !important;
 | 
			
		||||
  padding-bottom: 0 !important;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
.el-select,
 | 
			
		||||
.el-cascader {
 | 
			
		||||
  width: 100% !important;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
.dialog-with-menu>>>.el-dialog__header {
 | 
			
		||||
  padding: 10px 20px 10px;
 | 
			
		||||
  /* background: linear-gradient(to bottom, rgba(0, 0, 0, 0.25), white); */
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
.relative {
 | 
			
		||||
  position: relative;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
.at-right-top {
 | 
			
		||||
  position: absolute;
 | 
			
		||||
  top: 0;
 | 
			
		||||
  right: 0;
 | 
			
		||||
  z-index: 10000;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
ul.file-list,
 | 
			
		||||
ul.file-list>li {
 | 
			
		||||
  padding: 0;
 | 
			
		||||
  margin: 0;
 | 
			
		||||
  list-style: none;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
.file-list {
 | 
			
		||||
  max-height: 20vh;
 | 
			
		||||
  overflow-y: auto;
 | 
			
		||||
  margin-top: 12px;
 | 
			
		||||
  /* width: 240px; */
 | 
			
		||||
  display: flex;
 | 
			
		||||
  flex-direction: column;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
ul.file-list>li {
 | 
			
		||||
  border-radius: 4px;
 | 
			
		||||
  background-color: #edededd2;
 | 
			
		||||
  padding: 8px;
 | 
			
		||||
  margin-bottom: 2px;
 | 
			
		||||
  display: flex;
 | 
			
		||||
  justify-content: space-between;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
ul.file-list>li:hover {
 | 
			
		||||
  background-color: #ededed;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
.file-operations {
 | 
			
		||||
  display: flex;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
.file-icon {
 | 
			
		||||
  margin-right: 8px;
 | 
			
		||||
  font-size: 16px;
 | 
			
		||||
  line-height: 1;
 | 
			
		||||
  display: flex;
 | 
			
		||||
  place-content: center;
 | 
			
		||||
  width: 16px;
 | 
			
		||||
  height: 16px;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/* .image-preview-dialog {
 | 
			
		||||
} */
 | 
			
		||||
 | 
			
		||||
.force-disabled {
 | 
			
		||||
  margin-top: 42px;
 | 
			
		||||
}
 | 
			
		||||
</style>
 | 
			
		||||
@@ -33,6 +33,7 @@ export default {
 | 
			
		||||
			addUrl: '',
 | 
			
		||||
			pageUrl: '',
 | 
			
		||||
			infoUrl: '',
 | 
			
		||||
			deleteUrl: '',
 | 
			
		||||
			basePath: '',
 | 
			
		||||
			form: {}
 | 
			
		||||
		};
 | 
			
		||||
@@ -60,7 +61,7 @@ export default {
 | 
			
		||||
			return this.$axios({
 | 
			
		||||
				url,
 | 
			
		||||
				method,
 | 
			
		||||
				params: method === 'get' ? payload : null,
 | 
			
		||||
				params: (method === 'get' || method === 'delete') ? payload : null,
 | 
			
		||||
				data: method !== 'get' ? payload : null,
 | 
			
		||||
			})
 | 
			
		||||
		},
 | 
			
		||||
@@ -77,6 +78,7 @@ export default {
 | 
			
		||||
			return this.http(this.infoUrl == '' ? this.infoPath : this.infoUrl, 'get', payload);
 | 
			
		||||
		},
 | 
			
		||||
		del(payload) {
 | 
			
		||||
			debugger;
 | 
			
		||||
			return this.http(this.deleteUrl == '' ? this.deletePath : this.deleteUrl, 'delete', payload);
 | 
			
		||||
		},
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -163,7 +163,7 @@ input, textarea{
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
::-webkit-scrollbar-thumb {
 | 
			
		||||
  background-color: rgba(144,147,153,.5);
 | 
			
		||||
  background-color: #EDEDED;
 | 
			
		||||
  background-clip: padding-box;
 | 
			
		||||
  min-height: 28px;
 | 
			
		||||
  -webkit-border-radius: 2em;
 | 
			
		||||
@@ -174,7 +174,7 @@ input, textarea{
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
::-webkit-scrollbar-thumb:hover {
 | 
			
		||||
  background-color: rgba(144,147,153,.3);
 | 
			
		||||
  background-color: #D9D9D9;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// 抽屉head区域---start
 | 
			
		||||
@@ -197,3 +197,7 @@ input, textarea{
 | 
			
		||||
  vertical-align: middle;
 | 
			
		||||
}
 | 
			
		||||
// 抽屉head区域---end
 | 
			
		||||
// 弹出框,上下分布,去掉label的padding-bottom
 | 
			
		||||
.el-form--label-top .el-form-item__label {
 | 
			
		||||
  padding: 0;
 | 
			
		||||
}
 | 
			
		||||
@@ -187,19 +187,6 @@ export function getTenantEnable() {
 | 
			
		||||
  return process.env.VUE_APP_TENANT_ENABLE || true;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * 获得验证码功能是否开启
 | 
			
		||||
 */
 | 
			
		||||
export function getCaptchaEnable() {
 | 
			
		||||
  if (process.env.VUE_APP_CAPTCHA_ENABLE === "true") {
 | 
			
		||||
    return true;
 | 
			
		||||
  }
 | 
			
		||||
  if (process.env.VUE_APP_CAPTCHA_ENABLE === "false") {
 | 
			
		||||
    return false;
 | 
			
		||||
  }
 | 
			
		||||
  return process.env.VUE_APP_CAPTCHA_ENABLE || true;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * 获得文档是否开启
 | 
			
		||||
 */
 | 
			
		||||
 
 | 
			
		||||
@@ -2,7 +2,7 @@
 | 
			
		||||
 * @Author: zwq
 | 
			
		||||
 * @Date: 2021-07-19 15:18:30
 | 
			
		||||
 * @LastEditors: zhp
 | 
			
		||||
 * @LastEditTime: 2023-11-15 16:04:06
 | 
			
		||||
 * @LastEditTime: 2023-11-23 11:14:30
 | 
			
		||||
 * @Description:
 | 
			
		||||
-->
 | 
			
		||||
<template>
 | 
			
		||||
@@ -14,6 +14,8 @@
 | 
			
		||||
    }">
 | 
			
		||||
      <img src="../../assets/img/logo.png" style="width:1.1em;position:relative;top:.4em" alt="">
 | 
			
		||||
      许昌安彩AGV原片周转看板
 | 
			
		||||
      <h3 class="unit">单位:河南汇融科技服务有限公司</h3>
 | 
			
		||||
      <h3 class="time">{{ times }}</h3>
 | 
			
		||||
      <!-- <el-button
 | 
			
		||||
        type="text"
 | 
			
		||||
        class="title-button"
 | 
			
		||||
@@ -87,11 +89,11 @@
 | 
			
		||||
            <!-- <div style="width: 45%;position: absolute; top: 3em; right: 3em;">
 | 
			
		||||
              <top-radio-group />
 | 
			
		||||
            </div> -->
 | 
			
		||||
            <el-row :gutter="9 * beilv">
 | 
			
		||||
              <el-col :style="{ margin: 8 + 'px' + ' 0' }" :span="24">
 | 
			
		||||
            <!-- <el-row :gutter="9 * beilv"> -->
 | 
			
		||||
              <!-- <el-col :style="{ margin: 8 + 'px' + ' 0' }" :span="24"> -->
 | 
			
		||||
                <base-table :page="1" :limit="9" :show-index="false" :beilv="1" :table-config="inventoryTableProps"
 | 
			
		||||
                  :table-data="inventoryList" />
 | 
			
		||||
              </el-col>
 | 
			
		||||
              <!-- </el-col> -->
 | 
			
		||||
              <!-- <el-col :style="{ margin: 8 + 'px' + ' 0' }" :span="12">
 | 
			
		||||
                <base-table3
 | 
			
		||||
                  :page="2"
 | 
			
		||||
@@ -101,7 +103,7 @@
 | 
			
		||||
                  :table-data="qualityList2"
 | 
			
		||||
                />
 | 
			
		||||
              </el-col> -->
 | 
			
		||||
            </el-row>
 | 
			
		||||
            <!-- </el-row> -->
 | 
			
		||||
          </base-container>
 | 
			
		||||
        </el-col>
 | 
			
		||||
        <el-col :style="{ margin: 8 + 'px' + ' 0' }" :span="12">
 | 
			
		||||
@@ -666,7 +668,8 @@ export default {
 | 
			
		||||
    return {
 | 
			
		||||
      beilv: 1,
 | 
			
		||||
      beilv2: 1,
 | 
			
		||||
      clientWidth:0,
 | 
			
		||||
      clientWidth: 0,
 | 
			
		||||
      times:undefined,
 | 
			
		||||
      value: 100,
 | 
			
		||||
      qualityYearTableProps,
 | 
			
		||||
      cxNameList,
 | 
			
		||||
@@ -727,27 +730,28 @@ export default {
 | 
			
		||||
    }
 | 
			
		||||
  },
 | 
			
		||||
 | 
			
		||||
  // watch: {
 | 
			
		||||
  //   clientWidth(val) {
 | 
			
		||||
  //     if (!this.timer) {
 | 
			
		||||
  //       this.clientWidth = val
 | 
			
		||||
  //       this.beilv2 = this.clientWidth / 1920
 | 
			
		||||
  //       this.timer = true
 | 
			
		||||
  //       let _this = this
 | 
			
		||||
  //       setTimeout(function () {
 | 
			
		||||
  //         _this.timer = false
 | 
			
		||||
  //       }, 500)
 | 
			
		||||
  //     }
 | 
			
		||||
  //     // 这里可以添加修改时的方法
 | 
			
		||||
  //     this.windowWidth(val);
 | 
			
		||||
  //   }
 | 
			
		||||
  // },
 | 
			
		||||
  watch: {
 | 
			
		||||
    clientWidth(val) {
 | 
			
		||||
      if (!this.timer) {
 | 
			
		||||
        this.clientWidth = val
 | 
			
		||||
        this.beilv2 = this.clientWidth / 1920
 | 
			
		||||
        this.timer = true
 | 
			
		||||
        let _this = this
 | 
			
		||||
        setTimeout(function () {
 | 
			
		||||
          _this.timer = false
 | 
			
		||||
        }, 500)
 | 
			
		||||
      }
 | 
			
		||||
      // 这里可以添加修改时的方法
 | 
			
		||||
      this.windowWidth(val);
 | 
			
		||||
    }
 | 
			
		||||
  },
 | 
			
		||||
  created() {
 | 
			
		||||
    // this.fetchList('exception-alarm')
 | 
			
		||||
    // this.fetchList('inAndOutOfEachLine')
 | 
			
		||||
    // this.fetchList('order-process')
 | 
			
		||||
    // this.fetchList('line-chart-data')
 | 
			
		||||
    this.init()
 | 
			
		||||
    this.getTimes()
 | 
			
		||||
    this.windowWidth(document.documentElement.clientWidth)
 | 
			
		||||
  },
 | 
			
		||||
  mounted() {
 | 
			
		||||
@@ -776,6 +780,30 @@ export default {
 | 
			
		||||
  //   removeEventListener('resize', resizeFun)
 | 
			
		||||
  // },
 | 
			
		||||
  methods: {
 | 
			
		||||
    getTimes() {
 | 
			
		||||
      setInterval(this.getTimesInterval, 1000);
 | 
			
		||||
    },
 | 
			
		||||
    getTimesInterval: function () {
 | 
			
		||||
      let _this = this;
 | 
			
		||||
      let year = new Date().getFullYear(); //获取当前时间的年份
 | 
			
		||||
      let month = new Date().getMonth() + 1; //获取当前时间的月份
 | 
			
		||||
      let day = new Date().getDate(); //获取当前时间的天数
 | 
			
		||||
      let hours = new Date().getHours(); //获取当前时间的小时
 | 
			
		||||
      let minutes = new Date().getMinutes(); //获取当前时间的分数
 | 
			
		||||
      let seconds = new Date().getSeconds(); //获取当前时间的秒数
 | 
			
		||||
      //当小于 10 的是时候,在前面加 0
 | 
			
		||||
      if (hours < 10) {
 | 
			
		||||
        hours = "0" + hours;
 | 
			
		||||
      }
 | 
			
		||||
      if (minutes < 10) {
 | 
			
		||||
        minutes = "0" + minutes;
 | 
			
		||||
      }
 | 
			
		||||
      if (seconds < 10) {
 | 
			
		||||
        seconds = "0" + seconds;
 | 
			
		||||
      }
 | 
			
		||||
      //拼接格式化当前时间
 | 
			
		||||
      this.times = year + "-" + month + "-" + day + " " + hours + ":" + minutes + ":" + seconds;
 | 
			
		||||
    },
 | 
			
		||||
    windowWidth(value) {
 | 
			
		||||
      this.clientWidth = value
 | 
			
		||||
    },
 | 
			
		||||
@@ -846,7 +874,19 @@ export default {
 | 
			
		||||
    background-size: 100% 100%;
 | 
			
		||||
    color: #00fff0;
 | 
			
		||||
    text-align: center;
 | 
			
		||||
 | 
			
		||||
    position: relative;
 | 
			
		||||
    .unit{
 | 
			
		||||
      position: absolute;
 | 
			
		||||
      left: 260px;
 | 
			
		||||
      top:25px;
 | 
			
		||||
      font-size: 20px;
 | 
			
		||||
    }
 | 
			
		||||
    .time{
 | 
			
		||||
      position: absolute;
 | 
			
		||||
      left: 1360px;
 | 
			
		||||
      top:25px;
 | 
			
		||||
      font-size: 20px;
 | 
			
		||||
    }
 | 
			
		||||
    .title-button {
 | 
			
		||||
      color: #00fff0;
 | 
			
		||||
      font-size: 20px;
 | 
			
		||||
@@ -901,7 +941,7 @@ export default {
 | 
			
		||||
 | 
			
		||||
</style>
 | 
			
		||||
 | 
			
		||||
<style lang="scss">
 | 
			
		||||
<style lang="scss" >
 | 
			
		||||
.visual-container {
 | 
			
		||||
  ::-webkit-scrollbar {
 | 
			
		||||
    width: 8px;
 | 
			
		||||
 
 | 
			
		||||
@@ -60,7 +60,7 @@
 | 
			
		||||
                <el-col :style="{ margin: 8 + 'px' + ' 0' }" :span="24">
 | 
			
		||||
                  <base-container1 :beilv="1" :title="'设备状态监控'" :title-icon="'1_5'">
 | 
			
		||||
                    <div class="visual-select">
 | 
			
		||||
                      <el-select v-model="modelMonth" size="mini" placeholder="">
 | 
			
		||||
                      <el-select class="coldSelect" v-model="modelMonth" size="mini" placeholder="">
 | 
			
		||||
                        <el-option key="1" value="钢1线" label="钢1线" default />
 | 
			
		||||
                      </el-select>
 | 
			
		||||
                    </div>
 | 
			
		||||
@@ -634,21 +634,21 @@ export default {
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
  },
 | 
			
		||||
  watch: {
 | 
			
		||||
    clientWidth(val) {
 | 
			
		||||
      if (!this.timer) {
 | 
			
		||||
        this.clientWidth = val
 | 
			
		||||
        this.beilv2 = this.clientWidth / 1920
 | 
			
		||||
        this.timer = true
 | 
			
		||||
        let _this = this
 | 
			
		||||
        setTimeout(function () {
 | 
			
		||||
          _this.timer = false
 | 
			
		||||
        }, 500)
 | 
			
		||||
      }
 | 
			
		||||
      // 这里可以添加修改时的方法
 | 
			
		||||
      this.windowWidth(val);
 | 
			
		||||
    }
 | 
			
		||||
  },
 | 
			
		||||
  // watch: {
 | 
			
		||||
  //   clientWidth(val) {
 | 
			
		||||
  //     if (!this.timer) {
 | 
			
		||||
  //       this.clientWidth = val
 | 
			
		||||
  //       this.beilv2 = this.clientWidth / 1920
 | 
			
		||||
  //       this.timer = true
 | 
			
		||||
  //       let _this = this
 | 
			
		||||
  //       setTimeout(function () {
 | 
			
		||||
  //         _this.timer = false
 | 
			
		||||
  //       }, 500)
 | 
			
		||||
  //     }
 | 
			
		||||
  //     // 这里可以添加修改时的方法
 | 
			
		||||
  //     this.windowWidth(val);
 | 
			
		||||
  //   }
 | 
			
		||||
  // },
 | 
			
		||||
  created() {
 | 
			
		||||
    // this.fetchList('exception-alarm')
 | 
			
		||||
    // this.fetchList('inAndOutOfEachLine')
 | 
			
		||||
@@ -658,6 +658,7 @@ export default {
 | 
			
		||||
    this.windowWidth(document.documentElement.clientWidth)
 | 
			
		||||
  },
 | 
			
		||||
  mounted() {
 | 
			
		||||
    console.log(1111);
 | 
			
		||||
    const _this = this;
 | 
			
		||||
    _this.beilv2 = document.documentElement.clientWidth / 1920
 | 
			
		||||
    window.onresize = () => {
 | 
			
		||||
@@ -686,6 +687,7 @@ export default {
 | 
			
		||||
  methods: {
 | 
			
		||||
    windowWidth(value) {
 | 
			
		||||
      this.clientWidth = value
 | 
			
		||||
      this.beilv2 = this.clientWidth / 1920
 | 
			
		||||
    },
 | 
			
		||||
    // erd.listenTo(document.getElementById("box"), (element) => {
 | 
			
		||||
    //   var width = element.offsetWidth;
 | 
			
		||||
@@ -1057,7 +1059,7 @@ export default {
 | 
			
		||||
}
 | 
			
		||||
</style>
 | 
			
		||||
 | 
			
		||||
<style lang="scss">
 | 
			
		||||
<style lang="scss" >
 | 
			
		||||
.visual-container {
 | 
			
		||||
  ::-webkit-scrollbar {
 | 
			
		||||
    width: 8px;
 | 
			
		||||
@@ -1096,6 +1098,7 @@ export default {
 | 
			
		||||
    background-color: rgba($color: #5bc4be, $alpha: 1);
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
.coldSelect{
 | 
			
		||||
  .el-input {
 | 
			
		||||
      min-height: 10px;
 | 
			
		||||
    }
 | 
			
		||||
@@ -1113,6 +1116,7 @@ export default {
 | 
			
		||||
      color: rgba(255, 255, 255, 0.15);
 | 
			
		||||
      margin-left: 3em;
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
</style>
 | 
			
		||||
 | 
			
		||||
<style scoped>
 | 
			
		||||
 
 | 
			
		||||
@@ -2,7 +2,7 @@
 | 
			
		||||
 * @Author: zwq
 | 
			
		||||
 * @Date: 2021-07-19 15:18:30
 | 
			
		||||
 * @LastEditors: zhp
 | 
			
		||||
 * @LastEditTime: 2023-10-17 11:10:22
 | 
			
		||||
 * @LastEditTime: 2023-11-23 11:11:35
 | 
			
		||||
 * @Description:
 | 
			
		||||
-->
 | 
			
		||||
<template>
 | 
			
		||||
@@ -44,7 +44,7 @@
 | 
			
		||||
        <el-col :style="{ margin: 8 + 'px' + ' 0' }" :span="8">
 | 
			
		||||
          <base-container :title="'各工序缺陷汇总'" :title-icon="'5_2'">
 | 
			
		||||
            <div class="visual-select">
 | 
			
		||||
              <el-select v-model="modelMonth" size="mini" placeholder="">
 | 
			
		||||
              <el-select class="coldSelect" v-model="modelMonth" size="mini" placeholder="">
 | 
			
		||||
                <el-option key="1" value="钢1线" label="钢1线" default />
 | 
			
		||||
              </el-select>
 | 
			
		||||
            </div>
 | 
			
		||||
@@ -740,16 +740,16 @@ export default {
 | 
			
		||||
    // this.fetchList('order-process')
 | 
			
		||||
    // this.fetchList('line-chart-data')
 | 
			
		||||
    this.init()
 | 
			
		||||
    this.windowWidth(document.documentElement.clientWidth)
 | 
			
		||||
  },
 | 
			
		||||
  mounted() {
 | 
			
		||||
    const _this = this;
 | 
			
		||||
    window.onresize = () => {
 | 
			
		||||
      return (() => {
 | 
			
		||||
        _this.clientWidth = `${document.documentElement.clientWidth}`
 | 
			
		||||
        this.beilv2 = _this.clientWidth / 1920
 | 
			
		||||
      })()
 | 
			
		||||
    }
 | 
			
		||||
    this.windowWidth(document.documentElement.clientWidth)
 | 
			
		||||
    // const _this = this;
 | 
			
		||||
    // window.onresize = () => {
 | 
			
		||||
    //   return (() => {
 | 
			
		||||
    //     _this.clientWidth = `${document.documentElement.clientWidth}`
 | 
			
		||||
    //     this.beilv2 = _this.clientWidth / 1920
 | 
			
		||||
    //   })()
 | 
			
		||||
    // }
 | 
			
		||||
    // this.beilv2 = window.innerWidth / 1920
 | 
			
		||||
    // addEventListener('resize', resizeFun = () => {
 | 
			
		||||
    //   this.beilv2 = window.innerWidth / 1920
 | 
			
		||||
@@ -770,6 +770,7 @@ export default {
 | 
			
		||||
  methods: {
 | 
			
		||||
    windowWidth(value) {
 | 
			
		||||
      this.clientWidth = value
 | 
			
		||||
      this.beilv2 = this.clientWidth / 1920
 | 
			
		||||
    },
 | 
			
		||||
    // fetchList(type) {
 | 
			
		||||
    //   switch (type) {
 | 
			
		||||
@@ -932,6 +933,7 @@ export default {
 | 
			
		||||
    background-color: rgba($color: #5bc4be, $alpha: 1);
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
.coldSelect{
 | 
			
		||||
  .el-input {
 | 
			
		||||
      min-height: 10px;
 | 
			
		||||
    }
 | 
			
		||||
@@ -949,6 +951,7 @@ export default {
 | 
			
		||||
      color: rgba(255, 255, 255, 0.15);
 | 
			
		||||
      margin-left: 3em;
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
</style>
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -2,7 +2,7 @@
 | 
			
		||||
 * @Author: zwq
 | 
			
		||||
 * @Date: 2021-11-18 14:16:25
 | 
			
		||||
 * @LastEditors: DY
 | 
			
		||||
 * @LastEditTime: 2023-11-03 10:53:43
 | 
			
		||||
 * @LastEditTime: 2023-11-22 10:27:50
 | 
			
		||||
 * @Description:
 | 
			
		||||
-->
 | 
			
		||||
<template>
 | 
			
		||||
@@ -77,8 +77,8 @@ export default {
 | 
			
		||||
        remark: undefined
 | 
			
		||||
			},
 | 
			
		||||
			dataRule: {
 | 
			
		||||
        code: [{ required: true, message: "专业编码不能为空", trigger: "blur" }],
 | 
			
		||||
        name: [{ required: true, message: "专业名称不能为空", trigger: "blur" }],
 | 
			
		||||
        code: [{ required: true, message: "客户编号不能为空", trigger: "blur" }],
 | 
			
		||||
        name: [{ required: true, message: "客户名称不能为空", trigger: "blur" }],
 | 
			
		||||
				contact: [{ required: true, message: "联系人不能为空", trigger: "blur" }],
 | 
			
		||||
				telephone: [
 | 
			
		||||
					{ required: false, trigger: "blur", message: "手机号不能为空" },
 | 
			
		||||
@@ -87,6 +87,8 @@ export default {
 | 
			
		||||
              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();
 | 
			
		||||
								}
 | 
			
		||||
							} else {
 | 
			
		||||
								callback();
 | 
			
		||||
 
 | 
			
		||||
@@ -105,8 +105,8 @@ export default {
 | 
			
		||||
			formConfig: [
 | 
			
		||||
				{
 | 
			
		||||
					type: 'input',
 | 
			
		||||
					label: '名称',
 | 
			
		||||
					placeholder: '专业',
 | 
			
		||||
					label: '客户名称',
 | 
			
		||||
					placeholder: '客户名称',
 | 
			
		||||
					param: 'name',
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
 
 | 
			
		||||
@@ -2,10 +2,11 @@
 | 
			
		||||
 * @Author: zwq
 | 
			
		||||
 * @Date: 2021-11-18 14:16:25
 | 
			
		||||
 * @LastEditors: DY
 | 
			
		||||
 * @LastEditTime: 2023-11-02 14:16:30
 | 
			
		||||
 * @LastEditTime: 2023-11-25 18:09:05
 | 
			
		||||
 * @Description:
 | 
			
		||||
-->
 | 
			
		||||
<template>
 | 
			
		||||
	<div class="dialog">
 | 
			
		||||
		<el-form
 | 
			
		||||
			:model="dataForm"
 | 
			
		||||
			:rules="dataRule"
 | 
			
		||||
@@ -27,7 +28,7 @@
 | 
			
		||||
			<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="选择上级部门"/>
 | 
			
		||||
						<treeselect v-model="dataForm.parentId" :options="menuOptions" :normalizer="normalizer" :show-count="true" placeholder="选择上级部门" />
 | 
			
		||||
					</el-form-item>
 | 
			
		||||
				</el-col>
 | 
			
		||||
				<el-col :span="12">
 | 
			
		||||
@@ -39,6 +40,7 @@
 | 
			
		||||
				</el-col>
 | 
			
		||||
			</el-row>
 | 
			
		||||
		</el-form>
 | 
			
		||||
	</div>
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script>
 | 
			
		||||
@@ -68,6 +70,7 @@ export default {
 | 
			
		||||
			},
 | 
			
		||||
			departmentlList: [],
 | 
			
		||||
			menuOptions: [],
 | 
			
		||||
			isChoosed: false,
 | 
			
		||||
			dataRule: {
 | 
			
		||||
        code: [{ required: true, message: "部门编码不能为空", trigger: "blur" }],
 | 
			
		||||
        name: [{ required: true, message: "部门名称不能为空", trigger: "blur" }],
 | 
			
		||||
@@ -89,7 +92,6 @@ export default {
 | 
			
		||||
			const menu = { id: 0, name: '总部门', children: [] };
 | 
			
		||||
			menu.children = this.handleTree(this.departmentlList, "id")
 | 
			
		||||
			this.menuOptions.push(menu)
 | 
			
		||||
			console.log('你好', this.menuOptions)
 | 
			
		||||
		},
 | 
			
		||||
		/** 转换菜单数据结构 */
 | 
			
		||||
    normalizer(node) {
 | 
			
		||||
@@ -105,3 +107,9 @@ export default {
 | 
			
		||||
	},
 | 
			
		||||
};
 | 
			
		||||
</script>
 | 
			
		||||
 | 
			
		||||
<style scoped>
 | 
			
		||||
.dialog {
 | 
			
		||||
	min-height: 180px;
 | 
			
		||||
}
 | 
			
		||||
</style>
 | 
			
		||||
 
 | 
			
		||||
@@ -134,6 +134,11 @@ export default {
 | 
			
		||||
    //     this.dataListLoading = false;
 | 
			
		||||
    //   });
 | 
			
		||||
    // },
 | 
			
		||||
		successSubmit() {
 | 
			
		||||
      this.handleCancel()
 | 
			
		||||
      this.getDataList()
 | 
			
		||||
			this.$refs.addOrUpdate.getDict()
 | 
			
		||||
    },
 | 
			
		||||
		buttonClick(val) {
 | 
			
		||||
			switch (val.btnName) {
 | 
			
		||||
				case 'search':
 | 
			
		||||
 
 | 
			
		||||
@@ -46,21 +46,13 @@
 | 
			
		||||
					}}文件大小不超过2MB
 | 
			
		||||
				</div>
 | 
			
		||||
			</el-upload>
 | 
			
		||||
			<!-- <div
 | 
			
		||||
				class="file-list__item"
 | 
			
		||||
				v-for="n in 9"
 | 
			
		||||
				:key="n"
 | 
			
		||||
				:style="{
 | 
			
		||||
					display: n > 4 && !expand ? 'none' : 'block',
 | 
			
		||||
				}"
 | 
			
		||||
				:data-name="n"
 | 
			
		||||
				:class="{ 'default-icon': !isPicMode }">
 | 
			
		||||
				<i class="el-icon-delete"></i>
 | 
			
		||||
			</div> -->
 | 
			
		||||
			<div
 | 
			
		||||
				class="file-list__item"
 | 
			
		||||
				v-for="(file, index) in files"
 | 
			
		||||
				:key="file.fileName"
 | 
			
		||||
				style="width: 100%">
 | 
			
		||||
				<div
 | 
			
		||||
					class="file-list__item"
 | 
			
		||||
					v-if="!isPicMode"
 | 
			
		||||
					:style="{
 | 
			
		||||
						background: isPicMode
 | 
			
		||||
							? `url(${file.fileUrl}) no-repeat`
 | 
			
		||||
@@ -68,6 +60,7 @@
 | 
			
		||||
						backgroundSize: isPicMode ? '100% 100%' : '64px',
 | 
			
		||||
						backgroundPosition: isPicMode ? '0% 0%' : 'center',
 | 
			
		||||
					}"
 | 
			
		||||
					@click="handleDownload(file)"
 | 
			
		||||
					:data-name="file.fileName">
 | 
			
		||||
					<el-button
 | 
			
		||||
						v-if="!disabled"
 | 
			
		||||
@@ -76,6 +69,14 @@
 | 
			
		||||
						style="padding: 0"
 | 
			
		||||
						@click="(e) => handleDelete(file)" />
 | 
			
		||||
				</div>
 | 
			
		||||
 | 
			
		||||
				<el-image
 | 
			
		||||
					v-else
 | 
			
		||||
					class="file-list__item"
 | 
			
		||||
					style="width: 100%"
 | 
			
		||||
					:src="file.fileUrl"
 | 
			
		||||
					:preview-src-list="files.map((item) => item.fileUrl)"></el-image>
 | 
			
		||||
			</div>
 | 
			
		||||
		</section>
 | 
			
		||||
	</div>
 | 
			
		||||
</template>
 | 
			
		||||
@@ -189,6 +190,32 @@ export default {
 | 
			
		||||
			}, 500);
 | 
			
		||||
		},
 | 
			
		||||
 | 
			
		||||
		async handleDownload(file) {
 | 
			
		||||
			if (this.isPicMode) {
 | 
			
		||||
				// this.$emit('preview', file);
 | 
			
		||||
				const link = document.createElement('a');
 | 
			
		||||
				link.href = file.fileUrl;
 | 
			
		||||
				link.target = '_blank';
 | 
			
		||||
				document.body.appendChild(link);
 | 
			
		||||
				link.click();
 | 
			
		||||
				document.body.removeChild(link);
 | 
			
		||||
			} else {
 | 
			
		||||
				// this.$emit('download', file);
 | 
			
		||||
				const data = await this.$axios({
 | 
			
		||||
					url: file.fileUrl,
 | 
			
		||||
					method: 'get',
 | 
			
		||||
					responseType: 'blob',
 | 
			
		||||
				});
 | 
			
		||||
				const link = document.createElement('a');
 | 
			
		||||
				link.href = window.URL.createObjectURL(new Blob([data]));
 | 
			
		||||
				link.download = file.fileName;
 | 
			
		||||
				document.body.appendChild(link);
 | 
			
		||||
				link.click();
 | 
			
		||||
				document.body.removeChild(link);
 | 
			
		||||
				window.URL.revokeObjectURL(link.href);
 | 
			
		||||
			}
 | 
			
		||||
		},
 | 
			
		||||
 | 
			
		||||
		emitFilelist() {
 | 
			
		||||
			this.$emit('update', this.files);
 | 
			
		||||
		},
 | 
			
		||||
 
 | 
			
		||||
@@ -42,16 +42,26 @@
 | 
			
		||||
							v-model="form" />
 | 
			
		||||
					</div>
 | 
			
		||||
 | 
			
		||||
					<div v-if="section.key == 'attrs'" style="margin-top: 12px">
 | 
			
		||||
					<div
 | 
			
		||||
						v-if="section.key == 'attrs'"
 | 
			
		||||
						style="margin-top: 12px; position: relative">
 | 
			
		||||
						<div
 | 
			
		||||
							v-if="!mode.includes('detail')"
 | 
			
		||||
							style="position: absolute; top: -40px; right: 0">
 | 
			
		||||
							<el-button @click="handleAddAttr" type="text">
 | 
			
		||||
								<i class="el-icon-plus"></i>
 | 
			
		||||
								添加属性
 | 
			
		||||
							</el-button>
 | 
			
		||||
						</div>
 | 
			
		||||
						<base-table
 | 
			
		||||
							v-loading="attrListLoading"
 | 
			
		||||
							:table-props="section.props"
 | 
			
		||||
							:page="attrQuery?.params.pageNo || 1"
 | 
			
		||||
							:limit="attrQuery?.params.pageSize || 10"
 | 
			
		||||
							:table-data="list"
 | 
			
		||||
							:add-button-show="mode.includes('detail') ? null : '添加属性'"
 | 
			
		||||
							@emitButtonClick="handleAddAttr"
 | 
			
		||||
							@emitFun="handleEmitFun">
 | 
			
		||||
							<!-- :add-button-show="mode.includes('detail') ? null : '添加属性'"
 | 
			
		||||
							@emitButtonClick="handleAddAttr" -->
 | 
			
		||||
							<method-btn
 | 
			
		||||
								v-if="section.tableBtn"
 | 
			
		||||
								slot="handleBtn"
 | 
			
		||||
@@ -76,7 +86,7 @@
 | 
			
		||||
				<el-button v-if="mode == 'detail'" type="primary" @click="toggleEdit">
 | 
			
		||||
					编辑
 | 
			
		||||
				</el-button>
 | 
			
		||||
				<el-button v-else type="primary" @click="handleConfirm">确定</el-button>
 | 
			
		||||
				<el-button v-else type="primary" @click="handleConfirm">保存</el-button>
 | 
			
		||||
				<!-- sections的第二项必须是 属性列表  -->
 | 
			
		||||
				<!-- <el-button
 | 
			
		||||
						v-if="sections[1].allowAdd"
 | 
			
		||||
@@ -162,7 +172,9 @@ export default {
 | 
			
		||||
						input: true,
 | 
			
		||||
						label: '属性名称',
 | 
			
		||||
						prop: 'name',
 | 
			
		||||
						rules: [{ required: true, message: '不能为空', trigger: 'blur' }],
 | 
			
		||||
						rules: [
 | 
			
		||||
							{ required: true, message: '属性名称不能为空', trigger: 'blur' },
 | 
			
		||||
						],
 | 
			
		||||
					},
 | 
			
		||||
				],
 | 
			
		||||
				[
 | 
			
		||||
 
 | 
			
		||||
@@ -10,7 +10,7 @@
 | 
			
		||||
		v-loading="formLoading">
 | 
			
		||||
		<el-row :gutter="20">
 | 
			
		||||
			<el-col :span="8">
 | 
			
		||||
				<el-form-item label="设备名称" prop="name" :rules="[{ required: true, message: '不能为空', trigger: 'blur' }]">
 | 
			
		||||
				<el-form-item label="设备名称" prop="name" :rules="[{ required: true, message: '设备名称不能为空', trigger: 'blur' }]">
 | 
			
		||||
					<el-input v-model="form.name" :disabled="disabled" placeholder="请输入设备名称"></el-input>
 | 
			
		||||
				</el-form-item>
 | 
			
		||||
			</el-col>
 | 
			
		||||
@@ -33,7 +33,7 @@
 | 
			
		||||
			</el-col>
 | 
			
		||||
			<el-col :span="8">
 | 
			
		||||
				<el-form-item label="设备类型" prop="equipmentTypeId"
 | 
			
		||||
					:rules="[{ required: true, message: '不能为空', trigger: 'blur' }]">
 | 
			
		||||
					:rules="[{ required: true, message: '设备类型不能为空', trigger: 'blur' }]">
 | 
			
		||||
					<el-select v-model="form.equipmentTypeId" :disabled="disabled" filterable placeholder="请选择设备类型">
 | 
			
		||||
						<el-option v-for="eqType in eqTypeList" :key="eqType.id" :label="eqType.name"
 | 
			
		||||
							:value="eqType.id"></el-option>
 | 
			
		||||
@@ -43,7 +43,7 @@
 | 
			
		||||
 | 
			
		||||
			<el-col :span="8">
 | 
			
		||||
				<el-form-item label="预计生产时间(min/天)" prop="workTime" :rules="[
 | 
			
		||||
					{ required: true, message: '不能为空', trigger: 'blur' },
 | 
			
		||||
					{ required: true, message: '预计生产时间不能为空', trigger: 'blur' },
 | 
			
		||||
					{
 | 
			
		||||
						type: 'number',
 | 
			
		||||
						message: '请输入正确的数字值',
 | 
			
		||||
@@ -71,7 +71,7 @@
 | 
			
		||||
			</el-col>
 | 
			
		||||
			<el-col :span="8">
 | 
			
		||||
				<el-form-item label="设备TT值" prop="tvalue" :rules="[
 | 
			
		||||
					{ required: true, message: '不能为空', trigger: 'blur' },
 | 
			
		||||
					{ required: true, message: '设备TT值不能为空', trigger: 'blur' },
 | 
			
		||||
					{
 | 
			
		||||
						type: 'number',
 | 
			
		||||
						message: '请输入正确的数字值',
 | 
			
		||||
@@ -86,7 +86,7 @@
 | 
			
		||||
		<el-row :gutter="20">
 | 
			
		||||
			<el-col :span="8">
 | 
			
		||||
				<el-form-item label="产品加工时间(s)" prop="processingTime" :rules="[
 | 
			
		||||
					{ required: true, message: '不能为空', trigger: 'blur' },
 | 
			
		||||
					{ required: true, message: '产品加工时间不能为空', trigger: 'blur' },
 | 
			
		||||
					{
 | 
			
		||||
						type: 'number',
 | 
			
		||||
						message: '请输入正确的数字值',
 | 
			
		||||
 
 | 
			
		||||
@@ -1,29 +1,62 @@
 | 
			
		||||
<template>
 | 
			
		||||
	<div class="app-container">
 | 
			
		||||
		<!-- 搜索工作栏 -->
 | 
			
		||||
		<SearchBar :formConfigs="searchBarFormConfig" ref="search-bar" @headBtnClick="handleSearchBarBtnClick" />
 | 
			
		||||
		<SearchBar
 | 
			
		||||
			:formConfigs="searchBarFormConfig"
 | 
			
		||||
			ref="search-bar"
 | 
			
		||||
			@headBtnClick="handleSearchBarBtnClick" />
 | 
			
		||||
 | 
			
		||||
		<!-- 列表 -->
 | 
			
		||||
		<base-table :table-props="tableProps" :page="queryParams.pageNo" :limit="queryParams.pageSize" :table-data="list"
 | 
			
		||||
		<base-table
 | 
			
		||||
			:table-props="tableProps"
 | 
			
		||||
			:page="queryParams.pageNo"
 | 
			
		||||
			:limit="queryParams.pageSize"
 | 
			
		||||
			:table-data="list"
 | 
			
		||||
			@emitFun="handleEmitFun">
 | 
			
		||||
			<method-btn v-if="tableBtn.length" slot="handleBtn" :width="120" label="操作" :method-list="tableBtn"
 | 
			
		||||
			<method-btn
 | 
			
		||||
				v-if="tableBtn.length"
 | 
			
		||||
				slot="handleBtn"
 | 
			
		||||
				:width="120"
 | 
			
		||||
				label="操作"
 | 
			
		||||
				:method-list="tableBtn"
 | 
			
		||||
				@clickBtn="handleTableBtnClick" />
 | 
			
		||||
		</base-table>
 | 
			
		||||
 | 
			
		||||
		<!-- 分页组件 -->
 | 
			
		||||
		<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize"
 | 
			
		||||
		<pagination
 | 
			
		||||
			v-show="total > 0"
 | 
			
		||||
			:total="total"
 | 
			
		||||
			:page.sync="queryParams.pageNo"
 | 
			
		||||
			:limit.sync="queryParams.pageSize"
 | 
			
		||||
			@pagination="getList" />
 | 
			
		||||
 | 
			
		||||
		<!-- 对话框(添加) -->
 | 
			
		||||
		<base-dialog :dialogTitle="title" :dialogVisible="open" @close="cancel" @cancel="cancel" width="60%"
 | 
			
		||||
		<base-dialog
 | 
			
		||||
			:dialogTitle="title"
 | 
			
		||||
			:dialogVisible="open"
 | 
			
		||||
			@close="cancel"
 | 
			
		||||
			@cancel="cancel"
 | 
			
		||||
			width="60%"
 | 
			
		||||
			@confirm="submitForm">
 | 
			
		||||
			<DialogForm v-if="open" key="index-dialog-form" ref="form" label-position="top" size="small" v-model="form"
 | 
			
		||||
			<DialogForm
 | 
			
		||||
				v-if="open"
 | 
			
		||||
				key="index-dialog-form"
 | 
			
		||||
				ref="form"
 | 
			
		||||
				label-position="top"
 | 
			
		||||
				size="small"
 | 
			
		||||
				v-model="form"
 | 
			
		||||
				:has-files="['files', 'files2']"
 | 
			
		||||
				:rows="computedRows" />
 | 
			
		||||
		</base-dialog>
 | 
			
		||||
 | 
			
		||||
		<!-- 设备 详情 - 编辑 -->
 | 
			
		||||
		<EquipmentDrawer v-if="editVisible" ref="drawer" :mode="editMode" @update-mode="editMode = $event"
 | 
			
		||||
			:data-id="form.id" :sections="[
 | 
			
		||||
		<EquipmentDrawer
 | 
			
		||||
			v-if="editVisible"
 | 
			
		||||
			ref="drawer"
 | 
			
		||||
			:mode="editMode"
 | 
			
		||||
			@update-mode="editMode = $event"
 | 
			
		||||
			:data-id="form.id"
 | 
			
		||||
			:sections="[
 | 
			
		||||
				{
 | 
			
		||||
					name: '基本信息',
 | 
			
		||||
					key: 'base',
 | 
			
		||||
@@ -63,7 +96,10 @@
 | 
			
		||||
					].filter((v) => v),
 | 
			
		||||
					allowAdd: true,
 | 
			
		||||
				},
 | 
			
		||||
			]" @refreshDataList="getList" @cancel="cancelEdit" @destroy="cancelEdit" />
 | 
			
		||||
			]"
 | 
			
		||||
			@refreshDataList="getList"
 | 
			
		||||
			@cancel="cancelEdit"
 | 
			
		||||
			@destroy="cancelEdit" />
 | 
			
		||||
	</div>
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
@@ -123,7 +159,7 @@ export default {
 | 
			
		||||
				},
 | 
			
		||||
				{ prop: 'name', label: '设备名称' },
 | 
			
		||||
				{ width: 256, prop: 'code', label: '设备编码' },
 | 
			
		||||
				{ prop: 'equipmentType', label: '设备类型' },
 | 
			
		||||
				{ prop: 'equipmentTypeName', label: '设备类型' },
 | 
			
		||||
				{ prop: 'enName', label: '英文名称' },
 | 
			
		||||
				{ prop: 'abbr', label: '缩写' },
 | 
			
		||||
				// {
 | 
			
		||||
@@ -176,14 +212,18 @@ export default {
 | 
			
		||||
					type: 'separate',
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					type: this.$auth.hasPermi('base:core-equipment:export') ? 'button' : '',
 | 
			
		||||
					type: this.$auth.hasPermi('base:core-equipment:export')
 | 
			
		||||
						? 'button'
 | 
			
		||||
						: '',
 | 
			
		||||
					btnName: '导出',
 | 
			
		||||
					name: 'export',
 | 
			
		||||
					plain: true,
 | 
			
		||||
					color: 'primary',
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					type: this.$auth.hasPermi('base:core-equipment:create') ? 'button' : '',
 | 
			
		||||
					type: this.$auth.hasPermi('base:core-equipment:create')
 | 
			
		||||
						? 'button'
 | 
			
		||||
						: '',
 | 
			
		||||
					btnName: '新增',
 | 
			
		||||
					name: 'add',
 | 
			
		||||
					plain: true,
 | 
			
		||||
@@ -196,7 +236,9 @@ export default {
 | 
			
		||||
						input: true,
 | 
			
		||||
						label: '设备名称',
 | 
			
		||||
						prop: 'name',
 | 
			
		||||
						rules: [{ required: true, message: '不能为空', trigger: 'blur' }],
 | 
			
		||||
						rules: [
 | 
			
		||||
							{ required: true, message: '设备名称不能为空', trigger: 'blur' },
 | 
			
		||||
						],
 | 
			
		||||
						// bind: {
 | 
			
		||||
						// 	disabled: this.editMode == 'detail', // some condition, like detail mode...
 | 
			
		||||
						// }
 | 
			
		||||
@@ -211,10 +253,6 @@ export default {
 | 
			
		||||
						input: true,
 | 
			
		||||
						label: '英文名称',
 | 
			
		||||
						prop: 'enName',
 | 
			
		||||
						// rules: [{ required: true, message: '不能为空', trigger: 'blur' }],
 | 
			
		||||
						// bind: {
 | 
			
		||||
						// 	disabled: true, // some condition, like detail mode...
 | 
			
		||||
						// }
 | 
			
		||||
					},
 | 
			
		||||
				],
 | 
			
		||||
				[
 | 
			
		||||
@@ -222,10 +260,6 @@ export default {
 | 
			
		||||
						input: true,
 | 
			
		||||
						label: '缩写',
 | 
			
		||||
						prop: 'abbr',
 | 
			
		||||
						// rules: [{ required: true, message: '不能为空', trigger: 'blur' }],
 | 
			
		||||
						// bind: {
 | 
			
		||||
						// 	disabled: true, // some condition, like detail mode...
 | 
			
		||||
						// }
 | 
			
		||||
					},
 | 
			
		||||
 | 
			
		||||
					{
 | 
			
		||||
@@ -233,7 +267,9 @@ export default {
 | 
			
		||||
						label: '设备类型',
 | 
			
		||||
						prop: 'equipmentTypeId',
 | 
			
		||||
						url: '/base/core-equipment-type/page?pageNo=1&pageSize=100',
 | 
			
		||||
						rules: [{ required: true, message: '不能为空', trigger: 'blur' }],
 | 
			
		||||
						rules: [
 | 
			
		||||
							{ required: true, message: '设备类型不能为空', trigger: 'blur' },
 | 
			
		||||
						],
 | 
			
		||||
						bind: {
 | 
			
		||||
							filterable: true,
 | 
			
		||||
						},
 | 
			
		||||
@@ -243,7 +279,11 @@ export default {
 | 
			
		||||
						label: '预计生产时间(min/天)',
 | 
			
		||||
						prop: 'workTime',
 | 
			
		||||
						rules: [
 | 
			
		||||
							{ required: true, message: '不能为空', trigger: 'blur' },
 | 
			
		||||
							{
 | 
			
		||||
								required: true,
 | 
			
		||||
								message: '预计生产时间不能为空',
 | 
			
		||||
								trigger: 'blur',
 | 
			
		||||
							},
 | 
			
		||||
							{
 | 
			
		||||
								type: 'number',
 | 
			
		||||
								message: '请输入正确的数字值',
 | 
			
		||||
@@ -264,18 +304,26 @@ export default {
 | 
			
		||||
						datetime: true,
 | 
			
		||||
						label: '生产日期',
 | 
			
		||||
						prop: 'productionTime',
 | 
			
		||||
						bind: {
 | 
			
		||||
							format: 'yyyy-MM-dd',
 | 
			
		||||
							clearable: true,
 | 
			
		||||
						},
 | 
			
		||||
					},
 | 
			
		||||
					{
 | 
			
		||||
						datetime: true,
 | 
			
		||||
						label: '进厂日期',
 | 
			
		||||
						prop: 'enterTime',
 | 
			
		||||
						bind: {
 | 
			
		||||
							format: 'yyyy-MM-dd',
 | 
			
		||||
							clearable: true,
 | 
			
		||||
						},
 | 
			
		||||
					},
 | 
			
		||||
					{
 | 
			
		||||
						input: true,
 | 
			
		||||
						prop: 'tvalue',
 | 
			
		||||
						label: '设备TT值',
 | 
			
		||||
						rules: [
 | 
			
		||||
							{ required: true, message: '不能为空', trigger: 'blur' },
 | 
			
		||||
							{ required: true, message: '设备TT值不能为空', trigger: 'blur' },
 | 
			
		||||
							{
 | 
			
		||||
								type: 'number',
 | 
			
		||||
								message: '请输入正确的数字值',
 | 
			
		||||
@@ -288,10 +336,14 @@ export default {
 | 
			
		||||
				[
 | 
			
		||||
					{
 | 
			
		||||
						input: true,
 | 
			
		||||
						label: '产品加工时间(s)',
 | 
			
		||||
						label: '单件产品加工时间(s)',
 | 
			
		||||
						prop: 'processingTime',
 | 
			
		||||
						rules: [
 | 
			
		||||
							{ required: true, message: '不能为空', trigger: 'blur' },
 | 
			
		||||
							{
 | 
			
		||||
								required: true,
 | 
			
		||||
								message: '单件产品加工时间不能为空',
 | 
			
		||||
								trigger: 'blur',
 | 
			
		||||
							},
 | 
			
		||||
							{
 | 
			
		||||
								type: 'number',
 | 
			
		||||
								message: '请输入正确的数字值',
 | 
			
		||||
@@ -304,7 +356,6 @@ export default {
 | 
			
		||||
					{
 | 
			
		||||
						input: true,
 | 
			
		||||
						label: '制造商',
 | 
			
		||||
						// rules: [{ required: true, message: '不能为空', trigger: 'blur' }],
 | 
			
		||||
						prop: 'manufacturer',
 | 
			
		||||
					},
 | 
			
		||||
					{
 | 
			
		||||
@@ -317,13 +368,25 @@ export default {
 | 
			
		||||
					{
 | 
			
		||||
						textarea: true,
 | 
			
		||||
						label: '功能描述',
 | 
			
		||||
						// rules: [{ required: true, message: '不能为空', trigger: 'blur' }],
 | 
			
		||||
						prop: 'description',
 | 
			
		||||
					},
 | 
			
		||||
				],
 | 
			
		||||
				[
 | 
			
		||||
					{ input: true, label: '备注', prop: 'remark' }
 | 
			
		||||
				]
 | 
			
		||||
					{
 | 
			
		||||
						upload: true,
 | 
			
		||||
						label: '设备资料',
 | 
			
		||||
						prop: 'files',
 | 
			
		||||
					},
 | 
			
		||||
				],
 | 
			
		||||
				[
 | 
			
		||||
					{
 | 
			
		||||
						upload: true,
 | 
			
		||||
						label: '设备图片',
 | 
			
		||||
						prop: 'files2',
 | 
			
		||||
						fileType: 1,
 | 
			
		||||
					},
 | 
			
		||||
				],
 | 
			
		||||
				[{ input: true, label: '备注', prop: 'remark' }],
 | 
			
		||||
				// [
 | 
			
		||||
				// 	{
 | 
			
		||||
				// 		assetUpload: true,
 | 
			
		||||
@@ -424,7 +487,7 @@ export default {
 | 
			
		||||
			// 表单参数
 | 
			
		||||
			form: {
 | 
			
		||||
				id: null,
 | 
			
		||||
				files: []
 | 
			
		||||
				files: [],
 | 
			
		||||
			},
 | 
			
		||||
			showUploadComponents: false, // 是否显示上传组件
 | 
			
		||||
		};
 | 
			
		||||
@@ -507,7 +570,8 @@ export default {
 | 
			
		||||
				spec: undefined,
 | 
			
		||||
				description: undefined,
 | 
			
		||||
				remark: undefined,
 | 
			
		||||
				files: []
 | 
			
		||||
				files: [],
 | 
			
		||||
				files2: [],
 | 
			
		||||
			};
 | 
			
		||||
			this.resetForm('form');
 | 
			
		||||
		},
 | 
			
		||||
@@ -535,9 +599,12 @@ export default {
 | 
			
		||||
				if (!valid) {
 | 
			
		||||
					return;
 | 
			
		||||
				}
 | 
			
		||||
				const payload = Object.assign({}, this.form);
 | 
			
		||||
				payload.files = [...payload.files, ...payload.files2];
 | 
			
		||||
				delete payload.files2;
 | 
			
		||||
				// 修改的提交
 | 
			
		||||
				if (this.form.id != null) {
 | 
			
		||||
					updateEquipment(this.form).then((response) => {
 | 
			
		||||
					updateEquipment(payload).then((response) => {
 | 
			
		||||
						this.$modal.msgSuccess('修改成功');
 | 
			
		||||
						this.open = false;
 | 
			
		||||
						this.getList();
 | 
			
		||||
@@ -545,7 +612,7 @@ export default {
 | 
			
		||||
					return;
 | 
			
		||||
				}
 | 
			
		||||
				// 添加的提交
 | 
			
		||||
				createEquipment(this.form).then((response) => {
 | 
			
		||||
				createEquipment(payload).then((response) => {
 | 
			
		||||
					this.$modal.msgSuccess('新增成功');
 | 
			
		||||
					this.open = false;
 | 
			
		||||
					this.getList();
 | 
			
		||||
@@ -564,7 +631,7 @@ export default {
 | 
			
		||||
					this.getList();
 | 
			
		||||
					this.$modal.msgSuccess('删除成功');
 | 
			
		||||
				})
 | 
			
		||||
				.catch(() => { });
 | 
			
		||||
				.catch(() => {});
 | 
			
		||||
		},
 | 
			
		||||
		/** 导出按钮操作 */
 | 
			
		||||
		handleExport() {
 | 
			
		||||
@@ -582,7 +649,7 @@ export default {
 | 
			
		||||
					this.$download.excel(response, '设备.xls');
 | 
			
		||||
					this.exportLoading = false;
 | 
			
		||||
				})
 | 
			
		||||
				.catch(() => { });
 | 
			
		||||
				.catch(() => {});
 | 
			
		||||
		},
 | 
			
		||||
		// 查看详情
 | 
			
		||||
		viewDetail(id) {
 | 
			
		||||
 
 | 
			
		||||
@@ -149,7 +149,7 @@ export default {
 | 
			
		||||
						select: true,
 | 
			
		||||
						label: '产线',
 | 
			
		||||
						prop: 'productionLineId',
 | 
			
		||||
						rules: [{ required: true, message: '不能为空', trigger: 'blur' }],
 | 
			
		||||
						rules: [{ required: true, message: '产线名不能为空', trigger: 'blur' }],
 | 
			
		||||
						url: '/base/core-production-line/listAll',
 | 
			
		||||
						bind: { clearable: true, filterable: true },
 | 
			
		||||
						// watch: 'workshopSectionId'
 | 
			
		||||
@@ -159,7 +159,7 @@ export default {
 | 
			
		||||
						label: '工段',
 | 
			
		||||
						prop: 'workshopSectionId',
 | 
			
		||||
						depends: 'productionLineId',
 | 
			
		||||
						rules: [{ required: true, message: '不能为空', trigger: 'blur' }],
 | 
			
		||||
						rules: [{ required: true, message: '工段不能为空', trigger: 'blur' }],
 | 
			
		||||
						bind: { clearable: true, filterable: true },
 | 
			
		||||
						url: '/base/core-workshop-section/listByParentId',
 | 
			
		||||
					},
 | 
			
		||||
@@ -169,7 +169,7 @@ export default {
 | 
			
		||||
						select: true,
 | 
			
		||||
						label: '设备',
 | 
			
		||||
						prop: 'equipmentId',
 | 
			
		||||
						rules: [{ required: true, message: '不能为空', trigger: 'blur' }],
 | 
			
		||||
						rules: [{ required: true, message: '设备名不能为空', trigger: 'blur' }],
 | 
			
		||||
						bind: { clearable: true, filterable: true },
 | 
			
		||||
						url: '/base/core-equipment/listAll',
 | 
			
		||||
					},
 | 
			
		||||
@@ -189,6 +189,10 @@ export default {
 | 
			
		||||
						],
 | 
			
		||||
						label: '产线统计类型',
 | 
			
		||||
						prop: 'lineDataType',
 | 
			
		||||
						bind: {
 | 
			
		||||
							clearable: true, filterable: true
 | 
			
		||||
						},
 | 
			
		||||
						rules: [{ required: true, message: '产线统计类型不能为空', trigger: 'change' }],
 | 
			
		||||
					},
 | 
			
		||||
					{
 | 
			
		||||
						select: true,
 | 
			
		||||
@@ -199,6 +203,10 @@ export default {
 | 
			
		||||
						],
 | 
			
		||||
						label: '工段统计类型',
 | 
			
		||||
						prop: 'sectionDataType',
 | 
			
		||||
						bind: {
 | 
			
		||||
							clearable: true, filterable: true
 | 
			
		||||
						},
 | 
			
		||||
						rules: [{ required: true, message: '工段统计类型不能为空', trigger: 'change' }],
 | 
			
		||||
					},
 | 
			
		||||
				],
 | 
			
		||||
			],
 | 
			
		||||
 
 | 
			
		||||
@@ -91,15 +91,15 @@ export default {
 | 
			
		||||
					width: 180,
 | 
			
		||||
					filter: (val) => moment(val).format('yyyy-MM-DD HH:mm:ss'),
 | 
			
		||||
				},
 | 
			
		||||
				{ prop: 'name', label: '设备类型名称' },
 | 
			
		||||
				{ prop: 'code', label: '检测类型编码' },
 | 
			
		||||
				{ prop: 'name', label: '类型名称' },
 | 
			
		||||
				{ prop: 'code', label: '类型编号' },
 | 
			
		||||
				{ prop: 'remark', label: '备注' },
 | 
			
		||||
			],
 | 
			
		||||
			searchBarFormConfig: [
 | 
			
		||||
				{
 | 
			
		||||
					type: 'input',
 | 
			
		||||
					label: '设备类型',
 | 
			
		||||
					placeholder: '请输入设备类型名称',
 | 
			
		||||
					placeholder: '设备类型',
 | 
			
		||||
					param: 'name',
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
@@ -133,18 +133,19 @@ export default {
 | 
			
		||||
				[
 | 
			
		||||
					{
 | 
			
		||||
						input: true,
 | 
			
		||||
						label: '设备类型名称',
 | 
			
		||||
						label: '类型名称',
 | 
			
		||||
						prop: 'name',
 | 
			
		||||
						rules: [{ required: true, message: '不能为空', trigger: 'blur' }],
 | 
			
		||||
						rules: [{ required: true, message: '类型名称不能为空', trigger: 'blur' }],
 | 
			
		||||
						// bind: {
 | 
			
		||||
						// 	disabled: true, // some condition, like detail mode...
 | 
			
		||||
						// }
 | 
			
		||||
					},
 | 
			
		||||
					{
 | 
			
		||||
						input: true,
 | 
			
		||||
						label: '设备类型编码',
 | 
			
		||||
						label: '类型编号',
 | 
			
		||||
						prop: 'code',
 | 
			
		||||
						url: '/base/core-equipment-type/getCode',
 | 
			
		||||
						rules: [{ required: true, message: '类型编号不能为空', trigger: 'blur' }],
 | 
			
		||||
					},
 | 
			
		||||
				],
 | 
			
		||||
				[
 | 
			
		||||
@@ -174,7 +175,13 @@ export default {
 | 
			
		||||
				name: '',
 | 
			
		||||
			},
 | 
			
		||||
			// 表单参数
 | 
			
		||||
			form: {},
 | 
			
		||||
			form: {
 | 
			
		||||
				code: undefined,
 | 
			
		||||
				name: undefined,
 | 
			
		||||
				id: undefined,
 | 
			
		||||
				parentId: undefined,
 | 
			
		||||
				remark: undefined
 | 
			
		||||
			},
 | 
			
		||||
		};
 | 
			
		||||
	},
 | 
			
		||||
	watch: {
 | 
			
		||||
@@ -268,7 +275,7 @@ export default {
 | 
			
		||||
		handleDelete(row) {
 | 
			
		||||
			const id = row.id;
 | 
			
		||||
			this.$modal
 | 
			
		||||
				.confirm('是否确认删除设备类型"' + row.name + '"?')
 | 
			
		||||
				.confirm('是否确认删除设备类型"' + row.name + '"的数据项?')
 | 
			
		||||
				.then(function () {
 | 
			
		||||
					return deleteEquipmentType(id);
 | 
			
		||||
				})
 | 
			
		||||
 
 | 
			
		||||
@@ -2,7 +2,7 @@
 | 
			
		||||
 * @Author: zwq
 | 
			
		||||
 * @Date: 2021-11-18 14:16:25
 | 
			
		||||
 * @LastEditors: DY
 | 
			
		||||
 * @LastEditTime: 2023-11-15 16:23:49
 | 
			
		||||
 * @LastEditTime: 2023-11-27 20:12:00
 | 
			
		||||
 * @Description:
 | 
			
		||||
-->
 | 
			
		||||
<template>
 | 
			
		||||
@@ -11,7 +11,7 @@
 | 
			
		||||
		:rules="dataRule"
 | 
			
		||||
		ref="dataForm"
 | 
			
		||||
		@keyup.enter.native="dataFormSubmit()"
 | 
			
		||||
		label-width="100px">
 | 
			
		||||
		label-width="90px">
 | 
			
		||||
		<el-row :gutter="20">
 | 
			
		||||
			<el-col :span="12">
 | 
			
		||||
				<el-form-item label="原料名称" prop="name">
 | 
			
		||||
@@ -46,6 +46,9 @@
 | 
			
		||||
				</el-form-item>
 | 
			
		||||
			</el-col>
 | 
			
		||||
		</el-row>
 | 
			
		||||
		<el-form-item label="备注" prop="remark">
 | 
			
		||||
			<el-input v-model="dataForm.remark" clearable placeholder="请输入备注" />
 | 
			
		||||
		</el-form-item>
 | 
			
		||||
	</el-form>
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
@@ -70,7 +73,8 @@ export default {
 | 
			
		||||
        code: undefined,
 | 
			
		||||
        name: undefined,
 | 
			
		||||
        unit: undefined,
 | 
			
		||||
        dailyCost: undefined
 | 
			
		||||
        dailyCost: undefined,
 | 
			
		||||
				remark: undefined
 | 
			
		||||
			},
 | 
			
		||||
			departmentlList: [],
 | 
			
		||||
			menuOptions: [],
 | 
			
		||||
 
 | 
			
		||||
@@ -29,7 +29,7 @@
 | 
			
		||||
			@cancel="handleCancel"
 | 
			
		||||
			@confirm="handleConfirm"
 | 
			
		||||
			:before-close="handleCancel"
 | 
			
		||||
			width="50%">
 | 
			
		||||
			width="45%">
 | 
			
		||||
			<add-or-update
 | 
			
		||||
				ref="addOrUpdate"
 | 
			
		||||
				@refreshDataList="successSubmit"></add-or-update>
 | 
			
		||||
 
 | 
			
		||||
@@ -97,8 +97,8 @@ export default {
 | 
			
		||||
			formConfig: [
 | 
			
		||||
				{
 | 
			
		||||
					type: 'input',
 | 
			
		||||
					label: '名称',
 | 
			
		||||
					placeholder: '专业',
 | 
			
		||||
					label: '专业名称',
 | 
			
		||||
					placeholder: '专业名称',
 | 
			
		||||
					param: 'name',
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
 
 | 
			
		||||
@@ -2,14 +2,14 @@
 | 
			
		||||
 * @Author: zwq
 | 
			
		||||
 * @Date: 2021-11-18 14:16:25
 | 
			
		||||
 * @LastEditors: DY
 | 
			
		||||
 * @LastEditTime: 2023-11-15 15:41:44
 | 
			
		||||
 * @LastEditTime: 2023-11-27 20:07:09
 | 
			
		||||
 * @Description:
 | 
			
		||||
-->
 | 
			
		||||
<template>
 | 
			
		||||
	<el-drawer
 | 
			
		||||
		:visible.sync="visible"
 | 
			
		||||
		:show-close="false"
 | 
			
		||||
		:wrapper-closable="false"
 | 
			
		||||
		:wrapper-closable="isdetail"
 | 
			
		||||
		class="drawer"
 | 
			
		||||
		size="60%">
 | 
			
		||||
		<small-title slot="title" :no-padding="true">
 | 
			
		||||
@@ -114,14 +114,6 @@
 | 
			
		||||
					</el-row>
 | 
			
		||||
				</el-form>
 | 
			
		||||
			</div>
 | 
			
		||||
			<div class="drawer-body__footer">
 | 
			
		||||
				<el-button v-if="!idAttrShow" @click="goback()">取消</el-button>
 | 
			
		||||
				<el-button v-else :disabled="isdetail" @click="init(dataForm.id)">重置</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
 | 
			
		||||
@@ -158,14 +150,16 @@
 | 
			
		||||
					: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>
 | 
			
		||||
 | 
			
		||||
		<div v-if="!isdetail" class="drawer-body__footer">
 | 
			
		||||
			<el-button @click="goback()">取消</el-button>
 | 
			
		||||
			<el-button :disabled="isdetail" @click="init(dataForm.id)">重置</el-button>
 | 
			
		||||
			<el-button type="primary" @click="dataFormSubmit()">确定</el-button>
 | 
			
		||||
		</div>
 | 
			
		||||
 | 
			
		||||
		<attr-add
 | 
			
		||||
			v-if="addOrUpdateVisible"
 | 
			
		||||
			ref="addOrUpdate"
 | 
			
		||||
@@ -253,8 +247,8 @@ export default {
 | 
			
		||||
			isdetail: false,
 | 
			
		||||
			idAttrShow: false,
 | 
			
		||||
			dataRule: {
 | 
			
		||||
        code: [{ required: true, message: "物料编码不能为空", trigger: "blur" }],
 | 
			
		||||
        name: [{ required: true, message: "物料名称不能为空", trigger: "blur" }],
 | 
			
		||||
        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" }]
 | 
			
		||||
@@ -270,11 +264,7 @@ export default {
 | 
			
		||||
		handleClick(raw) {
 | 
			
		||||
			if (raw.type === 'delete') {
 | 
			
		||||
				this.$confirm(
 | 
			
		||||
					`确定对${
 | 
			
		||||
						raw.data.attrName
 | 
			
		||||
							? '[名称=' + raw.data.attrName + ']'
 | 
			
		||||
							: '[序号=' + raw.data._pageIndex + ']'
 | 
			
		||||
					}进行删除操作?`,
 | 
			
		||||
					`是否确认删除属性名为"${raw.data.name}"的数据项?`,
 | 
			
		||||
					'提示',
 | 
			
		||||
					{
 | 
			
		||||
						confirmButtonText: '确定',
 | 
			
		||||
 
 | 
			
		||||
@@ -84,18 +84,18 @@ export default {
 | 
			
		||||
			},
 | 
			
		||||
			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:update`)
 | 
			
		||||
					? {
 | 
			
		||||
							type: 'edit',
 | 
			
		||||
							btnName: '编辑',
 | 
			
		||||
					  }
 | 
			
		||||
					: undefined,
 | 
			
		||||
          this.$auth.hasPermi(`base:core-product:delete`)
 | 
			
		||||
					? {
 | 
			
		||||
							type: 'delete',
 | 
			
		||||
@@ -107,8 +107,8 @@ export default {
 | 
			
		||||
			formConfig: [
 | 
			
		||||
				{
 | 
			
		||||
					type: 'input',
 | 
			
		||||
					label: '工单名称',
 | 
			
		||||
					placeholder: '工单名称',
 | 
			
		||||
					label: '产品名称',
 | 
			
		||||
					placeholder: '产品名称',
 | 
			
		||||
					param: 'name'
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
@@ -141,6 +141,27 @@ export default {
 | 
			
		||||
	},
 | 
			
		||||
	created() {},
 | 
			
		||||
	methods: {
 | 
			
		||||
		// 删除
 | 
			
		||||
    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(() => { });
 | 
			
		||||
    },
 | 
			
		||||
		// 查看详情
 | 
			
		||||
		otherMethods(val) {
 | 
			
		||||
			if (val.type === 'detail') {
 | 
			
		||||
 
 | 
			
		||||
@@ -2,7 +2,7 @@
 | 
			
		||||
 * @Author: zwq
 | 
			
		||||
 * @Date: 2021-11-18 14:16:25
 | 
			
		||||
 * @LastEditors: DY
 | 
			
		||||
 * @LastEditTime: 2023-11-03 19:28:06
 | 
			
		||||
 * @LastEditTime: 2023-11-21 18:59:54
 | 
			
		||||
 * @Description:
 | 
			
		||||
-->
 | 
			
		||||
<template>
 | 
			
		||||
@@ -11,7 +11,7 @@
 | 
			
		||||
		:rules="dataRule"
 | 
			
		||||
		ref="dataForm"
 | 
			
		||||
		@keyup.enter.native="dataFormSubmit()"
 | 
			
		||||
		label-width="80px">
 | 
			
		||||
		label-width="100px">
 | 
			
		||||
		<el-row :gutter="20">
 | 
			
		||||
			<el-col :span="12">
 | 
			
		||||
				<el-form-item label="产线名称" prop="name">
 | 
			
		||||
@@ -30,7 +30,8 @@
 | 
			
		||||
					<el-select
 | 
			
		||||
						v-model="dataForm.factoryId"
 | 
			
		||||
						filterable
 | 
			
		||||
						placeholder="请选择工厂">
 | 
			
		||||
						placeholder="请选择工厂"
 | 
			
		||||
						style="width: 100%">
 | 
			
		||||
						<el-option
 | 
			
		||||
							v-for="dict in factoryList"
 | 
			
		||||
							:key="dict.id"
 | 
			
		||||
@@ -94,8 +95,8 @@ export default {
 | 
			
		||||
			},
 | 
			
		||||
			factoryList: [],
 | 
			
		||||
			dataRule: {
 | 
			
		||||
        code: [{ required: true, message: "专业编码不能为空", trigger: "blur" }],
 | 
			
		||||
        name: [{ required: true, message: "专业名称不能为空", trigger: "blur" }],
 | 
			
		||||
        code: [{ required: true, message: "产线编号不能为空", trigger: "blur" }],
 | 
			
		||||
        name: [{ required: true, message: "产线名称不能为空", trigger: "blur" }],
 | 
			
		||||
				factoryId: [{ required: true, message: "工厂不能为空", trigger: "blur" }]
 | 
			
		||||
      }
 | 
			
		||||
		};
 | 
			
		||||
 
 | 
			
		||||
@@ -71,6 +71,10 @@ const tableProps = [
 | 
			
		||||
		label: '当前状态',
 | 
			
		||||
		filter: codeFilter('lineStatus')
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'tvalue',
 | 
			
		||||
		label: '产线TT值(h)'
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'description',
 | 
			
		||||
		label: '描述'
 | 
			
		||||
@@ -140,8 +144,8 @@ export default {
 | 
			
		||||
    getDataList() {
 | 
			
		||||
      this.dataListLoading = true;
 | 
			
		||||
      this.urlOptions.getDataListURL(this.listQuery).then(response => {
 | 
			
		||||
        this.tableData = response.data.list;
 | 
			
		||||
				// this.getStatus(response.data.list)
 | 
			
		||||
        // this.tableData = response.data.list;
 | 
			
		||||
				this.getStatus(response.data.list)
 | 
			
		||||
        this.listQuery.total = response.data.total;
 | 
			
		||||
        this.dataListLoading = false;
 | 
			
		||||
      });
 | 
			
		||||
 
 | 
			
		||||
@@ -2,7 +2,7 @@
 | 
			
		||||
 * @Author: zwq
 | 
			
		||||
 * @Date: 2021-11-18 14:16:25
 | 
			
		||||
 * @LastEditors: DY
 | 
			
		||||
 * @LastEditTime: 2023-11-03 11:00:47
 | 
			
		||||
 * @LastEditTime: 2023-11-22 10:27:43
 | 
			
		||||
 * @Description:
 | 
			
		||||
-->
 | 
			
		||||
<template>
 | 
			
		||||
@@ -77,8 +77,8 @@ export default {
 | 
			
		||||
        remark: undefined
 | 
			
		||||
			},
 | 
			
		||||
			dataRule: {
 | 
			
		||||
        code: [{ required: true, message: "专业编码不能为空", trigger: "blur" }],
 | 
			
		||||
        name: [{ required: true, message: "专业名称不能为空", trigger: "blur" }],
 | 
			
		||||
        code: [{ required: true, message: "供应商编号不能为空", trigger: "blur" }],
 | 
			
		||||
        name: [{ required: true, message: "供应商名称不能为空", trigger: "blur" }],
 | 
			
		||||
				contact: [{ required: true, message: "联系人不能为空", trigger: "blur" }],
 | 
			
		||||
				telephone: [
 | 
			
		||||
					{ required: false, trigger: "blur", message: "手机号不能为空" },
 | 
			
		||||
@@ -87,6 +87,8 @@ export default {
 | 
			
		||||
							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();
 | 
			
		||||
								}
 | 
			
		||||
							} else {
 | 
			
		||||
								callback();
 | 
			
		||||
@@ -98,6 +100,31 @@ export default {
 | 
			
		||||
		};
 | 
			
		||||
	},
 | 
			
		||||
	mounted() {},
 | 
			
		||||
	methods: {}
 | 
			
		||||
	methods: {
 | 
			
		||||
		// 表单提交
 | 
			
		||||
    dataFormSubmit() {
 | 
			
		||||
			console.log('你好', this.dataForm)
 | 
			
		||||
      this.$refs["dataForm"].validate((valid) => {
 | 
			
		||||
        if (!valid) {
 | 
			
		||||
          return false;
 | 
			
		||||
        }
 | 
			
		||||
        // 修改的提交
 | 
			
		||||
        if (this.dataForm.id) {
 | 
			
		||||
          this.urlOptions.updateURL(this.dataForm).then(response => {
 | 
			
		||||
            this.$modal.msgSuccess("修改成功");
 | 
			
		||||
            this.visible = false; 
 | 
			
		||||
            this.$emit("refreshDataList");
 | 
			
		||||
          });
 | 
			
		||||
          return;
 | 
			
		||||
        }
 | 
			
		||||
        // 添加的提交
 | 
			
		||||
        this.urlOptions.createURL(this.dataForm).then(response => {
 | 
			
		||||
          this.$modal.msgSuccess("新增成功");
 | 
			
		||||
          this.visible = false;
 | 
			
		||||
          this.$emit("refreshDataList");
 | 
			
		||||
        });
 | 
			
		||||
      });
 | 
			
		||||
    },
 | 
			
		||||
	}
 | 
			
		||||
};
 | 
			
		||||
</script>
 | 
			
		||||
 
 | 
			
		||||
@@ -105,7 +105,7 @@ export default {
 | 
			
		||||
			formConfig: [
 | 
			
		||||
				{
 | 
			
		||||
					type: 'input',
 | 
			
		||||
					label: '关键字',
 | 
			
		||||
					label: '供应商',
 | 
			
		||||
					placeholder: '供应商名称',
 | 
			
		||||
					param: 'name',
 | 
			
		||||
				},
 | 
			
		||||
 
 | 
			
		||||
@@ -2,23 +2,23 @@
 | 
			
		||||
 * @Author: zwq
 | 
			
		||||
 * @Date: 2021-11-18 14:16:25
 | 
			
		||||
 * @LastEditors: DY
 | 
			
		||||
 * @LastEditTime: 2023-11-06 14:38:20
 | 
			
		||||
 * @LastEditTime: 2023-11-28 14:09:09
 | 
			
		||||
 * @Description:
 | 
			
		||||
-->
 | 
			
		||||
<template>
 | 
			
		||||
	<el-drawer
 | 
			
		||||
		:visible.sync="visible"
 | 
			
		||||
		:show-close="false"
 | 
			
		||||
		:wrapper-closable="false"
 | 
			
		||||
		:wrapper-closable="true"
 | 
			
		||||
		class="drawer"
 | 
			
		||||
		size="50%">
 | 
			
		||||
		<small-title slot="title" :no-padding="true">
 | 
			
		||||
			{{ '预使用主原料信息' }}
 | 
			
		||||
			{{ '工单名称:' + dataForm.name }}
 | 
			
		||||
		</small-title>
 | 
			
		||||
		<div class="content">
 | 
			
		||||
			<div style="height: 10vh">
 | 
			
		||||
			<!-- <div style="height: 10vh">
 | 
			
		||||
				<div style="font-size: 18px;">工单名:{{ dataForm.name }}</div>
 | 
			
		||||
			</div>
 | 
			
		||||
			</div> -->
 | 
			
		||||
 | 
			
		||||
			<div class="attr-list">
 | 
			
		||||
				<small-title
 | 
			
		||||
@@ -29,9 +29,8 @@
 | 
			
		||||
 | 
			
		||||
				<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 style="display: inline-block;">
 | 
			
		||||
              <el-button type="text" @click="addNew()" icon="el-icon-plus">新增</el-button>
 | 
			
		||||
            </span>
 | 
			
		||||
          </template>
 | 
			
		||||
				</div>
 | 
			
		||||
@@ -56,9 +55,9 @@
 | 
			
		||||
					@pagination="getList" />
 | 
			
		||||
			</div>
 | 
			
		||||
 | 
			
		||||
			<div class="drawer-body__footer">
 | 
			
		||||
			<!-- <div class="drawer-body__footer">
 | 
			
		||||
				<el-button type="primary" @click="goback()">关闭</el-button>
 | 
			
		||||
			</div>
 | 
			
		||||
			</div> -->
 | 
			
		||||
		</div>
 | 
			
		||||
 | 
			
		||||
		<attr-add
 | 
			
		||||
@@ -95,7 +94,8 @@ const tableProps = [
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'material',
 | 
			
		||||
		label: '原料名称'
 | 
			
		||||
		label: '原料名称',
 | 
			
		||||
		filter: publicFormatter('material')
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'origin',
 | 
			
		||||
@@ -103,7 +103,7 @@ const tableProps = [
 | 
			
		||||
		filter: (val) => ['', '内部', '采购'][val]
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'supplierId',
 | 
			
		||||
		prop: 'supplierName',
 | 
			
		||||
		label: '供应商',
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
@@ -195,7 +195,7 @@ export default {
 | 
			
		||||
				...this.listQuery,
 | 
			
		||||
				workOrderId: this.dataForm.id,
 | 
			
		||||
			}).then((response) => {
 | 
			
		||||
				this.materialList = response.data.list;
 | 
			
		||||
				this.materialList = response.data.records;
 | 
			
		||||
				this.listQuery.total = response.data.total;
 | 
			
		||||
			});
 | 
			
		||||
		},
 | 
			
		||||
@@ -297,7 +297,7 @@ export default {
 | 
			
		||||
}
 | 
			
		||||
.action_btn {
 | 
			
		||||
  float: right;
 | 
			
		||||
  margin: 5px 15px;
 | 
			
		||||
  margin: -40px 15px;
 | 
			
		||||
  font-size: 14px;
 | 
			
		||||
}
 | 
			
		||||
.add {
 | 
			
		||||
 
 | 
			
		||||
@@ -1,21 +1,19 @@
 | 
			
		||||
<template>
 | 
			
		||||
  <el-form ref="dataForm" :rules="rules" label-width="130px" :model="dataForm">
 | 
			
		||||
    <el-row>
 | 
			
		||||
      <el-col :span='12'>
 | 
			
		||||
  <el-form ref="dataForm" :rules="rules" label-width="130px" :model="dataForm" label-position="top">
 | 
			
		||||
    <el-row :gutter="20">
 | 
			
		||||
      <el-col :span='8'>
 | 
			
		||||
        <el-form-item label="工单名称" prop="name">
 | 
			
		||||
          <el-input v-model="dataForm.name"></el-input>
 | 
			
		||||
          <el-input v-model="dataForm.name" placeholder="请输入工单名称"></el-input>
 | 
			
		||||
        </el-form-item>
 | 
			
		||||
      </el-col>
 | 
			
		||||
      <el-col :span='12'>
 | 
			
		||||
      <el-col :span='8'>
 | 
			
		||||
        <el-form-item label="工单编码" prop="code">
 | 
			
		||||
          <el-input v-model="dataForm.code" disabled></el-input>
 | 
			
		||||
          <el-input v-model="dataForm.code" disabled placeholder="请输入工单编码"></el-input>
 | 
			
		||||
        </el-form-item>
 | 
			
		||||
      </el-col>
 | 
			
		||||
    </el-row>
 | 
			
		||||
    <el-row>
 | 
			
		||||
      <el-col :span='12'>
 | 
			
		||||
      <el-col :span='8'>
 | 
			
		||||
        <el-form-item label="产品名称" prop="planProductId">
 | 
			
		||||
          <el-select v-model="dataForm.planProductId" placeholder="请选择" style="width: 100%;" @change="selectProduct">
 | 
			
		||||
          <el-select v-model="dataForm.planProductId" placeholder="请选择产品" style="width: 100%;" filterable @change="selectProduct">
 | 
			
		||||
            <el-option
 | 
			
		||||
              v-for="item in productList"
 | 
			
		||||
              :key="item.id"
 | 
			
		||||
@@ -25,52 +23,50 @@
 | 
			
		||||
          </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-row>
 | 
			
		||||
    <el-row :gutter="20">
 | 
			
		||||
      <el-col :span='8'>
 | 
			
		||||
        <el-form-item label="产品规格" prop="specifications">
 | 
			
		||||
          <el-input v-model="dataForm.specifications" placeholder="请输入产品规格" />
 | 
			
		||||
        </el-form-item>
 | 
			
		||||
      </el-col>
 | 
			
		||||
    </el-row>
 | 
			
		||||
    <el-row>
 | 
			
		||||
      <el-col :span='12'>
 | 
			
		||||
      <el-col :span='8'>
 | 
			
		||||
        <el-form-item label="计划开始时间">
 | 
			
		||||
          <el-date-picker
 | 
			
		||||
            v-model="planStartTime"
 | 
			
		||||
            v-model="dataForm.planStartTime"
 | 
			
		||||
            type="datetime"
 | 
			
		||||
            value-format="yyyy-MM-dd HH:mm:ss"
 | 
			
		||||
            value-format="timestamp"
 | 
			
		||||
            style="width: 100%;"
 | 
			
		||||
            placeholder="选择日期">
 | 
			
		||||
            placeholder="请选择计划开始时间">
 | 
			
		||||
          </el-date-picker>
 | 
			
		||||
        </el-form-item>
 | 
			
		||||
      </el-col>
 | 
			
		||||
      <el-col :span='12'>
 | 
			
		||||
      <el-col :span='8'>
 | 
			
		||||
        <el-form-item label="计划完成时间">
 | 
			
		||||
          <el-date-picker
 | 
			
		||||
            v-model="planFinishTime"
 | 
			
		||||
            v-model="dataForm.planFinishTime"
 | 
			
		||||
            type="datetime"
 | 
			
		||||
            value-format="yyyy-MM-dd HH:mm:ss"
 | 
			
		||||
            value-format="timestamp"
 | 
			
		||||
            style="width: 100%;"
 | 
			
		||||
            placeholder="选择日期">
 | 
			
		||||
            placeholder="请选择计划完成时间">
 | 
			
		||||
          </el-date-picker>
 | 
			
		||||
        </el-form-item>
 | 
			
		||||
      </el-col>
 | 
			
		||||
    </el-row>
 | 
			
		||||
    <el-row>
 | 
			
		||||
      <el-col :span='12'>
 | 
			
		||||
    <el-row :gutter="20">
 | 
			
		||||
      <el-col :span='8'>
 | 
			
		||||
        <el-form-item label="计划投入数量" prop="planAssignQuantity">
 | 
			
		||||
          <el-input-number v-model="dataForm.planAssignQuantity" :min="0" :max="9999999999999" style="width: 100%;"></el-input-number>
 | 
			
		||||
          <el-input-number v-model="dataForm.planAssignQuantity" :min="0" :max="9999999999999" style="width: 100%;" placeholder="请输入计划投入数量"></el-input-number>
 | 
			
		||||
        </el-form-item>
 | 
			
		||||
      </el-col>
 | 
			
		||||
      <el-col :span='12'>
 | 
			
		||||
      <el-col :span='8'>
 | 
			
		||||
        <el-form-item label="计划生产数量" prop="planQuantity">
 | 
			
		||||
          <el-input-number v-model="dataForm.planQuantity" :min="0" :max="9999999999999" style="width: 100%;"></el-input-number>
 | 
			
		||||
          <el-input-number v-model="dataForm.planQuantity" :min="0" :max="9999999999999" style="width: 100%;" placeholder="请输入计划生产数量"></el-input-number>
 | 
			
		||||
        </el-form-item>
 | 
			
		||||
      </el-col>
 | 
			
		||||
    </el-row>
 | 
			
		||||
    <el-row>
 | 
			
		||||
      <el-col :span='12'>
 | 
			
		||||
      <el-col :span='8'>
 | 
			
		||||
        <el-form-item label="关联工艺" prop="processFlowId">
 | 
			
		||||
          <el-select v-model="dataForm.processFlowId" placeholder="请选择工艺" clearable filterable style="width: 100%;" @change="processFlowIdChange">
 | 
			
		||||
          <el-select v-model="dataForm.processFlowId" placeholder="请选择关联工艺" clearable filterable style="width: 100%;" @change="processFlowIdChange">
 | 
			
		||||
            <el-option
 | 
			
		||||
              v-for="item in processFlowList"
 | 
			
		||||
              :key="item.id"
 | 
			
		||||
@@ -80,19 +76,23 @@
 | 
			
		||||
          </el-select>
 | 
			
		||||
        </el-form-item>
 | 
			
		||||
      </el-col>
 | 
			
		||||
      <el-col :span='12'>
 | 
			
		||||
    </el-row>
 | 
			
		||||
    <el-row :gutter="20">
 | 
			
		||||
      <el-col :span='8'>
 | 
			
		||||
        <el-form-item label="物料计算方式" prop="materialMethod">
 | 
			
		||||
          <el-radio-group v-model="dataForm.materialMethod" @change="materialMethodChange">
 | 
			
		||||
            <el-radio :label="1">产品基础</el-radio>
 | 
			
		||||
            <el-radio :label="2">工艺扩展</el-radio>
 | 
			
		||||
          </el-radio-group>
 | 
			
		||||
          <!-- <el-radio-group v-model="dataForm.materialMethod" @change="materialMethodChange">
 | 
			
		||||
            <el-radio :label="1">产品基础BOM</el-radio>
 | 
			
		||||
            <el-radio :label="2">工艺扩展BOM</el-radio>
 | 
			
		||||
          </el-radio-group> -->
 | 
			
		||||
          <el-select v-model="dataForm.materialMethod" placeholder="请选择物料计算方式" style="width: 100%;" @change="materialMethodChange">
 | 
			
		||||
            <el-option key="1" label="产品基础BOM" :value="1" />
 | 
			
		||||
            <el-option key="2" label="工艺扩展BOM" :value="2" />
 | 
			
		||||
          </el-select>
 | 
			
		||||
        </el-form-item>
 | 
			
		||||
      </el-col>
 | 
			
		||||
    </el-row>
 | 
			
		||||
    <el-row>
 | 
			
		||||
      <el-col :span='12'>
 | 
			
		||||
      <el-col :span='8'>
 | 
			
		||||
        <el-form-item label="优先级" prop="priority">
 | 
			
		||||
          <el-select v-model="dataForm.priority" placeholder="请选择" style="width: 100%;">
 | 
			
		||||
          <el-select v-model="dataForm.priority" placeholder="请选择优先级" style="width: 100%;">
 | 
			
		||||
            <el-option
 | 
			
		||||
              v-for="item in getDictDatas(DICT_TYPE.ORDER_PRIORITY)"
 | 
			
		||||
              :key="item.value"
 | 
			
		||||
@@ -102,9 +102,9 @@
 | 
			
		||||
          </el-select>
 | 
			
		||||
        </el-form-item>
 | 
			
		||||
      </el-col>
 | 
			
		||||
      <el-col :span='12'>
 | 
			
		||||
      <el-col :span='8'>
 | 
			
		||||
        <el-form-item label="工单类型" prop="type">
 | 
			
		||||
          <el-select v-model="dataForm.type" placeholder="请选择" style="width: 100%;">
 | 
			
		||||
          <el-select v-model="dataForm.type" placeholder="请选择工单类型" style="width: 100%;">
 | 
			
		||||
            <el-option
 | 
			
		||||
              v-for="item in workOrderTypeList"
 | 
			
		||||
              :key="item.id"
 | 
			
		||||
@@ -115,10 +115,10 @@
 | 
			
		||||
        </el-form-item>
 | 
			
		||||
      </el-col>
 | 
			
		||||
    </el-row>
 | 
			
		||||
    <el-row>
 | 
			
		||||
      <el-col :span='12'>
 | 
			
		||||
    <el-row :gutter="20">
 | 
			
		||||
      <el-col :span='8'>
 | 
			
		||||
        <el-form-item label="关联产线" prop="productLineIds">
 | 
			
		||||
          <el-select v-model="dataForm.productLineIds" placeholder="请选择" multiple style="width: 100%;">
 | 
			
		||||
          <el-select v-model="dataForm.productLineIds" placeholder="请选择关联产线" multiple style="width: 100%;">
 | 
			
		||||
            <el-option
 | 
			
		||||
              v-for="item in productLineList"
 | 
			
		||||
              :key="item.id"
 | 
			
		||||
@@ -128,9 +128,9 @@
 | 
			
		||||
          </el-select>
 | 
			
		||||
        </el-form-item>
 | 
			
		||||
      </el-col>
 | 
			
		||||
      <el-col :span='12'>
 | 
			
		||||
      <el-col :span='8'>
 | 
			
		||||
        <el-form-item label="负责人" prop="workers">
 | 
			
		||||
          <el-input v-model="dataForm.workers"></el-input>
 | 
			
		||||
          <el-input v-model="dataForm.workers" placeholder="请输入负责人"></el-input>
 | 
			
		||||
        </el-form-item>
 | 
			
		||||
      </el-col>
 | 
			
		||||
    </el-row>
 | 
			
		||||
@@ -168,13 +168,14 @@ export default {
 | 
			
		||||
        name: '',
 | 
			
		||||
        code: '',
 | 
			
		||||
        planProductId: '',
 | 
			
		||||
        productSpec: '',
 | 
			
		||||
        specifications: '',
 | 
			
		||||
        planStartTime: '',
 | 
			
		||||
        planFinishTime: '',
 | 
			
		||||
        planAssignQuantity: 0,
 | 
			
		||||
        planQuantity: 0,
 | 
			
		||||
        processFlowId: '',
 | 
			
		||||
        materialMethod: 1,
 | 
			
		||||
        triggerOrigin: 1,
 | 
			
		||||
        priority: '',
 | 
			
		||||
        productLineIds: [],
 | 
			
		||||
        type: '',
 | 
			
		||||
@@ -186,7 +187,7 @@ export default {
 | 
			
		||||
        planProductId: [{ required: true, message: "产品名称不能为空", trigger: "change" }],
 | 
			
		||||
        planAssignQuantity: [{ required: true, message: "计划投入数量不能为空", trigger: "blur" }],
 | 
			
		||||
        planQuantity: [{ required: true, message: "计划生产数量不能为空", trigger: "blur" }],
 | 
			
		||||
        productLineIds: [{ required: true, message: "产品不能为空", trigger: "change" }]
 | 
			
		||||
        productLineIds: [{ required: true, message: "关联产线不能为空", trigger: "change" }]
 | 
			
		||||
      },
 | 
			
		||||
      productList: [],
 | 
			
		||||
      processFlowList: [],
 | 
			
		||||
@@ -232,6 +233,10 @@ export default {
 | 
			
		||||
        if (this.dataForm.id) {
 | 
			
		||||
          getCoreWO(id).then(response => {
 | 
			
		||||
            this.dataForm = response.data;
 | 
			
		||||
            if (this.dataForm.priority !== undefined) {
 | 
			
		||||
              this.dataForm.priority = String(this.dataForm.priority)
 | 
			
		||||
            }
 | 
			
		||||
            this.dataForm.priority 
 | 
			
		||||
          });
 | 
			
		||||
        } else {
 | 
			
		||||
          if (this.urlOptions.isGetCode) {
 | 
			
		||||
@@ -264,7 +269,11 @@ export default {
 | 
			
		||||
            cancelButtonText: '取消',
 | 
			
		||||
            type: 'warning'
 | 
			
		||||
          }).then(() => {
 | 
			
		||||
            this.$emit("refreshDataList", true);
 | 
			
		||||
            console.log('121', this.dataForm.name)
 | 
			
		||||
            this.$emit("refreshDataList", {
 | 
			
		||||
              id: response.data,
 | 
			
		||||
              name: this.dataForm.name
 | 
			
		||||
            });
 | 
			
		||||
          }).catch(() => {
 | 
			
		||||
            this.$emit("refreshDataList");        
 | 
			
		||||
          });
 | 
			
		||||
@@ -303,11 +312,11 @@ export default {
 | 
			
		||||
      if (val) {
 | 
			
		||||
        this.productList.map(item => {
 | 
			
		||||
          if (val === item.id) {
 | 
			
		||||
            this.dataForm.productSpec = item.specifications
 | 
			
		||||
            this.dataForm.specifications = item.specifications
 | 
			
		||||
          }
 | 
			
		||||
        })
 | 
			
		||||
      } else {
 | 
			
		||||
        this.dataForm.productSpec = ''
 | 
			
		||||
        this.dataForm.specifications = ''
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
 
 | 
			
		||||
@@ -1,7 +1,7 @@
 | 
			
		||||
<template>
 | 
			
		||||
	<el-dialog
 | 
			
		||||
		:visible.sync="visible"
 | 
			
		||||
		:width="'35%'"
 | 
			
		||||
		:width="'50%'"
 | 
			
		||||
		:append-to-body="true"
 | 
			
		||||
		:close-on-click-modal="false"
 | 
			
		||||
		class="dialog">
 | 
			
		||||
@@ -17,8 +17,10 @@
 | 
			
		||||
			ref="dataForm"
 | 
			
		||||
			:model="dataForm"
 | 
			
		||||
			:rules="dataRule"
 | 
			
		||||
			label-width="100px"
 | 
			
		||||
			label-width="80px"
 | 
			
		||||
			@keyup.enter.native="dataFormSubmit()">
 | 
			
		||||
			<el-row :gutter="20">
 | 
			
		||||
				<el-col :span="12">
 | 
			
		||||
					<el-form-item label="原料" prop="material">
 | 
			
		||||
						<el-select
 | 
			
		||||
							v-model="dataForm.material"
 | 
			
		||||
@@ -32,6 +34,8 @@
 | 
			
		||||
								:value="dict.value" />
 | 
			
		||||
						</el-select>
 | 
			
		||||
					</el-form-item>
 | 
			
		||||
				</el-col>
 | 
			
		||||
				<el-col :span="12">
 | 
			
		||||
					<el-form-item label="来源" prop="origin">
 | 
			
		||||
						<el-select
 | 
			
		||||
							v-model="dataForm.origin"
 | 
			
		||||
@@ -45,6 +49,10 @@
 | 
			
		||||
								: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="supplierId">
 | 
			
		||||
						<el-select
 | 
			
		||||
							v-model="dataForm.supplierId"
 | 
			
		||||
@@ -58,19 +66,28 @@
 | 
			
		||||
								:value="dict.id" />
 | 
			
		||||
						</el-select>
 | 
			
		||||
					</el-form-item>
 | 
			
		||||
				</el-col>
 | 
			
		||||
				<el-col :span="12">
 | 
			
		||||
					<el-form-item label="批次号" prop="batch">
 | 
			
		||||
						<el-input
 | 
			
		||||
							v-model="dataForm.batch"
 | 
			
		||||
							clearable
 | 
			
		||||
					placeholder="请输入规格" />
 | 
			
		||||
							placeholder="请输入批次号" />
 | 
			
		||||
					</el-form-item>
 | 
			
		||||
				</el-col>
 | 
			
		||||
			</el-row>
 | 
			
		||||
			<el-row :gutter="20">
 | 
			
		||||
				<el-col :span="12">
 | 
			
		||||
					<el-form-item label="数量" prop="num">
 | 
			
		||||
						<el-input-number
 | 
			
		||||
							v-model="dataForm.num"
 | 
			
		||||
							clearable
 | 
			
		||||
							controls-position="right"
 | 
			
		||||
							style="width: 100%"
 | 
			
		||||
							placeholder="请输入数量" />
 | 
			
		||||
					</el-form-item>
 | 
			
		||||
				</el-col>
 | 
			
		||||
				<el-col :span="12">
 | 
			
		||||
					<el-form-item label="单位" prop="unit">
 | 
			
		||||
						<el-select
 | 
			
		||||
							v-model="dataForm.unit"
 | 
			
		||||
@@ -84,6 +101,8 @@
 | 
			
		||||
								:value="dict.value" />
 | 
			
		||||
						</el-select>
 | 
			
		||||
					</el-form-item>
 | 
			
		||||
				</el-col>
 | 
			
		||||
			</el-row>
 | 
			
		||||
		</el-form>
 | 
			
		||||
 | 
			
		||||
		<el-row style="text-align: right">
 | 
			
		||||
@@ -143,13 +162,19 @@ export default {
 | 
			
		||||
		},
 | 
			
		||||
		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
 | 
			
		||||
						if (this.dataForm.unit !== undefined) {
 | 
			
		||||
							this.dataForm.unit = String(this.dataForm.unit)
 | 
			
		||||
						}
 | 
			
		||||
						if (this.dataForm.material !== undefined) {
 | 
			
		||||
							this.dataForm.material = String(this.dataForm.material)
 | 
			
		||||
						}
 | 
			
		||||
						console.log('111', this.dataForm)
 | 
			
		||||
					});
 | 
			
		||||
				}
 | 
			
		||||
			});
 | 
			
		||||
 
 | 
			
		||||
@@ -2,7 +2,7 @@
 | 
			
		||||
 * @Author: zwq
 | 
			
		||||
 * @Date: 2021-11-18 14:16:25
 | 
			
		||||
 * @LastEditors: DY
 | 
			
		||||
 * @LastEditTime: 2023-11-16 13:45:13
 | 
			
		||||
 * @LastEditTime: 2023-11-23 18:45:15
 | 
			
		||||
 * @Description:
 | 
			
		||||
-->
 | 
			
		||||
<template>
 | 
			
		||||
@@ -16,6 +16,7 @@
 | 
			
		||||
		<!-- <small-title slot="title" :no-padding="true">
 | 
			
		||||
			{{ isdetail ? '详情' : !dataForm.id ? '新增' : '编辑' }}
 | 
			
		||||
		</small-title> -->
 | 
			
		||||
		<el-button style="float: right" type="primary" @click="goback()">返回</el-button>
 | 
			
		||||
		<div v-show="workOrderButton.length">
 | 
			
		||||
			<el-button  v-for="(work, index) in workOrderButton" :key="index" type="primary" @click="init(work.id, true)">{{ work.name }}</el-button>
 | 
			
		||||
		</div>
 | 
			
		||||
@@ -33,7 +34,7 @@
 | 
			
		||||
					<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>
 | 
			
		||||
						<span v-for="(item, index) in orderList" :key="index" style="margin-right: 10px">{{ item.orderName }}</span>
 | 
			
		||||
					</el-col>
 | 
			
		||||
				</el-row>
 | 
			
		||||
				<el-row :gutter="20">
 | 
			
		||||
@@ -42,13 +43,15 @@
 | 
			
		||||
					<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.remainingTime }}</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">关联产线:
 | 
			
		||||
						<span v-for="(item, index) in dataForm.productLineNames" :key="index" style="margin-right: 10px">{{ item }}</span>
 | 
			
		||||
					</el-col>
 | 
			
		||||
					<el-col :span="8">物料计算方式:{{ dataForm.materialMethod === 1 ? '产品基础' : dataForm.materialMethod === 2 ? '工艺扩展' : '' }}</el-col>
 | 
			
		||||
				</el-row>
 | 
			
		||||
				<el-row :gutter="20">
 | 
			
		||||
@@ -63,9 +66,7 @@
 | 
			
		||||
			</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; white-space: pre-wrap">{{ parseTime(item.createTime) }}</span>
 | 
			
		||||
					</el-col>
 | 
			
		||||
					<el-col :span="8">工单创建时间:{{ parseTime(dataForm.createTime) }}</el-col>
 | 
			
		||||
					<el-col :span="8">计划开始时间:{{ parseTime(dataForm.planStartTime) }}</el-col>
 | 
			
		||||
					<el-col :span="8">计划完成时间:{{ parseTime(dataForm.planFinishTime) }}</el-col>
 | 
			
		||||
				</el-row>
 | 
			
		||||
@@ -143,7 +144,7 @@
 | 
			
		||||
<script>
 | 
			
		||||
// import basicAdd from '../../core/mixins/basic-add';
 | 
			
		||||
import { getCoreWO, getMaterialBomPage, getConOrderList, getCoreWOListById } from "@/api/base/coreWorkOrder";
 | 
			
		||||
import { orderList } from "@/api/base/orderManage";
 | 
			
		||||
// import { orderList } from "@/api/base/orderManage";
 | 
			
		||||
import { getProcessFlowList } from '@/api/base/orderManage'
 | 
			
		||||
import SmallTitle from './SmallTitle';
 | 
			
		||||
import { publicFormatter } from "@/utils/dict";
 | 
			
		||||
@@ -186,7 +187,7 @@ const tableProps = [
 | 
			
		||||
const tableProps1 = [
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'materialName',
 | 
			
		||||
		label: '原料名称'
 | 
			
		||||
		label: '物料名称'
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'unit',
 | 
			
		||||
@@ -223,7 +224,7 @@ export default {
 | 
			
		||||
			dataForm: {},
 | 
			
		||||
			orderList: [],
 | 
			
		||||
			materialList: [],
 | 
			
		||||
			orderArray: [],
 | 
			
		||||
			// orderArray: [],
 | 
			
		||||
			visible: false,
 | 
			
		||||
			isdetail: false,
 | 
			
		||||
			workOrderButton: [],
 | 
			
		||||
@@ -336,12 +337,11 @@ export default {
 | 
			
		||||
				});
 | 
			
		||||
			}
 | 
			
		||||
			// 获取订单相关信息
 | 
			
		||||
			orderList({
 | 
			
		||||
				workOrderId: this.dataForm.id
 | 
			
		||||
			}).then((response) => {
 | 
			
		||||
				this.orderArray = response.data;
 | 
			
		||||
				// this.listQuery.total = response.data.total;
 | 
			
		||||
			});
 | 
			
		||||
			// orderList({
 | 
			
		||||
			// 	workOrderId: this.dataForm.id
 | 
			
		||||
			// }).then((response) => {
 | 
			
		||||
			// 	this.orderArray = response.data;
 | 
			
		||||
			// });
 | 
			
		||||
		},
 | 
			
		||||
		init(id, isdetail) {
 | 
			
		||||
			this.initData();
 | 
			
		||||
@@ -374,8 +374,7 @@ export default {
 | 
			
		||||
			});
 | 
			
		||||
		},
 | 
			
		||||
		goback() {
 | 
			
		||||
			this.visible = false;
 | 
			
		||||
			this.$emit('refreshDataList');
 | 
			
		||||
			this.$router.go(-1);
 | 
			
		||||
			// this.initData();
 | 
			
		||||
		},
 | 
			
		||||
		goEdit() {
 | 
			
		||||
 
 | 
			
		||||
@@ -13,7 +13,7 @@
 | 
			
		||||
			<method-btn
 | 
			
		||||
				v-if="tableBtn.length"
 | 
			
		||||
				slot="handleBtn"
 | 
			
		||||
				:width="300"
 | 
			
		||||
				:width="350"
 | 
			
		||||
				label="操作"
 | 
			
		||||
				:method-list="tableBtn"
 | 
			
		||||
				@clickBtn="handleClick" />
 | 
			
		||||
@@ -57,7 +57,8 @@ import {
 | 
			
		||||
	getCoreWOPage,
 | 
			
		||||
	deleteCoreWO,
 | 
			
		||||
	statusChange,
 | 
			
		||||
	getConOrderList
 | 
			
		||||
	getConOrderList,
 | 
			
		||||
	getCoreWOList
 | 
			
		||||
} from '@/api/base/coreWorkOrder';
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@@ -65,19 +66,27 @@ const tableProps = [
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'createTime',
 | 
			
		||||
		label: '创建时间',
 | 
			
		||||
		filter: parseTime
 | 
			
		||||
		filter: parseTime,
 | 
			
		||||
		minWidth: 150,
 | 
			
		||||
		showOverflowtooltip: true
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'name',
 | 
			
		||||
		label: '工单名称'
 | 
			
		||||
		label: '工单名称',
 | 
			
		||||
		minWidth: 120,
 | 
			
		||||
		showOverflowtooltip: true
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'code',
 | 
			
		||||
		label: '工单编码'
 | 
			
		||||
		label: '工单编码',
 | 
			
		||||
		minWidth: 150,
 | 
			
		||||
		showOverflowtooltip: true
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'workers',
 | 
			
		||||
		label: '负责人'
 | 
			
		||||
		label: '负责人',
 | 
			
		||||
		minWidth: 100,
 | 
			
		||||
		showOverflowtooltip: true
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'priority',
 | 
			
		||||
@@ -87,7 +96,7 @@ const tableProps = [
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'triggerOrigin',
 | 
			
		||||
		label: '来源',
 | 
			
		||||
		filter: (val) => ['', 'MES', 'ERP'][val]
 | 
			
		||||
		filter: (val) => ['', 'MES-手动', 'MES-订单下发', 'ERP'][val]
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'status',
 | 
			
		||||
@@ -97,15 +106,19 @@ const tableProps = [
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'planFinishTime',
 | 
			
		||||
		label: '计划完成时间',
 | 
			
		||||
		filter: parseTime
 | 
			
		||||
		filter: parseTime,
 | 
			
		||||
		minWidth: 150,
 | 
			
		||||
		showOverflowtooltip: true
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'planQuantity',
 | 
			
		||||
		label: '计划生产数量'
 | 
			
		||||
		label: '计划生产数量',
 | 
			
		||||
		minWidth: 120,
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'actualQuantity',
 | 
			
		||||
		label: '实际生产数量'
 | 
			
		||||
		label: '实际生产数量',
 | 
			
		||||
		minWidth: 120,
 | 
			
		||||
	}
 | 
			
		||||
];
 | 
			
		||||
 | 
			
		||||
@@ -127,48 +140,10 @@ export default {
 | 
			
		||||
			allocationVisible: 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
 | 
			
		||||
									}
 | 
			
		||||
								]
 | 
			
		||||
							}
 | 
			
		||||
							btnName: '原料信息',
 | 
			
		||||
					  }
 | 
			
		||||
					: undefined,
 | 
			
		||||
					{
 | 
			
		||||
@@ -213,7 +188,7 @@ export default {
 | 
			
		||||
								{
 | 
			
		||||
									name: 'status',
 | 
			
		||||
									type: 'equal',
 | 
			
		||||
									value: 3
 | 
			
		||||
									value: 2
 | 
			
		||||
								},
 | 
			
		||||
								{
 | 
			
		||||
									name: 'status',
 | 
			
		||||
@@ -246,10 +221,58 @@ export default {
 | 
			
		||||
								}
 | 
			
		||||
							]
 | 
			
		||||
						}
 | 
			
		||||
					},
 | 
			
		||||
					this.$auth.hasPermi(`base:core-work-order:detail`)
 | 
			
		||||
					? {
 | 
			
		||||
							type: 'detail',
 | 
			
		||||
							btnName: '查看详情',
 | 
			
		||||
					  }
 | 
			
		||||
					: undefined,
 | 
			
		||||
					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:delete`)
 | 
			
		||||
					? {
 | 
			
		||||
							type: 'delete',
 | 
			
		||||
							btnName: '删除',
 | 
			
		||||
							showParam: {
 | 
			
		||||
								type: '|',
 | 
			
		||||
								data: [
 | 
			
		||||
									{
 | 
			
		||||
										name: 'status',
 | 
			
		||||
										type: 'equal',
 | 
			
		||||
										value: 1
 | 
			
		||||
									}
 | 
			
		||||
								]
 | 
			
		||||
							}
 | 
			
		||||
					  }
 | 
			
		||||
					: undefined
 | 
			
		||||
			].filter((v)=>v),
 | 
			
		||||
			tableData: [],
 | 
			
		||||
			formConfig: [
 | 
			
		||||
				// {
 | 
			
		||||
				// 	type: 'select',
 | 
			
		||||
				// 	label: '工单名称',
 | 
			
		||||
				// 	placeholder: '工单名称',
 | 
			
		||||
				// 	param: 'name',
 | 
			
		||||
				// 	defaultSelect: '',
 | 
			
		||||
				// 	selectOptions: [],
 | 
			
		||||
				// 	allowCreate: true,
 | 
			
		||||
				// 	filterable: true
 | 
			
		||||
				// },
 | 
			
		||||
				{
 | 
			
		||||
					type: 'input',
 | 
			
		||||
					label: '工单名称',
 | 
			
		||||
@@ -307,13 +330,32 @@ export default {
 | 
			
		||||
			this.listQuery.name = this.$route.query.workOrderName;
 | 
			
		||||
			this.formConfig[0].defaultSelect = this.$route.query.workOrderName;
 | 
			
		||||
		}
 | 
			
		||||
		// this.getWorkOrder()
 | 
			
		||||
		this.getDataList()
 | 
			
		||||
	},
 | 
			
		||||
	methods: {
 | 
			
		||||
		getWorkOrder() {
 | 
			
		||||
			getCoreWOList().then(res => {
 | 
			
		||||
				this.formConfig[0].selectOptions = res.data.map(item => {
 | 
			
		||||
					return {
 | 
			
		||||
						name: item.name,
 | 
			
		||||
						id: item.name
 | 
			
		||||
					}
 | 
			
		||||
				})
 | 
			
		||||
			})
 | 
			
		||||
		},
 | 
			
		||||
		refreshWorkOrder(val) {
 | 
			
		||||
			console.log(val)
 | 
			
		||||
			if (val) {
 | 
			
		||||
				console.log('打印')
 | 
			
		||||
				// 预使用原料信息
 | 
			
		||||
				console.log('预使用原料信息')
 | 
			
		||||
				this.handleCancel()
 | 
			
		||||
      	this.getDataList()
 | 
			
		||||
				this.materialVisible = true;
 | 
			
		||||
        this.addOrEditTitle = "预使用主原料信息";
 | 
			
		||||
        this.$nextTick(() => {
 | 
			
		||||
          this.$refs.material.init(val, true);
 | 
			
		||||
        });
 | 
			
		||||
			} else {
 | 
			
		||||
				this.successSubmit()
 | 
			
		||||
			}
 | 
			
		||||
 
 | 
			
		||||
@@ -2,7 +2,7 @@
 | 
			
		||||
 * @Author: zwq
 | 
			
		||||
 * @Date: 2021-11-18 14:16:25
 | 
			
		||||
 * @LastEditors: DY
 | 
			
		||||
 * @LastEditTime: 2023-11-03 11:01:24
 | 
			
		||||
 * @LastEditTime: 2023-11-24 18:13:02
 | 
			
		||||
 * @Description:
 | 
			
		||||
-->
 | 
			
		||||
<template>
 | 
			
		||||
@@ -196,7 +196,7 @@ export default {
 | 
			
		||||
				workCost: undefined,
 | 
			
		||||
        remark: undefined,
 | 
			
		||||
			},
 | 
			
		||||
			majorIdList: undefined,
 | 
			
		||||
			majorIdList: [],
 | 
			
		||||
			departmentlList: [],
 | 
			
		||||
			menuOptions: [],
 | 
			
		||||
			bindIds: [],
 | 
			
		||||
@@ -211,6 +211,8 @@ export default {
 | 
			
		||||
              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();
 | 
			
		||||
								}
 | 
			
		||||
							} else {
 | 
			
		||||
								callback();
 | 
			
		||||
@@ -243,13 +245,32 @@ export default {
 | 
			
		||||
		setOut(val) {
 | 
			
		||||
			if (val === 1) {
 | 
			
		||||
				this.isOut = true
 | 
			
		||||
				this.dataForm.outTime = ''
 | 
			
		||||
			} else {
 | 
			
		||||
				this.isOut = false
 | 
			
		||||
			}
 | 
			
		||||
		},
 | 
			
		||||
		reset() {
 | 
			
		||||
			this.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
 | 
			
		||||
			}
 | 
			
		||||
			this.majorIdList = []
 | 
			
		||||
		},
 | 
			
		||||
		// 表单提交
 | 
			
		||||
    dataFormSubmit() {
 | 
			
		||||
			console.log('111', this.dataForm)
 | 
			
		||||
      this.$refs["dataForm"].validate((valid) => {
 | 
			
		||||
        if (!valid) {
 | 
			
		||||
          return false;
 | 
			
		||||
@@ -267,24 +288,28 @@ export default {
 | 
			
		||||
            this.visible = false;
 | 
			
		||||
            this.$emit("refreshDataList");
 | 
			
		||||
          });
 | 
			
		||||
					if (this.majorIdList.length > 0) {
 | 
			
		||||
						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
 | 
			
		||||
					if (this.majorIdList.length > 0) {
 | 
			
		||||
						this.majorIdList.forEach(majorId => {
 | 
			
		||||
							createWoBindMa({
 | 
			
		||||
								workerId: this.workerId,
 | 
			
		||||
								majorId: majorId
 | 
			
		||||
							}).then(res => {})
 | 
			
		||||
						});
 | 
			
		||||
					}
 | 
			
		||||
          this.$modal.msgSuccess("新增成功");
 | 
			
		||||
          this.visible = false;
 | 
			
		||||
          this.$emit("refreshDataList");
 | 
			
		||||
@@ -292,7 +317,8 @@ export default {
 | 
			
		||||
      });
 | 
			
		||||
    },
 | 
			
		||||
		init(id) {
 | 
			
		||||
      this.dataForm.id = id || "";
 | 
			
		||||
			this.reset()
 | 
			
		||||
      this.dataForm.id = id || undefined;
 | 
			
		||||
      this.visible = true;
 | 
			
		||||
      if (this.urlOptions.getOption) {
 | 
			
		||||
        this.getArr()
 | 
			
		||||
@@ -302,6 +328,7 @@ export default {
 | 
			
		||||
        if (this.dataForm.id) {
 | 
			
		||||
          this.urlOptions.infoURL(id).then(response => {
 | 
			
		||||
            this.dataForm = response.data;
 | 
			
		||||
						this.dataForm.departmentName = undefined
 | 
			
		||||
          });
 | 
			
		||||
					// 获取员工--专业
 | 
			
		||||
					getWoBindMaPage({
 | 
			
		||||
 
 | 
			
		||||
@@ -2,7 +2,7 @@
 | 
			
		||||
 * @Author: zwq
 | 
			
		||||
 * @Date: 2021-11-18 14:16:25
 | 
			
		||||
 * @LastEditors: DY
 | 
			
		||||
 * @LastEditTime: 2023-11-03 19:31:25
 | 
			
		||||
 * @LastEditTime: 2023-11-27 09:21:48
 | 
			
		||||
 * @Description:
 | 
			
		||||
-->
 | 
			
		||||
<template>
 | 
			
		||||
@@ -43,7 +43,9 @@
 | 
			
		||||
				<el-form-item label="排序" prop="sort">
 | 
			
		||||
					<el-input-number
 | 
			
		||||
						v-model="dataForm.sort"
 | 
			
		||||
						placeholder="排序" />
 | 
			
		||||
						controls-position="right"
 | 
			
		||||
						placeholder="排序"
 | 
			
		||||
						style="width: 100%" />
 | 
			
		||||
				</el-form-item>
 | 
			
		||||
			</el-col>
 | 
			
		||||
		</el-row>
 | 
			
		||||
@@ -82,8 +84,8 @@ export default {
 | 
			
		||||
			},
 | 
			
		||||
			proLineList: [],
 | 
			
		||||
			dataRule: {
 | 
			
		||||
        code: [{ required: true, message: "专业编码不能为空", trigger: "blur" }],
 | 
			
		||||
        name: [{ required: true, message: "专业名称不能为空", trigger: "blur" }],
 | 
			
		||||
        code: [{ required: true, message: "工段编号不能为空", trigger: "blur" }],
 | 
			
		||||
        name: [{ required: true, message: "工段名称不能为空", trigger: "blur" }],
 | 
			
		||||
				productionLineId: [{ required: true, message: "产线不能为空", trigger: "blur" }],
 | 
			
		||||
        sort: [{ required: true, message: "排序不能为空", trigger: "blur" }]
 | 
			
		||||
      }
 | 
			
		||||
 
 | 
			
		||||
@@ -29,7 +29,7 @@
 | 
			
		||||
			@cancel="handleCancel"
 | 
			
		||||
			@confirm="handleConfirm"
 | 
			
		||||
			:before-close="handleCancel"
 | 
			
		||||
			width="50%">
 | 
			
		||||
			width="40%">
 | 
			
		||||
			<add-or-update
 | 
			
		||||
				ref="addOrUpdate"
 | 
			
		||||
				@refreshDataList="successSubmit"></add-or-update>
 | 
			
		||||
 
 | 
			
		||||
@@ -202,12 +202,11 @@ export default {
 | 
			
		||||
    }
 | 
			
		||||
  },
 | 
			
		||||
  created() {
 | 
			
		||||
    // this.init()
 | 
			
		||||
    // console.log('aaaaaa')
 | 
			
		||||
    // this.otherPaper()
 | 
			
		||||
    // $('.hiprintEpContainer').empty()
 | 
			
		||||
  },
 | 
			
		||||
  destroyed () {
 | 
			
		||||
    $('.hiprintEpContainer').empty()
 | 
			
		||||
    console.log(11111)
 | 
			
		||||
  },
 | 
			
		||||
  methods: {
 | 
			
		||||
    // handleClose() {
 | 
			
		||||
@@ -215,6 +214,7 @@ export default {
 | 
			
		||||
    // },
 | 
			
		||||
    closed() {
 | 
			
		||||
      $('.hiprintEpContainer').empty()
 | 
			
		||||
      $('.hiprint-printTemplate').empty()
 | 
			
		||||
    },
 | 
			
		||||
    init(data) {
 | 
			
		||||
      this.drawer = true
 | 
			
		||||
@@ -256,17 +256,17 @@ export default {
 | 
			
		||||
 | 
			
		||||
        // console.log(this.modelData)
 | 
			
		||||
        // console.log($('#hiprint-printTemplate').empty())
 | 
			
		||||
        if (this.modelData != {}) {
 | 
			
		||||
          console.log(this.modelData);
 | 
			
		||||
          $('.hiprintEpContainer').empty()
 | 
			
		||||
          hiprint.PrintElementTypeManager.build('.hiprintEpContainer', provider.value)
 | 
			
		||||
          $('.hiprint-printTemplate').empty()
 | 
			
		||||
          hiprintTemplate = new hiprint.PrintTemplate({
 | 
			
		||||
            template: JSON.parse(this.modelData),
 | 
			
		||||
            settingContainer: '#PrintElementOptionSetting',
 | 
			
		||||
            paginationContainer: '.hiprint-printPagination'
 | 
			
		||||
          })
 | 
			
		||||
        } else {
 | 
			
		||||
        // if () {
 | 
			
		||||
          // console.log(this.modelData);
 | 
			
		||||
          // $('.hiprintEpContainer').empty()
 | 
			
		||||
          // hiprint.PrintElementTypeManager.build('.hiprintEpContainer', provider.value)
 | 
			
		||||
          // $('.hiprint-printTemplate').empty()
 | 
			
		||||
          // hiprintTemplate = new hiprint.PrintTemplate({
 | 
			
		||||
          //   template: JSON.parse(this.modelData),
 | 
			
		||||
          //   settingContainer: '#PrintElementOptionSetting',
 | 
			
		||||
          //   paginationContainer: '.hiprint-printPagination'
 | 
			
		||||
          // })
 | 
			
		||||
        // } else {
 | 
			
		||||
          $('.hiprintEpContainer').empty()
 | 
			
		||||
          console.log(this.modelData);
 | 
			
		||||
          hiprint.PrintElementTypeManager.build('.hiprintEpContainer', provider.value)
 | 
			
		||||
@@ -275,11 +275,11 @@ export default {
 | 
			
		||||
          const template = provider.value
 | 
			
		||||
          // console.log(template)
 | 
			
		||||
          hiprintTemplate = new hiprint.PrintTemplate({
 | 
			
		||||
            template: template,
 | 
			
		||||
            template: this.modelData != '' ? JSON.parse(this.modelData) : {},
 | 
			
		||||
            settingContainer: '#PrintElementOptionSetting',
 | 
			
		||||
            paginationContainer: '.hiprint-printPagination'
 | 
			
		||||
          })
 | 
			
		||||
        }
 | 
			
		||||
        // }
 | 
			
		||||
        hiprintTemplate.design('#hiprint-printTemplate')
 | 
			
		||||
        // console.log(hiprintTemplate)
 | 
			
		||||
        console.log(hiprintTemplate);
 | 
			
		||||
 
 | 
			
		||||
@@ -236,212 +236,10 @@ export const aProvider = function (ops) {
 | 
			
		||||
  };
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
// 自定义设计元素2
 | 
			
		||||
export const bProvider = function (ops) {
 | 
			
		||||
  var addElementTypes = function (context) {
 | 
			
		||||
    context.removePrintElementTypes("bProviderModule");
 | 
			
		||||
    context.addPrintElementTypes(
 | 
			
		||||
      "bProviderModule",
 | 
			
		||||
      [
 | 
			
		||||
        new hiprint.PrintElementTypeGroup("常规", [
 | 
			
		||||
          {
 | 
			
		||||
            tid: 'bProviderModule.header', title: '单据表头', data: '单据表头', type: 'text',
 | 
			
		||||
            options: {
 | 
			
		||||
              testData: '单据表头',
 | 
			
		||||
              height: 17,
 | 
			
		||||
              fontSize: 16.5,
 | 
			
		||||
              fontWeight: "700",
 | 
			
		||||
              textAlign: "center",
 | 
			
		||||
              hideTitle: true
 | 
			
		||||
            }
 | 
			
		||||
          },
 | 
			
		||||
          {
 | 
			
		||||
            tid: 'bProviderModule.type', title: '单据类型', data: '单据类型', type: 'text',
 | 
			
		||||
            options: {
 | 
			
		||||
              testData: '单据类型',
 | 
			
		||||
              height: 16,
 | 
			
		||||
              fontSize: 15,
 | 
			
		||||
              fontWeight: "700",
 | 
			
		||||
              textAlign: "center",
 | 
			
		||||
              hideTitle: true
 | 
			
		||||
            }
 | 
			
		||||
          },
 | 
			
		||||
          {
 | 
			
		||||
            tid: 'bProviderModule.order', title: '订单编号', data: 'XS888888888', type: 'text',
 | 
			
		||||
            options: {
 | 
			
		||||
              field: 'orderId',
 | 
			
		||||
              testData: 'XS888888888',
 | 
			
		||||
              height: 16,
 | 
			
		||||
              fontSize: 6.75,
 | 
			
		||||
              fontWeight: "700",
 | 
			
		||||
              textAlign: "left",
 | 
			
		||||
              textContentVerticalAlign: "middle"
 | 
			
		||||
            }
 | 
			
		||||
          },
 | 
			
		||||
          {
 | 
			
		||||
            tid: 'bProviderModule.date', title: '业务日期', data: '2020-01-01', type: 'text',
 | 
			
		||||
            options: {
 | 
			
		||||
              field: 'date',
 | 
			
		||||
              testData: '2020-01-01',
 | 
			
		||||
              height: 16,
 | 
			
		||||
              fontSize: 6.75,
 | 
			
		||||
              fontWeight: "700",
 | 
			
		||||
              textAlign: "left",
 | 
			
		||||
              textContentVerticalAlign: "middle"
 | 
			
		||||
            }
 | 
			
		||||
          },
 | 
			
		||||
          {
 | 
			
		||||
            tid: 'bProviderModule.barcode', title: '条形码', data: 'XS888888888', type: 'text',
 | 
			
		||||
            options: {
 | 
			
		||||
              field: 'barcode',
 | 
			
		||||
              testData: 'XS888888888',
 | 
			
		||||
              height: 32,
 | 
			
		||||
              fontSize: 12,
 | 
			
		||||
              lineHeight: 18,
 | 
			
		||||
              textType: "barcode"
 | 
			
		||||
            }
 | 
			
		||||
          },
 | 
			
		||||
          {
 | 
			
		||||
            tid: 'bProviderModule.qrcode', title: '二维码', data: 'XS888888888', type: 'text',
 | 
			
		||||
            options: {
 | 
			
		||||
              field: 'qrcode',
 | 
			
		||||
              testData: 'XS888888888',
 | 
			
		||||
              height: 32,
 | 
			
		||||
              fontSize: 12,
 | 
			
		||||
              lineHeight: 18,
 | 
			
		||||
              textType: "qrcode"
 | 
			
		||||
            }
 | 
			
		||||
          },
 | 
			
		||||
          {
 | 
			
		||||
            tid: 'bProviderModule.platform', title: '平台名称', data: '平台名称', type: 'text',
 | 
			
		||||
            options: {
 | 
			
		||||
              testData: '平台名称',
 | 
			
		||||
              height: 17,
 | 
			
		||||
              fontSize: 16.5,
 | 
			
		||||
              fontWeight: "700",
 | 
			
		||||
              textAlign: "center",
 | 
			
		||||
              hideTitle: true
 | 
			
		||||
            }
 | 
			
		||||
          },
 | 
			
		||||
          {tid: 'bProviderModule.image',  title: 'Logo', data: 'data: image/png;base64iVBORw0KGgoAAAANSUhEUgAAAGQAAABkCAYAAABw4pVUAAAHVklEQVR4nO2dT2wUVRzHv2/2T5eSAlvFilwgQUH+eLACaUxEiJLAxdh44MDZi2ChUIrSFtoCgbbSP4GDdwgeEA8kRTAI0iIGBL1ITLxgLAlCsCKBYndnx7zd35pl2+7On/de387OJ9l00515/z7z/szMmzfs7869mD0yCjw2gZAB4VhAiln4/dUaRGdU18aOnzw9dn24ioGJj0soFsJr1z2yNm+qN2/fvRFL8XyMYqTmFfxZ+TwMc1xKDsL/f2Ms8xGeLwuIRpCKx99MHf/i4uPrw5GQ9jIAfsCMXfw2HkuOX03Wb1qLh4+uIGFJjzecPoS5iEhUTg1hDMaM2GuRk6cGMTQUCYmPQQq86CMAkkPDkQirGAzXf7Du34ejN9IHmETCRjQGPL6D+4NnYDEJDQmXbaY6on/dm2Vm/jHdZe0Almm6Ll+YNQbzasX7765BNHI1o0sOYRghwExg7MG9dDQSiqsdwHuZmlFKMjLwQ3QcFtjlSxHTenLO3Lp7vfU09AOS41Ka+HC6CjIDIaqmguvIPgBtIgOcDhjVlMTQtarKOScumR/teCdpxoeNZGJCapjFt7Rcywrb2MYtnQBatCpZTzCkYCF+5suKRXf+6EvOmv0GSzwrhB/QpmGkBYZSpqvIZAlp8ZeMLFwKUH3z2gqWyd/+3F/5b1yRQQMCN8gQspeaKt+SAItSCxCiPjIjhDEkjRAMxmCZSbgZkYke537qdxl57KM8C0OkkD0ADohMXIlwgPIuBFFC9uS3p2XGflFSRAgpdxlZeBl84jUQr0ImjDTKGWZZBwE0eCkCL0J20UgjgGCwEDHNPjB86PbiilshfGRxOBCRD0tLCSWTnzMLO9yE4EbIzjIdTdmGpc8/rB4qK0c4FcKbqe7pyWZJ0k1lZhsnQnZq3EzV00dHDjupKXaFNGtcM7YA+Io+WzRIz2R0UxkWxY6QJgCHlCbfPlzAsZytj2ks5RCVZUGKCdkOoEt+Wl3RkCcjyzGv5wIS6aIynZJCQni7d0TTjPFaMFDg9wGNa8qRQn3KVEI+1rjPmKpm5KNzTemmMp7AZEK2AehXmz7bbC1SM/IZoH10pJ/K+hnyhXBrvZpmoBHAURf7HaV9daQ3v6Zk7hhWVr4AYDOAzzRNeKPHAyW7r459Yj/deUynMcyqqpY9/fXW+RTwkiF/ms5pADcd7nMbwAkBcfMM3wOwwOF+rys46TxCt+T72d2NG0YSg2fnC58ANDkbAZyVH41QNgAYVBTXNiMxeLYG6qawvagmGqGoTHOfwcAe6T8TvWwYlTC7OsALgRDNCIRoRiBEMwIhmhEI0YxAiGYEQjRDtZCY9iUyEaVpVi3kvuL4RKA0zSqF8Ad5TimMTxSnKO1KUCWEZ6hDVaYk0KFKigohbSUuI0uHiieKZQtp89kM+U7ZUmQKafHp4wpSH/eWJaTT5zPkD8g62GQI8cXqDTZok/HEsWgh+3Of2y4D2kU/0idKyEOaJdgqKLxSotXlfLFJESXkicKZGTrys6g0iRIyD8AvAFYLCq+UWC1yACOyD+Hrf1wAUCcwTN2pozzXiEqn6E59JoBvANQKDldHaimvM0WmTcawlydw2Oc1pY7yKFQGJJ4YxqiTXyEp/OlkBeVNyn0SmZdO5gC47rOOfjXlaY6sCGRfXKwA8LVP+pRaykuFzEhUXH7nR9P3AFYqiEsWKykP0mpGFlU3qKI0IlmlKD6RrKK0R1VEpvIW7uwSHXnVUdqVoHqSwz+K4xOB0jQH87I0IxCiGYEQzQiEaEYgRDMCIZoRCNGMQIhmBEI0gwuJK0xScKZemHiY1mzqUxThYgBLHO7zQOAzGnMBPOdwn8WC4rbDNjaSWVajQaEUp9wBsB7ALY/hLAVwHsB89VmwRXrhuGwf0q/xIl/z6f6105qVyxIKQ1cZjdlV/HI79V6N1yjk/dxlAMtc7LuM9lXZVzqhIXdxtvxR1kCxZUynkbl0o2ihgyQspH3mapqn7flrSE427O3TuKbwGZI/AlhuY9vltO08Belyw6T99lTnIQN2VmGeJqppskGhpfoW0DbVmuahaarVVQudGPZo3tH/RCOnfJbSbzp34D1T/VjsTL3X6esWFMJngJwDsCgnykX0P+mzQ1yyq9jqqtnzkGI0a7wgPz9pfJm+/6ZxB77bzus+7L7pkwdkarr8OBdwJee7jjQVaqZysVtDsuwK3j3lmGYnb5hwerW3S+PRl440OX3dh5vL7z0iXzXqY/bYbaZycXs/5KDdV/iUKc1URo7xcoOqq0yfui1Gq5e3EoUava1qzS/aJQGs8xKIj2jx+gCoVyGcoUBKGs8yIEgIAiliZEDwJAehL3ovIYS+2F9UDckyRH/fFhmoxuwTvdaJaCGc7+gyi9+br1YZSzTJEAIaffHrZG/JCFwDpK16JEsI5yK9uMdvzVe7zAUxZQrhXKKBwxqZkSikQ8aiZbnIFgKS4oea0i5bBhQJgQ+kKJEBhUJAUkqxo+cduJqVrQH8B6xBgBhvJFNDAAAAAElFTkSuQmCC', type: 'image',   options: {
 | 
			
		||||
            src: 'data: image/png;base64iVBORw0KGgoAAAANSUhEUgAAAGQAAABkCAYAAABw4pVUAAAHVklEQVR4nO2dT2wUVRzHv2/2T5eSAlvFilwgQUH+eLACaUxEiJLAxdh44MDZi2ChUIrSFtoCgbbSP4GDdwgeEA8kRTAI0iIGBL1ITLxgLAlCsCKBYndnx7zd35pl2+7On/de387OJ9l00515/z7z/szMmzfs7869mD0yCjw2gZAB4VhAiln4/dUaRGdU18aOnzw9dn24ioGJj0soFsJr1z2yNm+qN2/fvRFL8XyMYqTmFfxZ+TwMc1xKDsL/f2Ms8xGeLwuIRpCKx99MHf/i4uPrw5GQ9jIAfsCMXfw2HkuOX03Wb1qLh4+uIGFJjzecPoS5iEhUTg1hDMaM2GuRk6cGMTQUCYmPQQq86CMAkkPDkQirGAzXf7Du34ejN9IHmETCRjQGPL6D+4NnYDEJDQmXbaY6on/dm2Vm/jHdZe0Almm6Ll+YNQbzasX7765BNHI1o0sOYRghwExg7MG9dDQSiqsdwHuZmlFKMjLwQ3QcFtjlSxHTenLO3Lp7vfU09AOS41Ka+HC6CjIDIaqmguvIPgBtIgOcDhjVlMTQtarKOScumR/teCdpxoeNZGJCapjFt7Rcywrb2MYtnQBatCpZTzCkYCF+5suKRXf+6EvOmv0GSzwrhB/QpmGkBYZSpqvIZAlp8ZeMLFwKUH3z2gqWyd/+3F/5b1yRQQMCN8gQspeaKt+SAItSCxCiPjIjhDEkjRAMxmCZSbgZkYke537qdxl57KM8C0OkkD0ADohMXIlwgPIuBFFC9uS3p2XGflFSRAgpdxlZeBl84jUQr0ImjDTKGWZZBwE0eCkCL0J20UgjgGCwEDHNPjB86PbiilshfGRxOBCRD0tLCSWTnzMLO9yE4EbIzjIdTdmGpc8/rB4qK0c4FcKbqe7pyWZJ0k1lZhsnQnZq3EzV00dHDjupKXaFNGtcM7YA+Io+WzRIz2R0UxkWxY6QJgCHlCbfPlzAsZytj2ks5RCVZUGKCdkOoEt+Wl3RkCcjyzGv5wIS6aIynZJCQni7d0TTjPFaMFDg9wGNa8qRQn3KVEI+1rjPmKpm5KNzTemmMp7AZEK2AehXmz7bbC1SM/IZoH10pJ/K+hnyhXBrvZpmoBHAURf7HaV9daQ3v6Zk7hhWVr4AYDOAzzRNeKPHAyW7r459Yj/deUynMcyqqpY9/fXW+RTwkiF/ms5pADcd7nMbwAkBcfMM3wOwwOF+rys46TxCt+T72d2NG0YSg2fnC58ANDkbAZyVH41QNgAYVBTXNiMxeLYG6qawvagmGqGoTHOfwcAe6T8TvWwYlTC7OsALgRDNCIRoRiBEMwIhmhEI0YxAiGYEQjRDtZCY9iUyEaVpVi3kvuL4RKA0zSqF8Ad5TimMTxSnKO1KUCWEZ6hDVaYk0KFKigohbSUuI0uHiieKZQtp89kM+U7ZUmQKafHp4wpSH/eWJaTT5zPkD8g62GQI8cXqDTZok/HEsWgh+3Of2y4D2kU/0idKyEOaJdgqKLxSotXlfLFJESXkicKZGTrys6g0iRIyD8AvAFYLCq+UWC1yACOyD+Hrf1wAUCcwTN2pozzXiEqn6E59JoBvANQKDldHaimvM0WmTcawlydw2Oc1pY7yKFQGJJ4YxqiTXyEp/OlkBeVNyn0SmZdO5gC47rOOfjXlaY6sCGRfXKwA8LVP+pRaykuFzEhUXH7nR9P3AFYqiEsWKykP0mpGFlU3qKI0IlmlKD6RrKK0R1VEpvIW7uwSHXnVUdqVoHqSwz+K4xOB0jQH87I0IxCiGYEQzQiEaEYgRDMCIZoRCNGMQIhmBEI0gwuJK0xScKZemHiY1mzqUxThYgBLHO7zQOAzGnMBPOdwn8WC4rbDNjaSWVajQaEUp9wBsB7ALY/hLAVwHsB89VmwRXrhuGwf0q/xIl/z6f6105qVyxIKQ1cZjdlV/HI79V6N1yjk/dxlAMtc7LuM9lXZVzqhIXdxtvxR1kCxZUynkbl0o2ihgyQspH3mapqn7flrSE427O3TuKbwGZI/AlhuY9vltO08Belyw6T99lTnIQN2VmGeJqppskGhpfoW0DbVmuahaarVVQudGPZo3tH/RCOnfJbSbzp34D1T/VjsTL3X6esWFMJngJwDsCgnykX0P+mzQ1yyq9jqqtnzkGI0a7wgPz9pfJm+/6ZxB77bzus+7L7pkwdkarr8OBdwJee7jjQVaqZysVtDsuwK3j3lmGYnb5hwerW3S+PRl440OX3dh5vL7z0iXzXqY/bYbaZycXs/5KDdV/iUKc1URo7xcoOqq0yfui1Gq5e3EoUava1qzS/aJQGs8xKIj2jx+gCoVyGcoUBKGs8yIEgIAiliZEDwJAehL3ovIYS+2F9UDckyRH/fFhmoxuwTvdaJaCGc7+gyi9+br1YZSzTJEAIaffHrZG/JCFwDpK16JEsI5yK9uMdvzVe7zAUxZQrhXKKBwxqZkSikQ8aiZbnIFgKS4oea0i5bBhQJgQ+kKJEBhUJAUkqxo+cduJqVrQH8B6xBgBhvJFNDAAAAAElFTkSuQmCC',
 | 
			
		||||
            fit: 'none'
 | 
			
		||||
            }},
 | 
			
		||||
        ]),
 | 
			
		||||
        new hiprint.PrintElementTypeGroup("客户", [
 | 
			
		||||
          {
 | 
			
		||||
            tid: 'bProviderModule.khname', title: '客户名称', data: '高级客户', type: 'text',
 | 
			
		||||
            options: {
 | 
			
		||||
              field: 'name',
 | 
			
		||||
              testData: '高级客户',
 | 
			
		||||
              height: 16,
 | 
			
		||||
              fontSize: 6.75,
 | 
			
		||||
              fontWeight: "700",
 | 
			
		||||
              textAlign: "left",
 | 
			
		||||
              textContentVerticalAlign: "middle"
 | 
			
		||||
            }
 | 
			
		||||
          },
 | 
			
		||||
          {
 | 
			
		||||
            tid: 'bProviderModule.tel', title: '客户电话', data: '18888888888', type: 'text',
 | 
			
		||||
            options: {
 | 
			
		||||
              field: 'tel',
 | 
			
		||||
              testData: '18888888888',
 | 
			
		||||
              height: 16,
 | 
			
		||||
              fontSize: 6.75,
 | 
			
		||||
              fontWeight: "700",
 | 
			
		||||
              textAlign: "left",
 | 
			
		||||
              textContentVerticalAlign: "middle"
 | 
			
		||||
            }
 | 
			
		||||
          },
 | 
			
		||||
        ]),
 | 
			
		||||
        new hiprint.PrintElementTypeGroup("表格/其他", [
 | 
			
		||||
          {
 | 
			
		||||
            tid: 'bProviderModule.table', title: '订单数据',
 | 
			
		||||
            type: 'table',
 | 
			
		||||
            options: {
 | 
			
		||||
              field: 'table',
 | 
			
		||||
              fields: [
 | 
			
		||||
                {text: '名称', field: 'NAME'},
 | 
			
		||||
                {text: '数量', field: 'SL'},
 | 
			
		||||
                {text: '规格', field: 'GG'},
 | 
			
		||||
                {text: '条码', field: 'TM'},
 | 
			
		||||
                {text: '单价', field: 'DJ'},
 | 
			
		||||
                {text: '金额', field: 'JE'},
 | 
			
		||||
                {text: '备注', field: 'DETAIL'},
 | 
			
		||||
              ],
 | 
			
		||||
            },
 | 
			
		||||
            editable: true,
 | 
			
		||||
            columnDisplayEditable: true,//列显示是否能编辑
 | 
			
		||||
            columnDisplayIndexEditable: true,//列顺序显示是否能编辑
 | 
			
		||||
            columnTitleEditable: true,//列标题是否能编辑
 | 
			
		||||
            columnResizable: true, //列宽是否能调整
 | 
			
		||||
            columnAlignEditable: true,//列对齐是否调整
 | 
			
		||||
            columns: [
 | 
			
		||||
              [
 | 
			
		||||
                {title: '名称', align: 'center', field: 'NAME', width: 100},
 | 
			
		||||
                {title: '数量', align: 'center', field: 'SL', width: 100},
 | 
			
		||||
                {title: '条码', align: 'center', field: 'TM', width: 100},
 | 
			
		||||
                {title: '规格', align: 'center', field: 'GG', width: 100},
 | 
			
		||||
                {title: '单价', align: 'center', field: 'DJ', width: 100},
 | 
			
		||||
                {title: '金额', align: 'center', field: 'JE', width: 100},
 | 
			
		||||
                {title: '备注', align: 'center', field: 'DETAIL', width: 100},
 | 
			
		||||
              ]
 | 
			
		||||
            ],
 | 
			
		||||
            footerFormatter: function (options, rows, data, currentPageGridRowsData) {
 | 
			
		||||
              if (data && data['totalCap']) {
 | 
			
		||||
                return `<td style="padding:0 10px" colspan="100">${'应收金额大写: ' + data['totalCap']}</td>`
 | 
			
		||||
              }
 | 
			
		||||
              return '<td style="padding:0 10px" colspan="100">应收金额大写: </td>'
 | 
			
		||||
            },
 | 
			
		||||
          },
 | 
			
		||||
          {tid: 'bProviderModule.customText', title: '文本', customText: '自定义文本', custom: true, type: 'text'},
 | 
			
		||||
          {
 | 
			
		||||
            tid: 'bProviderModule.longText', title: '长文本', type: 'longText', options: {
 | 
			
		||||
              field: 'test.longText',
 | 
			
		||||
              width: 200,
 | 
			
		||||
              testData: '长文本分页/不分页测试'
 | 
			
		||||
            },
 | 
			
		||||
          }
 | 
			
		||||
        ]),
 | 
			
		||||
        new hiprint.PrintElementTypeGroup("辅助", [
 | 
			
		||||
          {
 | 
			
		||||
            tid: 'bProviderModule.hline',
 | 
			
		||||
            title: '横线',
 | 
			
		||||
            type: 'hline'
 | 
			
		||||
          },
 | 
			
		||||
          {
 | 
			
		||||
            tid: 'bProviderModule.vline',
 | 
			
		||||
            title: '竖线',
 | 
			
		||||
            type: 'vline'
 | 
			
		||||
          },
 | 
			
		||||
          {
 | 
			
		||||
            tid: 'bProviderModule.rect',
 | 
			
		||||
            title: '矩形',
 | 
			
		||||
            type: 'rect'
 | 
			
		||||
          },
 | 
			
		||||
          {
 | 
			
		||||
            tid: 'bProviderModule.oval',
 | 
			
		||||
            title: '椭圆',
 | 
			
		||||
            type: 'oval'
 | 
			
		||||
          }
 | 
			
		||||
        ])
 | 
			
		||||
      ]
 | 
			
		||||
    );
 | 
			
		||||
  };
 | 
			
		||||
  return {
 | 
			
		||||
    addElementTypes: addElementTypes
 | 
			
		||||
  };
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
// type: 1供货商 2经销商
 | 
			
		||||
export default [{
 | 
			
		||||
  name: 'A设计',
 | 
			
		||||
  value: 'aProviderModule',
 | 
			
		||||
  type: 1,
 | 
			
		||||
  f: aProvider()
 | 
			
		||||
}, {
 | 
			
		||||
  name: 'B设计',
 | 
			
		||||
  value: 'bProviderModule',
 | 
			
		||||
  type: 2,
 | 
			
		||||
  f: bProvider()
 | 
			
		||||
}]
 | 
			
		||||
 
 | 
			
		||||
@@ -16,7 +16,7 @@
 | 
			
		||||
				<el-form-item
 | 
			
		||||
					label="产线"
 | 
			
		||||
					prop="productionLineId"
 | 
			
		||||
					:rules="[{ required: true, message: '不能为空', trigger: 'blur' }]">
 | 
			
		||||
					:rules="[{ required: true, message: '产线不能为空', trigger: 'blur' }]">
 | 
			
		||||
					<el-select
 | 
			
		||||
						v-model="dataForm.productionLineId"
 | 
			
		||||
						placeholder="请选择产线"
 | 
			
		||||
@@ -35,7 +35,7 @@
 | 
			
		||||
				<el-form-item
 | 
			
		||||
					label="工段"
 | 
			
		||||
					prop="workshopSectionId"
 | 
			
		||||
					:rules="[{ required: true, message: '不能为空', trigger: 'blur' }]">
 | 
			
		||||
					:rules="[{ required: true, message: '工段不能为空', trigger: 'blur' }]">
 | 
			
		||||
					<el-select
 | 
			
		||||
						v-model="dataForm.workshopSectionId"
 | 
			
		||||
						filterable
 | 
			
		||||
@@ -55,7 +55,7 @@
 | 
			
		||||
				<el-form-item
 | 
			
		||||
					label="设备"
 | 
			
		||||
					prop="equipmentId"
 | 
			
		||||
					:rules="[{ required: true, message: '不能为空', trigger: 'blur' }]">
 | 
			
		||||
					:rules="[{ required: true, message: '设备不能为空', trigger: 'blur' }]">
 | 
			
		||||
					<el-select
 | 
			
		||||
						v-model="dataForm.equipmentId"
 | 
			
		||||
						filterable
 | 
			
		||||
 
 | 
			
		||||
@@ -176,7 +176,7 @@ export default {
 | 
			
		||||
						url: '/base/production-line/listAll',
 | 
			
		||||
						// prop: '__product_line', // __开头代表不传递给服务器
 | 
			
		||||
						prop: 'productionLineId', // 编辑接口返回的产线id,所以不能使用上面那种形式
 | 
			
		||||
						rules: [{ required: true, message: '不能为空', trigger: 'blur' }],
 | 
			
		||||
						rules: [{ required: true, message: '产线不能为空', trigger: 'blur' }],
 | 
			
		||||
					},
 | 
			
		||||
					{
 | 
			
		||||
						select: true,
 | 
			
		||||
@@ -185,7 +185,7 @@ export default {
 | 
			
		||||
						// depends: '__product_line', // 依赖产线获取数据
 | 
			
		||||
						depends: 'productionLineId',
 | 
			
		||||
						prop: 'workshopSectionId',
 | 
			
		||||
						rules: [{ required: true, message: '不能为空', trigger: 'blur' }],
 | 
			
		||||
						rules: [{ required: true, message: '工段不能为空', trigger: 'blur' }],
 | 
			
		||||
					},
 | 
			
		||||
				],
 | 
			
		||||
				[
 | 
			
		||||
@@ -194,7 +194,7 @@ export default {
 | 
			
		||||
						label: '设备',
 | 
			
		||||
						url: '/base/core-equipment/page?pageNo=1&pageSize=100',
 | 
			
		||||
						prop: 'equipmentId',
 | 
			
		||||
						rules: [{ required: true, message: '不能为空', trigger: 'blur' }],
 | 
			
		||||
						rules: [{ required: true, message: '设备不能为空', trigger: 'blur' }],
 | 
			
		||||
					},
 | 
			
		||||
					{
 | 
			
		||||
						input: true,
 | 
			
		||||
 
 | 
			
		||||
@@ -16,36 +16,20 @@
 | 
			
		||||
				<el-form-item
 | 
			
		||||
					label="报警编码"
 | 
			
		||||
					prop="code"
 | 
			
		||||
					:rules="[{ required: true, message: '不能为空', trigger: 'blur' }]">
 | 
			
		||||
					:rules="[{ required: true, message: '报警编码不能为空', trigger: 'blur' }]">
 | 
			
		||||
					<el-input
 | 
			
		||||
						:disabled="disabled"
 | 
			
		||||
						v-model="dataForm.code"
 | 
			
		||||
						@change="$emit('update', dataForm)"
 | 
			
		||||
						placeholder="请输入工段排序" />
 | 
			
		||||
				</el-form-item>
 | 
			
		||||
				<!-- 				
 | 
			
		||||
						<el-form-item
 | 
			
		||||
						label="报警编码"
 | 
			
		||||
						prop="code"
 | 
			
		||||
						:rules="[{ required: true, message: '不能为空', trigger: 'blur' }]">
 | 
			
		||||
						<el-select
 | 
			
		||||
						v-model="dataForm.code"
 | 
			
		||||
						placeholder="请选择产线"
 | 
			
		||||
						@change="handleProductlineChange">
 | 
			
		||||
						<el-option
 | 
			
		||||
						v-for="opt in productionLineList"
 | 
			
		||||
						:key="opt.value"
 | 
			
		||||
						:label="opt.label"
 | 
			
		||||
						:value="opt.value" />
 | 
			
		||||
					</el-select>
 | 
			
		||||
				</el-form-item> -->
 | 
			
		||||
			</el-col>
 | 
			
		||||
 | 
			
		||||
			<el-col :span="12">
 | 
			
		||||
				<el-form-item
 | 
			
		||||
					label="报警类型"
 | 
			
		||||
					prop="type"
 | 
			
		||||
					:rules="[{ required: true, message: '不能为空', trigger: 'blur' }]">
 | 
			
		||||
					:rules="[{ required: true, message: '报警类型不能为空', trigger: 'blur' }]">
 | 
			
		||||
					<el-select
 | 
			
		||||
						v-model="dataForm.type"
 | 
			
		||||
						:disabled="disabled"
 | 
			
		||||
@@ -68,7 +52,7 @@
 | 
			
		||||
				<el-form-item
 | 
			
		||||
					label="报警级别"
 | 
			
		||||
					prop="grade"
 | 
			
		||||
					:rules="[{ required: true, message: '不能为空', trigger: 'blur' }]">
 | 
			
		||||
					:rules="[{ required: true, message: '报警级别不能为空', trigger: 'blur' }]">
 | 
			
		||||
					<el-select
 | 
			
		||||
						:disabled="disabled"
 | 
			
		||||
						v-model="dataForm.grade"
 | 
			
		||||
@@ -101,7 +85,7 @@
 | 
			
		||||
				<el-form-item
 | 
			
		||||
					label="参数列名"
 | 
			
		||||
					prop="plcParamName"
 | 
			
		||||
					:rules="[{ required: true, message: '不能为空', trigger: 'blur' }]">
 | 
			
		||||
					:rules="[{ required: true, message: '参数列名不能为空', trigger: 'blur' }]">
 | 
			
		||||
					<el-input
 | 
			
		||||
						:disabled="disabled"
 | 
			
		||||
						v-model="dataForm.plcParamName"
 | 
			
		||||
@@ -113,7 +97,7 @@
 | 
			
		||||
				<el-form-item
 | 
			
		||||
					label="报警内容"
 | 
			
		||||
					prop="alarmContent"
 | 
			
		||||
					:rules="[{ required: true, message: '不能为空', trigger: 'blur' }]">
 | 
			
		||||
					:rules="[{ required: true, message: '报警内容不能为空', trigger: 'blur' }]">
 | 
			
		||||
					<el-input
 | 
			
		||||
						:disabled="disabled"
 | 
			
		||||
						v-model="dataForm.alarmContent"
 | 
			
		||||
 
 | 
			
		||||
@@ -137,7 +137,7 @@ export default {
 | 
			
		||||
						label: '报警编码', // 自动生成
 | 
			
		||||
						prop: 'code',
 | 
			
		||||
						url: '/base/equipment-group-alarm/getCode',
 | 
			
		||||
						rules: [{ required: true, message: '不能为空', trigger: 'blur' }],
 | 
			
		||||
						rules: [{ required: true, message: '报警编码不能为空', trigger: 'blur' }],
 | 
			
		||||
					},
 | 
			
		||||
					{
 | 
			
		||||
						select: true,
 | 
			
		||||
@@ -147,7 +147,7 @@ export default {
 | 
			
		||||
							{ label: '布尔型', value: 2 },
 | 
			
		||||
							{ label: '字符型', value: 1 },
 | 
			
		||||
						],
 | 
			
		||||
						rules: [{ required: true, message: '不能为空', trigger: 'blur' }],
 | 
			
		||||
						rules: [{ required: true, message: '报警类型不能为空', trigger: 'blur' }],
 | 
			
		||||
					},
 | 
			
		||||
				],
 | 
			
		||||
				[
 | 
			
		||||
@@ -168,13 +168,13 @@ export default {
 | 
			
		||||
						input: true,
 | 
			
		||||
						label: '参数列名', // 在实时数据库的列名
 | 
			
		||||
						prop: 'plcParamName',
 | 
			
		||||
						rules: [{ required: true, message: '不能为空', trigger: 'blur' }],
 | 
			
		||||
						rules: [{ required: true, message: '参数列名不能为空', trigger: 'blur' }],
 | 
			
		||||
					},
 | 
			
		||||
					{
 | 
			
		||||
						input: true,
 | 
			
		||||
						label: '报警内容',
 | 
			
		||||
						prop: 'alarmContent',
 | 
			
		||||
						rules: [{ required: true, message: '不能为空', trigger: 'blur' }],
 | 
			
		||||
						rules: [{ required: true, message: '报警内容不能为空', trigger: 'blur' }],
 | 
			
		||||
					},
 | 
			
		||||
				],
 | 
			
		||||
			],
 | 
			
		||||
 
 | 
			
		||||
@@ -177,7 +177,7 @@ export default {
 | 
			
		||||
						input: true,
 | 
			
		||||
						label: '关联表名',
 | 
			
		||||
						prop: 'plcTableName',
 | 
			
		||||
						rules: [{ required: true, message: '不能为空', trigger: 'blur' }],
 | 
			
		||||
						rules: [{ required: true, message: '关联表名不能为空', trigger: 'blur' }],
 | 
			
		||||
						// bind: {
 | 
			
		||||
						// 	disabled: true, // some condition, like detail mode...
 | 
			
		||||
						// }
 | 
			
		||||
@@ -187,7 +187,7 @@ export default {
 | 
			
		||||
						label: '编码',
 | 
			
		||||
						prop: 'code',
 | 
			
		||||
						url: '/base/equipment-group/getCode',
 | 
			
		||||
						rules: [{ required: true, message: '不能为空', trigger: 'blur' }],
 | 
			
		||||
						rules: [{ required: true, message: '编码不能为空', trigger: 'blur' }],
 | 
			
		||||
					},
 | 
			
		||||
				],
 | 
			
		||||
				[
 | 
			
		||||
@@ -195,7 +195,7 @@ export default {
 | 
			
		||||
						input: true,
 | 
			
		||||
						label: '标识',
 | 
			
		||||
						prop: 'name',
 | 
			
		||||
						rules: [{ required: true, message: '不能为空', trigger: 'blur' }],
 | 
			
		||||
						rules: [{ required: true, message: '标识不能为空', trigger: 'blur' }],
 | 
			
		||||
						// bind: {
 | 
			
		||||
						// 	disabled: true, // some condition, like detail mode...
 | 
			
		||||
						// }
 | 
			
		||||
 
 | 
			
		||||
@@ -166,13 +166,17 @@ export default {
 | 
			
		||||
						input: true,
 | 
			
		||||
						label: '参数列名',
 | 
			
		||||
						prop: 'plcParamName',
 | 
			
		||||
						rules: [{ required: true, message: '不能为空', trigger: 'blur' }],
 | 
			
		||||
						rules: [
 | 
			
		||||
							{ required: true, message: '参数列名不能为空', trigger: 'blur' },
 | 
			
		||||
						],
 | 
			
		||||
					},
 | 
			
		||||
					{
 | 
			
		||||
						input: true,
 | 
			
		||||
						label: '参数名称',
 | 
			
		||||
						prop: 'name',
 | 
			
		||||
						rules: [{ required: true, message: '不能为空', trigger: 'blur' }],
 | 
			
		||||
						rules: [
 | 
			
		||||
							{ required: true, message: '参数名称不能为空', trigger: 'blur' },
 | 
			
		||||
						],
 | 
			
		||||
					},
 | 
			
		||||
				],
 | 
			
		||||
				[
 | 
			
		||||
@@ -181,7 +185,6 @@ export default {
 | 
			
		||||
						label: '单位',
 | 
			
		||||
						prop: 'unit',
 | 
			
		||||
						options: this.getDictDatas(this.DICT_TYPE.UNIT_DICT),
 | 
			
		||||
						// rules: [{ required: true, message: '不能为空', trigger: 'blur' }],
 | 
			
		||||
					},
 | 
			
		||||
					{
 | 
			
		||||
						switch: true,
 | 
			
		||||
@@ -222,7 +225,6 @@ export default {
 | 
			
		||||
								transform: (val) => Number(val),
 | 
			
		||||
							},
 | 
			
		||||
						],
 | 
			
		||||
						// rules: [{ required: true, message: '不能为空', trigger: 'blur' }],
 | 
			
		||||
					},
 | 
			
		||||
				],
 | 
			
		||||
				[
 | 
			
		||||
@@ -230,13 +232,11 @@ export default {
 | 
			
		||||
						input: true,
 | 
			
		||||
						label: '标准值',
 | 
			
		||||
						prop: 'defaultValue',
 | 
			
		||||
						// rules: [{ required: true, message: '不能为空', trigger: 'blur' }],
 | 
			
		||||
					},
 | 
			
		||||
					{
 | 
			
		||||
						input: true,
 | 
			
		||||
						label: '描述',
 | 
			
		||||
						prop: 'description',
 | 
			
		||||
						// rules: [{ required: true, message: '不能为空', trigger: 'blur' }],
 | 
			
		||||
					},
 | 
			
		||||
				],
 | 
			
		||||
				[
 | 
			
		||||
@@ -244,7 +244,6 @@ export default {
 | 
			
		||||
						input: true,
 | 
			
		||||
						label: '备注',
 | 
			
		||||
						prop: 'remark',
 | 
			
		||||
						// rules: [{ required: true, message: '不能为空', trigger: 'blur' }],
 | 
			
		||||
					},
 | 
			
		||||
				],
 | 
			
		||||
			],
 | 
			
		||||
@@ -424,12 +423,11 @@ export default {
 | 
			
		||||
		},
 | 
			
		||||
 | 
			
		||||
		// 提交属性表
 | 
			
		||||
		async submitAttrForm() {
 | 
			
		||||
			this.$refs['attrForm'].validate((valid) => {
 | 
			
		||||
		submitAttrForm() {
 | 
			
		||||
			this.$refs['attrForm'].validate(async (valid) => {
 | 
			
		||||
				if (!valid) {
 | 
			
		||||
					return;
 | 
			
		||||
				}
 | 
			
		||||
			});
 | 
			
		||||
				const isEdit = this.attrForm.id != null;
 | 
			
		||||
				this.attrFormSubmitting = true;
 | 
			
		||||
				const res = await this.$axios({
 | 
			
		||||
@@ -437,7 +435,7 @@ export default {
 | 
			
		||||
					method: isEdit ? 'put' : 'post',
 | 
			
		||||
					data: {
 | 
			
		||||
						...this.attrForm,
 | 
			
		||||
					connectId: this.infoData.id
 | 
			
		||||
						connectId: this.infoData.id,
 | 
			
		||||
					},
 | 
			
		||||
				});
 | 
			
		||||
 | 
			
		||||
@@ -453,6 +451,7 @@ export default {
 | 
			
		||||
					});
 | 
			
		||||
				}
 | 
			
		||||
				this.attrFormSubmitting = false;
 | 
			
		||||
			});
 | 
			
		||||
		},
 | 
			
		||||
 | 
			
		||||
		closeAttrForm() {
 | 
			
		||||
 
 | 
			
		||||
@@ -236,7 +236,7 @@ export default {
 | 
			
		||||
						prop: 'plcId',
 | 
			
		||||
						labelKey: `plcTableName`,
 | 
			
		||||
						url: '/base/equipment-plc/listAll',
 | 
			
		||||
						rules: [{ required: true, message: '不能为空', trigger: 'blur' }],
 | 
			
		||||
						rules: [{ required: true, message: '关联表名不能为空', trigger: 'blur' }],
 | 
			
		||||
						bind: {
 | 
			
		||||
							filterable: true,
 | 
			
		||||
						},
 | 
			
		||||
@@ -248,7 +248,7 @@ export default {
 | 
			
		||||
						label: '设备',
 | 
			
		||||
						prop: 'equipmentId',
 | 
			
		||||
						url: '/base/core-equipment/page?pageNo=1&pageSize=99',
 | 
			
		||||
						rules: [{ required: true, message: '不能为空', trigger: 'blur' }],
 | 
			
		||||
						rules: [{ required: true, message: '设备不能为空', trigger: 'blur' }],
 | 
			
		||||
						bind: {
 | 
			
		||||
							filterable: true,
 | 
			
		||||
						},
 | 
			
		||||
@@ -274,7 +274,7 @@ export default {
 | 
			
		||||
						input: true,
 | 
			
		||||
						label: '设备名',
 | 
			
		||||
						prop: 'equipmentName',
 | 
			
		||||
						rules: [{ required: true, message: '不能为空', trigger: 'blur' }],
 | 
			
		||||
						rules: [{ required: true, message: '设备名不能为空', trigger: 'blur' }],
 | 
			
		||||
						// bind: {
 | 
			
		||||
						// 	disabled: this.editMode == 'detail', // some condition, like detail mode...
 | 
			
		||||
						// }
 | 
			
		||||
 
 | 
			
		||||
@@ -120,13 +120,13 @@ export default {
 | 
			
		||||
						input: true,
 | 
			
		||||
						label: '参数列名',
 | 
			
		||||
						prop: 'plcParamName',
 | 
			
		||||
						rules: [{ required: true, message: '不能为空', trigger: 'blur' }],
 | 
			
		||||
						rules: [{ required: true, message: '参数列名不能为空', trigger: 'blur' }],
 | 
			
		||||
					},
 | 
			
		||||
					{
 | 
			
		||||
						input: true,
 | 
			
		||||
						label: '参数名称',
 | 
			
		||||
						prop: 'name',
 | 
			
		||||
						rules: [{ required: true, message: '不能为空', trigger: 'blur' }],
 | 
			
		||||
						rules: [{ required: true, message: '参数名称不能为空', trigger: 'blur' }],
 | 
			
		||||
					},
 | 
			
		||||
				],
 | 
			
		||||
				[
 | 
			
		||||
@@ -135,7 +135,6 @@ export default {
 | 
			
		||||
						label: '单位',
 | 
			
		||||
						prop: 'unit',
 | 
			
		||||
						options: this.getDictDatas(this.DICT_TYPE.UNIT_DICT),
 | 
			
		||||
						// rules: [{ required: true, message: '不能为空', trigger: 'blur' }],
 | 
			
		||||
					},
 | 
			
		||||
					{
 | 
			
		||||
						switch: true,
 | 
			
		||||
@@ -176,7 +175,6 @@ export default {
 | 
			
		||||
								transform: (val) => Number(val),
 | 
			
		||||
							},
 | 
			
		||||
						],
 | 
			
		||||
						// rules: [{ required: true, message: '不能为空', trigger: 'blur' }],
 | 
			
		||||
					},
 | 
			
		||||
				],
 | 
			
		||||
				[
 | 
			
		||||
@@ -184,13 +182,11 @@ export default {
 | 
			
		||||
						input: true,
 | 
			
		||||
						label: '标准值',
 | 
			
		||||
						prop: 'defaultValue',
 | 
			
		||||
						// rules: [{ required: true, message: '不能为空', trigger: 'blur' }],
 | 
			
		||||
					},
 | 
			
		||||
					{
 | 
			
		||||
						input: true,
 | 
			
		||||
						label: '描述',
 | 
			
		||||
						prop: 'description',
 | 
			
		||||
						// rules: [{ required: true, message: '不能为空', trigger: 'blur' }],
 | 
			
		||||
					},
 | 
			
		||||
				],
 | 
			
		||||
				[
 | 
			
		||||
@@ -198,7 +194,6 @@ export default {
 | 
			
		||||
						input: true,
 | 
			
		||||
						label: '备注',
 | 
			
		||||
						prop: 'remark',
 | 
			
		||||
						// rules: [{ required: true, message: '不能为空', trigger: 'blur' }],
 | 
			
		||||
					},
 | 
			
		||||
				],
 | 
			
		||||
			],
 | 
			
		||||
 
 | 
			
		||||
@@ -2,14 +2,14 @@
 | 
			
		||||
 * @Author: zwq
 | 
			
		||||
 * @Date: 2021-11-18 14:16:25
 | 
			
		||||
 * @LastEditors: DY
 | 
			
		||||
 * @LastEditTime: 2023-11-06 19:44:24
 | 
			
		||||
 * @LastEditTime: 2023-11-27 15:26:12
 | 
			
		||||
 * @Description:
 | 
			
		||||
-->
 | 
			
		||||
<template>
 | 
			
		||||
	<el-drawer
 | 
			
		||||
		:visible.sync="visible"
 | 
			
		||||
		:show-close="false"
 | 
			
		||||
		:wrapper-closable="false"
 | 
			
		||||
		:wrapper-closable="isdetail"
 | 
			
		||||
		class="drawer"
 | 
			
		||||
		size="60%">
 | 
			
		||||
		<small-title slot="title" :no-padding="true">
 | 
			
		||||
@@ -120,6 +120,7 @@
 | 
			
		||||
					</el-row>
 | 
			
		||||
				</el-form>
 | 
			
		||||
			</div>
 | 
			
		||||
			
 | 
			
		||||
			<div class="attr-list" v-if="idAttrShow">
 | 
			
		||||
				<small-title
 | 
			
		||||
					style="margin: 16px 0; padding-left: 8px"
 | 
			
		||||
@@ -127,12 +128,17 @@
 | 
			
		||||
					物料属性
 | 
			
		||||
				</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"
 | 
			
		||||
					:add-button-show="isdetail ? null : '添加属性'"
 | 
			
		||||
					@emitButtonClick="addNew()"
 | 
			
		||||
					:table-data="materialAttrList">
 | 
			
		||||
					<method-btn
 | 
			
		||||
						v-if="!isdetail"
 | 
			
		||||
@@ -151,13 +157,11 @@
 | 
			
		||||
					@pagination="getList" />
 | 
			
		||||
			</div>
 | 
			
		||||
 | 
			
		||||
			<div class="drawer-body__footer">
 | 
			
		||||
			<div v-if="!isdetail" 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>
 | 
			
		||||
				<el-button type="primary" @click="dataFormSubmit()">确定</el-button>
 | 
			
		||||
			</div>
 | 
			
		||||
 | 
			
		||||
		</div>
 | 
			
		||||
 | 
			
		||||
		<attr-add
 | 
			
		||||
@@ -288,11 +292,7 @@ export default {
 | 
			
		||||
		handleClick(raw) {
 | 
			
		||||
			if (raw.type === 'delete') {
 | 
			
		||||
				this.$confirm(
 | 
			
		||||
					`确定对${
 | 
			
		||||
						raw.data.attrName
 | 
			
		||||
							? '[名称=' + raw.data.attrName + ']'
 | 
			
		||||
							: '[序号=' + raw.data._pageIndex + ']'
 | 
			
		||||
					}进行删除操作?`,
 | 
			
		||||
					`是否确认删除属性名为"${raw.data.attrName}"的数据项?`,
 | 
			
		||||
					'提示',
 | 
			
		||||
					{
 | 
			
		||||
						confirmButtonText: '确定',
 | 
			
		||||
@@ -357,6 +357,29 @@ export default {
 | 
			
		||||
          }
 | 
			
		||||
				}
 | 
			
		||||
			});
 | 
			
		||||
		},
 | 
			
		||||
		// 表单提交
 | 
			
		||||
    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.idAttrShow = true
 | 
			
		||||
          this.$emit("refreshDataList");
 | 
			
		||||
        });
 | 
			
		||||
      });
 | 
			
		||||
    },
 | 
			
		||||
		goback() {
 | 
			
		||||
			this.$emit('refreshDataList');
 | 
			
		||||
@@ -425,4 +448,12 @@ export default {
 | 
			
		||||
	justify-content: flex-end;
 | 
			
		||||
	padding: 18px;
 | 
			
		||||
}
 | 
			
		||||
.action_btn {
 | 
			
		||||
  float: right;
 | 
			
		||||
  margin: -40px 15px;
 | 
			
		||||
  font-size: 14px;
 | 
			
		||||
}
 | 
			
		||||
.add {
 | 
			
		||||
	color: #0b58ff;
 | 
			
		||||
}
 | 
			
		||||
</style>
 | 
			
		||||
 
 | 
			
		||||
@@ -1,7 +1,7 @@
 | 
			
		||||
<template>
 | 
			
		||||
	<el-dialog
 | 
			
		||||
		:visible.sync="visible"
 | 
			
		||||
		:width="'35%'"
 | 
			
		||||
		:width="'30%'"
 | 
			
		||||
		:append-to-body="true"
 | 
			
		||||
		:close-on-click-modal="false"
 | 
			
		||||
		class="dialog">
 | 
			
		||||
@@ -17,7 +17,7 @@
 | 
			
		||||
			ref="dataForm"
 | 
			
		||||
			:model="dataForm"
 | 
			
		||||
			:rules="dataRule"
 | 
			
		||||
			label-width="100px"
 | 
			
		||||
			label-width="70px"
 | 
			
		||||
			@keyup.enter.native="dataFormSubmit()">
 | 
			
		||||
			<el-form-item label="属性名" prop="attrName">
 | 
			
		||||
				<el-input
 | 
			
		||||
 
 | 
			
		||||
@@ -13,7 +13,7 @@
 | 
			
		||||
			<method-btn
 | 
			
		||||
				v-if="tableBtn.length"
 | 
			
		||||
				slot="handleBtn"
 | 
			
		||||
				:width="220"
 | 
			
		||||
				:width="120"
 | 
			
		||||
				label="操作"
 | 
			
		||||
				:method-list="tableBtn"
 | 
			
		||||
				@clickBtn="handleClick" />
 | 
			
		||||
@@ -39,6 +39,7 @@ import {
 | 
			
		||||
	deleteMaterial
 | 
			
		||||
} from '@/api/base/material';
 | 
			
		||||
import { listData } from "@/api/system/dict/data";
 | 
			
		||||
import { publicFormatter } from '@/utils/dict';
 | 
			
		||||
 | 
			
		||||
const tableProps = [
 | 
			
		||||
	{
 | 
			
		||||
@@ -59,8 +60,9 @@ const tableProps = [
 | 
			
		||||
		label: '英文名称'
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'materialType',
 | 
			
		||||
		label: '物料类型'
 | 
			
		||||
		prop: 'type',
 | 
			
		||||
		label: '物料类型',
 | 
			
		||||
		filter: publicFormatter('material_type')
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'supplierName',
 | 
			
		||||
@@ -83,24 +85,24 @@ export default {
 | 
			
		||||
			},
 | 
			
		||||
			tableProps,
 | 
			
		||||
			tableBtn: [
 | 
			
		||||
				this.$auth.hasPermi(`base:material:queryAttr`)
 | 
			
		||||
					? {
 | 
			
		||||
							type: 'detail',
 | 
			
		||||
							btnName: '查看属性',
 | 
			
		||||
					  }
 | 
			
		||||
					: undefined,
 | 
			
		||||
				this.$auth.hasPermi(`base:material:update`)
 | 
			
		||||
					? {
 | 
			
		||||
							type: 'edit',
 | 
			
		||||
							btnName: '编辑',
 | 
			
		||||
					  }
 | 
			
		||||
					: undefined,
 | 
			
		||||
					this.$auth.hasPermi(`base:material:queryAttr`)
 | 
			
		||||
					? {
 | 
			
		||||
							type: 'search',
 | 
			
		||||
							btnName: '查看属性',
 | 
			
		||||
					  }
 | 
			
		||||
					: undefined,
 | 
			
		||||
					this.$auth.hasPermi(`base:material:editAttr`)
 | 
			
		||||
					? {
 | 
			
		||||
							type: 'editAttr',
 | 
			
		||||
							btnName: '编辑属性',
 | 
			
		||||
					  }
 | 
			
		||||
					: undefined,
 | 
			
		||||
					// this.$auth.hasPermi(`base:material:editAttr`)
 | 
			
		||||
					// ? {
 | 
			
		||||
					// 		type: 'editAttr',
 | 
			
		||||
					// 		btnName: '编辑属性',
 | 
			
		||||
					//   }
 | 
			
		||||
					// : undefined,
 | 
			
		||||
        this.$auth.hasPermi(`base:material:delete`)
 | 
			
		||||
					? {
 | 
			
		||||
							type: 'delete',
 | 
			
		||||
@@ -134,7 +136,7 @@ export default {
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					type: this.$auth.hasPermi('base:material:create') ? 'button' : '',
 | 
			
		||||
					btnName: '新增物料',
 | 
			
		||||
					btnName: '新增',
 | 
			
		||||
					name: 'add',
 | 
			
		||||
					color: 'success',
 | 
			
		||||
					plain: true
 | 
			
		||||
@@ -164,7 +166,7 @@ export default {
 | 
			
		||||
			});
 | 
			
		||||
		},
 | 
			
		||||
		otherMethods(val) {
 | 
			
		||||
			if (val.type === 'search') {
 | 
			
		||||
			if (val.type === 'detail') {
 | 
			
		||||
				this.addOrUpdateVisible = true;
 | 
			
		||||
				this.addOrEditTitle = '详情';
 | 
			
		||||
				this.$nextTick(() => {
 | 
			
		||||
 
 | 
			
		||||
@@ -2,7 +2,7 @@
 | 
			
		||||
 * @Author: zwq
 | 
			
		||||
 * @Date: 2021-11-18 14:16:25
 | 
			
		||||
 * @LastEditors: DY
 | 
			
		||||
 * @LastEditTime: 2023-11-06 19:55:59
 | 
			
		||||
 * @LastEditTime: 2023-11-27 15:10:20
 | 
			
		||||
 * @Description:
 | 
			
		||||
-->
 | 
			
		||||
<template>
 | 
			
		||||
@@ -18,7 +18,8 @@
 | 
			
		||||
					<el-select
 | 
			
		||||
						v-model="dataForm.materialId"
 | 
			
		||||
						placeholder="请选择物料"
 | 
			
		||||
						@change="setMaterialCode">
 | 
			
		||||
						@change="setMaterialCode"
 | 
			
		||||
						style="width: 100%">
 | 
			
		||||
						<el-option
 | 
			
		||||
							v-for="dict in materialList"
 | 
			
		||||
							:key="dict.id"
 | 
			
		||||
 
 | 
			
		||||
@@ -29,7 +29,7 @@
 | 
			
		||||
			@cancel="handleCancel"
 | 
			
		||||
			@confirm="handleConfirm"
 | 
			
		||||
			:before-close="handleCancel"
 | 
			
		||||
			width="50%">
 | 
			
		||||
			width="40%">
 | 
			
		||||
			<add-or-update
 | 
			
		||||
				ref="addOrUpdate"
 | 
			
		||||
				@refreshDataList="successSubmit"></add-or-update>
 | 
			
		||||
 
 | 
			
		||||
@@ -2,14 +2,14 @@
 | 
			
		||||
 * @Author: zwq
 | 
			
		||||
 * @Date: 2021-11-18 14:16:25
 | 
			
		||||
 * @LastEditors: DY
 | 
			
		||||
 * @LastEditTime: 2023-11-06 20:04:03
 | 
			
		||||
 * @LastEditTime: 2023-11-27 19:50:36
 | 
			
		||||
 * @Description:
 | 
			
		||||
-->
 | 
			
		||||
<template>
 | 
			
		||||
	<el-drawer
 | 
			
		||||
		:visible.sync="visible"
 | 
			
		||||
		:show-close="false"
 | 
			
		||||
		:wrapper-closable="false"
 | 
			
		||||
		:wrapper-closable="isdetail"
 | 
			
		||||
		class="drawer"
 | 
			
		||||
		size="70%">
 | 
			
		||||
		<small-title slot="title" :no-padding="true">
 | 
			
		||||
@@ -25,7 +25,7 @@
 | 
			
		||||
					label-width="100px"
 | 
			
		||||
					label-position="top">
 | 
			
		||||
					<el-row :gutter="20">
 | 
			
		||||
						<el-col :span="12">
 | 
			
		||||
						<el-col :span="8">
 | 
			
		||||
							<el-form-item label="产品名称" prop="productId">
 | 
			
		||||
								<el-select
 | 
			
		||||
									v-model="dataForm.productId"
 | 
			
		||||
@@ -42,15 +42,17 @@
 | 
			
		||||
								</el-select>
 | 
			
		||||
							</el-form-item>
 | 
			
		||||
						</el-col>
 | 
			
		||||
						<el-col :span="12">
 | 
			
		||||
						<el-col :span="8">
 | 
			
		||||
							<el-form-item label="产品BOM编码" prop="code">
 | 
			
		||||
								<el-input v-model="dataForm.code" disabled placeholder="请输入产品Bom编码" />
 | 
			
		||||
								<el-input v-model="dataForm.code" :disabled="isdetail" placeholder="请输入产品Bom编码" />
 | 
			
		||||
							</el-form-item>
 | 
			
		||||
						</el-col>
 | 
			
		||||
					</el-row>
 | 
			
		||||
						<el-col :span="8">
 | 
			
		||||
							<el-form-item label="备注" prop="remark">
 | 
			
		||||
								<el-input v-model="dataForm.remark" :disabled="isdetail" clearable placeholder="请输入备注" />
 | 
			
		||||
							</el-form-item>
 | 
			
		||||
						</el-col>
 | 
			
		||||
					</el-row>
 | 
			
		||||
				</el-form>
 | 
			
		||||
			</div>
 | 
			
		||||
			<div class="attr-list" v-if="idAttrShow">
 | 
			
		||||
@@ -60,90 +62,26 @@
 | 
			
		||||
					BOM明细
 | 
			
		||||
				</small-title>
 | 
			
		||||
 | 
			
		||||
				<!-- <base-table
 | 
			
		||||
				<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"
 | 
			
		||||
					:add-button-show="isdetail ? null : '添加属性'"
 | 
			
		||||
					@emitButtonClick="addNew()"
 | 
			
		||||
					:table-data="materialAttrList">
 | 
			
		||||
					:table-data="tableData">
 | 
			
		||||
					<method-btn
 | 
			
		||||
						v-if="!isdetail"
 | 
			
		||||
						slot="handleBtn"
 | 
			
		||||
						:width="120"
 | 
			
		||||
						:width="90"
 | 
			
		||||
						label="操作"
 | 
			
		||||
						:method-list="tableBtn"
 | 
			
		||||
						@clickBtn="handleClick" />
 | 
			
		||||
				</base-table> -->
 | 
			
		||||
				<el-button v-show="!isdetail" type="success" size="small" style="float: right" @click="addRow()">添加一行</el-button>
 | 
			
		||||
				<el-table
 | 
			
		||||
					:data="tableData"
 | 
			
		||||
      		style="width: 100%">
 | 
			
		||||
					<el-table-column type="index" label="序号" />
 | 
			
		||||
					<el-table-column prop="createTime" label="添加时间">
 | 
			
		||||
						<template slot-scope="scope">
 | 
			
		||||
							<span>{{ parseTime(scope.row.createTime) }}</span>
 | 
			
		||||
						</template>
 | 
			
		||||
					</el-table-column>
 | 
			
		||||
					<el-table-column prop="materialId" label="物料名称">
 | 
			
		||||
						<template slot-scope="scope">
 | 
			
		||||
							<el-select
 | 
			
		||||
									v-model="scope.row.materialId"
 | 
			
		||||
									filterable
 | 
			
		||||
									clearable
 | 
			
		||||
									:disabled="!scope.row.isEdit"
 | 
			
		||||
									placeholder="请选择物料"
 | 
			
		||||
									@change="setCode(scope.row)">
 | 
			
		||||
									<el-option
 | 
			
		||||
										v-for="dict in materialList"
 | 
			
		||||
										:key="dict.id"
 | 
			
		||||
										:label="dict.name"
 | 
			
		||||
										:value="dict.id" />
 | 
			
		||||
								</el-select>
 | 
			
		||||
						</template>
 | 
			
		||||
					</el-table-column>
 | 
			
		||||
					<el-table-column prop="materialCode" label="物料编码" />
 | 
			
		||||
					<el-table-column prop="mUnit" label="单位" />
 | 
			
		||||
					<el-table-column prop="num" label="数量">
 | 
			
		||||
						<template slot-scope="scope">
 | 
			
		||||
							<el-input v-model="scope.row.num" :disabled="!scope.row.isEdit"></el-input>
 | 
			
		||||
						</template>
 | 
			
		||||
					</el-table-column>
 | 
			
		||||
					<el-table-column prop="remark" label="备注">
 | 
			
		||||
						<template slot-scope="scope">
 | 
			
		||||
							<el-input v-model="scope.row.remark" :disabled="!scope.row.isEdit"></el-input>
 | 
			
		||||
						</template>
 | 
			
		||||
					</el-table-column>
 | 
			
		||||
					<el-table-column v-if="!isdetail" label="操作">
 | 
			
		||||
						<template slot-scope="scope">
 | 
			
		||||
							<el-tooltip v-if="!scope.row.isEdit" placement="top" content="编辑">
 | 
			
		||||
								<el-button
 | 
			
		||||
									type="text"
 | 
			
		||||
									:style="{color:'#0B58FF'}"
 | 
			
		||||
									size="mini"
 | 
			
		||||
									@click="edit(scope.row)"
 | 
			
		||||
								>
 | 
			
		||||
									<!-- 此处的icon的名字命名为'table_'加上按钮的type -->
 | 
			
		||||
									<svg-icon style="width: 18px; height: 18px" class="item-icon" icon-class="edit" />
 | 
			
		||||
									<!-- <span>{{ item.btnName | i18nFilter }}</span> -->
 | 
			
		||||
								</el-button>
 | 
			
		||||
							</el-tooltip>
 | 
			
		||||
							<el-button v-else type="text" size="small" @click="saveData(scope.row)">保存</el-button>
 | 
			
		||||
							<el-tooltip placement="top" content="删除">
 | 
			
		||||
								<el-button
 | 
			
		||||
									type="text"
 | 
			
		||||
									:style="{color:'#FF5454'}"
 | 
			
		||||
									size="mini"
 | 
			
		||||
									@click="deleteDetail(scope.row)"
 | 
			
		||||
								>
 | 
			
		||||
									<!-- 此处的icon的名字命名为'table_'加上按钮的type -->
 | 
			
		||||
									<svg-icon style="width: 18px; height: 18px" class="item-icon" icon-class="table_delete" />
 | 
			
		||||
									<!-- <span>{{ item.btnName | i18nFilter }}</span> -->
 | 
			
		||||
								</el-button>
 | 
			
		||||
							</el-tooltip>
 | 
			
		||||
						</template>
 | 
			
		||||
					</el-table-column>
 | 
			
		||||
				</el-table>
 | 
			
		||||
				</base-table>
 | 
			
		||||
				<pagination
 | 
			
		||||
					v-show="listQuery.total > 0"
 | 
			
		||||
					:total="listQuery.total"
 | 
			
		||||
@@ -153,20 +91,17 @@
 | 
			
		||||
					@pagination="getList" />
 | 
			
		||||
			</div>
 | 
			
		||||
 | 
			
		||||
			<div class="drawer-body__footer">
 | 
			
		||||
			<div v-if="!isdetail" 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>
 | 
			
		||||
				<el-button type="primary" @click="dataFormSubmit()">确定</el-button>
 | 
			
		||||
			</div>
 | 
			
		||||
		</div>
 | 
			
		||||
 | 
			
		||||
		<!-- <attr-add
 | 
			
		||||
		<attr-add
 | 
			
		||||
			v-if="addOrUpdateVisible"
 | 
			
		||||
			ref="addOrUpdate"
 | 
			
		||||
			:material-id="dataForm.id"
 | 
			
		||||
			@refreshDataList="getList" /> -->
 | 
			
		||||
			:bom-id="dataForm.id"
 | 
			
		||||
			@refreshDataList="getList" />
 | 
			
		||||
	</el-drawer>
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
@@ -177,7 +112,8 @@ import { getMaterialList } from "@/api/base/material";
 | 
			
		||||
import { listData } from "@/api/system/dict/data";
 | 
			
		||||
import SmallTitle from '../material/SmallTitle';
 | 
			
		||||
import { parseTime } from '../../core/mixins/code-filter';
 | 
			
		||||
// import attrAdd from './attr-add';
 | 
			
		||||
import attrAdd from './attr-add';
 | 
			
		||||
import { publicFormatter } from '@/utils/dict';
 | 
			
		||||
 | 
			
		||||
const tableBtn = [
 | 
			
		||||
	{
 | 
			
		||||
@@ -196,18 +132,31 @@ const tableProps = [
 | 
			
		||||
		filter: parseTime,
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'attrName',
 | 
			
		||||
		label: '属性名',
 | 
			
		||||
		prop: 'materialName',
 | 
			
		||||
		label: '物料名称',
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'attrValue',
 | 
			
		||||
		label: '属性值',
 | 
			
		||||
		prop: 'materialCode',
 | 
			
		||||
		label: '物料编码',
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'unit',
 | 
			
		||||
		label: '单位',
 | 
			
		||||
		filter: publicFormatter('unit_dict'),
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'num',
 | 
			
		||||
		label: '数量',
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'remark',
 | 
			
		||||
		label: '备注',
 | 
			
		||||
	}
 | 
			
		||||
];
 | 
			
		||||
 | 
			
		||||
export default {
 | 
			
		||||
	mixins: [basicAdd],
 | 
			
		||||
	components: { SmallTitle },
 | 
			
		||||
	components: { SmallTitle, attrAdd },
 | 
			
		||||
	data() {
 | 
			
		||||
		return {
 | 
			
		||||
			tableBtn,
 | 
			
		||||
@@ -233,7 +182,6 @@ export default {
 | 
			
		||||
			},
 | 
			
		||||
			productList: [],
 | 
			
		||||
			materialAttrList: [],
 | 
			
		||||
			materialList: [],
 | 
			
		||||
			tableData: [],
 | 
			
		||||
			unitList: [],
 | 
			
		||||
			visible: false,
 | 
			
		||||
@@ -248,13 +196,42 @@ export default {
 | 
			
		||||
		this.getDict()
 | 
			
		||||
	},
 | 
			
		||||
	methods: {
 | 
			
		||||
		handleClick(raw) {
 | 
			
		||||
			if (raw.type === 'delete') {
 | 
			
		||||
				this.deleteDetail(raw.data);
 | 
			
		||||
			} else {
 | 
			
		||||
				this.addNew(raw.data.id);
 | 
			
		||||
			}
 | 
			
		||||
		},
 | 
			
		||||
		// 表单提交
 | 
			
		||||
    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.idAttrShow = true;
 | 
			
		||||
					this.dataForm.id = response.data
 | 
			
		||||
          this.$emit("refreshDataList");
 | 
			
		||||
        });
 | 
			
		||||
      });
 | 
			
		||||
    },
 | 
			
		||||
		async getDict() {
 | 
			
		||||
			// 产品列表
 | 
			
		||||
			const proRes = await getProList();
 | 
			
		||||
			this.productList = proRes.data;
 | 
			
		||||
			// 物料列表
 | 
			
		||||
			const res = await getMaterialList();
 | 
			
		||||
			this.materialList = res.data;
 | 
			
		||||
			// 物料单位列表
 | 
			
		||||
			const unitRes = await listData({
 | 
			
		||||
				pageNo: 1,
 | 
			
		||||
@@ -274,8 +251,7 @@ export default {
 | 
			
		||||
		},
 | 
			
		||||
		deleteDetail(raw) {
 | 
			
		||||
			this.$confirm(
 | 
			
		||||
				`确定删除关于物料编码为${
 | 
			
		||||
					raw.materialCode}的数据?`,
 | 
			
		||||
				`是否确认删除物料名称为"${raw.materialName}"的数据项?`,
 | 
			
		||||
				'提示',
 | 
			
		||||
				{
 | 
			
		||||
					confirmButtonText: '确定',
 | 
			
		||||
@@ -297,66 +273,13 @@ export default {
 | 
			
		||||
				})
 | 
			
		||||
				.catch(() => {});
 | 
			
		||||
		},
 | 
			
		||||
		setCode(row) {
 | 
			
		||||
			const tempM = this.materialList.filter(item => {
 | 
			
		||||
				if (row.materialId === item.id) {
 | 
			
		||||
					row.materialCode = item.code
 | 
			
		||||
				}
 | 
			
		||||
				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
 | 
			
		||||
			console.log('row', row)
 | 
			
		||||
		},
 | 
			
		||||
		edit(row) {
 | 
			
		||||
			row.isEdit = true
 | 
			
		||||
		},
 | 
			
		||||
		saveData(row) {
 | 
			
		||||
			// this.$refs['dataForm'].validate((valid) => {
 | 
			
		||||
				// if (valid) {
 | 
			
		||||
				// 	修改的提交
 | 
			
		||||
				if (row.id) {
 | 
			
		||||
					updateMaterialPBDet({
 | 
			
		||||
						...row
 | 
			
		||||
					}).then((response) => {
 | 
			
		||||
						this.$modal.msgSuccess('修改成功');
 | 
			
		||||
						// this.visible = false;
 | 
			
		||||
						this.getList();
 | 
			
		||||
					});
 | 
			
		||||
					return;
 | 
			
		||||
				}
 | 
			
		||||
					// 添加的提交
 | 
			
		||||
			createMaterialPBDet({
 | 
			
		||||
				...row
 | 
			
		||||
			}).then((response) => {
 | 
			
		||||
				this.$modal.msgSuccess('新增成功');
 | 
			
		||||
				// this.visible = false;
 | 
			
		||||
				this.getList();
 | 
			
		||||
			});
 | 
			
		||||
				// }
 | 
			
		||||
			// });
 | 
			
		||||
		},
 | 
			
		||||
		getList() {
 | 
			
		||||
			// 获取产品Bom详细列表
 | 
			
		||||
			getProBomList({
 | 
			
		||||
				...this.listQuery,
 | 
			
		||||
				bomId: this.dataForm.id
 | 
			
		||||
			}).then((response) => {
 | 
			
		||||
				this.tableData = response.data.records.map(item => {
 | 
			
		||||
					this.unitList.filter(u => {
 | 
			
		||||
						if (item.unit === u.value) {
 | 
			
		||||
							item.mUnit = u.label
 | 
			
		||||
						}
 | 
			
		||||
					})
 | 
			
		||||
					item.isEdit = false
 | 
			
		||||
					return item
 | 
			
		||||
				});
 | 
			
		||||
				this.tableData = response.data.records
 | 
			
		||||
				this.listQuery.total = response.data.total;
 | 
			
		||||
			});
 | 
			
		||||
		},
 | 
			
		||||
@@ -452,7 +375,7 @@ export default {
 | 
			
		||||
 | 
			
		||||
.drawer >>> .visual-part {
 | 
			
		||||
	flex: 1 auto;
 | 
			
		||||
	max-height: 30vh;
 | 
			
		||||
	max-height: 20vh;
 | 
			
		||||
	overflow: hidden;
 | 
			
		||||
	overflow-y: scroll;
 | 
			
		||||
	padding-right: 10px; /* 调整滚动条样式 */
 | 
			
		||||
@@ -468,4 +391,12 @@ export default {
 | 
			
		||||
	justify-content: flex-end;
 | 
			
		||||
	padding: 18px;
 | 
			
		||||
}
 | 
			
		||||
.action_btn {
 | 
			
		||||
  float: right;
 | 
			
		||||
  margin: -40px 15px;
 | 
			
		||||
  font-size: 14px;
 | 
			
		||||
}
 | 
			
		||||
.add {
 | 
			
		||||
	color: #0b58ff;
 | 
			
		||||
}
 | 
			
		||||
</style>
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										197
									
								
								src/views/base/materialProductBom/attr-add.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										197
									
								
								src/views/base/materialProductBom/attr-add.vue
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,197 @@
 | 
			
		||||
<template>
 | 
			
		||||
	<el-dialog
 | 
			
		||||
		:visible.sync="visible"
 | 
			
		||||
		:width="'40%'"
 | 
			
		||||
		: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="80px"
 | 
			
		||||
			@keyup.enter.native="dataFormSubmit()">
 | 
			
		||||
			<el-row :gutter="20">
 | 
			
		||||
				<el-col :span="12">
 | 
			
		||||
					<el-form-item label="物料名称" prop="materialId">
 | 
			
		||||
						<el-select
 | 
			
		||||
							v-model="dataForm.materialId"
 | 
			
		||||
							placeholder="请选择物料"
 | 
			
		||||
							clearable
 | 
			
		||||
							filterable
 | 
			
		||||
							@change="setCode"
 | 
			
		||||
							style="width: 100%"
 | 
			
		||||
						>
 | 
			
		||||
							<el-option
 | 
			
		||||
								v-for="dict in materialList"
 | 
			
		||||
								: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="materialCode">
 | 
			
		||||
						<el-input
 | 
			
		||||
							v-model="dataForm.materialCode"
 | 
			
		||||
							clearable
 | 
			
		||||
							disabled
 | 
			
		||||
							placeholder="请输入物料编码" />
 | 
			
		||||
					</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"
 | 
			
		||||
							style="width: 100%"
 | 
			
		||||
							disabled
 | 
			
		||||
							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="num">
 | 
			
		||||
					<el-input-number v-model="dataForm.num" controls-position="right" clearable placeholder="请输入数量" style="width: 100%" />
 | 
			
		||||
					</el-form-item>
 | 
			
		||||
				</el-col>
 | 
			
		||||
			</el-row>
 | 
			
		||||
			<el-form-item label="备注" prop="remark">
 | 
			
		||||
				<el-input v-model="dataForm.remark" clearable placeholder="请输入备注" />
 | 
			
		||||
			</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 { getMaterialList } from '@/api/base/material';
 | 
			
		||||
import { createMaterialPBDet, updateMaterialPBDet, getMaterialPBDet } from "@/api/base/materialProductBom";
 | 
			
		||||
 | 
			
		||||
export default {
 | 
			
		||||
	props: {
 | 
			
		||||
		bomId: {
 | 
			
		||||
			type: String,
 | 
			
		||||
			default: '',
 | 
			
		||||
		},
 | 
			
		||||
	},
 | 
			
		||||
	data() {
 | 
			
		||||
		return {
 | 
			
		||||
			visible: false,
 | 
			
		||||
			dataForm: {
 | 
			
		||||
				id: undefined,
 | 
			
		||||
				materialId: '',
 | 
			
		||||
				num: 0,
 | 
			
		||||
				materialCode: undefined,
 | 
			
		||||
				unit: undefined,
 | 
			
		||||
				remark: '',
 | 
			
		||||
			},
 | 
			
		||||
			materialList: [],
 | 
			
		||||
			dataRule: {
 | 
			
		||||
				materialId: [{ required: true, message: '物料名称不能为空', trigger: 'change' }],
 | 
			
		||||
				num: [{ required: true, message: '数量不能为空', trigger: 'blur' }]
 | 
			
		||||
			},
 | 
			
		||||
		};
 | 
			
		||||
	},
 | 
			
		||||
	mounted() {
 | 
			
		||||
		this.getDict()
 | 
			
		||||
	},
 | 
			
		||||
	methods: {
 | 
			
		||||
		async getDict() {
 | 
			
		||||
			// 物料列表
 | 
			
		||||
			const res = await getMaterialList();
 | 
			
		||||
			this.materialList = res.data;
 | 
			
		||||
		},
 | 
			
		||||
		init(id) {
 | 
			
		||||
			this.dataForm.id = id || '';
 | 
			
		||||
			this.visible = true;
 | 
			
		||||
			this.$nextTick(() => {
 | 
			
		||||
				this.$refs['dataForm'].resetFields();
 | 
			
		||||
				if (this.dataForm.id) {
 | 
			
		||||
					getMaterialPBDet(this.dataForm.id).then((res) => {
 | 
			
		||||
						this.dataForm = res.data
 | 
			
		||||
						this.setCode()
 | 
			
		||||
					});
 | 
			
		||||
				}
 | 
			
		||||
			});
 | 
			
		||||
		},
 | 
			
		||||
		setCode() {
 | 
			
		||||
			const tempMaterial = this.materialList.filter(item =>{
 | 
			
		||||
				return item.id === this.dataForm.materialId
 | 
			
		||||
			})
 | 
			
		||||
			this.dataForm.materialCode = tempMaterial[0]?.code
 | 
			
		||||
			this.dataForm.unit = tempMaterial[0].unit === undefined ? undefined : String(tempMaterial[0]?.unit)
 | 
			
		||||
		},
 | 
			
		||||
		// 表单提交
 | 
			
		||||
		dataFormSubmit() {
 | 
			
		||||
			this.$refs['dataForm'].validate((valid) => {
 | 
			
		||||
				if (valid) {
 | 
			
		||||
					// 修改的提交
 | 
			
		||||
					if (this.dataForm.id) {
 | 
			
		||||
						updateMaterialPBDet({
 | 
			
		||||
							...this.dataForm,
 | 
			
		||||
							bomId: this.bomId,
 | 
			
		||||
						}).then((response) => {
 | 
			
		||||
							this.$modal.msgSuccess('修改成功');
 | 
			
		||||
							this.visible = false;
 | 
			
		||||
							this.$emit('refreshDataList');
 | 
			
		||||
						});
 | 
			
		||||
						return;
 | 
			
		||||
					}
 | 
			
		||||
					// 添加的提交
 | 
			
		||||
					createMaterialPBDet({
 | 
			
		||||
						...this.dataForm,
 | 
			
		||||
						bomId: this.bomId,
 | 
			
		||||
					}).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>
 | 
			
		||||
@@ -13,7 +13,7 @@
 | 
			
		||||
			<method-btn
 | 
			
		||||
				v-if="tableBtn.length"
 | 
			
		||||
				slot="handleBtn"
 | 
			
		||||
				:width="220"
 | 
			
		||||
				:width="120"
 | 
			
		||||
				label="操作"
 | 
			
		||||
				:method-list="tableBtn"
 | 
			
		||||
				@clickBtn="handleClick" />
 | 
			
		||||
@@ -68,24 +68,24 @@ export default {
 | 
			
		||||
			},
 | 
			
		||||
			tableProps,
 | 
			
		||||
			tableBtn: [
 | 
			
		||||
				this.$auth.hasPermi(`base:material-product-bom:queryMaterial`)
 | 
			
		||||
					? {
 | 
			
		||||
							type: 'detail',
 | 
			
		||||
							btnName: '查看物料',
 | 
			
		||||
					  }
 | 
			
		||||
					: undefined,
 | 
			
		||||
					this.$auth.hasPermi(`base:material-product-bom:update`)
 | 
			
		||||
					? {
 | 
			
		||||
							type: 'edit',
 | 
			
		||||
							btnName: '编辑',
 | 
			
		||||
					  }
 | 
			
		||||
					: undefined,
 | 
			
		||||
					this.$auth.hasPermi(`base:material-product-bom:queryMaterial`)
 | 
			
		||||
					? {
 | 
			
		||||
							type: 'search',
 | 
			
		||||
							btnName: '查看物料',
 | 
			
		||||
					  }
 | 
			
		||||
					: undefined,
 | 
			
		||||
					this.$auth.hasPermi(`base:material-product-bom:editMaterial`)
 | 
			
		||||
					? {
 | 
			
		||||
							type: 'editMaterial',
 | 
			
		||||
							btnName: '编辑物料',
 | 
			
		||||
					  }
 | 
			
		||||
					: undefined,
 | 
			
		||||
					// this.$auth.hasPermi(`base:material-product-bom:editMaterial`)
 | 
			
		||||
					// ? {
 | 
			
		||||
					// 		type: 'editMaterial',
 | 
			
		||||
					// 		btnName: '编辑物料',
 | 
			
		||||
					//   }
 | 
			
		||||
					// : undefined,
 | 
			
		||||
          this.$auth.hasPermi(`base:material-product-bom:delete`)
 | 
			
		||||
					? {
 | 
			
		||||
							type: 'delete',
 | 
			
		||||
@@ -123,7 +123,7 @@ export default {
 | 
			
		||||
	created() {},
 | 
			
		||||
	methods: {
 | 
			
		||||
		otherMethods(val) {
 | 
			
		||||
			if (val.type === 'search') {
 | 
			
		||||
			if (val.type === 'detail') {
 | 
			
		||||
				this.addOrUpdateVisible = true;
 | 
			
		||||
				this.addOrEditTitle = '详情';
 | 
			
		||||
				this.$nextTick(() => {
 | 
			
		||||
@@ -151,7 +151,7 @@ export default {
 | 
			
		||||
				case 'search':
 | 
			
		||||
					this.listQuery.pageNo = 1;
 | 
			
		||||
					this.listQuery.pageSize = 10;
 | 
			
		||||
					this.listQuery.name = val.name ? val.name : undefined;
 | 
			
		||||
					this.listQuery.productName = val.name ? val.name : undefined;
 | 
			
		||||
					this.getDataList();
 | 
			
		||||
					break;
 | 
			
		||||
				case 'reset':
 | 
			
		||||
 
 | 
			
		||||
@@ -2,7 +2,7 @@
 | 
			
		||||
 * @Author: zwq
 | 
			
		||||
 * @Date: 2021-11-18 14:16:25
 | 
			
		||||
 * @LastEditors: DY
 | 
			
		||||
 * @LastEditTime: 2023-11-06 19:27:57
 | 
			
		||||
 * @LastEditTime: 2023-11-27 19:57:23
 | 
			
		||||
 * @Description:
 | 
			
		||||
-->
 | 
			
		||||
<template>
 | 
			
		||||
@@ -11,9 +11,10 @@
 | 
			
		||||
		:rules="dataRule"
 | 
			
		||||
		ref="dataForm"
 | 
			
		||||
		@keyup.enter.native="dataFormSubmit()"
 | 
			
		||||
		label-width="80px">
 | 
			
		||||
		label-width="80px"
 | 
			
		||||
		label-position="top">
 | 
			
		||||
		<el-row :gutter="20">
 | 
			
		||||
			<el-col :span="12">
 | 
			
		||||
			<el-col :span="8">
 | 
			
		||||
				<el-form-item label="物料名称" prop="materialId">
 | 
			
		||||
					<el-select
 | 
			
		||||
						v-model="dataForm.materialId"
 | 
			
		||||
@@ -21,6 +22,7 @@
 | 
			
		||||
						clearable
 | 
			
		||||
						filterable
 | 
			
		||||
						@change="setCode"
 | 
			
		||||
						style="width: 100%"
 | 
			
		||||
					>
 | 
			
		||||
						<el-option
 | 
			
		||||
							v-for="dict in materialList"
 | 
			
		||||
@@ -30,7 +32,7 @@
 | 
			
		||||
					</el-select>
 | 
			
		||||
				</el-form-item>
 | 
			
		||||
			</el-col>
 | 
			
		||||
			<el-col :span="12">
 | 
			
		||||
			<el-col :span="8">
 | 
			
		||||
				<el-form-item label="物料编码" prop="materialCode">
 | 
			
		||||
					<el-input
 | 
			
		||||
						v-model="dataForm.materialCode"
 | 
			
		||||
@@ -39,15 +41,14 @@
 | 
			
		||||
						placeholder="请输入物料编码" />
 | 
			
		||||
				</el-form-item>
 | 
			
		||||
			</el-col>
 | 
			
		||||
		</el-row>
 | 
			
		||||
		<el-row :gutter="20">
 | 
			
		||||
			<el-col :span="12">
 | 
			
		||||
			<el-col :span="8">
 | 
			
		||||
				<el-form-item label="批次号" prop="materialDateId">
 | 
			
		||||
					<el-select
 | 
			
		||||
						v-model="dataForm.materialDateId"
 | 
			
		||||
						clearable
 | 
			
		||||
						filterable
 | 
			
		||||
						placeholder="请选择物料批次"
 | 
			
		||||
						style="width: 100%"
 | 
			
		||||
					>
 | 
			
		||||
						<el-option
 | 
			
		||||
							v-for="dict in materialDateList"
 | 
			
		||||
@@ -57,13 +58,16 @@
 | 
			
		||||
					</el-select>
 | 
			
		||||
				</el-form-item>
 | 
			
		||||
			</el-col>
 | 
			
		||||
			<el-col :span="12">
 | 
			
		||||
		</el-row>
 | 
			
		||||
		<el-row :gutter="20">
 | 
			
		||||
			<el-col :span="8">
 | 
			
		||||
				<el-form-item label="使用设备" prop="equipmentId">
 | 
			
		||||
					<el-select
 | 
			
		||||
						v-model="dataForm.equipmentId"
 | 
			
		||||
						clearable
 | 
			
		||||
						filterable
 | 
			
		||||
						placeholder="请选择使用设备">
 | 
			
		||||
						placeholder="请选择使用设备"
 | 
			
		||||
						style="width: 100%">
 | 
			
		||||
						<el-option
 | 
			
		||||
							v-for="dict in eqList"
 | 
			
		||||
							:key="dict.id"
 | 
			
		||||
@@ -72,9 +76,7 @@
 | 
			
		||||
					</el-select>
 | 
			
		||||
				</el-form-item>
 | 
			
		||||
			</el-col>
 | 
			
		||||
		</el-row>
 | 
			
		||||
		<el-row :gutter="20">
 | 
			
		||||
			<el-col :span="12">
 | 
			
		||||
			<el-col :span="8">
 | 
			
		||||
				<el-form-item label="使用时间" prop="useTime">
 | 
			
		||||
					<el-date-picker
 | 
			
		||||
						v-model="dataForm.useTime"
 | 
			
		||||
@@ -84,14 +86,15 @@
 | 
			
		||||
						placeholder="选择日期时间" />
 | 
			
		||||
				</el-form-item>
 | 
			
		||||
			</el-col>
 | 
			
		||||
			<el-col :span="12">
 | 
			
		||||
			<el-col :span="8">
 | 
			
		||||
				<el-form-item label="操作员" prop="userNames">
 | 
			
		||||
					<el-select
 | 
			
		||||
						v-model="dataForm.userNames"
 | 
			
		||||
						clearable
 | 
			
		||||
						filterable
 | 
			
		||||
						multiple
 | 
			
		||||
						placeholder="请选择操作员">
 | 
			
		||||
						placeholder="请选择操作员"
 | 
			
		||||
						style="width: 100%">
 | 
			
		||||
						<el-option
 | 
			
		||||
							v-for="dict in workersList"
 | 
			
		||||
							:key="dict.id"
 | 
			
		||||
@@ -102,12 +105,12 @@
 | 
			
		||||
			</el-col>
 | 
			
		||||
		</el-row>
 | 
			
		||||
		<el-row :gutter="20">
 | 
			
		||||
			<el-col :span="12">
 | 
			
		||||
			<el-col :span="8">
 | 
			
		||||
				<el-form-item label="使用数量" prop="num">
 | 
			
		||||
					<el-input-number v-model="dataForm.num" clearable placeholder="请输入使用数量" />
 | 
			
		||||
					<el-input-number v-model="dataForm.num" clearable controls-position="right" placeholder="请输入使用数量" style="width: 100%" />
 | 
			
		||||
				</el-form-item>
 | 
			
		||||
			</el-col>
 | 
			
		||||
			<el-col :span="12">
 | 
			
		||||
			<el-col :span="8">
 | 
			
		||||
				<el-form-item label="数据来源" prop="source">
 | 
			
		||||
					<el-select
 | 
			
		||||
						v-model="dataForm.source"
 | 
			
		||||
@@ -121,10 +124,12 @@
 | 
			
		||||
					</el-select>
 | 
			
		||||
				</el-form-item>
 | 
			
		||||
			</el-col>
 | 
			
		||||
		</el-row>
 | 
			
		||||
			<el-col :span="8">
 | 
			
		||||
				<el-form-item label="备注" prop="remark">
 | 
			
		||||
					<el-input v-model="dataForm.remark" clearable placeholder="请输入备注" />
 | 
			
		||||
				</el-form-item>
 | 
			
		||||
			</el-col>
 | 
			
		||||
		</el-row>
 | 
			
		||||
	</el-form>
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
@@ -151,7 +156,7 @@ export default {
 | 
			
		||||
				equipmentId: undefined,
 | 
			
		||||
        userName: undefined,
 | 
			
		||||
				userNames: [],
 | 
			
		||||
				useTime: undefined,
 | 
			
		||||
				useTime: new Date().getTime(),
 | 
			
		||||
        address: undefined,
 | 
			
		||||
				num: 0,
 | 
			
		||||
				source: undefined,
 | 
			
		||||
@@ -237,13 +242,8 @@ export default {
 | 
			
		||||
						this.dataForm.source = response.data.source
 | 
			
		||||
						this.dataForm.remark = response.data.remark
 | 
			
		||||
						this.dataForm.userNames = response.data.userName.split(',')
 | 
			
		||||
						console.log('打印', this.dataForm)
 | 
			
		||||
          });
 | 
			
		||||
        } else {
 | 
			
		||||
          if (this.urlOptions.isGetCode) {
 | 
			
		||||
            this.getCode()
 | 
			
		||||
          }
 | 
			
		||||
				}
 | 
			
		||||
        } else {}
 | 
			
		||||
      });
 | 
			
		||||
    },
 | 
			
		||||
		setCode() {
 | 
			
		||||
 
 | 
			
		||||
@@ -29,7 +29,7 @@
 | 
			
		||||
			@cancel="handleCancel"
 | 
			
		||||
			@confirm="handleConfirm"
 | 
			
		||||
			:before-close="handleCancel"
 | 
			
		||||
			width="50%">
 | 
			
		||||
			width="60%">
 | 
			
		||||
			<add-or-update
 | 
			
		||||
				ref="addOrUpdate"
 | 
			
		||||
				@refreshDataList="successSubmit"></add-or-update>
 | 
			
		||||
@@ -130,7 +130,7 @@ export default {
 | 
			
		||||
          type: 'datePicker',
 | 
			
		||||
          label: '使用时间段',
 | 
			
		||||
          dateType: 'datetimerange',
 | 
			
		||||
          format: 'yyyy-MM-dd',
 | 
			
		||||
          format: 'yyyy-MM-dd HH:mm:ss',
 | 
			
		||||
          valueFormat: 'yyyy-MM-dd HH:mm:ss',
 | 
			
		||||
          rangeSeparator: '-',
 | 
			
		||||
          startPlaceholder: '开始时间',
 | 
			
		||||
@@ -215,12 +215,33 @@ export default {
 | 
			
		||||
          this.$refs.addOrUpdate.init(val.data.id);
 | 
			
		||||
        });
 | 
			
		||||
      } else if (val.type === "delete") {
 | 
			
		||||
        this.deleteHandle(val.data.id, val.data.materialName, val.data._pageIndex)
 | 
			
		||||
        this.deleteHandle(val.data.id, val.data.materialName)
 | 
			
		||||
      } else if (val.type === "change") {
 | 
			
		||||
        this.changeStatus(val.data.id)
 | 
			
		||||
      } else {
 | 
			
		||||
        this.otherMethods(val)
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
		// 删除
 | 
			
		||||
    deleteHandle(id, name) {
 | 
			
		||||
      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(() => { });
 | 
			
		||||
    }
 | 
			
		||||
	},
 | 
			
		||||
};
 | 
			
		||||
 
 | 
			
		||||
@@ -2,7 +2,7 @@
 | 
			
		||||
 * @Author: zwq
 | 
			
		||||
 * @Date: 2022-08-24 11:19:43
 | 
			
		||||
 * @LastEditors: zhp
 | 
			
		||||
 * @LastEditTime: 2023-11-01 10:30:12
 | 
			
		||||
 * @LastEditTime: 2023-11-24 09:29:36
 | 
			
		||||
 * @Description:
 | 
			
		||||
 */
 | 
			
		||||
export default {
 | 
			
		||||
@@ -85,6 +85,7 @@ export default {
 | 
			
		||||
    },
 | 
			
		||||
    //tableBtn点击
 | 
			
		||||
    handleClick(val) {
 | 
			
		||||
      console.log(val.data.packagingCode);
 | 
			
		||||
      if (val.type === "edit") {
 | 
			
		||||
        this.addOrUpdateVisible = true;
 | 
			
		||||
        this.addOrEditTitle = "编辑";
 | 
			
		||||
@@ -92,7 +93,7 @@ export default {
 | 
			
		||||
          this.$refs.addOrUpdate.init(val.data.id);
 | 
			
		||||
        });
 | 
			
		||||
      } else if (val.type === "delete") {
 | 
			
		||||
        this.deleteHandle(val.data.id, val.data.name, val.data._pageIndex)
 | 
			
		||||
        this.deleteHandle(val.data.id, val.data.name, val.data._pageIndex,val.data.packagingCode )
 | 
			
		||||
      } else if (val.type === "change") {
 | 
			
		||||
        this.changeStatus(val.data.id)
 | 
			
		||||
      } else {
 | 
			
		||||
@@ -101,7 +102,7 @@ export default {
 | 
			
		||||
    },
 | 
			
		||||
    // 删除
 | 
			
		||||
    deleteHandle(id, name, index) {
 | 
			
		||||
      this.$confirm(`是否确认删除${name ? '[' + name + ']' : '[' + index + ']'}数据项?`, "提示", {
 | 
			
		||||
      this.$confirm(`是否确认删除${name ? ' 名称为'+ name : '[' + index + ']'}数据项?`, "提示", {
 | 
			
		||||
        confirmButtonText: "确定",
 | 
			
		||||
        cancelButtonText: "取消",
 | 
			
		||||
        type: "warning",
 | 
			
		||||
 
 | 
			
		||||
@@ -2,7 +2,7 @@
 | 
			
		||||
 * @Author: zwq
 | 
			
		||||
 * @Date: 2023-08-01 14:55:51
 | 
			
		||||
 * @LastEditors: zhp
 | 
			
		||||
 * @LastEditTime: 2023-11-07 19:28:18
 | 
			
		||||
 * @LastEditTime: 2023-11-24 09:13:50
 | 
			
		||||
 * @Description:
 | 
			
		||||
-->
 | 
			
		||||
<template>
 | 
			
		||||
@@ -77,7 +77,7 @@ const tableProps = [
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'printStatus',
 | 
			
		||||
    label: '打印状态',
 | 
			
		||||
    // subcomponent: unitDict,
 | 
			
		||||
    filter: (val) => val == 1 ? '未打印' : '已打印',
 | 
			
		||||
  },
 | 
			
		||||
	{
 | 
			
		||||
    prop: 'createTime',
 | 
			
		||||
@@ -97,6 +97,10 @@ export default {
 | 
			
		||||
			},
 | 
			
		||||
			tableProps,
 | 
			
		||||
      tableBtn: [
 | 
			
		||||
        {
 | 
			
		||||
          type: 'print',
 | 
			
		||||
          btnName: '打印',
 | 
			
		||||
        },
 | 
			
		||||
        this.$auth.hasPermi(`base:packaging-print-log:update`)
 | 
			
		||||
					? {
 | 
			
		||||
							type: 'edit',
 | 
			
		||||
@@ -109,10 +113,6 @@ export default {
 | 
			
		||||
							btnName: '删除',
 | 
			
		||||
					  }
 | 
			
		||||
          : undefined,
 | 
			
		||||
        {
 | 
			
		||||
          type: 'print',
 | 
			
		||||
          btnName: '打印',
 | 
			
		||||
        },
 | 
			
		||||
			].filter((v) => v),
 | 
			
		||||
			tableData: [],
 | 
			
		||||
      formConfig: [
 | 
			
		||||
@@ -122,7 +122,8 @@ export default {
 | 
			
		||||
          selectOptions: [],
 | 
			
		||||
          labelField: 'name',
 | 
			
		||||
          valueField: 'id',
 | 
			
		||||
          param: 'workOrderId'
 | 
			
		||||
          param: 'workOrderId',
 | 
			
		||||
          filterable: true,
 | 
			
		||||
        },
 | 
			
		||||
        {
 | 
			
		||||
          // parent: 'dateFilterType',
 | 
			
		||||
@@ -214,6 +215,26 @@ export default {
 | 
			
		||||
        // this.listQuery.total = response.data.total;
 | 
			
		||||
      })
 | 
			
		||||
    },
 | 
			
		||||
    deleteHandle(id, name, index, packagingCode) {
 | 
			
		||||
      this.$confirm(`是否确认删除${'[' + packagingCode + ']'}数据项?`, "提示", {
 | 
			
		||||
        confirmButtonText: "确定",
 | 
			
		||||
        cancelButtonText: "取消",
 | 
			
		||||
        type: "warning",
 | 
			
		||||
      })
 | 
			
		||||
        .then(() => {
 | 
			
		||||
          this.urlOptions.deleteURL(id).then(({ data }) => {
 | 
			
		||||
            this.$message({
 | 
			
		||||
              message: "操作成功",
 | 
			
		||||
              type: "success",
 | 
			
		||||
              duration: 1500,
 | 
			
		||||
              onClose: () => {
 | 
			
		||||
                this.getDataList();
 | 
			
		||||
              },
 | 
			
		||||
            });
 | 
			
		||||
          });
 | 
			
		||||
        })
 | 
			
		||||
        .catch(() => { });
 | 
			
		||||
    },
 | 
			
		||||
    handlePrint(id) {
 | 
			
		||||
      if (id) {
 | 
			
		||||
        getPackingModel(id).then(res => {
 | 
			
		||||
 
 | 
			
		||||
@@ -2,7 +2,7 @@
 | 
			
		||||
 * @Author: zwq
 | 
			
		||||
 * @Date: 2023-08-01 14:55:51
 | 
			
		||||
 * @LastEditors: zhp
 | 
			
		||||
 * @LastEditTime: 2023-11-01 10:28:29
 | 
			
		||||
 * @LastEditTime: 2023-11-22 14:40:07
 | 
			
		||||
 * @Description:
 | 
			
		||||
-->
 | 
			
		||||
<template>
 | 
			
		||||
@@ -34,6 +34,11 @@ import {
 | 
			
		||||
 | 
			
		||||
const tableProps = [
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'createTime',
 | 
			
		||||
    label: '创建时间',
 | 
			
		||||
    filter: parseTime
 | 
			
		||||
  },
 | 
			
		||||
	{
 | 
			
		||||
    prop: 'name',
 | 
			
		||||
    label: '模板名称'
 | 
			
		||||
	},
 | 
			
		||||
@@ -65,6 +70,10 @@ export default {
 | 
			
		||||
      tableProps,
 | 
			
		||||
      modelShow:false,
 | 
			
		||||
      tableBtn: [
 | 
			
		||||
        {
 | 
			
		||||
          type: 'print',
 | 
			
		||||
          btnName: '查看',
 | 
			
		||||
        },
 | 
			
		||||
        this.$auth.hasPermi(`base:packaging-print-model:update`)
 | 
			
		||||
					? {
 | 
			
		||||
							type: 'edit',
 | 
			
		||||
@@ -77,10 +86,6 @@ export default {
 | 
			
		||||
							btnName: '删除',
 | 
			
		||||
					  }
 | 
			
		||||
          : undefined,
 | 
			
		||||
        {
 | 
			
		||||
          type: 'print',
 | 
			
		||||
          btnName: '查看',
 | 
			
		||||
        },
 | 
			
		||||
			].filter((v) => v),
 | 
			
		||||
			tableData: [],
 | 
			
		||||
			formConfig: [
 | 
			
		||||
 
 | 
			
		||||
@@ -2,7 +2,7 @@
 | 
			
		||||
 * @Author: zwq
 | 
			
		||||
 * @Date: 2023-08-01 14:55:51
 | 
			
		||||
 * @LastEditors: zhp
 | 
			
		||||
 * @LastEditTime: 2023-10-18 16:11:22
 | 
			
		||||
 * @LastEditTime: 2023-11-22 14:36:33
 | 
			
		||||
 * @Description:
 | 
			
		||||
-->
 | 
			
		||||
<template>
 | 
			
		||||
@@ -107,12 +107,12 @@ export default {
 | 
			
		||||
        //   valueFormat: 'yyyy-MM-dd',
 | 
			
		||||
        //   param: 'createTime',
 | 
			
		||||
				// },
 | 
			
		||||
				{
 | 
			
		||||
					type: 'button',
 | 
			
		||||
					btnName: '搜索',
 | 
			
		||||
					name: 'search',
 | 
			
		||||
					color: 'primary',
 | 
			
		||||
				},
 | 
			
		||||
				// {
 | 
			
		||||
				// 	type: 'button',
 | 
			
		||||
				// 	btnName: '搜索',
 | 
			
		||||
				// 	name: 'search',
 | 
			
		||||
				// 	color: 'primary',
 | 
			
		||||
				// },
 | 
			
		||||
				// {
 | 
			
		||||
				// 	type: 'separate',
 | 
			
		||||
				// },
 | 
			
		||||
@@ -125,7 +125,7 @@ export default {
 | 
			
		||||
					type: 'separate',
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
          type: this.$auth.hasPermi('base:packaging-print-log:create') ? 'button' : '',
 | 
			
		||||
          type: this.$auth.hasPermi('base:packaging-print-type:create') ? 'button' : '',
 | 
			
		||||
					btnName: '新增',
 | 
			
		||||
					name: 'add',
 | 
			
		||||
					color: 'success',
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										228
									
								
								src/views/core/analysis/balanceAnalysis/chart.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										228
									
								
								src/views/core/analysis/balanceAnalysis/chart.vue
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,228 @@
 | 
			
		||||
<!-- 
 | 
			
		||||
    filename: chart.vue
 | 
			
		||||
    author: liubin
 | 
			
		||||
    date: 2023-11-29 09:03:01
 | 
			
		||||
    description: 
 | 
			
		||||
-->
 | 
			
		||||
 | 
			
		||||
<template>
 | 
			
		||||
	<div class="analysis-chart">
 | 
			
		||||
		<!-- tt ct 选择  -->
 | 
			
		||||
		<el-button
 | 
			
		||||
			v-for="(item, index) in ['设备CT', '设备TT', '产线CT', '产线TT']"
 | 
			
		||||
			:key="index"
 | 
			
		||||
			:class="[index == activeIndex ? 'activeButton' : '']"
 | 
			
		||||
			@click="activeIndex = index">
 | 
			
		||||
			{{ item }}
 | 
			
		||||
		</el-button>
 | 
			
		||||
		<!-- chart  -->
 | 
			
		||||
		<div id="chart" ref="chartDiv" class="chart" style="margin-top: 12px" />
 | 
			
		||||
	</div>
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script>
 | 
			
		||||
import * as echarts from 'echarts';
 | 
			
		||||
 | 
			
		||||
export default {
 | 
			
		||||
	name: 'AnalysisChart',
 | 
			
		||||
	components: {},
 | 
			
		||||
	props: ['daterange', 'tableData'],
 | 
			
		||||
	data() {
 | 
			
		||||
		return {
 | 
			
		||||
			activeIndex: 0,
 | 
			
		||||
			chart: null,
 | 
			
		||||
			templateOption: {
 | 
			
		||||
				tooltip: {
 | 
			
		||||
					trigger: 'axis',
 | 
			
		||||
				},
 | 
			
		||||
				legend: {
 | 
			
		||||
					icon: 'roundRect',
 | 
			
		||||
					itemWidth: 12,
 | 
			
		||||
					itemHeight: 12,
 | 
			
		||||
				},
 | 
			
		||||
				grid: {
 | 
			
		||||
					top: '12%',
 | 
			
		||||
					left: '6%',
 | 
			
		||||
					right: '6%',
 | 
			
		||||
					bottom: '12%',
 | 
			
		||||
				},
 | 
			
		||||
				xAxis: {
 | 
			
		||||
					name: '时间',
 | 
			
		||||
					axisLabel: {
 | 
			
		||||
						margin: 12,
 | 
			
		||||
						rotate: -8,
 | 
			
		||||
					},
 | 
			
		||||
					axisTicks: {
 | 
			
		||||
						show: false,
 | 
			
		||||
					},
 | 
			
		||||
					data: this.daterange || [
 | 
			
		||||
						'2020-01-02',
 | 
			
		||||
						'2020-02-02',
 | 
			
		||||
						'2020-03-02',
 | 
			
		||||
						'2020-04-02',
 | 
			
		||||
					],
 | 
			
		||||
				},
 | 
			
		||||
				yAxis: {
 | 
			
		||||
					name: ['设备CT', '设备TT', '产线CT', '产线TT'][this.activeIndex],
 | 
			
		||||
					nameLocation: 'end',
 | 
			
		||||
					nameGap: 28,
 | 
			
		||||
					nameTextStyle: {
 | 
			
		||||
						fontSize: 14,
 | 
			
		||||
						align: 'right',
 | 
			
		||||
					},
 | 
			
		||||
					axisLine: {
 | 
			
		||||
						show: true,
 | 
			
		||||
						lineStyle: {
 | 
			
		||||
							color: '#333',
 | 
			
		||||
							opacity: 0.6,
 | 
			
		||||
						},
 | 
			
		||||
					},
 | 
			
		||||
				},
 | 
			
		||||
				series: [
 | 
			
		||||
					{
 | 
			
		||||
						name: 'der Hund',
 | 
			
		||||
						type: 'line',
 | 
			
		||||
						data: [15, undefined, 36, 11],
 | 
			
		||||
					},
 | 
			
		||||
					{
 | 
			
		||||
						name: 'die Katze',
 | 
			
		||||
						type: 'line',
 | 
			
		||||
						data: [5, 2, 6, 3],
 | 
			
		||||
					},
 | 
			
		||||
					{
 | 
			
		||||
						name: 'die Maus',
 | 
			
		||||
						type: 'line',
 | 
			
		||||
						data: [11, 12, 13, 10],
 | 
			
		||||
					},
 | 
			
		||||
				],
 | 
			
		||||
			},
 | 
			
		||||
		};
 | 
			
		||||
	},
 | 
			
		||||
	mounted() {
 | 
			
		||||
		this.initChart();
 | 
			
		||||
	},
 | 
			
		||||
	deactivated() {},
 | 
			
		||||
	watch: {
 | 
			
		||||
		activeIndex(val) {
 | 
			
		||||
			this.initChart(val);
 | 
			
		||||
		},
 | 
			
		||||
	},
 | 
			
		||||
	methods: {
 | 
			
		||||
		/**
 | 
			
		||||
		 *
 | 
			
		||||
		 * @param {object} row 表格的每一列
 | 
			
		||||
		 * @param {string} key 表格列prop的后缀
 | 
			
		||||
		 */
 | 
			
		||||
		getListFromTableRow(row, key = '_eq_ct') {
 | 
			
		||||
			const list = [];
 | 
			
		||||
			for (const prop of Object.keys(row).sort()) {
 | 
			
		||||
				if (prop.endsWith(key)) {
 | 
			
		||||
					list.push(row[prop]);
 | 
			
		||||
				}
 | 
			
		||||
			}
 | 
			
		||||
			return list;
 | 
			
		||||
		},
 | 
			
		||||
		/** 初始化/设置 图表 */
 | 
			
		||||
		initChart(val) {
 | 
			
		||||
			console.log('tableData', this.tableData);
 | 
			
		||||
			if (!this.chart) this.chart = echarts.init(this.$refs.chartDiv);
 | 
			
		||||
			switch (val) {
 | 
			
		||||
				case 0:
 | 
			
		||||
					const eqCt = this.tableData.map((row) => ({
 | 
			
		||||
						name: row.equName,
 | 
			
		||||
						type: 'line',
 | 
			
		||||
						symbol: 'circle',
 | 
			
		||||
						symbolSize: 8,
 | 
			
		||||
						data: this.getListFromTableRow(row, '_eq_ct'),
 | 
			
		||||
					}));
 | 
			
		||||
					this.chart.setOption({
 | 
			
		||||
						...this.templateOption,
 | 
			
		||||
						yAxis: { ...this.templateOption.yAxis, name: '设备CT' },
 | 
			
		||||
						series: eqCt,
 | 
			
		||||
					});
 | 
			
		||||
					break;
 | 
			
		||||
				case 1:
 | 
			
		||||
					const eqTt = this.tableData.map((row) => ({
 | 
			
		||||
						name: row.equName,
 | 
			
		||||
						type: 'line',
 | 
			
		||||
						symbol: 'circle',
 | 
			
		||||
						symbolSize: 8,
 | 
			
		||||
						data: this.getListFromTableRow(row, '_eq_tt'),
 | 
			
		||||
					}));
 | 
			
		||||
					this.chart.setOption({
 | 
			
		||||
						...this.templateOption,
 | 
			
		||||
						yAxis: { ...this.templateOption.yAxis, name: '设备TT' },
 | 
			
		||||
						series: eqTt,
 | 
			
		||||
					});
 | 
			
		||||
					break;
 | 
			
		||||
				case 2:
 | 
			
		||||
					const plCt = this.tableData.map((row) => ({
 | 
			
		||||
						name: row.equName,
 | 
			
		||||
						type: 'line',
 | 
			
		||||
						symbol: 'circle',
 | 
			
		||||
						symbolSize: 8,
 | 
			
		||||
						data: this.getListFromTableRow(row, '_pl_ct'),
 | 
			
		||||
					}));
 | 
			
		||||
					this.chart.setOption({
 | 
			
		||||
						...this.templateOption,
 | 
			
		||||
						yAxis: { ...this.templateOption.yAxis, name: '产线CT' },
 | 
			
		||||
						series: plCt,
 | 
			
		||||
					});
 | 
			
		||||
					break;
 | 
			
		||||
				case 3:
 | 
			
		||||
					const plTt = this.tableData.map((row) => ({
 | 
			
		||||
						name: row.equName,
 | 
			
		||||
						type: 'line',
 | 
			
		||||
						symbol: 'circle',
 | 
			
		||||
						symbolSize: 8,
 | 
			
		||||
						data: this.getListFromTableRow(row, '_pl_tt'),
 | 
			
		||||
					}));
 | 
			
		||||
					this.chart.setOption({
 | 
			
		||||
						...this.templateOption,
 | 
			
		||||
						yAxis: { ...this.templateOption.yAxis, name: '产线TT' },
 | 
			
		||||
						series: plTt,
 | 
			
		||||
					});
 | 
			
		||||
					break;
 | 
			
		||||
				default:
 | 
			
		||||
					const eqCt2 = this.tableData.map((row) => ({
 | 
			
		||||
						name: row.equName,
 | 
			
		||||
						type: 'line',
 | 
			
		||||
						symbol: 'circle',
 | 
			
		||||
						symbolSize: 8,
 | 
			
		||||
						data: this.getListFromTableRow(row, '_eq_ct'),
 | 
			
		||||
					}));
 | 
			
		||||
					this.chart.setOption({
 | 
			
		||||
						...this.templateOption,
 | 
			
		||||
						yAxis: { ...this.templateOption.yAxis, name: '设备CT' },
 | 
			
		||||
						series: eqCt2,
 | 
			
		||||
					});
 | 
			
		||||
			}
 | 
			
		||||
		},
 | 
			
		||||
	},
 | 
			
		||||
};
 | 
			
		||||
</script>
 | 
			
		||||
 | 
			
		||||
<style scoped>
 | 
			
		||||
.analysis-chart {
 | 
			
		||||
	width: 100%;
 | 
			
		||||
	height: 100%;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
.analysis-chart >>> .el-button {
 | 
			
		||||
	background: #f1f1f1;
 | 
			
		||||
	color: #333;
 | 
			
		||||
	transition: all 0.3s;
 | 
			
		||||
	border: none;
 | 
			
		||||
 | 
			
		||||
	&.activeButton,
 | 
			
		||||
	&:hover {
 | 
			
		||||
		background: #0b58ff;
 | 
			
		||||
		color: #fff;
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
#chart {
 | 
			
		||||
	height: 100%;
 | 
			
		||||
	/* background: #ccc; */
 | 
			
		||||
}
 | 
			
		||||
</style>
 | 
			
		||||
							
								
								
									
										270
									
								
								src/views/core/analysis/balanceAnalysis/index copy.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										270
									
								
								src/views/core/analysis/balanceAnalysis/index copy.vue
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,270 @@
 | 
			
		||||
<template>
 | 
			
		||||
	<div class="app-container">
 | 
			
		||||
		<search-bar
 | 
			
		||||
			:formConfigs="formConfig"
 | 
			
		||||
			ref="searchBarForm"
 | 
			
		||||
			@headBtnClick="buttonClick" />
 | 
			
		||||
 | 
			
		||||
		<div v-if="tableData.length">
 | 
			
		||||
			<el-tabs
 | 
			
		||||
				v-model="activeName"
 | 
			
		||||
				@tab-click="handleTabClick"
 | 
			
		||||
				style="height: 100%">
 | 
			
		||||
				<el-tab-pane :label="'\u2002数据列表\u2002'" name="table">
 | 
			
		||||
					<!-- @emitFun="handleEmitFun"> -->
 | 
			
		||||
					<base-table
 | 
			
		||||
						v-if="mode == 'table'"
 | 
			
		||||
						:span-method="mergeColumnHandler"
 | 
			
		||||
						:page="1"
 | 
			
		||||
						:limit="999"
 | 
			
		||||
						:table-props="tableProps"
 | 
			
		||||
						:table-data="tableData" />
 | 
			
		||||
				</el-tab-pane>
 | 
			
		||||
				<el-tab-pane :label="'\u3000产线平衡分析图\u3000'" name="graph">
 | 
			
		||||
					<div class="graph" style="height: 100%">
 | 
			
		||||
						<!-- graph  -->
 | 
			
		||||
						<!-- <Graph
 | 
			
		||||
										v-if="list.length"
 | 
			
		||||
										:equipment-list="list"
 | 
			
		||||
										:render="renderKey" /> -->
 | 
			
		||||
						<BalanceChart ref="lineChart" />
 | 
			
		||||
						<div v-if="list.length == 0" class="no-data-bg"></div>
 | 
			
		||||
					</div>
 | 
			
		||||
				</el-tab-pane>
 | 
			
		||||
			</el-tabs>
 | 
			
		||||
 | 
			
		||||
			<!-- <SearchBar :formConfigs="[{ label: '产线平衡分析图', type: 'title' }]" /> -->
 | 
			
		||||
		</div>
 | 
			
		||||
		<div v-else class="no-data-bg"></div>
 | 
			
		||||
	</div>
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script>
 | 
			
		||||
import { getCT } from '@/api/core/analysis/index';
 | 
			
		||||
import { getCorePLList } from '@/api/base/coreProductionLine';
 | 
			
		||||
import BalanceChart from '../balanceChart';
 | 
			
		||||
 | 
			
		||||
export default {
 | 
			
		||||
	components: {
 | 
			
		||||
		BalanceChart,
 | 
			
		||||
	},
 | 
			
		||||
	// mixins: [basicPage],
 | 
			
		||||
	data() {
 | 
			
		||||
		return {
 | 
			
		||||
			urlOptions: {
 | 
			
		||||
				getDataListURL: getCT,
 | 
			
		||||
			},
 | 
			
		||||
			activeName: 'table',
 | 
			
		||||
			tableProps: [],
 | 
			
		||||
 | 
			
		||||
			tableData: [],
 | 
			
		||||
			listQuery: {
 | 
			
		||||
				// time: ''
 | 
			
		||||
				endTime: undefined,
 | 
			
		||||
				lineId: undefined,
 | 
			
		||||
				startTime: undefined,
 | 
			
		||||
			},
 | 
			
		||||
			timeList: [],
 | 
			
		||||
			spanArr: [],
 | 
			
		||||
			xData: [],
 | 
			
		||||
			yData: [],
 | 
			
		||||
			optionArrUrl: [getCorePLList],
 | 
			
		||||
			formConfig: [
 | 
			
		||||
				{
 | 
			
		||||
					type: 'select',
 | 
			
		||||
					label: '产线',
 | 
			
		||||
					selectOptions: [],
 | 
			
		||||
					param: 'lineIds',
 | 
			
		||||
					defaultSelect: '',
 | 
			
		||||
					multiple: false,
 | 
			
		||||
					filterable: 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',
 | 
			
		||||
				},
 | 
			
		||||
			],
 | 
			
		||||
		};
 | 
			
		||||
	},
 | 
			
		||||
	created() {
 | 
			
		||||
		this.getArr();
 | 
			
		||||
	},
 | 
			
		||||
	methods: {
 | 
			
		||||
		handleTabClick(tab, event) {
 | 
			
		||||
			if (tab.name == 'graph') this.renderKey = Math.random();
 | 
			
		||||
		},
 | 
			
		||||
 | 
			
		||||
		getArr() {
 | 
			
		||||
			const params = {
 | 
			
		||||
				page: 1,
 | 
			
		||||
				limit: 500,
 | 
			
		||||
			};
 | 
			
		||||
			this.optionArrUrl.forEach((item, index) => {
 | 
			
		||||
				item(params).then((response) => {
 | 
			
		||||
					this.formConfig[index].selectOptions = response.data;
 | 
			
		||||
				});
 | 
			
		||||
			});
 | 
			
		||||
		},
 | 
			
		||||
		setRowSpan(arr) {
 | 
			
		||||
			let count = 0;
 | 
			
		||||
			arr.forEach((item, index) => {
 | 
			
		||||
				if (index === 0) {
 | 
			
		||||
					this.spanArr.push(1);
 | 
			
		||||
				} else {
 | 
			
		||||
					if (item === arr[index - 1]) {
 | 
			
		||||
						this.spanArr[count] += 1;
 | 
			
		||||
						this.spanArr.push(0);
 | 
			
		||||
					} else {
 | 
			
		||||
						count = index;
 | 
			
		||||
						this.spanArr.push(1);
 | 
			
		||||
					}
 | 
			
		||||
				}
 | 
			
		||||
			});
 | 
			
		||||
		},
 | 
			
		||||
		/** 合并table列的规则 */
 | 
			
		||||
		mergeColumnHandler({ row, column, rowIndex, columnIndex }) {
 | 
			
		||||
			if (columnIndex == 0) {
 | 
			
		||||
				if (this.spanArr[rowIndex]) {
 | 
			
		||||
					return [
 | 
			
		||||
						this.spanArr[rowIndex], // row span
 | 
			
		||||
						1, // col span
 | 
			
		||||
					];
 | 
			
		||||
				} else {
 | 
			
		||||
					return [0, 0];
 | 
			
		||||
				}
 | 
			
		||||
			}
 | 
			
		||||
		},
 | 
			
		||||
		getData() {
 | 
			
		||||
			// this.listQuery.lineId = '1672847052717821953'
 | 
			
		||||
			// this.listQuery.startTime = '1693497600000';
 | 
			
		||||
			// this.listQuery.endTime = '1693843200000';
 | 
			
		||||
			this.urlOptions.getDataListURL(this.listQuery).then((res) => {
 | 
			
		||||
				console.log(res);
 | 
			
		||||
				let arr = [
 | 
			
		||||
					{
 | 
			
		||||
						prop: 'sectionName',
 | 
			
		||||
						label: '工段',
 | 
			
		||||
						align: 'center',
 | 
			
		||||
					},
 | 
			
		||||
					{
 | 
			
		||||
						prop: 'equName',
 | 
			
		||||
						label: '设备',
 | 
			
		||||
						align: 'center',
 | 
			
		||||
					},
 | 
			
		||||
				];
 | 
			
		||||
				let sectionArr = [];
 | 
			
		||||
				res.data.data.forEach((ele, index) => {
 | 
			
		||||
					let tempData = [];
 | 
			
		||||
					let eqData = [];
 | 
			
		||||
					let plData = [];
 | 
			
		||||
					ele.data.forEach((item, index) => {
 | 
			
		||||
						item.children.forEach((params) => {
 | 
			
		||||
							if (params.dynamicName === '设备CT') {
 | 
			
		||||
								tempData[item.dynamicName + '_eq'] = params.dynamicValue;
 | 
			
		||||
								eqData[index] = params.dynamicValue;
 | 
			
		||||
							} else {
 | 
			
		||||
								tempData[item.dynamicName + '_pl'] = params.dynamicValue;
 | 
			
		||||
								plData[index] = params.dynamicValue;
 | 
			
		||||
							}
 | 
			
		||||
						});
 | 
			
		||||
					});
 | 
			
		||||
					const equipment = {
 | 
			
		||||
						name: ele.equName,
 | 
			
		||||
						eqData: eqData,
 | 
			
		||||
						plData: plData,
 | 
			
		||||
					};
 | 
			
		||||
					tempData['equName'] = ele.equName;
 | 
			
		||||
					tempData['sectionName'] = ele.sectionName;
 | 
			
		||||
					this.tableData.push(tempData);
 | 
			
		||||
					const { sectionName } = tempData;
 | 
			
		||||
					sectionArr.push(sectionName);
 | 
			
		||||
					this.yData.push(equipment);
 | 
			
		||||
					console.log('看看equ', this.yData);
 | 
			
		||||
				});
 | 
			
		||||
				this.setRowSpan(sectionArr);
 | 
			
		||||
				res.data.nameData.forEach((item) => {
 | 
			
		||||
					this.timeList.push(item.name);
 | 
			
		||||
				});
 | 
			
		||||
				const timeArray = Array.from(new Set(this.timeList));
 | 
			
		||||
				for (const times of timeArray) {
 | 
			
		||||
					if (times !== '设备CT' && times !== '产线CT') {
 | 
			
		||||
						const subprop = {
 | 
			
		||||
							label: times,
 | 
			
		||||
							align: 'center',
 | 
			
		||||
							children: [
 | 
			
		||||
								{ prop: times + '_eq', label: '设备CT', align: 'center' },
 | 
			
		||||
								{ prop: times + '_pl', label: '产线CT', align: 'center' },
 | 
			
		||||
							],
 | 
			
		||||
						};
 | 
			
		||||
						arr.push(subprop);
 | 
			
		||||
						this.xData.push(times);
 | 
			
		||||
					}
 | 
			
		||||
				}
 | 
			
		||||
				this.tableProps = arr;
 | 
			
		||||
 | 
			
		||||
				console.log('表格横坐标', this.xData, this.yData);
 | 
			
		||||
				this.$nextTick(() => {
 | 
			
		||||
					this.$refs.lineChart.initChart(this.xData, this.yData);
 | 
			
		||||
				});
 | 
			
		||||
				// this.total = response.data.total;
 | 
			
		||||
				// this.dataListLoading = false;
 | 
			
		||||
			});
 | 
			
		||||
		},
 | 
			
		||||
		buttonClick(val) {
 | 
			
		||||
			// console.log(val)
 | 
			
		||||
			switch (val.btnName) {
 | 
			
		||||
				case 'search':
 | 
			
		||||
					// this.listQuery.pageNo = 1;
 | 
			
		||||
					// this.listQuery.pageSize = 10;
 | 
			
		||||
					this.listQuery.lineId = val.lineIds;
 | 
			
		||||
					this.listQuery.startTime = val.time
 | 
			
		||||
						? String(new Date(val.time[0]).getTime())
 | 
			
		||||
						: undefined;
 | 
			
		||||
					this.listQuery.endTime = val.time
 | 
			
		||||
						? String(new Date(val.time[1]).getTime())
 | 
			
		||||
						: undefined;
 | 
			
		||||
					if (val.time && val.lineIds) {
 | 
			
		||||
						this.tableData = [];
 | 
			
		||||
						this.xData = [];
 | 
			
		||||
						this.yData = [];
 | 
			
		||||
						this.tableProps = [];
 | 
			
		||||
						this.spanArr = [];
 | 
			
		||||
						this.timeList = [];
 | 
			
		||||
						this.getData();
 | 
			
		||||
					} else {
 | 
			
		||||
						this.$message({
 | 
			
		||||
							message: '请选择产线和时间',
 | 
			
		||||
							type: 'warning',
 | 
			
		||||
						});
 | 
			
		||||
					}
 | 
			
		||||
					break;
 | 
			
		||||
				case 'reset':
 | 
			
		||||
					this.$refs.searchBarForm.resetForm();
 | 
			
		||||
					this.listQuery = {
 | 
			
		||||
						pageSize: 10,
 | 
			
		||||
						pageNo: 1,
 | 
			
		||||
						total: 1,
 | 
			
		||||
					};
 | 
			
		||||
					this.getDataList();
 | 
			
		||||
					break;
 | 
			
		||||
				default:
 | 
			
		||||
					console.log(val);
 | 
			
		||||
			}
 | 
			
		||||
		},
 | 
			
		||||
	},
 | 
			
		||||
};
 | 
			
		||||
</script>
 | 
			
		||||
@@ -1,74 +1,74 @@
 | 
			
		||||
<template>
 | 
			
		||||
  <div class="app-container">
 | 
			
		||||
    <search-bar :formConfigs="formConfig" ref="searchBarForm" @headBtnClick="buttonClick" />
 | 
			
		||||
    <div v-if="tableData.length">
 | 
			
		||||
      <base-table v-loading="dataListLoading" :span-method="mergeColumnHandler" :table-props="tableProps" :table-data="tableData" />
 | 
			
		||||
      <SearchBar :formConfigs="[{ label: '产线平衡分析图', type: 'title' }]" />
 | 
			
		||||
      <BalanceChart ref="lineChart" />
 | 
			
		||||
	<div class="app-container" style="flex: 1; height: 1px">
 | 
			
		||||
		<search-bar
 | 
			
		||||
			:formConfigs="formConfig"
 | 
			
		||||
			ref="searchBarForm"
 | 
			
		||||
			@headBtnClick="handleSearchBarBtnClick" />
 | 
			
		||||
 | 
			
		||||
		<!-- <div v-if="tableData.length"> -->
 | 
			
		||||
		<div class="custom-tabs" style="">
 | 
			
		||||
			<el-tabs
 | 
			
		||||
				v-model="activeName"
 | 
			
		||||
				@tab-click="handleTabClick"
 | 
			
		||||
				style="height: 100%">
 | 
			
		||||
				<el-tab-pane :label="'\u2002数据列表\u2002'" name="table">
 | 
			
		||||
					<base-table
 | 
			
		||||
						v-if="activeName == 'table' && ready"
 | 
			
		||||
						:span-method="mergeRow"
 | 
			
		||||
						:page="1"
 | 
			
		||||
						:limit="999"
 | 
			
		||||
						:table-props="tableProps"
 | 
			
		||||
						:table-data="tableData" />
 | 
			
		||||
					<div v-if="tableData.length == 0" class="no-data-bg"></div>
 | 
			
		||||
				</el-tab-pane>
 | 
			
		||||
				<el-tab-pane :label="'\u3000产线平衡分析图\u3000'" name="graph">
 | 
			
		||||
					<div class="graph" style="height: 800px">
 | 
			
		||||
						<!-- graph  -->
 | 
			
		||||
						<AnalysisChart
 | 
			
		||||
							v-if="activeName == 'graph'"
 | 
			
		||||
							:table-data="tableData"
 | 
			
		||||
							:daterange="dateArr"></AnalysisChart>
 | 
			
		||||
						<!-- <div v-else class="no-data-bg"></div> -->
 | 
			
		||||
						<!-- <Graph
 | 
			
		||||
										v-if="list.length"
 | 
			
		||||
										:equipment-list="list"
 | 
			
		||||
										:render="renderKey" /> -->
 | 
			
		||||
						<!-- <BalanceChart ref="lineChart" /> -->
 | 
			
		||||
						<!-- <div v-if="list.length == 0" class="no-data-bg"></div> -->
 | 
			
		||||
					</div>
 | 
			
		||||
				</el-tab-pane>
 | 
			
		||||
			</el-tabs>
 | 
			
		||||
		</div>
 | 
			
		||||
    <div v-else class="no-data-bg"></div>
 | 
			
		||||
    <!-- <pagination
 | 
			
		||||
			:limit.sync="listQuery.pageSize"
 | 
			
		||||
			:page.sync="listQuery.pageNo"
 | 
			
		||||
			:total="listQuery.total"
 | 
			
		||||
			@pagination="getDataList" /> -->
 | 
			
		||||
	</div>
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script>
 | 
			
		||||
// import basicPage from '../../mixins/basic-page';
 | 
			
		||||
import { parseTime } from '../../mixins/code-filter';
 | 
			
		||||
import { getCT } from '@/api/core/analysis/index';
 | 
			
		||||
import { getCorePLList } from '@/api/base/coreProductionLine';
 | 
			
		||||
import BalanceChart from '../balanceChart'
 | 
			
		||||
import { time } from 'echarts';
 | 
			
		||||
// import { getWorkshopSectionPage } from '@/api/core/base/workshopSection';
 | 
			
		||||
 | 
			
		||||
// const tableProps = [
 | 
			
		||||
// 	// {
 | 
			
		||||
//   //   prop: 'lineName',
 | 
			
		||||
// 	// 	label: '产线',
 | 
			
		||||
// 	// 	align: 'center',
 | 
			
		||||
// 	// },
 | 
			
		||||
//   // {
 | 
			
		||||
//   //   prop: 'sum',
 | 
			
		||||
//   //   label: '合计',
 | 
			
		||||
//   //   align: 'center',
 | 
			
		||||
//   // },
 | 
			
		||||
//   // {
 | 
			
		||||
//   //   prop: 'dynamicValue',
 | 
			
		||||
//   //   label: 'dynamicName',
 | 
			
		||||
//   //   align: 'center',
 | 
			
		||||
//   //   children:[
 | 
			
		||||
 | 
			
		||||
//   //   ]
 | 
			
		||||
//   // }
 | 
			
		||||
// ];
 | 
			
		||||
import BalanceChart from '../balanceChart';
 | 
			
		||||
import basicPageMixin from '@/mixins/lb/basicPageMixin';
 | 
			
		||||
import AnalysisChart from './chart.vue';
 | 
			
		||||
 | 
			
		||||
export default {
 | 
			
		||||
	components: {
 | 
			
		||||
    BalanceChart
 | 
			
		||||
		BalanceChart,
 | 
			
		||||
		AnalysisChart,
 | 
			
		||||
	},
 | 
			
		||||
  // mixins: [basicPage],
 | 
			
		||||
	mixins: [basicPageMixin],
 | 
			
		||||
	data() {
 | 
			
		||||
		return {
 | 
			
		||||
      urlOptions: {
 | 
			
		||||
        getDataListURL: getCT,
 | 
			
		||||
			activeName: 'table',
 | 
			
		||||
			tableProps: [
 | 
			
		||||
				{
 | 
			
		||||
					prop: 'sectionName',
 | 
			
		||||
					label: '工段',
 | 
			
		||||
					align: 'center',
 | 
			
		||||
				},
 | 
			
		||||
      tableProps: [],
 | 
			
		||||
      dataListLoading: false,
 | 
			
		||||
				{
 | 
			
		||||
					prop: 'equName',
 | 
			
		||||
					label: '设备',
 | 
			
		||||
					align: 'center',
 | 
			
		||||
				},
 | 
			
		||||
			],
 | 
			
		||||
			tableData: [],
 | 
			
		||||
      listQuery: {
 | 
			
		||||
        // time: ''
 | 
			
		||||
        endTime: undefined,
 | 
			
		||||
        lineId:undefined,
 | 
			
		||||
        startTime:undefined
 | 
			
		||||
      },
 | 
			
		||||
      timeList: [],
 | 
			
		||||
      spanArr: [], 
 | 
			
		||||
      xData: [],
 | 
			
		||||
      yData: [],
 | 
			
		||||
      optionArrUrl: [getCorePLList],
 | 
			
		||||
			formConfig: [
 | 
			
		||||
				{
 | 
			
		||||
					type: 'select',
 | 
			
		||||
@@ -82,74 +82,223 @@ export default {
 | 
			
		||||
				{
 | 
			
		||||
					type: 'datePicker',
 | 
			
		||||
					label: '时间',
 | 
			
		||||
          dateType: 'datetimerange',
 | 
			
		||||
          format: 'yyyy-MM-dd',
 | 
			
		||||
          valueFormat: 'yyyy-MM-dd HH:mm:ss',
 | 
			
		||||
					dateType: 'monthrange',
 | 
			
		||||
					format: 'yyyy-MM',
 | 
			
		||||
					valueFormat: 'yyyy-MM-ddTHH:mm:ss',
 | 
			
		||||
					rangeSeparator: '-',
 | 
			
		||||
					startPlaceholder: '开始时间',
 | 
			
		||||
					endPlaceholder: '结束时间',
 | 
			
		||||
          width: 350,
 | 
			
		||||
          param: 'time',
 | 
			
		||||
					width: 240,
 | 
			
		||||
					param: 'timeArr',
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					type: 'button',
 | 
			
		||||
					btnName: '查询',
 | 
			
		||||
					name: 'search',
 | 
			
		||||
					color: 'primary',
 | 
			
		||||
        }
 | 
			
		||||
				},
 | 
			
		||||
			],
 | 
			
		||||
			queryParams: {
 | 
			
		||||
				lineId: null,
 | 
			
		||||
				startTime: null,
 | 
			
		||||
				endTime: null,
 | 
			
		||||
			},
 | 
			
		||||
			sectionMap: {},
 | 
			
		||||
			lastSection: null,
 | 
			
		||||
			currRowIndex: 0,
 | 
			
		||||
			spanArr: [],
 | 
			
		||||
			// 保存时间列表
 | 
			
		||||
			dateArr: [],
 | 
			
		||||
			ready: false,
 | 
			
		||||
		};
 | 
			
		||||
	},
 | 
			
		||||
  created() {
 | 
			
		||||
    this.getArr();
 | 
			
		||||
 | 
			
		||||
	mounted() {
 | 
			
		||||
		this.getLine();
 | 
			
		||||
	},
 | 
			
		||||
 | 
			
		||||
	methods: {
 | 
			
		||||
    getArr() {
 | 
			
		||||
      const params = {
 | 
			
		||||
        page: 1,
 | 
			
		||||
        limit: 500
 | 
			
		||||
      }
 | 
			
		||||
      this.optionArrUrl.forEach((item, index) => {
 | 
			
		||||
        item(params).then((response) => {
 | 
			
		||||
          this.formConfig[index].selectOptions = response.data
 | 
			
		||||
        });
 | 
			
		||||
      });
 | 
			
		||||
		handleTabClick(tab, event) {
 | 
			
		||||
			if (tab.name == 'graph') this.renderKey = Math.random();
 | 
			
		||||
		},
 | 
			
		||||
    setRowSpan(arr) {
 | 
			
		||||
      let count = 0
 | 
			
		||||
      arr.forEach((item, index) => {
 | 
			
		||||
        if(index === 0) {
 | 
			
		||||
          this.spanArr.push(1)
 | 
			
		||||
        } else {
 | 
			
		||||
          if (item === arr[index - 1]) {
 | 
			
		||||
            this.spanArr[count] += 1
 | 
			
		||||
            this.spanArr.push(0)
 | 
			
		||||
          } else {
 | 
			
		||||
            count = index
 | 
			
		||||
            this.spanArr.push(1)
 | 
			
		||||
          }
 | 
			
		||||
        }
 | 
			
		||||
      })
 | 
			
		||||
 | 
			
		||||
		/** 初始化 tableProps */
 | 
			
		||||
		initTableProps() {
 | 
			
		||||
			this.tableProps = [
 | 
			
		||||
				{
 | 
			
		||||
					prop: 'sectionName',
 | 
			
		||||
					label: '工段',
 | 
			
		||||
					align: 'center',
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					prop: 'equName',
 | 
			
		||||
					label: '设备',
 | 
			
		||||
					align: 'center',
 | 
			
		||||
				},
 | 
			
		||||
    /** 合并table列的规则 */
 | 
			
		||||
		mergeColumnHandler({ row, column, rowIndex, columnIndex }) {
 | 
			
		||||
			if (columnIndex == 0) {
 | 
			
		||||
				if (this.spanArr[rowIndex]) {
 | 
			
		||||
					return [
 | 
			
		||||
						this.spanArr[rowIndex], // row span
 | 
			
		||||
						1, // col span
 | 
			
		||||
			];
 | 
			
		||||
				} else {
 | 
			
		||||
		},
 | 
			
		||||
 | 
			
		||||
		/** 获取产线 */
 | 
			
		||||
		async getLine() {
 | 
			
		||||
			this.formConfig[0].selectOptions = [];
 | 
			
		||||
			const { code, data } = await this.http(
 | 
			
		||||
				'/base/core-production-line/listAll',
 | 
			
		||||
				'get'
 | 
			
		||||
			);
 | 
			
		||||
			if (code == 0) {
 | 
			
		||||
				this.formConfig[0].selectOptions = data;
 | 
			
		||||
			}
 | 
			
		||||
		},
 | 
			
		||||
 | 
			
		||||
		/** 获取产线平衡数据 */
 | 
			
		||||
		async getCT() {
 | 
			
		||||
			const { code, data } = await this.http(
 | 
			
		||||
				'/analysis/equipment-analysis/getCT',
 | 
			
		||||
				'post',
 | 
			
		||||
				this.queryParams
 | 
			
		||||
			);
 | 
			
		||||
			if (code == 0) {
 | 
			
		||||
				return data;
 | 
			
		||||
			}
 | 
			
		||||
			return { data: [], nameData: [] };
 | 
			
		||||
		},
 | 
			
		||||
 | 
			
		||||
		/** 解析数据 */
 | 
			
		||||
		async getList() {
 | 
			
		||||
			const { data, nameData } = await this.getCT();
 | 
			
		||||
			await this.buildProps(nameData);
 | 
			
		||||
			await this.buildTableData(data);
 | 
			
		||||
			this.tableData = this.tableData.sort((a, b) => {
 | 
			
		||||
				if (a.sectionName < b.sectionName) return -1;
 | 
			
		||||
				return 1;
 | 
			
		||||
			});
 | 
			
		||||
			// const p = this.tableProps
 | 
			
		||||
			// const d = this.tableData
 | 
			
		||||
			// debugger;
 | 
			
		||||
			this.ready = true;
 | 
			
		||||
		},
 | 
			
		||||
 | 
			
		||||
		buildProps(nameData) {
 | 
			
		||||
			this.initTableProps();
 | 
			
		||||
			this.dateArr = [];
 | 
			
		||||
			return new Promise((resolve, reject) => {
 | 
			
		||||
				try {
 | 
			
		||||
					const dateArr = Array.from(
 | 
			
		||||
						new Set(
 | 
			
		||||
							nameData
 | 
			
		||||
								.map((item) => (item.tree == 1 ? item.name : undefined))
 | 
			
		||||
								.filter((v) => v)
 | 
			
		||||
						)
 | 
			
		||||
					);
 | 
			
		||||
					// 排个序
 | 
			
		||||
					dateArr.sort().forEach((date) => {
 | 
			
		||||
						this.tableProps.push({
 | 
			
		||||
							label: date,
 | 
			
		||||
							align: 'center',
 | 
			
		||||
							children: [
 | 
			
		||||
								{
 | 
			
		||||
									prop: date + '_eq_ct',
 | 
			
		||||
									label: '设备CT',
 | 
			
		||||
									align: 'center',
 | 
			
		||||
								},
 | 
			
		||||
								{
 | 
			
		||||
									prop: date + '_eq_tt',
 | 
			
		||||
									label: '设备TT',
 | 
			
		||||
									align: 'center',
 | 
			
		||||
								},
 | 
			
		||||
								{
 | 
			
		||||
									prop: date + '_pl_ct',
 | 
			
		||||
									label: '产线CT',
 | 
			
		||||
									align: 'center',
 | 
			
		||||
								},
 | 
			
		||||
								{
 | 
			
		||||
									prop: date + '_pl_tt',
 | 
			
		||||
									label: '产线TT',
 | 
			
		||||
									align: 'center',
 | 
			
		||||
								},
 | 
			
		||||
							],
 | 
			
		||||
						});
 | 
			
		||||
					});
 | 
			
		||||
					this.dateArr = dateArr;
 | 
			
		||||
					resolve();
 | 
			
		||||
				} catch (err) {
 | 
			
		||||
					reject(err);
 | 
			
		||||
				}
 | 
			
		||||
			});
 | 
			
		||||
		},
 | 
			
		||||
 | 
			
		||||
		async buildTableData(data) {
 | 
			
		||||
			this.tableData = [];
 | 
			
		||||
			const sectionArr = Array.from(
 | 
			
		||||
				new Set(data.map((item) => item.sectionName))
 | 
			
		||||
			).sort();
 | 
			
		||||
 | 
			
		||||
			const sectionMap = sectionArr.reduce(
 | 
			
		||||
				(sum, curr) => ({ ...sum, [curr]: 0 }),
 | 
			
		||||
				{}
 | 
			
		||||
			);
 | 
			
		||||
 | 
			
		||||
			console.log('sectionArr', sectionArr);
 | 
			
		||||
			console.log('sectionMap', sectionMap);
 | 
			
		||||
			let spanArr = Array.from(sectionArr, () => 0);
 | 
			
		||||
 | 
			
		||||
			return new Promise((resolve, reject) => {
 | 
			
		||||
				/** 处理 工段 分组  */
 | 
			
		||||
				data.map((item) => {
 | 
			
		||||
					sectionMap[item.sectionName]++;
 | 
			
		||||
					/** 处理 设备  */
 | 
			
		||||
					const row = {
 | 
			
		||||
						equName: item.equName,
 | 
			
		||||
						sectionName: item.sectionName,
 | 
			
		||||
					};
 | 
			
		||||
					item.data.forEach((eq) => {
 | 
			
		||||
						const date = eq.dynamicName;
 | 
			
		||||
						eq.children.forEach((sub) => {
 | 
			
		||||
							if (sub.dynamicName == '设备CT')
 | 
			
		||||
								row[date + '_eq_ct'] = sub.dynamicValue;
 | 
			
		||||
							if (sub.dynamicName == '设备TT')
 | 
			
		||||
								row[date + '_eq_tt'] = sub.dynamicValue;
 | 
			
		||||
							if (sub.dynamicName == '产线CT')
 | 
			
		||||
								row[date + '_pl_ct'] = sub.dynamicValue;
 | 
			
		||||
							if (sub.dynamicName == '产线TT')
 | 
			
		||||
								row[date + '_pl_tt'] = sub.dynamicValue;
 | 
			
		||||
						});
 | 
			
		||||
					});
 | 
			
		||||
					this.tableData.push(row);
 | 
			
		||||
				});
 | 
			
		||||
 | 
			
		||||
				/** 生成span数组 */
 | 
			
		||||
				const tmp = [...spanArr];
 | 
			
		||||
				for (const [index, key] of sectionArr.entries()) {
 | 
			
		||||
					tmp[index + 1] = tmp[index] + sectionMap[key];
 | 
			
		||||
				}
 | 
			
		||||
 | 
			
		||||
				console.log('tep', tmp);
 | 
			
		||||
				spanArr = tmp;
 | 
			
		||||
 | 
			
		||||
				this.sectionMap = sectionMap;
 | 
			
		||||
				this.spanArr = spanArr;
 | 
			
		||||
				resolve();
 | 
			
		||||
			});
 | 
			
		||||
		},
 | 
			
		||||
 | 
			
		||||
		mergeRow({ row, column, rowIndex, columnIndex }) {
 | 
			
		||||
			if (columnIndex == 1) {
 | 
			
		||||
				const span = this.sectionMap[row.sectionName];
 | 
			
		||||
				if (this.spanArr.includes(rowIndex)) {
 | 
			
		||||
					console.log('span...');
 | 
			
		||||
					return [span, 1];
 | 
			
		||||
				}
 | 
			
		||||
				return [0, 0];
 | 
			
		||||
			}
 | 
			
		||||
			}
 | 
			
		||||
		},
 | 
			
		||||
 | 
			
		||||
		getData() {
 | 
			
		||||
			// this.listQuery.lineId = '1672847052717821953'
 | 
			
		||||
			// this.listQuery.startTime = '1693497600000';
 | 
			
		||||
			// this.listQuery.endTime = '1693843200000';
 | 
			
		||||
      this.urlOptions.getDataListURL(this.listQuery).then(res => {
 | 
			
		||||
        console.log(res)
 | 
			
		||||
			this.urlOptions.getDataListURL(this.listQuery).then((res) => {
 | 
			
		||||
				console.log(res);
 | 
			
		||||
				let arr = [
 | 
			
		||||
					{
 | 
			
		||||
						prop: 'sectionName',
 | 
			
		||||
@@ -160,42 +309,42 @@ export default {
 | 
			
		||||
						prop: 'equName',
 | 
			
		||||
						label: '设备',
 | 
			
		||||
						align: 'center',
 | 
			
		||||
          }
 | 
			
		||||
        ]
 | 
			
		||||
        let sectionArr= []
 | 
			
		||||
					},
 | 
			
		||||
				];
 | 
			
		||||
				let sectionArr = [];
 | 
			
		||||
				res.data.data.forEach((ele, index) => {
 | 
			
		||||
          let tempData = []
 | 
			
		||||
          let eqData = []
 | 
			
		||||
            let plData = []
 | 
			
		||||
					let tempData = [];
 | 
			
		||||
					let eqData = [];
 | 
			
		||||
					let plData = [];
 | 
			
		||||
					ele.data.forEach((item, index) => {
 | 
			
		||||
            item.children.forEach(params => {
 | 
			
		||||
						item.children.forEach((params) => {
 | 
			
		||||
							if (params.dynamicName === '设备CT') {
 | 
			
		||||
                tempData[item.dynamicName + '_eq'] = params.dynamicValue
 | 
			
		||||
                eqData[index] = params.dynamicValue
 | 
			
		||||
								tempData[item.dynamicName + '_eq'] = params.dynamicValue;
 | 
			
		||||
								eqData[index] = params.dynamicValue;
 | 
			
		||||
							} else {
 | 
			
		||||
                tempData[item.dynamicName + '_pl'] = params.dynamicValue
 | 
			
		||||
                plData[index] = params.dynamicValue
 | 
			
		||||
								tempData[item.dynamicName + '_pl'] = params.dynamicValue;
 | 
			
		||||
								plData[index] = params.dynamicValue;
 | 
			
		||||
							}
 | 
			
		||||
            })
 | 
			
		||||
          })
 | 
			
		||||
						});
 | 
			
		||||
					});
 | 
			
		||||
					const equipment = {
 | 
			
		||||
						name: ele.equName,
 | 
			
		||||
						eqData: eqData,
 | 
			
		||||
            plData: plData
 | 
			
		||||
          }
 | 
			
		||||
          tempData['equName'] = ele.equName
 | 
			
		||||
          tempData['sectionName'] = ele.sectionName
 | 
			
		||||
          this.tableData.push(tempData)
 | 
			
		||||
          const { sectionName } = tempData
 | 
			
		||||
          sectionArr.push(sectionName)
 | 
			
		||||
          this.yData.push(equipment)
 | 
			
		||||
          console.log('看看equ', this.yData)
 | 
			
		||||
        })
 | 
			
		||||
        this.setRowSpan(sectionArr)
 | 
			
		||||
        res.data.nameData.forEach(item => {
 | 
			
		||||
          this.timeList.push(item.name)
 | 
			
		||||
        })
 | 
			
		||||
        const timeArray = Array.from(new Set(this.timeList))
 | 
			
		||||
						plData: plData,
 | 
			
		||||
					};
 | 
			
		||||
					tempData['equName'] = ele.equName;
 | 
			
		||||
					tempData['sectionName'] = ele.sectionName;
 | 
			
		||||
					this.tableData.push(tempData);
 | 
			
		||||
					const { sectionName } = tempData;
 | 
			
		||||
					sectionArr.push(sectionName);
 | 
			
		||||
					this.yData.push(equipment);
 | 
			
		||||
					console.log('看看equ', this.yData);
 | 
			
		||||
				});
 | 
			
		||||
				this.setRowSpan(sectionArr);
 | 
			
		||||
				res.data.nameData.forEach((item) => {
 | 
			
		||||
					this.timeList.push(item.name);
 | 
			
		||||
				});
 | 
			
		||||
				const timeArray = Array.from(new Set(this.timeList));
 | 
			
		||||
				for (const times of timeArray) {
 | 
			
		||||
					if (times !== '设备CT' && times !== '产线CT') {
 | 
			
		||||
						const subprop = {
 | 
			
		||||
@@ -203,44 +352,67 @@ export default {
 | 
			
		||||
							align: 'center',
 | 
			
		||||
							children: [
 | 
			
		||||
								{ prop: times + '_eq', label: '设备CT', align: 'center' },
 | 
			
		||||
                { prop: times + '_pl', label: '产线CT', align: 'center' }
 | 
			
		||||
              ]
 | 
			
		||||
            }
 | 
			
		||||
            arr.push(subprop)
 | 
			
		||||
            this.xData.push(times)
 | 
			
		||||
								{ prop: times + '_pl', label: '产线CT', align: 'center' },
 | 
			
		||||
							],
 | 
			
		||||
						};
 | 
			
		||||
						arr.push(subprop);
 | 
			
		||||
						this.xData.push(times);
 | 
			
		||||
					}
 | 
			
		||||
				}
 | 
			
		||||
        this.tableProps = arr
 | 
			
		||||
				this.tableProps = arr;
 | 
			
		||||
 | 
			
		||||
        console.log('表格横坐标', this.xData, this.yData)
 | 
			
		||||
				console.log('表格横坐标', this.xData, this.yData);
 | 
			
		||||
				this.$nextTick(() => {
 | 
			
		||||
          this.$refs.lineChart.initChart(this.xData, this.yData)
 | 
			
		||||
        })
 | 
			
		||||
					this.$refs.lineChart.initChart(this.xData, this.yData);
 | 
			
		||||
				});
 | 
			
		||||
				// this.total = response.data.total;
 | 
			
		||||
				// this.dataListLoading = false;
 | 
			
		||||
			});
 | 
			
		||||
		},
 | 
			
		||||
 | 
			
		||||
		handleSearchBarBtnClick(btn) {
 | 
			
		||||
			switch (btn.btnName) {
 | 
			
		||||
				case 'search':
 | 
			
		||||
					this.queryParams.lineId = btn.lineIds || null;
 | 
			
		||||
					this.queryParams.startTime = btn.timeArr ? btn.timeArr[0] : null;
 | 
			
		||||
					this.queryParams.endTime = btn.timeArr ? btn.timeArr[1] : null;
 | 
			
		||||
 | 
			
		||||
					if (!btn.lineIds || !btn.timeArr.length) {
 | 
			
		||||
						this.$message({
 | 
			
		||||
							message: '请选择产线和时间',
 | 
			
		||||
							type: 'warning',
 | 
			
		||||
						});
 | 
			
		||||
					}
 | 
			
		||||
					this.getList();
 | 
			
		||||
					break;
 | 
			
		||||
			}
 | 
			
		||||
		},
 | 
			
		||||
 | 
			
		||||
		buttonClick(val) {
 | 
			
		||||
			// console.log(val)
 | 
			
		||||
			switch (val.btnName) {
 | 
			
		||||
				case 'search':
 | 
			
		||||
					// this.listQuery.pageNo = 1;
 | 
			
		||||
					// this.listQuery.pageSize = 10;
 | 
			
		||||
          this.listQuery.lineId = val.lineIds
 | 
			
		||||
          this.listQuery.startTime = val.time ? String(new Date(val.time[0]).getTime()) : undefined;
 | 
			
		||||
          this.listQuery.endTime = val.time ? String(new Date(val.time[1]).getTime()) : undefined;
 | 
			
		||||
					this.listQuery.lineId = val.lineIds;
 | 
			
		||||
					this.listQuery.startTime = val.time
 | 
			
		||||
						? String(new Date(val.time[0]).getTime())
 | 
			
		||||
						: undefined;
 | 
			
		||||
					this.listQuery.endTime = val.time
 | 
			
		||||
						? String(new Date(val.time[1]).getTime())
 | 
			
		||||
						: undefined;
 | 
			
		||||
					if (val.time && val.lineIds) {
 | 
			
		||||
            this.tableData = []
 | 
			
		||||
            this.xData = []
 | 
			
		||||
            this.yData = []
 | 
			
		||||
            this.tableProps = []
 | 
			
		||||
            this.spanArr = []
 | 
			
		||||
            this.timeList = []
 | 
			
		||||
            this.getData()
 | 
			
		||||
						this.tableData = [];
 | 
			
		||||
						this.xData = [];
 | 
			
		||||
						this.yData = [];
 | 
			
		||||
						this.tableProps = [];
 | 
			
		||||
						this.spanArr = [];
 | 
			
		||||
						this.timeList = [];
 | 
			
		||||
						this.getData();
 | 
			
		||||
					} else {
 | 
			
		||||
						this.$message({
 | 
			
		||||
							message: '请选择产线和时间',
 | 
			
		||||
              type: 'warning'
 | 
			
		||||
							type: 'warning',
 | 
			
		||||
						});
 | 
			
		||||
					}
 | 
			
		||||
					break;
 | 
			
		||||
@@ -260,3 +432,23 @@ export default {
 | 
			
		||||
	},
 | 
			
		||||
};
 | 
			
		||||
</script>
 | 
			
		||||
<style scoped>
 | 
			
		||||
.custom-tabs >>> .el-tabs__header {
 | 
			
		||||
	margin-bottom: 8px;
 | 
			
		||||
	display: inline-block;
 | 
			
		||||
	transform: translateY(-12px);
 | 
			
		||||
}
 | 
			
		||||
.custom-tabs >>> .el-tabs__item {
 | 
			
		||||
	padding-left: 0px !important;
 | 
			
		||||
	padding-right: 0px !important;
 | 
			
		||||
	line-height: 36px !important;
 | 
			
		||||
	height: 36px;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
.custom-tabs >>> .el-tabs__content {
 | 
			
		||||
	height: calc(100% - 42px);
 | 
			
		||||
}
 | 
			
		||||
.custom-tabs >>> .el-tab-pane {
 | 
			
		||||
	height: 100%;
 | 
			
		||||
}
 | 
			
		||||
</style>
 | 
			
		||||
 
 | 
			
		||||
@@ -6,17 +6,27 @@
 | 
			
		||||
 * @Description:
 | 
			
		||||
-->
 | 
			
		||||
<template>
 | 
			
		||||
  <div>
 | 
			
		||||
	<div class="balace-chart">
 | 
			
		||||
		<div style="margin: 20px">
 | 
			
		||||
      <el-button v-for="(item, index) in buttonList" :key="index" :class="[item.actived ? 'activeButton': 'normalButton']" @click="changeChart(index)">{{ item.name }}</el-button>
 | 
			
		||||
			<el-button
 | 
			
		||||
				v-for="(item, index) in buttonList"
 | 
			
		||||
				:key="index"
 | 
			
		||||
				:class="[item.actived ? 'activeButton' : '']"
 | 
			
		||||
				@click="changeChart(index)">
 | 
			
		||||
				{{ item.name }}
 | 
			
		||||
			</el-button>
 | 
			
		||||
		</div>
 | 
			
		||||
    <div id="chart" ref="chartDiv" :class="className" :style="{height:height,width:width}" />
 | 
			
		||||
		<div
 | 
			
		||||
			id="chart"
 | 
			
		||||
			ref="chartDiv"
 | 
			
		||||
			:class="className"
 | 
			
		||||
			:style="{ height: height, width: width }" />
 | 
			
		||||
	</div>
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script>
 | 
			
		||||
import * as echarts from 'echarts'
 | 
			
		||||
require('echarts/theme/macarons') // echarts theme
 | 
			
		||||
import * as echarts from 'echarts';
 | 
			
		||||
require('echarts/theme/macarons'); // echarts theme
 | 
			
		||||
// import resize from './mixins/resize'
 | 
			
		||||
 | 
			
		||||
export default {
 | 
			
		||||
@@ -24,15 +34,15 @@ export default {
 | 
			
		||||
	props: {
 | 
			
		||||
		className: {
 | 
			
		||||
			type: String,
 | 
			
		||||
      default: 'chart'
 | 
			
		||||
			default: 'chart',
 | 
			
		||||
		},
 | 
			
		||||
		width: {
 | 
			
		||||
			type: String,
 | 
			
		||||
      default: '100%'
 | 
			
		||||
			default: '100%',
 | 
			
		||||
		},
 | 
			
		||||
		height: {
 | 
			
		||||
			type: String,
 | 
			
		||||
      default: '350px'
 | 
			
		||||
			default: '350px',
 | 
			
		||||
		},
 | 
			
		||||
		// autoResize: {
 | 
			
		||||
		//   type: Boolean,
 | 
			
		||||
@@ -44,44 +54,47 @@ export default {
 | 
			
		||||
			chart: null,
 | 
			
		||||
			dataArray: [],
 | 
			
		||||
			xDatas: [],
 | 
			
		||||
      buttonList: []
 | 
			
		||||
    }
 | 
			
		||||
			buttonList: [],
 | 
			
		||||
		};
 | 
			
		||||
	},
 | 
			
		||||
	mounted() {
 | 
			
		||||
		// this.initChart()
 | 
			
		||||
		this.$nextTick(() => {
 | 
			
		||||
			this.changeChart(0);
 | 
			
		||||
		});
 | 
			
		||||
	},
 | 
			
		||||
	methods: {
 | 
			
		||||
		changeChart(index) {
 | 
			
		||||
      this.setOptions(this.xDatas, this.dataArray[index])
 | 
			
		||||
			this.setOptions(this.xDatas, this.dataArray[index]);
 | 
			
		||||
			this.buttonList.forEach((item, s) => {
 | 
			
		||||
				if (index === s) {
 | 
			
		||||
					// item.actived = true
 | 
			
		||||
          this.$nextTick(() =>{
 | 
			
		||||
					this.$nextTick(() => {
 | 
			
		||||
						// item.actived = true
 | 
			
		||||
            this.$set(item, 'actived', true)
 | 
			
		||||
          })
 | 
			
		||||
						this.$set(item, 'actived', true);
 | 
			
		||||
					});
 | 
			
		||||
				} else {
 | 
			
		||||
					// item.actived = false
 | 
			
		||||
          this.$nextTick(() =>{
 | 
			
		||||
					this.$nextTick(() => {
 | 
			
		||||
						// item.actived = false
 | 
			
		||||
            this.$set(item, 'actived', false)
 | 
			
		||||
          })
 | 
			
		||||
						this.$set(item, 'actived', false);
 | 
			
		||||
					});
 | 
			
		||||
					// this.$set(item, 'actived', false)
 | 
			
		||||
				}
 | 
			
		||||
      })
 | 
			
		||||
      console.log('看一下数22222据', this.dataArray)
 | 
			
		||||
			});
 | 
			
		||||
			console.log('看一下数22222据', this.dataArray);
 | 
			
		||||
		},
 | 
			
		||||
		initChart(xData, yData, lineName) {
 | 
			
		||||
      this.dataArray = yData
 | 
			
		||||
			this.dataArray = yData;
 | 
			
		||||
			this.buttonList = this.dataArray.map((item, index) => {
 | 
			
		||||
				return {
 | 
			
		||||
          'name': item.name,
 | 
			
		||||
          'actived': index === 0 ? true : false
 | 
			
		||||
        }
 | 
			
		||||
      })
 | 
			
		||||
      console.log('看一下数据', this.dataArray)
 | 
			
		||||
      this.xDatas = xData
 | 
			
		||||
      this.chart = echarts.init(this.$refs.chartDiv, 'macarons')
 | 
			
		||||
					name: item.name,
 | 
			
		||||
					actived: index === 0 ? true : false,
 | 
			
		||||
				};
 | 
			
		||||
			});
 | 
			
		||||
			console.log('看一下数据', this.dataArray);
 | 
			
		||||
			this.xDatas = xData;
 | 
			
		||||
			this.chart = echarts.init(this.$refs.chartDiv, 'macarons');
 | 
			
		||||
			// this.chart = echarts.init(document.getElementById('chart'), 'macarons')
 | 
			
		||||
			// this.setOptions(xData, yData[0], lineName)
 | 
			
		||||
		},
 | 
			
		||||
@@ -97,16 +110,16 @@ export default {
 | 
			
		||||
			this.chart.setOption({
 | 
			
		||||
				xAxis: {
 | 
			
		||||
					type: 'category',
 | 
			
		||||
          data: xData
 | 
			
		||||
					data: xData,
 | 
			
		||||
				},
 | 
			
		||||
				tooltip: {
 | 
			
		||||
          trigger: 'axis'
 | 
			
		||||
					trigger: 'axis',
 | 
			
		||||
				},
 | 
			
		||||
				legend: {
 | 
			
		||||
          data:lineName
 | 
			
		||||
					data: lineName,
 | 
			
		||||
				},
 | 
			
		||||
				yAxis: {
 | 
			
		||||
          type: 'value'
 | 
			
		||||
					type: 'value',
 | 
			
		||||
				},
 | 
			
		||||
				series: [
 | 
			
		||||
					{
 | 
			
		||||
@@ -118,19 +131,25 @@ export default {
 | 
			
		||||
						name: '产线CT',
 | 
			
		||||
						data: dataList.plData,
 | 
			
		||||
						type: 'line',
 | 
			
		||||
          }
 | 
			
		||||
        ]
 | 
			
		||||
      })
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
					},
 | 
			
		||||
				],
 | 
			
		||||
			});
 | 
			
		||||
		},
 | 
			
		||||
	},
 | 
			
		||||
};
 | 
			
		||||
</script>
 | 
			
		||||
 | 
			
		||||
<style scoped>
 | 
			
		||||
.activeButton {
 | 
			
		||||
  background-color: rgb(93,159,255);
 | 
			
		||||
}
 | 
			
		||||
.normalButton {
 | 
			
		||||
  background-color: none;
 | 
			
		||||
.balace-chart >>> .el-button {
 | 
			
		||||
	background: #e3e3e3;
 | 
			
		||||
	color: #333;
 | 
			
		||||
	transition: all 0.3s;
 | 
			
		||||
	border: none;
 | 
			
		||||
 | 
			
		||||
	&.activeButton,
 | 
			
		||||
	&:hover {
 | 
			
		||||
		background: #0b58ff;
 | 
			
		||||
		color: #fff;
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
</style>
 | 
			
		||||
 
 | 
			
		||||
@@ -110,7 +110,7 @@ export default {
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					type: 'button',
 | 
			
		||||
					btnName: '搜索',
 | 
			
		||||
					btnName: '查询',
 | 
			
		||||
					name: 'search',
 | 
			
		||||
					color: 'primary',
 | 
			
		||||
				},
 | 
			
		||||
@@ -149,6 +149,27 @@ export default {
 | 
			
		||||
	},
 | 
			
		||||
	created() {},
 | 
			
		||||
	methods: {
 | 
			
		||||
		// 删除
 | 
			
		||||
    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(() => { });
 | 
			
		||||
    },
 | 
			
		||||
		buttonClick(val) {
 | 
			
		||||
			switch (val.btnName) {
 | 
			
		||||
				case 'search':
 | 
			
		||||
 
 | 
			
		||||
@@ -1,9 +1,9 @@
 | 
			
		||||
<template>
 | 
			
		||||
  <el-form ref="addOrUpdate" :rules="rules" label-width="130px" :model="form">
 | 
			
		||||
    <el-row>
 | 
			
		||||
      <el-col :span='12'>
 | 
			
		||||
  <el-form ref="addOrUpdate" :rules="rules" label-width="130px" :model="form" label-position='top'>
 | 
			
		||||
    <el-row :gutter="20">
 | 
			
		||||
      <el-col :span='6'>
 | 
			
		||||
        <el-form-item label="订单名" prop="orderId">
 | 
			
		||||
          <el-select v-model="form.orderId" placeholder="请选择" style="width: 100%;">
 | 
			
		||||
          <el-select v-model="form.orderId" placeholder="请选择" style="width: 100%;" filterable>
 | 
			
		||||
            <el-option
 | 
			
		||||
              v-for="item in orderList"
 | 
			
		||||
              :key="item.id"
 | 
			
		||||
@@ -13,14 +13,12 @@
 | 
			
		||||
          </el-select>
 | 
			
		||||
        </el-form-item>
 | 
			
		||||
      </el-col>
 | 
			
		||||
      <el-col :span='12'>
 | 
			
		||||
      <el-col :span='6'>
 | 
			
		||||
        <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-col :span='6'>
 | 
			
		||||
        <el-form-item label="发货时间" prop="deliveryTime">
 | 
			
		||||
          <el-date-picker
 | 
			
		||||
            v-model="form.deliveryTime"
 | 
			
		||||
@@ -32,16 +30,16 @@
 | 
			
		||||
          </el-date-picker>
 | 
			
		||||
        </el-form-item>
 | 
			
		||||
      </el-col>
 | 
			
		||||
      <el-col :span='12'>
 | 
			
		||||
      <el-col :span='6'>
 | 
			
		||||
        <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-row :gutter="20">
 | 
			
		||||
      <el-col :span='6'>
 | 
			
		||||
        <el-form-item label="发货负责人" prop="deliveryPersonId">
 | 
			
		||||
          <el-select v-model="form.deliveryPersonId" placeholder="请选择" style="width: 100%;">
 | 
			
		||||
          <el-select v-model="form.deliveryPersonId" placeholder="请选择" style="width: 100%;" filterable>
 | 
			
		||||
            <el-option
 | 
			
		||||
              v-for="item in personList"
 | 
			
		||||
              :key="item.id"
 | 
			
		||||
@@ -51,21 +49,19 @@
 | 
			
		||||
          </el-select>
 | 
			
		||||
        </el-form-item>
 | 
			
		||||
      </el-col>
 | 
			
		||||
      <el-col :span='12'>
 | 
			
		||||
      <el-col :span='6'>
 | 
			
		||||
        <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-col :span='6'>
 | 
			
		||||
        <el-form-item label="运输联系方式" prop="principalCall">
 | 
			
		||||
          <el-input v-model="form.principalCall"></el-input>
 | 
			
		||||
        </el-form-item>
 | 
			
		||||
      </el-col>
 | 
			
		||||
      <el-col :span='12'>
 | 
			
		||||
      <el-col :span='6'>
 | 
			
		||||
        <el-form-item label="运输费用" prop="principalCost">
 | 
			
		||||
          <el-input-number v-model="form.principalCost" :min="0" :max='9999999999' :precision='2'></el-input-number>
 | 
			
		||||
          <el-input-number v-model="form.principalCost" :min="0" :max='9999999999' :precision='2' style='width: 100%;'></el-input-number>
 | 
			
		||||
        </el-form-item>
 | 
			
		||||
      </el-col>
 | 
			
		||||
    </el-row>
 | 
			
		||||
@@ -79,9 +75,8 @@
 | 
			
		||||
  </el-form>
 | 
			
		||||
</template>
 | 
			
		||||
<script>
 | 
			
		||||
import { orderList } from '@/api/base/orderManage'
 | 
			
		||||
import { getWorkerList } from '@/api/base/worker'
 | 
			
		||||
import { deliveryLogCreate, deliveryLogUpdate, getDeliveryLog } from '@/api/base/delivery'
 | 
			
		||||
import { deliveryLogCreate, deliveryLogUpdate, getDeliveryLog, listOrderList } from '@/api/base/delivery'
 | 
			
		||||
export default {
 | 
			
		||||
  name: 'AddOrUpdate',
 | 
			
		||||
  data() {
 | 
			
		||||
@@ -120,7 +115,7 @@ export default {
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
    getSelectList() {
 | 
			
		||||
      orderList().then(res => {
 | 
			
		||||
      listOrderList().then(res => {
 | 
			
		||||
        this.orderList = res.data || []
 | 
			
		||||
      })
 | 
			
		||||
      getWorkerList().then(res => {
 | 
			
		||||
 
 | 
			
		||||
@@ -2,10 +2,11 @@
 | 
			
		||||
  <div>
 | 
			
		||||
    <el-drawer
 | 
			
		||||
      title="发货清单详情"
 | 
			
		||||
      size="60%"
 | 
			
		||||
      size="65%"
 | 
			
		||||
      :append-to-body="true"
 | 
			
		||||
      :visible.sync="centervisible"
 | 
			
		||||
      @close='close'>
 | 
			
		||||
      @close='close'
 | 
			
		||||
      :show-close='false'>
 | 
			
		||||
      <div class="box1">
 | 
			
		||||
        <el-row>
 | 
			
		||||
          <el-col :span='12'>
 | 
			
		||||
@@ -69,7 +70,7 @@ const tableProps = [
 | 
			
		||||
    prop: 'createTime',
 | 
			
		||||
    label: '添加时间',
 | 
			
		||||
    filter: parseTime,
 | 
			
		||||
    minWidth: 150
 | 
			
		||||
    minWidth: 160
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'deliveryCarCode',
 | 
			
		||||
@@ -81,7 +82,7 @@ const tableProps = [
 | 
			
		||||
    prop: 'loadTime',
 | 
			
		||||
    label: '装车时间',
 | 
			
		||||
    filter: parseTime,
 | 
			
		||||
    minWidth: 150
 | 
			
		||||
    minWidth: 160
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'productName',
 | 
			
		||||
@@ -90,7 +91,7 @@ const tableProps = [
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'packagingSize',
 | 
			
		||||
    label: '装箱规格(片/箱)',
 | 
			
		||||
    width: 120
 | 
			
		||||
    width: 150
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'packagingNum',
 | 
			
		||||
 
 | 
			
		||||
@@ -1,19 +1,17 @@
 | 
			
		||||
<template>
 | 
			
		||||
  <el-form ref="addOrUpdate" :rules="rules" label-width="130px" :model="form">
 | 
			
		||||
    <el-row>
 | 
			
		||||
      <el-col :span='12'>
 | 
			
		||||
  <el-form ref="addOrUpdate" :rules="rules" label-width="130px" :model="form" label-position='top'>
 | 
			
		||||
    <el-row :gutter="20">
 | 
			
		||||
      <el-col :span='6'>
 | 
			
		||||
        <el-form-item label="发货单号">
 | 
			
		||||
          <el-input v-model="code" disabled></el-input>
 | 
			
		||||
        </el-form-item>
 | 
			
		||||
      </el-col>
 | 
			
		||||
      <el-col :span='12'>
 | 
			
		||||
      <el-col :span='6'>
 | 
			
		||||
        <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-col :span='6'>
 | 
			
		||||
        <el-form-item label="装车时间" prop="loadTime">
 | 
			
		||||
          <el-date-picker
 | 
			
		||||
            v-model="form.loadTime"
 | 
			
		||||
@@ -25,19 +23,19 @@
 | 
			
		||||
          </el-date-picker>
 | 
			
		||||
        </el-form-item>
 | 
			
		||||
      </el-col>
 | 
			
		||||
      <el-col :span='12'>
 | 
			
		||||
      <el-col :span='6'>
 | 
			
		||||
        <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-row :gutter="20">
 | 
			
		||||
      <el-col :span='6'>
 | 
			
		||||
        <el-form-item label="联系方式" prop="contactPersonCall">
 | 
			
		||||
          <el-input v-model="form.contactPersonCall"></el-input>
 | 
			
		||||
        </el-form-item>
 | 
			
		||||
      </el-col>
 | 
			
		||||
      <el-col :span='12'>
 | 
			
		||||
      <el-col :span='6'>
 | 
			
		||||
        <el-form-item label="装车产品" prop="productId">
 | 
			
		||||
          <el-select v-model="form.productId" disabled placeholder="请选择" style="width: 100%;">
 | 
			
		||||
            <el-option
 | 
			
		||||
@@ -49,26 +47,24 @@
 | 
			
		||||
          </el-select>
 | 
			
		||||
        </el-form-item>
 | 
			
		||||
      </el-col>
 | 
			
		||||
    </el-row>
 | 
			
		||||
    <el-row>
 | 
			
		||||
      <el-col :span='12'>
 | 
			
		||||
      <el-col :span='6'>
 | 
			
		||||
        <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-col :span='6'>
 | 
			
		||||
        <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-row :gutter="20">
 | 
			
		||||
      <el-col :span='6'>
 | 
			
		||||
        <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-col :span='6'>
 | 
			
		||||
        <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>
 | 
			
		||||
 
 | 
			
		||||
@@ -78,7 +78,7 @@ const tableProps = [
 | 
			
		||||
    prop: 'deliveryTime',
 | 
			
		||||
    label: '发货时间',
 | 
			
		||||
    filter: parseTime,
 | 
			
		||||
    minWidth: 150
 | 
			
		||||
    minWidth: 160
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'code',
 | 
			
		||||
@@ -103,7 +103,8 @@ const tableProps = [
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'principalCost',
 | 
			
		||||
    label: '运输费用'
 | 
			
		||||
    label: '运输费用',
 | 
			
		||||
    align: 'right'
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'remark',
 | 
			
		||||
@@ -225,7 +226,11 @@ export default {
 | 
			
		||||
    },
 | 
			
		||||
    getList() {
 | 
			
		||||
      deliveryLogPage({...this.queryParams}).then(res => {
 | 
			
		||||
        this.list = res.data.list || []
 | 
			
		||||
        let arr = res.data.list || []
 | 
			
		||||
        arr && arr.map(item => {
 | 
			
		||||
          item.principalCost = item.principalCost.toFixed(2)
 | 
			
		||||
        })
 | 
			
		||||
        this.list = arr
 | 
			
		||||
        this.total = res.data.total || 0
 | 
			
		||||
      })
 | 
			
		||||
    },
 | 
			
		||||
 
 | 
			
		||||
@@ -2,9 +2,10 @@
 | 
			
		||||
  <el-drawer
 | 
			
		||||
    title="发货进度"
 | 
			
		||||
    :visible.sync="centervisible"
 | 
			
		||||
    size="80%"
 | 
			
		||||
    size="50%"
 | 
			
		||||
    class="deliveryLogDetail"
 | 
			
		||||
    @close='closeA'>
 | 
			
		||||
    @close='closeA'
 | 
			
		||||
    :show-close='false'>
 | 
			
		||||
    <div class="box1">
 | 
			
		||||
      <div class="box_col">
 | 
			
		||||
        <div class="blodTip">订单名</div>
 | 
			
		||||
@@ -46,7 +47,7 @@
 | 
			
		||||
              <method-btn
 | 
			
		||||
                v-if="tableBtn.length"
 | 
			
		||||
                slot="handleBtn"
 | 
			
		||||
                :width="150"
 | 
			
		||||
                :width="80"
 | 
			
		||||
                label="操作"
 | 
			
		||||
                :method-list="tableBtn"
 | 
			
		||||
                @clickBtn="viewDetDetail"
 | 
			
		||||
@@ -64,7 +65,7 @@
 | 
			
		||||
          <div v-if="activeName === 'barChart'">
 | 
			
		||||
            <div 
 | 
			
		||||
              id="logDetPieBar"
 | 
			
		||||
              style="width: 100%"
 | 
			
		||||
              style="width: 60%"
 | 
			
		||||
              :style="{ height: chartHeight + 'px' }"
 | 
			
		||||
            ></div>
 | 
			
		||||
          </div>
 | 
			
		||||
@@ -74,10 +75,11 @@
 | 
			
		||||
    <!-- 详情抽屉 -->
 | 
			
		||||
    <el-drawer
 | 
			
		||||
      title="发货详情"
 | 
			
		||||
      size="60%"
 | 
			
		||||
      size="50%"
 | 
			
		||||
      :append-to-body="true"
 | 
			
		||||
      :visible.sync="innerDrawer"
 | 
			
		||||
      @close='closeB'>
 | 
			
		||||
      @close='closeB'
 | 
			
		||||
      :show-close='false'>
 | 
			
		||||
      <div class="box3">
 | 
			
		||||
        <el-row>
 | 
			
		||||
          <el-col :span='12'>
 | 
			
		||||
@@ -122,7 +124,7 @@ const tableProps = [
 | 
			
		||||
    prop: 'deliveryTime',
 | 
			
		||||
    label: '发货时间',
 | 
			
		||||
    filter: parseTime,
 | 
			
		||||
    minWidth: 150
 | 
			
		||||
    minWidth: 160
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'code',
 | 
			
		||||
@@ -139,7 +141,8 @@ const tableProps = [
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'rate',
 | 
			
		||||
    label: '发货比列(%)'
 | 
			
		||||
    label: '发货比列(%)',
 | 
			
		||||
    width: 110
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'principalCost',
 | 
			
		||||
@@ -151,7 +154,7 @@ const tableProps2 = [
 | 
			
		||||
    prop: 'createTime',
 | 
			
		||||
    label: '添加时间',
 | 
			
		||||
    filter: parseTime,
 | 
			
		||||
    minWidth: 150
 | 
			
		||||
    minWidth: 160
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'deliveryCarCode',
 | 
			
		||||
@@ -162,7 +165,7 @@ const tableProps2 = [
 | 
			
		||||
    prop: 'loadTime',
 | 
			
		||||
    label: '装车时间',
 | 
			
		||||
    filter: parseTime,
 | 
			
		||||
    minWidth: 150
 | 
			
		||||
    minWidth: 160
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'productName',
 | 
			
		||||
@@ -171,7 +174,8 @@ const tableProps2 = [
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'packagingSize',
 | 
			
		||||
    label: '装箱规格(片/箱)'
 | 
			
		||||
    label: '装箱规格(片/箱)',
 | 
			
		||||
    minWidth: 140
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'packagingNum',
 | 
			
		||||
@@ -208,8 +212,8 @@ export default {
 | 
			
		||||
      tableBtn: [
 | 
			
		||||
        this.$auth.hasPermi('base:group-team:update')
 | 
			
		||||
          ? {
 | 
			
		||||
              type: 'detDetail',
 | 
			
		||||
              btnName: '查看发货详情'
 | 
			
		||||
              type: 'detail',
 | 
			
		||||
              btnName: '详情'
 | 
			
		||||
            }
 | 
			
		||||
          : undefined
 | 
			
		||||
      ].filter((v) => v),
 | 
			
		||||
@@ -228,7 +232,7 @@ export default {
 | 
			
		||||
      // 图
 | 
			
		||||
      chartDom: '',
 | 
			
		||||
      chart: '',
 | 
			
		||||
      chartHeight: this.tableHeight(300)
 | 
			
		||||
      chartHeight: this.tableHeight(300)*0.6
 | 
			
		||||
    }
 | 
			
		||||
  },
 | 
			
		||||
  // watch: {
 | 
			
		||||
@@ -268,6 +272,8 @@ export default {
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
    getBar() {
 | 
			
		||||
      let color = ['#7164FF','#288AFF','#63BDFF','#8EF0AB','#FFCE6A']
 | 
			
		||||
      let colorList = []
 | 
			
		||||
      if (
 | 
			
		||||
        this.chart !== null &&
 | 
			
		||||
        this.chart !== '' &&
 | 
			
		||||
@@ -278,64 +284,90 @@ export default {
 | 
			
		||||
      this.chartDom = document.getElementById('logDetPieBar')
 | 
			
		||||
      this.chart = echarts.init(this.chartDom)
 | 
			
		||||
      let seriesData = []
 | 
			
		||||
      let sumData = 0
 | 
			
		||||
      this.tableData && this.tableData.map(item =>{
 | 
			
		||||
      if (this.tableData.length > 0) {
 | 
			
		||||
        for (let i = 0; i < this.tableData.length; i++) {
 | 
			
		||||
          let obj = {}
 | 
			
		||||
        obj.value = item.rate
 | 
			
		||||
        obj.name = item.name
 | 
			
		||||
          obj.value = this.tableData[i].num
 | 
			
		||||
          obj.name = this.tableData[i].name
 | 
			
		||||
          seriesData.push(obj)
 | 
			
		||||
        sumData+=item.rate
 | 
			
		||||
      })
 | 
			
		||||
      if (sumData < 100) {
 | 
			
		||||
          if (i < 5) {
 | 
			
		||||
            colorList.push(color[i])
 | 
			
		||||
          } else {
 | 
			
		||||
            colorList.push(color[i%5])
 | 
			
		||||
          }
 | 
			
		||||
        }
 | 
			
		||||
      }
 | 
			
		||||
      if (this.orderMsg.num < this.orderMsg.orderNum) {
 | 
			
		||||
        let obj = {}
 | 
			
		||||
        obj.value = 100 - sumData
 | 
			
		||||
        obj.value = this.orderMsg.orderNum - this.orderMsg.num
 | 
			
		||||
        obj.name = "未发货"
 | 
			
		||||
        seriesData.push(obj)
 | 
			
		||||
        colorList.push('#F5F5F5')
 | 
			
		||||
      }else {
 | 
			
		||||
        let obj = {}
 | 
			
		||||
        obj.value = 0
 | 
			
		||||
        obj.name = "未发货"
 | 
			
		||||
        seriesData.push(obj)
 | 
			
		||||
        colorList.push('#F5F5F5')
 | 
			
		||||
      }
 | 
			
		||||
      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>`
 | 
			
		||||
          }
 | 
			
		||||
        },
 | 
			
		||||
        color: colorList,
 | 
			
		||||
        legend: {
 | 
			
		||||
          type: 'scroll',
 | 
			
		||||
          orient: 'vertical',
 | 
			
		||||
          right: '10%',
 | 
			
		||||
          top: 20,
 | 
			
		||||
          bottom: 20,
 | 
			
		||||
          icon: 'rect',
 | 
			
		||||
          itemHeight: 8,
 | 
			
		||||
          itemWidth: 8
 | 
			
		||||
          bottom: '5%',
 | 
			
		||||
          left: 'center',
 | 
			
		||||
          itemWidth: 8,
 | 
			
		||||
          itemHeight: 8
 | 
			
		||||
        },
 | 
			
		||||
        series: [
 | 
			
		||||
          {
 | 
			
		||||
            type: 'pie',
 | 
			
		||||
            radius: ['60%', '80%'],
 | 
			
		||||
            avoidLabelOverlap: false,
 | 
			
		||||
            label: {
 | 
			
		||||
              show: false,
 | 
			
		||||
              position: 'center'
 | 
			
		||||
            },
 | 
			
		||||
            radius: ['40%', '55%'],
 | 
			
		||||
            emphasis: {
 | 
			
		||||
              scale: false
 | 
			
		||||
            },
 | 
			
		||||
            label: {
 | 
			
		||||
                show: true,
 | 
			
		||||
                fontSize: 40,
 | 
			
		||||
                fontWeight: 'bold'
 | 
			
		||||
              alignTo: 'edge',
 | 
			
		||||
              formatter: '{name|{b}}\n{value|{c}}',
 | 
			
		||||
              minMargin: 5,
 | 
			
		||||
              edgeDistance: 10,
 | 
			
		||||
              lineHeight: 15,
 | 
			
		||||
              rich: {
 | 
			
		||||
                name: {
 | 
			
		||||
                  fontSize: 14,
 | 
			
		||||
                  color: 'rgba(0,0,0,0.65)'
 | 
			
		||||
                },
 | 
			
		||||
              scale: true ,
 | 
			
		||||
              scaleSize: 20 ,
 | 
			
		||||
            },
 | 
			
		||||
            labelLine: {
 | 
			
		||||
              show: false
 | 
			
		||||
                value: {
 | 
			
		||||
                  fontSize: 14,
 | 
			
		||||
                  color: 'rgba(0,0,0,0.65)'
 | 
			
		||||
                }
 | 
			
		||||
              }
 | 
			
		||||
            },
 | 
			
		||||
            data: seriesData
 | 
			
		||||
          },
 | 
			
		||||
          {
 | 
			
		||||
            type: 'pie',
 | 
			
		||||
            radius: ['40%', '40%'],
 | 
			
		||||
            label: {
 | 
			
		||||
              show: true,
 | 
			
		||||
              position: 'center',
 | 
			
		||||
              color: '#000',
 | 
			
		||||
              formatter: [
 | 
			
		||||
                  '{a|'+this.orderMsg.orderNum+'}',
 | 
			
		||||
                  '{b|总数}'
 | 
			
		||||
              ].join('\n\n'),
 | 
			
		||||
              rich: {
 | 
			
		||||
                a: {
 | 
			
		||||
                    fontSize: 26 +'px'
 | 
			
		||||
                },
 | 
			
		||||
                b: {
 | 
			
		||||
                    fontSize: 16 +'px'
 | 
			
		||||
                }
 | 
			
		||||
              }
 | 
			
		||||
            },
 | 
			
		||||
            emphasis: {
 | 
			
		||||
              scale: false
 | 
			
		||||
            },
 | 
			
		||||
            data: [100]
 | 
			
		||||
          }
 | 
			
		||||
        ]
 | 
			
		||||
      };
 | 
			
		||||
@@ -375,11 +407,13 @@ export default {
 | 
			
		||||
</script>
 | 
			
		||||
<style scoped lang='scss'>
 | 
			
		||||
.box1 {
 | 
			
		||||
  height: 56px;
 | 
			
		||||
  height: 76px;
 | 
			
		||||
  border-bottom: 1px solid #E9E9E9;
 | 
			
		||||
  margin: 0px 8px 20px 30px;
 | 
			
		||||
  .box_col {
 | 
			
		||||
    display: inline-block;
 | 
			
		||||
    width: 20%;
 | 
			
		||||
    padding: 8px 8px 8px 40px;
 | 
			
		||||
    padding: 8px 8px 8px 8px;
 | 
			
		||||
    .blodTip {
 | 
			
		||||
      height: 16px;
 | 
			
		||||
      font-size: 14px;
 | 
			
		||||
@@ -396,7 +430,7 @@ export default {
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
.box2 {
 | 
			
		||||
    padding:32px 32px 30px 30px;
 | 
			
		||||
    padding:0px 32px 30px 30px;
 | 
			
		||||
    height: calc(100vh - 150px);
 | 
			
		||||
}
 | 
			
		||||
.boxTitle {
 | 
			
		||||
 
 | 
			
		||||
@@ -2,7 +2,7 @@
 | 
			
		||||
  <div class="searchBarBox divHeight" ref="searchBarRef" :style="{ paddingRight: isFold ? '55px' : '0px' }">
 | 
			
		||||
    <el-form :inline="true" class="demo-form-inline">
 | 
			
		||||
      <span class="blue-block"></span>
 | 
			
		||||
      <el-form-item label="能源类型">
 | 
			
		||||
      <el-form-item label="能源类型" required>
 | 
			
		||||
        <el-select v-model="queryParams.energyTypeId" placeholder="请选择" style="width: 100px;" size="small">
 | 
			
		||||
          <el-option
 | 
			
		||||
            v-for="item in energyTypeList"
 | 
			
		||||
@@ -12,7 +12,7 @@
 | 
			
		||||
          </el-option>
 | 
			
		||||
        </el-select>
 | 
			
		||||
      </el-form-item>
 | 
			
		||||
      <el-form-item label="时间维度">
 | 
			
		||||
      <el-form-item label="时间维度" required>
 | 
			
		||||
        <el-select v-model="queryParams.timeDim" placeholder="请选择" style="width: 80px;" size="small">
 | 
			
		||||
          <el-option
 | 
			
		||||
            v-for="item in getDictDatas(this.DICT_TYPE.TIME_DIM)"
 | 
			
		||||
@@ -22,7 +22,7 @@
 | 
			
		||||
          </el-option>
 | 
			
		||||
        </el-select>
 | 
			
		||||
      </el-form-item>
 | 
			
		||||
      <el-form-item label="时间范围">
 | 
			
		||||
      <el-form-item label="时间范围" required>
 | 
			
		||||
        <div v-show="queryParams.timeDim === '1'">
 | 
			
		||||
          <el-date-picker
 | 
			
		||||
            v-model="timeValue"
 | 
			
		||||
@@ -124,7 +124,7 @@
 | 
			
		||||
          </el-date-picker>
 | 
			
		||||
        </div>
 | 
			
		||||
      </el-form-item>
 | 
			
		||||
      <el-form-item label="对象维度">
 | 
			
		||||
      <el-form-item label="对象维度" required>
 | 
			
		||||
        <el-select v-model="queryParams.objType" placeholder="请选择" style="width: 80px;" @change="selectObjs" size="small">
 | 
			
		||||
          <el-option
 | 
			
		||||
            v-for="item in getDictDatas(this.DICT_TYPE.OBJECT_TYPE)"
 | 
			
		||||
@@ -134,7 +134,7 @@
 | 
			
		||||
          </el-option>
 | 
			
		||||
        </el-select>
 | 
			
		||||
      </el-form-item>
 | 
			
		||||
      <el-form-item label="对象选择">
 | 
			
		||||
      <el-form-item label="对象选择" required>
 | 
			
		||||
        <el-select v-model="queryParams.objIds" placeholder="请选择" multiple :multiple-limit='5' collapse-tags style="width: 200px;" size="small">
 | 
			
		||||
          <el-option
 | 
			
		||||
            v-for="item in objectList"
 | 
			
		||||
@@ -148,6 +148,8 @@
 | 
			
		||||
      </el-form-item>
 | 
			
		||||
      <el-form-item>
 | 
			
		||||
        <el-button type="primary" size="small" @click="search">查询</el-button>
 | 
			
		||||
        <span class="separateStyle"></span>
 | 
			
		||||
        <el-button size="small" @click="resetBtn">重置</el-button>
 | 
			
		||||
      </el-form-item>
 | 
			
		||||
    </el-form>
 | 
			
		||||
    <span v-if="isFold" class="foldClass" @click='switchMode'>
 | 
			
		||||
@@ -400,6 +402,19 @@ export default {
 | 
			
		||||
      console.log(this.queryParams)
 | 
			
		||||
      this.$emit('submit', this.queryParams)
 | 
			
		||||
    },
 | 
			
		||||
    resetBtn() {
 | 
			
		||||
      this.queryParams.energyTypeId = null
 | 
			
		||||
      this.queryParams.timeDim = this.getDictDatas(this.DICT_TYPE.TIME_DIM)[0].value // 默认时
 | 
			
		||||
      this.queryParams.objIds = []
 | 
			
		||||
      this.queryParams.objType = ''
 | 
			
		||||
      this.timeValue = []
 | 
			
		||||
      this.dateValue = []
 | 
			
		||||
      this.weekValue1 = null
 | 
			
		||||
      this.weekValue2 = null
 | 
			
		||||
      this.monthValue = []
 | 
			
		||||
      this.yearValue1 = null
 | 
			
		||||
      this.yearValue2 = null
 | 
			
		||||
    },
 | 
			
		||||
    transformTime(timeStamp) {// 本月最后一天
 | 
			
		||||
      let year = moment(timeStamp).format('YYYY')
 | 
			
		||||
      let month = moment(timeStamp).format('MM')
 | 
			
		||||
@@ -471,4 +486,12 @@ export default {
 | 
			
		||||
  height: 45px;
 | 
			
		||||
  overflow: hidden;
 | 
			
		||||
}
 | 
			
		||||
.separateStyle {
 | 
			
		||||
  display: inline-block;
 | 
			
		||||
  width: 1px;
 | 
			
		||||
  height: 24px;
 | 
			
		||||
  background: #E8E8E8;
 | 
			
		||||
  vertical-align: middle;
 | 
			
		||||
  margin: 0 10px;
 | 
			
		||||
}
 | 
			
		||||
</style>
 | 
			
		||||
@@ -34,10 +34,10 @@ export default {
 | 
			
		||||
  mounted() {
 | 
			
		||||
    window.addEventListener('resize', () => {
 | 
			
		||||
      this.tableH = this.tableHeight(260)
 | 
			
		||||
      this.isFold = this.searchBarWidth('contrastAnalysisBox', 1310)
 | 
			
		||||
      this.isFold = this.searchBarWidth('contrastAnalysisBox', 1437)
 | 
			
		||||
      // console.log(document.getElementById("contrastAnalysisBox").offsetWidth)
 | 
			
		||||
    })
 | 
			
		||||
    this.isFold = this.searchBarWidth('contrastAnalysisBox', 1310)
 | 
			
		||||
    this.isFold = this.searchBarWidth('contrastAnalysisBox', 1437)
 | 
			
		||||
  },
 | 
			
		||||
  methods: {
 | 
			
		||||
    getList(params) {
 | 
			
		||||
 
 | 
			
		||||
@@ -1,7 +1,7 @@
 | 
			
		||||
<template>
 | 
			
		||||
  <el-form :inline="true" class="demo-form-inline">
 | 
			
		||||
    <span class="blue-block"></span>
 | 
			
		||||
    <el-form-item label="对象选择">
 | 
			
		||||
    <el-form-item label="对象选择" required>
 | 
			
		||||
      <el-cascader
 | 
			
		||||
        v-model="objArr"
 | 
			
		||||
        :options="objList"
 | 
			
		||||
@@ -11,7 +11,7 @@
 | 
			
		||||
        style="width: 250px;"
 | 
			
		||||
        clearable></el-cascader>
 | 
			
		||||
    </el-form-item>
 | 
			
		||||
    <el-form-item label="时间维度">
 | 
			
		||||
    <el-form-item label="时间维度" required>
 | 
			
		||||
      <el-select v-model="queryParams.type" placeholder="请选择" style="width: 80px;" size="small">
 | 
			
		||||
        <el-option
 | 
			
		||||
          v-for="item in timeType"
 | 
			
		||||
@@ -22,7 +22,7 @@
 | 
			
		||||
        </el-option>
 | 
			
		||||
      </el-select>
 | 
			
		||||
    </el-form-item>
 | 
			
		||||
    <el-form-item label="时间">
 | 
			
		||||
    <el-form-item label="时间" required>
 | 
			
		||||
      <div v-show="queryParams.type === 1">
 | 
			
		||||
        <el-date-picker
 | 
			
		||||
          v-model="monthValue"
 | 
			
		||||
@@ -129,7 +129,7 @@ export default {
 | 
			
		||||
    },
 | 
			
		||||
    // 查询
 | 
			
		||||
    search() {
 | 
			
		||||
      if (!this.objArr.length === 0) {
 | 
			
		||||
      if (this.objArr.length === 0) {
 | 
			
		||||
        this.$modal.msgError('请选择对象')
 | 
			
		||||
        return false
 | 
			
		||||
      } else {
 | 
			
		||||
 
 | 
			
		||||
@@ -2,7 +2,7 @@
 | 
			
		||||
  <div class="searchBarBox divHeight" ref="searchBarRef" :style="{ paddingRight: isFold ? '55px' : '0px' }">
 | 
			
		||||
    <el-form :inline="true" class="demo-form-inline">
 | 
			
		||||
      <span class="blue-block"></span>
 | 
			
		||||
      <el-form-item label="能源类型">
 | 
			
		||||
      <el-form-item label="能源类型" required>
 | 
			
		||||
        <el-select v-model="queryParams.energyTypeId" placeholder="请选择" style="width: 100px;" size="small">
 | 
			
		||||
          <el-option
 | 
			
		||||
            v-for="item in energyTypeList"
 | 
			
		||||
@@ -12,7 +12,7 @@
 | 
			
		||||
          </el-option>
 | 
			
		||||
        </el-select>
 | 
			
		||||
      </el-form-item>
 | 
			
		||||
      <el-form-item label="对象选择">
 | 
			
		||||
      <el-form-item label="对象选择" required>
 | 
			
		||||
        <el-cascader
 | 
			
		||||
          v-model="objArr"
 | 
			
		||||
          :options="objList"
 | 
			
		||||
@@ -21,7 +21,7 @@
 | 
			
		||||
          size="small"
 | 
			
		||||
          clearable></el-cascader>
 | 
			
		||||
      </el-form-item>
 | 
			
		||||
      <el-form-item label="时间维度">
 | 
			
		||||
      <el-form-item label="时间维度" required>
 | 
			
		||||
        <el-select v-model="queryParams.timeDim" placeholder="请选择" style="width: 80px;" size="small">
 | 
			
		||||
          <el-option
 | 
			
		||||
            v-for="item in getDictDatas(this.DICT_TYPE.TIME_DIM)"
 | 
			
		||||
@@ -32,7 +32,7 @@
 | 
			
		||||
          </el-option>
 | 
			
		||||
        </el-select>
 | 
			
		||||
      </el-form-item>
 | 
			
		||||
      <el-form-item label="时间范围">
 | 
			
		||||
      <el-form-item label="时间范围" required>
 | 
			
		||||
        <div v-show="queryParams.timeDim === '1'">
 | 
			
		||||
          <el-date-picker
 | 
			
		||||
            v-model="timeValue"
 | 
			
		||||
@@ -129,6 +129,8 @@
 | 
			
		||||
      </el-form-item>
 | 
			
		||||
      <el-form-item>
 | 
			
		||||
        <el-button type="primary" size="small" @click="search">查询</el-button>
 | 
			
		||||
        <span class="separateStyle"></span>
 | 
			
		||||
        <el-button size="small" @click="resetBtn">重置</el-button>
 | 
			
		||||
      </el-form-item>
 | 
			
		||||
    </el-form>
 | 
			
		||||
    <span v-if="isFold" class="foldClass" @click='switchMode'>
 | 
			
		||||
@@ -360,6 +362,14 @@ export default {
 | 
			
		||||
      this.queryParams.endTime = this.queryParams.endTime + ''
 | 
			
		||||
      this.$emit('submit', this.queryParams)
 | 
			
		||||
    },
 | 
			
		||||
    // 重置
 | 
			
		||||
    resetBtn() {
 | 
			
		||||
      this.queryParams.energyTypeId = null
 | 
			
		||||
      this.queryParams.objId = null
 | 
			
		||||
      this.objArr = []
 | 
			
		||||
      this.queryParams.timeDim = this.getDictDatas(this.DICT_TYPE.TIME_DIM)[0].value // 默认时
 | 
			
		||||
      this.timeValue = [moment().startOf('day'), moment().endOf('day')-59*61*1000]
 | 
			
		||||
    },
 | 
			
		||||
    transformTime(timeStamp) {// 本月最后一天
 | 
			
		||||
      let year = moment(timeStamp).format('YYYY')
 | 
			
		||||
      let month = moment(timeStamp).format('MM')
 | 
			
		||||
@@ -435,4 +445,12 @@ export default {
 | 
			
		||||
  height: 45px;
 | 
			
		||||
  overflow: hidden;
 | 
			
		||||
}
 | 
			
		||||
.separateStyle {
 | 
			
		||||
  display: inline-block;
 | 
			
		||||
  width: 1px;
 | 
			
		||||
  height: 24px;
 | 
			
		||||
  background: #E8E8E8;
 | 
			
		||||
  vertical-align: middle;
 | 
			
		||||
  margin: 0 10px;
 | 
			
		||||
}
 | 
			
		||||
</style>
 | 
			
		||||
@@ -34,9 +34,9 @@ export default {
 | 
			
		||||
  mounted() {
 | 
			
		||||
    window.addEventListener('resize', () => {
 | 
			
		||||
      this.tableH = this.tableHeight(260)
 | 
			
		||||
      this.isFold = this.searchBarWidth('trendAnalysisBox', 1146)
 | 
			
		||||
      this.isFold = this.searchBarWidth('trendAnalysisBox', 1263)
 | 
			
		||||
    })
 | 
			
		||||
    this.isFold = this.searchBarWidth('trendAnalysisBox', 1146)
 | 
			
		||||
    this.isFold = this.searchBarWidth('trendAnalysisBox', 1263)
 | 
			
		||||
  },
 | 
			
		||||
  methods: {
 | 
			
		||||
    getList(params) {
 | 
			
		||||
 
 | 
			
		||||
@@ -1,7 +1,7 @@
 | 
			
		||||
<template>
 | 
			
		||||
  <el-form :inline="true" class="demo-form-inline">
 | 
			
		||||
    <span class="blue-block"></span>
 | 
			
		||||
    <el-form-item label="对象选择">
 | 
			
		||||
    <el-form-item label="对象选择" required>
 | 
			
		||||
      <el-cascader
 | 
			
		||||
        v-model="objArr"
 | 
			
		||||
        :options="objList"
 | 
			
		||||
@@ -10,7 +10,7 @@
 | 
			
		||||
        size="small"
 | 
			
		||||
        clearable></el-cascader>
 | 
			
		||||
    </el-form-item>
 | 
			
		||||
    <el-form-item label="时间维度">
 | 
			
		||||
    <el-form-item label="时间维度" required>
 | 
			
		||||
      <el-select v-model="queryParams.type" placeholder="请选择" style="width: 80px;" size="small">
 | 
			
		||||
        <el-option
 | 
			
		||||
          v-for="item in timeType"
 | 
			
		||||
@@ -21,7 +21,7 @@
 | 
			
		||||
        </el-option>
 | 
			
		||||
      </el-select>
 | 
			
		||||
    </el-form-item>
 | 
			
		||||
    <el-form-item label="时间">
 | 
			
		||||
    <el-form-item label="时间" required>
 | 
			
		||||
      <div v-show="queryParams.type === 1 || queryParams.type === 2">
 | 
			
		||||
        <el-date-picker
 | 
			
		||||
          v-model="yearValue"
 | 
			
		||||
@@ -103,7 +103,7 @@ export default {
 | 
			
		||||
    },
 | 
			
		||||
    // 查询
 | 
			
		||||
    search() {
 | 
			
		||||
      if (!this.objArr.length === 0) {
 | 
			
		||||
      if (this.objArr.length === 0) {
 | 
			
		||||
        this.$modal.msgError('请选择对象')
 | 
			
		||||
        return false
 | 
			
		||||
      } else {
 | 
			
		||||
 
 | 
			
		||||
@@ -25,18 +25,16 @@
 | 
			
		||||
      </el-col>
 | 
			
		||||
    </el-row>
 | 
			
		||||
    <el-row>
 | 
			
		||||
      <el-col :span="24">
 | 
			
		||||
        <el-form-item label="描述" prop="description">
 | 
			
		||||
          <el-input v-model="form.description"></el-input>
 | 
			
		||||
        </el-form-item>
 | 
			
		||||
      </el-col>
 | 
			
		||||
    </el-row>
 | 
			
		||||
    <el-row>
 | 
			
		||||
      <el-col :span="24">
 | 
			
		||||
      <el-col :span="12">
 | 
			
		||||
        <el-form-item label="是否采集" prop="collection">
 | 
			
		||||
          <el-switch v-model="form.collection"></el-switch>
 | 
			
		||||
        </el-form-item>
 | 
			
		||||
      </el-col>
 | 
			
		||||
      <el-col :span="12">
 | 
			
		||||
        <el-form-item label="描述" prop="description">
 | 
			
		||||
          <el-input v-model="form.description"></el-input>
 | 
			
		||||
        </el-form-item>
 | 
			
		||||
      </el-col>
 | 
			
		||||
    </el-row>
 | 
			
		||||
  </el-form>
 | 
			
		||||
</template>
 | 
			
		||||
 
 | 
			
		||||
Some files were not shown because too many files have changed in this diff Show More
		Reference in New Issue
	
	Block a user