Commit 51079059 by LJM

异常

parent f6c8f2f8
......@@ -49,7 +49,7 @@
}
}
.tab {
height: 106rpx;
height: 90rpx;
.box {
position: relative;
font-size: 26rpx;
......@@ -154,4 +154,29 @@
font-size: 28rpx;
color: #ffffff;
}
.filter-tab {
height: 60rpx;
.t1 {
font-size: 24rpx;
color: #404547;
}
.t2 {
font-size: 26rpx;
color: #404547;
}
.time {
.picker-data {
width: 140rpx;
}
.picker-time {
width: 70rpx;
text-align: right;
}
.text {
font-size: 24rpx;
color: #197adb;
white-space: nowrap;
}
}
}
}
......@@ -17,7 +17,6 @@
<input class="uni-input" placeholder="请输入或扫描异常批次" :focus="is_focus_2" placeholder-style="color:#000;font-weight: bold;" v-model="abnormal_batch" @input="handleInput($event,2)" />
<view class="row verCenter">
<text class="iconfont icon-jinggao2" @click="clearInput(2)" v-if="abnormal_batch"></text>
<view class="btn1 row rowCenter verCenter" @click="confirm()">确 认</view>
</view>
</view>
<view class="tab row verCenter">
......@@ -29,6 +28,46 @@
<template v-else-if="index == 3">({{have_close_box_num}})</template>
</view>
</view>
<view class="filter-tab row bothSide verCenter" v-if="abnormalTallyDetail">
<!-- 已装箱显示 -->
<template v-if="curr == 3">
<view class="t1"></view>
<view class="row verCenter">
<text class="t2">装箱时间:</text>
<view class="time row verCenter">
<picker mode="date" class="picker-data row verCenter" :value="pack_time_start" @change="bindDateChange($event,2)">
<span class="text">{{pack_time_start}}</span>
</picker>
<picker mode="date" class="picker-data row verCenter" :value="pack_time_end" @change="bindDateChange($event,3)">
<span class="text">{{pack_time_end}}</span>
</picker>
</view>
</view>
</template>
<!-- 未装箱 -->
<template v-else>
<template v-if="curr == 0">
<view class="t1" v-if="abnormalTallyDetail.confirm_all_num">已确认({{abnormalTallyDetail.confirm_all_num || ''}}</view>
</template>
<template v-else-if="curr == 1">
<view class="t1" v-if="abnormalTallyDetail.confirm_usa_num">已确认({{abnormalTallyDetail.confirm_usa_num || ''}}</view>
</template>
<template v-else-if="curr == 2">
<view class="t1" v-if="abnormalTallyDetail.confirm_goods_check_num">已确认({{abnormalTallyDetail.confirm_goods_check_num || '' }}</view>
</template>
<view class="row verCenter">
<text class="t2">截止时间:</text>
<view class="time row verCenter">
<picker mode="date" class="picker-data row verCenter" :value="confirm_time_date" @change="bindDateChange($event,1)">
<span class="text">{{confirm_time_date}}</span>
</picker>
<picker mode="time" class="picker-time row verCenter" :value="confirm_time_day" @change="bindTimeChange">
<span class="text">{{confirm_time_day}}</span>
</picker>
</view>
</view>
</template>
</view>
<view class="list" v-if="list.length > 0" :class="{pb100:curr==3}">
<scroll-view scroll-y="true" class="scroll-Y">
<view class="box" v-for="(item,index) in list" :key="index">
......@@ -86,6 +125,18 @@
</view>
</view>
</view>
<template v-if="curr == 3">
<view class="row verCenter mb16" style="margin-top: 16rpx;">
<text class="t2">装箱时间:</text>
<text class="t3">{{item.pack_time}}</text>
</view>
</template>
<template v-else>
<view class="row verCenter mb16" style="margin-top: 16rpx;">
<text class="t2">确认时间:</text>
<text class="t3">{{item.confirm_time_cn}}</text>
</view>
</template>
<view class="btn-wrap row">
<template v-if="curr != 3">
<!-- 商检和美产 产地已确认显示装箱 -->
......@@ -136,12 +187,80 @@
list: [],
box_sn: '', //箱号信息
wsty_id: '', //箱子id
abnormalTallyDetail: {},
confirm_time: '', //确认时间
pack_time: '', //装箱时间
confirm_time_date: this.getCurrentDate(),
confirm_time_day: '19:00',
pack_time_start: this.getPreviousMonthDate(this.getCurrentDate()),
pack_time_end: this.getCurrentDate()
};
},
onShow() {
this.getData();
},
created() {
this.updateConfirmTime();
},
methods: {
bindDateChange: function(e, type) {
switch (type) {
case 1:
this.confirm_time_date = e.detail.value;
this.updateConfirmTime();
break;
case 2:
this.pack_time_start = e.detail.value;
this.updatePackTime();
break;
case 3:
const newEndDate = e.detail.value;
if (new Date(newEndDate) < new Date(this.pack_time_start)) {
uni.showToast({
title: '装箱结束时间不能小于装箱开始时间',
icon: 'none'
});
return false;
} else {
this.pack_time_end = e.detail.value;
}
this.updatePackTime();
break;
}
this.getData();
},
bindTimeChange: function(e) {
this.confirm_time_day = e.detail.value;
this.updateConfirmTime();
},
/**
* 获取日期
*/
getCurrentDate() {
const today = new Date();
const year = today.getFullYear();
const month = String(today.getMonth() + 1).padStart(2, '0');
const day = String(today.getDate()).padStart(2, '0');
return `${year}-${month}-${day}`;
},
/**
* 时间推前一个月
* @param {Object} dateStr
*/
getPreviousMonthDate(dateStr) {
const date = new Date(dateStr);
date.setMonth(date.getMonth() - 1);
const year = date.getFullYear();
const month = String(date.getMonth() + 1).padStart(2, '0');
const day = String(date.getDate()).padStart(2, '0');
return `${year}-${month}-${day}`;
},
updateConfirmTime() {
this.confirm_time = `${this.confirm_time_date} ${this.confirm_time_day}`;
},
updatePackTime() {
this.pack_time = `${this.pack_time_start}~${this.pack_time_end}`;
},
/**
* 监听输入框
* @param {Object} event
......@@ -198,16 +317,24 @@
},
tab(index) {
this.curr = index;
if (index == 3) {
this.confirm_time = '';
this.updatePackTime();
} else {
this.pack_time = '';
this.updateConfirmTime();
}
this.getData();
},
/**
* 获取异常理货明细
*/
getData() {
this.request(API.getAbnormalTallyDetail, 'GET', { type: this.curr, abnormal_batch: this.abnormal_batch }, true).then(res => {
this.request(API.getAbnormalTallyDetail, 'GET', { type: this.curr, abnormal_batch: this.abnormal_batch, confirm_time: this.confirm_time, pack_time: this.pack_time }, true).then(res => {
if (res.err_code === 0) {
this.list = res.data.detail;
var data = res.data;
this.abnormalTallyDetail = 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; //已装箱
......
......@@ -157,12 +157,23 @@
</view>
</view>
<view class="pb16 row verCenter bothSide" style="margin-top: 24rpx;">
<view class="row verCenter" style="width: 50%;">
<view class="row verCenter">
<text class="t3 w130">净重:</text>
<view class="input-text">
<input class="uni-input" :disabled="item.tally_status == 3" type="number" inputmode="decimal" placeholder="输入" placeholder-style="color:#000;font-weight: bold;" v-model="form[index].net_weight" />
</view>
</view>
<view class="row verCenter">
<text class="t3 w130" style="width:105rpx;">备注:</text>
<view class="input-text">
<template v-if="item.tally_status == 3">
<input class="uni-input" :disabled="item.tally_status == 3" type="text" placeholder="输入" placeholder-style="color:#000;font-weight: bold;" v-model="form[index].remark" maxlength="100" @click="viewChange(form[index].remark)" />
</template>
<template v-else>
<input class="uni-input" :disabled="item.tally_status == 3" type="text" placeholder="输入" placeholder-style="color:#000;font-weight: bold;" v-model="form[index].remark" maxlength="100" />
</template>
</view>
</view>
</view>
<view class="row bothSide verCenter">
<view class="upload-list row verCenter">
......@@ -733,7 +744,8 @@
erp_order_sn: this.erp_order_sn, // 入仓号
box_sn: item.tally_status == 3 ? item.box_sn : this.box_sn,
wsty_id: this.wsty_id, // 箱子id
is_goods_check: item.is_goods_check //是否商检
is_goods_check: item.is_goods_check, //是否商检
remark: item.remark //备注
}));
this.image_list = res.data.detail.map(() => new Array()); //图片特殊处理
......@@ -1016,6 +1028,17 @@
}
},
/**
* 查看备注
*/
viewChange(val) {
uni.showModal({
title: '',
content: val,
showCancel: false,
confirmText: '关闭'
});
},
/**
* 再次获取焦点
*/
clearInputAndFocus() {
......
......@@ -118,12 +118,23 @@
</view>
</view>
<view class="pb16 row verCenter bothSide" style="margin-top: 24rpx;">
<view class="row verCenter" style="width: 50%;">
<view class="row verCenter">
<text class="t3 w130">净重:</text>
<view class="input-text">
<input class="uni-input" :disabled="item.tally_status == 3" type="number" inputmode="decimal" placeholder="输入" placeholder-style="color:#000;font-weight: bold;" v-model="form[index].net_weight" />
</view>
</view>
<view class="row verCenter">
<text class="t3 w130" style="width:105rpx;">备注:</text>
<view class="input-text">
<template v-if="item.tally_status == 3">
<input class="uni-input" :disabled="item.tally_status == 3" type="text" placeholder="输入" placeholder-style="color:#000;font-weight: bold;" v-model="form[index].remark" maxlength="100" @click="viewChange(form[index].remark)" />
</template>
<template v-else>
<input class="uni-input" :disabled="item.tally_status == 3" type="text" placeholder="输入" placeholder-style="color:#000;font-weight: bold;" v-model="form[index].remark" maxlength="100" />
</template>
</view>
</view>
</view>
<view class="row bothSide verCenter">
<view class="upload-list row verCenter">
......@@ -649,7 +660,8 @@
erp_order_sn: this.erp_order_sn, // 入仓号
box_sn: this.box_sn, // 箱子
is_goods_check: item.is_goods_check, //是否商检
sync_status: item.sync_status //明细同步状态
sync_status: item.sync_status, //明细同步状态
remark: item.remark //备注
}));
this.image_list = res.data.detail.map(() => new Array()); //图片特殊处理
......@@ -869,6 +881,17 @@
});
},
/**
* 查看备注
*/
viewChange(val) {
uni.showModal({
title: '',
content: val,
showCancel: false,
confirmText: '关闭'
});
},
/**
* 清空数据
*/
clearInput(type) {
......
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