From 3d94b6ef35f136e9e8474c2e49a19e2319ba3d89 Mon Sep 17 00:00:00 2001 From: zhang_li <2235006734@qqq.com> Date: Fri, 23 Aug 2024 16:20:00 +0800 Subject: [PATCH] =?UTF-8?q?HL-5620=E4=BE=9B=E5=BA=94=E5=95=86=E5=8F=91?= =?UTF-8?q?=E7=A5=A8=E7=94=B3=E8=AF=B7=E3=80=81=E6=8F=90=E4=BA=A4=E5=AE=A1?= =?UTF-8?q?=E6=89=B9=E3=80=81=E7=BC=96=E8=BE=91=20=E4=BE=9B=E5=BA=94?= =?UTF-8?q?=E5=95=86=E7=A1=AE=E8=AE=A4=20=E9=87=87=E8=B4=AD=E7=82=B9?= =?UTF-8?q?=E5=87=BB=E5=AE=A1=E6=89=B9=E9=80=9A=E8=BF=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../supplierinvoiceRequestMain/index.vue | 69 ++++++++++++------- 1 file changed, 46 insertions(+), 23 deletions(-) diff --git a/src/views/wms/supplierManage/supplierinvoice/supplierinvoiceRequestMain/index.vue b/src/views/wms/supplierManage/supplierinvoice/supplierinvoiceRequestMain/index.vue index db04d29ab..945b65d1d 100644 --- a/src/views/wms/supplierManage/supplierinvoice/supplierinvoiceRequestMain/index.vue +++ b/src/views/wms/supplierManage/supplierinvoice/supplierinvoiceRequestMain/index.vue @@ -382,7 +382,7 @@ const searchList = (model) => { selectionRows.value = [] let model1 = { ...model, - statuss: model.status.join(',')?model.status.join(','):'' + statuss: model.status.join(',') ? model.status.join(',') : '' } delete model1.status setSearchParams(model1) @@ -673,6 +673,12 @@ const buttonTableClick = async (val, row) => { } else if (val == 'purchase_mainPlanSub') { // 采购审批通过 // handleApp(row.id) + // 校验是否可以开票 + const res = await checkInvoicingCalendar() + if (res?.flag) { + message.alertWarning(res.msg) + return + } if (row.balanceStatementStatus) { formPurchasePassRef.value.open('update', row, null, '采购审批通过', '采购审批通过') } else { @@ -796,7 +802,7 @@ const openForm = async (type: string, row?: any) => { // if (item.field == 'procurementCreator') { // item.componentProps.options = procurementCreators.value - + // } }) } @@ -813,21 +819,21 @@ const openForm = async (type: string, row?: any) => { } if (row && row.procurementCreator) row.procurementCreator = Number(row.procurementCreator) // 校验是否可以开票 - SupplierinvoiceRequestMainApi.checkInvoicingCalendar({}).then((res) => { - if (res.flag) { - message.alertWarning(res.msg) - return - } - tableData.value = [] // 重置明细数据 - formRef.value.open(type, row) - // if(type=='create'){ - // nextTick(() => { - // formRef.value.formRef.setValues({ - // procurementCreator:procurementCreators.value[0].id - // }) - // }) - // } + const res = await checkInvoicingCalendar() + if (res?.flag) { + message.alertWarning(res.msg) + return + } + tableData.value = [] // 重置明细数据 + formRef.value.open(type, row) +} + // 校验是否可以开票 +const checkInvoicingCalendar = async () => { + let resData = '' + await SupplierinvoiceRequestMainApi.checkInvoicingCalendar({}).then((res) => { + resData = res }) + return resData } const defaultSupplierCode = ref('') const getDefaultSupplier = async () => { @@ -983,6 +989,12 @@ const handleOpe = async (id: number) => { /** 提交审批按钮操作 */ const handleSub = async (id: number) => { try { + // 校验是否可以开票 + const res = await checkInvoicingCalendar() + if (res?.flag) { + message.alertWarning(res.msg) + return + } // 提交审批的二次确认 await message.confirm(t('ts.是否提交审批所选中数据?')) tableObject.loading = true @@ -1081,6 +1093,12 @@ const handleTur = async (id: number, cause: string) => { /** 发票寄出确认按钮操作 */ const handleInvoiceSentOut = async (id: number) => { try { + // 校验是否可以开票 + const res = await checkInvoicingCalendar() + if (res?.flag) { + message.alertWarning(res.msg) + return + } // 驳回的二次确认 await message.confirm(t('ts.是否确认发票寄出选中数据?')) tableObject.loading = true @@ -1165,7 +1183,7 @@ const genRecords = async (id: number) => { /** 导出按钮操作 */ const handleExport = async () => { - console.log(111) + console.log(111) let rows: any = [] selectionRows.value.forEach((item) => { rows = [...rows, ...item.selectionRows.map((item1) => item1.number)] @@ -1181,8 +1199,8 @@ const handleExport = async () => { } else { paramsData = { ...paramsData, checkNums: rows } } - if (!paramsData.createTime || paramsData.createTime && paramsData.createTime.length == 0) { - delete paramsData.createTime + if (!paramsData.createTime || (paramsData.createTime && paramsData.createTime.length == 0)) { + delete paramsData.createTime } try { // 导出的二次确认 @@ -1410,11 +1428,16 @@ const getLoginUserRoleList = async () => { /** 初始化 **/ onMounted(async () => { - - SupplierinvoiceRequestMain.allSchemas.formSchema.forEach(async item=>{ - if(item.field == 'procurementCreator'){ + SupplierinvoiceRequestMain.allSchemas.formSchema.forEach(async (item) => { + if (item.field == 'procurementCreator') { //采购审批人 - const procurementCreators = await SupplierinvoiceRequestMainApi.queryUserInfoByRoleCode({ roleCode: 'purchase',pageSize: 1000,pageNo: 1,sort: '',by: 'ASC' }) + const procurementCreators = await SupplierinvoiceRequestMainApi.queryUserInfoByRoleCode({ + roleCode: 'purchase', + pageSize: 1000, + pageNo: 1, + sort: '', + by: 'ASC' + }) item.componentProps.options = procurementCreators.list } })