Compare commits
	
		
			30 Commits
		
	
	
		
			projects/m
			...
			e8d566e121
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| e8d566e121 | |||
| c3d6b87151 | |||
| d925556ed6 | |||
| ec6c7120ea | |||
| 39571053f5 | |||
| 
						 | 
					7ca1f07f56 | ||
| 
						 | 
					21988ae8b0 | ||
| e4c6154eb6 | |||
| f4e847aa46 | |||
| d44c366a19 | |||
| c2defa2da6 | |||
| 6aabe6dd90 | |||
| 3e51a00e17 | |||
| 506f12d405 | |||
| 587985e3c6 | |||
| 7e6cfb6345 | |||
| b3623d29c5 | |||
| f043a6a0a2 | |||
| 0f70fe85c8 | |||
| 5a00db7dcd | |||
| 9bcb4d42fa | |||
| 87bca23d96 | |||
| 9b20252e27 | |||
| c9fe2ba296 | |||
| 
						 | 
					5e4df4d849 | ||
| 
						 | 
					1d3372ed69 | ||
| 86f246eb94 | |||
| e2a16332be | |||
| 69b6942f35 | |||
| e28cd67e20 | 
							
								
								
									
										6
									
								
								.env.dev
									
									
									
									
									
								
							
							
						
						
									
										6
									
								
								.env.dev
									
									
									
									
									
								
							@@ -1,7 +1,7 @@
 | 
			
		||||
###
 | 
			
		||||
 # @Author: Do not edit
 | 
			
		||||
 # @Date: 2023-08-29 09:40:39
 | 
			
		||||
 # @LastEditTime: 2023-11-21 10:36:47
 | 
			
		||||
 # @LastEditTime: 2024-07-29 15:00:13
 | 
			
		||||
 # @LastEditors: DY
 | 
			
		||||
 # @Description:
 | 
			
		||||
###
 | 
			
		||||
@@ -14,9 +14,9 @@ VUE_APP_TITLE = MES系统
 | 
			
		||||
# 芋道管理系统/开发环境
 | 
			
		||||
# VUE_APP_BASE_API = 'http://100.64.0.26:48082'
 | 
			
		||||
VUE_APP_BASE_API = 'http://192.168.0.33:48082'
 | 
			
		||||
# VUE_APP_BASE_API = 'http://192.168.4.173:48080'
 | 
			
		||||
# VUE_APP_BASE_API = 'http://192.168.1.164:48082'
 | 
			
		||||
# VUE_APP_BASE_API = 'http://192.168.2.173:48080'
 | 
			
		||||
# VUE_APP_BASE_API = 'http://192.168.1.49:48082'
 | 
			
		||||
# VUE_APP_BASE_API = 'http://192.168.1.81: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:48082'
 | 
			
		||||
 
 | 
			
		||||
@@ -48,11 +48,12 @@
 | 
			
		||||
    "benz-amr-recorder": "^1.1.5",
 | 
			
		||||
    "bpmn-js-token-simulation": "0.10.0",
 | 
			
		||||
    "clipboard": "2.0.8",
 | 
			
		||||
    "code-brick-zj": "^1.0.2",
 | 
			
		||||
    "code-brick-zj": "^1.0.5",
 | 
			
		||||
    "core-js": "^3.26.0",
 | 
			
		||||
    "crypto-js": "^4.0.0",
 | 
			
		||||
    "diagram-js": "^12.3.0",
 | 
			
		||||
    "echarts": "5.4.0",
 | 
			
		||||
    "el-tree-transfer": "^2.4.7",
 | 
			
		||||
    "element-ui": "2.15.12",
 | 
			
		||||
    "file-saver": "^2.0.5",
 | 
			
		||||
    "fuse.js": "6.6.2",
 | 
			
		||||
 
 | 
			
		||||
@@ -1,8 +1,8 @@
 | 
			
		||||
/*
 | 
			
		||||
 * @Author: Do not edit
 | 
			
		||||
 * @Date: 2023-10-21 11:50:46
 | 
			
		||||
 * @LastEditTime: 2023-11-04 10:42:50
 | 
			
		||||
 * @LastEditors: DY
 | 
			
		||||
 * @LastEditTime: 2024-07-08 14:35:17
 | 
			
		||||
 * @LastEditors: zwq
 | 
			
		||||
 * @Description:
 | 
			
		||||
 */
 | 
			
		||||
import request from '@/utils/request'
 | 
			
		||||
@@ -61,7 +61,7 @@ export function getCoreProductPage(query) {
 | 
			
		||||
// 获得所有列表
 | 
			
		||||
export function getCoreProductList(query) {
 | 
			
		||||
  return request({
 | 
			
		||||
    url: '/base/core-product/listAll',
 | 
			
		||||
    url: '/base/core-product-material/listAll',
 | 
			
		||||
    method: 'get',
 | 
			
		||||
    params: query
 | 
			
		||||
  })
 | 
			
		||||
 
 | 
			
		||||
@@ -51,6 +51,13 @@ export function getCode() {
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// 获得可用的班次列表
 | 
			
		||||
export function listClassesEnabled() {
 | 
			
		||||
  return request({
 | 
			
		||||
    url: '/base/group-classes/listEnable',
 | 
			
		||||
    method: 'get'
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
// 导出班次基础信息 Excel
 | 
			
		||||
export function exportGroupClassesExcel(query) {
 | 
			
		||||
  return request({
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										125
									
								
								src/api/base/groupSchedulingPlan.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										125
									
								
								src/api/base/groupSchedulingPlan.js
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,125 @@
 | 
			
		||||
import request from '@/utils/request'
 | 
			
		||||
 | 
			
		||||
// 创建排班计划配置基础信息
 | 
			
		||||
export function createGroupPlan(data) {
 | 
			
		||||
  return request({
 | 
			
		||||
    url: '/base/group-scheduling-plan/create',
 | 
			
		||||
    method: 'post',
 | 
			
		||||
    data: data
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// 更新排班计划配置基础信息
 | 
			
		||||
export function updateGroupPlan(data) {
 | 
			
		||||
  return request({
 | 
			
		||||
    url: '/base/group-scheduling-plan/update',
 | 
			
		||||
    method: 'put',
 | 
			
		||||
    data: data
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// 删除排班计划配置基础信息
 | 
			
		||||
export function deleteGroupPlan(id) {
 | 
			
		||||
  return request({
 | 
			
		||||
    url: '/base/group-scheduling-plan/delete?id=' + id,
 | 
			
		||||
    method: 'delete'
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// 获得排班计划配置基础信息
 | 
			
		||||
export function getGroupPlan(id) {
 | 
			
		||||
  return request({
 | 
			
		||||
    url: '/base/group-scheduling-plan/get?id=' + id,
 | 
			
		||||
    method: 'get'
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// 获得排班计划配置基础信息分页
 | 
			
		||||
export function getGroupPlanPage(query) {
 | 
			
		||||
  return request({
 | 
			
		||||
    url: '/base/group-scheduling-plan/page',
 | 
			
		||||
    method: 'get',
 | 
			
		||||
    params: query
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// 获得所有排班计划列表
 | 
			
		||||
export function groupPlanList() {
 | 
			
		||||
  return request({
 | 
			
		||||
    url: '/base/group-scheduling-plan/listAll',
 | 
			
		||||
    method: 'get'
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
// 获得排班计划相关班组列表
 | 
			
		||||
export function groupPlanTeamList(id) {
 | 
			
		||||
  return request({
 | 
			
		||||
    url: '/base/group-scheduling-plan-team/teamListByPlanId?planId=' + id,
 | 
			
		||||
    method: 'get'
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
// 获得排班计划相关班次列表
 | 
			
		||||
export function groupPlanClassesList(id) {
 | 
			
		||||
  return request({
 | 
			
		||||
    url: '/base/group-scheduling-plan-classes/classesListByPlanId?planId=' + id,
 | 
			
		||||
    method: 'get'
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
// 获取code
 | 
			
		||||
export function getCode() {
 | 
			
		||||
  return request({
 | 
			
		||||
    url: '/base/group-scheduling-plan/getCode',
 | 
			
		||||
    method: 'get'
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// 导出排班计划配置基础信息 Excel
 | 
			
		||||
export function exportGroupPlanExcel(query) {
 | 
			
		||||
  return request({
 | 
			
		||||
    url: '/base/group-scheduling-plan/export-excel',
 | 
			
		||||
    method: 'get',
 | 
			
		||||
    params: query,
 | 
			
		||||
    responseType: 'blob'
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// 获得产线工段树形结构
 | 
			
		||||
export function getGroupPlanTree() {
 | 
			
		||||
  return request({
 | 
			
		||||
    url: '/base/group-scheduling-plan/getLineSectionTree',
 | 
			
		||||
    method: 'get'
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// 创建排班计划产线工段
 | 
			
		||||
export function createGroupPlanLine(data) {
 | 
			
		||||
  return request({
 | 
			
		||||
    url: '/base/group-scheduling-plan-line-section/createPlanLineSection',
 | 
			
		||||
    method: 'post',
 | 
			
		||||
    data: data
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// 更新排班计划产线工段
 | 
			
		||||
export function updateGroupPlanLine(data) {
 | 
			
		||||
  return request({
 | 
			
		||||
    url: '/base/group-scheduling-plan-line-section/updatePlanLineSection',
 | 
			
		||||
    method: 'put',
 | 
			
		||||
    data: data
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// 获得排班计划配置基础信息
 | 
			
		||||
export function getGroupPlanLine(id) {
 | 
			
		||||
  return request({
 | 
			
		||||
    url: '/base/group-scheduling-plan-line-section/getLineSectionByPlanId?planId=' + id,
 | 
			
		||||
    method: 'get'
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// 获得当前登录用户所在部门id
 | 
			
		||||
export function getLoginUserDeptId() {
 | 
			
		||||
  return request({
 | 
			
		||||
    url: '/base/group-scheduling-plan-line-section/getLoginUserDeptId',
 | 
			
		||||
    method: 'get'
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										54
									
								
								src/api/base/groupSchedulingRule.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										54
									
								
								src/api/base/groupSchedulingRule.js
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,54 @@
 | 
			
		||||
import request from '@/utils/request'
 | 
			
		||||
 | 
			
		||||
// 创建排班规则基础信息
 | 
			
		||||
export function createGroupRule(data) {
 | 
			
		||||
  return request({
 | 
			
		||||
    url: '/base/group-scheduling-rule/create',
 | 
			
		||||
    method: 'post',
 | 
			
		||||
    data: data
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// 更新排班规则基础信息
 | 
			
		||||
export function updateGroupRule(data) {
 | 
			
		||||
  return request({
 | 
			
		||||
    url: '/base/group-scheduling-rule/update',
 | 
			
		||||
    method: 'put',
 | 
			
		||||
    data: data
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// 删除排班规则基础信息
 | 
			
		||||
export function deleteGroupRule(id) {
 | 
			
		||||
  return request({
 | 
			
		||||
    url: '/base/group-scheduling-rule/delete?id=' + id,
 | 
			
		||||
    method: 'delete'
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// 获得排班规则基础信息
 | 
			
		||||
export function getGroupRule(id) {
 | 
			
		||||
  return request({
 | 
			
		||||
    url: '/base/group-scheduling-rule/get?id=' + id,
 | 
			
		||||
    method: 'get'
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// 获得排班规则基础信息分页
 | 
			
		||||
export function getGroupRulePage(query) {
 | 
			
		||||
  return request({
 | 
			
		||||
    url: '/base/group-scheduling-rule/page',
 | 
			
		||||
    method: 'get',
 | 
			
		||||
    params: query
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// 导出排班规则基础信息 Excel
 | 
			
		||||
export function exportGroupRuleExcel(query) {
 | 
			
		||||
  return request({
 | 
			
		||||
    url: '/base/group-scheduling-rule/export-excel',
 | 
			
		||||
    method: 'get',
 | 
			
		||||
    params: query,
 | 
			
		||||
    responseType: 'blob'
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
@@ -8,7 +8,14 @@ export function getPreset(query) {
 | 
			
		||||
    params: query
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// 获取某月预排班
 | 
			
		||||
export function getScheduling(query) {
 | 
			
		||||
  return request({
 | 
			
		||||
    url: '/base/group-team-scheduling/getScheduling',
 | 
			
		||||
    method: 'get',
 | 
			
		||||
    params: query
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
// 批量创建-更新排班信息
 | 
			
		||||
export function createOrUpdateList(data) {
 | 
			
		||||
  return request({
 | 
			
		||||
 
 | 
			
		||||
@@ -1,8 +1,8 @@
 | 
			
		||||
/*
 | 
			
		||||
 * @Author: Do not edit
 | 
			
		||||
 * @Date: 2023-10-21 11:50:46
 | 
			
		||||
 * @LastEditTime: 2023-10-24 11:22:28
 | 
			
		||||
 * @LastEditors: DY
 | 
			
		||||
 * @LastEditTime: 2024-07-05 10:09:18
 | 
			
		||||
 * @LastEditors: zwq
 | 
			
		||||
 * @Description:
 | 
			
		||||
 */
 | 
			
		||||
import request from '@/utils/request'
 | 
			
		||||
@@ -61,7 +61,7 @@ export function getMaterialPage(query) {
 | 
			
		||||
// 获得物料列表
 | 
			
		||||
export function getMaterialList(query) {
 | 
			
		||||
  return request({
 | 
			
		||||
    url: '/base/material/listbyfilter',
 | 
			
		||||
    url: '/base/core-product-material/listAll',
 | 
			
		||||
    method: 'get',
 | 
			
		||||
    params: query
 | 
			
		||||
  })
 | 
			
		||||
@@ -119,3 +119,84 @@ export function getMaterialAttr(query) {
 | 
			
		||||
    params: query
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
// 获得物料树结构
 | 
			
		||||
export function getMaterialTree() {
 | 
			
		||||
  return request({
 | 
			
		||||
    url: '/base/core-product-material-type/listTree',
 | 
			
		||||
    method: 'get'
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// 创建物料树
 | 
			
		||||
export function createMaterialTree(data) {
 | 
			
		||||
  return request({
 | 
			
		||||
    url: '/base/core-product-material-type/create',
 | 
			
		||||
    method: 'post',
 | 
			
		||||
    data: data
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// 更新物料树
 | 
			
		||||
export function updateMaterialTree(data) {
 | 
			
		||||
  return request({
 | 
			
		||||
    url: '/base/core-product-material-type/update',
 | 
			
		||||
    method: 'put',
 | 
			
		||||
    data: data
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// 删除物料树
 | 
			
		||||
export function deleteMaterialTree(id) {
 | 
			
		||||
  return request({
 | 
			
		||||
    url: '/base/core-product-material-type/delete?id=' + id,
 | 
			
		||||
    method: 'delete'
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// 获得产品物料分页
 | 
			
		||||
export function getProductMaterialPage(query) {
 | 
			
		||||
  return request({
 | 
			
		||||
    url: '/base/core-product-material/page',
 | 
			
		||||
    method: 'get',
 | 
			
		||||
    params: query
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
// 删除产品物料
 | 
			
		||||
export function deleteProductMaterial(id) {
 | 
			
		||||
  return request({
 | 
			
		||||
    url: '/base/core-product-material/delete?id=' + id,
 | 
			
		||||
    method: 'delete'
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
// 创建产品物料
 | 
			
		||||
export function createProductMaterial(data) {
 | 
			
		||||
  return request({
 | 
			
		||||
    url: '/base/core-product-material/create',
 | 
			
		||||
    method: 'post',
 | 
			
		||||
    data: data
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// 更新产品物料
 | 
			
		||||
export function updateProductMaterial(data) {
 | 
			
		||||
  return request({
 | 
			
		||||
    url: '/base/core-product-material/update',
 | 
			
		||||
    method: 'put',
 | 
			
		||||
    data: data
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
// 获得产品物料
 | 
			
		||||
export function getProductMaterial(id) {
 | 
			
		||||
  return request({
 | 
			
		||||
    url: '/base/core-product-material/get?id=' + id,
 | 
			
		||||
    method: 'get'
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// 获得产品物料code
 | 
			
		||||
export function getProductMaterialCode() {
 | 
			
		||||
  return request({
 | 
			
		||||
    url: '/base/core-product-material/getCode',
 | 
			
		||||
    method: 'POST'
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -70,7 +70,7 @@ export function getMaterialPBList(query) {
 | 
			
		||||
// 获得产品列表
 | 
			
		||||
export function getProList(query) {
 | 
			
		||||
  return request({
 | 
			
		||||
    url: '/base/core-product/listAll',
 | 
			
		||||
    url: '/base/core-product-material/listAll',
 | 
			
		||||
    method: 'get',
 | 
			
		||||
    params: query
 | 
			
		||||
  })
 | 
			
		||||
 
 | 
			
		||||
@@ -2,7 +2,7 @@ import request from '@/utils/request'
 | 
			
		||||
// 获得产品列表
 | 
			
		||||
export function getProductAll() {
 | 
			
		||||
  return request({
 | 
			
		||||
    url: '/base/core-product/listAll',
 | 
			
		||||
    url: '/base/core-product-material/listAll',
 | 
			
		||||
    method: 'get'
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
@@ -25,3 +25,13 @@ export function exportEqAnalysisExcel(query) {
 | 
			
		||||
    responseType: 'blob'
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// 导出设备状态追溯
 | 
			
		||||
export function exportEfficiencyExcel(query) {
 | 
			
		||||
  return request({
 | 
			
		||||
    url: '/analysis/equipment-analysis/export-efficiency',
 | 
			
		||||
    method: 'get',
 | 
			
		||||
    params: query,
 | 
			
		||||
    responseType: 'blob'
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
@@ -1,8 +1,8 @@
 | 
			
		||||
/*
 | 
			
		||||
 * @Author: zhp
 | 
			
		||||
 * @Date: 2023-11-07 19:47:48
 | 
			
		||||
 * @LastEditTime: 2023-11-23 13:57:41
 | 
			
		||||
 * @LastEditors: zhp
 | 
			
		||||
 * @LastEditTime: 2024-07-08 14:33:12
 | 
			
		||||
 * @LastEditors: zwq
 | 
			
		||||
 * @Description:
 | 
			
		||||
 */
 | 
			
		||||
import request from '@/utils/request'
 | 
			
		||||
@@ -99,7 +99,7 @@ export function getProcessEquMaterialBomDet(data) {
 | 
			
		||||
 | 
			
		||||
export function getMaterialList(data) {
 | 
			
		||||
  return request({
 | 
			
		||||
    url: '/base/material/listbyfilter',
 | 
			
		||||
    url: '/base/core-product-material/listAll',
 | 
			
		||||
    method: 'get',
 | 
			
		||||
    data: data
 | 
			
		||||
  })
 | 
			
		||||
 
 | 
			
		||||
@@ -25,7 +25,7 @@ export function getWorkOrderList(query) {
 | 
			
		||||
}
 | 
			
		||||
export function getProductList(query) {
 | 
			
		||||
  return request({
 | 
			
		||||
    url: '/base/core-product/listAll',
 | 
			
		||||
    url: '/base/core-product-material/listAll',
 | 
			
		||||
    method: 'get',
 | 
			
		||||
    params: query,
 | 
			
		||||
  })
 | 
			
		||||
@@ -38,3 +38,11 @@ export function getInspectionData(query) {
 | 
			
		||||
    params: query,
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
export function getRecordInOneDay(query) {
 | 
			
		||||
  return request({
 | 
			
		||||
    url: '/analysis/record-in-one-day/get',
 | 
			
		||||
    method: 'get',
 | 
			
		||||
    params: query,
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										
											BIN
										
									
								
								src/assets/images/choicepart/Devconfig.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								src/assets/images/choicepart/Devconfig.png
									
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							| 
		 After Width: | Height: | Size: 8.8 KiB  | 
							
								
								
									
										
											BIN
										
									
								
								src/assets/images/choicepart/Produce.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								src/assets/images/choicepart/Produce.png
									
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							| 
		 After Width: | Height: | Size: 9.1 KiB  | 
@@ -125,11 +125,8 @@ export default {
 | 
			
		||||
			// 取消自动聚焦 start
 | 
			
		||||
			this.Quill?.enable(false);
 | 
			
		||||
			this.$nextTick(() => {
 | 
			
		||||
				this.Quill?.enable(true);
 | 
			
		||||
				this.Quill?.blur();
 | 
			
		||||
				// if (!this.readOnly) {
 | 
			
		||||
				// 	this.Quill?.enable();
 | 
			
		||||
				// }
 | 
			
		||||
				this.Quill?.enable(true);
 | 
			
		||||
			});
 | 
			
		||||
			// 如果设置了上传地址则自定义图片上传事件
 | 
			
		||||
			if (this.type === 'url') {
 | 
			
		||||
 
 | 
			
		||||
@@ -78,7 +78,6 @@ 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);
 | 
			
		||||
		},
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										20
									
								
								src/mixins/tableHeightMixin.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										20
									
								
								src/mixins/tableHeightMixin.js
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,20 @@
 | 
			
		||||
export default {
 | 
			
		||||
	data() {
 | 
			
		||||
		return {
 | 
			
		||||
			tableH: this.tableHeight(260),
 | 
			
		||||
		};
 | 
			
		||||
	},
 | 
			
		||||
	created() {
 | 
			
		||||
		this.tableH = this?.heightNum ? this.tableHeight(this.heightNum) : this.tableHeight(260);
 | 
			
		||||
		window.addEventListener('resize', this._setTableHeight);
 | 
			
		||||
	},
 | 
			
		||||
	destroyed() {
 | 
			
		||||
		window.removeEventListener('resize', this._setTableHeight);
 | 
			
		||||
	},
 | 
			
		||||
	methods: {
 | 
			
		||||
		_setTableHeight() {
 | 
			
		||||
			this.tableH = this?.heightNum ? this.tableHeight(this.heightNum) : this.tableHeight(260);
 | 
			
		||||
			// this.tableH = this.tableHeight(260);
 | 
			
		||||
		},
 | 
			
		||||
	},
 | 
			
		||||
};
 | 
			
		||||
@@ -59,6 +59,33 @@ export default {
 | 
			
		||||
      type: "warning",
 | 
			
		||||
    })
 | 
			
		||||
  },
 | 
			
		||||
  // 删除确认窗体(UI规范)
 | 
			
		||||
  delConfirm(title) {
 | 
			
		||||
    return MessageBox.confirm("确定删除后不可恢复该数据",  `是否确认删除 【${title}】 数据项?`, {
 | 
			
		||||
      confirmButtonText: '确定',
 | 
			
		||||
      cancelButtonText: '取消',
 | 
			
		||||
      type: "warning",
 | 
			
		||||
      showClose:false
 | 
			
		||||
    })
 | 
			
		||||
  },
 | 
			
		||||
  // 关闭页面确认窗体(UI规范)
 | 
			
		||||
  closeConfirm() {
 | 
			
		||||
    return MessageBox.confirm("确定关闭将不保留编辑内容", "是否确认要关闭页面?", {
 | 
			
		||||
      confirmButtonText: '确定',
 | 
			
		||||
      cancelButtonText: '取消',
 | 
			
		||||
      type: "warning",
 | 
			
		||||
      showClose:false
 | 
			
		||||
    })
 | 
			
		||||
  },
 | 
			
		||||
  // 确认窗体(UI规范)
 | 
			
		||||
  newConfirm(content,title) {
 | 
			
		||||
    return MessageBox.confirm(content, title, {
 | 
			
		||||
      confirmButtonText: '确定',
 | 
			
		||||
      cancelButtonText: '取消',
 | 
			
		||||
      type: "warning",
 | 
			
		||||
      showClose:false
 | 
			
		||||
    })
 | 
			
		||||
  },
 | 
			
		||||
  // 提交内容
 | 
			
		||||
  prompt(content) {
 | 
			
		||||
    return MessageBox.prompt(content, "系统提示", {
 | 
			
		||||
 
 | 
			
		||||
@@ -201,3 +201,34 @@ input, textarea{
 | 
			
		||||
.el-form--label-top .el-form-item__label {
 | 
			
		||||
  padding: 0;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// 确认弹窗(UI样式修改和原样式有区别--start)
 | 
			
		||||
.el-message-box__status+.el-message-box__message {
 | 
			
		||||
  padding-left: 58px;
 | 
			
		||||
}
 | 
			
		||||
.el-message-box {
 | 
			
		||||
  width: auto;
 | 
			
		||||
  min-width: 424px;
 | 
			
		||||
  .el-message-box__header {
 | 
			
		||||
    padding:32px 32px 0px 72px;
 | 
			
		||||
    .el-message-box__title {
 | 
			
		||||
      font-size: 16px;
 | 
			
		||||
      font-weight: 600;
 | 
			
		||||
      color: rgba(0,0,0,0.85);
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
  .el-message-box__content {
 | 
			
		||||
    padding-bottom: 24px;
 | 
			
		||||
    .el-message-box__status {
 | 
			
		||||
      top:-72%;
 | 
			
		||||
      left:20px;
 | 
			
		||||
      font-size:21px !important
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
  .el-message-box__btns {
 | 
			
		||||
    padding-right: 32px;
 | 
			
		||||
    padding-bottom:14px;
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// 确认弹窗(UI样式修改和原样式有区别--end)
 | 
			
		||||
@@ -1,459 +0,0 @@
 | 
			
		||||
<!--
 | 
			
		||||
 * @Author: zwq
 | 
			
		||||
 * @Date: 2021-11-18 14:16:25
 | 
			
		||||
 * @LastEditors: DY
 | 
			
		||||
 * @LastEditTime: 2023-11-27 15:26:12
 | 
			
		||||
 * @Description:
 | 
			
		||||
-->
 | 
			
		||||
<template>
 | 
			
		||||
	<el-drawer
 | 
			
		||||
		:visible.sync="visible"
 | 
			
		||||
		:show-close="false"
 | 
			
		||||
		:wrapper-closable="isdetail"
 | 
			
		||||
		class="drawer"
 | 
			
		||||
		size="60%">
 | 
			
		||||
		<small-title slot="title" :no-padding="true">
 | 
			
		||||
			{{ isdetail ? '详情' : !dataForm.id ? '新增' : '编辑' }}
 | 
			
		||||
		</small-title>
 | 
			
		||||
		<div class="content">
 | 
			
		||||
			<div class="visual-part">
 | 
			
		||||
				<el-form
 | 
			
		||||
					:model="dataForm"
 | 
			
		||||
					:rules="dataRule"
 | 
			
		||||
					ref="dataForm"
 | 
			
		||||
					@keyup.enter.native="dataFormSubmit()"
 | 
			
		||||
					label-width="100px"
 | 
			
		||||
					label-position="top">
 | 
			
		||||
					<el-row :gutter="20">
 | 
			
		||||
						<el-col :span="12">
 | 
			
		||||
							<el-form-item label="物料编码" prop="code">
 | 
			
		||||
								<el-input
 | 
			
		||||
									v-model="dataForm.code"
 | 
			
		||||
									clearable
 | 
			
		||||
									:disabled="isdetail"
 | 
			
		||||
									placeholder="请输入物料编码" />
 | 
			
		||||
							</el-form-item>
 | 
			
		||||
						</el-col>
 | 
			
		||||
						<el-col :span="12">
 | 
			
		||||
							<el-form-item label="物料名称" prop="name">
 | 
			
		||||
								<el-input v-model="dataForm.name" :disabled="isdetail" clearable placeholder="请输入物料名称" />
 | 
			
		||||
							</el-form-item>
 | 
			
		||||
						</el-col>
 | 
			
		||||
					</el-row>
 | 
			
		||||
					<el-row :gutter="20">
 | 
			
		||||
						<el-col :span="12">
 | 
			
		||||
							<el-form-item label="英文名称" prop="engName">
 | 
			
		||||
								<el-input
 | 
			
		||||
									v-model="dataForm.engName"
 | 
			
		||||
									clearable
 | 
			
		||||
									:disabled="isdetail"
 | 
			
		||||
									placeholder="请输入英文名称" />
 | 
			
		||||
							</el-form-item>
 | 
			
		||||
						</el-col>
 | 
			
		||||
						<el-col :span="12">
 | 
			
		||||
							<el-form-item label="物料类型" prop="type">
 | 
			
		||||
								<el-select
 | 
			
		||||
									v-model="dataForm.type"
 | 
			
		||||
									filterable
 | 
			
		||||
									:disabled="isdetail"
 | 
			
		||||
									style="width: 100%"
 | 
			
		||||
									placeholder="请选择物料类型">
 | 
			
		||||
									<el-option
 | 
			
		||||
										v-for="dict in materialList"
 | 
			
		||||
										:key="dict.value"
 | 
			
		||||
										:label="dict.label"
 | 
			
		||||
										:value="dict.value" />
 | 
			
		||||
								</el-select>
 | 
			
		||||
							</el-form-item>
 | 
			
		||||
						</el-col>
 | 
			
		||||
					</el-row>
 | 
			
		||||
					<el-row :gutter="20">
 | 
			
		||||
						<el-col :span="12">
 | 
			
		||||
							<el-form-item label="规格" prop="spec">
 | 
			
		||||
								<el-input
 | 
			
		||||
									v-model="dataForm.spec"
 | 
			
		||||
									clearable
 | 
			
		||||
									:disabled="isdetail"
 | 
			
		||||
									placeholder="请输入规格" />
 | 
			
		||||
							</el-form-item>
 | 
			
		||||
						</el-col>
 | 
			
		||||
						<el-col :span="12">
 | 
			
		||||
							<el-form-item label="供应商" prop="supplierId">
 | 
			
		||||
								<el-select
 | 
			
		||||
									v-model="dataForm.supplierId"
 | 
			
		||||
									filterable
 | 
			
		||||
									clearable
 | 
			
		||||
									:disabled="isdetail"
 | 
			
		||||
									style="width: 100%"
 | 
			
		||||
									placeholder="请选择供应商">
 | 
			
		||||
									<el-option
 | 
			
		||||
										v-for="dict in supplierList"
 | 
			
		||||
										:key="dict.id"
 | 
			
		||||
										:label="dict.name"
 | 
			
		||||
										:value="dict.id" />
 | 
			
		||||
								</el-select>
 | 
			
		||||
							</el-form-item>
 | 
			
		||||
						</el-col>
 | 
			
		||||
					</el-row>
 | 
			
		||||
					<el-row :gutter="20">
 | 
			
		||||
						<el-col :span="12">
 | 
			
		||||
							<el-form-item label="单位" prop="unit">
 | 
			
		||||
								<el-select
 | 
			
		||||
									v-model="dataForm.unit"
 | 
			
		||||
									filterable
 | 
			
		||||
									:disabled="isdetail"
 | 
			
		||||
									style="width: 100%"
 | 
			
		||||
									placeholder="请选择物料单位">
 | 
			
		||||
									<el-option
 | 
			
		||||
										v-for="dict in getDictDatas('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="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">
 | 
			
		||||
				<small-title
 | 
			
		||||
					style="margin: 16px 0; padding-left: 8px"
 | 
			
		||||
					:no-padding="true">
 | 
			
		||||
					物料属性
 | 
			
		||||
				</small-title>
 | 
			
		||||
 | 
			
		||||
				<div v-if="!isdetail" class="action_btn">
 | 
			
		||||
          <template>
 | 
			
		||||
            <span style="display: inline-block;">
 | 
			
		||||
              <el-button type="text" @click="addNew()" icon="el-icon-plus">新增</el-button>
 | 
			
		||||
            </span>
 | 
			
		||||
          </template>
 | 
			
		||||
        </div>
 | 
			
		||||
				<base-table
 | 
			
		||||
					:table-props="tableProps"
 | 
			
		||||
					:page="listQuery.pageNo"
 | 
			
		||||
					:limit="listQuery.pageSize"
 | 
			
		||||
					:table-data="materialAttrList">
 | 
			
		||||
					<method-btn
 | 
			
		||||
						v-if="!isdetail"
 | 
			
		||||
						slot="handleBtn"
 | 
			
		||||
						:width="120"
 | 
			
		||||
						label="操作"
 | 
			
		||||
						:method-list="tableBtn"
 | 
			
		||||
						@clickBtn="handleClick" />
 | 
			
		||||
				</base-table>
 | 
			
		||||
				<pagination
 | 
			
		||||
					v-show="listQuery.total > 0"
 | 
			
		||||
					:total="listQuery.total"
 | 
			
		||||
					:page.sync="listQuery.pageNo"
 | 
			
		||||
					:limit.sync="listQuery.pageSize"
 | 
			
		||||
					:page-sizes="[5, 10, 15]"
 | 
			
		||||
					@pagination="getList" />
 | 
			
		||||
			</div>
 | 
			
		||||
 | 
			
		||||
			<div v-if="!isdetail" class="drawer-body__footer">
 | 
			
		||||
				<el-button style="" @click="goback()">取消</el-button>
 | 
			
		||||
				<el-button type="primary" @click="dataFormSubmit()">确定</el-button>
 | 
			
		||||
			</div>
 | 
			
		||||
 | 
			
		||||
		</div>
 | 
			
		||||
 | 
			
		||||
		<attr-add
 | 
			
		||||
			v-if="addOrUpdateVisible"
 | 
			
		||||
			ref="addOrUpdate"
 | 
			
		||||
			:material-id="dataForm.id"
 | 
			
		||||
			@refreshDataList="getList" />
 | 
			
		||||
	</el-drawer>
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script>
 | 
			
		||||
import basicAdd from '../../core/mixins/basic-add';
 | 
			
		||||
import { createMaterial, updateMaterial, getMaterial, getCode, getSupplierList, getMaterialAttrList, deleteMaterialAttr } from "@/api/base/material";
 | 
			
		||||
import { listData } from "@/api/system/dict/data";
 | 
			
		||||
import SmallTitle from './SmallTitle';
 | 
			
		||||
import { parseTime } from '../../core/mixins/code-filter';
 | 
			
		||||
import attrAdd from './attr-add';
 | 
			
		||||
import { getDictDatas } from "@/utils/dict";
 | 
			
		||||
 | 
			
		||||
const tableBtn = [
 | 
			
		||||
	{
 | 
			
		||||
		type: 'edit',
 | 
			
		||||
		btnName: '编辑',
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		type: 'delete',
 | 
			
		||||
		btnName: '删除',
 | 
			
		||||
	},
 | 
			
		||||
];
 | 
			
		||||
const tableProps = [
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'createTime',
 | 
			
		||||
		label: '添加时间',
 | 
			
		||||
		filter: parseTime,
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'attrName',
 | 
			
		||||
		label: '属性名',
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'attrValue',
 | 
			
		||||
		label: '属性值',
 | 
			
		||||
	},
 | 
			
		||||
];
 | 
			
		||||
 | 
			
		||||
export default {
 | 
			
		||||
	mixins: [basicAdd],
 | 
			
		||||
	components: { SmallTitle, attrAdd },
 | 
			
		||||
	data() {
 | 
			
		||||
		return {
 | 
			
		||||
			tableBtn,
 | 
			
		||||
			tableProps,
 | 
			
		||||
			addOrUpdateVisible: false,
 | 
			
		||||
			urlOptions: {
 | 
			
		||||
			  isGetCode: true,
 | 
			
		||||
        codeURL: getCode,
 | 
			
		||||
				createURL: createMaterial,
 | 
			
		||||
				updateURL: updateMaterial,
 | 
			
		||||
				infoURL: getMaterial,
 | 
			
		||||
			},
 | 
			
		||||
			listQuery: {
 | 
			
		||||
				pageSize: 10,
 | 
			
		||||
				pageNo: 1,
 | 
			
		||||
				total: 0,
 | 
			
		||||
			},
 | 
			
		||||
			dataForm: {
 | 
			
		||||
        id: undefined,
 | 
			
		||||
        code: undefined,
 | 
			
		||||
        name: '',
 | 
			
		||||
				engName: '',
 | 
			
		||||
				type: '',
 | 
			
		||||
        spec: undefined,
 | 
			
		||||
				supplierId: undefined,
 | 
			
		||||
        remark: undefined,
 | 
			
		||||
				unit: ''
 | 
			
		||||
			},
 | 
			
		||||
			materialList: [],
 | 
			
		||||
			supplierList: [],
 | 
			
		||||
			materialAttrList: [],
 | 
			
		||||
			unitList: [],
 | 
			
		||||
			visible: false,
 | 
			
		||||
			isdetail: false,
 | 
			
		||||
			idAttrShow: false,
 | 
			
		||||
			dataRule: {
 | 
			
		||||
        code: [{ required: true, message: "物料编码不能为空", trigger: "blur" }],
 | 
			
		||||
        name: [{ required: true, message: "物料名称不能为空", trigger: "blur" }],
 | 
			
		||||
				type: [{ required: true, message: "物料类型不能为空", trigger: "blur" }]
 | 
			
		||||
      }
 | 
			
		||||
		};
 | 
			
		||||
	},
 | 
			
		||||
	mounted() {
 | 
			
		||||
		this.getDict()
 | 
			
		||||
	},
 | 
			
		||||
	methods: {
 | 
			
		||||
		async getDict() {
 | 
			
		||||
			// 物料类型列表
 | 
			
		||||
			const res = await listData({
 | 
			
		||||
				pageNo: 1,
 | 
			
		||||
        pageSize: 99,
 | 
			
		||||
        dictType: 'material_type',
 | 
			
		||||
			});
 | 
			
		||||
			this.materialList = res.data.list.map(item => {
 | 
			
		||||
				return {
 | 
			
		||||
					label: item.label,
 | 
			
		||||
					value: Number(item.value)
 | 
			
		||||
				}
 | 
			
		||||
			});
 | 
			
		||||
			// 供应商列表
 | 
			
		||||
			const supplierRes = await getSupplierList();
 | 
			
		||||
			this.supplierList = supplierRes.data;
 | 
			
		||||
			// 物料单位列表
 | 
			
		||||
			// const unitRes = await listData({
 | 
			
		||||
			// 	pageNo: 1,
 | 
			
		||||
      //   pageSize: 99,
 | 
			
		||||
      //   dictType: 'goods_unit',
 | 
			
		||||
			// });
 | 
			
		||||
			// this.unitList = unitRes.data.list.map(item => {
 | 
			
		||||
			// 	return {
 | 
			
		||||
			// 		label: item.label,
 | 
			
		||||
			// 		value: Number(item.value)
 | 
			
		||||
			// 	}
 | 
			
		||||
			// });
 | 
			
		||||
		},
 | 
			
		||||
		initData() {
 | 
			
		||||
			this.materialAttrList.splice(0);
 | 
			
		||||
			this.listQuery.total = 0;
 | 
			
		||||
		},
 | 
			
		||||
		handleClick(raw) {
 | 
			
		||||
			if (raw.type === 'delete') {
 | 
			
		||||
				this.$confirm(
 | 
			
		||||
					`是否确认删除属性名为"${raw.data.attrName}"的数据项?`,
 | 
			
		||||
					'提示',
 | 
			
		||||
					{
 | 
			
		||||
						confirmButtonText: '确定',
 | 
			
		||||
						cancelButtonText: '取消',
 | 
			
		||||
						type: 'warning',
 | 
			
		||||
					}
 | 
			
		||||
				)
 | 
			
		||||
					.then(() => {
 | 
			
		||||
						deleteMaterialAttr(raw.data.id).then(({ data }) => {
 | 
			
		||||
							this.$message({
 | 
			
		||||
								message: '操作成功',
 | 
			
		||||
								type: 'success',
 | 
			
		||||
								duration: 1500,
 | 
			
		||||
								onClose: () => {
 | 
			
		||||
									this.getList();
 | 
			
		||||
								},
 | 
			
		||||
							});
 | 
			
		||||
						});
 | 
			
		||||
					})
 | 
			
		||||
					.catch(() => {});
 | 
			
		||||
			} else {
 | 
			
		||||
				this.addNew(raw.data.id);
 | 
			
		||||
			}
 | 
			
		||||
		},
 | 
			
		||||
		getList() {
 | 
			
		||||
			// 获取物料的属性列表
 | 
			
		||||
			getMaterialAttrList({
 | 
			
		||||
				...this.listQuery,
 | 
			
		||||
				materialId: this.dataForm.id,
 | 
			
		||||
			}).then((response) => {
 | 
			
		||||
				this.materialAttrList = response.data.list;
 | 
			
		||||
				this.listQuery.total = response.data.total;
 | 
			
		||||
			});
 | 
			
		||||
		},
 | 
			
		||||
		init(id, isdetail) {
 | 
			
		||||
			this.initData();
 | 
			
		||||
			this.isdetail = isdetail || false;
 | 
			
		||||
			this.dataForm.id = id || undefined;
 | 
			
		||||
			this.visible = true;
 | 
			
		||||
			if (id) {
 | 
			
		||||
				this.idAttrShow = true
 | 
			
		||||
			} else {
 | 
			
		||||
				this.idAttrShow = false
 | 
			
		||||
			}
 | 
			
		||||
 | 
			
		||||
			this.$nextTick(() => {
 | 
			
		||||
				this.$refs['dataForm'].resetFields();
 | 
			
		||||
 | 
			
		||||
				if (this.dataForm.id) {
 | 
			
		||||
					// 获取物料详情
 | 
			
		||||
					this.urlOptions.infoURL(id).then(response => {
 | 
			
		||||
            this.dataForm = response.data;
 | 
			
		||||
						if (this.dataForm.unit) {
 | 
			
		||||
							this.dataForm.unit = String(this.dataForm.unit)
 | 
			
		||||
						}
 | 
			
		||||
          });
 | 
			
		||||
					// 获取物料的属性列表
 | 
			
		||||
					this.getList();
 | 
			
		||||
				} else {
 | 
			
		||||
					if (this.urlOptions.isGetCode) {
 | 
			
		||||
            this.getCode()
 | 
			
		||||
          }
 | 
			
		||||
				}
 | 
			
		||||
			});
 | 
			
		||||
		},
 | 
			
		||||
		// 表单提交
 | 
			
		||||
    dataFormSubmit() {
 | 
			
		||||
      this.$refs["dataForm"].validate((valid) => {
 | 
			
		||||
        if (!valid) {
 | 
			
		||||
          return false;
 | 
			
		||||
        }
 | 
			
		||||
        // 修改的提交
 | 
			
		||||
        if (this.dataForm.id) {
 | 
			
		||||
          this.urlOptions.updateURL(this.dataForm).then(response => {
 | 
			
		||||
            this.$modal.msgSuccess("修改成功");
 | 
			
		||||
						this.visible = false
 | 
			
		||||
            this.$emit("refreshDataList");
 | 
			
		||||
          });
 | 
			
		||||
          return;
 | 
			
		||||
        }
 | 
			
		||||
        // 添加的提交
 | 
			
		||||
        this.urlOptions.createURL(this.dataForm).then(response => {
 | 
			
		||||
          this.$modal.msgSuccess("新增成功");
 | 
			
		||||
					this.idAttrShow = true
 | 
			
		||||
          this.$emit("refreshDataList");
 | 
			
		||||
        });
 | 
			
		||||
      });
 | 
			
		||||
    },
 | 
			
		||||
		goback() {
 | 
			
		||||
			this.$emit('refreshDataList');
 | 
			
		||||
			this.visible = false;
 | 
			
		||||
			// this.initData();
 | 
			
		||||
		},
 | 
			
		||||
		goEdit() {
 | 
			
		||||
			this.isdetail = false;
 | 
			
		||||
		},
 | 
			
		||||
		// 新增 / 修改
 | 
			
		||||
		addNew(id) {
 | 
			
		||||
			this.addOrUpdateVisible = true;
 | 
			
		||||
			this.$nextTick(() => {
 | 
			
		||||
				this.$refs.addOrUpdate.init(id);
 | 
			
		||||
			});
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
};
 | 
			
		||||
</script>
 | 
			
		||||
<style scoped>
 | 
			
		||||
.drawer >>> .el-drawer {
 | 
			
		||||
	border-radius: 8px 0 0 8px;
 | 
			
		||||
	display: flex;
 | 
			
		||||
	flex-direction: column;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
.drawer >>> .el-form-item__label {
 | 
			
		||||
	padding: 0;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
.drawer >>> .el-drawer__header {
 | 
			
		||||
	margin: 0;
 | 
			
		||||
	padding: 32px 32px 24px;
 | 
			
		||||
	border-bottom: 1px solid #dcdfe6;
 | 
			
		||||
}
 | 
			
		||||
.drawer >>> .el-drawer__body {
 | 
			
		||||
	flex: 1;
 | 
			
		||||
	height: 1px;
 | 
			
		||||
	display: flex;
 | 
			
		||||
	flex-direction: column;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
.drawer >>> .content {
 | 
			
		||||
	padding: 30px 24px;
 | 
			
		||||
	flex: 1;
 | 
			
		||||
	display: flex;
 | 
			
		||||
	flex-direction: column;
 | 
			
		||||
	/* height: 100%; */
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
.drawer >>> .visual-part {
 | 
			
		||||
	flex: 1 auto;
 | 
			
		||||
	max-height: 76vh;
 | 
			
		||||
	overflow: hidden;
 | 
			
		||||
	overflow-y: scroll;
 | 
			
		||||
	padding-right: 10px; /* 调整滚动条样式 */
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
.drawer >>> .el-form,
 | 
			
		||||
.drawer >>> .attr-list {
 | 
			
		||||
	padding: 0 16px;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
.drawer-body__footer {
 | 
			
		||||
	display: flex;
 | 
			
		||||
	justify-content: flex-end;
 | 
			
		||||
	padding: 18px;
 | 
			
		||||
}
 | 
			
		||||
.action_btn {
 | 
			
		||||
  float: right;
 | 
			
		||||
  margin: -40px 15px;
 | 
			
		||||
  font-size: 14px;
 | 
			
		||||
}
 | 
			
		||||
.add {
 | 
			
		||||
	color: #0b58ff;
 | 
			
		||||
}
 | 
			
		||||
</style>
 | 
			
		||||
@@ -1,252 +0,0 @@
 | 
			
		||||
<template>
 | 
			
		||||
	<div class="app-container">
 | 
			
		||||
		<search-bar
 | 
			
		||||
			:formConfigs="formConfig"
 | 
			
		||||
			ref="searchBarForm"
 | 
			
		||||
			@headBtnClick="buttonClick" />
 | 
			
		||||
		<base-table
 | 
			
		||||
			v-loading="dataListLoading"
 | 
			
		||||
			:table-props="tableProps"
 | 
			
		||||
			:page="listQuery.pageNo"
 | 
			
		||||
			:limit="listQuery.pageSize"
 | 
			
		||||
			:table-data="tableData">
 | 
			
		||||
			<method-btn
 | 
			
		||||
				v-if="tableBtn.length"
 | 
			
		||||
				slot="handleBtn"
 | 
			
		||||
				:width="120"
 | 
			
		||||
				label="操作"
 | 
			
		||||
				:method-list="tableBtn"
 | 
			
		||||
				@clickBtn="handleClick" />
 | 
			
		||||
		</base-table>
 | 
			
		||||
		<pagination
 | 
			
		||||
			:limit.sync="listQuery.pageSize"
 | 
			
		||||
			:page.sync="listQuery.pageNo"
 | 
			
		||||
			:total="listQuery.total"
 | 
			
		||||
			@pagination="getDataList" />
 | 
			
		||||
		<add-or-update
 | 
			
		||||
			v-if="addOrUpdateVisible"
 | 
			
		||||
			ref="addOrUpdate"
 | 
			
		||||
			@refreshDataList="getDataList" />
 | 
			
		||||
	</div>
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script>
 | 
			
		||||
import AddOrUpdate from './add-or-updata';
 | 
			
		||||
import basicPage from '../../core/mixins/basic-page';
 | 
			
		||||
import { parseTime } from '../../core/mixins/code-filter';
 | 
			
		||||
import {
 | 
			
		||||
	getMaterialPage,
 | 
			
		||||
	deleteMaterial
 | 
			
		||||
} from '@/api/base/material';
 | 
			
		||||
import { listData } from "@/api/system/dict/data";
 | 
			
		||||
import { publicFormatter } from '@/utils/dict';
 | 
			
		||||
 | 
			
		||||
const tableProps = [
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'createTime',
 | 
			
		||||
		label: '添加时间',
 | 
			
		||||
		filter: parseTime
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'code',
 | 
			
		||||
		label: '物料编码'
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'name',
 | 
			
		||||
		label: '物料名称'
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'engName',
 | 
			
		||||
		label: '英文名称'
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'type',
 | 
			
		||||
		label: '物料类型',
 | 
			
		||||
		filter: publicFormatter('material_type')
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'supplierName',
 | 
			
		||||
		label: '供应商'
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'remark',
 | 
			
		||||
		label: '备注'
 | 
			
		||||
	}
 | 
			
		||||
];
 | 
			
		||||
 | 
			
		||||
export default {
 | 
			
		||||
	mixins: [basicPage],
 | 
			
		||||
	data() {
 | 
			
		||||
		return {
 | 
			
		||||
			urlOptions: {
 | 
			
		||||
				getDataListURL: getMaterialPage,
 | 
			
		||||
				deleteURL: deleteMaterial
 | 
			
		||||
				// exportURL: exportFactoryExcel,
 | 
			
		||||
			},
 | 
			
		||||
			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:editAttr`)
 | 
			
		||||
					// ? {
 | 
			
		||||
					// 		type: 'editAttr',
 | 
			
		||||
					// 		btnName: '编辑属性',
 | 
			
		||||
					//   }
 | 
			
		||||
					// : undefined,
 | 
			
		||||
        this.$auth.hasPermi(`base:material:delete`)
 | 
			
		||||
					? {
 | 
			
		||||
							type: 'delete',
 | 
			
		||||
							btnName: '删除',
 | 
			
		||||
					  }
 | 
			
		||||
					: undefined,
 | 
			
		||||
			].filter((v)=>v),
 | 
			
		||||
			tableData: [],
 | 
			
		||||
			typeList: [],
 | 
			
		||||
			formConfig: [
 | 
			
		||||
				{
 | 
			
		||||
					type: 'input',
 | 
			
		||||
					label: '物料名称',
 | 
			
		||||
					placeholder: '物料名称',
 | 
			
		||||
					param: 'name',
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					type: 'input',
 | 
			
		||||
					label: '物料编码',
 | 
			
		||||
					placeholder: '物料编码',
 | 
			
		||||
					param: 'code',
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					type: 'button',
 | 
			
		||||
					btnName: '查询',
 | 
			
		||||
					name: 'search',
 | 
			
		||||
					color: 'primary',
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					type: 'separate',
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					type: this.$auth.hasPermi('base:material:create') ? 'button' : '',
 | 
			
		||||
					btnName: '新增',
 | 
			
		||||
					name: 'add',
 | 
			
		||||
					color: 'success',
 | 
			
		||||
					plain: true
 | 
			
		||||
				},
 | 
			
		||||
			],
 | 
			
		||||
		};
 | 
			
		||||
	},
 | 
			
		||||
	components: {
 | 
			
		||||
		AddOrUpdate,
 | 
			
		||||
	},
 | 
			
		||||
	created() {
 | 
			
		||||
		this.getDict()
 | 
			
		||||
	},
 | 
			
		||||
	methods: {
 | 
			
		||||
		async getDict() {
 | 
			
		||||
			// 物料类型列表
 | 
			
		||||
			const res = await listData({
 | 
			
		||||
				pageNo: 1,
 | 
			
		||||
        pageSize: 99,
 | 
			
		||||
        dictType: 'material_type',
 | 
			
		||||
			});
 | 
			
		||||
			this.typeList = res.data.list.map(item => {
 | 
			
		||||
				return {
 | 
			
		||||
					label: item.label,
 | 
			
		||||
					value: Number(item.value)
 | 
			
		||||
				}
 | 
			
		||||
			});
 | 
			
		||||
		},
 | 
			
		||||
		otherMethods(val) {
 | 
			
		||||
			if (val.type === 'detail') {
 | 
			
		||||
				this.addOrUpdateVisible = true;
 | 
			
		||||
				this.addOrEditTitle = '详情';
 | 
			
		||||
				this.$nextTick(() => {
 | 
			
		||||
					this.$refs.addOrUpdate.init(val.data.id, true);
 | 
			
		||||
				});
 | 
			
		||||
			} else {
 | 
			
		||||
				this.addOrEditTitle = '编辑';
 | 
			
		||||
				this.addOrUpdateVisible = true;
 | 
			
		||||
				this.$nextTick(() => {
 | 
			
		||||
					this.$refs.addOrUpdate.init(val.data.id);
 | 
			
		||||
				});
 | 
			
		||||
			}
 | 
			
		||||
		},
 | 
			
		||||
		// 获取数据列表
 | 
			
		||||
    getDataList() {
 | 
			
		||||
      this.dataListLoading = true;
 | 
			
		||||
      this.urlOptions.getDataListURL(this.listQuery).then(response => {
 | 
			
		||||
        this.tableData = response.data.records.map(item => {
 | 
			
		||||
					this.typeList.filter(t => {
 | 
			
		||||
						if (item.type === t.value) {
 | 
			
		||||
							item.materialType = t.label
 | 
			
		||||
						}
 | 
			
		||||
					})
 | 
			
		||||
					return item
 | 
			
		||||
				});
 | 
			
		||||
        this.listQuery.total = response.data.total;
 | 
			
		||||
        this.dataListLoading = false;
 | 
			
		||||
      });
 | 
			
		||||
    },
 | 
			
		||||
		buttonClick(val) {
 | 
			
		||||
			switch (val.btnName) {
 | 
			
		||||
				case 'search':
 | 
			
		||||
					this.listQuery.pageNo = 1;
 | 
			
		||||
					this.listQuery.pageSize = 10;
 | 
			
		||||
					this.listQuery.name = val.name ? val.name : undefined;
 | 
			
		||||
					this.listQuery.code = val.code ? val.code : undefined;
 | 
			
		||||
					this.getDataList();
 | 
			
		||||
					break;
 | 
			
		||||
				case 'reset':
 | 
			
		||||
					this.$refs.searchBarForm.resetForm();
 | 
			
		||||
					this.listQuery = {
 | 
			
		||||
						pageSize: 10,
 | 
			
		||||
						pageNo: 1,
 | 
			
		||||
						total: 1,
 | 
			
		||||
					};
 | 
			
		||||
					this.getDataList();
 | 
			
		||||
					break;
 | 
			
		||||
				case 'add':
 | 
			
		||||
					this.addOrEditTitle = '新增';
 | 
			
		||||
					this.addOrUpdateVisible = true;
 | 
			
		||||
					this.addOrUpdateHandle();
 | 
			
		||||
					break;
 | 
			
		||||
				case 'export':
 | 
			
		||||
					this.handleExport();
 | 
			
		||||
					break;
 | 
			
		||||
				default:
 | 
			
		||||
					console.log(val);
 | 
			
		||||
			}
 | 
			
		||||
		},
 | 
			
		||||
		// 删除
 | 
			
		||||
    deleteHandle(id, name, index) {
 | 
			
		||||
      this.$confirm(`是否删除物料名称为"${name}"的数据项?`, "提示", {
 | 
			
		||||
        confirmButtonText: "确定",
 | 
			
		||||
        cancelButtonText: "取消",
 | 
			
		||||
        type: "warning",
 | 
			
		||||
      })
 | 
			
		||||
        .then(() => {
 | 
			
		||||
          this.urlOptions.deleteURL(id).then(({ data }) => {
 | 
			
		||||
            this.$message({
 | 
			
		||||
              message: "操作成功",
 | 
			
		||||
              type: "success",
 | 
			
		||||
              duration: 1500,
 | 
			
		||||
              onClose: () => {
 | 
			
		||||
                this.getDataList();
 | 
			
		||||
              },
 | 
			
		||||
            });
 | 
			
		||||
          });
 | 
			
		||||
        })
 | 
			
		||||
        .catch(() => { });
 | 
			
		||||
    }
 | 
			
		||||
	},
 | 
			
		||||
};
 | 
			
		||||
</script>
 | 
			
		||||
@@ -1,324 +1,350 @@
 | 
			
		||||
<template>
 | 
			
		||||
  <div class="choicepart-container">
 | 
			
		||||
    <navbar />
 | 
			
		||||
    <div class="choicepart-wrapper">
 | 
			
		||||
      <div class="choicepart-box" id="choicepartBox" :style="'transform:scale('+scale+');width:1574px;height:538px;'" v-show="showItem">
 | 
			
		||||
      <div class="choicepart-line1">
 | 
			
		||||
        <div
 | 
			
		||||
          v-for="(item, index) in menuArr1"
 | 
			
		||||
          :key="index"
 | 
			
		||||
          class="choicepart-item"
 | 
			
		||||
          @click="handelClick(item, item.choicepart)"
 | 
			
		||||
          :style="{opacity: item.visible?1:0.4, pointerEvents:item.visible?'auto':'none'}"
 | 
			
		||||
        >
 | 
			
		||||
          <div>
 | 
			
		||||
            <img :src="require(`../../assets/images/choicepart/${item.name}.png`)" alt="">
 | 
			
		||||
          </div>
 | 
			
		||||
          <div class="choicepart-item-title">{{item.meta.title}}</div>
 | 
			
		||||
        </div>
 | 
			
		||||
      </div>
 | 
			
		||||
      <div class="choicepart-line2">
 | 
			
		||||
        <div
 | 
			
		||||
          v-for="(item, index) in menuArr2"
 | 
			
		||||
          :key="index"
 | 
			
		||||
          class="choicepart-item"
 | 
			
		||||
          @click="handelClick(item, item.choicepart)"
 | 
			
		||||
          :style="{opacity: item.visible?1:0.4, pointerEvents:item.visible?'auto':'none'}"
 | 
			
		||||
        >
 | 
			
		||||
          <div>
 | 
			
		||||
            <img :src="require(`../../assets/images/choicepart/${item.name}.png`)" alt="">
 | 
			
		||||
          </div>
 | 
			
		||||
          <div class="choicepart-item-title">{{item.meta.title}}</div>
 | 
			
		||||
        </div>
 | 
			
		||||
      </div>
 | 
			
		||||
    </div>
 | 
			
		||||
    </div>
 | 
			
		||||
    <div class="choicepart-footer">© 中建材智能自动化研究院有限公司</div>
 | 
			
		||||
  </div>
 | 
			
		||||
	<div class="choicepart-container">
 | 
			
		||||
		<navbar />
 | 
			
		||||
		<div class="choicepart-wrapper">
 | 
			
		||||
			<div
 | 
			
		||||
				class="choicepart-box"
 | 
			
		||||
				id="choicepartBox"
 | 
			
		||||
				:style="'transform:scale(' + scale + ');width:1574px;height:538px;'"
 | 
			
		||||
				v-show="showItem">
 | 
			
		||||
				<div class="choicepart-line1">
 | 
			
		||||
					<div
 | 
			
		||||
						v-for="(item, index) in menuArr1"
 | 
			
		||||
						:key="index"
 | 
			
		||||
						class="choicepart-item"
 | 
			
		||||
						@click="handelClick(item, item.choicepart)"
 | 
			
		||||
						:style="{
 | 
			
		||||
							opacity: item.visible ? 1 : 0.4,
 | 
			
		||||
							pointerEvents: item.visible ? 'auto' : 'none',
 | 
			
		||||
						}">
 | 
			
		||||
						<div>
 | 
			
		||||
							<img
 | 
			
		||||
								:src="
 | 
			
		||||
									require(`../../assets/images/choicepart/${item.name}.png`)
 | 
			
		||||
								"
 | 
			
		||||
								alt="" />
 | 
			
		||||
						</div>
 | 
			
		||||
						<div class="choicepart-item-title">{{ item.meta.title }}</div>
 | 
			
		||||
					</div>
 | 
			
		||||
				</div>
 | 
			
		||||
				<div class="choicepart-line2">
 | 
			
		||||
					<div
 | 
			
		||||
						v-for="(item, index) in menuArr2"
 | 
			
		||||
						:key="index"
 | 
			
		||||
						class="choicepart-item"
 | 
			
		||||
						@click="handelClick(item, item.choicepart)"
 | 
			
		||||
						:style="{
 | 
			
		||||
							opacity: item.visible ? 1 : 0.4,
 | 
			
		||||
							pointerEvents: item.visible ? 'auto' : 'none',
 | 
			
		||||
						}">
 | 
			
		||||
						<div>
 | 
			
		||||
							<img
 | 
			
		||||
								:src="
 | 
			
		||||
									require(`../../assets/images/choicepart/${item.name}.png`)
 | 
			
		||||
								"
 | 
			
		||||
								alt="" />
 | 
			
		||||
						</div>
 | 
			
		||||
						<div class="choicepart-item-title">{{ item.meta.title }}</div>
 | 
			
		||||
					</div>
 | 
			
		||||
				</div>
 | 
			
		||||
			</div>
 | 
			
		||||
		</div>
 | 
			
		||||
		<div class="choicepart-footer">© 中建材智能自动化研究院有限公司</div>
 | 
			
		||||
	</div>
 | 
			
		||||
</template>
 | 
			
		||||
<script>
 | 
			
		||||
import Navbar from './components/Navbar'
 | 
			
		||||
import { debounce } from '@/utils/debounce'
 | 
			
		||||
import Navbar from './components/Navbar';
 | 
			
		||||
import { debounce } from '@/utils/debounce';
 | 
			
		||||
export default {
 | 
			
		||||
  components: { Navbar },
 | 
			
		||||
  name: 'choicePart',
 | 
			
		||||
  data() {
 | 
			
		||||
    return {
 | 
			
		||||
      boxReset: '',
 | 
			
		||||
      scale: 1,
 | 
			
		||||
      menuArr1: [
 | 
			
		||||
        {
 | 
			
		||||
          name: 'Core',
 | 
			
		||||
          title: '基础核心',
 | 
			
		||||
          visible: false,
 | 
			
		||||
          meta: {
 | 
			
		||||
            title: ''
 | 
			
		||||
          }
 | 
			
		||||
        },
 | 
			
		||||
        {
 | 
			
		||||
          name: 'Order',
 | 
			
		||||
          title: '订单管理',
 | 
			
		||||
          visible: false,
 | 
			
		||||
          meta: {
 | 
			
		||||
            title: ''
 | 
			
		||||
          }
 | 
			
		||||
        },
 | 
			
		||||
        {
 | 
			
		||||
          name: 'Equipment',
 | 
			
		||||
          title: '设备管理',
 | 
			
		||||
          visible: false,
 | 
			
		||||
          meta: {
 | 
			
		||||
            title: ''
 | 
			
		||||
          }
 | 
			
		||||
        },
 | 
			
		||||
        {
 | 
			
		||||
          name: 'Group',
 | 
			
		||||
          title: '班组管理',
 | 
			
		||||
          visible: false,
 | 
			
		||||
          meta: {
 | 
			
		||||
            title: ''
 | 
			
		||||
          }
 | 
			
		||||
        },
 | 
			
		||||
        {
 | 
			
		||||
          name: 'Quality',
 | 
			
		||||
          title: '质量管理',
 | 
			
		||||
          visible: false,
 | 
			
		||||
          meta: {
 | 
			
		||||
            title: ''
 | 
			
		||||
          }
 | 
			
		||||
        },
 | 
			
		||||
        {
 | 
			
		||||
          name: 'Warehouse',
 | 
			
		||||
          title: '仓库管理',
 | 
			
		||||
          visible: false,
 | 
			
		||||
          meta: {
 | 
			
		||||
            title: ''
 | 
			
		||||
          }
 | 
			
		||||
        },
 | 
			
		||||
        {
 | 
			
		||||
          name: 'Energy',
 | 
			
		||||
          title: '能源管理',
 | 
			
		||||
          visible: false,
 | 
			
		||||
          meta: {
 | 
			
		||||
            title: ''
 | 
			
		||||
          }
 | 
			
		||||
        }
 | 
			
		||||
      ],
 | 
			
		||||
      menuArr2: [
 | 
			
		||||
        {
 | 
			
		||||
          name: 'Packaging',
 | 
			
		||||
          title: '包装管理',
 | 
			
		||||
          visible: false,
 | 
			
		||||
          meta: {
 | 
			
		||||
            title: ''
 | 
			
		||||
          }
 | 
			
		||||
        },
 | 
			
		||||
        {
 | 
			
		||||
          name: 'Material',
 | 
			
		||||
          title: '物料管理',
 | 
			
		||||
          visible: false,
 | 
			
		||||
          meta: {
 | 
			
		||||
            title: ''
 | 
			
		||||
          }
 | 
			
		||||
        },
 | 
			
		||||
        {
 | 
			
		||||
          name: 'Extend',
 | 
			
		||||
          title: '工艺管理',
 | 
			
		||||
          visible: false,
 | 
			
		||||
          meta: {
 | 
			
		||||
            title: ''
 | 
			
		||||
          }
 | 
			
		||||
        },
 | 
			
		||||
        {
 | 
			
		||||
          name: 'Delivery',
 | 
			
		||||
          title: '成品发货',
 | 
			
		||||
          visible: false,
 | 
			
		||||
          meta: {
 | 
			
		||||
            title: ''
 | 
			
		||||
          }
 | 
			
		||||
        },
 | 
			
		||||
        {
 | 
			
		||||
          name: 'Report',
 | 
			
		||||
          title: '报表管理',
 | 
			
		||||
          visible: false,
 | 
			
		||||
          meta: {
 | 
			
		||||
            title: ''
 | 
			
		||||
          }
 | 
			
		||||
        },
 | 
			
		||||
        {
 | 
			
		||||
          name: 'System',
 | 
			
		||||
          title: '系统管理',
 | 
			
		||||
          visible: false,
 | 
			
		||||
          meta: {
 | 
			
		||||
            title: ''
 | 
			
		||||
          }
 | 
			
		||||
        }
 | 
			
		||||
      ],
 | 
			
		||||
      showItem: false
 | 
			
		||||
    }
 | 
			
		||||
  },
 | 
			
		||||
  // computed:{
 | 
			
		||||
  //   ...mapGetters(['sidebarRouters'])
 | 
			
		||||
  // },
 | 
			
		||||
  mounted() {
 | 
			
		||||
    this.getMsg()
 | 
			
		||||
    this.boxReset = debounce(() => {
 | 
			
		||||
      this.resetSize()
 | 
			
		||||
    }, 300)
 | 
			
		||||
    this.boxReset()
 | 
			
		||||
    window.addEventListener('resize', () => {
 | 
			
		||||
      this.boxReset()
 | 
			
		||||
    })
 | 
			
		||||
  },
 | 
			
		||||
  methods: {
 | 
			
		||||
    getMsg() {
 | 
			
		||||
      let menuList = this.$store.state.permission.sidebarRouters
 | 
			
		||||
      console.log(menuList)
 | 
			
		||||
      if (menuList.length > 0) {
 | 
			
		||||
        for (let i = 0; i < menuList.length; i ++) {
 | 
			
		||||
          for (let k = 0; k < 7; k++) {
 | 
			
		||||
            if (menuList[i].name === this.menuArr1[k].name) {
 | 
			
		||||
              this.menuArr1[k].visible = true
 | 
			
		||||
              this.menuArr1[k].id = menuList[i].id
 | 
			
		||||
              this.menuArr1[k].choicepart = i
 | 
			
		||||
              this.menuArr1[k].children = menuList[i].children
 | 
			
		||||
              this.menuArr1[k].meta = menuList[i].meta
 | 
			
		||||
            }
 | 
			
		||||
          }
 | 
			
		||||
          for (let j = 0; j < 6; j++) {
 | 
			
		||||
            if (menuList[i].name === this.menuArr2[j].name) {
 | 
			
		||||
              this.menuArr2[j].visible = true
 | 
			
		||||
              this.menuArr2[j].id = menuList[i].id
 | 
			
		||||
              this.menuArr2[j].choicepart = i
 | 
			
		||||
              this.menuArr2[j].children = menuList[i].children
 | 
			
		||||
              this.menuArr2[j].meta = menuList[i].meta
 | 
			
		||||
            }
 | 
			
		||||
          }
 | 
			
		||||
        }
 | 
			
		||||
      }
 | 
			
		||||
      console.log(this.menuArr1)
 | 
			
		||||
      console.log(this.menuArr2)
 | 
			
		||||
    },
 | 
			
		||||
    handelClick(item, index) {
 | 
			
		||||
      // this.$router.push({name: 'SystemUser'})
 | 
			
		||||
      this.$store.dispatch('app/setChoicepart', index)
 | 
			
		||||
      this.toRouter(item)
 | 
			
		||||
      // if (item.meta.unuse) {
 | 
			
		||||
      //   this.$message.warning(this.$t('暂无数据'))
 | 
			
		||||
      // } else {
 | 
			
		||||
      //   this.toRouter(item)
 | 
			
		||||
      // }
 | 
			
		||||
    },
 | 
			
		||||
    toRouter(item) {
 | 
			
		||||
      console.log(item)
 | 
			
		||||
      if (item.children) {
 | 
			
		||||
        this.toRouter(item.children[0])
 | 
			
		||||
      } else {
 | 
			
		||||
        this.$router.push({ name: item.name })
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
    resetSize() {
 | 
			
		||||
      let _this = this
 | 
			
		||||
      _this.showItem = false
 | 
			
		||||
      _this.loading = true
 | 
			
		||||
      let choicepartBox = document.querySelector('#choicepartBox')
 | 
			
		||||
      let rw = parseFloat(window.innerWidth)
 | 
			
		||||
      let rh = parseFloat(window.innerHeight)
 | 
			
		||||
      let bw = parseFloat(choicepartBox.style.width)
 | 
			
		||||
      let bh = parseFloat(choicepartBox.style.height)
 | 
			
		||||
      let wx = 0.82/(bw / rw)
 | 
			
		||||
      let hx = 0.56/(bh / rh)
 | 
			
		||||
      _this.scale = wx > hx ? hx : wx
 | 
			
		||||
      setTimeout(_this.showItemFun, 700)
 | 
			
		||||
    },
 | 
			
		||||
    showItemFun() {
 | 
			
		||||
      this.loading = false
 | 
			
		||||
      this.showItem = true
 | 
			
		||||
    }
 | 
			
		||||
  },
 | 
			
		||||
  beforeDestroy() {
 | 
			
		||||
    this.showItem = false
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
	components: { Navbar },
 | 
			
		||||
	name: 'choicePart',
 | 
			
		||||
	data() {
 | 
			
		||||
		return {
 | 
			
		||||
			boxReset: '',
 | 
			
		||||
			scale: 1,
 | 
			
		||||
			menuArr1: [
 | 
			
		||||
				{
 | 
			
		||||
					name: 'Core',
 | 
			
		||||
					title: '基础核心',
 | 
			
		||||
					visible: false,
 | 
			
		||||
					meta: {
 | 
			
		||||
						title: '',
 | 
			
		||||
					},
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					name: 'Produce',
 | 
			
		||||
					title: '生产管理',
 | 
			
		||||
					visible: false,
 | 
			
		||||
					meta: {
 | 
			
		||||
						title: '',
 | 
			
		||||
					},
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					name: 'Equipment',
 | 
			
		||||
					title: '设备管理',
 | 
			
		||||
					visible: false,
 | 
			
		||||
					meta: {
 | 
			
		||||
						title: '',
 | 
			
		||||
					},
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					name: 'Group',
 | 
			
		||||
					title: '班组管理',
 | 
			
		||||
					visible: false,
 | 
			
		||||
					meta: {
 | 
			
		||||
						title: '',
 | 
			
		||||
					},
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					name: 'Quality',
 | 
			
		||||
					title: '质量管理',
 | 
			
		||||
					visible: false,
 | 
			
		||||
					meta: {
 | 
			
		||||
						title: '',
 | 
			
		||||
					},
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					name: 'Warehouse',
 | 
			
		||||
					title: '仓库管理',
 | 
			
		||||
					visible: false,
 | 
			
		||||
					meta: {
 | 
			
		||||
						title: '',
 | 
			
		||||
					},
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					name: 'Energy',
 | 
			
		||||
					title: '能源管理',
 | 
			
		||||
					visible: false,
 | 
			
		||||
					meta: {
 | 
			
		||||
						title: '',
 | 
			
		||||
					},
 | 
			
		||||
				},
 | 
			
		||||
			],
 | 
			
		||||
			menuArr2: [
 | 
			
		||||
				{
 | 
			
		||||
					name: 'Packaging',
 | 
			
		||||
					title: '包装管理',
 | 
			
		||||
					visible: false,
 | 
			
		||||
					meta: {
 | 
			
		||||
						title: '',
 | 
			
		||||
					},
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					name: 'Material',
 | 
			
		||||
					title: '物料管理',
 | 
			
		||||
					visible: false,
 | 
			
		||||
					meta: {
 | 
			
		||||
						title: '',
 | 
			
		||||
					},
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					name: 'Extend',
 | 
			
		||||
					title: '工艺管理',
 | 
			
		||||
					visible: false,
 | 
			
		||||
					meta: {
 | 
			
		||||
						title: '',
 | 
			
		||||
					},
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					name: 'Delivery',
 | 
			
		||||
					title: '成品发货',
 | 
			
		||||
					visible: false,
 | 
			
		||||
					meta: {
 | 
			
		||||
						title: '',
 | 
			
		||||
					},
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					name: 'Report',
 | 
			
		||||
					title: '报表管理',
 | 
			
		||||
					visible: false,
 | 
			
		||||
					meta: {
 | 
			
		||||
						title: '',
 | 
			
		||||
					},
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					name: 'System',
 | 
			
		||||
					title: '系统管理',
 | 
			
		||||
					visible: false,
 | 
			
		||||
					meta: {
 | 
			
		||||
						title: '',
 | 
			
		||||
					},
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					name: 'Devconfig',
 | 
			
		||||
					title: '开发配置',
 | 
			
		||||
					visible: false,
 | 
			
		||||
					meta: {
 | 
			
		||||
						title: '',
 | 
			
		||||
					},
 | 
			
		||||
				},
 | 
			
		||||
			],
 | 
			
		||||
			showItem: false,
 | 
			
		||||
		};
 | 
			
		||||
	},
 | 
			
		||||
	// computed:{
 | 
			
		||||
	//   ...mapGetters(['sidebarRouters'])
 | 
			
		||||
	// },
 | 
			
		||||
	mounted() {
 | 
			
		||||
		this.getMsg();
 | 
			
		||||
		this.boxReset = debounce(() => {
 | 
			
		||||
			this.resetSize();
 | 
			
		||||
		}, 300);
 | 
			
		||||
		this.boxReset();
 | 
			
		||||
		window.addEventListener('resize', () => {
 | 
			
		||||
			this.boxReset();
 | 
			
		||||
		});
 | 
			
		||||
	},
 | 
			
		||||
	methods: {
 | 
			
		||||
		getMsg() {
 | 
			
		||||
			let menuList = this.$store.state.permission.sidebarRouters;
 | 
			
		||||
			console.log('sss', menuList);
 | 
			
		||||
			console.log(menuList);
 | 
			
		||||
			if (menuList.length > 0) {
 | 
			
		||||
				for (let i = 0; i < menuList.length; i++) {
 | 
			
		||||
					for (let k = 0; k < 7; k++) {
 | 
			
		||||
						if (menuList[i].name === this.menuArr1[k].name) {
 | 
			
		||||
							this.menuArr1[k].visible = true;
 | 
			
		||||
							this.menuArr1[k].id = menuList[i].id;
 | 
			
		||||
							this.menuArr1[k].choicepart = i;
 | 
			
		||||
							this.menuArr1[k].children = menuList[i].children;
 | 
			
		||||
							this.menuArr1[k].meta = menuList[i].meta;
 | 
			
		||||
						}
 | 
			
		||||
					}
 | 
			
		||||
					for (let j = 0; j < 7; j++) {
 | 
			
		||||
						if (menuList[i].name === this.menuArr2[j].name) {
 | 
			
		||||
							this.menuArr2[j].visible = true;
 | 
			
		||||
							this.menuArr2[j].id = menuList[i].id;
 | 
			
		||||
							this.menuArr2[j].choicepart = i;
 | 
			
		||||
							this.menuArr2[j].children = menuList[i].children;
 | 
			
		||||
							this.menuArr2[j].meta = menuList[i].meta;
 | 
			
		||||
						}
 | 
			
		||||
					}
 | 
			
		||||
				}
 | 
			
		||||
			}
 | 
			
		||||
			console.log(this.menuArr1);
 | 
			
		||||
			console.log(this.menuArr2);
 | 
			
		||||
		},
 | 
			
		||||
		handelClick(item, index) {
 | 
			
		||||
			// this.$router.push({name: 'SystemUser'})
 | 
			
		||||
			this.$store.dispatch('app/setChoicepart', index);
 | 
			
		||||
			this.toRouter(item);
 | 
			
		||||
			// if (item.meta.unuse) {
 | 
			
		||||
			//   this.$message.warning(this.$t('暂无数据'))
 | 
			
		||||
			// } else {
 | 
			
		||||
			//   this.toRouter(item)
 | 
			
		||||
			// }
 | 
			
		||||
		},
 | 
			
		||||
		toRouter(item) {
 | 
			
		||||
			console.log(item);
 | 
			
		||||
			if (item.children) {
 | 
			
		||||
				this.toRouter(item.children[0]);
 | 
			
		||||
			} else {
 | 
			
		||||
				this.$router.push({ name: item.name });
 | 
			
		||||
			}
 | 
			
		||||
		},
 | 
			
		||||
		resetSize() {
 | 
			
		||||
			let _this = this;
 | 
			
		||||
			_this.showItem = false;
 | 
			
		||||
			_this.loading = true;
 | 
			
		||||
			let choicepartBox = document.querySelector('#choicepartBox');
 | 
			
		||||
			let rw = parseFloat(window.innerWidth);
 | 
			
		||||
			let rh = parseFloat(window.innerHeight);
 | 
			
		||||
			let bw = parseFloat(choicepartBox.style.width);
 | 
			
		||||
			let bh = parseFloat(choicepartBox.style.height);
 | 
			
		||||
			let wx = 0.82 / (bw / rw);
 | 
			
		||||
			let hx = 0.56 / (bh / rh);
 | 
			
		||||
			_this.scale = wx > hx ? hx : wx;
 | 
			
		||||
			setTimeout(_this.showItemFun, 700);
 | 
			
		||||
		},
 | 
			
		||||
		showItemFun() {
 | 
			
		||||
			this.loading = false;
 | 
			
		||||
			this.showItem = true;
 | 
			
		||||
		},
 | 
			
		||||
	},
 | 
			
		||||
	beforeDestroy() {
 | 
			
		||||
		this.showItem = false;
 | 
			
		||||
	},
 | 
			
		||||
};
 | 
			
		||||
</script>
 | 
			
		||||
<style lang='scss' scoped>
 | 
			
		||||
<style lang="scss" scoped>
 | 
			
		||||
.choicepart-container {
 | 
			
		||||
  position: relative;
 | 
			
		||||
  width: 100%;
 | 
			
		||||
  height: 100%;
 | 
			
		||||
  background: url('../../assets/images/choicepart/choicepart-back.png') repeat;
 | 
			
		||||
  background-size: 100% 100%;
 | 
			
		||||
  .choicepart-wrapper {
 | 
			
		||||
    width: 100vw;
 | 
			
		||||
    height: calc(100vh - 94px);
 | 
			
		||||
    display: flex;
 | 
			
		||||
    justify-content: center;
 | 
			
		||||
    align-items: center;
 | 
			
		||||
  }
 | 
			
		||||
  .choicepart-box {
 | 
			
		||||
    // transition: all 0.3s linear;
 | 
			
		||||
    .choicepart-line1 {
 | 
			
		||||
      width: 100%;
 | 
			
		||||
      margin-bottom: 80px;
 | 
			
		||||
      display: flex;
 | 
			
		||||
      flex-flow: row nowrap;
 | 
			
		||||
    }
 | 
			
		||||
    .choicepart-line2 {
 | 
			
		||||
      width: 100%;
 | 
			
		||||
      display: flex;
 | 
			
		||||
      flex-flow: row nowrap;
 | 
			
		||||
      justify-content: center;
 | 
			
		||||
    }
 | 
			
		||||
    .choicepart-item {
 | 
			
		||||
      width: 184px;
 | 
			
		||||
      height: 224px;
 | 
			
		||||
      background: url('../../assets/images/choicepart/choice-item-back.png') no-repeat;
 | 
			
		||||
      background-size: 100% 100%;
 | 
			
		||||
      border-radius: 5px;
 | 
			
		||||
      overflow: hidden;
 | 
			
		||||
      cursor: pointer;
 | 
			
		||||
      position: relative;
 | 
			
		||||
      margin: 0 20px;
 | 
			
		||||
      img {
 | 
			
		||||
        width: 184px;
 | 
			
		||||
        height: 224px;
 | 
			
		||||
      }
 | 
			
		||||
      .choicepart-item-title {
 | 
			
		||||
        overflow: hidden;
 | 
			
		||||
        padding: 0 10px;
 | 
			
		||||
        text-overflow: ellipsis;
 | 
			
		||||
        white-space: nowrap;
 | 
			
		||||
        position: absolute;
 | 
			
		||||
        bottom: 0;
 | 
			
		||||
        left: 2px;
 | 
			
		||||
        right: 2px;
 | 
			
		||||
        text-align: center;
 | 
			
		||||
        color: #fff;
 | 
			
		||||
        font-size: 16px;
 | 
			
		||||
        line-height: 40px;
 | 
			
		||||
        height: 40px;
 | 
			
		||||
        letter-spacing: 2px;
 | 
			
		||||
        background-color: rgba($color: #0b58ff, $alpha: 0.45);
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
    .choicepart-item:hover {
 | 
			
		||||
      .choicepart-item-title {
 | 
			
		||||
        background-color: rgba($color: #0b58ff, $alpha: 1);
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
  .choicepart-footer {
 | 
			
		||||
    position: absolute;
 | 
			
		||||
    width: 100%;
 | 
			
		||||
    color: #C7C7C7;
 | 
			
		||||
    user-select: none;
 | 
			
		||||
    font-size: 12px;
 | 
			
		||||
    letter-spacing: 1px;
 | 
			
		||||
    height: 30px;
 | 
			
		||||
    display: grid;
 | 
			
		||||
    place-content: center;
 | 
			
		||||
    bottom: 0;
 | 
			
		||||
    opacity: 0.5;
 | 
			
		||||
  }
 | 
			
		||||
	position: relative;
 | 
			
		||||
	width: 100%;
 | 
			
		||||
	height: 100%;
 | 
			
		||||
	background: url('../../assets/images/choicepart/choicepart-back.png') repeat;
 | 
			
		||||
	background-size: 100% 100%;
 | 
			
		||||
	.choicepart-wrapper {
 | 
			
		||||
		width: 100vw;
 | 
			
		||||
		height: calc(100vh - 94px);
 | 
			
		||||
		display: flex;
 | 
			
		||||
		justify-content: center;
 | 
			
		||||
		align-items: center;
 | 
			
		||||
	}
 | 
			
		||||
	.choicepart-box {
 | 
			
		||||
		// transition: all 0.3s linear;
 | 
			
		||||
		.choicepart-line1 {
 | 
			
		||||
			width: 100%;
 | 
			
		||||
			margin-bottom: 80px;
 | 
			
		||||
			display: flex;
 | 
			
		||||
			flex-flow: row nowrap;
 | 
			
		||||
		}
 | 
			
		||||
		.choicepart-line2 {
 | 
			
		||||
			width: 100%;
 | 
			
		||||
			display: flex;
 | 
			
		||||
			flex-flow: row nowrap;
 | 
			
		||||
			justify-content: center;
 | 
			
		||||
		}
 | 
			
		||||
		.choicepart-item {
 | 
			
		||||
			width: 184px;
 | 
			
		||||
			height: 224px;
 | 
			
		||||
			background: url('../../assets/images/choicepart/choice-item-back.png')
 | 
			
		||||
				no-repeat;
 | 
			
		||||
			background-size: 100% 100%;
 | 
			
		||||
			border-radius: 5px;
 | 
			
		||||
			overflow: hidden;
 | 
			
		||||
			cursor: pointer;
 | 
			
		||||
			position: relative;
 | 
			
		||||
			margin: 0 20px;
 | 
			
		||||
			img {
 | 
			
		||||
				width: 184px;
 | 
			
		||||
				height: 224px;
 | 
			
		||||
			}
 | 
			
		||||
			.choicepart-item-title {
 | 
			
		||||
				overflow: hidden;
 | 
			
		||||
				padding: 0 10px;
 | 
			
		||||
				text-overflow: ellipsis;
 | 
			
		||||
				white-space: nowrap;
 | 
			
		||||
				position: absolute;
 | 
			
		||||
				bottom: 0;
 | 
			
		||||
				left: 2px;
 | 
			
		||||
				right: 2px;
 | 
			
		||||
				text-align: center;
 | 
			
		||||
				color: #fff;
 | 
			
		||||
				font-size: 16px;
 | 
			
		||||
				line-height: 40px;
 | 
			
		||||
				height: 40px;
 | 
			
		||||
				letter-spacing: 2px;
 | 
			
		||||
				background-color: rgba($color: #0b58ff, $alpha: 0.45);
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
		.choicepart-item:hover {
 | 
			
		||||
			.choicepart-item-title {
 | 
			
		||||
				background-color: rgba($color: #0b58ff, $alpha: 1);
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
	.choicepart-footer {
 | 
			
		||||
		position: absolute;
 | 
			
		||||
		width: 100%;
 | 
			
		||||
		color: #c7c7c7;
 | 
			
		||||
		user-select: none;
 | 
			
		||||
		font-size: 12px;
 | 
			
		||||
		letter-spacing: 1px;
 | 
			
		||||
		height: 30px;
 | 
			
		||||
		display: grid;
 | 
			
		||||
		place-content: center;
 | 
			
		||||
		bottom: 0;
 | 
			
		||||
		opacity: 0.5;
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
</style>
 | 
			
		||||
							
								
								
									
										100
									
								
								src/views/core/oldBase/lineBindProduct/index.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										100
									
								
								src/views/core/oldBase/lineBindProduct/index.vue
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,100 @@
 | 
			
		||||
<!--
 | 
			
		||||
 * @Author: zwq
 | 
			
		||||
 * @Date: 2023-08-02 15:12:42
 | 
			
		||||
 * @LastEditors: DY
 | 
			
		||||
 * @LastEditTime: 2023-10-13 16:35:03
 | 
			
		||||
 * @Description:
 | 
			
		||||
-->
 | 
			
		||||
<template>
 | 
			
		||||
	<div class="app-container">
 | 
			
		||||
		<search-bar
 | 
			
		||||
			:formConfigs="[{ label: '产线在制产品', type: 'title' }]"
 | 
			
		||||
			ref="searchBarForm" />
 | 
			
		||||
		<base-table
 | 
			
		||||
			v-loading="dataListLoading"
 | 
			
		||||
			:table-props="tableProps"
 | 
			
		||||
			:page="listQuery.pageNo"
 | 
			
		||||
			:limit="listQuery.pageSize"
 | 
			
		||||
			:table-data="tableData"
 | 
			
		||||
			@emitFun="inputChange" />
 | 
			
		||||
		<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 { getLineBindProductPage } from '@/api/core/base/lineBindProduct';
 | 
			
		||||
import selectProduct from './selectProduct';
 | 
			
		||||
import { getProductPage } from '@/api/core/base/product';
 | 
			
		||||
 | 
			
		||||
const tableProps = [
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'lineName',
 | 
			
		||||
		label: '产线'
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'productName',
 | 
			
		||||
		label: '在制产品',
 | 
			
		||||
		list: [],
 | 
			
		||||
		subcomponent: selectProduct,
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'recordTime',
 | 
			
		||||
		label: '开始时间',
 | 
			
		||||
		filter: parseTime,
 | 
			
		||||
	},
 | 
			
		||||
];
 | 
			
		||||
 | 
			
		||||
export default {
 | 
			
		||||
	mixins: [basicPage, selectProduct],
 | 
			
		||||
	data() {
 | 
			
		||||
		return {
 | 
			
		||||
			urlOptions: {
 | 
			
		||||
				getDataListURL: getLineBindProductPage,
 | 
			
		||||
			},
 | 
			
		||||
			tableProps,
 | 
			
		||||
			tableData: [],
 | 
			
		||||
			// formConfig: [
 | 
			
		||||
			// 	{
 | 
			
		||||
			// 		type: 'button',
 | 
			
		||||
			// 		btnName: '同步',
 | 
			
		||||
			// 		name: 'search',
 | 
			
		||||
			// 		color: 'primary',
 | 
			
		||||
			// 	},
 | 
			
		||||
			// ],
 | 
			
		||||
		};
 | 
			
		||||
	},
 | 
			
		||||
	components: {},
 | 
			
		||||
	created() {
 | 
			
		||||
		const params = {
 | 
			
		||||
			pageSize: 100,
 | 
			
		||||
			pageNo: 1,
 | 
			
		||||
		};
 | 
			
		||||
		getProductPage(params).then((response) => {
 | 
			
		||||
			this.tableProps[1].list = response.data.list;
 | 
			
		||||
			console.log('打印', this.tableProps[1].list)
 | 
			
		||||
		});
 | 
			
		||||
	},
 | 
			
		||||
	methods: {
 | 
			
		||||
		buttonClick(val) {
 | 
			
		||||
			switch (val.btnName) {
 | 
			
		||||
				case 'search':
 | 
			
		||||
					this.listQuery.pageNo = 1;
 | 
			
		||||
					this.listQuery.pageSize = 10;
 | 
			
		||||
					this.getDataList();
 | 
			
		||||
					break;
 | 
			
		||||
				default:
 | 
			
		||||
					console.log(val);
 | 
			
		||||
			}
 | 
			
		||||
		},
 | 
			
		||||
		inputChange() {
 | 
			
		||||
			this.getDataList();
 | 
			
		||||
		},
 | 
			
		||||
	},
 | 
			
		||||
};
 | 
			
		||||
</script>
 | 
			
		||||
							
								
								
									
										79
									
								
								src/views/core/oldBase/lineBindProduct/selectProduct.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										79
									
								
								src/views/core/oldBase/lineBindProduct/selectProduct.vue
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,79 @@
 | 
			
		||||
<!--
 | 
			
		||||
 * @Author: zwq
 | 
			
		||||
 * @Date: 2023-08-03 14:09:18
 | 
			
		||||
 * @LastEditors: DY
 | 
			
		||||
 * @LastEditTime: 2023-10-13 16:47:25
 | 
			
		||||
 * @Description:
 | 
			
		||||
-->
 | 
			
		||||
<template>
 | 
			
		||||
	<div class="tableInner">
 | 
			
		||||
		<el-popover
 | 
			
		||||
    placement="top"
 | 
			
		||||
    title="切换在制产品"
 | 
			
		||||
    width="160"
 | 
			
		||||
    v-model="visible">
 | 
			
		||||
			<el-select v-model="list.string" style="margin: 5px;" filterable>
 | 
			
		||||
				<el-option
 | 
			
		||||
					v-for="item in injectData.list"
 | 
			
		||||
					:key="item.id"
 | 
			
		||||
					:label="item.name"
 | 
			
		||||
					:value="item.id + '+' + item.name"></el-option>
 | 
			
		||||
			</el-select>
 | 
			
		||||
			<div style="text-align: right; margin: 0">
 | 
			
		||||
				<el-button size="mini" type="text" @click="visible = false">
 | 
			
		||||
					取消
 | 
			
		||||
				</el-button>
 | 
			
		||||
				<el-button type="primary" size="mini" @click="changeInput">
 | 
			
		||||
					确定
 | 
			
		||||
				</el-button>
 | 
			
		||||
			</div>
 | 
			
		||||
			<el-button type="text" slot="reference">
 | 
			
		||||
				<svg-icon icon-class="changelogo"/>
 | 
			
		||||
			</el-button>
 | 
			
		||||
		</el-popover>
 | 
			
		||||
		<el-input readonly v-model="list.productName" style="width: 50%;margin-left: 5px" ></el-input>
 | 
			
		||||
	</div>
 | 
			
		||||
</template>
 | 
			
		||||
<script>
 | 
			
		||||
import { switchLineBindProduct } from '@/api/core/base/lineBindProduct';
 | 
			
		||||
 | 
			
		||||
export default {
 | 
			
		||||
	props: {
 | 
			
		||||
		injectData: {
 | 
			
		||||
			type: Object,
 | 
			
		||||
			default: () => ({}),
 | 
			
		||||
		},
 | 
			
		||||
	},
 | 
			
		||||
	data() {
 | 
			
		||||
		return {
 | 
			
		||||
			list: this.injectData,
 | 
			
		||||
			visible: false,
 | 
			
		||||
		};
 | 
			
		||||
	},
 | 
			
		||||
	mounted() {
 | 
			
		||||
		console.log('hello', this.list)
 | 
			
		||||
	},
 | 
			
		||||
	methods: {
 | 
			
		||||
		changeInput() {
 | 
			
		||||
			const data = {
 | 
			
		||||
				id: this.list.id,
 | 
			
		||||
				productId: this.list.string.split('+')[0],
 | 
			
		||||
				productName: this.list.string.split('+')[1],
 | 
			
		||||
			};
 | 
			
		||||
			switchLineBindProduct(data).then((response) => {
 | 
			
		||||
				this.$modal.msgSuccess('修改成功');
 | 
			
		||||
				this.visible = false;
 | 
			
		||||
				this.list.productName = this.list.string.split('+')[1]
 | 
			
		||||
				this.$emit('emitData');
 | 
			
		||||
			});
 | 
			
		||||
		},
 | 
			
		||||
	},
 | 
			
		||||
};
 | 
			
		||||
</script>
 | 
			
		||||
<style scoped>
 | 
			
		||||
.tableInner .el-input__inner {
 | 
			
		||||
	border: none;
 | 
			
		||||
	padding: 0;
 | 
			
		||||
	height: 33px;
 | 
			
		||||
}
 | 
			
		||||
</style>
 | 
			
		||||
							
								
								
									
										144
									
								
								src/views/core/oldBase/lineBindProductLog/index.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										144
									
								
								src/views/core/oldBase/lineBindProductLog/index.vue
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,144 @@
 | 
			
		||||
<template>
 | 
			
		||||
	<div class="app-container">
 | 
			
		||||
		<search-bar
 | 
			
		||||
			:formConfigs="formConfig"
 | 
			
		||||
			ref="searchBarForm"
 | 
			
		||||
			@headBtnClick="buttonClick" />
 | 
			
		||||
		<base-table
 | 
			
		||||
			v-loading="dataListLoading"
 | 
			
		||||
			:table-props="tableProps"
 | 
			
		||||
			:page="listQuery.pageNo"
 | 
			
		||||
			:limit="listQuery.pageSize"
 | 
			
		||||
			:table-data="tableData" />
 | 
			
		||||
		<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 { getLineBindProductLogPage } from '@/api/core/base/lineBindProductLog';
 | 
			
		||||
import { getProductionLinePage } from '@/api/core/base/productionLine';
 | 
			
		||||
import { getProductPage } from '@/api/core/base/product';
 | 
			
		||||
 | 
			
		||||
const tableProps = [
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'productionLineName',
 | 
			
		||||
		label: '产线'
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'productName',
 | 
			
		||||
		label: '在制产品'
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'startTime',
 | 
			
		||||
		label: '开始时间',
 | 
			
		||||
		filter: parseTime,
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'endTime',
 | 
			
		||||
		label: '结束时间',
 | 
			
		||||
		filter: parseTime,
 | 
			
		||||
	},
 | 
			
		||||
];
 | 
			
		||||
 | 
			
		||||
export default {
 | 
			
		||||
	mixins: [basicPage],
 | 
			
		||||
	data() {
 | 
			
		||||
		return {
 | 
			
		||||
			urlOptions: {
 | 
			
		||||
				getDataListURL: getLineBindProductLogPage,
 | 
			
		||||
			},
 | 
			
		||||
			tableProps,
 | 
			
		||||
			tableData: [],
 | 
			
		||||
			optionArrUrl: [getProductionLinePage, getProductPage],
 | 
			
		||||
			formConfig: [
 | 
			
		||||
				{
 | 
			
		||||
					type: 'select',
 | 
			
		||||
					label: '产线',
 | 
			
		||||
					selectOptions: [],
 | 
			
		||||
					param: 'productionLineId',
 | 
			
		||||
					defaultSelect: '',
 | 
			
		||||
					filterable: true,
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					type: 'select',
 | 
			
		||||
					label: '在制产品',
 | 
			
		||||
					selectOptions: [],
 | 
			
		||||
					param: 'productId',
 | 
			
		||||
					defaultSelect: '',
 | 
			
		||||
					filterable: true,
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					type: 'datePicker',
 | 
			
		||||
					label: '时间',
 | 
			
		||||
					dateType: 'daterange',
 | 
			
		||||
					format: 'yyyy-MM-dd',
 | 
			
		||||
					valueFormat: 'yyyy-MM-dd HH:mm:ss',
 | 
			
		||||
					rangeSeparator: '-',
 | 
			
		||||
					startPlaceholder: '开始时间',
 | 
			
		||||
					endPlaceholder: '结束时间',
 | 
			
		||||
					param: 'startTime',
 | 
			
		||||
					valueFormat: 'timestamp'
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					type: 'button',
 | 
			
		||||
					btnName: '搜索',
 | 
			
		||||
					name: 'search',
 | 
			
		||||
					color: 'primary',
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					type: 'button',
 | 
			
		||||
					btnName: '重置',
 | 
			
		||||
					name: 'reset',
 | 
			
		||||
				},
 | 
			
		||||
			],
 | 
			
		||||
		};
 | 
			
		||||
	},
 | 
			
		||||
	components: {
 | 
			
		||||
	},
 | 
			
		||||
	created() {
 | 
			
		||||
		this.getArr();
 | 
			
		||||
	},
 | 
			
		||||
	methods: {
 | 
			
		||||
		getArr() {
 | 
			
		||||
			const params = {
 | 
			
		||||
				page: 1,
 | 
			
		||||
				limit: 500,
 | 
			
		||||
			};
 | 
			
		||||
			this.optionArrUrl.forEach((item, index) => {
 | 
			
		||||
				item(params).then((response) => {
 | 
			
		||||
					this.formConfig[index].selectOptions = response.data.list;
 | 
			
		||||
				});
 | 
			
		||||
			});
 | 
			
		||||
		},
 | 
			
		||||
		buttonClick(val) {
 | 
			
		||||
			switch (val.btnName) {
 | 
			
		||||
				case 'search':
 | 
			
		||||
					this.listQuery.pageNo = 1;
 | 
			
		||||
					this.listQuery.pageSize = 10;
 | 
			
		||||
					this.listQuery.productionLineId = val.productionLineId;
 | 
			
		||||
					this.listQuery.productId = val.productId;
 | 
			
		||||
					this.listQuery.startTime = val.startTime;
 | 
			
		||||
					this.getDataList();
 | 
			
		||||
					break;
 | 
			
		||||
				case 'reset':
 | 
			
		||||
					this.$refs.searchBarForm.resetForm();
 | 
			
		||||
					this.listQuery = {
 | 
			
		||||
						pageSize: 10,
 | 
			
		||||
						pageNo: 1,
 | 
			
		||||
						total: 1,
 | 
			
		||||
					};
 | 
			
		||||
					this.getDataList();
 | 
			
		||||
					break;
 | 
			
		||||
				default:
 | 
			
		||||
					console.log(val);
 | 
			
		||||
			}
 | 
			
		||||
		},
 | 
			
		||||
	},
 | 
			
		||||
};
 | 
			
		||||
</script>
 | 
			
		||||
							
								
								
									
										448
									
								
								src/views/core/oldBase/product/add-or-updata.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										448
									
								
								src/views/core/oldBase/product/add-or-updata.vue
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,448 @@
 | 
			
		||||
<template>
 | 
			
		||||
	<el-drawer
 | 
			
		||||
		:visible.sync="visible"
 | 
			
		||||
		:show-close="false"
 | 
			
		||||
		:wrapper-closable="false"
 | 
			
		||||
		class="drawer"
 | 
			
		||||
		size="60%">
 | 
			
		||||
		<small-title slot="title" :no-padding="true">
 | 
			
		||||
			{{ isdetail ? '详情' : !dataForm.id ? '新增' : '编辑' }}
 | 
			
		||||
		</small-title>
 | 
			
		||||
 | 
			
		||||
		<div class="content">
 | 
			
		||||
			<div class="visual-part">
 | 
			
		||||
				<el-form
 | 
			
		||||
					ref="dataForm"
 | 
			
		||||
					:model="dataForm"
 | 
			
		||||
					:rules="dataRule"
 | 
			
		||||
					label-width="100px"
 | 
			
		||||
					label-position="top"
 | 
			
		||||
					@keyup.enter.native="dataFormSubmit">
 | 
			
		||||
					<el-row :gutter="20">
 | 
			
		||||
						<el-col :span="12">
 | 
			
		||||
							<el-form-item label="产品编码" prop="code">
 | 
			
		||||
								<el-input
 | 
			
		||||
									v-model="dataForm.code"
 | 
			
		||||
									clearable
 | 
			
		||||
									:disabled="isdetail"
 | 
			
		||||
									placeholder="请输入产品编码" />
 | 
			
		||||
							</el-form-item>
 | 
			
		||||
						</el-col>
 | 
			
		||||
						<el-col :span="12">
 | 
			
		||||
							<el-form-item label="产品名称" prop="name">
 | 
			
		||||
								<el-input
 | 
			
		||||
									v-model="dataForm.name"
 | 
			
		||||
									clearable
 | 
			
		||||
									:disabled="isdetail"
 | 
			
		||||
									placeholder="请输入产品名称" />
 | 
			
		||||
							</el-form-item>
 | 
			
		||||
						</el-col>
 | 
			
		||||
					</el-row>
 | 
			
		||||
					<el-row :gutter="20">
 | 
			
		||||
						<el-col :span="12">
 | 
			
		||||
							<el-form-item label="产品类型" prop="typeDictValue">
 | 
			
		||||
								<el-select
 | 
			
		||||
									v-model="dataForm.typeDictValue"
 | 
			
		||||
									style="width: 100%"
 | 
			
		||||
									:disabled="isdetail"
 | 
			
		||||
									placeholder="请选择产品类型">
 | 
			
		||||
									<el-option
 | 
			
		||||
										v-for="dict in getDictDatas(DICT_TYPE.PRODUCT_TYPE)"
 | 
			
		||||
										:key="dict.value"
 | 
			
		||||
										:label="dict.label"
 | 
			
		||||
										:value="dict.value" />
 | 
			
		||||
								</el-select>
 | 
			
		||||
							</el-form-item>
 | 
			
		||||
						</el-col>
 | 
			
		||||
						<el-col :span="12">
 | 
			
		||||
							<el-form-item label="单位" prop="unitDictValue">
 | 
			
		||||
								<el-select
 | 
			
		||||
									v-model="dataForm.unitDictValue"
 | 
			
		||||
									style="width: 100%"
 | 
			
		||||
									:disabled="isdetail"
 | 
			
		||||
									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-row>
 | 
			
		||||
					<el-row :gutter="20">
 | 
			
		||||
						<el-col :span="12">
 | 
			
		||||
							<el-form-item label="规格" prop="specifications">
 | 
			
		||||
								<el-input
 | 
			
		||||
									:disabled="isdetail"
 | 
			
		||||
									v-model="dataForm.specifications"
 | 
			
		||||
									placeholder="请输入规格" />
 | 
			
		||||
							</el-form-item>
 | 
			
		||||
						</el-col>
 | 
			
		||||
						<el-col :span="12">
 | 
			
		||||
							<el-form-item label="单位平方数" prop="area">
 | 
			
		||||
								<el-input
 | 
			
		||||
									:disabled="isdetail"
 | 
			
		||||
									v-model="dataForm.area"
 | 
			
		||||
									placeholder="请输入单位平方数" />
 | 
			
		||||
							</el-form-item>
 | 
			
		||||
						</el-col>
 | 
			
		||||
					</el-row>
 | 
			
		||||
					<el-row :gutter="20">
 | 
			
		||||
						<el-col :span="24">
 | 
			
		||||
							<el-form-item label="完成单位产品用时" prop="processTime">
 | 
			
		||||
								<el-input
 | 
			
		||||
									:disabled="isdetail"
 | 
			
		||||
									v-model="dataForm.processTime"
 | 
			
		||||
									placeholder="请输入完成单位产品用时" />
 | 
			
		||||
							</el-form-item>
 | 
			
		||||
						</el-col>
 | 
			
		||||
					</el-row>
 | 
			
		||||
				</el-form>
 | 
			
		||||
 | 
			
		||||
				<small-title
 | 
			
		||||
					style="margin: 16px 0; padding-left: 8px"
 | 
			
		||||
					:no-padding="true">
 | 
			
		||||
					产品属性列表
 | 
			
		||||
				</small-title>
 | 
			
		||||
 | 
			
		||||
				<div class="attr-list">
 | 
			
		||||
					<base-table
 | 
			
		||||
						:table-props="tableProps"
 | 
			
		||||
						:page="listQuery.pageNo"
 | 
			
		||||
						:limit="listQuery.pageSize"
 | 
			
		||||
						:add-button-show="isdetail ? null : '添加属性'"
 | 
			
		||||
						@emitButtonClick="addNew()"
 | 
			
		||||
						:table-data="productAttributeList">
 | 
			
		||||
						<method-btn
 | 
			
		||||
							v-if="!isdetail"
 | 
			
		||||
							slot="handleBtn"
 | 
			
		||||
							:width="120"
 | 
			
		||||
							label="操作"
 | 
			
		||||
							:method-list="tableBtn"
 | 
			
		||||
							@clickBtn="handleClick" />
 | 
			
		||||
					</base-table>
 | 
			
		||||
					<pagination
 | 
			
		||||
						v-show="listQuery.total > 0"
 | 
			
		||||
						:total="listQuery.total"
 | 
			
		||||
						:page.sync="listQuery.pageNo"
 | 
			
		||||
						:limit.sync="listQuery.pageSize"
 | 
			
		||||
						:page-sizes="[5, 10, 15]"
 | 
			
		||||
						@pagination="getList" />
 | 
			
		||||
				</div>
 | 
			
		||||
			</div>
 | 
			
		||||
		</div>
 | 
			
		||||
 | 
			
		||||
		<!-- <div style="position: absolute; bottom: 24px; right: 24px">
 | 
			
		||||
			<el-button style="margin-right: 10px" @click="goback()">返回</el-button>
 | 
			
		||||
			<el-button v-if="isdetail" type="primary" @click="goEdit()">
 | 
			
		||||
				编辑
 | 
			
		||||
			</el-button>
 | 
			
		||||
			<span v-if="!isdetail">
 | 
			
		||||
				<el-button type="primary" @click="dataFormSubmit()">保存</el-button>
 | 
			
		||||
				<el-button
 | 
			
		||||
					v-if="dataForm.id && !isdetail"
 | 
			
		||||
					type="primary"
 | 
			
		||||
					@click="addNew()">
 | 
			
		||||
					添加属性
 | 
			
		||||
				</el-button>
 | 
			
		||||
			</span>
 | 
			
		||||
		</div> -->
 | 
			
		||||
 | 
			
		||||
		<div class="drawer-body__footer">
 | 
			
		||||
			<el-button style="" @click="goback()">取消</el-button>
 | 
			
		||||
			<el-button v-if="isdetail" type="primary" @click="goEdit()">
 | 
			
		||||
				编辑
 | 
			
		||||
			</el-button>
 | 
			
		||||
			<el-button v-else type="primary" @click="dataFormSubmit()">确定</el-button>
 | 
			
		||||
		</div>
 | 
			
		||||
 | 
			
		||||
		<product-attr-add
 | 
			
		||||
			v-if="addOrUpdateVisible"
 | 
			
		||||
			ref="addOrUpdate"
 | 
			
		||||
			:product-id="dataForm.id"
 | 
			
		||||
			@refreshDataList="getList" />
 | 
			
		||||
	</el-drawer>
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script>
 | 
			
		||||
import {
 | 
			
		||||
	deleteProductAttr,
 | 
			
		||||
	getProductAttrPage,
 | 
			
		||||
} from '@/api/core/base/productAttr';
 | 
			
		||||
 | 
			
		||||
import {
 | 
			
		||||
	createProduct,
 | 
			
		||||
	updateProduct,
 | 
			
		||||
	getProduct,
 | 
			
		||||
	getCode,
 | 
			
		||||
} from '@/api/core/base/product';
 | 
			
		||||
import productAttrAdd from './attr-add';
 | 
			
		||||
import { parseTime } from '../../mixins/code-filter';
 | 
			
		||||
import SmallTitle from './SmallTitle';
 | 
			
		||||
 | 
			
		||||
const tableBtn = [
 | 
			
		||||
	{
 | 
			
		||||
		type: 'edit',
 | 
			
		||||
		btnName: '编辑',
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		type: 'delete',
 | 
			
		||||
		btnName: '删除',
 | 
			
		||||
	},
 | 
			
		||||
];
 | 
			
		||||
const tableProps = [
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'createTime',
 | 
			
		||||
		label: '添加时间',
 | 
			
		||||
		filter: parseTime,
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'name',
 | 
			
		||||
		label: '属性名',
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'value',
 | 
			
		||||
		label: '属性值',
 | 
			
		||||
	},
 | 
			
		||||
];
 | 
			
		||||
 | 
			
		||||
export default {
 | 
			
		||||
	components: { productAttrAdd, SmallTitle },
 | 
			
		||||
	data() {
 | 
			
		||||
		return {
 | 
			
		||||
			visible: false,
 | 
			
		||||
			addOrUpdateVisible: false,
 | 
			
		||||
			tableBtn,
 | 
			
		||||
			tableProps,
 | 
			
		||||
			productAttributeList: [],
 | 
			
		||||
			dataForm: {
 | 
			
		||||
				id: null,
 | 
			
		||||
				name: '', // 产品名称
 | 
			
		||||
				code: '', // 产品编码
 | 
			
		||||
				area: 0, // 单位平方数(float only)
 | 
			
		||||
				typeDictValue: null, // 产品类型id
 | 
			
		||||
				processTime: null, // 单位产品用时 (s)
 | 
			
		||||
				specifications: '', // 规格
 | 
			
		||||
				unitDictValue: '', // 单位id
 | 
			
		||||
			},
 | 
			
		||||
			listQuery: {
 | 
			
		||||
				pageSize: 10,
 | 
			
		||||
				pageNo: 1,
 | 
			
		||||
				total: 0,
 | 
			
		||||
			},
 | 
			
		||||
			dataRule: {
 | 
			
		||||
				code: [
 | 
			
		||||
					{
 | 
			
		||||
						required: true,
 | 
			
		||||
						message: '产品编码不能为空',
 | 
			
		||||
						trigger: 'blur',
 | 
			
		||||
					},
 | 
			
		||||
					// {
 | 
			
		||||
					// 	type: 'number',
 | 
			
		||||
					// 	message: '产品编码为数字类型',
 | 
			
		||||
					// 	trigger: 'blur',
 | 
			
		||||
					// 	transfom: 'val => Number(val)',
 | 
			
		||||
					// },
 | 
			
		||||
				],
 | 
			
		||||
				name: [
 | 
			
		||||
					{
 | 
			
		||||
						required: true,
 | 
			
		||||
						message: '产品名称不能为空',
 | 
			
		||||
						trigger: 'blur',
 | 
			
		||||
					},
 | 
			
		||||
				],
 | 
			
		||||
				typeDictValue: [
 | 
			
		||||
					{
 | 
			
		||||
						required: true,
 | 
			
		||||
						message: '产品类型不能为空',
 | 
			
		||||
						trigger: 'blur',
 | 
			
		||||
					},
 | 
			
		||||
				],
 | 
			
		||||
				area: [
 | 
			
		||||
					{
 | 
			
		||||
						type: 'number',
 | 
			
		||||
						message: '请输入正确的数值',
 | 
			
		||||
						trigger: 'change',
 | 
			
		||||
						transform: (val) => Number(val),
 | 
			
		||||
					},
 | 
			
		||||
				],
 | 
			
		||||
				processTime: [
 | 
			
		||||
					{
 | 
			
		||||
						required: true,
 | 
			
		||||
						message: '完成单位产品用时不能为空',
 | 
			
		||||
						trigger: 'blur',
 | 
			
		||||
					},
 | 
			
		||||
					{
 | 
			
		||||
						type: 'number',
 | 
			
		||||
						message: '请输入正确的数值',
 | 
			
		||||
						trigger: 'blur',
 | 
			
		||||
						transform: (val) => Number(val),
 | 
			
		||||
					},
 | 
			
		||||
				],
 | 
			
		||||
			},
 | 
			
		||||
			isdetail: false,
 | 
			
		||||
		};
 | 
			
		||||
	},
 | 
			
		||||
	methods: {
 | 
			
		||||
		initData() {
 | 
			
		||||
			this.productAttributeList.splice(0);
 | 
			
		||||
			this.listQuery.total = 0;
 | 
			
		||||
		},
 | 
			
		||||
		init(id, isdetail) {
 | 
			
		||||
			this.initData();
 | 
			
		||||
			this.isdetail = isdetail || false;
 | 
			
		||||
			this.dataForm.id = id || null;
 | 
			
		||||
			this.visible = true;
 | 
			
		||||
 | 
			
		||||
			this.$nextTick(() => {
 | 
			
		||||
				this.$refs['dataForm'].resetFields();
 | 
			
		||||
 | 
			
		||||
				if (this.dataForm.id) {
 | 
			
		||||
					// 获取产品详情
 | 
			
		||||
					getProduct(id).then((response) => {
 | 
			
		||||
						this.dataForm = response.data;
 | 
			
		||||
					});
 | 
			
		||||
					// 获取产品的属性列表
 | 
			
		||||
					this.getList();
 | 
			
		||||
				} else {
 | 
			
		||||
					getCode().then((res) => {
 | 
			
		||||
						this.dataForm.code = res.data;
 | 
			
		||||
					});
 | 
			
		||||
				}
 | 
			
		||||
			});
 | 
			
		||||
		},
 | 
			
		||||
 | 
			
		||||
		getList() {
 | 
			
		||||
			// 获取产品的属性列表
 | 
			
		||||
			getProductAttrPage({
 | 
			
		||||
				...this.listQuery,
 | 
			
		||||
				productId: this.dataForm.id,
 | 
			
		||||
			}).then((response) => {
 | 
			
		||||
				this.productAttributeList = response.data.list;
 | 
			
		||||
				this.listQuery.total = response.data.total;
 | 
			
		||||
			});
 | 
			
		||||
		},
 | 
			
		||||
		handleClick(raw) {
 | 
			
		||||
			if (raw.type === 'delete') {
 | 
			
		||||
				this.$confirm(
 | 
			
		||||
					`确定对${
 | 
			
		||||
						raw.data.name
 | 
			
		||||
							? '[名称=' + raw.data.name + ']'
 | 
			
		||||
							: '[序号=' + raw.data._pageIndex + ']'
 | 
			
		||||
					}进行删除操作?`,
 | 
			
		||||
					'提示',
 | 
			
		||||
					{
 | 
			
		||||
						confirmButtonText: '确定',
 | 
			
		||||
						cancelButtonText: '取消',
 | 
			
		||||
						type: 'warning',
 | 
			
		||||
					}
 | 
			
		||||
				)
 | 
			
		||||
					.then(() => {
 | 
			
		||||
						deleteProductAttr(raw.data.id).then(({ data }) => {
 | 
			
		||||
							this.$message({
 | 
			
		||||
								message: '操作成功',
 | 
			
		||||
								type: 'success',
 | 
			
		||||
								duration: 1500,
 | 
			
		||||
								onClose: () => {
 | 
			
		||||
									this.getList();
 | 
			
		||||
								},
 | 
			
		||||
							});
 | 
			
		||||
						});
 | 
			
		||||
					})
 | 
			
		||||
					.catch(() => {});
 | 
			
		||||
			} else {
 | 
			
		||||
				this.addNew(raw.data.id);
 | 
			
		||||
			}
 | 
			
		||||
		},
 | 
			
		||||
		// 表单提交
 | 
			
		||||
		dataFormSubmit() {
 | 
			
		||||
			this.$refs['dataForm'].validate((valid) => {
 | 
			
		||||
				if (valid) {
 | 
			
		||||
					// 修改的提交
 | 
			
		||||
					if (this.dataForm.id) {
 | 
			
		||||
						updateProduct(this.dataForm).then((response) => {
 | 
			
		||||
							this.$modal.msgSuccess('修改成功');
 | 
			
		||||
							this.visible = false;
 | 
			
		||||
							this.$emit('refreshDataList');
 | 
			
		||||
						});
 | 
			
		||||
						return;
 | 
			
		||||
					}
 | 
			
		||||
					// 添加的提交
 | 
			
		||||
					createProduct(this.dataForm).then((response) => {
 | 
			
		||||
						this.$modal.msgSuccess('新增成功');
 | 
			
		||||
						this.visible = false;
 | 
			
		||||
						this.$emit('refreshDataList');
 | 
			
		||||
					});
 | 
			
		||||
				}
 | 
			
		||||
			});
 | 
			
		||||
		},
 | 
			
		||||
		goEdit() {
 | 
			
		||||
			this.isdetail = false;
 | 
			
		||||
		},
 | 
			
		||||
		// 新增 / 修改
 | 
			
		||||
		addNew(id) {
 | 
			
		||||
			this.addOrUpdateVisible = true;
 | 
			
		||||
			this.$nextTick(() => {
 | 
			
		||||
				this.$refs.addOrUpdate.init(id);
 | 
			
		||||
			});
 | 
			
		||||
		},
 | 
			
		||||
		goback() {
 | 
			
		||||
			this.$emit('refreshDataList');
 | 
			
		||||
			this.visible = false;
 | 
			
		||||
			this.initData();
 | 
			
		||||
		},
 | 
			
		||||
	},
 | 
			
		||||
};
 | 
			
		||||
</script>
 | 
			
		||||
 | 
			
		||||
<style scoped>
 | 
			
		||||
.drawer >>> .el-drawer {
 | 
			
		||||
	border-radius: 8px 0 0 8px;
 | 
			
		||||
	display: flex;
 | 
			
		||||
	flex-direction: column;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
.drawer >>> .el-form-item__label {
 | 
			
		||||
	padding: 0;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
.drawer >>> .el-drawer__header {
 | 
			
		||||
	margin: 0;
 | 
			
		||||
	padding: 32px 32px 24px;
 | 
			
		||||
	border-bottom: 1px solid #dcdfe6;
 | 
			
		||||
}
 | 
			
		||||
.drawer >>> .el-drawer__body {
 | 
			
		||||
	flex: 1;
 | 
			
		||||
	height: 1px;
 | 
			
		||||
	display: flex;
 | 
			
		||||
	flex-direction: column;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
.drawer >>> .content {
 | 
			
		||||
	padding: 30px 24px;
 | 
			
		||||
	flex: 1;
 | 
			
		||||
	display: flex;
 | 
			
		||||
	flex-direction: column;
 | 
			
		||||
	/* height: 100%; */
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
.drawer >>> .visual-part {
 | 
			
		||||
	flex: 1 auto;
 | 
			
		||||
	max-height: 76vh;
 | 
			
		||||
	overflow: hidden;
 | 
			
		||||
	overflow-y: scroll;
 | 
			
		||||
	padding-right: 10px; /* 调整滚动条样式 */
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
.drawer >>> .el-form,
 | 
			
		||||
.drawer >>> .attr-list {
 | 
			
		||||
	padding: 0 16px;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
.drawer-body__footer {
 | 
			
		||||
	display: flex;
 | 
			
		||||
	justify-content: flex-end;
 | 
			
		||||
	padding: 18px;
 | 
			
		||||
}
 | 
			
		||||
</style>
 | 
			
		||||
							
								
								
									
										139
									
								
								src/views/core/oldBase/product/attr-add.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										139
									
								
								src/views/core/oldBase/product/attr-add.vue
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,139 @@
 | 
			
		||||
<template>
 | 
			
		||||
	<el-dialog
 | 
			
		||||
		:visible.sync="visible"
 | 
			
		||||
		:width="'35%'"
 | 
			
		||||
		:append-to-body="true"
 | 
			
		||||
		:close-on-click-modal="false"
 | 
			
		||||
		class="dialog">
 | 
			
		||||
		<template #title>
 | 
			
		||||
			<slot name="title">
 | 
			
		||||
				<div class="titleStyle">
 | 
			
		||||
					{{ !dataForm.id ? '新增' : '编辑' }}
 | 
			
		||||
				</div>
 | 
			
		||||
			</slot>
 | 
			
		||||
		</template>
 | 
			
		||||
 | 
			
		||||
		<el-form
 | 
			
		||||
			ref="dataForm"
 | 
			
		||||
			:model="dataForm"
 | 
			
		||||
			:rules="dataRule"
 | 
			
		||||
			label-width="100px"
 | 
			
		||||
			@keyup.enter.native="dataFormSubmit()">
 | 
			
		||||
			<el-form-item label="属性名" prop="name">
 | 
			
		||||
				<el-input
 | 
			
		||||
					v-model="dataForm.name"
 | 
			
		||||
					placeholder="请输入属性名"
 | 
			
		||||
					clearable />
 | 
			
		||||
			</el-form-item>
 | 
			
		||||
			<el-form-item label="属性值" prop="value">
 | 
			
		||||
				<el-input
 | 
			
		||||
					v-model="dataForm.value"
 | 
			
		||||
					placeholder="请输入属性值"
 | 
			
		||||
					clearable />
 | 
			
		||||
			</el-form-item>
 | 
			
		||||
		</el-form>
 | 
			
		||||
 | 
			
		||||
		<el-row style="text-align: right">
 | 
			
		||||
			<el-button @click="visible = false">取消</el-button>
 | 
			
		||||
			<el-button type="primary" @click="dataFormSubmit()">确定</el-button>
 | 
			
		||||
		</el-row>
 | 
			
		||||
	</el-dialog>
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script>
 | 
			
		||||
import {
 | 
			
		||||
	createProductAttr,
 | 
			
		||||
	updateProductAttr,
 | 
			
		||||
	getProductAttr,
 | 
			
		||||
} from '@/api/core/base/productAttr';
 | 
			
		||||
 | 
			
		||||
export default {
 | 
			
		||||
	props: {
 | 
			
		||||
		productId: {
 | 
			
		||||
			type: String,
 | 
			
		||||
			default: '',
 | 
			
		||||
		},
 | 
			
		||||
	},
 | 
			
		||||
	data() {
 | 
			
		||||
		return {
 | 
			
		||||
			visible: false,
 | 
			
		||||
			dataForm: {
 | 
			
		||||
				id: 0,
 | 
			
		||||
				name: '',
 | 
			
		||||
				value: '',
 | 
			
		||||
			},
 | 
			
		||||
			dataRule: {
 | 
			
		||||
				name: [{ required: true, message: '名称不能为空', trigger: 'blur' }],
 | 
			
		||||
			},
 | 
			
		||||
		};
 | 
			
		||||
	},
 | 
			
		||||
	methods: {
 | 
			
		||||
		init(id) {
 | 
			
		||||
			this.dataForm.id = id || '';
 | 
			
		||||
			this.visible = true;
 | 
			
		||||
			this.$nextTick(() => {
 | 
			
		||||
				this.$refs['dataForm'].resetFields();
 | 
			
		||||
				if (this.dataForm.id) {
 | 
			
		||||
					getProductAttr(this.dataForm.id).then((res) => {
 | 
			
		||||
						const { name, value } = res.data;
 | 
			
		||||
						this.dataForm.name = name;
 | 
			
		||||
						this.dataForm.value = value;
 | 
			
		||||
					});
 | 
			
		||||
				}
 | 
			
		||||
			});
 | 
			
		||||
		},
 | 
			
		||||
		// 表单提交
 | 
			
		||||
		dataFormSubmit() {
 | 
			
		||||
			this.$refs['dataForm'].validate((valid) => {
 | 
			
		||||
				if (valid) {
 | 
			
		||||
					// 修改的提交
 | 
			
		||||
					if (this.dataForm.id) {
 | 
			
		||||
						updateProductAttr({
 | 
			
		||||
							...this.dataForm,
 | 
			
		||||
							productId: this.productId,
 | 
			
		||||
						}).then((response) => {
 | 
			
		||||
							this.$modal.msgSuccess('修改成功');
 | 
			
		||||
							this.visible = false;
 | 
			
		||||
							this.$emit('refreshDataList');
 | 
			
		||||
						});
 | 
			
		||||
						return;
 | 
			
		||||
					}
 | 
			
		||||
					// 添加的提交
 | 
			
		||||
					createProductAttr({
 | 
			
		||||
						...this.dataForm,
 | 
			
		||||
						productId: this.productId,
 | 
			
		||||
					}).then((response) => {
 | 
			
		||||
						this.$modal.msgSuccess('新增成功');
 | 
			
		||||
						this.visible = false;
 | 
			
		||||
						this.$emit('refreshDataList');
 | 
			
		||||
					});
 | 
			
		||||
				}
 | 
			
		||||
			});
 | 
			
		||||
		},
 | 
			
		||||
	},
 | 
			
		||||
};
 | 
			
		||||
</script>
 | 
			
		||||
 | 
			
		||||
<style scoped>
 | 
			
		||||
.dialog >>> .el-dialog__body {
 | 
			
		||||
	padding: 30px 24px;
 | 
			
		||||
}
 | 
			
		||||
.dialog >>> .el-dialog__header {
 | 
			
		||||
	font-size: 16px;
 | 
			
		||||
	color: rgba(0, 0, 0, 0.85);
 | 
			
		||||
	font-weight: 500;
 | 
			
		||||
	padding: 13px 24px;
 | 
			
		||||
	border-bottom: 1px solid #e9e9e9;
 | 
			
		||||
}
 | 
			
		||||
.dialog >>> .el-dialog__header .titleStyle::before {
 | 
			
		||||
	content: '';
 | 
			
		||||
	display: inline-block;
 | 
			
		||||
	width: 4px;
 | 
			
		||||
	height: 16px;
 | 
			
		||||
	background-color: #0b58ff;
 | 
			
		||||
	border-radius: 1px;
 | 
			
		||||
	margin-right: 8px;
 | 
			
		||||
	position: relative;
 | 
			
		||||
	top: 2px;
 | 
			
		||||
}
 | 
			
		||||
</style>
 | 
			
		||||
							
								
								
									
										200
									
								
								src/views/core/oldBase/product/index.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										200
									
								
								src/views/core/oldBase/product/index.vue
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,200 @@
 | 
			
		||||
<!--
 | 
			
		||||
 * @Author: zwq
 | 
			
		||||
 * @Date: 2023-08-01 14:55:51
 | 
			
		||||
 * @LastEditors: DY
 | 
			
		||||
 * @LastEditTime: 2023-10-13 10:27:00
 | 
			
		||||
 * @Description:
 | 
			
		||||
-->
 | 
			
		||||
<template>
 | 
			
		||||
	<div class="app-container">
 | 
			
		||||
		<search-bar
 | 
			
		||||
			:formConfigs="formConfig"
 | 
			
		||||
			ref="searchBarForm"
 | 
			
		||||
			@headBtnClick="buttonClick" />
 | 
			
		||||
		<base-table
 | 
			
		||||
			:table-props="tableProps"
 | 
			
		||||
			:page="listQuery.pageNo"
 | 
			
		||||
			:limit="listQuery.pageSize"
 | 
			
		||||
			:table-data="tableData">
 | 
			
		||||
			<method-btn
 | 
			
		||||
				v-if="tableBtn.length"
 | 
			
		||||
				slot="handleBtn"
 | 
			
		||||
				:width="120"
 | 
			
		||||
				label="操作"
 | 
			
		||||
				:method-list="tableBtn"
 | 
			
		||||
				@clickBtn="handleClick" />
 | 
			
		||||
		</base-table>
 | 
			
		||||
		<pagination
 | 
			
		||||
			:limit.sync="listQuery.pageSize"
 | 
			
		||||
			:page.sync="listQuery.pageNo"
 | 
			
		||||
			:total="listQuery.total"
 | 
			
		||||
			@pagination="getDataList" />
 | 
			
		||||
		<add-or-update
 | 
			
		||||
			v-if="addOrUpdateVisible"
 | 
			
		||||
			ref="addOrUpdate"
 | 
			
		||||
			@refreshDataList="getDataList" />
 | 
			
		||||
	</div>
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script>
 | 
			
		||||
import AddOrUpdate from './add-or-updata';
 | 
			
		||||
import unitDict from './unitDict';
 | 
			
		||||
import basicPage from '../../mixins/basic-page';
 | 
			
		||||
import { parseTime } from '../../mixins/code-filter';
 | 
			
		||||
import {
 | 
			
		||||
	deleteProduct,
 | 
			
		||||
	getProductPage,
 | 
			
		||||
	exportProductExcel,
 | 
			
		||||
} from '@/api/core/base/product';
 | 
			
		||||
 | 
			
		||||
const tableProps = [
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'code',
 | 
			
		||||
		label: '产品编码'
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'name',
 | 
			
		||||
		label: '产品名称'
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'specifications',
 | 
			
		||||
		label: '规格'
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'unitDictValue',
 | 
			
		||||
		label: '单位',
 | 
			
		||||
		subcomponent: unitDict,
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'createTime',
 | 
			
		||||
		label: '创建时间',
 | 
			
		||||
		filter: parseTime
 | 
			
		||||
	},
 | 
			
		||||
];
 | 
			
		||||
 | 
			
		||||
export default {
 | 
			
		||||
	mixins: [basicPage],
 | 
			
		||||
	data() {
 | 
			
		||||
		return {
 | 
			
		||||
			urlOptions: {
 | 
			
		||||
				getDataListURL: getProductPage,
 | 
			
		||||
				deleteURL: deleteProduct,
 | 
			
		||||
				exportURL: exportProductExcel,
 | 
			
		||||
			},
 | 
			
		||||
			tableProps,
 | 
			
		||||
			tableBtn: [
 | 
			
		||||
				this.$auth.hasPermi(`base:product:update`)
 | 
			
		||||
					? {
 | 
			
		||||
							type: 'edit',
 | 
			
		||||
							btnName: '编辑',
 | 
			
		||||
					  }
 | 
			
		||||
					: undefined,
 | 
			
		||||
				this.$auth.hasPermi(`base:product:delete`)
 | 
			
		||||
					? {
 | 
			
		||||
							type: 'delete',
 | 
			
		||||
							btnName: '删除',
 | 
			
		||||
					  }
 | 
			
		||||
					: undefined,
 | 
			
		||||
				this.$auth.hasPermi(`base:product:update`)
 | 
			
		||||
					? {
 | 
			
		||||
							type: 'detail',
 | 
			
		||||
							btnName: '详情',
 | 
			
		||||
					  }
 | 
			
		||||
					: undefined,
 | 
			
		||||
			].filter((v) => v),
 | 
			
		||||
			tableData: [],
 | 
			
		||||
			formConfig: [
 | 
			
		||||
				{
 | 
			
		||||
					type: 'input',
 | 
			
		||||
					label: '产品编码',
 | 
			
		||||
					placeholder: '产品编码',
 | 
			
		||||
					param: 'code',
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					type: 'input',
 | 
			
		||||
					label: '产品名称',
 | 
			
		||||
					placeholder: '产品名称',
 | 
			
		||||
					param: 'name',
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					type: 'button',
 | 
			
		||||
					btnName: '搜索',
 | 
			
		||||
					name: 'search',
 | 
			
		||||
					color: 'primary',
 | 
			
		||||
				},
 | 
			
		||||
				// {
 | 
			
		||||
				// 	type: 'separate',
 | 
			
		||||
				// },
 | 
			
		||||
				// {
 | 
			
		||||
				// 	type: 'button',
 | 
			
		||||
				// 	btnName: '重置',
 | 
			
		||||
				// 	name: 'reset',
 | 
			
		||||
				// },
 | 
			
		||||
				{
 | 
			
		||||
					type: 'separate',
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					type: this.$auth.hasPermi('base:product:create') ? 'button' : '',
 | 
			
		||||
					btnName: '新增',
 | 
			
		||||
					name: 'add',
 | 
			
		||||
					color: 'success',
 | 
			
		||||
					plain: true,
 | 
			
		||||
				},
 | 
			
		||||
				// {
 | 
			
		||||
				// 	type: 'separate',
 | 
			
		||||
				// 	type: this.$auth.hasPermi('base:product:create') ? 'separate' : '',
 | 
			
		||||
				// },
 | 
			
		||||
				// {
 | 
			
		||||
				// 	type: this.$auth.hasPermi('base:product:export') ? 'button' : '',
 | 
			
		||||
				// 	btnName: '导出',
 | 
			
		||||
				// 	name: 'export',
 | 
			
		||||
				// 	color: 'warning',
 | 
			
		||||
				// },
 | 
			
		||||
			],
 | 
			
		||||
		};
 | 
			
		||||
	},
 | 
			
		||||
	components: {
 | 
			
		||||
		AddOrUpdate,
 | 
			
		||||
	},
 | 
			
		||||
	created() {},
 | 
			
		||||
	methods: {
 | 
			
		||||
		buttonClick(val) {
 | 
			
		||||
			switch (val.btnName) {
 | 
			
		||||
				case 'search':
 | 
			
		||||
					this.listQuery.pageNo = 1;
 | 
			
		||||
					this.listQuery.pageSize = 10;
 | 
			
		||||
					this.listQuery.name = val.name;
 | 
			
		||||
					this.listQuery.code = val.code;
 | 
			
		||||
					this.getDataList();
 | 
			
		||||
					break;
 | 
			
		||||
				case 'reset':
 | 
			
		||||
					this.$refs.searchBarForm.resetForm();
 | 
			
		||||
					this.listQuery = {
 | 
			
		||||
						pageSize: 10,
 | 
			
		||||
						pageNo: 1,
 | 
			
		||||
						total: 1,
 | 
			
		||||
					};
 | 
			
		||||
					this.getDataList();
 | 
			
		||||
					break;
 | 
			
		||||
				case 'add':
 | 
			
		||||
					this.addOrEditTitle = '新增';
 | 
			
		||||
					this.addOrUpdateVisible = true;
 | 
			
		||||
					this.addOrUpdateHandle();
 | 
			
		||||
					break;
 | 
			
		||||
				case 'export':
 | 
			
		||||
					this.handleExport();
 | 
			
		||||
					break;
 | 
			
		||||
				default:
 | 
			
		||||
					console.log(val);
 | 
			
		||||
			}
 | 
			
		||||
		},
 | 
			
		||||
		otherMethods(val) {
 | 
			
		||||
			this.addOrUpdateVisible = true;
 | 
			
		||||
			this.addOrEditTitle = '详情';
 | 
			
		||||
			this.$nextTick(() => {
 | 
			
		||||
				this.$refs.addOrUpdate.init(val.data.id, true);
 | 
			
		||||
			});
 | 
			
		||||
		},
 | 
			
		||||
	},
 | 
			
		||||
};
 | 
			
		||||
</script>
 | 
			
		||||
							
								
								
									
										228
									
								
								src/views/core/oldBase/productAttr/index.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										228
									
								
								src/views/core/oldBase/productAttr/index.vue
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,228 @@
 | 
			
		||||
<template>
 | 
			
		||||
  <div class="app-container">
 | 
			
		||||
 | 
			
		||||
    <!-- 搜索工作栏 -->
 | 
			
		||||
    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
 | 
			
		||||
      <el-form-item label="名称" prop="name">
 | 
			
		||||
        <el-input v-model="queryParams.name" placeholder="请输入名称" clearable @keyup.enter.native="handleQuery"/>
 | 
			
		||||
      </el-form-item>
 | 
			
		||||
      <el-form-item label="产品id,关联产品表" prop="productId">
 | 
			
		||||
        <el-input v-model="queryParams.productId" placeholder="请输入产品id,关联产品表" clearable @keyup.enter.native="handleQuery"/>
 | 
			
		||||
      </el-form-item>
 | 
			
		||||
      <el-form-item label="属性值" prop="value">
 | 
			
		||||
        <el-input v-model="queryParams.value" placeholder="请输入属性值" clearable @keyup.enter.native="handleQuery"/>
 | 
			
		||||
      </el-form-item>
 | 
			
		||||
      <el-form-item label="创建时间" prop="createTime">
 | 
			
		||||
        <el-date-picker v-model="queryParams.createTime" style="width: 240px" value-format="yyyy-MM-dd HH:mm:ss" type="daterange"
 | 
			
		||||
                        range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期" :default-time="['00:00:00', '23:59:59']" />
 | 
			
		||||
      </el-form-item>
 | 
			
		||||
      <el-form-item>
 | 
			
		||||
        <el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button>
 | 
			
		||||
        <el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button>
 | 
			
		||||
      </el-form-item>
 | 
			
		||||
    </el-form>
 | 
			
		||||
 | 
			
		||||
    <!-- 操作工具栏 -->
 | 
			
		||||
    <el-row :gutter="10" class="mb8">
 | 
			
		||||
      <el-col :span="1.5">
 | 
			
		||||
        <el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd"
 | 
			
		||||
                   v-hasPermi="['base:product-attr:create']">新增</el-button>
 | 
			
		||||
      </el-col>
 | 
			
		||||
      <el-col :span="1.5">
 | 
			
		||||
        <el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport" :loading="exportLoading"
 | 
			
		||||
                   v-hasPermi="['base:product-attr:export']">导出</el-button>
 | 
			
		||||
      </el-col>
 | 
			
		||||
      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
 | 
			
		||||
    </el-row>
 | 
			
		||||
 | 
			
		||||
    <!-- 列表 -->
 | 
			
		||||
    <el-table v-loading="loading" :data="list">
 | 
			
		||||
      <el-table-column label="ID" align="center" prop="id" />
 | 
			
		||||
      <el-table-column label="名称" align="center" prop="name" />
 | 
			
		||||
      <el-table-column label="产品id,关联产品表" align="center" prop="productId" />
 | 
			
		||||
      <el-table-column label="属性值" align="center" prop="value" />
 | 
			
		||||
      <el-table-column label="创建时间" align="center" prop="createTime" width="180">
 | 
			
		||||
        <template v-slot="scope">
 | 
			
		||||
          <span>{{ parseTime(scope.row.createTime) }}</span>
 | 
			
		||||
        </template>
 | 
			
		||||
      </el-table-column>
 | 
			
		||||
      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
 | 
			
		||||
        <template v-slot="scope">
 | 
			
		||||
          <el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)"
 | 
			
		||||
                     v-hasPermi="['base:product-attr:update']">修改</el-button>
 | 
			
		||||
          <el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"
 | 
			
		||||
                     v-hasPermi="['base:product-attr:delete']">删除</el-button>
 | 
			
		||||
        </template>
 | 
			
		||||
      </el-table-column>
 | 
			
		||||
    </el-table>
 | 
			
		||||
    <!-- 分页组件 -->
 | 
			
		||||
    <pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize"
 | 
			
		||||
                @pagination="getList"/>
 | 
			
		||||
 | 
			
		||||
    <!-- 对话框(添加 / 修改) -->
 | 
			
		||||
    <el-dialog :title="title" :visible.sync="open" width="500px" v-dialogDrag append-to-body>
 | 
			
		||||
      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
 | 
			
		||||
        <el-form-item label="名称" prop="name">
 | 
			
		||||
          <el-input v-model="form.name" placeholder="请输入名称" />
 | 
			
		||||
        </el-form-item>
 | 
			
		||||
        <el-form-item label="产品id,关联产品表" prop="productId">
 | 
			
		||||
          <el-input v-model="form.productId" placeholder="请输入产品id,关联产品表" />
 | 
			
		||||
        </el-form-item>
 | 
			
		||||
        <el-form-item label="属性值" prop="value">
 | 
			
		||||
          <el-input v-model="form.value" placeholder="请输入属性值" />
 | 
			
		||||
        </el-form-item>
 | 
			
		||||
      </el-form>
 | 
			
		||||
      <div slot="footer" class="dialog-footer">
 | 
			
		||||
        <el-button type="primary" @click="submitForm">确 定</el-button>
 | 
			
		||||
        <el-button @click="cancel">取 消</el-button>
 | 
			
		||||
      </div>
 | 
			
		||||
    </el-dialog>
 | 
			
		||||
  </div>
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script>
 | 
			
		||||
import { createProductAttr, updateProductAttr, deleteProductAttr, getProductAttr, getProductAttrPage, exportProductAttrExcel } from "@/api/core/base/productAttr";
 | 
			
		||||
 | 
			
		||||
export default {
 | 
			
		||||
  name: "ProductAttr",
 | 
			
		||||
  components: {
 | 
			
		||||
  },
 | 
			
		||||
  data() {
 | 
			
		||||
    return {
 | 
			
		||||
      // 遮罩层
 | 
			
		||||
      loading: true,
 | 
			
		||||
      // 导出遮罩层
 | 
			
		||||
      exportLoading: false,
 | 
			
		||||
      // 显示搜索条件
 | 
			
		||||
      showSearch: true,
 | 
			
		||||
      // 总条数
 | 
			
		||||
      total: 0,
 | 
			
		||||
      // 产品属性列表
 | 
			
		||||
      list: [],
 | 
			
		||||
      // 弹出层标题
 | 
			
		||||
      title: "",
 | 
			
		||||
      // 是否显示弹出层
 | 
			
		||||
      open: false,
 | 
			
		||||
      // 查询参数
 | 
			
		||||
      queryParams: {
 | 
			
		||||
        pageNo: 1,
 | 
			
		||||
        pageSize: 10,
 | 
			
		||||
        name: null,
 | 
			
		||||
        productId: null,
 | 
			
		||||
        value: null,
 | 
			
		||||
        createTime: [],
 | 
			
		||||
      },
 | 
			
		||||
      // 表单参数
 | 
			
		||||
      form: {},
 | 
			
		||||
      // 表单校验
 | 
			
		||||
      rules: {
 | 
			
		||||
        name: [{ required: true, message: "名称不能为空", trigger: "blur" }],
 | 
			
		||||
        productId: [{ required: true, message: "产品id,关联产品表不能为空", trigger: "blur" }],
 | 
			
		||||
      }
 | 
			
		||||
    };
 | 
			
		||||
  },
 | 
			
		||||
  created() {
 | 
			
		||||
    this.getList();
 | 
			
		||||
  },
 | 
			
		||||
  methods: {
 | 
			
		||||
    /** 查询列表 */
 | 
			
		||||
    getList() {
 | 
			
		||||
      this.loading = true;
 | 
			
		||||
      // 执行查询
 | 
			
		||||
      getProductAttrPage(this.queryParams).then(response => {
 | 
			
		||||
        this.list = response.data.list;
 | 
			
		||||
        this.total = response.data.total;
 | 
			
		||||
        this.loading = false;
 | 
			
		||||
      });
 | 
			
		||||
    },
 | 
			
		||||
    /** 取消按钮 */
 | 
			
		||||
    cancel() {
 | 
			
		||||
      this.open = false;
 | 
			
		||||
      this.reset();
 | 
			
		||||
    },
 | 
			
		||||
    /** 表单重置 */
 | 
			
		||||
    reset() {
 | 
			
		||||
      this.form = {
 | 
			
		||||
        id: undefined,
 | 
			
		||||
        name: undefined,
 | 
			
		||||
        productId: undefined,
 | 
			
		||||
        value: undefined,
 | 
			
		||||
      };
 | 
			
		||||
      this.resetForm("form");
 | 
			
		||||
    },
 | 
			
		||||
    /** 搜索按钮操作 */
 | 
			
		||||
    handleQuery() {
 | 
			
		||||
      this.queryParams.pageNo = 1;
 | 
			
		||||
      this.getList();
 | 
			
		||||
    },
 | 
			
		||||
    /** 重置按钮操作 */
 | 
			
		||||
    resetQuery() {
 | 
			
		||||
      this.resetForm("queryForm");
 | 
			
		||||
      this.handleQuery();
 | 
			
		||||
    },
 | 
			
		||||
    /** 新增按钮操作 */
 | 
			
		||||
    handleAdd() {
 | 
			
		||||
      this.reset();
 | 
			
		||||
      this.open = true;
 | 
			
		||||
      this.title = "添加产品属性";
 | 
			
		||||
    },
 | 
			
		||||
    /** 修改按钮操作 */
 | 
			
		||||
    handleUpdate(row) {
 | 
			
		||||
      this.reset();
 | 
			
		||||
      const id = row.id;
 | 
			
		||||
      getProductAttr(id).then(response => {
 | 
			
		||||
        this.form = response.data;
 | 
			
		||||
        this.open = true;
 | 
			
		||||
        this.title = "修改产品属性";
 | 
			
		||||
      });
 | 
			
		||||
    },
 | 
			
		||||
    /** 提交按钮 */
 | 
			
		||||
    submitForm() {
 | 
			
		||||
      this.$refs["form"].validate(valid => {
 | 
			
		||||
        if (!valid) {
 | 
			
		||||
          return;
 | 
			
		||||
        }
 | 
			
		||||
        // 修改的提交
 | 
			
		||||
        if (this.form.id != null) {
 | 
			
		||||
          updateProductAttr(this.form).then(response => {
 | 
			
		||||
            this.$modal.msgSuccess("修改成功");
 | 
			
		||||
            this.open = false;
 | 
			
		||||
            this.getList();
 | 
			
		||||
          });
 | 
			
		||||
          return;
 | 
			
		||||
        }
 | 
			
		||||
        // 添加的提交
 | 
			
		||||
        createProductAttr(this.form).then(response => {
 | 
			
		||||
          this.$modal.msgSuccess("新增成功");
 | 
			
		||||
          this.open = false;
 | 
			
		||||
          this.getList();
 | 
			
		||||
        });
 | 
			
		||||
      });
 | 
			
		||||
    },
 | 
			
		||||
    /** 删除按钮操作 */
 | 
			
		||||
    handleDelete(row) {
 | 
			
		||||
      const id = row.id;
 | 
			
		||||
      this.$modal.confirm('是否确认删除产品属性编号为"' + id + '"的数据项?').then(function() {
 | 
			
		||||
          return deleteProductAttr(id);
 | 
			
		||||
        }).then(() => {
 | 
			
		||||
          this.getList();
 | 
			
		||||
          this.$modal.msgSuccess("删除成功");
 | 
			
		||||
        }).catch(() => {});
 | 
			
		||||
    },
 | 
			
		||||
    /** 导出按钮操作 */
 | 
			
		||||
    handleExport() {
 | 
			
		||||
      // 处理查询参数
 | 
			
		||||
      let params = {...this.queryParams};
 | 
			
		||||
      params.pageNo = undefined;
 | 
			
		||||
      params.pageSize = undefined;
 | 
			
		||||
      this.$modal.confirm('是否确认导出所有产品属性数据项?').then(() => {
 | 
			
		||||
          this.exportLoading = true;
 | 
			
		||||
          return exportProductAttrExcel(params);
 | 
			
		||||
        }).then(response => {
 | 
			
		||||
          this.$download.excel(response, '产品属性.xls');
 | 
			
		||||
          this.exportLoading = false;
 | 
			
		||||
        }).catch(() => {});
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
};
 | 
			
		||||
</script>
 | 
			
		||||
							
								
								
									
										153
									
								
								src/views/core/oldBase/productionLine/add-or-updata.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										153
									
								
								src/views/core/oldBase/productionLine/add-or-updata.vue
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,153 @@
 | 
			
		||||
<!--
 | 
			
		||||
 * @Author: zwq
 | 
			
		||||
 * @Date: 2023-08-01 13:52:10
 | 
			
		||||
 * @LastEditors: DY
 | 
			
		||||
 * @LastEditTime: 2023-09-21 15:45:07
 | 
			
		||||
 * @Description:
 | 
			
		||||
-->
 | 
			
		||||
<template>
 | 
			
		||||
	<el-form
 | 
			
		||||
		class="dialog-inner__form"
 | 
			
		||||
		:model="dataForm"
 | 
			
		||||
		:rules="dataRule"
 | 
			
		||||
		ref="dataForm"
 | 
			
		||||
		@keyup.enter.native="dataFormSubmit()"
 | 
			
		||||
		label-width="90px">
 | 
			
		||||
		<el-row :gutter="20">
 | 
			
		||||
			<el-col :span="12">
 | 
			
		||||
				<el-form-item label="产线编码" prop="code">
 | 
			
		||||
					<el-input
 | 
			
		||||
						v-model="dataForm.code"
 | 
			
		||||
						clearable
 | 
			
		||||
						placeholder="请输入产线编码" />
 | 
			
		||||
				</el-form-item>
 | 
			
		||||
			</el-col>
 | 
			
		||||
			<el-col :span="12">
 | 
			
		||||
				<el-form-item label="产线名称" prop="name">
 | 
			
		||||
					<el-input
 | 
			
		||||
						v-model="dataForm.name"
 | 
			
		||||
						clearable
 | 
			
		||||
						placeholder="请输入产线名称" />
 | 
			
		||||
				</el-form-item>
 | 
			
		||||
			</el-col>
 | 
			
		||||
		</el-row>
 | 
			
		||||
		<el-row :gutter="20">
 | 
			
		||||
			<el-col :span="12">
 | 
			
		||||
				<el-form-item prop="factoryId" label="工厂名称">
 | 
			
		||||
					<el-select
 | 
			
		||||
						v-model="dataForm.factoryId"
 | 
			
		||||
						filterable
 | 
			
		||||
						clearable
 | 
			
		||||
						placeholder="请选择工厂">
 | 
			
		||||
						<el-option
 | 
			
		||||
							v-for="item in urlOptions.optionArr.arr0"
 | 
			
		||||
							:key="item.id"
 | 
			
		||||
							:label="item.name"
 | 
			
		||||
							:value="item.id"></el-option>
 | 
			
		||||
					</el-select>
 | 
			
		||||
				</el-form-item>
 | 
			
		||||
			</el-col>
 | 
			
		||||
			<el-col :span="12">
 | 
			
		||||
				<el-form-item label="产线TT值(h)" prop="tvalue">
 | 
			
		||||
					<el-input
 | 
			
		||||
						v-model="dataForm.tvalue"
 | 
			
		||||
						clearable
 | 
			
		||||
						placeholder="请输入每小时下片数量" />
 | 
			
		||||
				</el-form-item>
 | 
			
		||||
			</el-col>
 | 
			
		||||
		</el-row>
 | 
			
		||||
		<el-row :gutter="20">
 | 
			
		||||
			<el-col :span="12">
 | 
			
		||||
				<el-form-item label="额外编码" prop="externalCode">
 | 
			
		||||
					<el-input
 | 
			
		||||
						v-model="dataForm.externalCode"
 | 
			
		||||
						clearable
 | 
			
		||||
						placeholder="请输入额外编码" />
 | 
			
		||||
				</el-form-item>
 | 
			
		||||
			</el-col>
 | 
			
		||||
			<el-col :span="12">
 | 
			
		||||
				<el-form-item label="备注" prop="remark">
 | 
			
		||||
					<el-input
 | 
			
		||||
						v-model="dataForm.remark"
 | 
			
		||||
						clearable
 | 
			
		||||
						placeholder="请输入备注" />
 | 
			
		||||
				</el-form-item>
 | 
			
		||||
			</el-col>
 | 
			
		||||
		</el-row>
 | 
			
		||||
 | 
			
		||||
		<el-row>
 | 
			
		||||
			<el-col>
 | 
			
		||||
				<el-form-item label="描述" prop="description">
 | 
			
		||||
					<el-input
 | 
			
		||||
						v-model="dataForm.description"
 | 
			
		||||
						type="textarea"
 | 
			
		||||
						placeholder="请输入内容" />
 | 
			
		||||
				</el-form-item>
 | 
			
		||||
			</el-col>
 | 
			
		||||
		</el-row>
 | 
			
		||||
	</el-form>
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script>
 | 
			
		||||
import basicAdd from '../../mixins/basic-add';
 | 
			
		||||
import {
 | 
			
		||||
	createProductionLine,
 | 
			
		||||
	updateProductionLine,
 | 
			
		||||
	getProductionLine,
 | 
			
		||||
	getCode,
 | 
			
		||||
} from '@/api/core/base/productionLine';
 | 
			
		||||
import { getFactoryPage } from '@/api/core/base/factory';
 | 
			
		||||
 | 
			
		||||
export default {
 | 
			
		||||
	mixins: [basicAdd],
 | 
			
		||||
	data() {
 | 
			
		||||
		return {
 | 
			
		||||
			urlOptions: {
 | 
			
		||||
				getOption: true,
 | 
			
		||||
				isGetCode: true,
 | 
			
		||||
				codeURL: getCode,
 | 
			
		||||
				createURL: createProductionLine,
 | 
			
		||||
				updateURL: updateProductionLine,
 | 
			
		||||
				infoURL: getProductionLine,
 | 
			
		||||
				optionArrUrl: [getFactoryPage],
 | 
			
		||||
			},
 | 
			
		||||
			dataForm: {
 | 
			
		||||
				id: undefined,
 | 
			
		||||
				code: undefined,
 | 
			
		||||
				name: undefined,
 | 
			
		||||
				tvalue: undefined,
 | 
			
		||||
				factoryId: undefined,
 | 
			
		||||
				externalCode: undefined,
 | 
			
		||||
				remark: undefined,
 | 
			
		||||
				description: undefined,
 | 
			
		||||
			},
 | 
			
		||||
			dataRule: {
 | 
			
		||||
				code: [
 | 
			
		||||
					{ required: true, message: '产线编码不能为空', trigger: 'blur' },
 | 
			
		||||
				],
 | 
			
		||||
				name: [
 | 
			
		||||
					{ required: true, message: '产线名称不能为空', trigger: 'blur' },
 | 
			
		||||
				],
 | 
			
		||||
				factoryId: [
 | 
			
		||||
					{ required: true, message: '工厂不能为空', trigger: 'change' },
 | 
			
		||||
				],
 | 
			
		||||
				tvalue: [
 | 
			
		||||
					{
 | 
			
		||||
						type: 'number',
 | 
			
		||||
						message: '请输入正确的数字',
 | 
			
		||||
						trigger: 'change',
 | 
			
		||||
						transform: (val) => Number(val),
 | 
			
		||||
					},
 | 
			
		||||
				],
 | 
			
		||||
			},
 | 
			
		||||
		};
 | 
			
		||||
	},
 | 
			
		||||
	methods: {},
 | 
			
		||||
};
 | 
			
		||||
</script>
 | 
			
		||||
 | 
			
		||||
<style scoped>
 | 
			
		||||
.dialog-inner__form >>> .el-select {
 | 
			
		||||
	width: 100%;
 | 
			
		||||
}
 | 
			
		||||
</style>
 | 
			
		||||
							
								
								
									
										217
									
								
								src/views/core/oldBase/productionLine/index.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										217
									
								
								src/views/core/oldBase/productionLine/index.vue
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,217 @@
 | 
			
		||||
<template>
 | 
			
		||||
	<div class="app-container">
 | 
			
		||||
		<search-bar
 | 
			
		||||
			:formConfigs="formConfig"
 | 
			
		||||
			ref="searchBarForm"
 | 
			
		||||
			@headBtnClick="buttonClick" />
 | 
			
		||||
		<base-table
 | 
			
		||||
			v-loading="dataListLoading"
 | 
			
		||||
			:table-props="tableProps"
 | 
			
		||||
			:page="listQuery.pageNo"
 | 
			
		||||
			:limit="listQuery.pageSize"
 | 
			
		||||
			:table-data="tableData">
 | 
			
		||||
			<method-btn
 | 
			
		||||
				v-if="tableBtn.length"
 | 
			
		||||
				slot="handleBtn"
 | 
			
		||||
				:width="120"
 | 
			
		||||
				label="操作"
 | 
			
		||||
				:method-list="tableBtn"
 | 
			
		||||
				@clickBtn="handleClick" />
 | 
			
		||||
		</base-table>
 | 
			
		||||
		<pagination
 | 
			
		||||
			:limit.sync="listQuery.pageSize"
 | 
			
		||||
			:page.sync="listQuery.pageNo"
 | 
			
		||||
			:total="listQuery.total"
 | 
			
		||||
			@pagination="getDataList" />
 | 
			
		||||
		<base-dialog
 | 
			
		||||
			:dialogTitle="addOrEditTitle"
 | 
			
		||||
			:dialogVisible="addOrUpdateVisible"
 | 
			
		||||
			@cancel="handleCancel"
 | 
			
		||||
			@confirm="handleConfirm"
 | 
			
		||||
			:before-close="handleCancel"
 | 
			
		||||
			width="50%">
 | 
			
		||||
			<add-or-update
 | 
			
		||||
				ref="addOrUpdate"
 | 
			
		||||
				@refreshDataList="successSubmit"></add-or-update>
 | 
			
		||||
		</base-dialog>
 | 
			
		||||
	</div>
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script>
 | 
			
		||||
import AddOrUpdate from './add-or-updata';
 | 
			
		||||
import basicPage from '../../mixins/basic-page';
 | 
			
		||||
import codeFilter from '../../mixins/code-filter';
 | 
			
		||||
import { parseTime } from '../../mixins/code-filter';
 | 
			
		||||
import {
 | 
			
		||||
	deleteProductionLine,
 | 
			
		||||
	getProductionLinePage,
 | 
			
		||||
	exportProductionLineExcel,
 | 
			
		||||
	getStatus,
 | 
			
		||||
} from '@/api/core/base/productionLine';
 | 
			
		||||
 | 
			
		||||
const tableProps = [
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'code',
 | 
			
		||||
		label: '产线编码'
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'name',
 | 
			
		||||
		label: '产线名称'
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'factoryName',
 | 
			
		||||
		label: '工厂'
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'externalCode',
 | 
			
		||||
		label: '额外编码'
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'status',
 | 
			
		||||
		label: '当前状态',
 | 
			
		||||
		filter: codeFilter('lineStatus'),
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'description',
 | 
			
		||||
		label: '描述'
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'remark',
 | 
			
		||||
		label: '备注'
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'createTime',
 | 
			
		||||
		label: '创建时间',
 | 
			
		||||
		filter: parseTime
 | 
			
		||||
	},
 | 
			
		||||
];
 | 
			
		||||
 | 
			
		||||
export default {
 | 
			
		||||
	mixins: [basicPage],
 | 
			
		||||
	data() {
 | 
			
		||||
		return {
 | 
			
		||||
			urlOptions: {
 | 
			
		||||
				getDataListURL: getProductionLinePage,
 | 
			
		||||
				deleteURL: deleteProductionLine,
 | 
			
		||||
				exportURL: exportProductionLineExcel,
 | 
			
		||||
			},
 | 
			
		||||
			tableProps,
 | 
			
		||||
			tableBtn: [
 | 
			
		||||
				this.$auth.hasPermi(`base:production-line:update`)
 | 
			
		||||
					? {
 | 
			
		||||
							type: 'edit',
 | 
			
		||||
							btnName: '编辑',
 | 
			
		||||
					  }
 | 
			
		||||
					: undefined,
 | 
			
		||||
				this.$auth.hasPermi(`base:production-line:delete`)
 | 
			
		||||
					? {
 | 
			
		||||
							type: 'delete',
 | 
			
		||||
							btnName: '删除',
 | 
			
		||||
					  }
 | 
			
		||||
					: undefined,
 | 
			
		||||
			].filter((v) => v),
 | 
			
		||||
			tableData: [],
 | 
			
		||||
			formConfig: [
 | 
			
		||||
				{
 | 
			
		||||
					type: 'input',
 | 
			
		||||
					label: '产线名称',
 | 
			
		||||
					placeholder: '产线名称',
 | 
			
		||||
					param: 'name',
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					type: 'button',
 | 
			
		||||
					btnName: '搜索',
 | 
			
		||||
					name: 'search',
 | 
			
		||||
					color: 'primary',
 | 
			
		||||
				},
 | 
			
		||||
				// {
 | 
			
		||||
				// 	type: 'separate',
 | 
			
		||||
				// },
 | 
			
		||||
				// {
 | 
			
		||||
				// 	type: 'button',
 | 
			
		||||
				// 	btnName: '重置',
 | 
			
		||||
				// 	name: 'reset',
 | 
			
		||||
				// },
 | 
			
		||||
				{
 | 
			
		||||
					type: 'separate',
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					type: this.$auth.hasPermi('base:production-line:create')
 | 
			
		||||
						? 'button'
 | 
			
		||||
						: '',
 | 
			
		||||
					btnName: '新增',
 | 
			
		||||
					name: 'add',
 | 
			
		||||
					color: 'success',
 | 
			
		||||
					plain: true,
 | 
			
		||||
				},
 | 
			
		||||
				// {
 | 
			
		||||
				// 	type: this.$auth.hasPermi('base:production-line:create') ? 'separate' : '',
 | 
			
		||||
				// },
 | 
			
		||||
				// {
 | 
			
		||||
				// 	type: this.$auth.hasPermi('base:production-line:export') ? 'button' : '',
 | 
			
		||||
				// 	btnName: '导出',
 | 
			
		||||
				// 	name: 'export',
 | 
			
		||||
				// 	color: 'warning',
 | 
			
		||||
				// },
 | 
			
		||||
			],
 | 
			
		||||
		};
 | 
			
		||||
	},
 | 
			
		||||
	components: {
 | 
			
		||||
		AddOrUpdate,
 | 
			
		||||
	},
 | 
			
		||||
	created() {},
 | 
			
		||||
	methods: {
 | 
			
		||||
		// 获取数据列表
 | 
			
		||||
		getDataList() {
 | 
			
		||||
			this.dataListLoading = true;
 | 
			
		||||
			this.urlOptions.getDataListURL(this.listQuery).then((response) => {
 | 
			
		||||
				this.listQuery.total = response.data.total;
 | 
			
		||||
				this.getStatus(response.data.list);
 | 
			
		||||
				this.dataListLoading = false;
 | 
			
		||||
			});
 | 
			
		||||
		},
 | 
			
		||||
		getStatus(list) {
 | 
			
		||||
			const ids = list.map((i) => {
 | 
			
		||||
				return i.id;
 | 
			
		||||
			});
 | 
			
		||||
			getStatus(ids).then((response) => {
 | 
			
		||||
				response.forEach((a) => {
 | 
			
		||||
					list.forEach((b) => {
 | 
			
		||||
						if (b.id === a.id) b.status = a.status;
 | 
			
		||||
					});
 | 
			
		||||
				});
 | 
			
		||||
				this.tableData = list;
 | 
			
		||||
			});
 | 
			
		||||
		},
 | 
			
		||||
		buttonClick(val) {
 | 
			
		||||
			switch (val.btnName) {
 | 
			
		||||
				case 'search':
 | 
			
		||||
					this.listQuery.pageNo = 1;
 | 
			
		||||
					this.listQuery.pageSize = 10;
 | 
			
		||||
					this.listQuery.name = val.name;
 | 
			
		||||
					this.getDataList();
 | 
			
		||||
					break;
 | 
			
		||||
				case 'reset':
 | 
			
		||||
					this.$refs.searchBarForm.resetForm();
 | 
			
		||||
					this.listQuery = {
 | 
			
		||||
						pageSize: 10,
 | 
			
		||||
						pageNo: 1,
 | 
			
		||||
						total: 1,
 | 
			
		||||
					};
 | 
			
		||||
					this.getDataList();
 | 
			
		||||
					break;
 | 
			
		||||
				case 'add':
 | 
			
		||||
					this.addOrEditTitle = '新增';
 | 
			
		||||
					this.addOrUpdateVisible = true;
 | 
			
		||||
					this.addOrUpdateHandle();
 | 
			
		||||
					break;
 | 
			
		||||
				case 'export':
 | 
			
		||||
					this.handleExport();
 | 
			
		||||
					break;
 | 
			
		||||
				default:
 | 
			
		||||
					console.log(val);
 | 
			
		||||
			}
 | 
			
		||||
		},
 | 
			
		||||
	},
 | 
			
		||||
};
 | 
			
		||||
</script>
 | 
			
		||||
							
								
								
									
										271
									
								
								src/views/core/oldBase/productionLineRecDay/index.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										271
									
								
								src/views/core/oldBase/productionLineRecDay/index.vue
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,271 @@
 | 
			
		||||
<template>
 | 
			
		||||
  <div class="app-container">
 | 
			
		||||
 | 
			
		||||
    <!-- 搜索工作栏 -->
 | 
			
		||||
    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
 | 
			
		||||
      <el-form-item label="产线id" prop="productionLineId">
 | 
			
		||||
        <el-input v-model="queryParams.productionLineId" placeholder="请输入产线id" clearable @keyup.enter.native="handleQuery"/>
 | 
			
		||||
      </el-form-item>
 | 
			
		||||
      <el-form-item label="上一次记录时间至该条记录时间段内上片数量" prop="inputNum">
 | 
			
		||||
        <el-input v-model="queryParams.inputNum" placeholder="请输入上一次记录时间至该条记录时间段内上片数量" clearable @keyup.enter.native="handleQuery"/>
 | 
			
		||||
      </el-form-item>
 | 
			
		||||
      <el-form-item label="上一次记录时间至该条记录时间段内下片数量" prop="outputNum">
 | 
			
		||||
        <el-input v-model="queryParams.outputNum" placeholder="请输入上一次记录时间至该条记录时间段内下片数量" clearable @keyup.enter.native="handleQuery"/>
 | 
			
		||||
      </el-form-item>
 | 
			
		||||
      <el-form-item label="该记录时间点的累计上片数量" prop="sumInputNum">
 | 
			
		||||
        <el-input v-model="queryParams.sumInputNum" placeholder="请输入该记录时间点的累计上片数量" clearable @keyup.enter.native="handleQuery"/>
 | 
			
		||||
      </el-form-item>
 | 
			
		||||
      <el-form-item label="该记录时间点的累计下片数量" prop="sumOutputNum">
 | 
			
		||||
        <el-input v-model="queryParams.sumOutputNum" placeholder="请输入该记录时间点的累计下片数量" clearable @keyup.enter.native="handleQuery"/>
 | 
			
		||||
      </el-form-item>
 | 
			
		||||
      <el-form-item label="记录时间" prop="recordTime">
 | 
			
		||||
        <el-date-picker v-model="queryParams.recordTime" style="width: 240px" value-format="yyyy-MM-dd HH:mm:ss" type="daterange"
 | 
			
		||||
                        range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期" :default-time="['00:00:00', '23:59:59']" />
 | 
			
		||||
      </el-form-item>
 | 
			
		||||
      <el-form-item label="合格率(%)" prop="passRate">
 | 
			
		||||
        <el-input v-model="queryParams.passRate" placeholder="请输入合格率(%)" clearable @keyup.enter.native="handleQuery"/>
 | 
			
		||||
      </el-form-item>
 | 
			
		||||
      <el-form-item label="创建时间" prop="createTime">
 | 
			
		||||
        <el-date-picker v-model="queryParams.createTime" style="width: 240px" value-format="yyyy-MM-dd HH:mm:ss" type="daterange"
 | 
			
		||||
                        range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期" :default-time="['00:00:00', '23:59:59']" />
 | 
			
		||||
      </el-form-item>
 | 
			
		||||
      <el-form-item>
 | 
			
		||||
        <el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button>
 | 
			
		||||
        <el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button>
 | 
			
		||||
      </el-form-item>
 | 
			
		||||
    </el-form>
 | 
			
		||||
 | 
			
		||||
    <!-- 操作工具栏 -->
 | 
			
		||||
    <el-row :gutter="10" class="mb8">
 | 
			
		||||
      <el-col :span="1.5">
 | 
			
		||||
        <el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd"
 | 
			
		||||
                   v-hasPermi="['base:production-line-rec-day:create']">新增</el-button>
 | 
			
		||||
      </el-col>
 | 
			
		||||
      <el-col :span="1.5">
 | 
			
		||||
        <el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport" :loading="exportLoading"
 | 
			
		||||
                   v-hasPermi="['base:production-line-rec-day:export']">导出</el-button>
 | 
			
		||||
      </el-col>
 | 
			
		||||
      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
 | 
			
		||||
    </el-row>
 | 
			
		||||
 | 
			
		||||
    <!-- 列表 -->
 | 
			
		||||
    <el-table v-loading="loading" :data="list">
 | 
			
		||||
      <el-table-column label="ID" align="center" prop="id" />
 | 
			
		||||
      <el-table-column label="产线id" align="center" prop="productionLineId" />
 | 
			
		||||
      <el-table-column label="上一次记录时间至该条记录时间段内上片数量" align="center" prop="inputNum" />
 | 
			
		||||
      <el-table-column label="上一次记录时间至该条记录时间段内下片数量" align="center" prop="outputNum" />
 | 
			
		||||
      <el-table-column label="该记录时间点的累计上片数量" align="center" prop="sumInputNum" />
 | 
			
		||||
      <el-table-column label="该记录时间点的累计下片数量" align="center" prop="sumOutputNum" />
 | 
			
		||||
      <el-table-column label="记录时间" align="center" prop="recordTime" width="180">
 | 
			
		||||
        <template v-slot="scope">
 | 
			
		||||
          <span>{{ parseTime(scope.row.recordTime) }}</span>
 | 
			
		||||
        </template>
 | 
			
		||||
      </el-table-column>
 | 
			
		||||
      <el-table-column label="合格率(%)" align="center" prop="passRate" />
 | 
			
		||||
      <el-table-column label="创建时间" align="center" prop="createTime" width="180">
 | 
			
		||||
        <template v-slot="scope">
 | 
			
		||||
          <span>{{ parseTime(scope.row.createTime) }}</span>
 | 
			
		||||
        </template>
 | 
			
		||||
      </el-table-column>
 | 
			
		||||
      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
 | 
			
		||||
        <template v-slot="scope">
 | 
			
		||||
          <el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)"
 | 
			
		||||
                     v-hasPermi="['base:production-line-rec-day:update']">修改</el-button>
 | 
			
		||||
          <el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"
 | 
			
		||||
                     v-hasPermi="['base:production-line-rec-day:delete']">删除</el-button>
 | 
			
		||||
        </template>
 | 
			
		||||
      </el-table-column>
 | 
			
		||||
    </el-table>
 | 
			
		||||
    <!-- 分页组件 -->
 | 
			
		||||
    <pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize"
 | 
			
		||||
                @pagination="getList"/>
 | 
			
		||||
 | 
			
		||||
    <!-- 对话框(添加 / 修改) -->
 | 
			
		||||
    <el-dialog :title="title" :visible.sync="open" width="500px" v-dialogDrag append-to-body>
 | 
			
		||||
      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
 | 
			
		||||
        <el-form-item label="产线id" prop="productionLineId">
 | 
			
		||||
          <el-input v-model="form.productionLineId" placeholder="请输入产线id" />
 | 
			
		||||
        </el-form-item>
 | 
			
		||||
        <el-form-item label="上一次记录时间至该条记录时间段内上片数量" prop="inputNum">
 | 
			
		||||
          <el-input v-model="form.inputNum" placeholder="请输入上一次记录时间至该条记录时间段内上片数量" />
 | 
			
		||||
        </el-form-item>
 | 
			
		||||
        <el-form-item label="上一次记录时间至该条记录时间段内下片数量" prop="outputNum">
 | 
			
		||||
          <el-input v-model="form.outputNum" placeholder="请输入上一次记录时间至该条记录时间段内下片数量" />
 | 
			
		||||
        </el-form-item>
 | 
			
		||||
        <el-form-item label="该记录时间点的累计上片数量" prop="sumInputNum">
 | 
			
		||||
          <el-input v-model="form.sumInputNum" placeholder="请输入该记录时间点的累计上片数量" />
 | 
			
		||||
        </el-form-item>
 | 
			
		||||
        <el-form-item label="该记录时间点的累计下片数量" prop="sumOutputNum">
 | 
			
		||||
          <el-input v-model="form.sumOutputNum" placeholder="请输入该记录时间点的累计下片数量" />
 | 
			
		||||
        </el-form-item>
 | 
			
		||||
        <el-form-item label="记录时间" prop="recordTime">
 | 
			
		||||
          <el-date-picker clearable v-model="form.recordTime" type="date" value-format="timestamp" placeholder="选择记录时间" />
 | 
			
		||||
        </el-form-item>
 | 
			
		||||
        <el-form-item label="合格率(%)" prop="passRate">
 | 
			
		||||
          <el-input v-model="form.passRate" placeholder="请输入合格率(%)" />
 | 
			
		||||
        </el-form-item>
 | 
			
		||||
      </el-form>
 | 
			
		||||
      <div slot="footer" class="dialog-footer">
 | 
			
		||||
        <el-button type="primary" @click="submitForm">确 定</el-button>
 | 
			
		||||
        <el-button @click="cancel">取 消</el-button>
 | 
			
		||||
      </div>
 | 
			
		||||
    </el-dialog>
 | 
			
		||||
  </div>
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script>
 | 
			
		||||
import { createProductionLineRecDay, updateProductionLineRecDay, deleteProductionLineRecDay, getProductionLineRecDay, getProductionLineRecDayPage, exportProductionLineRecDayExcel } from "@/api/core/base/productionLineRecDay";
 | 
			
		||||
 | 
			
		||||
export default {
 | 
			
		||||
  name: "ProductionLineRecDay",
 | 
			
		||||
  components: {
 | 
			
		||||
  },
 | 
			
		||||
  data() {
 | 
			
		||||
    return {
 | 
			
		||||
      // 遮罩层
 | 
			
		||||
      loading: true,
 | 
			
		||||
      // 导出遮罩层
 | 
			
		||||
      exportLoading: false,
 | 
			
		||||
      // 显示搜索条件
 | 
			
		||||
      showSearch: true,
 | 
			
		||||
      // 总条数
 | 
			
		||||
      total: 0,
 | 
			
		||||
      // 产线生产定时记录表 一天添加一次数据列表
 | 
			
		||||
      list: [],
 | 
			
		||||
      // 弹出层标题
 | 
			
		||||
      title: "",
 | 
			
		||||
      // 是否显示弹出层
 | 
			
		||||
      open: false,
 | 
			
		||||
      // 查询参数
 | 
			
		||||
      queryParams: {
 | 
			
		||||
        pageNo: 1,
 | 
			
		||||
        pageSize: 10,
 | 
			
		||||
        productionLineId: null,
 | 
			
		||||
        inputNum: null,
 | 
			
		||||
        outputNum: null,
 | 
			
		||||
        sumInputNum: null,
 | 
			
		||||
        sumOutputNum: null,
 | 
			
		||||
        recordTime: [],
 | 
			
		||||
        passRate: null,
 | 
			
		||||
        createTime: [],
 | 
			
		||||
      },
 | 
			
		||||
      // 表单参数
 | 
			
		||||
      form: {},
 | 
			
		||||
      // 表单校验
 | 
			
		||||
      rules: {
 | 
			
		||||
        inputNum: [{ required: true, message: "上一次记录时间至该条记录时间段内上片数量不能为空", trigger: "blur" }],
 | 
			
		||||
        outputNum: [{ required: true, message: "上一次记录时间至该条记录时间段内下片数量不能为空", trigger: "blur" }],
 | 
			
		||||
        sumInputNum: [{ required: true, message: "该记录时间点的累计上片数量不能为空", trigger: "blur" }],
 | 
			
		||||
        sumOutputNum: [{ required: true, message: "该记录时间点的累计下片数量不能为空", trigger: "blur" }],
 | 
			
		||||
      }
 | 
			
		||||
    };
 | 
			
		||||
  },
 | 
			
		||||
  created() {
 | 
			
		||||
    this.getList();
 | 
			
		||||
  },
 | 
			
		||||
  methods: {
 | 
			
		||||
    /** 查询列表 */
 | 
			
		||||
    getList() {
 | 
			
		||||
      this.loading = true;
 | 
			
		||||
      // 执行查询
 | 
			
		||||
      getProductionLineRecDayPage(this.queryParams).then(response => {
 | 
			
		||||
        this.list = response.data.list;
 | 
			
		||||
        this.total = response.data.total;
 | 
			
		||||
        this.loading = false;
 | 
			
		||||
      });
 | 
			
		||||
    },
 | 
			
		||||
    /** 取消按钮 */
 | 
			
		||||
    cancel() {
 | 
			
		||||
      this.open = false;
 | 
			
		||||
      this.reset();
 | 
			
		||||
    },
 | 
			
		||||
    /** 表单重置 */
 | 
			
		||||
    reset() {
 | 
			
		||||
      this.form = {
 | 
			
		||||
        id: undefined,
 | 
			
		||||
        productionLineId: undefined,
 | 
			
		||||
        inputNum: undefined,
 | 
			
		||||
        outputNum: undefined,
 | 
			
		||||
        sumInputNum: undefined,
 | 
			
		||||
        sumOutputNum: undefined,
 | 
			
		||||
        recordTime: undefined,
 | 
			
		||||
        passRate: undefined,
 | 
			
		||||
      };
 | 
			
		||||
      this.resetForm("form");
 | 
			
		||||
    },
 | 
			
		||||
    /** 搜索按钮操作 */
 | 
			
		||||
    handleQuery() {
 | 
			
		||||
      this.queryParams.pageNo = 1;
 | 
			
		||||
      this.getList();
 | 
			
		||||
    },
 | 
			
		||||
    /** 重置按钮操作 */
 | 
			
		||||
    resetQuery() {
 | 
			
		||||
      this.resetForm("queryForm");
 | 
			
		||||
      this.handleQuery();
 | 
			
		||||
    },
 | 
			
		||||
    /** 新增按钮操作 */
 | 
			
		||||
    handleAdd() {
 | 
			
		||||
      this.reset();
 | 
			
		||||
      this.open = true;
 | 
			
		||||
      this.title = "添加产线生产定时记录表 一天添加一次数据";
 | 
			
		||||
    },
 | 
			
		||||
    /** 修改按钮操作 */
 | 
			
		||||
    handleUpdate(row) {
 | 
			
		||||
      this.reset();
 | 
			
		||||
      const id = row.id;
 | 
			
		||||
      getProductionLineRecDay(id).then(response => {
 | 
			
		||||
        this.form = response.data;
 | 
			
		||||
        this.open = true;
 | 
			
		||||
        this.title = "修改产线生产定时记录表 一天添加一次数据";
 | 
			
		||||
      });
 | 
			
		||||
    },
 | 
			
		||||
    /** 提交按钮 */
 | 
			
		||||
    submitForm() {
 | 
			
		||||
      this.$refs["form"].validate(valid => {
 | 
			
		||||
        if (!valid) {
 | 
			
		||||
          return;
 | 
			
		||||
        }
 | 
			
		||||
        // 修改的提交
 | 
			
		||||
        if (this.form.id != null) {
 | 
			
		||||
          updateProductionLineRecDay(this.form).then(response => {
 | 
			
		||||
            this.$modal.msgSuccess("修改成功");
 | 
			
		||||
            this.open = false;
 | 
			
		||||
            this.getList();
 | 
			
		||||
          });
 | 
			
		||||
          return;
 | 
			
		||||
        }
 | 
			
		||||
        // 添加的提交
 | 
			
		||||
        createProductionLineRecDay(this.form).then(response => {
 | 
			
		||||
          this.$modal.msgSuccess("新增成功");
 | 
			
		||||
          this.open = false;
 | 
			
		||||
          this.getList();
 | 
			
		||||
        });
 | 
			
		||||
      });
 | 
			
		||||
    },
 | 
			
		||||
    /** 删除按钮操作 */
 | 
			
		||||
    handleDelete(row) {
 | 
			
		||||
      const id = row.id;
 | 
			
		||||
      this.$modal.confirm('是否确认删除产线生产定时记录表 一天添加一次数据编号为"' + id + '"的数据项?').then(function() {
 | 
			
		||||
          return deleteProductionLineRecDay(id);
 | 
			
		||||
        }).then(() => {
 | 
			
		||||
          this.getList();
 | 
			
		||||
          this.$modal.msgSuccess("删除成功");
 | 
			
		||||
        }).catch(() => {});
 | 
			
		||||
    },
 | 
			
		||||
    /** 导出按钮操作 */
 | 
			
		||||
    handleExport() {
 | 
			
		||||
      // 处理查询参数
 | 
			
		||||
      let params = {...this.queryParams};
 | 
			
		||||
      params.pageNo = undefined;
 | 
			
		||||
      params.pageSize = undefined;
 | 
			
		||||
      this.$modal.confirm('是否确认导出所有产线生产定时记录表 一天添加一次数据数据项?').then(() => {
 | 
			
		||||
          this.exportLoading = true;
 | 
			
		||||
          return exportProductionLineRecDayExcel(params);
 | 
			
		||||
        }).then(response => {
 | 
			
		||||
          this.$download.excel(response, '产线生产定时记录表 一天添加一次数据.xls');
 | 
			
		||||
          this.exportLoading = false;
 | 
			
		||||
        }).catch(() => {});
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
};
 | 
			
		||||
</script>
 | 
			
		||||
							
								
								
									
										271
									
								
								src/views/core/oldBase/productionLineRecSch/index.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										271
									
								
								src/views/core/oldBase/productionLineRecSch/index.vue
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,271 @@
 | 
			
		||||
<template>
 | 
			
		||||
  <div class="app-container">
 | 
			
		||||
 | 
			
		||||
    <!-- 搜索工作栏 -->
 | 
			
		||||
    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
 | 
			
		||||
      <el-form-item label="产线id" prop="productionLineId">
 | 
			
		||||
        <el-input v-model="queryParams.productionLineId" placeholder="请输入产线id" clearable @keyup.enter.native="handleQuery"/>
 | 
			
		||||
      </el-form-item>
 | 
			
		||||
      <el-form-item label="上一次记录时间至该条记录时间端内上片数量" prop="inputNum">
 | 
			
		||||
        <el-input v-model="queryParams.inputNum" placeholder="请输入上一次记录时间至该条记录时间端内上片数量" clearable @keyup.enter.native="handleQuery"/>
 | 
			
		||||
      </el-form-item>
 | 
			
		||||
      <el-form-item label="上一次记录时间至该条记录时间端内下片数量" prop="outputNum">
 | 
			
		||||
        <el-input v-model="queryParams.outputNum" placeholder="请输入上一次记录时间至该条记录时间端内下片数量" clearable @keyup.enter.native="handleQuery"/>
 | 
			
		||||
      </el-form-item>
 | 
			
		||||
      <el-form-item label="该记录时间点的累计上片数量" prop="sumInputNum">
 | 
			
		||||
        <el-input v-model="queryParams.sumInputNum" placeholder="请输入该记录时间点的累计上片数量" clearable @keyup.enter.native="handleQuery"/>
 | 
			
		||||
      </el-form-item>
 | 
			
		||||
      <el-form-item label="该记录时间点的累计下片数量" prop="sumOutputNum">
 | 
			
		||||
        <el-input v-model="queryParams.sumOutputNum" placeholder="请输入该记录时间点的累计下片数量" clearable @keyup.enter.native="handleQuery"/>
 | 
			
		||||
      </el-form-item>
 | 
			
		||||
      <el-form-item label="记录时间" prop="recordTime">
 | 
			
		||||
        <el-date-picker v-model="queryParams.recordTime" style="width: 240px" value-format="yyyy-MM-dd HH:mm:ss" type="daterange"
 | 
			
		||||
                        range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期" :default-time="['00:00:00', '23:59:59']" />
 | 
			
		||||
      </el-form-item>
 | 
			
		||||
      <el-form-item label="合格率(%)" prop="passRate">
 | 
			
		||||
        <el-input v-model="queryParams.passRate" placeholder="请输入合格率(%)" clearable @keyup.enter.native="handleQuery"/>
 | 
			
		||||
      </el-form-item>
 | 
			
		||||
      <el-form-item label="创建时间" prop="createTime">
 | 
			
		||||
        <el-date-picker v-model="queryParams.createTime" style="width: 240px" value-format="yyyy-MM-dd HH:mm:ss" type="daterange"
 | 
			
		||||
                        range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期" :default-time="['00:00:00', '23:59:59']" />
 | 
			
		||||
      </el-form-item>
 | 
			
		||||
      <el-form-item>
 | 
			
		||||
        <el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button>
 | 
			
		||||
        <el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button>
 | 
			
		||||
      </el-form-item>
 | 
			
		||||
    </el-form>
 | 
			
		||||
 | 
			
		||||
    <!-- 操作工具栏 -->
 | 
			
		||||
    <el-row :gutter="10" class="mb8">
 | 
			
		||||
      <el-col :span="1.5">
 | 
			
		||||
        <el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd"
 | 
			
		||||
                   v-hasPermi="['base:production-line-rec-sch:create']">新增</el-button>
 | 
			
		||||
      </el-col>
 | 
			
		||||
      <el-col :span="1.5">
 | 
			
		||||
        <el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport" :loading="exportLoading"
 | 
			
		||||
                   v-hasPermi="['base:production-line-rec-sch:export']">导出</el-button>
 | 
			
		||||
      </el-col>
 | 
			
		||||
      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
 | 
			
		||||
    </el-row>
 | 
			
		||||
 | 
			
		||||
    <!-- 列表 -->
 | 
			
		||||
    <el-table v-loading="loading" :data="list">
 | 
			
		||||
      <el-table-column label="ID" align="center" prop="id" />
 | 
			
		||||
      <el-table-column label="产线id" align="center" prop="productionLineId" />
 | 
			
		||||
      <el-table-column label="上一次记录时间至该条记录时间端内上片数量" align="center" prop="inputNum" />
 | 
			
		||||
      <el-table-column label="上一次记录时间至该条记录时间端内下片数量" align="center" prop="outputNum" />
 | 
			
		||||
      <el-table-column label="该记录时间点的累计上片数量" align="center" prop="sumInputNum" />
 | 
			
		||||
      <el-table-column label="该记录时间点的累计下片数量" align="center" prop="sumOutputNum" />
 | 
			
		||||
      <el-table-column label="记录时间" align="center" prop="recordTime" width="180">
 | 
			
		||||
        <template v-slot="scope">
 | 
			
		||||
          <span>{{ parseTime(scope.row.recordTime) }}</span>
 | 
			
		||||
        </template>
 | 
			
		||||
      </el-table-column>
 | 
			
		||||
      <el-table-column label="合格率(%)" align="center" prop="passRate" />
 | 
			
		||||
      <el-table-column label="创建时间" align="center" prop="createTime" width="180">
 | 
			
		||||
        <template v-slot="scope">
 | 
			
		||||
          <span>{{ parseTime(scope.row.createTime) }}</span>
 | 
			
		||||
        </template>
 | 
			
		||||
      </el-table-column>
 | 
			
		||||
      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
 | 
			
		||||
        <template v-slot="scope">
 | 
			
		||||
          <el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)"
 | 
			
		||||
                     v-hasPermi="['base:production-line-rec-sch:update']">修改</el-button>
 | 
			
		||||
          <el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"
 | 
			
		||||
                     v-hasPermi="['base:production-line-rec-sch:delete']">删除</el-button>
 | 
			
		||||
        </template>
 | 
			
		||||
      </el-table-column>
 | 
			
		||||
    </el-table>
 | 
			
		||||
    <!-- 分页组件 -->
 | 
			
		||||
    <pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize"
 | 
			
		||||
                @pagination="getList"/>
 | 
			
		||||
 | 
			
		||||
    <!-- 对话框(添加 / 修改) -->
 | 
			
		||||
    <el-dialog :title="title" :visible.sync="open" width="500px" v-dialogDrag append-to-body>
 | 
			
		||||
      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
 | 
			
		||||
        <el-form-item label="产线id" prop="productionLineId">
 | 
			
		||||
          <el-input v-model="form.productionLineId" placeholder="请输入产线id" />
 | 
			
		||||
        </el-form-item>
 | 
			
		||||
        <el-form-item label="上一次记录时间至该条记录时间端内上片数量" prop="inputNum">
 | 
			
		||||
          <el-input v-model="form.inputNum" placeholder="请输入上一次记录时间至该条记录时间端内上片数量" />
 | 
			
		||||
        </el-form-item>
 | 
			
		||||
        <el-form-item label="上一次记录时间至该条记录时间端内下片数量" prop="outputNum">
 | 
			
		||||
          <el-input v-model="form.outputNum" placeholder="请输入上一次记录时间至该条记录时间端内下片数量" />
 | 
			
		||||
        </el-form-item>
 | 
			
		||||
        <el-form-item label="该记录时间点的累计上片数量" prop="sumInputNum">
 | 
			
		||||
          <el-input v-model="form.sumInputNum" placeholder="请输入该记录时间点的累计上片数量" />
 | 
			
		||||
        </el-form-item>
 | 
			
		||||
        <el-form-item label="该记录时间点的累计下片数量" prop="sumOutputNum">
 | 
			
		||||
          <el-input v-model="form.sumOutputNum" placeholder="请输入该记录时间点的累计下片数量" />
 | 
			
		||||
        </el-form-item>
 | 
			
		||||
        <el-form-item label="记录时间" prop="recordTime">
 | 
			
		||||
          <el-date-picker clearable v-model="form.recordTime" type="date" value-format="timestamp" placeholder="选择记录时间" />
 | 
			
		||||
        </el-form-item>
 | 
			
		||||
        <el-form-item label="合格率(%)" prop="passRate">
 | 
			
		||||
          <el-input v-model="form.passRate" placeholder="请输入合格率(%)" />
 | 
			
		||||
        </el-form-item>
 | 
			
		||||
      </el-form>
 | 
			
		||||
      <div slot="footer" class="dialog-footer">
 | 
			
		||||
        <el-button type="primary" @click="submitForm">确 定</el-button>
 | 
			
		||||
        <el-button @click="cancel">取 消</el-button>
 | 
			
		||||
      </div>
 | 
			
		||||
    </el-dialog>
 | 
			
		||||
  </div>
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script>
 | 
			
		||||
import { createProductionLineRecSch, updateProductionLineRecSch, deleteProductionLineRecSch, getProductionLineRecSch, getProductionLineRecSchPage, exportProductionLineRecSchExcel } from "@/api/core/base/productionLineRecSch";
 | 
			
		||||
 | 
			
		||||
export default {
 | 
			
		||||
  name: "ProductionLineRecSch",
 | 
			
		||||
  components: {
 | 
			
		||||
  },
 | 
			
		||||
  data() {
 | 
			
		||||
    return {
 | 
			
		||||
      // 遮罩层
 | 
			
		||||
      loading: true,
 | 
			
		||||
      // 导出遮罩层
 | 
			
		||||
      exportLoading: false,
 | 
			
		||||
      // 显示搜索条件
 | 
			
		||||
      showSearch: true,
 | 
			
		||||
      // 总条数
 | 
			
		||||
      total: 0,
 | 
			
		||||
      // 产线生产定时记录表 一小时添加一次数据	至少需要一个上片设备和下片设备才会自动添加列表
 | 
			
		||||
      list: [],
 | 
			
		||||
      // 弹出层标题
 | 
			
		||||
      title: "",
 | 
			
		||||
      // 是否显示弹出层
 | 
			
		||||
      open: false,
 | 
			
		||||
      // 查询参数
 | 
			
		||||
      queryParams: {
 | 
			
		||||
        pageNo: 1,
 | 
			
		||||
        pageSize: 10,
 | 
			
		||||
        productionLineId: null,
 | 
			
		||||
        inputNum: null,
 | 
			
		||||
        outputNum: null,
 | 
			
		||||
        sumInputNum: null,
 | 
			
		||||
        sumOutputNum: null,
 | 
			
		||||
        recordTime: [],
 | 
			
		||||
        passRate: null,
 | 
			
		||||
        createTime: [],
 | 
			
		||||
      },
 | 
			
		||||
      // 表单参数
 | 
			
		||||
      form: {},
 | 
			
		||||
      // 表单校验
 | 
			
		||||
      rules: {
 | 
			
		||||
        inputNum: [{ required: true, message: "上一次记录时间至该条记录时间端内上片数量不能为空", trigger: "blur" }],
 | 
			
		||||
        outputNum: [{ required: true, message: "上一次记录时间至该条记录时间端内下片数量不能为空", trigger: "blur" }],
 | 
			
		||||
        sumInputNum: [{ required: true, message: "该记录时间点的累计上片数量不能为空", trigger: "blur" }],
 | 
			
		||||
        sumOutputNum: [{ required: true, message: "该记录时间点的累计下片数量不能为空", trigger: "blur" }],
 | 
			
		||||
      }
 | 
			
		||||
    };
 | 
			
		||||
  },
 | 
			
		||||
  created() {
 | 
			
		||||
    this.getList();
 | 
			
		||||
  },
 | 
			
		||||
  methods: {
 | 
			
		||||
    /** 查询列表 */
 | 
			
		||||
    getList() {
 | 
			
		||||
      this.loading = true;
 | 
			
		||||
      // 执行查询
 | 
			
		||||
      getProductionLineRecSchPage(this.queryParams).then(response => {
 | 
			
		||||
        this.list = response.data.list;
 | 
			
		||||
        this.total = response.data.total;
 | 
			
		||||
        this.loading = false;
 | 
			
		||||
      });
 | 
			
		||||
    },
 | 
			
		||||
    /** 取消按钮 */
 | 
			
		||||
    cancel() {
 | 
			
		||||
      this.open = false;
 | 
			
		||||
      this.reset();
 | 
			
		||||
    },
 | 
			
		||||
    /** 表单重置 */
 | 
			
		||||
    reset() {
 | 
			
		||||
      this.form = {
 | 
			
		||||
        id: undefined,
 | 
			
		||||
        productionLineId: undefined,
 | 
			
		||||
        inputNum: undefined,
 | 
			
		||||
        outputNum: undefined,
 | 
			
		||||
        sumInputNum: undefined,
 | 
			
		||||
        sumOutputNum: undefined,
 | 
			
		||||
        recordTime: undefined,
 | 
			
		||||
        passRate: undefined,
 | 
			
		||||
      };
 | 
			
		||||
      this.resetForm("form");
 | 
			
		||||
    },
 | 
			
		||||
    /** 搜索按钮操作 */
 | 
			
		||||
    handleQuery() {
 | 
			
		||||
      this.queryParams.pageNo = 1;
 | 
			
		||||
      this.getList();
 | 
			
		||||
    },
 | 
			
		||||
    /** 重置按钮操作 */
 | 
			
		||||
    resetQuery() {
 | 
			
		||||
      this.resetForm("queryForm");
 | 
			
		||||
      this.handleQuery();
 | 
			
		||||
    },
 | 
			
		||||
    /** 新增按钮操作 */
 | 
			
		||||
    handleAdd() {
 | 
			
		||||
      this.reset();
 | 
			
		||||
      this.open = true;
 | 
			
		||||
      this.title = "添加产线生产定时记录表 一小时添加一次数据	至少需要一个上片设备和下片设备才会自动添加";
 | 
			
		||||
    },
 | 
			
		||||
    /** 修改按钮操作 */
 | 
			
		||||
    handleUpdate(row) {
 | 
			
		||||
      this.reset();
 | 
			
		||||
      const id = row.id;
 | 
			
		||||
      getProductionLineRecSch(id).then(response => {
 | 
			
		||||
        this.form = response.data;
 | 
			
		||||
        this.open = true;
 | 
			
		||||
        this.title = "修改产线生产定时记录表 一小时添加一次数据	至少需要一个上片设备和下片设备才会自动添加";
 | 
			
		||||
      });
 | 
			
		||||
    },
 | 
			
		||||
    /** 提交按钮 */
 | 
			
		||||
    submitForm() {
 | 
			
		||||
      this.$refs["form"].validate(valid => {
 | 
			
		||||
        if (!valid) {
 | 
			
		||||
          return;
 | 
			
		||||
        }
 | 
			
		||||
        // 修改的提交
 | 
			
		||||
        if (this.form.id != null) {
 | 
			
		||||
          updateProductionLineRecSch(this.form).then(response => {
 | 
			
		||||
            this.$modal.msgSuccess("修改成功");
 | 
			
		||||
            this.open = false;
 | 
			
		||||
            this.getList();
 | 
			
		||||
          });
 | 
			
		||||
          return;
 | 
			
		||||
        }
 | 
			
		||||
        // 添加的提交
 | 
			
		||||
        createProductionLineRecSch(this.form).then(response => {
 | 
			
		||||
          this.$modal.msgSuccess("新增成功");
 | 
			
		||||
          this.open = false;
 | 
			
		||||
          this.getList();
 | 
			
		||||
        });
 | 
			
		||||
      });
 | 
			
		||||
    },
 | 
			
		||||
    /** 删除按钮操作 */
 | 
			
		||||
    handleDelete(row) {
 | 
			
		||||
      const id = row.id;
 | 
			
		||||
      this.$modal.confirm('是否确认删除产线生产定时记录表 一小时添加一次数据	至少需要一个上片设备和下片设备才会自动添加编号为"' + id + '"的数据项?').then(function() {
 | 
			
		||||
          return deleteProductionLineRecSch(id);
 | 
			
		||||
        }).then(() => {
 | 
			
		||||
          this.getList();
 | 
			
		||||
          this.$modal.msgSuccess("删除成功");
 | 
			
		||||
        }).catch(() => {});
 | 
			
		||||
    },
 | 
			
		||||
    /** 导出按钮操作 */
 | 
			
		||||
    handleExport() {
 | 
			
		||||
      // 处理查询参数
 | 
			
		||||
      let params = {...this.queryParams};
 | 
			
		||||
      params.pageNo = undefined;
 | 
			
		||||
      params.pageSize = undefined;
 | 
			
		||||
      this.$modal.confirm('是否确认导出所有产线生产定时记录表 一小时添加一次数据	至少需要一个上片设备和下片设备才会自动添加数据项?').then(() => {
 | 
			
		||||
          this.exportLoading = true;
 | 
			
		||||
          return exportProductionLineRecSchExcel(params);
 | 
			
		||||
        }).then(response => {
 | 
			
		||||
          this.$download.excel(response, '产线生产定时记录表 一小时添加一次数据	至少需要一个上片设备和下片设备才会自动添加.xls');
 | 
			
		||||
          this.exportLoading = false;
 | 
			
		||||
        }).catch(() => {});
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
};
 | 
			
		||||
</script>
 | 
			
		||||
							
								
								
									
										112
									
								
								src/views/core/oldBase/workshopSection/add-or-updata.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										112
									
								
								src/views/core/oldBase/workshopSection/add-or-updata.vue
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,112 @@
 | 
			
		||||
<!--
 | 
			
		||||
 * @Author: zwq
 | 
			
		||||
 * @Date: 2023-08-01 13:52:10
 | 
			
		||||
 * @LastEditors: DY
 | 
			
		||||
 * @LastEditTime: 2023-10-16 13:40:00
 | 
			
		||||
 * @Description:
 | 
			
		||||
-->
 | 
			
		||||
<template>
 | 
			
		||||
	<el-form
 | 
			
		||||
		:model="dataForm"
 | 
			
		||||
		:rules="dataRule"
 | 
			
		||||
		ref="dataForm"
 | 
			
		||||
		@keyup.enter.native="dataFormSubmit()"
 | 
			
		||||
		label-width="90px">
 | 
			
		||||
		<el-row :gutter="20">
 | 
			
		||||
			<el-col :span="12">
 | 
			
		||||
				<el-form-item label="工段编码" prop="code">
 | 
			
		||||
					<el-input
 | 
			
		||||
						v-model="dataForm.code"
 | 
			
		||||
						clearable
 | 
			
		||||
						placeholder="请输入工段编码" />
 | 
			
		||||
				</el-form-item>
 | 
			
		||||
			</el-col>
 | 
			
		||||
			<el-col :span="12">
 | 
			
		||||
				<el-form-item label="工段名称" prop="name">
 | 
			
		||||
					<el-input
 | 
			
		||||
						v-model="dataForm.name"
 | 
			
		||||
						clearable
 | 
			
		||||
						placeholder="请输入工段名称" />
 | 
			
		||||
				</el-form-item>
 | 
			
		||||
			</el-col>
 | 
			
		||||
		</el-row>
 | 
			
		||||
		<el-row :gutter="20">
 | 
			
		||||
			<el-col :span="12">
 | 
			
		||||
				<el-form-item prop="productionLineId" label="产线">
 | 
			
		||||
					<el-select
 | 
			
		||||
					v-model="dataForm.productionLineId" filterable clearable placeholder="请选择产线">
 | 
			
		||||
						<el-option
 | 
			
		||||
							v-for="item in urlOptions.optionArr.arr0"
 | 
			
		||||
							:key="item.id"
 | 
			
		||||
							:label="item.name"
 | 
			
		||||
							:value="item.id"
 | 
			
		||||
						>
 | 
			
		||||
						</el-option>
 | 
			
		||||
					</el-select>
 | 
			
		||||
				</el-form-item>
 | 
			
		||||
			</el-col>
 | 
			
		||||
			<el-col :span="12">
 | 
			
		||||
				<el-form-item label="排序" prop="sort">
 | 
			
		||||
					<el-input-number v-model="dataForm.sort" :min="1" :max="100" clearable placeholder="请输入排序" />
 | 
			
		||||
				</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>
 | 
			
		||||
 | 
			
		||||
<script>
 | 
			
		||||
import basicAdd from '../../mixins/basic-add';
 | 
			
		||||
import {
 | 
			
		||||
	createWorkshopSection,
 | 
			
		||||
	updateWorkshopSection,
 | 
			
		||||
	getWorkshopSection,
 | 
			
		||||
	getCode,
 | 
			
		||||
} from '@/api/core/base/workshopSection';
 | 
			
		||||
import {
 | 
			
		||||
	getProductionLinePage,
 | 
			
		||||
} from '@/api/core/base/productionLine';
 | 
			
		||||
 | 
			
		||||
export default {
 | 
			
		||||
	mixins: [basicAdd],
 | 
			
		||||
	data() {
 | 
			
		||||
		return {
 | 
			
		||||
			urlOptions: {
 | 
			
		||||
        getOption: true,
 | 
			
		||||
			  isGetCode: true,
 | 
			
		||||
        codeURL: getCode,
 | 
			
		||||
				createURL: createWorkshopSection,
 | 
			
		||||
				updateURL: updateWorkshopSection,
 | 
			
		||||
				infoURL: getWorkshopSection,
 | 
			
		||||
        optionArrUrl: [getProductionLinePage],
 | 
			
		||||
			},
 | 
			
		||||
			dataForm: {
 | 
			
		||||
				id: undefined,
 | 
			
		||||
				code: undefined,
 | 
			
		||||
				productionLineId: undefined,
 | 
			
		||||
				sort: undefined,
 | 
			
		||||
				name: undefined,
 | 
			
		||||
				remark: undefined,
 | 
			
		||||
			},
 | 
			
		||||
			dataRule: {
 | 
			
		||||
				code: [
 | 
			
		||||
					{ required: true, message: '工段编码不能为空', trigger: 'blur' },
 | 
			
		||||
				],
 | 
			
		||||
				name: [
 | 
			
		||||
					{ required: true, message: '工段名称不能为空', trigger: 'blur' },
 | 
			
		||||
				],
 | 
			
		||||
				sort: [
 | 
			
		||||
					{ required: true, message: '排序不能为空', trigger: 'blur' },
 | 
			
		||||
				],
 | 
			
		||||
        productionLineId: [
 | 
			
		||||
					{ required: true, message: '产线不能为空', trigger: 'change' },
 | 
			
		||||
				],
 | 
			
		||||
			},
 | 
			
		||||
		};
 | 
			
		||||
	},
 | 
			
		||||
	methods: {
 | 
			
		||||
	},
 | 
			
		||||
};
 | 
			
		||||
</script>
 | 
			
		||||
							
								
								
									
										182
									
								
								src/views/core/oldBase/workshopSection/index.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										182
									
								
								src/views/core/oldBase/workshopSection/index.vue
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,182 @@
 | 
			
		||||
<template>
 | 
			
		||||
	<div class="app-container">
 | 
			
		||||
		<search-bar
 | 
			
		||||
			:formConfigs="formConfig"
 | 
			
		||||
			ref="searchBarForm"
 | 
			
		||||
			@headBtnClick="buttonClick" />
 | 
			
		||||
		<base-table
 | 
			
		||||
      v-loading="dataListLoading"
 | 
			
		||||
			:table-props="tableProps"
 | 
			
		||||
			:page="listQuery.pageNo"
 | 
			
		||||
			:limit="listQuery.pageSize"
 | 
			
		||||
			:table-data="tableData">
 | 
			
		||||
			<method-btn
 | 
			
		||||
				v-if="tableBtn.length"
 | 
			
		||||
				slot="handleBtn"
 | 
			
		||||
				:width="120"
 | 
			
		||||
				label="操作"
 | 
			
		||||
				:method-list="tableBtn"
 | 
			
		||||
				@clickBtn="handleClick" />
 | 
			
		||||
		</base-table>
 | 
			
		||||
		<pagination
 | 
			
		||||
			:limit.sync="listQuery.pageSize"
 | 
			
		||||
			:page.sync="listQuery.pageNo"
 | 
			
		||||
			:total="listQuery.total"
 | 
			
		||||
			@pagination="getDataList" />
 | 
			
		||||
		<base-dialog
 | 
			
		||||
			:dialogTitle="addOrEditTitle"
 | 
			
		||||
			:dialogVisible="addOrUpdateVisible"
 | 
			
		||||
			@cancel="handleCancel"
 | 
			
		||||
			@confirm="handleConfirm"
 | 
			
		||||
			:before-close="handleCancel"
 | 
			
		||||
			width="50%">
 | 
			
		||||
			<add-or-update
 | 
			
		||||
				ref="addOrUpdate"
 | 
			
		||||
				@refreshDataList="successSubmit"></add-or-update>
 | 
			
		||||
		</base-dialog>
 | 
			
		||||
	</div>
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script>
 | 
			
		||||
import AddOrUpdate from './add-or-updata';
 | 
			
		||||
import basicPage from '../../mixins/basic-page';
 | 
			
		||||
import { parseTime } from '../../mixins/code-filter';
 | 
			
		||||
import {
 | 
			
		||||
  deleteWorkshopSection,
 | 
			
		||||
  getWorkshopSectionPage,
 | 
			
		||||
  exportWorkshopSectionExcel
 | 
			
		||||
} from "@/api/core/base/workshopSection";
 | 
			
		||||
 | 
			
		||||
const tableProps = [
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'code',
 | 
			
		||||
		label: '工段编码'
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'name',
 | 
			
		||||
		label: '工段名称'
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'productionLineName',
 | 
			
		||||
		label: '产线'
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'sort',
 | 
			
		||||
		label: '排序'
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'remark',
 | 
			
		||||
		label: '备注'
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'createTime',
 | 
			
		||||
		label: '创建时间',
 | 
			
		||||
		filter: parseTime
 | 
			
		||||
	},
 | 
			
		||||
];
 | 
			
		||||
 | 
			
		||||
export default {
 | 
			
		||||
	mixins: [basicPage],
 | 
			
		||||
	data() {
 | 
			
		||||
		return {
 | 
			
		||||
			urlOptions: {
 | 
			
		||||
				getDataListURL: getWorkshopSectionPage,
 | 
			
		||||
				deleteURL: deleteWorkshopSection,
 | 
			
		||||
				exportURL: exportWorkshopSectionExcel,
 | 
			
		||||
			},
 | 
			
		||||
			tableProps,
 | 
			
		||||
			tableBtn: [
 | 
			
		||||
				this.$auth.hasPermi(`base:workshop-section:update`)
 | 
			
		||||
					? {
 | 
			
		||||
							type: 'edit',
 | 
			
		||||
							btnName: '编辑',
 | 
			
		||||
					  }
 | 
			
		||||
					: undefined,
 | 
			
		||||
          this.$auth.hasPermi(`base:workshop-section:delete`)
 | 
			
		||||
					? {
 | 
			
		||||
							type: 'delete',
 | 
			
		||||
							btnName: '删除',
 | 
			
		||||
					  }
 | 
			
		||||
					: undefined,
 | 
			
		||||
			].filter((v)=>v),
 | 
			
		||||
			tableData: [],
 | 
			
		||||
			formConfig: [
 | 
			
		||||
				{
 | 
			
		||||
					type: 'input',
 | 
			
		||||
					label: '工段名称',
 | 
			
		||||
					placeholder: '工段名称',
 | 
			
		||||
					param: 'name',
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					type: 'button',
 | 
			
		||||
					btnName: '搜索',
 | 
			
		||||
					name: 'search',
 | 
			
		||||
					color: 'primary',
 | 
			
		||||
				},
 | 
			
		||||
				// {
 | 
			
		||||
				// 	type: 'separate',
 | 
			
		||||
				// },
 | 
			
		||||
				// {
 | 
			
		||||
				// 	type: 'button',
 | 
			
		||||
				// 	btnName: '重置',
 | 
			
		||||
				// 	name: 'reset',
 | 
			
		||||
				// },
 | 
			
		||||
				{
 | 
			
		||||
					type: 'separate',
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					type: this.$auth.hasPermi('base:workshop-section:create') ? 'button' : '',
 | 
			
		||||
					btnName: '新增',
 | 
			
		||||
					name: 'add',
 | 
			
		||||
					color: 'success',
 | 
			
		||||
					plain: true,
 | 
			
		||||
				},
 | 
			
		||||
				// {
 | 
			
		||||
				// 	type: this.$auth.hasPermi('base:workshop-section:create') ? 'separate' : '',
 | 
			
		||||
				// },
 | 
			
		||||
				// {
 | 
			
		||||
				// 	type: this.$auth.hasPermi('base:workshop-section:export') ? 'button' : '',
 | 
			
		||||
				// 	btnName: '导出',
 | 
			
		||||
				// 	name: 'export',
 | 
			
		||||
				// 	color: 'warning',
 | 
			
		||||
				// },
 | 
			
		||||
			],
 | 
			
		||||
		};
 | 
			
		||||
	},
 | 
			
		||||
	components: {
 | 
			
		||||
		AddOrUpdate,
 | 
			
		||||
	},
 | 
			
		||||
	created() {},
 | 
			
		||||
	methods: {
 | 
			
		||||
		buttonClick(val) {
 | 
			
		||||
			switch (val.btnName) {
 | 
			
		||||
				case 'search':
 | 
			
		||||
					this.listQuery.pageNo = 1;
 | 
			
		||||
					this.listQuery.pageSize = 10;
 | 
			
		||||
					this.listQuery.name = val.name;
 | 
			
		||||
					this.getDataList();
 | 
			
		||||
					break;
 | 
			
		||||
				case 'reset':
 | 
			
		||||
					this.$refs.searchBarForm.resetForm();
 | 
			
		||||
					this.listQuery = {
 | 
			
		||||
						pageSize: 10,
 | 
			
		||||
						pageNo: 1,
 | 
			
		||||
						total: 1,
 | 
			
		||||
					};
 | 
			
		||||
					this.getDataList();
 | 
			
		||||
					break;
 | 
			
		||||
				case 'add':
 | 
			
		||||
					this.addOrEditTitle = '新增';
 | 
			
		||||
					this.addOrUpdateVisible = true;
 | 
			
		||||
					this.addOrUpdateHandle();
 | 
			
		||||
					break;
 | 
			
		||||
				case 'export':
 | 
			
		||||
					this.handleExport();
 | 
			
		||||
					break;
 | 
			
		||||
				default:
 | 
			
		||||
					console.log(val);
 | 
			
		||||
			}
 | 
			
		||||
		},
 | 
			
		||||
	},
 | 
			
		||||
};
 | 
			
		||||
</script>
 | 
			
		||||
							
								
								
									
										215
									
								
								src/views/devConfig/energy/energyPlc/index.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										215
									
								
								src/views/devConfig/energy/energyPlc/index.vue
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,215 @@
 | 
			
		||||
<template>
 | 
			
		||||
	<div class="app-container">
 | 
			
		||||
		<!-- 搜索工作栏 -->
 | 
			
		||||
		<search-bar
 | 
			
		||||
			:formConfigs="formConfig"
 | 
			
		||||
			ref="searchBarForm"
 | 
			
		||||
			@headBtnClick="buttonClick" />
 | 
			
		||||
		<!-- 列表 -->
 | 
			
		||||
		<base-table
 | 
			
		||||
			:page="queryParams.pageNo"
 | 
			
		||||
			:limit="queryParams.pageSize"
 | 
			
		||||
			:table-props="tableProps"
 | 
			
		||||
			:table-data="list"
 | 
			
		||||
			:max-height="tableH">
 | 
			
		||||
			<method-btn
 | 
			
		||||
				v-if="tableBtn.length"
 | 
			
		||||
				slot="handleBtn"
 | 
			
		||||
				:width="80"
 | 
			
		||||
				label="操作"
 | 
			
		||||
				:method-list="tableBtn"
 | 
			
		||||
				@clickBtn="handleClick" />
 | 
			
		||||
		</base-table>
 | 
			
		||||
		<pagination
 | 
			
		||||
			:page.sync="queryParams.pageNo"
 | 
			
		||||
			:limit.sync="queryParams.pageSize"
 | 
			
		||||
			:total="total"
 | 
			
		||||
			@pagination="getList" />
 | 
			
		||||
		<!-- 新增 -->
 | 
			
		||||
		<base-dialog
 | 
			
		||||
			:dialogTitle="addOrEditTitle"
 | 
			
		||||
			:dialogVisible="centervisible"
 | 
			
		||||
			@cancel="handleCancel"
 | 
			
		||||
			@confirm="handleConfirm"
 | 
			
		||||
			:before-close="handleCancel">
 | 
			
		||||
			<energy-plc-add ref="energyPlc" @successSubmit="successSubmit" />
 | 
			
		||||
		</base-dialog>
 | 
			
		||||
	</div>
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script>
 | 
			
		||||
import { getEnergyPlcPage, deleteEnergyPlc } from '@/api/base/energyPlc';
 | 
			
		||||
// import { publicFormatter } from '@/utils/dict'
 | 
			
		||||
import EnergyPlcAdd from './components/energyPlcAdd.vue';
 | 
			
		||||
import tableHeightMixin from '@/mixins/tableHeightMixin';
 | 
			
		||||
const tableProps = [
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'plcTableName',
 | 
			
		||||
		label: '关联表名',
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'code',
 | 
			
		||||
		label: '关联表编码',
 | 
			
		||||
		minWidth: 150,
 | 
			
		||||
		showOverflowtooltip: true,
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'name',
 | 
			
		||||
		label: '标识名',
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'enName',
 | 
			
		||||
		label: '英文标识名',
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'collection',
 | 
			
		||||
		label: '是否采集',
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'description',
 | 
			
		||||
		label: '描述',
 | 
			
		||||
		showOverflowtooltip: true,
 | 
			
		||||
	},
 | 
			
		||||
];
 | 
			
		||||
export default {
 | 
			
		||||
	name: 'EnergyPlc',
 | 
			
		||||
	components: { EnergyPlcAdd },
 | 
			
		||||
	mixins: [tableHeightMixin],
 | 
			
		||||
	data() {
 | 
			
		||||
		return {
 | 
			
		||||
			formConfig: [
 | 
			
		||||
				{
 | 
			
		||||
					type: 'input',
 | 
			
		||||
					label: '标识名',
 | 
			
		||||
					placeholder: '标识名',
 | 
			
		||||
					param: 'name',
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					type: 'button',
 | 
			
		||||
					btnName: '查询',
 | 
			
		||||
					name: 'search',
 | 
			
		||||
					color: 'primary',
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					type: 'separate',
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					type: this.$auth.hasPermi('base:energy-plc:create') ? 'button' : '',
 | 
			
		||||
					btnName: '新增',
 | 
			
		||||
					name: 'add',
 | 
			
		||||
					color: 'success',
 | 
			
		||||
					plain: true,
 | 
			
		||||
				},
 | 
			
		||||
			],
 | 
			
		||||
			tableProps,
 | 
			
		||||
			tableBtn: [
 | 
			
		||||
				this.$auth.hasPermi('base:energy-plc:update')
 | 
			
		||||
					? {
 | 
			
		||||
							type: 'edit',
 | 
			
		||||
							btnName: '编辑',
 | 
			
		||||
					  }
 | 
			
		||||
					: undefined,
 | 
			
		||||
				this.$auth.hasPermi('base:energy-plc:delete')
 | 
			
		||||
					? {
 | 
			
		||||
							type: 'delete',
 | 
			
		||||
							btnName: '删除',
 | 
			
		||||
					  }
 | 
			
		||||
					: undefined,
 | 
			
		||||
			].filter((v) => v),
 | 
			
		||||
			collectionList: [
 | 
			
		||||
				{ value: 0, label: '否' },
 | 
			
		||||
				{ value: 1, label: '是' },
 | 
			
		||||
			],
 | 
			
		||||
			// 总条数
 | 
			
		||||
			total: 0,
 | 
			
		||||
			// 班次基础信息列表
 | 
			
		||||
			list: [],
 | 
			
		||||
			// 弹出层标题
 | 
			
		||||
			addOrEditTitle: '',
 | 
			
		||||
			// 是否显示弹出层
 | 
			
		||||
			centervisible: false,
 | 
			
		||||
			// 查询参数
 | 
			
		||||
			queryParams: {
 | 
			
		||||
				pageNo: 1,
 | 
			
		||||
				pageSize: 20,
 | 
			
		||||
				name: null,
 | 
			
		||||
			},
 | 
			
		||||
		};
 | 
			
		||||
	},
 | 
			
		||||
	created() {
 | 
			
		||||
		this.getList();
 | 
			
		||||
	},
 | 
			
		||||
	methods: {
 | 
			
		||||
		buttonClick(val) {
 | 
			
		||||
			switch (val.btnName) {
 | 
			
		||||
				case 'search':
 | 
			
		||||
					this.queryParams.pageNo = 1;
 | 
			
		||||
					this.queryParams.name = val.name;
 | 
			
		||||
					this.getList();
 | 
			
		||||
					break;
 | 
			
		||||
				default:
 | 
			
		||||
					this.addOrEditTitle = '新增';
 | 
			
		||||
					this.centervisible = true;
 | 
			
		||||
					this.$nextTick(() => {
 | 
			
		||||
						this.$refs.energyPlc.init();
 | 
			
		||||
					});
 | 
			
		||||
			}
 | 
			
		||||
		},
 | 
			
		||||
		/** 查询列表 */
 | 
			
		||||
		getList() {
 | 
			
		||||
			getEnergyPlcPage(this.queryParams).then((response) => {
 | 
			
		||||
				let arr = response.data.list || [];
 | 
			
		||||
				arr &&
 | 
			
		||||
					arr.map((item) => {
 | 
			
		||||
						this.collectionList.map((i) => {
 | 
			
		||||
							if (item.collection === i.value) {
 | 
			
		||||
								item.collection = i.label;
 | 
			
		||||
							}
 | 
			
		||||
						});
 | 
			
		||||
					});
 | 
			
		||||
				this.list = arr;
 | 
			
		||||
				this.total = response.data.total;
 | 
			
		||||
			});
 | 
			
		||||
		},
 | 
			
		||||
		handleClick(val) {
 | 
			
		||||
			switch (val.type) {
 | 
			
		||||
				case 'edit':
 | 
			
		||||
					this.addOrEditTitle = '编辑';
 | 
			
		||||
					this.$nextTick(() => {
 | 
			
		||||
						this.$refs.energyPlc.init(val.data.id);
 | 
			
		||||
					});
 | 
			
		||||
					this.centervisible = true;
 | 
			
		||||
					break;
 | 
			
		||||
				default:
 | 
			
		||||
					this.handleDelete(val.data);
 | 
			
		||||
			}
 | 
			
		||||
		},
 | 
			
		||||
		handleCancel() {
 | 
			
		||||
			this.$refs.energyPlc.formClear();
 | 
			
		||||
			this.centervisible = false;
 | 
			
		||||
			this.addOrEditTitle = '';
 | 
			
		||||
		},
 | 
			
		||||
		handleConfirm() {
 | 
			
		||||
			this.$refs.energyPlc.submitForm();
 | 
			
		||||
		},
 | 
			
		||||
		successSubmit() {
 | 
			
		||||
			this.handleCancel();
 | 
			
		||||
			this.getList();
 | 
			
		||||
		},
 | 
			
		||||
		/** 删除按钮操作 */
 | 
			
		||||
		handleDelete(row) {
 | 
			
		||||
			this.$modal
 | 
			
		||||
				.delConfirm(row.name)
 | 
			
		||||
				.then(function () {
 | 
			
		||||
					return deleteEnergyPlc(row.id);
 | 
			
		||||
				})
 | 
			
		||||
				.then(() => {
 | 
			
		||||
					this.queryParams.pageNo = 1;
 | 
			
		||||
					this.getList();
 | 
			
		||||
					this.$modal.msgSuccess('删除成功');
 | 
			
		||||
				})
 | 
			
		||||
				.catch(() => {});
 | 
			
		||||
		},
 | 
			
		||||
	},
 | 
			
		||||
};
 | 
			
		||||
</script>
 | 
			
		||||
@@ -6,37 +6,67 @@
 | 
			
		||||
-->
 | 
			
		||||
 | 
			
		||||
<template>
 | 
			
		||||
  <el-form ref="form" :model="dataForm" label-width="120px" v-loading="formLoading">
 | 
			
		||||
    <el-row :gutter="20">
 | 
			
		||||
      <el-col :span="12">
 | 
			
		||||
        <el-form-item label="产线" prop="productionLineId"
 | 
			
		||||
          :rules="[{ required: true, message: '不能为空', trigger: 'blur' }]">
 | 
			
		||||
          <el-select v-model="dataForm.productionLineId" placeholder="请选择产线" filterable
 | 
			
		||||
            @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="sectionId" :rules="[{ required: true, message: '不能为空', trigger: 'blur' }]">
 | 
			
		||||
          <el-select v-model="dataForm.sectionId" placeholder="请选择工段" filterable @change="$emit('update', dataForm)">
 | 
			
		||||
            <el-option v-for="opt in workshopSectionList" :key="opt.value" :label="opt.label" :value="opt.value" />
 | 
			
		||||
          </el-select>
 | 
			
		||||
        </el-form-item>
 | 
			
		||||
      </el-col>
 | 
			
		||||
	<el-form
 | 
			
		||||
		ref="form"
 | 
			
		||||
		:model="dataForm"
 | 
			
		||||
		label-width="110px"
 | 
			
		||||
		v-loading="formLoading">
 | 
			
		||||
		<el-row :gutter="20">
 | 
			
		||||
			<el-col :span="12">
 | 
			
		||||
				<el-form-item
 | 
			
		||||
					label="产线"
 | 
			
		||||
					prop="productionLineId"
 | 
			
		||||
					:rules="[{ required: true, message: '不能为空', trigger: 'blur' }]">
 | 
			
		||||
					<el-select
 | 
			
		||||
						v-model="dataForm.productionLineId"
 | 
			
		||||
						placeholder="请选择产线"
 | 
			
		||||
						filterable
 | 
			
		||||
						@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="sectionId"
 | 
			
		||||
					:rules="[{ required: true, message: '不能为空', trigger: 'blur' }]">
 | 
			
		||||
					<el-select
 | 
			
		||||
						v-model="dataForm.sectionId"
 | 
			
		||||
						placeholder="请选择工段"
 | 
			
		||||
						filterable
 | 
			
		||||
						@change="$emit('update', dataForm)">
 | 
			
		||||
						<el-option
 | 
			
		||||
							v-for="opt in workshopSectionList"
 | 
			
		||||
							: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="buttonId" :rules="[
 | 
			
		||||
        	{ required: true, message: '不能为空', trigger: 'blur' },
 | 
			
		||||
        	{
 | 
			
		||||
        		type: 'number',
 | 
			
		||||
        		message: '请输入整数',
 | 
			
		||||
        		trigger: 'blur',
 | 
			
		||||
        		transform: (val) => Number.isInteger(Number(val)) && Number(val),
 | 
			
		||||
        	},
 | 
			
		||||
        ]">
 | 
			
		||||
          <el-input v-model="dataForm.buttonId" @change="$emit('update', dataForm)" placeholder="请输入整数" />
 | 
			
		||||
        </el-form-item>
 | 
			
		||||
			<el-col :span="12">
 | 
			
		||||
				<el-form-item
 | 
			
		||||
					label="按钮盒识别码"
 | 
			
		||||
					prop="buttonId"
 | 
			
		||||
					:rules="[
 | 
			
		||||
						{ required: true, message: '不能为空', trigger: 'blur' },
 | 
			
		||||
						{
 | 
			
		||||
							type: 'number',
 | 
			
		||||
							message: '请输入整数',
 | 
			
		||||
							trigger: 'blur',
 | 
			
		||||
							transform: (val) => Number.isInteger(Number(val)) && Number(val),
 | 
			
		||||
						},
 | 
			
		||||
					]">
 | 
			
		||||
					<el-input
 | 
			
		||||
						v-model="dataForm.buttonId"
 | 
			
		||||
						@change="$emit('update', dataForm)"
 | 
			
		||||
						placeholder="请输入整数" />
 | 
			
		||||
				</el-form-item>
 | 
			
		||||
				<el-form-item
 | 
			
		||||
					label="产线"
 | 
			
		||||
					prop="productionLineId"
 | 
			
		||||
@@ -101,35 +131,50 @@
 | 
			
		||||
				</el-form-item>
 | 
			
		||||
			</el-col>
 | 
			
		||||
 | 
			
		||||
      <el-col :span="12">
 | 
			
		||||
        <el-form-item label="按钮值" prop="keyValue" :rules="[
 | 
			
		||||
        	{ required: true, message: '不能为空', trigger: 'blur' },
 | 
			
		||||
        	{
 | 
			
		||||
        		type: 'number',
 | 
			
		||||
        		message: '请输入100以内的整数',
 | 
			
		||||
        		trigger: 'blur',
 | 
			
		||||
        		transform: (val) =>
 | 
			
		||||
        			Number.isInteger(+val) &&
 | 
			
		||||
        			Number(val) >= 0 &&
 | 
			
		||||
        			Number(val) <= 100 &&
 | 
			
		||||
        			Number(val),
 | 
			
		||||
        	},
 | 
			
		||||
        ]">
 | 
			
		||||
          <el-input v-model="dataForm.keyValue" type="number" min="0" max="100" @change="$emit('update', dataForm)"
 | 
			
		||||
            placeholder="请输入按钮盒模式" />
 | 
			
		||||
        </el-form-item>
 | 
			
		||||
      </el-col>
 | 
			
		||||
			<el-col :span="12">
 | 
			
		||||
				<el-form-item
 | 
			
		||||
					label="按钮值"
 | 
			
		||||
					prop="keyValue"
 | 
			
		||||
					:rules="[
 | 
			
		||||
						{ required: true, message: '不能为空', trigger: 'blur' },
 | 
			
		||||
						{
 | 
			
		||||
							type: 'number',
 | 
			
		||||
							message: '请输入100以内的整数',
 | 
			
		||||
							trigger: 'blur',
 | 
			
		||||
							transform: (val) =>
 | 
			
		||||
								Number.isInteger(+val) &&
 | 
			
		||||
								Number(val) >= 0 &&
 | 
			
		||||
								Number(val) <= 100 &&
 | 
			
		||||
								Number(val),
 | 
			
		||||
						},
 | 
			
		||||
					]">
 | 
			
		||||
					<el-input
 | 
			
		||||
						v-model="dataForm.keyValue"
 | 
			
		||||
						type="number"
 | 
			
		||||
						min="0"
 | 
			
		||||
						max="100"
 | 
			
		||||
						@change="$emit('update', dataForm)"
 | 
			
		||||
						placeholder="请输入按钮盒模式" />
 | 
			
		||||
				</el-form-item>
 | 
			
		||||
			</el-col>
 | 
			
		||||
 | 
			
		||||
      <el-col :span="12">
 | 
			
		||||
        <el-form-item label="检测内容" prop="inspectionDetId">
 | 
			
		||||
          <el-select v-model="dataForm.inspectionDetId" placeholder="请选择检测内容" filterable
 | 
			
		||||
            @change="$emit('update', dataForm)">
 | 
			
		||||
            <el-option v-for="opt in inspectionDetList" :key="opt.value" :label="opt.label" :value="opt.value" />
 | 
			
		||||
          </el-select>
 | 
			
		||||
        </el-form-item>
 | 
			
		||||
      </el-col>
 | 
			
		||||
    </el-row>
 | 
			
		||||
  </el-form>
 | 
			
		||||
			<el-col :span="12">
 | 
			
		||||
				<el-form-item label="检测内容" prop="inspectionDetId">
 | 
			
		||||
					<el-select
 | 
			
		||||
						v-model="dataForm.inspectionDetId"
 | 
			
		||||
						placeholder="请选择检测内容"
 | 
			
		||||
						filterable
 | 
			
		||||
						@change="$emit('update', dataForm)">
 | 
			
		||||
						<el-option
 | 
			
		||||
							v-for="opt in inspectionDetList"
 | 
			
		||||
							:key="opt.value"
 | 
			
		||||
							:label="opt.label"
 | 
			
		||||
							:value="opt.value" />
 | 
			
		||||
					</el-select>
 | 
			
		||||
				</el-form-item>
 | 
			
		||||
			</el-col>
 | 
			
		||||
		</el-row>
 | 
			
		||||
	</el-form>
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script>
 | 
			
		||||
@@ -150,14 +195,14 @@ export default {
 | 
			
		||||
	data() {
 | 
			
		||||
		return {
 | 
			
		||||
			formLoading: true,
 | 
			
		||||
      productionLineList: [],
 | 
			
		||||
      inspectionDetList:[],
 | 
			
		||||
			productionLineList: [],
 | 
			
		||||
			inspectionDetList: [],
 | 
			
		||||
			workshopSectionList: [],
 | 
			
		||||
		};
 | 
			
		||||
	},
 | 
			
		||||
	mounted() {
 | 
			
		||||
    this.getProductionLineList()
 | 
			
		||||
    this.getQualityInspectionDetList()
 | 
			
		||||
		this.getProductionLineList();
 | 
			
		||||
		this.getQualityInspectionDetList();
 | 
			
		||||
		// this.getWorksectionList();
 | 
			
		||||
		// this.getCode('/base/equipment-group-alarm/getCode').then((code) => {
 | 
			
		||||
		// 	this.formLoading = false;
 | 
			
		||||
@@ -197,20 +242,20 @@ export default {
 | 
			
		||||
			}
 | 
			
		||||
			this.formLoading = false;
 | 
			
		||||
		},
 | 
			
		||||
    async getQualityInspectionDetList() {
 | 
			
		||||
      this.formLoading = true;
 | 
			
		||||
      const res = await this.$axios({
 | 
			
		||||
        url: '/base/quality-inspection-det/listAll',
 | 
			
		||||
        method: 'get',
 | 
			
		||||
      });
 | 
			
		||||
      if (res.code == 0) {
 | 
			
		||||
        this.inspectionDetList = res.data.map((item) => ({
 | 
			
		||||
          label: item.content,
 | 
			
		||||
          value: item.id,
 | 
			
		||||
        }));
 | 
			
		||||
      }
 | 
			
		||||
      this.formLoading = false;
 | 
			
		||||
    },
 | 
			
		||||
		async getQualityInspectionDetList() {
 | 
			
		||||
			this.formLoading = true;
 | 
			
		||||
			const res = await this.$axios({
 | 
			
		||||
				url: '/base/quality-inspection-det/listAll',
 | 
			
		||||
				method: 'get',
 | 
			
		||||
			});
 | 
			
		||||
			if (res.code == 0) {
 | 
			
		||||
				this.inspectionDetList = res.data.map((item) => ({
 | 
			
		||||
					label: item.content,
 | 
			
		||||
					value: item.id,
 | 
			
		||||
				}));
 | 
			
		||||
			}
 | 
			
		||||
			this.formLoading = false;
 | 
			
		||||
		},
 | 
			
		||||
		async getWorksectionList(id) {
 | 
			
		||||
			this.formLoading = true;
 | 
			
		||||
			const res = await this.$axios({
 | 
			
		||||
@@ -12,12 +12,13 @@
 | 
			
		||||
			:page="queryParams.pageNo"
 | 
			
		||||
			:limit="queryParams.pageSize"
 | 
			
		||||
			:table-data="list"
 | 
			
		||||
			@emitFun="handleEmitFun">
 | 
			
		||||
			@emitFun="handleEmitFun"
 | 
			
		||||
			:max-height="tableH">
 | 
			
		||||
			<method-btn
 | 
			
		||||
				v-if="tableBtn.length"
 | 
			
		||||
				slot="handleBtn"
 | 
			
		||||
				label="操作"
 | 
			
		||||
				:width="120"
 | 
			
		||||
				:width="80"
 | 
			
		||||
				fixed="right"
 | 
			
		||||
				:method-list="tableBtn"
 | 
			
		||||
				@clickBtn="handleTableBtnClick" />
 | 
			
		||||
@@ -56,10 +57,11 @@ import {
 | 
			
		||||
import basicPageMixin from '@/mixins/lb/basicPageMixin';
 | 
			
		||||
import moment from 'moment';
 | 
			
		||||
import DialogForm from './dialogForm.vue';
 | 
			
		||||
import tableHeightMixin from '@/mixins/tableHeightMixin';
 | 
			
		||||
 | 
			
		||||
export default {
 | 
			
		||||
	name: 'QualityInspectionBoxBtn',
 | 
			
		||||
	mixins: [basicPageMixin],
 | 
			
		||||
	mixins: [basicPageMixin, tableHeightMixin],
 | 
			
		||||
	components: { DialogForm },
 | 
			
		||||
	data() {
 | 
			
		||||
		return {
 | 
			
		||||
@@ -70,7 +72,9 @@ export default {
 | 
			
		||||
						label: '产线',
 | 
			
		||||
						url: '/base/production-line/listAll',
 | 
			
		||||
						prop: 'productionId',
 | 
			
		||||
						rules: [{ required: true, message: '产线不能为空', trigger: 'blur' }],
 | 
			
		||||
						rules: [
 | 
			
		||||
							{ required: true, message: '产线不能为空', trigger: 'blur' },
 | 
			
		||||
						],
 | 
			
		||||
						bind: {
 | 
			
		||||
							filterable: true,
 | 
			
		||||
						},
 | 
			
		||||
@@ -80,7 +84,9 @@ export default {
 | 
			
		||||
						label: '工段',
 | 
			
		||||
						url: '/base/workshop-section/listAll',
 | 
			
		||||
						prop: 'sectionId',
 | 
			
		||||
						rules: [{ required: true, message: '工段不能为空', trigger: 'blur' }],
 | 
			
		||||
						rules: [
 | 
			
		||||
							{ required: true, message: '工段不能为空', trigger: 'blur' },
 | 
			
		||||
						],
 | 
			
		||||
						bind: {
 | 
			
		||||
							filterable: true,
 | 
			
		||||
						},
 | 
			
		||||
@@ -118,17 +124,17 @@ export default {
 | 
			
		||||
							},
 | 
			
		||||
						],
 | 
			
		||||
						bind: { type: 'number', min: 0, max: 100 },
 | 
			
		||||
          },
 | 
			
		||||
          {
 | 
			
		||||
            select: true,
 | 
			
		||||
            label: '检测内容',
 | 
			
		||||
            url: '/base/quality-inspection-det/listAll',
 | 
			
		||||
            prop: 'inspectionDetId',
 | 
			
		||||
            rules: [{ required: true, message: '不能为空', trigger: 'blur' }],
 | 
			
		||||
            bind: {
 | 
			
		||||
              filterable: true,
 | 
			
		||||
            },
 | 
			
		||||
          },
 | 
			
		||||
					},
 | 
			
		||||
					{
 | 
			
		||||
						select: true,
 | 
			
		||||
						label: '检测内容',
 | 
			
		||||
						url: '/base/quality-inspection-det/listAll',
 | 
			
		||||
						prop: 'inspectionDetId',
 | 
			
		||||
						rules: [{ required: true, message: '不能为空', trigger: 'blur' }],
 | 
			
		||||
						bind: {
 | 
			
		||||
							filterable: true,
 | 
			
		||||
						},
 | 
			
		||||
					},
 | 
			
		||||
				],
 | 
			
		||||
			],
 | 
			
		||||
			searchBarFormConfig: [
 | 
			
		||||
@@ -180,41 +186,42 @@ export default {
 | 
			
		||||
					filter: (val) => moment(val).format('yyyy-MM-DD HH:mm:ss'),
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
          prop: 'productionLineName',
 | 
			
		||||
					prop: 'productionLineName',
 | 
			
		||||
					label: '产线',
 | 
			
		||||
					showOverflowtooltip: true,
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					prop: 'sectionName',
 | 
			
		||||
					label: '工段',
 | 
			
		||||
					showOverflowtooltip: true,
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					prop: 'inspectionDetContent',
 | 
			
		||||
					label: '检测内容',
 | 
			
		||||
					showOverflowtooltip: true,
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					width: 160,
 | 
			
		||||
					prop: 'buttonId',
 | 
			
		||||
					label: '按钮盒识别码',
 | 
			
		||||
				},
 | 
			
		||||
				// {
 | 
			
		||||
				// 	width: 256,
 | 
			
		||||
				// 	prop: 'productionId',
 | 
			
		||||
				// 	label: '按钮盒所在产线ID',
 | 
			
		||||
				// 	,
 | 
			
		||||
				// },
 | 
			
		||||
				// {
 | 
			
		||||
				// 	width: 256,
 | 
			
		||||
				// 	prop: 'sectionId',
 | 
			
		||||
				// 	label: '按钮盒所在工段ID',
 | 
			
		||||
				// 	,
 | 
			
		||||
				// },
 | 
			
		||||
				{ width: 90, prop: 'keyValue', label: '按钮值' },
 | 
			
		||||
				{ width: 128, prop: 'model', label: '按钮盒模式' },
 | 
			
		||||
				{
 | 
			
		||||
					width: 90,
 | 
			
		||||
					prop: 'keyValue',
 | 
			
		||||
					label: '按钮值',
 | 
			
		||||
					showOverflowtooltip: true,
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					width: 128,
 | 
			
		||||
					prop: 'model',
 | 
			
		||||
					label: '按钮盒模式',
 | 
			
		||||
					showOverflowtooltip: true,
 | 
			
		||||
				},
 | 
			
		||||
			],
 | 
			
		||||
			// 查询参数
 | 
			
		||||
			queryParams: {
 | 
			
		||||
				pageNo: 1,
 | 
			
		||||
				pageSize: 10,
 | 
			
		||||
				pageSize: 20,
 | 
			
		||||
				inspectionDetContent: null,
 | 
			
		||||
			},
 | 
			
		||||
			// 搜索框需要的 keys, 与上面 queryParams 的除 pageNo, pageSize 之外的 key 一一对应
 | 
			
		||||
@@ -222,8 +229,8 @@ export default {
 | 
			
		||||
			form: {
 | 
			
		||||
				id: null,
 | 
			
		||||
				buttonId: null,
 | 
			
		||||
        inspectionDetId: null,
 | 
			
		||||
        productionLineId: null,
 | 
			
		||||
				inspectionDetId: null,
 | 
			
		||||
				productionLineId: null,
 | 
			
		||||
				sectionId: null,
 | 
			
		||||
				model: null,
 | 
			
		||||
				keyValue: null,
 | 
			
		||||
@@ -261,7 +268,7 @@ export default {
 | 
			
		||||
		handleAdd() {
 | 
			
		||||
			this.reset();
 | 
			
		||||
			this.open = true;
 | 
			
		||||
			this.title = '添加安灯按钮16键对应';
 | 
			
		||||
			this.title = '新增';
 | 
			
		||||
		},
 | 
			
		||||
		/** 修改按钮操作 */
 | 
			
		||||
		handleUpdate(row) {
 | 
			
		||||
@@ -270,7 +277,7 @@ export default {
 | 
			
		||||
			getQualityInspectionBoxBtn(id).then((response) => {
 | 
			
		||||
				this.form = response.data;
 | 
			
		||||
				this.open = true;
 | 
			
		||||
				this.title = '修改安灯按钮16键对应';
 | 
			
		||||
				this.title = '编辑';
 | 
			
		||||
			});
 | 
			
		||||
		},
 | 
			
		||||
		/** 提交按钮 */
 | 
			
		||||
@@ -300,7 +307,7 @@ export default {
 | 
			
		||||
		handleDelete(row) {
 | 
			
		||||
			const id = row.id;
 | 
			
		||||
			this.$modal
 | 
			
		||||
				.confirm('是否确认删除"' + row.sectionName + '"?')
 | 
			
		||||
				.delConfirm(row.buttonId)
 | 
			
		||||
				.then(function () {
 | 
			
		||||
					return deleteQualityInspectionBoxBtn(id);
 | 
			
		||||
				})
 | 
			
		||||
@@ -1,53 +1,93 @@
 | 
			
		||||
<template>
 | 
			
		||||
  <div class="app-container">
 | 
			
		||||
    <!-- 搜索工作栏 -->
 | 
			
		||||
    <SearchBar :formConfigs="searchBarFormConfig" ref="search-bar" @headBtnClick="handleSearchBarBtnClick" />
 | 
			
		||||
	<div class="app-container">
 | 
			
		||||
		<!-- 搜索工作栏 -->
 | 
			
		||||
		<SearchBar
 | 
			
		||||
			:formConfigs="searchBarFormConfig"
 | 
			
		||||
			ref="search-bar"
 | 
			
		||||
			@headBtnClick="handleSearchBarBtnClick" />
 | 
			
		||||
 | 
			
		||||
    <!-- 列表 -->
 | 
			
		||||
    <base-table :table-props="tableProps" :page="queryParams.pageNo" :limit="queryParams.pageSize" :table-data="list"
 | 
			
		||||
      @emitFun="handleEmitFun">
 | 
			
		||||
      <method-btn v-if="tableBtn.length" slot="handleBtn" label="操作" :width="120" fixed="right" :method-list="tableBtn"
 | 
			
		||||
        @clickBtn="handleTableBtnClick" />
 | 
			
		||||
    </base-table>
 | 
			
		||||
		<!-- 列表 -->
 | 
			
		||||
		<base-table
 | 
			
		||||
			:table-props="tableProps"
 | 
			
		||||
			:page="queryParams.pageNo"
 | 
			
		||||
			:limit="queryParams.pageSize"
 | 
			
		||||
			:table-data="list"
 | 
			
		||||
			@emitFun="handleEmitFun"
 | 
			
		||||
			:max-height="tableH">
 | 
			
		||||
			<method-btn
 | 
			
		||||
				v-if="tableBtn.length"
 | 
			
		||||
				slot="handleBtn"
 | 
			
		||||
				label="操作"
 | 
			
		||||
				:width="80"
 | 
			
		||||
				fixed="right"
 | 
			
		||||
				:method-list="tableBtn"
 | 
			
		||||
				@clickBtn="handleTableBtnClick" />
 | 
			
		||||
		</base-table>
 | 
			
		||||
 | 
			
		||||
    <!-- 分页组件 -->
 | 
			
		||||
    <pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize"
 | 
			
		||||
      @pagination="getList" />
 | 
			
		||||
		<!-- 分页组件 -->
 | 
			
		||||
		<pagination
 | 
			
		||||
			v-show="total > 0"
 | 
			
		||||
			:total="total"
 | 
			
		||||
			:page.sync="queryParams.pageNo"
 | 
			
		||||
			:limit.sync="queryParams.pageSize"
 | 
			
		||||
			@pagination="getList" />
 | 
			
		||||
 | 
			
		||||
    <!-- 对话框(添加 / 修改) -->
 | 
			
		||||
    <base-dialog :dialogTitle="title" :dialogVisible="open" width="40%" @close="cancel" @cancel="cancel"
 | 
			
		||||
      @confirm="submitForm">
 | 
			
		||||
      <DialogForm v-if="open" ref="form" v-model="form" :rows="[
 | 
			
		||||
      	[
 | 
			
		||||
      		{
 | 
			
		||||
      			select: true,
 | 
			
		||||
      			label: '检测类型',
 | 
			
		||||
      			prop: 'typeId',
 | 
			
		||||
      			url: '/base/quality-inspection-type/listAll',
 | 
			
		||||
      			rules: [{ required: true, message: '检测类型不能为空', trigger: 'blur' }],
 | 
			
		||||
      			bind: {
 | 
			
		||||
      				filterable: true,
 | 
			
		||||
      			},
 | 
			
		||||
          },
 | 
			
		||||
              {
 | 
			
		||||
      			input: true,
 | 
			
		||||
      			label: '检测内容',
 | 
			
		||||
      			prop: 'content',
 | 
			
		||||
      			rules: [{ required: true, message: '检测内容不能为空', trigger: 'blur' }],
 | 
			
		||||
      		},
 | 
			
		||||
      	],
 | 
			
		||||
		<!-- 对话框(添加 / 修改) -->
 | 
			
		||||
		<base-dialog
 | 
			
		||||
			:dialogTitle="title"
 | 
			
		||||
			:dialogVisible="open"
 | 
			
		||||
			width="40%"
 | 
			
		||||
			@close="cancel"
 | 
			
		||||
			@cancel="cancel"
 | 
			
		||||
			@confirm="submitForm">
 | 
			
		||||
			<DialogForm
 | 
			
		||||
				v-if="open"
 | 
			
		||||
				ref="form"
 | 
			
		||||
				v-model="form"
 | 
			
		||||
				:rows="[
 | 
			
		||||
					[
 | 
			
		||||
						{
 | 
			
		||||
							select: true,
 | 
			
		||||
							label: '检测类型',
 | 
			
		||||
							prop: 'typeId',
 | 
			
		||||
							url: '/base/quality-inspection-type/listAll',
 | 
			
		||||
							rules: [
 | 
			
		||||
								{
 | 
			
		||||
									required: true,
 | 
			
		||||
									message: '检测类型不能为空',
 | 
			
		||||
									trigger: 'blur',
 | 
			
		||||
								},
 | 
			
		||||
							],
 | 
			
		||||
							bind: {
 | 
			
		||||
								filterable: true,
 | 
			
		||||
							},
 | 
			
		||||
						},
 | 
			
		||||
						{
 | 
			
		||||
							input: true,
 | 
			
		||||
							label: '检测内容',
 | 
			
		||||
							prop: 'content',
 | 
			
		||||
							rules: [
 | 
			
		||||
								{
 | 
			
		||||
									required: true,
 | 
			
		||||
									message: '检测内容不能为空',
 | 
			
		||||
									trigger: 'blur',
 | 
			
		||||
								},
 | 
			
		||||
							],
 | 
			
		||||
						},
 | 
			
		||||
					],
 | 
			
		||||
 | 
			
		||||
        [
 | 
			
		||||
          {
 | 
			
		||||
            input: true,
 | 
			
		||||
            label: '内容编码',
 | 
			
		||||
            prop: 'code',
 | 
			
		||||
            url: '/base/quality-inspection-det/getCode',
 | 
			
		||||
          },
 | 
			
		||||
          { input: true, label: '备注', prop: 'remark' }],
 | 
			
		||||
      ]" />
 | 
			
		||||
    </base-dialog>
 | 
			
		||||
  </div>
 | 
			
		||||
					[
 | 
			
		||||
						{
 | 
			
		||||
							input: true,
 | 
			
		||||
							label: '内容编码',
 | 
			
		||||
							prop: 'code',
 | 
			
		||||
							url: '/base/quality-inspection-det/getCode',
 | 
			
		||||
						},
 | 
			
		||||
						{ input: true, label: '备注', prop: 'remark' },
 | 
			
		||||
					],
 | 
			
		||||
				]" />
 | 
			
		||||
		</base-dialog>
 | 
			
		||||
	</div>
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script>
 | 
			
		||||
@@ -63,10 +103,11 @@ import {
 | 
			
		||||
import moment from 'moment';
 | 
			
		||||
 | 
			
		||||
import basicPageMixin from '@/mixins/lb/basicPageMixin';
 | 
			
		||||
import tableHeightMixin from '@/mixins/tableHeightMixin';
 | 
			
		||||
 | 
			
		||||
export default {
 | 
			
		||||
	name: 'QualityInspectionDet',
 | 
			
		||||
	mixins: [basicPageMixin],
 | 
			
		||||
	mixins: [basicPageMixin, tableHeightMixin],
 | 
			
		||||
	data() {
 | 
			
		||||
		return {
 | 
			
		||||
			typeList: [], // 检测类型列表
 | 
			
		||||
@@ -141,19 +182,18 @@ export default {
 | 
			
		||||
				{
 | 
			
		||||
					prop: 'createTime',
 | 
			
		||||
					label: '添加时间',
 | 
			
		||||
					fixed: true,
 | 
			
		||||
					width: 180,
 | 
			
		||||
					width: 160,
 | 
			
		||||
					filter: (val) => moment(val).format('yyyy-MM-DD HH:mm:ss'),
 | 
			
		||||
				},
 | 
			
		||||
				{ prop: 'typeName', label: '类型名称',  },
 | 
			
		||||
				{ prop: 'content', label: '检测内容',  },
 | 
			
		||||
				{ prop: 'code', label: '检测编码',  },
 | 
			
		||||
				{ prop: 'remark', label: '备注',  },
 | 
			
		||||
				{ prop: 'typeName', label: '检测类型', showOverflowtooltip: true },
 | 
			
		||||
				{ prop: 'content', label: '检测内容', showOverflowtooltip: true },
 | 
			
		||||
				{ prop: 'code', label: '检测编码', showOverflowtooltip: true },
 | 
			
		||||
				{ prop: 'remark', label: '备注', showOverflowtooltip: true },
 | 
			
		||||
			],
 | 
			
		||||
			// 查询参数
 | 
			
		||||
			queryParams: {
 | 
			
		||||
				pageNo: 1,
 | 
			
		||||
				pageSize: 10,
 | 
			
		||||
				pageSize: 20,
 | 
			
		||||
				content: null,
 | 
			
		||||
				createTime: [],
 | 
			
		||||
			},
 | 
			
		||||
@@ -248,7 +288,7 @@ export default {
 | 
			
		||||
		handleDelete(row) {
 | 
			
		||||
			const id = row.id;
 | 
			
		||||
			this.$modal
 | 
			
		||||
				.confirm('是否确认删除检测信息"' + row.content + '"?')
 | 
			
		||||
				.delConfirm(row.content)
 | 
			
		||||
				.then(function () {
 | 
			
		||||
					return deleteQualityInspectionDet(id);
 | 
			
		||||
				})
 | 
			
		||||
@@ -1,52 +1,78 @@
 | 
			
		||||
<template>
 | 
			
		||||
  <div class="app-container">
 | 
			
		||||
    <!-- 搜索工作栏 -->
 | 
			
		||||
    <SearchBar :formConfigs="searchBarFormConfig" ref="search-bar" @headBtnClick="handleSearchBarBtnClick" />
 | 
			
		||||
	<div class="app-container">
 | 
			
		||||
		<!-- 搜索工作栏 -->
 | 
			
		||||
		<SearchBar
 | 
			
		||||
			:formConfigs="searchBarFormConfig"
 | 
			
		||||
			ref="search-bar"
 | 
			
		||||
			@headBtnClick="handleSearchBarBtnClick" />
 | 
			
		||||
 | 
			
		||||
    <!-- 列表 -->
 | 
			
		||||
    <base-table :table-props="tableProps" :page="queryParams.pageNo" :limit="queryParams.pageSize" :table-data="list"
 | 
			
		||||
      @emitFun="handleEmitFun">
 | 
			
		||||
      <method-btn v-if="tableBtn.length" slot="handleBtn" label="操作" :width="120" :method-list="tableBtn"
 | 
			
		||||
        @clickBtn="handleTableBtnClick" />
 | 
			
		||||
    </base-table>
 | 
			
		||||
		<!-- 列表 -->
 | 
			
		||||
		<base-table
 | 
			
		||||
			:table-props="tableProps"
 | 
			
		||||
			:page="queryParams.pageNo"
 | 
			
		||||
			:limit="queryParams.pageSize"
 | 
			
		||||
			:table-data="list"
 | 
			
		||||
			@emitFun="handleEmitFun"
 | 
			
		||||
			:max-height="tableH">
 | 
			
		||||
			<method-btn
 | 
			
		||||
				v-if="tableBtn.length"
 | 
			
		||||
				slot="handleBtn"
 | 
			
		||||
				label="操作"
 | 
			
		||||
				:width="80"
 | 
			
		||||
				:method-list="tableBtn"
 | 
			
		||||
				@clickBtn="handleTableBtnClick" />
 | 
			
		||||
		</base-table>
 | 
			
		||||
 | 
			
		||||
    <!-- 分页组件 -->
 | 
			
		||||
    <pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize"
 | 
			
		||||
      @pagination="getList" />
 | 
			
		||||
		<!-- 分页组件 -->
 | 
			
		||||
		<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" width="30%" @cancel="cancel"
 | 
			
		||||
      @confirm="submitForm">
 | 
			
		||||
      <DialogForm v-if="open" ref="form" v-model="form" :rows="[
 | 
			
		||||
      	[
 | 
			
		||||
      		{
 | 
			
		||||
      			input: true,
 | 
			
		||||
      			label: '检测类型名称',
 | 
			
		||||
      			prop: 'name',
 | 
			
		||||
      			rules: [
 | 
			
		||||
      				{
 | 
			
		||||
      					required: true,
 | 
			
		||||
      					message: '检测类型名称不能为空',
 | 
			
		||||
      					trigger: 'blur',
 | 
			
		||||
      				},
 | 
			
		||||
      			],
 | 
			
		||||
      			// bind: {
 | 
			
		||||
      			// 	disabled: true, // some condition, like detail mode...
 | 
			
		||||
      			// }
 | 
			
		||||
      		},
 | 
			
		||||
      	],
 | 
			
		||||
        [
 | 
			
		||||
      		{
 | 
			
		||||
      			input: true,
 | 
			
		||||
      			label: '检测类型编码',
 | 
			
		||||
      			prop: 'code',
 | 
			
		||||
      			url: '/base/quality-inspection-type/getCode',
 | 
			
		||||
      		},
 | 
			
		||||
      	],
 | 
			
		||||
      	[{ input: true, label: '备注', prop: 'remark' }],
 | 
			
		||||
      ]" />
 | 
			
		||||
    </base-dialog>
 | 
			
		||||
  </div>
 | 
			
		||||
		<!-- 对话框(添加 / 修改) -->
 | 
			
		||||
		<base-dialog
 | 
			
		||||
			:dialogTitle="title"
 | 
			
		||||
			:dialogVisible="open"
 | 
			
		||||
			@close="cancel"
 | 
			
		||||
			width="40%"
 | 
			
		||||
			@cancel="cancel"
 | 
			
		||||
			@confirm="submitForm">
 | 
			
		||||
			<DialogForm
 | 
			
		||||
				v-if="open"
 | 
			
		||||
				ref="form"
 | 
			
		||||
				v-model="form"
 | 
			
		||||
				:rows="[
 | 
			
		||||
					[
 | 
			
		||||
						{
 | 
			
		||||
							input: true,
 | 
			
		||||
							label: '检测类型',
 | 
			
		||||
							prop: 'name',
 | 
			
		||||
							rules: [
 | 
			
		||||
								{
 | 
			
		||||
									required: true,
 | 
			
		||||
									message: '检测类型不能为空',
 | 
			
		||||
									trigger: 'blur',
 | 
			
		||||
								},
 | 
			
		||||
							],
 | 
			
		||||
							// bind: {
 | 
			
		||||
							// 	disabled: true, // some condition, like detail mode...
 | 
			
		||||
							// }
 | 
			
		||||
						},
 | 
			
		||||
					],
 | 
			
		||||
					[
 | 
			
		||||
						{
 | 
			
		||||
							input: true,
 | 
			
		||||
							label: '检测类型编码',
 | 
			
		||||
							prop: 'code',
 | 
			
		||||
							url: '/base/quality-inspection-type/getCode',
 | 
			
		||||
						},
 | 
			
		||||
					],
 | 
			
		||||
					[{ input: true, label: '备注', prop: 'remark' }],
 | 
			
		||||
				]" />
 | 
			
		||||
		</base-dialog>
 | 
			
		||||
	</div>
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script>
 | 
			
		||||
@@ -61,10 +87,11 @@ import {
 | 
			
		||||
	exportQualityInspectionTypeExcel,
 | 
			
		||||
} from '@/api/base/qualityInspectionType';
 | 
			
		||||
import basicPageMixin from '@/mixins/lb/basicPageMixin';
 | 
			
		||||
import tableHeightMixin from '@/mixins/tableHeightMixin';
 | 
			
		||||
 | 
			
		||||
export default {
 | 
			
		||||
	name: 'QualityInspectionType',
 | 
			
		||||
	mixins: [basicPageMixin],
 | 
			
		||||
	mixins: [basicPageMixin, tableHeightMixin],
 | 
			
		||||
	data() {
 | 
			
		||||
		return {
 | 
			
		||||
			tableBtn: [
 | 
			
		||||
@@ -85,45 +112,12 @@ export default {
 | 
			
		||||
				{
 | 
			
		||||
					prop: 'createTime',
 | 
			
		||||
					label: '添加时间',
 | 
			
		||||
					fixed: true,
 | 
			
		||||
					width: 180,
 | 
			
		||||
					width: 160,
 | 
			
		||||
					filter: (val) => moment(val).format('yyyy-MM-DD HH:mm:ss'),
 | 
			
		||||
				},
 | 
			
		||||
				{ prop: 'name', label: '检测类型名称' },
 | 
			
		||||
				{ prop: 'code', label: '检测类型编码' },
 | 
			
		||||
				{ prop: 'remark', label: '备注' },
 | 
			
		||||
				// {
 | 
			
		||||
				// 	label: '操作',
 | 
			
		||||
				// 	alignt: 'center',
 | 
			
		||||
				// 	subcomponent: {
 | 
			
		||||
				// 		render: function (h) {
 | 
			
		||||
				// 			return h('div', null, [
 | 
			
		||||
				// 				h(
 | 
			
		||||
				// 					'el-button',
 | 
			
		||||
				// 					{
 | 
			
		||||
				// 						props: {
 | 
			
		||||
				// 							icon: 'el-icon-edit',
 | 
			
		||||
				// 							size: 'mini',
 | 
			
		||||
				// 							type: 'text',
 | 
			
		||||
				// 						},
 | 
			
		||||
				// 					},
 | 
			
		||||
				// 					' 修改'
 | 
			
		||||
				// 				),
 | 
			
		||||
				// 				h(
 | 
			
		||||
				// 					'el-button',
 | 
			
		||||
				// 					{
 | 
			
		||||
				// 						props: {
 | 
			
		||||
				// 							icon: 'el-icon-edit',
 | 
			
		||||
				// 							size: 'mini',
 | 
			
		||||
				// 							type: 'text',
 | 
			
		||||
				// 						},
 | 
			
		||||
				// 					},
 | 
			
		||||
				// 					' 修改'
 | 
			
		||||
				// 				),
 | 
			
		||||
				// 			]);
 | 
			
		||||
				// 		},
 | 
			
		||||
				// 	},
 | 
			
		||||
				// },
 | 
			
		||||
				{ prop: 'name', label: '检测类型', showOverflowtooltip: true },
 | 
			
		||||
				{ prop: 'code', label: '类型编码', showOverflowtooltip: true },
 | 
			
		||||
				{ prop: 'remark', label: '备注', showOverflowtooltip: true },
 | 
			
		||||
			],
 | 
			
		||||
			//
 | 
			
		||||
			searchBarFormConfig: [
 | 
			
		||||
@@ -139,11 +133,6 @@ export default {
 | 
			
		||||
					name: 'search',
 | 
			
		||||
					color: 'primary',
 | 
			
		||||
				},
 | 
			
		||||
				// {
 | 
			
		||||
				// 	type: 'button',
 | 
			
		||||
				// 	btnName: '重置',
 | 
			
		||||
				// 	name: 'reset',
 | 
			
		||||
				// },
 | 
			
		||||
				{
 | 
			
		||||
					type: 'separate',
 | 
			
		||||
				},
 | 
			
		||||
@@ -162,7 +151,7 @@ export default {
 | 
			
		||||
			// 查询参数
 | 
			
		||||
			queryParams: {
 | 
			
		||||
				pageNo: 1,
 | 
			
		||||
				pageSize: 10,
 | 
			
		||||
				pageSize: 20,
 | 
			
		||||
				name: null,
 | 
			
		||||
			},
 | 
			
		||||
			// 表单参数
 | 
			
		||||
@@ -242,7 +231,7 @@ export default {
 | 
			
		||||
		handleAdd() {
 | 
			
		||||
			this.reset();
 | 
			
		||||
			this.open = true;
 | 
			
		||||
			this.title = '添加质量检测类型基础';
 | 
			
		||||
			this.title = '新增';
 | 
			
		||||
		},
 | 
			
		||||
		/** 修改按钮操作 */
 | 
			
		||||
		handleUpdate(row) {
 | 
			
		||||
@@ -251,7 +240,7 @@ export default {
 | 
			
		||||
			getQualityInspectionType(id).then((response) => {
 | 
			
		||||
				this.form = response.data;
 | 
			
		||||
				this.open = true;
 | 
			
		||||
				this.title = '修改质量检测类型基础';
 | 
			
		||||
				this.title = '编辑';
 | 
			
		||||
			});
 | 
			
		||||
		},
 | 
			
		||||
		/** 提交按钮 */
 | 
			
		||||
@@ -284,7 +273,7 @@ export default {
 | 
			
		||||
		handleDelete(row) {
 | 
			
		||||
			const id = row.id;
 | 
			
		||||
			this.$modal
 | 
			
		||||
				.confirm('是否确认删除该质量检测类型?')
 | 
			
		||||
				.delConfirm(row.name)
 | 
			
		||||
				.then(function () {
 | 
			
		||||
					return deleteQualityInspectionType(id);
 | 
			
		||||
				})
 | 
			
		||||
							
								
								
									
										104
									
								
								src/views/devConfig/quality/qualityScrapDet/add-or-updata.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										104
									
								
								src/views/devConfig/quality/qualityScrapDet/add-or-updata.vue
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,104 @@
 | 
			
		||||
<!--
 | 
			
		||||
 * @Author: zhp
 | 
			
		||||
 * @Date: 2023-11-06 15:15:30
 | 
			
		||||
 * @LastEditTime: 2023-11-20 15:23:59
 | 
			
		||||
 * @LastEditors: zhp
 | 
			
		||||
 * @Description:
 | 
			
		||||
-->
 | 
			
		||||
<template>
 | 
			
		||||
	<el-form
 | 
			
		||||
		:model="dataForm"
 | 
			
		||||
		:rules="dataRule"
 | 
			
		||||
		ref="dataForm"
 | 
			
		||||
		@keyup.enter.native="dataFormSubmit()"
 | 
			
		||||
		label-width="auto">
 | 
			
		||||
		<el-row :gutter="20">
 | 
			
		||||
			<el-col :span="12">
 | 
			
		||||
				<el-form-item label="报废原因编码" prop="code">
 | 
			
		||||
					<el-input v-model="dataForm.code" placeholder="请输入报废原因编码" />
 | 
			
		||||
				</el-form-item>
 | 
			
		||||
			</el-col>
 | 
			
		||||
			<el-col :span="12">
 | 
			
		||||
				<el-form-item label="报废原因" prop="content">
 | 
			
		||||
					<el-input v-model="dataForm.content" placeholder="请输入报废原因" />
 | 
			
		||||
				</el-form-item>
 | 
			
		||||
			</el-col>
 | 
			
		||||
		</el-row>
 | 
			
		||||
		<el-row :gutter="20">
 | 
			
		||||
			<el-col :span="12">
 | 
			
		||||
				<el-form-item label="报废类型" prop="typeId">
 | 
			
		||||
					<el-select v-model="dataForm.typeId" placeholder="请选择报废类型">
 | 
			
		||||
						<el-option
 | 
			
		||||
							v-for="dict in typeList"
 | 
			
		||||
							:key="dict.id"
 | 
			
		||||
							:label="dict.name"
 | 
			
		||||
							:value="dict.id" />
 | 
			
		||||
					</el-select>
 | 
			
		||||
				</el-form-item>
 | 
			
		||||
			</el-col>
 | 
			
		||||
			<el-col :span="12">
 | 
			
		||||
				<el-form-item label="备注" prop="remark">
 | 
			
		||||
					<el-input
 | 
			
		||||
						v-model="dataForm.remark"
 | 
			
		||||
						clearable
 | 
			
		||||
						placeholder="请输入备注" />
 | 
			
		||||
				</el-form-item>
 | 
			
		||||
			</el-col>
 | 
			
		||||
		</el-row>
 | 
			
		||||
	</el-form>
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script>
 | 
			
		||||
import basicAdd from '../../../core/mixins/basic-add';
 | 
			
		||||
import {
 | 
			
		||||
	createQualityScrapDet,
 | 
			
		||||
	updateQualityScrapDet,
 | 
			
		||||
	getQualityScrapDet,
 | 
			
		||||
	getCode,
 | 
			
		||||
} from '@/api/base/qualityScrapDet';
 | 
			
		||||
import { getList } from '@/api/base/qualityScrapType';
 | 
			
		||||
 | 
			
		||||
export default {
 | 
			
		||||
	mixins: [basicAdd],
 | 
			
		||||
	data() {
 | 
			
		||||
		return {
 | 
			
		||||
			urlOptions: {
 | 
			
		||||
				isGetCode: true,
 | 
			
		||||
				codeURL: getCode,
 | 
			
		||||
				createURL: createQualityScrapDet,
 | 
			
		||||
				updateURL: updateQualityScrapDet,
 | 
			
		||||
				infoURL: getQualityScrapDet,
 | 
			
		||||
			},
 | 
			
		||||
			typeList: [],
 | 
			
		||||
			dataForm: {
 | 
			
		||||
				id: undefined,
 | 
			
		||||
				code: undefined,
 | 
			
		||||
				content: undefined,
 | 
			
		||||
				typeId: null,
 | 
			
		||||
				remark: undefined,
 | 
			
		||||
			},
 | 
			
		||||
			dataRule: {
 | 
			
		||||
				code: [
 | 
			
		||||
					{ required: true, message: '报废原因编码不能为空', trigger: 'blur' },
 | 
			
		||||
				],
 | 
			
		||||
				content: [
 | 
			
		||||
					{ required: true, message: '报废原因不能为空', trigger: 'blur' },
 | 
			
		||||
				],
 | 
			
		||||
				typeId: [
 | 
			
		||||
					{ required: true, message: '报废类型不能为空', trigger: 'change' },
 | 
			
		||||
				],
 | 
			
		||||
			},
 | 
			
		||||
		};
 | 
			
		||||
	},
 | 
			
		||||
	mounted() {
 | 
			
		||||
		this.getDict();
 | 
			
		||||
	},
 | 
			
		||||
	methods: {
 | 
			
		||||
		async getDict() {
 | 
			
		||||
			// 报废类型
 | 
			
		||||
			const res = await getList();
 | 
			
		||||
			this.typeList = res.data;
 | 
			
		||||
		},
 | 
			
		||||
	},
 | 
			
		||||
};
 | 
			
		||||
</script>
 | 
			
		||||
							
								
								
									
										159
									
								
								src/views/devConfig/quality/qualityScrapDet/basic-page.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										159
									
								
								src/views/devConfig/quality/qualityScrapDet/basic-page.js
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,159 @@
 | 
			
		||||
/*
 | 
			
		||||
 * @Author: zwq
 | 
			
		||||
 * @Date: 2022-08-24 11:19:43
 | 
			
		||||
 * @LastEditors: DY
 | 
			
		||||
 * @LastEditTime: 2023-09-21 16:02:07
 | 
			
		||||
 * @Description:
 | 
			
		||||
 */
 | 
			
		||||
export default {
 | 
			
		||||
  data() {
 | 
			
		||||
    /* eslint-disable */
 | 
			
		||||
    return {
 | 
			
		||||
      urlOptions: {
 | 
			
		||||
        getDataListURL: '',
 | 
			
		||||
        deleteURL: '',
 | 
			
		||||
        statusUrl: '',
 | 
			
		||||
        exportURL: ''
 | 
			
		||||
      },
 | 
			
		||||
      tableData: [],
 | 
			
		||||
      listQuery: {
 | 
			
		||||
        pageSize: 10,
 | 
			
		||||
        pageNo: 1,
 | 
			
		||||
        total: 1,
 | 
			
		||||
      },
 | 
			
		||||
      exportLoading: false,
 | 
			
		||||
      dataListLoading: false,
 | 
			
		||||
      addOrEditTitle: '',
 | 
			
		||||
      addOrUpdateVisible: false,
 | 
			
		||||
    }
 | 
			
		||||
  },
 | 
			
		||||
  created() {
 | 
			
		||||
  },
 | 
			
		||||
  mounted() {
 | 
			
		||||
    this.getDataList()
 | 
			
		||||
  },
 | 
			
		||||
  methods: {
 | 
			
		||||
    // 获取数据列表
 | 
			
		||||
    getDataList() {
 | 
			
		||||
      this.dataListLoading = true;
 | 
			
		||||
      this.urlOptions.getDataListURL(this.listQuery).then(response => {
 | 
			
		||||
        this.tableData = response.data.list;
 | 
			
		||||
        this.listQuery.total = response.data.total;
 | 
			
		||||
        this.dataListLoading = false;
 | 
			
		||||
      });
 | 
			
		||||
    },
 | 
			
		||||
    // 每页数
 | 
			
		||||
    sizeChangeHandle(val) {
 | 
			
		||||
      this.listQuery.pageSize = val;
 | 
			
		||||
      this.listQuery.pageNo = 1;
 | 
			
		||||
      this.getDataList();
 | 
			
		||||
    },
 | 
			
		||||
    // 当前页
 | 
			
		||||
    currentChangeHandle(val) {
 | 
			
		||||
      this.listQuery.pageNo = val;
 | 
			
		||||
      this.getDataList();
 | 
			
		||||
    },
 | 
			
		||||
    // 新增 / 修改
 | 
			
		||||
    addOrUpdateHandle(id) {
 | 
			
		||||
      this.addOrUpdateVisible = true;
 | 
			
		||||
      this.$nextTick(() => {
 | 
			
		||||
        this.$refs.addOrUpdate.init(id);
 | 
			
		||||
      });
 | 
			
		||||
    },
 | 
			
		||||
    cancel(id) {
 | 
			
		||||
      this.$refs["popover-" + id].showPopper = false;
 | 
			
		||||
    },
 | 
			
		||||
    //改变状态
 | 
			
		||||
    changeStatus(id) {
 | 
			
		||||
      this.$http
 | 
			
		||||
        .post(this.urlOptions.statusUrl, { id })
 | 
			
		||||
        .then(({ data: res }) => {
 | 
			
		||||
          if (res.code !== 0) {
 | 
			
		||||
            return this.$message.error(res.msg);
 | 
			
		||||
          }
 | 
			
		||||
          this.$refs["popover-" + id].showPopper = false;
 | 
			
		||||
          this.$message({
 | 
			
		||||
            message: this.$t("prompt.success"),
 | 
			
		||||
            type: "success",
 | 
			
		||||
            duration: 500,
 | 
			
		||||
            onClose: () => {
 | 
			
		||||
              this.getDataList();
 | 
			
		||||
            },
 | 
			
		||||
          });
 | 
			
		||||
        })
 | 
			
		||||
        .catch(() => { });
 | 
			
		||||
    },
 | 
			
		||||
    //tableBtn点击
 | 
			
		||||
    handleClick(val) {
 | 
			
		||||
      if (val.type === "edit") {
 | 
			
		||||
        this.addOrUpdateVisible = true;
 | 
			
		||||
        this.addOrEditTitle = "编辑";
 | 
			
		||||
        this.$nextTick(() => {
 | 
			
		||||
          this.$refs.addOrUpdate.init(val.data.id);
 | 
			
		||||
        });
 | 
			
		||||
      } else if (val.type === "delete") {
 | 
			
		||||
        this.deleteHandle(val.data.id, val.data.content)
 | 
			
		||||
      } else if (val.type === "change") {
 | 
			
		||||
        this.changeStatus(val.data.id)
 | 
			
		||||
      } else {
 | 
			
		||||
        this.otherMethods(val)
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
    // 删除
 | 
			
		||||
    deleteHandle(id,name) {
 | 
			
		||||
      this.$modal
 | 
			
		||||
				.delConfirm(name)
 | 
			
		||||
        .then(() => {
 | 
			
		||||
          this.urlOptions.deleteURL(id).then(({ data }) => {
 | 
			
		||||
            this.getDataList();
 | 
			
		||||
            this.$modal.msgSuccess('删除成功');
 | 
			
		||||
          });
 | 
			
		||||
        })
 | 
			
		||||
        .catch(() => { });
 | 
			
		||||
    },
 | 
			
		||||
    //search-bar点击
 | 
			
		||||
    buttonClick(val) {
 | 
			
		||||
      switch (val.btnName) {
 | 
			
		||||
        case "search":
 | 
			
		||||
          this.listQuery.xm1 = val.xm1;
 | 
			
		||||
          this.listQuery.xm2 = val.xm2;
 | 
			
		||||
          this.listQuery.pageNo = 1;
 | 
			
		||||
          this.getDataList();
 | 
			
		||||
          break;
 | 
			
		||||
        case "add":
 | 
			
		||||
          this.addOrEditTitle = '新增'
 | 
			
		||||
          this.addOrUpdateVisible = true;
 | 
			
		||||
          this.addOrUpdateHandle()
 | 
			
		||||
          break;
 | 
			
		||||
        default:
 | 
			
		||||
          console.log(val)
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
    handleCancel() {
 | 
			
		||||
      this.$refs.addOrUpdate.formClear()
 | 
			
		||||
      this.addOrUpdateVisible = false
 | 
			
		||||
      this.addOrEditTitle = ''
 | 
			
		||||
    },
 | 
			
		||||
    handleConfirm() {
 | 
			
		||||
      this.$refs.addOrUpdate.dataFormSubmit()
 | 
			
		||||
    },
 | 
			
		||||
    successSubmit() {
 | 
			
		||||
      this.handleCancel()
 | 
			
		||||
      this.getDataList()
 | 
			
		||||
    },
 | 
			
		||||
    /** 导出按钮操作 */
 | 
			
		||||
    handleExport() {
 | 
			
		||||
      // 处理查询参数
 | 
			
		||||
      let params = { ...this.queryParams };
 | 
			
		||||
      params.pageNo = undefined;
 | 
			
		||||
      params.pageSize = undefined;
 | 
			
		||||
      this.$modal.confirm('是否确认导出所有数据项?').then(() => {
 | 
			
		||||
        this.exportLoading = true;
 | 
			
		||||
        return this.urlOptions.exportURL(params);
 | 
			
		||||
      }).then(response => {
 | 
			
		||||
        this.$download.excel(response, '工厂.xls');
 | 
			
		||||
        this.exportLoading = false;
 | 
			
		||||
      }).catch(() => { });
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										191
									
								
								src/views/devConfig/quality/qualityScrapDet/index.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										191
									
								
								src/views/devConfig/quality/qualityScrapDet/index.vue
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,191 @@
 | 
			
		||||
<template>
 | 
			
		||||
	<div class="app-container">
 | 
			
		||||
		<search-bar
 | 
			
		||||
			:formConfigs="formConfig"
 | 
			
		||||
			ref="searchBarForm"
 | 
			
		||||
			@headBtnClick="buttonClick" />
 | 
			
		||||
		<base-table
 | 
			
		||||
			v-loading="dataListLoading"
 | 
			
		||||
			:table-props="tableProps"
 | 
			
		||||
			:page="listQuery.pageNo"
 | 
			
		||||
			:limit="listQuery.pageSize"
 | 
			
		||||
			:table-data="tableData"
 | 
			
		||||
			:max-height="tableH">
 | 
			
		||||
			<method-btn
 | 
			
		||||
				v-if="tableBtn.length"
 | 
			
		||||
				slot="handleBtn"
 | 
			
		||||
				:width="80"
 | 
			
		||||
				label="操作"
 | 
			
		||||
				:method-list="tableBtn"
 | 
			
		||||
				@clickBtn="handleClick" />
 | 
			
		||||
		</base-table>
 | 
			
		||||
		<pagination
 | 
			
		||||
			:limit.sync="listQuery.pageSize"
 | 
			
		||||
			:page.sync="listQuery.pageNo"
 | 
			
		||||
			:total="total"
 | 
			
		||||
			@pagination="getDataList" />
 | 
			
		||||
		<base-dialog
 | 
			
		||||
			:dialogTitle="addOrEditTitle"
 | 
			
		||||
			:dialogVisible="addOrUpdateVisible"
 | 
			
		||||
			@cancel="handleCancel"
 | 
			
		||||
			@confirm="handleConfirm"
 | 
			
		||||
			:before-close="handleCancel"
 | 
			
		||||
			width="50%">
 | 
			
		||||
			<add-or-update
 | 
			
		||||
				ref="addOrUpdate"
 | 
			
		||||
				@refreshDataList="successSubmit"></add-or-update>
 | 
			
		||||
		</base-dialog>
 | 
			
		||||
	</div>
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script>
 | 
			
		||||
import AddOrUpdate from './add-or-updata';
 | 
			
		||||
import basicPage from './basic-page';
 | 
			
		||||
import { parseTime } from '../../../core/mixins/code-filter';
 | 
			
		||||
import {
 | 
			
		||||
	getQualityScrapDetPage,
 | 
			
		||||
	deleteQualityScrapDet,
 | 
			
		||||
} from '@/api/base/qualityScrapDet';
 | 
			
		||||
import { getList } from '@/api/base/qualityScrapType';
 | 
			
		||||
import tableHeightMixin from '@/mixins/tableHeightMixin';
 | 
			
		||||
const tableProps = [
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'createTime',
 | 
			
		||||
		label: '添加时间',
 | 
			
		||||
		filter: parseTime,
 | 
			
		||||
		width: 160,
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'content',
 | 
			
		||||
		label: '报废原因',
 | 
			
		||||
		showOverflowtooltip: true,
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'code',
 | 
			
		||||
		label: '报废原因编码',
 | 
			
		||||
		showOverflowtooltip: true,
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'typeName',
 | 
			
		||||
		label: '报废类型',
 | 
			
		||||
		showOverflowtooltip: true,
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'remark',
 | 
			
		||||
		label: '备注',
 | 
			
		||||
		showOverflowtooltip: true,
 | 
			
		||||
	},
 | 
			
		||||
];
 | 
			
		||||
 | 
			
		||||
export default {
 | 
			
		||||
	mixins: [basicPage, tableHeightMixin],
 | 
			
		||||
	data() {
 | 
			
		||||
		return {
 | 
			
		||||
			urlOptions: {
 | 
			
		||||
				getDataListURL: getQualityScrapDetPage,
 | 
			
		||||
				deleteURL: deleteQualityScrapDet,
 | 
			
		||||
				// exportURL: exportFactoryExcel,
 | 
			
		||||
			},
 | 
			
		||||
			tableProps,
 | 
			
		||||
			tableBtn: [
 | 
			
		||||
				this.$auth.hasPermi(`base:quality-inspection-det:update`)
 | 
			
		||||
					? {
 | 
			
		||||
							type: 'edit',
 | 
			
		||||
							btnName: '编辑',
 | 
			
		||||
					  }
 | 
			
		||||
					: undefined,
 | 
			
		||||
				this.$auth.hasPermi(`base:quality-inspection-det:delete`)
 | 
			
		||||
					? {
 | 
			
		||||
							type: 'delete',
 | 
			
		||||
							btnName: '删除',
 | 
			
		||||
					  }
 | 
			
		||||
					: undefined,
 | 
			
		||||
			].filter((v) => v),
 | 
			
		||||
			tableData: [],
 | 
			
		||||
			formConfig: [
 | 
			
		||||
				{
 | 
			
		||||
					type: 'input',
 | 
			
		||||
					label: '报废原因',
 | 
			
		||||
					placeholder: '报废原因',
 | 
			
		||||
					param: 'content',
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					type: 'select',
 | 
			
		||||
					label: '报废类型',
 | 
			
		||||
					selectOptions: [],
 | 
			
		||||
					labelField: 'name',
 | 
			
		||||
					valueField: 'id',
 | 
			
		||||
					param: 'typeId',
 | 
			
		||||
					filterable: true,
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					type: 'button',
 | 
			
		||||
					btnName: '查询',
 | 
			
		||||
					name: 'search',
 | 
			
		||||
					color: 'primary',
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					type: 'separate',
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					type: this.$auth.hasPermi('base:quality-scrap-det:create')
 | 
			
		||||
						? 'button'
 | 
			
		||||
						: '',
 | 
			
		||||
					btnName: '新增',
 | 
			
		||||
					name: 'add',
 | 
			
		||||
					color: 'success',
 | 
			
		||||
					plain: true,
 | 
			
		||||
				},
 | 
			
		||||
			],
 | 
			
		||||
			listQuery: {
 | 
			
		||||
				pageNo: 1,
 | 
			
		||||
				pageSize: 20,
 | 
			
		||||
			},
 | 
			
		||||
			total: 0,
 | 
			
		||||
		};
 | 
			
		||||
	},
 | 
			
		||||
	components: {
 | 
			
		||||
		AddOrUpdate,
 | 
			
		||||
	},
 | 
			
		||||
	created() {},
 | 
			
		||||
	mounted() {
 | 
			
		||||
		this.getDict();
 | 
			
		||||
	},
 | 
			
		||||
	methods: {
 | 
			
		||||
		// 获取数据列表
 | 
			
		||||
		getDataList() {
 | 
			
		||||
			this.dataListLoading = true;
 | 
			
		||||
			this.urlOptions.getDataListURL(this.listQuery).then((response) => {
 | 
			
		||||
				this.tableData = response.data.list;
 | 
			
		||||
				this.total = response.data.total;
 | 
			
		||||
				this.dataListLoading = false;
 | 
			
		||||
			});
 | 
			
		||||
		},
 | 
			
		||||
		async getDict() {
 | 
			
		||||
			// 物料列表
 | 
			
		||||
			const res = await getList();
 | 
			
		||||
			this.formConfig[1].selectOptions = res.data;
 | 
			
		||||
		},
 | 
			
		||||
		buttonClick(val) {
 | 
			
		||||
			switch (val.btnName) {
 | 
			
		||||
				case 'search':
 | 
			
		||||
					this.listQuery.pageNo = 1;
 | 
			
		||||
					this.listQuery.content = val.content ? val.content : undefined;
 | 
			
		||||
					this.listQuery.typeId = val.typeId ? val.typeId : undefined;
 | 
			
		||||
					this.getDataList();
 | 
			
		||||
					break;
 | 
			
		||||
				case 'add':
 | 
			
		||||
					this.addOrEditTitle = '新增';
 | 
			
		||||
					this.addOrUpdateVisible = true;
 | 
			
		||||
					this.addOrUpdateHandle();
 | 
			
		||||
					break;
 | 
			
		||||
				case 'export':
 | 
			
		||||
					this.handleExport();
 | 
			
		||||
					break;
 | 
			
		||||
				default:
 | 
			
		||||
					console.log(val);
 | 
			
		||||
			}
 | 
			
		||||
		},
 | 
			
		||||
	},
 | 
			
		||||
};
 | 
			
		||||
</script>
 | 
			
		||||
@@ -0,0 +1,88 @@
 | 
			
		||||
<!--
 | 
			
		||||
 * @Author: zhp
 | 
			
		||||
 * @Date: 2023-11-06 15:15:30
 | 
			
		||||
 * @LastEditTime: 2023-11-24 08:42:18
 | 
			
		||||
 * @LastEditors: zhp
 | 
			
		||||
 * @Description:
 | 
			
		||||
-->
 | 
			
		||||
<template>
 | 
			
		||||
	<el-form
 | 
			
		||||
		:model="dataForm"
 | 
			
		||||
		:rules="dataRule"
 | 
			
		||||
		ref="dataForm"
 | 
			
		||||
		@keyup.enter.native="dataFormSubmit()">
 | 
			
		||||
		<el-row :gutter="24">
 | 
			
		||||
			<el-col :span="12">
 | 
			
		||||
				<el-form-item label="报废类型编码" prop="code" label-width="120px">
 | 
			
		||||
					<el-input v-model="dataForm.code" placeholder="请输入报废类型编码" />
 | 
			
		||||
				</el-form-item>
 | 
			
		||||
			</el-col>
 | 
			
		||||
			<el-col :span="12">
 | 
			
		||||
				<el-form-item label="报废类型" prop="name" label-width="90px">
 | 
			
		||||
					<el-input v-model="dataForm.name" placeholder="请输入报废类型" />
 | 
			
		||||
				</el-form-item>
 | 
			
		||||
			</el-col>
 | 
			
		||||
		</el-row>
 | 
			
		||||
		<el-row :gutter="24">
 | 
			
		||||
			<el-col :span="12">
 | 
			
		||||
				<el-form-item
 | 
			
		||||
					label="报废类型描述"
 | 
			
		||||
					prop="description"
 | 
			
		||||
					label-width="120px">
 | 
			
		||||
					<el-input
 | 
			
		||||
						v-model="dataForm.description"
 | 
			
		||||
						clearable
 | 
			
		||||
						placeholder="报废类型描述" />
 | 
			
		||||
				</el-form-item>
 | 
			
		||||
			</el-col>
 | 
			
		||||
			<el-col :span="12">
 | 
			
		||||
				<el-form-item label="备注" prop="remark" label-width="90px">
 | 
			
		||||
					<el-input
 | 
			
		||||
						v-model="dataForm.remark"
 | 
			
		||||
						clearable
 | 
			
		||||
						placeholder="请输入备注" />
 | 
			
		||||
				</el-form-item>
 | 
			
		||||
			</el-col>
 | 
			
		||||
		</el-row>
 | 
			
		||||
	</el-form>
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script>
 | 
			
		||||
import basicAdd from '../../../core/mixins/basic-add';
 | 
			
		||||
import {
 | 
			
		||||
	createQualityScrapType,
 | 
			
		||||
	updateQualityScrapType,
 | 
			
		||||
	getQualityScrapType,
 | 
			
		||||
	getCode,
 | 
			
		||||
} from '@/api/base/qualityScrapType';
 | 
			
		||||
 | 
			
		||||
export default {
 | 
			
		||||
	mixins: [basicAdd],
 | 
			
		||||
	data() {
 | 
			
		||||
		return {
 | 
			
		||||
			urlOptions: {
 | 
			
		||||
				isGetCode: true,
 | 
			
		||||
				codeURL: getCode,
 | 
			
		||||
				createURL: createQualityScrapType,
 | 
			
		||||
				updateURL: updateQualityScrapType,
 | 
			
		||||
				infoURL: getQualityScrapType,
 | 
			
		||||
			},
 | 
			
		||||
			dataForm: {
 | 
			
		||||
				id: undefined,
 | 
			
		||||
				code: undefined,
 | 
			
		||||
				name: undefined,
 | 
			
		||||
				description: undefined,
 | 
			
		||||
				remark: undefined,
 | 
			
		||||
			},
 | 
			
		||||
			dataRule: {
 | 
			
		||||
				code: [
 | 
			
		||||
					{ required: true, message: '报废类型编码不能为空', trigger: 'blur' },
 | 
			
		||||
				],
 | 
			
		||||
				name: [
 | 
			
		||||
					{ required: true, message: '报废类型不能为空', trigger: 'blur' },
 | 
			
		||||
				],
 | 
			
		||||
			},
 | 
			
		||||
		};
 | 
			
		||||
	},
 | 
			
		||||
};
 | 
			
		||||
</script>
 | 
			
		||||
							
								
								
									
										159
									
								
								src/views/devConfig/quality/qualityScrapType/basic-page.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										159
									
								
								src/views/devConfig/quality/qualityScrapType/basic-page.js
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,159 @@
 | 
			
		||||
/*
 | 
			
		||||
 * @Author: zwq
 | 
			
		||||
 * @Date: 2022-08-24 11:19:43
 | 
			
		||||
 * @LastEditors: DY
 | 
			
		||||
 * @LastEditTime: 2023-09-21 16:02:07
 | 
			
		||||
 * @Description:
 | 
			
		||||
 */
 | 
			
		||||
export default {
 | 
			
		||||
  data() {
 | 
			
		||||
    /* eslint-disable */
 | 
			
		||||
    return {
 | 
			
		||||
      urlOptions: {
 | 
			
		||||
        getDataListURL: '',
 | 
			
		||||
        deleteURL: '',
 | 
			
		||||
        statusUrl: '',
 | 
			
		||||
        exportURL: ''
 | 
			
		||||
      },
 | 
			
		||||
      tableData: [],
 | 
			
		||||
      listQuery: {
 | 
			
		||||
        pageSize: 10,
 | 
			
		||||
        pageNo: 1,
 | 
			
		||||
        total: 1,
 | 
			
		||||
      },
 | 
			
		||||
      exportLoading: false,
 | 
			
		||||
      dataListLoading: false,
 | 
			
		||||
      addOrEditTitle: '',
 | 
			
		||||
      addOrUpdateVisible: false,
 | 
			
		||||
    }
 | 
			
		||||
  },
 | 
			
		||||
  created() {
 | 
			
		||||
  },
 | 
			
		||||
  mounted() {
 | 
			
		||||
    this.getDataList()
 | 
			
		||||
  },
 | 
			
		||||
  methods: {
 | 
			
		||||
    // 获取数据列表
 | 
			
		||||
    getDataList() {
 | 
			
		||||
      this.dataListLoading = true;
 | 
			
		||||
      this.urlOptions.getDataListURL(this.listQuery).then(response => {
 | 
			
		||||
        this.tableData = response.data.list;
 | 
			
		||||
        this.listQuery.total = response.data.total;
 | 
			
		||||
        this.dataListLoading = false;
 | 
			
		||||
      });
 | 
			
		||||
    },
 | 
			
		||||
    // 每页数
 | 
			
		||||
    sizeChangeHandle(val) {
 | 
			
		||||
      this.listQuery.pageSize = val;
 | 
			
		||||
      this.listQuery.pageNo = 1;
 | 
			
		||||
      this.getDataList();
 | 
			
		||||
    },
 | 
			
		||||
    // 当前页
 | 
			
		||||
    currentChangeHandle(val) {
 | 
			
		||||
      this.listQuery.pageNo = val;
 | 
			
		||||
      this.getDataList();
 | 
			
		||||
    },
 | 
			
		||||
    // 新增 / 修改
 | 
			
		||||
    addOrUpdateHandle(id) {
 | 
			
		||||
      this.addOrUpdateVisible = true;
 | 
			
		||||
      this.$nextTick(() => {
 | 
			
		||||
        this.$refs.addOrUpdate.init(id);
 | 
			
		||||
      });
 | 
			
		||||
    },
 | 
			
		||||
    cancel(id) {
 | 
			
		||||
      this.$refs["popover-" + id].showPopper = false;
 | 
			
		||||
    },
 | 
			
		||||
    //改变状态
 | 
			
		||||
    changeStatus(id) {
 | 
			
		||||
      this.$http
 | 
			
		||||
        .post(this.urlOptions.statusUrl, { id })
 | 
			
		||||
        .then(({ data: res }) => {
 | 
			
		||||
          if (res.code !== 0) {
 | 
			
		||||
            return this.$message.error(res.msg);
 | 
			
		||||
          }
 | 
			
		||||
          this.$refs["popover-" + id].showPopper = false;
 | 
			
		||||
          this.$message({
 | 
			
		||||
            message: this.$t("prompt.success"),
 | 
			
		||||
            type: "success",
 | 
			
		||||
            duration: 500,
 | 
			
		||||
            onClose: () => {
 | 
			
		||||
              this.getDataList();
 | 
			
		||||
            },
 | 
			
		||||
          });
 | 
			
		||||
        })
 | 
			
		||||
        .catch(() => { });
 | 
			
		||||
    },
 | 
			
		||||
    //tableBtn点击
 | 
			
		||||
    handleClick(val) {
 | 
			
		||||
      if (val.type === "edit") {
 | 
			
		||||
        this.addOrUpdateVisible = true;
 | 
			
		||||
        this.addOrEditTitle = "编辑";
 | 
			
		||||
        this.$nextTick(() => {
 | 
			
		||||
          this.$refs.addOrUpdate.init(val.data.id);
 | 
			
		||||
        });
 | 
			
		||||
      } else if (val.type === "delete") {
 | 
			
		||||
        this.deleteHandle(val.data.id, val.data.name)
 | 
			
		||||
      } else if (val.type === "change") {
 | 
			
		||||
        this.changeStatus(val.data.id)
 | 
			
		||||
      } else {
 | 
			
		||||
        this.otherMethods(val)
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
    // 删除
 | 
			
		||||
    deleteHandle(id,name) {
 | 
			
		||||
      this.$modal
 | 
			
		||||
				.delConfirm(name)
 | 
			
		||||
        .then(() => {
 | 
			
		||||
          this.urlOptions.deleteURL(id).then(({ data }) => {
 | 
			
		||||
            this.getDataList();
 | 
			
		||||
            this.$modal.msgSuccess('删除成功');
 | 
			
		||||
          });
 | 
			
		||||
        })
 | 
			
		||||
        .catch(() => { });
 | 
			
		||||
    },
 | 
			
		||||
    //search-bar点击
 | 
			
		||||
    buttonClick(val) {
 | 
			
		||||
      switch (val.btnName) {
 | 
			
		||||
        case "search":
 | 
			
		||||
          this.listQuery.xm1 = val.xm1;
 | 
			
		||||
          this.listQuery.xm2 = val.xm2;
 | 
			
		||||
          this.listQuery.pageNo = 1;
 | 
			
		||||
          this.getDataList();
 | 
			
		||||
          break;
 | 
			
		||||
        case "add":
 | 
			
		||||
          this.addOrEditTitle = '新增'
 | 
			
		||||
          this.addOrUpdateVisible = true;
 | 
			
		||||
          this.addOrUpdateHandle()
 | 
			
		||||
          break;
 | 
			
		||||
        default:
 | 
			
		||||
          console.log(val)
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
    handleCancel() {
 | 
			
		||||
      this.$refs.addOrUpdate.formClear()
 | 
			
		||||
      this.addOrUpdateVisible = false
 | 
			
		||||
      this.addOrEditTitle = ''
 | 
			
		||||
    },
 | 
			
		||||
    handleConfirm() {
 | 
			
		||||
      this.$refs.addOrUpdate.dataFormSubmit()
 | 
			
		||||
    },
 | 
			
		||||
    successSubmit() {
 | 
			
		||||
      this.handleCancel()
 | 
			
		||||
      this.getDataList()
 | 
			
		||||
    },
 | 
			
		||||
    /** 导出按钮操作 */
 | 
			
		||||
    handleExport() {
 | 
			
		||||
      // 处理查询参数
 | 
			
		||||
      let params = { ...this.queryParams };
 | 
			
		||||
      params.pageNo = undefined;
 | 
			
		||||
      params.pageSize = undefined;
 | 
			
		||||
      this.$modal.confirm('是否确认导出所有数据项?').then(() => {
 | 
			
		||||
        this.exportLoading = true;
 | 
			
		||||
        return this.urlOptions.exportURL(params);
 | 
			
		||||
      }).then(response => {
 | 
			
		||||
        this.$download.excel(response, '工厂.xls');
 | 
			
		||||
        this.exportLoading = false;
 | 
			
		||||
      }).catch(() => { });
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										173
									
								
								src/views/devConfig/quality/qualityScrapType/index.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										173
									
								
								src/views/devConfig/quality/qualityScrapType/index.vue
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,173 @@
 | 
			
		||||
<template>
 | 
			
		||||
	<div class="app-container">
 | 
			
		||||
		<search-bar
 | 
			
		||||
			:formConfigs="formConfig"
 | 
			
		||||
			ref="searchBarForm"
 | 
			
		||||
			@headBtnClick="buttonClick" />
 | 
			
		||||
		<base-table
 | 
			
		||||
			v-loading="dataListLoading"
 | 
			
		||||
			:table-props="tableProps"
 | 
			
		||||
			:page="listQuery.pageNo"
 | 
			
		||||
			:limit="listQuery.pageSize"
 | 
			
		||||
			:table-data="tableData"
 | 
			
		||||
			:max-height="tableH">
 | 
			
		||||
			<method-btn
 | 
			
		||||
				v-if="tableBtn.length"
 | 
			
		||||
				slot="handleBtn"
 | 
			
		||||
				:width="80"
 | 
			
		||||
				label="操作"
 | 
			
		||||
				:method-list="tableBtn"
 | 
			
		||||
				@clickBtn="handleClick" />
 | 
			
		||||
		</base-table>
 | 
			
		||||
		<pagination
 | 
			
		||||
			:limit.sync="listQuery.pageSize"
 | 
			
		||||
			:page.sync="listQuery.pageNo"
 | 
			
		||||
			:total="total"
 | 
			
		||||
			@pagination="getDataList" />
 | 
			
		||||
		<base-dialog
 | 
			
		||||
			:dialogTitle="addOrEditTitle"
 | 
			
		||||
			:dialogVisible="addOrUpdateVisible"
 | 
			
		||||
			@cancel="handleCancel"
 | 
			
		||||
			@confirm="handleConfirm"
 | 
			
		||||
			:before-close="handleCancel"
 | 
			
		||||
			width="50%">
 | 
			
		||||
			<add-or-update
 | 
			
		||||
				ref="addOrUpdate"
 | 
			
		||||
				@refreshDataList="successSubmit"></add-or-update>
 | 
			
		||||
		</base-dialog>
 | 
			
		||||
	</div>
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script>
 | 
			
		||||
import AddOrUpdate from './add-or-updata';
 | 
			
		||||
import basicPage from './basic-page';
 | 
			
		||||
import { parseTime } from '../../../core/mixins/code-filter';
 | 
			
		||||
import {
 | 
			
		||||
	getQualityScrapTypePage,
 | 
			
		||||
	deleteQualityScrapType,
 | 
			
		||||
} from '@/api/base/qualityScrapType';
 | 
			
		||||
import tableHeightMixin from '@/mixins/tableHeightMixin';
 | 
			
		||||
 | 
			
		||||
const tableProps = [
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'createTime',
 | 
			
		||||
		label: '添加时间',
 | 
			
		||||
		filter: parseTime,
 | 
			
		||||
		width: 160,
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'name',
 | 
			
		||||
		label: '报废类型',
 | 
			
		||||
		showOverflowtooltip: true,
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'code',
 | 
			
		||||
		label: '报废类型编码',
 | 
			
		||||
		showOverflowtooltip: true,
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'description',
 | 
			
		||||
		label: '描述信息',
 | 
			
		||||
		showOverflowtooltip: true,
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'remark',
 | 
			
		||||
		label: '备注',
 | 
			
		||||
		showOverflowtooltip: true,
 | 
			
		||||
	},
 | 
			
		||||
];
 | 
			
		||||
 | 
			
		||||
export default {
 | 
			
		||||
	mixins: [basicPage, tableHeightMixin],
 | 
			
		||||
	data() {
 | 
			
		||||
		return {
 | 
			
		||||
			urlOptions: {
 | 
			
		||||
				getDataListURL: getQualityScrapTypePage,
 | 
			
		||||
				deleteURL: deleteQualityScrapType,
 | 
			
		||||
				// exportURL: exportFactoryExcel,
 | 
			
		||||
			},
 | 
			
		||||
			tableProps,
 | 
			
		||||
			tableBtn: [
 | 
			
		||||
				this.$auth.hasPermi(`base:quality-scrap-type:update`)
 | 
			
		||||
					? {
 | 
			
		||||
							type: 'edit',
 | 
			
		||||
							btnName: '编辑',
 | 
			
		||||
					  }
 | 
			
		||||
					: undefined,
 | 
			
		||||
				this.$auth.hasPermi(`base:quality-scrap-type:delete`)
 | 
			
		||||
					? {
 | 
			
		||||
							type: 'delete',
 | 
			
		||||
							btnName: '删除',
 | 
			
		||||
					  }
 | 
			
		||||
					: undefined,
 | 
			
		||||
			].filter((v) => v),
 | 
			
		||||
			tableData: [],
 | 
			
		||||
			formConfig: [
 | 
			
		||||
				{
 | 
			
		||||
					type: 'input',
 | 
			
		||||
					label: '报废类型',
 | 
			
		||||
					placeholder: '报废类型',
 | 
			
		||||
					param: 'name',
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					type: 'button',
 | 
			
		||||
					btnName: '查询',
 | 
			
		||||
					name: 'search',
 | 
			
		||||
					color: 'primary',
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					type: 'separate',
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					type: this.$auth.hasPermi('base:quality-scrap-type:create')
 | 
			
		||||
						? 'button'
 | 
			
		||||
						: '',
 | 
			
		||||
					btnName: '新增',
 | 
			
		||||
					name: 'add',
 | 
			
		||||
					color: 'success',
 | 
			
		||||
					plain: true,
 | 
			
		||||
				},
 | 
			
		||||
			],
 | 
			
		||||
			listQuery: {
 | 
			
		||||
				pageNo: 1,
 | 
			
		||||
				pageSize: 20,
 | 
			
		||||
			},
 | 
			
		||||
			total: 0,
 | 
			
		||||
		};
 | 
			
		||||
	},
 | 
			
		||||
	components: {
 | 
			
		||||
		AddOrUpdate,
 | 
			
		||||
	},
 | 
			
		||||
	created() {},
 | 
			
		||||
	methods: {
 | 
			
		||||
		// 获取数据列表
 | 
			
		||||
		getDataList() {
 | 
			
		||||
			this.dataListLoading = true;
 | 
			
		||||
			this.urlOptions.getDataListURL(this.listQuery).then((response) => {
 | 
			
		||||
				this.tableData = response.data.list;
 | 
			
		||||
				this.total = response.data.total;
 | 
			
		||||
				this.dataListLoading = false;
 | 
			
		||||
			});
 | 
			
		||||
		},
 | 
			
		||||
		buttonClick(val) {
 | 
			
		||||
			switch (val.btnName) {
 | 
			
		||||
				case 'search':
 | 
			
		||||
					this.listQuery.pageNo = 1;
 | 
			
		||||
					this.listQuery.name = val.name ? val.name : undefined;
 | 
			
		||||
					this.getDataList();
 | 
			
		||||
					break;
 | 
			
		||||
				case 'add':
 | 
			
		||||
					this.addOrEditTitle = '新增';
 | 
			
		||||
					this.addOrUpdateVisible = true;
 | 
			
		||||
					this.addOrUpdateHandle();
 | 
			
		||||
					break;
 | 
			
		||||
				case 'export':
 | 
			
		||||
					this.handleExport();
 | 
			
		||||
					break;
 | 
			
		||||
				default:
 | 
			
		||||
					console.log(val);
 | 
			
		||||
			}
 | 
			
		||||
		},
 | 
			
		||||
	},
 | 
			
		||||
};
 | 
			
		||||
</script>
 | 
			
		||||
@@ -1,218 +0,0 @@
 | 
			
		||||
<template>
 | 
			
		||||
  <div class="app-container">
 | 
			
		||||
 | 
			
		||||
    <!-- 搜索工作栏 -->
 | 
			
		||||
    <search-bar
 | 
			
		||||
      :formConfigs="formConfig"
 | 
			
		||||
      ref="searchBarForm"
 | 
			
		||||
      @headBtnClick="buttonClick"
 | 
			
		||||
    />
 | 
			
		||||
    <!-- 列表 -->
 | 
			
		||||
    <base-table
 | 
			
		||||
      :page="queryParams.pageNo"
 | 
			
		||||
      :limit="queryParams.pageSize"
 | 
			
		||||
      :table-props="tableProps"
 | 
			
		||||
      :table-data="list"
 | 
			
		||||
      :max-height="tableH"
 | 
			
		||||
    >
 | 
			
		||||
      <method-btn
 | 
			
		||||
        v-if="tableBtn.length"
 | 
			
		||||
        slot="handleBtn"
 | 
			
		||||
        :width="80"
 | 
			
		||||
        label="操作"
 | 
			
		||||
        :method-list="tableBtn"
 | 
			
		||||
        @clickBtn="handleClick"
 | 
			
		||||
      />
 | 
			
		||||
    </base-table>
 | 
			
		||||
    <pagination
 | 
			
		||||
      :page.sync="queryParams.pageNo"
 | 
			
		||||
      :limit.sync="queryParams.pageSize"
 | 
			
		||||
      :total="total"
 | 
			
		||||
      @pagination="getList"
 | 
			
		||||
    />
 | 
			
		||||
    <!-- 新增 -->
 | 
			
		||||
    <base-dialog
 | 
			
		||||
      :dialogTitle="addOrEditTitle"
 | 
			
		||||
      :dialogVisible="centervisible"
 | 
			
		||||
      @cancel="handleCancel"
 | 
			
		||||
      @confirm="handleConfirm"
 | 
			
		||||
      :before-close="handleCancel"
 | 
			
		||||
    >
 | 
			
		||||
      <energy-plc-add ref="energyPlc" @successSubmit="successSubmit" />
 | 
			
		||||
    </base-dialog>
 | 
			
		||||
  </div>
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script>
 | 
			
		||||
import { getEnergyPlcPage, deleteEnergyPlc } from "@/api/base/energyPlc";
 | 
			
		||||
// import { publicFormatter } from '@/utils/dict'
 | 
			
		||||
import EnergyPlcAdd from './components/energyPlcAdd.vue'
 | 
			
		||||
const tableProps = [
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'plcTableName',
 | 
			
		||||
    label: '关联表名'
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'code',
 | 
			
		||||
    label: '关联表编码',
 | 
			
		||||
    minWidth: 150,
 | 
			
		||||
    showOverflowtooltip: true
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'name',
 | 
			
		||||
    label: '标识名'
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'enName',
 | 
			
		||||
    label: '英文标识名'
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'collection',
 | 
			
		||||
    label: '是否采集'
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'description',
 | 
			
		||||
    label: '描述',
 | 
			
		||||
    showOverflowtooltip: true
 | 
			
		||||
  }
 | 
			
		||||
]
 | 
			
		||||
export default {
 | 
			
		||||
  name: "EnergyPlc",
 | 
			
		||||
  components: { EnergyPlcAdd },
 | 
			
		||||
  data() {
 | 
			
		||||
    return {
 | 
			
		||||
      formConfig: [
 | 
			
		||||
        {
 | 
			
		||||
          type: 'input',
 | 
			
		||||
          label: '标识名',
 | 
			
		||||
          placeholder: '标识名',
 | 
			
		||||
          param: 'name'
 | 
			
		||||
        },
 | 
			
		||||
        {
 | 
			
		||||
          type: 'button',
 | 
			
		||||
          btnName: '查询',
 | 
			
		||||
          name: 'search',
 | 
			
		||||
          color: 'primary'
 | 
			
		||||
        },
 | 
			
		||||
        {
 | 
			
		||||
          type: 'separate'
 | 
			
		||||
        },
 | 
			
		||||
        {
 | 
			
		||||
          type: this.$auth.hasPermi('base:energy-plc:create') ? 'button' : '',
 | 
			
		||||
          btnName: '新增',
 | 
			
		||||
          name: 'add',
 | 
			
		||||
          color: 'success',
 | 
			
		||||
          plain: true
 | 
			
		||||
        }
 | 
			
		||||
      ],
 | 
			
		||||
      tableProps,
 | 
			
		||||
      tableBtn: [
 | 
			
		||||
        this.$auth.hasPermi('base:energy-plc:update')
 | 
			
		||||
          ? {
 | 
			
		||||
              type: 'edit',
 | 
			
		||||
              btnName: '编辑'
 | 
			
		||||
            }
 | 
			
		||||
          : undefined,
 | 
			
		||||
        this.$auth.hasPermi('base:energy-plc:delete')
 | 
			
		||||
          ? {
 | 
			
		||||
              type: 'delete',
 | 
			
		||||
              btnName: '删除'
 | 
			
		||||
            }
 | 
			
		||||
          : undefined
 | 
			
		||||
      ].filter((v) => v),
 | 
			
		||||
      tableH: this.tableHeight(260),
 | 
			
		||||
      collectionList: [
 | 
			
		||||
        {value: 0,label: '否'},
 | 
			
		||||
        {value: 1,label: '是'}
 | 
			
		||||
      ],
 | 
			
		||||
      // 总条数
 | 
			
		||||
      total: 0,
 | 
			
		||||
      // 班次基础信息列表
 | 
			
		||||
      list: [],
 | 
			
		||||
      // 弹出层标题
 | 
			
		||||
      addOrEditTitle: "",
 | 
			
		||||
      // 是否显示弹出层
 | 
			
		||||
      centervisible: false,
 | 
			
		||||
      // 查询参数
 | 
			
		||||
      queryParams: {
 | 
			
		||||
        pageNo: 1,
 | 
			
		||||
        pageSize: 20,
 | 
			
		||||
        name: null
 | 
			
		||||
      }
 | 
			
		||||
    };
 | 
			
		||||
  },
 | 
			
		||||
  created() {
 | 
			
		||||
    window.addEventListener('resize', () => {
 | 
			
		||||
      this.tableH = this.tableHeight(260)
 | 
			
		||||
    })
 | 
			
		||||
    this.getList();
 | 
			
		||||
  },
 | 
			
		||||
  methods: {
 | 
			
		||||
    buttonClick(val) {
 | 
			
		||||
      switch (val.btnName) {
 | 
			
		||||
        case 'search':
 | 
			
		||||
          this.queryParams.pageNo = 1;
 | 
			
		||||
          this.queryParams.name = val.name
 | 
			
		||||
          this.getList()
 | 
			
		||||
          break
 | 
			
		||||
        default:
 | 
			
		||||
          this.addOrEditTitle = '新增'
 | 
			
		||||
          this.centervisible = true
 | 
			
		||||
          this.$nextTick(() => {
 | 
			
		||||
            this.$refs.energyPlc.init()
 | 
			
		||||
          })
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
    /** 查询列表 */
 | 
			
		||||
    getList() {
 | 
			
		||||
      getEnergyPlcPage(this.queryParams).then(response => {
 | 
			
		||||
        let arr = response.data.list || [];
 | 
			
		||||
        arr&&arr.map(item => {
 | 
			
		||||
          this.collectionList.map(i => {
 | 
			
		||||
            if (item.collection === i.value) {
 | 
			
		||||
              item.collection = i.label
 | 
			
		||||
            }
 | 
			
		||||
          })
 | 
			
		||||
        })
 | 
			
		||||
        this.list = arr
 | 
			
		||||
        this.total = response.data.total;
 | 
			
		||||
      });
 | 
			
		||||
    },
 | 
			
		||||
    handleClick(val) {
 | 
			
		||||
      switch (val.type) {
 | 
			
		||||
        case 'edit':
 | 
			
		||||
          this.addOrEditTitle = '编辑'
 | 
			
		||||
          this.$nextTick(() => {
 | 
			
		||||
            this.$refs.energyPlc.init(val.data.id)
 | 
			
		||||
          })
 | 
			
		||||
          this.centervisible = true
 | 
			
		||||
          break
 | 
			
		||||
        default:
 | 
			
		||||
        this.handleDelete(val.data)
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
    handleCancel() {
 | 
			
		||||
      this.$refs.energyPlc.formClear()
 | 
			
		||||
      this.centervisible = false
 | 
			
		||||
      this.addOrEditTitle = ''
 | 
			
		||||
    },
 | 
			
		||||
    handleConfirm() {
 | 
			
		||||
      this.$refs.energyPlc.submitForm()
 | 
			
		||||
    },
 | 
			
		||||
    successSubmit() {
 | 
			
		||||
      this.handleCancel()
 | 
			
		||||
      this.getList()
 | 
			
		||||
    },
 | 
			
		||||
    /** 删除按钮操作 */
 | 
			
		||||
    handleDelete(row) {
 | 
			
		||||
      this.$modal.confirm('是否确认删除关联表名为"' + row.name + '"的数据项?').then(function() {
 | 
			
		||||
          return deleteEnergyPlc(row.id);
 | 
			
		||||
        }).then(() => {
 | 
			
		||||
          this.queryParams.pageNo = 1;
 | 
			
		||||
          this.getList();
 | 
			
		||||
          this.$modal.msgSuccess("删除成功");
 | 
			
		||||
        }).catch(() => {});
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
};
 | 
			
		||||
</script>
 | 
			
		||||
@@ -280,7 +280,7 @@ export default {
 | 
			
		||||
 | 
			
		||||
		async fillProductOptions() {
 | 
			
		||||
			const { data } = await this.$axios({
 | 
			
		||||
				url: '/base/core-product/listAll',
 | 
			
		||||
				url: '/base/core-product-material/listAll',
 | 
			
		||||
				method: 'get',
 | 
			
		||||
			});
 | 
			
		||||
			const cfg = this.searchBarFormConfig.find(
 | 
			
		||||
 
 | 
			
		||||
@@ -94,7 +94,7 @@ export default {
 | 
			
		||||
		return {
 | 
			
		||||
			readOnly: false,
 | 
			
		||||
			chosedLogId: false,
 | 
			
		||||
			searchBarKeys: ['equipmentName', 'recordTime'],
 | 
			
		||||
			searchBarKeys: ['equipmentName', 'createTime'],
 | 
			
		||||
			tableBtn: [
 | 
			
		||||
				// this.$auth.hasPermi('equipment:spare-parts-config:update')
 | 
			
		||||
				// 	? {
 | 
			
		||||
@@ -124,11 +124,11 @@ export default {
 | 
			
		||||
					label: '报警级别',
 | 
			
		||||
					filter: publicFormatter(this.DICT_TYPE.EQU_ALARM_LEVEL),
 | 
			
		||||
				},
 | 
			
		||||
				{ prop: 'createTime', label: '报警时间', filter: timeFilter }, // 接口缺
 | 
			
		||||
				{ prop: 'alarmCode', label: '设备报警码' }, // 接口缺
 | 
			
		||||
				{ prop: 'createTime', label: '报警时间', filter: timeFilter },
 | 
			
		||||
				{ prop: 'alarmCode', label: '设备报警码' },
 | 
			
		||||
				{ prop: 'alarmContent', label: '报警内容' },
 | 
			
		||||
				{ prop: 'opt1', label: '处理记录', name: '查看', subcomponent: btn },
 | 
			
		||||
				{ prop: 'opt2', label: '处理', name: '报警处理', subcomponent: btn }, // TODO: 是否换成按钮, 群里问
 | 
			
		||||
				{ prop: 'opt2', label: '处理', name: '报警处理', subcomponent: btn },
 | 
			
		||||
				// { prop: 'remark', label: '备注' },
 | 
			
		||||
			],
 | 
			
		||||
			searchBarFormConfig: [
 | 
			
		||||
@@ -145,8 +145,8 @@ export default {
 | 
			
		||||
					dateType: 'daterange', // datetimerange
 | 
			
		||||
					// format: 'yyyy-MM-dd HH:mm:ss',
 | 
			
		||||
					format: 'yyyy-MM-dd',
 | 
			
		||||
					valueFormat: 'timestamp',
 | 
			
		||||
					// valueFormat: 'yyyy-MM-dd HH:mm:ss',
 | 
			
		||||
					// valueFormat: 'timestamp',
 | 
			
		||||
					valueFormat: 'yyyy-MM-dd HH:mm:ss',
 | 
			
		||||
					rangeSeparator: '-',
 | 
			
		||||
					startPlaceholder: '开始日期',
 | 
			
		||||
					endPlaceholder: '结束日期',
 | 
			
		||||
 
 | 
			
		||||
@@ -383,7 +383,7 @@ export default {
 | 
			
		||||
 | 
			
		||||
		// 新增属性
 | 
			
		||||
		handleAddAttr() {
 | 
			
		||||
			if (!this.dataId) return this.$message.error('请先创建设备分组信息');
 | 
			
		||||
			if (!this.dataId) return this.$message.warning('请先创建设备分组信息');
 | 
			
		||||
			this.attrForm = {
 | 
			
		||||
				id: null,
 | 
			
		||||
				equipmentGroupId: this.dataId,
 | 
			
		||||
 
 | 
			
		||||
@@ -382,7 +382,7 @@ export default {
 | 
			
		||||
 | 
			
		||||
		// 新增属性
 | 
			
		||||
		handleAddAttr() {
 | 
			
		||||
			if (!this.dataId) return this.$message.error('请先创建设备分组信息');
 | 
			
		||||
			if (!this.dataId) return this.$message.warning('请先创建设备分组信息');
 | 
			
		||||
			this.attrForm = {
 | 
			
		||||
				id: null,
 | 
			
		||||
				equipmentGroupId: this.dataId,
 | 
			
		||||
 
 | 
			
		||||
@@ -84,10 +84,10 @@ export default {
 | 
			
		||||
					: undefined,
 | 
			
		||||
			].filter((v) => v),
 | 
			
		||||
			tableProps: [
 | 
			
		||||
				{ prop: 'program', label: '巡检项目' },
 | 
			
		||||
				{ prop: 'content', label: '巡检内容' },
 | 
			
		||||
				{ prop: 'code', label: '巡检内容编码' },
 | 
			
		||||
				{ prop: 'remark', label: '备注' },
 | 
			
		||||
				{ prop: 'program', label: '巡检项目', showOverflowtooltip: true },
 | 
			
		||||
				{ prop: 'content', label: '巡检内容', minWidth: 150, showOverflowtooltip: true },
 | 
			
		||||
				{ prop: 'code', label: '巡检内容编码', showOverflowtooltip: true },
 | 
			
		||||
				{ prop: 'remark', label: '备注', showOverflowtooltip: true },
 | 
			
		||||
			],
 | 
			
		||||
			searchBarFormConfig: [
 | 
			
		||||
				{
 | 
			
		||||
 
 | 
			
		||||
@@ -60,110 +60,112 @@
 | 
			
		||||
						</el-col>
 | 
			
		||||
					</el-row>
 | 
			
		||||
 | 
			
		||||
					<el-divider style="margin-top: -10px" />
 | 
			
		||||
					<el-divider />
 | 
			
		||||
					
 | 
			
		||||
					<small-title style="margin: 16px 0; padding-left: 8px" :no-padding="true">
 | 
			
		||||
						{{ '设备维修信息' }}
 | 
			
		||||
					</small-title>
 | 
			
		||||
					<el-row :gutter="20">
 | 
			
		||||
						<el-col :span="6">
 | 
			
		||||
							<el-form-item
 | 
			
		||||
								label="维修开始时间"
 | 
			
		||||
								prop="maintenanceStartTime"
 | 
			
		||||
								:rules="[{ required: true, message: '维修开始时间不能为空', trigger: 'blur' }]">
 | 
			
		||||
								<el-date-picker
 | 
			
		||||
									v-model="dataForm.maintenanceStartTime"
 | 
			
		||||
									type="datetime"
 | 
			
		||||
									:disabled="disabled"
 | 
			
		||||
									placeholder="请选择维修开始时间"
 | 
			
		||||
									value-format="timestamp" />
 | 
			
		||||
							</el-form-item>
 | 
			
		||||
						</el-col>
 | 
			
		||||
						<el-col :span="6">
 | 
			
		||||
							<el-form-item
 | 
			
		||||
								label="维修结束时间"
 | 
			
		||||
								prop="maintenanceFinishTime"
 | 
			
		||||
								:rules="[{ required: true, message: '维修结束时间不能为空', trigger: 'blur' }]">
 | 
			
		||||
								<el-date-picker
 | 
			
		||||
									v-model="dataForm.maintenanceFinishTime"
 | 
			
		||||
									type="datetime"
 | 
			
		||||
									:disabled="disabled"
 | 
			
		||||
									placeholder="请选择维修开始时间"
 | 
			
		||||
									value-format="timestamp" />
 | 
			
		||||
							</el-form-item>
 | 
			
		||||
						</el-col>
 | 
			
		||||
						<el-col :span="6">
 | 
			
		||||
							<el-form-item
 | 
			
		||||
								label="维修方式"
 | 
			
		||||
								prop="repairMode"
 | 
			
		||||
								:rules="[{ required: true, message: '维修方式不能为空', trigger: 'blur' }]">
 | 
			
		||||
								<el-select
 | 
			
		||||
									:disabled="disabled"
 | 
			
		||||
									v-model="dataForm.repairMode"
 | 
			
		||||
									placeholder="请选择维修方式">
 | 
			
		||||
									<el-option
 | 
			
		||||
										v-for="opt in getDictDatas('repair-mode')"
 | 
			
		||||
										:key="opt.value"
 | 
			
		||||
										:label="opt.label"
 | 
			
		||||
										:value="opt.value" />
 | 
			
		||||
								</el-select>
 | 
			
		||||
							</el-form-item>
 | 
			
		||||
						</el-col>
 | 
			
		||||
						<el-col :span="6">
 | 
			
		||||
							<el-form-item label="故障类型" prop="faultType">
 | 
			
		||||
								<el-select
 | 
			
		||||
									:disabled="disabled"
 | 
			
		||||
									v-model="dataForm.faultType"
 | 
			
		||||
									placeholder="请选择故障类型">
 | 
			
		||||
									<el-option
 | 
			
		||||
										v-for="opt in getDictDatas('fault-type')"
 | 
			
		||||
										:key="opt.value"
 | 
			
		||||
										:label="opt.label"
 | 
			
		||||
										:value="opt.value" />
 | 
			
		||||
								</el-select>
 | 
			
		||||
							</el-form-item>
 | 
			
		||||
						</el-col>
 | 
			
		||||
					</el-row>
 | 
			
		||||
					<div v-if=" disabled && dataForm.maintenanceStatus === 1 ? true : !disabled ? true : false">
 | 
			
		||||
						<small-title style="margin: 16px 0; padding-left: 8px" :no-padding="true">
 | 
			
		||||
							{{ '设备维修信息' }}
 | 
			
		||||
						</small-title>
 | 
			
		||||
						<el-row :gutter="20">
 | 
			
		||||
							<el-col :span="6">
 | 
			
		||||
								<el-form-item
 | 
			
		||||
									label="维修开始时间"
 | 
			
		||||
									prop="maintenanceStartTime"
 | 
			
		||||
									:rules="[{ required: true, message: '维修开始时间不能为空', trigger: 'blur' }]">
 | 
			
		||||
									<el-date-picker
 | 
			
		||||
										v-model="dataForm.maintenanceStartTime"
 | 
			
		||||
										type="datetime"
 | 
			
		||||
										:disabled="disabled"
 | 
			
		||||
										placeholder="请选择维修开始时间"
 | 
			
		||||
										value-format="timestamp" />
 | 
			
		||||
								</el-form-item>
 | 
			
		||||
							</el-col>
 | 
			
		||||
							<el-col :span="6">
 | 
			
		||||
								<el-form-item
 | 
			
		||||
									label="维修结束时间"
 | 
			
		||||
									prop="maintenanceFinishTime"
 | 
			
		||||
									:rules="[{ required: true, message: '维修结束时间不能为空', trigger: 'blur' }]">
 | 
			
		||||
									<el-date-picker
 | 
			
		||||
										v-model="dataForm.maintenanceFinishTime"
 | 
			
		||||
										type="datetime"
 | 
			
		||||
										:disabled="disabled"
 | 
			
		||||
										placeholder="请选择维修开始时间"
 | 
			
		||||
										value-format="timestamp" />
 | 
			
		||||
								</el-form-item>
 | 
			
		||||
							</el-col>
 | 
			
		||||
							<el-col :span="6">
 | 
			
		||||
								<el-form-item
 | 
			
		||||
									label="维修方式"
 | 
			
		||||
									prop="repairMode"
 | 
			
		||||
									:rules="[{ required: true, message: '维修方式不能为空', trigger: 'blur' }]">
 | 
			
		||||
									<el-select
 | 
			
		||||
										:disabled="disabled"
 | 
			
		||||
										v-model="dataForm.repairMode"
 | 
			
		||||
										placeholder="请选择维修方式">
 | 
			
		||||
										<el-option
 | 
			
		||||
											v-for="opt in getDictDatas('repair-mode')"
 | 
			
		||||
											:key="opt.value"
 | 
			
		||||
											:label="opt.label"
 | 
			
		||||
											:value="opt.value" />
 | 
			
		||||
									</el-select>
 | 
			
		||||
								</el-form-item>
 | 
			
		||||
							</el-col>
 | 
			
		||||
							<el-col :span="6">
 | 
			
		||||
								<el-form-item label="故障类型" prop="faultType">
 | 
			
		||||
									<el-select
 | 
			
		||||
										:disabled="disabled"
 | 
			
		||||
										v-model="dataForm.faultType"
 | 
			
		||||
										placeholder="请选择故障类型">
 | 
			
		||||
										<el-option
 | 
			
		||||
											v-for="opt in getDictDatas('fault-type')"
 | 
			
		||||
											:key="opt.value"
 | 
			
		||||
											:label="opt.label"
 | 
			
		||||
											:value="opt.value" />
 | 
			
		||||
									</el-select>
 | 
			
		||||
								</el-form-item>
 | 
			
		||||
							</el-col>
 | 
			
		||||
						</el-row>
 | 
			
		||||
 | 
			
		||||
					<el-row :gutter="20">
 | 
			
		||||
						<el-col>
 | 
			
		||||
							<el-form-item
 | 
			
		||||
								label="故障明细"
 | 
			
		||||
								prop="faultDetail"
 | 
			
		||||
								:rules="[{ required: true, message: '故障明细不能为空', trigger: 'blur' }]">
 | 
			
		||||
								<!-- // 富文本 -->
 | 
			
		||||
								<editor v-model="dataForm.faultDetail" :read-only="disabled" :min-height="150"/>
 | 
			
		||||
							</el-form-item>
 | 
			
		||||
						</el-col>
 | 
			
		||||
					</el-row>
 | 
			
		||||
						<el-row :gutter="20">
 | 
			
		||||
							<el-col>
 | 
			
		||||
								<el-form-item
 | 
			
		||||
									label="故障明细"
 | 
			
		||||
									prop="faultDetail"
 | 
			
		||||
									:rules="[{ required: true, message: '故障明细不能为空', trigger: 'blur' }]">
 | 
			
		||||
									<!-- // 富文本 -->
 | 
			
		||||
									<editor v-model="dataForm.faultDetail" :read-only="disabled" :min-height="150"/>
 | 
			
		||||
								</el-form-item>
 | 
			
		||||
							</el-col>
 | 
			
		||||
						</el-row>
 | 
			
		||||
 | 
			
		||||
					<el-row :gutter="20">
 | 
			
		||||
						<el-col>
 | 
			
		||||
							<el-form-item label="维修记录" prop="maintenanceDetail">
 | 
			
		||||
								<!-- // 富文本 -->
 | 
			
		||||
								<editor v-model="dataForm.maintenanceDetail" :read-only="disabled" :min-height="150"/>
 | 
			
		||||
							</el-form-item>
 | 
			
		||||
						</el-col>
 | 
			
		||||
					</el-row>
 | 
			
		||||
						<el-row :gutter="20">
 | 
			
		||||
							<el-col>
 | 
			
		||||
								<el-form-item label="维修记录" prop="maintenanceDetail">
 | 
			
		||||
									<!-- // 富文本 -->
 | 
			
		||||
									<editor v-model="dataForm.maintenanceDetail" :read-only="disabled" :min-height="150"/>
 | 
			
		||||
								</el-form-item>
 | 
			
		||||
							</el-col>
 | 
			
		||||
						</el-row>
 | 
			
		||||
 | 
			
		||||
					<el-row :gutter="20">
 | 
			
		||||
						<el-col>
 | 
			
		||||
							<el-form-item label="维修附件" prop="file">
 | 
			
		||||
								<FileUpload v-model="file" :limit="1" :f-name="fileName" :disabled="disabled" @name="setFileName" />
 | 
			
		||||
							</el-form-item>
 | 
			
		||||
						</el-col>
 | 
			
		||||
					</el-row>
 | 
			
		||||
						<el-row :gutter="20">
 | 
			
		||||
							<el-col>
 | 
			
		||||
								<el-form-item label="维修附件" prop="file">
 | 
			
		||||
									<FileUpload v-model="file" :limit="1" :f-name="fileName" :disabled="disabled" @name="setFileName" />
 | 
			
		||||
								</el-form-item>
 | 
			
		||||
							</el-col>
 | 
			
		||||
						</el-row>
 | 
			
		||||
 | 
			
		||||
					<el-row :gutter="20">
 | 
			
		||||
						<el-col>
 | 
			
		||||
							<el-form-item label="备注" prop="remark">
 | 
			
		||||
								<el-input
 | 
			
		||||
									v-model="dataForm.remark"
 | 
			
		||||
									:placeholder="`请输入备注`"
 | 
			
		||||
									:disabled="disabled" />
 | 
			
		||||
							</el-form-item>
 | 
			
		||||
						</el-col>
 | 
			
		||||
					</el-row>
 | 
			
		||||
						<el-row :gutter="20">
 | 
			
		||||
							<el-col>
 | 
			
		||||
								<el-form-item label="备注" prop="remark">
 | 
			
		||||
									<el-input
 | 
			
		||||
										v-model="dataForm.remark"
 | 
			
		||||
										:placeholder="`请输入备注`"
 | 
			
		||||
										:disabled="disabled" />
 | 
			
		||||
								</el-form-item>
 | 
			
		||||
							</el-col>
 | 
			
		||||
						</el-row>
 | 
			
		||||
					</div>
 | 
			
		||||
				</el-form>
 | 
			
		||||
 | 
			
		||||
				<div v-if="!disabled" class="drawer-body__footer">
 | 
			
		||||
@@ -249,7 +251,7 @@ export default {
 | 
			
		||||
					getEqRepair(this.dataForm.id).then(response => {
 | 
			
		||||
						this.formLoading = false
 | 
			
		||||
            this.dataForm = response.data;
 | 
			
		||||
						this.dataForm.maintenanceStatus = row.maintenanceStatus || 0
 | 
			
		||||
						this.dataForm.maintenanceStatus = this.dataForm.maintenanceStatus || 0
 | 
			
		||||
						if (this.dataForm.files.length > 0) {
 | 
			
		||||
							this.file = this.dataForm.files[0].fileUrl
 | 
			
		||||
							this.fileName = this.dataForm.files[0].fileName
 | 
			
		||||
 
 | 
			
		||||
@@ -121,7 +121,7 @@ export default {
 | 
			
		||||
				{ prop: 'lineName', label: '产线' },
 | 
			
		||||
				{ prop: 'sectionName', label: '工段' },
 | 
			
		||||
				{ prop: 'equipmentName', label: '设备名称', minWidth: 100, showOverflowtooltip: true },
 | 
			
		||||
				{ prop: 'maintenanceDetail', label: '维修明细' },
 | 
			
		||||
				{ prop: 'maintenanceDetail', label: '维修明细', minWidth: 100, showOverflowtooltip: true },
 | 
			
		||||
				{ prop: 'repairman', label: '维修工', minWidth: 100, showOverflowtooltip: true },
 | 
			
		||||
				{ prop: 'repairmanPhone', label: '联系方式', minWidth: 100, showOverflowtooltip: true },
 | 
			
		||||
				{ prop: 'remark', label: '备注', minWidth: 120, showOverflowtooltip: true },
 | 
			
		||||
 
 | 
			
		||||
@@ -9,72 +9,80 @@
 | 
			
		||||
	<el-drawer
 | 
			
		||||
		:visible.sync="visible"
 | 
			
		||||
		:show-close="false"
 | 
			
		||||
		:wrapper-closable="false"
 | 
			
		||||
		:wrapper-closable="disabled"
 | 
			
		||||
		class="drawer"
 | 
			
		||||
		size="60%">
 | 
			
		||||
		size="60%"
 | 
			
		||||
		@closed="$emit('destroy')">
 | 
			
		||||
		<small-title slot="title" :no-padding="true">
 | 
			
		||||
			{{ disabled ? '查看备件' : '添加备件' }}
 | 
			
		||||
		</small-title>
 | 
			
		||||
		<el-form
 | 
			
		||||
			ref="form"
 | 
			
		||||
			:model="dataForm"
 | 
			
		||||
			label-width="100px"
 | 
			
		||||
			v-loading="formLoading">
 | 
			
		||||
			<el-row :gutter="20">
 | 
			
		||||
				<el-col :span="12">
 | 
			
		||||
					<el-form-item label="配置名" prop="name">
 | 
			
		||||
						<span>{{ dataForm.name }}</span>
 | 
			
		||||
					</el-form-item>
 | 
			
		||||
				</el-col>
 | 
			
		||||
				<el-col :span="12">
 | 
			
		||||
					<el-form-item label="设备名称" prop="equipmentName">
 | 
			
		||||
						<span>{{ dataForm.equipmentName }}</span>
 | 
			
		||||
					</el-form-item>
 | 
			
		||||
				</el-col>
 | 
			
		||||
			</el-row>
 | 
			
		||||
			<el-row :gutter="20">
 | 
			
		||||
				<el-col :span="12">
 | 
			
		||||
					<el-form-item label="负责人" prop="responsible">
 | 
			
		||||
						<span>{{ dataForm.responsible }}</span>
 | 
			
		||||
					</el-form-item>
 | 
			
		||||
				</el-col>
 | 
			
		||||
			</el-row>
 | 
			
		||||
			<el-form-item label="描述" prop="faultTime">
 | 
			
		||||
				<editor v-model="dataForm.description" read-only :min-height="200"/>
 | 
			
		||||
			</el-form-item>
 | 
			
		||||
		</el-form>
 | 
			
		||||
		<div class="content">
 | 
			
		||||
			<el-form
 | 
			
		||||
				ref="form"
 | 
			
		||||
				:model="dataForm"
 | 
			
		||||
				label-width="100px"
 | 
			
		||||
				label-position="top"
 | 
			
		||||
				v-loading="formLoading">
 | 
			
		||||
				<el-row :gutter="20">
 | 
			
		||||
					<el-col :span="6">
 | 
			
		||||
						<el-form-item label="配置名" prop="name">
 | 
			
		||||
							<span>{{ dataForm.name }}</span>
 | 
			
		||||
						</el-form-item>
 | 
			
		||||
					</el-col>
 | 
			
		||||
					<el-col :span="6">
 | 
			
		||||
						<el-form-item label="设备名称" prop="equipmentName">
 | 
			
		||||
							<span>{{ dataForm.equipmentName }}</span>
 | 
			
		||||
						</el-form-item>
 | 
			
		||||
					</el-col>
 | 
			
		||||
					<el-col :span="6">
 | 
			
		||||
						<el-form-item label="负责人" prop="responsible">
 | 
			
		||||
							<span>{{ dataForm.responsible }}</span>
 | 
			
		||||
						</el-form-item>
 | 
			
		||||
					</el-col>
 | 
			
		||||
				</el-row>
 | 
			
		||||
				<el-form-item label="描述" prop="description">
 | 
			
		||||
					<div v-html="dataForm.description" style="padding: 5px; margin: 0; border: 1px solid #dfdfdf" />
 | 
			
		||||
					<!-- <editor v-model="dataForm.description" read-only :min-height="200"/> -->
 | 
			
		||||
				</el-form-item>
 | 
			
		||||
			</el-form>
 | 
			
		||||
			
 | 
			
		||||
			<div v-if="!disabled" class="action_btn">
 | 
			
		||||
				<template>
 | 
			
		||||
					<span style="display: inline-block;" @click="addNew()">
 | 
			
		||||
						<svg-icon style="width: 14px; height: 14px" class="item-icon" icon-class="table_add" />
 | 
			
		||||
						<span class="add">添加</span>
 | 
			
		||||
					</span>
 | 
			
		||||
				</template>
 | 
			
		||||
			<div>
 | 
			
		||||
				<small-title style="margin: 16px 0; padding-left: 8px" :no-padding="true">
 | 
			
		||||
					{{ '备品备件' }}
 | 
			
		||||
				</small-title>
 | 
			
		||||
				<div v-if="!disabled" class="action_btn">
 | 
			
		||||
					<template>
 | 
			
		||||
						<span style="display: inline-block;" @click="addNew()">
 | 
			
		||||
							<svg-icon style="width: 14px; height: 14px" class="item-icon" icon-class="table_add" />
 | 
			
		||||
							<span class="add">添加</span>
 | 
			
		||||
						</span>
 | 
			
		||||
					</template>
 | 
			
		||||
				</div>
 | 
			
		||||
				<base-table
 | 
			
		||||
					:table-props="tableProps"
 | 
			
		||||
					:page="listQuery.pageNo"
 | 
			
		||||
					:limit="listQuery.pageSize"
 | 
			
		||||
					:table-data="list">
 | 
			
		||||
					<method-btn
 | 
			
		||||
						v-if="!disabled"
 | 
			
		||||
						slot="handleBtn"
 | 
			
		||||
						:width="120"
 | 
			
		||||
						label="操作"
 | 
			
		||||
						:method-list="tableBtn"
 | 
			
		||||
						@clickBtn="handleClick" />
 | 
			
		||||
				</base-table>
 | 
			
		||||
				<pagination
 | 
			
		||||
					v-show="listQuery.total > 0"
 | 
			
		||||
					:total="listQuery.total"
 | 
			
		||||
					:page.sync="listQuery.pageNo"
 | 
			
		||||
					:limit.sync="listQuery.pageSize"
 | 
			
		||||
					:page-sizes="[5, 10, 15]"
 | 
			
		||||
					@pagination="getList" />
 | 
			
		||||
			</div>	
 | 
			
		||||
			<base-table
 | 
			
		||||
				:table-props="tableProps"
 | 
			
		||||
				:page="listQuery.pageNo"
 | 
			
		||||
				:limit="listQuery.pageSize"
 | 
			
		||||
				:table-data="list">
 | 
			
		||||
				<method-btn
 | 
			
		||||
					v-if="!disabled"
 | 
			
		||||
					slot="handleBtn"
 | 
			
		||||
					:width="120"
 | 
			
		||||
					label="操作"
 | 
			
		||||
					:method-list="tableBtn"
 | 
			
		||||
					@clickBtn="handleClick" />
 | 
			
		||||
			</base-table>
 | 
			
		||||
			<pagination
 | 
			
		||||
				v-show="listQuery.total > 0"
 | 
			
		||||
				:total="listQuery.total"
 | 
			
		||||
				:page.sync="listQuery.pageNo"
 | 
			
		||||
				:limit.sync="listQuery.pageSize"
 | 
			
		||||
				:page-sizes="[5, 10, 15]"
 | 
			
		||||
				@pagination="getList" />
 | 
			
		||||
 | 
			
		||||
		<div class="drawer-body__footer">
 | 
			
		||||
			<el-button type="primary" @click="goback()">关闭</el-button>
 | 
			
		||||
			<div v-if="!disabled" class="drawer-body__footer">
 | 
			
		||||
				<el-button type="primary" @click="goback()">关闭</el-button>
 | 
			
		||||
			</div>
 | 
			
		||||
		</div>
 | 
			
		||||
 | 
			
		||||
		<attr-add
 | 
			
		||||
@@ -255,10 +263,10 @@ export default {
 | 
			
		||||
	padding: 18px;
 | 
			
		||||
}
 | 
			
		||||
.action_btn {
 | 
			
		||||
  /* float: right; */
 | 
			
		||||
  float: right;
 | 
			
		||||
	display: flex;
 | 
			
		||||
	justify-content: right;
 | 
			
		||||
  margin: 5px 15px;
 | 
			
		||||
  margin: -35px 15px;
 | 
			
		||||
  font-size: 14px;
 | 
			
		||||
}
 | 
			
		||||
.add {
 | 
			
		||||
@@ -312,4 +320,7 @@ export default {
 | 
			
		||||
	justify-content: flex-end;
 | 
			
		||||
	padding: 18px;
 | 
			
		||||
}
 | 
			
		||||
.content {
 | 
			
		||||
	padding: 0 20px;
 | 
			
		||||
}
 | 
			
		||||
</style>
 | 
			
		||||
 
 | 
			
		||||
@@ -17,7 +17,7 @@
 | 
			
		||||
				v-if="tableBtn.length"
 | 
			
		||||
				slot="handleBtn"
 | 
			
		||||
				label="操作"
 | 
			
		||||
				:width="250"
 | 
			
		||||
				:width="180"
 | 
			
		||||
				:method-list="tableBtn"
 | 
			
		||||
				@clickBtn="handleTableBtnClick" />
 | 
			
		||||
		</base-table>
 | 
			
		||||
@@ -34,7 +34,7 @@
 | 
			
		||||
		<base-dialog
 | 
			
		||||
			:dialogTitle="title"
 | 
			
		||||
			:dialogVisible="open"
 | 
			
		||||
			width="35%"
 | 
			
		||||
			width="50%"
 | 
			
		||||
			@close="cancel"
 | 
			
		||||
			@cancel="cancel"
 | 
			
		||||
			@confirm="submitForm">
 | 
			
		||||
@@ -44,12 +44,14 @@
 | 
			
		||||
				v-model="form"
 | 
			
		||||
				:disabled="mode == 'detail'"
 | 
			
		||||
				:has-files="false"
 | 
			
		||||
				:rows="rows" />
 | 
			
		||||
				:rows="rows"
 | 
			
		||||
				style="margin: 0 30px" />
 | 
			
		||||
		</base-dialog>
 | 
			
		||||
		<addSparts
 | 
			
		||||
			v-if="addOrUpdateVisible"
 | 
			
		||||
			ref="addOrUpdate"
 | 
			
		||||
			@refreshDataList="getList" />
 | 
			
		||||
			@refreshDataList="getList"
 | 
			
		||||
			@destroy="addOrUpdateVisible = false" />
 | 
			
		||||
	</div>
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
@@ -79,22 +81,24 @@ export default {
 | 
			
		||||
				// 			btnName: '详情',
 | 
			
		||||
				// 	  }
 | 
			
		||||
				// 	: undefined,
 | 
			
		||||
				this.$auth.hasPermi('equipment:spare-parts-config:update')
 | 
			
		||||
				this.$auth.hasPermi('equipment:spare-parts-config:addParts')
 | 
			
		||||
					? {
 | 
			
		||||
							type: 'edit',
 | 
			
		||||
							btnName: '修改',
 | 
			
		||||
							type: 'addParts',
 | 
			
		||||
							btnName: '添加',
 | 
			
		||||
							showTip: '添加备件'
 | 
			
		||||
					  }
 | 
			
		||||
					: undefined,
 | 
			
		||||
				this.$auth.hasPermi('equipment:spare-parts-config:queryParts')
 | 
			
		||||
					? {
 | 
			
		||||
							type: 'queryParts',
 | 
			
		||||
							btnName: '查看备件',
 | 
			
		||||
							btnName: '查看',
 | 
			
		||||
							showTip: '查看备件'
 | 
			
		||||
					  }
 | 
			
		||||
					: undefined,
 | 
			
		||||
				this.$auth.hasPermi('equipment:spare-parts-config:addParts')
 | 
			
		||||
				this.$auth.hasPermi('equipment:spare-parts-config:update')
 | 
			
		||||
					? {
 | 
			
		||||
							type: 'addParts',
 | 
			
		||||
							btnName: '添加备件',
 | 
			
		||||
							type: 'edit',
 | 
			
		||||
							btnName: '修改',
 | 
			
		||||
					  }
 | 
			
		||||
					: undefined,
 | 
			
		||||
				this.$auth.hasPermi('equipment:spare-parts-config:delete')
 | 
			
		||||
@@ -105,15 +109,15 @@ export default {
 | 
			
		||||
					: undefined,
 | 
			
		||||
			].filter((v) => v),
 | 
			
		||||
			tableProps: [
 | 
			
		||||
				{ prop: 'name', label: '配置名' },
 | 
			
		||||
				{ prop: 'lineName', label: '产线' },
 | 
			
		||||
				{ prop: 'sectionName', label: '工段' },
 | 
			
		||||
				{ prop: 'equipmentName', label: '设备名' },
 | 
			
		||||
				{ prop: 'equipmentCode', label: '设备编码' },
 | 
			
		||||
				{ prop: 'responsible', label: '负责人' },
 | 
			
		||||
				{ prop: 'name', label: '配置名', minWidth: 100, showOverflowtooltip: true },
 | 
			
		||||
				{ prop: 'lineName', label: '产线', minWidth: 100, showOverflowtooltip: true },
 | 
			
		||||
				{ prop: 'sectionName', label: '工段', minWidth: 100, showOverflowtooltip: true },
 | 
			
		||||
				{ prop: 'equipmentName', label: '设备名', minWidth: 120, showOverflowtooltip: true },
 | 
			
		||||
				{ prop: 'equipmentCode', label: '设备编码', minWidth: 100, showOverflowtooltip: true },
 | 
			
		||||
				{ prop: 'responsible', label: '负责人', minWidth: 150, showOverflowtooltip: true },
 | 
			
		||||
				// { prop: 'unit', label: '单位', filter: publicFormatter('unit_dict') },
 | 
			
		||||
				{ prop: 'description', label: '描述', subcomponent: htmls },
 | 
			
		||||
				{ prop: 'sparePartNumber', label: '备品备件数量' },
 | 
			
		||||
				{ prop: 'description', label: '描述', subcomponent: htmls, minWidth: 120, showOverflowtooltip: true },
 | 
			
		||||
				{ prop: 'sparePartNumber', label: '备品备件数量', width: 130 },
 | 
			
		||||
				// { prop: 'remark', label: '备注' },
 | 
			
		||||
			],
 | 
			
		||||
			searchBarFormConfig: [
 | 
			
		||||
@@ -198,7 +202,7 @@ export default {
 | 
			
		||||
						prop: 'description', // TODO: 富文本
 | 
			
		||||
						subcomponent: Editor,
 | 
			
		||||
						bind: {
 | 
			
		||||
							'min-height': 192
 | 
			
		||||
							'min-height': 150
 | 
			
		||||
						}
 | 
			
		||||
					},
 | 
			
		||||
				],
 | 
			
		||||
 
 | 
			
		||||
@@ -9,81 +9,84 @@
 | 
			
		||||
	<el-drawer
 | 
			
		||||
		:visible.sync="visible"
 | 
			
		||||
		:show-close="false"
 | 
			
		||||
		:wrapper-closable="false"
 | 
			
		||||
		:wrapper-closable="!isLog"
 | 
			
		||||
		class="drawer"
 | 
			
		||||
		size="60%">
 | 
			
		||||
		<small-title slot="title" :no-padding="true">
 | 
			
		||||
			{{ !isLog ? '操作页面' : '更换记录' }}
 | 
			
		||||
		</small-title>
 | 
			
		||||
		<el-form
 | 
			
		||||
			ref="form"
 | 
			
		||||
			:model="dataForm"
 | 
			
		||||
			label-width="100px"
 | 
			
		||||
			v-loading="formLoading">
 | 
			
		||||
			<el-row :gutter="20">
 | 
			
		||||
				<el-col :span="12">
 | 
			
		||||
					<el-form-item v-if="!isLog" label="配置名" prop="name">
 | 
			
		||||
						<span>{{ dataForm.name }}</span>
 | 
			
		||||
					</el-form-item>
 | 
			
		||||
					<el-form-item v-else label="产线名称" prop="lineName">
 | 
			
		||||
						<span>{{ dataForm.lineName }}</span>
 | 
			
		||||
					</el-form-item>
 | 
			
		||||
				</el-col>
 | 
			
		||||
				<el-col :span="12">
 | 
			
		||||
					<el-form-item label="设备名称" prop="equipmentName">
 | 
			
		||||
						<span>{{ dataForm.equipmentName }}</span>
 | 
			
		||||
					</el-form-item>
 | 
			
		||||
				</el-col>
 | 
			
		||||
			</el-row>
 | 
			
		||||
			<el-form-item label="描述" prop="faultTime">
 | 
			
		||||
				<editor v-model="dataForm.description" read-only :min-height="200"/>
 | 
			
		||||
			</el-form-item>
 | 
			
		||||
		</el-form>
 | 
			
		||||
		<div class="content">
 | 
			
		||||
			<el-form
 | 
			
		||||
				ref="form"
 | 
			
		||||
				:model="dataForm"
 | 
			
		||||
				label-width="90px"
 | 
			
		||||
				v-loading="formLoading">
 | 
			
		||||
				<el-row :gutter="20">
 | 
			
		||||
					<el-col :span="12">
 | 
			
		||||
						<el-form-item v-if="!isLog" label="配置名" prop="name">
 | 
			
		||||
							<span style="margin-left: 5px">{{ dataForm.name }}</span>
 | 
			
		||||
						</el-form-item>
 | 
			
		||||
						<el-form-item v-else label="产线名称" prop="lineName">
 | 
			
		||||
							<span style="margin-left: 5px">{{ dataForm.lineName }}</span>
 | 
			
		||||
						</el-form-item>
 | 
			
		||||
					</el-col>
 | 
			
		||||
					<el-col :span="12">
 | 
			
		||||
						<el-form-item label="设备名称" prop="equipmentName">
 | 
			
		||||
							<span style="margin-left: 5px">{{ dataForm.equipmentName }}</span>
 | 
			
		||||
						</el-form-item>
 | 
			
		||||
					</el-col>
 | 
			
		||||
				</el-row>
 | 
			
		||||
				<el-form-item label="描述" prop="description">
 | 
			
		||||
					<div v-html="dataForm.description" style="padding: 5px; margin-left: 5px; border: 1px solid #dfdfdf" />
 | 
			
		||||
					<!-- <editor v-model="dataForm.description" :read-only="true" :min-height="200"/> -->
 | 
			
		||||
				</el-form-item>
 | 
			
		||||
			</el-form>
 | 
			
		||||
			
 | 
			
		||||
		<div v-if="!isLog">
 | 
			
		||||
			<base-table
 | 
			
		||||
				:table-props="tableProps"
 | 
			
		||||
				:page="listQuery.pageNo"
 | 
			
		||||
				:limit="listQuery.pageSize"
 | 
			
		||||
				:table-data="list">
 | 
			
		||||
				<method-btn
 | 
			
		||||
					v-if="!isLog"
 | 
			
		||||
					slot="handleBtn"
 | 
			
		||||
					:width="120"
 | 
			
		||||
					label="操作"
 | 
			
		||||
					:method-list="tableBtn"
 | 
			
		||||
					@clickBtn="handleClick" />
 | 
			
		||||
			</base-table>
 | 
			
		||||
			<pagination
 | 
			
		||||
				v-show="listQuery.total > 0"
 | 
			
		||||
				:total="listQuery.total"
 | 
			
		||||
				:page.sync="listQuery.pageNo"
 | 
			
		||||
				:limit.sync="listQuery.pageSize"
 | 
			
		||||
				:page-sizes="[5, 10, 15]"
 | 
			
		||||
				@pagination="getList" />
 | 
			
		||||
			<div v-if="!isLog">
 | 
			
		||||
				<base-table
 | 
			
		||||
					:table-props="tableProps"
 | 
			
		||||
					:page="listQuery.pageNo"
 | 
			
		||||
					:limit="listQuery.pageSize"
 | 
			
		||||
					:table-data="list">
 | 
			
		||||
					<method-btn
 | 
			
		||||
						v-if="!isLog"
 | 
			
		||||
						slot="handleBtn"
 | 
			
		||||
						:width="120"
 | 
			
		||||
						label="操作"
 | 
			
		||||
						:method-list="tableBtn"
 | 
			
		||||
						@clickBtn="handleClick" />
 | 
			
		||||
				</base-table>
 | 
			
		||||
				<pagination
 | 
			
		||||
					v-show="listQuery.total > 0"
 | 
			
		||||
					:total="listQuery.total"
 | 
			
		||||
					:page.sync="listQuery.pageNo"
 | 
			
		||||
					:limit.sync="listQuery.pageSize"
 | 
			
		||||
					:page-sizes="[5, 10, 15]"
 | 
			
		||||
					@pagination="getList" />
 | 
			
		||||
			</div>
 | 
			
		||||
 | 
			
		||||
			<div v-else>
 | 
			
		||||
				<!-- 搜索工作栏 -->
 | 
			
		||||
				<SearchBar
 | 
			
		||||
					:formConfigs="formConfig"
 | 
			
		||||
					ref="search-bar"
 | 
			
		||||
					@headBtnClick="buttonClick" />
 | 
			
		||||
				<base-table
 | 
			
		||||
					:table-props="tableProps1"
 | 
			
		||||
					:page="listQuery1.pageNo"
 | 
			
		||||
					:limit="listQuery1.pageSize"
 | 
			
		||||
					:table-data="list1" />
 | 
			
		||||
				<pagination
 | 
			
		||||
					v-show="listQuery1.total > 0"
 | 
			
		||||
					:total="listQuery1.total"
 | 
			
		||||
					:page.sync="listQuery1.pageNo"
 | 
			
		||||
					:limit.sync="listQuery1.pageSize"
 | 
			
		||||
					:page-sizes="[5, 10, 15]"
 | 
			
		||||
					@pagination="getList1" />
 | 
			
		||||
			</div>
 | 
			
		||||
		</div>
 | 
			
		||||
 | 
			
		||||
		<div v-else>
 | 
			
		||||
			<!-- 搜索工作栏 -->
 | 
			
		||||
			<SearchBar
 | 
			
		||||
				:formConfigs="formConfig"
 | 
			
		||||
				ref="search-bar"
 | 
			
		||||
				@headBtnClick="buttonClick" />
 | 
			
		||||
			<base-table
 | 
			
		||||
				:table-props="tableProps1"
 | 
			
		||||
				:page="listQuery1.pageNo"
 | 
			
		||||
				:limit="listQuery1.pageSize"
 | 
			
		||||
				:table-data="list1" />
 | 
			
		||||
			<pagination
 | 
			
		||||
				v-show="listQuery1.total > 0"
 | 
			
		||||
				:total="listQuery1.total"
 | 
			
		||||
				:page.sync="listQuery1.pageNo"
 | 
			
		||||
				:limit.sync="listQuery1.pageSize"
 | 
			
		||||
				:page-sizes="[5, 10, 15]"
 | 
			
		||||
				@pagination="getList1" />
 | 
			
		||||
		</div>
 | 
			
		||||
 | 
			
		||||
		<div class="drawer-body__footer">
 | 
			
		||||
		<div v-if="isLog" class="drawer-body__footer">
 | 
			
		||||
			<el-button type="primary" @click="goback()">关闭</el-button>
 | 
			
		||||
		</div>
 | 
			
		||||
 | 
			
		||||
@@ -429,4 +432,7 @@ export default {
 | 
			
		||||
	justify-content: flex-end;
 | 
			
		||||
	padding: 18px;
 | 
			
		||||
}
 | 
			
		||||
.content {
 | 
			
		||||
	padding: 0 20px;
 | 
			
		||||
}
 | 
			
		||||
</style>
 | 
			
		||||
 
 | 
			
		||||
@@ -74,8 +74,7 @@ const remainBox = {
 | 
			
		||||
		value() {
 | 
			
		||||
			const temp = this.injectData[this.injectData.prop] || null;
 | 
			
		||||
			if (temp) {
 | 
			
		||||
				console.log('12', temp);
 | 
			
		||||
				return temp === 'Green' ? 'green' : 'red';
 | 
			
		||||
				return temp === 'Green' ? '未超期' : temp === 'Red' ? '已超期' : '即将超期';
 | 
			
		||||
			}
 | 
			
		||||
			return this.injectData[this.injectData.prop] || null;
 | 
			
		||||
		},
 | 
			
		||||
@@ -83,7 +82,7 @@ const remainBox = {
 | 
			
		||||
			if (this.value) {
 | 
			
		||||
				// const v = +this.value;
 | 
			
		||||
				// return v < 0 ? 'red' : v >= 0 && v < 2 ? 'yellow' : 'green';
 | 
			
		||||
				return this.value;
 | 
			
		||||
				return this.value === '未超期' ? '#37D97F' : this.value === '已超期' ? '#FF5454' : '#FFD767';
 | 
			
		||||
			}
 | 
			
		||||
			return 'unset';
 | 
			
		||||
		},
 | 
			
		||||
@@ -95,9 +94,9 @@ const remainBox = {
 | 
			
		||||
					this.color
 | 
			
		||||
					// this.color == 'Green' ? 'green' : this.color == 'Red' ? 'red' : 'yellow'
 | 
			
		||||
				}; position:absolute; inset: 0; padding: 0 10px; display: flex; align-items: center; color: ${
 | 
			
		||||
					this.color == 'red' || this.color == 'green' ? '#fff' : 'unset'
 | 
			
		||||
					'#fff'
 | 
			
		||||
				}`}>
 | 
			
		||||
				{this.injectData[this.injectData.prop] || ''}
 | 
			
		||||
				{this.value}
 | 
			
		||||
			</div>
 | 
			
		||||
		);
 | 
			
		||||
	},
 | 
			
		||||
@@ -155,18 +154,19 @@ export default {
 | 
			
		||||
				// 	: undefined,
 | 
			
		||||
			].filter((v) => v),
 | 
			
		||||
			tableProps: [
 | 
			
		||||
				{ prop: 'name', label: '配置名' },
 | 
			
		||||
				{ prop: 'lineName', label: '产线名称' },
 | 
			
		||||
				{ prop: 'sectionName', label: '工段名' },
 | 
			
		||||
				{ prop: 'equipmentName', label: '设备名称' },
 | 
			
		||||
				{ prop: 'responsible', label: '负责人' },
 | 
			
		||||
				{ prop: 'name', label: '配置名', showOverflowtooltip: true },
 | 
			
		||||
				{ prop: 'lineName', label: '产线名称', showOverflowtooltip: true },
 | 
			
		||||
				{ prop: 'sectionName', label: '工段名', showOverflowtooltip: true },
 | 
			
		||||
				{ prop: 'equipmentName', label: '设备名称', showOverflowtooltip: true },
 | 
			
		||||
				{ prop: 'responsible', label: '负责人', minWidth: 130, showOverflowtooltip: true },
 | 
			
		||||
				{ prop: 'color', label: '是否超期', subcomponent: remainBox },
 | 
			
		||||
				{ prop: 'opt1', label: '备件更换', name: '操作', subcomponent: btn },
 | 
			
		||||
				{ prop: 'opt1', label: '备件更换', name: '操作', subcomponent: btn, width: 110 },
 | 
			
		||||
				{
 | 
			
		||||
					prop: 'opt2',
 | 
			
		||||
					label: '更换记录',
 | 
			
		||||
					name: '更新记录',
 | 
			
		||||
					subcomponent: btn,
 | 
			
		||||
					width: 110
 | 
			
		||||
				}, // TODO: 是否换成按钮, 群里问
 | 
			
		||||
				// { prop: 'remark', label: '备注' },
 | 
			
		||||
			],
 | 
			
		||||
 
 | 
			
		||||
@@ -270,7 +270,7 @@ export default {
 | 
			
		||||
			switch (btnName) {
 | 
			
		||||
				case 'search':
 | 
			
		||||
					if (!payload.recordTime || payload.recordTime.length <= 0) {
 | 
			
		||||
						this.$message.error('请选择时间段');
 | 
			
		||||
						this.$message.warning('请选择时间段');
 | 
			
		||||
						return;
 | 
			
		||||
					}
 | 
			
		||||
					this.startTime = new Date(payload.recordTime).getTime();
 | 
			
		||||
@@ -493,7 +493,7 @@ export default {
 | 
			
		||||
			if (code == 0) {
 | 
			
		||||
				const newEqlist = this.objectToArray(data);
 | 
			
		||||
				if (!newEqlist || newEqlist.length == 0) {
 | 
			
		||||
					this.$message.error('该设备没有产量数据');
 | 
			
		||||
					this.$message.warning('该设备没有产量数据');
 | 
			
		||||
					return;
 | 
			
		||||
				}
 | 
			
		||||
				this.graphList.push(...newEqlist);
 | 
			
		||||
 
 | 
			
		||||
@@ -338,7 +338,7 @@ export default {
 | 
			
		||||
			switch (btnName) {
 | 
			
		||||
				case 'search':
 | 
			
		||||
					if (!payload.recordTime || payload.recordTime.length <= 0) {
 | 
			
		||||
						this.$message.error('请选择时间段');
 | 
			
		||||
						this.$message.warning('请选择时间段');
 | 
			
		||||
						return;
 | 
			
		||||
					}
 | 
			
		||||
 | 
			
		||||
@@ -373,7 +373,7 @@ export default {
 | 
			
		||||
 | 
			
		||||
		async submitForm() {
 | 
			
		||||
			if (this.existingEquipments.indexOf(this.queryParams.equipmentId) >= 0) {
 | 
			
		||||
				this.$message.error('该设备已存在');
 | 
			
		||||
				this.$message.warning('该设备已存在');
 | 
			
		||||
				return;
 | 
			
		||||
			}
 | 
			
		||||
			const { code, data } = await this.$axios({
 | 
			
		||||
@@ -387,7 +387,7 @@ export default {
 | 
			
		||||
			if (code == 0) {
 | 
			
		||||
				const newEqlist = this.objectToArray(data);
 | 
			
		||||
				if (!newEqlist || newEqlist.length == 0) {
 | 
			
		||||
					this.$message.error('该设备没有状态数据');
 | 
			
		||||
					this.$message.warning('该设备没有状态数据');
 | 
			
		||||
					return;
 | 
			
		||||
				}
 | 
			
		||||
				this.graphList.push(newEqlist[0]);
 | 
			
		||||
 
 | 
			
		||||
@@ -1,8 +1,8 @@
 | 
			
		||||
<!--
 | 
			
		||||
 * @Author: zwq
 | 
			
		||||
 * @Date: 2021-11-18 14:16:25
 | 
			
		||||
 * @LastEditors: zhp
 | 
			
		||||
 * @LastEditTime: 2023-11-28 10:03:20
 | 
			
		||||
 * @LastEditors: zwq
 | 
			
		||||
 * @LastEditTime: 2024-07-09 13:40:03
 | 
			
		||||
 * @Description:
 | 
			
		||||
-->
 | 
			
		||||
<template>
 | 
			
		||||
 
 | 
			
		||||
@@ -1,8 +1,8 @@
 | 
			
		||||
<!--
 | 
			
		||||
 * @Author: zhp
 | 
			
		||||
 * @Date: 2023-11-08 15:30:27
 | 
			
		||||
 * @LastEditTime: 2023-11-23 14:27:59
 | 
			
		||||
 * @LastEditors: zhp
 | 
			
		||||
 * @LastEditTime: 2024-07-09 13:29:06
 | 
			
		||||
 * @LastEditors: zwq
 | 
			
		||||
 * @Description:
 | 
			
		||||
-->
 | 
			
		||||
<template>
 | 
			
		||||
@@ -42,8 +42,8 @@ import {
 | 
			
		||||
  getProcessEquMaterialBomDet,
 | 
			
		||||
  createProcessEquMaterialBomDetList,
 | 
			
		||||
  updateProcessEquMaterialBomDet,
 | 
			
		||||
  getMaterialList
 | 
			
		||||
} from '@/api/extend/processEquMaterialBom';
 | 
			
		||||
import { getMaterialTree,getMaterialList } from '@/api/base/material';
 | 
			
		||||
 | 
			
		||||
export default {
 | 
			
		||||
	props: {
 | 
			
		||||
@@ -94,12 +94,16 @@ export default {
 | 
			
		||||
				}
 | 
			
		||||
			});
 | 
			
		||||
    },
 | 
			
		||||
    getDict() {
 | 
			
		||||
      getMaterialList().then((res) => [
 | 
			
		||||
        this.materialList = res.data,
 | 
			
		||||
        console.log(res)
 | 
			
		||||
      ])
 | 
			
		||||
    },
 | 
			
		||||
		async getDict() {
 | 
			
		||||
			const materRes = await getMaterialTree();
 | 
			
		||||
      let typeId = materRes.data[0].product?materRes.data[1].id:materRes.data[0].id
 | 
			
		||||
      const listQuery= {
 | 
			
		||||
        typeId:typeId
 | 
			
		||||
      }
 | 
			
		||||
			const materData = await getMaterialList(listQuery);
 | 
			
		||||
			this.materialList = [];
 | 
			
		||||
			this.materialList = materData.data;
 | 
			
		||||
		},
 | 
			
		||||
		// 表单提交
 | 
			
		||||
		dataFormSubmit() {
 | 
			
		||||
			this.$refs['dataForm'].validate((valid) => {
 | 
			
		||||
 
 | 
			
		||||
@@ -12,32 +12,6 @@
 | 
			
		||||
        </el-form-item>
 | 
			
		||||
      </el-col>
 | 
			
		||||
    </el-row>
 | 
			
		||||
    <el-row>
 | 
			
		||||
      <el-col :span="12">
 | 
			
		||||
        <el-form-item label="生效时间" prop="enableTime">
 | 
			
		||||
          <el-date-picker
 | 
			
		||||
          v-model="form.enableTime"
 | 
			
		||||
          type="datetime"
 | 
			
		||||
          placeholder="选择日期时间"
 | 
			
		||||
          label-format="yyyy-MM-dd HH:mm:ss"
 | 
			
		||||
          value-format="timestamp"
 | 
			
		||||
          style="width: 100%;">
 | 
			
		||||
        </el-date-picker>
 | 
			
		||||
        </el-form-item>
 | 
			
		||||
      </el-col>
 | 
			
		||||
      <el-col :span="12">
 | 
			
		||||
        <el-form-item label="失效时间" prop="disableTime">
 | 
			
		||||
          <el-date-picker
 | 
			
		||||
            v-model="form.disableTime"
 | 
			
		||||
            type="datetime"
 | 
			
		||||
            placeholder="选择日期时间"
 | 
			
		||||
            label-format="yyyy-MM-dd HH:mm:ss"
 | 
			
		||||
            value-format="timestamp"
 | 
			
		||||
            style="width: 100%;">
 | 
			
		||||
          </el-date-picker>
 | 
			
		||||
        </el-form-item>
 | 
			
		||||
      </el-col>
 | 
			
		||||
    </el-row>
 | 
			
		||||
    <el-row>
 | 
			
		||||
      <el-col :span="12">
 | 
			
		||||
        <el-form-item label="班次开始时间" prop="startTime">
 | 
			
		||||
@@ -91,8 +65,6 @@ export default {
 | 
			
		||||
        id: '',
 | 
			
		||||
        name: '',
 | 
			
		||||
        code: '',
 | 
			
		||||
        enableTime: '',
 | 
			
		||||
        disableTime: '',
 | 
			
		||||
        startTime: '',
 | 
			
		||||
        endTime: '',
 | 
			
		||||
        daySpan: '',
 | 
			
		||||
@@ -101,7 +73,6 @@ export default {
 | 
			
		||||
      isEdit: false, //是否是编辑
 | 
			
		||||
      rules: {
 | 
			
		||||
        name: [{ required: true, message: '请输入班组名称', trigger: 'blur' }],
 | 
			
		||||
        enableTime: [{ required: true, message: '请选择班次开始时间', trigger: 'change' }],
 | 
			
		||||
        code: [{ required: true, message: '请输入编码', trigger: 'blur' }],
 | 
			
		||||
        startTime: [{ required: true, message: '请输入生效时间', trigger: 'change' }],
 | 
			
		||||
        endTime: [{ required: true, message: '请选择班次结束时间', trigger: 'change' }]
 | 
			
		||||
@@ -116,7 +87,6 @@ export default {
 | 
			
		||||
        getGroupClasses(id).then((res) => {
 | 
			
		||||
          if (res.code === 0) {
 | 
			
		||||
            this.form = res.data
 | 
			
		||||
            this.form.disableTime = res.data.disableTime || ''
 | 
			
		||||
          }
 | 
			
		||||
        })
 | 
			
		||||
      } else {
 | 
			
		||||
@@ -146,7 +116,6 @@ export default {
 | 
			
		||||
    submitForm() {
 | 
			
		||||
      this.$refs['form'].validate((valid) => {
 | 
			
		||||
        if (valid) {
 | 
			
		||||
          this.form.disableTime = this.form.disableTime || ''
 | 
			
		||||
          if (this.isEdit) {
 | 
			
		||||
            //编辑
 | 
			
		||||
            updateGroupClasses({ ...this.form }).then((res) => {
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										52
									
								
								src/views/group/base/groupClasses/components/statusBtn.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										52
									
								
								src/views/group/base/groupClasses/components/statusBtn.vue
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,52 @@
 | 
			
		||||
<!--
 | 
			
		||||
 * @Author: zwq
 | 
			
		||||
 * @Date: 2024-07-01 14:53:55
 | 
			
		||||
 * @LastEditors: zwq
 | 
			
		||||
 * @LastEditTime: 2024-07-10 10:28:05
 | 
			
		||||
 * @Description:
 | 
			
		||||
-->
 | 
			
		||||
<template>
 | 
			
		||||
  <el-switch v-model="state" type="text" size="small" :disabled="readonly" @change="changeHandler" />
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script>
 | 
			
		||||
export default {
 | 
			
		||||
  props: {
 | 
			
		||||
    injectData: {
 | 
			
		||||
      type: Object,
 | 
			
		||||
      default: () => ({})
 | 
			
		||||
    }
 | 
			
		||||
  },
 | 
			
		||||
  data() {
 | 
			
		||||
    return {
 | 
			
		||||
      state: false
 | 
			
		||||
    }
 | 
			
		||||
  },
 | 
			
		||||
  computed: {
 | 
			
		||||
    readonly() {
 | 
			
		||||
      return !!this.injectData.readonly
 | 
			
		||||
    }
 | 
			
		||||
  },
 | 
			
		||||
  mounted() {
 | 
			
		||||
    this.mapToState()
 | 
			
		||||
  },
 | 
			
		||||
  methods: {
 | 
			
		||||
    mapToState() {
 | 
			
		||||
      if (this.injectData.prop === 'enabled') {
 | 
			
		||||
        this.state = this.injectData.enabled === 1 ? true : false
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
    changeHandler() {
 | 
			
		||||
      let params = {}
 | 
			
		||||
      let payload = {}
 | 
			
		||||
      params.name = 'state'
 | 
			
		||||
      payload.id = this.injectData.id
 | 
			
		||||
      payload.enabled = this.state ? '1' : '0'
 | 
			
		||||
      payload.startTime = this.injectData.startTime
 | 
			
		||||
      payload.endTime = this.injectData.endTime
 | 
			
		||||
      params.payload = payload
 | 
			
		||||
      this.$emit('emitData', params)
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
</script>
 | 
			
		||||
@@ -1,262 +1,263 @@
 | 
			
		||||
<!--
 | 
			
		||||
 * @Author: zwq
 | 
			
		||||
 * @Date: 2024-07-01 14:53:55
 | 
			
		||||
 * @LastEditors: zwq
 | 
			
		||||
 * @LastEditTime: 2024-07-12 16:19:13
 | 
			
		||||
 * @Description:
 | 
			
		||||
-->
 | 
			
		||||
<template>
 | 
			
		||||
  <div class="app-container">
 | 
			
		||||
 | 
			
		||||
    <!-- 搜索工作栏 -->
 | 
			
		||||
    <search-bar
 | 
			
		||||
      :formConfigs="formConfig"
 | 
			
		||||
      ref="searchBarForm"
 | 
			
		||||
      @headBtnClick="buttonClick"
 | 
			
		||||
    />
 | 
			
		||||
    <!-- 列表 -->
 | 
			
		||||
    <base-table
 | 
			
		||||
      :page="queryParams.pageNo"
 | 
			
		||||
      :limit="queryParams.pageSize"
 | 
			
		||||
      :table-props="tableProps"
 | 
			
		||||
      :table-data="list"
 | 
			
		||||
      :max-height="tableH"
 | 
			
		||||
    >
 | 
			
		||||
      <method-btn
 | 
			
		||||
        v-if="tableBtn.length"
 | 
			
		||||
        slot="handleBtn"
 | 
			
		||||
        :width="120"
 | 
			
		||||
        label="操作"
 | 
			
		||||
        :method-list="tableBtn"
 | 
			
		||||
        @clickBtn="handleClick"
 | 
			
		||||
      />
 | 
			
		||||
    </base-table>
 | 
			
		||||
    <pagination
 | 
			
		||||
      :page.sync="queryParams.pageNo"
 | 
			
		||||
      :limit.sync="queryParams.pageSize"
 | 
			
		||||
      :total="total"
 | 
			
		||||
      @pagination="getList"
 | 
			
		||||
    />
 | 
			
		||||
    <!-- 新增 -->
 | 
			
		||||
    <base-dialog
 | 
			
		||||
      :dialogTitle="addOrEditTitle"
 | 
			
		||||
      :dialogVisible="centervisible"
 | 
			
		||||
      @cancel="handleCancel"
 | 
			
		||||
      @confirm="handleConfirm"
 | 
			
		||||
      :before-close="handleCancel"
 | 
			
		||||
      width='50%'
 | 
			
		||||
    >
 | 
			
		||||
      <group-class-add ref="classList" @successSubmit="successSubmit" />
 | 
			
		||||
    </base-dialog>
 | 
			
		||||
  </div>
 | 
			
		||||
	<div class="app-container">
 | 
			
		||||
		<!-- 搜索工作栏 -->
 | 
			
		||||
		<search-bar
 | 
			
		||||
			:formConfigs="formConfig"
 | 
			
		||||
			ref="searchBarForm"
 | 
			
		||||
			@headBtnClick="buttonClick" />
 | 
			
		||||
		<!-- 列表 -->
 | 
			
		||||
		<base-table
 | 
			
		||||
			:page="queryParams.pageNo"
 | 
			
		||||
			:limit="queryParams.pageSize"
 | 
			
		||||
			:table-props="tableProps"
 | 
			
		||||
			:table-data="list"
 | 
			
		||||
			:max-height="tableH"
 | 
			
		||||
			@emitFun="handleTableEvents">
 | 
			
		||||
			<method-btn
 | 
			
		||||
				v-if="tableBtn.length"
 | 
			
		||||
				slot="handleBtn"
 | 
			
		||||
				:width="120"
 | 
			
		||||
				label="操作"
 | 
			
		||||
				:method-list="tableBtn"
 | 
			
		||||
				@clickBtn="handleClick" />
 | 
			
		||||
		</base-table>
 | 
			
		||||
		<pagination
 | 
			
		||||
			:page.sync="queryParams.pageNo"
 | 
			
		||||
			:limit.sync="queryParams.pageSize"
 | 
			
		||||
			:total="total"
 | 
			
		||||
			@pagination="getList" />
 | 
			
		||||
		<!-- 新增 -->
 | 
			
		||||
		<base-dialog
 | 
			
		||||
			:dialogTitle="addOrEditTitle"
 | 
			
		||||
			:dialogVisible="centervisible"
 | 
			
		||||
			@cancel="handleCancel"
 | 
			
		||||
			@confirm="handleConfirm"
 | 
			
		||||
			:before-close="handleCancel"
 | 
			
		||||
			width="50%">
 | 
			
		||||
			<group-class-add ref="classList" @successSubmit="successSubmit" />
 | 
			
		||||
		</base-dialog>
 | 
			
		||||
	</div>
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script>
 | 
			
		||||
import { getGroupClassesPage, deleteGroupClasses, updateGroupClasses } from "@/api/base/groupClasses";
 | 
			
		||||
import GroupClassAdd from './components/groupClassAdd.vue'
 | 
			
		||||
import { formatDate } from '@/utils'
 | 
			
		||||
import {
 | 
			
		||||
	getGroupClassesPage,
 | 
			
		||||
	deleteGroupClasses,
 | 
			
		||||
	updateGroupClasses,
 | 
			
		||||
} from '@/api/base/groupClasses';
 | 
			
		||||
import GroupClassAdd from './components/groupClassAdd.vue';
 | 
			
		||||
import StatusBtn from './components/statusBtn';
 | 
			
		||||
const tableProps = [
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'enableTimeStr',
 | 
			
		||||
    label: '生效时段',
 | 
			
		||||
    minWidth: 300
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'name',
 | 
			
		||||
    label: '班次名称'
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'timeStr',
 | 
			
		||||
    label: '班次时间',
 | 
			
		||||
    minWidth: 100
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'code',
 | 
			
		||||
    label: '班次编码',
 | 
			
		||||
    minWidth: 200
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'status',
 | 
			
		||||
    label: '班次状态'
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'remark',
 | 
			
		||||
    label: '备注'
 | 
			
		||||
  }
 | 
			
		||||
]
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'name',
 | 
			
		||||
		label: '班次名称',
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'timeStr',
 | 
			
		||||
		label: '班次时间',
 | 
			
		||||
		minWidth: 100,
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'code',
 | 
			
		||||
		label: '班次编码',
 | 
			
		||||
		minWidth: 200,
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'enabled',
 | 
			
		||||
		label: '班次状态',
 | 
			
		||||
		subcomponent: StatusBtn,
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'remark',
 | 
			
		||||
		label: '备注',
 | 
			
		||||
	},
 | 
			
		||||
];
 | 
			
		||||
export default {
 | 
			
		||||
  name: "GroupClass",
 | 
			
		||||
  components: { GroupClassAdd },
 | 
			
		||||
  data() {
 | 
			
		||||
    return {
 | 
			
		||||
      formConfig: [
 | 
			
		||||
        {
 | 
			
		||||
          type: 'input',
 | 
			
		||||
          label: '班次名称',
 | 
			
		||||
          placeholder: '班次名称',
 | 
			
		||||
          param: 'name'
 | 
			
		||||
        },
 | 
			
		||||
        {
 | 
			
		||||
          type: 'button',
 | 
			
		||||
          btnName: '查询',
 | 
			
		||||
          name: 'search',
 | 
			
		||||
          color: 'primary'
 | 
			
		||||
        },
 | 
			
		||||
        {
 | 
			
		||||
          type: 'separate'
 | 
			
		||||
        },
 | 
			
		||||
        {
 | 
			
		||||
          type: this.$auth.hasPermi('base:group-classes:create') ? 'button' : '',
 | 
			
		||||
          btnName: '新增',
 | 
			
		||||
          name: 'add',
 | 
			
		||||
          color: 'success',
 | 
			
		||||
          plain: true
 | 
			
		||||
        }
 | 
			
		||||
      ],
 | 
			
		||||
      tableProps,
 | 
			
		||||
      tableBtn: [
 | 
			
		||||
      this.$auth.hasPermi('base:group-classes:cancel')
 | 
			
		||||
          ? {
 | 
			
		||||
              type: 'cancel',
 | 
			
		||||
              btnName: '作废',
 | 
			
		||||
              showParam: {
 | 
			
		||||
                type: '&',
 | 
			
		||||
                data: [
 | 
			
		||||
                  {
 | 
			
		||||
                    type: 'unequal',
 | 
			
		||||
                    name: 'status',
 | 
			
		||||
                    value: '不可用'
 | 
			
		||||
                  }
 | 
			
		||||
                ]
 | 
			
		||||
              }
 | 
			
		||||
            }
 | 
			
		||||
          : undefined,
 | 
			
		||||
        this.$auth.hasPermi('base:group-classes:update')
 | 
			
		||||
          ? {
 | 
			
		||||
              type: 'edit',
 | 
			
		||||
              btnName: '编辑'
 | 
			
		||||
            }
 | 
			
		||||
          : undefined,
 | 
			
		||||
        this.$auth.hasPermi('base:group-classes:delete')
 | 
			
		||||
          ? {
 | 
			
		||||
              type: 'delete',
 | 
			
		||||
              btnName: '删除'
 | 
			
		||||
            }
 | 
			
		||||
          : undefined
 | 
			
		||||
      ].filter((v) => v),
 | 
			
		||||
      tableH: this.tableHeight(260),
 | 
			
		||||
      // 总条数
 | 
			
		||||
      total: 0,
 | 
			
		||||
      // 班次基础信息列表
 | 
			
		||||
      list: [],
 | 
			
		||||
      // 弹出层标题
 | 
			
		||||
      addOrEditTitle: "",
 | 
			
		||||
      // 是否显示弹出层
 | 
			
		||||
      centervisible: false,
 | 
			
		||||
      // 查询参数
 | 
			
		||||
      queryParams: {
 | 
			
		||||
        pageNo: 1,
 | 
			
		||||
        pageSize: 20,
 | 
			
		||||
        name: null
 | 
			
		||||
      }
 | 
			
		||||
    };
 | 
			
		||||
  },
 | 
			
		||||
  created() {
 | 
			
		||||
    window.addEventListener('resize', () => {
 | 
			
		||||
      this.tableH = this.tableHeight(260)
 | 
			
		||||
    })
 | 
			
		||||
    this.getList()
 | 
			
		||||
  },
 | 
			
		||||
  methods: {
 | 
			
		||||
    buttonClick(val) {
 | 
			
		||||
      switch (val.btnName) {
 | 
			
		||||
        case 'search':
 | 
			
		||||
          this.queryParams.pageNo = 1;
 | 
			
		||||
          this.queryParams.name = val.name
 | 
			
		||||
          this.getList()
 | 
			
		||||
          break
 | 
			
		||||
        default:
 | 
			
		||||
          this.addOrEditTitle = '新增'
 | 
			
		||||
          this.centervisible = true
 | 
			
		||||
          this.$nextTick(() => {
 | 
			
		||||
            this.$refs.classList.init()
 | 
			
		||||
          })
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
    /** 查询列表 */
 | 
			
		||||
    getList() {
 | 
			
		||||
      getGroupClassesPage(this.queryParams).then(res => {
 | 
			
		||||
        if (res.code === 0 && res.data.list.length > 0) {
 | 
			
		||||
          res.data.list.map(item => {
 | 
			
		||||
            item.enableTimeStr = formatDate(item.enableTime) + '至' + (item.disableTime ? formatDate(item.disableTime) : '永久')
 | 
			
		||||
            item.timeStr = item.startTime.slice(0, 5) + '-' + item.endTime.slice(0, 5)
 | 
			
		||||
            item.status = item.status === true ? '可用' : '不可用'
 | 
			
		||||
          })
 | 
			
		||||
          this.list = res.data.list;
 | 
			
		||||
          this.total = res.data.total;
 | 
			
		||||
        } else {
 | 
			
		||||
          this.list = []
 | 
			
		||||
          this.total = 0
 | 
			
		||||
        }
 | 
			
		||||
      });
 | 
			
		||||
    },
 | 
			
		||||
    handleClick(val) {
 | 
			
		||||
      switch (val.type) {
 | 
			
		||||
        case 'edit':
 | 
			
		||||
          this.addOrEditTitle = '编辑'
 | 
			
		||||
          this.$nextTick(() => {
 | 
			
		||||
            this.$refs.classList.init(val.data.id)
 | 
			
		||||
          })
 | 
			
		||||
          this.centervisible = true
 | 
			
		||||
          break
 | 
			
		||||
        case 'cancel':
 | 
			
		||||
          this.discard(val.data)
 | 
			
		||||
          break
 | 
			
		||||
        default:
 | 
			
		||||
        this.handleDelete(val.data)
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
    handleCancel() {
 | 
			
		||||
      this.$refs.classList.formClear()
 | 
			
		||||
      this.centervisible = false
 | 
			
		||||
      this.addOrEditTitle = ''
 | 
			
		||||
    },
 | 
			
		||||
    handleConfirm() {
 | 
			
		||||
      this.$refs.classList.submitForm()
 | 
			
		||||
    },
 | 
			
		||||
    successSubmit() {
 | 
			
		||||
      this.handleCancel()
 | 
			
		||||
      this.getList()
 | 
			
		||||
    },
 | 
			
		||||
    discard(row) {
 | 
			
		||||
      let obj = {}
 | 
			
		||||
      obj.id = row.id
 | 
			
		||||
      obj.startTime = row.startTime
 | 
			
		||||
      obj.endTime = row.endTime
 | 
			
		||||
      obj.enableTime = row.enableTime
 | 
			
		||||
      obj.disableTime = Date.parse(new Date())
 | 
			
		||||
      this.$modal.confirm('是否确认作废班次名称为"' + row.name + '"的数据项?').then(function() {
 | 
			
		||||
          return updateGroupClasses({ ...obj })
 | 
			
		||||
        }).then(() => {
 | 
			
		||||
          this.getList();
 | 
			
		||||
          this.$modal.msgSuccess("操作成功");
 | 
			
		||||
        }).catch(() => {});
 | 
			
		||||
    },
 | 
			
		||||
    /** 删除按钮操作 */
 | 
			
		||||
    handleDelete(row) {
 | 
			
		||||
      console.log(row)
 | 
			
		||||
      let _this = this
 | 
			
		||||
      if (row.status === '可用') {// 可用
 | 
			
		||||
        _this.$modal.confirm('删除的班次"' + row.name + '"可能会影响交接班计划,请点取消再次确认!').then(function() {
 | 
			
		||||
          return _this.$modal.confirm('是否确认删除班次名称为"' + row.name + '"的数据项?').then(function() {
 | 
			
		||||
              return deleteGroupClasses(row.id);
 | 
			
		||||
            }).then(() => {
 | 
			
		||||
              _this.getList();
 | 
			
		||||
              _this.$modal.msgSuccess("删除成功");
 | 
			
		||||
            }).catch(() => {});
 | 
			
		||||
          })
 | 
			
		||||
      } else {
 | 
			
		||||
        _this.$modal.confirm('是否确认删除班次名称为"' + row.name + '"的数据项?').then(function() {
 | 
			
		||||
            return deleteGroupClasses(row.id);
 | 
			
		||||
          }).then(() => {
 | 
			
		||||
            _this.getList();
 | 
			
		||||
            _this.$modal.msgSuccess("删除成功");
 | 
			
		||||
          }).catch(() => {});
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
	name: 'GroupClass',
 | 
			
		||||
	components: { GroupClassAdd },
 | 
			
		||||
	data() {
 | 
			
		||||
		return {
 | 
			
		||||
			formConfig: [
 | 
			
		||||
				{
 | 
			
		||||
					type: 'input',
 | 
			
		||||
					label: '班次名称',
 | 
			
		||||
					placeholder: '班次名称',
 | 
			
		||||
					param: 'name',
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					type: 'button',
 | 
			
		||||
					btnName: '查询',
 | 
			
		||||
					name: 'search',
 | 
			
		||||
					color: 'primary',
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					type: 'separate',
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					type: this.$auth.hasPermi('base:group-classes:create')
 | 
			
		||||
						? 'button'
 | 
			
		||||
						: '',
 | 
			
		||||
					btnName: '新增',
 | 
			
		||||
					name: 'add',
 | 
			
		||||
					color: 'success',
 | 
			
		||||
					plain: true,
 | 
			
		||||
				},
 | 
			
		||||
			],
 | 
			
		||||
			tableProps,
 | 
			
		||||
			tableBtn: [
 | 
			
		||||
				this.$auth.hasPermi('base:group-classes:update')
 | 
			
		||||
					? {
 | 
			
		||||
							type: 'edit',
 | 
			
		||||
							btnName: '编辑',
 | 
			
		||||
					  }
 | 
			
		||||
					: undefined,
 | 
			
		||||
				this.$auth.hasPermi('base:group-classes:delete')
 | 
			
		||||
					? {
 | 
			
		||||
							type: 'delete',
 | 
			
		||||
							btnName: '删除',
 | 
			
		||||
					  }
 | 
			
		||||
					: undefined,
 | 
			
		||||
			].filter((v) => v),
 | 
			
		||||
			tableH: this.tableHeight(260),
 | 
			
		||||
			// 总条数
 | 
			
		||||
			total: 0,
 | 
			
		||||
			// 班次基础信息列表
 | 
			
		||||
			list: [],
 | 
			
		||||
			// 弹出层标题
 | 
			
		||||
			addOrEditTitle: '',
 | 
			
		||||
			// 是否显示弹出层
 | 
			
		||||
			centervisible: false,
 | 
			
		||||
			// 查询参数
 | 
			
		||||
			queryParams: {
 | 
			
		||||
				pageNo: 1,
 | 
			
		||||
				pageSize: 20,
 | 
			
		||||
				name: null,
 | 
			
		||||
			},
 | 
			
		||||
		};
 | 
			
		||||
	},
 | 
			
		||||
	created() {
 | 
			
		||||
		window.addEventListener('resize', () => {
 | 
			
		||||
			this.tableH = this.tableHeight(260);
 | 
			
		||||
		});
 | 
			
		||||
		this.getList();
 | 
			
		||||
	},
 | 
			
		||||
	methods: {
 | 
			
		||||
		buttonClick(val) {
 | 
			
		||||
			switch (val.btnName) {
 | 
			
		||||
				case 'search':
 | 
			
		||||
					this.queryParams.pageNo = 1;
 | 
			
		||||
					this.queryParams.name = val.name;
 | 
			
		||||
					this.getList();
 | 
			
		||||
					break;
 | 
			
		||||
				default:
 | 
			
		||||
					this.addOrEditTitle = '新增';
 | 
			
		||||
					this.centervisible = true;
 | 
			
		||||
					this.$nextTick(() => {
 | 
			
		||||
						this.$refs.classList.init();
 | 
			
		||||
					});
 | 
			
		||||
			}
 | 
			
		||||
		},
 | 
			
		||||
		// 班组状态
 | 
			
		||||
		handleTableEvents(params) {
 | 
			
		||||
			if (params.name === 'state') {
 | 
			
		||||
				// 班组状态
 | 
			
		||||
				updateGroupClasses({ ...params.payload })
 | 
			
		||||
					.then((res) => {
 | 
			
		||||
						if (res.code === 0) {
 | 
			
		||||
							this.$modal.msgSuccess('操作成功');
 | 
			
		||||
							this.getList();
 | 
			
		||||
						}
 | 
			
		||||
					})
 | 
			
		||||
					.catch((res) => {
 | 
			
		||||
						this.getList();
 | 
			
		||||
					});
 | 
			
		||||
			}
 | 
			
		||||
		},
 | 
			
		||||
		/** 查询列表 */
 | 
			
		||||
		getList() {
 | 
			
		||||
			getGroupClassesPage(this.queryParams).then((res) => {
 | 
			
		||||
				if (res.code === 0 && res.data.list && res.data.list.length > 0) {
 | 
			
		||||
					res.data.list.map((item) => {
 | 
			
		||||
						item.timeStr =
 | 
			
		||||
							item.startTime.slice(0, 5) + '-' + item.endTime.slice(0, 5);
 | 
			
		||||
					});
 | 
			
		||||
					this.list = res.data.list;
 | 
			
		||||
					this.total = res.data.total;
 | 
			
		||||
				} else {
 | 
			
		||||
					this.list = [];
 | 
			
		||||
					this.total = 0;
 | 
			
		||||
				}
 | 
			
		||||
			});
 | 
			
		||||
		},
 | 
			
		||||
		handleClick(val) {
 | 
			
		||||
			switch (val.type) {
 | 
			
		||||
				case 'edit':
 | 
			
		||||
					this.addOrEditTitle = '编辑';
 | 
			
		||||
					this.$nextTick(() => {
 | 
			
		||||
						this.$refs.classList.init(val.data.id);
 | 
			
		||||
					});
 | 
			
		||||
					this.centervisible = true;
 | 
			
		||||
					break;
 | 
			
		||||
				default:
 | 
			
		||||
					this.handleDelete(val.data);
 | 
			
		||||
			}
 | 
			
		||||
		},
 | 
			
		||||
		handleCancel() {
 | 
			
		||||
			this.$refs.classList.formClear();
 | 
			
		||||
			this.centervisible = false;
 | 
			
		||||
			this.addOrEditTitle = '';
 | 
			
		||||
		},
 | 
			
		||||
		handleConfirm() {
 | 
			
		||||
			this.$refs.classList.submitForm();
 | 
			
		||||
		},
 | 
			
		||||
		successSubmit() {
 | 
			
		||||
			this.handleCancel();
 | 
			
		||||
			this.getList();
 | 
			
		||||
		},
 | 
			
		||||
		/** 删除按钮操作 */
 | 
			
		||||
		handleDelete(row) {
 | 
			
		||||
			console.log(row);
 | 
			
		||||
			let _this = this;
 | 
			
		||||
			if (row.enabled) {
 | 
			
		||||
				// 可用
 | 
			
		||||
				_this.$modal
 | 
			
		||||
					.confirm(
 | 
			
		||||
						'删除的班次"' +
 | 
			
		||||
							row.name +
 | 
			
		||||
							'"可能会影响交接班计划,请点取消再次确认!'
 | 
			
		||||
					)
 | 
			
		||||
					.then(function () {
 | 
			
		||||
						return _this.$modal
 | 
			
		||||
							.confirm('是否确认删除班次名称为"' + row.name + '"的数据项?')
 | 
			
		||||
							.then(function () {
 | 
			
		||||
								return deleteGroupClasses(row.id);
 | 
			
		||||
							})
 | 
			
		||||
							.then(() => {
 | 
			
		||||
								_this.getList();
 | 
			
		||||
								_this.$modal.msgSuccess('删除成功');
 | 
			
		||||
							})
 | 
			
		||||
							.catch(() => {});
 | 
			
		||||
					});
 | 
			
		||||
			} else {
 | 
			
		||||
				_this.$modal
 | 
			
		||||
					.confirm('是否确认删除班次名称为"' + row.name + '"的数据项?')
 | 
			
		||||
					.then(function () {
 | 
			
		||||
						return deleteGroupClasses(row.id);
 | 
			
		||||
					})
 | 
			
		||||
					.then(() => {
 | 
			
		||||
						_this.getList();
 | 
			
		||||
						_this.$modal.msgSuccess('删除成功');
 | 
			
		||||
					})
 | 
			
		||||
					.catch(() => {});
 | 
			
		||||
			}
 | 
			
		||||
		},
 | 
			
		||||
	},
 | 
			
		||||
};
 | 
			
		||||
</script>
 | 
			
		||||
 
 | 
			
		||||
@@ -14,20 +14,18 @@
 | 
			
		||||
    </el-row>
 | 
			
		||||
    <el-row>
 | 
			
		||||
      <el-col :span="12">
 | 
			
		||||
        <el-form-item label="班组组长" prop="leaderId">
 | 
			
		||||
          <el-select v-model="form.leaderId" placeholder="请选择" style="width: 100%;" filterable @change="selectLeader">
 | 
			
		||||
            <el-option
 | 
			
		||||
              v-for="item in workerList"
 | 
			
		||||
              :key="item.id"
 | 
			
		||||
              :label="item.name"
 | 
			
		||||
              :value="item.id">
 | 
			
		||||
            </el-option>
 | 
			
		||||
          </el-select>
 | 
			
		||||
        <el-form-item label="班组组长" prop="leaderName">
 | 
			
		||||
          <el-input v-model="form.leaderName" clearable></el-input>
 | 
			
		||||
        </el-form-item>
 | 
			
		||||
      </el-col>
 | 
			
		||||
      <el-col :span="12">
 | 
			
		||||
        <el-form-item label="手机号" prop="telephone">
 | 
			
		||||
          <el-input v-model="form.telephone" disabled></el-input>
 | 
			
		||||
        <el-form-item label="手机号" prop="leaderPhone">
 | 
			
		||||
          <el-input v-model="form.leaderPhone" clearable></el-input>
 | 
			
		||||
        </el-form-item>
 | 
			
		||||
      </el-col>
 | 
			
		||||
      <el-col :span="12">
 | 
			
		||||
        <el-form-item label="班组人数" prop="num">
 | 
			
		||||
          <el-input-number style="width: 100%;" v-model="form.num" :step="1" step-strictly></el-input-number>
 | 
			
		||||
        </el-form-item>
 | 
			
		||||
      </el-col>
 | 
			
		||||
    </el-row>
 | 
			
		||||
@@ -35,7 +33,6 @@
 | 
			
		||||
</template>
 | 
			
		||||
<script>
 | 
			
		||||
import { getGroupTeam, updateGroupTeam, createGroupTeam, getCode } from '@/api/base/groupTeam'
 | 
			
		||||
import { getWorkerList } from '@/api/base/worker'
 | 
			
		||||
export default {
 | 
			
		||||
  name: 'groupTeamAdd',
 | 
			
		||||
  data() {
 | 
			
		||||
@@ -44,28 +41,26 @@ export default {
 | 
			
		||||
        id: '',
 | 
			
		||||
        name: '',
 | 
			
		||||
        code: '',
 | 
			
		||||
        leaderId: '',
 | 
			
		||||
        telephone: ''
 | 
			
		||||
        leaderName: '',
 | 
			
		||||
        leaderPhone: '',
 | 
			
		||||
        num: ''
 | 
			
		||||
      },
 | 
			
		||||
      isEdit: false, //是否是编辑
 | 
			
		||||
      rules: {
 | 
			
		||||
        name: [{ required: true, message: '请输入班组名称', trigger: 'blur' }],
 | 
			
		||||
        code: [{ required: true, message: '请输入班组编码', trigger: 'blur' }],
 | 
			
		||||
        leaderId: [{ required: true, message: '请选择组长', trigger: 'select' }]
 | 
			
		||||
        leaderName: [{ required: true, message: '请输入组长', trigger: 'blur' }]
 | 
			
		||||
      },
 | 
			
		||||
      workerList: []
 | 
			
		||||
    }
 | 
			
		||||
  },
 | 
			
		||||
  methods: {
 | 
			
		||||
    init(id) {
 | 
			
		||||
      this.getWorkerList()
 | 
			
		||||
      if (id) {
 | 
			
		||||
        this.isEdit = true
 | 
			
		||||
        this.form.id = id
 | 
			
		||||
        getGroupTeam( id ).then((res) => {
 | 
			
		||||
          if (res.code === 0) {
 | 
			
		||||
            this.form = res.data
 | 
			
		||||
            this.selectLeader()
 | 
			
		||||
          }
 | 
			
		||||
        })
 | 
			
		||||
      } else {
 | 
			
		||||
@@ -76,24 +71,6 @@ export default {
 | 
			
		||||
        })
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
    // 获取员工list
 | 
			
		||||
    getWorkerList() {
 | 
			
		||||
      getWorkerList().then(res => {
 | 
			
		||||
        this.workerList = res.data
 | 
			
		||||
      })
 | 
			
		||||
    },
 | 
			
		||||
    // 获取手机号
 | 
			
		||||
    selectLeader() {
 | 
			
		||||
      if (this.form.leaderId) {
 | 
			
		||||
        this.workerList.map(item => {
 | 
			
		||||
          if (item.id === this.form.leaderId) {
 | 
			
		||||
            this.form.telephone = item.telephone || ''
 | 
			
		||||
          }
 | 
			
		||||
        })
 | 
			
		||||
      } else {
 | 
			
		||||
        this.form.telephone = ''
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
    submitForm() {
 | 
			
		||||
      this.$refs['form'].validate((valid) => {
 | 
			
		||||
        if (valid) {
 | 
			
		||||
 
 | 
			
		||||
@@ -1,3 +1,10 @@
 | 
			
		||||
<!--
 | 
			
		||||
 * @Author: zwq
 | 
			
		||||
 * @Date: 2024-07-01 14:53:55
 | 
			
		||||
 * @LastEditors: zwq
 | 
			
		||||
 * @LastEditTime: 2024-07-10 10:00:03
 | 
			
		||||
 * @Description:
 | 
			
		||||
-->
 | 
			
		||||
<template>
 | 
			
		||||
  <el-switch v-model="state" type="text" size="small" :disabled="readonly" @change="changeHandler" />
 | 
			
		||||
</template>
 | 
			
		||||
@@ -37,7 +44,7 @@ export default {
 | 
			
		||||
      payload.enabled = this.state ? '1' : '0'
 | 
			
		||||
      payload.code = this.injectData.code
 | 
			
		||||
      payload.name = this.injectData.name
 | 
			
		||||
      payload.leaderId = this.injectData.leaderId
 | 
			
		||||
      payload.leaderName = this.injectData.leaderName
 | 
			
		||||
      params.payload = payload
 | 
			
		||||
      this.$emit('emitData', params)
 | 
			
		||||
    }
 | 
			
		||||
 
 | 
			
		||||
@@ -193,7 +193,7 @@ export default {
 | 
			
		||||
    },
 | 
			
		||||
    getList() {
 | 
			
		||||
      groupTeamPage({ ...this.queryParams }).then(res => {
 | 
			
		||||
        if (res.code === 0 && res.data.list.length > 0) {
 | 
			
		||||
				if (res.code === 0 && res.data.list && res.data.list.length > 0) {
 | 
			
		||||
          let arr = []
 | 
			
		||||
          res.data.list.map(item => {
 | 
			
		||||
            let obj = {}
 | 
			
		||||
 
 | 
			
		||||
@@ -42,8 +42,6 @@
 | 
			
		||||
    >
 | 
			
		||||
      <group-team-add ref="groupList" @successSubmit="successSubmit" />
 | 
			
		||||
    </base-dialog>
 | 
			
		||||
    <!-- 组员编辑 -->
 | 
			
		||||
    <worker-edit v-if='paramVisible' ref='workerEditParam' @closeDrawer="closeDrawer"></worker-edit>
 | 
			
		||||
  </div>
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
@@ -52,8 +50,6 @@ import { getGroupTeamPage, deleteGroupTeam, updateGroupTeam } from "@/api/base/g
 | 
			
		||||
import { parseTime } from '@/utils/ruoyi'
 | 
			
		||||
import GroupTeamAdd from './components/groupTeamAdd'
 | 
			
		||||
import StatusBtn from './components/statusBtn'
 | 
			
		||||
import WorkerOperate from './components/workerOperate'
 | 
			
		||||
import WorkerEdit from './components/workerEdit'
 | 
			
		||||
const tableProps = [
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'createTime',
 | 
			
		||||
@@ -83,15 +79,10 @@ const tableProps = [
 | 
			
		||||
    label: '班组状态',
 | 
			
		||||
    subcomponent: StatusBtn
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'workerName',
 | 
			
		||||
    label: '组员',
 | 
			
		||||
    subcomponent: WorkerOperate
 | 
			
		||||
  },
 | 
			
		||||
]
 | 
			
		||||
export default {
 | 
			
		||||
  name: "GroupTeam",
 | 
			
		||||
  components: { GroupTeamAdd, WorkerEdit },
 | 
			
		||||
  components: { GroupTeamAdd },
 | 
			
		||||
  data() {
 | 
			
		||||
    return {
 | 
			
		||||
      formConfig: [
 | 
			
		||||
@@ -155,7 +146,6 @@ export default {
 | 
			
		||||
        name: null,
 | 
			
		||||
        code: null
 | 
			
		||||
      },
 | 
			
		||||
      paramVisible: false
 | 
			
		||||
    };
 | 
			
		||||
  },
 | 
			
		||||
  created() {
 | 
			
		||||
@@ -203,17 +193,14 @@ export default {
 | 
			
		||||
    },
 | 
			
		||||
    // 班组状态
 | 
			
		||||
    handleTableEvents(params) {
 | 
			
		||||
      console.log(params)
 | 
			
		||||
      if (params.name === 'state') {// 班组状态
 | 
			
		||||
        updateGroupTeam({ ...params.payload }).then((res) => {
 | 
			
		||||
          if (res.code === 0) {
 | 
			
		||||
            this.$modal.msgSuccess("操作成功");
 | 
			
		||||
            this.getList()
 | 
			
		||||
          }
 | 
			
		||||
        })
 | 
			
		||||
      }else {// 编辑&查看
 | 
			
		||||
        this.paramVisible = true
 | 
			
		||||
        this.$nextTick(() => {
 | 
			
		||||
          this.$refs.workerEditParam.init(params)
 | 
			
		||||
        }).catch((res)=>{
 | 
			
		||||
          this.getList()
 | 
			
		||||
        })
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
 
 | 
			
		||||
@@ -1,478 +1,520 @@
 | 
			
		||||
<!--
 | 
			
		||||
 * @Author: zwq
 | 
			
		||||
 * @Date: 2024-07-01 14:54:06
 | 
			
		||||
 * @LastEditors: zwq
 | 
			
		||||
 * @LastEditTime: 2024-07-15 14:55:35
 | 
			
		||||
 * @Description:
 | 
			
		||||
-->
 | 
			
		||||
<template>
 | 
			
		||||
  <div class="groupTeamScheduling">
 | 
			
		||||
    <div class="operationArea">
 | 
			
		||||
      <el-form :inline="true" class="demo-form-inline">
 | 
			
		||||
        <span class="blue-block"></span>
 | 
			
		||||
        <el-form-item label="月份选择">
 | 
			
		||||
          <el-date-picker
 | 
			
		||||
            v-model="startDay"
 | 
			
		||||
            type="month"
 | 
			
		||||
            placeholder="选择月"
 | 
			
		||||
            size="small"
 | 
			
		||||
            :disabled="showSetting"
 | 
			
		||||
            @change="selectMonth"
 | 
			
		||||
            :clearable="false"
 | 
			
		||||
            style="width: 120px">
 | 
			
		||||
          </el-date-picker>
 | 
			
		||||
        </el-form-item>
 | 
			
		||||
        <el-form-item>
 | 
			
		||||
          <span class="separateStyle" v-if="this.$auth.hasPermi('base:group-team-scheduling:set')"></span>
 | 
			
		||||
        </el-form-item>
 | 
			
		||||
        <el-form-item>
 | 
			
		||||
          <el-button type="primary" size="small" v-if="this.$auth.hasPermi('base:group-team-scheduling:set')" :disabled="showSetting || settingBtnDis" @click="settingMsg">设置</el-button>
 | 
			
		||||
        </el-form-item>
 | 
			
		||||
        <el-form-item>
 | 
			
		||||
          <el-button type="primary" size="small" v-show="showSetting && autoScheduling" @click="schedulingBtn">自动排班</el-button>
 | 
			
		||||
        </el-form-item>
 | 
			
		||||
        <el-form-item>
 | 
			
		||||
          <span class="separateStyle" v-show="showSetting"></span>
 | 
			
		||||
        </el-form-item>
 | 
			
		||||
        <el-form-item>
 | 
			
		||||
          <el-button type="primary" size="small" v-show="showSetting" @click="confirmSetting">确认</el-button>
 | 
			
		||||
        </el-form-item>
 | 
			
		||||
        <el-form-item>
 | 
			
		||||
          <el-button type="primary" size="small" plain v-show="showSetting" @click="cancelSetting">取消</el-button>
 | 
			
		||||
        </el-form-item>
 | 
			
		||||
        <el-form-item label="请先选择查询的班组" class="rightItem">
 | 
			
		||||
          <!-- <el-button type="primary" size="small" :disabled="jumpDisabled" @click="toOtherPage('1')">班组上下片查询</el-button> -->
 | 
			
		||||
          <el-button type="primary" size="small" :disabled="jumpDisabled" @click="toOtherPage('2')">班组能源查询</el-button>
 | 
			
		||||
          <el-button type="primary" size="small" :disabled="jumpDisabled" @click="toOtherPage('3')">班组检测查询</el-button>
 | 
			
		||||
        </el-form-item>
 | 
			
		||||
      </el-form>
 | 
			
		||||
    </div>
 | 
			
		||||
    <!-- 日历区域 -->
 | 
			
		||||
    <div class="calenderArea">
 | 
			
		||||
      <div style="font-size: 24px;font-weight: 500">{{ this.month }} {{ this.year }}</div>
 | 
			
		||||
      <el-calendar v-model="startDay">
 | 
			
		||||
        <!-- 这里使用的是 2.5 slot 语法,对于新项目请使用 2.6 slot 语法-->
 | 
			
		||||
        <template
 | 
			
		||||
          slot="dateCell"
 | 
			
		||||
          slot-scope="{date, data}">
 | 
			
		||||
          <div v-if="data.type === 'current-month'">
 | 
			
		||||
            <!-- 日期 -->
 | 
			
		||||
            <div class="dateStyle">
 | 
			
		||||
              {{ Number(data.day.split('-')[2]) }}
 | 
			
		||||
            </div>
 | 
			
		||||
            <!-- 班次班组 -->
 | 
			
		||||
            <!-- class有两个样式,一个是类似class1,还有个是选中红框显示 -->
 | 
			
		||||
            <el-row :gutter="2" :class="'class' + (index+1) + (chooseTip === (item.startDay+item.classesId) ? ' team-active' : '')" v-for="(item, index) in list[Number(data.day.split('-')[2])]" :key='index'>
 | 
			
		||||
              <el-col :span="12">
 | 
			
		||||
                <div class="selectDiv">
 | 
			
		||||
                  <!-- 选择班组图标 -->
 | 
			
		||||
                  <div class="toggle-icon" v-show="showSetting && (new Date(data.day).valueOf() < new Date().valueOf() ? false: true)">
 | 
			
		||||
                    <svg-icon icon-class="toggle"/>
 | 
			
		||||
                  </div>
 | 
			
		||||
                  <!-- 不能选择班组 -->
 | 
			
		||||
                  <div class="toggle-icon-hide" v-show="!(showSetting && (new Date(data.day).valueOf() < new Date().valueOf() ? false: true))"></div>
 | 
			
		||||
                  <el-select v-model="item.teamId" size='small' :disabled="!showSetting || (new Date(data.day).valueOf() > new Date().valueOf() ? false: true)">
 | 
			
		||||
                    <el-option
 | 
			
		||||
                      v-for="i in teamList"
 | 
			
		||||
                      :key="i.id"
 | 
			
		||||
                      :label="i.name"
 | 
			
		||||
                      :value="i.id">
 | 
			
		||||
                    </el-option>
 | 
			
		||||
                  </el-select>
 | 
			
		||||
              </div>
 | 
			
		||||
              </el-col>
 | 
			
		||||
              <el-col :span="12">
 | 
			
		||||
                <el-button class="labelClass" @click="chooseTeam(item)">{{ item.classesName }}</el-button>
 | 
			
		||||
              </el-col>
 | 
			
		||||
            </el-row>
 | 
			
		||||
          </div>
 | 
			
		||||
        </template>
 | 
			
		||||
      </el-calendar>
 | 
			
		||||
    </div>
 | 
			
		||||
  </div>
 | 
			
		||||
	<div class="groupTeamScheduling">
 | 
			
		||||
		<div class="operationArea">
 | 
			
		||||
			<el-tabs v-model="planId" @tab-click="setPlan">
 | 
			
		||||
				<el-tab-pane
 | 
			
		||||
					v-for="item in planArr"
 | 
			
		||||
					:key="item.id"
 | 
			
		||||
					:label="item.name"
 | 
			
		||||
					:name="item.id" />
 | 
			
		||||
			</el-tabs>
 | 
			
		||||
			<el-form :inline="true" class="demo-form-inline">
 | 
			
		||||
				<span class="blue-block"></span>
 | 
			
		||||
				<el-form-item label="月份选择">
 | 
			
		||||
					<el-date-picker
 | 
			
		||||
						v-model="startDay"
 | 
			
		||||
						type="month"
 | 
			
		||||
						placeholder="选择月"
 | 
			
		||||
						size="small"
 | 
			
		||||
						:disabled="showSetting"
 | 
			
		||||
						@change="selectMonth"
 | 
			
		||||
						:clearable="false"
 | 
			
		||||
						style="width: 120px"></el-date-picker>
 | 
			
		||||
				</el-form-item>
 | 
			
		||||
				<el-form-item>
 | 
			
		||||
					<span
 | 
			
		||||
						class="separateStyle"
 | 
			
		||||
						v-if="this.$auth.hasPermi('base:group-team-scheduling:set')"></span>
 | 
			
		||||
				</el-form-item>
 | 
			
		||||
				<el-form-item>
 | 
			
		||||
					<el-button
 | 
			
		||||
						type="primary"
 | 
			
		||||
						size="small"
 | 
			
		||||
						v-if="this.$auth.hasPermi('base:group-team-scheduling:set')"
 | 
			
		||||
						:disabled="showSetting || settingBtnDis"
 | 
			
		||||
						@click="settingMsg">
 | 
			
		||||
						设置
 | 
			
		||||
					</el-button>
 | 
			
		||||
				</el-form-item>
 | 
			
		||||
				<el-form-item>
 | 
			
		||||
					<span class="separateStyle" v-show="showSetting"></span>
 | 
			
		||||
				</el-form-item>
 | 
			
		||||
				<el-form-item>
 | 
			
		||||
					<el-button
 | 
			
		||||
						type="primary"
 | 
			
		||||
						size="small"
 | 
			
		||||
						v-show="showSetting"
 | 
			
		||||
						@click="confirmSetting">
 | 
			
		||||
						确认
 | 
			
		||||
					</el-button>
 | 
			
		||||
				</el-form-item>
 | 
			
		||||
				<el-form-item>
 | 
			
		||||
					<el-button
 | 
			
		||||
						type="primary"
 | 
			
		||||
						size="small"
 | 
			
		||||
						plain
 | 
			
		||||
						v-show="showSetting"
 | 
			
		||||
						@click="cancelSetting">
 | 
			
		||||
						取消
 | 
			
		||||
					</el-button>
 | 
			
		||||
				</el-form-item>
 | 
			
		||||
			</el-form>
 | 
			
		||||
		</div>
 | 
			
		||||
		<!-- 日历区域 -->
 | 
			
		||||
		<div class="calenderArea">
 | 
			
		||||
			<div style="font-size: 24px; font-weight: 500">
 | 
			
		||||
				{{ this.month }} {{ this.year }}
 | 
			
		||||
			</div>
 | 
			
		||||
			<el-calendar v-model="startDay">
 | 
			
		||||
				<!-- 这里使用的是 2.5 slot 语法,对于新项目请使用 2.6 slot 语法-->
 | 
			
		||||
				<template slot="dateCell" slot-scope="{ date, data }">
 | 
			
		||||
					<div v-if="data.type === 'current-month'">
 | 
			
		||||
						<!-- 日期 -->
 | 
			
		||||
						<div class="dateStyle">
 | 
			
		||||
							{{ Number(data.day.split('-')[2]) }}
 | 
			
		||||
						</div>
 | 
			
		||||
						<!-- 班次班组 -->
 | 
			
		||||
						<!-- class有两个样式,一个是类似class1,还有个是选中红框显示 -->
 | 
			
		||||
						<el-row
 | 
			
		||||
							:gutter="2"
 | 
			
		||||
							:class="
 | 
			
		||||
								'class' +
 | 
			
		||||
								(index + 1) +
 | 
			
		||||
								(chooseTip === item.startDay + item.classesId
 | 
			
		||||
									? ' team-active'
 | 
			
		||||
									: '')
 | 
			
		||||
							"
 | 
			
		||||
							v-for="(item, index) in list[Number(data.day.split('-')[2])]"
 | 
			
		||||
							:key="index">
 | 
			
		||||
							<el-col :span="12">
 | 
			
		||||
								<div class="selectDiv">
 | 
			
		||||
									<!-- 选择班组图标 -->
 | 
			
		||||
									<div
 | 
			
		||||
										class="toggle-icon"
 | 
			
		||||
										v-show="
 | 
			
		||||
											showSetting &&
 | 
			
		||||
											(new Date(data.day).valueOf() < new Date().valueOf()
 | 
			
		||||
												? false
 | 
			
		||||
												: true)
 | 
			
		||||
										">
 | 
			
		||||
										<svg-icon icon-class="toggle" />
 | 
			
		||||
									</div>
 | 
			
		||||
									<!-- 不能选择班组 -->
 | 
			
		||||
									<div
 | 
			
		||||
										class="toggle-icon-hide"
 | 
			
		||||
										v-show="
 | 
			
		||||
											!(
 | 
			
		||||
												showSetting &&
 | 
			
		||||
												(new Date(data.day).valueOf() < new Date().valueOf()
 | 
			
		||||
													? false
 | 
			
		||||
													: true)
 | 
			
		||||
											)
 | 
			
		||||
										"></div>
 | 
			
		||||
									<el-select
 | 
			
		||||
										v-model="item.teamId"
 | 
			
		||||
										size="small"
 | 
			
		||||
										:disabled="
 | 
			
		||||
											!showSetting ||
 | 
			
		||||
											(new Date(data.day).valueOf() > new Date().valueOf()
 | 
			
		||||
												? false
 | 
			
		||||
												: true)
 | 
			
		||||
										">
 | 
			
		||||
										<el-option
 | 
			
		||||
											v-for="i in teamList"
 | 
			
		||||
											:key="i.id"
 | 
			
		||||
											:label="i.name"
 | 
			
		||||
											:value="i.id"></el-option>
 | 
			
		||||
									</el-select>
 | 
			
		||||
								</div>
 | 
			
		||||
							</el-col>
 | 
			
		||||
							<el-col :span="12">
 | 
			
		||||
								<el-button class="labelClass" @click="chooseTeam(item)">
 | 
			
		||||
									{{ item.classesName }}
 | 
			
		||||
								</el-button>
 | 
			
		||||
							</el-col>
 | 
			
		||||
						</el-row>
 | 
			
		||||
					</div>
 | 
			
		||||
				</template>
 | 
			
		||||
			</el-calendar>
 | 
			
		||||
		</div>
 | 
			
		||||
	</div>
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script>
 | 
			
		||||
import { getPreset, createOrUpdateList, autoSet } from "@/api/base/groupTeamScheduling";
 | 
			
		||||
import { listEnabled } from "@/api/base/groupTeam";
 | 
			
		||||
import {
 | 
			
		||||
	getScheduling,
 | 
			
		||||
	createOrUpdateList,
 | 
			
		||||
} from '@/api/base/groupTeamScheduling';
 | 
			
		||||
import {
 | 
			
		||||
	groupPlanList,
 | 
			
		||||
	groupPlanTeamList,
 | 
			
		||||
} from '@/api/base/groupSchedulingPlan';
 | 
			
		||||
import { listEnabled } from '@/api/base/groupTeam';
 | 
			
		||||
import moment from 'moment';
 | 
			
		||||
 | 
			
		||||
export default {
 | 
			
		||||
  name: "GroupTeamScheduling",
 | 
			
		||||
  data() {
 | 
			
		||||
    return {
 | 
			
		||||
      startDay: '',// 查询参数
 | 
			
		||||
      year: '',// 2023
 | 
			
		||||
      month: '',// 九月
 | 
			
		||||
      monthList: ["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],
 | 
			
		||||
      list: {},
 | 
			
		||||
      teamList: [],// 班组下拉
 | 
			
		||||
      showSetting: false,// 设置模式。自动排班,确认,取消按钮显示
 | 
			
		||||
      settingBtnDis: false,
 | 
			
		||||
      jumpDisabled: true,// 操作按钮控制
 | 
			
		||||
      chooseObj: {}, //当前选中的数据,查询按钮用
 | 
			
		||||
      chooseTip: '',// 当前选中数据的唯一值,显示红框
 | 
			
		||||
      autoScheduling: false // 只有在当前日期后的月份才生效
 | 
			
		||||
    };
 | 
			
		||||
  },
 | 
			
		||||
  created() {
 | 
			
		||||
    this.startDay = new Date()
 | 
			
		||||
    // 设置按钮是否置灰
 | 
			
		||||
    this.settingBtn()
 | 
			
		||||
    this.getTeamList()
 | 
			
		||||
    this.toggleMonth()
 | 
			
		||||
    this.getList()
 | 
			
		||||
  },
 | 
			
		||||
  methods: {
 | 
			
		||||
    // 切换月份
 | 
			
		||||
    selectMonth() {
 | 
			
		||||
      if (this.startDay) {
 | 
			
		||||
        this.settingBtn() // 设置按钮状态,需在getlist前面
 | 
			
		||||
        this.toggleMonth()
 | 
			
		||||
        this.getList()
 | 
			
		||||
        this.clearChoose()
 | 
			
		||||
        if ( moment(this.startDay).valueOf() > moment().endOf('month').valueOf()) {
 | 
			
		||||
          this.autoScheduling = true
 | 
			
		||||
        } else {
 | 
			
		||||
          this.autoScheduling = false
 | 
			
		||||
        }
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
    // 获取班组列表
 | 
			
		||||
    getTeamList() {
 | 
			
		||||
      listEnabled().then(res => {
 | 
			
		||||
        this.teamList = res.data || []
 | 
			
		||||
      })
 | 
			
		||||
    },
 | 
			
		||||
    // 获取日历数据
 | 
			
		||||
    getList() {
 | 
			
		||||
      let year = moment(this.startDay).format('YYYY')
 | 
			
		||||
      let month = moment(this.startDay).format('M')
 | 
			
		||||
      getPreset({
 | 
			
		||||
        year: year,
 | 
			
		||||
        month: month
 | 
			
		||||
      }).then(res => {
 | 
			
		||||
        let obj = res.data || {}
 | 
			
		||||
        if (obj) {
 | 
			
		||||
          for (let item in obj) {
 | 
			
		||||
            for (let i = 0; i < obj[item].length; i++) {
 | 
			
		||||
              if (!obj[item][i].teamId) {
 | 
			
		||||
                obj[item][i].teamId = ''
 | 
			
		||||
              }
 | 
			
		||||
            }
 | 
			
		||||
          }
 | 
			
		||||
        }
 | 
			
		||||
        this.list = obj
 | 
			
		||||
      }).catch(() => {
 | 
			
		||||
        this.list = {}
 | 
			
		||||
        this.settingBtnDis = true // 禁用设置按钮
 | 
			
		||||
      })
 | 
			
		||||
    },
 | 
			
		||||
    // 设置
 | 
			
		||||
    settingMsg() {
 | 
			
		||||
      this.showSetting = !this.showSetting
 | 
			
		||||
      this.clearChoose()
 | 
			
		||||
    },
 | 
			
		||||
    // 取消
 | 
			
		||||
    cancelSetting() {
 | 
			
		||||
      this.showSetting = !this.showSetting
 | 
			
		||||
      this.getList() // 数据还原
 | 
			
		||||
    },
 | 
			
		||||
    // 确认
 | 
			
		||||
    confirmSetting() {
 | 
			
		||||
      let num = 0
 | 
			
		||||
      // 当月数据的话,今天及今天之前的不传
 | 
			
		||||
      if (moment(this.startDay).format('YYYY-MM') === moment().format('YYYY-MM')) {
 | 
			
		||||
        num = Number(moment().format('DD'))
 | 
			
		||||
      } else {
 | 
			
		||||
        num = 0
 | 
			
		||||
      }
 | 
			
		||||
      // 下月数据全部都传
 | 
			
		||||
      // 打平数据
 | 
			
		||||
      let tempArr = Object.values(this.list)
 | 
			
		||||
      let arr = []
 | 
			
		||||
      for (let i = num; i < tempArr.length; i++) {
 | 
			
		||||
        for (let j = 0; j < tempArr[i].length; j++) {
 | 
			
		||||
          arr.push(tempArr[i][j])
 | 
			
		||||
        }
 | 
			
		||||
      }
 | 
			
		||||
      createOrUpdateList(arr).then(res => {
 | 
			
		||||
        if (res.code === 0) {
 | 
			
		||||
          this.showSetting = !this.showSetting
 | 
			
		||||
          this.$modal.msgSuccess("操作成功")
 | 
			
		||||
          this.getList() // 数据更新
 | 
			
		||||
        }
 | 
			
		||||
      })
 | 
			
		||||
    },
 | 
			
		||||
    // 点击班次红框选中当前数据
 | 
			
		||||
    chooseTeam(value) {
 | 
			
		||||
      if (this.showSetting) {
 | 
			
		||||
        this.$modal.msgWarning("当前处于设置模式")
 | 
			
		||||
        return false
 | 
			
		||||
      }
 | 
			
		||||
      this.chooseObj = value
 | 
			
		||||
      this.chooseTip = value.startDay + value.classesId // 匹配当前的样式
 | 
			
		||||
      this.jumpDisabled = false //查询按钮不禁用
 | 
			
		||||
    },
 | 
			
		||||
    // 自动排班
 | 
			
		||||
    schedulingBtn() {
 | 
			
		||||
      let tempData = this.list
 | 
			
		||||
      // 次月1号有值前端排班
 | 
			
		||||
      if (this.list[1][0].teamId) {
 | 
			
		||||
        let tempArr = Object.values(this.list)
 | 
			
		||||
        let arr = []
 | 
			
		||||
        let n = 0
 | 
			
		||||
        for (let i = 0; i < tempArr.length; i++) {
 | 
			
		||||
          if (n > 0) {
 | 
			
		||||
            break;
 | 
			
		||||
          }
 | 
			
		||||
          for (let j = 0; j < tempArr[i].length; j++) {
 | 
			
		||||
            if (tempArr[i][j].teamId) {
 | 
			
		||||
              arr.push(tempArr[i][j].teamId)
 | 
			
		||||
            } else {
 | 
			
		||||
              n++
 | 
			
		||||
            }
 | 
			
		||||
          }
 | 
			
		||||
        }
 | 
			
		||||
        let tempNum = 0
 | 
			
		||||
        for (let k = 0; k < tempArr.length; k++) {
 | 
			
		||||
          for (let v = 0; v < tempArr[k].length; v++) {
 | 
			
		||||
            let t = tempNum % arr.length
 | 
			
		||||
            if (arr.length === 1) {
 | 
			
		||||
              tempData[k+1][v].teamId = arr[0]
 | 
			
		||||
            } else {
 | 
			
		||||
              tempData[k+1][v].teamId = arr[t]
 | 
			
		||||
            }
 | 
			
		||||
            tempNum++
 | 
			
		||||
          }
 | 
			
		||||
        }
 | 
			
		||||
        this.list = []
 | 
			
		||||
        this.list = tempData
 | 
			
		||||
      } else {
 | 
			
		||||
        // 次月1号没有值,接口排班
 | 
			
		||||
        // console.log(moment(this.startDay).format("YYYY-MM-DD"))
 | 
			
		||||
        autoSet({
 | 
			
		||||
          year: this.year,
 | 
			
		||||
          month: moment(this.startDay).month() + 1
 | 
			
		||||
        }).then(res => {
 | 
			
		||||
          this.list = res.data || {}
 | 
			
		||||
        })
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
    // 设置按钮如果是上个月或者今天是本月最后一天,设置按钮置灰
 | 
			
		||||
    settingBtn() {
 | 
			
		||||
      let nowMonth = moment().startOf('month').valueOf()
 | 
			
		||||
      let startMonth = moment(this.startDay).valueOf()
 | 
			
		||||
      let nowDate = moment(new Date()).date()
 | 
			
		||||
      let sumDate = moment().daysInMonth()
 | 
			
		||||
      if (nowMonth > startMonth) { // 之前月
 | 
			
		||||
        this.settingBtnDis = true
 | 
			
		||||
      } else {
 | 
			
		||||
        if (nowDate < sumDate) {
 | 
			
		||||
          this.settingBtnDis = false
 | 
			
		||||
        } else {
 | 
			
		||||
          this.settingBtnDis = true
 | 
			
		||||
        }
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
    // 清除红框选中数据
 | 
			
		||||
    clearChoose() {
 | 
			
		||||
      this.chooseObj = {}
 | 
			
		||||
      this.chooseTip = ""
 | 
			
		||||
      this.jumpDisabled = true
 | 
			
		||||
    },
 | 
			
		||||
    // 切换月份显示
 | 
			
		||||
    toggleMonth() {
 | 
			
		||||
      this.year = moment(this.startDay).format("YYYY")
 | 
			
		||||
      let month = Number(moment(this.startDay).format("MM"))
 | 
			
		||||
      this.month = this.monthList[month - 1]
 | 
			
		||||
    },
 | 
			
		||||
    // 3个跳转按钮
 | 
			
		||||
    toOtherPage(val) {
 | 
			
		||||
      switch (val) {
 | 
			
		||||
        case '1':
 | 
			
		||||
          this.$router.push({
 | 
			
		||||
            path: '/core/enhance/product-line-24h?startTime='+this.chooseObj.startTime+'&endTime='+this.chooseObj.endTime,
 | 
			
		||||
          })
 | 
			
		||||
          break;
 | 
			
		||||
        case '2': // 能源
 | 
			
		||||
          this.$router.push({
 | 
			
		||||
            // path: '/energy/monitoring/energy-report-search?startTime='+this.chooseObj.startTime+'&endTime='+this.chooseObj.endTime
 | 
			
		||||
            path: '/energy/base/energy-quantity-realtime?startTime='+this.chooseObj.startTime+'&endTime='+this.chooseObj.endTime
 | 
			
		||||
          })
 | 
			
		||||
          break;
 | 
			
		||||
        default:
 | 
			
		||||
          this.$router.push({
 | 
			
		||||
            path: '/quality/base/quality-inspection-data/detection-information/statistical-data?startTime='+this.chooseObj.startTime+'&endTime='+this.chooseObj.endTime,
 | 
			
		||||
            // name: 'QualityStatistics',
 | 
			
		||||
            // params: { startTime: this.chooseObj.startTime, endTime: this.chooseObj.endTime }
 | 
			
		||||
          })
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
	name: 'GroupTeamScheduling',
 | 
			
		||||
	data() {
 | 
			
		||||
		return {
 | 
			
		||||
			startDay: '', // 查询参数
 | 
			
		||||
			year: '', // 2023
 | 
			
		||||
			month: '', // 九月
 | 
			
		||||
			monthList: [
 | 
			
		||||
				'一月',
 | 
			
		||||
				'二月',
 | 
			
		||||
				'三月',
 | 
			
		||||
				'四月',
 | 
			
		||||
				'五月',
 | 
			
		||||
				'六月',
 | 
			
		||||
				'七月',
 | 
			
		||||
				'八月',
 | 
			
		||||
				'九月',
 | 
			
		||||
				'十月',
 | 
			
		||||
				'十一月',
 | 
			
		||||
				'十二月',
 | 
			
		||||
			],
 | 
			
		||||
			planId: undefined, //计划id
 | 
			
		||||
			list: {},
 | 
			
		||||
			planArr: [], //排班计划数组
 | 
			
		||||
			teamList: [], // 班组下拉
 | 
			
		||||
			showSetting: false, // 设置模式。自动排班,确认,取消按钮显示
 | 
			
		||||
			settingBtnDis: false,
 | 
			
		||||
			jumpDisabled: true, // 操作按钮控制
 | 
			
		||||
			chooseObj: {}, //当前选中的数据,查询按钮用
 | 
			
		||||
			chooseTip: '', // 当前选中数据的唯一值,显示红框
 | 
			
		||||
			autoScheduling: false, // 只有在当前日期后的月份才生效
 | 
			
		||||
		};
 | 
			
		||||
	},
 | 
			
		||||
	created() {
 | 
			
		||||
		this.startDay = new Date();
 | 
			
		||||
		groupPlanList().then((res) => {
 | 
			
		||||
			this.planArr = res.data || [];
 | 
			
		||||
			this.planId = this.planArr[0] ? this.planArr[0].id : undefined;
 | 
			
		||||
			if (this.planId) {
 | 
			
		||||
				this.getList();
 | 
			
		||||
				this.getTeamList();
 | 
			
		||||
			}
 | 
			
		||||
		});
 | 
			
		||||
		// 设置按钮是否置灰
 | 
			
		||||
		this.settingBtn();
 | 
			
		||||
		this.toggleMonth();
 | 
			
		||||
	},
 | 
			
		||||
	methods: {
 | 
			
		||||
		setPlan() {
 | 
			
		||||
			this.getList();
 | 
			
		||||
			this.getTeamList();
 | 
			
		||||
		},
 | 
			
		||||
		// 切换月份
 | 
			
		||||
		selectMonth() {
 | 
			
		||||
			if (this.startDay) {
 | 
			
		||||
				this.settingBtn(); // 设置按钮状态,需在getlist前面
 | 
			
		||||
				this.toggleMonth();
 | 
			
		||||
				this.getList();
 | 
			
		||||
				this.clearChoose();
 | 
			
		||||
				if (
 | 
			
		||||
					moment(this.startDay).valueOf() > moment().endOf('month').valueOf()
 | 
			
		||||
				) {
 | 
			
		||||
					this.autoScheduling = true;
 | 
			
		||||
				} else {
 | 
			
		||||
					this.autoScheduling = false;
 | 
			
		||||
				}
 | 
			
		||||
			}
 | 
			
		||||
		},
 | 
			
		||||
		// 获取计划对应班组列表
 | 
			
		||||
		getTeamList() {
 | 
			
		||||
			groupPlanTeamList(this.planId).then((res) => {
 | 
			
		||||
				this.teamList = res.data || [];
 | 
			
		||||
			});
 | 
			
		||||
		},
 | 
			
		||||
		// 获取日历数据
 | 
			
		||||
		getList() {
 | 
			
		||||
			let year = moment(this.startDay).format('YYYY');
 | 
			
		||||
			let month = moment(this.startDay).format('M');
 | 
			
		||||
			getScheduling({
 | 
			
		||||
				year: year,
 | 
			
		||||
				month: month,
 | 
			
		||||
				planId: this.planId,
 | 
			
		||||
			})
 | 
			
		||||
				.then((res) => {
 | 
			
		||||
					let obj = res.data || {};
 | 
			
		||||
					if (obj) {
 | 
			
		||||
						for (let item in obj) {
 | 
			
		||||
							for (let i = 0; i < obj[item].length; i++) {
 | 
			
		||||
								if (!obj[item][i].teamId) {
 | 
			
		||||
									obj[item][i].teamId = '';
 | 
			
		||||
								}
 | 
			
		||||
							}
 | 
			
		||||
						}
 | 
			
		||||
					}
 | 
			
		||||
					this.list = obj;
 | 
			
		||||
				})
 | 
			
		||||
				.catch(() => {
 | 
			
		||||
					this.list = {};
 | 
			
		||||
					this.settingBtnDis = true; // 禁用设置按钮
 | 
			
		||||
				});
 | 
			
		||||
		},
 | 
			
		||||
		// 设置
 | 
			
		||||
		settingMsg() {
 | 
			
		||||
			this.showSetting = !this.showSetting;
 | 
			
		||||
			this.clearChoose();
 | 
			
		||||
		},
 | 
			
		||||
		// 取消
 | 
			
		||||
		cancelSetting() {
 | 
			
		||||
			this.showSetting = !this.showSetting;
 | 
			
		||||
			this.getList(); // 数据还原
 | 
			
		||||
		},
 | 
			
		||||
		// 确认
 | 
			
		||||
		confirmSetting() {
 | 
			
		||||
			let num = 0;
 | 
			
		||||
			// 当月数据的话,今天及今天之前的不传
 | 
			
		||||
			if (
 | 
			
		||||
				moment(this.startDay).format('YYYY-MM') === moment().format('YYYY-MM')
 | 
			
		||||
			) {
 | 
			
		||||
				num = Number(moment().format('DD'));
 | 
			
		||||
			} else {
 | 
			
		||||
				num = 0;
 | 
			
		||||
			}
 | 
			
		||||
			// 下月数据全部都传
 | 
			
		||||
			// 打平数据
 | 
			
		||||
			let tempArr = Object.values(this.list);
 | 
			
		||||
			let arr = [];
 | 
			
		||||
			for (let i = num; i < tempArr.length; i++) {
 | 
			
		||||
				for (let j = 0; j < tempArr[i].length; j++) {
 | 
			
		||||
					arr.push(tempArr[i][j]);
 | 
			
		||||
				}
 | 
			
		||||
			}
 | 
			
		||||
			createOrUpdateList(arr).then((res) => {
 | 
			
		||||
				if (res.code === 0) {
 | 
			
		||||
					this.showSetting = !this.showSetting;
 | 
			
		||||
					this.$modal.msgSuccess('操作成功');
 | 
			
		||||
					this.getList(); // 数据更新
 | 
			
		||||
				}
 | 
			
		||||
			});
 | 
			
		||||
		},
 | 
			
		||||
		// 点击班次红框选中当前数据
 | 
			
		||||
		chooseTeam(value) {
 | 
			
		||||
			// if (this.showSetting) {
 | 
			
		||||
			// 	this.$modal.msgWarning('当前处于设置模式');
 | 
			
		||||
			// 	return false;
 | 
			
		||||
			// }
 | 
			
		||||
			this.chooseObj = value;
 | 
			
		||||
			this.chooseTip = value.startDay + value.classesId; // 匹配当前的样式
 | 
			
		||||
			this.jumpDisabled = false; //查询按钮不禁用
 | 
			
		||||
		},
 | 
			
		||||
		// 设置按钮如果是上个月或者今天是本月最后一天,设置按钮置灰
 | 
			
		||||
		settingBtn() {
 | 
			
		||||
			let nowMonth = moment().startOf('month').valueOf();
 | 
			
		||||
			let startMonth = moment(this.startDay).valueOf();
 | 
			
		||||
			let nowDate = moment(new Date()).date();
 | 
			
		||||
			let sumDate = moment().daysInMonth();
 | 
			
		||||
			if (nowMonth > startMonth) {
 | 
			
		||||
				// 之前月
 | 
			
		||||
				this.settingBtnDis = true;
 | 
			
		||||
			} else {
 | 
			
		||||
				if (nowDate < sumDate) {
 | 
			
		||||
					this.settingBtnDis = false;
 | 
			
		||||
				} else {
 | 
			
		||||
					this.settingBtnDis = true;
 | 
			
		||||
				}
 | 
			
		||||
			}
 | 
			
		||||
		},
 | 
			
		||||
		// 清除红框选中数据
 | 
			
		||||
		clearChoose() {
 | 
			
		||||
			this.chooseObj = {};
 | 
			
		||||
			this.chooseTip = '';
 | 
			
		||||
			this.jumpDisabled = true;
 | 
			
		||||
		},
 | 
			
		||||
		// 切换月份显示
 | 
			
		||||
		toggleMonth() {
 | 
			
		||||
			this.year = moment(this.startDay).format('YYYY');
 | 
			
		||||
			let month = Number(moment(this.startDay).format('MM'));
 | 
			
		||||
			this.month = this.monthList[month - 1];
 | 
			
		||||
		},
 | 
			
		||||
	},
 | 
			
		||||
};
 | 
			
		||||
</script>
 | 
			
		||||
<style lang='scss'>
 | 
			
		||||
<style lang="scss">
 | 
			
		||||
.demo-form-inline {
 | 
			
		||||
  .el-date-editor .el-range__icon {
 | 
			
		||||
    font-size: 16px;
 | 
			
		||||
    color: #0B58FF;
 | 
			
		||||
  }
 | 
			
		||||
  .el-input__prefix .el-icon-date {
 | 
			
		||||
    font-size: 16px;
 | 
			
		||||
    color: #0B58FF;
 | 
			
		||||
  }
 | 
			
		||||
	.el-date-editor .el-range__icon {
 | 
			
		||||
		font-size: 16px;
 | 
			
		||||
		color: #0b58ff;
 | 
			
		||||
	}
 | 
			
		||||
	.el-input__prefix .el-icon-date {
 | 
			
		||||
		font-size: 16px;
 | 
			
		||||
		color: #0b58ff;
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
.groupTeamScheduling {
 | 
			
		||||
  background-color: #F2F4F9;
 | 
			
		||||
  .operationArea {
 | 
			
		||||
    padding: 14px 10px 0 16px;
 | 
			
		||||
    margin-bottom: 8px;
 | 
			
		||||
    background-color: #fff;
 | 
			
		||||
    border-radius: 8px;
 | 
			
		||||
    .blue-block {
 | 
			
		||||
      display: inline-block;
 | 
			
		||||
      width: 4px;
 | 
			
		||||
      height: 16px;
 | 
			
		||||
      background-color: #0B58FF;
 | 
			
		||||
      border-radius: 1px;
 | 
			
		||||
      margin-right: 8px;
 | 
			
		||||
      margin-top: 10px;
 | 
			
		||||
    }
 | 
			
		||||
    .separateStyle {
 | 
			
		||||
      display: inline-block;
 | 
			
		||||
      width: 1px;
 | 
			
		||||
      height: 24px;
 | 
			
		||||
      background: #E8E8E8;
 | 
			
		||||
      vertical-align: middle;
 | 
			
		||||
    }
 | 
			
		||||
    .el-form-item {
 | 
			
		||||
      margin-bottom: 10px;
 | 
			
		||||
    }
 | 
			
		||||
    .rightItem {
 | 
			
		||||
      float: right;
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
  // 日历
 | 
			
		||||
  .calenderArea {
 | 
			
		||||
    padding: 14px 10px 0 20px;
 | 
			
		||||
    background-color: #fff;
 | 
			
		||||
    border-radius: 8px;
 | 
			
		||||
    .el-calendar__body {
 | 
			
		||||
      padding: 10px 16px 16px 0;
 | 
			
		||||
    }
 | 
			
		||||
    .el-calendar__header {
 | 
			
		||||
      display: none;
 | 
			
		||||
    }
 | 
			
		||||
    .el-calendar-table > thead {
 | 
			
		||||
      height: 48px;
 | 
			
		||||
      font-size: 20px;
 | 
			
		||||
      font-weight: 500;
 | 
			
		||||
      color: #000000;
 | 
			
		||||
      background-color: rgba(242, 244, 249, 1);
 | 
			
		||||
    }
 | 
			
		||||
    .el-calendar-table__row {
 | 
			
		||||
      height: 133px;
 | 
			
		||||
      .prev, .next {
 | 
			
		||||
        pointer-events: none;
 | 
			
		||||
      }
 | 
			
		||||
      .el-calendar-day {
 | 
			
		||||
        padding: 0 10px;
 | 
			
		||||
        height: 100%;
 | 
			
		||||
        .dateStyle {
 | 
			
		||||
          font-size: 20px;
 | 
			
		||||
          font-weight: 500;
 | 
			
		||||
          color: #000000;
 | 
			
		||||
          text-align: right;
 | 
			
		||||
          height: 32px;
 | 
			
		||||
          line-height: 28px;
 | 
			
		||||
          padding-right: 10px;
 | 
			
		||||
        }
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
    .team-active {// 选中班组
 | 
			
		||||
      border:2px solid red
 | 
			
		||||
    }
 | 
			
		||||
    .class1, .class2, .class3 {
 | 
			
		||||
      padding: 0;
 | 
			
		||||
      font-weight: 600;
 | 
			
		||||
      margin-bottom: 2px;
 | 
			
		||||
      .selectDiv {
 | 
			
		||||
        position: relative;
 | 
			
		||||
        .toggle-icon {
 | 
			
		||||
          position: absolute;
 | 
			
		||||
          width: 26px;
 | 
			
		||||
          height: 26px;
 | 
			
		||||
          line-height: 26px;
 | 
			
		||||
          font-size: 14px;
 | 
			
		||||
          z-index: 1;
 | 
			
		||||
          text-align: center;
 | 
			
		||||
        }
 | 
			
		||||
        .toggle-icon-hide {
 | 
			
		||||
          position: absolute;
 | 
			
		||||
          width: 2px;
 | 
			
		||||
          height: 28px;
 | 
			
		||||
          z-index: 1;
 | 
			
		||||
        }
 | 
			
		||||
        .el-input__suffix {
 | 
			
		||||
          display: none;
 | 
			
		||||
        }
 | 
			
		||||
        .el-input--suffix .el-input__inner {
 | 
			
		||||
          padding: 0 4px 0 28px;
 | 
			
		||||
        }
 | 
			
		||||
        .el-input--small .el-input__inner {
 | 
			
		||||
          height: 28px;
 | 
			
		||||
          border: none;
 | 
			
		||||
          font-weight: 600;
 | 
			
		||||
        }
 | 
			
		||||
      }
 | 
			
		||||
      .labelClass {
 | 
			
		||||
        width: 100%;
 | 
			
		||||
        height: 28px;
 | 
			
		||||
        border: none;
 | 
			
		||||
        padding: 0;
 | 
			
		||||
        font-weight: 600;
 | 
			
		||||
        text-align: center;
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
    .class1 {
 | 
			
		||||
      .selectDiv {
 | 
			
		||||
        .toggle-icon, .toggle-icon-hide {
 | 
			
		||||
          background-color: #FACE00;
 | 
			
		||||
        }
 | 
			
		||||
        .el-input--small .el-input__inner {
 | 
			
		||||
          color: #E7A200;
 | 
			
		||||
          background-color: #FFEFC0;
 | 
			
		||||
        }
 | 
			
		||||
      }
 | 
			
		||||
      .labelClass {
 | 
			
		||||
        color: #E7A200;
 | 
			
		||||
        background-color: #FFEFC0;
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
    .class2 {
 | 
			
		||||
      .selectDiv {
 | 
			
		||||
        .toggle-icon, .toggle-icon-hide {
 | 
			
		||||
          background-color: #3984FF;
 | 
			
		||||
        }
 | 
			
		||||
        .el-input--small .el-input__inner {
 | 
			
		||||
          color: #2D7BFF;
 | 
			
		||||
          background-color: #BEEAFF;
 | 
			
		||||
        }
 | 
			
		||||
      }
 | 
			
		||||
      .labelClass {
 | 
			
		||||
        color: #2D7BFF;
 | 
			
		||||
        background-color: #BEEAFF;
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
    .class3 {
 | 
			
		||||
      .selectDiv {
 | 
			
		||||
        .toggle-icon, .toggle-icon-hide {
 | 
			
		||||
          background-color: #37D97F;
 | 
			
		||||
        }
 | 
			
		||||
        .el-input--small .el-input__inner {
 | 
			
		||||
          color: #129F51;
 | 
			
		||||
          background-color: #E0FFEE;
 | 
			
		||||
        }
 | 
			
		||||
      }
 | 
			
		||||
      .labelClass {
 | 
			
		||||
        color: #129F51;
 | 
			
		||||
        background-color: #E0FFEE;
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
	background-color: #f2f4f9;
 | 
			
		||||
	.operationArea {
 | 
			
		||||
		padding: 14px 10px 0 16px;
 | 
			
		||||
		margin-bottom: 8px;
 | 
			
		||||
		background-color: #fff;
 | 
			
		||||
		border-radius: 8px;
 | 
			
		||||
		.blue-block {
 | 
			
		||||
			display: inline-block;
 | 
			
		||||
			width: 4px;
 | 
			
		||||
			height: 16px;
 | 
			
		||||
			background-color: #0b58ff;
 | 
			
		||||
			border-radius: 1px;
 | 
			
		||||
			margin-right: 8px;
 | 
			
		||||
			margin-top: 10px;
 | 
			
		||||
		}
 | 
			
		||||
		.separateStyle {
 | 
			
		||||
			display: inline-block;
 | 
			
		||||
			width: 1px;
 | 
			
		||||
			height: 24px;
 | 
			
		||||
			background: #e8e8e8;
 | 
			
		||||
			vertical-align: middle;
 | 
			
		||||
		}
 | 
			
		||||
		.el-form-item {
 | 
			
		||||
			margin-bottom: 10px;
 | 
			
		||||
		}
 | 
			
		||||
		.rightItem {
 | 
			
		||||
			float: right;
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
	// 日历
 | 
			
		||||
	.calenderArea {
 | 
			
		||||
		padding: 14px 10px 0 20px;
 | 
			
		||||
		background-color: #fff;
 | 
			
		||||
		border-radius: 8px;
 | 
			
		||||
		.el-calendar__body {
 | 
			
		||||
			padding: 10px 16px 16px 0;
 | 
			
		||||
		}
 | 
			
		||||
		.el-calendar__header {
 | 
			
		||||
			display: none;
 | 
			
		||||
		}
 | 
			
		||||
		.el-calendar-table > thead {
 | 
			
		||||
			height: 48px;
 | 
			
		||||
			font-size: 20px;
 | 
			
		||||
			font-weight: 500;
 | 
			
		||||
			color: #000000;
 | 
			
		||||
			background-color: rgba(242, 244, 249, 1);
 | 
			
		||||
		}
 | 
			
		||||
		.el-calendar-table__row {
 | 
			
		||||
			height: 133px;
 | 
			
		||||
			.prev,
 | 
			
		||||
			.next {
 | 
			
		||||
				pointer-events: none;
 | 
			
		||||
			}
 | 
			
		||||
			.el-calendar-day {
 | 
			
		||||
				padding: 0 10px;
 | 
			
		||||
				height: 100%;
 | 
			
		||||
				.dateStyle {
 | 
			
		||||
					font-size: 20px;
 | 
			
		||||
					font-weight: 500;
 | 
			
		||||
					color: #000000;
 | 
			
		||||
					text-align: right;
 | 
			
		||||
					height: 32px;
 | 
			
		||||
					line-height: 28px;
 | 
			
		||||
					padding-right: 10px;
 | 
			
		||||
				}
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
		.team-active {
 | 
			
		||||
			// 选中班组
 | 
			
		||||
			border: 2px solid #409eff;
 | 
			
		||||
		}
 | 
			
		||||
		.class1,
 | 
			
		||||
		.class2,
 | 
			
		||||
		.class3 {
 | 
			
		||||
			padding: 0;
 | 
			
		||||
			font-weight: 600;
 | 
			
		||||
			margin-bottom: 2px;
 | 
			
		||||
			.selectDiv {
 | 
			
		||||
				position: relative;
 | 
			
		||||
				.toggle-icon {
 | 
			
		||||
					position: absolute;
 | 
			
		||||
					width: 26px;
 | 
			
		||||
					height: 26px;
 | 
			
		||||
					line-height: 26px;
 | 
			
		||||
					font-size: 14px;
 | 
			
		||||
					z-index: 1;
 | 
			
		||||
					text-align: center;
 | 
			
		||||
				}
 | 
			
		||||
				.toggle-icon-hide {
 | 
			
		||||
					position: absolute;
 | 
			
		||||
					width: 2px;
 | 
			
		||||
					height: 28px;
 | 
			
		||||
					z-index: 1;
 | 
			
		||||
				}
 | 
			
		||||
				.el-input__suffix {
 | 
			
		||||
					display: none;
 | 
			
		||||
				}
 | 
			
		||||
				.el-input--suffix .el-input__inner {
 | 
			
		||||
					padding: 0 4px 0 28px;
 | 
			
		||||
				}
 | 
			
		||||
				.el-input--small .el-input__inner {
 | 
			
		||||
					height: 28px;
 | 
			
		||||
					border: none;
 | 
			
		||||
					font-weight: 600;
 | 
			
		||||
				}
 | 
			
		||||
			}
 | 
			
		||||
			.labelClass {
 | 
			
		||||
				width: 100%;
 | 
			
		||||
				height: 28px;
 | 
			
		||||
				border: none;
 | 
			
		||||
				padding: 0;
 | 
			
		||||
				font-weight: 600;
 | 
			
		||||
				text-align: center;
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
		.class1 {
 | 
			
		||||
			.selectDiv {
 | 
			
		||||
				.toggle-icon,
 | 
			
		||||
				.toggle-icon-hide {
 | 
			
		||||
					background-color: #face00;
 | 
			
		||||
				}
 | 
			
		||||
				.el-input--small .el-input__inner {
 | 
			
		||||
					color: #e7a200;
 | 
			
		||||
					background-color: #ffefc0;
 | 
			
		||||
				}
 | 
			
		||||
			}
 | 
			
		||||
			.labelClass {
 | 
			
		||||
				color: #e7a200;
 | 
			
		||||
				background-color: #ffefc0;
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
		.class2 {
 | 
			
		||||
			.selectDiv {
 | 
			
		||||
				.toggle-icon,
 | 
			
		||||
				.toggle-icon-hide {
 | 
			
		||||
					background-color: #3984ff;
 | 
			
		||||
				}
 | 
			
		||||
				.el-input--small .el-input__inner {
 | 
			
		||||
					color: #2d7bff;
 | 
			
		||||
					background-color: #beeaff;
 | 
			
		||||
				}
 | 
			
		||||
			}
 | 
			
		||||
			.labelClass {
 | 
			
		||||
				color: #2d7bff;
 | 
			
		||||
				background-color: #beeaff;
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
		.class3 {
 | 
			
		||||
			.selectDiv {
 | 
			
		||||
				.toggle-icon,
 | 
			
		||||
				.toggle-icon-hide {
 | 
			
		||||
					background-color: #37d97f;
 | 
			
		||||
				}
 | 
			
		||||
				.el-input--small .el-input__inner {
 | 
			
		||||
					color: #129f51;
 | 
			
		||||
					background-color: #e0ffee;
 | 
			
		||||
				}
 | 
			
		||||
			}
 | 
			
		||||
			.labelClass {
 | 
			
		||||
				color: #129f51;
 | 
			
		||||
				background-color: #e0ffee;
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
</style>
 | 
			
		||||
 
 | 
			
		||||
@@ -0,0 +1,260 @@
 | 
			
		||||
<!--
 | 
			
		||||
 * @Author: zwq
 | 
			
		||||
 * @Date: 2024-07-10 13:43:41
 | 
			
		||||
 * @LastEditors: zwq
 | 
			
		||||
 * @LastEditTime: 2024-07-15 16:00:36
 | 
			
		||||
 * @Description:
 | 
			
		||||
-->
 | 
			
		||||
<template>
 | 
			
		||||
	<el-form ref="form" :rules="rules" label-width="110px" :model="form">
 | 
			
		||||
		<el-row>
 | 
			
		||||
			<el-col :span="12">
 | 
			
		||||
				<el-form-item label="部门名称" prop="deptId">
 | 
			
		||||
					<el-select
 | 
			
		||||
						v-model="form.deptId"
 | 
			
		||||
						filterable
 | 
			
		||||
						clearable
 | 
			
		||||
						style="width: 100%"
 | 
			
		||||
						placeholder="请选择部门">
 | 
			
		||||
						<el-option
 | 
			
		||||
							v-for="item in deptArr"
 | 
			
		||||
							:key="item.id"
 | 
			
		||||
							:label="item.name"
 | 
			
		||||
							:value="item.id"></el-option>
 | 
			
		||||
					</el-select>
 | 
			
		||||
				</el-form-item>
 | 
			
		||||
			</el-col>
 | 
			
		||||
			<el-col :span="12">
 | 
			
		||||
				<el-form-item label="计划名称" prop="name">
 | 
			
		||||
					<el-input v-model="form.name" clearable />
 | 
			
		||||
				</el-form-item>
 | 
			
		||||
			</el-col>
 | 
			
		||||
			<el-col :span="12">
 | 
			
		||||
				<el-form-item label="相关班组" prop="teamIdList">
 | 
			
		||||
					<el-select
 | 
			
		||||
						v-model="form.teamIdList"
 | 
			
		||||
						filterable
 | 
			
		||||
						clearable
 | 
			
		||||
						multiple
 | 
			
		||||
						style="width: 100%"
 | 
			
		||||
						placeholder="请选择班组">
 | 
			
		||||
						<el-option
 | 
			
		||||
							v-for="item in teamList"
 | 
			
		||||
							:key="item.id"
 | 
			
		||||
							:label="item.name"
 | 
			
		||||
							:value="item.id"></el-option>
 | 
			
		||||
					</el-select>
 | 
			
		||||
				</el-form-item>
 | 
			
		||||
			</el-col>
 | 
			
		||||
			<el-col :span="12">
 | 
			
		||||
				<el-form-item label="相关班次" prop="classesIdList">
 | 
			
		||||
					<el-select
 | 
			
		||||
						v-model="form.classesIdList"
 | 
			
		||||
						filterable
 | 
			
		||||
						clearable
 | 
			
		||||
						multiple
 | 
			
		||||
						style="width: 100%"
 | 
			
		||||
						placeholder="请选择班次">
 | 
			
		||||
						<el-option
 | 
			
		||||
							v-for="item in classList"
 | 
			
		||||
							:key="item.id"
 | 
			
		||||
							:label="item.name"
 | 
			
		||||
							:value="item.id"></el-option>
 | 
			
		||||
					</el-select>
 | 
			
		||||
				</el-form-item>
 | 
			
		||||
			</el-col>
 | 
			
		||||
			<el-col :span="12">
 | 
			
		||||
				<el-form-item label="备注" prop="remark">
 | 
			
		||||
					<el-input v-model="form.remark"></el-input>
 | 
			
		||||
				</el-form-item>
 | 
			
		||||
			</el-col>
 | 
			
		||||
			<el-col :span="12">
 | 
			
		||||
				<el-form-item label="是否生产班组" prop="isProduction">
 | 
			
		||||
					<el-radio-group v-model="form.isProduction">
 | 
			
		||||
						<el-radio :label="true">是</el-radio>
 | 
			
		||||
						<el-radio :label="false">否</el-radio>
 | 
			
		||||
					</el-radio-group>
 | 
			
		||||
				</el-form-item>
 | 
			
		||||
			</el-col>
 | 
			
		||||
			<el-col :span="24" v-show="form.isProduction">
 | 
			
		||||
				<tree-transfer
 | 
			
		||||
					:title="title"
 | 
			
		||||
					:from_data="fromData"
 | 
			
		||||
					:to_data="toData"
 | 
			
		||||
					@add-btn="add"
 | 
			
		||||
					@remove-btn="remove"
 | 
			
		||||
					pid="productionLineId"
 | 
			
		||||
					:defaultProps="{ label: 'name' }"
 | 
			
		||||
					height="450px"
 | 
			
		||||
					:mode="mode"
 | 
			
		||||
					filter
 | 
			
		||||
					openAll></tree-transfer>
 | 
			
		||||
			</el-col>
 | 
			
		||||
		</el-row>
 | 
			
		||||
	</el-form>
 | 
			
		||||
</template>
 | 
			
		||||
<script>
 | 
			
		||||
import {
 | 
			
		||||
	getGroupPlan,
 | 
			
		||||
	updateGroupPlan,
 | 
			
		||||
	createGroupPlan,
 | 
			
		||||
	getGroupPlanTree,
 | 
			
		||||
	createGroupPlanLine,
 | 
			
		||||
	updateGroupPlanLine,
 | 
			
		||||
	getGroupPlanLine,
 | 
			
		||||
	getLoginUserDeptId,
 | 
			
		||||
} from '@/api/base/groupSchedulingPlan';
 | 
			
		||||
 | 
			
		||||
import { listDept } from '@/api/system/dept';
 | 
			
		||||
import { listEnabled } from '@/api/base/groupTeam';
 | 
			
		||||
import { listClassesEnabled } from '@/api/base/groupClasses';
 | 
			
		||||
import treeTransfer from 'el-tree-transfer';
 | 
			
		||||
 | 
			
		||||
export default {
 | 
			
		||||
	components: { treeTransfer },
 | 
			
		||||
	name: '',
 | 
			
		||||
	data() {
 | 
			
		||||
		return {
 | 
			
		||||
			form: {
 | 
			
		||||
				id: '',
 | 
			
		||||
				name: '',
 | 
			
		||||
				deptId: '',
 | 
			
		||||
				teamIdList: [],
 | 
			
		||||
				classesIdList: [],
 | 
			
		||||
				remark: '',
 | 
			
		||||
				isProduction: false,
 | 
			
		||||
			},
 | 
			
		||||
			deptArr: [], //部门
 | 
			
		||||
			teamList: [], //班组
 | 
			
		||||
			classList: [], //班次
 | 
			
		||||
			rules: {
 | 
			
		||||
				name: [{ required: true, message: '请输入计划名称', trigger: 'blur' }],
 | 
			
		||||
				deptId: [{ required: true, message: '请选择部门', trigger: 'change' }],
 | 
			
		||||
				teamIdList: [
 | 
			
		||||
					{ required: true, message: '请选择相关班组', trigger: 'change' },
 | 
			
		||||
				],
 | 
			
		||||
				classesIdList: [
 | 
			
		||||
					{ required: true, message: '请选择相关班次', trigger: 'change' },
 | 
			
		||||
				],
 | 
			
		||||
			},
 | 
			
		||||
			title: ['待选', '已选'], //标题 类型:Array 必填:false 默认:["源列表", "目标列表"]
 | 
			
		||||
			mode: 'transfer',
 | 
			
		||||
			fromData: [], //左边内容
 | 
			
		||||
			toData: [], //右边已选内容
 | 
			
		||||
		};
 | 
			
		||||
	},
 | 
			
		||||
	methods: {
 | 
			
		||||
		init(id) {
 | 
			
		||||
			this.form.id = id || undefined;
 | 
			
		||||
			this.fromData = [];
 | 
			
		||||
			this.toData = [];
 | 
			
		||||
			this.getArr();
 | 
			
		||||
			this.$nextTick(() => {
 | 
			
		||||
				this.$refs['form'].resetFields();
 | 
			
		||||
				if (this.form.id) {
 | 
			
		||||
					getGroupPlan(id).then((response) => {
 | 
			
		||||
						this.form = response.data;
 | 
			
		||||
						if (this.form.isProduction) {
 | 
			
		||||
							getGroupPlanLine(id).then((res) => {
 | 
			
		||||
								this.toData = res.data ? res.data.datas : [];
 | 
			
		||||
								this.getFilterLeftData(this.fromData, this.toData); //编辑时组件有bug,左边相同数据不消失
 | 
			
		||||
							});
 | 
			
		||||
						}
 | 
			
		||||
					});
 | 
			
		||||
				} else {
 | 
			
		||||
					getLoginUserDeptId().then((res) => {
 | 
			
		||||
						this.form.deptId = res.data;
 | 
			
		||||
					});
 | 
			
		||||
				}
 | 
			
		||||
			});
 | 
			
		||||
		},
 | 
			
		||||
		getArr() {
 | 
			
		||||
			listDept().then((response) => {
 | 
			
		||||
				this.deptArr = response.data;
 | 
			
		||||
			});
 | 
			
		||||
			listEnabled().then((res) => {
 | 
			
		||||
				this.teamList = res.data || [];
 | 
			
		||||
			});
 | 
			
		||||
			listClassesEnabled().then((res) => {
 | 
			
		||||
				this.classList = res.data || [];
 | 
			
		||||
			});
 | 
			
		||||
			getGroupPlanTree().then((res) => {
 | 
			
		||||
				this.fromData = res.data;
 | 
			
		||||
				this.fromData.forEach((item) => {
 | 
			
		||||
					item.productionLineId = 0;
 | 
			
		||||
				});
 | 
			
		||||
			});
 | 
			
		||||
		},
 | 
			
		||||
		// 监听穿梭框组件添加
 | 
			
		||||
		add(fromData, toData, obj) {
 | 
			
		||||
			console.log('fromData:', fromData);
 | 
			
		||||
			console.log('toData:', toData);
 | 
			
		||||
		},
 | 
			
		||||
		// 监听穿梭框组件移除
 | 
			
		||||
		remove(fromData, toData, obj) {
 | 
			
		||||
			console.log('fromData:', fromData);
 | 
			
		||||
			console.log('toData:', toData);
 | 
			
		||||
		},
 | 
			
		||||
		submitForm() {
 | 
			
		||||
			this.$refs['form'].validate((valid) => {
 | 
			
		||||
				if (valid) {
 | 
			
		||||
					if (this.form.id) {
 | 
			
		||||
						//编辑
 | 
			
		||||
						updateGroupPlan({ ...this.form }).then((res) => {
 | 
			
		||||
							if (res.code === 0) {
 | 
			
		||||
								if (this.form.isProduction) {
 | 
			
		||||
									const params = {
 | 
			
		||||
										planId: this.form.id,
 | 
			
		||||
										list: this.toData,
 | 
			
		||||
									};
 | 
			
		||||
									updateGroupPlanLine(params).then((res) => {
 | 
			
		||||
										this.$modal.msgSuccess('操作成功');
 | 
			
		||||
										this.$emit('successSubmit');
 | 
			
		||||
									});
 | 
			
		||||
								}
 | 
			
		||||
							}
 | 
			
		||||
						});
 | 
			
		||||
					} else {
 | 
			
		||||
						createGroupPlan({ ...this.form }).then((res) => {
 | 
			
		||||
							if (res.code === 0) {
 | 
			
		||||
								if (this.form.isProduction) {
 | 
			
		||||
									const params = {
 | 
			
		||||
										planId: res.data,
 | 
			
		||||
										list: this.toData,
 | 
			
		||||
									};
 | 
			
		||||
									createGroupPlanLine(params).then((res) => {
 | 
			
		||||
										this.$modal.msgSuccess('操作成功');
 | 
			
		||||
										this.$emit('successSubmit');
 | 
			
		||||
									});
 | 
			
		||||
								}
 | 
			
		||||
							}
 | 
			
		||||
						});
 | 
			
		||||
					}
 | 
			
		||||
				} else {
 | 
			
		||||
					return false;
 | 
			
		||||
				}
 | 
			
		||||
			});
 | 
			
		||||
		},
 | 
			
		||||
		formClear() {
 | 
			
		||||
			this.$refs.form.resetFields();
 | 
			
		||||
		},
 | 
			
		||||
 | 
			
		||||
		/** 消除组件左边与右边选中数据相同项 */
 | 
			
		||||
		// 处理过滤数据
 | 
			
		||||
		getFilterLeftData(data, selData) {
 | 
			
		||||
			for (let i = data.length - 1; i >= 0; i--) {
 | 
			
		||||
				for (let j = selData.length - 1; j >= 0; j--) {
 | 
			
		||||
					if (data[i] && data[i].id === selData[j].id) {
 | 
			
		||||
						// 当id相等可以删除的情况 即:没有子级可以删除;
 | 
			
		||||
						if (!data[i].children) {
 | 
			
		||||
							data.splice(i, 1);
 | 
			
		||||
						} else {
 | 
			
		||||
							this.getFilterLeftData(data[i].children, selData[j].children);
 | 
			
		||||
						}
 | 
			
		||||
					}
 | 
			
		||||
				}
 | 
			
		||||
			}
 | 
			
		||||
		},
 | 
			
		||||
	},
 | 
			
		||||
};
 | 
			
		||||
</script>
 | 
			
		||||
							
								
								
									
										233
									
								
								src/views/group/base/schedulingPlanConfig/index.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										233
									
								
								src/views/group/base/schedulingPlanConfig/index.vue
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,233 @@
 | 
			
		||||
<!--
 | 
			
		||||
 * @Author: zwq
 | 
			
		||||
 * @Date: 2024-07-10 11:08:48
 | 
			
		||||
 * @LastEditors: zwq
 | 
			
		||||
 * @LastEditTime: 2024-07-12 16:19:28
 | 
			
		||||
 * @Description:
 | 
			
		||||
-->
 | 
			
		||||
<template>
 | 
			
		||||
	<div class="app-container">
 | 
			
		||||
		<!-- 搜索工作栏 -->
 | 
			
		||||
		<search-bar
 | 
			
		||||
			:formConfigs="formConfig"
 | 
			
		||||
			ref="searchBarForm"
 | 
			
		||||
			@headBtnClick="buttonClick" />
 | 
			
		||||
		<!-- 列表 -->
 | 
			
		||||
		<base-table
 | 
			
		||||
			:page="queryParams.pageNo"
 | 
			
		||||
			:limit="queryParams.pageSize"
 | 
			
		||||
			:table-props="tableProps"
 | 
			
		||||
			:table-data="list"
 | 
			
		||||
			:max-height="tableH">
 | 
			
		||||
			<method-btn
 | 
			
		||||
				v-if="tableBtn.length"
 | 
			
		||||
				slot="handleBtn"
 | 
			
		||||
				:width="120"
 | 
			
		||||
				label="操作"
 | 
			
		||||
				:method-list="tableBtn"
 | 
			
		||||
				@clickBtn="handleClick" />
 | 
			
		||||
		</base-table>
 | 
			
		||||
		<pagination
 | 
			
		||||
			:page.sync="queryParams.pageNo"
 | 
			
		||||
			:limit.sync="queryParams.pageSize"
 | 
			
		||||
			:total="total"
 | 
			
		||||
			@pagination="getList" />
 | 
			
		||||
		<!-- 新增 -->
 | 
			
		||||
		<base-dialog
 | 
			
		||||
			:dialogTitle="addOrEditTitle"
 | 
			
		||||
			:dialogVisible="centervisible"
 | 
			
		||||
			@cancel="handleCancel"
 | 
			
		||||
			@confirm="handleConfirm"
 | 
			
		||||
			:before-close="handleCancel"
 | 
			
		||||
			width="50%">
 | 
			
		||||
			<schedulingPlanConfigAdd ref="classList" @successSubmit="successSubmit" />
 | 
			
		||||
		</base-dialog>
 | 
			
		||||
	</div>
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script>
 | 
			
		||||
import {
 | 
			
		||||
	getGroupPlanPage,
 | 
			
		||||
	deleteGroupPlan,
 | 
			
		||||
} from '@/api/base/groupSchedulingPlan';
 | 
			
		||||
import { listDept } from '@/api/system/dept';
 | 
			
		||||
import schedulingPlanConfigAdd from './components/schedulingPlanConfigAdd.vue';
 | 
			
		||||
const tableProps = [
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'deptName',
 | 
			
		||||
		label: '部门名称',
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'name',
 | 
			
		||||
		label: '计划名称',
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'str',
 | 
			
		||||
		label: '产线及工段',
 | 
			
		||||
		minWidth: 200,
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'teamName',
 | 
			
		||||
		label: '班组名称',
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'classesName',
 | 
			
		||||
		label: '班次名称',
 | 
			
		||||
	},
 | 
			
		||||
];
 | 
			
		||||
export default {
 | 
			
		||||
	name: 'schedulingPlanConfig',
 | 
			
		||||
	components: { schedulingPlanConfigAdd },
 | 
			
		||||
	data() {
 | 
			
		||||
		return {
 | 
			
		||||
			formConfig: [
 | 
			
		||||
				{
 | 
			
		||||
					type: 'select',
 | 
			
		||||
					label: '部门名称',
 | 
			
		||||
					selectOptions: [],
 | 
			
		||||
					param: 'deptId',
 | 
			
		||||
					defaultSelect: '',
 | 
			
		||||
					filterable: true,
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					type: 'input',
 | 
			
		||||
					label: '计划名称',
 | 
			
		||||
					placeholder: '计划名称',
 | 
			
		||||
					param: 'name',
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					type: 'button',
 | 
			
		||||
					btnName: '查询',
 | 
			
		||||
					name: 'search',
 | 
			
		||||
					color: 'primary',
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					type: 'separate',
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					type: this.$auth.hasPermi('base:group-scheduling-plan:create')
 | 
			
		||||
						? 'button'
 | 
			
		||||
						: '',
 | 
			
		||||
					btnName: '新增',
 | 
			
		||||
					name: 'add',
 | 
			
		||||
					color: 'success',
 | 
			
		||||
					plain: true,
 | 
			
		||||
				},
 | 
			
		||||
			],
 | 
			
		||||
			tableProps,
 | 
			
		||||
			tableBtn: [
 | 
			
		||||
				this.$auth.hasPermi('base:group-scheduling-plan:update')
 | 
			
		||||
					? {
 | 
			
		||||
							type: 'edit',
 | 
			
		||||
							btnName: '编辑',
 | 
			
		||||
					  }
 | 
			
		||||
					: undefined,
 | 
			
		||||
				this.$auth.hasPermi('base:group-scheduling-plan:delete')
 | 
			
		||||
					? {
 | 
			
		||||
							type: 'delete',
 | 
			
		||||
							btnName: '删除',
 | 
			
		||||
					  }
 | 
			
		||||
					: undefined,
 | 
			
		||||
			].filter((v) => v),
 | 
			
		||||
			tableH: this.tableHeight(260),
 | 
			
		||||
			// 总条数
 | 
			
		||||
			total: 0,
 | 
			
		||||
			// 列表
 | 
			
		||||
			list: [],
 | 
			
		||||
			// 弹出层标题
 | 
			
		||||
			addOrEditTitle: '',
 | 
			
		||||
			// 是否显示弹出层
 | 
			
		||||
			centervisible: false,
 | 
			
		||||
			// 查询参数
 | 
			
		||||
			queryParams: {
 | 
			
		||||
				pageNo: 1,
 | 
			
		||||
				pageSize: 20,
 | 
			
		||||
				name: null,
 | 
			
		||||
			},
 | 
			
		||||
		};
 | 
			
		||||
	},
 | 
			
		||||
	created() {
 | 
			
		||||
		window.addEventListener('resize', () => {
 | 
			
		||||
			this.tableH = this.tableHeight(260);
 | 
			
		||||
		});
 | 
			
		||||
		listDept().then((response) => {
 | 
			
		||||
			this.formConfig[0].selectOptions = response.data;
 | 
			
		||||
		});
 | 
			
		||||
		this.getList();
 | 
			
		||||
	},
 | 
			
		||||
	methods: {
 | 
			
		||||
		buttonClick(val) {
 | 
			
		||||
			switch (val.btnName) {
 | 
			
		||||
				case 'search':
 | 
			
		||||
					this.queryParams.pageNo = 1;
 | 
			
		||||
					this.queryParams.name = val.name || undefined;
 | 
			
		||||
					this.queryParams.deptId = val.deptId || undefined;
 | 
			
		||||
					this.getList();
 | 
			
		||||
					break;
 | 
			
		||||
				default:
 | 
			
		||||
					this.addOrEditTitle = '新增';
 | 
			
		||||
					this.centervisible = true;
 | 
			
		||||
					this.$nextTick(() => {
 | 
			
		||||
						this.$refs.classList.init();
 | 
			
		||||
					});
 | 
			
		||||
			}
 | 
			
		||||
		},
 | 
			
		||||
		/** 查询列表 */
 | 
			
		||||
		getList() {
 | 
			
		||||
			getGroupPlanPage(this.queryParams).then((res) => {
 | 
			
		||||
				if (res.code === 0 && res.data.list && res.data.list.length > 0) {
 | 
			
		||||
          res.data.list.forEach(item => {
 | 
			
		||||
            if(item.isProduction){
 | 
			
		||||
              item.str = item.strList?item.strList.join(','):'-'
 | 
			
		||||
            }
 | 
			
		||||
          });
 | 
			
		||||
					this.list = res.data.list;
 | 
			
		||||
					this.total = res.data.total;
 | 
			
		||||
				} else {
 | 
			
		||||
					this.list = [];
 | 
			
		||||
					this.total = 0;
 | 
			
		||||
				}
 | 
			
		||||
			});
 | 
			
		||||
		},
 | 
			
		||||
		handleClick(val) {
 | 
			
		||||
			switch (val.type) {
 | 
			
		||||
				case 'edit':
 | 
			
		||||
					this.addOrEditTitle = '编辑';
 | 
			
		||||
					this.$nextTick(() => {
 | 
			
		||||
						this.$refs.classList.init(val.data.id);
 | 
			
		||||
					});
 | 
			
		||||
					this.centervisible = true;
 | 
			
		||||
					break;
 | 
			
		||||
				default:
 | 
			
		||||
					this.handleDelete(val.data);
 | 
			
		||||
			}
 | 
			
		||||
		},
 | 
			
		||||
		handleCancel() {
 | 
			
		||||
			this.$refs.classList.formClear();
 | 
			
		||||
			this.centervisible = false;
 | 
			
		||||
			this.addOrEditTitle = '';
 | 
			
		||||
		},
 | 
			
		||||
		handleConfirm() {
 | 
			
		||||
			this.$refs.classList.submitForm();
 | 
			
		||||
		},
 | 
			
		||||
		successSubmit() {
 | 
			
		||||
			this.handleCancel();
 | 
			
		||||
			this.getList();
 | 
			
		||||
		},
 | 
			
		||||
		/** 删除按钮操作 */
 | 
			
		||||
		handleDelete(row) {
 | 
			
		||||
			let _this = this;
 | 
			
		||||
			_this.$modal
 | 
			
		||||
				.confirm('是否确认删除名称为"' + row.name + '"的数据项?')
 | 
			
		||||
				.then(function () {
 | 
			
		||||
					return deleteGroupPlan(row.id);
 | 
			
		||||
				})
 | 
			
		||||
				.then(() => {
 | 
			
		||||
					_this.getList();
 | 
			
		||||
					_this.$modal.msgSuccess('删除成功');
 | 
			
		||||
				})
 | 
			
		||||
				.catch(() => {});
 | 
			
		||||
		},
 | 
			
		||||
	},
 | 
			
		||||
};
 | 
			
		||||
</script>
 | 
			
		||||
@@ -0,0 +1,280 @@
 | 
			
		||||
<!--
 | 
			
		||||
 * @Author: zwq
 | 
			
		||||
 * @Date: 2024-07-11 09:30:21
 | 
			
		||||
 * @LastEditors: zwq
 | 
			
		||||
 * @LastEditTime: 2024-07-12 16:09:46
 | 
			
		||||
 * @Description:
 | 
			
		||||
-->
 | 
			
		||||
<template>
 | 
			
		||||
	<el-form ref="form" :rules="rules" label-width="110px" :model="form">
 | 
			
		||||
		<el-row>
 | 
			
		||||
			<el-col :span="12">
 | 
			
		||||
				<el-form-item label="排班开始日期" prop="startDay">
 | 
			
		||||
					<el-date-picker
 | 
			
		||||
						v-model="form.startDay"
 | 
			
		||||
						type="datetime"
 | 
			
		||||
						placeholder="选择日期时间"
 | 
			
		||||
						label-format="yyyy-MM-dd HH:mm:ss"
 | 
			
		||||
						value-format="timestamp"
 | 
			
		||||
						style="width: 100%"></el-date-picker>
 | 
			
		||||
				</el-form-item>
 | 
			
		||||
			</el-col>
 | 
			
		||||
			<el-col :span="12">
 | 
			
		||||
				<el-form-item label="排班结束日期" prop="endDay">
 | 
			
		||||
					<el-date-picker
 | 
			
		||||
						v-model="form.endDay"
 | 
			
		||||
						type="datetime"
 | 
			
		||||
						placeholder="选择日期时间"
 | 
			
		||||
						label-format="yyyy-MM-dd HH:mm:ss"
 | 
			
		||||
						value-format="timestamp"
 | 
			
		||||
						style="width: 100%"></el-date-picker>
 | 
			
		||||
				</el-form-item>
 | 
			
		||||
			</el-col>
 | 
			
		||||
			<el-col :span="12">
 | 
			
		||||
				<el-form-item label="排班计划" prop="planId">
 | 
			
		||||
					<el-select
 | 
			
		||||
						v-model="form.planId"
 | 
			
		||||
						filterable
 | 
			
		||||
						clearable
 | 
			
		||||
						@change="setTableArr"
 | 
			
		||||
						style="width: 100%"
 | 
			
		||||
						placeholder="请选择排班计划">
 | 
			
		||||
						<el-option
 | 
			
		||||
							v-for="item in planArr"
 | 
			
		||||
							:key="item.id"
 | 
			
		||||
							:label="item.name"
 | 
			
		||||
							:value="item.id"></el-option>
 | 
			
		||||
					</el-select>
 | 
			
		||||
				</el-form-item>
 | 
			
		||||
			</el-col>
 | 
			
		||||
			<el-col :span="12">
 | 
			
		||||
				<el-form-item label="备注" prop="remark">
 | 
			
		||||
					<el-input v-model="form.remark"></el-input>
 | 
			
		||||
				</el-form-item>
 | 
			
		||||
			</el-col>
 | 
			
		||||
			<el-col :span="24">
 | 
			
		||||
				<div class="min-title">班组上班顺序</div>
 | 
			
		||||
				<base-table
 | 
			
		||||
					border
 | 
			
		||||
					:table-props="tableProps"
 | 
			
		||||
					:table-data="tableData"
 | 
			
		||||
					:page="1"
 | 
			
		||||
					:limit="100"
 | 
			
		||||
					:height="300"
 | 
			
		||||
					@emitButtonClick="addNew"
 | 
			
		||||
					@emitFun="inputChange"
 | 
			
		||||
					:add-button-show="addButtonShow">
 | 
			
		||||
					<method-btn
 | 
			
		||||
						slot="handleBtn"
 | 
			
		||||
						:width="60"
 | 
			
		||||
						label="操作"
 | 
			
		||||
						:method-list="tableBtn"
 | 
			
		||||
						@clickBtn="handleClick" />
 | 
			
		||||
				</base-table>
 | 
			
		||||
			</el-col>
 | 
			
		||||
		</el-row>
 | 
			
		||||
	</el-form>
 | 
			
		||||
</template>
 | 
			
		||||
<script>
 | 
			
		||||
import {
 | 
			
		||||
	getGroupRule,
 | 
			
		||||
	updateGroupRule,
 | 
			
		||||
	createGroupRule,
 | 
			
		||||
} from '@/api/base/groupSchedulingRule';
 | 
			
		||||
import {
 | 
			
		||||
	groupPlanList,
 | 
			
		||||
	groupPlanTeamList,
 | 
			
		||||
	groupPlanClassesList,
 | 
			
		||||
} from '@/api/base/groupSchedulingPlan';
 | 
			
		||||
import tableSelect from './tableSelect';
 | 
			
		||||
 | 
			
		||||
const tableBtn = [
 | 
			
		||||
	{
 | 
			
		||||
		type: 'delete',
 | 
			
		||||
		btnName: '删除',
 | 
			
		||||
	},
 | 
			
		||||
];
 | 
			
		||||
const tableProps = [
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'classesId',
 | 
			
		||||
		label: '班次',
 | 
			
		||||
		classesArr: [],
 | 
			
		||||
		subcomponent: tableSelect,
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'teamId',
 | 
			
		||||
		label: '班组',
 | 
			
		||||
		teamArr: [],
 | 
			
		||||
		subcomponent: tableSelect,
 | 
			
		||||
	},
 | 
			
		||||
];
 | 
			
		||||
export default {
 | 
			
		||||
	name: 'schedulingRuleConfigAdd',
 | 
			
		||||
	data() {
 | 
			
		||||
		return {
 | 
			
		||||
			form: {
 | 
			
		||||
				id: '',
 | 
			
		||||
				startDay: '',
 | 
			
		||||
				endDay: '',
 | 
			
		||||
				planId: '',
 | 
			
		||||
				remark: '',
 | 
			
		||||
			},
 | 
			
		||||
			tableBtn,
 | 
			
		||||
			tableProps,
 | 
			
		||||
			tableData: [],
 | 
			
		||||
			addButtonShow: '',
 | 
			
		||||
			planArr: [], //排班计划数组
 | 
			
		||||
			rules: {
 | 
			
		||||
				name: [{ required: true, message: '请输入班组名称', trigger: 'blur' }],
 | 
			
		||||
				startDay: [
 | 
			
		||||
					{ required: true, message: '请选择排班开始时间', trigger: 'change' },
 | 
			
		||||
				],
 | 
			
		||||
				endDay: [
 | 
			
		||||
					{ required: true, message: '请选择排班结束时间', trigger: 'change' },
 | 
			
		||||
				],
 | 
			
		||||
			},
 | 
			
		||||
		};
 | 
			
		||||
	},
 | 
			
		||||
	methods: {
 | 
			
		||||
		init(id) {
 | 
			
		||||
			this.form = {
 | 
			
		||||
				id: id || undefined,
 | 
			
		||||
				startDay: '',
 | 
			
		||||
				endDay: '',
 | 
			
		||||
				planId: '',
 | 
			
		||||
				remark: '',
 | 
			
		||||
			};
 | 
			
		||||
			this.getArr();
 | 
			
		||||
			this.tableData = [];
 | 
			
		||||
			this.$nextTick(() => {
 | 
			
		||||
				this.$refs['form'].resetFields();
 | 
			
		||||
				if (this.form.id) {
 | 
			
		||||
					getGroupRule(id).then((response) => {
 | 
			
		||||
						this.form = response.data;
 | 
			
		||||
						this.getTableArr(response.data.planId);
 | 
			
		||||
						this.tableData = [];
 | 
			
		||||
					});
 | 
			
		||||
				}
 | 
			
		||||
			});
 | 
			
		||||
		},
 | 
			
		||||
		getArr() {
 | 
			
		||||
			groupPlanList().then((res) => {
 | 
			
		||||
				this.planArr = res.data || [];
 | 
			
		||||
			});
 | 
			
		||||
		},
 | 
			
		||||
		setTableArr() {
 | 
			
		||||
			if (this.form.planId) {
 | 
			
		||||
				this.tableData = [];
 | 
			
		||||
				this.getTableArr(this.form.planId);
 | 
			
		||||
			} else {
 | 
			
		||||
				this.tableData = [];
 | 
			
		||||
				this.addButtonShow = '';
 | 
			
		||||
			}
 | 
			
		||||
		},
 | 
			
		||||
		async getTableArr(id) {
 | 
			
		||||
			//获取表格下拉框
 | 
			
		||||
			this.addButtonShow = '新增';
 | 
			
		||||
			const res0 = await groupPlanClassesList(id);
 | 
			
		||||
			this.tableProps[0].classesArr = res0.data || [];
 | 
			
		||||
			const res1 = await groupPlanTeamList(id);
 | 
			
		||||
			this.tableProps[1].teamArr = res1.data || [];
 | 
			
		||||
			if (this.form.id) {
 | 
			
		||||
				//编辑时获取班组上班顺序
 | 
			
		||||
				this.form.sequenceList.forEach((item) => {
 | 
			
		||||
					this.tableData.push(item);
 | 
			
		||||
				});
 | 
			
		||||
			}
 | 
			
		||||
		},
 | 
			
		||||
		inputChange(data) {
 | 
			
		||||
			this.tableData[data._pageIndex - 1][data.prop] = data[data.prop];
 | 
			
		||||
		},
 | 
			
		||||
		handleClick(raw) {
 | 
			
		||||
			if (raw.type === 'delete') {
 | 
			
		||||
				this.$confirm(
 | 
			
		||||
					`确定对${
 | 
			
		||||
						raw.data.name
 | 
			
		||||
							? '[名称=' + raw.data.name + ']'
 | 
			
		||||
							: '[序号=' + raw.data._pageIndex + ']'
 | 
			
		||||
					}进行删除操作?`,
 | 
			
		||||
					'提示',
 | 
			
		||||
					{
 | 
			
		||||
						confirmButtonText: '确定',
 | 
			
		||||
						cancelButtonText: '取消',
 | 
			
		||||
						type: 'warning',
 | 
			
		||||
					}
 | 
			
		||||
				)
 | 
			
		||||
					.then(() => {
 | 
			
		||||
						this.tableData.splice(raw.data._pageIndex - 1, 1);
 | 
			
		||||
						this.tableData.forEach((item, index) => {
 | 
			
		||||
							item.sequence = index;
 | 
			
		||||
						});
 | 
			
		||||
						console.log(this.tableData);
 | 
			
		||||
					})
 | 
			
		||||
					.catch(() => {});
 | 
			
		||||
			}
 | 
			
		||||
		},
 | 
			
		||||
		// 新增
 | 
			
		||||
		addNew() {
 | 
			
		||||
			this.tableData.push({ sequence: this.tableData.length });
 | 
			
		||||
		},
 | 
			
		||||
		submitForm() {
 | 
			
		||||
			this.$refs['form'].validate((valid) => {
 | 
			
		||||
				if (valid) {
 | 
			
		||||
					if (this.form.id) {
 | 
			
		||||
						//编辑
 | 
			
		||||
						let list = [];
 | 
			
		||||
						this.tableData.forEach((item) => {
 | 
			
		||||
							const obj = {
 | 
			
		||||
								classesId: item.classesId,
 | 
			
		||||
								sequence: item.sequence,
 | 
			
		||||
								teamId: item.teamId,
 | 
			
		||||
							};
 | 
			
		||||
							list.push(obj);
 | 
			
		||||
						});
 | 
			
		||||
						this.form.list = list;
 | 
			
		||||
						updateGroupRule({ ...this.form }).then((res) => {
 | 
			
		||||
							this.$modal.msgSuccess('操作成功');
 | 
			
		||||
							this.$emit('successSubmit');
 | 
			
		||||
						});
 | 
			
		||||
					} else {
 | 
			
		||||
						let list = [];
 | 
			
		||||
						this.tableData.forEach((item) => {
 | 
			
		||||
							const obj = {
 | 
			
		||||
								classesId: item.classesId,
 | 
			
		||||
								sequence: item.sequence,
 | 
			
		||||
								teamId: item.teamId,
 | 
			
		||||
							};
 | 
			
		||||
							list.push(obj);
 | 
			
		||||
						});
 | 
			
		||||
						this.form.list = list;
 | 
			
		||||
						createGroupRule({ ...this.form }).then((res) => {
 | 
			
		||||
							this.$modal.msgSuccess('操作成功');
 | 
			
		||||
							this.$emit('successSubmit');
 | 
			
		||||
						});
 | 
			
		||||
					}
 | 
			
		||||
				} else {
 | 
			
		||||
					return false;
 | 
			
		||||
				}
 | 
			
		||||
			});
 | 
			
		||||
		},
 | 
			
		||||
		formClear() {
 | 
			
		||||
			this.$refs.form.resetFields();
 | 
			
		||||
		},
 | 
			
		||||
	},
 | 
			
		||||
};
 | 
			
		||||
</script>
 | 
			
		||||
<style scoped>
 | 
			
		||||
.min-title {
 | 
			
		||||
	margin-bottom: 5px;
 | 
			
		||||
}
 | 
			
		||||
.min-title::before {
 | 
			
		||||
	content: '';
 | 
			
		||||
	display: inline-block;
 | 
			
		||||
	vertical-align: middle;
 | 
			
		||||
	width: 6px;
 | 
			
		||||
	height: 6px;
 | 
			
		||||
	border-radius: 50%;
 | 
			
		||||
	margin: auto 5px;
 | 
			
		||||
	background-color: #0b58ff;
 | 
			
		||||
}
 | 
			
		||||
</style>
 | 
			
		||||
@@ -0,0 +1,44 @@
 | 
			
		||||
<template>
 | 
			
		||||
	<div class="tableInner">
 | 
			
		||||
		<el-select :key="itemProp+list._pageIndex" v-model="list[itemProp]" @change="changeInput">
 | 
			
		||||
			<el-option
 | 
			
		||||
				v-for="item in itemProp==='classesId'?list.classesArr:list.teamArr"
 | 
			
		||||
				:key="item.id"
 | 
			
		||||
				:label="item.name"
 | 
			
		||||
				:value="item.id"></el-option>
 | 
			
		||||
		</el-select>
 | 
			
		||||
	</div>
 | 
			
		||||
</template>
 | 
			
		||||
<script>
 | 
			
		||||
export default {
 | 
			
		||||
	name: 'tableSelect',
 | 
			
		||||
	props: {
 | 
			
		||||
		injectData: {
 | 
			
		||||
			type: Object,
 | 
			
		||||
			default: () => ({}),
 | 
			
		||||
		},
 | 
			
		||||
		itemProp: {
 | 
			
		||||
			type: String,
 | 
			
		||||
		},
 | 
			
		||||
	},
 | 
			
		||||
	data() {
 | 
			
		||||
		return {
 | 
			
		||||
			list: this.injectData,
 | 
			
		||||
		};
 | 
			
		||||
	},
 | 
			
		||||
	methods: {
 | 
			
		||||
		changeInput() {
 | 
			
		||||
			this.$emit('emitData', this.list);
 | 
			
		||||
		},
 | 
			
		||||
	},
 | 
			
		||||
};
 | 
			
		||||
</script>
 | 
			
		||||
<style scoped>
 | 
			
		||||
.tableInner >>> .el-input__inner {
 | 
			
		||||
  color: #409EFF;
 | 
			
		||||
  border: 1px rgb(232, 231, 231) solid;
 | 
			
		||||
  padding: 0;
 | 
			
		||||
  text-align: center;
 | 
			
		||||
  height: 30px;
 | 
			
		||||
}
 | 
			
		||||
</style>
 | 
			
		||||
Some files were not shown because too many files have changed in this diff Show More
		Reference in New Issue
	
	Block a user