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

打印修改

parent a5dae6eb
......@@ -69,10 +69,17 @@
<div>
<el-checkbox v-model="allchecked" @change="allcheckbtn">全选</el-checkbox>
<span style='margin-left:10px'>入库批次</span>
<el-select v-model="msg.StockInId" placeholder="请选择" size="small" clearable @change="allchecked = false,getList()">
<el-select v-model="msg.StockInId" placeholder="请选择" size="small" clearable @change="allchecked = false,checkList=[],xzCreateDate='',GoodsNames='',getList()">
<el-option label="不限" :value="0" ></el-option>
<el-option :label="item.StockInNum" :value="item.StockInId" v-for="(item,index2) in options" :key="index2"></el-option>
</el-select>
<span style='margin-left:10px'>入库时间</span>
<el-select v-model="xzCreateDate" placeholder="请选择" size="small" clearable @change="allchecked = false,GoodsNames='',checkList=[],getxzdate()">
<el-option :label="item.CreateDate" :value="item.CreateDate" v-for="(item,index2) in CreateDatelist" :key="index2"></el-option>
</el-select>
<el-input @keyup.enter.native="allchecked = false,checkList=[],xzCreateDate='',getGoodsName()" style="display:inline-block;width:225px;height:30px"
placeholder="请输入商品名称" v-model="GoodsNames" @clear="allchecked = false,checkList=[],xzCreateDate='',getList()" size="small" clearable>
</el-input>
</div>
<div style="margin-top:30px">
<el-row :gutter="30">
......@@ -185,10 +192,38 @@ export default {
dataList:[],
checkList:[],
allchecked:false,
CreateDatelist:[],
stagingData:[],//商品名字搜索使用
xzCreateDate:'',
GoodsNames:'',
};
},
created() {},
created() {
},
methods: {
groupArr(list,field){
var fieldList = [],att=[];
list.map((e)=>{
fieldList.push(e[field])
})
//数组去重
fieldList = fieldList.filter((e,i,self)=>{
return self.indexOf(e)==i
})
for(var j=0;j<fieldList.length;j++){
//过滤出匹配到的数据
var arr = list.filter((e)=>{
return e.CreateDate==fieldList[j];
})
att.push({
CreateDate:arr[0].CreateDate,
list:arr
})
}
return att;
},
getProcurementInfo(data) {//获取采购单 入库批次
this.assetsApipost("/api/property/GetProcurementSotckInBatchList", {ProcurementId:data.ID}, res => {
if (res.data.resultCode == 1) {
......@@ -206,6 +241,8 @@ export default {
this.dataList.forEach(x=>{
x.Ischeck = false
})
this.stagingData = this.dataList
this.CreateDatelist = this.groupArr(this.dataList,'CreateDate')
} else {
this.Error(res.data.message);
}
......@@ -249,6 +286,33 @@ export default {
}
this.$forceUpdate()
},
getxzdate(){
this.dataList.forEach(x=>{
x.Ischeck = false
})
if(this.xzCreateDate==''){
this.getList()
}else{
this.CreateDatelist.forEach(x=>{
if(x.CreateDate == this.xzCreateDate ){
this.dataList=x.list
}
})
}
},
getGoodsName(){
let data = [];
this.stagingData.forEach(x=>{
x.Ischeck = false
if(x.GoodsName.indexOf(this.GoodsNames)!=-1){
data.push(x)
}
})
this.dataList =data;
console.log(this.dataList)
},
batchprint(n){//批量打印
// debugger;
......@@ -283,7 +347,12 @@ export default {
that.batchprint(num)
},200)
if(conunt == num){
that.loading = false
that.loading = false;
that.checkList=[];
that.dataList.forEach((x,i)=>{
x.Ischeck = false;
})
}
}else{
......
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