综合销售表下钻详情页面列表字段为null则隐藏对应列,自定义表单在initOption内配置的默认搜索,新增或者重置搜索后也要保留

This commit is contained in:
mll
2026-04-17 18:01:55 +08:00
parent 911909c72f
commit 51befc8bba
2 changed files with 5 additions and 4 deletions

View File

@@ -301,14 +301,13 @@ const getSaleInfo=async ()=>{
})
tableSaleOption.value.height='calc(100vh - 160px)'
fieldList.value.forEach(item=>{
if(Object.keys(res.records[0]).includes(item.fieldCode)){
if(res.records[0]&&(res.records[0][item.fieldCode]||res.records[0][item.fieldCode]==0)){
let config={
prop:item.fieldCode,
label:item.fieldName,
width:item.width?item.width+'px':item.fieldName=='产品名称'?'200px':undefined,
align:'center',
}
tableSaleOption.value.column[item.fieldCode]=config
}
})

View File

@@ -471,7 +471,7 @@ const subTabsValue = ref<any>({})
const subFormRef = ref({})
const subTableRef = ref({})
const subTabsRef = ref()
const searchDefaultValue = ref<any>({})
const erpTabsOption = ref<any>({})
const menuLeftShow = ref(true)
const erpTableRef = ref({})
@@ -710,6 +710,8 @@ const initTable = async () => {
}
try {
if (jsEnhanceObj.value.initOption) jsEnhanceObj.value.initOption()
searchDefaultValue.value =JSON.parse(JSON.stringify(tableSearch.value))
} catch (error) {
enhanceErrorTip('js增强【initOption】方法执行异常请检查', error)
}
@@ -1466,7 +1468,7 @@ const searchChange = (params, done) => {
}
const resetChange = () => {
return new Promise(async (resolve) => {
tableSearch.value = {}
tableSearch.value = {...searchDefaultValue.value}
if (tableInfo.value.tableType == 'treeAround' && tableCurrType.value != 'add') {
treeRef.value.setCurrentKey(null)
treeAroundRow.value = {}