Compare commits
	
		
			14 Commits
		
	
	
		
			e8d566e121
			...
			projects/m
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| be430ebbff | |||
| 61b4bf784b | |||
| b0f10b9002 | |||
| e6b9d75f16 | |||
| d9f3434712 | |||
| de15716b7c | |||
| c736992a34 | |||
| dcbb2c719b | |||
| bc2940ca99 | |||
| 76938951ed | |||
| 8b91e7812f | |||
| 9cffa01414 | |||
| 905479d5f4 | |||
| c1ae248234 | 
							
								
								
									
										6
									
								
								.env.dev
									
									
									
									
									
								
							
							
						
						
									
										6
									
								
								.env.dev
									
									
									
									
									
								
							| @@ -1,7 +1,7 @@ | ||||
| ### | ||||
|  # @Author: Do not edit | ||||
|  # @Date: 2023-08-29 09:40:39 | ||||
|  # @LastEditTime: 2024-07-29 15:00:13 | ||||
|  # @LastEditTime: 2023-11-21 10:36:47 | ||||
|  # @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.1.164:48082' | ||||
| # VUE_APP_BASE_API = 'http://192.168.4.173:48080' | ||||
| # VUE_APP_BASE_API = 'http://192.168.2.173:48080' | ||||
| # VUE_APP_BASE_API = 'http://192.168.1.81:48082' | ||||
| # VUE_APP_BASE_API = 'http://192.168.1.49:48082' | ||||
| # VUE_APP_BASE_API = 'http://192.168.1.8:48082' | ||||
| # VUE_APP_BASE_API = 'http://192.168.4.159:48080' | ||||
| # VUE_APP_BASE_API = 'http://192.168.1.56:48082' | ||||
|   | ||||
| @@ -15,15 +15,14 @@ VUE_APP_TITLE = MES系统 | ||||
| VUE_APP_BASE_API = '/prod-api' | ||||
|  | ||||
| # 积木报表指向地址 | ||||
| VUE_APP_JIMU_API = 'http://192.168.0.33:48082' | ||||
| VUE_APP_JIMU_API = 'http://10.70.2.2:8080' | ||||
|  | ||||
|  | ||||
| # 根据服务器或域名修改 | ||||
| # PUBLIC_PATH = 'http://my-pi.com:8888/yudao-admin/' | ||||
| PUBLIC_PATH = 'http://192.168.0.33:8889/' | ||||
| PUBLIC_PATH = 'http://10.70.2.32' | ||||
|  | ||||
| # 二级部署路径 | ||||
| VUE_APP_APP_NAME ='yudao-admin' | ||||
| # VUE_APP_APP_NAME ='yudao-admin' | ||||
|  | ||||
| # 多租户的开关 | ||||
| VUE_APP_TENANT_ENABLE = true | ||||
|   | ||||
							
								
								
									
										22
									
								
								.env.stage
									
									
									
									
									
								
							
							
						
						
									
										22
									
								
								.env.stage
									
									
									
									
									
								
							| @@ -1,16 +1,21 @@ | ||||
