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) => {