diff --git a/src/api/measure/source.ts b/src/api/measure/source.ts index e447f41..8b646b1 100644 --- a/src/api/measure/source.ts +++ b/src/api/measure/source.ts @@ -47,7 +47,7 @@ data, }) } -// 保存数据 +// 保存至草稿箱 export function sourceSave(data: object) { return request({ url: `${prefix}/supplier/save`, @@ -55,6 +55,14 @@ data, }) } +// 更新草稿箱文件 +export function sourceDraftUpdate(data: object) { + return request({ + url: `${prefix}/supplier/draftUpdate`, + method: 'post', + data, + }) +} // 更新数据 export function getSoucreLisUpdate(data: object) { return request({ diff --git a/src/api/measure/source.ts b/src/api/measure/source.ts index e447f41..8b646b1 100644 --- a/src/api/measure/source.ts +++ b/src/api/measure/source.ts @@ -47,7 +47,7 @@ data, }) } -// 保存数据 +// 保存至草稿箱 export function sourceSave(data: object) { return request({ url: `${prefix}/supplier/save`, @@ -55,6 +55,14 @@ data, }) } +// 更新草稿箱文件 +export function sourceDraftUpdate(data: object) { + return request({ + url: `${prefix}/supplier/draftUpdate`, + method: 'post', + data, + }) +} // 更新数据 export function getSoucreLisUpdate(data: object) { return request({ diff --git a/src/router/index.ts b/src/router/index.ts index 3af58ea..6b9ba93 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -136,7 +136,8 @@ to.meta.title && settingsStore.setTitle(typeof to.meta.title === 'function' ? to.meta.title() : to.meta.title) // 判断当前页面是否开启缓存,如果开启,则将当前页面的 name 信息存入 keep-alive 全局状态 if (to.meta.cache) { - const componentName = to.matched.at(-1)?.components?.default.name + const componentName = to.matched[to.matched.length - 1].components?.default.name + // debugger if (componentName) { keepAliveStore.add(componentName) } @@ -146,7 +147,7 @@ } // 判断离开页面是否开启缓存,如果开启,则根据缓存规则判断是否需要清空 keep-alive 全局状态里离开页面的 name 信息 if (from.meta.cache) { - const componentName = from.matched.at(-1)?.components?.default.name + const componentName = from.matched[to.matched.length - 1].components?.default.name if (componentName) { // 通过 meta.cache 判断针对哪些页面进行缓存 switch (typeof from.meta.cache) { diff --git a/src/api/measure/source.ts b/src/api/measure/source.ts index e447f41..8b646b1 100644 --- a/src/api/measure/source.ts +++ b/src/api/measure/source.ts @@ -47,7 +47,7 @@ data, }) } -// 保存数据 +// 保存至草稿箱 export function sourceSave(data: object) { return request({ url: `${prefix}/supplier/save`, @@ -55,6 +55,14 @@ data, }) } +// 更新草稿箱文件 +export function sourceDraftUpdate(data: object) { + return request({ + url: `${prefix}/supplier/draftUpdate`, + method: 'post', + data, + }) +} // 更新数据 export function getSoucreLisUpdate(data: object) { return request({ diff --git a/src/router/index.ts b/src/router/index.ts index 3af58ea..6b9ba93 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -136,7 +136,8 @@ to.meta.title && settingsStore.setTitle(typeof to.meta.title === 'function' ? to.meta.title() : to.meta.title) // 判断当前页面是否开启缓存,如果开启,则将当前页面的 name 信息存入 keep-alive 全局状态 if (to.meta.cache) { - const componentName = to.matched.at(-1)?.components?.default.name + const componentName = to.matched[to.matched.length - 1].components?.default.name + // debugger if (componentName) { keepAliveStore.add(componentName) } @@ -146,7 +147,7 @@ } // 判断离开页面是否开启缓存,如果开启,则根据缓存规则判断是否需要清空 keep-alive 全局状态里离开页面的 name 信息 if (from.meta.cache) { - const componentName = from.matched.at(-1)?.components?.default.name + const componentName = from.matched[to.matched.length - 1].components?.default.name if (componentName) { // 通过 meta.cache 判断针对哪些页面进行缓存 switch (typeof from.meta.cache) { diff --git a/src/router/modules/customer.ts b/src/router/modules/customer.ts index 88c0f5d..d470c49 100644 --- a/src/router/modules/customer.ts +++ b/src/router/modules/customer.ts @@ -65,7 +65,7 @@ path: '/customerManage', component: Layout, redirect: '/customerManage/list', - name: 'MeasureSource', + name: 'Customer', meta: { title: '客户管理', icon: 'ep:key', diff --git a/src/api/measure/source.ts b/src/api/measure/source.ts index e447f41..8b646b1 100644 --- a/src/api/measure/source.ts +++ b/src/api/measure/source.ts @@ -47,7 +47,7 @@ data, }) } -// 保存数据 +// 保存至草稿箱 export function sourceSave(data: object) { return request({ url: `${prefix}/supplier/save`, @@ -55,6 +55,14 @@ data, }) } +// 更新草稿箱文件 +export function sourceDraftUpdate(data: object) { + return request({ + url: `${prefix}/supplier/draftUpdate`, + method: 'post', + data, + }) +} // 更新数据 export function getSoucreLisUpdate(data: object) { return request({ diff --git a/src/router/index.ts b/src/router/index.ts index 3af58ea..6b9ba93 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -136,7 +136,8 @@ to.meta.title && settingsStore.setTitle(typeof to.meta.title === 'function' ? to.meta.title() : to.meta.title) // 判断当前页面是否开启缓存,如果开启,则将当前页面的 name 信息存入 keep-alive 全局状态 if (to.meta.cache) { - const componentName = to.matched.at(-1)?.components?.default.name + const componentName = to.matched[to.matched.length - 1].components?.default.name + // debugger if (componentName) { keepAliveStore.add(componentName) } @@ -146,7 +147,7 @@ } // 判断离开页面是否开启缓存,如果开启,则根据缓存规则判断是否需要清空 keep-alive 全局状态里离开页面的 name 信息 if (from.meta.cache) { - const componentName = from.matched.at(-1)?.components?.default.name + const componentName = from.matched[to.matched.length - 1].components?.default.name if (componentName) { // 通过 meta.cache 判断针对哪些页面进行缓存 switch (typeof from.meta.cache) { diff --git a/src/router/modules/customer.ts b/src/router/modules/customer.ts index 88c0f5d..d470c49 100644 --- a/src/router/modules/customer.ts +++ b/src/router/modules/customer.ts @@ -65,7 +65,7 @@ path: '/customerManage', component: Layout, redirect: '/customerManage/list', - name: 'MeasureSource', + name: 'Customer', meta: { title: '客户管理', icon: 'ep:key', diff --git a/src/router/modules/measure.ts b/src/router/modules/measure.ts index 855c6fa..4e41e86 100644 --- a/src/router/modules/measure.ts +++ b/src/router/modules/measure.ts @@ -390,7 +390,7 @@ children: [ { path: 'list', - name: 'measureSourceList', + name: 'MeasureSourceList', component: () => import('@/views/measure/source/list.vue'), meta: { title: '溯源供方列表', @@ -418,6 +418,7 @@ title: '溯源供方审批', icon: 'ep:key', auth: '/measure/measureSource/approve', + cache: true, }, }, { diff --git a/src/api/measure/source.ts b/src/api/measure/source.ts index e447f41..8b646b1 100644 --- a/src/api/measure/source.ts +++ b/src/api/measure/source.ts @@ -47,7 +47,7 @@ data, }) } -// 保存数据 +// 保存至草稿箱 export function sourceSave(data: object) { return request({ url: `${prefix}/supplier/save`, @@ -55,6 +55,14 @@ data, }) } +// 更新草稿箱文件 +export function sourceDraftUpdate(data: object) { + return request({ + url: `${prefix}/supplier/draftUpdate`, + method: 'post', + data, + }) +} // 更新数据 export function getSoucreLisUpdate(data: object) { return request({ diff --git a/src/router/index.ts b/src/router/index.ts index 3af58ea..6b9ba93 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -136,7 +136,8 @@ to.meta.title && settingsStore.setTitle(typeof to.meta.title === 'function' ? to.meta.title() : to.meta.title) // 判断当前页面是否开启缓存,如果开启,则将当前页面的 name 信息存入 keep-alive 全局状态 if (to.meta.cache) { - const componentName = to.matched.at(-1)?.components?.default.name + const componentName = to.matched[to.matched.length - 1].components?.default.name + // debugger if (componentName) { keepAliveStore.add(componentName) } @@ -146,7 +147,7 @@ } // 判断离开页面是否开启缓存,如果开启,则根据缓存规则判断是否需要清空 keep-alive 全局状态里离开页面的 name 信息 if (from.meta.cache) { - const componentName = from.matched.at(-1)?.components?.default.name + const componentName = from.matched[to.matched.length - 1].components?.default.name if (componentName) { // 通过 meta.cache 判断针对哪些页面进行缓存 switch (typeof from.meta.cache) { diff --git a/src/router/modules/customer.ts b/src/router/modules/customer.ts index 88c0f5d..d470c49 100644 --- a/src/router/modules/customer.ts +++ b/src/router/modules/customer.ts @@ -65,7 +65,7 @@ path: '/customerManage', component: Layout, redirect: '/customerManage/list', - name: 'MeasureSource', + name: 'Customer', meta: { title: '客户管理', icon: 'ep:key', diff --git a/src/router/modules/measure.ts b/src/router/modules/measure.ts index 855c6fa..4e41e86 100644 --- a/src/router/modules/measure.ts +++ b/src/router/modules/measure.ts @@ -390,7 +390,7 @@ children: [ { path: 'list', - name: 'measureSourceList', + name: 'MeasureSourceList', component: () => import('@/views/measure/source/list.vue'), meta: { title: '溯源供方列表', @@ -418,6 +418,7 @@ title: '溯源供方审批', icon: 'ep:key', auth: '/measure/measureSource/approve', + cache: true, }, }, { diff --git a/src/store/modules/dict.ts b/src/store/modules/dict.ts index 0719c75..be90c53 100644 --- a/src/store/modules/dict.ts +++ b/src/store/modules/dict.ts @@ -1,5 +1,8 @@ import type { DeptTreeNode } from '@/views/system/dept/dept-interface' +interface approvalStatus { + [key: string]: string +} const useDictStore = defineStore( 'dict', { @@ -14,7 +17,7 @@ 已通过: '4', 未通过: '5', 已取消: '6', - }, // 审批状态 + } as approvalStatus, // 审批状态 }), getters: { getAllDeptList: (state) => { diff --git a/src/api/measure/source.ts b/src/api/measure/source.ts index e447f41..8b646b1 100644 --- a/src/api/measure/source.ts +++ b/src/api/measure/source.ts @@ -47,7 +47,7 @@ data, }) } -// 保存数据 +// 保存至草稿箱 export function sourceSave(data: object) { return request({ url: `${prefix}/supplier/save`, @@ -55,6 +55,14 @@ data, }) } +// 更新草稿箱文件 +export function sourceDraftUpdate(data: object) { + return request({ + url: `${prefix}/supplier/draftUpdate`, + method: 'post', + data, + }) +} // 更新数据 export function getSoucreLisUpdate(data: object) { return request({ diff --git a/src/router/index.ts b/src/router/index.ts index 3af58ea..6b9ba93 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -136,7 +136,8 @@ to.meta.title && settingsStore.setTitle(typeof to.meta.title === 'function' ? to.meta.title() : to.meta.title) // 判断当前页面是否开启缓存,如果开启,则将当前页面的 name 信息存入 keep-alive 全局状态 if (to.meta.cache) { - const componentName = to.matched.at(-1)?.components?.default.name + const componentName = to.matched[to.matched.length - 1].components?.default.name + // debugger if (componentName) { keepAliveStore.add(componentName) } @@ -146,7 +147,7 @@ } // 判断离开页面是否开启缓存,如果开启,则根据缓存规则判断是否需要清空 keep-alive 全局状态里离开页面的 name 信息 if (from.meta.cache) { - const componentName = from.matched.at(-1)?.components?.default.name + const componentName = from.matched[to.matched.length - 1].components?.default.name if (componentName) { // 通过 meta.cache 判断针对哪些页面进行缓存 switch (typeof from.meta.cache) { diff --git a/src/router/modules/customer.ts b/src/router/modules/customer.ts index 88c0f5d..d470c49 100644 --- a/src/router/modules/customer.ts +++ b/src/router/modules/customer.ts @@ -65,7 +65,7 @@ path: '/customerManage', component: Layout, redirect: '/customerManage/list', - name: 'MeasureSource', + name: 'Customer', meta: { title: '客户管理', icon: 'ep:key', diff --git a/src/router/modules/measure.ts b/src/router/modules/measure.ts index 855c6fa..4e41e86 100644 --- a/src/router/modules/measure.ts +++ b/src/router/modules/measure.ts @@ -390,7 +390,7 @@ children: [ { path: 'list', - name: 'measureSourceList', + name: 'MeasureSourceList', component: () => import('@/views/measure/source/list.vue'), meta: { title: '溯源供方列表', @@ -418,6 +418,7 @@ title: '溯源供方审批', icon: 'ep:key', auth: '/measure/measureSource/approve', + cache: true, }, }, { diff --git a/src/store/modules/dict.ts b/src/store/modules/dict.ts index 0719c75..be90c53 100644 --- a/src/store/modules/dict.ts +++ b/src/store/modules/dict.ts @@ -1,5 +1,8 @@ import type { DeptTreeNode } from '@/views/system/dept/dept-interface' +interface approvalStatus { + [key: string]: string +} const useDictStore = defineStore( 'dict', { @@ -14,7 +17,7 @@ 已通过: '4', 未通过: '5', 已取消: '6', - }, // 审批状态 + } as approvalStatus, // 审批状态 }), getters: { getAllDeptList: (state) => { diff --git a/src/views/measure/source/approve.vue b/src/views/measure/source/approve.vue index 9ac8eea..0011ab3 100644 --- a/src/views/measure/source/approve.vue +++ b/src/views/measure/source/approve.vue @@ -1,8 +1,9 @@