Browse Source

修改任务筛选缓存

hella_online_20240821
lijuncheng 1 month ago
parent
commit
422b94e9b0
  1. 8
      src/common/config.js
  2. 35
      src/mycomponents/job/jobFilter.vue
  3. 435
      src/pages/issue/job/issueJob.vue
  4. 146
      src/pages/package/job/overPackageJob.vue
  5. 228
      src/pages/productionReceipt/job/productionReceiptJob.vue
  6. 5
      src/pages/purchaseReceipt/job/receiptJob.vue
  7. 256
      src/pages/repleinsh/job/repleinshJob.vue

8
src/common/config.js

@ -1,4 +1,10 @@
export const overPagePrint="overPage_print"
export const overPageTemplate="overPage_Template"
//3分钟刷新
export const planRefreshTime=3*60*1000
export const planRefreshTime=3*60*1000
export const issueJobFilter="issue_job_filter"
export const repleinshJobFilter="repleinsh_job_filter"
export const overPackageJobFilter="over_package_job_filter"
export const productionReceiptJobFilter="production_receipt_job_filter"

35
src/mycomponents/job/jobFilter.vue

@ -52,7 +52,7 @@
来源库区
</view>
<u-input style="margin-left: 20rpx;" confirmType="search" v-model="fromAreaCode" :border="true"
placeholder="请输入来源库区" />
placeholder="请输入来源库区" />
</view>
<view v-if="isShowToAreaCode" class="uni-flex space-between u-col-center"
style="width: 100%;margin-top: 30rpx;">
@ -60,7 +60,7 @@
到库区
</view>
<u-input style="margin-left: 50rpx;" confirmType="search" v-model="toAreaCode" :border="true"
placeholder="请输入到库区" />
placeholder="请输入到库区" />
</view>
<!-- <view class="">
@ -75,7 +75,8 @@
</view> -->
<view class=" uni-flex uni-row" style="margin-top: 5px;" v-if="isShowQurery">
<button class="btn_single_clear" hover-class="btn_commit_after" @click="reset()">重置</button>
<button class="btn_single_commit" hover-class="btn_commit_after" style="margin-left: 20rpx;" @click="query()">查询</button>
<button class="btn_single_commit" hover-class="btn_commit_after" style="margin-left: 20rpx;"
@click="query()">查询</button>
</view>
</view>
@ -164,7 +165,10 @@
toAreaCode: '', //
itemCode: '', //
creationTime: '',
status: ''
status: '1,2',
isOnToday: false,
isOnWait: false,
params: {}
}
},
watch: {
@ -197,16 +201,16 @@
}
return params;
},
reset(){
reset() {
this.checkedTodayModel = false
this.checkedWaitModel = false
this.productionLineCode = ''
this.fromLocationCode = ''
this.fromAreaCode = ''//
this.toAreaCode = ''//
this.fromAreaCode = '' //
this.toAreaCode = '' //
this.itemCode = ''
this.creationTime = ''
this.status = ''
this.status = '1,2'
this.query()
},
@ -239,6 +243,21 @@
openFilter() {
this.$refs['popup'].open("top");
},
openFilterParams(params) {
this.$refs['popup'].open("top");
if(params){
this.productionLineCode = params.productionLineCode
this.fromLocationCode = params.fromLocationCode
this.fromAreaCode = params.fromAreaCode
this.toAreaCode = params.toAreaCode
this.itemCode = params.itemCode
this.creationTime = params.creationTime
this.status = params.status
this.checkedTodayModel=this.creationTime?true:false
this.checkedWaitModel=this.status=="1"?true:false
}
},
closeScanPopup() {
this.$refs.popup.close()
},

435
src/pages/issue/job/issueJob.vue

@ -1,18 +1,11 @@
<template>
<view class="">
<com-empty-view v-if="jobList.length==0"></com-empty-view>
<job-filter :isShowFromLocationCode="true" :isShowFromAreaCode="true" :isShowToAreaCode="true" :isShowProductionLineCode="true" :productionline="productionlineList"
ref="filter" otherTitle=""
:checkedToday="checkedToday"
:checkedWaitTask="checkedWaitTask"
@switchChangeWait="switchChangeWait"
@switchChangeToday="switchChangeToday"
:isShowItemCode="true" @onQuery="getListByFilter" :isShowQurery='true'>
<!-- <job-filter :isShowFromLocationCode="true" :isShowProductionLineCode="true"
:productionline="productionlineList" ref="filter" otherTitle="" @switchChangeToday="switchChangeToday"
@switchChangeWait="switchChangeWait" @onScanNumber="getScanNumber" :checkedToday="checkedToday"
:checkedWaitTask="checkedWaitTask" @productionLineCode="productionLineCode"
@fromLocationCode="fromLocationCode"> -->
<job-filter :isShowFromLocationCode="true" :isShowFromAreaCode="true" :isShowToAreaCode="true"
:isShowProductionLineCode="true"
:productionline="productionlineList"
ref="filter" otherTitle="" :isShowItemCode="true"
@onQuery="getListByFilter" :isShowQurery='true'>
</job-filter>
<view v-if="jobList.length>0">
<uni-swipe-action ref="swipeAction">
@ -56,11 +49,12 @@
import {
getBusinessType
} from '@/common/record.js';
import {
planRefreshTime
planRefreshTime,
issueJobFilter
} from '@/common/config.js';
import {
getDetailOption,
@ -108,13 +102,14 @@
detailCloseOptions: [],
title: '',
productionLine: "",
fromLocation: "",
fromAreaCode: '', //
toAreaCode: '', //
fromLocation: "",
fromAreaCode: '', //
toAreaCode: '', //
filterItemCode: "",
businessTypeCode: "Issue",
businessType: null,
timer:null
timer: null,
productionLineCode:""
};
},
onLoad(option) {
@ -122,15 +117,15 @@
this.getIssueJobByProductionline()
},
onShow() {
this.timerRefresh();
this.getList('refresh')
},
onHide() {
this.stopRefresh();
// this.stopRefresh();
},
onUnload(){
this.stopRefresh();
onUnload() {
// this.stopRefresh();
},
onReady() {
@ -143,13 +138,15 @@
if (this.loadingType == 'loading' || this.loadingType == 'nomore') {
return;
}
this.getList('more', this.fromLocation, this.productionLine, this.filterItemCode,this.fromAreaCode,this.toAreaCode)
this.getList('more')
},
onPullDownRefresh() {
this.getList('refresh', this.fromLocation, this.productionLine, this.filterItemCode,this.fromAreaCode,this.toAreaCode)
this.getList('refresh')
},
//退
@ -167,17 +164,17 @@
if (e.index === 0) {
goHome();
} else if (e.index == 1) {
this.$refs.filter.openFilter();
this.$refs.filter.openFilterParams(uni.getStorageSync(issueJobFilter));
}
},
methods: {
timerRefresh() {
this.getList('refresh', this.fromLocation, this.productionLine, this.filterItemCode,this.fromAreaCode,this.toAreaCode)
this.getList('refresh')
this.stopRefresh();
var that = this;
this.timer = setInterval(function() {
that.getList('refresh', that.fromLocation, that.productionLine, that.filterItemCode,this.fromAreaCode,this.toAreaCode)
that.getList('refresh')
console.log('发料刷新');
}, planRefreshTime)
},
@ -218,7 +215,7 @@
})
},
getList(type, fromLocation = '', productionLine = '',filterItemCode='',fromAreaCode='',toAreaCode='') {
getList(type) {
let that = this;
uni.showLoading({
title: "加载中­....",
@ -230,72 +227,19 @@
this.pageNo = 1;
this.jobList = [];
}
var filters = []
if (this.checkedToday) {
filters.push({
column: "create_time",
action: "betweeen",
value: this.todayTime
})
}
filters.push({
column: "status",
action: "in",
value: this.status
})
if (fromLocation) {
//
filters.push({
column: "fromLocationCode",
action: "==",
value: fromLocation
})
}
if(fromAreaCode){
//
filters.push({
column: "fromAreaCode",
action: "==",
value: fromAreaCode
})
}
if(toAreaCode){
//
filters.push({
column: "toAreaCode",
action: "==",
value: toAreaCode
})
}
if (productionLine) {
// 线
filters.push({
column: "productionLineCode",
action: "==",
value: productionLine
})
}
if(filterItemCode){
//
filters.push({
column: "itemCode",
action: "like",
value: filterItemCode
})
}
var queryFiltersParams =this.setQueryParam()
var params = {
filters: filters,
filters: queryFiltersParams,
pageNo: this.pageNo,
pageSize: 100,
pageSize: this.pageSize,
}
console.log("查询条件",JSON.stringify(params))
getIssueJobList(params).then(res => {
uni.hideLoading();
if (type === "refresh") {
uni.stopPullDownRefresh();
this.openScanPopup()
}
var list = res.data.list;
@ -311,6 +255,9 @@
if (type === "refresh") {
uni.stopPullDownRefresh();
}
if(this.jobList.length>0){
this.openScanPopup()
}
}).catch(error => {
if (type === "refresh") {
uni.stopPullDownRefresh();
@ -322,154 +269,94 @@
})
},
getListByFilter(params) {
console.log('getListByFilter',params)
let that = this;
uni.showLoading({
title: "加载中­....",
mask: true
});
// var filters = []
// if (this.checkedToday) {
// filters.push({
// column: "create_time",
// action: "betweeen",
// value: this.todayTime
// })
setQueryParam() {
var filterParams = []
var queryParams=uni.getStorageSync(issueJobFilter)
// if(!queryParams){
// queryParams={
// }
// queryParams.status="1,2"
// }
// filters.push({
// column: "status",
// action: "in",
// value: this.status
// })
if (params.status) {
this.status = params.status
}else{
this.status = "1,2"
}
if(params.creationTime==""){
this.checkedToday = false;
//
if (queryParams.creationTime ) {
filterParams.push({
column: "create_time",
action: "betweeen",
value: queryParams.creationTime
})
}
if (params.fromLocationCode) {
//
this.fromLocation = params.fromLocationCode
// filters.push({
// column: "fromLocationCode",
// action: "==",
// value: params.fromLocationCode
// })
}else{
this.fromLocation = ''
//
if (queryParams.status) {
filterParams.push({
column: "status",
action: "in",
value: queryParams.status
})
}else {
filterParams.push({
column: "status",
action: "in",
value: "1,2"
})
}
if (params.productionLineCode) {
// 线
this.productionLine = params.productionLineCode
// filters.push({
// column: "productionLineCode",
// action: "==",
// value: params.productionLineCode
// })
}else{
this.productionLine = ''
//线
if (queryParams.productionLineCode) {
filterParams.push({
column: "productionLineCode",
action: "==",
value: queryParams.productionLineCode
})
}
if (params.itemCode) {
//
this.filterItemCode = params.itemCode
// filters.push({
// column: "itemCode",
// action: "like",
// value: params.itemCode
// })
}else{
this.filterItemCode = ''
}
if (params.fromAreaCode) {
//
this.fromAreaCode = params.fromAreaCode
// filters.push({
// column: "fromAreaCode",
// action: "==",
// value: params.fromAreaCode
// })
}else{
this.fromAreaCode = ''
}
if (params.toAreaCode) {
//
this.toAreaCode = params.toAreaCode
// filters.push({
// column: "toAreaCode",
// action: "==",
// value: params.toAreaCode
// })
}else{
this.toAreaCode = ''
//
if (queryParams.itemCode) {
filterParams.push({
column: "itemCode",
action: "like",
value: queryParams.itemCode
})
}
// var params = {
// filters: filters,
// pageNo: 1,
// pageSize: 100,
// }
this.getList('refresh', this.fromLocation, this.productionLine, this.filterItemCode,this.fromAreaCode,this.toAreaCode)
// getIssueJobList(params).then(res => {
// uni.hideLoading();
// if (res.data.total == 0) {
// that.showMessage('');
// } else if (res.data.total == 1) {
// that.openJobDetail(res.data.list[0]);
// } else {
// that.showItemList(res.data.list);
// }
// }).catch(error => {
// that.showMessage(error)
// })
},
//
if (queryParams.fromLocationCode) {
filterParams.push({
column: "fromLocationCode",
action: "==",
value: queryParams.fromLocationCode
})
}
//
if (queryParams.fromAreaCode) {
filterParams.push({
column: "fromAreaCode",
action: "==",
value: queryParams.fromAreaCode
})
}
//
if (queryParams.toAreaCode) {
filterParams.push({
column: "toAreaCode",
action: "==",
value: queryParams.toAreaCode
})
}
return filterParams;
fromLocationCode(fromLocation) {
this.fromLocation = fromLocation;
this.getList('refresh', this.fromLocation, this.productionLine, this.filterItemCode,this.fromAreaCode,this.toAreaCode)
},
productionLineCode(productionLineCode) {
this.productionLine = productionLineCode
this.getList('refresh', this.fromLocation, this.productionLine, this.filterItemCode,this.fromAreaCode,this.toAreaCode)
},
getByAsnNumber(code) {
let that = this;
uni.showLoading({
title: "加载中....",
mask: true
});
getPurchasereceiptByAsnNumber(code).then(res => {
uni.hideLoading();
if (res.data.total == 0) {
that.showMessage('未查找到' + '【' + code + '】的收货任务');
} else if (res.data.total == 1) {
this.$refs.scanAsnNumber.closeScanPopup();
that.openJobDetail(res.data.list[0]);
} else {
this.$refs.scanAsnNumber.closeScanPopup();
that.showItemList(res.data.list);
}
}).catch(error => {
uni.hideLoading();
that.showErrorMessage(error);
})
getListByFilter(params) {
this.productionLineCode =params.productionLineCode
uni.setStorageSync(issueJobFilter,params)
this.getList('refresh')
},
openJobDetail(item, scanMessage = '') {
this.getJobInfoByNumber(item.number,scanMessage)
this.getJobInfoByNumber(item.number, scanMessage)
},
showItemList(itemList) {
@ -512,8 +399,8 @@
cancleJob(id) {
cancleTakeIssueJob(id).then(res => {
if (res.data) {
this.getList('refresh', this.fromLocation, this.productionLine, this.filterItemCode,this.fromAreaCode,this.toAreaCode)
this.getList('refresh')
uni.showToast({
title: "放弃任务成功"
})
@ -533,7 +420,7 @@
closeTakeIssueJob(id).then(res => {
uni.hideLoading()
if (res.data) {
this.getList("refresh")
this.getList('refresh')
uni.showToast({
title: "关闭任务成功"
})
@ -546,19 +433,7 @@
})
},
switchChangeToday(state, creationTime) {
this.checkedToday = state;
this.todayTime = creationTime;
this.getList('refresh', this.fromLocation, this.productionLine, this.filterItemCode,this.fromAreaCode,this.toAreaCode)
},
switchChangeWait(state, jobStatus) {
this.checkedWaitTask = state;
this.status = jobStatus;
this.getList('refresh', this.fromLocation, this.productionLine, this.filterItemCode,this.fromAreaCode,this.toAreaCode)
},
getJobInfoByNumber(number,scanMessage){
getJobInfoByNumber(number, scanMessage) {
let that = this;
uni.showLoading({
title: "加载中....",
@ -575,35 +450,37 @@
action: "==",
value: number
})
var params = {
filters: filters,
pageNo: 1,
pageSize: 100,
pageSize: this.pageSize,
}
getIssueJobList(params).then(res => {
uni.hideLoading();
if (res.data.list.length == 0) {
that.showMessage('未查找到' + '【' + number + '】的发料任务');
} else {
var result =res.data.list[0];
if(result.acceptUserId&&result.acceptUserId!=this.$store.state.user.id){
this.$refs.comMessage.showErrorMessage("任务号["+result.number+"]已经被["+result.acceptUserName+"]承接,无法执行", res => {
if (res) {
if (this.$refs.scanPopup) {
this.$refs.scanPopup.getfocus()
} else {
var result = res.data.list[0];
if (result.acceptUserId && result.acceptUserId != this.$store.state.user.id) {
this.$refs.comMessage.showErrorMessage("任务号[" + result.number + "]已经被[" + result
.acceptUserName + "]承接,无法执行", res => {
if (res) {
if (this.$refs.scanPopup) {
this.$refs.scanPopup.getfocus()
}
this.getList('refresh')
}
this.getList('refresh', this.fromLocation, this.productionLine, this.filterItemCode,this.fromAreaCode,this.toAreaCode)
}
});
});
return;
}
uni.navigateTo({
url: './issueDetail?id=' + result.masterId + '&status=' + result.status + '&scanMessage=' +
url: './issueDetail?id=' + result.masterId + '&status=' + result.status +
'&scanMessage=' +
scanMessage + '&title=' + this.title
});
this.scanMessage=""
this.scanMessage = ""
}
}).catch(error => {
uni.hideLoading();
@ -611,44 +488,6 @@
})
},
getScanNumber(code) {
this.getDataListByType(code)
},
getDataListByType(code) {
let that = this;
uni.showLoading({
title: "加载中....",
mask: true
});
var filters = []
filters.push({
column: "status",
action: "in",
value: '1,2'
})
filters.push({
column: "number",
action: "==",
value: code
})
var params = {
filters: filters,
pageNo: 1,
pageSize: 100,
}
getIssueJobList(params).then(res => {
uni.hideLoading();
if (res.data.list.length == 0) {
that.showMessage('未查找到' + '【' + code + '】的发料任务');
} else if (res.data.list.length == 1) {
that.openJobDetail(res.data.list[0]);
}
}).catch(error => {
uni.hideLoading();
that.showMessage(error);
})
},
showMessage(message) {
this.$refs.comMessage.showErrorMessage(message, res => {
@ -700,6 +539,14 @@
value: balance.locationCode
}
]
if(productionLineCode){
filters.push({
column: "productionLineCode",
action: "==",
value: productionLineCode
})
}
getIssueJobList({
filters: filters,
pageNo: 1,

146
src/pages/package/job/overPackageJob.vue

@ -1,9 +1,9 @@
<template>
<view class="">
<com-empty-view v-if="jobList.length==0"></com-empty-view>
<job-filter ref="filter" otherTitle="" @switchChangeToday="switchChangeToday"
@switchChangeWait="switchChangeWait" @onScanNumber="getScanNumber" :checkedToday="checkedToday"
:checkedWaitTask="checkedWaitTask">
<job-filter ref="filter" otherTitle=""
@onQuery="getListByFilter" :isShowQurery='true'
>
</job-filter>
<view v-if="jobList.length>0">
<uni-swipe-action ref="swipeAction">
@ -45,7 +45,8 @@
getBusinessType
} from '@/common/record.js';
import {
planRefreshTime
planRefreshTime,
overPackageJobFilter
} from '@/common/config.js';
import {
@ -99,16 +100,16 @@
},
onShow() {
this.timerRefresh();
this.getList('refresh')
// this.timerRefresh();
},
onHide() {
this.stopRefresh();
// this.stopRefresh();
},
onUnload(){
this.stopRefresh();
// this.stopRefresh();
},
onReady() {
@ -150,7 +151,7 @@
if (e.index === 0) {
goHome();
} else if (e.index == 1) {
this.$refs.filter.openFilter();
this.$refs.filter.openFilterParams(uni.getStorageSync(overPackageJobFilter));
}
},
@ -180,6 +181,37 @@
this.timer = null;
}
},
setQueryParam() {
var filterParams = []
var queryParams=uni.getStorageSync(overPackageJobFilter)
//
if (queryParams.creationTime ) {
filterParams.push({
column: "create_time",
action: "betweeen",
value: queryParams.creationTime
})
}
//
if (queryParams.status) {
filterParams.push({
column: "status",
action: "in",
value: queryParams.status
})
}else {
filterParams.push({
column: "status",
action: "in",
value: "1,2"
})
}
return filterParams;
},
getList(type) {
let that = this;
uni.showLoading({
@ -192,23 +224,10 @@
this.pageNo = 1;
this.jobList = [];
}
var filters = []
if (this.checkedToday) {
filters.push({
column: "create_time",
action: "betweeen",
value: this.todayTime
})
}
filters.push({
column: "status",
action: "in",
value: this.status
})
var queryFiltersParams =this.setQueryParam()
var params = {
filters: filters,
filters: queryFiltersParams,
pageNo: this.pageNo,
pageSize: this.pageSize,
}
@ -238,30 +257,10 @@
that.showMessage(error)
})
},
getByAsnNumber(code) {
let that = this;
uni.showLoading({
title: "加载中....",
mask: true
});
getPurchasereceiptByAsnNumber(code).then(res => {
uni.hideLoading();
if (res.data.total == 0) {
that.showMessage('未查找到' + '【' + code + '】的收货任务');
} else if (res.data.total == 1) {
this.$refs.scanAsnNumber.closeScanPopup();
that.openJobDetail(res.data.list[0]);
} else {
this.$refs.scanAsnNumber.closeScanPopup();
that.showItemList(res.data.list);
}
}).catch(error => {
uni.hideLoading();
that.showErrorMessage(error);
})
getListByFilter(params) {
uni.setStorageSync(overPackageJobFilter,params)
this.getList('refresh')
},
@ -330,57 +329,6 @@
})
},
switchChangeToday(state, creationTime) {
this.checkedToday = state;
this.todayTime = creationTime;
this.getList("refresh");
},
switchChangeWait(state, jobStatus) {
this.checkedWaitTask = state;
this.status = jobStatus;
this.getList("refresh");
},
getScanNumber(code) {
this.getDataListByType(code)
},
getDataListByType(code) {
let that = this;
uni.showLoading({
title: "加载中....",
mask: true
});
var filters = []
filters.push({
column: "status",
action: "in",
value: '1,2'
})
filters.push({
column: "number",
action: "==",
value: code
})
var params = {
filters: filters,
pageNo: 1,
pageSize: 100,
}
getOverPageJobList(params).then(res => {
uni.hideLoading();
if (res.data.list.length == 0) {
that.showMessage('未查找到' + '【' + code + '】的发料任务');
} else if (res.data.list.length == 1) {
that.openJobDetail(res.data.list[0]);
}
}).catch(error => {
uni.hideLoading();
that.showMessage(error);
})
},
showMessage(message) {
this.$refs.comMessage.showErrorMessage(message, res => {
if (res) {

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

@ -1,9 +1,10 @@
<template>
<view class="">
<com-empty-view v-if="jobList.length==0"></com-empty-view>
<job-filter ref="filter" otherTitle="ASN" @switchChangeToday="switchChangeToday"
@switchChangeWait="switchChangeWait" @onScanNumber="getScanNumber" :checkedToday="checkedToday"
:checkedWaitTask="checkedWaitTask" :isShowProductionLineCode="true" @productionLineCode="productionLineCode"
<job-filter ref="filter" otherTitle="ASN"
:isShowProductionLineCode="true"
:productionline="productionLineList"
:isShowItemCode="true"
:isShowQurery='true'
@ -43,6 +44,11 @@
goHome,
updateTitle
} from '@/common/basic.js';
import {
planRefreshTime,
productionReceiptJobFilter
} from '@/common/config.js';
import {
getDetailOption,
@ -88,7 +94,8 @@
scanMessage: "",
productionLineList: [],
productionLine: "",
filterItemCode:""
filterItemCode:"",
productionLineCode:""
};
},
onLoad(option) {
@ -97,7 +104,7 @@
},
onShow() {
this.getList('refresh', this.productionLine,this.filterItemCode)
this.getList('refresh')
},
onReady() {
@ -110,11 +117,11 @@
if (this.loadingType == 'loading' || this.loadingType == 'nomore') {
return;
}
this.getList('more', this.productionLine,this.filterItemCode)
this.getList('more')
},
onPullDownRefresh() {
this.getList('refresh', this.productionLine,this.filterItemCode)
this.getList('refresh')
},
//退
@ -132,15 +139,11 @@
if (e.index === 0) {
goHome();
} else if (e.index == 1) {
this.$refs.filter.openFilter();
this.$refs.filter.openFilterParams(uni.getStorageSync(productionReceiptJobFilter));
}
},
methods: {
productionLineCode(productionLineCode) {
this.productionLine = productionLineCode
this.getList('refresh', this.productionLine,this.filterItemCode)
},
getProductionReceiptJobByProductionline() {
getProductionReceiptJobByProductionline().then(res => {
if (res.code == 0) {
@ -157,59 +160,68 @@
}
})
},
getList(type, productionLine = '',filterItemCode="") {
let that = this;
uni.showLoading({
title: "加载中­....",
mask: true
});
this.loadingType = "loading";
if (type === "refresh") {
this.pageNo = 1;
this.jobList = [];
}
var filters = []
if (this.checkedToday) {
filters.push({
setQueryParam(){
var filterParams = []
var queryParams=uni.getStorageSync(productionReceiptJobFilter)
//
if (queryParams.creationTime ) {
filterParams.push({
column: "create_time",
action: "betweeen",
value: this.todayTime
value: queryParams.creationTime
})
}
filters.push({
column: "status",
action: "in",
value: this.status
})
filters.push({
column: "accept_user_id",
action: "==",
value: this.$store.state.user.id
})
if (productionLine) {
// 线
filters.push({
//
if (queryParams.status) {
filterParams.push({
column: "status",
action: "in",
value: queryParams.status
})
}else {
filterParams.push({
column: "status",
action: "in",
value: "1,2"
})
}
//线
if (queryParams.productionLineCode) {
filterParams.push({
column: "productionLineCode",
action: "==",
value: productionLine
value: queryParams.productionLineCode
})
}
if(filterItemCode){
//
filters.push({
//
if (queryParams.itemCode) {
filterParams.push({
column: "itemCode",
action: "like",
value: filterItemCode
value: queryParams.itemCode
})
}
return filterParams;
},
getList(type) {
let that = this;
uni.showLoading({
title: "加载中­....",
mask: true
});
this.loadingType = "loading";
if (type === "refresh") {
this.pageNo = 1;
this.jobList = [];
}
var queryFiltersParams =this.setQueryParam()
var params = {
filters: filters,
filters: queryFiltersParams,
pageNo: this.pageNo,
pageSize: this.pageSize,
}
@ -279,7 +291,7 @@
cancleJob(id) {
cancleTakeProductionReceiptJob(id).then(res => {
if (res.data) {
this.getList('refresh', this.productionLine,this.filterItemCode)
this.getList('refresh')
uni.showToast({
title: "放弃任务成功"
})
@ -291,61 +303,6 @@
})
},
switchChangeToday(state, creationTime) {
this.checkedToday = state;
this.todayTime = creationTime;
this.getList('refresh', this.productionLine,this.filterItemCode)
},
switchChangeWait(state, jobStatus) {
this.checkedWaitTask = state;
this.status = jobStatus;
this.getList('refresh', this.productionLine,this.filterItemCode)
},
getScanNumber(code) {
this.getDataListByType(code)
},
getDataListByType(code) {
let that = this;
uni.showLoading({
title: "加载中....",
mask: true
});
var filters = []
filters.push({
column: "status",
action: "in",
value: '1,2'
})
filters.push({
column: "number",
action: "==",
value: code
})
filters.push({
column: "accept_user_id",
action: "==",
value: this.$store.state.user.id
})
var params = {
filters: filters,
pageNo: 1,
pageSize: 100,
}
getProductionReceiptJobList(params).then(res => {
uni.hideLoading();
if (res.data.list.length == 0) {
that.showMessage('未查找到' + '【' + code + '】的收货任务');
} else if (res.data.list.length == 1) {
that.openJobDetail(res.data.list[0]);
}
}).catch(error => {
uni.hideLoading();
that.showMessage(error);
})
},
showMessage(message) {
if(this.$refs.scanPopup){
this.$refs.scanPopup.packLoseFocus()
@ -392,8 +349,17 @@
column: "accept_user_id",
action: "==",
value: this.$store.state.user.id
}
},
]
if(this.productionLineCode){
filters.push({
column: "productionLineCode",
action: "==",
value: this.productionLineCode
})
}
getProductionReceiptJobList({
filters: filters,
pageNo: 1,
@ -430,49 +396,9 @@
},
getListByFilter(params) {
console.log('getListByFilter',params)
let that = this;
var filters = []
if (this.checkedToday) {
filters.push({
column: "create_time",
action: "betweeen",
value: this.todayTime
})
}
filters.push({
column: "status",
action: "in",
value: this.status
})
if (params.productionLineCode) {
// 线
this.productionLine = params.productionLineCode
}else{
this.productionLine = ''
}
if (params.itemCode) {
//
this.filterItemCode = params.itemCode
}else{
this.filterItemCode = ''
}
if (params.status) {
this.status = params.status
}else{
this.status = "1,2"
}
if(params.creationTime==""){
this.checkedToday = false;
}
this.todayTime = params.creationTime
this.getList('refresh', this.productionLine, this.filterItemCode)
this.productionLineCode =params.productionLineCode
uni.setStorageSync(productionReceiptJobFilter,params)
this.getList('refresh')
},
}
}

5
src/pages/purchaseReceipt/job/receiptJob.vue

@ -390,6 +390,11 @@
column: "status",
action: "in",
value: '1,2',
},
{
column: "accept_user_id",
action: "==",
value: this.$store.state.user.id
}]
} else {
filters = [{

256
src/pages/repleinsh/job/repleinshJob.vue

@ -1,16 +1,10 @@
<template>
<view class="">
<com-empty-view v-if="jobList.length==0"></com-empty-view>
<!-- <job-filter :isShowFromLocationCode="true" ref="filter" otherTitle="ASN" @switchChangeToday="switchChangeToday"
@switchChangeWait="switchChangeWait" @onScanNumber="getScanNumber" :checkedToday="checkedToday" :isShowItemCode="true"
:checkedWaitTask="checkedWaitTask" @fromLocationCode="fromLocationCode">
</job-filter> -->
<job-filter :isShowFromLocationCode="true" :isShowProductionLineCode="false"
:productionline="productionlineList" ref="filter" otherTitle="" @switchChangeToday="switchChangeToday"
@switchChangeWait="switchChangeWait" @onScanNumber="getScanNumber" :checkedToday="checkedToday"
:checkedWaitTask="checkedWaitTask" :isShowItemCode="true" @productionLineCode="productionLineCode"
@fromLocationCode="fromLocationCodeQuery" :isShowQurery='true' @onQuery="getListByFilter">
<job-filter :isShowFromLocationCode="true"
ref="filter" otherTitle="" :isShowItemCode="true"
@onQuery="getListByFilter" :isShowQurery='true'>
</job-filter>
<view v-if="jobList.length>0">
<uni-swipe-action ref="swipeAction">
@ -60,7 +54,8 @@
} from '@/common/array.js';
import {
planRefreshTime
planRefreshTime,
repleinshJobFilter
} from '@/common/config.js';
import comEmptyView from '@/mycomponents/common/comEmptyView.vue'
@ -119,14 +114,14 @@
onShow() {
this.timerRefresh();
this.getList('refresh')
},
onHide() {
this.stopRefresh();
// this.stopRefresh();
},
onUnload(){
this.stopRefresh();
// this.stopRefresh();
},
onReady() {
this.detailOptions = getDetailOption();
@ -149,7 +144,7 @@
if (e.index === 0) {
goHome();
} else if (e.index == 1) {
this.$refs.filter.openFilter();
this.$refs.filter.openFilterParams(uni.getStorageSync(repleinshJobFilter));
}
},
onReachBottom() {
@ -157,21 +152,21 @@
if (this.loadingType == 'loading' || this.loadingType == 'nomore') {
return;
}
this.getList('more', this.fromLocationCode, this.filterItemCode)
this.getList('more')
},
onPullDownRefresh() {
this.getList('refresh', this.fromLocationCode, this.filterItemCode)
this.getList('refresh')
},
methods: {
timerRefresh() {
this.getList('refresh', this.fromLocationCode, this.filterItemCode)
this.getList('refresh')
this.stopRefresh();
var that = this;
this.timer = setInterval(function() {
that.getList('refresh', that.fromLocationCode, that.filterItemCode)
that.getList('refresh')
console.log('补料刷新');
}, planRefreshTime)
},
@ -193,58 +188,71 @@
}
});
},
getList(type, fromLocationCode = '',filterItemCode='') {
setQueryParam(){
var filterParams = []
var queryParams=uni.getStorageSync(repleinshJobFilter)
let that = this;
uni.showLoading({
title: "加载中­....",
mask: true
});
this.loadingType = "loading";
if (type === "refresh") {
this.pageNo = 1;
this.jobList = [];
}
var filters = []
if (this.checkedToday) {
filters.push({
//
if (queryParams.creationTime ) {
filterParams.push({
column: "create_time",
action: "betweeen",
value: this.todayTime
value: queryParams.creationTime
})
}
filters.push({
column: "status",
action: "in",
value: this.status
})
if (fromLocationCode != '') {
//
if (queryParams.status) {
filterParams.push({
column: "status",
action: "in",
value: queryParams.status
})
}else {
filterParams.push({
column: "status",
action: "in",
value: "1,2"
})
}
//
filters.push({
if (queryParams.fromLocationCode) {
filterParams.push({
column: "fromLocationCode",
action: "==",
value: fromLocationCode
value: queryParams.fromLocationCode
})
}
if (filterItemCode != '') {
//
filters.push({
//
if (queryParams.itemCode) {
filterParams.push({
column: "itemCode",
action: "like",
value: filterItemCode
value: queryParams.itemCode
})
}
return filterParams;
},
getList(type) {
let that = this;
uni.showLoading({
title: "加载中­....",
mask: true
});
this.loadingType = "loading";
if (type === "refresh") {
this.pageNo = 1;
this.jobList = [];
}
var queryFiltersParams =this.setQueryParam()
var params = {
filters: filters,
filters: queryFiltersParams,
pageNo: this.pageNo,
pageSize: this.pageSize,
// sort: 'number',
// by: 'desc'
}
getRepleinshJobList(params).then(res => {
@ -276,87 +284,11 @@
},
getListByFilter(params) {
let that = this;
uni.showLoading({
title: "加载中­....",
mask: true
});
// var filters = []
// if (this.checkedToday) {
// filters.push({
// column: "create_time",
// action: "betweeen",
// value: this.todayTime
// })
// }
// filters.push({
// column: "status",
// action: "in",
// value: this.status
// })
if (params.status) {
this.status = params.status
}else{
this.status = "1,2"
}
if(params.creationTime==""){
this.checkedToday = false;
}
if (params.fromLocationCode) {
//
this.fromLocationCode = params.fromLocationCode
// filters.push({
// column: "fromLocationCode",
// action: "==",
// value: params.fromLocationCode
// })
}else{
this.fromLocationCode = ''
}
if (params.itemCode) {
//
this.filterItemCode = params.itemCode
// filters.push({
// column: "itemCode",
// action: "like",
// value: params.itemCode
// })
}else{
this.filterItemCode = ''
}
// var params = {
// filters: filters,
// pageNo: 1,
// pageSize: 100,
// }
this.getList('refresh', this.fromLocationCode, this.filterItemCode)
// getRepleinshJobList(params).then(res => {
// uni.hideLoading();
// if (res.data.total == 0) {
// that.showMessage('');
// } else if (res.data.total == 1) {
// that.openJobDetail(res.data.list[0]);
// } else {
// that.showItemList(res.data.list);
// }
// }).catch(error => {
// that.showMessage(error)
// })
uni.setStorageSync(repleinshJobFilter,params)
this.getList('refresh')
},
fromLocationCodeQuery(fromLocationCode) {
console.log('fromLocationCode', fromLocationCode)
this.fromLocationCode = fromLocationCode
this.getList('refresh', this.fromLocationCode, this.filterItemCode)
},
openJobDetail(item, scanMessage = '') {
this.getJobInfoByNumber(item.number,scanMessage )
@ -383,7 +315,7 @@
var params = {
filters: filters,
pageNo: 1,
pageSize: 100,
pageSize: this.pageSize,
}
getRepleinshJobList(params).then(res => {
uni.hideLoading();
@ -397,7 +329,7 @@
if (this.$refs.scanPopup) {
this.$refs.scanPopup.getfocus()
}
this.getList('refresh', this.fromLocationCode, this.filterItemCode)
this.getList('refresh')
}
});
@ -451,7 +383,7 @@
cancleJob(id) {
cancleTakeRepleinshJob(id).then(res => {
if (res.data) {
this.getList('refresh', this.fromLocationCode, this.filterItemCode)
this.getList('refresh')
uni.showToast({
title: "放弃任务成功"
})
@ -471,7 +403,7 @@
closeTakeRepleinshJob(id).then(res => {
uni.hideLoading()
if (res.data) {
this.getList('refresh', this.fromLocationCode, this.filterItemCode)
this.getList('refresh')
uni.showToast({
title: "关闭任务成功"
})
@ -484,58 +416,6 @@
})
},
switchChangeToday(state, creationTime) {
this.checkedToday = state;
this.todayTime = creationTime;
this.getList('refresh', this.fromLocationCode, this.filterItemCode)
},
switchChangeWait(state, jobStatus) {
this.checkedWaitTask = state;
this.status = jobStatus;
this.getList('refresh', this.fromLocationCode, this.filterItemCode)
},
getScanNumber(code) {
this.getDataListByType(code)
},
getDataListByType(code) {
let that = this;
uni.showLoading({
title: "加载中....",
mask: true
});
var filters = []
filters.push({
column: "status",
action: "in",
value: '1,2'
})
filters.push({
column: "number",
action: "==",
value: code
})
var params = {
filters: filters,
pageNo: 1,
pageSize: 100,
sort: 'number',
by: 'desc'
}
getRepleinshJobList(params).then(res => {
uni.hideLoading();
if (res.data.list.length == 0) {
that.showMessage('未查找到' + '【' + code + '】的补料任务');
} else {
that.openJobDetail(res.data.list[0]);
}
}).catch(error => {
uni.hideLoading();
that.showMessage(error);
})
},
showMessage(message) {
this.$refs.comMessage.showErrorMessage(message, res => {
if (res) {

Loading…
Cancel
Save