自己操作

master
lion 2 years ago
parent 3d0190e93b
commit 4fe7fdce1e

@ -7,7 +7,8 @@ import {
import { import {
getToken, getToken,
setToken, setToken,
removeToken removeToken,
removeWzglUser
} from '@/utils/auth' } from '@/utils/auth'
import { import {
resetRouter resetRouter
@ -139,7 +140,8 @@ const actions = {
console.log("logout",state.token) console.log("logout",state.token)
logout(state.token).then(() => { logout(state.token).then(() => {
removeToken() // must remove token first removeToken() // must remove token first
resetRouter() resetRouter()
removeWzglUser()
commit('RESET_STATE') commit('RESET_STATE')
resolve() resolve()
}).catch(error => { }).catch(error => {
@ -153,7 +155,8 @@ const actions = {
commit commit
}) { }) {
return new Promise(resolve => { return new Promise(resolve => {
removeToken() // must remove token first removeToken() // must remove token first
removeWzglUser()
commit('RESET_STATE') commit('RESET_STATE')
resolve() resolve()
}) })

@ -1,6 +1,8 @@
import Cookies from 'js-cookie' import Cookies from 'js-cookie'
const TokenKey = 'patrol_wzgl_token' const TokenKey = 'patrol_wzgl_token'
const UserInfo = 'patrol_wzgl_user'
export function getToken() { export function getToken() {
//return Cookies.get(TokenKey) //return Cookies.get(TokenKey)
@ -22,3 +24,24 @@ export function removeToken() {
return Cookies.remove(TokenKey) return Cookies.remove(TokenKey)
} }
export function getWzglUser() {
//return Cookies.get(TokenKey)
if (Cookies.get(UserInfo)) {
return Cookies.get(UserInfo)
} else {
return sessionStorage.getItem(UserInfo);
}
}
export function setWzglUser(User) {
sessionStorage.setItem(UserInfo, User);
return Cookies.set(UserInfo, User)
}
export function removeWzglUser() {
sessionStorage.clear();
return Cookies.remove(UserInfo)
}

@ -40,6 +40,9 @@
import { import {
getInfo getInfo
} from '../../api/user.js' } from '../../api/user.js'
import {
setWzglUser
} from '@/utils/auth.js'
export default { export default {
components: { components: {
@ -183,6 +186,7 @@
getInfo().then(response => { getInfo().then(response => {
console.log(response) console.log(response)
this.user = response this.user = response
setWzglUser(this.user)
}).catch(error => {}) }).catch(error => {})
this.start_time = this.recentTime(-14, 'yyyy-MM-dd') this.start_time = this.recentTime(-14, 'yyyy-MM-dd')
this.end_time = this.getNowDate() this.end_time = this.getNowDate()

File diff suppressed because it is too large Load Diff

@ -8,7 +8,9 @@
<Input v-model="select.keyword" style="width: 200px;margin-right: 10px;" placeholder="借用人搜索" /> <Input v-model="select.keyword" style="width: 200px;margin-right: 10px;" placeholder="借用人搜索" />
<Button type="primary" @click="getindex"></Button> <Button type="primary" @click="getindex"></Button>
<Button icon="ios-add" type="primary" style="margin-left: 10px;" <Button icon="ios-add" type="primary" style="margin-left: 10px;"
@click="$refs['addoutbounds'].isShow = true,$refs['addoutbounds'].type = 'add',$refs['addoutbounds'].chukuType = chukuType">添加</Button> @click="$refs['addoutbounds'].isShow = true,$refs['addoutbounds'].type = 'add',
$refs['addoutbounds'].chukuType = chukuType,
$refs['addoutbounds'].authName=authName">添加</Button>
<!-- <Button icon="ios-add" type="primary" style="margin-left: 10px;" <!-- <Button icon="ios-add" type="primary" style="margin-left: 10px;"
@click="$refs['imports'].show()">导入</Button> --> @click="$refs['imports'].show()">导入</Button> -->
@ -21,7 +23,8 @@
:table-item="table"> :table-item="table">
<template v-slot:btns> <template v-slot:btns>
<el-table-column fixed="right" label="操作" width="260" header-align="center"> <el-table-column fixed="right" label="操作" width="260" header-align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<div v-if="scope.row.jilurenyuan==authName">
<Button type="primary" size="small" style="margin-left: 10px;" @click="editorChuku(scope.row.id,'editor')"></Button> <Button type="primary" size="small" style="margin-left: 10px;" @click="editorChuku(scope.row.id,'editor')"></Button>
<Button v-if='scope.row.zhuangtai===""' type="primary" size="small" style="margin-left: 10px;" @click="editorChuku(scope.row.id,'outbounds')"></Button> <Button v-if='scope.row.zhuangtai===""' type="primary" size="small" style="margin-left: 10px;" @click="editorChuku(scope.row.id,'outbounds')"></Button>
<Button v-if='scope.row.zhuangtai===""' type="primary" size="small" style="margin-left: 10px;" @click="tofollow(scope.row.id,scope.row)"></Button> <Button v-if='scope.row.zhuangtai===""' type="primary" size="small" style="margin-left: 10px;" @click="tofollow(scope.row.id,scope.row)"></Button>
@ -29,7 +32,9 @@
<Button type="primary" size="small" style="margin-left: 10px;" @click="printChuku(scope.row.id,'print')"></Button> <Button type="primary" size="small" style="margin-left: 10px;" @click="printChuku(scope.row.id,'print')"></Button>
<Poptip transfer confirm title="确认要删除吗?" @on-ok="deleteChuku(scope.row)"> <Poptip transfer confirm title="确认要删除吗?" @on-ok="deleteChuku(scope.row)">
<Button type="primary" style="margin-left: 10px;" size="small" ghost>删除</Button> <Button type="primary" style="margin-left: 10px;" size="small" ghost>删除</Button>
</Poptip> </Poptip>
</div>
</template> </template>
</el-table-column> </el-table-column>
</template> </template>
@ -48,8 +53,8 @@
destroy destroy
} from "@/api/system/baseForm.js" } from "@/api/system/baseForm.js"
import { import {
getInfo getWzglUser
} from "@/api/user.js" } from "@/utils/auth.js"
import { import {
getOutboundsStatus getOutboundsStatus
} from "@/api/contract.js" } from "@/api/contract.js"
@ -81,7 +86,8 @@
left: 0 left: 0
}, },
loading:false, loading:false,
userName:'', userName:'',
authName:'',
select: { select: {
pageSize: 10, pageSize: 10,
pageIndex: 1, pageIndex: 1,
@ -152,10 +158,10 @@
} }
}, },
methods: { methods: {
getUserName(){ async getUserName(){
getInfo().then(res => { const res = await JSON.parse(getWzglUser())
this.userName = res.username this.userName = res.username
}) this.authName = res.name
}, },
async getindex() { async getindex() {
this.loading = true this.loading = true

@ -310,7 +310,8 @@
isShow: false, isShow: false,
type: 'add', type: 'add',
id: '', id: '',
rukuType: '', rukuType: '',
authName:'',
rukuTypeName: '盘点', rukuTypeName: '盘点',
tableName: 'stocks', tableName: 'stocks',
importstableName: 'stocks_items', importstableName: 'stocks_items',
@ -978,10 +979,14 @@
} }
if (this.type === 'editor') { if (this.type === 'editor') {
this.getDetail() this.getDetail()
}
if(this.type=='add'){
this.form.jingbanren = this.authName
} }
} else { } else {
this.id = '' this.id = ''
this.type = '' this.type = ''
this.authName = ''
this.mingxiList = [] this.mingxiList = []
this.$refs['dialog'].reset() this.$refs['dialog'].reset()
} }

@ -8,7 +8,9 @@
<Input v-model="select.keyword" style="width: 200px;margin-right: 10px;" placeholder="经办人搜索" /> <Input v-model="select.keyword" style="width: 200px;margin-right: 10px;" placeholder="经办人搜索" />
<Button type="primary" @click="getindex"></Button> <Button type="primary" @click="getindex"></Button>
<Button icon="ios-add" type="primary" style="margin-left: 10px;" <Button icon="ios-add" type="primary" style="margin-left: 10px;"
@click="$refs['addRuku'].isShow = true,$refs['addRuku'].type = 'add',$refs['addRuku'].rukuType = rukuType">添加</Button> @click="$refs['addRuku'].isShow = true,$refs['addRuku'].type = 'add',
$refs['addRuku'].rukuType = rukuType
$refs['addRuku'].authName =authName">添加</Button>
<!-- <Button icon="ios-add" type="primary" style="margin-left: 10px;" <!-- <Button icon="ios-add" type="primary" style="margin-left: 10px;"
@click="$refs['imports'].show()">导入</Button> --> @click="$refs['imports'].show()">导入</Button> -->
@ -21,14 +23,17 @@
:table-item="table"> :table-item="table">
<template v-slot:btns> <template v-slot:btns>
<el-table-column fixed="right" label="操作" width="260" header-align="center"> <el-table-column fixed="right" label="操作" width="260" header-align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<Button type="primary" size="small" @click="editorRuku(scope.row.id,'editor')"></Button> <div v-if="scope.row.jingbanren==authName">
<!-- <Button type="primary" size="small" @click="editorActivity(scope.row.id,'editor')"></Button> <Button type="primary" size="small" @click="editorRuku(scope.row.id,'editor')"></Button>
<Button style="margin-left: 10px;" type="primary" size="small" @click="checkActivity(scope.row.id)"></Button> <!-- <Button type="primary" size="small" @click="editorActivity(scope.row.id,'editor')"></Button>
<Button type="primary" size="small" style="margin-left: 10px;" @click="editorActivity(scope.row.id,'copy')"></Button> --> <Button style="margin-left: 10px;" type="primary" size="small" @click="checkActivity(scope.row.id)"></Button>
<Poptip transfer confirm title="确认要删除吗?" @on-ok="deleteRuku(scope.row)"> <Button type="primary" size="small" style="margin-left: 10px;" @click="editorActivity(scope.row.id,'copy')"></Button> -->
<Button type="primary" style="margin-left: 10px;" size="small" ghost>删除</Button> <Poptip transfer confirm title="确认要删除吗?" @on-ok="deleteRuku(scope.row)">
</Poptip> <Button type="primary" style="margin-left: 10px;" size="small" ghost>删除</Button>
</Poptip>
</div>
</template> </template>
</el-table-column> </el-table-column>
</template> </template>
@ -49,7 +54,10 @@
import addRuku from "./component/addRuku.vue" import addRuku from "./component/addRuku.vue"
import { import {
Message Message
} from 'element-ui' } from 'element-ui'
import {
getWzglUser
} from "@/utils/auth.js"
import imports from "@/views/component/imports.vue" import imports from "@/views/component/imports.vue"
import { import {
index as fieldIndex index as fieldIndex
@ -64,6 +72,7 @@
}, },
data() { data() {
return { return {
authName:'',
loading:false, loading:false,
select: { select: {
pageSize: 10, pageSize: 10,
@ -140,7 +149,11 @@
] ]
} }
}, },
methods: { methods: {
async getUserName(){
const res = JSON.parse(getWzglUser())
this.authName = res.name
},
async getindex() { async getindex() {
this.loading = true this.loading = true
const res = await index({ const res = await index({
@ -198,7 +211,8 @@
this.rukuType = this.rukuTypeList[k] this.rukuType = this.rukuTypeList[k]
} }
} }
} }
this.getUserName()
this.getindex() this.getindex()
} }

Loading…
Cancel
Save