From 526d5d78829452142f5ae5ae1e8ca799069ca277 Mon Sep 17 00:00:00 2001 From: ljlong_2630 Date: Tue, 7 May 2024 09:56:56 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E9=80=89=E5=AE=9A=E9=9B=86=E6=94=B9?= =?UTF-8?q?=E9=80=A0=E8=A1=A5=E5=85=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../selectedProject/selectedProject.data.ts | 3 ++- .../qms/basicDataManage/selectedSet/index.vue | 27 +++++++++++++++++-- 2 files changed, 27 insertions(+), 3 deletions(-) diff --git a/src/views/qms/basicDataManage/selectedProject/selectedProject.data.ts b/src/views/qms/basicDataManage/selectedProject/selectedProject.data.ts index 875da6e3d..12f0117a7 100644 --- a/src/views/qms/basicDataManage/selectedProject/selectedProject.data.ts +++ b/src/views/qms/basicDataManage/selectedProject/selectedProject.data.ts @@ -10,6 +10,7 @@ export const SelectedProjectRules = reactive({ // dictionaryTypeAndCode: [required], estimateCode: [required], defectLevel: [required], + dictionaryValue: [required] }) export const SelectedProject = useCrudSchemas(reactive([ @@ -28,7 +29,7 @@ export const SelectedProject = useCrudSchemas(reactive([ } }, { - label: '选定集', + label: '字典项', field: 'dictionaryValue', sort: 'custom', isSearch: true, diff --git a/src/views/qms/basicDataManage/selectedSet/index.vue b/src/views/qms/basicDataManage/selectedSet/index.vue index 9047a67c1..b302283f1 100644 --- a/src/views/qms/basicDataManage/selectedSet/index.vue +++ b/src/views/qms/basicDataManage/selectedSet/index.vue @@ -108,6 +108,7 @@ const tableData = ref([]) const routeName = ref() const selectDictType = ref() const optionsList = ref() +const existValue = ref([]) routeName.value = route.name const tableColumns = ref(SelectedSet.allSchemas.tableColumns) @@ -377,16 +378,37 @@ const validateNotRepetition = (data) => { }; -const detailValidate = (data) => { +const detailValidate = (formType,data) => { let tag = true; + existValue.value.forEach(item=>{ + if(data.dictionaryValue == item.dictionaryValue){ + message.warning("选定集字典项不能重复!") + tag = false; + } + }) return tag } const detailOpenForm = (type, row, masterParmas) => { + let param = { + masterId : masterParmas.masterId + } if(type == 'create'){ + SelectedProjectApi.getSelectedProjectNoPage(param).then(res => { + if(res.length > 0){ + existValue.value = res + } + }) }else if('update'){ + SelectedProjectApi.getSelectedProjectNoPage(param).then(res => { + if(res.length > 0){ + existValue.value = res.filter(item=>{ + return item?.id != row.id + }) + } + }) + } - } @@ -396,6 +418,7 @@ const detailBasiFormOnChange = (field,val,detailFormRef) => { } const formSelectChange = (a,b,c,d) => { + } /** 初始化 **/ From 07ba572b92d572e0ce39b854fc2e9bfa914378cf Mon Sep 17 00:00:00 2001 From: yufei0306 <13417315+yufei0306@user.noreply.gitee.com> Date: Tue, 7 May 2024 13:26:57 +0800 Subject: [PATCH 2/4] =?UTF-8?q?PDF=EF=BC=8C=E5=9B=BE=E7=89=87=E9=A2=84?= =?UTF-8?q?=E8=A7=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Annex/src/Annex.vue | 25 +++++++- src/components/Detail/src/Detail.vue | 10 +++- src/components/PreviewPDF/index.vue | 60 +++++++++++++++++++ .../supplierdeliverRecordMain/index.vue | 38 +++++++++++- .../supplierdeliverRequestMain/index.vue | 1 + 5 files changed, 128 insertions(+), 6 deletions(-) create mode 100644 src/components/PreviewPDF/index.vue diff --git a/src/components/Annex/src/Annex.vue b/src/components/Annex/src/Annex.vue index ef289c6a8..cb68ced7d 100644 --- a/src/components/Annex/src/Annex.vue +++ b/src/components/Annex/src/Annex.vue @@ -16,17 +16,20 @@
{{ item.size }}KB
来自 {{ item.nickname }}
- - + + +
{{ formatDate(item.createTime) }}
+ diff --git a/src/components/Detail/src/Detail.vue b/src/components/Detail/src/Detail.vue index d3308ecf0..3428a8a8f 100644 --- a/src/components/Detail/src/Detail.vue +++ b/src/components/Detail/src/Detail.vue @@ -223,6 +223,7 @@ const props = defineProps({ default: ()=>({ label: '附件', showDownload:false, + showPreview:false, hiddenDelete:false }) }, @@ -460,10 +461,14 @@ const getFileList = async () => { } } // 获取其他附件列表篇 -const getAnnexFileList = async (row:id) => { - console.log('getAnnexFileList') +const getAnnexFileList = async (row) => { props.annexTable?.forEach(async (item) => { let requstData = {...remarksData.data,tableName: item?.tableName} + if(item?.queryParams){ + item?.queryParams?.forEach(queryItem => { + requstData[queryItem.queryField] = row[queryItem.rowField] + }); + } const annexList = await FileApi.getFileList(requstData) const annexData = annexTableData.value.find(annex=>annex.label === item.label) if(annexData){ @@ -476,6 +481,7 @@ const getAnnexFileList = async (row:id) => { annexList, hasSubDetail:item.hasSubDetail||false, subDetailTableData:item.subDetailTableData, + showPreview:item.showPreview||false, // 是否展示预览按钮 showDownload:item.showDownload||false, // 是否展示下载按钮 hiddenDelete:item.hiddenDelete || false, // 是否展示删除按钮 }) diff --git a/src/components/PreviewPDF/index.vue b/src/components/PreviewPDF/index.vue new file mode 100644 index 000000000..696f1b105 --- /dev/null +++ b/src/components/PreviewPDF/index.vue @@ -0,0 +1,60 @@ + + + + + \ No newline at end of file diff --git a/src/views/wms/purchasereceiptManage/supplierdeliver/supplierdeliverRecordMain/index.vue b/src/views/wms/purchasereceiptManage/supplierdeliver/supplierdeliverRecordMain/index.vue index 4c6a3afae..660f8b0e2 100644 --- a/src/views/wms/purchasereceiptManage/supplierdeliver/supplierdeliverRecordMain/index.vue +++ b/src/views/wms/purchasereceiptManage/supplierdeliver/supplierdeliverRecordMain/index.vue @@ -53,6 +53,31 @@ import download from '@/utils/download' +import * as SupplierdeliverInspectionDetailApi from '@/api/wms/supplierdeliverInspectionDetail' +import {   SupplierdeliverInspectionDetail,SupplierdeliverInspectionDetailRules} from '../supplierdeliverInspectionDetail/supplierdeliverInspectionDetail.data' import { SupplierdeliverRecordMain,SupplierdeliverRecordMainRules, SupplierdeliverRecordDetail,SupplierdeliverRecordDetailRules,SupplierdeliverRecordDetailPickingNumer } from './supplierdeliverRecordMain.data' import * as SupplierdeliverRecordMainApi from '@/api/wms/supplierdeliverRecordMain' import * as SupplierdeliverRecordDetailApi from '@/api/wms/supplierdeliverRecordDetail' +import * as SupplierdeliverRequestDetailApi from '@/api/wms/supplierdeliverRequestDetail' import * as defaultButtons from '@/utils/disposition/defaultButtons' import { getAccessToken } from '@/utils/auth' import { CACHE_KEY, useCache } from '@/hooks/web/useCache' @@ -197,9 +225,17 @@ const { getList:getDetailList } = detatableMethods const { wsCache } = useCache() /** 详情操作 */ const detailRef = ref() -const openDetail = (row: any, titleName: any, titleValue: any) => { +const openDetail = async (row: any, titleName: any, titleValue: any) => { const departmentCode = wsCache.get(CACHE_KEY.DEPT).find((account) => account.id == row.departmentCode)?.name if (departmentCode) row.departmentCode = JSON.parse(JSON.stringify(departmentCode)) + //获取申请中的masterId + const { tableObject: requestTableObject, tableMethods:requestTableMethods } = useTable({ + getListApi: SupplierdeliverRequestDetailApi.getSupplierdeliverRequestDetailPage // 分页接口 + }) + const { getList:requestGetList } = requestTableMethods + requestTableObject.params.number = 'REQ0120240506-0002' + await requestGetList() + row.annexMasterId = requestTableObject.tableList[0].masterId detailRef.value.openDetail(row, titleName, titleValue,'recordSupplierdeliverMain') } diff --git a/src/views/wms/purchasereceiptManage/supplierdeliver/supplierdeliverRequestMain/index.vue b/src/views/wms/purchasereceiptManage/supplierdeliver/supplierdeliverRequestMain/index.vue index abe1f8cbc..4002104d1 100644 --- a/src/views/wms/purchasereceiptManage/supplierdeliver/supplierdeliverRequestMain/index.vue +++ b/src/views/wms/purchasereceiptManage/supplierdeliver/supplierdeliverRequestMain/index.vue @@ -82,6 +82,7 @@ prop: 'uploadFile', tableName:'SupplierdeliverInspectionDetail', hasSubDetail:true, // 附件中是否展示明细表 + showPreview:true, // 附件中是否展示预览按钮 align:'left', //明细表数据 subDetailTableData:{ From 9143fdec2b7ecd233dbd260cdeaecfde0c03e885 Mon Sep 17 00:00:00 2001 From: yufei0306 <13417315+yufei0306@user.noreply.gitee.com> Date: Tue, 7 May 2024 13:31:01 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E5=9B=BE=E7=89=87=E9=A2=84=E8=A7=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Detail/src/Detail.vue | 1 + src/components/PreviewPDF/index.vue | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/Detail/src/Detail.vue b/src/components/Detail/src/Detail.vue index 3428a8a8f..ad389ea97 100644 --- a/src/components/Detail/src/Detail.vue +++ b/src/components/Detail/src/Detail.vue @@ -103,6 +103,7 @@ - + From 24ed368b866dd016a7dca8e65d16bbbd4fdc1298 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B7=BB=E7=A0=96-JAVA=5CAdministrator?= <591141169@qq.com> Date: Tue, 7 May 2024 13:38:37 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=E6=9A=82=E5=AD=98=E5=8A=9F=E8=83=BD?= =?UTF-8?q?=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../inspectionJob/inspectionJobMain/index.ts | 6 + src/utils/disposition/defaultButtons.ts | 14 ++ .../qms/inspection/inspectionJob/addForm.vue | 128 ++++++++++++++++++ .../qms/inspection/inspectionJob/index.vue | 1 - 4 files changed, 148 insertions(+), 1 deletion(-) diff --git a/src/api/qms/inspectionJob/inspectionJobMain/index.ts b/src/api/qms/inspectionJob/inspectionJobMain/index.ts index 2b59a7401..aca7fd268 100644 --- a/src/api/qms/inspectionJob/inspectionJobMain/index.ts +++ b/src/api/qms/inspectionJob/inspectionJobMain/index.ts @@ -22,6 +22,11 @@ export const createInspectionJobMain = async (data) => { return await request.post({ url: `/qms/inspection-job-main/create`, data }) } +// 暂存检验任务 +export const stagingInspectionJobMain = async (data) => { + return await request.post({ url: `/qms/inspection-job-main/staging`, data }) +} + // 修改检验任务 export const updateInspectionJobMain = async (data) => { return await request.put({ url: `/qms/inspection-job-main/update`, data }) @@ -46,6 +51,7 @@ export const abandonInspectionJobMain = async (id) => { export const closeInspectionJobMain = async (id) => { return await request.put({ url: `/qms/inspection-job-main/close?id=` + id }) } + // 导出检验申请 Excel export const exportInspectionJobMain = async (params) => { return await request.download({ url: `/qms/inspection-job-main/export-excel`, params }) diff --git a/src/utils/disposition/defaultButtons.ts b/src/utils/disposition/defaultButtons.ts index 164f2c295..1d967ae75 100644 --- a/src/utils/disposition/defaultButtons.ts +++ b/src/utils/disposition/defaultButtons.ts @@ -187,6 +187,20 @@ export function formCloseBtn(option:any) { }) } +// form表单-关闭按钮 +export function formStagingBtn(option:any) { + return __defaultBtnOption(option,{ + label: t(`btn.暂存`).replace('btn.', ''), + name: 'staging', + hide: false, + + color: '', + float:'right', + hasPermi: '' + }) +} + + // drawer抽屉头部-编辑按钮 export function drawerEditBtn(option:any) { return __defaultBtnOption(option,{ diff --git a/src/views/qms/inspection/inspectionJob/addForm.vue b/src/views/qms/inspection/inspectionJob/addForm.vue index 8d3704a9a..c38c44d2d 100644 --- a/src/views/qms/inspection/inspectionJob/addForm.vue +++ b/src/views/qms/inspection/inspectionJob/addForm.vue @@ -522,6 +522,10 @@ const buttonBaseClick =async(val) => { // await InspectionJobMainApi.abandonInspectionJobMain(data.value.id) dialogVisible.value = false } + // 暂存 + else if (val == 'staging') { + staging() + } } // 传递给父类 const emit = defineEmits(['submitForm', 'searchTableSuccess']) @@ -661,12 +665,136 @@ const submitForm = async () => { console.log(111) } } + + +const staging = async () => { + try { + console.log(data.value.subList) + const elForm = unref(formMainRef)?.getElFormRef() + // 校验表单 + if (!elForm) return + const valid = await elForm.validate() + if (!valid) return + // 校验包装列表 + + console.log(11,data.value.packageList) + if(data.value.packageList?.length>0){ + const validateForm1 = await tableFormRef.value.validateForm() + if (!validateForm1) return + let isPass = data.value.packageList.some(cur=>parseFloat(cur.sampleAmount)>parseFloat(cur.amount)) + if(isPass){ + message.error(`采样数量不能大于数量`) + return + } + // let number = 0 + // data.value.packageList.forEach(cur=>{ + // number += parseFloat(cur.sampleAmount) + // }) + // number = number.toFixed('2') + // if(number != data.value.sampleTotalAmount){ + // message.error(`采样数量之和必须等于采样总数量`) + // return + // } + } + + const bol2 = await validateForm(formFeaturesRef.value) + if (!bol2) { + message.error(`模板中有检验工序和检验特性未填写完全`) + return + } + // 判断数组是否有未填的选项 + let arrBol = [] + let isOutweigh = []//结束时间是否大于开始时间 + let numberList = []//判断合格数量和不合格数量之和是否等于主表数量 + let parseFloatList = []//判断合格数量和不合格数量是否是整数 + data.value.subList.forEach((item, index) => { + if (item.inspectionJobCharacteristicsUpdateReqVO.resultEntryMethod == 1) { + arrBol.push( + item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList.some( + (cur, key) => { + return !cur.qualifiedQuantity || !cur.unqualifiedQuantity + } + ) + ) + } + if (item.inspectionJobCharacteristicsUpdateReqVO.featureType == 0) { + arrBol.push( + item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList.some( + (cur, key) => { + return !cur.inspectionValue + } + ) + ) + } + if (item.inspectionJobCharacteristicsUpdateReqVO.featureType == 1) { + arrBol.push( + item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList.some( + (cur, key) => { + return !cur.qualitativeCode + } + ) + ) + } + // 开始时间大于结束时间放入数组中 + if (item.inspectionJobCharacteristicsUpdateReqVO.inspectionStartTime >item.inspectionJobCharacteristicsUpdateReqVO.inspectionEndTime) { + isOutweigh.push(item.inspectionJobCharacteristicsUpdateReqVO.inspectionStartTime) + } + // 合格数量和不合格数量之和不能是小数 + if (item.inspectionJobCharacteristicsUpdateReqVO.resultEntryMethod == 1) { + parseFloatList.push( + item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList.some( + (cur, key) => { + return String(cur.qualifiedQuantity).indexOf('.')>-1 || String(cur.unqualifiedQuantity).indexOf('.')>-1 + } + ) + ) + // 合格数量和不合格数量之和不等于总数量 + numberList.push( + item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList.some( + (cur, key) => { + console.log(12,cur.qualifiedQuantity) + console.log(13,cur.unqualifiedQuantity) + console.log(14,item.inspectionJobCharacteristicsUpdateReqVO.sampleQty) + return parseFloat(cur.qualifiedQuantity) + parseFloat(cur.unqualifiedQuantity) != parseFloat(item.inspectionJobCharacteristicsUpdateReqVO.sampleQty) + } + ) + ) + } + }) + let isEmpty1 = arrBol.some(item=>item == true) + let isEmptyNumberList = numberList.some(item=>item == true) + let isParseFloat = parseFloatList.some(item=>item == true) + if(isEmpty1){ + message.error('检验工序和检验特性有字段未填写完全') + return; + } + if(isOutweigh?.length>0){ + message.error('检验特性中有开始时间大于结束时间') + return; + } + if(isParseFloat){ + message.error('合格数量和不合格数量之和不可以是小数') + return; + } + if(isEmptyNumberList){ + message.error('合格数量和不合格数量之和必须等于样品份数') + return; + } + await InspectionJobMainApi.stagingInspectionJobMain(data.value) + message.success('暂存成功!') + } catch { + console.log(111) + } +} + + /** 弹窗按钮 */ let Butttondata: any = [] if (props.footButttondata) { Butttondata = props.footButttondata } else { Butttondata = [ + defaultButtons.formStagingBtn(null), // 暂存 defaultButtons.formSaveBtn(null), // 保存 defaultButtons.formCloseBtn(null) // 关闭 ] diff --git a/src/views/qms/inspection/inspectionJob/index.vue b/src/views/qms/inspection/inspectionJob/index.vue index 1c3b1f33b..5b24b0c84 100644 --- a/src/views/qms/inspection/inspectionJob/index.vue +++ b/src/views/qms/inspection/inspectionJob/index.vue @@ -203,7 +203,6 @@ const list = ref([]) detailRef.value.openDetail(row, titleName, titleValue, 'basicInspectionJobMain') } //执行 - const formRef = ref() const execute = async (type : string, row ?: number) => { formRef.value.open(type, row)