From 1b546cf2db99a67627f0c828f62db2b7c44b54be Mon Sep 17 00:00:00 2001 From: zhang_li <2235006734@qqq.com> Date: Mon, 17 Feb 2025 11:35:24 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9C=BA=E5=86=85=E6=A8=A1=E5=85=B7=E5=8F=B0?= =?UTF-8?q?=E8=B4=A6=E6=A0=B9=E6=8D=AE=E8=B7=AF=E7=94=B1=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/eam/mold/moldAccounts/index.vue | 30 +++++++++++++++---- .../mold/moldAccounts/moldAccounts.data.ts | 17 ++--------- 2 files changed, 26 insertions(+), 21 deletions(-) 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',