From 59d135839fa7c4cdd09007a213f83a5738ba7887 Mon Sep 17 00:00:00 2001 From: zhousq Date: Tue, 14 May 2024 15:17:04 +0800 Subject: [PATCH] =?UTF-8?q?2024-05-14=20=E4=BF=AE=E6=94=B9=E8=AF=A5?= =?UTF-8?q?=E6=8A=A5=E5=B7=A5=E4=B8=BAform=E8=A1=A8=E5=8D=95=EF=BC=8C?= =?UTF-8?q?=E5=90=A6=E5=88=99=E6=95=B0=E6=8D=AE=E4=B8=8D=E5=88=B7=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mes/workScheduling/components/report.vue | 95 ++++++++++--------- 1 file changed, 52 insertions(+), 43 deletions(-) diff --git a/src/views/mes/workScheduling/components/report.vue b/src/views/mes/workScheduling/components/report.vue index c0729c427..52b1de841 100644 --- a/src/views/mes/workScheduling/components/report.vue +++ b/src/views/mes/workScheduling/components/report.vue @@ -7,33 +7,33 @@ width="600px" > - - - + + + - + - + - + - + - + @@ -54,24 +54,32 @@ const dialogVisible = ref(false) const dialogTitle = ref() const formLoading = ref(false) const personOption=ref([]) -const processCode = ref() -const personSelected = ref() -const checkFlag = ref(false) -const unqualified = ref() -const reportCount = ref() -const qualified = ref() -const workTerm = ref() const saveFlag=ref(false) const planDayCode=ref() -const formRef=ref() +const form = reactive({ + processCode:"", + reportCount:0, + workTerm:0, + checkFlag:"FALSE", + personSelected:[], + qualified:0, + unqualified:0 +}) const openDetail = async (row: any, titleName: any,code:string) => { rowData.value = row //console.log('row-68',row) dialogVisible.value = true dialogTitle.value = titleName - processCode.value=row.nodeCode + form.processCode=row.nodeCode + form.personSelected=[] + form.reportCount=0, + form.workTerm=0, + form.checkFlag="FALSE", + form.personSelected=[], + form.qualified=0, + form.unqualified=0 planDayCode.value=code - getCurrentWorkerList(processCode.value) + getCurrentWorkerList(row.nodeCode) } @@ -85,54 +93,55 @@ const getCurrentWorkerList = async (val) => { personOption.value = await workschedulingApi.getCurrentWorkerList(params) } -const count = ref(0) -const qcount = ref(1) + //报工数量处理 -const handleCount = (val) => { - - if (reportCount.value> rowData.value.planCount) { +const handleCount = () => { + if (form.reportCount> rowData.value.planCount) { message.alert('报工数量不能超出计划数量!计划数【'+rowData.value.planCount+'】') - reportCount.value =rowData.value.planCount + form.reportCount =rowData.value.planCount //tableData.value[index].reportCount =rowData.value.planCount - count.value++ + //count.value++ return } //message.alert(row.checkFlag==true?'1':'2') - if (checkFlag.value) { - if (reportCount.value < qualified.value) { + if (form.checkFlag) { + if (form.reportCount < form.qualified) { message.alert('合格数不能超出报工数!') - qualified.value=reportCount.value - qcount.value++ + form.qualified=form.reportCount + //qcount.value++ return } - if (qualified.value == undefined || qualified.value == 0) { - qualified.val = reportCount.value - qcount.value++ + if (form.qualified == undefined || form.qualified == 0) { + form.qualified= form.reportCount + //qcount.value++ } - unqualified.value= reportCount.value- qualified.value + form.unqualified= form.reportCount- form.qualified } } //提交报工 const saveReport = async() => { - let listSub=[{}] - personSelected.value.forEach((item) => { + let listSub=[]; + form.personSelected.forEach((item) => { let data={ - reportCount: formRef.value.reportCount, - workTerm: formRef.value.workTerm, - reportPerson: formRef.value.item, - qualified: formRef.value.qualified, - unqualified: formRef.value.unqualified + reportCount: form.reportCount, + workTerm: form.workTerm, + checkFlag: form.checkFlag, + reportPerson: item, + qualified: form.qualified, + unqualified: form.unqualified } listSub.push(data) }) + let data = { reportDate: dayjs(new Date()).format('YYYY-MM-DD HH:mm:ss'), schedulingCode: rowData.value.schedulingCode, - processCode: processCode.value, + processCode: form.processCode, list: listSub } + console.log("report-saveReport-137",data) saveFlag.value = true try { await workschedulingApi.reportWorkByProcess(data)