Browse Source

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

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

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

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

Loading…
Cancel
Save