diff --git a/src/api/wms/purchasereturnRecordMain/index.ts b/src/api/wms/purchasereturnRecordMain/index.ts index b08fddfe7..caa8fc615 100644 --- a/src/api/wms/purchasereturnRecordMain/index.ts +++ b/src/api/wms/purchasereturnRecordMain/index.ts @@ -75,6 +75,16 @@ export const exportPurchasereturnRecordMain = async (params) => { } } +// 导出采购退货记录主 Excel +export const exportPurchasereturnRecordMainSCP = async (params) => { + if (params.isSearch) { + const data = {...params} + return await request.downloadPost({ url: `/wms/purchasereturn-record-main/export-excel-senior-SCP`, data }) + } else { + return await request.download({url: `/wms/purchasereturn-record-main/export-excel-SCP`, params}) + } +} + // 下载用户导入模板 export const importTemplate = () => { return request.download({ url: '/wms/purchasereturn-record-main/get-import-template' }) 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) diff --git a/src/views/qms/inspectionJob/addForm.vue b/src/views/qms/inspectionJob/addForm.vue index 6fc8fc810..88e5dc8d3 100644 --- a/src/views/qms/inspectionJob/addForm.vue +++ b/src/views/qms/inspectionJob/addForm.vue @@ -370,30 +370,35 @@ // 总数量值是 样品份数 乘 每份样品量 allSamplePieceSize.value += parseFloat((parseFloat(item.inspectionJobCharacteristicsUpdateReqVO.sampleQty) * parseFloat(item.inspectionJobCharacteristicsUpdateReqVO.samplePieceSize)).toFixed(2)) // rules.value['inspectionJobCharacteristicsUpdateReqVO.quantifyCapping'][0].required = true - if (item.inspectionJobCharacteristicsUpdateReqVO.resultEntryMethod == 0) { - // rules.value['inspectionJobCharacteristicsUpdateReqVO.quantifyCapping'][0].required = true - item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList = [] - for (let i = 0; i < parseInt(item.inspectionJobCharacteristicsUpdateReqVO.sampleQty); i++) { + if(!item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList){ + // 单个录入时 + if (item.inspectionJobCharacteristicsUpdateReqVO.resultEntryMethod == 0) { + // rules.value['inspectionJobCharacteristicsUpdateReqVO.quantifyCapping'][0].required = true + item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList = [] + for (let i = 0; i < parseInt(item.inspectionJobCharacteristicsUpdateReqVO.sampleQty); i++) { + item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList.push({ + inspectionValue: '', //检验值 + qualitativeCode: '', //定性字典项值 + defectLevel: '', //缺陷级别 + qualifiedQuantity: '', //合格数量 + unqualifiedQuantity: '' //不合格数量 + }) + } + } else { + // 汇总录入时 + item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList = [] + rules.value['inspectionJobCharacteristicsUpdateReqVO.quantifyCapping'][0].required = false item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList.push({ inspectionValue: '', //检验值 qualitativeCode: '', //定性字典项值 defectLevel: '', //缺陷级别 qualifiedQuantity: '', //合格数量 unqualifiedQuantity: '' //不合格数量 - }) - } - } else { - item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList = [] - rules.value['inspectionJobCharacteristicsUpdateReqVO.quantifyCapping'][0].required = false - item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList.push({ - inspectionValue: '', //检验值 - qualitativeCode: '', //定性字典项值 - defectLevel: '', //缺陷级别 - qualifiedQuantity: '', //合格数量 - unqualifiedQuantity: '' //不合格数量 + } + ) } - ) } + // 编辑判断上限下限目标值是否必填 if (item.inspectionJobCharacteristicsUpdateReqVO.quantifyIsCapping) { rules.value['inspectionJobCharacteristicsUpdateReqVO.quantifyCapping'][0].required = true @@ -424,13 +429,15 @@ */ for (let i = 0; i < data.value.packageList.length; i++) { - if (allSamplePieceSize.value > data.value.packageList[i].amount) { - data.value.packageList[i].sampleAmount = data.value.packageList[i].amount - allSamplePieceSize.value = parseFloat((allSamplePieceSize.value - data.value.packageList[i].amount).toFixed(2)) - } else { - data.value.packageList[i].sampleAmount = allSamplePieceSize.value - allSamplePieceSize.value = 0 - // return; + if(data.value.packageList[i].sampleAmount==null){ + if (allSamplePieceSize.value > data.value.packageList[i].amount) { + data.value.packageList[i].sampleAmount = data.value.packageList[i].amount + allSamplePieceSize.value = parseFloat((allSamplePieceSize.value - data.value.packageList[i].amount).toFixed(2)) + } else { + data.value.packageList[i].sampleAmount = allSamplePieceSize.value + allSamplePieceSize.value = 0 + // return; + } } } // data.value.packageList.forEach(item=>{ @@ -802,6 +809,7 @@ return; } await InspectionJobMainApi.stagingInspectionJobMain(data.value); + message.success("暂存成功") } catch { console.log(111) } diff --git a/src/views/wms/purchasereceiptManage/purchasereturn/purchasereturnRecordMain/index.vue b/src/views/wms/purchasereceiptManage/purchasereturn/purchasereturnRecordMain/index.vue index fc338441d..4303e7e04 100644 --- a/src/views/wms/purchasereceiptManage/purchasereturn/purchasereturnRecordMain/index.vue +++ b/src/views/wms/purchasereceiptManage/purchasereturn/purchasereturnRecordMain/index.vue @@ -167,8 +167,14 @@ const handleExport = async () => { await message.exportConfirm() // 发起导出 exportLoading.value = true - const data = await PurchasereturnRecordMainApi.exportPurchasereturnRecordMain(tableObject.params) - download.excel(data, `${t('ts.采购退货记录主')}.xlsx`) + if(routeName.value.includes('SCP')){ + const data = await PurchasereturnRecordMainApi.exportPurchasereturnRecordMainSCP(tableObject.params) + download.excel(data, `${t('ts.采购退货记录主')}.xlsx`) + }else{ + const data = await PurchasereturnRecordMainApi.exportPurchasereturnRecordMain(tableObject.params) + download.excel(data, `${t('ts.采购退货记录主')}.xlsx`) + } + } catch { } finally { exportLoading.value = false