回库 kucun

master
lion 3 years ago
parent 0d48dc9688
commit d192e73b23

@ -29,6 +29,7 @@
"normalize.css": "7.0.0",
"nprogress": "0.2.0",
"path-to-regexp": "2.4.0",
"qrcodejs2": "0.0.2",
"tinymce": "^5.10.7",
"view-design": "^4.7.0",
"vue": "2.6.10",

@ -2,13 +2,13 @@
<div style="padding: 0 20px">
<div ref="lxHeader">
<lx-header icon="md-apps" text="库管理" style="margin-bottom: 10px; border: 0px; margin-top: 15px">
<lx-header icon="md-apps" text="管理" style="margin-bottom: 10px; border: 0px; margin-top: 15px">
<slot>
<div style="display: flex;justify-content: flex-start;flex-wrap: wrap;">
<!-- <Input v-model="select.keyword" style="width: 200px;margin-right: 10px;" placeholder="关键字搜索" />
<Button type="primary" @click="getActivities"></Button> -->
<Button icon="ios-add" type="primary" style="margin-left: 10px;"
@click="$refs['addRuku'].isShow = true,$refs['addRuku'].type = 'add'">添加</Button>
<!-- <Button icon="ios-add" type="primary" style="margin-left: 10px;"
@click="$refs['addRuku'].isShow = true,$refs['addRuku'].type = 'add'">添加</Button> -->
<!-- <Button icon="ios-add" type="primary" style="margin-left: 10px;"
@click="$refs['imports'].show()">导入</Button> -->
@ -18,23 +18,29 @@
</div>
<xy-table :list="list" :total="total" @pageSizeChange="e => select.pageSize = e" @pageIndexChange="pageChange"
:table-item="table">
<template v-slot:btns>
<el-table-column fixed="right" label="操作" width="260" header-align="center">
:table-item="table" :auths='[]'>
<template v-slot:btns>
<div></div>
<!-- <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 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> -->
<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>
</el-table-column>
</el-table-column> -->
</template>
</xy-table>
<!-- <addRuku ref="addRuku" @refresh="getindex"></addRuku> -->
<!-- <addRuku ref="addRuku" @refresh="getindex"></addRuku> -->
<div class="code" v-if="showcode" @click="closeCode">
<div id="qrCode" ref="qrCodeDiv"></div>
</div>
<imports :table-name="customForm.tableName" :form-info="form" ref="imports" @refresh="getindex"></imports>
@ -46,7 +52,8 @@
index,
destroy
} from "@/api/system/baseForm.js"
// import addRuku from "./component/addRuku.vue"
// import addRuku from "./component/addRuku.vue"
import QRCode from 'qrcodejs2';
import {
Message
} from 'element-ui'
@ -63,7 +70,8 @@
pageSize: 10,
pageIndex: 1,
keyword: ""
},
},
showcode:false,
customForm: {
customFormId: "",
tableName: ""
@ -74,53 +82,102 @@
table: [{
label:'序号',
type:'index',
fixed:'left'
fixed:'left',
width:80,
},
{
label: "入库时间",
label: "物资编码",
width: 180,
prop: 'rukushijian',
prop: 'wuzibianma',
align: 'center'
},
{
label: "入库类型",
width: 180,
prop: 'rukuleixing',
label: "资产名称",
prop: 'zichanmingcheng',
align: 'center'
},
{
label: "经办人",
label: "物资类型",
width: 120,
prop: 'jingbanren',
prop: 'wuzileixing',
align: 'center'
},
{
label: "记录人员",
width: 220,
prop: 'jilurenyuan',
label: "计量单位",
width: 120,
prop: 'jiliangdanwei',
align: 'left'
},
{
label: "保管人员",
width: 140,
prop: 'baoguanrenyuan'
label: "入库数量",
width: 120,
prop: 'rukushuliang'
},
{
label: "在库数量",
width: 120,
prop: 'zaikushuliang'
},
{
label: "入库批次",
width: 120,
prop: 'rukupici'
},
{
label: "所在仓库",
width: 180,
prop: 'suozaicangku'
},
{
label: "所在货架",
width: 180,
prop: 'suozaihuojia'
},
{
label: "二维码",
width: 180,
prop: 'erweima',
customFn: (row) => {
return (<Button type='primary' size='small'
on=
{
{
["click"]: (e) => (this.showCode(e, row))
}
}
>生成二维码</Button>)
}
},
{
label: "备注",
width: 200,
prop: 'beizhu',
align: 'left'
}
]
}
},
methods: {
methods: {
showCode(e,row){
console.log(e,row)
this.showcode = true
this.$nextTick(function(){
new QRCode(this.$refs.qrCodeDiv, {
text: row.wuzibianma+'-'+row.id,
width: 200,
height: 200,
colorDark: "#333333", //
colorLight: "#ffffff", //
correctLevel: QRCode.CorrectLevel.L//L/M/H
})
})
},
closeCode(){
this.$refs.qrCodeDiv.innerHTML = ""
this.showcode = false
},
async getindex() {
const res = await index({
rows: this.select.pageSize,
page: this.select.pageIndex,
table_name: 'stocks',
table_name: 'inventorys',
keyword: this.select.keyword
})
this.list = res.data
@ -206,5 +263,21 @@
}
</script>
<style scoped lang="scss">
<style scoped lang="scss">
.code{
position: absolute;
left:0;
top:0;
background: rgba(0, 0, 0, 0.5);
width:100%;
height:100%;
z-index:9999
}
#qrCode{
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%,-50%);
}
</style>

