Browse Source

任务列表添加扫描功能

hella_online_20240829
yufei0306 7 months ago
parent
commit
ad1f917aae
  1. 68
      src/mycomponents/jobList/jobList.vue
  2. 128
      src/mycomponents/scan/winScanPackJob.vue
  3. 11
      src/pages/productPutaway/job/productPutawayDetail.vue
  4. 75
      src/pages/productPutaway/job/productPutawayJob.vue
  5. 11
      src/pages/productReceipt/job/fgProductReceiptDetail.vue
  6. 10
      src/pages/productReceipt/job/productReceiptDetail.vue
  7. 93
      src/pages/productReceipt/job/productReceiptJob.vue
  8. 10
      src/pages/purchaseReceipt/job/receiptDetail.vue
  9. 72
      src/pages/purchaseReceipt/job/receiptJob.vue
  10. 5
      src/pages/putaway/job/putawayDetail.vue
  11. 71
      src/pages/putaway/job/putawayJob.vue

68
src/mycomponents/jobList/jobList.vue

@ -0,0 +1,68 @@
<template>
<view class="wyf">
<uni-popup ref="listPopup" type="dialog">
<view class="container">
<uni-list class="list">
<uni-list-item v-for="(item,index) in list" :title="item.title"
thumb-size="lg" >
<template v-slot:footer>
<!-- <image class="slot-image" src="@/static/logo.png" mode="widthFix" @click="selectItem(item,index)"></image -->
<text class="go" @click="selectItem(item,index)">Go</text>
</template>
</uni-list-item>
</uni-list>
</view>
</uni-popup>
</view>
</template>
<script>
import { onShow } from '@dcloudio/uni-app';
export default {
emits: ["selectItem"],
components: {
},
data() {
return {
list: []
// [{
// title:'',
// selected:false
// }],
}
},
props: {
},
methods:{
openList(list){
this.list = list
this.$refs.listPopup.open('center')
},
selectItem(item,index){
this.$emit("selectItem", item);
}
}
}
</script>
<style lang="scss" scoped>
.container{
display: flex;
justify-content: center;
align-items: center;
.list{
width: 80%;
border-radius: 10px !important;
overflow: hidden;
.slot-image{
width: 40rpx;
}
.go{
color: rgb(60, 156, 255);
}
}
}
</style>

128
src/mycomponents/scan/winScanPackJob.vue

@ -0,0 +1,128 @@
<template>
<uni-popup ref="popup" @change="change" @maskClick="closeScanPopup()">
<view class="popup_box">
<view class="pop_title uni-flex space-between">
<view class="" style="font-size: 35rpx;">
扫描{{title}}
</view>
<view class="">
<image class="fr icons_scan_close" src="/static/icons/icons_scan_close.svg"
@click="closeScanPopup()"></image>
</view>
</view>
<view class="">
<view class="">
<win-com-scan ref="comscan" :placeholder="title" @getResult="getScanResult"
:isShowHistory="isShowHistory" :clearResult="true" :headerType="headerType"></win-com-scan>
</view>
</view>
</view>
</uni-popup>
<comMessage ref="comMessage"></comMessage>
</template>
<script>
import winComScan from '@/mycomponents/scan/winComScan.vue'
import {
getBalanceByManagementPrecision,
} from '@/common/balance.js';
import {
getBasicLocationByCode,
getPutawayJobList
} from '@/api/request2.js';
import {
getListLocationTypeDesc,
checkDirectoryItemExist,
getDirectoryItemArray,
getLocationTypeName,
getInventoryStatusDesc
} from '@/common/directory.js';
export default {
name: 'winScanPack',
emits: ["getResult", "close", "getCountScanResult"],
components: {
winComScan
},
props: {
title: {
type: String,
default: '箱标签'
},
isShowHistory: {
type: Boolean,
default: true
},
headerType: {
type: String,
default: "HPQ,HMQ"
},
},
data() {
return {
show: false,
}
},
created() {
},
methods: {
//
openScanPopup(){
this.$refs.popup.open('bottom')
},
//
closeScanPopup(content) {
this.$refs.popup.close();
this.$emit("close", '');
},
//
getScanResult(result) {
this.$emit("getResult", result);
},
packGetFocus() {
if (this.$refs.comscan != undefined) {
this.$refs.comscan.getfocus();
}
},
packLoseFocus() {
if (this.$refs.comscan != undefined) {
this.$refs.comscan.losefocus();
}
},
showMessage(message, callback) {
setTimeout(r => {
this.packLoseFocus();
this.$refs.comMessage.showMessage(message, callback);
})
},
showErrorMessage(message, callback) {
setTimeout(r => {
this.packLoseFocus();
this.$refs.comMessage.showErrorMessage(message, callback)
})
},
change(e) {
this.show = e.show
},
selectItem(item,index){
}
}
}
</script>
<style lang="scss">
.scroll-view {
overflow-y: scroll;
height: auto;
max-height: 300rpx;
}
</style>

