|
|
@ -11,8 +11,7 @@ |
|
|
|
<view class=""> |
|
|
|
<com-move-record-card :dataContent="item" :index="index" @removeData="removeData" |
|
|
|
:isShowStatus="isShowStatus" @updateData="updateData" @removePack='removePack' |
|
|
|
:allowEditQty="true" |
|
|
|
:allowEditStatus="allowEditStatus" > |
|
|
|
:allowEditQty="true" :allowEditStatus="allowEditStatus"> |
|
|
|
</com-move-record-card> |
|
|
|
</view> |
|
|
|
</view> |
|
|
@ -35,7 +34,10 @@ |
|
|
|
<win-scan-button @goScan='showPopup'></win-scan-button> |
|
|
|
</view> |
|
|
|
<!-- 合格转隔离单独的弹窗--> |
|
|
|
<okToHoldRecordPack ref="okToHoldRecordPackRef" :showOnePop='showOnePop' @showFromLocationPopup='showFromLocationPopup' @itemCodeClick='openScanPopup' @confirm='okToHoldRecordPackConfirm' @getInputMsgResult="getInputMsgResult" @itemCodeScanMsg='itemCodeScanMsg' ></okToHoldRecordPack> |
|
|
|
<okToHoldRecordPack ref="okToHoldRecordPackRef" :showOnePop='showOnePop' |
|
|
|
@showFromLocationPopup='showFromLocationPopup' @itemCodeClick='openScanPopup' |
|
|
|
@confirm='okToHoldRecordPackConfirm' @getInputMsgResult="getInputMsgResult" |
|
|
|
@itemCodeScanMsg='itemCodeScanMsg'></okToHoldRecordPack> |
|
|
|
<win-scan-pack-and-location ref="scanPopup" @getResult='getScanResult' :title="'箱码'"> |
|
|
|
</win-scan-pack-and-location> |
|
|
|
<win-scan-location ref="scanFromLocationCode" title="来源库位" @getLocation='getFromLocation' |
|
|
@ -60,10 +62,14 @@ |
|
|
|
import { |
|
|
|
inventoryMoveRecordSubmit, |
|
|
|
getBasicLocationByCode, |
|
|
|
getBasicItemByCode |
|
|
|
} from '@/api/request2.js'; |
|
|
|
|
|
|
|
import { |
|
|
|
getDirectoryItemArray |
|
|
|
getDirectoryItemArray, |
|
|
|
getItemTypeName, |
|
|
|
checkDirectoryItemExist, |
|
|
|
getListItemTypeDesc |
|
|
|
} from '@/common/directory.js'; |
|
|
|
|
|
|
|
import { |
|
|
@ -72,7 +78,7 @@ |
|
|
|
|
|
|
|
import { |
|
|
|
getPackingNumberAndBatchByList, |
|
|
|
deepCopyData |
|
|
|
deepCopyData, |
|
|
|
} from '@/common/basic.js'; |
|
|
|
|
|
|
|
import { |
|
|
@ -148,6 +154,7 @@ |
|
|
|
dataContent: {}, |
|
|
|
fromLocationAreaTypeList: [], |
|
|
|
toLocationAreaTypeList: [], |
|
|
|
itemCodeTypeList: [], |
|
|
|
isShowEditLocation: false, |
|
|
|
isJustReplay: true, //是否只是回显,不走库存余额接口 |
|
|
|
} |
|
|
@ -157,6 +164,7 @@ |
|
|
|
getBusinessType(this.businessTypeCode, res => { |
|
|
|
if (res.success) { |
|
|
|
this.businessType = res.businessType; |
|
|
|
this.itemCodeTypeList = res.itemCodeTypeList; |
|
|
|
this.fromLocationAreaTypeList = res.fromLocationAreaTypeList; |
|
|
|
this.toLocationAreaTypeList = res.toLocationAreaTypeList; |
|
|
|
this.showPopup() |
|
|
@ -311,6 +319,11 @@ |
|
|
|
this.$refs.comMessage.showErrorMessage('请输入数量'); |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
this.checkItemCode(obj.itemCode, callBack => { |
|
|
|
|
|
|
|
if (callBack) { |
|
|
|
if (checkDirectoryItemExist(this.itemCodeTypeList, callBack)) { |
|
|
|
this.getResult = this.getResult ? this.getResult : { |
|
|
|
label: {}, |
|
|
|
fromLocationCode: '' |
|
|
@ -321,7 +334,44 @@ |
|
|
|
this.getResult.label.qty = obj.handleQty |
|
|
|
this.isJustReplay = false |
|
|
|
this.$refs.scanPopup.getScanResult(this.getResult, this.businessType) |
|
|
|
} else { |
|
|
|
var hint = getListItemTypeDesc(this.itemCodeTypeList); |
|
|
|
this.showErrorMessage("扫描物料[" + obj.itemCode + "]是[" + |
|
|
|
getItemTypeName(callBack) + "],需要的物料类型是[" + hint + "]") |
|
|
|
} |
|
|
|
|
|
|
|
} else { |
|
|
|
this.showErrorMessage('未查找到物料【' + obj.itemCode + '】'); |
|
|
|
} |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
}, |
|
|
|
//checkItemCode |
|
|
|
checkItemCode(itemCode, callBack) { |
|
|
|
getBasicItemByCode(itemCode).then(res => { |
|
|
|
if (res.data.list.length > 0) { |
|
|
|
var itemType = res.data.list[0].type |
|
|
|
callBack(itemType) |
|
|
|
} else { |
|
|
|
callBack(null) |
|
|
|
} |
|
|
|
|
|
|
|
}).catch(error => { |
|
|
|
callBack(null) |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
isInItemCodeTypeList(itemType) { |
|
|
|
var item = this.itemCodeTypeList.find(res => res == itemType) |
|
|
|
|
|
|
|
if (item = undefined) { |
|
|
|
return false |
|
|
|
} |
|
|
|
return true |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
getScanResultAfter(result) { |
|
|
|
var balance = result.balance; |
|
|
|
var pack = result.package; |
|
|
@ -398,7 +448,8 @@ |
|
|
|
} |
|
|
|
// 不可以大于库存余额数量 |
|
|
|
if (result.label.qty > balance.qty) { |
|
|
|
this.$refs.comMessage.showConfirmWarningModal("物料号[" + result.label.itemCode + "]数量[" + result.label.qty + "]不可以大于库存余额数量[" + balance.qty + "]") |
|
|
|
this.$refs.comMessage.showConfirmWarningModal("物料号[" + result.label.itemCode + "]数量[" + result.label |
|
|
|
.qty + "]不可以大于库存余额数量[" + balance.qty + "]") |
|
|
|
return |
|
|
|
} |
|
|
|
if (item == undefined) { |
|
|
@ -478,7 +529,8 @@ |
|
|
|
"已经存在") |
|
|
|
} else if (managementTypeParams == 'BY_BATCH') { |
|
|
|
this.showErrorMessage( |
|
|
|
"物料号[" + item.itemCode + "]\n" + "批次[" + detail.batch + "]\n" + "库位[" + detail.fromLocationCode + "]\n" + |
|
|
|
"物料号[" + item.itemCode + "]\n" + "批次[" + detail.batch + "]\n" + "库位[" + detail |
|
|
|
.fromLocationCode + "]\n" + |
|
|
|
"已经存在") |
|
|
|
} |
|
|
|
} |
|
|
@ -487,7 +539,12 @@ |
|
|
|
}, |
|
|
|
getInputMsgResult(result, fromWitch) { |
|
|
|
if (fromWitch == 'fromLocationScanMsg') { |
|
|
|
this.isClearFromLocationCode = false
this.$refs.scanFromLocationCode.getScanResult(result)
}else if(fromWitch == 'itemCodeScanMsg'){
result.fromLocationCode = this.fromLocationCode
this.$refs.scanPopup.getScanResult(result)
} |
|
|
|
this.isClearFromLocationCode = false |
|
|
|
this.$refs.scanFromLocationCode.getScanResult(result) |
|
|
|
} else if (fromWitch == 'itemCodeScanMsg') { |
|
|
|
result.fromLocationCode = this.fromLocationCode |
|
|
|
this.$refs.scanPopup.getScanResult(result) |
|
|
|
} |
|
|
|
}, |
|
|
|
// 清除来源库位 |
|
|
|
clearFromLocation(fromLocationCodeParams) { |
|
|
@ -614,7 +671,8 @@ |
|
|
|
console.log("提交", params) |
|
|
|
let obj = params.subList.find(item => item.balanceQty < item.handleQty) |
|
|
|
if (obj) { |
|
|
|
this.$refs.comMessage.showConfirmWarningModal('物料号[' +obj.itemCode + ']批次[' +obj.batch + ']数量[' + obj.handleQty + ']不允许大于库存数量[' +obj.balanceQty + ']') |
|
|
|
this.$refs.comMessage.showConfirmWarningModal('物料号[' + obj.itemCode + ']批次[' + obj.batch + ']数量[' + obj |
|
|
|
.handleQty + ']不允许大于库存数量[' + obj.balanceQty + ']') |
|
|
|
uni.hideLoading() |
|
|
|
return |
|
|
|
} |
|
|
|