Browse Source

YT-2317启用翻包功能

intex_online20250408
张立 1 month ago
parent
commit
ff519eb7ec
  1. 10
      src/api/request2.js
  2. 4
      src/manifest.json
  3. 3
      src/mycomponents/balance/balance.vue
  4. 39
      src/mycomponents/balance/boardNumber.vue
  5. 14
      src/mycomponents/item/itemQty.vue
  6. 7
      src/mycomponents/qty/compareQty.vue
  7. 26
      src/mycomponents/record/recordComDetailCard.vue
  8. 154
      src/pages/package/record/overPackageRecord.vue

10
src/api/request2.js

@ -4973,6 +4973,14 @@ export function deptList() {
method: "get",
});
}
/**
* 获取翻包打印数据
*/
export function printPurchaseLabel(requestNumber) {
return request({
url: baseApi + `/wms/packageover-record-main/printPurchaseLabel?id=&request_number=${requestNumber}`,
method: "get",
});
}

4
src/manifest.json

@ -3,8 +3,8 @@
"package" : "com.yingtai.pda",
"appid" : "__UNI__F36DDCF",
"description" : "",
"versionName" : "1.0.7",
"versionCode" : 7,
"versionName" : "1.0.8",
"versionCode" : 8,
"transformPx" : false,
/* 5+App */
"app-plus" : {

3
src/mycomponents/balance/balance.vue

@ -7,6 +7,7 @@
<pack v-if="isShowPack && dataContent.packingNumber"
:isShowPackingNumberProps="isShowPackingNumberProps"
:packingCode="dataContent.packingNumber"></pack>
<board-number v-if="dataContent.boardNumber" :packingCode="dataContent.boardNumber"></board-number>
<batch v-if="isShowBatch && dataContent.batch" :batch="dataContent.batch"></batch>
<location title="来源库位" v-if="isShowFromLocation" :locationCode="dataContent.locationCode"></location>
<to-location title="目标库位" v-if="isShowToLocation" :locationCode="dataContent.toLocationCode">
@ -38,6 +39,7 @@
</template>
<script>
import boardNumber from '@/mycomponents/balance/boardNumber.vue'
import pack from '@/mycomponents/balance/pack.vue'
import location from '@/mycomponents/balance/location.vue'
import toLocation from '@/mycomponents/balance/toLocation.vue'
@ -51,6 +53,7 @@
export default {
components: {
pack,
boardNumber,
location,
toLocation,
batch,

39
src/mycomponents/balance/boardNumber.vue

@ -0,0 +1,39 @@
<template>
<view class="card_view" >
<text class="card_packing_code ">{{title}}</text>
<text class="card_content ">{{packingCode}}</text>
</view>
</template>
<script>
import {
getSwitchInfoByCode
} from '@/common/basic.js';
export default {
components: {
},
data() {
return {
};
},
props: {
packingCode: {
type: String,
default: ''
},
title:{
type:String,
default: '看板编号'
},
},
mounted() {
},
methods: {
}
}
</script>
<style>
</style>

14
src/mycomponents/item/itemQty.vue

@ -1,14 +1,14 @@
<template>
<view class="uni-flex uni-row space-between center" style=" margin-left: 15px;">
<view>
<item :dataContent="dataContent"></item>
<item :dataContent="dataContent" :isSpecial="isSpecial"></item>
</view>
<view>
<balance-qty v-if="isShowBalanceQty" :dataContent="dataContent"></balance-qty>
<compare-qty v-else :dataContent="dataContent" :recommendQty="Number(dataContent.qty)"
:handleQty="dataContent.handleQty"
:isShowRecommendQty="isShowRecommendQty"
:isShowStatus="false" :isShowStdPack="showStdPack">
:isShowStatus="false" :isShowStdPack="showStdPack" :isShowNumView='isShowNumView'>
</compare-qty>
</view>
</view>
@ -51,7 +51,15 @@
type: Boolean,
default: true
},
isSpecial: {
type: Boolean,
default: false
},
//
isShowNumView: {
type: Boolean,
default: true
},
},
watch: {

7
src/mycomponents/qty/compareQty.vue

@ -1,7 +1,7 @@
<template>
<view>
<status v-show="isShowStatus && dataContent.inventoryStatus" :status='dataContent.inventoryStatus'></status>
<view class="uni-flex uni-row center">
<view class="uni-flex uni-row center" v-if="isShowNumView">
<view class="uni-flex uni-row ">
<view v-if="Number(handleQty)!=0">
@ -102,6 +102,11 @@
type: Boolean,
default: false
},
//
isShowNumView: {
type: Boolean,
default: true
},
},
watch: {
handleQty: {

26
src/mycomponents/record/recordComDetailCard.vue

@ -8,6 +8,8 @@
<item-qty :dataContent="dataContent" :isShowBalance="true"
:isShowBalanceQty="isShowBalanceQty"
:isShowRecommendQty="isShowRecommendQty"
:isSpecial='isSpecial'
:isShowNumView='isShowNumView'
></item-qty>
<view style="margin-left: 10px; margin-top: 5px;">
<pack title='父包装' v-if="dataContent.containerNumber" :packingCode='dataContent.containerNumber'></pack>
@ -28,6 +30,14 @@
:isShowFromLocation="isShowFromLocation"
:isShowToLocation="isShowToLocation" :isShowParentPack="isShowParentPack" >
</balance>
<view class="flex u-m-t-20 align-center">
<view>每包数量</view>
<u-number-box v-model="detail.flippedNumber" :min='1' :max='9999' @change="valChange($event,detail)"></u-number-box>
</view>
<view class="flex u-m-t-20 align-center">
<view>包装数量</view>
<view>{{detail.everyPackageQty}}</view>
</view>
</uni-swipe-action-item>
</uni-swipe-action>
<!-- <view class='split_line'></view> -->
@ -139,9 +149,16 @@
isShowRecommendQty:{
type: Boolean,
default: true
}
},
isSpecial: {
type: Boolean,
default: false
},
//
isShowNumView: {
type: Boolean,
default: true
},
},
watch: {
@ -236,6 +253,9 @@
// this.editItem.qty = qty;
this.editItem.handleQty = qty;
this.$emit('updateData')
},
valChange(e,item){
item.everyPackageQty =Math.ceil(item.qty /e.value )
}
}
}

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

