|
|
@ -3,13 +3,14 @@ |
|
|
|
<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"> |
|
|
|
:checkedWaitTask="checkedWaitTask" :isShowProductionLineCode="true" |
|
|
|
@productionLineCode="productionLineCode" |
|
|
|
:productionline="productionLineList"> |
|
|
|
</job-filter> |
|
|
|
<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-production-job-card :dataContent="item" @click='openJobDetail(item)'> |
|
|
|
</com-production-job-card> |
|
|
@ -23,7 +24,7 @@ |
|
|
|
<uni-load-more :status="loadingType" /> |
|
|
|
</view> |
|
|
|
<win-scan-button @goScan='openScanPopup' v-if="jobList.length>0"></win-scan-button> |
|
|
|
<winScanPackJob ref="scanPopup" @getResult='getScanResult' ></winScanPackJob> |
|
|
|
<winScanPackJob ref="scanPopup" @getResult='getScanResult'></winScanPackJob> |
|
|
|
<jobList ref="jobList" @selectItem="selectItem"></jobList> |
|
|
|
<comMessage ref="comMessage"></comMessage> |
|
|
|
</view> |
|
|
@ -32,7 +33,8 @@ |
|
|
|
<script> |
|
|
|
import { |
|
|
|
getProductionReceiptJobList, |
|
|
|
cancleTakeProductionReceiptJob |
|
|
|
cancleTakeProductionReceiptJob, |
|
|
|
getIssueJobByProductionline |
|
|
|
} from '@/api/request2.js'; |
|
|
|
|
|
|
|
import { |
|
|
@ -80,16 +82,19 @@ |
|
|
|
status: '1,2', //待处理 、进行中 |
|
|
|
detailOptions: [], |
|
|
|
detailGiveupOptions: [], |
|
|
|
title:'', |
|
|
|
scanMessage:"" |
|
|
|
title: '', |
|
|
|
scanMessage: "", |
|
|
|
productionLineList: [], |
|
|
|
productionLine:"" |
|
|
|
}; |
|
|
|
}, |
|
|
|
onLoad(option){ |
|
|
|
onLoad(option) { |
|
|
|
this.title = option.title |
|
|
|
this.getIssueJobByProductionline() |
|
|
|
}, |
|
|
|
|
|
|
|
onShow() { |
|
|
|
this.getList('refresh'); |
|
|
|
this.getList('refresh', this.productionLine); |
|
|
|
}, |
|
|
|
|
|
|
|
onReady() { |
|
|
@ -102,11 +107,11 @@ |
|
|
|
if (this.loadingType == 'loading' || this.loadingType == 'nomore') { |
|
|
|
return; |
|
|
|
} |
|
|
|
this.getList("more"); |
|
|
|
this.getList("more", this.productionLine); |
|
|
|
}, |
|
|
|
|
|
|
|
onPullDownRefresh() { |
|
|
|
this.getList('refresh'); |
|
|
|
this.getList('refresh', this.productionLine); |
|
|
|
}, |
|
|
|
|
|
|
|
//后退按钮 |
|
|
@ -129,7 +134,28 @@ |
|
|
|
}, |
|
|
|
|
|
|
|
methods: { |
|
|
|
getList(type) { |
|
|
|
productionLineCode(productionLineCode) { |
|
|
|
this.productionLine = productionLineCode |
|
|
|
this.getList('refresh', this.productionLine) |
|
|
|
}, |
|
|
|
getIssueJobByProductionline() { |
|
|
|
getIssueJobByProductionline().then(res => { |
|
|
|
console.log('生产线', res) |
|
|
|
if (res.code == 0) { |
|
|
|
this.productionLineList = res.data.map(item => ({ |
|
|
|
value: item.value, |
|
|
|
text: item.name |
|
|
|
})) |
|
|
|
this.productionLineList.unshift({ |
|
|
|
value: "", |
|
|
|
text: "全部" |
|
|
|
}) |
|
|
|
} else { |
|
|
|
this.productionLineList = [] |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
getList(type, productionLine = '') { |
|
|
|
let that = this; |
|
|
|
uni.showLoading({ |
|
|
|
title: "加载中....", |
|
|
@ -149,18 +175,28 @@ |
|
|
|
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 (productionLine) { |
|
|
|
// 生产线 |
|
|
|
filters.push({ |
|
|
|
column: "productionLineCode", |
|
|
|
action: "==", |
|
|
|
value: productionLine |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
var params = { |
|
|
|
filters: filters, |
|
|
|
pageNo: this.pageNo, |
|
|
@ -175,7 +211,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"; |
|
|
@ -183,7 +219,7 @@ |
|
|
|
} |
|
|
|
this.jobList = type === "refresh" ? list : this.jobList.concat(list); |
|
|
|
this.pageNo++; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}).catch(error => { |
|
|
|
if (type === "refresh") { |
|
|
@ -198,9 +234,10 @@ |
|
|
|
|
|
|
|
openJobDetail(item, scanMessage = '') { |
|
|
|
uni.navigateTo({ |
|
|
|
url: './productionReceiptDetail?id=' + item.masterId + '&status=' + item.status+'&scanMessage=' + scanMessage +'&title='+this.title |
|
|
|
url: './productionReceiptDetail?id=' + item.masterId + '&status=' + item.status + |
|
|
|
'&scanMessage=' + scanMessage + '&title=' + this.title |
|
|
|
}); |
|
|
|
this.scanMessage="" |
|
|
|
this.scanMessage = "" |
|
|
|
}, |
|
|
|
|
|
|
|
showItemList(itemList) { |
|
|
@ -230,12 +267,12 @@ |
|
|
|
|
|
|
|
cancleJob(id) { |
|
|
|
cancleTakeProductionReceiptJob(id).then(res => { |
|
|
|
if(res.data){ |
|
|
|
this.getList("refresh") |
|
|
|
if (res.data) { |
|
|
|
this.getList("refresh", this.productionLine) |
|
|
|
uni.showToast({ |
|
|
|
title:"放弃任务成功" |
|
|
|
title: "放弃任务成功" |
|
|
|
}) |
|
|
|
}else { |
|
|
|
} else { |
|
|
|
this.showMessage("放弃任务失败") |
|
|
|
} |
|
|
|
}).catch(error => { |
|
|
@ -246,13 +283,13 @@ |
|
|
|
switchChangeToday(state, creationTime) { |
|
|
|
this.checkedToday = state; |
|
|
|
this.todayTime = creationTime; |
|
|
|
this.getList("refresh"); |
|
|
|
this.getList("refresh", this.productionLine); |
|
|
|
}, |
|
|
|
|
|
|
|
switchChangeWait(state, jobStatus) { |
|
|
|
this.checkedWaitTask = state; |
|
|
|
this.status = jobStatus; |
|
|
|
this.getList("refresh"); |
|
|
|
this.getList("refresh"), this.productionLine; |
|
|
|
}, |
|
|
|
getScanNumber(code) { |
|
|
|
this.getDataListByType(code) |
|
|
@ -279,7 +316,7 @@ |
|
|
|
action: "==", |
|
|
|
value: this.$store.state.user.id |
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
var params = { |
|
|
|
filters: filters, |
|
|
|
pageNo: 1, |
|
|
@ -310,11 +347,11 @@ |
|
|
|
}, |
|
|
|
selectItem(item) { |
|
|
|
this.$refs.scanPopup.closeScanPopup(); |
|
|
|
this.openJobDetail(item,this.scanMessage); |
|
|
|
this.openJobDetail(item, this.scanMessage); |
|
|
|
}, |
|
|
|
getScanResult(result) { |
|
|
|
try { |
|
|
|
this.scanMessage="" |
|
|
|
this.scanMessage = "" |
|
|
|
var filters = [{ |
|
|
|
column: "packingNumber", |
|
|
|
action: "==", |
|
|
@ -349,8 +386,8 @@ |
|
|
|
item.selected = false |
|
|
|
}) |
|
|
|
let list = [] |
|
|
|
resultList.forEach(item=>{ |
|
|
|
if(!list.find(subItem=>subItem.title==item.title)){ |
|
|
|
resultList.forEach(item => { |
|
|
|
if (!list.find(subItem => subItem.title == item.title)) { |
|
|
|
list.push(item) |
|
|
|
} |
|
|
|
}) |
|
|
@ -360,12 +397,12 @@ |
|
|
|
this.selectItem(list[0]) |
|
|
|
} |
|
|
|
} else { |
|
|
|
this.showMessage("未查找到任务<br>"+"扫描["+result.scanMessage+"]") |
|
|
|
this.showMessage("未查找到任务<br>" + "扫描[" + result.scanMessage + "]") |
|
|
|
} |
|
|
|
}).catch(error => { |
|
|
|
this.showMessage(error+"<br>扫描["+result.scanMessage+"]") |
|
|
|
this.showMessage(error + "<br>扫描[" + result.scanMessage + "]") |
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
} catch (e) { |
|
|
|
this.showMessage(e.message) |
|
|
|
} |
|
|
@ -376,4 +413,4 @@ |
|
|
|
|
|
|
|
<style scoped lang="scss"> |
|
|
|
|
|
|
|
</style> |
|
|
|
</style> |