自己操作

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
@ -140,6 +141,7 @@ const actions = {
logout(state.token).then(() => {
removeToken() // must remove token first
resetRouter()
removeWzglUser()
commit('RESET_STATE')
resolve()
}).catch(error => {
@ -154,6 +156,7 @@ const actions = {
}) {
return new Promise(resolve => {
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()

@ -1,17 +1,14 @@
<template>
<div>
<xy-dialog ref="dialog" :width='70' :is-show.sync="isShow" type="form" :title="titleName" :form="form" :rules="rules" @submit="submit">
<xy-dialog ref="dialog" :width='70' :is-show.sync="isShow" type="form" :title="titleName" :form="form"
:rules="rules" @submit="submit">
<template v-slot:chukushijian>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;">*</span>出库时间
</div>
<div class="xy-table-item-content">
<el-date-picker
style="width: 300px;"
v-model="form.chukushijian"
type="date"
placeholder="选择日期"
<el-date-picker style="width: 300px;" v-model="form.chukushijian" type="date" placeholder="选择日期"
value-format="yyyy-MM-dd">
</el-date-picker>
</div>
@ -41,10 +38,7 @@
</div>
<div class="xy-table-item-content">
<el-select v-model="form.jieyongcangku" filterable style="width: 300px;" placeholder="请选择借用仓库">
<el-option
v-for="item in cangkuList"
:key="item.cangkumingcheng"
:label="item.cangkumingcheng"
<el-option v-for="item in cangkuList" :key="item.cangkumingcheng" :label="item.cangkumingcheng"
:value="item.cangkumingcheng">
</el-option>
</el-select>
@ -88,7 +82,8 @@
<span style="color: red;font-weight: 600;padding-right: 4px;"></span>报废原因
</div>
<div class="xy-table-item-content">
<el-input type="textarea" v-model="form.baofeiyuanyin" placeholder="请输入报废原因" clearable style="width: 300px;"></el-input>
<el-input type="textarea" v-model="form.baofeiyuanyin" placeholder="请输入报废原因" clearable
style="width: 300px;"></el-input>
</div>
</div>
</template>
@ -98,7 +93,8 @@
<span style="color: red;font-weight: 600;padding-right: 4px;"></span>备注
</div>
<div class="xy-table-item-content">
<el-input type="textarea" v-model="form.beizhu" placeholder="请输入备注" clearable style="width: 300px;"></el-input>
<el-input type="textarea" v-model="form.beizhu" placeholder="请输入备注" clearable
style="width: 300px;"></el-input>
</div>
</div>
</template>
@ -108,16 +104,13 @@
<span style="color: red;font-weight: 600;padding-right: 4px;"></span>出库明细
</div>
<div class="xy-table-item-content">
<Button type="primary" icon="md-add" style="margin-bottom: 10px"
@click="isShowMingxi=true">新增出库明细</Button>
<Button type="primary" icon="md-add" style="margin-bottom: 10px" @click="isShowMingxi=true"></Button>
<xy-table style="width: 50%" :height="260" :is-page="false" :list="mingxiList"
:table-item="mingxiTable">
<xy-table style="width: 50%" :height="260" :is-page="false" :list="mingxiList" :table-item="mingxiTable">
<template v-slot:btns>
<el-table-column label="操作" width="90" header-align="center" align="center">
<template v-slot:default="scope">
<Button size="small" type="primary" ghost
@click="mingxiList.splice(scope.$index, 1)">删除</Button>
<Button size="small" type="primary" ghost @click="mingxiList.splice(scope.$index, 1)">删除</Button>
</template>
</el-table-column>
</template>
@ -131,7 +124,8 @@
</xy-dialog>
<!-- 新增明细 -->
<Modal v-model="isShowMingxi" width='600' title="新增明细" :loading='showLoading' @on-cancel='mingxiCancel' @on-ok="mingxiConfirm">
<Modal v-model="isShowMingxi" width='600' title="新增明细" :loading='showLoading' @on-cancel='mingxiCancel'
@on-ok="mingxiConfirm">
<div class="mingxiwrap">
<div class="xy-table-item">
<div class="xy-table-item-label">
@ -202,11 +196,7 @@
</div>
<div class="xy-table-item-content">
<el-select v-model="mingxiObj.shifouhuiku" style="width: 300px;" placeholder="请选择">
<el-option
v-for="item in huikuoptions"
:key="item.value"
:label="item.label"
:value="item.value">
<el-option v-for="item in huikuoptions" :key="item.value" :label="item.label" :value="item.value">
</el-option>
</el-select>
</div>
@ -216,11 +206,7 @@
<span style="color: red;font-weight: 600;padding-right: 4px;"></span>回库时间
</div>
<div class="xy-table-item-content">
<el-date-picker
style="width: 300px;"
v-model="mingxiObj.huikushijian"
type="date"
placeholder="选择日期"
<el-date-picker style="width: 300px;" v-model="mingxiObj.huikushijian" type="date" placeholder="选择日期"
value-format="yyyy-MM-dd">
</el-date-picker>
</div>
@ -235,13 +221,10 @@
<el-input type="text" @keyup.enter.native="getWuzi" v-model="keyword" placeholder="请输入关键词查找库存"></el-input>
<el-button type="primary" @click="getWuzi"></el-button>
</div>
<Table
highlight-row
ref="currentRowTable"
:columns="wuziColumns"
:data="wuziList"
<Table highlight-row ref="currentRowTable" :columns="wuziColumns" :data="wuziList"
@on-current-change="wuziSelect" />
<Page :current="wuziPageIndex" :total="wuziTotal" simple style="padding-top: 14px;display: flex;justify-content: center;" @on-change="wuziPageChange"/>
<Page :current="wuziPageIndex" :total="wuziTotal" simple
style="padding-top: 14px;display: flex;justify-content: center;" @on-change="wuziPageChange" />
</Modal>
@ -250,9 +233,14 @@
</template>
<script>
import {save,index,show} from "@/api/system/baseForm.js"
import {getInfo} from "@/api/user.js"
import { Message } from 'element-ui'
import {
save,
index,
show
} from "@/api/system/baseForm.js"
import {
Message
} from 'element-ui'
export default {
data() {
@ -260,6 +248,7 @@ export default {
isShow: false,
type: 'add',
id: '',
authName: "",
titleName: '',
keyword: '',
chukuType: '',
@ -272,15 +261,13 @@ export default {
label: '处置',
value: '应急'
}],
huikuoptions:[
{
huikuoptions: [{
label: '是',
value: '是'
}, {
label: '否',
value: '否'
}
],
}],
form: {
chukushijian: "",
chukuleixing: '',
@ -321,8 +308,7 @@ export default {
mingxiList: [],
showLoading: true,
mingxiIndex: '',
mingxiTable: [
{
mingxiTable: [{
label: "物资编码",
prop: "wuzibianma",
width: 180
@ -364,14 +350,14 @@ export default {
label: "回库时间",
prop: "huikushijian",
width: 180
}],
}
],
//
isShowWuzi: false,
wuziList: [],
wuziPageIndex: 1,
wuziTotal: 0,
wuziColumns:[
{
wuziColumns: [{
width: 60,
_isChecked: false,
key: "isSelect",
@ -433,7 +419,8 @@ export default {
this.showLoading = true
})
}, 500)
if(this.mingxiObj.wuzibianma==''||this.mingxiObj.jieyongshuliang==''||this.mingxiObj.shifouhuiku==''){
if (this.mingxiObj.wuzibianma == '' || this.mingxiObj.jieyongshuliang == '' || this.mingxiObj.shifouhuiku ==
'') {
Message({
type: 'warning',
message: '请填写完整数据'
@ -492,7 +479,11 @@ export default {
page_size: 10,
page: this.wuziPageIndex,
table_name: 'inventorys',
filter:[{"key":"zichanmingcheng","op":"like","value":this.keyword}]
filter: [{
"key": "zichanmingcheng",
"op": "like",
"value": this.keyword
}]
})
for (var m of res.data) {
m.names = m.wuzibianma + "--" + m.zichanmingcheng
@ -532,7 +523,10 @@ export default {
this.cangkuList = res.data
},
async getDetail() {
const res = await show({id:this.id,table_name:this.tableName})
const res = await show({
id: this.id,
table_name: this.tableName
})
this.form = {
chukushijian: res?.chukushijian,
zhuangtai: res?.zhuangtai,
@ -582,27 +576,24 @@ export default {
})
}
},
getUserName(){
getInfo().then(res=>{
this.form.jilurenyuan = res.name
})
},
},
watch: {
isShow(newVal) {
if (newVal) {
this.titleName = this.type === 'add' ? `新增${this.chukuType}出库` : (this.type === 'editor'?`编辑${this.chukuType}出库`:'出库')
this.titleName = this.type === 'add' ? `新增${this.chukuType}出库` : (this.type === 'editor' ?
`编辑${this.chukuType}出库` : '出库')
this.form.chukuleixing = this.chukuType
if (this.type === 'editor' || this.type === 'outbounds') {
this.getDetail()
} else {
this.getUserName()
this.form.jilurenyuan = this.authName
}
} else {
this.id = ''
this.type = ''
this.mingxiList = []
this.authName = ''
this.$refs['dialog'].reset()
}
}
@ -616,20 +607,25 @@ export default {
display: flex;
flex-wrap: wrap;
}
.mingxiwrap .xy-table-item {
margin-bottom: 10px
}
.searchCompanys {
display: flex;
justify-content: space-between;
margin-bottom: 15px;
}
::v-deep .searchCompanys .el-input {
width: 82%
}
.xy-table-item-label {
width: 160px;
}
.img__delete {
transform: scale(0.8, 0.8);
@ -637,6 +633,7 @@ export default {
top: 4px;
right: 4px;
}
::v-deep .avatar-uploader .el-upload {
border: 1px dashed #d9d9d9;
border-radius: 6px;
@ -644,9 +641,11 @@ export default {
position: relative;
overflow: hidden;
}
::v-deep .avatar-uploader .el-upload:hover {
border-color: #409EFF;
}
::v-deep .el-upload--picture-card {
font-size: 28px;
color: #8c939d;
@ -655,6 +654,7 @@ export default {
line-height: 80px !important;
text-align: center;
}
::v-deep .avatar-uploader-icon {
font-size: 28px;
color: #8c939d;
@ -663,6 +663,7 @@ export default {
line-height: 80px !important;
text-align: center;
}
::v-deep .avatar {
width: 80px !important;
display: block;

@ -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> -->
@ -22,6 +24,7 @@
<template v-slot:btns>
<el-table-column fixed="right" label="操作" width="260" header-align="center">
<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>
@ -30,6 +33,8 @@
<Poptip transfer confirm title="确认要删除吗?" @on-ok="deleteChuku(scope.row)">
<Button type="primary" style="margin-left: 10px;" size="small" ghost>删除</Button>
</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"
@ -82,6 +87,7 @@
},
loading:false,
userName:'',
authName:'',
select: {
pageSize: 10,
pageIndex: 1,
@ -152,10 +158,10 @@
}
},
methods: {
getUserName(){
getInfo().then(res => {
async getUserName(){
const res = await JSON.parse(getWzglUser())
this.userName = res.username
})
this.authName = res.name
},
async getindex() {
this.loading = true

@ -311,6 +311,7 @@
type: 'add',
id: '',
rukuType: '',
authName:'',
rukuTypeName: '盘点',
tableName: 'stocks',
importstableName: 'stocks_items',
@ -979,9 +980,13 @@
if (this.type === 'editor') {
this.getDetail()
}
if(this.type=='add'){
this.form.jingbanren = this.authName
}
} else {
this.id = ''
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> -->
@ -22,6 +24,7 @@
<template v-slot:btns>
<el-table-column fixed="right" label="操作" width="260" header-align="center">
<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>
@ -29,6 +32,8 @@
<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>
@ -50,6 +55,9 @@
import {
Message
} 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,
@ -141,6 +150,10 @@
}
},
methods: {
async getUserName(){
const res = JSON.parse(getWzglUser())
this.authName = res.name
},
async getindex() {
this.loading = true
const res = await index({
@ -199,6 +212,7 @@
}
}
}
this.getUserName()
this.getindex()
}

Loading…
Cancel
Save