From a14150f9d21e5531a83463a5563cf6ebb1358058 Mon Sep 17 00:00:00 2001 From: xy <271556543@qq.com> Date: Wed, 13 Dec 2023 15:31:57 +0800 Subject: [PATCH] 2023-12-13 --- src/api/user.js | 9 +- src/layout/index.vue | 2 +- src/permission.js | 9 +- src/store/index.js | 9 +- src/views/budget/seeBudget.vue | 92 +++++++++---------- .../contract/components/detailContract.vue | 2 +- .../contract/components/editorContract.vue | 13 ++- src/views/contract/contractList.vue | 12 +-- 8 files changed, 79 insertions(+), 69 deletions(-) diff --git a/src/api/user.js b/src/api/user.js index f9dcc72..e3cea54 100644 --- a/src/api/user.js +++ b/src/api/user.js @@ -17,7 +17,14 @@ export function loginOss(data) { }) } - +export function loginOssV2 (data) { + return request({ + url: "/api/admin/auth/oss-login-v2", + method: "post", + data, + noloading:true + }) +} export function getInfo(token) { return request({ diff --git a/src/layout/index.vue b/src/layout/index.vue index 3e0acf0..99c150b 100644 --- a/src/layout/index.vue +++ b/src/layout/index.vue @@ -158,7 +158,7 @@ export default { async logout() { await this.$store.dispatch('app/clearLayout') await this.$store.dispatch("user/logout"); - this.$router.push(`/login?redirect=${this.$route.fullPath}`); + this.$router.push(`/login`); }, handleClickOutside() { this.$store.dispatch("app/closeSideBar", { diff --git a/src/permission.js b/src/permission.js index 593029a..16471a7 100644 --- a/src/permission.js +++ b/src/permission.js @@ -9,6 +9,7 @@ import { getToken } from '@/utils/auth' // get token from cookie import getPageTitle from '@/utils/get-page-title' +import { loginOssV2 } from "@/api/user" NProgress.configure({ showSpinner: false @@ -23,13 +24,19 @@ router.beforeEach(async (to, from, next) => { // set page title document.title = getPageTitle(to.meta.title) + if (to.query.code) { + console.log(to) + const { token } = await loginOssV2({ + code: to.query.code + }) + store.commit('user/SET_TOKEN',token) + } // determine whether the user has logged in const hasToken = getToken() if (hasToken) { if (to.path === '/login') { // if is logged in, redirect to the home page - console.log(to.fullPath) await store.dispatch('user/resetToken') next(to.fullPath) diff --git a/src/store/index.js b/src/store/index.js index e30b4db..840edbe 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -16,14 +16,7 @@ const store = new Vuex.Store({ settings, user }, - getters, - plugins:[ - createPersistedState({ - storage:window.localStorage, - key:'worker-layout', - paths:['app.workerLayout'] - }) - ] + getters }) export default store diff --git a/src/views/budget/seeBudget.vue b/src/views/budget/seeBudget.vue index b836d24..89e08fc 100644 --- a/src/views/budget/seeBudget.vue +++ b/src/views/budget/seeBudget.vue @@ -48,17 +48,17 @@ -
- -
+ + + @@ -136,76 +136,75 @@ total: 0, pageIndex: 1, pageSize: 10, - table: [{ - label: "隶属项目", - prop: 'pid_info_name', - width: 200, - align: 'left', - sortable: false, - fixed: 'left' - }, + table: [ { label: "项目名称", - prop: 'name', + prop: "name", width: 200, - align: 'left', + align: "left", sortable: false, - fixed: 'left' + fixed: "left", }, { - label: "预算类型", prop: 'type_detail.value', + label: "预算类型", width: 115, }, { label: "所属年份", - prop: 'year', - width: 105 + prop: "year", + width: 105, }, + // { + // label: "相关科室", + // prop: "plan_department.name", + // width: 110, + // }, { - label: "相关科室", - prop: 'plan_department.name', - width: 110 - }, - { - label: '年初预算金额(元)', - prop: 'money', - align: 'right', + label: "年初预算金额(元)", + prop: "money", + align: "right", width: 180, formatter: (cell, data, value) => { - return moneyFormatter(value) - } + if (value == 0) return "--"; + else return moneyFormatter(value); + }, }, { - label: '调整后预算金额(元)', - prop: 'update_money', - align: 'right', + label: "调整后预算金额(元)", + prop: "update_money", + align: "right", width: 200, formatter: (cell, data, value) => { - return moneyFormatter(value) - } + return moneyFormatter(value); + }, }, { label: "创建信息", - prop: 'created_at', + prop: "created_at", width: 160, formatter: (cell, data, value) => { - return parseTime(new Date(value), '{y}-{m}-{d}') - } + return parseTime(new Date(value), "{y}-{m}-{d}"); + }, + }, + { + label: '科室', + width: 150, + prop: 'plan_department.name' }, { label: "描述", minWidth: 300, - prop: 'content', - align: 'left', - sortable: false + prop: "content", + align: "left", + sortable: false, }, ], select: { page: 1, year: "", type: "", - department: "" + department: "", }, departments: [], //部门类型 @@ -286,20 +285,21 @@ year: this.select.year, type: this.select.type, plan_department_id: this.select.department, - top_pid: 1 + //top_pid: 1, + is_auth: 0, + is_tree: 1 }).then(res => { - - for (var m of res.list.data) { + for (var m of res.list) { m.pid_info_name = m.pid_info?.name } this.list = mergeTableRow({ - data: res.list.data, + data: res.list, mergeColNames: ["pid_info_name"], // 需要合并的列,默认合并列相同的数据 firstMergeColNames: ["pid_info_name"], // 受影响的列,只合并以firstMerge为首的同类型数据 firstMerge: 'pid_info_name' // 以哪列为基础进行合并,一般为第一列 }) - this.total = res.list.total + //this.total = res.list.total this.totalMoney = res.total_money }) }, diff --git a/src/views/contract/components/detailContract.vue b/src/views/contract/components/detailContract.vue index eb41e91..9897864 100644 --- a/src/views/contract/components/detailContract.vue +++ b/src/views/contract/components/detailContract.vue @@ -130,7 +130,7 @@
-
合同会签信息
+
合同审批信息
合同金额
diff --git a/src/views/contract/components/editorContract.vue b/src/views/contract/components/editorContract.vue index 5d621ba..1b68212 100644 --- a/src/views/contract/components/editorContract.vue +++ b/src/views/contract/components/editorContract.vue @@ -176,7 +176,7 @@