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

@ -63,6 +63,10 @@
getBalanceByParams,
getBasicItemByCode
} from '@/api/request2.js';
import {
getLabelInfo
} from '@/common/label.js';
import {
getListLocationAreaTypeDesc,
@ -165,6 +169,33 @@
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() {
this.$emit('confirm', this.fromLocationCode)
},

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

@ -95,6 +95,17 @@ import { getDirectoryItemArray } from '@/common/directory';
that.fromLocationList = that.getFromLocationList();
}
},
//
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) {
this.$refs.balanceSelect.openPopup(items);
@ -342,6 +353,7 @@ import { getDirectoryItemArray } from '@/common/directory';
batch.Records.push(record);
this.calcBatchHandleQty(batch);
this.packGetFocus();
this.$emit('refresh');
},
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" />
</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>
</view>
</template>
@ -32,6 +39,10 @@
goHome,
updateTitle
} from '@/common/basic.js';
import {
getBusinessType
} from '@/common/record.js';
import {
planRefreshTime
} from '@/common/config.js';
@ -45,6 +56,9 @@
import jobFilter from '@/mycomponents/job/jobFilter.vue'
import comOverPackJobCard from '@/pages/package/coms/comOverPackJobCard.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 {
name: 'issue',
@ -52,7 +66,10 @@
comEmptyView,
jobFilter,
comOverPackJobCard,
jobInfoPopup
jobInfoPopup,
winComScanBalance,
winScanButton,
jobList
},
data() {
return {
@ -68,7 +85,11 @@
detailOptions: [],
detailGiveupOptions: [],
title:'',
timer:null
businessTypeCode: "OverPackage",
businessType: null,
timer:null,
scanMessage:""
};
},
@ -125,6 +146,16 @@
},
methods: {
getBusinessTypeFunc() {
getBusinessType(this.businessTypeCode, res => {
if (res.success) {
this.businessType = res.businessType;
this.openScanPopup();
} else {
this.showErrorMessage(res.message)
}
});
},
timerRefresh() {
this.getList('refresh')
this.stopRefresh();
@ -225,8 +256,8 @@
},
openJobDetail(item) {
this.getJobInfoByNumber(item.number)
openJobDetail(item,scanMessage = '') {
this.getJobInfoByNumber(item.number,scanMessage)
},
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;
uni.showLoading({
title: "加载中....",
@ -367,14 +406,93 @@
return;
}
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 => {
uni.hideLoading();
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>

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

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

Loading…
Cancel
Save