diff --git a/src/views/qms/inspectionQ2/index.vue b/src/views/qms/inspectionQ2/index.vue index 20be438ea..a624b9859 100644 --- a/src/views/qms/inspectionQ2/index.vue +++ b/src/views/qms/inspectionQ2/index.vue @@ -49,6 +49,14 @@ { /** 添加/修改操作 */ const basicFormRef = ref() const openForm = (type: string, row?: any) => { - basicFormRef.value.open(type, row) + if (row && row.claimAddress?.trim()) { + row.filePathList = row.claimAddress.split(',') + } + + if (row && row.filePathList && row.filePathList.length > 0) { + row.filePathListView = row.filePathList.map((item) => { + return { + name: item, + url: item + } + }) + } + if(!row || !row.claimAmount){ nextTick(() => { basicFormRef.value.formRef.setValues({ @@ -463,7 +483,26 @@ const openForm = (type: string, row?: any) => { disbursementAmount: 0 }) }) + const currentTime = new Date().getTime() + const fileId = Q2.allSchemas.formSchema.find((item) => item.field == 'fileId') + const uploadFile = Q2.allSchemas.formSchema.find( + (item) => item.field == 'claimAddress' + ) + if (fileId) { + fileId['value'] = currentTime + } + if (uploadFile) { + uploadFile['componentProps']['upData']['tableId'] = currentTime + uploadFile['componentProps']['modelValue'] = [] + } } + else if (type == 'update') { + const uploadFile = Q2.allSchemas.formSchema.find( + (item) => item.field == 'claimAddress' + ) + uploadFile['componentProps']['modelValue'] = row.filePathListView + } + basicFormRef.value.open(type, row) } // form表单提交 diff --git a/src/views/qms/inspectionQ2/inspectionQ2.data.ts b/src/views/qms/inspectionQ2/inspectionQ2.data.ts index 2f1c9b16f..408786daf 100644 --- a/src/views/qms/inspectionQ2/inspectionQ2.data.ts +++ b/src/views/qms/inspectionQ2/inspectionQ2.data.ts @@ -596,7 +596,26 @@ export const Q2 = useCrudSchemas( } } }, - + { + label: '索赔单附件', + field: 'claimAddress', + sort: 'custom', + isTable: true, + table: { + width: 150 + }, + form: { + component: 'UploadFile', + componentProps: { + upData: { + tableName: 'basicInspectionQ2', + tableId: '' + }, + fileType: ['doc', 'xls', 'ppt', 'txt'], + modelValue: [] + } + } + }, { label: '状态', field: 'status', diff --git a/src/views/wms/purchasereceiptManage/purchasereturn/purchasereturnRecordMain/index.vue b/src/views/wms/purchasereceiptManage/purchasereturn/purchasereturnRecordMain/index.vue index e6c4d78ae..646d22353 100644 --- a/src/views/wms/purchasereceiptManage/purchasereturn/purchasereturnRecordMain/index.vue +++ b/src/views/wms/purchasereceiptManage/purchasereturn/purchasereturnRecordMain/index.vue @@ -143,15 +143,15 @@ const butttondata = (row,$index) => { const buttonTableClick = async (val, row) => { if (val == 'documentPrint') { // 单据打印 - handleDocumentPrint(row.id) + handleDocumentPrint(row.requestNumber,row.itemCode) } } // 单据打印 const BASE_URL = getJmreportBaseUrl() const documentSrc = ref(BASE_URL + '/jmreport/view/920874172025987072?token=' + getAccessToken()) -const handleDocumentPrint = async (id) => { - window.open(documentSrc.value + '&id=' + id) +const handleDocumentPrint = async (requestNumber,itemCode) => { + window.open(documentSrc.value + '&requestNumber=' + requestNumber +'&itemCode=' + itemCode) } // 获取部门 用于详情 部门回显 const { wsCache } = useCache() diff --git a/src/views/wms/purchasereceiptManage/purchasereturn/purchasereturnRequestMain/index.vue b/src/views/wms/purchasereceiptManage/purchasereturn/purchasereturnRequestMain/index.vue index 4441297a9..e45740eed 100644 --- a/src/views/wms/purchasereceiptManage/purchasereturn/purchasereturnRequestMain/index.vue +++ b/src/views/wms/purchasereceiptManage/purchasereturn/purchasereturnRequestMain/index.vue @@ -562,7 +562,10 @@ const butttondata = (row, $index) => { defaultButtons.mainListEditBtn({ hide: isShowMainButton(row, ['1']), hasPermi: 'wms:purchasereturn-request-main:update' - }) // 编辑 + }), // 编辑 + defaultButtons.mainListDocumentPrintBtn({ + hide: isShowMainButton(row, ['8']) + })// 打印标签 // { // label: '生成标签', // name: 'ssbq', @@ -608,12 +611,23 @@ const buttonTableClick = async (val, row) => { genLabelId.value = row.masterId await getDetailList() formLabelRef.value.open('create', row, null, 'createLabel') //创建标签页面 createLabel 标题 - } else if (val == 'point') { + } + else if (val == 'documentPrint') { + // 单据打印 + handleDocumentPrint(row.number,row.itemCode) + }else if (val == 'point') { // 标签打印 labelPrint(row) } } +// 单据打印 +const BASE_URL2 = getJmreportBaseUrl() +const documentSrc = ref(BASE_URL2 + '/jmreport/view/920874172025987072?token=' + getAccessToken()) +const handleDocumentPrint = async (number,itemCode) => { + window.open(documentSrc.value + '&requestNumber=' + number +'&itemCode=' + itemCode) +} + /** 添加/修改操作 */ const formRef = ref() const openForm = async (type: string, row?: number) => {