diff --git a/src/api/productManagement/workplan_v2.js b/src/api/productManagement/workplan_v2.js index 8970712..013c7d1 100644 --- a/src/api/productManagement/workplan_v2.js +++ b/src/api/productManagement/workplan_v2.js @@ -3,61 +3,61 @@ import { downFile } from '@/utils/request' // 导出函数,获取工作计划列表 export function getWorkplanList(query) { - return request({ - url: '/mes/pro/workplan_v2/list', - method: 'get', - params: query, - }) + return request({ + url: '/mes/pro/workplan_v2/list', + method: 'get', + params: query, + }) } // 导出函数,添加新的工作计划 export function addNewworkplan(data) { - return request({ - url: '/mes/pro/workplan_v2/addworkplan', - method: 'post', - data: data, - contextType: 'application/json', - }) + return request({ + url: '/mes/pro/workplan_v2/addworkplan', + method: 'post', + data: data, + contextType: 'application/json', + }) } // 导出函数,删除工作计划 export function deleteworkplan(id) { - return request({ - url: '/mes/pro/workplan_v2/deleteitem/' + id, - method: 'get', - }) + return request({ + url: '/mes/pro/workplan_v2/deleteitem/' + id, + method: 'get', + }) } // 导出函数,删除所有工作计划 export function deleteAllWorkplan(query) { - return request({ - url: '/mes/pro/workplan_v2/deleteAll', - method: 'get', - params: query, - - }) + return request({ + url: '/mes/pro/workplan_v2/deleteAll', + method: 'get', + params: query, + + }) } // 导出函数,更新工作计划 export function updateworkplan(data) { - return request({ - url: '/mes/pro/workplan_v2/updateworkplan', - method: 'post', - data: data, - contextType: 'application/json', - }) + return request({ + url: '/mes/pro/workplan_v2/updateworkplan', + method: 'post', + data: data, + contextType: 'application/json', + }) } // 导出函数,处理周汇总 export function handleWeekSummary(query) { - return request({ - url: '/mes/pro/workplan_v2/getWeekSummary', - method: 'get', - params: query, - }) + return request({ + url: '/mes/pro/workplan_v2/getWeekSummary', + method: 'get', + params: query, + }) } @@ -66,5 +66,15 @@ export function handleWeekSummary(query) { // 导出函数,下载工作计划 export async function dowmloadWorkplan(query) { - await downFile('/mes/pro/workplan_v2/downloadWorkplan', { ...query }) + await downFile('/mes/pro/workplan_v2/downloadWorkplan', { ...query }) +} + + +// 检查计划数据 +export function checkWorkPlan(data) { + return request({ + url: '/mes/pro/workplan_v2/checkWorkPlan', + method: 'post', + data: data, + }) } \ No newline at end of file diff --git a/src/views/productManagement/workorder2.vue b/src/views/productManagement/workorder2.vue index 301145b..46582da 100644 --- a/src/views/productManagement/workorder2.vue +++ b/src/views/productManagement/workorder2.vue @@ -30,6 +30,12 @@ 生成工单 + +
+ + {{item.text}}:{{checkNumOption[index]}} + +
当前首检工单: {{nowOrderRetainStr}} @@ -71,8 +77,8 @@
- - + + @@ -190,7 +196,7 @@ return { mqttClient: null, mqttClientId: emqxUtil.title + Math.random().toString(16).substring(2, 8), - sortable:null, + sortable: null, search: { year: new Date().getFullYear(), week: 1, @@ -255,11 +261,31 @@ rules: { finishedPartNumber: [{ required: true, message: '成品零件号不能为空', trigger: 'blur' }], }, + // 数据检查 + stateCheckOptions: [ + { state: 0, color: '#ffffff', text: '正常' }, + { state: 1, color: '#FA8072', text: '物料不存在' }, + { state: 2, color: '#EE82EE', text: '毛坯号异常' }, + { state: 3, color: '#FFC0CB', text: '颜色异常' }, + { state: 4, color: '#E6E6FA', text: '规格异常' }, + { state: 5, color: '#ffffd5', text: '物料不包含此描述' }, + ], + tableAllData: [], + // checkNumOption: [0, 0, 0, 0, 0, 0], } }, created() { this.initMqtt(); }, + computed: { + checkNumOption() { + let list = [0, 0, 0, 0, 0, 0]; + for (let item of this.tableAllData) { + list[item.state]++; + } + return list; + } + }, mounted() { this.getList() // this.drag() @@ -315,15 +341,15 @@ this.$nextTick(function () { this.workorder_table_data = newArray; const query = { - oldId:this.workorder_table_data[oldIndex].id, - oldSort:this.workorder_table_data[oldIndex].sort, - newId:this.workorder_table_data[newIndex].id, - newSort:this.workorder_table_data[newIndex].sort, + oldId: this.workorder_table_data[oldIndex].id, + oldSort: this.workorder_table_data[oldIndex].sort, + newId: this.workorder_table_data[newIndex].id, + newSort: this.workorder_table_data[newIndex].sort, } updateSort2(query).then((res) => { if (res.code == 200 && res.data > 0) { this.$notify.success('修改成功') - }else{ + } else { this.$notify.error('修改失败') } }) @@ -349,8 +375,17 @@ this.pagination.total = res.data.item2 } }) + let allQuery = query; + allQuery.pageNum = 1; + allQuery.pageSize = 1000; + getWorkoderList(allQuery).then((res) => { + if (res.code == 200) { + this.tableAllData = res.data.item1 + } + }) }, + //todo 导入生产工单 importworkorder() { this.upload.open = true @@ -587,7 +622,19 @@ this.workorderItem.previousNumber = 0; } }, - + // 更改单元格格式 + rowClassName(item) { + const row = item.row; + const options = this.stateCheckOptions; + for (let index in options) { + if (row.state === options[index].state) { + return { + backgroundColor: options[index].color, + } + } + } + return null; + }, initMqtt() { const that = this; if (that.mqttClient !== null && that.mqttClient.connected) { @@ -650,4 +697,9 @@ align-items: center; justify-content: center; } + .tag-box{ + margin-top: 10px; + margin-bottom: 10px; + + } \ No newline at end of file diff --git a/src/views/productManagement/workplan2.vue b/src/views/productManagement/workplan2.vue index 60c0960..a499727 100644 --- a/src/views/productManagement/workplan2.vue +++ b/src/views/productManagement/workplan2.vue @@ -1,618 +1,617 @@ + .el-icon-arrow-down { + font-size: 12px; + } + + .form_define ::v-deep .el-form-item__content { + height: 27.6px; + } + + .form_define { + height: 37px; + } + + .statistic-title { + font-weight: 700; + font-size: 24px; + } + + .statistic-text { + font-weight: 600; + font-size: 18px; + } + \ No newline at end of file diff --git a/src/views/qualityManagement/FQC/firstFQC.vue b/src/views/qualityManagement/FQC/firstFQC.vue index d32905a..654dceb 100644 --- a/src/views/qualityManagement/FQC/firstFQC.vue +++ b/src/views/qualityManagement/FQC/firstFQC.vue @@ -445,6 +445,7 @@ 上一个工单 + 同步开始时间 本工单完成 @@ -769,14 +770,41 @@ }, //todo 工单完成 workOrderCompleted() { - const oldWorkorderId = this.CurrentWorkorder.clientWorkorder; - this.$modal.confirm('是否确认完成本工单?').then(() => { - this.getNext_current_workorder() + this.$confirm('是否确认完成本工单?', '操作提示', { type: 'warning', closeOnClickModal: false }).then(() => { + this.getNext_current_workorder(false); + + }).catch(() => { + this.$message.info("操作取消"); + }) + }, + // 设置工单开始时间 + setWorkOrderStartTime() { + const workorderId = this.CurrentWorkorder.clientWorkorder; + writeProcessFlow_first({ workorderID: workorderId, time: new Date() }); + const data = { + workOrderId: workorderId + } + GetQcQualityStatisticsFirstStartTime(data).then(res => { + if (res.code === 200) { + this.workOrderStartTime = res.data; + } }) }, //todo 获取下一个工单号 - getNext_current_workorder() { + getNext_current_workorder(check = true) { + if (!this.checkHasStartTime() && check) { + this.$confirm("当前工单未点击本工单完成,无工单开始时间,是否进入下一个工单?", '操作提示', { type: 'warning', closeOnClickModal: false }).then(() => { + this.getNextWorkOrder(); + }).catch(() => { + this.$message.info("操作取消"); + }) + } else { + this.getNextWorkOrder(); + } + }, + getNextWorkOrder() { + const oldWorkorderId = this.CurrentWorkorder.clientWorkorder; get_next_current_workorder() .then((res) => { if (res.code == 200) { @@ -810,10 +838,9 @@ this.team = result.data.team this.publishNowOrderRetain(this.CurrentWorkorder.clientWorkorder) + this.setWorkOrderStartTime(); this.$loading().close() } - - return writeProcessFlow_first({ workorderID: this.CurrentWorkorder.clientWorkorder, time: new Date() }); }) }, //todo 获取上一个工单号 @@ -852,6 +879,15 @@ }) }, + //TODO 检查=== + //1.非完成切换工单时检查是否含有开始时间 + checkHasStartTime() { + if (this.workOrderStartTime === "" || this.workOrderStartTime === "工单无开始时间!") { + return false; + } + return true; + }, + //todo 累加器 这里是值传递还是引用传递?????????????????????????????? Accumulator(item, type, index) { let query = {} @@ -1146,6 +1182,8 @@ ::v-deep .el-button { float: right; + margin-bottom: 10px; + margin-right: 10px; } } diff --git a/src/views/qualityManagement/FQC/thirtyFQC.vue b/src/views/qualityManagement/FQC/thirtyFQC.vue index 265a88c..a058c6a 100644 --- a/src/views/qualityManagement/FQC/thirtyFQC.vue +++ b/src/views/qualityManagement/FQC/thirtyFQC.vue @@ -455,7 +455,9 @@ 上一个工单 - 本工单完成 +
+ 本工单完成 +
@@ -574,7 +576,7 @@ created() { this.initMqtt(); this.getcurrentWorkorder() - + // this.startTimer() }, mounted() {}, @@ -776,39 +778,50 @@ this.$modal .confirm('是否确认完成本工单?') .then(() => { - this.getNext_current_workorder() + + this.$notify.success(`已完成工单${saveWorkorderInfo.clientWorkorder},即将跳转下一个工单`); //todo 更改这个工单状态为2 - return update_workorder_status({ workorderID: saveWorkorderInfo.clientWorkorder }) - }) - .then((res) => { - if (res.code == 200) { - this.$notify.success('工单完成') - //todo 生成质量统计表 !!!!需要工单和班组 - let query = { - workorderID: saveWorkorderInfo.clientWorkorder, - team: saveWorkorderInfo.team, - firstquality_time: this.$store.state.quality.firstquality_time, - } - return generateQualityStatisticsTable(query) + this.getNext_current_workorder().then(() => { + setTimeout(() => { + update_workorder_status({ workorderID: saveWorkorderInfo.clientWorkorder }) + .then((res) => { + if (res.code == 200) { + this.$notify.success(`工单${saveWorkorderInfo.clientWorkorder},开始生成相关数据……`) + //todo 生成质量统计表 !!!!需要工单和班组 + let query = { + workorderID: saveWorkorderInfo.clientWorkorder, + team: saveWorkorderInfo.team, + firstquality_time: this.$store.state.quality.firstquality_time, + } + return generateQualityStatisticsTable(query) + } + }).then((res) => { + if (res.code == 200) { + this.$notify.success(`工单${saveWorkorderInfo.clientWorkorder}质量统计表生成成功`) + } + // 入库检验数据转换 + const quest = { workorder: saveWorkorderInfo.clientWorkorder } + return convertToIncomingInspectionData(quest) - } - }).then((res) => { - if (res.code == 200) { - this.$notify.success('质量统计表生成成功') - } - // 入库检验数据转换 - const quest = { workorder: saveWorkorderInfo.clientWorkorder } - return convertToIncomingInspectionData(quest) + }).then((res) => { + if (res.code == 200) { + this.$notify.success(`工单${saveWorkorderInfo.clientWorkorder}生成入库检验数量为${res.data}`); + } + }) + }, 500); + setTimeout(() => { + location.reload(); + }, 2000); + }) + + }).catch(() => { - }).then((res) => { - if (res.code == 200) { - this.$notify.success("生成入库检验数量为" + res.data); - } }) + }, //todo 获取下一个工单号 getNext_current_workorder() { - get_next_current_workorder() + return get_next_current_workorder() .then((res) => { if (res.code == 200) { if (res.data != null) { @@ -819,11 +832,11 @@ this.publishOrderChange(); return GetcheckItemTable({ workorderID: this.CurrentWorkorder.clientWorkorder }) } else { - this.$notify.warning('已经是最后一个工单,没有工单了') + this.$notify.warning('当前为列表最后工单,请刷新尝试获取最新工单!'); return null; } } else if (res.code == 210) { - this.$notify.warning('已经是最后一个工单,没有工单了') + this.$notify.warning('当前无更多数据,请刷新尝试获取最新工单!'); return null; } }) @@ -833,17 +846,12 @@ } if (result.code == 200) { this.paint = result.data.paint - this.device = result.data.device - this.blank = result.data.blank - this.program = result.data.program - this.team = result.data.team this.$loading().close() } - }) }, //todo 获取上一个工单号 @@ -858,11 +866,11 @@ this.publishOrderChange(); return GetcheckItemTable({ workorderID: this.CurrentWorkorder.clientWorkorder }) } else { - this.$notify.warning('没有生产工单') + this.$notify.warning('当前为列表第一个工单,请刷新尝试获取最新工单!') return null; } } else if (res.code == 210) { - this.$notify.warning('没有生产工单') + this.$notify.warning('当前为列表第一个工单,请刷新尝试获取最新工单!') return null; } }) @@ -1134,7 +1142,7 @@ this.$nextTick(() => { this.$refs.elImageRef.clickHandler(); }) - + }, }, // 退出后关闭计时器 @@ -1143,7 +1151,7 @@ }, - + } diff --git a/src/views/wmsManagement/WmBlankInventory.vue b/src/views/wmsManagement/WmBlankInventory.vue index dfbd1ef..b0ac8a5 100644 --- a/src/views/wmsManagement/WmBlankInventory.vue +++ b/src/views/wmsManagement/WmBlankInventory.vue @@ -15,8 +15,8 @@ - + @@ -182,7 +182,7 @@ queryParams: { pageNum: 1, pageSize: 10, - type: 0, + type: 1, status: 1, sort: undefined, sortType: undefined, diff --git a/src/views/wmsManagement/components/TheWmBlankRecord/TheWmBlankRecord.vue b/src/views/wmsManagement/components/TheWmBlankRecord/TheWmBlankRecord.vue index c207ddb..f818ac5 100644 --- a/src/views/wmsManagement/components/TheWmBlankRecord/TheWmBlankRecord.vue +++ b/src/views/wmsManagement/components/TheWmBlankRecord/TheWmBlankRecord.vue @@ -21,11 +21,11 @@ - 增加库存 + 库存变动 - + @@ -74,15 +74,28 @@ - 毛坯 - 返工件 + 毛坯 + 返工件 - 增加库存 - 减少库存 + 增加库存 + 减少库存 - + + + + + + + + + + + + + + @@ -110,6 +123,9 @@ addInventoryNum, reduceInventoryNum } from '@/api/wmsManagement/wmBlankRecord.js'; + import { + getWmBlankInventory, + } from '@/api/wmsManagement/wmBlankInventory.js'; export default { inheritAttrs: false, props: { @@ -169,6 +185,23 @@ }, mounted() {}, methods: { + // 初始化数据 + initData() { + this.formAdd.fkBlankInventoryId = this.ItemData.id; + this.formAdd.description = this.ItemData.description ?? ""; + this.formAdd.specification = this.ItemData.specification ?? ""; + this.formAdd.blankNum = this.ItemData.blankNum ?? ""; + this.formAdd.type = this.ItemData.type; + this.formAdd.changeQuantity = 0; + this.formAdd.remark = ""; + // 库存值更新 + getWmBlankInventory(this.ItemData.id).then((res) => { + const { code, data } = res; + if (code == 200) { + this.formAdd.quantity = data.quantity; + } + }); + }, // 查询数据 getList() { this.loading = true; @@ -204,21 +237,17 @@ this.getList(); }, handleAdd(type = 0) { - if (type === 1) { - this.addDialogTitle = "增加库存"; - } else { - this.addDialogTitle = "减少库存"; - } - this.formAdd.fkBlankInventoryId = this.ItemData.id; - this.formAdd.blankNum = this.ItemData.blankNum; - this.formAdd.description = this.ItemData.description; - this.formAdd.specification = this.ItemData.specification; - this.formAdd.type = this.ItemData.type; + // if (type === 1) { + // this.addDialogTitle = "增加库存"; + // } else { + // this.addDialogTitle = "减少库存"; + // } + this.addDialogTitle = "修改库存"; this.formAdd.actionType = type; - this.formAdd.changeQuantity = 0; - this.formAdd.remark = ""; + this.initData(); this.addDialogOpen = true; }, + handelConfirm() { this.$refs['elForm'].validate(valid => { if (!valid) return @@ -237,6 +266,7 @@ this.$message.success("手动添加记录成功!"); this.getList(); this.emitRefresh(); + this.initData(); this.addDialogOpen = false; } }) @@ -251,6 +281,7 @@ this.$message.success("手动添加记录成功!"); this.getList(); this.emitRefresh(); + this.initData(); this.addDialogOpen = false; } })
产品描述