Browse Source

查询列表弹窗 新增配置条件 备料计划样例

master
陈薪名 1 year ago
parent
commit
9fab4b9cf1
  1. 21
      src/components/BasicForm/src/BasicForm.vue
  2. 8
      src/components/Form/src/Form.vue
  3. 3
      src/components/SearchTable/src/SearchTable.vue
  4. 20
      src/views/wms/issueManage/preparetoissueplan/preparetoissueMain/preparetoissueMain.data.ts

21
src/components/BasicForm/src/BasicForm.vue

@ -125,13 +125,25 @@ const formSchema = ref(props.formAllSchemas?.formSchema)
// formField form // formField form
// searchField // searchField
// type type=tableForm // type type=tableForm
// searchCondition
const searchTableRef = ref() const searchTableRef = ref()
const opensearchTable = (formField, searchField, searchTitle, searchAllSchemas, searchPage, type, row) => { const opensearchTable = (formField, searchField, searchTitle, searchAllSchemas, searchPage, type, row, searchCondition) => {
const _searchCondition = {}
//
if (searchCondition && searchCondition.length > 0) {
searchCondition.forEach(item => {
//
if (item.isMainValue) {
_searchCondition[item.key] = formRef.value.formModel[item.value]
} else {
_searchCondition[item.key] = item.value
}
})
}
const _searchTableTitle = searchTitle const _searchTableTitle = searchTitle
const _searchTableAllSchemas = searchAllSchemas const _searchTableAllSchemas = searchAllSchemas
const _searchTablePage = searchPage const _searchTablePage = searchPage
console.log(_searchTablePage) searchTableRef.value.open(_searchTableTitle, _searchTableAllSchemas, _searchTablePage, formField, searchField, type, row, _searchCondition)
searchTableRef.value.open(_searchTableTitle, _searchTableAllSchemas, _searchTablePage, formField, searchField, type, row)
} }
// //
// val row // val row
@ -302,7 +314,8 @@ const inpuFocus = (headerItem, row, index) => {
headerItem.tableForm.searchAllSchemas, headerItem.tableForm.searchAllSchemas,
headerItem.tableForm.searchPage, headerItem.tableForm.searchPage,
'tableForm', 'tableForm',
row row,
headerItem.tableForm.searchCondition
) )
} }
</script> </script>

8
src/components/Form/src/Form.vue

@ -120,9 +120,8 @@ export default defineComponent({
return unref(elFormRef) as ComponentRef<typeof ElForm> return unref(elFormRef) as ComponentRef<typeof ElForm>
} }
const opensearchTable = (field, searchField,searchTitle,searchAllSchemas, searchPage) => { const opensearchTable = (field, searchField,searchTitle,searchAllSchemas, searchPage, searchCondition) => {
console.log(124, field) emit('opensearchTable',field, searchField, searchTitle, searchAllSchemas, searchPage, searchCondition)
emit('opensearchTable',field, searchField, searchTitle, searchAllSchemas, searchPage)
} }
expose({ expose({
@ -233,7 +232,8 @@ export default defineComponent({
item.field, item?.componentProps?.searchField, item.field, item?.componentProps?.searchField,
item?.componentProps?.searchTitle, item?.componentProps?.searchTitle,
item?.componentProps?.searchAllSchemas, item?.componentProps?.searchAllSchemas,
item?.componentProps?.searchPage item?.componentProps?.searchPage,
item?.componentProps?.searchCondition
)}}/> )}}/>
</> </>
) )

3
src/components/SearchTable/src/SearchTable.vue

@ -64,7 +64,7 @@ const searchFieldRef = ref()
const typeRef = ref() const typeRef = ref()
const rowRef = ref() const rowRef = ref()
const allSchemasRef = ref() const allSchemasRef = ref()
const open = (titleName: any, allSchemas: any,getApiPage: any, formField: any, searchField: any, type: any, row: any ) => { const open = (titleName: any, allSchemas: any,getApiPage: any, formField: any, searchField: any, type: any, row: any, searchCondition:any ) => {
searchDialogVisible.value = true searchDialogVisible.value = true
formFieldRef.value = formField formFieldRef.value = formField
searchFieldRef.value = searchField searchFieldRef.value = searchField
@ -80,6 +80,7 @@ const open = (titleName: any, allSchemas: any,getApiPage: any, formField: any, s
getListApi: getPage.value // getListApi: getPage.value //
}) })
tableObjectRef.value = tableObject tableObjectRef.value = tableObject
if (searchCondition) tableObjectRef.value.params = searchCondition
// //
const { getList, setSearchParams } = tableMethods const { getList, setSearchParams } = tableMethods
setSearchParamsRef.value = setSearchParams setSearchParamsRef.value = setSearchParams

20
src/views/wms/issueManage/preparetoissueplan/preparetoissueMain/preparetoissueMain.data.ts

@ -385,7 +385,18 @@ export const PreparetoissueDetail = useCrudSchemas(reactive<CrudSchema[]>([
searchField: 'itemCode', // 查询弹窗赋值字段 searchField: 'itemCode', // 查询弹窗赋值字段
searchTitle: '生产线物品关系信息', // 查询弹窗标题 searchTitle: '生产线物品关系信息', // 查询弹窗标题
searchAllSchemas: Productionlineitem.allSchemas, // 查询弹窗所需类 searchAllSchemas: Productionlineitem.allSchemas, // 查询弹窗所需类
searchPage: ProductionlineitemApi.getProductionlineitemPage // 查询弹窗所需分页方法 searchPage: ProductionlineitemApi.getProductionlineitemPage, // 查询弹窗所需分页方法
searchCondition: [{
key:'productionLineCode',
value:'prodLine',
isMainValue: true
}//, //条件,例:isMainValue: true,表示查询条件是主表的字段的值 productionLineCode:查询列表中字段 prodLine:指主表某字段
// {
// key:'available',
// value:'TRUE',
// isMainValue: false
// }
] // 条件,例:isMainValue: false,表示查询条件不是主表的字段的值 available:查询列表中字段 TRUE:指查询具体值
} }
}, },
tableForm:{ tableForm:{
@ -394,7 +405,12 @@ export const PreparetoissueDetail = useCrudSchemas(reactive<CrudSchema[]>([
searchField: 'itemCode', // 查询弹窗赋值字段 searchField: 'itemCode', // 查询弹窗赋值字段
searchTitle: '生产线物品关系信息', // 查询弹窗标题 searchTitle: '生产线物品关系信息', // 查询弹窗标题
searchAllSchemas: Productionlineitem.allSchemas, // 查询弹窗所需类 searchAllSchemas: Productionlineitem.allSchemas, // 查询弹窗所需类
searchPage: ProductionlineitemApi.getProductionlineitemPage // 查询弹窗所需分页方法 searchPage: ProductionlineitemApi.getProductionlineitemPage, // 查询弹窗所需分页方法
searchCondition: [{
key:'productionLineCode',
value:'prodLine',
isMainValue: true
}]
}, },
}, },
{ {

Loading…
Cancel
Save