Browse Source

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

hella_online_20240829
lijuncheng 2 months ago
parent
commit
f4979f1562
  1. 8
      src/pages/issue/coms/comScanIssuePack.vue
  2. 14
      src/pages/issue/job/issueJob.vue
  3. 81
      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) {
if(!result.package){
this.showErrorMessage('扫描数据错误['+result.label.code+"]",
res => {
this.getfocus();
}
)
return;
}
if (this.toLocation && result.package.packUnit) {
let item = this.toLocation.Items.find(r => r.itemCode == result.package.itemCode);
if (result.package.packUnit !== item.packUnit) {

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

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

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

@ -21,6 +21,8 @@
<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>
<comMessage ref="comMessage"></comMessage>
</view>
</template>
@ -48,7 +50,9 @@
import comRepleinshJobCard from '@/pages/repleinsh/coms/comRepleinshJobCard.vue'
import repleinshJobListPopup from '@/pages/repleinsh/coms/repleinshJobListPopup.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 {
name: 'repleinsh',
components: {
@ -57,6 +61,8 @@
comRepleinshJobCard,
repleinshJobListPopup,
repleinshInfoPopup,
winScanPackJob,
winScanButton,
},
data() {
return {
@ -195,9 +201,10 @@
this.getList('refresh', fromLocationCode, '')
},
openJobDetail(item) {
openJobDetail(item,scanMessage = '') {
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>

Loading…
Cancel
Save