Commit f073c73a authored by 黄媛媛's avatar 黄媛媛

1

parent dfcd6782
......@@ -63,6 +63,22 @@
<el-input class="w100" size="small" type="number" v-model="scope.row.NewNumber" placeholder="请输入" :disabled="ERPEmpId==0 ? true: false" :min="0"></el-input>
</template>
</el-table-column>
<el-table-column prop="Number" label="出库商品" width="200px">
<template slot-scope="scope">
<div>
<span >
{{scope.row.NewGoodsName}}
</span>
<el-tooltip class="item" effect="dark" content="修改商品" placement="top" >
<img @click="editGoods(scope.row,scope.$index)"
src="../../assets/img/userman/edit.png" alt="">
</el-tooltip>
</div>
</template>
</el-table-column>
</el-table>
<el-pagination style="text-align:right" background @current-change="handleCurrentChange" :page-size="msg.pageSize" :current-page.sync="msg.pageIndex"
layout="prev, pager, next" :total="total">
......@@ -84,6 +100,80 @@
<el-button @click="chooseA" size="small" type="primary">确 定</el-button>
</span>
</el-dialog>
<!-- 商品选择 -->
<el-dialog custom-class="app-add-cat" title="出库商品选择" :visible.sync="Egoods" width="1100px">
<el-form :inline="true" label-width="80px" >
<el-form-item label="商品">
<el-select size="small" v-model="Goodsobj.NewGoodsId" @change="getSpecification" :filter-method="ChangeListName" filterable
style="display:inline-block;width:600px;"
placeholder="请选择">
<el-option v-for="item in GoodsList" :key="item.Id" :label="item.Name" :value="item.Id">
</el-option>
</el-select>
</el-form-item>
<!-- <el-form-item label="商品ID">
<el-input @keyup.enter.native="getgoodsList(1),EgoodID = goodsmsg.Id" v-model="goodsmsg.Id" placeholder="请输入商品ID" clearable></el-input>
</el-form-item> -->
</el-form>
<el-form :inline="true" label-width="80px" >
<el-form-item label="商品规格">
<el-select size="small" v-model="Goodsobj.NewSpecificationSort" @change="getSort"
style="display:inline-block;width:300px;"
placeholder="请选择">
<el-option v-for="item in SpecificationList" :key="item.SpecificationKey" :label="item.SpecificationName" :value="item.SpecificationKey">
</el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" size="small" @click="addGoods">添加</el-button>
</el-form-item>
</el-form>
<el-table :data="tableData2" v-loading="loading" border style="width: 100%">
<el-table-column prop="NewGoodsName" label="商品名称">
</el-table-column>
<el-table-column prop="Number" label="出库规格" width="250px">
<template slot-scope="scope">
<div style="color:'#409eff'">
<span class="el-tag el-tag--small el-tag--light" style="top: 5px; position: relative; margin-right: 5px;max-width:250px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; ">
{{scope.row.NewSpecification}}
</span>
</div>
</template>
</el-table-column>
<el-table-column prop="Number" label="出库数量" width="150px">
<template slot-scope="scope">
<el-input class="w100" size="small" type="number" v-model="scope.row.NewNumber" placeholder="请输入" :disabled="ERPEmpId==0 ? true: false" :min="0"></el-input>
</template>
</el-table-column>
<el-table-column prop="Number" label="操作" width="100px">
<template slot-scope="scope">
<div>
<!-- <span style="top: 5px; position: relative; margin-right: 5px;max-width:200px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; ">
{{scope.row.GoodsName}}
</span> -->
<el-tooltip class="item" effect="dark" content="删除" placement="top" >
<img @click="editGoods2(scope.row,scope.$index)"
src="../../assets/img/userman/del.png" alt="">
</el-tooltip>
</div>
</template>
</el-table-column>
</el-table>
<span slot="footer" class="dialog-footer">
<el-button size="small" @click="Egoods = false,tableData2=[]">取 消</el-button>
<el-button @click="chooseB" size="small" type="primary">确 定</el-button>
</span>
</el-dialog>
</div>
</template>
......@@ -92,7 +182,7 @@
data() {
return {
loading: false,
Egoods:false,
tableData:[],
total: 0,
outobj:{
......@@ -108,12 +198,42 @@
EndTime:'',
},
goodsmsg:{
pageIndex:1,
pageSize:5,
Name:'',
GoodsStatus:0,
IsSelectSellOut:0,
CategoryIds:'',
Id:'',
StartTime:'',
EndTime:'',
OrderBy:0,
},
ERPEmpId:0,
SpecList:[],
AtterDig:false,
outindex:{},
SupplierData: [], //供应商data
dateList: [], //日期
GoodsList:[],//商品列表
Goodsobj:{
Id:0,
OrderNo:0,
GoodsId:'',
GoodsName:'',
Number:0,
Specification:'',
SpecificationSort:'',
NewSpecification:'',
NewSpecificationSort:"",
NewNumber:1,
IScheck:false,
},
SpecificationList:[],
tableData2:[],
editGoodsindex:0,
}
},
created() {
......@@ -162,6 +282,19 @@
this.outobj.WarehouseOutGoodsList = array;
},
unique(arr) {
for (var i = 0, len = arr.length; i < len; i++) {
for (var j = i + 1, len = arr.length; j < len; j++) {
if (arr[i].NewGoodsId === arr[j].NewGoodsId) {
arr.splice(j, 1);
j--; // 每删除一个数j的值就减1
len--; // j值减小时len也要相应减1(减少循环次数,节省性能)
// console.log(j,len)
}
}
}
return arr;
},
outapplyfor(){
let that = this
if(that.ERPEmpId==0){
......@@ -177,22 +310,27 @@
this.tableData.forEach(j=>{
if(x.OrderGoodsId == j.Id){
let obj = {}
console.log(j)
obj.OrderGoodsId = j.Id;
obj.NewSpecificationSort = j.NewSpecificationSort;
obj.NewNumber = j.NewNumber;
obj.NewGoodsName = j.NewGoodsName;
obj.NewGoodsId = j.NewGoodsId;
array.push(obj)
if(j.NewNumber=='' || j.NewNumber ==0){
showtip =true
}
}
})
})
if(showtip == true){
that.Error('出库数量大于0');
return
}
array = this.unique(array)
this.outobj.WarehouseOutGoodsList = array;
console.log( this.outobj.WarehouseOutGoodsList)
that.$confirm('是否申请出库?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
......@@ -228,7 +366,7 @@
}
},
costBtn(obj,index){
console.log(index)
this.outindex = index
if(this.ERPEmpId==0){
this.Error('您还未授权,不能修改规格');
......@@ -252,6 +390,89 @@
})
}
},
getSpecification(val){
//给Goodsobj赋值
this.GoodsList.forEach(x=>{
if(x.Id == val){
this.Goodsobj.NewGoodsId = x.Id;
this.Goodsobj.NewGoodsName = x.Name;
}
})
//获取规则列表
this.assetsApipost("/api/WarehouseOut/GetSuppliesMaterialList", {GoodsId:val}, res => {
if (res.data.resultCode == 1) {
this.SpecificationList = res.data.data;
}else{
this.Error(res.data.message);
}
})
},
getSort(val){
this.SpecificationList.forEach(x=>{
if(x.SpecificationKey == val){
this.Goodsobj.NewSpecification = x.SpecificationName;
this.Goodsobj.NewSpecificationSort = x.SpecificationKey;
}
})
},
editGoods(obj,index){
if(this.ERPEmpId==0){
this.Error('您还未授权,不能修改商品');
}else{
this.Egoods = true;
this.editGoodsindex = index
this.Goodsobj = obj
this.Goodsobj.NewGoodsId = '',
this.Goodsobj.NewSpecificationSort = '',
console.log(obj)
// let objs={}
// objs.Id = obj.Id;
// objs.OrderNo = obj.OrderNo;
// objs.GoodsId = obj.GoodsId;
// objs.GoodsName = obj.GoodsName;
// objs.Number = obj.Number;
// objs.Specification = obj.Specification;
// objs.SpecificationSort = obj.SpecificationSort;
// objs.NewSpecification = obj.NewSpecification;
// objs.NewSpecificationSort = obj.NewSpecificationSort;
// objs.NewNumber = obj.NewNumber;
// this.tableData2.push(objs)
}
},
ChangeListName(val){
this.goodsmsg.Name = val;
// this.goodsmsg.Id = val;
this.getgoodsList(0);
},
getgoodsList(type){
if(this.goodsmsg.Id==''){
this.goodsmsg.Id=0;
}
this.apipost("/api/product/GetProductGoodsPageList", this.goodsmsg, res => {
if(res.data.resultCode==1){
let pageData=res.data.data.pageData;
this.GoodsList = pageData
if(type==1){
}
}
})
},
chooseB(){
//删除当前的对象 把tableData2数组插入当前的位置
this.tableData2.unshift(this.editGoodsindex,0)
this.tableData.splice(this.editGoodsindex,1)
Array.prototype.splice.apply(this.tableData, this.tableData2);
this.Egoods = false;
this.tableData2=[]
},
chooseAttr(index){
this.SpecList.forEach((x,i)=>{
x.IScheck=false;
......@@ -262,6 +483,26 @@
this.$forceUpdate();
},
//添加商品的时候选择商品
addGoods(){
let that= this
let obj = Object.assign({},that.Goodsobj)
if(obj.NewGoodsId==''){
this.Error('请选择商品')
return
}
if(obj.NewSpecificationSort==''){
this.Error('请选择规格')
return
}
that.tableData2.push(obj)
that.Goodsobj.NewGoodsId = '';
that.Goodsobj.NewSpecificationSort = '';
that.Goodsobj.NewNumber = 1;
},
editGoods2(row,index){
this.tableData2.splice(index,1)
},
chooseA(){
this.SpecList.forEach((x,i)=>{
if(x.IScheck == true){
......
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