|
@ -11,7 +11,8 @@ |
|
|
<uni-swipe-action-item |
|
|
<uni-swipe-action-item |
|
|
:right-options="item.status=='2'?detailGiveupOptions:item.status=='1'?detailCloseOptions:detailOptions" |
|
|
:right-options="item.status=='2'?detailGiveupOptions:item.status=='1'?detailCloseOptions:detailOptions" |
|
|
@click="swipeClick($event,item)"> |
|
|
@click="swipeClick($event,item)"> |
|
|
<com-repleinsh-job-card :dataContent="item" @click='openJobDetail(item)'></com-repleinsh-job-card> |
|
|
<com-repleinsh-job-card :dataContent="item" |
|
|
|
|
|
@click='openJobDetail(item)'></com-repleinsh-job-card> |
|
|
</uni-swipe-action-item> |
|
|
</uni-swipe-action-item> |
|
|
</view> |
|
|
</view> |
|
|
</uni-swipe-action> |
|
|
</uni-swipe-action> |
|
@ -22,17 +23,18 @@ |
|
|
|
|
|
|
|
|
</view> |
|
|
</view> |
|
|
<win-scan-button @goScan='openScanPopup' v-if="jobList.length>0"></win-scan-button> |
|
|
<win-scan-button @goScan='openScanPopup' v-if="jobList.length>0"></win-scan-button> |
|
|
<winScanPackJob ref="scanPopup" @getResult='getScanResult' ></winScanPackJob> |
|
|
<winComScanBalance ref="scanPopup" @getBalance='getScanResult' :bussinessCode="businessTypeCode"> |
|
|
|
|
|
</winComScanBalance> |
|
|
|
|
|
<!-- <winScanPackJob ref="scanPopup" @getResult='getScanResult' ></winScanPackJob> --> |
|
|
<comMessage ref="comMessage"></comMessage> |
|
|
<comMessage ref="comMessage"></comMessage> |
|
|
</view> |
|
|
</view> |
|
|
</template> |
|
|
</template> |
|
|
|
|
|
|
|
|
<script> |
|
|
<script> |
|
|
|
|
|
|
|
|
import { |
|
|
import { |
|
|
getRepleinshJobList, |
|
|
getRepleinshJobList, |
|
|
cancleTakeRepleinshJob, |
|
|
cancleTakeRepleinshJob, |
|
|
closeTakeRepleinshJob |
|
|
closeTakeRepleinshJob, |
|
|
} from '@/api/request2.js'; |
|
|
} from '@/api/request2.js'; |
|
|
|
|
|
|
|
|
import { |
|
|
import { |
|
@ -40,6 +42,10 @@ |
|
|
updateTitle |
|
|
updateTitle |
|
|
} from '@/common/basic.js'; |
|
|
} from '@/common/basic.js'; |
|
|
|
|
|
|
|
|
|
|
|
import { |
|
|
|
|
|
getBusinessType |
|
|
|
|
|
} from '@/common/record.js'; |
|
|
|
|
|
|
|
|
import { |
|
|
import { |
|
|
getDetailOption, |
|
|
getDetailOption, |
|
|
getDetailGiveupOption, |
|
|
getDetailGiveupOption, |
|
@ -54,6 +60,7 @@ |
|
|
import repleinshInfoPopup from '@/pages/repleinsh/coms/repleinshInfoPopup.vue' |
|
|
import repleinshInfoPopup from '@/pages/repleinsh/coms/repleinshInfoPopup.vue' |
|
|
import winScanButton from '@/mycomponents/scan/winScanButton.vue' |
|
|
import winScanButton from '@/mycomponents/scan/winScanButton.vue' |
|
|
import winScanPackJob from "@/mycomponents/scan/winScanPackJob.vue" |
|
|
import winScanPackJob from "@/mycomponents/scan/winScanPackJob.vue" |
|
|
|
|
|
import winComScanBalance from '@/mycomponents/scan/winComScanBalance.vue' |
|
|
|
|
|
|
|
|
export default { |
|
|
export default { |
|
|
name: 'repleinsh', |
|
|
name: 'repleinsh', |
|
@ -65,6 +72,7 @@ |
|
|
repleinshInfoPopup, |
|
|
repleinshInfoPopup, |
|
|
winScanPackJob, |
|
|
winScanPackJob, |
|
|
winScanButton, |
|
|
winScanButton, |
|
|
|
|
|
winComScanBalance |
|
|
}, |
|
|
}, |
|
|
data() { |
|
|
data() { |
|
|
return { |
|
|
return { |
|
@ -80,12 +88,18 @@ |
|
|
detailOptions: [], |
|
|
detailOptions: [], |
|
|
detailGiveupOptions: [], |
|
|
detailGiveupOptions: [], |
|
|
detailCloseOptions: [], |
|
|
detailCloseOptions: [], |
|
|
title:'', |
|
|
title: '', |
|
|
scanMessage:"" |
|
|
scanMessage: "", |
|
|
|
|
|
businessTypeCode: "Repleinment", |
|
|
|
|
|
businessType: null, |
|
|
|
|
|
scanBalance: {}, |
|
|
|
|
|
inInventoryStatus: "", //目标入库库存状态 |
|
|
|
|
|
outInventoryStatus: "", //来源出库库存状态 |
|
|
}; |
|
|
}; |
|
|
}, |
|
|
}, |
|
|
onLoad(option){ |
|
|
onLoad(option) { |
|
|
this.title = option.title |
|
|
this.title = option.title |
|
|
|
|
|
this.getBusinessTypeFunc() |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
onShow() { |
|
|
onShow() { |
|
@ -128,8 +142,20 @@ |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
methods: { |
|
|
methods: { |
|
|
getList(type, fromLocationCode = '') { |
|
|
getBusinessTypeFunc() { |
|
|
|
|
|
getBusinessType(this.businessTypeCode, res => { |
|
|
|
|
|
if (res.success) { |
|
|
|
|
|
this.businessType = res.businessType; |
|
|
|
|
|
this.fromInventoryStatuses = getDirectoryItemArray(res.fromInventoryStatuses); |
|
|
|
|
|
this.fromLocationAreaTypeList = res.fromLocationAreaTypeList |
|
|
|
|
|
// this.openScanPopup(); |
|
|
|
|
|
} else { |
|
|
|
|
|
this.showErrorMessage(res.message) |
|
|
|
|
|
} |
|
|
|
|
|
}); |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
getList(type, fromLocationCode = '') { |
|
|
let that = this; |
|
|
let that = this; |
|
|
uni.showLoading({ |
|
|
uni.showLoading({ |
|
|
title: "加载中....", |
|
|
title: "加载中....", |
|
@ -186,7 +212,7 @@ |
|
|
|
|
|
|
|
|
var list = res.data.list; |
|
|
var list = res.data.list; |
|
|
this.totalCount = res.data.total |
|
|
this.totalCount = res.data.total |
|
|
updateTitle(this.title+"(" + this.totalCount + ")"); |
|
|
updateTitle(this.title + "(" + this.totalCount + ")"); |
|
|
this.loadingType = "loadmore"; |
|
|
this.loadingType = "loadmore"; |
|
|
if (list == null || list.length == 0) { |
|
|
if (list == null || list.length == 0) { |
|
|
this.loadingType = "nomore"; |
|
|
this.loadingType = "nomore"; |
|
@ -210,11 +236,12 @@ |
|
|
this.getList('refresh', fromLocationCode, '') |
|
|
this.getList('refresh', fromLocationCode, '') |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
openJobDetail(item,scanMessage = '') { |
|
|
openJobDetail(item, scanMessage) { |
|
|
uni.navigateTo({ |
|
|
uni.navigateTo({ |
|
|
url: './repleinshDetail?id=' + item.masterId + '&status=' + item.status+'&scanMessage=' + scanMessage +'&title='+this.title |
|
|
url: './repleinshDetail?id=' + item.masterId + '&status=' + item.status + '&scanMessage=' + |
|
|
|
|
|
scanMessage + '&title=' + this.title |
|
|
}); |
|
|
}); |
|
|
this.scanMessage="" |
|
|
this.scanMessage = "" |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
showItemList(itemList) { |
|
|
showItemList(itemList) { |
|
@ -235,7 +262,7 @@ |
|
|
this.cancleJob(dataContent.masterId); |
|
|
this.cancleJob(dataContent.masterId); |
|
|
} |
|
|
} |
|
|
}); |
|
|
}); |
|
|
}else if (e.content.text == "关闭") { |
|
|
} else if (e.content.text == "关闭") { |
|
|
this.$refs.comMessage.showQuestionMessage("确定要关闭当前任务?", |
|
|
this.$refs.comMessage.showQuestionMessage("确定要关闭当前任务?", |
|
|
res => { |
|
|
res => { |
|
|
if (res) { |
|
|
if (res) { |
|
@ -251,12 +278,12 @@ |
|
|
|
|
|
|
|
|
cancleJob(id) { |
|
|
cancleJob(id) { |
|
|
cancleTakeRepleinshJob(id).then(res => { |
|
|
cancleTakeRepleinshJob(id).then(res => { |
|
|
if(res.data){ |
|
|
if (res.data) { |
|
|
this.getList("refresh") |
|
|
this.getList("refresh") |
|
|
uni.showToast({ |
|
|
uni.showToast({ |
|
|
title:"放弃任务成功" |
|
|
title: "放弃任务成功" |
|
|
}) |
|
|
}) |
|
|
}else { |
|
|
} else { |
|
|
this.showMessage("放弃任务失败") |
|
|
this.showMessage("放弃任务失败") |
|
|
} |
|
|
} |
|
|
}).catch(error => { |
|
|
}).catch(error => { |
|
@ -271,12 +298,12 @@ |
|
|
|
|
|
|
|
|
closeTakeRepleinshJob(id).then(res => { |
|
|
closeTakeRepleinshJob(id).then(res => { |
|
|
uni.hideLoading() |
|
|
uni.hideLoading() |
|
|
if(res.data){ |
|
|
if (res.data) { |
|
|
this.getList("refresh") |
|
|
this.getList("refresh") |
|
|
uni.showToast({ |
|
|
uni.showToast({ |
|
|
title:"关闭任务成功" |
|
|
title: "关闭任务成功" |
|
|
}) |
|
|
}) |
|
|
}else { |
|
|
} else { |
|
|
this.showMessage("关闭任务失败") |
|
|
this.showMessage("关闭任务失败") |
|
|
} |
|
|
} |
|
|
}).catch(error => { |
|
|
}).catch(error => { |
|
@ -350,25 +377,31 @@ |
|
|
}); |
|
|
}); |
|
|
}, |
|
|
}, |
|
|
openScanPopup() { |
|
|
openScanPopup() { |
|
|
this.$refs.scanPopup.openScanPopup(); |
|
|
if (this.businessType == null) { |
|
|
|
|
|
this.getBusinessTypeFunc() |
|
|
|
|
|
} else { |
|
|
|
|
|
this.$refs.scanPopup.openScanPopup(this.businessType); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
}, |
|
|
}, |
|
|
selectItem(item) { |
|
|
selectItem(item) { |
|
|
this.$refs.scanPopup.closeScanPopup(); |
|
|
this.$refs.scanPopup.closeScanPopup(); |
|
|
this.openJobDetail(item,this.scanMessage); |
|
|
this.openJobDetail(item, this.scanMessage); |
|
|
}, |
|
|
}, |
|
|
getScanResult(result) { |
|
|
getScanResult(result) { |
|
|
this.scanMessage="" |
|
|
let balance = result.balance; |
|
|
if(!result.label.batch){ |
|
|
if (balance != null) { |
|
|
|
|
|
this.scanMessage = "" |
|
|
|
|
|
if (!result.label.batch) { |
|
|
this.showMessage("批次为空") |
|
|
this.showMessage("批次为空") |
|
|
return; |
|
|
return; |
|
|
} |
|
|
} |
|
|
if(!result.label.itemCode){ |
|
|
if (!result.label.itemCode) { |
|
|
this.showMessage("物料号为空") |
|
|
this.showMessage("物料号为空") |
|
|
return; |
|
|
return; |
|
|
} |
|
|
} |
|
|
try { |
|
|
try { |
|
|
var filters = [ |
|
|
var filters = [{ |
|
|
{ |
|
|
|
|
|
column: "status", |
|
|
column: "status", |
|
|
action: "in", |
|
|
action: "in", |
|
|
value: '1,2' |
|
|
value: '1,2' |
|
@ -387,6 +420,11 @@ |
|
|
column: "accept_user_id", |
|
|
column: "accept_user_id", |
|
|
action: "==", |
|
|
action: "==", |
|
|
value: this.$store.state.user.id |
|
|
value: this.$store.state.user.id |
|
|
|
|
|
}, |
|
|
|
|
|
{ |
|
|
|
|
|
column: "fromLocationCode", |
|
|
|
|
|
action: "==", |
|
|
|
|
|
value: balance.locationCode |
|
|
} |
|
|
} |
|
|
] |
|
|
] |
|
|
getRepleinshJobList({ |
|
|
getRepleinshJobList({ |
|
@ -396,7 +434,7 @@ |
|
|
sort: 'createTime', |
|
|
sort: 'createTime', |
|
|
by: 'asc' |
|
|
by: 'asc' |
|
|
}).then(res => { |
|
|
}).then(res => { |
|
|
this.scanMessage =result.scanMessage |
|
|
this.scanMessage = result.scanMessage |
|
|
let resultList = res.data.list; |
|
|
let resultList = res.data.list; |
|
|
if (resultList.length > 0) { |
|
|
if (resultList.length > 0) { |
|
|
resultList.forEach(item => { |
|
|
resultList.forEach(item => { |
|
@ -404,24 +442,30 @@ |
|
|
item.selected = false |
|
|
item.selected = false |
|
|
}) |
|
|
}) |
|
|
let list = [] |
|
|
let list = [] |
|
|
resultList.forEach(item=>{ |
|
|
resultList.forEach(item => { |
|
|
if(!list.find(subItem=>subItem.title==item.title)){ |
|
|
if (!list.find(subItem => subItem.title == item.title)) { |
|
|
list.push(item) |
|
|
list.push(item) |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
if(list.length >0){ |
|
|
if (list.length > 0) { |
|
|
this.selectItem(list[0]) |
|
|
this.selectItem(list[0]) |
|
|
} |
|
|
} |
|
|
} else { |
|
|
} else { |
|
|
this.showMessage("物料号["+result.label.itemCode+"]批次["+result.label.batch+']未查找到任务<br>'+"扫描["+result.scanMessage+"]") |
|
|
this.showMessage("物料号[" + result.label.itemCode + "]批次[" + result.label.batch + |
|
|
|
|
|
']未查找到任务<br>' + "扫描[" + result.scanMessage + "]") |
|
|
} |
|
|
} |
|
|
}).catch(error => { |
|
|
}).catch(error => { |
|
|
this.showMessage(error+"<br>扫描["+result.scanMessage+"]") |
|
|
this.showMessage(error + "<br>扫描[" + result.scanMessage + "]") |
|
|
}) |
|
|
}) |
|
|
|
|
|
|
|
|
} catch (e) { |
|
|
} catch (e) { |
|
|
this.showMessage(e.message) |
|
|
this.showMessage(e.message) |
|
|
} |
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
// else |
|
|
|
|
|
// { |
|
|
|
|
|
// this.showMessage(error + "<br>扫描[" + result.scanMessage + "]") |
|
|
|
|
|
// } |
|
|
}, |
|
|
}, |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|