lijuncheng 9 months ago
parent
commit
5b6350606c
  1. 16
      api/request2.js
  2. 43
      common/balance.js
  3. 1
      common/record.js
  4. 1
      common/style/pdabasic.css
  5. 13
      mycomponents/location/requiredLocation.vue
  6. 2
      mycomponents/scan/winScanContainer.vue
  7. 2
      mycomponents/scan/winScanPackAndLocation.vue
  8. 2
      pages/package/record/mergePackageRecord.vue
  9. 2
      pages/package/record/overPackageRecord.vue
  10. 2
      pages/package/record/splitPackageRecord.vue
  11. 2
      pages/pallet/record/unBindPalletRecord.vue
  12. 214
      pages/putaway/record/putawayRecord.vue
  13. 94
      pages/transfer/job/receiptDetail.vue

16
api/request2.js

@ -304,6 +304,22 @@ export function getBasicLocationByCode(code) {
});
}
/**
* 校验库位零件关系
* @param {*}
*
*/
export function validateItemAndLocation(parmas) {
return request({
url: baseApi + "/wms/location/validate",
method: "post",
data: parmas,
});
}
/**
* 查询物品信息接口
* @param {*} code 物品代码

43
common/balance.js

@ -4,6 +4,47 @@ import {
getBalanceByFilter
} from '@/api/request2.js';
/**
*
获取管理精度查询策略参数
* @param {*}
*
*/
export function getPrecisionStrategyParams(dataSource) {
}
/**
*
获取管理精度查询策略参数
* @param {*}
*
*/
export function getPrecisionStrategyParamsByLocation(detailSource,toLocationCode) {
var itemList = []
detailSource.forEach(item => {
item.subList.forEach(detail => {
if (detail.scaned) {
detail.toLocationCode = toLocationCode;
var filterResult = itemList.filter(res => {
if (res.itemCode == item.itemCode &&
res.locationCode == detail.toLocationCode) {
return res
}
})
//去掉重复元素
if (filterResult.length == 0) {
var result = {
itemCode: item.itemCode,
locationCode: detail.toLocationCode
}
itemList.push(result)
}
}
})
})
return itemList;
}
/**
* "itemCode": [],
@ -19,7 +60,7 @@ export function getPrecisionStrategyList(itemList, callback) {
success: true,
message: ''
};
getPrecisionStrategy(itemList).then(res => {
if (res.data == null) {
result.success = false

1
common/record.js

@ -19,6 +19,7 @@ export function createItemInfo(balance, pack) {
}
return item;
}
export function createDetailInfo(data, pack) {
data.scaned = true;
// data.toInventoryStatus = this.toInventoryStatus == "" ? data.inventoryStatus : this.toInventoryStatus;

1
common/style/pdabasic.css

@ -725,6 +725,7 @@ page {
.page-header .header_item {
/* padding-left: 10rpx; */
padding: 5rpx 10rpx;
font-size:15px ;
}
.page-header .header_job_top {

13
mycomponents/location/requiredLocation.vue

@ -5,9 +5,12 @@
padding-right: 10rpx;
font-size:32rpx;">
<view class="uni-flex uni-row u-col-center" @click="showLocation">
<text style="font-size: 35rpx;">{{title}} </text>
<text style="font-size: 35rpx;color:#3FBAFF;" v-if="locationCode==''&&isShowEdit==true">&nbsp 请扫描</text>
<text style="font-size: 35rpx;color:#3FBAFF;">&nbsp {{locationCode}}</text>
<view>
{{title}}
<!-- <text style="font-size: 35rpx;">{{title}}&nbsp {{locationCode}} </text> -->
<text style="font-size: 35rpx;color:#3FBAFF;" v-if="locationCode==''&&isShowEdit==true">&nbsp 请扫描</text>
<text style="font-size: 35rpx;color:#3FBAFF;">&nbsp {{locationCode}}</text>
</view>
<image v-if="isShowEdit" style="width:45rpx;height: 45rpx;" src="/static/icons/icons_edit.svg"></image>
</view>
<win-scan-location ref="scanLocationCode" :title="title" @getLocation='getLocation'
@ -59,10 +62,10 @@
},
methods: {
showLocation() {
if(this.isShowEdit){
if (this.isShowEdit) {
this.$refs.scanLocationCode.openScanPopup();
}
},
//
getLocation(location, code) {

2
mycomponents/scan/winScanContainer.vue

@ -12,7 +12,7 @@
</view>
<view class="">
<view class="">
<win-com-scan ref="scan" @getResult="getScanResult" :placeholder='title' :clearResult="false"
<win-com-scan ref="scan" headerType='HCQ' @getResult="getScanResult" :placeholder='title' :clearResult="false"
:boxFocus="true" :isShowHistory="isShowHistory">
</win-com-scan>
</view>

2
mycomponents/scan/winScanPackAndLocation.vue

@ -27,7 +27,7 @@
<view v-if='allowModifyLocation'>
<uni-combox :candidates="fromLocationList" v-model="fromLocationCode" placeholder="请扫描来源库位"
@confirm="scanLocation"></uni-combox>
@confirm="scanLocation" style='height: 30px;'></uni-combox>
</view>
<view v-else>
<text style="padding: 5px">

2
pages/package/record/mergePackageRecord.vue

@ -35,7 +35,7 @@
<win-scan-button @goScan='openScanPopup'></win-scan-button>
</view>
<win-scan-pack-and-location ref="scanPopup" @getResult='getScanResult'></win-scan-pack-and-location>
<win-scan-pack-and-location ref="scanPopup" @getResult='getScanResult' allowModifyLocation="false"></win-scan-pack-and-location>
<win-scan-location ref="scanLocationCode" title="来源库位" @getLocation='getLocation'
:locationTypeList="fromlocationTypeList"></win-scan-location>
<com-message ref="comMessage"></com-message>

2
pages/package/record/overPackageRecord.vue

@ -30,7 +30,7 @@
</view>
<win-scan-pack-and-location ref="scanPopup" @getResult='getScanResult'></win-scan-pack-and-location>
<win-scan-pack-and-location ref="scanPopup" @getResult='getScanResult' allowModifyLocation="false"></win-scan-pack-and-location>
<win-scan-location ref="scanLocationCode" title="来源库位" @getLocation='getLocation'
:locationTypeList="fromlocationTypeList"></win-scan-location>
<win-scan-button @goScan='showScanPopupPack'></win-scan-button>

2
pages/package/record/splitPackageRecord.vue

@ -29,7 +29,7 @@
</view>
</view>
<win-scan-pack-and-location ref="scanPopup" @getResult='getScanResult'></win-scan-pack-and-location>
<win-scan-pack-and-location ref="scanPopup" @getResult='getScanResult' allowModifyLocation="false"></win-scan-pack-and-location>
<win-scan-location ref="scanLocationCode" title="来源库位" @getLocation='getLocation'
:locationTypeList="fromlocationTypeList"></win-scan-location>
<win-scan-button @goScan='showScanPopupPack'></win-scan-button>

2
pages/pallet/record/unBindPalletRecord.vue

@ -297,7 +297,7 @@
this.scanPopupGetFocus();
},
getContainer(containerInfo) {
this.containerCode = containerInfo.Number;
this.containerCode = containerInfo.number;
getContainerDetailByNumber(this.containerCode).then(res => {
if (res.data.length > 0) {
this.detailSource = this.getDataSource(res.data)

214
pages/putaway/record/putawayRecord.vue

@ -17,13 +17,12 @@
</scroll-view>
</view>
<requiredLocation v-if="showToLoaction" title="目标库位" :locationCode="toLocationCode"
@getLocation='getToLocationCode' :locationTypeList="tolocationTypeList"></requiredLocation>
<view class="page-footer">
<view class="uni-flex u-col-center space-between padding_10"
style="background-color:ghostwhite; width: 100%; ">
<view class="">
<requiredLocation v-if="showToLoaction" title="目标库位" :locationCode="toLocationCode"
@getLocation='getToLocationCode' :locationTypeList="tolocationTypeList"></requiredLocation>
</view>
<view class=" uni-flex uni-row">
<button class="btn_single_commit" hover-class="btn_commit_after" @click="commit">提交</button>
@ -42,7 +41,8 @@
<script>
import {
putawayRequestSubmit,
putawayRecordSubmit
putawayRecordSubmit,
validateItemAndLocation
} from '@/api/request2.js';
import {
@ -56,12 +56,6 @@
getDirectoryItemArray
} from '@/common/directory.js';
import {
getDetailOption,
getDetailRemoveOption,
getDetailEditRemoveOption
} from '@/common/array.js';
import {
getBusinessType,
createItemInfo,
@ -70,7 +64,9 @@
} from '@/common/record.js';
import {
getManagementPrecisions
getManagementPrecisions,
getPrecisionStrategyList,
getPrecisionStrategyParamsByLocation
} from '@/common/balance.js';
import winScanButton from '@/mycomponents/scan/winScanButton.vue'
@ -96,35 +92,20 @@
data() {
return {
id: '',
receiptJob: {},
received: false,
dataContent: {}, //
detailSource: [], //
locationTypeList: [],
businessTypeInfo: {},
fromLocationInfo: {},
fromLocationCode: "",
toLocationCode: "",
isShowLocation: false,
fromlocationTypeList: [],
tolocationTypeList: [],
inInventoryStatus: "", //
outInventoryStatus: "", //
businessType: {},
fromType: "",
showToLoaction: true
};
},
onLoad(option) {
this.fromType = option.fromType
if (this.fromType == "requestType") {
this.showToLoaction = false
updateTitle("原料上架申请")
} else {
updateTitle("原料上架记录")
this.showToLoaction = true
}
var typeCode = "PurchasePutaway"
getBusinessType(typeCode, res => {
if (res.success) {
@ -188,10 +169,10 @@
showErrorMessage(message) {
this.$refs.comMessage.showErrorMessage(message, res => {
if (res) {
}
if (res) {}
});
},
calcHandleQty() {
for (let item of this.detailSource) {
item.qty = 0;
@ -207,6 +188,7 @@
updateData() {
this.calcHandleQty();
},
removeItem(index, item) {
this.detailSource.splice(index, 1)
},
@ -228,6 +210,7 @@
}
this.$refs.scanPopup.openScanPopupForType(this.fromLocationCode, this.businessType);
},
showFromLocationPopup() {
this.$nextTick(() => {
this.$refs.scanLocationCode.openScanPopup();
@ -254,115 +237,122 @@
return;
}
uni.showLoading({
title: "提交中....",
mask: true
//
// uni.showLoading({
// title: "....",
// mask: true
// });
//
//1:
// var itemCodes = []
// let conditions = [];
// this.detailSource.forEach(item => {
// debugger;
// let condition = {
// itemCode: item.itemCode,
// batch: item.batch,
// inventoryStatus: item.inInventoryStatus,
// locationCode: this.toLocationCode
// };
// conditions.push(condition)
// })
let itemAndLocationRelations = this.getItemAndLocationRelations();
validateItemAndLocation(itemAndLocationRelations, res => {
debugger;
});
if (this.fromType == "requestType") {
var params = this.setRequestParams()
console.log("提交" + JSON.stringify(params))
// putawayRequestSubmit(params).then(res => {
// uni.hideLoading()
// if (res.data) {
// this.showCommitSuccessMessage("<br>" + res.data, )
// } else {
// this.showErrorMessage("[" + res.msg + "]")
// }
// }).catch(error => {
// uni.hideLoading()
// this.showErrorMessage(error)
// })
} else {
//
var itemCodes = []
this.detailSource.forEach(item => {
itemCodes.push(item.itemCode)
})
//
getManagementPrecisions(itemCodes, this.toLocationCode, res => {
if (res.success) {
this.managementList = res.list;
var params = this.setRecordParams(true)
console.log("提交参数", JSON.stringify(params));
// putawayRecordSubmit(params).then(res => {
// uni.hideLoading()
// if (res.data) {
// this.showCommitSuccessMessage("<br>" + res.data, )
// } else {
// this.showErrorMessage("[" + res.msg + "]")
// }
// }).catch(error => {
// uni.hideLoading()
// this.showErrorMessage(error)
// })
} else {
uni.hideLoading();
this.showErrorMessage(res.message);
}
});
}
let precisionStrategyParams = getPrecisionStrategyParamsByLocation(this.detailSource, this.toLocationCode);
return;
//2:
// getManagementPrecisions(itemCodes, this.toLocationCode, res => {
// if (res.success) {
// this.managementList = res.list;
// var params = this.setRecordParams(true)
// console.log("", JSON.stringify(params));
// putawayRecordSubmit(params).then(res => {
// uni.hideLoading()
// if (res.data) {
// this.showCommitSuccessMessage("<br>" + res.data, )
// } else {
// this.showErrorMessage("[" + res.msg + "]")
// }
// }).catch(error => {
// uni.hideLoading()
// this.showErrorMessage(error)
// })
// } else {
// uni.hideLoading();
// this.showErrorMessage(res.message);
// }
// });
},
setRecordParams(queryModel) {
var subList = []
var creator = this.$store.state.user.id
getItemAndLocationRelations() {
var itemList = []
this.detailSource.forEach(item => {
item.subList.forEach(detail => {
if (detail.scaned) {
if (queryModel) {
var info = getPackingNumberAndBatch(this.managementList, detail.itemCode,
detail.packingNumber, detail.batch);
detail.toPackingNumber = info.packingNumber;;
detail.toContainerNumber = detail.containerNumber
detail.toBatch = info.batch;
detail.toInventoryStatus = detail.inventoryStatus
detail.toLocationCode = this.toLocationCode
} else {
// detail.toPackingNumber = detail.packingNumber;
// detail.toContainerNumber = detail.containerNumber
// detail.toBatch = detail.toBatch;
// detail.toInventoryStatus = detail.inventoryStatus
// detail.toLocationCode = ""
detail.toLocationCode = this.toLocationCode;
var filterResult = itemList.filter(res => {
if (res.itemCode == item.itemCode &&
res.locationCode == detail.toLocationCode &&
res.batch == detail.batch &&
res.inventoryStatus == detail.inventoryStatus) {
return res
}
})
//
if (filterResult.length == 0) {
var result = {
itemCode: item.itemCode,
locationCode: detail.toLocationCode,
batch: detail.batch,
inventoryStatus: detail.inventoryStatus,
}
itemList.push(result)
}
subList.push(detail)
}
})
})
this.dataContent.subList = subList
this.dataContent.creator = creator;
return this.dataContent;
return itemList;
},
setRequestParams(){
setRecordParams(queryModel) {
var subList = []
var supplierCode=""
var creator = this.$store.state.user.id
this.detailSource.forEach(item => {
item.subList.forEach(detail => {
if (detail.scaned) {
if(supplierCode==""){
supplierCode = detail.package.supplierCode
}
var info = getPackingNumberAndBatch(this.managementList, detail.itemCode,
detail.packingNumber, detail.batch);
detail.toPackingNumber = info.packingNumber;;
detail.toContainerNumber = detail.containerNumber
detail.toBatch = info.batch;
detail.toInventoryStatus = detail.inventoryStatus
detail.toLocationCode = this.toLocationCode
detail.package = null;
subList.push(detail)
}
})
})
this.dataContent.subList = subList
this.dataContent.supplierCode = supplierCode
this.dataContent.businessType = "PurchasePutaway"
this.dataContent.departmentCode= "研发部门";
this.dataContent.status= 1 ;
this.dataContent.autoCommit = "FALSE";
this.dataContent.autoAgree = "FALSE";
this.dataContent.autoExecute = "FALSE";
this.dataContent.directCreateRecord = "FALSE";
this.dataContent.creator = creator;
return this.dataContent;
},
showMessage(message) {
this.$refs.comMessage.showMessage(message, res => {
if (res) {}

94
pages/transfer/job/receiptDetail.vue

@ -7,6 +7,9 @@
<view class="header_item">
申请单号 : {{jobContent.requestNumber}}
</view>
<view class="header_item">
来源仓库 : {{jobContent.fromWarehouseCode}}
</view>
<u-line color="#D8D8D8" style="margin-bottom: 15rpx;margin-top: 10rpx;"></u-line>
</view>
<view class="page-main">
@ -37,7 +40,8 @@
</view>
<win-scan-button @goScan='openScanPopup'></win-scan-button>
<win-scan-pack-and-location ref="scanPopup" @getResult='getScanResult'></win-scan-pack-and-location>
<win-scan-pack ref="scanPopup" @getResult='getScanResult'></win-scan-pack>
<!-- <win-scan-pack-and-location ref="scanPopup" @getResult='getScanResult'></win-scan-pack-and-location> -->
<detail-info-popup ref="detailInfoPopup"></detail-info-popup>
<com-message ref="comMessage"></com-message>
@ -57,7 +61,8 @@
navigateBack,
getPackingNumberAndBatch,
getInventoryStatusName,
getDirectoryItemArray
getDirectoryItemArray,
compareAsc
} from '@/common/basic.js';
import {
@ -75,17 +80,18 @@
import requiredLocation from '@/mycomponents/location/requiredLocation.vue'
import comMessage from '@/mycomponents/common/comMessage.vue'
import winScanPackAndLocation from "@/mycomponents/scan/winScanPackAndLocation.vue"
import winScanPack from "@/mycomponents/scan/winScanPack.vue"
import comDetailCard from "@/mycomponents/detail/comDetailCard.vue"
import detailInfoPopup from '@/pages/transfer/coms/detailInfoPopup.vue'
import jobTop from '@/mycomponents/job/jobTop.vue'
export default {
name: 'returnDetail',
components: {
winScanButton,
requiredLocation,
comMessage,
winScanPackAndLocation,
winScanPack,
comDetailCard,
detailInfoPopup,
jobTop
@ -101,7 +107,7 @@
toLocationCode: "",
businessTypeInfo: {},
managementList: [],
tolocationTypeList:[]
tolocationTypeList: []
};
},
onLoad(option) {
@ -227,29 +233,45 @@
},
openScanPopup() {
let fromlocationCode = '';
let fromlocationList = [];
for (var i = 0; i < this.detailSource.length; i++) {
let item = this.detailSource[i];
item.subList.forEach(l => {
//
var location = fromlocationList.filter(res => res.fromLocationCode != l.fromLocationCode)
if (location.length == 0) {
fromlocationList.push(l.fromLocationCode);
}
//
if (fromlocationCode == '') {
if (!l.scaned) {
fromlocationCode = l.fromLocationCode;
this.$refs.scanPopup.openScanPopup();
},
getScanResult(result) {
try {
var packingNumber = result.label.packingNumber;
var batch = result.label.batch;
var qty = result.label.qty;
var itemCode = result.label.itemCode;
var detail = this.detailSource.find(r => r.itemCode == itemCode);
if (detail == undefined) {
this.showMessage("物料号【" + itemCode + "】不在列表中")
} else {
var itemDetail = detail.subList.find(r => r.packingNumber == packingNumber && r.batch == batch);
if (itemDetail == undefined) {
this.showMessage("箱码【" + packingNumber + "】、批次【" + batch + "】不在列表中")
} else {
if (itemDetail.scaned) {
this.showMessage("箱码【" + packingNumber + "】已经扫描")
} else {
itemDetail.scaned = true;
this.detailSource[0].subList.sort(compareAsc('scaned')); //
itemDetail.handleQty = Number(result.label.qty);
itemDetail.toLocationCode = this.toLocationCode;
itemDetail.labelQty = Number(result.label.qty);
calcHandleQty(this.detailSource);
this.continueScan()
this.$forceUpdate()
var list = this.detailSource[0].subList;
}
}
})
}
} catch (e) {
this.showErrorMessage(e.message)
}
this.$refs.scanPopup.openScanPopupForJob(fromlocationCode, fromlocationList, this.jobContent);
},
getScanResult(result) {
getScanResult1(result) {
try {
var packingNumber = result.label.packingNumber;
var batch = result.label.batch;
@ -272,15 +294,16 @@
let balanceStatus = getInventoryStatusName(result.balance.inventoryStatus);
let itemStatus = getInventoryStatusName(itemDetail.inventoryStatus);
if (itemDetail.inventoryStatus != result.balance.inventoryStatus) {
if(this.jobContent.allowModifyInventoryStatus=="TRUE"){
this.showQuestionMessage('任务中允许修改库存状态,实际库存状态[' + balanceStatus + ']与推荐库存状态[' + itemStatus +
if (this.jobContent.allowModifyInventoryStatus == "TRUE") {
this.showQuestionMessage('任务中允许修改库存状态,实际库存状态[' + balanceStatus + ']与推荐库存状态[' +
itemStatus +
']不一致,是否继续入库?', res => {
if (res) {
itemDetail.scaned = true;
itemDetail.handleQty = Number(result.balance.qty) ;
itemDetail.handleQty = Number(result.balance.qty);
itemDetail.toInventoryStatus = result.balance.inventoryStatus
itemDetail.balance = result.balance;
itemDetail.balance.balanceQty = Number(result.balance.qty) ;
itemDetail.balance.balanceQty = Number(result.balance.qty);
itemDetail.balance.stdPackQty = Number(result.package.stdPackQty)
itemDetail.balance.stdPackUnit = result.package.stdPackUnit
this.calcHandleQty();
@ -288,20 +311,21 @@
this.scanPopupGetFocus();
}
});
}else {
this.showQuestionMessage('任务中不允许修改库存状态,实际库存状态[' + balanceStatus + ']与推荐库存状态[' + itemStatus +
} else {
this.showQuestionMessage('任务中不允许修改库存状态,实际库存状态[' + balanceStatus + ']与推荐库存状态[' +
itemStatus +
']不一致,不允许转移!', res => {
this.scanPopupGetFocus();
});
}
} else {
itemDetail.scaned = true;
itemDetail.handleQty = Number(result.balance.qty) ;
itemDetail.handleQty = Number(result.balance.qty);
itemDetail.toInventoryStatus = result.balance.inventoryStatus
itemDetail.balance = result.balance;
itemDetail.balance.balanceQty = Number(result.balance.qty) ;
itemDetail.balance.balanceQty = Number(result.balance.qty);
itemDetail.balance.stdPackQty = Number(result.package.stdPackQty)
itemDetail.balance.stdPackUnit = result.package.stdPackUnit
this.calcHandleQty();
@ -350,7 +374,7 @@
},
submitJob() {
uni.showLoading({
title: "提交中....",
mask: true
@ -379,7 +403,7 @@
} else {
this.showErrorMessage("提交失败[" + res.msg + "]")
}
}).catch(error => {
uni.hideLoading()
this.showErrorMessage(error)

Loading…
Cancel
Save