|
|
@ -25,7 +25,9 @@ import { getRepleinshJobList, cancleTakeRepleinshJob, closeTakeRepleinshJob } fr |
|
|
|
import { goHome, updateTitle } from '@/common/basic.js' |
|
|
|
|
|
|
|
import { getDetailOption, getDetailGiveupOption, getDetailCloseOption } from '@/common/array.js' |
|
|
|
|
|
|
|
import { |
|
|
|
getBusinessType |
|
|
|
} from '@/common/record.js'; |
|
|
|
import comEmptyView from '@/mycomponents/common/comEmptyView.vue' |
|
|
|
import jobFilter from '@/mycomponents/job/jobFilter.vue' |
|
|
|
|
|
|
@ -59,7 +61,11 @@ const filter = ref() |
|
|
|
const comMessageRef = ref() |
|
|
|
const jobInfoPopupRef = ref() |
|
|
|
const jobListPopupRef = ref() |
|
|
|
|
|
|
|
const businessTypeCode = ref('Repleinment') |
|
|
|
const businessType = ref(null) |
|
|
|
const scanBalance = ref({}) |
|
|
|
const outInventoryStatus = ref("") |
|
|
|
const inInventoryStatus = ref("") |
|
|
|
onShow(() => { |
|
|
|
nextTick(() => { |
|
|
|
getList('refresh') |
|
|
@ -67,6 +73,7 @@ onShow(() => { |
|
|
|
}) |
|
|
|
onLoad((option) => { |
|
|
|
title.value = option.title |
|
|
|
getBusinessTypeFunc() |
|
|
|
}) |
|
|
|
onReady(() => { |
|
|
|
detailOptions.value = getDetailOption() |
|
|
@ -310,80 +317,112 @@ const showMessage = (message) => { |
|
|
|
}) |
|
|
|
} |
|
|
|
const openScanPopup = () => { |
|
|
|
scanPopup.value.openScanPopup() |
|
|
|
if (businessType.value == null) { |
|
|
|
getBusinessTypeFunc() |
|
|
|
} else { |
|
|
|
scanPopup.value.openScanPopup(businessType.value) |
|
|
|
} |
|
|
|
} |
|
|
|
const selectItem = (item) => { |
|
|
|
scanPopup.value.closeScanPopup() |
|
|
|
openJobDetail(item, scanMessage.value) |
|
|
|
} |
|
|
|
const getScanResult = (result) => { |
|
|
|
scanMessage.value = '' |
|
|
|
if (!result.label.batch) { |
|
|
|
showMessage('批次为空') |
|
|
|
return |
|
|
|
} |
|
|
|
if (!result.label.itemCode) { |
|
|
|
showMessage('物料号为空') |
|
|
|
return |
|
|
|
} |
|
|
|
try { |
|
|
|
const filters = [ |
|
|
|
{ |
|
|
|
column: 'status', |
|
|
|
action: 'in', |
|
|
|
value: '1,2' |
|
|
|
}, |
|
|
|
{ |
|
|
|
column: 'batch', |
|
|
|
action: '==', |
|
|
|
value: result.label.batch |
|
|
|
}, |
|
|
|
{ |
|
|
|
column: 'itemCode', |
|
|
|
action: '==', |
|
|
|
value: result.label.itemCode |
|
|
|
}, |
|
|
|
{ |
|
|
|
column: 'accept_user_id', |
|
|
|
action: '==', |
|
|
|
value: store.id |
|
|
|
} |
|
|
|
] |
|
|
|
getRepleinshJobList({ |
|
|
|
filters, |
|
|
|
pageNo: 1, |
|
|
|
pageSize: 1000, |
|
|
|
sort: 'createTime', |
|
|
|
by: 'asc' |
|
|
|
}) |
|
|
|
.then((res) => { |
|
|
|
scanMessage.value = result.scanMessage |
|
|
|
const resultList = res.data.list |
|
|
|
if (resultList.length > 0) { |
|
|
|
resultList.forEach((item) => { |
|
|
|
item.title = item.number |
|
|
|
item.selected = false |
|
|
|
}) |
|
|
|
const list = [] |
|
|
|
resultList.forEach((item) => { |
|
|
|
if (!list.find((subItem) => subItem.title == item.title)) { |
|
|
|
list.push(item) |
|
|
|
} |
|
|
|
}) |
|
|
|
if (list.length > 0) { |
|
|
|
selectItem(list[0]) |
|
|
|
} |
|
|
|
} else { |
|
|
|
showMessage(`物料号[${result.label.itemCode}]批次[${result.label.batch}]未查找到任务<br>` + `扫描[${result.scanMessage}]`) |
|
|
|
let balance = result.balance; |
|
|
|
if (balance != null) { |
|
|
|
scanMessage.value = "" |
|
|
|
if (!result.label.batch) { |
|
|
|
this.showMessage("批次为空") |
|
|
|
return; |
|
|
|
} |
|
|
|
if (!result.label.itemCode) { |
|
|
|
this.showMessage("物料号为空") |
|
|
|
return; |
|
|
|
} |
|
|
|
if (!result.label.batch) { |
|
|
|
showMessage('批次为空') |
|
|
|
return |
|
|
|
} |
|
|
|
if (!result.label.itemCode) { |
|
|
|
showMessage('物料号为空') |
|
|
|
return |
|
|
|
} |
|
|
|
try { |
|
|
|
const filters = [ |
|
|
|
{ |
|
|
|
column: 'status', |
|
|
|
action: 'in', |
|
|
|
value: '1,2' |
|
|
|
}, |
|
|
|
{ |
|
|
|
column: 'batch', |
|
|
|
action: '==', |
|
|
|
value: result.label.batch |
|
|
|
}, |
|
|
|
{ |
|
|
|
column: 'itemCode', |
|
|
|
action: '==', |
|
|
|
value: result.label.itemCode |
|
|
|
}, |
|
|
|
{ |
|
|
|
column: 'accept_user_id', |
|
|
|
action: '==', |
|
|
|
value: store.id |
|
|
|
}, |
|
|
|
{ |
|
|
|
column: "fromLocationCode", |
|
|
|
action: "==", |
|
|
|
value: balance.locationCode |
|
|
|
} |
|
|
|
] |
|
|
|
getRepleinshJobList({ |
|
|
|
filters, |
|
|
|
pageNo: 1, |
|
|
|
pageSize: 1000, |
|
|
|
sort: 'createTime', |
|
|
|
by: 'asc' |
|
|
|
}) |
|
|
|
.catch((error) => { |
|
|
|
showMessage(`${error}<br>扫描[${result.scanMessage}]`) |
|
|
|
}) |
|
|
|
} catch (e) { |
|
|
|
showMessage(e.message) |
|
|
|
.then((res) => { |
|
|
|
scanMessage.value = result.scanMessage |
|
|
|
const resultList = res.data.list |
|
|
|
if (resultList.length > 0) { |
|
|
|
resultList.forEach((item) => { |
|
|
|
item.title = item.number |
|
|
|
item.selected = false |
|
|
|
}) |
|
|
|
const list = [] |
|
|
|
resultList.forEach((item) => { |
|
|
|
if (!list.find((subItem) => subItem.title == item.title)) { |
|
|
|
list.push(item) |
|
|
|
} |
|
|
|
}) |
|
|
|
if (list.length > 0) { |
|
|
|
selectItem(list[0]) |
|
|
|
} |
|
|
|
} else { |
|
|
|
showMessage(`物料号[${result.label.itemCode}]批次[${result.label.batch}]未查找到任务<br>` + `扫描[${result.scanMessage}]`) |
|
|
|
} |
|
|
|
}) |
|
|
|
.catch((error) => { |
|
|
|
showMessage(`${error}<br>扫描[${result.scanMessage}]`) |
|
|
|
}) |
|
|
|
} catch (e) { |
|
|
|
showMessage(e.message) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
const 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) |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|
</script> |
|
|
|
|
|
|
|
<style scoped lang="scss"></style> |
|
|
|