回库 kucun

master
lion 3 years ago
parent 0d48dc9688
commit d192e73b23

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

@ -2,13 +2,13 @@
<div style="padding: 0 20px"> <div style="padding: 0 20px">
<div ref="lxHeader"> <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> <slot>
<div style="display: flex;justify-content: flex-start;flex-wrap: wrap;"> <div style="display: flex;justify-content: flex-start;flex-wrap: wrap;">
<!-- <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="getActivities"></Button> --> <Button type="primary" @click="getActivities"></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'">添加</Button> @click="$refs['addRuku'].isShow = true,$refs['addRuku'].type = 'add'">添加</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> -->
@ -18,23 +18,29 @@
</div> </div>
<xy-table :list="list" :total="total" @pageSizeChange="e => select.pageSize = e" @pageIndexChange="pageChange" <xy-table :list="list" :total="total" @pageSizeChange="e => select.pageSize = e" @pageIndexChange="pageChange"
:table-item="table"> :table-item="table" :auths='[]'>
<template v-slot:btns> <template v-slot:btns>
<el-table-column fixed="right" label="操作" width="260" header-align="center"> <div></div>
<!-- <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> <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 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)"> <Poptip transfer confirm title="确认要删除吗?" @on-ok="deleteRuku(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>
</template> </template>
</el-table-column> </el-table-column> -->
</template> </template>
</xy-table> </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> <imports :table-name="customForm.tableName" :form-info="form" ref="imports" @refresh="getindex"></imports>
@ -46,7 +52,8 @@
index, index,
destroy destroy
} from "@/api/system/baseForm.js" } from "@/api/system/baseForm.js"
// import addRuku from "./component/addRuku.vue" // import addRuku from "./component/addRuku.vue"
import QRCode from 'qrcodejs2';
import { import {
Message Message
} from 'element-ui' } from 'element-ui'
@ -63,7 +70,8 @@
pageSize: 10, pageSize: 10,
pageIndex: 1, pageIndex: 1,
keyword: "" keyword: ""
}, },
showcode:false,
customForm: { customForm: {
customFormId: "", customFormId: "",
tableName: "" tableName: ""
@ -74,53 +82,102 @@
table: [{ table: [{
label:'序号', label:'序号',
type:'index', type:'index',
fixed:'left' fixed:'left',
width:80,
}, },
{ {
label: "入库时间", label: "物资编码",
width: 180, width: 180,
prop: 'rukushijian', prop: 'wuzibianma',
align: 'center' align: 'center'
}, },
{ {
label: "入库类型", label: "资产名称",
width: 180, prop: 'zichanmingcheng',
prop: 'rukuleixing',
align: 'center' align: 'center'
}, },
{ {
label: "经办人", label: "物资类型",
width: 120, width: 120,
prop: 'jingbanren', prop: 'wuzileixing',
align: 'center' align: 'center'
}, },
{ {
label: "记录人员", label: "计量单位",
width: 220, width: 120,
prop: 'jilurenyuan', prop: 'jiliangdanwei',
align: 'left' align: 'left'
}, },
{ {
label: "保管人员", label: "入库数量",
width: 140, width: 120,
prop: 'baoguanrenyuan' 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() { async getindex() {
const res = await index({ const res = await index({
rows: this.select.pageSize, rows: this.select.pageSize,
page: this.select.pageIndex, page: this.select.pageIndex,
table_name: 'stocks', table_name: 'inventorys',
keyword: this.select.keyword keyword: this.select.keyword
}) })
this.list = res.data this.list = res.data
@ -206,5 +263,21 @@
} }
</script> </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> </style>

@ -100,9 +100,10 @@
<span style="color: red;font-weight: 600;padding-right: 4px;"></span>入库明细 <span style="color: red;font-weight: 600;padding-right: 4px;"></span>入库明细
</div> </div>
<div class="xy-table-item-content"> <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> @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"> <xy-table style="width: 620px" :height="260" :is-page="false" :list="mingxiList" :table-item="mingxiTable">
<template v-slot:btns> <template v-slot:btns>
<el-table-column label="操作" width="90" header-align="center" align="center"> <el-table-column label="操作" width="90" header-align="center" align="center">
@ -128,9 +129,13 @@
<div class="xy-table-item-label"> <div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;"></span>物资编码 <span style="color: red;font-weight: 600;padding-right: 4px;"></span>物资编码
</div> </div>
<div class="xy-table-item-content"> <div class="xy-table-item-content" style="display: flex;align-items: center;">
<el-input type="text" @focus="showWuzi" v-model="mingxiObj.wuzibianma" placeholder="请选择物资编码" <el-input v-if="form.rukuleixing!=''" type="text" @focus="showWuzi" v-model="mingxiObj.wuzibianma" placeholder="请选择物资编码"
style="width: 300px;"></el-input> 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> </div>
<div class="xy-table-item"> <div class="xy-table-item">
@ -195,14 +200,15 @@
<!-- 选择物资编号 --> <!-- 选择物资编号 -->
<Modal v-model="isShowWuzi" title="物资选择"> <Modal v-model="isShowWuzi" title="物资选择">
<div class="searchCompanys"> <div class="searchCompanys">
<el-input type="text" @keyup.enter.native="getWuzi" v-model="keyword" placeholder="请输入关键词查找"></el-input> <el-input type="text" @keyup.enter.native="getList" v-model="keyword" placeholder="请输入关键词查找"></el-input>
<el-button type="primary" @click="getWuzi"></el-button> <el-button type="primary" @click="getList"></el-button>
</div> </div>
<Table highlight-row ref="currentRowTable" :columns="wuziColumns" :data="wuziList" <Table highlight-row ref="currentRowTable" :columns="wuziColumns" :data="showList"
@on-current-change="wuziSelect" /> @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" /> style="padding-top: 14px;display: flex;justify-content: center;" @on-change="wuziPageChange" />
</Modal> </Modal>
</div> </div>
</template> </template>
@ -281,10 +287,14 @@
], ],
// //
isShowWuzi: false, isShowWuzi: false,
wuziList: [], wuziList: [],
kucunList:[],
showList:[],
wuziPageIndex: 1, wuziPageIndex: 1,
keyword:'', keyword:'',
wuziTotal: 0, showTotal:0,
wuziTotal: 0,
kucunTotal:0,
wuziColumns: [{ wuziColumns: [{
title: '名称', title: '名称',
key: 'names', key: 'names',
@ -293,7 +303,8 @@
}, },
created() { created() {
this.getCangku() this.getCangku()
this.getWuzi() // this.getWuzi()
// this.getKucun()
}, },
methods: { methods: {
mingxiConfirm(){ mingxiConfirm(){
@ -313,12 +324,18 @@
this.mingxiObjBefore = {} this.mingxiObjBefore = {}
this.mingxiIndex = '' this.mingxiIndex = ''
this.isShowMingxi = false this.isShowMingxi = false
this.showList = []
this.showTotal = 0
this.wuziPageIndex = 1
}, },
mingxiCancel(){ mingxiCancel(){
this.mingxiObj = {} this.mingxiObj = {}
this.mingxiObjBefore = {} this.mingxiObjBefore = {}
this.mingxiIndex = '' this.mingxiIndex = ''
this.isShowMingxi = false this.isShowMingxi = false
this.showList = []
this.showTotal = 0
this.wuziPageIndex = 1
}, },
editMingxi(index){ editMingxi(index){
const before = this.mingxiList[index] const before = this.mingxiList[index]
@ -329,10 +346,40 @@
this.mingxiIndex = index+1 // 0=false this.mingxiIndex = index+1 // 0=false
this.isShowMingxi = true this.isShowMingxi = true
}, },
showWuzi() { showWuzi(type) {
console.log("123") if(this.form.rukuleixing==''){
this.isShowWuzi = true 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() { async getWuzi() {
let res = await index({ let res = await index({
@ -344,8 +391,43 @@
for (var m of res.data) { for (var m of res.data) {
m.names = m.wuzibianma + "--" + m.zichanmingcheng m.names = m.wuzibianma + "--" + m.zichanmingcheng
} }
this.wuziList = res.data this.showList = res.data
this.wuziTotal = res.total 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() { async getCangku() {
let res = await index({ let res = await index({
@ -361,9 +443,10 @@
this.mingxiObj.wuzileixing = e.wuzileixing this.mingxiObj.wuzileixing = e.wuzileixing
this.mingxiObj.jiliangdanwei = e.jiliangdanwei this.mingxiObj.jiliangdanwei = e.jiliangdanwei
}, },
wuziPageChange(e) { wuziPageChange(e) {
console.log("e",e)
this.wuziPageIndex = e this.wuziPageIndex = e
this.getWuzi() this.getList()
}, },
showWuzimingxi() { showWuzimingxi() {
@ -404,7 +487,6 @@
type: 'success', type: 'success',
message: '编辑成功' message: '编辑成功'
}) })
callback
}) })
}, },
submit() { submit() {

Loading…
Cancel
Save