Browse Source

page/productDismantle 文件迁移 8/8-10/25

pull/1/head
test 4 months ago
parent
commit
54ddb6bef0
  1. 1081
      src/pages/productDismantle/job/productDismantleDetail.vue
  2. 719
      src/pages/productDismantle/record/productDismantleRecord.vue

1081
src/pages/productDismantle/job/productDismantleDetail.vue

File diff suppressed because it is too large

719
src/pages/productDismantle/record/productDismantleRecord.vue

@ -1,373 +1,362 @@
<template> <template>
<view class="page-wraper"> <view class="page-wraper">
<view class=""> <view class="">
<com-blank-view @goScan='showFromLocationPopup' v-if="detailSource.length==0"></com-blank-view> <com-blank-view @goScan='showFromLocationPopup' v-if="detailSource.length==0"></com-blank-view>
</view> </view>
<view class="page-wraper" v-if="detailSource.length>0"> <view class="page-wraper" v-if="detailSource.length>0">
<view class="page-main"> <view class="page-main">
<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="">
<record-com-detail-card :dataContent="item" :index="index" :settingParam="jobContent" <record-com-detail-card :dataContent="item" :index="index" :settingParam="jobContent"
@removeItem="removeItem(index,item)" @updateData="updateData" @removePack="removePack"> @removeItem="removeItem(index,item)" @updateData="updateData" @removePack="removePack">
</record-com-detail-card> </record-com-detail-card>
</view> </view>
<view class='split_line'></view> <view class='split_line'></view>
</view> </view>
</scroll-view> </scroll-view>
</view> </view>
<requiredLocation title="目标库位" :locationCode="toLocationCode" @getLocation='getToLocationCode' <requiredLocation title="目标库位" :locationCode="toLocationCode" @getLocation='getToLocationCode'
:locationAreaTypeList="toLocationAreaTypeList"></requiredLocation> :locationAreaTypeList="toLocationAreaTypeList"></requiredLocation>
<view class="page-footer"> <view class="page-footer">
<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> </view>
<view class=" uni-flex uni-row"> <view class=" uni-flex uni-row">
<button class="btn_single_commit" hover-class="btn_commit_after" @click="commit">提交</button> <button class="btn_single_commit" hover-class="btn_commit_after" @click="commit">提交</button>
</view> </view>
</view> </view>
</view> </view>
<win-scan-button @goScan='openScanPopup'></win-scan-button> <win-scan-button @goScan='openScanPopup'></win-scan-button>
</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'></win-scan-pack-and-location>
<win-scan-location ref="scanLocationCode" title="来源库位" @getLocation='getLocation' <win-scan-location ref="scanLocationCode" title="来源库位" @getLocation='getLocation'
:locationAreaTypeList="fromLocationAreaTypeList"></win-scan-location> :locationAreaTypeList="fromLocationAreaTypeList"></win-scan-location>
<comMessage ref="comMessage"></comMessage> <comMessage ref="comMessage"></comMessage>
</view> </view>
</template> </template>
<script> <script>
import { import {
productDismantleRecordSubmit productDismantleRecordSubmit
} from '@/api/request2.js'; } from '@/api/request2.js';
import { import {
goHome, goHome,
} from '@/common/basic.js'; } from '@/common/basic.js';
import { import {
getInventoryStatusDesc, getInventoryStatusDesc,
getDirectoryItemArray getDirectoryItemArray
} from '@/common/directory.js'; } from '@/common/directory.js';
import { import {
getBusinessType, getBusinessType,
createItemInfo, createItemInfo,
createDetailInfo, createDetailInfo,
calcHandleQty calcHandleQty
} from '@/common/record.js'; } from '@/common/record.js';
import winScanButton from '@/mycomponents/scan/winScanButton.vue' import winScanButton from '@/mycomponents/scan/winScanButton.vue'
import winScanPack from '@/mycomponents/scan/winScanPack.vue' import winScanPack from '@/mycomponents/scan/winScanPack.vue'
import requiredLocation from '@/mycomponents/location/requiredLocation.vue' import requiredLocation from '@/mycomponents/location/requiredLocation.vue'
import comProductionRecord from '@/pages/productionReceipt/coms/comProductionRecord.vue' import comProductionRecord from '@/pages/productionReceipt/coms/comProductionRecord.vue'
import comBlankView from '@/mycomponents/common/comBlankView.vue' import comBlankView from '@/mycomponents/common/comBlankView.vue'
import winScanLocation from "@/mycomponents/scan/winScanLocation.vue" import winScanLocation from "@/mycomponents/scan/winScanLocation.vue"
import winScanPackAndLocation from "@/mycomponents/scan/winScanPackAndLocation.vue" import winScanPackAndLocation from "@/mycomponents/scan/winScanPackAndLocation.vue"
import recordComDetailCard from '@/mycomponents/record/recordComDetailCard.vue' import recordComDetailCard from '@/mycomponents/record/recordComDetailCard.vue'
export default { export default {
components: { components: {
winScanButton, winScanButton,
winScanPack, winScanPack,
comProductionRecord, comProductionRecord,
requiredLocation, requiredLocation,
comBlankView, comBlankView,
winScanLocation, winScanLocation,
winScanPackAndLocation, winScanPackAndLocation,
recordComDetailCard recordComDetailCard
}, },
data() { data() {
return { return {
id: '', id: '',
receiptJob: {}, receiptJob: {},
received: false, received: false,
isShowPackingCode: true, isShowPackingCode: true,
scanCount: 0, scanCount: 0,
jobContent: {}, // jobContent: {}, //
detailList: [], //subList detailList: [], //subList
detailSource: [], // detailSource: [], //
toLocationInfo: {}, toLocationInfo: {},
businessTypeInfo: {}, businessTypeInfo: {},
fromLocationInfo: {}, fromLocationInfo: {},
fromLocationCode: "", fromLocationCode: "",
toLocationCode: "", toLocationCode: "",
isShowLocation: false, isShowLocation: false,
fromLocationAreaTypeList: [], fromLocationAreaTypeList: [],
toLocationAreaTypeList: [], toLocationAreaTypeList: [],
allowModifyLocation: false, allowModifyLocation: false,
inInventoryStatus: "", // inInventoryStatus: "", //
outInventoryStatus: "", // outInventoryStatus: "", //
businessType: {} businessType: {}
}; };
}, },
onLoad(option) { onLoad(option) {
var typeCode = "ProductPutaway" var typeCode = "ProductPutaway"
getBusinessType(typeCode, res => { getBusinessType(typeCode, res => {
if (res.success) { if (res.success) {
this.businessType = res.businessType; this.businessType = res.businessType;
this.fromLocationAreaTypeList = res.fromLocationAreaTypeList; this.fromLocationAreaTypeList = res.fromLocationAreaTypeList;
this.toLocationAreaTypeList = res.toLocationAreaTypeList; this.toLocationAreaTypeList = res.toLocationAreaTypeList;
this.showFromLocationPopup(); this.showFromLocationPopup();
} else { } else {
this.showErrorMessage(res.message) this.showErrorMessage(res.message)
} }
}); });
}, },
// //
onNavigationBarButtonTap(e) { onNavigationBarButtonTap(e) {
if (e.index === 0) { if (e.index === 0) {
goHome(); goHome();
} }
}, },
// //
onBackPress(e) {}, onBackPress(e) {},
onPullDownRefresh() {}, onPullDownRefresh() {},
mounted() {}, mounted() {},
methods: { methods: {
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;
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
} }
}) })
if (item == undefined) { if (item == undefined) {
var itemp = createItemInfo(balance, pack); var itemp = createItemInfo(balance, pack);
let newDetail = createDetailInfo(balance, pack); // let newDetail = createDetailInfo(balance, pack); //
itemp.subList.push(newDetail); itemp.subList.push(newDetail);
this.detailSource.push(itemp) this.detailSource.push(itemp)
} else { } else {
var detail = item.subList.find(r => { var detail = item.subList.find(r => {
if (r.packingNumber == balance.packingNumber && if (r.packingNumber == balance.packingNumber &&
r.batch == balance.batch && r.batch == balance.batch &&
r.locationCode == balance.locationCode && r.locationCode == balance.locationCode &&
r.inventoryStatus == balance.inventoryStatus) { r.inventoryStatus == balance.inventoryStatus) {
return r; return r;
} }
}) })
if (detail == undefined) { if (detail == undefined) {
let newDetail = createDetailInfo(balance, pack); let newDetail = createDetailInfo(balance, pack);
item.subList.push(newDetail); item.subList.push(newDetail);
} else { } else {
if (detail.scaned == true) { if (detail.scaned == true) {
this.showErrorMessage("箱码[" + balance.packingNumber + "批次[" + balance.batch + "]已经在列表中") this.showErrorMessage("箱码[" + balance.packingNumber + "批次[" + balance.batch + "]已经在列表中")
} }
} }
} }
this.calcHandleQty(); this.calcHandleQty();
}, },
showErrorMessage(message) { showErrorMessage(message) {
this.$refs.comMessage.showErrorMessage(message, res => { this.$refs.comMessage.showErrorMessage(message, res => {
if (res) { if (res) {
} }
}); });
}, },
calcHandleQty() { calcHandleQty() {
calcHandleQty(this.detailSource); calcHandleQty(this.detailSource);
this.$forceUpdate(); this.$forceUpdate();
}, },
updateData() { removeItem(index, item) {
this.calcHandleQty(); this.detailSource.splice(index, 1)
}, },
removeItem(index, item) { removePack() {
this.detailSource.splice(index, 1) for (var i = 0; i < this.detailSource.length; i++) {
}, var item = this.detailSource[i];
removePack() { if (item.subList.length == 0) {
for (var i = 0; i < this.detailSource.length; i++) { this.detailSource.splice(i, 1)
var item = this.detailSource[i]; }
if (item.subList.length == 0) { }
this.detailSource.splice(i, 1) this.updateData();
} },
}
this.updateData(); openScanPopup() {
}, if (this.fromLocationCode == "") {
this.showFromLocationPopup();
openScanPopup() { return
if (this.fromLocationCode == "") { }
this.showFromLocationPopup(); this.$refs.scanPopup.openScanPopupForType(this.fromLocationCode, this.businessType);
return },
} showFromLocationPopup() {
this.$refs.scanPopup.openScanPopupForType(this.fromLocationCode, this.businessType); this.$nextTick(() => {
}, this.$refs.scanLocationCode.openScanPopup();
showFromLocationPopup() { })
this.$nextTick(() => {
this.$refs.scanLocationCode.openScanPopup(); },
}) closeScanPopup() {
if (this.$refs.scanPopup != undefined) {
}, this.$refs.scanPopup.closeScanPopup();
closeScanPopup() { }
if (this.$refs.scanPopup != undefined) { },
this.$refs.scanPopup.closeScanPopup();
} scanPopupGetFocus() {
}, if (this.$refs.scanPopup != undefined) {
this.$refs.scanPopup.getfocus();
scanPopupGetFocus() { }
if (this.$refs.scanPopup != undefined) { },
this.$refs.scanPopup.getfocus();
} scanLocationCode(location, code) {
}, this.toLocationCode = code
this.toLocationCode = location;
scanLocationCode(location, code) {
this.toLocationCode = code },
this.toLocationCode = location;
commit() {
}, if (this.toLocationCode == "") {
this.showMessage("请先选择目标库位")
commit() { return;
if (this.toLocationCode == "") { }
this.showMessage("请先选择目标库位") //
return; uni.showLoading({
} title: "提交中....",
// mask: true
uni.showLoading({ });
title: "提交中....",
mask: true var params = this.setParams();
}); console.log("提交" + JSON.stringify(params))
// productDismantleRecordSubmit(params).then(res => {
var params = this.setParams(); // uni.hideLoading()
console.log("提交" + JSON.stringify(params)) // if (res.data) {
// productDismantleRecordSubmit(params).then(res => { // this.showCommitSuccessMessage("\n" + res.data, )
// uni.hideLoading() // } else {
// if (res.data) { // this.showErrorMessage("[" + res.msg + "]")
// this.showCommitSuccessMessage("<br>" + res.data, ) // }
// } else { // }).catch(error => {
// this.showErrorMessage("[" + res.msg + "]") // uni.hideLoading()
// } // this.showErrorMessage(error)
// }).catch(error => { // })
// uni.hideLoading()
// this.showErrorMessage(error) },
// })
setParams() {
}, var subList = []
this.detailSource.forEach(item => {
setParams() { item.subList.forEach(detail => {
var subList = [] if (detail.scaned) {
this.detailSource.forEach(item => { // var info = getPackingNumberAndBatch(this.managementList, detail.itemCode,
item.subList.forEach(detail => { // detail.packingNumber, detail.batch);
if (detail.scaned) { // detail.toPackingNumber =info.packingNumber;
// var info = getPackingNumberAndBatch(this.managementList, detail.itemCode, // detail.toBatch =info.batch;
// detail.packingNumber, detail.batch); subList.push(detail)
// detail.toPackingNumber =info.packingNumber; }
// detail.toBatch =info.batch; })
subList.push(detail) })
} return subList;
})
}) },
return subList;
showMessage(message) {
}, this.$refs.comMessage.showMessage(message, res => {
if (res) {}
showMessage(message) { });
this.$refs.comMessage.showMessage(message, res => { },
if (res) {} showScanMessage(message) {
}); this.$refs.comMessage.showScanMessage(message);
}, },
showErrorMessage(message) {
this.$refs.comMessage.showErrorMessage(message, res => { afterCloseMessage() {
if (res) { this.scanPopupGetFocus();
},
}
}); closeScanMessage() {
}, this.scanPopupGetFocus();
},
showScanMessage(message) { getLocation(location, code) {
this.$refs.comMessage.showScanMessage(message); this.getFromLocationCode(location, code)
}, },
getFromLocationCode(location, code) {
afterCloseMessage() { this.fromLocationInfo = location;
this.scanPopupGetFocus(); this.fromLocationCode = code;
}, this.openScanPopup();
},
closeScanMessage() { getToLocationCode(location, code) {
this.scanPopupGetFocus(); if (this.fromLocationCode == code) {
}, uni.showToast({
getLocation(location, code) { title: "来源库位[" + this.fromLocationCode + "]不能与目标库位[" + code + "]一致",
this.getFromLocationCode(location, code) duration: 2000
}, })
getFromLocationCode(location, code) { return
this.fromLocationInfo = location; }
this.fromLocationCode = code; this.ToLocationCodeInfo = location;
this.openScanPopup(); this.toLocationCode = code;
}, },
getToLocationCode(location, code) {
if (this.fromLocationCode == code) { showCommitSuccessMessage(hint) {
uni.showToast({ this.$refs.comMessage.showSuccessMessage(hint, res => {
title: "来源库位[" + this.fromLocationCode + "]不能与目标库位[" + code + "]一致", this.fromLocationCode = '';
duration: 2000
}) })
return },
}
this.ToLocationCodeInfo = location; updateData() {
this.toLocationCode = code; this.calcHandleQty();
}, for (var i = 0; i < this.detailSource.length; i++) {
let item = this.detailSource[i];
showCommitSuccessMessage(hint) { if (item.qty == 0) {
this.$refs.comMessage.showSuccessMessage(hint, res => { this.detailSource.splice(i, 1)
this.fromLocationCode = ''; }
}
}) }
}, }
}
updateData() {
this.calcHandleQty();
for (var i = 0; i < this.detailSource.length; i++) {
let item = this.detailSource[i];
if (item.qty == 0) {
this.detailSource.splice(i, 1)
}
}
}
}
}
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
page { page {
width: 100%; width: 100%;
height: 100%; height: 100%;
background-color: #fff; background-color: #fff;
} }
.page-wraper { .page-wraper {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
width: 100%; width: 100%;
height: 100%; height: 100%;
} }
.page-main { .page-main {
flex: 1; flex: 1;
position: relative; position: relative;
} }
.page-main-scroll { .page-main-scroll {
position: absolute; position: absolute;
left: 0; left: 0;
right: 0; right: 0;
top: 0; top: 0;
bottom: 0; bottom: 0;
} }
.page-main-list { .page-main-list {
/* height: 80rpx; /* height: 80rpx;
line-height: 80rpx; */ line-height: 80rpx; */
text-align: center; text-align: center;
background: #e0e0e0; background: #e0e0e0;
} }
</style> </style>

Loading…
Cancel
Save