Commit f579ba19 by LJM

单一物料多箱货物支持快捷理货装(分)箱及相关联功能

parent 2a163828
......@@ -18,12 +18,12 @@
width: 33.3%;
margin-bottom: 10rpx;
.t1 {
font-size: 24rpx;
font-size: 26rpx;
color: #6e767a;
}
.t2 {
font-size: 24rpx;
color: #404547;
font-size: 26rpx;
color: #197adb;
font-weight: bold;
}
}
......@@ -33,7 +33,13 @@
font-size: 28rpx;
color: #919399;
}
.status-color {
font-size: 26rpx;
color: #197adb;
font-weight: bold;
}
.uni-input {
width: 216rpx;
height: 55rpx;
background: #ffffff;
border-radius: 10rpx;
......@@ -42,6 +48,14 @@
padding-left: 18rpx;
margin: 0 6rpx;
}
.btn {
width: 122rpx;
height: 51rpx;
background: #197adb;
font-size: 28rpx;
color: #ffffff;
border-radius: 10rpx;
}
}
}
.list {
......@@ -265,3 +279,59 @@
::v-deep .uni-drawer__content {
width: 85% !important;
}
.popup-content-tally-num {
background-color: #f1f4f6;
padding: 50rpx 24rpx 50rpx 24rpx;
border-radius: 10rpx;
width: 550rpx;
.input-box {
margin-bottom: 30rpx;
.label {
width: 190rpx;
font-size: 26rpx;
color: #6e767a;
white-space: nowrap;
}
.tt {
font-weight: bold;
font-size: 28rpx;
color: #404547;
}
.uni-input {
width: 210rpx;
height: 55rpx;
background: #e6edf0;
border-radius: 4rpx;
padding-left: 20rpx;
font-size: 26rpx;
color: #404547;
font-weight: bold;
}
}
.tip {
font-size: 26rpx;
color: #f39d18;
margin-bottom: 40rpx;
}
.btn {
padding: 0 70rpx;
.ok {
width: 140rpx;
height: 60rpx;
background: #197adb;
border-radius: 10rpx;
font-size: 26rpx;
color: #ffffff;
}
.canel {
width: 140rpx;
height: 60rpx;
background: #ffffff;
border-radius: 10rpx;
border: 1px solid #197adb;
font-size: 24rpx;
color: #197adb;
}
}
}
......@@ -355,9 +355,10 @@
});
},
/**
* 异常型号装箱 1装箱 0去除
* 异常型号装箱 1装箱 0取出
*/
submitAbnormalBox(type, wstydl_id, item) {
debugger
if (type == 1) {
//装箱的时候验证
if (!this.box_sn) {
......@@ -377,23 +378,67 @@
confirmText: '确认取出',
success: (res) => {
if (res.confirm) {
this.request(API.submitAbnormalBox, 'POST', { type: type, wstydl_id: wstydl_id, wsty_id: this.wsty_id }, true).then(res => {
if (res.err_code === 0) {
uni.showModal({
title: '',
content: type == 1 ? '装箱成功' : '取出成功',
showCancel: false,
success: (res) => {
if (res.confirm) {
this.getData();
} else if (res.cancel) {
console.log('用户点击取消');
this.request(API.getBoxNumByDetailId, 'POST', { wsty_id: this.form[index].wsty_id }, true).then(json => {
if (json.err_code === 0) {
if (json.data > 1) {
let text = `${item.erp_order_sn}货物分部在${this.box_sn}${json.data.length}个子箱,请确认是否全部取消`;
uni.showModal({
title: '提示',
content: text,
success: (res) => {
if (res.confirm) {
this.request(API.submitAbnormalBox, 'POST', { type: type, wstydl_id: wstydl_id, wsty_id: this.wsty_id }, true).then(res => {
if (res.err_code === 0) {
uni.showModal({
title: '',
content: type == 1 ? '装箱成功' : '取出成功',
showCancel: false,
success: (res) => {
if (res.confirm) {
this.getData();
} else if (res.cancel) {
console.log('用户点击取消');
}
}
});
} else {
uni.showToast({
title: res.err_msg,
icon: 'none'
});
}
});
} else if (res.cancel) {
console.log('用户点击取消');
}
}
}
});
});
} else {
this.request(API.submitAbnormalBox, 'POST', { type: type, wstydl_id: wstydl_id, wsty_id: this.wsty_id }, true).then(res => {
if (res.err_code === 0) {
uni.showModal({
title: '',
content: type == 1 ? '装箱成功' : '取出成功',
showCancel: false,
success: (res) => {
if (res.confirm) {
this.getData();
} else if (res.cancel) {
console.log('用户点击取消');
}
}
});
} else {
uni.showToast({
title: res.err_msg,
icon: 'none'
});
}
});
}
} else {
uni.showToast({
title: res.err_msg,
title: json.err_msg,
icon: 'none'
});
}
......
......@@ -20,14 +20,29 @@
<view class="t2">{{boxData.net_weight_sum}}kg</view>
</view>
</view>
<view class="input-box row verCenter">
<view class="input-box row verCenter" style="margin-bottom: 20rpx;">
<view class="row verCenter">
<text style="color: red;">*</text>
<text class="tt">总毛重:</text>
</view>
<input type="number" placeholder="请输入总毛重" class="uni-input" v-model="gross_weight" />
<input type="number" inputmode="decimal" placeholder="请输入总毛重" class="uni-input" v-model="gross_weight" />
<text class="tt">kg</text>
</view>
<view class="input-box row verCenter">
<view class="row verCenter">
<text style="color: red;">*</text>
<text class="tt">子箱数:</text>
</view>
<template v-if="flag">
<input type="number" inputmode="numeric" placeholder="请输入子箱数" class="uni-input" v-model="sub_box_qty" />
<view style="background-color: #fff;color: #197adb;border: 1px solid #197adb;width: 100rpx;margin: 0 10rpx;" class="btn row rowCenter verCenter" @click="flag=false">取消</view>
<view style="width: 153rpx;" class="btn row rowCenter verCenter" @click="alterTallyTagBySubBoxQty()">保存打印</view>
</template>
<template v-else>
<view class="status-color">{{boxData.sub_box_qty || 1}}</view>
<view class="btn row rowCenter verCenter" @click="flag=true" style="margin-left: 60rpx;">多子箱</view>
</template>
</view>
</view>
<!-- 列表区 -->
<view class="list" v-if="list.length > 0">
......@@ -95,6 +110,35 @@
<text class="text">查不到当前数据</text>
</view>
<view class="closeBoxBtn row rowCenter verCenter" @click="closeBoxChange">确认封箱</view>
<!-- 多个纸箱提示 -->
<uni-popup ref="printScanList" background-color="#F1F4F6">
<view class="popup-content-tally-num">
<view class="text">{{box_sn}}有{{checkboxItems.length}}个子箱,选择你需要打印标签</view>
<view class="row verCenter" style="font-size: 28rpx;">
<checkbox-group @change="checkboxAllChange">
<label>
<checkbox value="cb" style="transform:scale(0.7)" color="#197adb" activeBackgroundColor="#197adb" activeBorderColor="#197adb" :checked="allChecked" />全选
</label>
</checkbox-group>
</view>
<view class="uni-list" style="padding-left: 50rpx;">
<scroll-view scroll-y="true" style="max-height:400rpx">
<checkbox-group @change="checkboxChange">
<label class="row verCenter" v-for="item in checkboxItems" :key="item.value">
<view>
<checkbox :value="item.value" :checked="item.checked" style="transform:scale(0.7)" color="#197adb" />
</view>
<view>{{item.name}}</view>
</label>
</checkbox-group>
</scroll-view>
</view>
<view class="btn row bothSide" style="margin-top: 24rpx;">
<view class="ok row rowCenter verCenter" @click="printMultiple()">打印</view>
<view class="canel row rowCenter verCenter" @click="close()">返回</view>
</view>
</view>
</uni-popup>
</view>
</template>
......@@ -103,6 +147,8 @@
export default {
data() {
return {
email: uni.getStorageSync('email') || '', //操作人邮箱
flag: false,
noexebshowFalg: true, //控制是否会触发生命周期
wsty_id: '',
box_sn: '',
......@@ -114,9 +160,12 @@
is_focus: true, //获取焦点动态化
boxData: {},
gross_weight: '',
sub_box_qty: '', //子箱号
searchParams: {
all_search: ''
}
},
allChecked: false,
checkboxItems: []
};
},
onLoad(options) {
......@@ -235,6 +284,157 @@
current: index,
urls: arr
});
},
/**
* 修改子箱数量
*/
alterTallyTagBySubBoxQty() {
if (Number(this.sub_box_qty) <= 1) {
uni.showToast({
title: '请输入大于1的整数',
icon: 'none',
duration: 2000
});
return false;
}
this.request(API.alterTallyTagBySubBoxQty, 'POST', { box_sn: this.box_sn, sub_box_qty: this.sub_box_qty }, true).then(res => {
if (res.err_code === 0) {
uni.showToast({
title: '操作成功',
icon: 'success',
duration: 2000
});
setTimeout(() => {
this.print();
}, 2000)
} else {
uni.showToast({
title: res.err_msg,
icon: 'none'
});
}
});
},
/**
* 打印箱号
*/
print() {
if (!this.box_sn) {
uni.showModal({
title: '',
content: '请先扫描箱号',
showCancel: false
});
return false;
}
this.request(API.getPrintScanList, 'POST', { box_sn: this.box_sn }, true).then(res => {
if (res.err_code === 0) {
//一个标签的时候直接打印
if (res.data.length == 0) {
uni.showToast({
title: '数据异常',
icon: 'none'
});
} else if (res.data.length == 1) {
this.printConfirm(res.data);
} else {
//多个时候
res.data.forEach(item => {
this.checkboxItems.push({
value: item,
name: item,
checked: false
});
});
this.$refs.printScanList.open();
}
} else {
uni.showToast({
title: res.err_msg,
icon: 'none'
});
}
});
},
/**
* 处理打印标签,单个和多个
*/
printConfirm(data) {
var box_sn = [];
if (data.length > 0) {
data.forEach(item => {
box_sn.push({ box_sn: item });
});
}
var params = {
type: 1,
email: this.email,
print_json: JSON.stringify(box_sn)
}
this.request(API.addSCTallyData, 'POST', params, true).then(res => {
if (res.code === 0) {
uni.showToast({
title: '打印箱号成功',
icon: 'success'
})
setTimeout(() => {
this.close();
this.flag = false;
this.resetChange();
this.getData();
this.getBoxData();
}, 2000)
} else {
uni.showToast({
title: res.msg,
icon: 'none'
});
}
});
},
/**
* 全选复选框状态变化
* @param {Object} e
*/
checkboxAllChange(e) {
this.allChecked = e.detail.value.length > 0; // 如果全选框被选中,设置为true
this.checkboxItems.forEach(item => {
item.checked = this.allChecked;
});
},
/**
* 单个复选框状态变化
* @param {Object} e
*/
checkboxChange(e) {
const values = e.detail.value;
this.checkboxItems.forEach(item => {
item.checked = values.includes(item.value);
});
// 更新全选复选框的状态
this.allChecked = this.checkboxItems.every(item => item.checked);
console.log(values);
},
/**
* 多个打印确认
*/
printMultiple() {
var checkedItems = this.checkboxItems.filter(item => item.checked);
if (checkedItems.length == 0) {
uni.showToast({
title: '请勾选要打印的箱号',
icon: 'none'
})
return false;
}
var box_sn = checkedItems.map(item => item.value);
this.printConfirm(box_sn);
},
/**
* 关闭打印多个提示
*/
close() {
this.$refs.printScanList.close();
}
}
};
......
......@@ -285,6 +285,35 @@
</view>
</view>
</uni-popup>
<!-- 多个纸箱提示 -->
<uni-popup ref="printScanList" background-color="#F1F4F6">
<view class="popup-content-tally-num">
<view class="text">{{box_sn}}有{{checkboxItems.length}}个子箱,选择你需要打印标签</view>
<view class="row verCenter" style="font-size: 28rpx;">
<checkbox-group @change="checkboxAllChange">
<label>
<checkbox value="cb" style="transform:scale(0.7)" color="#197adb" activeBackgroundColor="#197adb" activeBorderColor="#197adb" :checked="allChecked" />全选
</label>
</checkbox-group>
</view>
<view class="uni-list" style="padding-left: 50rpx;">
<scroll-view scroll-y="true" style="max-height:400rpx">
<checkbox-group @change="checkboxChange">
<label class="row verCenter" v-for="item in checkboxItems" :key="item.value">
<view>
<checkbox :value="item.value" :checked="item.checked" style="transform:scale(0.7)" color="#197adb" />
</view>
<view>{{item.name}}</view>
</label>
</checkbox-group>
</scroll-view>
</view>
<view class="btn row bothSide" style="margin-top: 24rpx;">
<view class="ok row rowCenter verCenter" @click="printMultiple()">打印</view>
<view class="canel row rowCenter verCenter" @click="close()">返回</view>
</view>
</view>
</uni-popup>
</view>
</template>
......@@ -325,7 +354,9 @@
tally_info: {
tally_num_temp: ''
},
net_weight_total: 0 //净重合计
net_weight_total: 0, //净重合计
allChecked: false,
checkboxItems: []
};
},
watch: {
......@@ -395,6 +426,9 @@
var value = event.target.value;
if (type == 1) {
if (value) {
if (value.indexOf('-') !== -1) { // 判断字符串中是否存在 '-'
value = value.split('-')[0]; // 存在则截取 '-' 前的部分
}
this.getBoxSn(value);
}
} else if (type == 2) {
......@@ -852,6 +886,9 @@
}
});
},
/**
* 理货数量异常提示
*/
tallyDetailConfirmClose() {
this.$refs.popupTallyNum.close();
},
......@@ -993,27 +1030,61 @@
});
},
/**
* 理货明细撤销
* 理货明细撤销(取消理货)
*/
cancelTallyDetail(index) {
uni.showModal({
title: '提示',
content: '确定取消该商品理货吗?',
success: (res) => {
if (res.confirm) {
this.request(API.cancelTallyDetail, 'POST', { wstydl_id: this.form[index].wstydl_id, wsty_id: this.form[index].wsty_id }, true).then(res => {
if (res.err_code === 0) {
this.getTallyData();
} else {
uni.showToast({
title: res.err_msg,
icon: 'none'
});
//根据理货明细获取箱数
this.request(API.getBoxNumByDetailId, 'POST', { wsty_id: this.form[index].wsty_id }, true).then(json => {
if (json.err_code === 0) {
if (json.data > 1) {
let text = `${this.erp_order_sn}货物分部在${this.box_sn}${json.data.length}个子箱,请确认是否全部取消`;
uni.showModal({
title: '提示',
content: text,
success: (res) => {
if (res.confirm) {
this.request(API.cancelTallyDetail, 'POST', { wstydl_id: this.form[index].wstydl_id, wsty_id: this.form[index].wsty_id }, true).then(res => {
if (res.err_code === 0) {
this.getTallyData();
} else {
uni.showToast({
title: res.err_msg,
icon: 'none'
});
}
});
} else if (res.cancel) {
console.log('用户点击取消');
}
}
});
} else {
uni.showModal({
title: '提示',
content: '确定取消该商品理货吗?',
success: (res) => {
if (res.confirm) {
this.request(API.cancelTallyDetail, 'POST', { wstydl_id: this.form[index].wstydl_id, wsty_id: this.form[index].wsty_id }, true).then(res => {
if (res.err_code === 0) {
this.getTallyData();
} else {
uni.showToast({
title: res.err_msg,
icon: 'none'
});
}
});
} else if (res.cancel) {
console.log('用户点击取消');
}
}
});
} else if (res.cancel) {
console.log('用户点击取消');
}
} else {
uni.showToast({
title: json.err_msg,
icon: 'none'
});
}
});
},
......@@ -1127,10 +1198,49 @@
});
return false;
}
this.request(API.getPrintScanList, 'POST', { box_sn: this.box_sn }, true).then(res => {
if (res.err_code === 0) {
//一个标签的时候直接打印
if (res.data.length == 0) {
uni.showToast({
title: '数据异常',
icon: 'none'
});
} else if (res.data.length == 1) {
this.printConfirm(res.data);
} else {
//多个时候
res.data.forEach(item => {
this.checkboxItems.push({
value: item,
name: item,
checked: false
});
});
this.$refs.printScanList.open();
}
} else {
uni.showToast({
title: res.err_msg,
icon: 'none'
});
}
});
},
/**
* 处理打印标签,单个和多个
*/
printConfirm(data) {
var box_sn = [];
if (data.length > 0) {
data.forEach(item => {
box_sn.push({ box_sn: item });
});
}
var params = {
type: 1,
email: this.email,
print_json: JSON.stringify([{ box_sn: this.box_sn }])
print_json: JSON.stringify(box_sn)
}
this.request(API.addSCTallyData, 'POST', params, true).then(res => {
if (res.code === 0) {
......@@ -1138,15 +1248,62 @@
title: '打印箱号成功',
icon: 'success'
})
setTimeout(() => {
this.close();
}, 2000)
} else {
uni.showToast({
title: res.err_msg,
title: res.msg,
icon: 'none'
});
}
});
},
/**
* 全选复选框状态变化
* @param {Object} e
*/
checkboxAllChange(e) {
this.allChecked = e.detail.value.length > 0; // 如果全选框被选中,设置为true
this.checkboxItems.forEach(item => {
item.checked = this.allChecked;
});
},
/**
* 单个复选框状态变化
* @param {Object} e
*/
checkboxChange(e) {
const values = e.detail.value;
this.checkboxItems.forEach(item => {
item.checked = values.includes(item.value);
});
// 更新全选复选框的状态
this.allChecked = this.checkboxItems.every(item => item.checked);
console.log(values);
},
/**
* 多个打印确认
*/
printMultiple() {
var checkedItems = this.checkboxItems.filter(item => item.checked);
if (checkedItems.length == 0) {
uni.showToast({
title: '请勾选要打印的箱号',
icon: 'none'
})
return false;
}
var box_sn = checkedItems.map(item => item.value);
this.printConfirm(box_sn);
},
/**
* 关闭打印多个提示
*/
close() {
this.$refs.printScanList.close();
},
/**
* 清空数据
*/
clearInput(type) {
......
......@@ -5,7 +5,7 @@
<view class="action-bar row verCenter">
<text class="iconfont icon-jinggao2" @click="clearInput(1)" v-if="box_sn"></text>
<template v-if="box_sn && is_unboxing && tallyData.detail && tallyData.detail.length > 0">
<view class="btn1 row rowCenter verCenter" @click="closeBox()">重新封箱</view>
<navigator class="btn1 row rowCenter verCenter" :url="'/pages/tally/closeBox?box_sn='+box_sn+'&wsty_id='+wsty_id" hover-class="none" @click="closeBox()">重新封箱</navigator>
</template>
<template v-else>
<view class="btn row rowCenter verCenter" @click="unboxing()" v-if="box_sn && tallyData.detail && tallyData.detail.length > 0">开 箱</view>
......@@ -161,6 +161,7 @@
is_focus_1: true, //获取焦点动态化
is_focus_2: false, //获取焦点动态化
box_sn: '',
wsty_id: '', //箱子id
keyword: '',
all_search: '', //全量搜索字段
tallyData: {}, //理货信息
......@@ -280,9 +281,15 @@
title: '开箱成功',
icon: 'success'
})
//这里的必须性是为了拿到箱子id
setTimeout(() => {
this.is_unboxing = true; //表示开箱成功
this.getTallyData();
this.request(API.getBoxSn, 'POST', { box_sn: box_sn }, true).then(res => {
if (res.err_code === 0) {
this.wsty_id = res.data.wsty_id;
this.is_unboxing = true; //表示开箱成功
this.getTallyData();
}
});
}, 2000)
} else {
this.form = [];
......@@ -610,7 +617,7 @@
net_weight: item.net_weight, // 净重
goods_check_pic: item.goods_check_pic, // 商检的必须上传图片
wstydl_id: item.wstydl_id, // 理货明细ID
erp_order_sn: this.erp_order_sn, // 入仓号
erp_order_sn: item.erp_order_sn, // 入仓号
box_sn: this.box_sn, // 箱子
is_goods_check: item.is_goods_check, //是否商检
sync_status: item.sync_status, //明细同步状态
......@@ -907,20 +914,61 @@
});
return false;
}
this.request(API.cancelTallyDetail, 'POST', { wstydl_id: this.form[this.formIndex].wstydl_id, box_sn: this.box_sn, gross_weight: val }, true).then(res => {
if (res.err_code === 0) {
uni.showToast({
title: '取消理货成功',
icon: 'success',
duration: 2000
});
setTimeout(() => {
this.$refs.canelInputDialog.close();
this.getTallyData();
}, 2000);
this.request(API.getBoxNumByDetailId, 'POST', { wsty_id: this.form[index].wsty_id }, true).then(json => {
if (json.err_code === 0) {
if (json.data > 1) {
let text = `${this.form[this.formIndex].erp_order_sn}货物分部在${this.box_sn}${json.data.length}个子箱,请确认是否全部取消`;
uni.showModal({
title: '提示',
content: text,
success: (res) => {
if (res.confirm) {
this.request(API.cancelTallyDetail, 'POST', { wstydl_id: this.form[this.formIndex].wstydl_id, box_sn: this.box_sn, gross_weight: val }, true).then(res => {
if (res.err_code === 0) {
uni.showToast({
title: '取消理货成功',
icon: 'success',
duration: 2000
});
setTimeout(() => {
this.$refs.canelInputDialog.close();
this.getTallyData();
}, 2000);
} else {
uni.showToast({
title: res.err_msg,
icon: 'none'
});
}
});
} else if (res.cancel) {
console.log('用户点击取消');
}
}
});
} else {
this.request(API.cancelTallyDetail, 'POST', { wstydl_id: this.form[this.formIndex].wstydl_id, box_sn: this.box_sn, gross_weight: val }, true).then(res => {
if (res.err_code === 0) {
uni.showToast({
title: '取消理货成功',
icon: 'success',
duration: 2000
});
setTimeout(() => {
this.$refs.canelInputDialog.close();
this.getTallyData();
}, 2000);
} else {
uni.showToast({
title: res.err_msg,
icon: 'none'
});
}
});
}
} else {
uni.showToast({
title: res.err_msg,
title: json.err_msg,
icon: 'none'
});
}
......
const API_BASE = 'https://api.ichunt.com';
const API_BASE_OSS = 'https://image.ichunt.net'; //oss系统
const API_BASE_OSS_HK = 'http://hk.image.semour.com'; //oss系统 HK
const API_BASE_WMS = 'https://wms.ichunt.net'; //WMS系统
// const API_BASE = 'https://api.ichunt.com';
// const API_BASE_OSS = 'https://image.ichunt.net'; //oss系统
// const API_BASE_OSS_HK = 'http://hk.image.semour.com'; //oss系统 HK
// const API_BASE_WMS = 'https://wms.ichunt.net'; //WMS系统
// const API_BASE = 'http://api.liexin.com';
// const API_BASE_OSS = 'http://image.liexindev.net';
// const API_BASE_OSS_HK = 'http://image.liexindev.net'; //oss系统 HK
// const API_BASE_WMS = 'http://wms.liexindev.net'; //WMS系统
const API_BASE = 'http://api.liexin.com';
const API_BASE_OSS = 'http://image.liexindev.net';
const API_BASE_OSS_HK = 'http://image.liexindev.net'; //oss系统 HK
const API_BASE_WMS = 'http://wms.liexindev.net'; //WMS系统
const API = {
......@@ -325,7 +325,23 @@ const API = {
/**
* 获取app版本
*/
getAppLatestVersion: API_BASE + '/supplywechatwms/getAppLatestVersion'
getAppLatestVersion: API_BASE + '/supplywechatwms/getAppLatestVersion',
/**
* 获取获取标签打印列表版本
*/
getPrintScanList: API_BASE + '/tallyGoodsAjax/getPrintScanList',
/**
* app 修改子箱数量
*/
alterTallyTagBySubBoxQty: API_BASE + '/supplywechatwms/alterTallyTagBySubBoxQty',
/**
* app 根据获取标签号
*/
getPrintScanList: API_BASE + '/supplywechatwms/getPrintScanList',
/**
* app 根据理货明细获取箱数
*/
getBoxNumByDetailId: API_BASE + '/supplywechatwms/getBoxNumByDetailId'
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment