Browse Source

bug

master_hella_20240701
wangyufei 4 months ago
parent
commit
8561ad2740
  1. 41
      src/views/wms/purchasereceiptManage/supplierdeliver/demandforecastingMain/index.vue

41
src/views/wms/purchasereceiptManage/supplierdeliver/demandforecastingMain/index.vue

@ -58,21 +58,8 @@ const tableColumns = ref(DemandforecastingMain.allSchemas.tableColumns)
const updataTableColumns = (val) => { const updataTableColumns = (val) => {
orginTableColumns.value = val orginTableColumns.value = val
} }
const updateDateTableColumns = ()=>{
console.log('tableObjectHead',tableObjectHead)
let dateColumns = []
tableObjectHead.tableList.forEach(item=>{
dateColumns.push({
field: item,
label: item,
table:{
width: 120
}
})
})
tableColumns.value = [...orginTableColumns.value,...dateColumns]
console.log('tableColumns',tableColumns.value)
}
// //
const searchQueryTableSuccess = (formField, searchField, val, formRef, type, row ) => { const searchQueryTableSuccess = (formField, searchField, val, formRef, type, row ) => {
@ -102,6 +89,24 @@ const { tableObject:tableObjectHead, tableMethods:tableMethodsHead } = useTable(
// //
const { getList:getListHead, setSearchParams:setSearchParamsHead } = tableMethodsHead const { getList:getListHead, setSearchParams:setSearchParamsHead } = tableMethodsHead
watch(()=>tableObjectHead.tableList,()=>{
updateDateTableColumns()
},{deep:true})
const updateDateTableColumns = ()=>{
console.log('tableObjectHead',tableObjectHead)
let dateColumns = []
tableObjectHead.tableList.forEach(item=>{
dateColumns.push({
field: item,
label: item,
table:{
width: 120
}
})
})
tableColumns.value = [...orginTableColumns.value,...dateColumns]
console.log('tableColumns',tableColumns.value)
}
const { tableObject, tableMethods } = useTable({ const { tableObject, tableMethods } = useTable({
getListApi: DemandforecastingDetailApi.getDemandforecastingDetailPage // getListApi: DemandforecastingDetailApi.getDemandforecastingDetailPage //
}) })
@ -128,7 +133,7 @@ const buttonBaseClick = async (val, item) => {
}) })
} else { } else {
await getListHead() await getListHead()
updateDateTableColumns() // updateDateTableColumns()
getList() getList()
} }
@ -143,7 +148,7 @@ const buttonBaseClick = async (val, item) => {
const searchClick = async (data)=>{ const searchClick = async (data)=>{
console.log('searchClick',data) console.log('searchClick',data)
await setSearchParamsHead(data) await setSearchParamsHead(data)
updateDateTableColumns() // updateDateTableColumns()
setSearchParams(data) setSearchParams(data)
} }
/** 导出按钮操作 */ /** 导出按钮操作 */
@ -181,7 +186,7 @@ const searchFormClick = (searchData) => {
/** 初始化 **/ /** 初始化 **/
onMounted(async () => { onMounted(async () => {
await getListHead() await getListHead()
updateDateTableColumns() // updateDateTableColumns()
getList() getList()
importTemplateData.templateUrl = await DemandforecastingMainApi.importTemplate() importTemplateData.templateUrl = await DemandforecastingMainApi.importTemplate()
}) })

Loading…
Cancel
Save