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