Browse Source

模具筛选搜索添加默认字段

master
张立 6 days ago
parent
commit
9a46bf3106
  1. 54
      src/views/eam/mold/moldAccounts/index.vue

54
src/views/eam/mold/moldAccounts/index.vue

@ -3,8 +3,8 @@
<!-- 搜索工作栏 -->
<Search
:schema="MoldAccountsSchema.allSchemas.searchSchema"
@search="setSearchParams"
@reset="setSearchParams"
@search="searchParams"
@reset="searchParams"
/>
</ContentWrap>
@ -336,10 +336,31 @@ const importSuccess = () => {
//
const searchFormClick = (searchData) => {
let isHave = searchData?.filters?.some((item) => item.column == 'sourceType')
if (!isHave) {
if (route.name == 'withinMoldAccounts') {
searchData.filters.push(
{
action: '==',
column: 'sourceType',
value: '0'
}
)
} else {
searchData.filters.push(
{
action: '==',
column: 'sourceType',
value: '1'
}
)
}
}
tableObject.params = {
isSearch: true,
filters: searchData.filters
}
getList() //
}
@ -417,28 +438,39 @@ const changeTabs = (item) => {
const count = ref(0)
/** 初始化 **/
onMounted(async () => {
init()
getList()
await init()
await getList()
importTemplateData.templateUrl = await MoldAccountsApi.importTemplate()
})
const init = () => {
console.log(90,route.name)
nextTick(() => {
if (route.name == 'withinMoldAccounts') {
sourceType.value = "0";
// sourceType.value = "0";
MoldAccountsSchema.value.allSchemas.formSchema = MoldAccounts.allSchemas.formSchema.filter(item => item.field !== 'outsourcedSuppliers')
MoldAccountsSchema.value.allSchemas.tableColumns = MoldAccounts.allSchemas.tableColumns.filter(item => item.field !== 'outsourcedSuppliers')
tableObject.params = {
sourceType: "0",
}
} else {
sourceType.value = "1";
// sourceType.value = "1";
MoldAccountsSchema.value = cloneDeep(MoldAccounts)
tableObject.params = {
sourceType: "1",
}
}
count.value++
})
}
onActivated(async() => {
init()
await init()
await getList()
})
const searchParams = (model) => {
if (route.name == 'withinMoldAccounts') {
model.sourceType= "0"
} else {
model.sourceType= "1"
}
setSearchParams(model)
}
/** 二维码 */
const openQrCode = async (number: String) => {
// const data = await MoldAccountsApi.getQrCode(number)

Loading…
Cancel
Save