Commit 89ade954 by LJM

add

parent 86bd34a2
.abnormalTally { .abnormalTally {
height: 100vh; height: 100vh;
padding: 0 24rpx; padding: 24rpx 24rpx 0 24rpx;
overflow: hidden; overflow: hidden;
.head-text { .head-text {
height: 80rpx; height: 80rpx;
...@@ -132,4 +132,16 @@ ...@@ -132,4 +132,16 @@
} }
} }
} }
.fix-btn {
position: fixed;
bottom: 20rpx;
left: 0;
right: 0;
margin: 0 24rpx;
height: 88rpx;
background: #197adb;
border-radius: 4rpx;
font-size: 28rpx;
color: #ffffff;
}
} }
<template> <template>
<view class="abnormalTally"> <view class="abnormalTally">
<view class="head-text row verCenter">
<view style="width: 50%;margin-left: 25rpx;">
<text class="t1">异常待处理:</text>
<text class="t2">88</text>
</view>
<view style="width: 50%;">
</view>
</view>
<view class="input-box row bothSide verCenter" style="margin-bottom: 16rpx;"> <view class="input-box row bothSide verCenter" style="margin-bottom: 16rpx;">
<input class="uni-input" placeholder="请取箱号" placeholder-style="color:#000;font-weight: bold;" /> <input class="uni-input" placeholder="请取箱号" disabled placeholder-style="color:#000;font-weight: bold;" v-model="box_sn" focus />
<view class="btn row rowCenter verCenter">取箱号</view> <template v-if="box_sn">
<view class="btn1 row rowCenter verCenter" @click="print()">打印箱号</view>
<view class="btn row rowCenter verCenter" @click="canel()">取消装箱</view>
</template>
<template v-else>
<view class="btn row rowCenter verCenter" @click="getBoxSn()">取箱号</view>
</template>
</view> </view>
<view class="input-box row bothSide verCenter"> <view class="input-box row bothSide verCenter">
<input class="uni-input" placeholder="请输入或扫描异常批次" placeholder-style="color:#000;font-weight: bold;" /> <input class="uni-input" placeholder="请输入或扫描异常批次" placeholder-style="color:#000;font-weight: bold;" v-model="abnormal_batch" @input="handleInput($event)" />
<view class="btn1 row rowCenter verCenter">确 认</view> <view class="btn1 row rowCenter verCenter" @click="confirm()">确 认</view>
</view> </view>
<view class="tab row verCenter"> <view class="tab row verCenter">
<view class="box" v-for="(item,index) in arr" :key="index" :class="{curr:curr==index}" @click="tab(index)">{{item}} (5)</view> <view class="box" v-for="(item,index) in arr" :key="index" :class="{curr:curr==index}" @click="tab(index)">
{{item}}
<template v-if="index == 0">({{num}})</template>
<template v-else-if="index == 1">({{usa_num}})</template>
<template v-else-if="index == 2">({{goods_check_num}})</template>
<template v-else-if="index == 3">({{have_close_box_num}})</template>
</view>
</view> </view>
<view class="list"> <view class="list">
<scroll-view scroll-y="true" class="scroll-Y"> <scroll-view scroll-y="true" class="scroll-Y">
<view class="box" v-for="(item,index) in 10" :key="index"> <view class="box" v-for="(item,index) in list" :key="index">
<view class="text row bothSide verCenter"> <view class="text row bothSide verCenter">
<text class="num row rowCenter verCenter">{{index+1}}</text> <text class="num row rowCenter verCenter">{{index+1}}</text>
<!-- 左侧 --> <!-- 左侧 -->
<view class="bar" style="width: 60%;"> <view class="bar" style="width: 60%;">
<view class="t1 mb16">YC0424001</view> <view class="t1 mb16">{{item.abnormal_batch}}</view>
<view class="row verCenter mb16"> <view class="row verCenter mb16">
<text class="t2">型号:</text> <text class="t2">型号:</text>
<text class="t3">BLM15KD200SN1D</text> <text class="t3">{{item.goods_type}}</text>
</view> </view>
<view class="row verCenter"> <view class="row verCenter">
<text class="t2">品牌:</text> <text class="t2">品牌:</text>
<text class="t3">NEXPERIA</text> <text class="t3">{{item.brand}}</text>
</view> </view>
</view> </view>
<!-- 右侧 --> <!-- 右侧 -->
<view class="bar" style="width: 40%;"> <view class="bar" style="width: 40%;">
<view class="row verCenter mb16"> <view class="row verCenter mb16">
<text class="t2">数量:</text> <text class="t2">数量:</text>
<text class="t3">1,000,000</text> <text class="t3">{{item.tally_num}}</text>
</view> </view>
<view class="row verCenter mb16"> <view class="row verCenter mb16">
<text class="t2">产地:</text> <text class="t2">产地:</text>
<text class="t3">美国</text> <template v-if="item.origin_confirm_status == 1">
<text class="iconfont icon-jinggao31"></text> <text class="t3" style="color: #197ADB;">{{item.origin}}</text>
<text class="t4" style="margin-left: 2rpx;">未确认</text> <text class="iconfont icon-jinggao31" style="color: #197ADB;"></text>
<text class="t4" style="margin-left: 2rpx;color: #197ADB;">已确认</text>
</template>
<template v-else>
<text class="t3">{{item.origin}}</text>
<text class="iconfont icon-jinggao31"></text>
<text class="t4" style="margin-left: 2rpx;">未确认</text>
</template>
</view> </view>
<view class="row verCenter mb16"> <view class="row verCenter mb16">
<text class="t2">商检:</text> <text class="t2">商检:</text>
<text class="t3"></text> <template v-if="item.is_goods_check == 1">
<text class="t3" style="color: #197ADB;">{{item.is_goods_check_cn}}</text>
</template>
<template v-else>
<text class="t3">{{item.is_goods_check_cn}}</text>
</template>
<template v-if="item.goods_check_confirm_status == 1">
<text class="iconfont icon-jinggao31" style="color: #197ADB;"></text>
<text class="t4" style="margin-left: 2rpx;color: #197ADB;">关务已确认</text>
</template>
<template v-else>
<text class="iconfont icon-jinggao31"></text>
<text class="t4" style="margin-left: 2rpx;">关务未确认</text>
</template>
</view> </view>
</view> </view>
</view> </view>
<view class="btn-wrap row" v-if="index == 0"> <view class="btn-wrap row">
<view class="btn row rowCenter verCenter">装 箱</view> <template v-if="curr != 3">
<!-- 产地确认,需要商检 关务已确认 -->
<template v-if="item.origin_confirm_status == 1 && item.is_goods_check == 1 && item.goods_check_confirm_status == 1">
<view class="btn row rowCenter verCenter" @click="submitAbnormalBox(1,item.wstydl_id)">装 箱</view>
</template>
<!-- 产地确认,不需要商检 -->
<template v-else-if="item.origin_confirm_status == 1 && item.is_goods_check == 0">
<view class="btn row rowCenter verCenter" @click="submitAbnormalBox(1,item.wstydl_id)">装 箱</view>
</template>
</template>
<template v-else>
<!-- 产地确认,需要商检 关务已确认 -->
<template v-if="item.origin_confirm_status == 1 && item.is_goods_check == 1 && item.goods_check_confirm_status == 1">
<view class="btn row rowCenter verCenter" @click="submitAbnormalBox(0,item.wstydl_id)">取 出</view>
</template>
<!-- 产地确认,不需要商检 -->
<template v-else-if="item.origin_confirm_status == 1 && item.is_goods_check == 0">
<view class="btn row rowCenter verCenter" @click="submitAbnormalBox(0,item.wstydl_id)">取 出</view>
</template>
<view class="fix-btn row rowCenter verCenter" @click="closeBox()">封 箱</view>
</template>
</view> </view>
</view> </view>
</scroll-view> </scroll-view>
</view> </view>
<!-- 关单封箱弹窗 -->
<uni-popup ref="inputDialog" type="dialog">
<uni-popup-dialog ref="inputClose" mode="input" :title="title" value="" confirmText="新箱子" cancelText="不需要换箱" placeholder="请输入毛重" @close="dialogInputClose" @confirm="dialogInputConfirm" :is-mask-click="true" :before-close="true"></uni-popup-dialog>
</uni-popup>
</view> </view>
</template> </template>
...@@ -71,13 +118,208 @@ ...@@ -71,13 +118,208 @@
export default { export default {
data() { data() {
return { return {
title: '',
curr: 0, curr: 0,
arr: ['美产', '商检', '已装箱'] arr: ['全部未装箱', '美产', '商检', '已装箱'],
num: '', //异常数量总数
usa_num: '',
goods_check_num: '',
have_close_box_num: '',
abnormal_batch: '', //异常批次
list: [],
box_sn: '', //箱号信息
wsty_id: '', //箱子id
}; };
}, },
onShow() {
this.getData();
},
methods: { methods: {
/**
* 监听输入框
* @param {Object} event
*/
handleInput: debounce(function(event) {
var inputValue = event.target.value;
if (inputValue) {
if (inputValue.includes('\n')) {
this.getData();
}
}
}, 500),
/**
* 确认
*/
confirm() {
if (!this.abnormal_batch) {
uni.showToast({
title: '请输入异常批次号',
icon: 'none'
});
return false;
}
this.getData();
},
/**
* 获取箱号
*/
getBoxSn() {
this.request(API.getBoxSn, 'POST', {}, true).then(res => {
if (res.err_code === 0) {
this.box_sn = res.data.box_sn;
this.wsty_id = res.data.wsty_id;
} else {
uni.showToast({
title: res.err_msg,
icon: 'none'
});
}
});
},
tab(index) { tab(index) {
this.curr = index; this.curr = index;
this.getData();
},
/**
* 获取异常理货明细
*/
getData() {
this.request(API.getAbnormalTallyDetail, 'GET', { type: this.curr, abnormal_batch: this.abnormal_batch }, true).then(res => {
if (res.err_code === 0) {
this.list = res.data.detail;
var data = res.data;
this.usa_num = res.data.usa_num; //美产
this.goods_check_num = res.data.goods_check_num; //商检
this.have_close_box_num = res.data.have_close_box_num; //已装箱
this.num = Object.keys(data)
.filter(key => key !== 'detail' && key !== 'have_close_box_num') // 排除 'detail' 和 'have_close_box_num' 属性
.map(key => Number(data[key])) // 转换为数字
.reduce((acc, val) => acc + val, 0);
} else {
uni.showToast({
title: res.err_msg,
icon: 'none'
});
}
});
},
/**
* 异常型号装箱
*/
submitAbnormalBox(type, wstydl_id) {
if (!this.box_sn) {
uni.showModal({
title: '',
content: '请先取箱号!并将打印的箱号贴于外箱上',
showCancel: false
});
return false;
}
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'
});
}
});
},
/**
* 关单封箱
*/
closeBox() {
this.title = `该箱子已经全部验货完毕是否更换新的箱子?`;
this.$refs.inputDialog.open();
},
/**
* 新箱子
*/
dialogInputConfirm(val) {
if (!val) {
uni.showToast({
title: '请输入毛重',
icon: 'none'
});
return false;
}
this.request(API.closeBox, 'POST', { wsty_id: this.wsty_id, gross_weight: val }, true).then(res => {
if (res.err_code === 0) {
this.box_sn = '';
this.wsty_id = '';
this.tallyData = [];
this.erp_order_sn = '';
this.$refs.inputDialog.close()
} else {
uni.showToast({
title: res.err_msg,
icon: 'none'
});
}
});
},
/**
* 不需要换箱
*/
dialogInputClose() {
this.request(API.closeBox, 'POST', { wsty_id: this.wsty_id, gross_weight: '' }, true).then(res => {
if (res.err_code === 0) {
this.$refs.inputDialog.close();
this.tallyData = [];
this.erp_order_sn = '';
} 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.fixBox, 'POST', { old_box_sn_str: this.old_box_sn_str }, true).then(res => {
if (res.err_code === 0) {
uni.showModal({
title: '',
content: '打印成功,请查看打印机',
showCancel: false
});
} else {
uni.showToast({
title: res.err_msg,
icon: 'none'
});
}
});
},
/**
* 取消装箱
*/
canel() {
this.box_sn = '';
this.wsty_id = '';
} }
} }
}; };
...@@ -85,4 +327,14 @@ ...@@ -85,4 +327,14 @@
<style scoped lang="scss"> <style scoped lang="scss">
@import '@/assets/css/tally/abnormalTally.scss'; @import '@/assets/css/tally/abnormalTally.scss';
::v-deep {
.uni-dialog-title-text {
padding: 10px;
text-align: center;
color: #404547;
font-size: 26rpx !important;
font-weight: bold !important;
}
}
</style> </style>
\ No newline at end of file
...@@ -201,6 +201,7 @@ ...@@ -201,6 +201,7 @@
export default { export default {
data() { data() {
return { return {
is_focus: true, //获取焦点动态化
title: '', title: '',
step: 0, step: 0,
keyword: '', keyword: '',
......
<template> <template>
<view class="printBox"> <view class="printBox">
<view class="input-box row bothSide verCenter"> <view class="input-box row bothSide verCenter">
<input class="uni-input" placeholder="输入或扫描入箱号" placeholder-style="color:#000;font-weight: bold;" v-model="box_sn" /> <input class="uni-input" placeholder="输入或扫描入箱号" placeholder-style="color:#000;font-weight: bold;" v-model="box_sn" :focus="is_focus" />
<view class="btn row rowCenter verCenter" @click="print()">打印箱号</view> <view class="btn row rowCenter verCenter" @click="print()">打印箱号</view>
</view> </view>
</view> </view>
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
export default { export default {
data() { data() {
return { return {
is_focus: true, //获取焦点动态化
box_sn: '' box_sn: ''
}; };
}, },
......
...@@ -279,7 +279,7 @@ const API = { ...@@ -279,7 +279,7 @@ const API = {
/** /**
* 异常型号装箱 * 异常型号装箱
*/ */
getAbnormalTallyDetail: API_BASE + '/supplywechatwms/closeAbnormalBox', submitAbnormalBox: API_BASE + '/supplywechatwms/submitAbnormalBox',
/** /**
* 合箱 * 合箱
*/ */
......
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