11
src/pages/productPutaway/job/productPutawayDetail.vue

@ -113,12 +113,14 @@
jobToLocationCode: "",
type: "",
isCheckLocation: false,
switchCode: ""
switchCode: "",
scanedPackingNumber: ''
};
},
onLoad(option) {
this.id = option.id;
this.type = option.type;
this.scanedPackingNumber = option.scaned || '';
if (this.type == 'predict') {
this.switchCode = "SemiPutawayLocationCodeValidate"
updateTitle("预生产上架任务");
@ -197,7 +199,12 @@
that.jobToLocationCode = that.subList[0].toLocationCode
that.toLocationAreaTypeList = getLocationTypeArray(that.jobContent.toAreaTypes)
that.detailSource = getDataSource(that.subList)
that.detailSource.forEach(r => {
r.subList.forEach(s => {
if (this.scanedPackingNumber && this.scanedPackingNumber == s
.packingNumber) s.scaned = true
})
})
that.isCheckLocation = getSwitchInfoByCode(that.switchCode)
if (that.isCheckLocation) {
that.toLocationCode = ""

75
src/pages/productPutaway/job/productPutawayJob.vue

@ -21,6 +21,10 @@
<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' :allowNullBalance="true">
</winScanPackJob>
<jobList ref="jobList" @selectItem="selectItem"></jobList>
<comMessage ref="comMessage"></comMessage>
</view>
</template>
@ -47,14 +51,20 @@
import comProductJobCard from '@/pages/productPutaway/coms/comProductJobCard.vue'
import jobListPopup from '@/pages/productPutaway/coms/jobListPopup.vue'
import jobInfoPopup from '@/pages/productPutaway/coms/jobInfoPopup.vue'
import jobList from '@/mycomponents/jobList/jobList.vue'
import winScanButton from '@/mycomponents/scan/winScanButton.vue'
import winScanPackJob from "@/mycomponents/scan/winScanPackJob.vue"
export default {
components: {
comEmptyView,
jobFilter,
comProductJobCard,
jobListPopup,
jobInfoPopup
jobInfoPopup,
winScanButton,
winScanPackJob,
jobList
},
data() {
return {
@ -200,10 +210,10 @@
})
},
openJobDetail(item) {
openJobDetail(item,packingNumber='') {
uni.navigateTo({
url: './productPutawayDetail?id=' + item.masterId + '&status=' + item.status + '&type=' + item
.type
.type + '&scaned=' + packingNumber
});
},
@ -304,6 +314,63 @@
}
});
},
openScanPopup() {
this.$refs.scanPopup.openScanPopup();
},
selectItem(item) {
this.$refs.scanPopup.closeScanPopup();
this.openJobDetail(item, item.packingNumber);
},
getScanResult(result) {
try {
var filters = [{
column: "packingNumber",
action: "==",
value: result.label.packingNumber
},
{
column: "batch",
action: "==",
value: result.label.batch
},
{
column: "qty",
action: "==",
value: result.label.qty
}, {
column: "itemCode",
action: "==",
value: result.label.itemCode
}, {
column: "fromLocationCode",
action: "==",
value: result.label.fromLocationCode
}
]
getProductPutawayJobList({
filters: filters,
pageNo: 1,
pageSize: 100,
}).then(res => {
var list = res.data.list;
list.forEach(item => {
item.title = item.number;
item.selected = false
})
console.log('list', list)
if (list.length > 1) {
this.$refs.jobList.openList(list)
} else {
this.selectItem(list[0])
}
}).catch(error => {
this.showMessage(error)
})
} catch (e) {
this.showMessage(e.message)
}
},
}
}
</script>

11
src/pages/productReceipt/job/fgProductReceiptDetail.vue

