From dd961ba5038e60fce08b4fa881f456336f08d968 Mon Sep 17 00:00:00 2001 From: wangyufei <2267742828@qq.com> Date: Tue, 9 Jul 2024 15:37:56 +0800 Subject: [PATCH] =?UTF-8?q?=E9=BB=98=E8=AE=A4=E4=BE=9B=E5=BA=94=E5=95=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../supplierdeliverRequestMain/index.vue | 16 ++++++++++++++-- .../supplierdeliverBasicForm.vue | 3 ++- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/src/views/wms/purchasereceiptManage/supplierdeliver/supplierdeliverRequestMain/index.vue b/src/views/wms/purchasereceiptManage/supplierdeliver/supplierdeliverRequestMain/index.vue index 0efeed9b4..f5a35e350 100644 --- a/src/views/wms/purchasereceiptManage/supplierdeliver/supplierdeliverRequestMain/index.vue +++ b/src/views/wms/purchasereceiptManage/supplierdeliver/supplierdeliverRequestMain/index.vue @@ -682,7 +682,7 @@ const formRef = ref() const supplierdeliverFormRef = ref() const openForm = async (type: string, row?: number) => { - supplierdeliverFormRef.value.openForm(type, row) + supplierdeliverFormRef.value.openForm(type, row,defaultSupplierCode.value) // if(type == "update"){ // SupplierdeliverRequestMain.allSchemas.formSchema.forEach((item) => { // if(item.field == 'supplierCode'){ @@ -1176,9 +1176,21 @@ const formFormDateChange = (field, val, row, index) => { row.supplierBatch = produceDateStr } } - +const defaultSupplierCode = ref('') + const getDefaultSupplier = async ()=>{ + let supplier = await SupplierApi.getSupplierPageSCP({isSearch:false}) + if(supplier.list&&supplier.list.length>0){ + defaultSupplierCode.value = supplier.list[0]['code'] + }else{ + defaultSupplierCode.value = '' + } + console.log('defaultSupplierCode',defaultSupplierCode) + } + /** 初始化 **/ onMounted(async () => { + getDefaultSupplier() + getList() importTemplateData.templateUrl = await SupplierdeliverRequestMainApi.importTemplate() }) diff --git a/src/views/wms/purchasereceiptManage/supplierdeliver/supplierdeliverRequestMain/supplierdeliverBasicForm.vue b/src/views/wms/purchasereceiptManage/supplierdeliver/supplierdeliverRequestMain/supplierdeliverBasicForm.vue index 80268a9df..c4991cd51 100644 --- a/src/views/wms/purchasereceiptManage/supplierdeliver/supplierdeliverRequestMain/supplierdeliverBasicForm.vue +++ b/src/views/wms/purchasereceiptManage/supplierdeliver/supplierdeliverRequestMain/supplierdeliverBasicForm.vue @@ -132,7 +132,7 @@ const openFormByCreate = async ( data ) => { formRef.value.formRef.setValues(setV) }) } -const openForm = async (type: string, row?: number) => { +const openForm = async (type: string, row?: number, defaultSupplierCode?: string) => { if(type == "update"){ SupplierdeliverRequestMain.allSchemas.formSchema.forEach((item) => { if(item.field == 'supplierCode'){ @@ -154,6 +154,7 @@ const openForm = async (type: string, row?: number) => { SupplierdeliverRequestMain.allSchemas.formSchema.forEach((item) => { if(item.field == 'supplierCode'){ item.componentProps.isSearchList = true + item.value = defaultSupplierCode } if(item.field == 'ppNumber'){ item.componentProps.isSearchList = true