Browse Source

添加拆箱合箱

agv
李俊城 4 months ago
parent
commit
6a92979ea6
  1. 18
      fe/PDA/api/index.js
  2. 52
      fe/PDA/common/basic.js
  3. 1
      fe/PDA/components/uni-datetime-picker/uni-datetime-picker.vue
  4. 6
      fe/PDA/mycomponents/common/comNumberBox.vue
  5. 276
      fe/PDA/mycomponents/coms/inventory/comSplit.vue
  6. 29
      fe/PDA/pages.js
  7. 30
      fe/PDA/pages.json
  8. 476
      fe/PDA/pages/inventory/mergePacking.vue
  9. 84
      fe/PDA/pages/inventory/mergePackingResult.vue
  10. 2
      fe/PDA/pages/inventory/returnWareHouse.vue
  11. 580
      fe/PDA/pages/inventory/splitPacking.vue
  12. 84
      fe/PDA/pages/inventory/splitPackingResult.vue
  13. 2
      fe/PDA/static/config.json

18
fe/PDA/api/index.js

@ -2249,11 +2249,27 @@ export const getWorkStationByLocation = (locationCode) => request(
//获取位置码信息
export const returnWarhouseSubmit = (params) => request(
devUrl + returnWareHouseUrl, { //
returnWareHouseUrl+"/wms/api/RestJsonService/notifyOutTaskBack4FW", { //
data: params,
method: "post"
});
//拆箱 提交
export function splitPackingSubmit(params) { //
return request(devUrl + "/api/pda/store/separation-packing-note", { //
data: params,
method: "post"
})
}
//合箱提交
export function mergePackingSubmit(params) { //
return request(devUrl + "/api/pda/store/integration-packing-note", { //
data: params,
method: "post"
})
}

52
fe/PDA/common/basic.js

@ -106,6 +106,20 @@ export function getInventoryStatusDesc(val) {
else return '其他'
}
export function getInventoryStatusList() {
var list=["待检","合格","不合格","隔离","报废","冻结"]
return list;
}
export function getInventoryStatusValueList(val) {
if (val == '待检') return 1
else if (val == '合格') return 2
else if (val == '不合格') return 3
else if (val == '隔离') return 4
else if (val == '报废') return 5
else if (val == '冻结') return 6
}
//零件状态
export function getItemTypeStyle(val) {
if (val == 0) return 'unk'
@ -255,10 +269,10 @@ export function getPositionCodeName(type) {
let array = [{
name: '注塑区',
type: 1,
},{
}, {
name: '喷涂区',
type: 2,
},{
}, {
name: '装配区',
type: 3,
}, {
@ -335,6 +349,15 @@ export function dateFormat(time) {
let date = new Date(time);
return getDate(date) + " " + getTime(date);
}
//带T的时间转换为毫秒值
export function timeInMilliseconds(timeString) {
return new Date(timeString).getTime();
}
export function secondsToDateTime(time) {
let date = new Date(time);
return getDate(date) + "T" + getTime(date) + "Z";
}
//获取日期部分
export function getDate(date) {
@ -468,7 +491,7 @@ export function navigateBack(backIndex) {
* 深度克隆对象
* @param {*} target
*/
export function deepCopyData(target) {
export function deepCopyData(target) {
// 克隆原始类型和null
if (!(target !== null && (typeof target === 'object' || typeof target === 'function'))) {
return target;
@ -498,23 +521,22 @@ export function getIssueJobState(val) {
// }
const S4 = function() {
return (((1 + Math.random()) * 0x10000) | 0).toString(16).substring(1);
return (((1 + Math.random()) * 0x10000) | 0).toString(16).substring(1);
};
export function guid() {
return (S4() + S4() +'-' +S4() +'-' +S4() +'-' +S4() +'-' +S4() +S4() +S4()
);
return (S4() + S4() + '-' + S4() + '-' + S4() + '-' + S4() + '-' + S4() + S4() + S4());
}
export function debounceSetting(fn, wait) {
let timeout = null;
wait = wait || 600;
return function () {
let that = this;
if(timeout !== null) clearTimeout(timeout);
timeout = setTimeout(() => {
fn.apply(that);
}, wait);
}
let timeout = null;
wait = wait || 600;
return function() {
let that = this;
if (timeout !== null) clearTimeout(timeout);
timeout = setTimeout(() => {
fn.apply(that);
}, wait);
}
}

1
fe/PDA/components/uni-datetime-picker/uni-datetime-picker.vue

@ -289,6 +289,7 @@
},
methods: {
initPicker(newVal) {
if(!newVal)return;
if (!newVal || Array.isArray(newVal) && !newVal.length) {
this.$nextTick(() => {
this.clear(false)

6
fe/PDA/mycomponents/common/comNumberBox.vue

@ -3,7 +3,7 @@
<view @click="_calcValue('minus')" class="uni-numbox__minus uni-cursor-point">
<text class="uni-numbox--text" :class="{ 'uni-numbox--disabled': inputValue <= min || disabled }">-</text>
</view>
<input :disabled="disabled" @focus="_onFocus" @blur="_onBlur" class="uni-numbox__value" type="number"
<input :disabled="inPutDisabled" @focus="_onFocus" @blur="_onBlur" class="uni-numbox__value" type="number"
v-model="inputValue" />
<view @click="_calcValue('plus')" class="uni-numbox__plus uni-cursor-point">
<text class="uni-numbox--text" :class="{ 'uni-numbox--disabled': inputValue >= max || disabled }">+</text>
@ -50,6 +50,10 @@
disabled: {
type: Boolean,
default: false
},
inPutDisabled: {
type: Boolean,
default: false
}
},
data() {

276
fe/PDA/mycomponents/coms/inventory/comSplit.vue

@ -0,0 +1,276 @@
<template>
<view class="">
<!-- <view class="uni-flex uni-row item" style="align-items: center; ">
<view class="" style="font-size: 35rpx;">
ERP料号代码 :
</view>
<uni-easyinput type="text" v-model="dataContent.itemCode" placeholder="请输入ERP料号代码" />
</view>
<view class="uni-flex uni-row item" style="align-items: center; ">
<view class="" style="font-size: 35rpx;">
ERP料号名称 :
</view>
<uni-easyinput type="text" v-model="dataContent.itemName" placeholder="请输入ERP料号名称" />
</view>
<view class="uni-flex uni-row item" style="align-items: center; ">
<view class="" style="font-size: 35rpx;">
ERP料号描述1 :
</view>
<uni-easyinput type="text" v-model="dataContent.itemDesc1" placeholder="请输入ERP料号描述1" />
</view>
<view class="uni-flex uni-row item" style="align-items: center; ">
<view class="" style="font-size: 35rpx;">
ERP料号描述2 :
</view>
<uni-easyinput type="text" v-model="dataContent.itemDesc2" placeholder="请输入ERP料号描述2" />
</view>
<view class="uni-flex uni-row item" style="align-items: center; ">
<view class="" style="font-size: 35rpx;">
库位代码 :
</view>
<uni-easyinput type="text" v-model="dataContent.locationCode" placeholder="请输入库位代码" />
</view>
<view class="uni-flex uni-row item" style="align-items: center; ">
<view class="" style="font-size: 35rpx;">
ERP库位代码 :
</view>
<uni-easyinput type="text" v-model="dataContent.locationErpCode" placeholder="请输入ERP库位代码" />
</view>
<view class="uni-flex uni-row item" style="align-items: center; ">
<view class="" style="font-size: 35rpx;">
批次 :
</view>
<uni-easyinput type="text" v-model="dataContent.lot" placeholder="请输入批次" />
</view> -->
<view class="uni-flex uni-row item" style="align-items: center; ">
<view class="" style="font-size: 35rpx;">
<text style="color: red; font-weight: bold;">*</text>
数量 :
</view>
<uni-easyinput type="number" v-model="dataContent.qty" placeholder="请输入数量" />
</view>
<!-- <view class="uni-flex uni-row item" style="align-items: center; ">
<view class="" style="font-size: 35rpx;">
单位 :
</view>
<uni-easyinput type="text" v-model="dataContent.uom" placeholder="请输入单位" />
</view>
<view class="uni-flex uni-row item" style="align-items: center; ">
<view class="" style="font-size: 35rpx;">
标包 :
</view>
<uni-easyinput type="text" v-model="dataContent.stdPackQty" placeholder="请输入标包" />
</view>
<view class="uni-flex uni-row item" style="align-items: center; ">
<view class="" style="font-size: 35rpx;">
库存状态 :
</view>
<u-select v-model="showStatus" :list="statusList" ></u-select>
<uni-combox :candidates="statusList" placeholder="请选择库存状态" v-model="dataContent.statusName"></uni-combox>
<!-- <uni-easyinput type="text" v-model="dataContent.inventoryStatuses" placeholder="请输入库存状态" /> -->
<!-- </view> -->
<!-- <view class="uni-flex uni-row item" style="align-items: center; ">
<view class="" style="font-size: 35rpx;">
要货计划单号 :
</view>
<uni-easyinput type="text" v-model="dataContent.rpNumber" placeholder="请输入要货计划单号" />
</view>
<view class="uni-flex uni-row item" style="align-items: center; ">
<view class="" style="font-size: 35rpx;">
供应商发货单 :
</view>
<uni-easyinput type="text" v-model="dataContent.purchaseInfo_AsnNumber" placeholder="请输入供应商发货单" />
</view> -->
<!-- <view class="uni-flex uni-row item" style="align-items: center; ">
<view class="" style="font-size: 35rpx;">
到货通知单 :
</view>
<uni-easyinput type="text" v-model="dataContent.arrivalNoticNumber" placeholder="请输入到货通知单" />
</view> -->
<!-- <view class="uni-flex uni-row item" style="align-items: center; ">
<view class="" style="font-size: 35rpx;">
收货记录单 :
</view>
<uni-easyinput type="text" v-model="dataContent.receiptRecNumber" placeholder="请输入收货记录单" />
</view> -->
<!-- <view class="uni-flex uni-row item" style="align-items: center; ">
<view class="" style="font-size: 35rpx;">
采购订单 :
</view>
<uni-easyinput type="text" v-model="dataContent.purchaseInfo_PoNumber" placeholder="请输入采购订单" />
</view> -->
<!-- <view class="uni-flex uni-row item" style="align-items: center; ">
<view class="" style="font-size: 35rpx;">
上架单 :
</view>
<uni-easyinput type="text" v-model="dataContent.putOnShelfNumber" placeholder="请输入上架单" />
</view> -->
<!-- <view class="uni-flex uni-row item" style="align-items: center; ">
<view class="" style="font-size: 35rpx;">
任务单 :
</view>
<uni-easyinput type="text" v-model="dataContent.taskOrderNumber" placeholder="请输入任务单" />
</view> -->
<!-- <view class="uni-flex uni-row item" style="align-items: center; ">
<view class="" style="font-size: 35rpx;">
供应商代码 :
</view>
<uni-easyinput type="text" v-model="dataContent.supplierCode" placeholder="请输入供应商代码" />
</view>
<view class="uni-flex uni-row item" style="align-items: center; ">
<view class="" style="font-size: 35rpx;">
供应商名称 :
</view>
<uni-easyinput type="text" v-model="dataContent.supplierName" placeholder="请输入供应商名称" />
</view>
<view class="uni-flex uni-row item" style="align-items: center; ">
<view class="" style="font-size: 35rpx;">
供应商简称 :
</view>
<uni-easyinput type="text" v-model="dataContent.supplierSimpleName" placeholder="请输入供应商简称" />
</view>
<view class="uni-flex uni-row item" style="align-items: center; ">
<view class="" style="font-size: 35rpx;">
供应商物品代码 :
</view>
<uni-easyinput type="text" v-model="dataContent.supplierItemCode" placeholder="请输入供应商物品代码" />
</view>
<view class="uni-flex uni-row item" style="align-items: center; ">
<view class="" style="font-size: 35rpx;">
供应商物品名称 :
</view>
<uni-easyinput type="text" v-model="dataContent.supplierItemName" placeholder="请输入供应商物品名称" />
</view>
<view class="uni-flex uni-row item" style="align-items: center; ">
<view class="" style="font-size: 35rpx;">
备注 :
</view>
<uni-easyinput type="text" v-model="dataContent.remark" placeholder="请输入备注" />
</view>
<view class="uni-flex uni-row item" style="align-items: center; ">
<view class="" style="font-size: 35rpx;">
生产日期 :
</view>
<uni-datetime-picker type="datetime" v-model="dataContent.produceDate" placeholder="请输入备注" />
</view>
<view class="uni-flex uni-row item" style="align-items: center; ">
<view class="" style="font-size: 35rpx;">
要求到货日期 :
</view>
<uni-datetime-picker type="datetime" return-type="timestamp" v-model="dataContent.planArriveDate"
placeholder="请输入备注" />
</view>
<view class="uni-flex uni-row item" style="align-items: center; ">
<view class="" style="font-size: 35rpx;">
到货日期 :
</view>
<uni-datetime-picker type="datetime" v-model="dataContent.arriveDate" placeholder="请输入备注" />
</view>
<view class="uni-flex uni-row item" style="align-items: center; ">
<view class="" style="font-size: 35rpx;">
过期时间 :
</view>
<uni-datetime-picker type="datetime" v-model="dataContent.expireDate" placeholder="请输入备注" />
</view>
<view class="uni-flex uni-row item" style="align-items: center; ">
<view class="" style="font-size: 35rpx;">
生效日期 :
</view>
<uni-datetime-picker type="datetime" v-model="dataContent.activeDate" placeholder="请输入备注" />
</view>
<view class="uni-flex uni-row item" style="align-items: center; ">
<view class="" style="font-size: 35rpx;">
创建时间 :
</view>
<uni-datetime-picker type="datetime" v-model="dataContent.creationTime" placeholder="请输入备注" />
</view>
<view class="uni-flex uni-row item" style="align-items: center; ">
<view class="" style="font-size: 35rpx;">
上次修改时间 :
</view>
<uni-datetime-picker type="datetime" v-model="dataContent.lastModificationTime" placeholder="请输入备注" />
</view> -->
</view>
</template>
<script>
import {
getCurrDateTime,
getInventoryStatusList,
getInventoryStatusDesc
} from '@/common/basic.js';
export default {
data() {
return {
showStatus:false,
statusList:[],
};
},
//
props: {
dataContent: {
type: Object,
value: null
},
},
filters: {},
mounted() {
this.dataContent.statusName =this.inventoryStatusDesc(this.dataContent.inventoryStatuses)
this.statusList=getInventoryStatusList()
},
methods: {
getDate(value) {
return getCurrDateTime(value)
},
clickShowStatus(){
this.showStatus=true
},
inventoryStatusDesc(value){
return getInventoryStatusDesc(value)
},
selectStatus(item){
// this.statusName=item[0].label
this.dataContent.inventoryStatuses=item[0].value
}
}
}
</script>
<style>
.item {
margin: 5rpx;
padding: 5rpx;
font-size: 35rpx;
}
</style>

29
fe/PDA/pages.js

@ -1018,6 +1018,35 @@ module.exports = () => ({
"navigationBarTitleText": "回库",
"enablePullDownRefresh": false
}
},
{
"path": "pages/inventory/splitPacking",
"style": {
"navigationBarTitleText": "拆箱",
"enablePullDownRefresh": false
}
},
{
"path": "pages/inventory/splitPackingResult",
"style": {
"navigationBarTitleText": "拆箱结果",
"enablePullDownRefresh": false
}
},
{
"path": "pages/inventory/mergePacking",
"style": {
"navigationBarTitleText": "合箱",
"enablePullDownRefresh": false
}
},
{
"path": "pages/inventory/mergePackingResult",
"style": {
"navigationBarTitleText": "合箱结果",
"enablePullDownRefresh": false
}
}

30
fe/PDA/pages.json

@ -1014,6 +1014,36 @@
"navigationBarTitleText": "回库",
"enablePullDownRefresh": false
}
},
{
"path": "pages/inventory/splitPacking",
"style": {
"navigationBarTitleText": "拆箱",
"enablePullDownRefresh": false
}
},
{
"path": "pages/inventory/splitPackingResult",
"style": {
"navigationBarTitleText": "拆箱结果",
"enablePullDownRefresh": false
}
},
{
"path": "pages/inventory/mergePacking",
"style": {
"navigationBarTitleText": "合箱",
"enablePullDownRefresh": false
}
},
{
"path": "pages/inventory/mergePackingResult",
"style": {
"navigationBarTitleText": "合箱结果",
"enablePullDownRefresh": false
}
}
],

476
fe/PDA/pages/inventory/mergePacking.vue

@ -0,0 +1,476 @@
<template>
<page-meta root-font-size="18px"></page-meta>
<view class="">
<win-blank-view @goScan='openScanPopup' v-if="itemList.length==0"></win-blank-view>
<scroll-view :scroll-top="scrollTop" scroll-y="true" class="scroll-Y" @scrolltoupper="upper"
@scrolltolower="lower" @scroll="scroll" style="padding-bottom:150px">
<view class="detail-list" v-for="(item,index) in itemList">
<view style="-webkit-flex: 1;flex: 1;">
<view class="detail-content">
<uni-swipe-action>
<uni-swipe-action-item :right-options="options" :auto-close="false"
@click="swipeClick($event,index)">
<view class="uni-flex uni-row" style="">
<view style="margin-left: 10rpx; margin-top: 10rpx;"
@click="checkeClick(item.packingCode)">
<checkbox :value="item.packingCode" :checked="item.checked" />
<text style="writing-mode: vertical-rl; font-size: 35rpx;margin-top: 15rpx;">
选择此库存</text>
</view>
<view class="">
<com-balance-item :dataContent="item"></com-balance-item>
</view>
</view>
</uni-swipe-action-item>
</uni-swipe-action>
</view>
</view>
</view>
<view v-if="itemList.length>0"
style="background-color: #000; height: 1rpx;margin-top: 15rpx;margin-bottom: 15rpx;">
</view>
</scroll-view>
<div class="new_bot_box" v-show="itemList.length>0">
<view class="new_btn_bot bot_pos uni-flex">
<button class="new_clear_btn btn_double" @click="cancel()">清空</button>
<button class="new_save_btn btn_double" @click="submit()">提交</button>
</view>
</div>
<win-scan-button @goScan='openScanPopup' v-if="itemList.length>0"></win-scan-button>
<win-scan-by-pack ref="scanPopup" @getScanResult='getScanResult'>
</win-scan-by-pack>
<com-balance ref="balanceItems" @selectedItem='selectedBalanceItem'></com-balance>
<com-message ref="comMessage" @afterClose='afterCloseMessagg'></com-message>
</view>
</view>
</template>
<script>
import {
locations,
getBalancesByFilter,
mergePackingSubmit
} from '@/api/index.js';
import {
showConfirmMsg,
goHome,
getRemoveOption,
scanSuccessAudio,
scanFailedAudio,
deepCopyData
} from '@/common/basic.js';
import winBlankView from '@/mycomponents/wincom/winBlankView.vue'
import comBalanceItem from '@/mycomponents/comItem/comBalanceItem.vue'
import winScanButton from '@/mycomponents/wincom/winScanButton.vue'
import winScanByPack from '@/mycomponents/wincom/winScanByPack.vue'
import comMessage from '@/mycomponents/common/comMessage.vue'
import comBalance from '@/mycomponents/common/comBalance.vue'
import winCollapseLocation from '@/mycomponents/wincom/winCollapseLocation.vue'
import comNumberBox from '@/mycomponents/common/comNumberBox.vue';
import comSplit from '@/mycomponents/coms/inventory/comSplit.vue';
export default {
name: 'comtransfer',
components: {
winBlankView,
comBalanceItem,
comMessage,
winScanButton,
winScanByPack,
comBalance,
winCollapseLocation,
comNumberBox,
comSplit
},
data() {
return {
options: [],
itemList: [],
fromLocationCode: '',
scrollTop: 0,
old: {
scrollTop: 0
},
locationErpCode: '',
toLocationErpCode: '',
locationGotFocus: false,
labelInfo: {}
};
},
watch: {},
mounted: function() {
this.openScanPopup();
this.options = getRemoveOption();
},
methods: {
openScanPopup() {
this.$refs.scanPopup.openScanPopup()
},
//?
swipeClick(e, index) {
let {
content
} = e;
if (content.text === '移除') {
uni.showModal({
title: '提示',
content: '是否移除选择的行?',
success: res => {
if (res.confirm) {
this.itemList.splice(index, 1);
}
}
});
}
},
getScanResult(result) {
let that = this;
let code = result.data.code;
let label = result.data
let datas = that.itemList.filter(r => {
return r.packingCode == code
})
if (datas.length > 0) {
scanFailedAudio()
setTimeout(res => {
showConfirmMsg('箱码【' + code + '】已经存在,是否要重新扫描?', confirm => {
if (confirm) {
that.itemList.forEach((r, i) => {
if (r.packingCode == code) {
that.itemList = [];
return;
}
});
that.getBalance(code, label);
}
});
}, 100)
} else {
that.getBalance(code, label);
}
},
getBalance(packingCode, label) {
uni.showLoading({
title: '加载中',
mask: true
})
let that = this;
//ERP
let params = {
pageSize: 100,
pageIndex: 1,
// locationTypes: [2, 3, 4],
packingCode: packingCode
};
getBalancesByFilter(params)
.then(res => {
try {
if (res.totalCount === 0) {
scanFailedAudio()
this.showMessage('箱码【' + packingCode + '】未查询到库存信息');
} else if (res.totalCount === 1) {
this.pushItem(res.items[0], label);
this.$refs.scanPopup.closeScanPopup()
} else {
scanSuccessAudio()
this.$refs.scanPopup.closeScanPopup()
this.$refs.balanceItems.openPopup(res.items);
}
} catch (e) {
scanFailedAudio()
this.showMessage(e.message);
}
uni.hideLoading();
})
.catch(err => {
scanFailedAudio()
this.showMessage(err.message);
uni.hideLoading();
});
},
pushItem(balanceItem, label) {
//
if (this.itemList.length > 0) {
var itemInfo = this.itemList[0]
if (itemInfo.itemCode != balanceItem.itemCode) {
this.showMessage("扫描ERP料号[" + balanceItem.itemCode + "]与合箱ERP料号[" + itemInfo.itemCode +
"]不一致,不允许合箱")
return;
}
}
let item = this.createItem(balanceItem);
item.itemNameTemp =item.itemName
item.itemName =item.itemDesc2
item.checked = false
item.label = label
this.locationErpCode = balanceItem.locationErpCode;
this.itemList.unshift(item);
scanSuccessAudio()
},
createItem(item) {
item.checked = true;
item.fromLot = item.lot;
item.toLot = item.lot;
item.fromPackingCode = item.packingCode;
item.toPackingCode = item.packingCode;
item.fromContainerCode = item.containerCode;
item.toContainerCode = item.containerCode;
item.fromLocationCode = item.locationCode;
item.fromWarehouseCode = localStorage.warehouseCode;
item.toWarehouseCode = localStorage.warehouseCode;
item.fromStatus = item.status;
item.toStatus = item.status;
item.fromLocationErpCode = item.locationErpCode;
// item.fromLocationErpCode = item.locationErpCode;
item.defaultQty = item.qty
item.defaultUom = item.uom
return item;
},
selectedBalanceItem(balanceItem) {
this.pushItem(balanceItem,this.labelInfo);
},
clear() {
this.itemList = [];
this.splitList = []
},
submit() {
let that = this;
if (that.itemList.length < 2) {
this.showMessage('合箱箱码必须大于等于2');
return;
}
if (!this.checkData()) {
this.showMessage('请先选择合箱的箱码');
return;
}
uni.showLoading({
title: "提交中....",
mask: true
});
var params = this.setParams()
mergePackingSubmit(params)
.then(res => {
uni.hideLoading();
if(res&&res.details.length>0){
this.navigateToPage(res.details)
this.clearInfo();
}else {
this.showMessage("提交成功未返回数据")
}
})
.catch(err => {
that.showMessage(err.message);
uni.hideLoading();
});
},
checkData() {
var isCheck = this.itemList.find(r => r.checked == true)
if (isCheck) {
return true
} else {
return false
}
},
setParams() {
var checked = []
var noChecked = []
this.itemList.forEach(res => {
if (res.checked) {
checked.push(res)
} else {
noChecked.push(res)
}
})
var mainLabelItem = checked[0].label;
var mainItem = checked[0]
let item = {
tenantId: mainLabelItem.tenantId,
activeDate: mainItem.activeDate,
warehouseCode: mainItem.warehouseCode,
remark: mainLabelItem.remark,
extraProperties: {},
worker: localStorage.userName_CN == "" ? localStorage.userName : localStorage.userName_CN,
activeDate: mainItem.activeDate,
number: "",
itemCode: mainLabelItem.itemCode,
itemName: mainItem.itemNameTemp,
itemDesc1: mainLabelItem.itemDesc1,
itemDesc2: mainLabelItem.itemDesc2,
configuration: mainItem.configuration,
packingCode: mainItem.packingCode,
locationCode: mainItem.locationCode,
containerCode: mainLabelItem.containerCode,
lot: mainItem.lot,
inventoryStatuses: mainItem.status,
stdPackQty: mainLabelItem.stdPackQty,
uom: mainLabelItem.uom,
qty: mainItem.qty,
labelType: mainLabelItem.labelType,
fullBarcodeString: mainLabelItem.fullBarcodeString,
supplierBatch: mainLabelItem.supplierBatch,
arriveDate: mainLabelItem.arriveDate,
produceDate: mainLabelItem.produceDate,
expireDate: mainLabelItem.expireDate,
recommendLocationCode: mainLabelItem.recommendLocationCode,
locationErpCode: mainLabelItem.locationErpCode,
supplierCode: mainLabelItem.supplierCode,
rpNumber: mainLabelItem.rpNumber,
purchaseInfo_PoNumber: mainLabelItem.poNumber,
purchaseInfo_AsnNumber: mainLabelItem.asnNumber,
arrivalNoticNumber: "",
taskOrderNumber: "",
receiptRecNumber: "",
putOnShelfNumber: "",
supplierName: mainLabelItem.supplierName,
supplierSimpleName: mainLabelItem.supplierSimpleName,
supplierItemCode: mainLabelItem.supplierItemCode,
supplierItemName: mainLabelItem.supplierItemName,
planArriveDate: mainLabelItem.planArriveDate,
details: []
}
noChecked.forEach(r => {
var submitItem = deepCopyData(r.label)
submitItem.packingCode = r.packingCode
submitItem.locationCode = r.locationCode
submitItem.inventoryStatuses = r.status
submitItem.stdPackQty = r.stdPackQty
submitItem.qty=r.qty
submitItem.lot=r.lot
submitItem.recommendLocationCode = r.recommendLocationCode
submitItem.locationErpCode = r.locationErpCode
submitItem.purchaseInfo_PoNumber = submitItem.poNumber
submitItem.purchaseInfo_AsnNumber = submitItem.asnNumber
submitItem.arrivalNoticNumber = ""
submitItem.taskOrderNumber = ""
submitItem.receiptRecNumber = ""
submitItem.putOnShelfNumber = ""
submitItem.supplierName = ""
submitItem.itemName=mainItem.itemNameTemp,
item.details.push(submitItem);
})
return item;
},
navigateToPage(dataList){
uni.navigateTo({
url: './mergePackingResult?data='+encodeURIComponent(JSON.stringify(dataList))
});
},
cancel() {
let that = this;
showConfirmMsg('是否要清空合箱数据?', confirm => {
if (confirm) {
that.clearInfo();
}
})
},
clearInfo() {
this.itemList = [];
this.labelInfo={}
},
afterCloseMessagg() {
if (this.locationGotFocus) {
this.$refs.location.gotFocus();
}
},
upper: function(e) {
// console.log(e)
},
lower: function(e) {
// console.log(e)
},
scroll: function(e) {
// console.log(e)
this.old.scrollTop = e.detail.scrollTop;
},
showMessage(message) {
this.$refs.comMessage.showMessage(message);
},
showCommitSuccess() {
this.$refs.comMessage.showCommitSuccess();
},
checkeClick(value) {
for (let i = 0; i < this.itemList.length; i++) {
this.itemList[i].checked = false
}
for (let i = 0; i < this.itemList.length; i++) {
if (this.itemList[i].packingCode == value) {
if (this.itemList[i].checked == true) {
this.itemList[i].checked = false
} else {
this.itemList[i].checked = true
}
}
}
this.$forceUpdate()
},
}
};
</script>
<style scoped lang="scss">
/deep/ .input-value {
font-size: 16px;
}
/deep/ .uni-collapse-item__title-text {
font-size: 16px;
}
/deep/ .uni-collapse-item--border {
border-bottom-width: 0px;
border-bottom-color: #ebeef5;
}
/deep/ .uni-collapse-item--border {
border-bottom-width: 1px;
border-bottom-color: #ebeef5;
}
</style>

84
fe/PDA/pages/inventory/mergePackingResult.vue

@ -0,0 +1,84 @@
<template>
<view class="">
<view class="" v-for="(item,index) in dataList" :key="index">
<view class="" style="border-radius: 10rpx; background-color: #fff; font-size: 35rpx; margin: 15rpx; padding: 20rpx;">
<view class="">
ERP料号 : {{item.itemCode}}
</view>
<view class="">
ERP名称 : {{item.itemName}}
</view>
<view class="">
描述1 : {{item.itemDesc1}}
</view>
<view class="">
箱码 : {{item.packingCode}}
</view>
<view class="" style="margin-top: 10rpx;">
数量 : {{item.qty}}
</view>
</view>
</view>
</view>
</template>
<script>
import {
goHome
} from '@/common/basic.js';
export default {
components: {},
data() {
return {
dataList: []
};
},
onLoad(e){
if(e.data==undefined||e.data=='undefined'){
}else {
this.dataList =JSON.parse(decodeURIComponent(e.data))
}
},
onPullDownRefresh() {},
//
onNavigationBarButtonTap(e) {
if (e.index === 0) {
goHome();
} else if (e.index === 1) {
window.location.reload();
}
},
methods: {
},
}
</script>
<style scoped lang="scss">
movable-view {
display: flex;
align-items: center;
justify-content: center;
height: 150rpx;
width: 150rpx;
}
movable-area {
height: 500rpx;
width: 100%;
overflow: hidden;
}
.movable-max {
width: 500rpx;
height: 500rpx;
}
</style>

2
fe/PDA/pages/inventory/returnWareHouse.vue

@ -149,7 +149,7 @@
if (value <= 0) {
item.qty = item.defaultHandleQty
this.$refs['comNumberBox_' + index][0].setValue(item.qty);
this.showMessage('发料数量不能小于或等于0')
this.showMessage('数量不能小于或等于0')
return;
}
},

580
fe/PDA/pages/inventory/splitPacking.vue

@ -0,0 +1,580 @@
<template>
<page-meta root-font-size="18px"></page-meta>
<view class="">
<win-blank-view @goScan='openScanPopup' v-if="itemList.length==0"></win-blank-view>
<scroll-view :scroll-top="scrollTop" scroll-y="true" class="scroll-Y" @scrolltoupper="upper"
@scrolltolower="lower" @scroll="scroll" style="padding-bottom:150px">
<view class="detail-list" v-for="(item,index) in itemList">
<view style="-webkit-flex: 1;flex: 1;">
<view class="detail-content">
<uni-swipe-action>
<uni-swipe-action-item :right-options="options" :auto-close="false"
@click="swipeClick($event,'itemCode',index)">
<com-balance-item :dataContent="item"></com-balance-item>
</uni-swipe-action-item>
</uni-swipe-action>
</view>
</view>
</view>
<view v-if="itemList.length>0" class="uni-flex uni-row uni-center" style="align-items: center;">
<view class="" style="margin-left: 20rpx; margin-right: 20rpx; font-size: 35rpx; font-weight: bold;">
拆出箱数 :
</view>
<com-number-box :inPutDisabled ="true" ref="comNumberBoxRef" v-model="splitQty" :max="999999" :min="0" style='width: 100px;'
@change="qtyChanged($event)">
</com-number-box>
</view>
<view v-if="itemList.length>0"
style="background-color: #000; height: 1rpx;margin-top: 15rpx;margin-bottom: 15rpx;">
</view>
<view class="">
<view class="" v-for="(splitItem,index) in splitList">
<view style="-webkit-flex: 1;flex: 1;">
<view class="">
<uni-swipe-action>
<uni-swipe-action-item :right-options="options" :auto-close="false"
@click="swipeClick($event,'split',index)">
<view class="uni-flex uni-row">
<view class=""
style="font-size: 35rpx;font-weight: bold; margin-top: 30rpx; margin-left: 0rpx;">
({{index+1}})
</view>
<view class="detail-list">
<comSplit :dataContent="splitItem"></comSplit>
</view>
</view>
</uni-swipe-action-item>
</uni-swipe-action>
</view>
</view>
</view>
</view>
</scroll-view>
<div class="new_bot_box" v-show="itemList.length>0">
<view class="new_btn_bot bot_pos uni-flex">
<button class="new_clear_btn btn_double" @click="cancel()">清空</button>
<button class="new_save_btn btn_double" @click="submit()">提交</button>
</view>
</div>
<win-scan-button @goScan='openScanPopup' v-if="itemList.length>0"></win-scan-button>
<win-scan-by-pack ref="scanPopup" @getScanResult='getScanResult'>
</win-scan-by-pack>
<com-balance ref="balanceItems" @selectedItem='selectedBalanceItem'></com-balance>
<com-message ref="comMessage" @afterClose='afterCloseMessagg'></com-message>
</view>
</view>
</template>
<script>
import {
locations,
getBalancesByFilter,
splitPackingSubmit
} from '@/api/index.js';
import {
showConfirmMsg,
goHome,
getRemoveOption,
scanSuccessAudio,
scanFailedAudio,
timeInMilliseconds,
secondsToDateTime,
deepCopyData,
getInventoryStatusValueList
} from '@/common/basic.js';
import winBlankView from '@/mycomponents/wincom/winBlankView.vue'
import comBalanceItem from '@/mycomponents/comItem/comBalanceItem.vue'
import winScanButton from '@/mycomponents/wincom/winScanButton.vue'
import winScanByPack from '@/mycomponents/wincom/winScanByPack.vue'
import comMessage from '@/mycomponents/common/comMessage.vue'
import comBalance from '@/mycomponents/common/comBalance.vue'
import winCollapseLocation from '@/mycomponents/wincom/winCollapseLocation.vue'
import comNumberBox from '@/mycomponents/common/comNumberBox.vue';
import comSplit from '@/mycomponents/coms/inventory/comSplit.vue';
export default {
name: 'comtransfer',
components: {
winBlankView,
comBalanceItem,
comMessage,
winScanButton,
winScanByPack,
comBalance,
winCollapseLocation,
comNumberBox,
comSplit
},
data() {
return {
options: [],
itemList: [],
fromLocationCode: '',
scrollTop: 0,
old: {
scrollTop: 0
},
isClearPackCode: false, //
isClearContainerCode: false, //
isClearLot: false, //,
locationErpCode: '',
toLocationErpCode: '',
locationGotFocus: false,
splitQty: 0,
splitList: [],
labelInfo:{}
};
},
watch: {},
mounted: function() {
this.openScanPopup();
this.options = getRemoveOption();
},
onLoad() {
},
methods: {
openScanPopup() {
this.$refs.scanPopup.openScanPopup()
},
//?
swipeClick(e, type, index) {
let {
content
} = e;
if (content.text === '移除') {
setTimeout(res=>{
uni.showModal({
title: '提示',
content: '是否移除选择的行?',
success: res => {
if (res.confirm) {
if (type == "itemCode") {
this.itemList.splice(index, 1);
this.splitList = []
} else {
this.splitList.splice(index, 1);
this.splitQty=this.splitList.length
}
}
}
});
},200)
}
},
getScanResult(result) {
let that = this;
let code = result.data.code;
let label = result.data
let datas = that.itemList.filter(r => {
return r.packingCode == code
})
if (datas.length > 0) {
scanFailedAudio()
setTimeout(res => {
showConfirmMsg('箱码【' + code + '】已经存在,是否要重新扫描?', confirm => {
if (confirm) {
that.itemList.forEach((r, i) => {
if (r.packingCode == code) {
that.itemList = [];
that.splitList = [];
return;
}
});
that.getBalance(code, label);
}
});
}, 100)
} else {
that.getBalance(code, label);
}
},
getBalance(packingCode, label) {
uni.showLoading({
title: '加载中',
mask: true
})
let that = this;
//ERP
let params = {
pageSize: 100,
pageIndex: 1,
locationTypes: [2, 3, 4,5],
packingCode: packingCode
};
getBalancesByFilter(params)
.then(res => {
try {
if (res.totalCount === 0) {
scanFailedAudio()
this.showMessage('箱码【' + packingCode + '】在原料库、半成品库、成品库、线边库未查询到库存信息');
} else if (res.totalCount === 1) {
this.labelInfo=label
this.pushItem(res.items[0], label);
this.$refs.scanPopup.closeScanPopup()
} else {
scanSuccessAudio()
this.$refs.scanPopup.closeScanPopup()
this.$refs.balanceItems.openPopup(res.items);
}
} catch (e) {
scanFailedAudio()
this.showMessage(e.message);
}
uni.hideLoading();
})
.catch(err => {
scanFailedAudio()
this.showMessage(err.message);
uni.hideLoading();
});
},
pushItem(balanceItem, label) {
this.clearInfo()
let item = this.createItem(balanceItem);
item.label = label
item.statusName=""
if (this.itemList.length == 0) {
this.locationErpCode = balanceItem.locationErpCode;
item.itemNameTemp =item.itemName
item.itemName =item.itemDesc2
this.itemList.unshift(item);
scanSuccessAudio()
}
},
createItem(item) {
item.checked = true;
item.fromLot = item.lot;
item.toLot = item.lot;
item.fromPackingCode = item.packingCode;
item.toPackingCode = item.packingCode;
item.fromContainerCode = item.containerCode;
item.toContainerCode = item.containerCode;
item.fromLocationCode = item.locationCode;
item.fromWarehouseCode = localStorage.warehouseCode;
item.toWarehouseCode = localStorage.warehouseCode;
item.fromStatus = item.status;
item.toStatus = item.status;
item.fromLocationErpCode = item.locationErpCode;
// item.fromLocationErpCode = item.locationErpCode;
item.defaultQty = item.qty
item.defaultUom = item.uom
return item;
},
selectedBalanceItem(balanceItem) {
this.pushItem(balanceItem,this.this.labelInfo);
},
clear() {
this.itemList = [];
this.splitList = []
this.splitQty= 0,
this.labelInfo={}
},
submit() {
let that = this;
if (that.itemList.length === 0) {
this.showMessage('请选择要提交的零件');
return;
}
var isHaveQty=true
for(var i=0;i<this.splitList.length;i++){
if( Number(this.splitList[i].qty)==0){
isHaveQty=false
}
}
if(!isHaveQty){
this.showMessage('数量必须大于0');
return;
}
var totalsplitQty = 0;
this.splitList.forEach(res => {
totalsplitQty += Number(res.qty)
})
if(totalsplitQty==0){
this.showMessage('请输入拆箱数量');
return;
}else {
if(totalsplitQty>=that.itemList[0].qty){
this.showMessage('拆箱数量必须小于库存数量');
return;
}
}
uni.showLoading({
title: "提交中....",
mask: true
});
var mainLabelItem = this.itemList[0].label;
var mainItem = this.itemList[0]
let item = {
warehouseCode: mainItem.warehouseCode,
activeDate: mainItem.activeDate,
remark: mainLabelItem.remark,
worker: localStorage.userName_CN == "" ? localStorage.userName : localStorage.userName_CN,
activeDate: mainItem.activeDate,
number: "",
itemCode: mainLabelItem.itemCode,
itemName: mainItem.itemNameTemp,
itemDesc1: mainLabelItem.itemDesc1,
itemDesc2: mainLabelItem.itemDesc2,
configuration: mainItem.configuration,
packingCode: mainItem.packingCode,
locationCode: mainItem.locationCode,
containerCode: mainLabelItem.containerCode,
lot: mainLabelItem.lot,
inventoryStatuses: mainItem.status,
stdPackQty: mainLabelItem.stdPackQty,
uom: mainLabelItem.uom,
qty: mainItem.qty,
labelType: mainLabelItem.labelType,
fullBarcodeString: mainLabelItem.fullBarcodeString,
supplierBatch: mainLabelItem.supplierBatch,
arriveDate: mainLabelItem.arriveDate,
produceDate: mainLabelItem.produceDate,
expireDate: mainLabelItem.expireDate,
recommendLocationCode: mainLabelItem.recommendLocationCode,
locationErpCode: mainLabelItem.locationErpCode,
supplierCode: mainLabelItem.supplierCode,
rpNumber: mainLabelItem.rpNumber,
purchaseInfo_AsnNumber: mainLabelItem.asnNumber,
purchaseInfo_PoNumber: mainLabelItem.poNumber,
arrivalNoticNumber: "",
taskOrderNumber: "",
receiptRecNumber: "",
putOnShelfNumber: "",
supplierName: mainLabelItem.supplierName,
supplierSimpleName: mainLabelItem.supplierSimpleName,
supplierItemCode: mainLabelItem.supplierItemCode,
supplierItemName: mainLabelItem.supplierItemName,
planArriveDate: mainLabelItem.planArriveDate,
details: []
}
this.splitList.forEach(r => {
item.details.push(deepCopyData(r));
})
item.details.forEach(res => {
res.produceDate = res.produceDate ? secondsToDateTime(res.produceDate) : res
.produceDate;
res.planArriveDate = res.planArriveDate ? secondsToDateTime(res.planArriveDate) :
"",
res.expireDate = res.expireDate ? secondsToDateTime(res.expireDate) : "",
res.activeDate = res.activeDate ? secondsToDateTime(res.activeDate) : "",
res.creationTime = res.creationTime ? secondsToDateTime(res.creationTime) : "",
res.lastModificationTime = res.lastModificationTime ? secondsToDateTime(res
.lastModificationTime) : ""
res.inventoryStatuses=getInventoryStatusValueList(res.statusName)
})
let params = JSON.stringify(item);
splitPackingSubmit(params)
.then(res => {
uni.hideLoading();
if(res&&res.details.length>0){
this.navigateToPage(res.details)
this.clearInfo();
}else {
this.showMessage("提交成功未返回数据")
}
})
.catch(err => {
uni.hideLoading();
that.showMessage(err.message);
});
},
navigateToPage(dataList){
uni.navigateTo({
url: './splitPackingResult?data='+encodeURIComponent(JSON.stringify(dataList))
});
},
checkQty(balanceQty) {
var isPassed = false
//
var totalsplitQty = 0;
this.splitList.forEach(res => {
totalsplitQty += res.qty
})
if (totalsplitQty > balanceQty) {
isPassed = false
} else {
isPassed = true
}
return isPassed;
},
cancel() {
let that = this;
showConfirmMsg('是否要清空拆箱数据?', confirm => {
if (confirm) {
that.clearInfo();
}
})
},
clearInfo() {
this.itemList = [];
this.splitList = []
this.splitQty = 0
},
afterCloseMessagg() {
if (this.locationGotFocus) {
this.$refs.location.gotFocus();
}
},
clearPackCode() {
this.isClearPackCode = !this.isClearPackCode;
},
clearContainerCode() {
this.isClearContainerCode = !this.isClearContainerCode;
},
clearLot() {
this.isClearLot = !this.isClearLot;
},
upper: function(e) {
// console.log(e)
},
lower: function(e) {
// console.log(e)
},
scroll: function(e) {
// console.log(e)
this.old.scrollTop = e.detail.scrollTop;
},
showMessage(message) {
this.$refs.comMessage.showMessage(message);
},
showCommitSuccess() {
this.$refs.comMessage.showCommitSuccess();
},
qtyChanged(value) {
if(value<this.splitList.length){
this.splitList.splice(0,1)
}
var size = value - this.splitList.length;
var labelInfo = this.itemList[0].label
var itemInfo = this.itemList[0]
for (var i = 0; i < size; i++) {
var item = {
number: "",
packingCode: "",
warehouseCode: itemInfo.warehouseCode,
itemCode: labelInfo.itemCode,
itemName: labelInfo.itemName,
itemDesc1: labelInfo.itemDesc1,
itemDesc2: labelInfo.itemDesc2,
locationCode: itemInfo.locationCode,
locationErpCode: itemInfo.locationErpCode,
recommendLocationCode: itemInfo.recommendLocationCode,
lot: itemInfo.lot,
inventoryStatuses: itemInfo.status,
stdPackQty: labelInfo.stdPackQty,
uom: labelInfo.uom,
qty: 0,
labelType: labelInfo.labelType,
concurrencyStamp: labelInfo.concurrencyStamp,
configuration: labelInfo.configuration,
rpNumber: labelInfo.rpNumber,
purchaseInfo_AsnNumber: labelInfo.asnNumber,
purchaseInfo_PoNumber: labelInfo.poNumber,
arrivalNoticNumber: "",
receiptRecNumber: "",
putOnShelfNumber: "",
taskOrderNumber: "",
produceDate: labelInfo.produceDate ? timeInMilliseconds(labelInfo.produceDate) : labelInfo
.produceDate,
planArriveDate: labelInfo.planArriveDate ? timeInMilliseconds(labelInfo.planArriveDate) : "",
expireDate: labelInfo.expireDate ? timeInMilliseconds(labelInfo.expireDate) : "",
supplierCode: labelInfo.supplierCode,
supplierName: labelInfo.supplierName,
supplierSimpleName: labelInfo.supplierSimpleName,
supplierItemCode: labelInfo.supplierItemCode,
supplierItemName: labelInfo.supplierItemName,
activeDate: labelInfo.activeDate ? timeInMilliseconds(labelInfo.activeDate) : "",
creationTime: labelInfo.creationTime ? timeInMilliseconds(labelInfo.creationTime) : "",
lastModificationTime: labelInfo.lastModificationTime ? timeInMilliseconds(labelInfo
.lastModificationTime) : "",
remark: "",
worker: localStorage.userName_CN == "" ? localStorage.userName : localStorage.userName_CN,
fullBarcodeString: labelInfo.fullBarcodeString
}
this.splitList.push(item)
}
}
}
};
</script>
<style scoped lang="scss">
/deep/ .input-value {
font-size: 16px;
}
/deep/ .uni-collapse-item__title-text {
font-size: 16px;
}
/deep/ .uni-collapse-item--border {
border-bottom-width: 0px;
border-bottom-color: #ebeef5;
}
/deep/ .uni-collapse-item--border {
border-bottom-width: 1px;
border-bottom-color: #ebeef5;
}
</style>

84
fe/PDA/pages/inventory/splitPackingResult.vue

@ -0,0 +1,84 @@
<template>
<view class="">
<view class="" v-for="(item,index) in dataList" :key="index">
<view class="" style="border-radius: 10rpx; background-color: #fff; font-size: 35rpx; margin: 15rpx; padding: 20rpx;">
<view class="">
ERP料号 : {{item.itemCode}}
</view>
<view class="">
ERP名称 : {{item.itemName}}
</view>
<view class="">
描述1 : {{item.itemDesc1}}
</view>
<view class="">
箱码 : {{item.packingCode}}
</view>
<view class="" style="margin-top: 10rpx;">
数量 : {{item.qty}}
</view>
</view>
</view>
</view>
</template>
<script>
import {
goHome
} from '@/common/basic.js';
export default {
components: {},
data() {
return {
dataList: []
};
},
onLoad(e){
if(e.data==undefined||e.data=='undefined'){
}else {
this.dataList =JSON.parse(decodeURIComponent(e.data))
}
},
onPullDownRefresh() {},
//
onNavigationBarButtonTap(e) {
if (e.index === 0) {
goHome();
} else if (e.index === 1) {
window.location.reload();
}
},
methods: {
},
}
</script>
<style scoped lang="scss">
movable-view {
display: flex;
align-items: center;
justify-content: center;
height: 150rpx;
width: 150rpx;
}
movable-area {
height: 500rpx;
width: 100%;
overflow: hidden;
}
.movable-max {
width: 500rpx;
height: 500rpx;
}
</style>

2
fe/PDA/static/config.json

@ -34,7 +34,7 @@
"purchaseReturnReason": "PurReturnReason",
"returnBeforPutawayReason": "UnqualifiedReason",
"receiptCheckReason": "UnqualifiedReason",
"returnWareHouseUrl": "/wms/api/RestJsonService/notifyOutTaskBack4FW"
"returnWareHouseUrl": "http://10.164.233.34:9192"
},
"desc": {
"companyCode": "公司代码",

Loading…
Cancel
Save