Browse Source

修改翻包任务跳转到详情,自动扫描

lijuncheng0816
lijuncheng 4 months ago
parent
commit
64035597b5
  1. 31
      src/mycomponents/scan/winComScanBalanceLocation.vue
  2. 12
      src/pages/package/coms/comScanPackagePack.vue
  3. 130
      src/pages/package/job/overPackageJob.vue
  4. 10
      src/pages/package/job/overPackageJobDetail.vue

31
src/mycomponents/scan/winComScanBalanceLocation.vue

@ -64,6 +64,10 @@
getBasicItemByCode getBasicItemByCode
} from '@/api/request2.js'; } from '@/api/request2.js';
import {
getLabelInfo
} from '@/common/label.js';
import { import {
getListLocationAreaTypeDesc, getListLocationAreaTypeDesc,
checkDirectoryItemExist, checkDirectoryItemExist,
@ -165,6 +169,33 @@
this.fromLocationAreaTypeList = getDirectoryItemArray(jobContent.fromAreaTypes); // this.fromLocationAreaTypeList = getDirectoryItemArray(jobContent.fromAreaTypes); //
}, },
//
openScanPopupForJobSimulate(fromLocationCode, fromLocationList, jobContent, scanMessage) {
this.fromLocationCode = fromLocationCode;
this.fromLocationList = fromLocationList;
if (!fromLocationCode) {
if (this.fromLocationList.length == 0) {
// this.locationGetFocus();
alert('没有来源库位:List')
} else {
this.fromLocationCode = this.fromLocationList[0];
}
}
this.fromInventoryStatuses = getDirectoryItemArray(jobContent.outInventoryStatuses)
this.inventoryStatus = getDirectoryItemArray(jobContent.outInventoryStatuses); //; //
this.fromLocationAreaTypeList = getDirectoryItemArray(jobContent.fromAreaTypes); //
getLabelInfo(scanMessage, this.headerType, callback => {
if (callback.success) {
this.getScanResult(callback);
} else {
this.showErrorMessage(callback.message, res => {})
}
})
},
handleConfirm() { handleConfirm() {
this.$emit('confirm', this.fromLocationCode) this.$emit('confirm', this.fromLocationCode)
}, },

12
src/pages/package/coms/comScanPackagePack.vue

@ -96,6 +96,17 @@ import { getDirectoryItemArray } from '@/common/directory';
} }
}, },
//
openScanPopupForJobSimulate(content, jobcontent, scanMessage) {
this.issueRecord = [];
this.dataContent = content;
this.jobContent = jobcontent;
this.initData();
this.$refs.scanPopup.openScanPopupForJobSimulate(this.fromLocationCode, this.fromLocationList, this.jobContent,
scanMessage);
},
showBalanceSelect(items) { showBalanceSelect(items) {
this.$refs.balanceSelect.openPopup(items); this.$refs.balanceSelect.openPopup(items);
}, },
@ -342,6 +353,7 @@ import { getDirectoryItemArray } from '@/common/directory';
batch.Records.push(record); batch.Records.push(record);
this.calcBatchHandleQty(batch); this.calcBatchHandleQty(batch);
this.packGetFocus(); this.packGetFocus();
this.$emit('refresh');
}, },
swipeClick(e, item, index) { swipeClick(e, item, index) {

130
src/pages/package/job/overPackageJob.vue

@ -19,6 +19,13 @@
<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>
<winComScanBalance ref="scanPopup" @getBalance='getScanResult'
:isCheckLocationBalance="false"
:bussinessCode="businessTypeCode">
</winComScanBalance>
<!-- <winScanPackJob ref="scanPopup" @getResult='getScanResult'></winScanPackJob> -->
<jobList ref="jobList" @selectItem="selectItem"></jobList>
<comMessage ref="comMessage"></comMessage> <comMessage ref="comMessage"></comMessage>
</view> </view>
</template> </template>
@ -32,6 +39,10 @@
goHome, goHome,
updateTitle updateTitle
} from '@/common/basic.js'; } from '@/common/basic.js';
import {
getBusinessType
} from '@/common/record.js';
import { import {
planRefreshTime planRefreshTime
} from '@/common/config.js'; } from '@/common/config.js';
@ -45,6 +56,9 @@
import jobFilter from '@/mycomponents/job/jobFilter.vue' import jobFilter from '@/mycomponents/job/jobFilter.vue'
import comOverPackJobCard from '@/pages/package/coms/comOverPackJobCard.vue' import comOverPackJobCard from '@/pages/package/coms/comOverPackJobCard.vue'
import jobInfoPopup from '@/pages/issue/coms/jobInfoPopup.vue' import jobInfoPopup from '@/pages/issue/coms/jobInfoPopup.vue'
import winScanButton from '@/mycomponents/scan/winScanButton.vue'
import winComScanBalance from '@/mycomponents/scan/winComScanBalance.vue'
import jobList from '@/mycomponents/jobList/jobList.vue'
export default { export default {
name: 'issue', name: 'issue',
@ -52,7 +66,10 @@
comEmptyView, comEmptyView,
jobFilter, jobFilter,
comOverPackJobCard, comOverPackJobCard,
jobInfoPopup jobInfoPopup,
winComScanBalance,
winScanButton,
jobList
}, },
data() { data() {
return { return {
@ -68,7 +85,11 @@
detailOptions: [], detailOptions: [],
detailGiveupOptions: [], detailGiveupOptions: [],
title:'', title:'',
timer:null businessTypeCode: "OverPackage",
businessType: null,
timer:null,
scanMessage:""
}; };
}, },
@ -125,6 +146,16 @@
}, },
methods: { methods: {
getBusinessTypeFunc() {
getBusinessType(this.businessTypeCode, res => {
if (res.success) {
this.businessType = res.businessType;
this.openScanPopup();
} else {
this.showErrorMessage(res.message)
}
});
},
timerRefresh() { timerRefresh() {
this.getList('refresh') this.getList('refresh')
this.stopRefresh(); this.stopRefresh();
@ -225,8 +256,8 @@
}, },
openJobDetail(item) { openJobDetail(item,scanMessage = '') {
this.getJobInfoByNumber(item.number) this.getJobInfoByNumber(item.number,scanMessage)
}, },
showItemList(itemList) { showItemList(itemList) {
@ -327,8 +358,16 @@
} }
}); });
}, },
openScanPopup() {
if (this.businessType == null) {
this.getBusinessTypeFunc()
} else {
this.$refs.scanPopup.openScanPopup(this.businessType);
}
},
getJobInfoByNumber(number){ getJobInfoByNumber(number,scanMessage){
console.log("扫描",scanMessage)
let that = this; let that = this;
uni.showLoading({ uni.showLoading({
title: "加载中....", title: "加载中....",
@ -367,14 +406,93 @@
return; return;
} }
uni.navigateTo({ uni.navigateTo({
url: './overPackageJobDetail?id=' + result.masterId + '&status=' + result.status+'&title='+this.title url: './overPackageJobDetail?id=' + result.masterId + '&status=' + result.status+'&title='+this.title+'&scanMessage=' +
scanMessage
}); });
this.scanMessage=""
} }
}).catch(error => { }).catch(error => {
uni.hideLoading(); uni.hideLoading();
that.showMessage(error); that.showMessage(error);
}) })
}, },
selectItem(item) {
this.$refs.scanPopup.closeScanPopup();
this.openJobDetail(item, this.scanMessage);
},
getScanResult(result) {
let balance = result.balance;
if (balance != null) {
this.scanMessage = ""
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
},
{
column: "fromLocationCode",
action: "==",
value: balance.locationCode
}
]
getOverPageJobList({
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("按来源库位[" + balance.locationCode + "]批次[" + result.label.batch +
"]物料号[" + result.label.itemCode + "]未查找到任务\n" + "扫描[" + result
.scanMessage + "]")
}
}).catch(error => {
this.showMessage(error + "\n扫描[" + result.scanMessage + "]")
})
} catch (e) {
this.showMessage(e.message)
}
}
}
} }
} }
</script> </script>

