Browse Source

整理预生产上架功能

hella_online_20240829
niexiting 2 months ago
parent
commit
085868a42b
  1. 19
      src/common/array.js
  2. 13
      src/common/record.js
  3. 26
      src/mycomponents/record/recordComDetailCard.vue
  4. 14
      src/mycomponents/scan/winScanPackage.vue
  5. 94
      src/pages/productPutaway/record/productPutawayRecord.vue

19
src/common/array.js

@ -278,6 +278,25 @@ export function getEditRemoveOption() {
}
//详情编辑移除
export function getEditLocationRemoveOption() {
let option_edit_remove = [{
text: '修改\n库位',
style: {
backgroundColor: '#F1A532'
}
},
{
text: '移除',
style: {
backgroundColor: '#F56C6C'
}
}
];
return option_edit_remove;
}
// 库存状态字典项
export function getInventoryStatusArray() {
let array = [{

13
src/common/record.js

@ -5,8 +5,12 @@ import {
import {
getDirectoryItemArray,
} from '@/common/directory.js';
import { calc } from '@/common/calc'
import { Decimal } from 'decimal.js';//引入
import {
calc
} from '@/common/calc'
import {
Decimal
} from 'decimal.js'; //引入
import {
deepCopyData
} from '@/common/basic.js';
@ -20,8 +24,11 @@ export function createItemInfo(balance, pack) {
qty: new Decimal(balance.qty).toNumber(),
handleQty: new Decimal(0).toNumber(),
uom: pack.uom,
subList: []
subList: [],
// packingNumber: pack.number,
// parentPackingNumber: pack.parentNumber,
}
item.containerNumber = pack.parentNumber != null ? pack.parentNumber : pack.number;
return item;
}

26
src/mycomponents/record/recordComDetailCard.vue

@ -7,6 +7,10 @@
<uni-swipe-action-item @click="removeItem($event,dataContent)" :right-options="removeOptions">
<item-qty :dataContent="dataContent" :isShowBalance="true"
:isShowBalanceQty="isShowBalanceQty"></item-qty>
<view style="margin-left: 10px; margin-top: 5px;">
<pack title='父包装' :packingCode='dataContent.containerNumber'></pack>
<location title='目标库位' :locationCode='dataContent.toLocationCode'></location>
</view>
</uni-swipe-action-item>
</uni-swipe-action>
</template>
@ -40,11 +44,14 @@
import purchaseLabel from '@/mycomponents/balance/purchaseLabel.vue'
import location from '@/mycomponents/balance/location.vue'
import recordDetailPopup from '@/mycomponents/detail/recordDetailPopup.vue'
import pack from '@/mycomponents/balance/pack.vue'
import PackageAndItemCard from '@/mycomponents/package/PackageAndItemCard.vue'
import {
getDetailOption,
getDetailEditRemoveOption,
getClearOption
getClearOption,
getEditLocationRemoveOption
} from '@/common/array.js';
export default {
components: {
@ -55,7 +62,9 @@
balanceDetailPopup,
purchaseLabel,
location,
recordDetailPopup
recordDetailPopup,
pack,
PackageAndItemCard
// winListHint
},
props: {
@ -124,19 +133,21 @@
mounted() {
this.detailOptions = getDetailOption();
this.scanOptions = getDetailEditRemoveOption();
this.removeOptions = getClearOption();
this.removeOptions = getEditLocationRemoveOption();
},
methods: {
removeItem(e, dataContent) {
if (e.content.text == "清空") {
if (e.content.text == "移除") {
this.$refs.comMessage.showQuestionMessage("确定清空物料及箱码信息?",
res => {
if (res) {
this.$emit('removeItem')
this.$emit('removeItem',dataContent)
// this.$emit('removeItem', this.dataContent)
}
});
} else {
this.editLocation(dataContent)
}
},
swipeClick(e, item, index) {
@ -169,6 +180,11 @@
});
},
editLocation(item) {
this.editItem = item;
this.$emit('editLocation', item)
},
confirm(qty) {
// this.editItem.qty = qty;
this.editItem.handleQty = qty;

14
src/mycomponents/scan/winScanPackage.vue

@ -172,7 +172,16 @@
pageSize: 100,
}
getBalanceByFilter(params).then(res => {
if (res.data.list.length == 0) {
if (res.data.list.length > 0) {
res.data.list.forEach(r => {
if (packageInfo.parentNumber !== null) {
r.parentPackingNumber = packageInfo.parentNumber
} else {
r.parentPackingNumber = packageInfo.number
}
})
callback(res.data.list)
} else {
//
if (packageInfo.subList.length > 0) {
let packparams = '';
@ -194,6 +203,7 @@
this.packGetFocus();
})
} else {
res1.data.list.forEach(r => r.parentPackingNumber = packageInfo.number)
callback(res1.data.list)
}
}).catch(err => {
@ -204,8 +214,6 @@
this.packGetFocus();
})
}
} else {
callback(res.data.list)
}
}).catch(err => {
this.showErrorMessage(err.message);

94
src/pages/productPutaway/record/productPutawayRecord.vue

@ -11,10 +11,9 @@
<view class="">
<record-com-detail-card :dataContent="item" :index="index" :settingParam="dataContent"
:isShowStatus="true" :isShowToLocation='false' @removeItem="removeItem(index,item)"
@updateData="updateData" @removePack="removePack">
@updateData="updateData" @removePack="removePack" @editLocation="showScanToLocation">
</record-com-detail-card>
</view>
<view class='split_line'></view>
</view>
</scroll-view>
</view>
@ -23,10 +22,12 @@
<view class="uni-flex u-col-center space-between padding_10"
style="background-color:ghostwhite; width: 100%; ">
<view class="">
<requiredLocation title="目标库位" :locationCode="toLocationCode" @getLocation='getToLocationCode'
:locationAreaTypeList="tolocationTypeList"></requiredLocation>
<!-- <requiredLocation title="目标库位" :locationCode="toLocationCode" @getLocation='getToLocationCode'
:locationAreaTypeList="tolocationTypeList"></requiredLocation> -->
</view>
<view class=" uni-flex uni-row">
<button class="btn_single_reject" style="margin-right:5px ;" hover-class="btn_commit_after"
@click="commit">取消</button>
<button class="btn_single_commit" hover-class="btn_commit_after" @click="commit">提交</button>
</view>
</view>
@ -34,13 +35,16 @@
<win-scan-button @goScan='openScanPopup'></win-scan-button>
</view>
<win-scan-package ref="scanPopup" @getResult='getScanResult'></win-scan-package>
<win-scan-location ref="scanLocationCode" title="目标库位" @getLocation='getToLocationCode'
:locationAreaTypeList="toLocationAreaTypeList"></win-scan-location>
<comMessage ref="comMessage"></comMessage>
</view>
</template>
<script>
import {
productPutawayRecordSubmit
productPutawayRecordSubmit,
getPutawayRecommendLocation
} from '@/api/request2.js';
import {
goHome,
@ -69,12 +73,12 @@
import comBlankView from '@/mycomponents/common/comBlankView.vue'
import recordComDetailCard from '@/mycomponents/record/recordComDetailCard.vue'
import winScanPackage from '@/mycomponents/scan/winScanPackage.vue'
import winScanLocation from "@/mycomponents/scan/winScanLocation.vue"
import {
updateTitle
} from '@/common/basic.js';
export default {
components: {
winScanButton,
@ -82,7 +86,8 @@
requiredLocation,
comBlankView,
recordComDetailCard,
winScanPackage
winScanPackage,
winScanLocation
},
data() {
return {
@ -100,7 +105,8 @@
bussinessCode: "ProductPutaway",
businessType: {},
managementList: [],
type: ''
type: '',
editItem: null
};
},
onLoad(option) {
@ -118,6 +124,7 @@
if (res.success) {
this.businessType = res.businessType;
this.fromLocationAreaTypeList = res.fromLocationAreaTypeList;
this.toLocationAreaTypeList = res.toLocationAreaTypeList;
this.tolocationTypeList = res.tolocationTypeList;
this.openScanPopup();
} else {
@ -144,13 +151,18 @@
let pack = result.package;
result.balance.forEach(
balance => {
var item = this.detailSource.find(res => {
if (res.itemCode == balance.itemCode) {
let item = this.detailSource.find(res => {
if (res.itemCode == balance.itemCode && res.containerNumber == balance
.parentPackingNumber) {
return res
}
})
if (item == undefined) {
var itemp = createItemInfo(balance, pack);
//
this.getRecommendLocation(balance, res => {
itemp.toLocationCode = res.code;
})
let newDetail = createDetailInfo(balance, pack); //
newDetail.fromInventoryStatus = balance.inventoryStatus;
itemp.subList.push(newDetail);
@ -180,6 +192,41 @@
)
},
getRecommendLocation(balance, callback) {
uni.showLoading({
title: '扫描中...',
mask: true
})
let param = {
itemCode: balance.itemCode,
batch: balance.batch,
inventoryStatus: balance.inventoryStatus,
supplierCode: '',
businessCode: this.bussinessCode
};
console.log(JSON.stringify(param))
getPutawayRecommendLocation(param).then(res => {
callback(res.data);
uni.hideLoading();
}).catch(error => {
uni.hideLoading()
this.showErrorMessage(error);
})
},
//
removeRecommendLocation() {
this.showMessage('移除推荐的预占用库位')
},
showScanToLocation(item) {
this.editItem = item;
setTimeout(r => {
this.$refs.scanLocationCode.openScanPopup();
})
},
showErrorMessage(message) {
this.$refs.comMessage.showErrorMessage(message, res => {});
},
@ -192,6 +239,7 @@
this.calcHandleQty();
},
removeItem(index, item) {
this.removeRecommendLocation();
this.detailSource.splice(index, 1)
},
removePack() {
@ -199,6 +247,7 @@
var item = this.detailSource[i];
if (item.subList.length == 0) {
this.detailSource.splice(i, 1)
this.removeRecommendLocation(item)
}
}
this.updateData();
@ -208,17 +257,9 @@
setTimeout(r => {
this.$refs.scanPopup.openScanPopupByBusinessType(this.businessType);
})
// setTimeout(r => {
// this.$refs.scanPopup.openScanPopup(this.businessType);
// this.scanPopupGetFocus();
// })
},
// showFromLocationPopup() {
// this.$nextTick(() => {
// this.$refs.scanLocationCode.openScanPopup();
// })
// },
closeScanPopup() {
if (this.$refs.scanPopup != undefined) {
this.$refs.scanPopup.closeScanPopup();
@ -383,20 +424,9 @@
closeScanMessage() {
this.scanPopupGetFocus();
},
getLocation(location, code) {
this.getFromLocationCode(location, code)
},
getFromLocationCode(location, code) {
this.fromLocationCode = code;
this.openScanPopup();
},
getToLocationCode(location, code) {
this.toLocationCode = code;
this.detailSource.forEach(item => {
item.subList.forEach(detail => {
detail.toLocationCode = this.toLocationCode
})
})
this.editItem.toLocationCode = code;
},
showCommitSuccessMessage(hint) {

Loading…
Cancel
Save