| NODE_ENV = production | ||||
| # 生产环境配置 | ||||
| ENV = 'production' | ||||
|  | ||||
| # 页面标题 | ||||
| VUE_APP_TITLE = 产线监控系统 | ||||
| VUE_APP_TITLE = MES系统 | ||||
|  | ||||
| # 测试环境配置 | ||||
| ENV = 'staging' | ||||
| # 芋道管理系统/生产环境 | ||||
| VUE_APP_BASE_API = '/prod-api' | ||||
|  | ||||
| # 芋道管理系统/测试环境 | ||||
| VUE_APP_BASE_API = 'http://api-dashboard.yudao.iocoder.cn' | ||||
| # 积木报表指向地址 | ||||
| VUE_APP_JIMU_API = 'http://192.168.0.33:48082' | ||||
|  | ||||
| # 静态资源地址 | ||||
| PUBLIC_PATH = 'http://static.yudao.iocoder.cn/' | ||||
|  | ||||
| # 根据服务器或域名修改 | ||||
| PUBLIC_PATH = 'http://192.168.0.33:8889/' | ||||
|  | ||||
| # 二级部署路径 | ||||
| # VUE_APP_APP_NAME ='yudao-admin' | ||||
|  | ||||
| # 多租户的开关 | ||||
| VUE_APP_TENANT_ENABLE = true | ||||
| @@ -20,4 +25,3 @@ VUE_APP_DOC_ENABLE = false | ||||
|  | ||||
| # 百度统计 | ||||
| VUE_APP_BAIDU_CODE = fadc1bd5db1a1d6f581df60a1807f8ab | ||||
|  | ||||
|   | ||||
| @@ -48,12 +48,11 @@ | ||||
|     "benz-amr-recorder": "^1.1.5", | ||||
|     "bpmn-js-token-simulation": "0.10.0", | ||||
|     "clipboard": "2.0.8", | ||||
|     "code-brick-zj": "^1.0.5", | ||||
|     "code-brick-zj": "^1.0.2", | ||||
|     "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: 2024-07-08 14:35:17 | ||||
|  * @LastEditors: zwq | ||||
|  * @LastEditTime: 2023-11-04 10:42:50 | ||||
|  * @LastEditors: DY | ||||
|  * @Description:  | ||||
|  */ | ||||
| import request from '@/utils/request' | ||||
| @@ -61,7 +61,7 @@ export function getCoreProductPage(query) { | ||||
| // 获得所有列表 | ||||
| export function getCoreProductList(query) { | ||||
|   return request({ | ||||
|     url: '/base/core-product-material/listAll', | ||||
|     url: '/base/core-product/listAll', | ||||
|     method: 'get', | ||||
|     params: query | ||||
|   }) | ||||
|   | ||||
| @@ -51,13 +51,6 @@ export function getCode() { | ||||
|   }) | ||||
| } | ||||
|  | ||||
| // 获得可用的班次列表 | ||||
| export function listClassesEnabled() { | ||||
|   return request({ | ||||
|     url: '/base/group-classes/listEnable', | ||||
|     method: 'get' | ||||
|   }) | ||||
| } | ||||
| // 导出班次基础信息 Excel | ||||
| export function exportGroupClassesExcel(query) { | ||||
|   return request({ | ||||
|   | ||||
| @@ -1,125 +0,0 @@ | ||||
| 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' | ||||
|   }) | ||||
| } | ||||
| @@ -1,54 +0,0 @@ | ||||
| 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,14 +8,7 @@ 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: 2024-07-05 10:09:18 | ||||
|  * @LastEditors: zwq | ||||
|  * @LastEditTime: 2023-10-24 11:22:28 | ||||
|  * @LastEditors: DY | ||||
|  * @Description:  | ||||
|  */ | ||||
| import request from '@/utils/request' | ||||
| @@ -61,7 +61,7 @@ export function getMaterialPage(query) { | ||||
| // 获得物料列表 | ||||
| export function getMaterialList(query) { | ||||
|   return request({ | ||||
|     url: '/base/core-product-material/listAll', | ||||
|     url: '/base/material/listbyfilter', | ||||
|     method: 'get', | ||||
|     params: query | ||||
|   }) | ||||
| @@ -119,84 +119,3 @@ 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-material/listAll', | ||||
|     url: '/base/core-product/listAll', | ||||
|     method: 'get', | ||||
|     params: query | ||||
|   }) | ||||
|   | ||||
| @@ -2,7 +2,7 @@ import request from '@/utils/request' | ||||
| // 获得产品列表 | ||||
| export function getProductAll() { | ||||
|   return request({ | ||||
|     url: '/base/core-product-material/listAll', | ||||
|     url: '/base/core-product/listAll', | ||||
|     method: 'get' | ||||
|   }) | ||||
| } | ||||
| @@ -25,13 +25,3 @@ 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: 2024-07-08 14:33:12 | ||||
|  * @LastEditors: zwq | ||||
|  * @LastEditTime: 2023-11-23 13:57:41 | ||||
|  * @LastEditors: zhp | ||||
|  * @Description: | ||||
|  */ | ||||
| import request from '@/utils/request' | ||||
| @@ -99,7 +99,7 @@ export function getProcessEquMaterialBomDet(data) { | ||||
|  | ||||
| export function getMaterialList(data) { | ||||
|   return request({ | ||||
|     url: '/base/core-product-material/listAll', | ||||
|     url: '/base/material/listbyfilter', | ||||
|     method: 'get', | ||||
|     data: data | ||||
|   }) | ||||
|   | ||||
| @@ -25,7 +25,7 @@ export function getWorkOrderList(query) { | ||||
| } | ||||
| export function getProductList(query) { | ||||
|   return request({ | ||||
|     url: '/base/core-product-material/listAll', | ||||
|     url: '/base/core-product/listAll', | ||||
|     method: 'get', | ||||
|     params: query, | ||||
|   }) | ||||
| @@ -38,11 +38,3 @@ export function getInspectionData(query) { | ||||
|     params: query, | ||||
|   }) | ||||
| } | ||||
|  | ||||
| export function getRecordInOneDay(query) { | ||||
|   return request({ | ||||
|     url: '/analysis/record-in-one-day/get', | ||||
|     method: 'get', | ||||
|     params: query, | ||||
|   }) | ||||
| } | ||||
|   | ||||
										
											Binary file not shown.
										
									
								
							| Before Width: | Height: | Size: 8.8 KiB | 
										
											Binary file not shown.
										
									
								
							| Before Width: | Height: | Size: 9.1 KiB | 
| @@ -125,8 +125,11 @@ export default { | ||||
| 			// 取消自动聚焦 start | ||||
| 			this.Quill?.enable(false); | ||||
| 			this.$nextTick(() => { | ||||
| 				this.Quill?.blur(); | ||||
| 				this.Quill?.enable(true); | ||||
| 				this.Quill?.blur(); | ||||
| 				// if (!this.readOnly) { | ||||
| 				// 	this.Quill?.enable(); | ||||
| 				// } | ||||
| 			}); | ||||
| 			// 如果设置了上传地址则自定义图片上传事件 | ||||
| 			if (this.type === 'url') { | ||||
|   | ||||
| @@ -360,6 +360,7 @@ export default { | ||||
|         ts: Date.now(), // 现在的时间戳 | ||||
|       } | ||||
|       reqGet(data).then(res => { | ||||
|         console.log(1) | ||||
|         if (res.repCode === '0000') { | ||||
|           this.backImgBase = res.repData.originalImageBase64 | ||||
|           this.blockBackImgBase = res.repData.jigsawImageBase64 | ||||
|   | ||||
| @@ -78,6 +78,7 @@ export default { | ||||
| 			return this.http(this.infoUrl == '' ? this.infoPath : this.infoUrl, 'get', payload); | ||||
| 		}, | ||||
| 		del(payload) { | ||||
| 			debugger; | ||||
| 			return this.http(this.deleteUrl == '' ? this.deletePath : this.deleteUrl, 'delete', payload); | ||||
| 		}, | ||||
|  | ||||
|   | ||||
| @@ -1,20 +0,0 @@ | ||||
| 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,33 +59,6 @@ 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,34 +201,3 @@ 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) | ||||
| @@ -2,7 +2,7 @@ | ||||
|  * @Author: zwq | ||||
|  * @Date: 2021-11-18 14:16:25 | ||||
|  * @LastEditors: DY | ||||
|  * @LastEditTime: 2024-07-19 18:59:13 | ||||
|  * @LastEditTime: 2023-11-16 09:14:35 | ||||
|  * @Description: | ||||
| --> | ||||
| <template> | ||||
| @@ -105,7 +105,7 @@ | ||||
| <script> | ||||
| import basicAdd from '../../core/mixins/basic-add'; | ||||
| import { getConOrderList, createConCoreWOr, getCoreWO } from '@/api/base/coreWorkOrder'; | ||||
| import SmallTitle from './SmallTitle'; | ||||
| import SmallTitle from '../material/SmallTitle'; | ||||
| // import { parseTime } from '../../core/mixins/code-filter'; | ||||
| // import attrAdd from './attr-add'; | ||||
| 
 | ||||
							
								
								
									
										459
									
								
								src/views/base/material/add-or-updata.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										459
									
								
								src/views/base/material/add-or-updata.vue
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,459 @@ | ||||
| <!-- | ||||
|  * @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> | ||||
							
								
								
									
										252
									
								
								src/views/base/material/index.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										252
									
								
								src/views/base/material/index.vue
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,252 @@ | ||||
| <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,8 +1,8 @@ | ||||
| <!-- | ||||
|  * @Author: zwq | ||||
|  * @Date: 2021-11-18 14:16:25 | ||||
|  * @LastEditors: zwq | ||||
|  * @LastEditTime: 2024-07-09 09:59:11 | ||||
|  * @LastEditors: DY | ||||
|  * @LastEditTime: 2023-11-27 19:50:36 | ||||
|  * @Description: | ||||
| --> | ||||
| <template> | ||||
| @@ -107,9 +107,10 @@ | ||||
| 
 | ||||
| <script> | ||||
| import basicAdd from '../../core/mixins/basic-add'; | ||||
| import { createMaterialPB, updateMaterialPB, getMaterialPB, getCode, getProBomList, createMaterialPBDet, updateMaterialPBDet, deleteMaterialPBDet } from "@/api/base/materialProductBom"; | ||||
| import { getMaterialTree,getMaterialList } from '@/api/base/material'; | ||||
| import SmallTitle from '../coreWorkOrder/SmallTitle'; | ||||
| import { createMaterialPB, updateMaterialPB, getMaterialPB, getCode, getProList, getProBomList, createMaterialPBDet, updateMaterialPBDet, deleteMaterialPBDet } from "@/api/base/materialProductBom"; | ||||
| import { getMaterialList } from "@/api/base/material"; | ||||
| import { listData } from "@/api/system/dict/data"; | ||||
| import SmallTitle from '../material/SmallTitle'; | ||||
| import { parseTime } from '../../core/mixins/code-filter'; | ||||
| import attrAdd from './attr-add'; | ||||
| import { publicFormatter } from '@/utils/dict'; | ||||
| @@ -182,6 +183,7 @@ export default { | ||||
| 			productList: [], | ||||
| 			materialAttrList: [], | ||||
| 			tableData: [], | ||||
| 			unitList: [], | ||||
| 			visible: false, | ||||
| 			isdetail: false, | ||||
| 			idAttrShow: false, | ||||
| @@ -227,14 +229,21 @@ export default { | ||||
|       }); | ||||
|     }, | ||||
| 		async getDict() { | ||||
| 			const materRes = await getMaterialTree(); | ||||
|       let typeId = materRes.data[0].product?materRes.data[0].id:materRes.data[1].id | ||||
|       const listQuery= { | ||||
|         typeId:typeId | ||||
| 			// 产品列表 | ||||
| 			const proRes = await getProList(); | ||||
| 			this.productList = proRes.data; | ||||
| 			// 物料单位列表 | ||||
| 			const unitRes = await listData({ | ||||
| 				pageNo: 1, | ||||
|         pageSize: 99, | ||||
|         dictType: 'unit_dict', | ||||
| 			}); | ||||
| 			this.unitList = unitRes.data.list.map(item => { | ||||
| 				return { | ||||
| 					label: item.label, | ||||
| 					value: Number(item.value) | ||||
| 				} | ||||
| 			const materData = await getMaterialList(listQuery); | ||||
| 			this.productList = []; | ||||
| 			this.productList = materData.data; | ||||
| 			}); | ||||
| 		}, | ||||
| 		initData() { | ||||
| 			// this.materialAttrList.splice(0); | ||||
| @@ -83,7 +83,7 @@ | ||||
| </template> | ||||
| 
 | ||||
| <script> | ||||
| import { getMaterialTree,getMaterialList } from '@/api/base/material'; | ||||
| import { getMaterialList } from '@/api/base/material'; | ||||
| import { createMaterialPBDet, updateMaterialPBDet, getMaterialPBDet } from "@/api/base/materialProductBom"; | ||||
| 
 | ||||
| export default { | ||||
| @@ -117,14 +117,8 @@ export default { | ||||
| 	methods: { | ||||
| 		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; | ||||
| 			const res = await getMaterialList(); | ||||
| 			this.materialList = res.data; | ||||
| 		}, | ||||
| 		init(id) { | ||||
| 			this.dataForm.id = id || ''; | ||||
| @@ -1,8 +1,8 @@ | ||||
| <!-- | ||||
|  * @Author: zwq | ||||
|  * @Date: 2021-11-18 14:16:25 | ||||
|  * @LastEditors: zwq | ||||
|  * @LastEditTime: 2024-07-09 09:58:24 | ||||
|  * @LastEditors: DY | ||||
|  * @LastEditTime: 2023-11-27 19:57:23 | ||||
|  * @Description: | ||||
| --> | ||||
| <template> | ||||
| @@ -22,7 +22,8 @@ | ||||
| 						clearable | ||||
| 						filterable | ||||
| 						@change="setCode" | ||||
| 						style="width: 100%"> | ||||
| 						style="width: 100%" | ||||
| 					> | ||||
| 						<el-option | ||||
| 							v-for="dict in materialList" | ||||
| 							:key="dict.id" | ||||
| @@ -41,13 +42,14 @@ | ||||
| 				</el-form-item> | ||||
| 			</el-col> | ||||
| 			<el-col :span="8"> | ||||
| 				<el-form-item label="物料批次" prop="materialDateId"> | ||||
| 				<el-form-item label="批次号" prop="materialDateId"> | ||||
| 					<el-select | ||||
| 						v-model="dataForm.materialDateId" | ||||
| 						clearable | ||||
| 						filterable | ||||
| 						placeholder="请选择物料批次" | ||||
| 						style="width: 100%"> | ||||
| 						style="width: 100%" | ||||
| 					> | ||||
| 						<el-option | ||||
| 							v-for="dict in materialDateList" | ||||
| 							:key="dict.id" | ||||
| @@ -79,8 +81,8 @@ | ||||
| 					<el-date-picker | ||||
| 						v-model="dataForm.useTime" | ||||
| 						type="datetime" | ||||
| 						format="yyyy-MM-dd HH:mm:ss" | ||||
| 						value-format="timestamp" | ||||
| 						format='yyyy-MM-dd HH:mm:ss' | ||||
|          		value-format='timestamp' | ||||
| 						placeholder="选择日期时间" /> | ||||
| 				</el-form-item> | ||||
| 			</el-col> | ||||
| @@ -96,8 +98,8 @@ | ||||
| 						<el-option | ||||
| 							v-for="dict in workersList" | ||||
| 							:key="dict.id" | ||||
| 							:label="dict.nickname" | ||||
| 							:value="dict.nickname" /> | ||||
| 							:label="dict.name" | ||||
| 							:value="dict.name" /> | ||||
| 					</el-select> | ||||
| 				</el-form-item> | ||||
| 			</el-col> | ||||
| @@ -105,12 +107,7 @@ | ||||
| 		<el-row :gutter="20"> | ||||
| 			<el-col :span="8"> | ||||
| 				<el-form-item label="使用数量" prop="num"> | ||||
| 					<el-input-number | ||||
| 						v-model="dataForm.num" | ||||
| 						clearable | ||||
| 						controls-position="right" | ||||
| 						placeholder="请输入使用数量" | ||||
| 						style="width: 100%" /> | ||||
| 					<el-input-number v-model="dataForm.num" clearable controls-position="right" placeholder="请输入使用数量" style="width: 100%" /> | ||||
| 				</el-form-item> | ||||
| 			</el-col> | ||||
| 			<el-col :span="8"> | ||||
| @@ -129,10 +126,7 @@ | ||||
| 			</el-col> | ||||
| 			<el-col :span="8"> | ||||
| 				<el-form-item label="备注" prop="remark"> | ||||
| 					<el-input | ||||
| 						v-model="dataForm.remark" | ||||
| 						clearable | ||||
| 						placeholder="请输入备注" /> | ||||
| 					<el-input v-model="dataForm.remark" clearable placeholder="请输入备注" /> | ||||
| 				</el-form-item> | ||||
| 			</el-col> | ||||
| 		</el-row> | ||||
| @@ -141,15 +135,9 @@ | ||||
| 
 | ||||
| <script> | ||||
| import basicAdd from '../../core/mixins/basic-add'; | ||||
| import { | ||||
| 	createMaterialLog, | ||||
| 	updateMaterialLog, | ||||
| 	getMaterialLog, | ||||
| 	getEqListAll, | ||||
| } from '@/api/base/materialUseLog'; | ||||
| import { getMaterialTree,getMaterialList } from '@/api/base/material'; | ||||
| import { getMaterDateList } from '@/api/base/materialDate'; | ||||
| import { listSimpleUsers } from '@/api/system/user'; | ||||
| import { createMaterialLog, updateMaterialLog, getMaterialLog, getEqListAll, getworkerAll } from "@/api/base/materialUseLog"; | ||||
| import { getMaterialList } from "@/api/base/material" | ||||
| import { getMaterDateList } from "@/api/base/materialDate" | ||||
| 
 | ||||
| export default { | ||||
| 	mixins: [basicAdd], | ||||
| @@ -158,7 +146,7 @@ export default { | ||||
| 			urlOptions: { | ||||
| 				createURL: createMaterialLog, | ||||
| 				updateURL: updateMaterialLog, | ||||
| 				infoURL: getMaterialLog, | ||||
| 				infoURL: getMaterialLog | ||||
| 			}, | ||||
| 			dataForm: { | ||||
|         id: undefined, | ||||
| @@ -172,77 +160,66 @@ export default { | ||||
|         address: undefined, | ||||
| 				num: 0, | ||||
| 				source: undefined, | ||||
| 				remark: undefined, | ||||
|         remark: undefined | ||||
| 			}, | ||||
| 			dataSourceList: [ | ||||
| 				{ | ||||
| 					id: 1, | ||||
| 					name: '手动', | ||||
| 					name: '手动' | ||||
| 				}, | ||||
| 				{ | ||||
| 					id: 2, | ||||
| 					name: 'PDA', | ||||
| 				}, | ||||
| 					name: 'PDA' | ||||
| 				} | ||||
| 			], | ||||
| 			materialList: [], | ||||
| 			materialDateList: [], | ||||
| 			eqList: [], | ||||
| 			workersList: [], | ||||
| 			dataRule: { | ||||
| 				materialId: [ | ||||
| 					{ required: true, message: '物料不能为空', trigger: 'blur' }, | ||||
| 				], | ||||
| 				useTime: [ | ||||
| 					{ required: true, message: '使用时间不能为空', trigger: 'blur' }, | ||||
| 				], | ||||
| 				userNames: [ | ||||
| 					{ required: true, message: '操作员不能为空', trigger: 'blur' }, | ||||
| 				], | ||||
| 				num: [{ required: true, message: '使用数量不能为空', trigger: 'blur' }], | ||||
| 			}, | ||||
|         materialId: [{ required: true, message: "物料不能为空", trigger: "blur" }], | ||||
|         materialDateId: [{ required: true, message: "批次号不能为空", trigger: "blur" }], | ||||
| 				useTime: [{ required: true, message: "使用时间不能为空", trigger: "blur" }], | ||||
| 				userNames: [{ required: true, message: "操作员不能为空", trigger: "blur" }], | ||||
| 				num: [{ required: true, message: "使用数量不能为空", trigger: "blur" }] | ||||
|       } | ||||
| 		}; | ||||
| 	}, | ||||
| 	mounted() { | ||||
| 		this.getDictData(); | ||||
| 		this.getDictData() | ||||
| 	}, | ||||
| 	methods: { | ||||
| 		async getDictData() { | ||||
| 			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; | ||||
| 			const dateRes = await getMaterDateList(); | ||||
| 			this.materialDateList = dateRes.data; | ||||
| 			const eqRes = await getEqListAll(); | ||||
| 			this.eqList = eqRes.data; | ||||
| 			const workerRes = await listSimpleUsers(); | ||||
| 			this.workersList = workerRes.data; | ||||
| 			const materRes = await getMaterialList() | ||||
| 			this.materialList = materRes.data | ||||
| 			const dateRes = await getMaterDateList() | ||||
| 			this.materialDateList = dateRes.data | ||||
| 			const eqRes = await getEqListAll() | ||||
| 			this.eqList = eqRes.data | ||||
| 			const workerRes = await getworkerAll() | ||||
| 			this.workersList = workerRes.data | ||||
| 		}, | ||||
| 		// 表单提交 | ||||
|     dataFormSubmit() { | ||||
| 			this.dataForm.userName = this.dataForm.userNames.join(','); | ||||
| 			this.$refs['dataForm'].validate((valid) => { | ||||
| 			this.dataForm.userName = this.dataForm.userNames.join(',') | ||||
|       this.$refs["dataForm"].validate((valid) => { | ||||
|         if (!valid) { | ||||
|           return false; | ||||
|         } | ||||
|         // 修改的提交 | ||||
|         if (this.dataForm.id) { | ||||
| 					this.urlOptions.updateURL(this.dataForm).then((response) => { | ||||
| 						this.$modal.msgSuccess('修改成功'); | ||||
|           this.urlOptions.updateURL(this.dataForm).then(response => { | ||||
|             this.$modal.msgSuccess("修改成功"); | ||||
|             this.visible = false; | ||||
| 						this.$emit('refreshDataList'); | ||||
|             this.$emit("refreshDataList"); | ||||
|           }); | ||||
|           return; | ||||
|         } | ||||
|         // 添加的提交 | ||||
| 				this.urlOptions.createURL(this.dataForm).then((response) => { | ||||
| 					this.$modal.msgSuccess('新增成功'); | ||||
|         this.urlOptions.createURL(this.dataForm).then(response => { | ||||
|           this.$modal.msgSuccess("新增成功"); | ||||
|           this.visible = false; | ||||
| 					this.$emit('refreshDataList'); | ||||
|           this.$emit("refreshDataList"); | ||||
|         }); | ||||
|       }); | ||||
|     }, | ||||
| @@ -251,34 +228,33 @@ export default { | ||||
|       this.visible = true; | ||||
| 
 | ||||
|       this.$nextTick(() => { | ||||
| 				this.$refs['dataForm'].resetFields(); | ||||
|         this.$refs["dataForm"].resetFields(); | ||||
|         if (this.dataForm.id) { | ||||
| 					this.urlOptions.infoURL(id).then((response) => { | ||||
| 						this.dataForm.id = response.data.id; | ||||
| 						this.dataForm.materialCode = response.data.materialCode; | ||||
| 						this.dataForm.materialId = response.data.materialId; | ||||
| 						this.dataForm.materialDateId = response.data.materialDateId; | ||||
| 						this.dataForm.equipmentId = response.data.equipmentId; | ||||
| 						this.dataForm.useTime = response.data.useTime; | ||||
|           this.urlOptions.infoURL(id).then(response => { | ||||
|             this.dataForm.id = response.data.id | ||||
| 						this.dataForm.materialCode = response.data.materialCode | ||||
| 						this.dataForm.materialId = response.data.materialId | ||||
| 						this.dataForm.materialDateId = response.data.materialDateId | ||||
| 						this.dataForm.equipmentId = response.data.equipmentId | ||||
| 						this.dataForm.useTime = response.data.useTime | ||||
| 						// this.dataForm.userName = response.data.userName | ||||
| 						this.dataForm.num = response.data.num; | ||||
| 						this.dataForm.source = response.data.source; | ||||
| 						this.dataForm.remark = response.data.remark; | ||||
| 						this.dataForm.userNames = response.data.userName.split(','); | ||||
| 						this.dataForm.num = response.data.num | ||||
| 						this.dataForm.source = response.data.source | ||||
| 						this.dataForm.remark = response.data.remark | ||||
| 						this.dataForm.userNames = response.data.userName.split(',') | ||||
|           }); | ||||
| 				} else { | ||||
| 				} | ||||
|         } else {} | ||||
|       }); | ||||
|     }, | ||||
| 		setCode() { | ||||
| 			const tempMaterial = this.materialList.filter((item) => { | ||||
| 				return item.id === this.dataForm.materialId; | ||||
| 			}); | ||||
| 			this.dataForm.materialCode = tempMaterial[0].code; | ||||
| 			getMaterDateList({ materialId: this.dataForm.materialId }).then((res) => { | ||||
| 				this.materialDateList = res.data; | ||||
| 			}); | ||||
| 		}, | ||||
| 			const tempMaterial = this.materialList.filter(item =>{ | ||||
| 				return item.id === this.dataForm.materialId | ||||
| 			}) | ||||
| 			this.dataForm.materialCode = tempMaterial[0].code | ||||
| 			getMaterDateList({materialId: this.dataForm.materialId}).then(res =>{ | ||||
| 				this.materialDateList = res.data | ||||
| 			}) | ||||
| 		} | ||||
| 	}, | ||||
| }; | ||||
| </script> | ||||
| @@ -1,8 +1,8 @@ | ||||
| /* | ||||
|  * @Author: zwq | ||||
|  * @Date: 2022-08-24 11:19:43 | ||||
|  * @LastEditors: zwq | ||||
|  * @LastEditTime: 2024-07-05 10:10:12 | ||||
|  * @LastEditors: zhp | ||||
|  * @LastEditTime: 2023-11-24 09:29:36 | ||||
|  * @Description: | ||||
|  */ | ||||
| export default { | ||||
| @@ -53,12 +53,11 @@ export default { | ||||
|       this.listQuery.pageNo = val; | ||||
|       this.getDataList(); | ||||
|     }, | ||||
|     // 新增
 | ||||
|     addOrUpdateHandle() { | ||||
|       this.addOrEditTitle = '新增'; | ||||
|     // 新增 / 修改
 | ||||
|     addOrUpdateHandle(id) { | ||||
|       this.addOrUpdateVisible = true; | ||||
|       this.$nextTick(() => { | ||||
|         this.$refs.addOrUpdate.init(); | ||||
|         this.$refs.addOrUpdate.init(id); | ||||
|       }); | ||||
|     }, | ||||
|     cancel(id) { | ||||
| @@ -1,8 +1,8 @@ | ||||
| 
 | ||||
| /* | ||||
|  * @Date: 2020-12-29 16:49:28 | ||||
|  * @LastEditors: zwq | ||||
|  * @LastEditTime: 2024-07-08 16:27:39 | ||||
|  * @LastEditors: DY | ||||
|  * @LastEditTime: 2023-09-12 11:13:34 | ||||
|  * @FilePath: \basic-admin\src\filters\basicData\index.js | ||||
|  * @Description: | ||||
|  */ | ||||
| @@ -33,7 +33,7 @@ export function parseTime(time, pattern) { | ||||
|     if ((typeof time === 'string') && (/^[0-9]+$/.test(time))) { | ||||
|       time = parseInt(time) | ||||
|     } else if (typeof time === 'string') { | ||||
|       time = time.replace(new RegExp(/-/gm), '/').replace('T', ' ').replace(new RegExp(/\.\d{3}/gm), ''); | ||||
|       time = time.replace(new RegExp(/-/gm), '/').replace('T', ' ').replace(new RegExp(/\.\d{3}/gm),''); | ||||
|     } | ||||
|     if ((typeof time === 'number') && (time.toString().length === 10)) { | ||||
|       time = time * 1000 | ||||
| @@ -62,22 +62,6 @@ export function parseTime(time, pattern) { | ||||
|   }) | ||||
|   return time_str | ||||
| } | ||||
| // 遍历树结构返回数组
 | ||||
| export function getTreeArr(arr) { | ||||
|   let result =[] | ||||
|   arr.forEach(item => { | ||||
|     if(item.children && item.children.length>0){ | ||||
|       let {children,...obj} = item | ||||
|       result.push(obj) | ||||
|       result = result.concat(getTreeArr(children)) | ||||
|     }else{ | ||||
|       let {children,...obj} = item | ||||
|       result.push(obj) | ||||
|     } | ||||
|   }); | ||||
|   return result | ||||
| } | ||||
| 
 | ||||
| export default function (dictTable) { | ||||
|   return function (val) { | ||||
|     return table?.[dictTable]?.[val] | ||||
| @@ -2,29 +2,19 @@ | ||||
|   <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-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', | ||||
| 						}"> | ||||
|           :style="{opacity: item.visible?1:0.4, pointerEvents:item.visible?'auto':'none'}" | ||||
|         > | ||||
|           <div> | ||||
| 							<img | ||||
| 								:src=" | ||||
| 									require(`../../assets/images/choicepart/${item.name}.png`) | ||||
| 								" | ||||
| 								alt="" /> | ||||
|             <img :src="require(`../../assets/images/choicepart/${item.name}.png`)" alt=""> | ||||
|           </div> | ||||
| 						<div class="choicepart-item-title">{{ item.meta.title }}</div> | ||||
|           <div class="choicepart-item-title">{{item.meta.title}}</div> | ||||
|         </div> | ||||
|       </div> | ||||
|       <div class="choicepart-line2"> | ||||
| @@ -33,18 +23,12 @@ | ||||
|           :key="index" | ||||
|           class="choicepart-item" | ||||
|           @click="handelClick(item, item.choicepart)" | ||||
| 						:style="{ | ||||
| 							opacity: item.visible ? 1 : 0.4, | ||||
| 							pointerEvents: item.visible ? 'auto' : 'none', | ||||
| 						}"> | ||||
|           :style="{opacity: item.visible?1:0.4, pointerEvents:item.visible?'auto':'none'}" | ||||
|         > | ||||
|           <div> | ||||
| 							<img | ||||
| 								:src=" | ||||
| 									require(`../../assets/images/choicepart/${item.name}.png`) | ||||
| 								" | ||||
| 								alt="" /> | ||||
|             <img :src="require(`../../assets/images/choicepart/${item.name}.png`)" alt=""> | ||||
|           </div> | ||||
| 						<div class="choicepart-item-title">{{ item.meta.title }}</div> | ||||
|           <div class="choicepart-item-title">{{item.meta.title}}</div> | ||||
|         </div> | ||||
|       </div> | ||||
|     </div> | ||||
| @@ -53,8 +37,8 @@ | ||||
|   </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', | ||||
| @@ -68,57 +52,57 @@ export default { | ||||
|           title: '基础核心', | ||||
|           visible: false, | ||||
|           meta: { | ||||
| 						title: '', | ||||
| 					}, | ||||
|             title: '' | ||||
|           } | ||||
|         }, | ||||
|         { | ||||
| 					name: 'Produce', | ||||
| 					title: '生产管理', | ||||
|           name: 'Order', | ||||
|           title: '订单管理', | ||||
|           visible: false, | ||||
|           meta: { | ||||
| 						title: '', | ||||
| 					}, | ||||
|             title: '' | ||||
|           } | ||||
|         }, | ||||
|         { | ||||
|           name: 'Equipment', | ||||
|           title: '设备管理', | ||||
|           visible: false, | ||||
|           meta: { | ||||
| 						title: '', | ||||
| 					}, | ||||
|             title: '' | ||||
|           } | ||||
|         }, | ||||
|         { | ||||
|           name: 'Group', | ||||
|           title: '班组管理', | ||||
|           visible: false, | ||||
|           meta: { | ||||
| 						title: '', | ||||
| 					}, | ||||
|             title: '' | ||||
|           } | ||||
|         }, | ||||
|         { | ||||
|           name: 'Quality', | ||||
|           title: '质量管理', | ||||
|           visible: false, | ||||
|           meta: { | ||||
| 						title: '', | ||||
| 					}, | ||||
|             title: '' | ||||
|           } | ||||
|         }, | ||||
|         { | ||||
|           name: 'Warehouse', | ||||
|           title: '仓库管理', | ||||
|           visible: false, | ||||
|           meta: { | ||||
| 						title: '', | ||||
| 					}, | ||||
|             title: '' | ||||
|           } | ||||
|         }, | ||||
|         { | ||||
|           name: 'Energy', | ||||
|           title: '能源管理', | ||||
|           visible: false, | ||||
|           meta: { | ||||
| 						title: '', | ||||
| 					}, | ||||
| 				}, | ||||
|             title: '' | ||||
|           } | ||||
|         } | ||||
|       ], | ||||
|       menuArr2: [ | ||||
|         { | ||||
| @@ -126,108 +110,99 @@ export default { | ||||
|           title: '包装管理', | ||||
|           visible: false, | ||||
|           meta: { | ||||
| 						title: '', | ||||
| 					}, | ||||
|             title: '' | ||||
|           } | ||||
|         }, | ||||
|         { | ||||
|           name: 'Material', | ||||
|           title: '物料管理', | ||||
|           visible: false, | ||||
|           meta: { | ||||
| 						title: '', | ||||
| 					}, | ||||
|             title: '' | ||||
|           } | ||||
|         }, | ||||
|         { | ||||
|           name: 'Extend', | ||||
|           title: '工艺管理', | ||||
|           visible: false, | ||||
|           meta: { | ||||
| 						title: '', | ||||
| 					}, | ||||
|             title: '' | ||||
|           } | ||||
|         }, | ||||
|         { | ||||
|           name: 'Delivery', | ||||
|           title: '成品发货', | ||||
|           visible: false, | ||||
|           meta: { | ||||
| 						title: '', | ||||
| 					}, | ||||
|             title: '' | ||||
|           } | ||||
|         }, | ||||
|         { | ||||
|           name: 'Report', | ||||
|           title: '报表管理', | ||||
|           visible: false, | ||||
|           meta: { | ||||
| 						title: '', | ||||
| 					}, | ||||
|             title: '' | ||||
|           } | ||||
|         }, | ||||
|         { | ||||
|           name: 'System', | ||||
|           title: '系统管理', | ||||
|           visible: false, | ||||
|           meta: { | ||||
| 						title: '', | ||||
| 					}, | ||||
| 				}, | ||||
| 				{ | ||||
| 					name: 'Devconfig', | ||||
| 					title: '开发配置', | ||||
| 					visible: false, | ||||
| 					meta: { | ||||
| 						title: '', | ||||
| 					}, | ||||
| 				}, | ||||
|             title: '' | ||||
|           } | ||||
|         } | ||||
|       ], | ||||
| 			showItem: false, | ||||
| 		}; | ||||
|       showItem: false | ||||
|     } | ||||
|   }, | ||||
|   // computed:{ | ||||
|   //   ...mapGetters(['sidebarRouters']) | ||||
|   // }, | ||||
|   mounted() { | ||||
| 		this.getMsg(); | ||||
|     this.getMsg() | ||||
|     this.boxReset = debounce(() => { | ||||
| 			this.resetSize(); | ||||
| 		}, 300); | ||||
| 		this.boxReset(); | ||||
|       this.resetSize() | ||||
|     }, 300) | ||||
|     this.boxReset() | ||||
|     window.addEventListener('resize', () => { | ||||
| 			this.boxReset(); | ||||
| 		}); | ||||
|       this.boxReset() | ||||
|     }) | ||||
|   }, | ||||
|   methods: { | ||||
|     getMsg() { | ||||
| 			let menuList = this.$store.state.permission.sidebarRouters; | ||||
| 			console.log('sss', menuList); | ||||
| 			console.log(menuList); | ||||
|       let menuList = this.$store.state.permission.sidebarRouters | ||||
|       console.log(menuList) | ||||
|       if (menuList.length > 0) { | ||||
| 				for (let i = 0; i < menuList.length; i++) { | ||||
|         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; | ||||
|               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++) { | ||||
|           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; | ||||
|               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); | ||||
|       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); | ||||
|       this.$store.dispatch('app/setChoicepart', index) | ||||
|       this.toRouter(item) | ||||
|       // if (item.meta.unuse) { | ||||
|       //   this.$message.warning(this.$t('暂无数据')) | ||||
|       // } else { | ||||
| @@ -235,38 +210,38 @@ export default { | ||||
|       // } | ||||
|     }, | ||||
|     toRouter(item) { | ||||
| 			console.log(item); | ||||
|       console.log(item) | ||||
|       if (item.children) { | ||||
| 				this.toRouter(item.children[0]); | ||||
|         this.toRouter(item.children[0]) | ||||
|       } else { | ||||
| 				this.$router.push({ name: item.name }); | ||||
|         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); | ||||
|       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; | ||||
| 		}, | ||||
|       this.loading = false | ||||
|       this.showItem = true | ||||
|     } | ||||
|   }, | ||||
|   beforeDestroy() { | ||||
| 		this.showItem = false; | ||||
| 	}, | ||||
| }; | ||||
|     this.showItem = false | ||||
|   } | ||||
| } | ||||
| </script> | ||||
| <style lang="scss" scoped> | ||||
| <style lang='scss' scoped> | ||||
| .choicepart-container { | ||||
|   position: relative; | ||||
|   width: 100%; | ||||
| @@ -297,8 +272,7 @@ export default { | ||||
|     .choicepart-item { | ||||
|       width: 184px; | ||||
|       height: 224px; | ||||
| 			background: url('../../assets/images/choicepart/choice-item-back.png') | ||||
| 				no-repeat; | ||||
|       background: url('../../assets/images/choicepart/choice-item-back.png') no-repeat; | ||||
|       background-size: 100% 100%; | ||||
|       border-radius: 5px; | ||||
|       overflow: hidden; | ||||
| @@ -336,7 +310,7 @@ export default { | ||||
|   .choicepart-footer { | ||||
|     position: absolute; | ||||
|     width: 100%; | ||||
| 		color: #c7c7c7; | ||||
|     color: #C7C7C7; | ||||
|     user-select: none; | ||||
|     font-size: 12px; | ||||
|     letter-spacing: 1px; | ||||
|   | ||||
| @@ -1,100 +0,0 @@ | ||||
| <!-- | ||||
|  * @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> | ||||
| @@ -1,79 +0,0 @@ | ||||
| <!-- | ||||
|  * @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> | ||||
Some files were not shown because too many files have changed in this diff Show More
		Reference in New Issue
	
	Block a user