10
src/pages/package/job/overPackageJobDetail.vue

@ -58,7 +58,7 @@
</view> </view>
<win-scan-button @goScan='openScanDetailPopup'></win-scan-button> <win-scan-button @goScan='openScanDetailPopup'></win-scan-button>
<comScanPackagePack ref="comScanPackagePack" @closeScan='closeScan' @updateData='updateData'> <comScanPackagePack ref="comScanPackagePack" @closeScan='closeScan' @updateData='updateData' @refresh="resizeCollapse">
</comScanPackagePack> </comScanPackagePack>
<comMessage ref="comMessage"></comMessage> <comMessage ref="comMessage"></comMessage>
</view> </view>
@ -128,6 +128,7 @@
detailOptions: [], detailOptions: [],
scanOptions: [], scanOptions: [],
jobStatus: "", jobStatus: "",
scanMessage: ''
// printDeafult: {}, // // printDeafult: {}, //
// templateDeafult: {} // // templateDeafult: {} //
@ -143,6 +144,7 @@
title: option.title + '详情' title: option.title + '详情'
}) })
this.id = option.id; this.id = option.id;
this.scanMessage = option.scanMessage || '';
if (this.id != undefined) { if (this.id != undefined) {
// //
if (option.status == "1") { if (option.status == "1") {
@ -229,6 +231,9 @@
that.jobStatus = res.data.status that.jobStatus = res.data.status
that.subList = res.data.subList; that.subList = res.data.subList;
that.detailSource = getDataSource(that.detailSource, that.subList) that.detailSource = getDataSource(that.detailSource, that.subList)
if (this.scanMessage) {
this.openScanPopupSimulate(this.scanMessage);
}
// this.$nextTick(() => { // this.$nextTick(() => {
// if (uni.getStorageSync('overPackageJobDetailPointParams')) { // if (uni.getStorageSync('overPackageJobDetailPointParams')) {
// const overPackageJobDetailPointParams = uni.getStorageSync( // const overPackageJobDetailPointParams = uni.getStorageSync(
@ -255,6 +260,9 @@
this.showErrorMessage(error) this.showErrorMessage(error)
}) })
}, },
openScanPopupSimulate(scanMessage) {
this.$refs.comScanPackagePack.openScanPopupForJobSimulate(this.detailSource, this.jobContent, scanMessage);
},
closeScan() { closeScan() {
this.resizeCollapse(); this.resizeCollapse();

Loading…
Cancel
Save