Browse Source

Merge branch 'master_hella' of http://dev.ccwin-in.com:3000/sfms3.0/sfms3.0-ui into master_hella

hella_online_20240911
yufei_wang 2 months ago
parent
commit
d6cae11418
  1. 6
      src/components/Search/src/Search.vue
  2. 31
      src/views/wms/inventoryManage/balanceSummary/index.vue

6
src/components/Search/src/Search.vue

@ -71,7 +71,7 @@ const props = defineProps({
},
})
const emit = defineEmits(['search', 'reset','onInput','onChange','onEnter','searchTableSuccess'])
const emit = defineEmits(['search', 'reset','onInput','onChange','onEnter','searchTableSuccess','onBlur'])
const visible = ref(true)
@ -288,6 +288,9 @@ const setVisible = () => {
const searchTableSuccess = (formField, searchField, val, type, row) => {
emit('searchTableSuccess', formField, searchField, val, formRef.value, type, row)
}
const onBlur = async (field, e) => {
emit('onBlur', field, e)
}
const Search = ref()
onMounted(() => {})
defineExpose({setFormValues,search}) // open
@ -312,6 +315,7 @@ defineExpose({setFormValues,search}) // 提供 open 方法,用于打开弹窗
@onChange="onChange"
@onEnter="onEnter"
@onSubmit="onSubmit"
@onBlur="onBlur"
>
<template #action>
<div v-if="layout === 'inline'">

31
src/views/wms/inventoryManage/balanceSummary/index.vue

@ -1,7 +1,7 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search :schema="BalanceSummarySearch.allSchemas.searchSchema" @search="searchList" @reset="searchList" @searchTableSuccess="searchQueryTableSuccess"/>
<Search ref="searchRef" :schema="BalanceSummarySearch.allSchemas.searchSchema" @search="searchList" @reset="searchList" @searchTableSuccess="searchQueryTableSuccess" @onBlur="onBlur"/>
</ContentWrap>
<!-- 列表头部 -->
<TableHead
@ -27,6 +27,7 @@
</template>
<script setup lang="ts">
//
import * as ItembasicApi from '@/api/wms/itembasic'
import * as BalanceApi from '@/api/wms/balance'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import { formatDate } from '@/utils/formatTime'
@ -145,7 +146,35 @@ const searchList = (model)=>{
tableData.value = []
}
}
const searchRef = ref()
const onBlur = async (field, e) => {
console.log('onBlur',field, e)
if(e){
let res = await ItembasicApi.getItembasicPage({
isSearch:true,
"filters":[{
"column":"code",
"action":"==",
"value":e
},{
"action":"==",
"column":"available",
"value":"TRUE"
}],
pageSize:20,
pageNo:1,
sort:"",
by:"ASC"
})
if(res&&res.list&&res.list.length>0){
const setV = {}
setV['desc1'] = res.list[0]['desc1']
searchRef.value.setFormValues(setV)
}
console.log('res',res)
}
}
const searchQueryTableSuccess = (formField, searchField, val, formRef, type, row ) => {
console.log('searchQueryTableSuccess',formField, searchField, val, formRef, type, row )
nextTick(() => {

Loading…
Cancel
Save