From b3507fb29a809482662ccfcb8195023ff1479d7a Mon Sep 17 00:00:00 2001 From: DouDou <877258667@qq.com> Date: Tue, 3 Sep 2024 17:44:52 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B7=A5=E5=85=B7=E7=9A=84=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/com_tool_info_add_update.vue | 126 +++++++++--------- src/views/modules/tooling/manuf_tool.vue | 17 +-- 2 files changed, 73 insertions(+), 70 deletions(-) diff --git a/src/views/modules/tooling/components/com_tool_info_add_update.vue b/src/views/modules/tooling/components/com_tool_info_add_update.vue index e941cef..1aeac9f 100644 --- a/src/views/modules/tooling/components/com_tool_info_add_update.vue +++ b/src/views/modules/tooling/components/com_tool_info_add_update.vue @@ -8,7 +8,7 @@ - + @@ -19,7 +19,7 @@ 域: - + @@ -49,7 +49,10 @@ - + + + + @@ -57,7 +60,12 @@ - + + + + + + @@ -71,8 +79,8 @@ - + @@ -100,7 +108,7 @@ - {{ buttons.confirmButton }} + {{ buttons.confirmButton }} {{buttons.closeButton}} @@ -130,7 +138,7 @@ export default { titleCon: '工具新增', showDefault: false, visible: false, - readonlyFlag: true, + addFlag: false, pageData: { site: this.$store.state.user.site, username: this.$store.state.user.name, @@ -139,17 +147,16 @@ export default { toolType: '', toolTypeDesc: '', calendarId: '', - schedCapacity: '', + schedCapacity: 'Infinite capacity', alternateToolId: '', alternateToolDesc: '', calibrationControl: '', - calibrationTime: '', - enabledForControlPlanDb: '', + calibrationTime: 0, + enabledForControlPlanDb: 'TRUE', lastUsed: '', noteText: '', ifsRowId: 0, ifsRowVersion: '', - addFlag: false }, dataListLoading: false, labels: { @@ -276,22 +283,21 @@ export default { this.pageData.toolId = ''; this.pageData.toolType = ''; this.pageData.toolDesc = ''; - this.pageData.toolType = ''; this.pageData.toolTypeDesc = ''; this.pageData.calendarId = ''; - this.pageData.schedCapacity = ''; + this.pageData.schedCapacity = 'Infinite capacity'; this.pageData.alternateToolId = ''; this.pageData.alternateToolDesc = ''; - this.pageData.calibrationControl = ''; - this.pageData.calibrationTime = ''; - this.pageData.enabledForControlPlanDb = ''; + this.pageData.calibrationControl = 'No Calibration Required'; + this.pageData.calibrationTime = 0; + this.pageData.enabledForControlPlanDb = 'FALSE'; this.pageData.lastUsed = ''; this.pageData.noteText = ''; }else{ this.titleCon = '工具修改'; this.pageData = JSON.parse(JSON.stringify(toolInfo)); } - this.pageData.addFlag = addFlag; + this.addFlag = addFlag; }, /*关闭modal*/ @@ -332,53 +338,49 @@ export default { } }, - - - - /*检查新的工具实例信息*/ - checkToolInstanceIdFun(){ - if(this.pageData.toolInstanceId == null || this.pageData.toolInstanceId == ''){ - this.$message.error(this.labels.pleaseScanToolInstanceId); + /*检查新的工信息*/ + saveToolInfoFun(){ + if(this.pageData.toolId == null || this.pageData.toolId == ''){ + this.$message.error('工具标识号不能为空!'); return false; } - checkToolInstanceId(this.pageData).then(({data}) => { - //判断是否存在异常 - if(data.code == 500){ - this.$message.error(data.msg); - }else if (data.resultMap.resultCode == 201){ - let msg = data.resultMap.resultMsg; - this.$confirm(msg, '提示', { - confirmButtonText: this.labels.confirmLabel, - cancelButtonText: this.labels.cancelLabel, - type: "warning" - }).then(() => { - this.pageData.checkFlag = true; - }).catch(() => { - this.pageData.checkFlag = false; - }); - }else{ - this.pageData.checkFlag = true; - } - }); - }, - - /*添加刀模记录*/ - addToolInstanceIdFun(){ - /*添加工具的实例*/ - addToolInstanceId(this.pageData).then(({data}) => { - if(data.code == 500){ - this.$message.error(data.msg); - }else{ - //清空数据再次准备 - this.pageData.toolInstanceId = ''; - this.pageData.oriToolInstanceId = ''; - this.pageData.consumeQty = ''; - this.pageData.oriConsumeQty = ''; - this.pageData.totalConsumeQty = ''; - } - }); + if(this.pageData.toolDesc == null || this.pageData.toolDesc == ''){ + this.$message.error('工具描述不能为空!'); + return false; + } + if(this.pageData.toolType == null || this.pageData.toolType == ''){ + this.$message.error('工具类型不能为空!'); + return false; + } + if(this.pageData.calendarId == null || this.pageData.calendarId == ''){ + this.$message.error('日历标识不能为空!'); + return false; + } + if(this.pageData.calibrationTime == null || this.pageData.calibrationTime === ''){ + this.$message.error('校准间隔时间不能为空!'); + return false; + } + //判断是否是新增 + if (this.addFlag){ + insertToolInfo(this.pageData).then(({data}) =>{ + if(data.code === 200){ + this.$message.success('操作成功!'); + this.closeDialog(); + }else{ + this.$message.error(data.msg); + } + }); + }else{ + modifyToolInfo(this.pageData).then(({data}) =>{ + if(data.code === 200){ + this.$message.success('操作成功!'); + this.closeDialog(); + }else{ + this.$message.error(data.msg); + } + }); + } }, - }, created() { // this.factoryList() diff --git a/src/views/modules/tooling/manuf_tool.vue b/src/views/modules/tooling/manuf_tool.vue index b25fe38..9fc85b1 100644 --- a/src/views/modules/tooling/manuf_tool.vue +++ b/src/views/modules/tooling/manuf_tool.vue @@ -47,8 +47,8 @@ fixed="right" label="操作"> { + this.$refs.toolInfoAddUpdate.init(toolInfo, false) + }); + }, //切换工具触发 changeData(row) { @@ -694,7 +700,6 @@ export default { this.searchData.pageSize = this.pageSize this.searchData.pageIndex = this.pageIndex getToolInfoList(this.searchData).then(({data}) => { - debugger; if (data.code == 200) { this.dataList = data.rows; this.totalPage = data.total; @@ -719,10 +724,6 @@ export default { if (this.activeName == 'detail') { this.getToolInstanceList(); } - if (this.activeName == 'down') { - this.getFileContentData(); - } - },