From fb84e7b6aff78673baa809ab49684ac6c792b344 Mon Sep 17 00:00:00 2001 From: Ledo Date: Fri, 11 Jul 2025 17:31:41 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B4=A8=E6=A3=80=E8=AE=A1=E7=AE=97=E7=AD=89?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/pages/pgMaster/pgMaster-detail.vue | 10 +- .../productionReport-detail.vue | 2 +- .../unqualifiedNotification-detail.vue | 141 +++++++++++------- .../pages/zjPgMaster/zjPgMaster-detail.vue | 9 +- 4 files changed, 94 insertions(+), 68 deletions(-) diff --git a/mes-ui/mini-app/src/pages/pgMaster/pgMaster-detail.vue b/mes-ui/mini-app/src/pages/pgMaster/pgMaster-detail.vue index 3211cea..0785794 100644 --- a/mes-ui/mini-app/src/pages/pgMaster/pgMaster-detail.vue +++ b/mes-ui/mini-app/src/pages/pgMaster/pgMaster-detail.vue @@ -328,16 +328,16 @@ //算时间和数量 //算时间 - var lastIndex = historyList.value.length - 1; - var lastItem = historyList.value[lastIndex]; - console.log(historyList.value) - workTime.value = Math.floor(Math.abs(lastItem.createTime - Date.now()) / (1000 * 60 * 60)).toString(); + // var lastIndex = historyList.value.length - 1; + var lastItem = historyList.value[0]; + var www = new Date(); + workTime.value = Math.floor(Math.abs(lastItem.createTime - www.getTime()) / (1000 * 60 * 60)).toString(); //算数量 if (historyList.value.length == 1) { amount.value = detailInfo.value.amount; } else { var beforeAmount = 0; - for (var i = 0; i < historyList.value.length - 1; i++) { + for (var i = 1; i < historyList.value.length ; i++) { beforeAmount += historyList.value[i].amount } var finalamount = detailInfo.value.amount - beforeAmount diff --git a/mes-ui/mini-app/src/pages/productionReport/productionReport-detail.vue b/mes-ui/mini-app/src/pages/productionReport/productionReport-detail.vue index c9cb719..b27107e 100644 --- a/mes-ui/mini-app/src/pages/productionReport/productionReport-detail.vue +++ b/mes-ui/mini-app/src/pages/productionReport/productionReport-detail.vue @@ -281,7 +281,7 @@ @click="handleComplate"> - 质检结束 + 生产结束 diff --git a/mes-ui/mini-app/src/pages/unqualifiedNotification/unqualifiedNotification-detail.vue b/mes-ui/mini-app/src/pages/unqualifiedNotification/unqualifiedNotification-detail.vue index 17e9d3e..63bd23a 100644 --- a/mes-ui/mini-app/src/pages/unqualifiedNotification/unqualifiedNotification-detail.vue +++ b/mes-ui/mini-app/src/pages/unqualifiedNotification/unqualifiedNotification-detail.vue @@ -3,7 +3,7 @@ import { formatDate } from '@/utils/index' import { onLoad, onShow } from '@dcloudio/uni-app' import { useLoginStore } from '@/stores/modules/login' - import { getNotificationDetailAPI,operateWx } from '@/services/unqualifiedNotification' + import { getNotificationDetailAPI, operateWx } from '@/services/unqualifiedNotification' import { serviceDomain } from '@/services/constants' const popup = ref() const userStore = useLoginStore() @@ -144,15 +144,15 @@ } } const range = [ - { value: 1, text: "返修" }, - { value: 2, text: "让步接收" }, - { value: 3, text: "报废" }, - ] + { value: 1, text: "返修" }, + { value: 2, text: "让步接收" }, + { value: 3, text: "报废" }, + ] // 提交报工 - const handleOk = async() =>{ - if(detailInfo.value.auditOpinion){ - await submitForm(detailInfo.value.auditOpinion); - }else{ + const handleOk = async () => { + if (detailInfo.value.auditOpinion) { + await submitForm(detailInfo.value.auditOpinion); + } else { uni.showToast({ icon: 'none', duration: 3000, @@ -170,11 +170,11 @@ auditOpinion: active, auditor: userId, projectId: 0, - projectSubId:0, + projectSubId: 0, status: 1, - notificationStatus:3 + notificationStatus: 3 } - await operateWx(params); + await operateWx(params); } catch (error) { uni.showToast({ icon: 'none', @@ -183,7 +183,7 @@ }) } finally { isLoading.value = false; - // const url = `/pages/pgMaster/pgMaster-detail?id=${detailInfo.value.id}` + // const url = `/pages/unqualifiedNotification/unqualifiedNotification` // uni.redirectTo({ // url, // }) @@ -204,10 +204,23 @@ await getDetailData(idValue.value, typeName.value) } - const audit = ()=>{ + const audit = () => { popup.value.open() } - + const cancel = () => { + uni.navigateBack({ + delta: 1 // 返回的页面数,这里1表示返回上一页 + }); + } + const getSuger = (val) => { + if (val == 1) { + return '返修' + } else if (val == 2) { + return '让步接收' + } else if (val == 3) { + return '报废' + } + } const detailId = ref() @@ -322,24 +336,33 @@ + \ No newline at end of file diff --git a/mes-ui/mini-app/src/pages/zjPgMaster/zjPgMaster-detail.vue b/mes-ui/mini-app/src/pages/zjPgMaster/zjPgMaster-detail.vue index 49cc5ea..f1f94a3 100644 --- a/mes-ui/mini-app/src/pages/zjPgMaster/zjPgMaster-detail.vue +++ b/mes-ui/mini-app/src/pages/zjPgMaster/zjPgMaster-detail.vue @@ -304,15 +304,14 @@ const handleStop = async () => { // var lastIndex = historyList.value.length-1; var lastItem = historyList.value[0]; - console.log(historyList.value) - workTime.value = Math.floor(Math.abs(lastItem.createTime - Date.now()) / (1000 * 60 * 60)).toString(); + var nowDate = new Date(); + workTime.value = Math.floor(Math.abs(lastItem.createTime - nowDate.getTime()) / (1000 * 60 * 60)).toString(); //算数量 if (historyList.value.length == 1) { amount.value = detailInfo.value.amount; } else { var beforeAmount = 0; - for (var i = historyList.value.length - 1; i > 0; i--) { - console.log(historyList.value[i]) + for (var i = 1; i < historyList.value.length ; i++) { beforeAmount += historyList.value[i].amount } var finalamount = detailInfo.value.amount - beforeAmount @@ -397,7 +396,7 @@ icon: 'none', // 显示纯文本时icon设为none duration: 2000 }); - await initPage() + // await initPage() const pages = getCurrentPages(); // 获取当前页面栈 const currentPage = pages[pages.length - 1]; // 当前页面 const url = `/${currentPage.route}?${Object.entries(currentPage.options).map(([key, val]) => `${key}=${val}`).join('&')}`;