Browse Source

失去焦点问题

hella_online_20240829
zhang_li 5 months ago
parent
commit
c8a05307f9
  1. 5
      src/api/wms/areabasic/index.ts
  2. 111
      src/components/BasicForm/src/BasicForm.vue
  3. 67
      src/views/wms/basicDataManage/itemManage/itemarea/itemarea.data.ts
  4. 20
      src/views/wms/basicDataManage/itemManage/itemwarehouse/itemwarehouse.data.ts
  5. 11
      src/views/wms/basicDataManage/itemManage/packageunit/packageunit.data.ts
  6. 8
      src/views/wms/basicDataManage/itemManage/productionlineitem/productionlineitem.data.ts

5
src/api/wms/areabasic/index.ts

@ -66,3 +66,8 @@ export const exportArea = async (params) => {
export const importTemplate = () => {
return request.download({ url: '/wms/areabasic/get-import-template' })
}
// 根据code获取数据列表
export const getAreabasicByCodes = async (params) => {
return await request.get({ url: `/wms/areabasic/listByCodes`, params })
}

111
src/components/BasicForm/src/BasicForm.vue

@ -856,63 +856,16 @@ const onBlur = async (field, e) => {
formSchema.value.find((item) => item.field == field)?.componentProps?.verificationParams ||
[]
console.log('走新方法啦')
searchCondition = [...searchCondition, ...verificationParams]
// searchCondition = [...searchCondition, ...verificationParams]
if (e && isString(e)) {
let setV = {}
setV[field] = ''
let params = {}
// keyvalue
// if (searchCondition1 && searchCondition1.length > 0) {
// for (let i = 0; i < searchCondition1.length; i++) {
// searchCondition1[i].isSearch = true
// if (searchCondition1[i].isMainValue) {
// params[searchCondition1[i].key] = formRef.value.formModel[searchCondition1[i].value]
// ? formRef.value.formModel[searchCondition1[i].value]
// : props.detailData
// ? props.detailData[searchCondition1[i].value]
// : ''
// //
// let isNull = false
// if (params[searchCondition1[i].key] == '' || params[searchCondition1[i].key] == undefined) {
// isNull = true
// }
// if (isNull) {
// message.warning(
// searchCondition1[i].message ? searchCondition1[i].message : ''
// )
// return
// }
// } else {
// //
// if (searchCondition1[i].isSearch) {
// if (searchCondition1[i].isFormModel) {
// //formModel
// if (searchCondition1[i].required) {
// if (
// formRef.value.formModel[searchCondition1[i].value] == '' ||
// formRef.value.formModel[searchCondition1[i].value] == undefined
// ) {
// message.warning(
// searchCondition1[i].message
// ? searchCondition1[i].message
// : ''
// )
// return
// }
// }
// }
// params[searchCondition1[i].key] = searchCondition1[i].value
// } else {
// params[searchCondition1[i].key] = searchCondition1[i].value
// }
// }
// }
// }
//
const _searchCondition = {}
let filters: any[] = []
if (searchCondition && searchCondition.length > 0) {
//
let filters: any[] = []
for (var i = 0; i < searchCondition.length; i++) {
// searchCondition.forEach((item) => {
// row
@ -925,9 +878,7 @@ const onBlur = async (field, e) => {
? props.detailData[searchCondition[i].value]
: // : row
// ? row[searchCondition[i].value]
e
? e.trim()
: ''
''
//
let isNull = false
if (
@ -942,7 +893,13 @@ const onBlur = async (field, e) => {
)
return
}
filters.push({
action: searchCondition[i].action || '==',
column: searchCondition[i].key,
value: formRef.value.formModel[searchCondition[i].value]
})
}
// else if (searchCondition[i].isTableRowValue) {
// if (searchCondition[i].required) {
// if (row[searchCondition[i].value] == '' || row[searchCondition[i].value] == undefined) {
@ -973,21 +930,49 @@ const onBlur = async (field, e) => {
}
}
filters.push({
action: searchCondition[i].action,
action: searchCondition[i].action || '==',
column: searchCondition[i].key,
value: formRef.value.formModel[searchCondition[i].value]
? formRef.value.formModel[searchCondition[i].value]
: e.trim()
})
} else {
filters.push({
action: searchCondition[i].action,
action: searchCondition[i].action || '==',
column: searchCondition[i].key,
value: searchCondition[i].value
})
}
} else {
_searchCondition[searchCondition[i].key] = searchCondition[i].value
filters.push({
action: searchCondition[i].action || '==',
column: searchCondition[i].key,
value: searchCondition[i].value
})
}
}
}
}
if (verificationParams && verificationParams.length > 0) {
//
for (var i = 0; i < verificationParams.length; i++) {
//
if (verificationParams[i].isSearch) {
if (verificationParams[i].isFormModel) {
filters.push({
action: verificationParams[i].action,
column: verificationParams[i].key,
value: formRef.value.formModel[verificationParams[i].value]
? formRef.value.formModel[verificationParams[i].value]
: e.trim()
})
} else {
filters.push({
action: verificationParams[i].action,
column: verificationParams[i].key,
value: verificationParams[i].value
})
}
} else {
_searchCondition[verificationParams[i].key] = verificationParams[i].value
}
}
}
@ -995,13 +980,18 @@ const onBlur = async (field, e) => {
_searchCondition.isSearch = true
_searchCondition.filters = filters
}
}
console.log(4545, _searchCondition)
let obj = {
by: 'ASC',
pageNo: 1,
pageSize: 20
}
params = { ..._searchCondition, ...obj }
console.log(888,_searchCondition)
params = {
isSearch:_searchCondition.isSearch,
filters:_searchCondition.filters,
...obj
}
// console.log(333,params)
if (!formSchemaObj?.multiple && e.indexOf(',') > -1) {
message.alert('该输入框只能输入一条数据')
@ -1059,6 +1049,7 @@ const onBlur = async (field, e) => {
isExecute.value = true
}
//
const batchAdd = async (val) => {
const row = {}

67
src/views/wms/basicDataManage/itemManage/itemarea/itemarea.data.ts

@ -38,7 +38,15 @@ export const Itemarea = useCrudSchemas(reactive<CrudSchema[]>([
key: 'available',
value: 'TRUE',
isMainValue: false
}]
}],
verificationParams: [{
key: 'code',
action: '==',
value: '',
isMainValue: false,
isSearch: true,
isFormModel: true,
}], // 失去焦点校验参数
}
}
},
@ -64,7 +72,15 @@ export const Itemarea = useCrudSchemas(reactive<CrudSchema[]>([
key: 'available',
value: 'TRUE',
isMainValue: false
}]
}],
verificationParams: [{
key: 'code',
action: '==',
value: '',
isMainValue: false,
isSearch: true,
isFormModel: true
}], // 失去焦点校验参数
}
}
},
@ -106,7 +122,15 @@ export const Itemarea = useCrudSchemas(reactive<CrudSchema[]>([
searchCondition: [{
key: 'available',
value: 'TRUE',
}]
}],
verificationParams: [{
key: 'code',
action: '==',
value: '',
isMainValue: false,
isSearch: true,
isFormModel: true
}], // 失去焦点校验参数
}
}
},
@ -136,7 +160,17 @@ export const Itemarea = useCrudSchemas(reactive<CrudSchema[]>([
value: 'itemCode',
message: "请选择物料代码",
isMainValue: true
}]
}],
verificationParams: [{
key: 'packUnit',
action: '==',
value: '',
isMainValue: false,
isSearch: true,
isFormModel: true,
required: true,
message: '请选择物料代码',
}], // 失去焦点校验参数
}
}
},
@ -166,7 +200,18 @@ export const Itemarea = useCrudSchemas(reactive<CrudSchema[]>([
value: 'itemCode',
message: "请选择物料代码",
isMainValue: true
}]
}],
verificationParams: [{
key: 'packUnit',
action: '==',
value: '',
isMainValue: false,
isSearch: true,
isFormModel: true,
required: true,
message: '请选择物料代码',
isBlurParams:true,//是否是失去焦点的方法的参数
}], // 失去焦点校验参数
}
}
},
@ -270,7 +315,17 @@ export const Itemarea = useCrudSchemas(reactive<CrudSchema[]>([
key: 'available',
value: 'TRUE',
isMainValue: false
}]
}],
verificationParams: [{
key: 'code',
action: '==',
value: '',
isMainValue: false,
isSearch: true,
isFormModel: true,
required: true,
message: '请选择物料代码',
}], // 失去焦点校验参数
}
}
},

