|
|
@ -1,15 +1,23 @@ |
|
|
|
<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"> |
|
|
|
<view class="uni-flex" style="flex-direction: column;;"> |
|
|
|
|
|
|
|
<job-filter ref="filter" @onQuery="getListByFilter" :isShowQurery="true"> |
|
|
|
</job-filter> |
|
|
|
<view style="background-color: #fff; padding-left: 20rpx; border-radius: 15rpx;"> |
|
|
|
<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="itemType" :clear="false" :localdata="itemTypeList" |
|
|
|
@change="itemTypeConfirm"></uni-data-select> |
|
|
|
</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"> |
|
|
|
<uni-swipe-action-item |
|
|
|
:right-options="item.status=='2'?detailGiveupOptions:detailOptions" |
|
|
|
<uni-swipe-action-item :right-options="item.status=='2'?detailGiveupOptions:detailOptions" |
|
|
|
@click="swipeClick($event,item)"> |
|
|
|
<com-deliver-job-card :dataContent="item" @click='openJobDetail(item)'></com-deliver-job-card> |
|
|
|
</uni-swipe-action-item> |
|
|
@ -27,17 +35,29 @@ |
|
|
|
</template> |
|
|
|
|
|
|
|
<script> |
|
|
|
|
|
|
|
import { |
|
|
|
getDeliverJobList, |
|
|
|
cancleTakeDeliverJob |
|
|
|
} from '@/api/request2.js'; |
|
|
|
|
|
|
|
import { |
|
|
|
getBusinessType, |
|
|
|
} from '@/common/record.js'; |
|
|
|
|
|
|
|
import { |
|
|
|
goHome, |
|
|
|
updateTitle |
|
|
|
} from '@/common/basic.js'; |
|
|
|
|
|
|
|
import { |
|
|
|
getItemTypeInfo |
|
|
|
} from '@/common/directory.js'; |
|
|
|
|
|
|
|
import { |
|
|
|
planRefreshTime, |
|
|
|
deliverJobFilter |
|
|
|
} from '@/common/config.js'; |
|
|
|
|
|
|
|
import { |
|
|
|
getDetailOption, |
|
|
|
getDetailGiveupOption |
|
|
@ -72,8 +92,10 @@ |
|
|
|
status: '1,2', //待处理 、进行中 |
|
|
|
detailOptions: [], |
|
|
|
detailGiveupOptions: [], |
|
|
|
businessType:'', |
|
|
|
title:'' |
|
|
|
businessType: '', |
|
|
|
title: '', |
|
|
|
itemType: "", |
|
|
|
itemTypeList: [], |
|
|
|
}; |
|
|
|
}, |
|
|
|
onLoad(option) { |
|
|
@ -81,7 +103,12 @@ |
|
|
|
this.businessType = option.businessType |
|
|
|
}, |
|
|
|
onShow() { |
|
|
|
if (this.itemTypeList.length == 0) { |
|
|
|
this.getItemTypeList() |
|
|
|
} else { |
|
|
|
this.getList('refresh'); |
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
onReady() { |
|
|
@ -120,6 +147,26 @@ |
|
|
|
}, |
|
|
|
|
|
|
|
methods: { |
|
|
|
getItemTypeList() { |
|
|
|
var typeCode = "Deliver" |
|
|
|
getBusinessType(typeCode, res => { |
|
|
|
if (res.success && res.itemCodeTypeList.length > 0) { |
|
|
|
var list = [] |
|
|
|
res.itemCodeTypeList.forEach(item => { |
|
|
|
var itemText = getItemTypeInfo(item).label |
|
|
|
list.push({ |
|
|
|
value: item, |
|
|
|
text: itemText |
|
|
|
}) |
|
|
|
}) |
|
|
|
this.itemTypeList = list; |
|
|
|
} else { |
|
|
|
this.itemTypeList = [] |
|
|
|
} |
|
|
|
this.getList('refresh') |
|
|
|
}); |
|
|
|
}, |
|
|
|
|
|
|
|
getList(type) { |
|
|
|
let that = this; |
|
|
|
uni.showLoading({ |
|
|
@ -131,35 +178,11 @@ |
|
|
|
this.pageNo = 1; |
|
|
|
this.jobList = []; |
|
|
|
} |
|
|
|
var filters = [] |
|
|
|
if (this.checkedToday) { |
|
|
|
filters.push({ |
|
|
|
column: "create_time", |
|
|
|
action: "betweeen", |
|
|
|
value: this.todayTime |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
filters.push({ |
|
|
|
column: "accept_user_id", |
|
|
|
action: "==", |
|
|
|
value: this.$store.state.user.id |
|
|
|
}) |
|
|
|
filters.push({ |
|
|
|
column: "status", |
|
|
|
action: "in", |
|
|
|
value: this.status |
|
|
|
}) |
|
|
|
if(this.businessType&&this.businessType.length>0){ |
|
|
|
// 成品发货任务:businessType=Deliver 自制备件发货任务:businessType=ZZBJDeliver |
|
|
|
filters.push({ |
|
|
|
column: "businessType", |
|
|
|
action: "==", |
|
|
|
value: this.businessType |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
var queryFiltersParams = this.setQueryParam() |
|
|
|
var params = { |
|
|
|
filters: filters, |
|
|
|
filters: queryFiltersParams, |
|
|
|
pageNo: this.pageNo, |
|
|
|
pageSize: this.pageSize, |
|
|
|
} |
|
|
@ -171,7 +194,7 @@ |
|
|
|
|
|
|
|
var list = res.data.list; |
|
|
|
this.totalCount = res.data.total |
|
|
|
updateTitle(this.title+"(" + this.totalCount + ")"); |
|
|
|
updateTitle(this.title + "(" + this.totalCount + ")"); |
|
|
|
this.loadingType = "loadmore"; |
|
|
|
if (list == null || list.length == 0) { |
|
|
|
this.loadingType = "nomore"; |
|
|
@ -193,7 +216,7 @@ |
|
|
|
|
|
|
|
openJobDetail(item) { |
|
|
|
uni.navigateTo({ |
|
|
|
url: './deliverDetail?id=' + item.masterId + '&status=' + item.status+'&title='+this.title |
|
|
|
url: './deliverDetail?id=' + item.masterId + '&status=' + item.status + '&title=' + this.title |
|
|
|
}); |
|
|
|
}, |
|
|
|
|
|
|
@ -224,12 +247,12 @@ |
|
|
|
|
|
|
|
cancleJob(id) { |
|
|
|
cancleTakeDeliverJob(id).then(res => { |
|
|
|
if(res.data){ |
|
|
|
if (res.data) { |
|
|
|
this.getList("refresh") |
|
|
|
uni.showToast({ |
|
|
|
title:"放弃任务成功" |
|
|
|
title: "放弃任务成功" |
|
|
|
}) |
|
|
|
}else { |
|
|
|
} else { |
|
|
|
this.showMessage("放弃任务失败") |
|
|
|
} |
|
|
|
}).catch(error => { |
|
|
@ -237,54 +260,70 @@ |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
switchChangeToday(state, creationTime) { |
|
|
|
this.checkedToday = state; |
|
|
|
this.todayTime = creationTime; |
|
|
|
this.getList("refresh"); |
|
|
|
}, |
|
|
|
|
|
|
|
switchChangeWait(state, jobStatus) { |
|
|
|
this.checkedWaitTask = state; |
|
|
|
this.status = jobStatus; |
|
|
|
getListByFilter(params) { |
|
|
|
params.itemType = this.itemType |
|
|
|
uni.setStorageSync(deliverJobFilter, params) |
|
|
|
this.getList("refresh"); |
|
|
|
}, |
|
|
|
getScanNumber(code) { |
|
|
|
this.getDataListByType(code) |
|
|
|
}, |
|
|
|
getDataListByType(code) { |
|
|
|
let that = this; |
|
|
|
uni.showLoading({ |
|
|
|
title: "加载中....", |
|
|
|
mask: true |
|
|
|
}); |
|
|
|
var filters = [] |
|
|
|
filters.push({ |
|
|
|
setQueryParam() { |
|
|
|
var filterParams = []; |
|
|
|
var queryParams = uni.getStorageSync(deliverJobFilter) |
|
|
|
if (queryParams.creationTime) { |
|
|
|
filterParams.push({ |
|
|
|
column: "create_time", |
|
|
|
action: "betweeen", |
|
|
|
value: queryParams.creationTime |
|
|
|
}) |
|
|
|
} |
|
|
|
//只看待处理 |
|
|
|
if (queryParams.status) { |
|
|
|
filterParams.push({ |
|
|
|
column: "status", |
|
|
|
action: "in", |
|
|
|
value: '1,2' |
|
|
|
value: queryParams.status |
|
|
|
}) |
|
|
|
filters.push({ |
|
|
|
column: "number", |
|
|
|
} else { |
|
|
|
filterParams.push({ |
|
|
|
column: "status", |
|
|
|
action: "in", |
|
|
|
value: "1,2" |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
filterParams.push({ |
|
|
|
column: "accept_user_id", |
|
|
|
action: "==", |
|
|
|
value: code |
|
|
|
value: this.$store.state.user.id |
|
|
|
}) |
|
|
|
|
|
|
|
var params = { |
|
|
|
filters: filters, |
|
|
|
pageNo: 1, |
|
|
|
pageSize: 100, |
|
|
|
} |
|
|
|
getDeliverJobList(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]); |
|
|
|
if (this.businessType && this.businessType.length > 0) { |
|
|
|
// 成品发货任务:businessType=Deliver 自制备件发货任务:businessType=ZZBJDeliver |
|
|
|
filterParams.push({ |
|
|
|
column: "businessType", |
|
|
|
action: "==", |
|
|
|
value: this.businessType |
|
|
|
}) |
|
|
|
} |
|
|
|
}).catch(error => { |
|
|
|
uni.hideLoading(); |
|
|
|
that.showMessage(error); |
|
|
|
//物料类型 |
|
|
|
if (queryParams.itemType) { |
|
|
|
filterParams.push({ |
|
|
|
column: "itemType", |
|
|
|
action: "==", |
|
|
|
value: queryParams.itemType |
|
|
|
}) |
|
|
|
this.itemType = queryParams.itemType |
|
|
|
} else { |
|
|
|
if (this.itemType) { |
|
|
|
filterParams.push({ |
|
|
|
column: "itemType", |
|
|
|
action: "==", |
|
|
|
value: this.itemType |
|
|
|
}) |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
return filterParams; |
|
|
|
}, |
|
|
|
|
|
|
|
showMessage(message) { |
|
|
@ -293,8 +332,19 @@ |
|
|
|
|
|
|
|
} |
|
|
|
}); |
|
|
|
}, |
|
|
|
itemTypeConfirm(e) { |
|
|
|
var params = uni.getStorageSync(deliverJobFilter) |
|
|
|
this.itemType = e; |
|
|
|
//第一次没有值,需要赋值 |
|
|
|
if (!params) { |
|
|
|
params = { |
|
|
|
itemType: "" |
|
|
|
} |
|
|
|
} |
|
|
|
this.getListByFilter(params) |
|
|
|
}, |
|
|
|
} |
|
|
|
} |
|
|
|
</script> |
|
|
|
|
|
|
|