Browse Source

发料接收修改筛选

hella_online_20240803
lijuncheng 4 weeks ago
parent
commit
cab30f1242
  1. 135
      src/pages/productionReceipt/job/productionReceiptJob.vue

135
src/pages/productionReceipt/job/productionReceiptJob.vue

@ -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">
@ -94,17 +107,22 @@
scanMessage: "", scanMessage: "",
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,27 +163,36 @@
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() {
var filterParams = [] var filterParams = []
var queryParams=uni.getStorageSync(productionReceiptJobFilter) var queryParams = uni.getStorageSync(productionReceiptJobFilter)
// //
if (queryParams.creationTime ) { if (queryParams.creationTime) {
filterParams.push({ filterParams.push({
column: "create_time", column: "create_time",
action: "betweeen", action: "betweeen",
@ -179,7 +206,7 @@
action: "in", action: "in",
value: queryParams.status value: queryParams.status
}) })
}else { } else {
filterParams.push({ filterParams.push({
column: "status", column: "status",
action: "in", action: "in",
@ -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;
@ -219,13 +267,15 @@
this.pageNo = 1; this.pageNo = 1;
this.jobList = []; this.jobList = [];
} }
var queryFiltersParams =this.setQueryParam() var queryFiltersParams = this.setQueryParam()
var params = { var params = {
filters: queryFiltersParams, filters: queryFiltersParams,
pageNo: this.pageNo, pageNo: this.pageNo,
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();
@ -304,12 +353,12 @@
}, },
showMessage(message) { showMessage(message) {
if(this.$refs.scanPopup){ if (this.$refs.scanPopup) {
this.$refs.scanPopup.packLoseFocus() this.$refs.scanPopup.packLoseFocus()
} }
this.$refs.comMessage.showErrorMessage(message, res => { this.$refs.comMessage.showErrorMessage(message, res => {
if (res) { if (res) {
if(this.$refs.scanPopup){ if (this.$refs.scanPopup) {
this.$refs.scanPopup.packGetFocus() this.$refs.scanPopup.packGetFocus()
} }
} }
@ -396,10 +445,38 @@
}, },
getListByFilter(params) { getListByFilter(params) {
this.productionLineCode =params.productionLineCode params.productionLineCode=this.productionLineCode
uni.setStorageSync(productionReceiptJobFilter,params) params.itemCode=this.filterItemCode
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>

Loading…
Cancel
Save