Commit d8a307de authored by zhengke's avatar zhengke

修改

parent fc5000dd
...@@ -13,7 +13,7 @@ export default { ...@@ -13,7 +13,7 @@ export default {
</script> </script>
<style> <style>
@import "//at.alicdn.com/t/font_1544586_kc9j119l3w.css"; @import "//at.alicdn.com/t/font_1544586_7izg0wp5b3o.css";
@import "./assets/css/common.css"; @import "./assets/css/common.css";
@import './assets/global/font.css'; @import './assets/global/font.css';
@import "./assets/css/reset.css"; @import "./assets/css/reset.css";
......
<style>
.outbound_Main {
position: relative;
}
.outbound_Main .outBound_Cont {
min-height: 800px;
padding: 20px;
}
.outbound_Main .outbound_table {
width: 100%;
}
.outbound_Main .outbound_Gun {
width: 100%;
}
</style>
<template>
<div class="outbound_Main">
<div class="routerTitle" style="padding:17px 30px;">
<span class="pageTitle" style="margin-top:-5px;">商品出库</span>
<span @click="sureOutband()" class="chaxunSpan">确认出库</span>
</div>
<ul class="queryul" style="margin-left:20px;">
扫码出库
<li style="min-width: 364px;">
<el-input ref="barCodeInput" v-model="barCode" placeholder="商品出库条码"
@keyup.enter.native="payCode"></el-input>
</li>
</ul>
<div class="outBound_Cont">
<div class="outbound_Gun">
<vxe-table stripe style="margin-top:10px;width:100%" :loading="loadingSearch" :data="scanData">
<vxe-table-column field="ImageList" title="图片">
<template v-slot="{ row }">
<img style="width:100px;height:100px;" :src="row.ImageList[0]" />
</template>
</vxe-table-column>
<vxe-table-column field="Name" title="姓名"></vxe-table-column>
<vxe-table-column field="SuppliesNum" title="物料编码"></vxe-table-column>
<vxe-table-column field="SpecificationList" title="商品规格列表">
<template v-slot="{ row }">
<div v-for="(item,index) in row.SpecificationList" :key="index">
{{item}}
</div>
</template>
</vxe-table-column>
<vxe-table-column field="Units" title="单位"></vxe-table-column>
<vxe-table-column field="StockInNum" title="入库单号"></vxe-table-column>
<vxe-table-column field="StockInDate" title="入库时间"></vxe-table-column>
<vxe-table-column field="UnitPrice" title="价格"></vxe-table-column>
<vxe-table-column title="操作">
<template v-slot="{ row, rowIndex }">
<img @click="delBound(row,rowIndex)" style="width:24px;height:24px"
src="../../assets/img/delete.png" alt="">
</template>
</vxe-table-column>
</vxe-table>
</div>
<div class="outbound_table">
<ul class="queryul" style="margin:30px 0 25px 0;">
选择仓库
<li style="margin-bottom:0;">
<el-select size="mini" v-model="msg.WarehouseId" @change="getData()" placeholder="请选择">
<el-option :key="0" label="不限" :value="0"></el-option>
<el-option v-for="item in getWareHouseList" :key="item.Id" :label="item.Name" :value="item.Id">
</el-option>
</el-select>
</li>
</ul>
<vxe-table stripe style="margin-top:15px;width:100%" :loading="loading" :data="tableData">
<vxe-table-column field="OrderNo" title="订单号"></vxe-table-column>
<vxe-table-column field="GoodsName" title="商户名称"></vxe-table-column>
<vxe-table-column field="Specification" title="商品规格"></vxe-table-column>
<vxe-table-column field="Number" title="购买数量"></vxe-table-column>
<vxe-table-column field="nowBound" title="正在出库"></vxe-table-column>
</vxe-table>
</div>
</div>
</div>
</template>
<script>
export default {
data() {
return {
barCode: '',
getWareHouseList: [],
//数据
tableData: [],
//主要商品列表loading
loading: false,
//扫码枪loading
loadingSearch: false,
msg: {
ID: 0,
WarehouseId: 0
},
scanData: [],
//确认出库msg
sureMsg: {
ID: 0,
WarehouseId: 0,
WarehouseOutGoodsDetailList: []
},
orderNum:0
};
},
mounted() {
this.msg.ID = this.$route.query.ID;
this.getWareHouse();
this.getData();
// var myInput = document.getElementById('myCode');
// myInput.focus();
// myInput.onblur = function() {
// myInput.focus();
// }
this.$refs["barCodeInput"].focus();
},
methods: {
currentChange(val) {
this.msg.pageIndex = val;
this.getList();
},
// 仓库列表
getWareHouse() {
this.apiJavaPost("/api/Supplies/GetWareHouseList", {
Name: ''
},
res => {
if (res.data.resultCode === 1) {
this.getWareHouseList = res.data.data;
console.log(res,'res');
} else {
this.Error(res.data.message);
}
},
null
);
},
//获取数据
getData() {
this.loading = true;
this.apiJavaPost("/api/WarehouseOut/GetOuGoodsByWarehouseId", this.msg,
res => {
this.loading = false;
if (res.data.resultCode === 1) {
this.tableData = res.data.data;
if (this.tableData) {
this.tableData.forEach(x => {
x.nowBound = 0;
})
}
} else {
this.Error(res.data.message);
}
},
null
);
},
//扫码枪开始
payCode() {
let msg = {
Code: this.barCode,
WareHouseId: this.msg.WarehouseId
}
this.loadingSearch = true;
this.apiJavaPost("/api/Supplies/GetProcurementGoodsInfo", msg,
res => {
this.loadingSearch = false;
if (res.data.resultCode === 1) {
var myData = res.data.data.GoodsModel;
if(myData){
var scanMsg = {};
var data2 = JSON.parse(JSON.stringify(this.tableData));
this.orderNum=0;
data2.forEach(x => {
if ((myData.GoodsId == x.GoodsId) && (myData.SpecificationKey == x.SpecificationSort)) {
this.orderNum++;
if(x.nowBound<x.Number){
x.nowBound++;
this.tableData = data2;
this.scanData.unshift(myData);
scanMsg.MaterialId = myData.SuppliesId;
scanMsg.CostMoney = myData.UnitPrice;
scanMsg.OrderGoodsId = x.OrderGoodsId;
scanMsg.StockInId = myData.StockInId;
this.sureMsg.WarehouseOutGoodsDetailList.push(scanMsg);
}else{
this.Error('超过了购买数量');
}
}
})
this.getorderNum();
}else{
this.Error(res.data.data.Msg);
}
} else {
this.Error(res.data.message);
}
this.barCode = '';
},
null
);
},
getorderNum(){
if(this.orderNum==0){
this.Error('该商品未在出库列表中');
}
},
//删除扫描
delBound(row, index) {
this.scanData.splice(index, 1);
this.sureMsg.WarehouseOutGoodsDetailList.splice(index, 1);
this.tableData.forEach(x => {
if (x.GoodsId == row.GoodsId) {
x.nowBound--
}
})
},
//确认出库
sureOutband() {
var buyNum = 0;
this.tableData.forEach(x => {
buyNum += x.Number;
})
if (this.scanData.length != buyNum) {
this.Error('出库数量与列表数据不符');
return;
}
this.sureMsg.ID = this.msg.ID;
this.sureMsg.WarehouseId = this.msg.WarehouseId;
this.apiJavaPost("/api/WarehouseOut/SetStockOutInfo", this.sureMsg,
res => {
if (res.data.resultCode === 1) {
this.Success(res.data.message);
this.$router.push({
path: "/" + 'outboundApplication',
});
} else {
this.Error(res.data.message);
}
},
null
);
}
}
};
</script>
...@@ -81,7 +81,12 @@ export default { ...@@ -81,7 +81,12 @@ export default {
name: 'outboundApplication', name: 'outboundApplication',
component: resolve => require(['@/components/assetsman/outboundApplication'], resolve), component: resolve => require(['@/components/assetsman/outboundApplication'], resolve),
}, },
//出库详情
{
path: '/outboundDetail',
name: 'outboundDetail',
component: resolve => require(['@/components/assetsman/outboundDetail'], resolve),
},
// 派发&退库 // 派发&退库
{ {
path: '/PaiTui', path: '/PaiTui',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment