diff --git a/src/views/eam/mold/moldAccounts/index.vue b/src/views/eam/mold/moldAccounts/index.vue index eeb3a68..af8075a 100644 --- a/src/views/eam/mold/moldAccounts/index.vue +++ b/src/views/eam/mold/moldAccounts/index.vue @@ -2,7 +2,7 @@ @@ -15,9 +15,8 @@ :routeName="routeName" @updataTableColumns="updataTableColumns" @searchFormClick="searchFormClick" - :allSchemas="MoldAccounts.allSchemas" + :allSchemas="MoldAccountsSchema.allSchemas" /> - @@ -120,6 +120,7 @@ import { getAccessToken } from '@/utils/auth' import { dateFormatter } from '@/utils/formatTime' import * as SupplierApi from '@/api/eam/basic/supplier' import { selectAllFactoryArea,selectAllFactoryAreaDept } from '@/api/system/dept' +import { cloneDeep } from 'lodash-es' import { MoldMaintainOrderMain, @@ -138,11 +139,12 @@ const { t } = useI18n() // 国际化 const route = useRoute() // 路由信息 const routeName = ref() +const MoldAccountsSchema = ref(cloneDeep(MoldAccounts)) const deviceNumber = ref() routeName.value = route.name const tableColumns = ref(MoldAccounts.allSchemas.tableColumns) -const allSchemas = ref(MoldAccounts.allSchemas) +const allSchemas = ref(MoldAccountsSchema.value.allSchemas) const detailAllSchemas = ref() const apiPage = ref() const itemCodeRow = ref() @@ -411,11 +413,27 @@ const changeTabs = (item) => { ] } - +const count = ref(0) /** 初始化 **/ onMounted(async () => { getList() importTemplateData.templateUrl = await MoldAccountsApi.importTemplate() + init() +}) +const init = () => { + console.log(90,route.name) + nextTick(() => { + if (route.name == 'withinMoldAccounts') { + MoldAccountsSchema.value.allSchemas.formSchema = MoldAccounts.allSchemas.formSchema.filter(item => item.field !== 'outsourcedSuppliers') + console.log( MoldAccountsSchema.value.allSchemas.formSchema) + } else { + MoldAccountsSchema.value= cloneDeep(MoldAccounts) + } + count.value++ + }) +} +onActivated(async() => { +init() }) /** 二维码 */ diff --git a/src/views/eam/mold/moldAccounts/moldAccounts.data.ts b/src/views/eam/mold/moldAccounts/moldAccounts.data.ts index a8ec744..aa27240 100644 --- a/src/views/eam/mold/moldAccounts/moldAccounts.data.ts +++ b/src/views/eam/mold/moldAccounts/moldAccounts.data.ts @@ -37,27 +37,15 @@ export const MoldAccountsRules = reactive({ ] }) + export const MoldAccounts = useCrudSchemas(reactive([ { label: '来源类型', field: 'sourceType', sort: 'custom', isSearch: false, - isForm: false, + isForm: true, form: { - hidden:() => { - /* const route = useRoute(); - // 获取当前路由的路径 - const currentPath = route.path; - console.log('当前路由路径:', currentPath) - // 获取当前路由的参数 - const routeParams = route.params; - console.log('当前路由参数:', routeParams) - // 获取当前路由的查询参数 - const routeQuery = route.query; - console.log('当前路由查询参数:', routeQuery)*/ - return true; - } }, table: { width: '150', @@ -71,7 +59,6 @@ export const MoldAccounts = useCrudSchemas(reactive([ isSearch: false, isForm: true, form: { - hidden:true }, table: { width: '150',