master
xy 2 years ago
parent db0685b41c
commit a14150f9d2

@ -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) { export function getInfo(token) {
return request({ return request({

@ -158,7 +158,7 @@ export default {
async logout() { async logout() {
await this.$store.dispatch('app/clearLayout') await this.$store.dispatch('app/clearLayout')
await this.$store.dispatch("user/logout"); await this.$store.dispatch("user/logout");
this.$router.push(`/login?redirect=${this.$route.fullPath}`); this.$router.push(`/login`);
}, },
handleClickOutside() { handleClickOutside() {
this.$store.dispatch("app/closeSideBar", { this.$store.dispatch("app/closeSideBar", {

@ -9,6 +9,7 @@ import {
getToken getToken
} from '@/utils/auth' // get token from cookie } from '@/utils/auth' // get token from cookie
import getPageTitle from '@/utils/get-page-title' import getPageTitle from '@/utils/get-page-title'
import { loginOssV2 } from "@/api/user"
NProgress.configure({ NProgress.configure({
showSpinner: false showSpinner: false
@ -23,13 +24,19 @@ router.beforeEach(async (to, from, next) => {
// set page title // set page title
document.title = getPageTitle(to.meta.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 // determine whether the user has logged in
const hasToken = getToken() const hasToken = getToken()
if (hasToken) { if (hasToken) {
if (to.path === '/login') { if (to.path === '/login') {
// if is logged in, redirect to the home page // if is logged in, redirect to the home page
console.log(to.fullPath)
await store.dispatch('user/resetToken') await store.dispatch('user/resetToken')
next(to.fullPath) next(to.fullPath)

@ -16,14 +16,7 @@ const store = new Vuex.Store({
settings, settings,
user user
}, },
getters, getters
plugins:[
createPersistedState({
storage:window.localStorage,
key:'worker-layout',
paths:['app.workerLayout']
})
]
}) })
export default store export default store

@ -48,17 +48,17 @@
<xy-table stripe ref="xyTable" :objectSpanMethod="objectSpanMethod" :table-item="table" :list="list" :show-summary="true" <xy-table stripe ref="xyTable" :objectSpanMethod="objectSpanMethod" :table-item="table" :list="list" :show-summary="true"
:summary-method="summary"> :summary-method="summary">
<template v-slot:btns> <template v-slot:btns>
<el-table-column header-align="center" align="left" :width="130" label="操作" > <el-table-column header-align="center" align="left" :width="150" label="操作" >
<template #default="{ row }"> <template #default="{ row }">
<Button size="small" type="primary" @click="$refs['payPlan'].rowName = row.name,$refs['payPlan'].setId(row.id),$refs['payPlan'].show();">付款计划</Button> <Button v-if="row.pid === 0" size="small" type="primary" @click="$refs['payPlan'].rowName = row.name,$refs['payPlan'].setId(row.id),$refs['payPlan'].show();"></Button>
</template> </template>
</el-table-column> </el-table-column>
</template> </template>
</xy-table> </xy-table>
<div style="display: flex;justify-content: flex-end;"> <!-- <div style="display: flex;justify-content: flex-end;">-->
<Page :total="total" show-elevator @on-change="pageChange" show-sizer @on-page-size-change="pageSizeChange" /> <!-- <Page :total="total" show-elevator @on-change="pageChange" show-sizer @on-page-size-change="pageSizeChange" />-->
</div> <!-- </div>-->
<payPlan ref="payPlan"></payPlan> <payPlan ref="payPlan"></payPlan>
</div> </div>
@ -136,76 +136,75 @@
total: 0, total: 0,
pageIndex: 1, pageIndex: 1,
pageSize: 10, pageSize: 10,
table: [{ table: [
label: "隶属项目",
prop: 'pid_info_name',
width: 200,
align: 'left',
sortable: false,
fixed: 'left'
},
{ {
label: "项目名称", label: "项目名称",
prop: 'name', prop: "name",
width: 200, width: 200,
align: 'left', align: "left",
sortable: false, sortable: false,
fixed: 'left' fixed: "left",
}, },
{ {
label: "预算类型",
prop: 'type_detail.value', prop: 'type_detail.value',
label: "预算类型",
width: 115, width: 115,
}, },
{ {
label: "所属年份", label: "所属年份",
prop: 'year', prop: "year",
width: 105 width: 105,
}, },
// {
// label: "",
// prop: "plan_department.name",
// width: 110,
// },
{ {
label: "相关科室", label: "年初预算金额(元)",
prop: 'plan_department.name', prop: "money",
width: 110 align: "right",
},
{
label: '年初预算金额(元)',
prop: 'money',
align: 'right',
width: 180, width: 180,
formatter: (cell, data, value) => { formatter: (cell, data, value) => {
return moneyFormatter(value) if (value == 0) return "--";
} else return moneyFormatter(value);
},
}, },
{ {
label: '调整后预算金额(元)', label: "调整后预算金额(元)",
prop: 'update_money', prop: "update_money",
align: 'right', align: "right",
width: 200, width: 200,
formatter: (cell, data, value) => { formatter: (cell, data, value) => {
return moneyFormatter(value) return moneyFormatter(value);
} },
}, },
{ {
label: "创建信息", label: "创建信息",
prop: 'created_at', prop: "created_at",
width: 160, width: 160,
formatter: (cell, data, value) => { 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: "描述", label: "描述",
minWidth: 300, minWidth: 300,
prop: 'content', prop: "content",
align: 'left', align: "left",
sortable: false sortable: false,
}, },
], ],
select: { select: {
page: 1, page: 1,
year: "", year: "",
type: "", type: "",
department: "" department: "",
}, },
departments: [], // departments: [], //
@ -286,20 +285,21 @@
year: this.select.year, year: this.select.year,
type: this.select.type, type: this.select.type,
plan_department_id: this.select.department, plan_department_id: this.select.department,
top_pid: 1 //top_pid: 1,
is_auth: 0,
is_tree: 1
}).then(res => { }).then(res => {
for (var m of res.list) {
for (var m of res.list.data) {
m.pid_info_name = m.pid_info?.name m.pid_info_name = m.pid_info?.name
} }
this.list = this.list =
mergeTableRow({ mergeTableRow({
data: res.list.data, data: res.list,
mergeColNames: ["pid_info_name"], // mergeColNames: ["pid_info_name"], //
firstMergeColNames: ["pid_info_name"], // firstMerge firstMergeColNames: ["pid_info_name"], // firstMerge
firstMerge: 'pid_info_name' // firstMerge: 'pid_info_name' //
}) })
this.total = res.list.total //this.total = res.list.total
this.totalMoney = res.total_money this.totalMoney = res.total_money
}) })
}, },

@ -130,7 +130,7 @@
</div> </div>
</div> </div>
<div class="out-sign-info" v-if="outContractDetail.flow_detail"> <div class="out-sign-info" v-if="outContractDetail.flow_detail">
<div class="sign-info-title">合同会签信息</div> <div class="sign-info-title">合同审批信息</div>
<div class="sign-info-item"> <div class="sign-info-item">
<div class="sign-info-item-title">合同金额</div> <div class="sign-info-item-title">合同金额</div>
<div class="sign-info-item-content"> <div class="sign-info-item-content">

@ -176,7 +176,7 @@
<template v-slot:join_status v-if="adminEdit"> <template v-slot:join_status v-if="adminEdit">
<div class="xy-table-item"> <div class="xy-table-item">
<div class="xy-table-item-label" style="width: 200px"> <div class="xy-table-item-label" style="width: 200px">
合同会签流程 合同审批流程
</div> </div>
<div class="xy-table-item-content"> <div class="xy-table-item-content">
<el-select v-model="detail.join_status" placeholder="请选择"> <el-select v-model="detail.join_status" placeholder="请选择">
@ -236,10 +236,10 @@
<Input v-model="planSearch" search enter-button=" " placeholder="搜索预算计划.." @on-search="getBudgets" /> <Input v-model="planSearch" search enter-button=" " placeholder="搜索预算计划.." @on-search="getBudgets" />
<xy-table :list="plans" :show-index="false" :table-item="planTable" :height="310" style="margin-top: 10px;" <xy-table :list="plans" :show-index="false" :table-item="planTable" :height="310" style="margin-top: 10px;"
ref="editorPlanTable" row-key="id" border default-expand-all :tree-props="{ children: 'children', hasChildren: 'hasChildren' }" @select="selectPlan"> ref="editorPlanTable" row-key="id" border default-expand-all :tree-props="{ children: 'notChildren', hasChildren: 'hasChildren' }" @select="selectPlan">
<template v-slot:btns> <template v-slot:btns>
<el-table-column label="使用金额" header-align="center"> <el-table-column label="使用金额" header-align="center" width="130">
<template slot-scope="scope"> <template slot-scope="scope" v-if="scope.row.pid === 0">
<Input :value="scope.row.useMoney" @input="planInput($event,scope.row)" /> <Input :value="scope.row.useMoney" @input="planInput($event,scope.row)" />
</template> </template>
</el-table-column> </el-table-column>
@ -449,7 +449,10 @@ import { resetSelect } from '@/utils'
planTable: [{ planTable: [{
sortable: false, sortable: false,
width: 44, width: 44,
type: "selection" type: "selection",
selectable: (row, index) => {
return row.pid === 0
}
}, },
{ {
label: "科室", label: "科室",

@ -228,7 +228,7 @@
</div> </div>
<div> <div>
<span style="padding: 0 6px; word-break: keep-all"> <span style="padding: 0 6px; word-break: keep-all">
合同会签状态 合同审批状态
</span> </span>
<Select <Select
@ -419,7 +419,7 @@
size="small" size="small"
type="primary" type="primary"
@click="signProcess(scope.row)" @click="signProcess(scope.row)"
>合同会签 >合同审批
</Button> </Button>
</template> </template>
<template <template
@ -958,7 +958,7 @@
row-key="id" row-key="id"
border border
default-expand-all default-expand-all
:tree-props="{ children: 'children', hasChildren: 'hasChildren' }" :tree-props="{ children: 'notChildren', hasChildren: 'hasChildren' }"
@select="selectPlan" @select="selectPlan"
> >
<template v-slot:btns> <template v-slot:btns>
@ -969,7 +969,7 @@
width="140" width="140"
> >
<template slot-scope="scope"> <template slot-scope="scope">
<Input v-if="scope.row.pid !== 0" <Input v-if="scope.row.pid === 0"
:value="scope.row.useMoney" :value="scope.row.useMoney"
@input="planInput($event, scope.row)" @input="planInput($event, scope.row)"
/> />
@ -1491,7 +1491,7 @@ export default {
} }
}, },
{ {
label: "合同会签流程", label: "合同审批流程",
width: 145, width: 145,
prop: "join_status", prop: "join_status",
formatter: (cell, data, value) => { formatter: (cell, data, value) => {
@ -1778,7 +1778,7 @@ export default {
type: "selection", type: "selection",
fixed: "left", fixed: "left",
selectable: (row, index) => { selectable: (row, index) => {
return row.pid !== 0 return row.pid === 0
} }
}, },
{ {

Loading…
Cancel
Save