@ -135,11 +135,13 @@
jobStatus: "",
jobToLocationCode: "",
fgList: [],
itemCode: ""
itemCode: "",
scanedPackingNumber: ''
};
},
onLoad(option) {
this.id = option.id;
this.scanedPackingNumber = option.scaned || '';
if (this.id != undefined) {
//
if (option.status == "1") {
@ -216,6 +218,13 @@
that.jobToLocationCode = that.subList[0].toLocationCode
that.toLocationTypeList = getDirectoryItemArray(that.jobContent.toLocationTypes)
that.detailSource = getDataSource(that.subList)
that.detailSource.forEach(r => {
r.subList.forEach(s => {
if (this.scanedPackingNumber && this.scanedPackingNumber == s
.packingNumber) s.scaned = true
})
})
} else {
that.showMessage('列表数据为0');

10
src/pages/productReceipt/job/productReceiptDetail.vue

@ -133,12 +133,14 @@
toLocationAreaTypeList: [],
managementList: [],
jobStatus: "",
jobToLocationCode: ""
jobToLocationCode: "",
scanedPackingNumber: ''
};
},
onLoad(option) {
this.id = option.id;
this.scanedPackingNumber = option.scaned || '';
if (this.id != undefined) {
//
if (option.status == "1") {
@ -214,6 +216,12 @@
that.jobToLocationCode = that.subList[0].toLocationCode
that.toLocationAreaTypeList = getDirectoryItemArray(that.jobContent.toAreaTypes)
that.detailSource = getDataSource(that.subList)
that.detailSource.forEach(r => {
r.subList.forEach(s => {
if (this.scanedPackingNumber && this.scanedPackingNumber == s
.packingNumber) s.scaned = true
})
})
} else {
that.showMessage('列表数据为0');
}

93
src/pages/productReceipt/job/productReceiptJob.vue

@ -20,6 +20,9 @@
<job-info-popup ref='jobInfoPopup'></job-info-popup>
<uni-load-more :status="loadingType" v-if="jobList.length>0" />
<win-scan-button @goScan='openScanPopup' v-if="jobList.length>0"></win-scan-button>
<winScanPackJob ref="scanPopup" @getResult='getScanResult' :allowNullBalance="true"></winScanPackJob>
<jobList ref="jobList" @selectItem="selectItem"></jobList>
<comMessage ref="comMessage"></comMessage>
</view>
</view>
@ -47,6 +50,9 @@
import comProductJobCard from '@/pages/productReceipt/coms/comProductJobCard.vue'
import jobListPopup from '@/pages/productReceipt/coms/jobListPopup.vue'
import jobInfoPopup from '@/pages/productReceipt/coms/jobInfoPopup.vue'
import jobList from '@/mycomponents/jobList/jobList.vue'
import winScanButton from '@/mycomponents/scan/winScanButton.vue'
import winScanPackJob from "@/mycomponents/scan/winScanPackJob.vue"
export default {
name: 'receipt',
@ -55,7 +61,10 @@
jobFilter,
comProductJobCard,
jobListPopup,
jobInfoPopup
jobInfoPopup,
winScanButton,
winScanPackJob,
jobList
},
data() {
return {
@ -121,7 +130,7 @@
},
methods: {
refresh(){
refresh() {
this.getList('refresh');
},
getList(type) {
@ -172,9 +181,9 @@
this.totalCount = res.data.total
if (this.type == 'predict') {
updateTitle("预生产收货任务(" + this.totalCount + ")");
} else if(this.type == 'assemble'){
} else if (this.type == 'assemble') {
updateTitle("装配收货任务(" + this.totalCount + ")");
}else {
} else {
updateTitle("报废收货任务(" + this.totalCount + ")");
}
this.loadingType = "loadmore";
@ -192,9 +201,9 @@
}
if (this.type == 'predict') {
updateTitle("预生产收货任务(" + this.totalCount + ")");
} else if(this.type == 'assemble'){
} else if (this.type == 'assemble') {
updateTitle("装配收货任务(" + this.totalCount + ")");
}else {
} else {
updateTitle("报废收货任务(" + this.totalCount + ")");
}
this.loadingType = "";
@ -203,18 +212,18 @@
})
},
openJobDetail(item) {
openJobDetail(item,packingNumber='') {
if (this.type == 'predict') {
uni.navigateTo({
url: './productReceiptDetail?id=' + item.masterId + '&status=' + item.status
url: './productReceiptDetail?id=' + item.masterId + '&status=' + item.status + '&scaned=' + packingNumber
});
} else if(this.type == 'assemble'){
} else if (this.type == 'assemble') {
uni.navigateTo({
url: './fgProductReceiptDetail?id=' + item.masterId + '&status=' + item.status
url: './fgProductReceiptDetail?id=' + item.masterId + '&status=' + item.status + '&scaned=' + packingNumber
});
}else {
} else {
uni.navigateTo({
url: './scrapReceiptDetail?id=' + item.masterId + '&status=' + item.status
url: './scrapReceiptDetail?id=' + item.masterId + '&status=' + item.status + '&scaned=' + packingNumber
});
}
},
@ -322,13 +331,71 @@
toHome() {
goHome()
},
onReach(){
onReach() {
if (this.loadingType == 'loading' || this.loadingType == 'nomore') {
return;
}
this.getList("more");
},
openScanPopup() {
this.$refs.scanPopup.openScanPopup();
},
selectItem(item) {
this.$refs.scanPopup.closeScanPopup();
this.openJobDetail(item,item.packingNumber);
},
getScanResult(result) {
try {
var filters = [{
column: "packingNumber",
action: "==",
value: result.label.packingNumber
},
{
column: "batch",
action: "==",
value: result.label.batch
},
{
column: "qty",
action: "==",
value: result.label.qty
}, {
column: "itemCode",
action: "==",
value: result.label.itemCode
}, {
column: "fromLocationCode",
action: "==",
value: result.label.fromLocationCode
}
]
getProductReceiptJobList({
filters: filters,
pageNo: 1,
pageSize: 100,
}).then(res => {
var list = res.data.list;
list.forEach(item => {
item.title = item.number;
item.selected = false
})
console.log('list', list.length)
if (list.length > 1) {
this.$refs.jobList.openList(list)
} else {
this.selectItem(list[0])
}
}).catch(error => {
this.showMessage(error)
})
} catch (e) {
this.showMessage(e.message)
}
},
}
}
</script>

10
src/pages/purchaseReceipt/job/receiptDetail.vue

@ -125,13 +125,15 @@
managementList: [],
jobStatus: "",
isAllReceived: false,
operation: ''
operation: '',
scanedPackingNumber: ''
};
},
onLoad(option) {
this.id = option.id;
this.scanedPackingNumber = option.scaned || '';
this.operation = option.operation;
if (this.id != undefined) {
//
@ -213,6 +215,12 @@
that.jobStatus = res.data.status
that.jobToLocationCode = that.subList[0].toLocationCode
that.detailSource = getTreeDataSource(that.subList)
that.detailSource.forEach(r => {
r.subList.forEach(s => {
if (this.scanedPackingNumber && this.scanedPackingNumber == s
.packingNumber) s.scaned = true
})
})
that.isAllReceived = false;
} else {
that.showMessage('列表数据为0');

72
src/pages/purchaseReceipt/job/receiptJob.vue

@ -19,6 +19,10 @@
<receipt-info-popup ref='jobInfoPopup'></receipt-info-popup>
<receipt-job-list-popup ref="jobListPopup" @selectedItem="selectedItem"></receipt-job-list-popup>
</view>
<win-scan-button @goScan='openScanPopup' v-if="jobList.length>0"></win-scan-button>
<winScanPackJob ref="scanPopup" @getResult='getScanResult' :allowNullBalance="true">
</winScanPackJob>
<jobList ref="jobList" @selectItem="selectItem"></jobList>
<comMessage ref="comMessage"></comMessage>
</view>
</template>
@ -45,6 +49,9 @@
import comReceiptJobCard from '@/pages/purchaseReceipt/coms/comReceiptJobCard.vue'
import receiptJobListPopup from '@/pages/purchaseReceipt/coms/receiptJobListPopup.vue'
import receiptInfoPopup from '@/pages/purchaseReceipt/coms/receiptInfoPopup.vue'
import jobList from '@/mycomponents/jobList/jobList.vue'
import winScanButton from '@/mycomponents/scan/winScanButton.vue'
import winScanPackJob from "@/mycomponents/scan/winScanPackJob.vue"
export default {
name: 'receipt',
@ -54,6 +61,9 @@
comReceiptJobCard,
receiptInfoPopup,
receiptJobListPopup,
winScanButton,
winScanPackJob,
jobList
},
data() {
return {
@ -244,9 +254,10 @@
})
},
openJobDetail(item) {
openJobDetail(item,packingNumber='') {
uni.navigateTo({
url: './receiptDetail?id=' + item.masterId + '&status=' + item.status + '&operation=' + this.operation
url: './receiptDetail?id=' + item.masterId + '&status=' + item.status + '&operation=' + this
.operation + '&scaned=' + packingNumber
});
},
@ -312,6 +323,63 @@
});
},
openScanPopup() {
this.$refs.scanPopup.openScanPopup();
},
selectItem(item) {
this.$refs.scanPopup.closeScanPopup();
this.openJobDetail(item, item.packingNumber);
},
getScanResult(result) {
try {
var filters = [{
column: "packingNumber",
action: "==",
value: result.label.packingNumber
},
{
column: "batch",
action: "==",
value: result.label.batch
},
{
column: "qty",
action: "==",
value: result.label.qty
}, {
column: "itemCode",
action: "==",
value: result.label.itemCode
}, {
column: "fromLocationCode",
action: "==",
value: result.label.fromLocationCode
}
]
getPurchaseReceiptJobList({
filters: filters,
pageNo: 1,
pageSize: 100,
}).then(res => {
var list = res.data.list;
list.forEach(item => {
item.title = item.number;
item.selected = false
})
console.log('list', list)
if (list.length > 1) {
this.$refs.jobList.openList(list)
} else {
this.selectItem(list[0])
}
}).catch(error => {
this.showMessage(error)
})
} catch (e) {
this.showMessage(e.message)
}
},
}
}
</script>

