Browse Source

发料,补料按物料号查找最先的任务

hella_online_20240829
lijuncheng 4 months ago
parent
commit
f4979f1562
  1. 8
      src/pages/issue/coms/comScanIssuePack.vue
  2. 14
      src/pages/issue/job/issueJob.vue
  3. 79
      src/pages/repleinsh/job/repleinshJob.vue

8
src/pages/issue/coms/comScanIssuePack.vue

@ -443,6 +443,14 @@ import { getDirectoryItemArray } from '../../../common/directory.js';
onScan(result) { onScan(result) {
if(!result.package){
this.showErrorMessage('扫描数据错误['+result.label.code+"]",
res => {
this.getfocus();
}
)
return;
}
if (this.toLocation && result.package.packUnit) { if (this.toLocation && result.package.packUnit) {
let item = this.toLocation.Items.find(r => r.itemCode == result.package.itemCode); let item = this.toLocation.Items.find(r => r.itemCode == result.package.itemCode);
if (result.package.packUnit !== item.packUnit) { if (result.package.packUnit !== item.packUnit) {

14
src/pages/issue/job/issueJob.vue

@ -369,6 +369,14 @@
this.$refs.scanPopup.openScanPopup(); this.$refs.scanPopup.openScanPopup();
}, },
getScanResult(result) { getScanResult(result) {
if(!result.label.batch){
this.showMessage("批次为空")
return;
}
if(!result.label.itemCode){
this.showMessage("物料号为空")
return;
}
try { try {
var filters = [ var filters = [
{ {
@ -390,7 +398,7 @@
getIssueJobList({ getIssueJobList({
filters: filters, filters: filters,
pageNo: 1, pageNo: 1,
pageSize: 100, pageSize: 1000,
sort: 'createTime', sort: 'createTime',
by: 'asc' by: 'asc'
}).then(res => { }).then(res => {
@ -407,9 +415,7 @@
list.push(item) list.push(item)
} }
}) })
if (list.length > 1) { if(list.length >0){
this.$refs.jobList.openList(list)
} else {
this.selectItem(list[0]) this.selectItem(list[0])
} }
} else { } else {

79
src/pages/repleinsh/job/repleinshJob.vue

@ -21,6 +21,8 @@
<uni-load-more :status="loadingType" v-if="jobList.length>0" /> <uni-load-more :status="loadingType" v-if="jobList.length>0" />
</view> </view>
<win-scan-button @goScan='openScanPopup' v-if="jobList.length>0"></win-scan-button>
<winScanPackJob ref="scanPopup" @getResult='getScanResult' ></winScanPackJob>
<comMessage ref="comMessage"></comMessage> <comMessage ref="comMessage"></comMessage>
</view> </view>
</template> </template>
@ -48,6 +50,8 @@
import comRepleinshJobCard from '@/pages/repleinsh/coms/comRepleinshJobCard.vue' import comRepleinshJobCard from '@/pages/repleinsh/coms/comRepleinshJobCard.vue'
import repleinshJobListPopup from '@/pages/repleinsh/coms/repleinshJobListPopup.vue' import repleinshJobListPopup from '@/pages/repleinsh/coms/repleinshJobListPopup.vue'
import repleinshInfoPopup from '@/pages/repleinsh/coms/repleinshInfoPopup.vue' import repleinshInfoPopup from '@/pages/repleinsh/coms/repleinshInfoPopup.vue'
import winScanButton from '@/mycomponents/scan/winScanButton.vue'
import winScanPackJob from "@/mycomponents/scan/winScanPackJob.vue"
export default { export default {
name: 'repleinsh', name: 'repleinsh',
@ -57,6 +61,8 @@
comRepleinshJobCard, comRepleinshJobCard,
repleinshJobListPopup, repleinshJobListPopup,
repleinshInfoPopup, repleinshInfoPopup,
winScanPackJob,
winScanButton,
}, },
data() { data() {
return { return {
@ -195,9 +201,10 @@
this.getList('refresh', fromLocationCode, '') this.getList('refresh', fromLocationCode, '')
}, },
openJobDetail(item) { openJobDetail(item,scanMessage = '') {
uni.navigateTo({ uni.navigateTo({
url: './repleinshDetail?id=' + item.masterId + '&status=' + item.status url: './repleinshDetail?id=' + item.masterId + '&status=' + item.status+'&scanMessage=' +
scanMessage
}); });
}, },
@ -300,6 +307,74 @@
} }
}); });
}, },
openScanPopup() {
this.$refs.scanPopup.openScanPopup();
},
selectItem(item) {
this.$refs.scanPopup.closeScanPopup();
this.openJobDetail(item,this.scanMessage);
},
getScanResult(result) {
if(!result.label.batch){
this.showMessage("批次为空")
return;
}
if(!result.label.itemCode){
this.showMessage("物料号为空")
return;
}
try {
var filters = [
{
column: "status",
action: "in",
value: '1,2'
},
{
column: "batch",
action: "==",
value: result.label.batch
},
{
column: "itemCode",
action: "==",
value: result.label.itemCode
}
]
getRepleinshJobList({
filters: filters,
pageNo: 1,
pageSize: 1000,
sort: 'createTime',
by: 'asc'
}).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 >0){
this.selectItem(list[0])
}
} else {
this.showMessage("物料号["+result.label.itemCode+"]批次["+result.label.batch+']未查找到任务')
}
}).catch(error => {
this.showMessage(error)
})
} catch (e) {
this.showMessage(e.message)
}
},
} }
} }
</script> </script>

Loading…
Cancel
Save