ljlong_2630 1 week ago
parent
commit
00dbf6c67c
  1. 2
      src/api/wms/business/inputBlur.ts
  2. 10
      src/components/BasicForm/src/BasicForm.vue
  3. 1
      src/components/Form/src/Form.vue
  4. 1
      src/views/wms/purchasereceiptManage/supplierdeliver/purchasePlanMain/purchasePlanMain.data.ts

2
src/api/wms/business/inputBlur.ts

@ -416,6 +416,7 @@ export const FormBlur = async (field, val, routeName, formRef, detailData, formS
if (list.value?.length == 0) {
message.alert('暂无数据')
formRef.setValues(setV)
callback([])
return
}
if (arr1.length != list.value.length) {
@ -425,6 +426,7 @@ export const FormBlur = async (field, val, routeName, formRef, detailData, formS
...arr2.filter((item) => !arr1.includes(item))
].join(',')
message.alert('代码' + str + '没有找到对应数据')
callback([])
formRef.setValues(setV)
return
}

10
src/components/BasicForm/src/BasicForm.vue

@ -1008,8 +1008,10 @@ const onChange = (field, cur) => {
* @param field 当前操作字段
* @param e
*/
const isOnBlur = ref(true)
const onBlur = async (field, e) => {
// isOnBlurfalsetrue
if (isOnBlur.value) {//bug
let formSchemaObj = formSchema.value.find((item) => item.field == field)?.componentProps
if (formSchemaObj?.enterSearch) {
await FormBlur(
@ -1037,6 +1039,8 @@ const onBlur = async (field, e) => {
}
}
}
//
const batchAdd = async (val) => {
const row = {}
@ -1138,6 +1142,7 @@ const inputStringFcous= (headerItem) => {
const onEnter = async (field, value, e) => {
let formSchemaObj = formSchema.value.find((item) => item.field == field)?.componentProps
if (formSchemaObj?.enterSearch && formSchemaObj?.isEnter) {
isOnBlur.value = false//bug
await FormBlur(
field,
value,
@ -1146,8 +1151,11 @@ const onEnter = async (field, value, e) => {
props.detailData,
formSchemaObj,
(list) => {
isOnBlur.value = true
if (list.length != 0) {
emit('onEnter', field, value, e)
}
}
)
} else {
emit('onEnter', field, value, e)

1
src/components/Form/src/Form.vue

@ -329,6 +329,7 @@ export default defineComponent({
if(event.keyCode === 13){
//
emit('onEnter',item.field,formModel.value[item.field],event)
event.target.blur();//
}
}}

1
src/views/wms/purchasereceiptManage/supplierdeliver/purchasePlanMain/purchasePlanMain.data.ts

@ -68,6 +68,7 @@ export const PurchasePlanMain = useCrudSchemas(
form: {
labelMessage: '影响明细中物料代码,需在供应商物料中维护',
componentProps: {
isEnter: true,
enterSearch: true,
isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请选择供应商代码', // 输入框占位文本

Loading…
Cancel
Save