|
@ -17,13 +17,8 @@ |
|
|
<com-product-detail-card :dataContent="item" :settingParam="jobContent" :isShowLocation="false" |
|
|
<com-product-detail-card :dataContent="item" :settingParam="jobContent" :isShowLocation="false" |
|
|
@remove="updateData" @updateData="updateData" :locationTypeList='toLocationTypeList'> |
|
|
@remove="updateData" @updateData="updateData" :locationTypeList='toLocationTypeList'> |
|
|
</com-product-detail-card> |
|
|
</com-product-detail-card> |
|
|
<view class="card_view" style="margin-left: 20px; border-bottom: 1px solid #e0e0e0;" |
|
|
|
|
|
v-for="(fg, index) in fgList"> |
|
|
|
|
|
<com-fg-card :detail='fg'></com-fg-card> |
|
|
|
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
<view class="split_line"></view> |
|
|
|
|
|
</view> |
|
|
|
|
|
</scroll-view> |
|
|
</scroll-view> |
|
|
</view> |
|
|
</view> |
|
|
|
|
|
|
|
@ -76,6 +71,13 @@ |
|
|
getScanCount |
|
|
getScanCount |
|
|
} from '@/common/detail.js'; |
|
|
} from '@/common/detail.js'; |
|
|
|
|
|
|
|
|
|
|
|
import { |
|
|
|
|
|
Decimal |
|
|
|
|
|
} from 'decimal.js'; //引入 |
|
|
|
|
|
|
|
|
|
|
|
import { |
|
|
|
|
|
calc |
|
|
|
|
|
} from '@/common/calc' |
|
|
|
|
|
|
|
|
import winScanButton from '@/mycomponents/scan/winScanButton.vue' |
|
|
import winScanButton from '@/mycomponents/scan/winScanButton.vue' |
|
|
import locationCompare from '@/mycomponents/location/locationCompare.vue' |
|
|
import locationCompare from '@/mycomponents/location/locationCompare.vue' |
|
@ -83,7 +85,7 @@ |
|
|
import comDetailCard from "@/mycomponents/detail/comDetailCard.vue" |
|
|
import comDetailCard from "@/mycomponents/detail/comDetailCard.vue" |
|
|
import jobTop from '@/mycomponents/job/jobTop.vue' |
|
|
import jobTop from '@/mycomponents/job/jobTop.vue' |
|
|
import comProductDetailCard from "@/pages/productReceipt/coms/comProductDetailCard.vue" |
|
|
import comProductDetailCard from "@/pages/productReceipt/coms/comProductDetailCard.vue" |
|
|
import comFgCard from "@/pages/productReceipt/coms/comFgCard.vue" |
|
|
|
|
|
|
|
|
|
|
|
export default { |
|
|
export default { |
|
|
name: 'receipt_detail', |
|
|
name: 'receipt_detail', |
|
@ -94,7 +96,6 @@ |
|
|
winScanFgLabel, |
|
|
winScanFgLabel, |
|
|
jobTop, |
|
|
jobTop, |
|
|
comProductDetailCard, |
|
|
comProductDetailCard, |
|
|
comFgCard |
|
|
|
|
|
}, |
|
|
}, |
|
|
data() { |
|
|
data() { |
|
|
return { |
|
|
return { |
|
@ -202,26 +203,45 @@ |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
getScanResult(result) { |
|
|
getScanResult(result) { |
|
|
let source = that.detailSource; |
|
|
//TODO缺少零件号的对应关系 |
|
|
this.fgList.push(result); |
|
|
let that = this; |
|
|
}, |
|
|
if (that.detailSource.length > 0) { |
|
|
|
|
|
let item = that.detailSource[0]; //应该按零件号查找 |
|
|
//继续扫描 |
|
|
result.uom = item.uom; |
|
|
continueScan() { |
|
|
if (item.subList.length > 0) { |
|
|
this.scanCount = getScanCount(this.subList); |
|
|
let subItem = item.subList[0]; |
|
|
if (this.scanCount == this.subList.length) { |
|
|
if (subItem.fgList == undefined) { |
|
|
this.closeScanPopup(); |
|
|
subItem.fgList = []; |
|
|
} else { |
|
|
} |
|
|
|
|
|
subItem.fgList.push(result); |
|
|
|
|
|
that.calcFgQty(this.detailSource); |
|
|
|
|
|
setTimeout(r => { |
|
|
this.scanPopupGetFocus(); |
|
|
this.scanPopupGetFocus(); |
|
|
|
|
|
}, 500) |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
calcFgQty() { |
|
|
|
|
|
let that = this; |
|
|
|
|
|
that.detailSource.forEach(item => { |
|
|
|
|
|
item.subList.forEach(pack => { |
|
|
|
|
|
pack.handleQty = new Decimal(0).toNumber(); |
|
|
|
|
|
pack.fgList.forEach(fg => { |
|
|
|
|
|
if (fg != null) { |
|
|
|
|
|
fg.qty = new Decimal(fg.qty).toNumber(); |
|
|
|
|
|
pack.handleQty = calc.add(pack.handleQty, fg.qty); |
|
|
|
|
|
// item.qty = calc.add(item.qty, detail.qty); |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
}) |
|
|
|
|
|
}) |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
updateData() { |
|
|
updateData() { |
|
|
calcHandleQty(this.detailSource); |
|
|
calcHandleQty(this.detailSource); |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
openScanPopup() { |
|
|
openScanPopup() { |
|
|
this.$refs.scanPopup.openScanPopup(); |
|
|
this.$refs.scanPopup.openScanPopup(); |
|
|
}, |
|
|
}, |
|
@ -230,16 +250,15 @@ |
|
|
this.$refs.scanPopup.closeScanPopup(); |
|
|
this.$refs.scanPopup.closeScanPopup(); |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
scanLocationCode(location, code) { |
|
|
scanLocationCode(location, code) { |
|
|
this.$refs.comMessage.showQuestionMessage("是否把所有的目标库位都变成默认库位[" + code + "]", res => { |
|
|
// this.$refs.comMessage.showQuestionMessage("是否把所有的目标库位都变成默认库位[" + code + "]", res => { |
|
|
this.toLocationCode = code |
|
|
this.toLocationCode = code |
|
|
this.detailSource.forEach(item => { |
|
|
this.detailSource.forEach(item => { |
|
|
item.subList.forEach(detail => { |
|
|
item.subList.forEach(detail => { |
|
|
detail.toLocationCode = code |
|
|
detail.toLocationCode = code |
|
|
}) |
|
|
}) |
|
|
}) |
|
|
}) |
|
|
}) |
|
|
// }) |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
checkLocation() { |
|
|
checkLocation() { |
|
@ -248,7 +267,6 @@ |
|
|
this.showMessageHint('请扫描收货库位', callback => { |
|
|
this.showMessageHint('请扫描收货库位', callback => { |
|
|
this.$refs.comScanLocation.showLocation(); |
|
|
this.$refs.comScanLocation.showLocation(); |
|
|
}) |
|
|
}) |
|
|
|
|
|
|
|
|
return isPass = false; |
|
|
return isPass = false; |
|
|
} |
|
|
} |
|
|
return isPass; |
|
|
return isPass; |
|
@ -263,33 +281,30 @@ |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
commit() { |
|
|
commit() { |
|
|
this.scanCount = getScanCount(this.subList); |
|
|
// this.scanCount = getScanCount(this.subList); |
|
|
if (this.scanCount == 0) { |
|
|
// if (this.scanCount == 0) { |
|
|
this.showErrorMessage("扫描数为0,请先扫描") |
|
|
// this.showErrorMessage("扫描数为0,请先扫描") |
|
|
return; |
|
|
// return; |
|
|
} |
|
|
// } |
|
|
//校验库位、 |
|
|
//校验库位、 |
|
|
if (!this.checkLocation()) { |
|
|
if (!this.checkLocation()) { |
|
|
return |
|
|
return |
|
|
} |
|
|
} |
|
|
|
|
|
this.detailSource.forEach(item => { |
|
|
|
|
|
item.subList.forEach(subitem => { |
|
|
//扫描数量和任务数量相等,直接提交 |
|
|
if (subitem.handleQty == undefined) { |
|
|
if (this.scanCount == this.subList.length) { |
|
|
this.showMessage("还没扫码成品不能提交") |
|
|
this.submitJob(); |
|
|
|
|
|
} else if (this.scanCount < this.subList.length) { |
|
|
|
|
|
//扫描数量小于任务数量,判断是否允许部分提交 |
|
|
|
|
|
if (this.jobContent.allowPartialComplete == "TRUE") { |
|
|
|
|
|
//提交 |
|
|
|
|
|
this.submitJob(); |
|
|
|
|
|
} else { |
|
|
} else { |
|
|
//不允许部分提交,提示 |
|
|
if (subitem.handleQty != subitem.packQty) { |
|
|
this.showMessage('请完成扫描后,再进行提交<br>' + "已经扫描[" + this.scanCount + "]总共[" + this.subList |
|
|
this.showQuestionMessage('制品数量不等于包装数量,是否继续提交?', res => { |
|
|
.length + |
|
|
if (res) { |
|
|
"]"); |
|
|
this.submitJob(); |
|
|
|
|
|
} |
|
|
|
|
|
}); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
}) |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
submitJob() { |
|
|
submitJob() { |
|
|