|
|
@ -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" @onScanAsnNumber="getScanAsnNumber" |
|
|
|
:checkedToday="checkedToday" :checkedWaitTask="checkedWaitTask"> |
|
|
|
<job-filter ref="filter" |
|
|
|
:isShowItemCode="true" |
|
|
|
@onQuery="getListByFilter" :isShowQurery='true' |
|
|
|
> |
|
|
|
</job-filter> |
|
|
|
<view v-if="jobList.length>0"> |
|
|
|
<uni-swipe-action ref="swipeAction"> |
|
|
@ -35,6 +36,11 @@ |
|
|
|
goHome, |
|
|
|
updateTitle |
|
|
|
} from '@/common/basic.js'; |
|
|
|
|
|
|
|
import { |
|
|
|
purchaseReturnJobFilter |
|
|
|
} from '@/common/config.js'; |
|
|
|
|
|
|
|
|
|
|
|
import { |
|
|
|
getDetailOption, |
|
|
@ -66,7 +72,7 @@ |
|
|
|
loadingType: "nomore", |
|
|
|
checkedToday: false, |
|
|
|
checkedWaitTask: false, |
|
|
|
todayTime: "", |
|
|
|
creationTime:"", |
|
|
|
status: '1,2', //待处理 、进行中 |
|
|
|
detailOptions: [], |
|
|
|
detailGiveupOptions: [], |
|
|
@ -113,7 +119,7 @@ |
|
|
|
if (e.index === 0) { |
|
|
|
goHome(); |
|
|
|
} else if (e.index == 1) { |
|
|
|
this.$refs.filter.openFilter(); |
|
|
|
this.$refs.filter.openFilterParams(uni.getStorageSync(purchaseReturnJobFilter)); |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
@ -130,27 +136,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 |
|
|
|
}) |
|
|
|
filters.push({ |
|
|
|
column: "accept_user_id", |
|
|
|
action: "==", |
|
|
|
value: this.$store.state.user.id |
|
|
|
}) |
|
|
|
|
|
|
|
var queryFiltersParams =this.setQueryParam() |
|
|
|
var params = { |
|
|
|
filters: filters, |
|
|
|
filters: queryFiltersParams, |
|
|
|
pageNo: this.pageNo, |
|
|
|
pageSize: this.pageSize, |
|
|
|
} |
|
|
@ -182,6 +171,50 @@ |
|
|
|
that.showErrorMessage(error) |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
setQueryParam(){ |
|
|
|
var filterParams = [] |
|
|
|
var queryParams=uni.getStorageSync(purchaseReturnJobFilter) |
|
|
|
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" |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
if(queryParams.itemCode){ |
|
|
|
filterParams.push({ |
|
|
|
column: "itemCode", |
|
|
|
action: "like", |
|
|
|
value: queryParams.itemCode |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
filterParams.push({ |
|
|
|
column: "accept_user_id", |
|
|
|
action: "==", |
|
|
|
value: this.$store.state.user.id |
|
|
|
}) |
|
|
|
|
|
|
|
return filterParams; |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
openJobDetail(item) { |
|
|
@ -231,78 +264,9 @@ |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
switchChangeToday(state, creationTime) { |
|
|
|
this.checkedToday = state; |
|
|
|
this.todayTime = creationTime; |
|
|
|
this.getList("refresh"); |
|
|
|
}, |
|
|
|
|
|
|
|
switchChangeWait(state, jobStatus) { |
|
|
|
this.checkedWaitTask = state; |
|
|
|
this.status = jobStatus; |
|
|
|
this.getList("refresh"); |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
getScanAsnNumber(code) { |
|
|
|
this.getDataListByType(code, "asnNumber") |
|
|
|
}, |
|
|
|
|
|
|
|
getScanNumber(code) { |
|
|
|
this.getDataListByType(code, "number") |
|
|
|
}, |
|
|
|
getDataListByType(code, type) { |
|
|
|
let that = this; |
|
|
|
uni.showLoading({ |
|
|
|
title: "加载中....", |
|
|
|
mask: true |
|
|
|
}); |
|
|
|
var filters = [] |
|
|
|
filters.push({ |
|
|
|
column: "status", |
|
|
|
action: "in", |
|
|
|
value: '1,2' |
|
|
|
}) |
|
|
|
if (type == "asnNumber") { |
|
|
|
filters.push({ |
|
|
|
column: "asn_number", |
|
|
|
action: "==", |
|
|
|
value: code |
|
|
|
}) |
|
|
|
} else if (type == "number") { |
|
|
|
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, |
|
|
|
} |
|
|
|
getPurchaseReturnJobList(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]); |
|
|
|
} else { |
|
|
|
if (type == "asnNumber") { |
|
|
|
that.showItemList(res.data.list); |
|
|
|
} |
|
|
|
} |
|
|
|
}).catch(error => { |
|
|
|
uni.hideLoading(); |
|
|
|
that.showMessage(error); |
|
|
|
}) |
|
|
|
getListByFilter(params) { |
|
|
|
uni.setStorageSync(purchaseReturnJobFilter,params) |
|
|
|
this.getList('refresh') |
|
|
|
}, |
|
|
|
|
|
|
|
showErrorMessage(message) { |
|
|
|