5
src/pages/putaway/job/putawayDetail.vue

@ -107,11 +107,13 @@
toLocationAreaTypeList: [],
jobStatus: "",
jobToLocationCode: "",
isCheckLocation: false
isCheckLocation: false,
scanedPackingNumber : ''
};
},
onLoad(option) {
this.id = option.id;
this.scanedPackingNumber = option.scaned || '';
if (this.id != undefined) {
//
if (option.status == "1") {
@ -188,6 +190,7 @@
that.detailSource.forEach(r => {
r.subList.forEach(s => {
if(this.scanedPackingNumber&&this.scanedPackingNumber==s.packingNumber) s.scaned = true
s.inventoryStatus = s.inspectResult;//
})
})

71
src/pages/putaway/job/putawayJob.vue

@ -22,11 +22,18 @@
<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' :allowNullBalance="true">
</winScanPackJob>
<jobList ref="jobList" @selectItem="selectItem"></jobList>
<comMessage ref="comMessage"></comMessage>
</view>
</template>
<script>
import jobList from '@/mycomponents/jobList/jobList.vue'
import {
getPutawayJobList,
@ -42,12 +49,14 @@
getDetailOption,
getDetailGiveupOption
} from '@/common/array.js';
import winScanButton from '@/mycomponents/scan/winScanButton.vue'
import comEmptyView from '@/mycomponents/common/comEmptyView.vue'
import jobFilter from '@/mycomponents/job/jobFilter.vue'
import comPutawayJobCard from '@/pages/putaway/coms/comPutawayJobCard.vue'
import putawayJobListPopup from '@/pages/putaway/coms/putawayJobListPopup.vue'
import putawayInfoPopup from '@/pages/putaway/coms/putawayInfoPopup.vue'
import winScanPackJob from "@/mycomponents/scan/winScanPackJob.vue"
export default {
name: 'Putaway',
@ -57,6 +66,9 @@
comPutawayJobCard,
putawayJobListPopup,
putawayInfoPopup,
winScanButton,
winScanPackJob,
jobList
},
data() {
return {
@ -281,6 +293,65 @@
}
});
},
openScanPopup() {
this.$refs.scanPopup.openScanPopup();
},
selectItem(item){
this.$refs.scanPopup.closeScanPopup();
uni.navigateTo({
url: './putawayDetail?id=' + item.masterId + '&status=' + item.status+'&scaned=' + item.packingNumber
});
},
getScanResult(result) {
try {
var filters = [{
column: "packingNumber",
action: "==",
value: result.label.packingNumber
},
{
column: "batch",
action: "==",
value: result.label.batch
},
{
column: "qty",
action: "==",
value: result.label.qty
},{
column: "itemCode",
action: "==",
value: result.label.itemCode
},{
column: "fromLocationCode",
action: "==",
value: result.label.fromLocationCode
}]
getPutawayJobList({
filters: filters,
pageNo: 1,
pageSize: 100,
}).then(res => {
console.log('getPutawayJobList',getPutawayJobList)
var list = res.data.list;
list.forEach(item=>{
item.title = item.number;
item.selected = false
})
console.log('list',list)
if(list.length>1){
this.$refs.jobList.openList(list)
}else{
this.selectItem(list[0])
}
}).catch(error => {
this.showMessage(error)
})
} catch (e) {
this.showMessage(e.message)
}
},
}
}
</script>

Loading…
Cancel
Save