@ -100,9 +100,10 @@
<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"
<Button v-if="form.rukuleixing!=''" type="primary" icon="md-add" style="margin-bottom: 10px"
@click="isShowMingxi=true">新增入库明细</Button>
<Button v-if="form.rukuleixing==''" type="primary" icon="md-add" style="margin-bottom: 10px"
@click="isShowMingxi=true">新增回库明细</Button>
<xy-table style="width: 620px" :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">
@ -128,9 +129,13 @@
<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-input type="text" @focus="showWuzi" v-model="mingxiObj.wuzibianma" placeholder="请选择物资编码"
<div class="xy-table-item-content" style="display: flex;align-items: center;">
<el-input v-if="form.rukuleixing!=''" type="text" @focus="showWuzi" v-model="mingxiObj.wuzibianma" placeholder="请选择物资编码"
style="width: 300px;"></el-input>
<el-input v-if="form.rukuleixing==''" @change='getKucunShow' ref='huikubianma' type="text" v-model="mingxiObj.wuzibianma" placeholder="请扫码获取回库物资编码"
style="width: 300px;"></el-input>
<Button @click='showWuzi("回库")' v-if="form.rukuleixing==''" type="primary" icon="md-add" style="margin-left: 10px"
>选择</Button>
</div>
</div>
<div class="xy-table-item">
@ -195,14 +200,15 @@
<!-- 选择物资编号 -->
<Modal v-model="isShowWuzi" title="物资选择">
<div class="searchCompanys">
<el-input type="text" @keyup.enter.native="getWuzi" v-model="keyword" placeholder="请输入关键词查找"></el-input>
<el-button type="primary" @click="getWuzi"></el-button>
<el-input type="text" @keyup.enter.native="getList" v-model="keyword" placeholder="请输入关键词查找"></el-input>
<el-button type="primary" @click="getList"></el-button>
</div>
<Table highlight-row ref="currentRowTable" :columns="wuziColumns" :data="wuziList"
<Table highlight-row ref="currentRowTable" :columns="wuziColumns" :data="showList"
@on-current-change="wuziSelect" />
<Page :current="wuziPageIndex" :total="wuziTotal" simple
<Page :current="wuziPageIndex" :total="showTotal" simple
style="padding-top: 14px;display: flex;justify-content: center;" @on-change="wuziPageChange" />
</Modal>
</Modal>
</div>
</template>
@ -281,10 +287,14 @@
],
//
isShowWuzi: false,
wuziList: [],
wuziList: [],
kucunList:[],
showList:[],
wuziPageIndex: 1,
keyword:'',
wuziTotal: 0,
keyword:'',
showTotal:0,
wuziTotal: 0,
kucunTotal:0,
wuziColumns: [{
title: '名称',
key: 'names',
@ -293,7 +303,8 @@
},
created() {
this.getCangku()
this.getWuzi()
// this.getWuzi()
// this.getKucun()
},
methods: {
mingxiConfirm(){
@ -313,12 +324,18 @@
this.mingxiObjBefore = {}
this.mingxiIndex = ''
this.isShowMingxi = false
this.showList = []
this.showTotal = 0
this.wuziPageIndex = 1
},
mingxiCancel(){
this.mingxiObj = {}
this.mingxiObjBefore = {}
this.mingxiIndex = ''
this.isShowMingxi = false
this.showList = []
this.showTotal = 0
this.wuziPageIndex = 1
},
editMingxi(index){
const before = this.mingxiList[index]
@ -329,10 +346,40 @@
this.mingxiIndex = index+1 // 0=false
this.isShowMingxi = true
},
showWuzi() {
console.log("123")
this.isShowWuzi = true
showWuzi(type) {
if(this.form.rukuleixing==''){
Message({
type: 'warning',
message: '请先选择入库类型'
})
return
}
this.isShowWuzi = true
if(type=='回库'){
this.$nextTick(() => {
this.$refs.huikubianma.focus()
})
this.getKucun()
// this.showList = this.kucunList
// this.showTotal = this.kucunTotal
}else{
this.getWuzi()
// this.showList = this.wuziList
// this.showTotal = this.wuziTotal
}
},
getList(){
if(this.form.rukuleixing=='回库'){
this.getKucun()
// this.showList = this.kucunList
// this.showTotal = this.kucunTotal
}else{
this.getWuzi()
// this.showList = this.wuziList
// this.showTotal = this.wuziTotal
}
},
async getWuzi() {
let res = await index({
@ -344,8 +391,43 @@
for (var m of res.data) {
m.names = m.wuzibianma + "--" + m.zichanmingcheng
}
this.wuziList = res.data
this.wuziTotal = res.total
this.showList = res.data
this.showTotal = res.total
},
async getKucun() {
let res = await index({
page_size: 10,
page: this.wuziPageIndex,
table_name: 'inventorys',
filter:[{"key":"zichanmingcheng","op":"like","value":this.keyword}]
})
for (var m of res.data) {
m.names = m.wuzibianma + "--" + m.zichanmingcheng
}
this.showList = res.data
this.showTotal = res.total
},
async getKucunShow(e){
console.log(e)
let id = ''
if(e){
id = e.split('-')[1]
this.$nextTick(() => {
this.$refs.huikubianma.blur()
})
}else{
return
}
const res = await show({
id: id,
table_name: "inventorys"
})
this.mingxiObj.wuzibianma = res.wuzibianma
this.mingxiObj.zichanmingcheng = res.zichanmingcheng
this.mingxiObj.wuzileixing = res.wuzileixing
this.mingxiObj.jiliangdanwei = res.jiliangdanwei
this.mingxiObj.id = res.id
},
async getCangku() {
let res = await index({
@ -361,9 +443,10 @@
this.mingxiObj.wuzileixing = e.wuzileixing
this.mingxiObj.jiliangdanwei = e.jiliangdanwei
},
wuziPageChange(e) {
wuziPageChange(e) {
console.log("e",e)
this.wuziPageIndex = e
this.getWuzi()
this.getList()
},
showWuzimingxi() {
@ -404,7 +487,6 @@
type: 'success',
message: '编辑成功'
})
callback
})
},
submit() {

Loading…
Cancel
Save