From 61de4f1543f64cf57292388dd023db93902eac9d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A4=9C=E7=AC=99=E6=AD=8C?= <2277317060@qq.com> Date: Fri, 23 Feb 2024 16:12:38 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=94=9F=E4=BA=A7=E7=95=8C?= =?UTF-8?q?=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hw-ui/src/api/board/firstFloor.js | 28 + hw-ui/src/api/board/laserLight.js | 29 + hw-ui/src/views/board/firstFloor/index.vue | 194 +++-- .../views/board/fourthFloor/laserLight.vue | 746 +++++++++--------- 4 files changed, 562 insertions(+), 435 deletions(-) create mode 100644 hw-ui/src/api/board/laserLight.js diff --git a/hw-ui/src/api/board/firstFloor.js b/hw-ui/src/api/board/firstFloor.js index a6bad0a9..dd33b92e 100644 --- a/hw-ui/src/api/board/firstFloor.js +++ b/hw-ui/src/api/board/firstFloor.js @@ -1,6 +1,24 @@ import request from '@/utils/request' +// 开始 +export function startProductPlanDetail(query) { + return request({ + url: '/mes/api/startProductPlanDetail', + method: 'post', + data: query + }) +} +// 完成 +export function completeProductPlanDetail(query) { + return request({ + url: '/mes/api/completeProductPlanDetail', + method: 'post', + data: query + }) +} + +// 获取计划 export function getProductPlans(query) { return request({ url: '/mes/api/getProductPlans', @@ -9,6 +27,16 @@ export function getProductPlans(query) { }) } +// 获取计划详情 +export function getProductPlanDetails(query) { + return request({ + url: '/mes/api/getProductPlanDetails', + method: 'get', + params: query + }) +} + +// 创建 export function insertProductPlanDetails(query) { return request({ url: '/mes/api/insertProductPlanDetails', diff --git a/hw-ui/src/api/board/laserLight.js b/hw-ui/src/api/board/laserLight.js new file mode 100644 index 00000000..e629c4fa --- /dev/null +++ b/hw-ui/src/api/board/laserLight.js @@ -0,0 +1,29 @@ +import request from '@/utils/request' + + + +// 获取计划 +export function getProductPlans(query) { + return request({ + url: '/mes/api/getProductPlans', + method: 'get', + params: query + }) +} + +// 开始/继续 +export function startNextProductPlanDetail(query) { + return request({ + url: '/mes/api/startNextProductPlanDetail', + method: 'post', + data: query + }) +} + +// 获取信息 +export function getNewestProductPlanDetail(query) { + return request({ + url: '/mes/api/getNewestProductPlanDetail/'+query, + method: 'get', + }) +} diff --git a/hw-ui/src/views/board/firstFloor/index.vue b/hw-ui/src/views/board/firstFloor/index.vue index 695ca1e6..1182d61c 100644 --- a/hw-ui/src/views/board/firstFloor/index.vue +++ b/hw-ui/src/views/board/firstFloor/index.vue @@ -10,7 +10,7 @@ :cell-style="{textAlign:'center'}" :data="tableData" :header-cell-style="{textAlign:'center'}" - max-height="19.13vw" + :max-height="19.13 * vw" style="width: 100%" > 明细 @@ -97,7 +97,7 @@ :cell-style="{textAlign:'center'}" :data="tableData1" :header-cell-style="{textAlign:'center'}" - max-height="19.13vw" + :max-height="19.13 * vw" style="width: 100%" > @@ -108,31 +108,51 @@ > + + + + + @@ -276,7 +289,8 @@ import { getWarehouses, applyRawOutstock, getProductPlans, - insertProductPlanDetails + insertProductPlanDetails, + getProductPlanDetails, startProductPlanDetail, completeProductPlanDetail } from '@/api/board/firstFloor' const vw = (document.documentElement.clientWidth || document.body.clientWidth) / 100 @@ -287,6 +301,7 @@ export default { }, data() { return { + vw: (document.documentElement.clientWidth || document.body.clientWidth) / 100, searchMaterialValue: '', warehouseList: [], form: { @@ -306,60 +321,16 @@ export default { }, dialogVisible: false, addDialogVisible: false, - tableData: [ - { - workOrderNumber: '202401221413', - plan: '1000', - practical: '800', - difference: '200', - deliveryTime: '2024-01-01', - }, - { - workOrderNumber: '202401221413', - plan: '1000', - practical: '800', - difference: '200', - deliveryTime: '2024-01-01', - }, - { - workOrderNumber: '202401221413', - plan: '1000', - practical: '800', - difference: '200', - deliveryTime: '2024-01-01', - } - ], - tableData1: [ - { - workOrderNumber: '202401221413', - planNumber: '202401221413-1', - startTime: '2024-01-01', - }, - { - workOrderNumber: '202401221413', - planNumber: '202401221413-2', - startTime: '2024-01-01', - }, - { - workOrderNumber: '202401221413', - planNumber: '202401221413-3', - startTime: '2024-01-01', - }, - ], + tableData: [], + tableData1: [], } }, mounted() { getProductPlans().then(e => { - console.log(e) this.tableData = e.data - }) - insertProductPlanDetails({ - "planId": 1, - "planAmount": 1, - "materialId": 1, - "materialBomId": 1 - }).then(e => { - console.log(e) + getProductPlanDetails({planId: e.data?.[0]?.planId}).then(res => { + this.tableData1 = res.data + }) }) this.$refs.chart2.setData({ tooltip: { @@ -525,21 +496,84 @@ export default { }) }, methods: { - getDetail() { - if(true){ - this.$alert('这是一段内容', '标题名称', { + planExecute(e) { + console.log(e) + if (e.planDetailStatus === '1') { + this.$confirm('是否开始计划', '确认', { confirmButtonText: '确定', - callback: action => { + cancelButtonText: '取消', + type: 'success' + }).then(() => { + startProductPlanDetail({ + planDetailId: e.planDetailId + }) + .finally(() => { + this.getDetail({row: {planId: e.planId}}) + getProductPlans().then(e => { + this.tableData = e.data + }) + }) + }) + .catch(() => { this.$message({ type: 'info', - message: `action: ${ action }` + message: '已取消' }); - } - }); - - }else{ - + }) + } + if (e.planDetailStatus === '2') { + this.$confirm('是否完成计划', '确认', { + confirmButtonText: '确定', + cancelButtonText: '取消', + type: 'success' + }).then(() => { + completeProductPlanDetail({ + planDetailId: e.planDetailId + }) + .finally(() => { + this.getDetail({row: {planId: e.planId}}) + getProductPlans().then(e => { + this.tableData = e.data + }) + }) + }) + .catch(() => { + this.$message({ + type: 'info', + message: '已取消' + }); + }) } + }, + getDetail(e) { + getProductPlanDetails({planId: e.row.planId}).then(res => { + if (res.data.length === 0) { + this.$confirm('是否生成计划明细', '确认', { + confirmButtonText: '确定', + cancelButtonText: '取消', + type: 'success' + }).then(() => { + insertProductPlanDetails({ + "planId": e.row.planId, + }).then(val => { + this.tableData1 = val.data + this.$message({ + type: 'info', + message: `生成完成` + }); + }) + }) + .catch(() => { + this.$message({ + type: 'info', + message: '已取消' + }); + }) + } else { + this.tableData1 = res.data + } + + }) }, getMaterials(val) { @@ -589,7 +623,6 @@ export default { }) }, searchMaterial(val) { - console.log(val) getMaterialBoms({ ancestors: 1, materialName: val @@ -631,6 +664,7 @@ export default { .el-table { background-color: #fff0; + //overflow: auto; } .whiteTable { diff --git a/hw-ui/src/views/board/fourthFloor/laserLight.vue b/hw-ui/src/views/board/fourthFloor/laserLight.vue index 15b72a78..81bcd3df 100644 --- a/hw-ui/src/views/board/fourthFloor/laserLight.vue +++ b/hw-ui/src/views/board/fourthFloor/laserLight.vue @@ -5,26 +5,30 @@
工单信息
-
- +
+ + + + - + - + - + - + - +
- 图纸下发 + 图纸下发 + 继续
@@ -55,11 +59,14 @@
+ + + @@ -103,23 +119,26 @@ > @@ -150,6 +169,7 @@