|
@ -1,15 +1,28 @@ |
|
|
<template> |
|
|
<template> |
|
|
<view class=""> |
|
|
<view class="uni-flex" style="flex-direction: column;;"> |
|
|
<com-empty-view v-if="jobList.length==0"></com-empty-view> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<job-filter ref="filter" otherTitle="ASN" |
|
|
<job-filter ref="filter" otherTitle="ASN" :isShowProductionLineCode="false" :isShowItemCode="false" |
|
|
:isShowProductionLineCode="true" |
|
|
:isShowQurery='true' @onQuery="getListByFilter"> |
|
|
:productionline="productionLineList" |
|
|
|
|
|
:isShowItemCode="true" |
|
|
|
|
|
:isShowQurery='true' |
|
|
|
|
|
@onQuery="getListByFilter"> |
|
|
|
|
|
</job-filter> |
|
|
</job-filter> |
|
|
|
|
|
<view style="background-color: #fff; padding-left: 20rpx;"> |
|
|
|
|
|
<view class="uni-flex space-between u-col-center" style="width: 100%;padding-top: 20rpx;"> |
|
|
|
|
|
<view class="" style="font-size: 32rpx; font-weight: bold;"> |
|
|
|
|
|
生产线 : |
|
|
|
|
|
</view> |
|
|
|
|
|
<uni-data-select class="uni-data-select" style="margin-left: 10rpx;" placeholder="请输入生产线" |
|
|
|
|
|
v-model="productionLineCode" :clear="false" :localdata="productionLineList" |
|
|
|
|
|
@change="productionLineCodeConfirm"></uni-data-select> |
|
|
|
|
|
</view> |
|
|
|
|
|
<view class="uni-flex space-between u-col-center" style="width: 100%;margin-top: 30rpx;"> |
|
|
|
|
|
<view class="" style="font-size: 32rpx;font-weight: bold;"> |
|
|
|
|
|
物料代码 : |
|
|
|
|
|
</view> |
|
|
|
|
|
<u-input style="margin-left: 20rpx;" confirmType="search" v-model="filterItemCode" :border="true" |
|
|
|
|
|
placeholder="请输入物料代码" @confirm="itemCodeConfirm" /> |
|
|
|
|
|
</view> |
|
|
|
|
|
</view> |
|
|
|
|
|
<com-empty-view v-if="jobList.length==0"></com-empty-view> |
|
|
<view v-if="jobList.length>0"> |
|
|
<view v-if="jobList.length>0"> |
|
|
<uni-swipe-action ref="swipeAction"> |
|
|
<uni-swipe-action ref="swipeAction"> |
|
|
<view v-for="(item, index) in jobList" :key="index"> |
|
|
<view v-for="(item, index) in jobList" :key="index"> |
|
@ -95,16 +108,21 @@ |
|
|
productionLineList: [], |
|
|
productionLineList: [], |
|
|
productionLine: "", |
|
|
productionLine: "", |
|
|
filterItemCode: "", |
|
|
filterItemCode: "", |
|
|
productionLineCode:"" |
|
|
productionLineCode: "", |
|
|
}; |
|
|
}; |
|
|
}, |
|
|
}, |
|
|
onLoad(option) { |
|
|
onLoad(option) { |
|
|
this.title = option.title |
|
|
this.title = option.title |
|
|
this.getProductionReceiptJobByProductionline() |
|
|
|
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
onShow() { |
|
|
onShow() { |
|
|
|
|
|
if(this.productionLineList==0){ |
|
|
|
|
|
this.getProductionReceiptJobByProductionline() |
|
|
|
|
|
}else { |
|
|
this.getList('refresh') |
|
|
this.getList('refresh') |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
onReady() { |
|
|
onReady() { |
|
@ -145,19 +163,28 @@ |
|
|
|
|
|
|
|
|
methods: { |
|
|
methods: { |
|
|
getProductionReceiptJobByProductionline() { |
|
|
getProductionReceiptJobByProductionline() { |
|
|
|
|
|
uni.showLoading({ |
|
|
|
|
|
title: "获取生产线", |
|
|
|
|
|
mask: true |
|
|
|
|
|
}) |
|
|
getProductionReceiptJobByProductionline().then(res => { |
|
|
getProductionReceiptJobByProductionline().then(res => { |
|
|
if (res.code == 0) { |
|
|
uni.hideLoading() |
|
|
this.productionLineList = res.data.map(item => ({ |
|
|
if (res.data && res.data.length > 0) { |
|
|
value: item.value, |
|
|
this.productionLineList = res.data; |
|
|
text: item.name |
|
|
res.data.forEach(item => { |
|
|
})) |
|
|
item.value = item.value, |
|
|
this.productionLineList.unshift({ |
|
|
item.text = item.value+"("+item.name+")" |
|
|
value: "", |
|
|
|
|
|
text: "全部" |
|
|
|
|
|
}) |
|
|
}) |
|
|
|
|
|
this.productionLineList = res.data |
|
|
|
|
|
this.productionLineCode = this.productionLineList[0].value |
|
|
} else { |
|
|
} else { |
|
|
this.productionLineList = [] |
|
|
this.productionLineList = [] |
|
|
} |
|
|
} |
|
|
|
|
|
this.getList('refresh') |
|
|
|
|
|
}).catch(error => { |
|
|
|
|
|
uni.hideLoading() |
|
|
|
|
|
this.showMessage(error) |
|
|
|
|
|
this.getList('refresh') |
|
|
}) |
|
|
}) |
|
|
}, |
|
|
}, |
|
|
setQueryParam() { |
|
|
setQueryParam() { |
|
@ -194,6 +221,17 @@ |
|
|
action: "==", |
|
|
action: "==", |
|
|
value: queryParams.productionLineCode |
|
|
value: queryParams.productionLineCode |
|
|
}) |
|
|
}) |
|
|
|
|
|
this.productionLineCode=queryParams.productionLineCode |
|
|
|
|
|
}else{ |
|
|
|
|
|
if(this.productionLineCode){ |
|
|
|
|
|
filterParams.push({ |
|
|
|
|
|
column: "productionLineCode", |
|
|
|
|
|
action: "==", |
|
|
|
|
|
value: this.productionLineCode |
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
//物料代码 |
|
|
//物料代码 |
|
|
if (queryParams.itemCode) { |
|
|
if (queryParams.itemCode) { |
|
@ -202,6 +240,16 @@ |
|
|
action: "like", |
|
|
action: "like", |
|
|
value: queryParams.itemCode |
|
|
value: queryParams.itemCode |
|
|
}) |
|
|
}) |
|
|
|
|
|
this.filterItemCode = queryParams.itemCode |
|
|
|
|
|
}else { |
|
|
|
|
|
if(this.filterItemCode){ |
|
|
|
|
|
filterParams.push({ |
|
|
|
|
|
column: "itemCode", |
|
|
|
|
|
action: "like", |
|
|
|
|
|
value: this.filterItemCode |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
return filterParams; |
|
|
return filterParams; |
|
@ -226,6 +274,8 @@ |
|
|
pageSize: this.pageSize, |
|
|
pageSize: this.pageSize, |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
console.log("查询条件",JSON.stringify(params)) |
|
|
|
|
|
|
|
|
getProductionReceiptJobList(params).then(res => { |
|
|
getProductionReceiptJobList(params).then(res => { |
|
|
uni.hideLoading(); |
|
|
uni.hideLoading(); |
|
|
if (type === "refresh") { |
|
|
if (type === "refresh") { |
|
@ -243,7 +293,6 @@ |
|
|
this.jobList = type === "refresh" ? list : this.jobList.concat(list); |
|
|
this.jobList = type === "refresh" ? list : this.jobList.concat(list); |
|
|
this.pageNo++; |
|
|
this.pageNo++; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}).catch(error => { |
|
|
}).catch(error => { |
|
|
if (type === "refresh") { |
|
|
if (type === "refresh") { |
|
|
uni.stopPullDownRefresh(); |
|
|
uni.stopPullDownRefresh(); |
|
@ -396,10 +445,38 @@ |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
getListByFilter(params) { |
|
|
getListByFilter(params) { |
|
|
this.productionLineCode =params.productionLineCode |
|
|
params.productionLineCode=this.productionLineCode |
|
|
|
|
|
params.itemCode=this.filterItemCode |
|
|
uni.setStorageSync(productionReceiptJobFilter, params) |
|
|
uni.setStorageSync(productionReceiptJobFilter, params) |
|
|
|
|
|
var test =uni.getStorageSync(productionReceiptJobFilter) |
|
|
this.getList('refresh') |
|
|
this.getList('refresh') |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
productionLineCodeConfirm(e) { |
|
|
|
|
|
var params = uni.getStorageSync(productionReceiptJobFilter) |
|
|
|
|
|
this.productionLineCode = e; |
|
|
|
|
|
//第一次没有值,需要赋值 |
|
|
|
|
|
if(!params){ |
|
|
|
|
|
params={ |
|
|
|
|
|
productionLineCode:"", |
|
|
|
|
|
itemCode:"" |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
this.getListByFilter(params) |
|
|
|
|
|
}, |
|
|
|
|
|
itemCodeConfirm(itemCode) { |
|
|
|
|
|
var params = uni.getStorageSync(productionReceiptJobFilter) |
|
|
|
|
|
this.filterItemCode = itemCode; |
|
|
|
|
|
//第一次没有值,需要赋值 |
|
|
|
|
|
if(!params){ |
|
|
|
|
|
params = { |
|
|
|
|
|
productionLineCode:"", |
|
|
|
|
|
itemCode:"" |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
this.getListByFilter(params) |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
</script> |
|
|
</script> |
|
|