Browse Source

发料接收修改筛选

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

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

@ -1,15 +1,28 @@
<template>
<view class="">
<com-empty-view v-if="jobList.length==0"></com-empty-view>
<view class="uni-flex" style="flex-direction: column;;">
<job-filter ref="filter" otherTitle="ASN"
:isShowProductionLineCode="true"
:productionline="productionLineList"
:isShowItemCode="true"
:isShowQurery='true'
@onQuery="getListByFilter">
<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">
@ -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,7 +206,7 @@
action: "in",
value: queryParams.status
})
}else {
} else {
filterParams.push({
column: "status",
action: "in",
@ -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,6 +240,16 @@
action: "like",
value: queryParams.itemCode
})
this.filterItemCode = queryParams.itemCode
}else {
if(this.filterItemCode){
filterParams.push({
column: "itemCode",
action: "like",
value: this.filterItemCode
})
}
}
return filterParams;
@ -219,13 +267,15 @@
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();
if (type === "refresh") {
@ -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()
}
}
@ -396,10 +445,38 @@
},
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>

Loading…
Cancel
Save