Browse Source

修改翻包记录

hella_vue3
lijuncheng 8 months ago
parent
commit
c4450633fb
  1. 40
      src/common/directory.js
  2. 4
      src/common/record.js
  3. 19
      src/mycomponents/scan/winScanLocation.vue
  4. 3
      src/pages/index/index.vue
  5. 20
      src/pages/package/job/overPackageJobDetail.vue
  6. 95
      src/pages/package/record/overPackageRecord.vue

40
src/common/directory.js

@ -19,6 +19,8 @@ let inspectTypeList = [];
let sampleMethodList = []; let sampleMethodList = [];
let transferModeList = []; let transferModeList = [];
let countStageList = []; let countStageList = [];
let locationAreaTypeList = [];
// 获取业务类型字典项 // 获取业务类型字典项
@ -57,6 +59,7 @@ export function clearCacheData() {
sampleMethodList = []; sampleMethodList = [];
transferModeList = []; transferModeList = [];
countStageList = []; countStageList = [];
locationAreaTypeList=[]
} }
//获取字典信息 //获取字典信息
@ -144,6 +147,16 @@ export function getJobStateStyle(value) {
} }
} }
//获取库区描述(多个库区)
export function getListLocationAreaTypeDesc(list) {
let desc = '';
list.forEach(res => {
desc += getLocationAreaTypeInfo(res).label + ","
})
desc = desc.slice(0, -1);
return desc;
}
//获取库位描述(多个库位) //获取库位描述(多个库位)
export function getListLocationTypeDesc(list) { export function getListLocationTypeDesc(list) {
let desc = ''; let desc = '';
@ -212,6 +225,23 @@ export function getItemStateInfo(value) {
return resultInfo return resultInfo
} }
//获取库区类型
export function getLocationAreaTypeInfo(value) {
var resultInfo = "";
if (locationAreaTypeList.length == 0) {
locationAreaTypeList = getDirectoryInfo("area_type")
}
if (locationAreaTypeList.length > 0) {
for (let item of locationAreaTypeList) {
if (item.value == value) {
resultInfo = item
break;
}
}
}
return resultInfo
}
//获取库位类型 //获取库位类型
export function getLocationTypeInfo(value) { export function getLocationTypeInfo(value) {
var resultInfo = ""; var resultInfo = "";
@ -228,6 +258,13 @@ export function getLocationTypeInfo(value) {
} }
return resultInfo return resultInfo
} }
//获取库区类型名称
export function getLocationAreaTypeName(value) {
let location = getLocationAreaTypeInfo(value);
return location == '' ? value : location.label;
}
//获取库位类型名称 //获取库位类型名称
export function getLocationTypeName(value) { export function getLocationTypeName(value) {
@ -530,3 +567,6 @@ export function getPackUnitName(value) {
} }
return resultInfo return resultInfo
} }
locationAreaTypeList

4
src/common/record.js

