Browse Source

默认供应商

master_hella_20240701
wangyufei 4 months ago
parent
commit
dd961ba503
  1. 14
      src/views/wms/purchasereceiptManage/supplierdeliver/supplierdeliverRequestMain/index.vue
  2. 3
      src/views/wms/purchasereceiptManage/supplierdeliver/supplierdeliverRequestMain/supplierdeliverBasicForm.vue

14
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()
})

3
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

Loading…
Cancel
Save