20
src/views/wms/basicDataManage/itemManage/itemwarehouse/itemwarehouse.data.ts

@ -32,7 +32,15 @@ export const Itemwarehouse = useCrudSchemas(reactive<CrudSchema[]>([
action: '==',
isSearch: true,
isMainValue: false
}]
}],
verificationParams: [{
key: 'code',
action: '==',
value: '',
isMainValue: false,
isSearch: 'true',
isFormModel: true
}], // 失去焦点校验参数
}
}
},
@ -60,7 +68,15 @@ export const Itemwarehouse = useCrudSchemas(reactive<CrudSchema[]>([
action: '==',
isSearch: true,
isMainValue: false
}]
}],
verificationParams: [{
key: 'code',
action: '==',
value: '',
isMainValue: false,
isSearch: 'true',
isFormModel: true
}], // 失去焦点校验参数
}
}
},

11
src/views/wms/basicDataManage/itemManage/packageunit/packageunit.data.ts

@ -334,6 +334,7 @@ export const Packageunit = useCrudSchemas(reactive<CrudSchema[]>([
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
enterSearch: true,
isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请选择父包装代码', // 输入框占位文本
searchField: 'code', // 查询弹窗赋值字段
@ -344,7 +345,15 @@ export const Packageunit = useCrudSchemas(reactive<CrudSchema[]>([
key: 'available',
value: 'TRUE',
isMainValue: false
}]
}],
verificationParams: [{
key: 'code',
action: '==',
value: '',
isMainValue: false,
isSearch: 'true',
isFormModel: true
}], // 失去焦点校验参数
}
}
},

8
src/views/wms/basicDataManage/itemManage/productionlineitem/productionlineitem.data.ts

@ -116,6 +116,14 @@ export const Productionlineitem = useCrudSchemas(reactive<CrudSchema[]>([
searchTitle: '物料信息',
searchAllSchemas: Itembasic.allSchemas,
searchPage: ItembasicApi.getItembasicPage,
verificationParams: [{
key: 'code',
action: '==',
value: '',
isMainValue: false,
isSearch: 'true',
isFormModel: true
}], // 失去焦点校验参数
searchCondition: [
{
key:'enableMake',

Loading…
Cancel
Save