@ -79,6 +79,8 @@ export function getBusinessType(typeCode, callback) {
success: true, success: true,
businessType: '', businessType: '',
fromlocationTypeList: '', fromlocationTypeList: '',
fromLocationAreaTypeList:'',
toAreaTypes:'',
tolocationTypeList: '', tolocationTypeList: '',
itemCodeTypeList:"", itemCodeTypeList:"",
useOnTheWay:"FALSE", useOnTheWay:"FALSE",
@ -89,6 +91,8 @@ export function getBusinessType(typeCode, callback) {
getBusinesstypeByCode(typeCode).then(res => { getBusinesstypeByCode(typeCode).then(res => {
if (res.data.total > 0) { if (res.data.total > 0) {
result.businessType = res.data.list[0]; result.businessType = res.data.list[0];
result.fromLocationAreaTypeList = getDirectoryItemArray(res.data.list[0].outAreaTypes) ;
result.toLocationAreaTypeList = getDirectoryItemArray(res.data.list[0].inAreaTypes) ;
result.fromlocationTypeList = getDirectoryItemArray(res.data.list[0].outLocationTypes) result.fromlocationTypeList = getDirectoryItemArray(res.data.list[0].outLocationTypes)
result.tolocationTypeList = getDirectoryItemArray(res.data.list[0].inLocationTypes) result.tolocationTypeList = getDirectoryItemArray(res.data.list[0].inLocationTypes)
result.itemCodeTypeList = getDirectoryItemArray(res.data.list[0].itemTypes) result.itemCodeTypeList = getDirectoryItemArray(res.data.list[0].itemTypes)

19
src/mycomponents/scan/winScanLocation.vue

@ -27,8 +27,8 @@
getBasicLocationByCode, getBasicLocationByCode,
} from '@/api/request2.js'; } from '@/api/request2.js';
import { import {
getLocationTypeName, getLocationAreaTypeName,
getListLocationTypeDesc, getListLocationAreaTypeDesc,
checkDirectoryItemExist checkDirectoryItemExist
} from '@/common/directory.js'; } from '@/common/directory.js';
import winComScan from '@/mycomponents/scan/winComScan.vue' import winComScan from '@/mycomponents/scan/winComScan.vue'
@ -44,7 +44,7 @@
}, },
locationTypeList: { locationTypeList: {
type: Array, type: Array,
default: [] default: null
}, },
isShowHistory: { isShowHistory: {
type: Boolean, type: Boolean,
@ -98,15 +98,22 @@
if (res.data.total > 0) { if (res.data.total > 0) {
let result = res.data.list[0]; let result = res.data.list[0];
var type = result.type; var type = result.type;
var areaType = ""
if(this.code=="RAW"){
areaType="RAW"
}else {
areaType="SUPPER"
}
var available = result.available; var available = result.available;
if (available == "TRUE") { if (available == "TRUE") {
if (checkDirectoryItemExist(this.locationTypeList, type)) { if (checkDirectoryItemExist(this.locationTypeList, areaType)) {
this.location = result; this.location = result;
this.callBack(); this.callBack();
} else { } else {
var hint = getListLocationTypeDesc(this.locationTypeList); var hint = getListLocationAreaTypeDesc(this.locationTypeList);
this.showErrorMessage("扫描库位[" + this.code + "]是[" + this.showErrorMessage("扫描库位[" + this.code + "]是[" +
getLocationTypeName(type) + "],需要的库位类型是[" + hint + "]") getLocationAreaTypeName(areaType) + "],需要的库区是[" + hint + "]")
} }
} else { } else {
this.showErrorMessage("扫描库位[" + this.code + "]不可用") this.showErrorMessage("扫描库位[" + this.code + "]不可用")

3
src/pages/index/index.vue

@ -93,7 +93,6 @@
forcedLogin: false, forcedLogin: false,
count: 1, count: 1,
position: [-10, -10], position: [-10, -10],
timer: null,
menusCount: {}, menusCount: {},
filterList: [], filterList: [],
serchval: "" serchval: ""
@ -337,7 +336,7 @@
"inventory_status", "container_type", "pack_unit", "unplanned_receipt_reason", "inventory_status", "container_type", "pack_unit", "unplanned_receipt_reason",
"unplanned_issue_reason", "scrap_reason", "inspect_failed_reason", "unplanned_issue_reason", "scrap_reason", "inspect_failed_reason",
"request_status", "inspect_type", "next_action", "sample_method", "transfer_mode", "request_status", "inspect_type", "next_action", "sample_method", "transfer_mode",
"count_stage", "inspect_result" "count_stage", "inspect_result","area_type"
] ]
} }
getDictionaryItem(params).then(res => { getDictionaryItem(params).then(res => {

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

@ -26,7 +26,8 @@
</view> </view>
</view> </view>
<comOverPackJobDetailCard ref='comOverPackJobDetailCard' :dataContent="toLocation" @updateData='updateData'> <comOverPackJobDetailCard ref='comOverPackJobDetailCard' :dataContent="toLocation"
@updateData='updateData'>
</comOverPackJobDetailCard> </comOverPackJobDetailCard>
</view> </view>
</scroll-view> </scroll-view>
@ -286,9 +287,11 @@
var toPackQty = this.detailSource[0].Items[0].Locations[0].Batchs[0].toPackQty var toPackQty = this.detailSource[0].Items[0].Locations[0].Batchs[0].toPackQty
if (tempHandleQty > tempQty) { if (tempHandleQty > tempQty) {
// //
this.showCommitMessage("实际数量【"+tempHandleQty+"】大于需求数量"+"【"+tempQty+"】, 是否提交?",tempHandleQty,toPackQty) this.showCommitMessage("实际数量【" + tempHandleQty + "】大于需求数量" + "【" + tempQty + "】, 是否提交?", tempHandleQty,
toPackQty)
} else if (tempHandleQty < tempQty) { } else if (tempHandleQty < tempQty) {
this.showCommitMessage("实际数量【"+tempHandleQty+"】小于需求数量"+"【"+tempQty+"】, 是否提交?",tempHandleQty,toPackQty) this.showCommitMessage("实际数量【" + tempHandleQty + "】小于需求数量" + "【" + tempQty + "】, 是否提交?", tempHandleQty,
toPackQty)
} else { } else {
this.packageHint(tempHandleQty, toPackQty) this.packageHint(tempHandleQty, toPackQty)
} }
@ -296,9 +299,8 @@
packageHint(tempHandleQty, toPackQty) { packageHint(tempHandleQty, toPackQty) {
// //
if (tempHandleQty % toPackQty > 0) { if (tempHandleQty % toPackQty > 0) {
var count= Math.ceil(tempHandleQty / toPackQty); this.$refs.comMessage.showQuestionMessage("扫描数量【" + tempHandleQty +
// "】,将有1个非整包,是否提交?", res => {
this.$refs.comMessage.showQuestionMessage("新标包数量是【"+toPackQty+"】,扫描数量【"+tempHandleQty+"】,将不能翻成【"+count+"】个整包,是否提交?", res => {
if (res) { if (res) {
this.submitJob() this.submitJob()
} }
@ -366,9 +368,11 @@
record.singlePrice = single_price; record.singlePrice = single_price;
record.amount = single_price * r.qty; record.amount = single_price * r.qty;
record.fromPackUnit = subItem.fromPackUnit; record.fromPackUnit = subItem
.fromPackUnit;
record.toPackUnit = subItem.toPackUnit; record.toPackUnit = subItem.toPackUnit;
record.fromPackQty = subItem.fromPackQty; record.fromPackQty = subItem
.fromPackQty;
record.toPackQty = subItem.toPackQty; record.toPackQty = subItem.toPackQty;
record.toBatch = r.batch; record.toBatch = r.batch;

95
src/pages/package/record/overPackageRecord.vue

@ -9,11 +9,13 @@
<scroll-view scroll-y="true" class="page-main-scroll"> <scroll-view scroll-y="true" class="page-main-scroll">
<view class="detail-list" v-for="(item, index) in detailSource" :key="item.id"> <view class="detail-list" v-for="(item, index) in detailSource" :key="item.id">
<view class=""> <view class="">
<view class="" style="padding: 20rpx; font-size: 35rpx;"> <view class="" style="padding: 20rpx; font-size: 32rpx;">
<view> 来源库位 : {{item.subList[0].locationCode}} <view> 来源库位 : {{item.subList[0].locationCode}}
</view> </view>
<view> 来源包装规格 : {{getPackUnitName(packUnit)}} <view> 来源包装规格 :
{{fromPackUnit}}/{{item.subList[0].packQty}}{{getUomInfo(item.subList[0].uom)}}
</view> </view>
</view> </view>
<record-com-detail-card :dataContent="item" :index="index" <record-com-detail-card :dataContent="item" :index="index"
@ -30,14 +32,16 @@
<view class="uni-flex u-col-center space-between padding_10" <view class="uni-flex u-col-center space-between padding_10"
style="background-color:ghostwhite; width: 100%; "> style="background-color:ghostwhite; width: 100%; ">
<view class=""> <view class="">
<view class="uni-flex uni-row title u-col-center" style="font-size: 30rpx;"> <view class="uni-flex uni-row title u-col-center" style="font-size: 28rpx;">
<text>目标包装规格 :</text> <text>目标包装规格 :</text>
<view class="uni-flex u-col-center uni-row" @click="showPackage"> <view class="uni-flex u-col-center uni-row" @click="showPackage">
<view class="" style="margin-left: 5rpx;width: 100%;"> <view class="" style="margin-left: 5rpx;width: 100%;">
{{toPackUnit}} {{toPackUnitShow}}
</view> </view>
<u-select v-model="show" mode="single-column" :list="packageList" <u-select v-model="show" mode="single-column" :list="packageList"
@confirm="confirmSelect"></u-select> @confirm="confirmSelect">
</u-select>
</view> </view>
</view> </view>
@ -53,7 +57,7 @@
<win-scan-pack-and-location ref="scanPopup" @getResult='getScanResult' :allowModifyLocation="false"> <win-scan-pack-and-location ref="scanPopup" @getResult='getScanResult' :allowModifyLocation="false">
</win-scan-pack-and-location> </win-scan-pack-and-location>
<win-scan-location ref="scanLocationCode" title="来源库位" @getLocation='getLocation' <win-scan-location ref="scanLocationCode" title="来源库位" @getLocation='getLocation'
:locationTypeList="fromlocationTypeList"></win-scan-location> :locationTypeList="fromLocationAreaTypeList"></win-scan-location>
<comMessage ref="comMessage"></comMessage> <comMessage ref="comMessage"></comMessage>
</view> </view>
</template> </template>
@ -70,7 +74,8 @@
import { import {
getInventoryStatusDesc, getInventoryStatusDesc,
getDirectoryItemArray, getDirectoryItemArray,
getPackUnitName getPackUnitName,
getUomInfo
} from '@/common/directory.js'; } from '@/common/directory.js';
import { import {
@ -113,15 +118,16 @@
fromLocationCode: "", fromLocationCode: "",
isShowLocation: false, isShowLocation: false,
fromlocationTypeList: [], fromlocationTypeList: [],
fromLocationAreaTypeList: [],
tolocationTypeList: [], tolocationTypeList: [],
inInventoryStatus: "", // inInventoryStatus: "", //
outInventoryStatus: "", // outInventoryStatus: "", //
businessType: {}, businessType: {},
dataContent: {}, dataContent: {},
packUnit: "", fromPackUnit: "",
packageList: [], packageList: [],
show: false, show: false,
toPackUnit:"包装规格", toPackUnitShow: "包装规格",
toPackQty: "", toPackQty: "",
itemCode: "" itemCode: ""
}; };
@ -132,13 +138,13 @@
if (res.success) { if (res.success) {
this.businessType = res.businessType; this.businessType = res.businessType;
this.fromlocationTypeList = res.fromlocationTypeList; this.fromlocationTypeList = res.fromlocationTypeList;
this.fromLocationAreaTypeList = res.fromLocationAreaTypeList
this.tolocationTypeList = res.tolocationTypeList; this.tolocationTypeList = res.tolocationTypeList;
this.showFromLocationPopup(); this.showFromLocationPopup();
} else { } else {
this.showErrorMessage(res.message) this.showErrorMessage(res.message)
} }
}); });
// this.getPackUnitByItemCode("LENS")
}, },
// //
onNavigationBarButtonTap(e) { onNavigationBarButtonTap(e) {
@ -154,6 +160,14 @@
mounted() {}, mounted() {},
methods: { methods: {
getUomInfo(uom) {
let item = getUomInfo(uom);
if (item == '') {
return uom;
} else {
return item.label
}
},
scanPopupPack() { scanPopupPack() {
this.$refs.scanPopupPack.openScanPopup(); this.$refs.scanPopupPack.openScanPopup();
}, },
@ -162,7 +176,8 @@
if (res.data != null && res.data.list.length > 0) { if (res.data != null && res.data.list.length > 0) {
res.data.list.forEach(item => { res.data.list.forEach(item => {
item.value = item.packQty; item.value = item.packQty;
item.label = item.packUnit; item.label = item.packUnit + "/" + item.packQty + this
.getUomInfo(item.uom);
}) })
this.packageList = res.data.list this.packageList = res.data.list
this.show = true; this.show = true;
@ -176,24 +191,21 @@
}, },
confirmSelect(e) { confirmSelect(e) {
this.toPackQty = e[0].value; if (this.fromPackUnit == e[0].label) {
this.toPackUnit = e[0].label; this.showErrorMessage("来源包装规格【" + this.fromPackUnit + "】与目标包装规格【" + e[0].label + "】不能相等")
}, return
getPackUnitByItemCode(itemCode){ }
getPackUnitByItemCode(itemCode).then(res=>{ this.toPackUnitShow = e[0].label
res.data.list.forEach(item => { var toPackUnit = e[0].label.split("/")[0]
item.value = item.packQty; this.toPackUnit =toPackUnit
item.label = item.packUnit; this.toPackQty = e[0].value
})
this.packageList = res.data.list
})
}, },
getScanResult(result) { getScanResult(result) {
let balance = result.balance; let balance = result.balance;
let label = result.label; let label = result.label;
let pack = result.package; let pack = result.package;
this.packUnit = pack.packUnit; this.fromPackUnit = pack.packUnit;
var item = this.detailSource.find(res => { var item = this.detailSource.find(res => {
if (res.itemCode == balance.itemCode) { if (res.itemCode == balance.itemCode) {
return res return res
@ -245,9 +257,6 @@
}); });
}, },
updateData() {
this.calcHandleQty();
},
removeItem(index, item) { removeItem(index, item) {
this.detailSource.splice(index, 1) this.detailSource.splice(index, 1)
}, },
@ -285,13 +294,37 @@
this.$refs.scanPopup.getfocus(); this.$refs.scanPopup.getfocus();
} }
}, },
commit() { commit() {
if (this.detailSource.length > 0 && this.detailSource[0].subList.length > 0) { if (this.detailSource.length > 0 && this.detailSource[0].subList.length > 0) {
if(this.toPackUnit=="目标包装"){ if (this.toPackUnit == "包装规格") {
this.showErrorMessage("请选择目标包装规格") this.showErrorMessage("请选择目标包装规格")
return; return;
} }
this.checkSubmit();
} else {
this.showErrorMessage("没有要扫描的数据")
}
},
checkSubmit() {
var tempHandleQty = this.detailSource[0].subList[0].handleQty
var toPackQty = this.toPackQty;
//
if (tempHandleQty % toPackQty > 0) {
// var count = Math.ceil(tempHandleQty / toPackQty);
this.$refs.comMessage.showQuestionMessage( "扫描数量【" + tempHandleQty +
"】,将有1个非整包,是否提交?", res => {
if (res) {
this.submitJob()
}
});
} else {
this.submitJob()
}
},
submitJob() {
uni.showLoading({ uni.showLoading({
title: "提交中....", title: "提交中....",
mask: true mask: true
@ -310,9 +343,6 @@
uni.hideLoading() uni.hideLoading()
this.showErrorMessage(error) this.showErrorMessage(error)
}) })
} else {
this.showErrorMessage("没有要扫描的数据")
}
}, },
@ -335,6 +365,9 @@
subItem.fromPackingNumber = detail.packingNumber; subItem.fromPackingNumber = detail.packingNumber;
subItem.fromBatch = detail.batch; subItem.fromBatch = detail.batch;
subItem.fromLocationCode = detail.locationCode; subItem.fromLocationCode = detail.locationCode;
subItem.fromPackUnit = detail.packUnit;
subItem.fromPackQty = detail.packQty;
subItem.toPackQty = this.toPackQty; subItem.toPackQty = this.toPackQty;
subItem.toPackUnit = this.toPackUnit; subItem.toPackUnit = this.toPackUnit;
subItem.package = "" subItem.package = ""

Loading…
Cancel
Save