Commit 47bb4d31 authored by 黄媛媛's avatar 黄媛媛

parent e3be132d
......@@ -6,6 +6,31 @@
</el-button>
</div>
<div class="content">
<div style="margin-bottom:20px">
<span>供应商</span>
<el-select style="margin:0 10px" class="w200" @change="msg.pageIndex=1,getList()" v-model="msg.SupplierId" size="small"
placeholder="请选择">
<el-option label="不限" :value="0"></el-option>
<el-option v-for="item in SupplierData" :key="item.Id" :label="item.Name" :value="item.ID">
</el-option>
</el-select>
<span>订单号</span>
<div class="searchInput" style="width:250px">
<el-input @keyup.enter.native="msg.pageIndex=1,getList()" style="display:inline-block;width:225px;height:30px"
placeholder="请输入订单号搜索"
v-model="msg.OrderNo"
@clear="msg.pageIndex=1,getList()"
size="small"
clearable>
</el-input>
<span @click="msg.pageIndex=1,getList()" class="el-icon-search" style="color:#979dad;font-size:14px;position:relative;top:1px"></span>
</div>
<span>下单时间</span>
<el-date-picker v-model="dateList" @change="msg.pageIndex=1,getList()" size="small" type="datetimerange" range-separator="至"
value-format="yyyy-MM-dd HH:mm:ss" start-placeholder="开始日期" end-placeholder="结束日期">
</el-date-picker>
</div>
<el-table :data="tableData" v-loading="loading" border style="width: 100%"
@selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" style="text-align:center;">
......@@ -18,12 +43,47 @@
</el-table-column>
<el-table-column prop="Number" label="购买数量" width="150px">
</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>
<el-tooltip class="item" effect="dark" content="修改规格" placement="top" >
<img @click="costBtn(scope.row,scope.$index)"
src="../../assets/img/userman/edit1.png" alt="">
</el-tooltip>
</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>
<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">
</el-pagination>
</div>
<!-- 规格选择 -->
<el-dialog custom-class="app-add-cat" title="出库规格选择" :visible.sync="AtterDig" width="1100px">
<div class="temp_content" v-if="SpecList.length>0">
<span class="el-tag el-tag--small el-tag--light AttrList" :style="{color: item.IScheck == true?'#409eff':'#000'}"
v-for="(item,index) in SpecList" :key="index"
@click="chooseAttr(index)"
>
<span >{{item.SpecificationName}}</span>
</span>
</div>
<span slot="footer" class="dialog-footer">
<el-button size="small" @click="AtterDig = false">取 消</el-button>
<el-button @click="chooseA" size="small" type="primary">确 定</el-button>
</span>
</el-dialog>
</div>
</template>
......@@ -42,10 +102,18 @@
msg:{
pageIndex: 1,
pageSize: 15,
SupplierId:0
SupplierId:0,
OrderNo:'',
StartTime:'',
EndTime:'',
},
ERPEmpId:0
ERPEmpId:0,
SpecList:[],
AtterDig:false,
outindex:{},
SupplierData: [], //供应商data
dateList: [], //日期
}
},
created() {
......@@ -54,11 +122,18 @@
},
mounted() {
this.getList();
this.getAllSupplier()
},
methods: {
getList() {
if (this.dateList && this.dateList.length > 0) {
this.msg.StartTime = this.dateList[0];
this.msg.EndTime = this.dateList[1];
} else {
this.msg.StartTime = '';
this.msg.EndTime = '';
}
this.loading = true;
this.assetsApipost("/api/WarehouseOut/GetNoOutOrderGoodsList", this.msg, res => {
this.loading = false;
......@@ -92,37 +167,118 @@
if(that.ERPEmpId==0){
that.Error('您还未授权,暂不能出库');
}else{
if (that.outobj.WarehouseOutGoodsList.length == 0) {
that.Info('请选择商品');
return
}
that.$confirm('是否申请出库?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
that.loading = true;
that.assetsApipost("/api/WarehouseOut/SetWarehouseOutApply", that.outobj, res => {
that.loading = false;
if (res.data.resultCode == 1) {
that.Success(res.data.message);
that.outobj.WarehouseOutGoodsList = []
that.getList();
}else{
that.Error(res.data.message);
}
}
let array=[]
let showtip = false
this.outobj.WarehouseOutGoodsList.forEach(x=>{
this.tableData.forEach(j=>{
if(x.OrderGoodsId == j.Id){
let obj = {}
obj.OrderGoodsId = j.Id;
obj.NewSpecificationSort = j.NewSpecificationSort;
obj.NewNumber = j.NewNumber;
array.push(obj)
if(j.NewNumber=='' || j.NewNumber ==0){
showtip =true
}
}
})
})
}).catch(() => {
if(showtip == true){
that.Error('出库数量大于0');
return
}
this.outobj.WarehouseOutGoodsList = array;
console.log( this.outobj.WarehouseOutGoodsList)
that.$confirm('是否申请出库?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
that.loading = true;
that.assetsApipost("/api/WarehouseOut/SetWarehouseOutApply", that.outobj, res => {
that.loading = false;
if (res.data.resultCode == 1) {
that.Success(res.data.message);
that.outobj.WarehouseOutGoodsList = []
that.getList();
}else{
that.Error(res.data.message);
}
})
}).catch(() => {
});
});
}
}
},
changeNum(row,val){
if(val=='' || val == 0 ){//当输入 空和0 的时候做的处理
this.tableData.forEach(x => {
if(x.Id==row.Id){
x.NewNumber=0
}
});
}
},
costBtn(obj,index){
console.log(index)
this.outindex = index
if(this.ERPEmpId==0){
this.Error('您还未授权,修改规格');
}else{
this.assetsApipost("/api/WarehouseOut/GetSuppliesMaterialList", {GoodsId:obj.GoodsId}, res => {
if (res.data.resultCode == 1) {
this.SpecList = res.data.data;
this.SpecList.forEach(x=>{
x.IScheck=false;
if(x.SpecificationKey == obj.NewSpecificationSort){
x.IScheck=true;
}
})
this.AtterDig = true
}else{
this.Error(res.data.message);
}
})
}
},
chooseAttr(index){
this.SpecList.forEach((x,i)=>{
x.IScheck=false;
if(index == i){
x.IScheck=true;
}
})
this.$forceUpdate();
},
chooseA(){
this.SpecList.forEach((x,i)=>{
if(x.IScheck == true){
this.tableData[this.outindex].NewSpecification = x.SpecificationName
this.tableData[this.outindex].NewSpecificationSort = x.SpecificationKey
}
})
this.AtterDig = false
},
//获取供应商
getAllSupplier() {
this.apipost("/api/Supplier/GetSupplierAllList", {}, res => {
if (res.data.resultCode == 1) {
this.SupplierData = res.data.data;
}
})
},
}
......@@ -137,5 +293,8 @@
-webkit-box-sizing: border-box;
box-sizing: border-box;
}
.outboundManage .AttrList{
margin-top: 10px; position: relative; margin-right: 15px;
overflow: hidden; white-space: nowrap; text-overflow: ellipsis; cursor: pointer;
}
</style>
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