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 |  # @Author: Do not edit | ||||||
|  # @Date: 2023-08-29 09:40:39 |  # @Date: 2023-08-29 09:40:39 | ||||||
|  # @LastEditTime: 2024-07-29 15:00:13 |  # @LastEditTime: 2023-11-21 10:36:47 | ||||||
|  # @LastEditors: DY |  # @LastEditors: DY | ||||||
|  # @Description: |  # @Description: | ||||||
| ### | ### | ||||||
| @@ -14,9 +14,9 @@ VUE_APP_TITLE = MES系统 | |||||||
| # 芋道管理系统/开发环境 | # 芋道管理系统/开发环境 | ||||||
| # VUE_APP_BASE_API = 'http://100.64.0.26:48082' | # VUE_APP_BASE_API = 'http://100.64.0.26:48082' | ||||||
| VUE_APP_BASE_API = 'http://192.168.0.33:48082' | VUE_APP_BASE_API = 'http://192.168.0.33:48082' | ||||||
| # VUE_APP_BASE_API = 'http://192.168.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.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.1.8:48082' | ||||||
| # VUE_APP_BASE_API = 'http://192.168.4.159:48080' | # VUE_APP_BASE_API = 'http://192.168.4.159:48080' | ||||||
| # VUE_APP_BASE_API = 'http://192.168.1.56:48082' | # 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_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://10.70.2.32' | ||||||
| PUBLIC_PATH = 'http://192.168.0.33:8889/' |  | ||||||
|  |  | ||||||
| # 二级部署路径 | # 二级部署路径 | ||||||
| VUE_APP_APP_NAME ='yudao-admin' | # VUE_APP_APP_NAME ='yudao-admin' | ||||||
|  |  | ||||||
| # 多租户的开关 | # 多租户的开关 | ||||||
| VUE_APP_TENANT_ENABLE = true | 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 | VUE_APP_TENANT_ENABLE = true | ||||||
| @@ -20,4 +25,3 @@ VUE_APP_DOC_ENABLE = false | |||||||
|  |  | ||||||
| # 百度统计 | # 百度统计 | ||||||
| VUE_APP_BAIDU_CODE = fadc1bd5db1a1d6f581df60a1807f8ab | VUE_APP_BAIDU_CODE = fadc1bd5db1a1d6f581df60a1807f8ab | ||||||
|  |  | ||||||
|   | |||||||
| @@ -48,12 +48,11 @@ | |||||||
|     "benz-amr-recorder": "^1.1.5", |     "benz-amr-recorder": "^1.1.5", | ||||||
|     "bpmn-js-token-simulation": "0.10.0", |     "bpmn-js-token-simulation": "0.10.0", | ||||||
|     "clipboard": "2.0.8", |     "clipboard": "2.0.8", | ||||||
|     "code-brick-zj": "^1.0.5", |     "code-brick-zj": "^1.0.2", | ||||||
|     "core-js": "^3.26.0", |     "core-js": "^3.26.0", | ||||||
|     "crypto-js": "^4.0.0", |     "crypto-js": "^4.0.0", | ||||||
|     "diagram-js": "^12.3.0", |     "diagram-js": "^12.3.0", | ||||||
|     "echarts": "5.4.0", |     "echarts": "5.4.0", | ||||||
|     "el-tree-transfer": "^2.4.7", |  | ||||||
|     "element-ui": "2.15.12", |     "element-ui": "2.15.12", | ||||||
|     "file-saver": "^2.0.5", |     "file-saver": "^2.0.5", | ||||||
|     "fuse.js": "6.6.2", |     "fuse.js": "6.6.2", | ||||||
|   | |||||||
| @@ -1,9 +1,9 @@ | |||||||
| /* | /* | ||||||
|  * @Author: Do not edit |  * @Author: Do not edit | ||||||
|  * @Date: 2023-10-21 11:50:46 |  * @Date: 2023-10-21 11:50:46 | ||||||
|  * @LastEditTime: 2024-07-08 14:35:17 |  * @LastEditTime: 2023-11-04 10:42:50 | ||||||
|  * @LastEditors: zwq |  * @LastEditors: DY | ||||||
|  * @Description: |  * @Description:  | ||||||
|  */ |  */ | ||||||
| import request from '@/utils/request' | import request from '@/utils/request' | ||||||
|  |  | ||||||
| @@ -61,7 +61,7 @@ export function getCoreProductPage(query) { | |||||||
| // 获得所有列表 | // 获得所有列表 | ||||||
| export function getCoreProductList(query) { | export function getCoreProductList(query) { | ||||||
|   return request({ |   return request({ | ||||||
|     url: '/base/core-product-material/listAll', |     url: '/base/core-product/listAll', | ||||||
|     method: 'get', |     method: 'get', | ||||||
|     params: query |     params: query | ||||||
|   }) |   }) | ||||||
| @@ -108,4 +108,4 @@ export function getCoreProductAttrPage(query) { | |||||||
|     method: 'get', |     method: 'get', | ||||||
|     params: query |     params: query | ||||||
|   }) |   }) | ||||||
| } | } | ||||||
| @@ -51,13 +51,6 @@ export function getCode() { | |||||||
|   }) |   }) | ||||||
| } | } | ||||||
|  |  | ||||||
| // 获得可用的班次列表 |  | ||||||
| export function listClassesEnabled() { |  | ||||||
|   return request({ |  | ||||||
|     url: '/base/group-classes/listEnable', |  | ||||||
|     method: 'get' |  | ||||||
|   }) |  | ||||||
| } |  | ||||||
| // 导出班次基础信息 Excel | // 导出班次基础信息 Excel | ||||||
| export function exportGroupClassesExcel(query) { | export function exportGroupClassesExcel(query) { | ||||||
|   return request({ |   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 |     params: query | ||||||
|   }) |   }) | ||||||
| } | } | ||||||
| // 获取某月预排班 |  | ||||||
| export function getScheduling(query) { |  | ||||||
|   return request({ |  | ||||||
|     url: '/base/group-team-scheduling/getScheduling', |  | ||||||
|     method: 'get', |  | ||||||
|     params: query |  | ||||||
|   }) |  | ||||||
| } |  | ||||||
| // 批量创建-更新排班信息 | // 批量创建-更新排班信息 | ||||||
| export function createOrUpdateList(data) { | export function createOrUpdateList(data) { | ||||||
|   return request({ |   return request({ | ||||||
|   | |||||||
| @@ -1,9 +1,9 @@ | |||||||
| /* | /* | ||||||
|  * @Author: Do not edit |  * @Author: Do not edit | ||||||
|  * @Date: 2023-10-21 11:50:46 |  * @Date: 2023-10-21 11:50:46 | ||||||
|  * @LastEditTime: 2024-07-05 10:09:18 |  * @LastEditTime: 2023-10-24 11:22:28 | ||||||
|  * @LastEditors: zwq |  * @LastEditors: DY | ||||||
|  * @Description: |  * @Description:  | ||||||
|  */ |  */ | ||||||
| import request from '@/utils/request' | import request from '@/utils/request' | ||||||
|  |  | ||||||
| @@ -61,7 +61,7 @@ export function getMaterialPage(query) { | |||||||
| // 获得物料列表 | // 获得物料列表 | ||||||
| export function getMaterialList(query) { | export function getMaterialList(query) { | ||||||
|   return request({ |   return request({ | ||||||
|     url: '/base/core-product-material/listAll', |     url: '/base/material/listbyfilter', | ||||||
|     method: 'get', |     method: 'get', | ||||||
|     params: query |     params: query | ||||||
|   }) |   }) | ||||||
| @@ -118,85 +118,4 @@ export function getMaterialAttr(query) { | |||||||
|     method: 'get', |     method: 'get', | ||||||
|     params: 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' |  | ||||||
|   }) |  | ||||||
| } |  | ||||||
| @@ -3,7 +3,7 @@ | |||||||
|  * @Date: 2023-10-21 11:50:46 |  * @Date: 2023-10-21 11:50:46 | ||||||
|  * @LastEditTime: 2023-11-27 17:54:28 |  * @LastEditTime: 2023-11-27 17:54:28 | ||||||
|  * @LastEditors: DY |  * @LastEditors: DY | ||||||
|  * @Description: |  * @Description:  | ||||||
|  */ |  */ | ||||||
| import request from '@/utils/request' | import request from '@/utils/request' | ||||||
|  |  | ||||||
| @@ -70,7 +70,7 @@ export function getMaterialPBList(query) { | |||||||
| // 获得产品列表 | // 获得产品列表 | ||||||
| export function getProList(query) { | export function getProList(query) { | ||||||
|   return request({ |   return request({ | ||||||
|     url: '/base/core-product-material/listAll', |     url: '/base/core-product/listAll', | ||||||
|     method: 'get', |     method: 'get', | ||||||
|     params: query |     params: query | ||||||
|   }) |   }) | ||||||
|   | |||||||
| @@ -2,7 +2,7 @@ import request from '@/utils/request' | |||||||
| // 获得产品列表 | // 获得产品列表 | ||||||
| export function getProductAll() { | export function getProductAll() { | ||||||
|   return request({ |   return request({ | ||||||
|     url: '/base/core-product-material/listAll', |     url: '/base/core-product/listAll', | ||||||
|     method: 'get' |     method: 'get' | ||||||
|   }) |   }) | ||||||
| } | } | ||||||
| @@ -24,14 +24,4 @@ export function exportEqAnalysisExcel(query) { | |||||||
|     params: query, |     params: query, | ||||||
|     responseType: 'blob' |     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 |  * @Author: zhp | ||||||
|  * @Date: 2023-11-07 19:47:48 |  * @Date: 2023-11-07 19:47:48 | ||||||
|  * @LastEditTime: 2024-07-08 14:33:12 |  * @LastEditTime: 2023-11-23 13:57:41 | ||||||
|  * @LastEditors: zwq |  * @LastEditors: zhp | ||||||
|  * @Description: |  * @Description: | ||||||
|  */ |  */ | ||||||
| import request from '@/utils/request' | import request from '@/utils/request' | ||||||
| @@ -99,7 +99,7 @@ export function getProcessEquMaterialBomDet(data) { | |||||||
|  |  | ||||||
| export function getMaterialList(data) { | export function getMaterialList(data) { | ||||||
|   return request({ |   return request({ | ||||||
|     url: '/base/core-product-material/listAll', |     url: '/base/material/listbyfilter', | ||||||
|     method: 'get', |     method: 'get', | ||||||
|     data: data |     data: data | ||||||
|   }) |   }) | ||||||
|   | |||||||
| @@ -25,7 +25,7 @@ export function getWorkOrderList(query) { | |||||||
| } | } | ||||||
| export function getProductList(query) { | export function getProductList(query) { | ||||||
|   return request({ |   return request({ | ||||||
|     url: '/base/core-product-material/listAll', |     url: '/base/core-product/listAll', | ||||||
|     method: 'get', |     method: 'get', | ||||||
|     params: query, |     params: query, | ||||||
|   }) |   }) | ||||||
| @@ -38,11 +38,3 @@ export function getInspectionData(query) { | |||||||
|     params: 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 | 			// 取消自动聚焦 start | ||||||
| 			this.Quill?.enable(false); | 			this.Quill?.enable(false); | ||||||
| 			this.$nextTick(() => { | 			this.$nextTick(() => { | ||||||
| 				this.Quill?.blur(); |  | ||||||
| 				this.Quill?.enable(true); | 				this.Quill?.enable(true); | ||||||
|  | 				this.Quill?.blur(); | ||||||
|  | 				// if (!this.readOnly) { | ||||||
|  | 				// 	this.Quill?.enable(); | ||||||
|  | 				// } | ||||||
| 			}); | 			}); | ||||||
| 			// 如果设置了上传地址则自定义图片上传事件 | 			// 如果设置了上传地址则自定义图片上传事件 | ||||||
| 			if (this.type === 'url') { | 			if (this.type === 'url') { | ||||||
|   | |||||||
| @@ -360,6 +360,7 @@ export default { | |||||||
|         ts: Date.now(), // 现在的时间戳 |         ts: Date.now(), // 现在的时间戳 | ||||||
|       } |       } | ||||||
|       reqGet(data).then(res => { |       reqGet(data).then(res => { | ||||||
|  |         console.log(1) | ||||||
|         if (res.repCode === '0000') { |         if (res.repCode === '0000') { | ||||||
|           this.backImgBase = res.repData.originalImageBase64 |           this.backImgBase = res.repData.originalImageBase64 | ||||||
|           this.blockBackImgBase = res.repData.jigsawImageBase64 |           this.blockBackImgBase = res.repData.jigsawImageBase64 | ||||||
|   | |||||||
| @@ -78,6 +78,7 @@ export default { | |||||||
| 			return this.http(this.infoUrl == '' ? this.infoPath : this.infoUrl, 'get', payload); | 			return this.http(this.infoUrl == '' ? this.infoPath : this.infoUrl, 'get', payload); | ||||||
| 		}, | 		}, | ||||||
| 		del(payload) { | 		del(payload) { | ||||||
|  | 			debugger; | ||||||
| 			return this.http(this.deleteUrl == '' ? this.deletePath : this.deleteUrl, 'delete', payload); | 			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", |       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) { |   prompt(content) { | ||||||
|     return MessageBox.prompt(content, "系统提示", { |     return MessageBox.prompt(content, "系统提示", { | ||||||
|   | |||||||
| @@ -104,7 +104,7 @@ export const constantRoutes = [ | |||||||
|     // this generates a separate chunk (about.[hash].js) for this route |     // this generates a separate chunk (about.[hash].js) for this route | ||||||
|     // which is lazy-loaded when the route is visited. |     // which is lazy-loaded when the route is visited. | ||||||
|     component: () => import(/* webpackChunkName: "about" */ '@/views/OperationalOverview/coldBoard.vue') |     component: () => import(/* webpackChunkName: "about" */ '@/views/OperationalOverview/coldBoard.vue') | ||||||
|   }, |   },  | ||||||
|      { |      { | ||||||
|     path: '/processingBoard', |     path: '/processingBoard', | ||||||
|     name: 'processingBoard', |     name: 'processingBoard', | ||||||
|   | |||||||
| @@ -200,35 +200,4 @@ input, textarea{ | |||||||
| // 弹出框,上下分布,去掉label的padding-bottom | // 弹出框,上下分布,去掉label的padding-bottom | ||||||
| .el-form--label-top .el-form-item__label { | .el-form--label-top .el-form-item__label { | ||||||
|   padding: 0; |   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 |  * @Author: zwq | ||||||
|  * @Date: 2021-11-18 14:16:25 |  * @Date: 2021-11-18 14:16:25 | ||||||
|  * @LastEditors: DY |  * @LastEditors: DY | ||||||
|  * @LastEditTime: 2024-07-19 18:59:13 |  * @LastEditTime: 2023-11-16 09:14:35 | ||||||
|  * @Description: |  * @Description: | ||||||
| --> | --> | ||||||
| <template> | <template> | ||||||
| @@ -105,7 +105,7 @@ | |||||||
| <script> | <script> | ||||||
| import basicAdd from '../../core/mixins/basic-add'; | import basicAdd from '../../core/mixins/basic-add'; | ||||||
| import { getConOrderList, createConCoreWOr, getCoreWO } from '@/api/base/coreWorkOrder'; | 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 { parseTime } from '../../core/mixins/code-filter'; | ||||||
| // import attrAdd from './attr-add'; | // 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 |  * @Author: zwq | ||||||
|  * @Date: 2021-11-18 14:16:25 |  * @Date: 2021-11-18 14:16:25 | ||||||
|  * @LastEditors: zwq |  * @LastEditors: DY | ||||||
|  * @LastEditTime: 2024-07-09 09:59:11 |  * @LastEditTime: 2023-11-27 19:50:36 | ||||||
|  * @Description: |  * @Description: | ||||||
| --> | --> | ||||||
| <template> | <template> | ||||||
| @@ -107,9 +107,10 @@ | |||||||
| 
 | 
 | ||||||
| <script> | <script> | ||||||
| import basicAdd from '../../core/mixins/basic-add'; | import basicAdd from '../../core/mixins/basic-add'; | ||||||
| import { createMaterialPB, updateMaterialPB, getMaterialPB, getCode, getProBomList, createMaterialPBDet, updateMaterialPBDet, deleteMaterialPBDet } from "@/api/base/materialProductBom"; | import { createMaterialPB, updateMaterialPB, getMaterialPB, getCode, getProList, getProBomList, createMaterialPBDet, updateMaterialPBDet, deleteMaterialPBDet } from "@/api/base/materialProductBom"; | ||||||
| import { getMaterialTree,getMaterialList } from '@/api/base/material'; | import { getMaterialList } from "@/api/base/material"; | ||||||
| import SmallTitle from '../coreWorkOrder/SmallTitle'; | import { listData } from "@/api/system/dict/data"; | ||||||
|  | import SmallTitle from '../material/SmallTitle'; | ||||||
| import { parseTime } from '../../core/mixins/code-filter'; | import { parseTime } from '../../core/mixins/code-filter'; | ||||||
| import attrAdd from './attr-add'; | import attrAdd from './attr-add'; | ||||||
| import { publicFormatter } from '@/utils/dict'; | import { publicFormatter } from '@/utils/dict'; | ||||||
| @@ -182,6 +183,7 @@ export default { | |||||||
| 			productList: [], | 			productList: [], | ||||||
| 			materialAttrList: [], | 			materialAttrList: [], | ||||||
| 			tableData: [], | 			tableData: [], | ||||||
|  | 			unitList: [], | ||||||
| 			visible: false, | 			visible: false, | ||||||
| 			isdetail: false, | 			isdetail: false, | ||||||
| 			idAttrShow: false, | 			idAttrShow: false, | ||||||
| @@ -211,7 +213,7 @@ export default { | |||||||
|         if (this.dataForm.id) { |         if (this.dataForm.id) { | ||||||
|           this.urlOptions.updateURL(this.dataForm).then(response => { |           this.urlOptions.updateURL(this.dataForm).then(response => { | ||||||
|             this.$modal.msgSuccess("修改成功"); |             this.$modal.msgSuccess("修改成功"); | ||||||
|             this.visible = false; |             this.visible = false;  | ||||||
|             this.$emit("refreshDataList"); |             this.$emit("refreshDataList"); | ||||||
|           }); |           }); | ||||||
|           return; |           return; | ||||||
| @@ -227,14 +229,21 @@ export default { | |||||||
|       }); |       }); | ||||||
|     }, |     }, | ||||||
| 		async getDict() { | 		async getDict() { | ||||||
| 			const materRes = await getMaterialTree(); | 			// 产品列表 | ||||||
|       let typeId = materRes.data[0].product?materRes.data[0].id:materRes.data[1].id | 			const proRes = await getProList(); | ||||||
|       const listQuery= { | 			this.productList = proRes.data; | ||||||
|         typeId:typeId | 			// 物料单位列表 | ||||||
|       } | 			const unitRes = await listData({ | ||||||
| 			const materData = await getMaterialList(listQuery); | 				pageNo: 1, | ||||||
| 			this.productList = []; |         pageSize: 99, | ||||||
| 			this.productList = materData.data; |         dictType: 'unit_dict', | ||||||
|  | 			}); | ||||||
|  | 			this.unitList = unitRes.data.list.map(item => { | ||||||
|  | 				return { | ||||||
|  | 					label: item.label, | ||||||
|  | 					value: Number(item.value) | ||||||
|  | 				} | ||||||
|  | 			}); | ||||||
| 		}, | 		}, | ||||||
| 		initData() { | 		initData() { | ||||||
| 			// this.materialAttrList.splice(0); | 			// this.materialAttrList.splice(0); | ||||||
| @@ -83,7 +83,7 @@ | |||||||
| </template> | </template> | ||||||
| 
 | 
 | ||||||
| <script> | <script> | ||||||
| import { getMaterialTree,getMaterialList } from '@/api/base/material'; | import { getMaterialList } from '@/api/base/material'; | ||||||
| import { createMaterialPBDet, updateMaterialPBDet, getMaterialPBDet } from "@/api/base/materialProductBom"; | import { createMaterialPBDet, updateMaterialPBDet, getMaterialPBDet } from "@/api/base/materialProductBom"; | ||||||
| 
 | 
 | ||||||
| export default { | export default { | ||||||
| @@ -117,14 +117,8 @@ export default { | |||||||
| 	methods: { | 	methods: { | ||||||
| 		async getDict() { | 		async getDict() { | ||||||
| 			// 物料列表 | 			// 物料列表 | ||||||
| 			const materRes = await getMaterialTree(); | 			const res = await getMaterialList(); | ||||||
|       let typeId = materRes.data[0].product?materRes.data[1].id:materRes.data[0].id | 			this.materialList = res.data; | ||||||
|       const listQuery= { |  | ||||||
|         typeId:typeId |  | ||||||
|       } |  | ||||||
| 			const materData = await getMaterialList(listQuery); |  | ||||||
| 			this.materialList = []; |  | ||||||
| 			this.materialList = materData.data; |  | ||||||
| 		}, | 		}, | ||||||
| 		init(id) { | 		init(id) { | ||||||
| 			this.dataForm.id = id || ''; | 			this.dataForm.id = id || ''; | ||||||
| @@ -1,8 +1,8 @@ | |||||||
| <!-- | <!-- | ||||||
|  * @Author: zwq |  * @Author: zwq | ||||||
|  * @Date: 2021-11-18 14:16:25 |  * @Date: 2021-11-18 14:16:25 | ||||||
|  * @LastEditors: zwq |  * @LastEditors: DY | ||||||
|  * @LastEditTime: 2024-07-09 09:58:24 |  * @LastEditTime: 2023-11-27 19:57:23 | ||||||
|  * @Description: |  * @Description: | ||||||
| --> | --> | ||||||
| <template> | <template> | ||||||
| @@ -22,7 +22,8 @@ | |||||||
| 						clearable | 						clearable | ||||||
| 						filterable | 						filterable | ||||||
| 						@change="setCode" | 						@change="setCode" | ||||||
| 						style="width: 100%"> | 						style="width: 100%" | ||||||
|  | 					> | ||||||
| 						<el-option | 						<el-option | ||||||
| 							v-for="dict in materialList" | 							v-for="dict in materialList" | ||||||
| 							:key="dict.id" | 							:key="dict.id" | ||||||
| @@ -41,13 +42,14 @@ | |||||||
| 				</el-form-item> | 				</el-form-item> | ||||||
| 			</el-col> | 			</el-col> | ||||||
| 			<el-col :span="8"> | 			<el-col :span="8"> | ||||||
| 				<el-form-item label="物料批次" prop="materialDateId"> | 				<el-form-item label="批次号" prop="materialDateId"> | ||||||
| 					<el-select | 					<el-select | ||||||
| 						v-model="dataForm.materialDateId" | 						v-model="dataForm.materialDateId" | ||||||
| 						clearable | 						clearable | ||||||
| 						filterable | 						filterable | ||||||
| 						placeholder="请选择物料批次" | 						placeholder="请选择物料批次" | ||||||
| 						style="width: 100%"> | 						style="width: 100%" | ||||||
|  | 					> | ||||||
| 						<el-option | 						<el-option | ||||||
| 							v-for="dict in materialDateList" | 							v-for="dict in materialDateList" | ||||||
| 							:key="dict.id" | 							:key="dict.id" | ||||||
| @@ -79,8 +81,8 @@ | |||||||
| 					<el-date-picker | 					<el-date-picker | ||||||
| 						v-model="dataForm.useTime" | 						v-model="dataForm.useTime" | ||||||
| 						type="datetime" | 						type="datetime" | ||||||
| 						format="yyyy-MM-dd HH:mm:ss" | 						format='yyyy-MM-dd HH:mm:ss' | ||||||
| 						value-format="timestamp" |          		value-format='timestamp' | ||||||
| 						placeholder="选择日期时间" /> | 						placeholder="选择日期时间" /> | ||||||
| 				</el-form-item> | 				</el-form-item> | ||||||
| 			</el-col> | 			</el-col> | ||||||
| @@ -96,8 +98,8 @@ | |||||||
| 						<el-option | 						<el-option | ||||||
| 							v-for="dict in workersList" | 							v-for="dict in workersList" | ||||||
| 							:key="dict.id" | 							:key="dict.id" | ||||||
| 							:label="dict.nickname" | 							:label="dict.name" | ||||||
| 							:value="dict.nickname" /> | 							:value="dict.name" /> | ||||||
| 					</el-select> | 					</el-select> | ||||||
| 				</el-form-item> | 				</el-form-item> | ||||||
| 			</el-col> | 			</el-col> | ||||||
| @@ -105,12 +107,7 @@ | |||||||
| 		<el-row :gutter="20"> | 		<el-row :gutter="20"> | ||||||
| 			<el-col :span="8"> | 			<el-col :span="8"> | ||||||
| 				<el-form-item label="使用数量" prop="num"> | 				<el-form-item label="使用数量" prop="num"> | ||||||
| 					<el-input-number | 					<el-input-number v-model="dataForm.num" clearable controls-position="right" placeholder="请输入使用数量" style="width: 100%" /> | ||||||
| 						v-model="dataForm.num" |  | ||||||
| 						clearable |  | ||||||
| 						controls-position="right" |  | ||||||
| 						placeholder="请输入使用数量" |  | ||||||
| 						style="width: 100%" /> |  | ||||||
| 				</el-form-item> | 				</el-form-item> | ||||||
| 			</el-col> | 			</el-col> | ||||||
| 			<el-col :span="8"> | 			<el-col :span="8"> | ||||||
| @@ -129,10 +126,7 @@ | |||||||
| 			</el-col> | 			</el-col> | ||||||
| 			<el-col :span="8"> | 			<el-col :span="8"> | ||||||
| 				<el-form-item label="备注" prop="remark"> | 				<el-form-item label="备注" prop="remark"> | ||||||
| 					<el-input | 					<el-input v-model="dataForm.remark" clearable placeholder="请输入备注" /> | ||||||
| 						v-model="dataForm.remark" |  | ||||||
| 						clearable |  | ||||||
| 						placeholder="请输入备注" /> |  | ||||||
| 				</el-form-item> | 				</el-form-item> | ||||||
| 			</el-col> | 			</el-col> | ||||||
| 		</el-row> | 		</el-row> | ||||||
| @@ -141,15 +135,9 @@ | |||||||
| 
 | 
 | ||||||
| <script> | <script> | ||||||
| import basicAdd from '../../core/mixins/basic-add'; | import basicAdd from '../../core/mixins/basic-add'; | ||||||
| import { | import { createMaterialLog, updateMaterialLog, getMaterialLog, getEqListAll, getworkerAll } from "@/api/base/materialUseLog"; | ||||||
| 	createMaterialLog, | import { getMaterialList } from "@/api/base/material" | ||||||
| 	updateMaterialLog, | import { getMaterDateList } from "@/api/base/materialDate" | ||||||
| 	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'; |  | ||||||
| 
 | 
 | ||||||
| export default { | export default { | ||||||
| 	mixins: [basicAdd], | 	mixins: [basicAdd], | ||||||
| @@ -158,127 +146,115 @@ export default { | |||||||
| 			urlOptions: { | 			urlOptions: { | ||||||
| 				createURL: createMaterialLog, | 				createURL: createMaterialLog, | ||||||
| 				updateURL: updateMaterialLog, | 				updateURL: updateMaterialLog, | ||||||
| 				infoURL: getMaterialLog, | 				infoURL: getMaterialLog | ||||||
| 			}, | 			}, | ||||||
| 			dataForm: { | 			dataForm: { | ||||||
| 				id: undefined, |         id: undefined, | ||||||
| 				materialId: undefined, | 				materialId: undefined, | ||||||
| 				materialCode: undefined, |         materialCode: undefined, | ||||||
| 				materialDateId: undefined, | 				materialDateId: undefined, | ||||||
| 				equipmentId: undefined, | 				equipmentId: undefined, | ||||||
| 				userName: undefined, |         userName: undefined, | ||||||
| 				userNames: [], | 				userNames: [], | ||||||
| 				useTime: new Date().getTime(), | 				useTime: new Date().getTime(), | ||||||
| 				address: undefined, |         address: undefined, | ||||||
| 				num: 0, | 				num: 0, | ||||||
| 				source: undefined, | 				source: undefined, | ||||||
| 				remark: undefined, |         remark: undefined | ||||||
| 			}, | 			}, | ||||||
| 			dataSourceList: [ | 			dataSourceList: [ | ||||||
| 				{ | 				{ | ||||||
| 					id: 1, | 					id: 1, | ||||||
| 					name: '手动', | 					name: '手动' | ||||||
| 				}, | 				}, | ||||||
| 				{ | 				{ | ||||||
| 					id: 2, | 					id: 2, | ||||||
| 					name: 'PDA', | 					name: 'PDA' | ||||||
| 				}, | 				} | ||||||
| 			], | 			], | ||||||
| 			materialList: [], | 			materialList: [], | ||||||
| 			materialDateList: [], | 			materialDateList: [], | ||||||
| 			eqList: [], | 			eqList: [], | ||||||
| 			workersList: [], | 			workersList: [], | ||||||
| 			dataRule: { | 			dataRule: { | ||||||
| 				materialId: [ |         materialId: [{ required: true, message: "物料不能为空", trigger: "blur" }], | ||||||
| 					{ required: true, message: '物料不能为空', trigger: 'blur' }, |         materialDateId: [{ required: true, message: "批次号不能为空", trigger: "blur" }], | ||||||
| 				], | 				useTime: [{ required: true, message: "使用时间不能为空", trigger: "blur" }], | ||||||
| 				useTime: [ | 				userNames: [{ required: true, message: "操作员不能为空", trigger: "blur" }], | ||||||
| 					{ required: true, message: '使用时间不能为空', trigger: 'blur' }, | 				num: [{ required: true, message: "使用数量不能为空", trigger: "blur" }] | ||||||
| 				], |       } | ||||||
| 				userNames: [ |  | ||||||
| 					{ required: true, message: '操作员不能为空', trigger: 'blur' }, |  | ||||||
| 				], |  | ||||||
| 				num: [{ required: true, message: '使用数量不能为空', trigger: 'blur' }], |  | ||||||
| 			}, |  | ||||||
| 		}; | 		}; | ||||||
| 	}, | 	}, | ||||||
| 	mounted() { | 	mounted() { | ||||||
| 		this.getDictData(); | 		this.getDictData() | ||||||
| 	}, | 	}, | ||||||
| 	methods: { | 	methods: { | ||||||
| 		async getDictData() { | 		async getDictData() { | ||||||
| 			const materRes = await getMaterialTree(); | 			const materRes = await getMaterialList() | ||||||
|       let typeId = materRes.data[0].product?materRes.data[1].id:materRes.data[0].id | 			this.materialList = materRes.data | ||||||
|       const listQuery= { | 			const dateRes = await getMaterDateList() | ||||||
|         typeId:typeId | 			this.materialDateList = dateRes.data | ||||||
|       } | 			const eqRes = await getEqListAll() | ||||||
| 			const materData = await getMaterialList(listQuery); | 			this.eqList = eqRes.data | ||||||
| 			this.materialList = []; | 			const workerRes = await getworkerAll() | ||||||
| 			this.materialList = materData.data; | 			this.workersList = workerRes.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; |  | ||||||
| 		}, | 		}, | ||||||
| 		// 表单提交 | 		// 表单提交 | ||||||
| 		dataFormSubmit() { |     dataFormSubmit() { | ||||||
| 			this.dataForm.userName = this.dataForm.userNames.join(','); | 			this.dataForm.userName = this.dataForm.userNames.join(',') | ||||||
| 			this.$refs['dataForm'].validate((valid) => { |       this.$refs["dataForm"].validate((valid) => { | ||||||
| 				if (!valid) { |         if (!valid) { | ||||||
| 					return false; |           return false; | ||||||
| 				} |         } | ||||||
| 				// 修改的提交 |         // 修改的提交 | ||||||
| 				if (this.dataForm.id) { |         if (this.dataForm.id) { | ||||||
| 					this.urlOptions.updateURL(this.dataForm).then((response) => { |           this.urlOptions.updateURL(this.dataForm).then(response => { | ||||||
| 						this.$modal.msgSuccess('修改成功'); |             this.$modal.msgSuccess("修改成功"); | ||||||
| 						this.visible = false; |             this.visible = false; | ||||||
| 						this.$emit('refreshDataList'); |             this.$emit("refreshDataList"); | ||||||
| 					}); |           }); | ||||||
| 					return; |           return; | ||||||
| 				} |         } | ||||||
| 				// 添加的提交 |         // 添加的提交 | ||||||
| 				this.urlOptions.createURL(this.dataForm).then((response) => { |         this.urlOptions.createURL(this.dataForm).then(response => { | ||||||
| 					this.$modal.msgSuccess('新增成功'); |           this.$modal.msgSuccess("新增成功"); | ||||||
| 					this.visible = false; |           this.visible = false; | ||||||
| 					this.$emit('refreshDataList'); |           this.$emit("refreshDataList"); | ||||||
| 				}); |         }); | ||||||
| 			}); |       }); | ||||||
| 		}, |     }, | ||||||
| 		init(id) { | 		init(id) { | ||||||
| 			this.dataForm.id = id || undefined; |       this.dataForm.id = id || undefined; | ||||||
| 			this.visible = true; |       this.visible = true; | ||||||
| 
 | 
 | ||||||
| 			this.$nextTick(() => { |       this.$nextTick(() => { | ||||||
| 				this.$refs['dataForm'].resetFields(); |         this.$refs["dataForm"].resetFields(); | ||||||
| 				if (this.dataForm.id) { |         if (this.dataForm.id) { | ||||||
| 					this.urlOptions.infoURL(id).then((response) => { |           this.urlOptions.infoURL(id).then(response => { | ||||||
| 						this.dataForm.id = response.data.id; |             this.dataForm.id = response.data.id | ||||||
| 						this.dataForm.materialCode = response.data.materialCode; | 						this.dataForm.materialCode = response.data.materialCode | ||||||
| 						this.dataForm.materialId = response.data.materialId; | 						this.dataForm.materialId = response.data.materialId | ||||||
| 						this.dataForm.materialDateId = response.data.materialDateId; | 						this.dataForm.materialDateId = response.data.materialDateId | ||||||
| 						this.dataForm.equipmentId = response.data.equipmentId; | 						this.dataForm.equipmentId = response.data.equipmentId | ||||||
| 						this.dataForm.useTime = response.data.useTime; | 						this.dataForm.useTime = response.data.useTime | ||||||
| 						// this.dataForm.userName = response.data.userName | 						// this.dataForm.userName = response.data.userName | ||||||
| 						this.dataForm.num = response.data.num; | 						this.dataForm.num = response.data.num | ||||||
| 						this.dataForm.source = response.data.source; | 						this.dataForm.source = response.data.source | ||||||
| 						this.dataForm.remark = response.data.remark; | 						this.dataForm.remark = response.data.remark | ||||||
| 						this.dataForm.userNames = response.data.userName.split(','); | 						this.dataForm.userNames = response.data.userName.split(',') | ||||||
| 					}); |           }); | ||||||
| 				} else { |         } else {} | ||||||
| 				} |       }); | ||||||
| 			}); |     }, | ||||||
| 		}, |  | ||||||
| 		setCode() { | 		setCode() { | ||||||
| 			const tempMaterial = this.materialList.filter((item) => { | 			const tempMaterial = this.materialList.filter(item =>{ | ||||||
| 				return item.id === this.dataForm.materialId; | 				return item.id === this.dataForm.materialId | ||||||
| 			}); | 			}) | ||||||
| 			this.dataForm.materialCode = tempMaterial[0].code; | 			this.dataForm.materialCode = tempMaterial[0].code | ||||||
| 			getMaterDateList({ materialId: this.dataForm.materialId }).then((res) => { | 			getMaterDateList({materialId: this.dataForm.materialId}).then(res =>{ | ||||||
| 				this.materialDateList = res.data; | 				this.materialDateList = res.data | ||||||
| 			}); | 			}) | ||||||
| 		}, | 		} | ||||||
| 	}, | 	}, | ||||||
| }; | }; | ||||||
| </script> | </script> | ||||||
| @@ -1,8 +1,8 @@ | |||||||
| /* | /* | ||||||
|  * @Author: zwq |  * @Author: zwq | ||||||
|  * @Date: 2022-08-24 11:19:43 |  * @Date: 2022-08-24 11:19:43 | ||||||
|  * @LastEditors: zwq |  * @LastEditors: zhp | ||||||
|  * @LastEditTime: 2024-07-05 10:10:12 |  * @LastEditTime: 2023-11-24 09:29:36 | ||||||
|  * @Description: |  * @Description: | ||||||
|  */ |  */ | ||||||
| export default { | export default { | ||||||
| @@ -53,12 +53,11 @@ export default { | |||||||
|       this.listQuery.pageNo = val; |       this.listQuery.pageNo = val; | ||||||
|       this.getDataList(); |       this.getDataList(); | ||||||
|     }, |     }, | ||||||
|     // 新增
 |     // 新增 / 修改
 | ||||||
|     addOrUpdateHandle() { |     addOrUpdateHandle(id) { | ||||||
|       this.addOrEditTitle = '新增'; |  | ||||||
|       this.addOrUpdateVisible = true; |       this.addOrUpdateVisible = true; | ||||||
|       this.$nextTick(() => { |       this.$nextTick(() => { | ||||||
|         this.$refs.addOrUpdate.init(); |         this.$refs.addOrUpdate.init(id); | ||||||
|       }); |       }); | ||||||
|     }, |     }, | ||||||
|     cancel(id) { |     cancel(id) { | ||||||
| @@ -1,8 +1,8 @@ | |||||||
| 
 | 
 | ||||||
| /* | /* | ||||||
|  * @Date: 2020-12-29 16:49:28 |  * @Date: 2020-12-29 16:49:28 | ||||||
|  * @LastEditors: zwq |  * @LastEditors: DY | ||||||
|  * @LastEditTime: 2024-07-08 16:27:39 |  * @LastEditTime: 2023-09-12 11:13:34 | ||||||
|  * @FilePath: \basic-admin\src\filters\basicData\index.js |  * @FilePath: \basic-admin\src\filters\basicData\index.js | ||||||
|  * @Description: |  * @Description: | ||||||
|  */ |  */ | ||||||
| @@ -33,7 +33,7 @@ export function parseTime(time, pattern) { | |||||||
|     if ((typeof time === 'string') && (/^[0-9]+$/.test(time))) { |     if ((typeof time === 'string') && (/^[0-9]+$/.test(time))) { | ||||||
|       time = parseInt(time) |       time = parseInt(time) | ||||||
|     } else if (typeof time === 'string') { |     } 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)) { |     if ((typeof time === 'number') && (time.toString().length === 10)) { | ||||||
|       time = time * 1000 |       time = time * 1000 | ||||||
| @@ -62,22 +62,6 @@ export function parseTime(time, pattern) { | |||||||
|   }) |   }) | ||||||
|   return time_str |   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) { | export default function (dictTable) { | ||||||
|   return function (val) { |   return function (val) { | ||||||
|     return table?.[dictTable]?.[val] |     return table?.[dictTable]?.[val] | ||||||
| @@ -1,350 +1,324 @@ | |||||||
| <template> | <template> | ||||||
| 	<div class="choicepart-container"> |   <div class="choicepart-container"> | ||||||
| 		<navbar /> |     <navbar /> | ||||||
| 		<div class="choicepart-wrapper"> |     <div class="choicepart-wrapper"> | ||||||
| 			<div |       <div class="choicepart-box" id="choicepartBox" :style="'transform:scale('+scale+');width:1574px;height:538px;'" v-show="showItem"> | ||||||
| 				class="choicepart-box" |       <div class="choicepart-line1"> | ||||||
| 				id="choicepartBox" |         <div | ||||||
| 				:style="'transform:scale(' + scale + ');width:1574px;height:538px;'" |           v-for="(item, index) in menuArr1" | ||||||
| 				v-show="showItem"> |           :key="index" | ||||||
| 				<div class="choicepart-line1"> |           class="choicepart-item" | ||||||
| 					<div |           @click="handelClick(item, item.choicepart)" | ||||||
| 						v-for="(item, index) in menuArr1" |           :style="{opacity: item.visible?1:0.4, pointerEvents:item.visible?'auto':'none'}" | ||||||
| 						:key="index" |         > | ||||||
| 						class="choicepart-item" |           <div> | ||||||
| 						@click="handelClick(item, item.choicepart)" |             <img :src="require(`../../assets/images/choicepart/${item.name}.png`)" alt=""> | ||||||
| 						:style="{ |           </div> | ||||||
| 							opacity: item.visible ? 1 : 0.4, |           <div class="choicepart-item-title">{{item.meta.title}}</div> | ||||||
| 							pointerEvents: item.visible ? 'auto' : 'none', |         </div> | ||||||
| 						}"> |       </div> | ||||||
| 						<div> |       <div class="choicepart-line2"> | ||||||
| 							<img |         <div | ||||||
| 								:src=" |           v-for="(item, index) in menuArr2" | ||||||
| 									require(`../../assets/images/choicepart/${item.name}.png`) |           :key="index" | ||||||
| 								" |           class="choicepart-item" | ||||||
| 								alt="" /> |           @click="handelClick(item, item.choicepart)" | ||||||
| 						</div> |           :style="{opacity: item.visible?1:0.4, pointerEvents:item.visible?'auto':'none'}" | ||||||
| 						<div class="choicepart-item-title">{{ item.meta.title }}</div> |         > | ||||||
| 					</div> |           <div> | ||||||
| 				</div> |             <img :src="require(`../../assets/images/choicepart/${item.name}.png`)" alt=""> | ||||||
| 				<div class="choicepart-line2"> |           </div> | ||||||
| 					<div |           <div class="choicepart-item-title">{{item.meta.title}}</div> | ||||||
| 						v-for="(item, index) in menuArr2" |         </div> | ||||||
| 						:key="index" |       </div> | ||||||
| 						class="choicepart-item" |     </div> | ||||||
| 						@click="handelClick(item, item.choicepart)" |     </div> | ||||||
| 						:style="{ |     <div class="choicepart-footer">© 中建材智能自动化研究院有限公司</div> | ||||||
| 							opacity: item.visible ? 1 : 0.4, |   </div> | ||||||
| 							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> | </template> | ||||||
| <script> | <script> | ||||||
| import Navbar from './components/Navbar'; | import Navbar from './components/Navbar' | ||||||
| import { debounce } from '@/utils/debounce'; | import { debounce } from '@/utils/debounce' | ||||||
| export default { | export default { | ||||||
| 	components: { Navbar }, |   components: { Navbar }, | ||||||
| 	name: 'choicePart', |   name: 'choicePart', | ||||||
| 	data() { |   data() { | ||||||
| 		return { |     return { | ||||||
| 			boxReset: '', |       boxReset: '', | ||||||
| 			scale: 1, |       scale: 1, | ||||||
| 			menuArr1: [ |       menuArr1: [ | ||||||
| 				{ |         { | ||||||
| 					name: 'Core', |           name: 'Core', | ||||||
| 					title: '基础核心', |           title: '基础核心', | ||||||
| 					visible: false, |           visible: false, | ||||||
| 					meta: { |           meta: { | ||||||
| 						title: '', |             title: '' | ||||||
| 					}, |           } | ||||||
| 				}, |         }, | ||||||
| 				{ |         { | ||||||
| 					name: 'Produce', |           name: 'Order', | ||||||
| 					title: '生产管理', |           title: '订单管理', | ||||||
| 					visible: false, |           visible: false, | ||||||
| 					meta: { |           meta: { | ||||||
| 						title: '', |             title: '' | ||||||
| 					}, |           } | ||||||
| 				}, |         }, | ||||||
| 				{ |         { | ||||||
| 					name: 'Equipment', |           name: 'Equipment', | ||||||
| 					title: '设备管理', |           title: '设备管理', | ||||||
| 					visible: false, |           visible: false, | ||||||
| 					meta: { |           meta: { | ||||||
| 						title: '', |             title: '' | ||||||
| 					}, |           } | ||||||
| 				}, |         }, | ||||||
| 				{ |         { | ||||||
| 					name: 'Group', |           name: 'Group', | ||||||
| 					title: '班组管理', |           title: '班组管理', | ||||||
| 					visible: false, |           visible: false, | ||||||
| 					meta: { |           meta: { | ||||||
| 						title: '', |             title: '' | ||||||
| 					}, |           } | ||||||
| 				}, |         }, | ||||||
| 				{ |         { | ||||||
| 					name: 'Quality', |           name: 'Quality', | ||||||
| 					title: '质量管理', |           title: '质量管理', | ||||||
| 					visible: false, |           visible: false, | ||||||
| 					meta: { |           meta: { | ||||||
| 						title: '', |             title: '' | ||||||
| 					}, |           } | ||||||
| 				}, |         }, | ||||||
| 				{ |         { | ||||||
| 					name: 'Warehouse', |           name: 'Warehouse', | ||||||
| 					title: '仓库管理', |           title: '仓库管理', | ||||||
| 					visible: false, |           visible: false, | ||||||
| 					meta: { |           meta: { | ||||||
| 						title: '', |             title: '' | ||||||
| 					}, |           } | ||||||
| 				}, |         }, | ||||||
| 				{ |         { | ||||||
| 					name: 'Energy', |           name: 'Energy', | ||||||
| 					title: '能源管理', |           title: '能源管理', | ||||||
| 					visible: false, |           visible: false, | ||||||
| 					meta: { |           meta: { | ||||||
| 						title: '', |             title: '' | ||||||
| 					}, |           } | ||||||
| 				}, |         } | ||||||
| 			], |       ], | ||||||
| 			menuArr2: [ |       menuArr2: [ | ||||||
| 				{ |         { | ||||||
| 					name: 'Packaging', |           name: 'Packaging', | ||||||
| 					title: '包装管理', |           title: '包装管理', | ||||||
| 					visible: false, |           visible: false, | ||||||
| 					meta: { |           meta: { | ||||||
| 						title: '', |             title: '' | ||||||
| 					}, |           } | ||||||
| 				}, |         }, | ||||||
| 				{ |         { | ||||||
| 					name: 'Material', |           name: 'Material', | ||||||
| 					title: '物料管理', |           title: '物料管理', | ||||||
| 					visible: false, |           visible: false, | ||||||
| 					meta: { |           meta: { | ||||||
| 						title: '', |             title: '' | ||||||
| 					}, |           } | ||||||
| 				}, |         }, | ||||||
| 				{ |         { | ||||||
| 					name: 'Extend', |           name: 'Extend', | ||||||
| 					title: '工艺管理', |           title: '工艺管理', | ||||||
| 					visible: false, |           visible: false, | ||||||
| 					meta: { |           meta: { | ||||||
| 						title: '', |             title: '' | ||||||
| 					}, |           } | ||||||
| 				}, |         }, | ||||||
| 				{ |         { | ||||||
| 					name: 'Delivery', |           name: 'Delivery', | ||||||
| 					title: '成品发货', |           title: '成品发货', | ||||||
| 					visible: false, |           visible: false, | ||||||
| 					meta: { |           meta: { | ||||||
| 						title: '', |             title: '' | ||||||
| 					}, |           } | ||||||
| 				}, |         }, | ||||||
| 				{ |         { | ||||||
| 					name: 'Report', |           name: 'Report', | ||||||
| 					title: '报表管理', |           title: '报表管理', | ||||||
| 					visible: false, |           visible: false, | ||||||
| 					meta: { |           meta: { | ||||||
| 						title: '', |             title: '' | ||||||
| 					}, |           } | ||||||
| 				}, |         }, | ||||||
| 				{ |         { | ||||||
| 					name: 'System', |           name: 'System', | ||||||
| 					title: '系统管理', |           title: '系统管理', | ||||||
| 					visible: false, |           visible: false, | ||||||
| 					meta: { |           meta: { | ||||||
| 						title: '', |             title: '' | ||||||
| 					}, |           } | ||||||
| 				}, |         } | ||||||
| 				{ |       ], | ||||||
| 					name: 'Devconfig', |       showItem: false | ||||||
| 					title: '开发配置', |     } | ||||||
| 					visible: false, |   }, | ||||||
| 					meta: { |   // computed:{ | ||||||
| 						title: '', |   //   ...mapGetters(['sidebarRouters']) | ||||||
| 					}, |   // }, | ||||||
| 				}, |   mounted() { | ||||||
| 			], |     this.getMsg() | ||||||
| 			showItem: false, |     this.boxReset = debounce(() => { | ||||||
| 		}; |       this.resetSize() | ||||||
| 	}, |     }, 300) | ||||||
| 	// computed:{ |     this.boxReset() | ||||||
| 	//   ...mapGetters(['sidebarRouters']) |     window.addEventListener('resize', () => { | ||||||
| 	// }, |       this.boxReset() | ||||||
| 	mounted() { |     }) | ||||||
| 		this.getMsg(); |   }, | ||||||
| 		this.boxReset = debounce(() => { |   methods: { | ||||||
| 			this.resetSize(); |     getMsg() { | ||||||
| 		}, 300); |       let menuList = this.$store.state.permission.sidebarRouters | ||||||
| 		this.boxReset(); |       console.log(menuList) | ||||||
| 		window.addEventListener('resize', () => { |       if (menuList.length > 0) { | ||||||
| 			this.boxReset(); |         for (let i = 0; i < menuList.length; i ++) { | ||||||
| 		}); |           for (let k = 0; k < 7; k++) { | ||||||
| 	}, |             if (menuList[i].name === this.menuArr1[k].name) { | ||||||
| 	methods: { |               this.menuArr1[k].visible = true | ||||||
| 		getMsg() { |               this.menuArr1[k].id = menuList[i].id | ||||||
| 			let menuList = this.$store.state.permission.sidebarRouters; |               this.menuArr1[k].choicepart = i | ||||||
| 			console.log('sss', menuList); |               this.menuArr1[k].children = menuList[i].children | ||||||
| 			console.log(menuList); |               this.menuArr1[k].meta = menuList[i].meta | ||||||
| 			if (menuList.length > 0) { |             } | ||||||
| 				for (let i = 0; i < menuList.length; i++) { |           } | ||||||
| 					for (let k = 0; k < 7; k++) { |           for (let j = 0; j < 6; j++) { | ||||||
| 						if (menuList[i].name === this.menuArr1[k].name) { |             if (menuList[i].name === this.menuArr2[j].name) { | ||||||
| 							this.menuArr1[k].visible = true; |               this.menuArr2[j].visible = true | ||||||
| 							this.menuArr1[k].id = menuList[i].id; |               this.menuArr2[j].id = menuList[i].id | ||||||
| 							this.menuArr1[k].choicepart = i; |               this.menuArr2[j].choicepart = i | ||||||
| 							this.menuArr1[k].children = menuList[i].children; |               this.menuArr2[j].children = menuList[i].children | ||||||
| 							this.menuArr1[k].meta = menuList[i].meta; |               this.menuArr2[j].meta = menuList[i].meta | ||||||
| 						} |             } | ||||||
| 					} |           } | ||||||
| 					for (let j = 0; j < 7; j++) { |         } | ||||||
| 						if (menuList[i].name === this.menuArr2[j].name) { |       } | ||||||
| 							this.menuArr2[j].visible = true; |       console.log(this.menuArr1) | ||||||
| 							this.menuArr2[j].id = menuList[i].id; |       console.log(this.menuArr2) | ||||||
| 							this.menuArr2[j].choicepart = i; |     }, | ||||||
| 							this.menuArr2[j].children = menuList[i].children; |     handelClick(item, index) { | ||||||
| 							this.menuArr2[j].meta = menuList[i].meta; |       // this.$router.push({name: 'SystemUser'}) | ||||||
| 						} |       this.$store.dispatch('app/setChoicepart', index) | ||||||
| 					} |       this.toRouter(item) | ||||||
| 				} |       // if (item.meta.unuse) { | ||||||
| 			} |       //   this.$message.warning(this.$t('暂无数据')) | ||||||
| 			console.log(this.menuArr1); |       // } else { | ||||||
| 			console.log(this.menuArr2); |       //   this.toRouter(item) | ||||||
| 		}, |       // } | ||||||
| 		handelClick(item, index) { |     }, | ||||||
| 			// this.$router.push({name: 'SystemUser'}) |     toRouter(item) { | ||||||
| 			this.$store.dispatch('app/setChoicepart', index); |       console.log(item) | ||||||
| 			this.toRouter(item); |       if (item.children) { | ||||||
| 			// if (item.meta.unuse) { |         this.toRouter(item.children[0]) | ||||||
| 			//   this.$message.warning(this.$t('暂无数据')) |       } else { | ||||||
| 			// } else { |         this.$router.push({ name: item.name }) | ||||||
| 			//   this.toRouter(item) |       } | ||||||
| 			// } |     }, | ||||||
| 		}, |     resetSize() { | ||||||
| 		toRouter(item) { |       let _this = this | ||||||
| 			console.log(item); |       _this.showItem = false | ||||||
| 			if (item.children) { |       _this.loading = true | ||||||
| 				this.toRouter(item.children[0]); |       let choicepartBox = document.querySelector('#choicepartBox') | ||||||
| 			} else { |       let rw = parseFloat(window.innerWidth) | ||||||
| 				this.$router.push({ name: item.name }); |       let rh = parseFloat(window.innerHeight) | ||||||
| 			} |       let bw = parseFloat(choicepartBox.style.width) | ||||||
| 		}, |       let bh = parseFloat(choicepartBox.style.height) | ||||||
| 		resetSize() { |       let wx = 0.82/(bw / rw) | ||||||
| 			let _this = this; |       let hx = 0.56/(bh / rh) | ||||||
| 			_this.showItem = false; |       _this.scale = wx > hx ? hx : wx | ||||||
| 			_this.loading = true; |       setTimeout(_this.showItemFun, 700) | ||||||
| 			let choicepartBox = document.querySelector('#choicepartBox'); |     }, | ||||||
| 			let rw = parseFloat(window.innerWidth); |     showItemFun() { | ||||||
| 			let rh = parseFloat(window.innerHeight); |       this.loading = false | ||||||
| 			let bw = parseFloat(choicepartBox.style.width); |       this.showItem = true | ||||||
| 			let bh = parseFloat(choicepartBox.style.height); |     } | ||||||
| 			let wx = 0.82 / (bw / rw); |   }, | ||||||
| 			let hx = 0.56 / (bh / rh); |   beforeDestroy() { | ||||||
| 			_this.scale = wx > hx ? hx : wx; |     this.showItem = false | ||||||
| 			setTimeout(_this.showItemFun, 700); |   } | ||||||
| 		}, |  | ||||||
| 		showItemFun() { |  | ||||||
| 			this.loading = false; |  | ||||||
| 			this.showItem = true; |  | ||||||
| 		}, |  | ||||||
| 	}, |  | ||||||
| 	beforeDestroy() { |  | ||||||
| 		this.showItem = false; |  | ||||||
| 	}, |  | ||||||
| }; |  | ||||||
| </script> |  | ||||||
| <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; |  | ||||||
| 	} |  | ||||||
| } | } | ||||||
| </style> | </script> | ||||||
|  | <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; | ||||||
|  |   } | ||||||
|  | } | ||||||
|  | </style> | ||||||
| @@ -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> |  | ||||||
Some files were not shown because too many files have changed in this diff Show More
		Reference in New Issue
	
	Block a user