|
|
@ -1,15 +1,28 @@ |
|
|
|
<template> |
|
|
|
<view class=""> |
|
|
|
<com-empty-view v-if="jobList.length==0"></com-empty-view> |
|
|
|
|
|
|
|
|
|
|
|
<job-filter ref="filter" otherTitle="ASN" |
|
|
|
:isShowProductionLineCode="true" |
|
|
|
:productionline="productionLineList" |
|
|
|
:isShowItemCode="true" |
|
|
|
:isShowQurery='true' |
|
|
|
@onQuery="getListByFilter"> |
|
|
|
<view class="uni-flex" style="flex-direction: column;;"> |
|
|
|
|
|
|
|
|
|
|
|
<job-filter ref="filter" otherTitle="ASN" :isShowProductionLineCode="false" :isShowItemCode="false" |
|
|
|
:isShowQurery='true' @onQuery="getListByFilter"> |
|
|
|
</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"> |
|
|
|
<uni-swipe-action ref="swipeAction"> |
|
|
|
<view v-for="(item, index) in jobList" :key="index"> |
|
|
@ -44,7 +57,7 @@ |
|
|
|
goHome, |
|
|
|
updateTitle |
|
|
|
} from '@/common/basic.js'; |
|
|
|
|
|
|
|
|
|
|
|
import { |
|
|
|
planRefreshTime, |
|
|
|
productionReceiptJobFilter |
|
|
@ -94,17 +107,22 @@ |
|
|
|
scanMessage: "", |
|
|
|
productionLineList: [], |
|
|
|
productionLine: "", |
|
|
|
filterItemCode:"", |
|
|
|
productionLineCode:"" |
|
|
|
filterItemCode: "", |
|
|
|
productionLineCode: "", |
|
|
|
}; |
|
|
|
}, |
|
|
|
onLoad(option) { |
|
|
|
this.title = option.title |
|
|
|
this.getProductionReceiptJobByProductionline() |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
onShow() { |
|
|
|
this.getList('refresh') |
|
|
|
if(this.productionLineList==0){ |
|
|
|
this.getProductionReceiptJobByProductionline() |
|
|
|
}else { |
|
|
|
this.getList('refresh') |
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
onReady() { |
|
|
@ -145,27 +163,36 @@ |
|
|
|
|
|
|
|
methods: { |
|
|
|
getProductionReceiptJobByProductionline() { |
|
|
|
uni.showLoading({ |
|
|
|
title: "获取生产线", |
|
|
|
mask: true |
|
|
|
}) |
|
|
|
getProductionReceiptJobByProductionline().then(res => { |
|
|
|
if (res.code == 0) { |
|
|
|
this.productionLineList = res.data.map(item => ({ |
|
|
|
value: item.value, |
|
|
|
text: item.name |
|
|
|
})) |
|
|
|
this.productionLineList.unshift({ |
|
|
|
value: "", |
|
|
|
text: "全部" |
|
|
|
uni.hideLoading() |
|
|
|
if (res.data && res.data.length > 0) { |
|
|
|
this.productionLineList = res.data; |
|
|
|
res.data.forEach(item => { |
|
|
|
item.value = item.value, |
|
|
|
item.text = item.value+"("+item.name+")" |
|
|
|
}) |
|
|
|
this.productionLineList = res.data |
|
|
|
this.productionLineCode = this.productionLineList[0].value |
|
|
|
} else { |
|
|
|
this.productionLineList = [] |
|
|
|
} |
|
|
|
this.getList('refresh') |
|
|
|
}).catch(error => { |
|
|
|
uni.hideLoading() |
|
|
|
this.showMessage(error) |
|
|
|
this.getList('refresh') |
|
|
|
}) |
|
|
|
}, |
|
|
|
setQueryParam(){ |
|
|
|
setQueryParam() { |
|
|
|
var filterParams = [] |
|
|
|
var queryParams=uni.getStorageSync(productionReceiptJobFilter) |
|
|
|
|
|
|
|
var queryParams = uni.getStorageSync(productionReceiptJobFilter) |
|
|
|
|
|
|
|
//只看当天 |
|
|
|
if (queryParams.creationTime ) { |
|
|
|
if (queryParams.creationTime) { |
|
|
|
filterParams.push({ |
|
|
|
column: "create_time", |
|
|
|
action: "betweeen", |
|
|
@ -179,14 +206,14 @@ |
|
|
|
action: "in", |
|
|
|
value: queryParams.status |
|
|
|
}) |
|
|
|
}else { |
|
|
|
} else { |
|
|
|
filterParams.push({ |
|
|
|
column: "status", |
|
|
|
action: "in", |
|
|
|
value: "1,2" |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//生产线 |
|
|
|
if (queryParams.productionLineCode) { |
|
|
|
filterParams.push({ |
|
|
@ -194,6 +221,17 @@ |
|
|
|
action: "==", |
|
|
|
value: queryParams.productionLineCode |
|
|
|
}) |
|
|
|
this.productionLineCode=queryParams.productionLineCode |
|
|
|
}else{ |
|
|
|
if(this.productionLineCode){ |
|
|
|
filterParams.push({ |
|
|
|
column: "productionLineCode", |
|
|
|
action: "==", |
|
|
|
value: this.productionLineCode |
|
|
|
}) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
//物料代码 |
|
|
|
if (queryParams.itemCode) { |
|
|
@ -202,10 +240,20 @@ |
|
|
|
action: "like", |
|
|
|
value: queryParams.itemCode |
|
|
|
}) |
|
|
|
this.filterItemCode = queryParams.itemCode |
|
|
|
}else { |
|
|
|
if(this.filterItemCode){ |
|
|
|
filterParams.push({ |
|
|
|
column: "itemCode", |
|
|
|
action: "like", |
|
|
|
value: this.filterItemCode |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
return filterParams; |
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
|
getList(type) { |
|
|
|
let that = this; |
|
|
@ -219,12 +267,14 @@ |
|
|
|
this.pageNo = 1; |
|
|
|
this.jobList = []; |
|
|
|
} |
|
|
|
var queryFiltersParams =this.setQueryParam() |
|
|
|
var queryFiltersParams = this.setQueryParam() |
|
|
|
var params = { |
|
|
|
filters: queryFiltersParams, |
|
|
|
pageNo: this.pageNo, |
|
|
|
pageSize: this.pageSize, |
|
|
|
} |
|
|
|
|
|
|
|
console.log("查询条件",JSON.stringify(params)) |
|
|
|
|
|
|
|
getProductionReceiptJobList(params).then(res => { |
|
|
|
uni.hideLoading(); |
|
|
@ -243,7 +293,6 @@ |
|
|
|
this.jobList = type === "refresh" ? list : this.jobList.concat(list); |
|
|
|
this.pageNo++; |
|
|
|
|
|
|
|
|
|
|
|
}).catch(error => { |
|
|
|
if (type === "refresh") { |
|
|
|
uni.stopPullDownRefresh(); |
|
|
@ -304,12 +353,12 @@ |
|
|
|
}, |
|
|
|
|
|
|
|
showMessage(message) { |
|
|
|
if(this.$refs.scanPopup){ |
|
|
|
if (this.$refs.scanPopup) { |
|
|
|
this.$refs.scanPopup.packLoseFocus() |
|
|
|
} |
|
|
|
this.$refs.comMessage.showErrorMessage(message, res => { |
|
|
|
if (res) { |
|
|
|
if(this.$refs.scanPopup){ |
|
|
|
if (this.$refs.scanPopup) { |
|
|
|
this.$refs.scanPopup.packGetFocus() |
|
|
|
} |
|
|
|
} |
|
|
@ -350,9 +399,9 @@ |
|
|
|
action: "==", |
|
|
|
value: this.$store.state.user.id |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
] |
|
|
|
|
|
|
|
|
|
|
|
if(this.productionLineCode){ |
|
|
|
filters.push({ |
|
|
|
column: "productionLineCode", |
|
|
@ -394,12 +443,40 @@ |
|
|
|
this.showMessage(e.message) |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
getListByFilter(params) { |
|
|
|
this.productionLineCode =params.productionLineCode |
|
|
|
uni.setStorageSync(productionReceiptJobFilter,params) |
|
|
|
params.productionLineCode=this.productionLineCode |
|
|
|
params.itemCode=this.filterItemCode |
|
|
|
uni.setStorageSync(productionReceiptJobFilter, params) |
|
|
|
var test =uni.getStorageSync(productionReceiptJobFilter) |
|
|
|
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> |
|
|
|