Browse Source

修改盘点任务查询

hella_online_20240924
lijuncheng 2 months ago
parent
commit
8bed6c5f48
  1. 182
      src/pages/count/job/countJob.vue

182
src/pages/count/job/countJob.vue

@ -1,15 +1,12 @@
<template> <template>
<view class=""> <view class="">
<com-empty-view v-if="jobList.length==0"></com-empty-view> <com-empty-view v-if="jobList.length==0"></com-empty-view>
<job-filter ref="filter" otherTitle="ASN" @switchChangeToday="switchChangeToday" <job-filter ref="filter" :isShowFromLocationCode="true" @onQuery="getListByFilter" :isShowQurery="true">
@switchChangeWait="switchChangeWait" @onScanNumber="getScanNumber" :checkedToday="checkedToday"
:checkedWaitTask="checkedWaitTask">
</job-filter> </job-filter>
<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">
<uni-swipe-action-item <uni-swipe-action-item :right-options="item.status=='2'?detailGiveupOptions:detailOptions"
:right-options="item.status=='2'?detailGiveupOptions:detailOptions"
@click="swipeClick($event,item)"> @click="swipeClick($event,item)">
<com-count-job-card :dataContent="item" @click='openJobDetail(item)'></com-count-job-card> <com-count-job-card :dataContent="item" @click='openJobDetail(item)'></com-count-job-card>
</uni-swipe-action-item> </uni-swipe-action-item>
@ -80,7 +77,12 @@
status: '1,2', // status: '1,2', //
detailOptions: [], detailOptions: [],
detailGiveupOptions: [], detailGiveupOptions: [],
title:'' title: '',
queryParams: {
creationTime: "",
status: "1,2",
fromLocationCode: ""
}
}; };
}, },
onLoad(option) { onLoad(option) {
@ -142,40 +144,10 @@
this.jobList = []; 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({ var queryFiltersParams = this.setQueryParam()
column: "countSplitType",
action: "==",
value: "locationCode"
})
filters.push({
column: "isOpenCount",
action: "==",
value: "TRUE"
})
filters.push({
column: "accept_user_id",
action: "==",
value: this.$store.state.user.id
})
var params = { var params = {
filters: filters, filters: queryFiltersParams,
pageNo: this.pageNo, pageNo: this.pageNo,
pageSize: this.pageSize, pageSize: this.pageSize,
sort: "number", sort: "number",
@ -228,6 +200,69 @@
}); });
} }
}, },
setQueryParam() {
var filterParams = []
//
if (this.queryParams.creationTime) {
filterParams.push({
column: "create_time",
action: "betweeen",
value: this.queryParams.creationTime
})
}
//
if (this.queryParams.status) {
filterParams.push({
column: "status",
action: "in",
value: this.queryParams.status
})
} else {
filterParams.push({
column: "status",
action: "in",
value: "1,2"
})
}
//
if (this.queryParams.fromLocationCode) {
filterParams.push({
column: "countSplitCode",
action: "==",
value: this.queryParams.fromLocationCode
})
}
filterParams.push({
column: "countSplitType",
action: "==",
value: "locationCode"
})
filterParams.push({
column: "isOpenCount",
action: "==",
value: "TRUE"
})
filterParams.push({
column: "accept_user_id",
action: "==",
value: this.$store.state.user.id
})
return filterParams;
},
getListByFilter(params) {
this.queryParams.creationTime = params.creationTime;
this.queryParams.status = params.status;
this.queryParams.fromLocationCode = params.fromLocationCode;
this.getList('refresh')
},
showItemList(itemList) { showItemList(itemList) {
this.$refs.jobListPopup.openPopup(itemList); this.$refs.jobListPopup.openPopup(itemList);
@ -279,77 +314,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
})
filters.push({
column: "countSplitType",
action: "==",
value: "locationCode"
})
filters.push({
column: "isOpenCount",
action: "==",
value: "TRUE"
})
filters.push({
column: "accept_user_id",
action: "==",
value: this.$store.state.user.id
})
var params = {
filters: filters,
pageNo: 1,
pageSize: 100,
sort:"number",
by:"DESC"
}
getCountJobList(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) { showMessage(message) {
this.$refs.comMessage.showErrorMessage(message, res => { this.$refs.comMessage.showErrorMessage(message, res => {
if (res) { if (res) {

Loading…
Cancel
Save