From 7cced1cf2b0309755927de1bf2c50609391aaa76 Mon Sep 17 00:00:00 2001 From: bjang03 Date: Thu, 9 May 2024 08:56:09 +0800 Subject: [PATCH 1/2] =?UTF-8?q?1=E3=80=81=E5=B7=A5=E5=BA=8F=E6=8A=A5?= =?UTF-8?q?=E5=B7=A5-=E8=A1=A8=E5=8D=95=E9=A1=B5=E9=87=8D=E5=A4=8D?= =?UTF-8?q?=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mes/workScheduling/processReportForm.vue | 8 +- .../processReportPeopleCheck.vue | 53 +++--------- .../mes/workScheduling/workScheduling.vue | 84 +++++++++++-------- 3 files changed, 67 insertions(+), 78 deletions(-) diff --git a/src/pages/mes/workScheduling/processReportForm.vue b/src/pages/mes/workScheduling/processReportForm.vue index b6d211e..d5dc866 100644 --- a/src/pages/mes/workScheduling/processReportForm.vue +++ b/src/pages/mes/workScheduling/processReportForm.vue @@ -112,7 +112,13 @@ function remove(index: number){ } /* 通用方法 */ onShow(() => { - list.value = uni.getStorageSync("processReportList") + uni.getStorageSync("processReportList").forEach(person=>{ + if(person.checked){ + person.reportList.forEach(report=>{ + list.value.push(report) + }) + } + }) }) diff --git a/src/pages/mes/workScheduling/processReportPeopleCheck.vue b/src/pages/mes/workScheduling/processReportPeopleCheck.vue index 4b0a43b..224460f 100644 --- a/src/pages/mes/workScheduling/processReportPeopleCheck.vue +++ b/src/pages/mes/workScheduling/processReportPeopleCheck.vue @@ -2,10 +2,10 @@ - + - + {{ item.personName }} @@ -44,38 +44,11 @@ const data = ref({ processCode: '', nickName: '' }) -let checked: string | any[] = [] /* 是否显示"没有更多了" */ const status = ref('loadmore') /* 列表数据集 */ const list = ref([]) -/* 列表调用API方法 */ -async function getList() { - if (status.value === 'nomore') return - status.value = 'loading' - proxy.$modal.loading('加载中') - - await workSchedulingApi.getConfigProcessWorker(data.value).then((res) => { - uni.setStorageSync("isLeader", res.data.leader) - if (res.data.leader) { - list.value = res.data.list - } else { - if (res.data.list.length == 0){ - _toast("没有可以报工项") - return - } - uni.setStorageSync("processReportList", res.data.list) - uni.redirectTo({ - url: "./processReportForm" - }) - } - }) - proxy.$modal.closeLoading() -} -function checkChange(checkedArray: any[]) { - checked = checkedArray -} /* 打开详情页 */ function openDetail(item: any) { console.log(item) @@ -84,23 +57,21 @@ function openDetail(item: any) { /* 通用方法 */ onShow(() => { - list.value = [] - getList() }) function onSubmit() { - if (checked.length == 0){ - _toast("请选择人员") - return - } - uni.setStorageSync("processReportList", checked) - uni.redirectTo({ - url: "./processReportForm" + list.value.forEach(item=>{ + if (item.checked){ + uni.setStorageSync("processReportList", list.value) + uni.redirectTo({ + url: "./processReportForm" + }) + return + } }) + _toast("请选择人员") } onLoad((option) => { - // "{"status":"1","remark":null,"planMasterCode":"PO20240429-0015","schedulingCode":"9bb4ab0cfcc14e3284833506b5041571","productCode":"015.886-117","productName":null,"workroomCode":"work1","lineCode":"work1-line1","prouteCode":"015.886-117","planCount":25,"finishCount":0,"qualifiedCount":null,"unqualifiedCount":null,"flagDo":"0","planSubCode":null,"workingNode":"QD_HJ_01","workingTaskSort":1,"formType":"BATCH","workSort":0,"currentWorkstation":null,"planStartTime":null,"planEndTime":1714388234000,"realStartTime":null,"realFinishedTime":null,"qualityFormNo":null,"reason":null,"planNoDay":null,"batchCode":"M015.886-117-001","id":61,"createTime":1714370517000,"creator":"1"}" - data.value.planDayCode = uni.getStorageSync("processReportListParams").planMasterCode - data.value.processCode = uni.getStorageSync("processReportListParams").workingNode + list.value = uni.getStorageSync("processReportList") }) diff --git a/src/pages/mes/workScheduling/workScheduling.vue b/src/pages/mes/workScheduling/workScheduling.vue index 547aa8b..19e77b3 100644 --- a/src/pages/mes/workScheduling/workScheduling.vue +++ b/src/pages/mes/workScheduling/workScheduling.vue @@ -80,27 +80,22 @@