|
|
@ -1,22 +1,34 @@ |
|
|
|
<template> |
|
|
|
<view class=""> |
|
|
|
<view class="" style="background: white;padding: 20rpx;position: fixed;width: 100%;box-shadow: 0px 0px 10px 10px rgba(1, 1, 1, 0.05);z-index: 22;"> |
|
|
|
<uni-pagination :total="totalCount" title="标题文字" :pageSize='pageSize' @change="changePage" :current="pageNo"/> |
|
|
|
<view class="" style="background: white;padding: 20rpx;position: fixed;width: 100%;box-shadow: 0px 0px 10px 10px rgba(1, 1, 1, 0.05);z-index: 22; "> |
|
|
|
|
|
|
|
<uni-pagination :total="totalCount" title="每页30" :pageSize='pageSize' @change="changePage" :current="pageNo"/> |
|
|
|
<view class="" style="width: 100%; font-size: 30rpx; align-items: center; text-align: center;"> |
|
|
|
当前第{{pageNo}}页,每页:{{ pageSize}}条 共计:{{ totalCount }}条 |
|
|
|
</view> |
|
|
|
|
|
|
|
</view> |
|
|
|
<com-empty-view v-if="jobList.length==0"></com-empty-view> |
|
|
|
<job-filter ref="filter" otherTitle="ASN" @switchChangeToday="switchChangeToday" |
|
|
|
:isShowToAreaCode="true" :isShowQurery='true' :isShowToday='false' :isShowStatus='false' |
|
|
|
@switchChangeWait="switchChangeWait" @onScanNumber="getScanNumber" :checkedToday="checkedToday" |
|
|
|
:checkedWaitTask="checkedWaitTask" @onQuery="getListByFilter"> |
|
|
|
<job-filter ref="filter" otherTitle="ASN" :isShowToAreaCode="true" :isShowQurery='true' :isShowStatus='false' |
|
|
|
:isShowToLocationCode="true" :isShowItemCode="true" @onQuery="getListByFilter"> |
|
|
|
</job-filter> |
|
|
|
|
|
|
|
<view v-if="jobList.length>0" style="padding-bottom: 100rpx;padding-top: 100rpx;"> |
|
|
|
|
|
|
|
<view v-if="jobList.length>0" style="padding-bottom: 100rpx;padding-top: 150rpx;"> |
|
|
|
<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 :right-options="item.status=='2'?detailGiveupOptions:detailOptions" |
|
|
|
@click="swipeClick($event,item)"> |
|
|
|
<com-putaway-job-card :dataContent="item" @click='openJobDetail(item)'></com-putaway-job-card> |
|
|
|
|
|
|
|
<view class="flex" style="flex-direction: row; align-items: center;" > |
|
|
|
<view class="uni-flex" style="flex-direction: column; align-items: center;" > |
|
|
|
|
|
|
|
<text style="margin-bottom: 10rpx;">({{index+1}})</text> |
|
|
|
<u-checkbox v-model="item.checked" :name="item.id" size="50" shape ="circle"> |
|
|
|
</u-checkbox> |
|
|
|
</view> |
|
|
|
<view class="" style="width: 100%;"> |
|
|
|
<com-putaway-job-card :dataContent="item" @click='openJobDetail(item)'></com-putaway-job-card> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</uni-swipe-action-item> |
|
|
|
</view> |
|
|
|
</uni-swipe-action> |
|
|
@ -26,13 +38,10 @@ |
|
|
|
<!-- <uni-load-more :status="loadingType" v-if="jobList.length>0" /> --> |
|
|
|
|
|
|
|
</view> |
|
|
|
<!-- <win-scan-button @goScan='openScanPopup' v-if="jobList.length>0"></win-scan-button> --> |
|
|
|
|
|
|
|
<!-- <winScanPackJob ref="scanPopup" @getResult='getScanResult'> |
|
|
|
</winScanPackJob> --> |
|
|
|
<jobList ref="jobList" @selectItem="selectItem"></jobList> |
|
|
|
<view class="footer" v-if="jobList.length>0"> |
|
|
|
<button class="btn_single_commit" hover-class="btn_commit_after" @click="takeAllJob">执行当前页</button> |
|
|
|
<button class="btn_single_commit" hover-class="btn_commit_after" @click="takeAllJob">执行当前已选择项</button> |
|
|
|
</view> |
|
|
|
<comMessage ref="comMessage"></comMessage> |
|
|
|
</view> |
|
|
@ -49,6 +58,7 @@ |
|
|
|
cancleAllTakePutawayJob |
|
|
|
} from '@/api/request2.js'; |
|
|
|
|
|
|
|
|
|
|
|
import { |
|
|
|
goHome, |
|
|
|
updateTitle |
|
|
@ -56,7 +66,6 @@ |
|
|
|
|
|
|
|
import { |
|
|
|
getDetailOption, |
|
|
|
|
|
|
|
getDetailGiveupOption |
|
|
|
} from '@/common/array.js'; |
|
|
|
import winScanButton from '@/mycomponents/scan/winScanButton.vue' |
|
|
@ -67,6 +76,9 @@ |
|
|
|
import putawayJobListPopup from '@/pages/putaway/coms/putawayJobListPopup.vue' |
|
|
|
import putawayInfoPopup from '@/pages/putaway/coms/putawayInfoPopup.vue' |
|
|
|
import winScanPackJob from "@/mycomponents/scan/winScanPackJob.vue" |
|
|
|
import comCheckAll from "@/mycomponents/button/comCheckAll.vue" |
|
|
|
|
|
|
|
|
|
|
|
import { |
|
|
|
Exception |
|
|
|
} from 'sass'; |
|
|
@ -81,12 +93,14 @@ |
|
|
|
putawayInfoPopup, |
|
|
|
winScanButton, |
|
|
|
winScanPackJob, |
|
|
|
jobList |
|
|
|
jobList, |
|
|
|
comCheckAll |
|
|
|
}, |
|
|
|
data() { |
|
|
|
return { |
|
|
|
jobList: [], |
|
|
|
pageNo: 1, |
|
|
|
currentPageNo: 1, |
|
|
|
pageSize: 30, |
|
|
|
totalCount: 0, |
|
|
|
loadingType: "nomore", |
|
|
@ -98,7 +112,11 @@ |
|
|
|
detailGiveupOptions: [], |
|
|
|
title: '', |
|
|
|
scanMessage: "", |
|
|
|
jobNumberList:[],//全部承接参数 |
|
|
|
jobNumberList: [], //全部承接参数 |
|
|
|
creationTime: "", |
|
|
|
itemCode: "", |
|
|
|
toAreaCode: "", |
|
|
|
toLocationCode: "" |
|
|
|
}; |
|
|
|
}, |
|
|
|
|
|
|
@ -146,7 +164,7 @@ |
|
|
|
}, |
|
|
|
|
|
|
|
methods: { |
|
|
|
getList(type,toAreaCode='') { |
|
|
|
getList(type) { |
|
|
|
let that = this; |
|
|
|
uni.showLoading({ |
|
|
|
title: "加载中....", |
|
|
@ -159,49 +177,24 @@ |
|
|
|
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 |
|
|
|
}) |
|
|
|
if(this.toAreaCode){ |
|
|
|
//到库区 |
|
|
|
filters.push({ |
|
|
|
column: "toAreaCode", |
|
|
|
action: "==", |
|
|
|
value: this.toAreaCode |
|
|
|
}) |
|
|
|
} |
|
|
|
var queryFiltersParams = this.setQueryParam() |
|
|
|
var params = { |
|
|
|
filters: filters, |
|
|
|
filters: queryFiltersParams, |
|
|
|
pageNo: this.pageNo, |
|
|
|
pageSize: this.pageSize, |
|
|
|
} |
|
|
|
|
|
|
|
this.currentPageNo = this.pageNo |
|
|
|
getPutawayJobList(params).then(res => { |
|
|
|
uni.hideLoading(); |
|
|
|
// if (type === "refresh") { |
|
|
|
// uni.stopPullDownRefresh(); |
|
|
|
// this.openScanPopup() |
|
|
|
// } |
|
|
|
if (type === "refresh") { |
|
|
|
uni.stopPullDownRefresh(); |
|
|
|
} |
|
|
|
|
|
|
|
var list = res.data.list; |
|
|
|
list.forEach(item=>{ |
|
|
|
item.checked=false; |
|
|
|
}) |
|
|
|
this.totalCount = res.data.total |
|
|
|
console.log(333,this.totalCount) |
|
|
|
updateTitle(this.title + "(" + this.totalCount + ")"); |
|
|
|
// this.loadingType = "loadmore"; |
|
|
|
// if (list == null || list.length == 0) { |
|
|
@ -209,7 +202,6 @@ |
|
|
|
// return; |
|
|
|
// } |
|
|
|
this.jobList = list |
|
|
|
this.jobNumberList = list.map(item=>item.number) |
|
|
|
// this.pageNo++; |
|
|
|
|
|
|
|
}).catch(error => { |
|
|
@ -230,6 +222,62 @@ |
|
|
|
this.scanMessage = "" |
|
|
|
}, |
|
|
|
|
|
|
|
setQueryParam() { |
|
|
|
var filterParams = [] |
|
|
|
var queryParams = { |
|
|
|
status: this.status, |
|
|
|
creationTime: this.creationTime, |
|
|
|
itemCode: this.itemCode, |
|
|
|
toAreaCode: this.toAreaCode, |
|
|
|
toLocationCode: this.toLocationCode |
|
|
|
} |
|
|
|
|
|
|
|
//只看当天 |
|
|
|
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 |
|
|
|
}) |
|
|
|
} |
|
|
|
//物料代码 |
|
|
|
if (queryParams.itemCode) { |
|
|
|
filterParams.push({ |
|
|
|
column: "itemCode", |
|
|
|
action: "like", |
|
|
|
value: queryParams.itemCode |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
//到库区 |
|
|
|
if (queryParams.toAreaCode) { |
|
|
|
filterParams.push({ |
|
|
|
column: "toAreaCode", |
|
|
|
action: "==", |
|
|
|
value: queryParams.toAreaCode |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
//目标库位 |
|
|
|
if (queryParams.toLocationCode) { |
|
|
|
filterParams.push({ |
|
|
|
column: "toLocationCode", |
|
|
|
action: "==", |
|
|
|
value: queryParams.toLocationCode |
|
|
|
}) |
|
|
|
} |
|
|
|
return filterParams; |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
showItemList(itemList) { |
|
|
|
this.$refs.scanList.openPopup(itemList); |
|
|
|
}, |
|
|
@ -270,72 +318,14 @@ |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
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' |
|
|
|
}) |
|
|
|
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, |
|
|
|
} |
|
|
|
getPutawayJobList(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){ |
|
|
|
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() |
|
|
|
} |
|
|
|
} |
|
|
@ -356,121 +346,35 @@ |
|
|
|
}); |
|
|
|
this.scanMessage = "" |
|
|
|
}, |
|
|
|
getScanResult(result) { |
|
|
|
try { |
|
|
|
this.scanMessage = "" |
|
|
|
var filters = [{ |
|
|
|
column: "packingNumber", |
|
|
|
action: "in", |
|
|
|
value: result.package.number + "," + result.package.parentNumber |
|
|
|
}, |
|
|
|
{ |
|
|
|
column: "batch", |
|
|
|
action: "==", |
|
|
|
value: result.package.batch |
|
|
|
}, |
|
|
|
// { |
|
|
|
// column: "qty", |
|
|
|
// action: "==", |
|
|
|
// value: result.label.qty |
|
|
|
// }, |
|
|
|
{ |
|
|
|
column: "itemCode", |
|
|
|
action: "==", |
|
|
|
value: result.package.itemCode |
|
|
|
}, |
|
|
|
{ |
|
|
|
column: "status", |
|
|
|
action: "in", |
|
|
|
value: '1', |
|
|
|
}, |
|
|
|
// { |
|
|
|
// column: "accept_user_id", |
|
|
|
// action: "==", |
|
|
|
// value: this.$store.state.user.id |
|
|
|
// } |
|
|
|
// { |
|
|
|
// column: "fromLocationCode", |
|
|
|
// action: "==", |
|
|
|
// value: result.label.fromLocationCode |
|
|
|
// }, |
|
|
|
] |
|
|
|
getPutawayJobList({ |
|
|
|
filters: filters, |
|
|
|
pageNo: 1, |
|
|
|
pageSize: 100, |
|
|
|
}).then(res => { |
|
|
|
this.scanMessage = result.scanMessage |
|
|
|
let resultList = res.data.list; |
|
|
|
if (resultList.length > 0) { |
|
|
|
resultList.forEach(item => { |
|
|
|
item.title = item.number; |
|
|
|
item.selected = false |
|
|
|
}) |
|
|
|
let list = [] |
|
|
|
resultList.forEach(item => { |
|
|
|
if (!list.find(subItem => subItem.title == item.title)) { |
|
|
|
list.push(item) |
|
|
|
} |
|
|
|
}) |
|
|
|
if (list.length == 1) { |
|
|
|
//待处理 |
|
|
|
if (list[0].status == 1) { |
|
|
|
this.selectItem(list[0]) |
|
|
|
} else if (list[0].status == 2) { |
|
|
|
//进行中 |
|
|
|
if (list[0].acceptUserId == this.$store.state.user.id) { |
|
|
|
this.selectItem(list[0]) |
|
|
|
} else { |
|
|
|
this.showMessage("该任务已经被[" + list[0].acceptUserName + "]承接" + "\n任务号[" + |
|
|
|
list[0].number + "]扫描[" + result.scanMessage + "]") |
|
|
|
} |
|
|
|
} else if (list[0].status == 3) { |
|
|
|
this.showMessage("该任务已经完成\n承接人[" + list[0].acceptUserName + "]\n任务号[" + |
|
|
|
list[0].number + "]扫描[" + result.scanMessage + "]") |
|
|
|
} |
|
|
|
} else { |
|
|
|
this.showMessage("查询到多条任务\n" + "扫描[" + result.scanMessage + "]") |
|
|
|
} |
|
|
|
|
|
|
|
} else { |
|
|
|
this.showMessage("未查找到任务\n" + "扫描[" + result.scanMessage + "]") |
|
|
|
} |
|
|
|
}).catch(error => { |
|
|
|
this.showMessage(error + "\n扫描[" + result.scanMessage + "]") |
|
|
|
}) |
|
|
|
|
|
|
|
} catch (e) { |
|
|
|
this.showMessage(e + "\n扫描[" + result.scanMessage + "]") |
|
|
|
} |
|
|
|
}, |
|
|
|
getListByFilter(params) { |
|
|
|
console.log('getListByFilter',params) |
|
|
|
console.log('getListByFilter', params) |
|
|
|
|
|
|
|
let that = this; |
|
|
|
uni.showLoading({ |
|
|
|
title: "加载中....", |
|
|
|
mask: true |
|
|
|
}); |
|
|
|
this.status = "1" |
|
|
|
if(params.creationTime==""){ |
|
|
|
this.checkedToday = false; |
|
|
|
} |
|
|
|
if (params.toAreaCode) { |
|
|
|
// 到库区 |
|
|
|
this.toAreaCode = params.toAreaCode |
|
|
|
}else{ |
|
|
|
this.toAreaCode = '' |
|
|
|
} |
|
|
|
this.getList('refresh',this.toAreaCode) |
|
|
|
this.creationTime = params.creationTime |
|
|
|
this.itemCode = params.itemCode |
|
|
|
this.toAreaCode = params.toAreaCode |
|
|
|
this.toLocationCode = params.toLocationCode |
|
|
|
this.getList('refresh') |
|
|
|
}, |
|
|
|
// 承接全部任务 |
|
|
|
takeAllJob(){ |
|
|
|
takeAllJob() { |
|
|
|
uni.showLoading({ |
|
|
|
title: "加载中....", |
|
|
|
mask: true |
|
|
|
}); |
|
|
|
this.jobNumberList =[] |
|
|
|
this.jobList.forEach(item=>{ |
|
|
|
if(item.checked){ |
|
|
|
this.jobNumberList.push(item.number) |
|
|
|
} |
|
|
|
}) |
|
|
|
|
|
|
|
takeAllPutawayJob({ |
|
|
|
jobNumberList:this.jobNumberList |
|
|
|
jobNumberList: this.jobNumberList |
|
|
|
}).then(res => { |
|
|
|
if (res.data) { |
|
|
|
this.executeAllJob() |
|
|
@ -483,62 +387,71 @@ |
|
|
|
this.showMessage(error) |
|
|
|
}) |
|
|
|
}, |
|
|
|
executeAllJob(){ |
|
|
|
executeAllJob() { |
|
|
|
putawayJobAllExecute({ |
|
|
|
jobNumberList:this.jobNumberList |
|
|
|
jobNumberList: this.jobNumberList |
|
|
|
}).then(res => { |
|
|
|
if (res.data) { |
|
|
|
uni.hideLoading() |
|
|
|
this.$refs.comMessage.showSuccessMessage( "执行任务成功", res => { |
|
|
|
this.$refs.comMessage.showSuccessMessage("执行任务成功", res => { |
|
|
|
if (res) { |
|
|
|
this.getList() |
|
|
|
this.getList('refresh') |
|
|
|
} |
|
|
|
}); |
|
|
|
} else { |
|
|
|
uni.hideLoading() |
|
|
|
this.showMessage("执行任务失败") |
|
|
|
this.cancleAllJob() |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
}).catch(error => { |
|
|
|
uni.hideLoading() |
|
|
|
this.showMessage(error) |
|
|
|
this.cancleAllJob() |
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
|
// 取消承接全部任务 |
|
|
|
cancleAllJob(){ |
|
|
|
cancleAllJob() { |
|
|
|
cancleAllTakePutawayJob({ |
|
|
|
jobNumberList:this.jobNumberList |
|
|
|
jobNumberList: this.jobNumberList |
|
|
|
}).then(res => { |
|
|
|
|
|
|
|
|
|
|
|
}).catch(error => { |
|
|
|
uni.hideLoading() |
|
|
|
this.showMessage(error) |
|
|
|
}) |
|
|
|
}, |
|
|
|
changePage(e){ |
|
|
|
changePage(e) { |
|
|
|
console.log(e) |
|
|
|
this.pageNo = e.current |
|
|
|
this.status = 1 |
|
|
|
this.getList() |
|
|
|
}, |
|
|
|
checkAllItems(checkAll){ |
|
|
|
console.log(checkAll) |
|
|
|
}, |
|
|
|
cancleAll(){ |
|
|
|
this.jobList.forEach(res=>{ |
|
|
|
res.checked=false; |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
</script> |
|
|
|
|
|
|
|
<style scoped lang="scss"> |
|
|
|
.footer{ |
|
|
|
position: fixed; |
|
|
|
bottom: 0px; |
|
|
|
background: white; |
|
|
|
width: 100%; |
|
|
|
padding:16rpx 20rpx; |
|
|
|
box-shadow: 0px 0px 20rpx 20rpx rgba(0, 0, 0, 0.05); |
|
|
|
button{ |
|
|
|
.footer { |
|
|
|
position: fixed; |
|
|
|
bottom: 0px; |
|
|
|
background: white; |
|
|
|
width: 100%; |
|
|
|
padding: 16rpx 20rpx; |
|
|
|
box-shadow: 0px 0px 20rpx 20rpx rgba(0, 0, 0, 0.05); |
|
|
|
|
|
|
|
button { |
|
|
|
width: 100%; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
</style> |