Browse Source

1:清空供应商代码时,清空明细

2:输入供应商后自动带出供应商联系人、联系电话、联系人电子邮件
3:筛选完供应商代码后,自动带出供应商物料明细
master_hella_20240701
yufei0306 7 months ago
parent
commit
d7c354187a
  1. 8
      src/components/BasicForm/src/BasicForm.vue
  2. 7
      src/components/Form/src/Form.vue
  3. 23
      src/views/wms/purchasereceiptManage/supplierdeliver/purchaseMain/index.vue

8
src/components/BasicForm/src/BasicForm.vue

@ -15,6 +15,7 @@
:schema="formSchema"
:is-col="true"
@opensearchTable="opensearchTable"
@clearSearchInput="clearSearchInput"
@onChange="onChange"
@onBlur="onBlur"
@onEnter="onEnter"
@ -413,7 +414,9 @@ const opensearchTable = (
)
}
const clearSearchInput = (field)=>{
emit('clearSearchInput',field)
}
const sumFormDataByTable = () => {
if(props.sumFormDataField){
const sumObject = {}
@ -603,7 +606,8 @@ const emit = defineEmits([
'onEnter',
'inputNumberChange',
'formFormDateChange',
'footButtonClick'
'footButtonClick',
'clearSearchInput'
])
//
const formSelectChange = (field, val, row) => {

7
src/components/Form/src/Form.vue

@ -54,7 +54,7 @@ export default defineComponent({
vLoading: propTypes.bool.def(false),
labelPosition: propTypes.string.def('left'),
},
emits: ['register','opensearchTable', 'onChange', 'onBlur','onEnter'],
emits: ['register','opensearchTable','clearSearchInput', 'onChange', 'onBlur','onEnter'],
setup(props, { slots, expose, emit }) {
// element form
const elFormRef = ref<ComponentRef<typeof ElForm>>()
@ -124,6 +124,9 @@ export default defineComponent({
emit('opensearchTable',field, searchField, searchTitle, searchAllSchemas, searchPage, searchCondition,multiple)
}
const clearSearchInput = (field) => {
emit('clearSearchInput')
}
expose({
setValues,
formModel,
@ -258,6 +261,7 @@ export default defineComponent({
}else{
formModel.value[item.field] = ''
}
clearSearchInput(item.field)
}}>
</ElButton>
)
@ -292,6 +296,7 @@ export default defineComponent({
}else{
formModel.value[item.field] = ''
}
clearSearchInput(item.field)
}}>
</ElButton>
)

23
src/views/wms/purchasereceiptManage/supplierdeliver/purchaseMain/index.vue

@ -56,6 +56,7 @@
@handleAddTable="handleAddTable"
@handleDeleteTable="handleDeleteTable"
@searchTableSuccess="searchTableSuccess"
@clearSearchInput="clearSearchInput"
@submitForm="submitForm"
@onChange="onChangeQty"
@onEnter="onEnter"
@ -120,6 +121,9 @@ console.log('PurchaseMain.allSchemas.searchSchema',PurchaseMain.allSchemas.searc
})
const clearSearchInput = (formField)=>{
tableData.value = []
}
//
const searchTableSuccess = (formField, searchField, val, formRef, type, row) => {
nextTick(async() => {
@ -140,6 +144,15 @@ console.log('PurchaseMain.allSchemas.searchSchema',PurchaseMain.allSchemas.searc
message.warning(`物料代码${repeatCode.join(',')}已经存在`);
}
if(val.length>0){
//frm
const setV = {}
tableData.value = [] //
setV['contactName']=val[0]['contacts']
setV['contactPhone']=val[0]['phone']
setV['contactEmail']=val[0]['email']
setV['taxRate']=val[0]['taxRate']
formRef.setValues(setV)
//
val.forEach(item=>{
const newRow = {...row}
newRow[formField] = item[searchField]
@ -169,8 +182,9 @@ console.log('PurchaseMain.allSchemas.searchSchema',PurchaseMain.allSchemas.searc
setV['contactPhone']=val[0]['phone']
setV['contactEmail']=val[0]['email']
setV['taxRate']=val[0]['taxRate']
formRef.setValues(setV)
onEnter('supplierCode')
}
formRef.setValues(setV)
}
})
}
@ -516,7 +530,12 @@ console.log('PurchaseMain.allSchemas.searchSchema',PurchaseMain.allSchemas.searc
}
const onEnter = (field)=>{
formRef.value.handleAddTable()
const timer = setTimeout(()=>{
formRef.value.handleAddTable()
if(timer){
clearTimeout(timer)
}
},500)
}
/** 初始化 **/
onMounted(async () => {

Loading…
Cancel
Save