@ -30,7 +30,8 @@
<view class="">
<record-com-detail-card :dataContent="item" :index="index"
@removeItem="removeItem(index,item)" @updateData="updateData" @removePack="removePack"
:isShowFromLocation="false" :isShowToLocation="false">
:isShowFromLocation="false" :isShowToLocation="false" :isSpecial='true'
:isShowNumView='false' :isShowParentToLocation='false' :isShowStatus='false'>
</record-com-detail-card>
</view>
<view class='split_line'></view>
@ -42,7 +43,7 @@
<view class="uni-flex u-col-center space-between padding_10"
style="background-color:ghostwhite; width: 100%; ">
<view class="">
<view class="uni-flex uni-row">
<!-- <view class="uni-flex uni-row">
<text>目标包装规格:</text>
<view class="uni-flex u-col-center uni-row" @click="showPackage">
<view class="" style="margin-left: 5rpx;width: 100%;">
@ -52,7 +53,7 @@
@confirm="confirmSelect">
</u-select>
</view>
</view>
</view> -->
</view>
<view class=" uni-flex uni-row">
@ -60,7 +61,7 @@
</view>
</view>
</view>
<win-scan-button @goScan='openScanPopup'></win-scan-button>
<!-- <win-scan-button @goScan='openScanPopup'></win-scan-button> -->
</view>
<winComScanBalance ref="scanPopup"
@ -81,7 +82,8 @@
import {
overPackageRecordSubmit,
getPackUnitByItemCode,
getBalanceByParams
getBalanceByParams,
printPurchaseLabel
} from '@/api/request2.js';
import {
deepCopyData,
@ -167,16 +169,6 @@
uni.setNavigationBarTitle({
title: option.title
})
this.getBusinessType();
// this.$nextTick(()=>{
// if(uni.getStorageSync('overPackageRecordPointParams')){
// const overPackageRecordPointParams = uni.getStorageSync('overPackageRecordPointParams')
// this.dataContent.printerUuid = overPackageRecordPointParams.printDeafult.value;
// this.dataContent.modelCode = overPackageRecordPointParams.templateDeafult.value;
// this.$refs.printService.setDefaultData(overPackageRecordPointParams.printDeafult,overPackageRecordPointParams.templateDeafult)
// }
// })
},
//
onNavigationBarButtonTap(e) {
@ -258,6 +250,7 @@
let balance = result.balance;
let label = result.label;
let pack = result.package;
console.log(result)
this.fromPackUnit = pack.packUnit;
this.fromPack = pack;
if(this.fromLocationCode&&this.fromLocationCode!=balance.locationCode){
@ -277,11 +270,13 @@
}
var itemp = createItemInfo(balance, pack);
let newDetail = createDetailInfo(balance, pack); //
if(balance.lableQty){
newDetail.handleQty =balance.lableQty
}
newDetail.handleQty =0
newDetail.qty =label.qty
newDetail.parentNumber =pack.parentNumber;
newDetail.packingNumber =pack.number
newDetail.boardNumber =pack.number.substring(pack.number.length - 5);
newDetail.flippedNumber =1
newDetail.everyPackageQty =Math.ceil(newDetail.qty /newDetail.flippedNumber )
itemp.subList.push(newDetail);
this.detailSource.push(itemp)
this.itemCode = balance.itemCode;
@ -298,11 +293,13 @@
})
if (detail == undefined) {
let newDetail = createDetailInfo(balance, pack);
if(balance.lableQty){
newDetail.handleQty =balance.lableQty
}
newDetail.handleQty =0
newDetail.qty =label.qty
newDetail.parentNumber =pack.parentNumber;
newDetail.packingNumber =pack.number
newDetail.boardNumber =pack.number.substring(pack.number.length - 5);
newDetail.flippedNumber =1
newDetail.everyPackageQty =Math.ceil(newDetail.qty /newDetail.flippedNumber )
item.subList.push(newDetail);
this.scanPopupGetFocus()
} else {
@ -311,7 +308,6 @@
}
}
}
this.calcHandleQty();
},
calcHandleQty() {
@ -366,25 +362,12 @@
}
},
commit() {
// if(!this.dataContent.printerUuid){
// this.showErrorMessage("")
// return;
// }
// if(!this.dataContent.modelCode){
// this.showErrorMessage("")
// return;
// }
if (this.detailSource.length > 0 && this.detailSource[0].subList.length > 0) {
if (!this.toPackUnit || this.toPackUnit == "包装规格") {
this.showErrorMessage("请选择目标包装规格")
return;
}
if(this.fromPackUnit==this.toPackUnit){
this.showErrorMessage("来源包装规格与目标包装规格一致,不能进行翻包操作")
return;
this.$refs.comMessage.showQuestionMessage("是否确认翻包?", res => {
if (res) {
this.submitJob()
}
this.checkSubmit();
});
} else {
this.showErrorMessage("没有要扫描的数据")
@ -420,44 +403,18 @@
});
var params = this.setParams();
console.log(params)
overPackageRecordSubmit(params).then(res => {
uni.hideLoading()
// if (res.data == '') {
// this.showCommitSuccessMessage(res.data)
// const overPackageRecordPointParams = {
// printDeafult:this.printDeafult,
// templateDeafult:this.templateDeafult,
// }
// uni.setStorageSync('overPackageRecordPointParams',overPackageRecordPointParams)
// this.detailSource = []
// }else {
// this.showErrorMessage(res.data)
// }
if (res.data) {
let list = []
res.data.forEach(item => {
list.push({
itemCode: item.itemCode, //
itemName: item.itemName, //
packName: item.packName, //
packageCode: item.toPackingNumber, //
batch: item.toBatch, //
parentNumber: item.parentNumber, //
itemType: item.itemType, //
asnNumber: item.asnNumber, //ASN
supplierCode: item.supplierCode, //
qty: item.qty, //
printTimes: getCurrDateTime(), //
productionLineCode: item.productionLineCode, //线
barcodeString: item.barcodeString, //
barcodeBase64: '',
})
printPurchaseLabel('REC3920250403-0002').then(res1=>{
this.showCommitSuccessMessage('提交成功\n生成翻包记录!',res1.data.list)
}).catch(err=>{
console.log(55,err)
})
this.showCommitSuccessMessage("提交成功\n生成翻包记录\n", list)
}else {
this.showErrorMessage("提交失败[" + res.msg + "]")
this.showErrorMessage(res.data)
}
}).catch(error => {
uni.hideLoading()
@ -467,46 +424,30 @@
},
setParams() {
var subList = []
var obj = {}
var creator = this.$store.state.user.id
this.detailSource.forEach(item => {
item.subList.forEach(detail => {
if (detail.scaned) {
var subItem = deepCopyData(detail);
subItem.itemCode = detail.itemCode;
subItem.itemName = detail.package.itemName;
subItem.itemDesc1 = detail.package.itemDesc1;
subItem.itemDesc2 = detail.package.itemDesc2;
subItem.fromInventoryStatus = detail.inventoryStatus;
subItem.fromQty = detail.handleQty
subItem.fromParentPackingNumber =detail.parentNumber;
subItem.fromPackingNumber = detail.packingNumber;
subItem.fromBatch = detail.batch;
subItem.fromLocationCode = detail.locationCode;
subItem.fromPackUnit = detail.packUnit;
subItem.fromPackQty = detail.packQty;
subItem.toPackQty = this.toPackQty;
subItem.toPackUnit = this.toPackUnit;
subItem.package = ""
subList.push(subItem)
// var subItem = deepCopyData(detail);
obj.locationCode = detail.locationCode;
obj.fromPackingNumber = detail.packingNumber
obj.fromBatch = detail.batch
obj.fromInventoryStatus = detail.inventoryStatus
obj.itemCode = detail.itemCode
obj.fromPackUnit = detail.packUnit
obj.fromPackQty = detail.packQty
obj.toPackUnit = detail.packUnit
obj.toPackQty = detail.packQty
obj.flippedNumber = detail.flippedNumber
obj.everyPackageQty = detail.everyPackageQty
obj.qty = detail.qty
}
})
})
this.dataContent.subList = subList;
this.dataContent.creator = creator;
return this.dataContent;
return obj;
},
// printCode(e){
// this.dataContent.printerUuid = e.value;
// this.printDeafult = e
// },
// templateCode(e){
// this.dataContent.modelCode = e.value;
// this.templateDeafult = e
// },
showMessage(message) {
this.$refs.comMessage.showMessage(message, res => {
if (res) {}
@ -538,11 +479,8 @@
this.toPackUnitShow ="请选择"
this.toPackQty = ""
if (pointData.length > 0) {
pointData.forEach(item=>{
item.fromLocationCode = fromLocationCode
})
uni.navigateTo({
url: `/pages/point/index?points=${JSON.stringify(pointData)}`
url: `/pages/pointSplitLabel/index?points=${JSON.stringify(pointData)}`
});
}

Loading…
Cancel
Save