From 1f6692159c4f58209ec313c445fff4d376634f10 Mon Sep 17 00:00:00 2001 From: TengXF <302828528@qq.com> Date: Fri, 10 May 2024 14:55:51 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20add=20=E5=AE=8C=E5=B7=A5=E6=93=8D?= =?UTF-8?q?=E4=BD=9C=20=E8=A1=A5=E6=96=99=E6=93=8D=E4=BD=9C=20=E8=A1=A5?= =?UTF-8?q?=E6=96=99=E7=94=B3=E8=AF=B7=20=E8=A1=A5=E6=96=99=E8=AF=A6?= =?UTF-8?q?=E6=83=85=20=E9=A2=86=E6=96=99=E6=93=8D=E4=BD=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/mes/workScheduling/index.ts | 15 + src/pages.json | 14 + src/pages/mes/orderDayPlan/orderDayPlan.vue | 16 +- .../mes/workScheduling/completeHandle.vue | 359 ++++++++++++++++++ .../mes/workScheduling/requestDetail.vue | 183 +++++++++ .../mes/workScheduling/workScheduling.vue | 196 +++++++--- 6 files changed, 728 insertions(+), 55 deletions(-) create mode 100644 src/pages/mes/workScheduling/completeHandle.vue create mode 100644 src/pages/mes/workScheduling/requestDetail.vue diff --git a/src/api/mes/workScheduling/index.ts b/src/api/mes/workScheduling/index.ts index 7fc1b78..3d232c0 100644 --- a/src/api/mes/workScheduling/index.ts +++ b/src/api/mes/workScheduling/index.ts @@ -113,3 +113,18 @@ export function addBasicItem(data) { return http.post('/mes/', data) } +export function getRequestMainList(params) { + return http.get('/mes/item-request-main/page', {params}) +} +// 完工查询是否最后节点 +export function getNodePosition(params) { + return http.get('/mes/workScheduling/getNodePosition', {params}) +} +// 完工查询人员 +export function getCurrentWorkerList(params) { + return http.get('/mes/workScheduling/getCurrentWorkerList', {params}) +} + +export function getRequestMainDetail(params) { + return http.get('/mes/item-request-detail/page', {params}) +} diff --git a/src/pages.json b/src/pages.json index 1baa029..232407d 100644 --- a/src/pages.json +++ b/src/pages.json @@ -2058,6 +2058,20 @@ "navigationBarTitleText": "补料申请", "enablePullDownRefresh": true } + }, + { + "path": "pages/mes/workScheduling/completeHandle", + "style": { + "navigationBarTitleText": "完工处理", + "enablePullDownRefresh": true + } + }, + { + "path": "pages/mes/workScheduling/requestDetail", + "style": { + "navigationBarTitleText": "配料详情", + "enablePullDownRefresh": true + } } diff --git a/src/pages/mes/orderDayPlan/orderDayPlan.vue b/src/pages/mes/orderDayPlan/orderDayPlan.vue index a2c94d1..fd99dcc 100644 --- a/src/pages/mes/orderDayPlan/orderDayPlan.vue +++ b/src/pages/mes/orderDayPlan/orderDayPlan.vue @@ -12,18 +12,22 @@ - {{item.planNoDay}} - - - {{`${$time.formatDate(item.createTime)}`}} + 计划号:{{item.planNoDay}} + - 日计划单号:{{ item.planNoDay }} + 创建时间: + + {{`${$time.formatDate(item.createTime)}`}} + - 产品批次码:{{ item.batchCode }} + 生产批次:{{ item.batchCode }} + + 产品码:{{ item.productCode }} + 状态: diff --git a/src/pages/mes/workScheduling/completeHandle.vue b/src/pages/mes/workScheduling/completeHandle.vue new file mode 100644 index 0000000..b8c0808 --- /dev/null +++ b/src/pages/mes/workScheduling/completeHandle.vue @@ -0,0 +1,359 @@ + + + + + \ No newline at end of file diff --git a/src/pages/mes/workScheduling/requestDetail.vue b/src/pages/mes/workScheduling/requestDetail.vue new file mode 100644 index 0000000..9978675 --- /dev/null +++ b/src/pages/mes/workScheduling/requestDetail.vue @@ -0,0 +1,183 @@ + + + + + \ No newline at end of file diff --git a/src/pages/mes/workScheduling/workScheduling.vue b/src/pages/mes/workScheduling/workScheduling.vue index 14a51a6..4952abe 100644 --- a/src/pages/mes/workScheduling/workScheduling.vue +++ b/src/pages/mes/workScheduling/workScheduling.vue @@ -10,18 +10,44 @@ @change="tabsChange" :is-scroll="false"> --> - + + + + + 计划号:{{ item.planDayCode }} + + + + 产品号:{{ item.productCode }} + + + 工序号:{{ item.processCode }} + + + 工位号:{{ item.workstationCode }} + + + 创建时间:{{`${$time.formatDate(item.createTime)}`}} + + + 领料 + + + + + + - 日计划单号:{{ item.planMasterCode }} + 计划号:{{ item.planMasterCode }} - 任务工单号:{{ item.schedulingCode }} + 产品号:{{ item.productCode }} - 产品编号:{{ item.productCode }} + 工序号:{{ item.workingNode }} - 产品名称:{{ item.productName }} + 工位号:{{ item.currentWorkstation }} 创建时间:{{`${$time.formatDate(item.createTime)}`}} @@ -66,11 +92,10 @@ 开工 SOP 明细 - 叫料 - 领料 - 补料 - 报工 - 完工 + 叫料 + 补料 + 报工 + 完工 @@ -168,7 +193,8 @@ const tabParams = ref({ pageNo: 1, pageSize: 10, status: '', - flag: null + flag: null, + flagDo:'' }) async function getTabsList() { @@ -190,13 +216,37 @@ async function getTabsList() { falg.value = 'tab' } +//查询待领料数据 +function getRequestList() { + if (status.value == 'nomore') return + status.value = 'loading' + proxy.$modal.loading('加载中') + workSchedulingListApi.getRequestMainList(tabParams.value).then((res) => { + proxy.$modal.closeLoading() + if (res.data.list.length > 0) { + list.value = list.value.concat(res.data.list) + tabParams.value.pageNo++ + status.value = 'loadmore' + } else { + status.value = 'nomore' + } + }).catch(() => { + proxy.$modal.closeLoading() + }) + falg.value = 'request' +} + //首次进页面触发 onShow(() => { - tabParams.value.pageNo = 1 - tabParams.value.status = '' - list.value = [] - getTabsList() + falg.value == 'tab' + status.value = 'loading' + tabParams.value.flagDo = '' + current.value = 0 + tabParams.value.pageNo = 1 + tabParams.value.status = '' + list.value = [] + getTabsList() }) //滑动到底部展示 @@ -210,21 +260,12 @@ onReachBottom(() => { status.value = 'loading' getViewList() } + else{ + status.value = 'loading' + getRequestList() + } }) -//折叠框 -// function getNodeCodes(item){ -// console.log(item.schedulingCode) -// workSchedulingListApi.getWorkSchedulingDetail(item.schedulingCode).then((res) => { -// console.log(res.data); -// nodeCodes.value = [] -// nodeCodes.value = res.data -// console.log(nodeCodes.value); -// }).catch(() => { - -// }) -// } - //工序完成 function nodeCodeFinish(item){ console.log(item.remark) @@ -240,6 +281,12 @@ function nodeCodeFinish(item){ }) } + +// 打开叫料详情页 +function openRequestDetail(item, index) { + proxy.$tab.navigateTo(`/pages/mes/workScheduling/requestDetail?obj=${JSON.stringify(item)}`) +} + //打开明细 function openDetail(item, index) { proxy.$tab.navigateTo(`/pages/mes/workScheduling/workSchedulingDetail?obj=${JSON.stringify(item)}`) @@ -277,6 +324,7 @@ function kaigong(item){ //切换标签页 function tabsChange(index) { + tabParams.value.flagDo = '' current.value = index tabParams.value.pageNo = 1 if (index == '0') { @@ -288,7 +336,12 @@ function tabsChange(index) { }else if(index == '3'){ tabParams.value.status = '1' }else if(index == '4'){ - tabParams.value.status = '2' + list.value = [] + status.value = 'loading' + tabParams.value.status = '0' + tabParams.value.flagDo = '1' + getRequestList() + return }else if(index == '5'){ tabParams.value.status = '3' }else if(index == '6'){ @@ -316,6 +369,11 @@ const searchTableParams = ref({ flag: null }) +const nodeInfo = ref({ + planDayCode:'PO20240430-0011', + processCode:'QD_CY_01' +}) + async function searchTable() { list.value = [] searchTableParams.value.planNoDay = this.searchValue @@ -325,24 +383,43 @@ async function searchTable() { } }) } - // 完工处理(临时,后续调整) -function completeHandle(item) { - console.log(item) - proxy.$modal.loading("点击了完工按钮") - setTimeout(() => { - proxy.$modal.closeLoading() - }, 1000) - // proxy.$modal.loading('处理中') - // workSchedulingListApi.completeHandle(completedParams.value).then((res) => { - // proxy.$modal.closeLoading() - // if (res.data) { - - // } else { - - // } - // }).catch(() => { - // proxy.$modal.closeLoading() - // }) + // 完工处理->验证 +function finished(item) { + nodeInfo.value.planDayCode = item.planMasterCode + nodeInfo.value.processCode = item.workingNode + workSchedulingListApi.getNodePosition(nodeInfo.value).then((res) => { + proxy.$modal.closeLoading() + console.log(res.data) + if (res.data != null && res.data=="end") { + proxy.$modal.confirm('确定提交完工吗?').then(() => { + submitFinish(item) + + }) + } else { + proxy.$modal.confirm('当前不是最后工序,是否强制完工').then(() => { + submitFinish(item) + }) + } + }).catch(() => { + proxy.$modal.closeLoading() + }) +} +// 完工处理->提交 +function submitFinish(item){ + workSchedulingListApi.completeHandle(item).then((res) => { + proxy.$modal.closeLoading() + if (res.data) { + proxy.$modal.showToast('成功') + list.value = [] + status.value = 'loadmore' + tabParams.value.pageNo = 1 + getTabsList() + } else { + proxy.$modal.showToast('失败') + } + }).catch(() => { + proxy.$modal.closeLoading() + }) } async function reportHandle(item) { @@ -373,14 +450,35 @@ function callBasicItem(item) { } // 领料 -function receiveBasicItem(item) { - console.log(item) +function receiveItem(item){ + console.log(item) + proxy.$modal.confirm('确定提交吗').then(() => { + proxy.$modal.loading('处理中') + workSchedulingListApi.receiveBasicItem(item).then((res) => { + proxy.$modal.closeLoading() + if (res.data) { + list.value = [] + status.value = 'loadmore' + tabParams.value.status = '0' + tabParams.value.flagDo = '1' + getRequestList() + } else { + + } + }).catch(() => { + proxy.$modal.closeLoading() + }) + proxy.$modal.closeLoading() + }) + } + // 补料 function addBasicItem(item){ const objString = JSON.stringify(item); proxy.$tab.navigateTo(`/pages/mes/workScheduling/addBasicItem/index?obj=${encodeURIComponent(objString)}`) } + //SOP文件预览 function SOP(item){ workSchedulingListApi.getWorkSchedulingPDF(JSON.stringify(item.planMasterCode)).then((res) => {