ljlong_2630 1 week ago
parent
commit
00dbf6c67c
  1. 2
      src/api/wms/business/inputBlur.ts
  2. 56
      src/components/BasicForm/src/BasicForm.vue
  3. 3
      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) { if (list.value?.length == 0) {
message.alert('暂无数据') message.alert('暂无数据')
formRef.setValues(setV) formRef.setValues(setV)
callback([])
return return
} }
if (arr1.length != list.value.length) { 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)) ...arr2.filter((item) => !arr1.includes(item))
].join(',') ].join(',')
message.alert('代码' + str + '没有找到对应数据') message.alert('代码' + str + '没有找到对应数据')
callback([])
formRef.setValues(setV) formRef.setValues(setV)
return return
} }

56
src/components/BasicForm/src/BasicForm.vue

@ -1008,33 +1008,37 @@ const onChange = (field, cur) => {
* @param field 当前操作字段 * @param field 当前操作字段
* @param e * @param e
*/ */
const isOnBlur = ref(true)
const onBlur = async (field, e) => { const onBlur = async (field, e) => {
let formSchemaObj = formSchema.value.find((item) => item.field == field)?.componentProps // isOnBlurfalsetrue
if (formSchemaObj?.enterSearch) { if (isOnBlur.value) {//bug
await FormBlur( let formSchemaObj = formSchema.value.find((item) => item.field == field)?.componentProps
field, if (formSchemaObj?.enterSearch) {
e, await FormBlur(
routeName.value, field,
formRef.value, e,
props.detailData, routeName.value,
formSchemaObj, formRef.value,
(list) => { props.detailData,
emit('searchTableSuccess', field, formSchemaObj.searchField, list, formRef.value, 'form') formSchemaObj,
} (list) => {
) emit('searchTableSuccess', field, formSchemaObj.searchField, list, formRef.value, 'form')
}
)
if (props.isShowFooterButtton && !props.footButttondata) { if (props.isShowFooterButtton && !props.footButttondata) {
Butttondata = [ Butttondata = [
defaultButtons.formSaveBtn(null), // defaultButtons.formSaveBtn(null), //
defaultButtons.formCloseBtn(null) // defaultButtons.formCloseBtn(null) //
] ]
count.value++ count.value++
}
sureDisabled.value= false
} else {
emit('onBlur', field, e)
} }
sureDisabled.value= false
} else {
emit('onBlur', field, e)
} }
} }
// //
@ -1138,6 +1142,7 @@ const inputStringFcous= (headerItem) => {
const onEnter = async (field, value, e) => { const onEnter = async (field, value, e) => {
let formSchemaObj = formSchema.value.find((item) => item.field == field)?.componentProps let formSchemaObj = formSchema.value.find((item) => item.field == field)?.componentProps
if (formSchemaObj?.enterSearch && formSchemaObj?.isEnter) { if (formSchemaObj?.enterSearch && formSchemaObj?.isEnter) {
isOnBlur.value = false//bug
await FormBlur( await FormBlur(
field, field,
value, value,
@ -1146,7 +1151,10 @@ const onEnter = async (field, value, e) => {
props.detailData, props.detailData,
formSchemaObj, formSchemaObj,
(list) => { (list) => {
emit('onEnter', field, value, e) isOnBlur.value = true
if (list.length != 0) {
emit('onEnter', field, value, e)
}
} }
) )
} else { } else {

3
src/components/Form/src/Form.vue

@ -325,10 +325,11 @@ export default defineComponent({
formItemSlotsSearchList[item.field] = () => { formItemSlotsSearchList[item.field] = () => {
return ( return (
<> <>
<ElInput class={'myInput'} v-model={formModel.value[item.field]} placeholder={t(`ts.${item?.componentProps?.searchListPlaceholder}`).replace('ts.','') || ''} onKeyup={(event)=>{ <ElInput class={'myInput'} v-model={formModel.value[item.field]} placeholder={t(`ts.${item?.componentProps?.searchListPlaceholder}`).replace('ts.','') || ''} onKeyup={(event)=>{
if(event.keyCode === 13){ if(event.keyCode === 13){
// //
emit('onEnter',item.field,formModel.value[item.field],event) 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: { form: {
labelMessage: '影响明细中物料代码,需在供应商物料中维护', labelMessage: '影响明细中物料代码,需在供应商物料中维护',
componentProps: { componentProps: {
isEnter: true,
enterSearch: true, enterSearch: true,
isSearchList: true, // 开启查询弹窗 isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请选择供应商代码', // 输入框占位文本 searchListPlaceholder: '请选择供应商代码', // 输入框占位文本

Loading…
Cancel
Save