自己操作

master
lion 2 years ago
parent 3d0190e93b
commit 4fe7fdce1e

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

@ -1,6 +1,8 @@
import Cookies from 'js-cookie'
const TokenKey = 'patrol_wzgl_token'
const UserInfo = 'patrol_wzgl_user'
export function getToken() {
//return Cookies.get(TokenKey)
@ -22,3 +24,24 @@ export function removeToken() {
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 {
getInfo
} from '../../api/user.js'
import {
setWzglUser
} from '@/utils/auth.js'
export default {
components: {
@ -183,6 +186,7 @@
getInfo().then(response => {
console.log(response)
this.user = response
setWzglUser(this.user)
}).catch(error => {})
this.start_time = this.recentTime(-14, 'yyyy-MM-dd')
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="借用人搜索" />
<Button type="primary" @click="getindex"></Button>
<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;"
@click="$refs['imports'].show()">导入</Button> -->
@ -21,7 +23,8 @@
:table-item="table">
<template v-slot:btns>
<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 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>
@ -29,7 +32,9 @@
<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)">
<Button type="primary" style="margin-left: 10px;" size="small" ghost>删除</Button>
</Poptip>
</Poptip>
</div>
</template>
</el-table-column>
</template>
@ -48,8 +53,8 @@
destroy
} from "@/api/system/baseForm.js"
import {
getInfo
} from "@/api/user.js"
getWzglUser
} from "@/utils/auth.js"
import {
getOutboundsStatus
} from "@/api/contract.js"
@ -81,7 +86,8 @@
left: 0
},
loading:false,
userName:'',
userName:'',
authName:'',
select: {
pageSize: 10,
pageIndex: 1,
@ -152,10 +158,10 @@
}
},
methods: {
getUserName(){
getInfo().then(res => {
this.userName = res.username
})
async getUserName(){
const res = await JSON.parse(getWzglUser())
this.userName = res.username
this.authName = res.name
},
async getindex() {
this.loading = true

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

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

Loading…
Cancel
Save