Commit 19263432 by LJM

bug

parent 09986e63
......@@ -37,7 +37,7 @@
}
}
.print-btn {
font-size: 24rpx;
font-size: 23rpx;
color: #1969f9;
}
.preCheck {
......
......@@ -34,7 +34,7 @@
}
}
.print-btn {
font-size: 24rpx;
font-size: 23rpx;
color: #1969f9;
}
.search-box {
......@@ -210,6 +210,19 @@
font-weight: bold;
}
}
.p-text {
margin-top: 38rpx;
margin-bottom: 25rpx;
.tt {
font-size: 20rpx;
color: #484b59;
}
.ed {
font-weight: bold;
font-size: 20rpx;
color: #1969f9;
}
}
.pp {
font-size: 20rpx;
color: #292b33;
......@@ -271,60 +284,6 @@
}
}
}
.drawer-list {
.box {
position: relative;
padding: 18rpx 18rpx 18rpx 18rpx;
background: #ffffff;
box-shadow: 0px 3rpx 3rpx 0px rgba(198, 199, 204, 0.3);
border-radius: 10rpx;
border: 1px solid #c6c7cc;
margin-bottom: 15rpx;
.top {
margin-bottom: 10rpx;
.t1 {
font-size: 17rpx;
color: #1969f9;
font-weight: bold;
}
.t2 {
font-size: 20rpx;
color: #292b33;
font-weight: bold;
margin-left: 8rpx;
}
.t3 {
font-size: 16rpx;
color: #919399;
}
.t4 {
font-size: 16rpx;
color: #484b59;
}
}
.bar {
line-height: 26rpx;
.tt {
font-size: 16rpx;
color: #919399;
white-space: nowrap;
}
.yy {
max-width: 55%;
font-size: 16rpx;
color: #484b59;
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
}
}
}
}
.time {
margin-top: 8rpx;
font-size: 16rpx;
color: #919399;
}
.btn {
position: absolute;
bottom: 0;
......@@ -345,27 +304,10 @@
font-weight: bold;
}
}
.tip-box {
margin-top: 36rpx;
margin-bottom: 23rpx;
height: 60rpx;
background: #fff5ec;
border-radius: 30rpx 30rpx 30rpx 30rpx;
.iconfont {
font-size: 30rpx;
color: #f98119;
margin-left: 23rpx;
}
.tt {
margin-left: 12rpx;
font-size: 20rpx;
color: #f98119;
}
}
.input-wrap {
margin-bottom: 25rpx;
.label-title {
font-size: 20rpx;
font-size: 17rpx;
color: #484b59;
font-weight: bold;
margin-bottom: 10rpx;
......@@ -396,112 +338,126 @@
padding: 18rpx;
}
}
.sel-box {
height: 55rpx;
.select-box {
background: #ffffff;
border-radius: 10rpx;
border: 1px solid #1969f9;
font-size: 17rpx;
padding-left: 18rpx;
.wrap {
padding-left: 15rpx;
padding-right: 25rpx;
height: 40rpx;
}
.uni-input {
font-size: 17rpx;
color: #484b59;
}
.uni-arrow {
width: 14rpx;
height: 9rpx;
background: url('https://img.ichunt.com/images/ichunt/202304/10/e4c72319ad41ce1425f71cc6ec35f111.png') no-repeat center;
background-size: contain;
margin-right: 12rpx;
margin-left: 12rpx;
}
}
}
.uni-swiper-wrap {
margin-top: 15rpx;
.uni-swiper-input {
margin-bottom: 15rpx;
.label {
width: 24%;
font-size: 16rpx;
.pack {
.h2 {
font-size: 17rpx;
color: #484b59;
font-weight: bold;
margin-bottom: 10rpx;
.tt {
font-size: 17rpx;
color: #919399;
&.required:before {
content: ' *';
color: red;
}
font-weight: normal;
}
.select-box {
position: relative;
width: 76%;
height: 45rpx;
.uni-arrow {
position: absolute;
right: 14rpx;
width: 14rpx;
height: 9rpx;
background: url('https://img.ichunt.com/images/ichunt/202304/10/e4c72319ad41ce1425f71cc6ec35f111.png') no-repeat center;
background-size: contain;
.num {
.t1 {
font-size: 13rpx;
color: #1969f9;
}
.uni-input {
width: 100%;
height: 45rpx;
background: #ffffff;
border-radius: 10rpx;
border: 1px solid #1969f9;
font-size: 17rpx;
padding-left: 18rpx;
.t2 {
font-size: 13rpx;
color: #919399;
}
}
.input-box {
position: relative;
width: 76%;
.uni-input {
width: 100%;
height: 45rpx;
background: #ffffff;
border-radius: 10rpx;
border: 1px solid #1969f9;
font-size: 17rpx;
padding-left: 18rpx;
}
}
.icon-box {
width: 75rpx;
height: 55rpx;
border-radius: 10rpx;
border: 1px solid #c6c7cc;
.iconfont {
font-size: 30rpx;
color: #56585e;
}
}
.uni-swiper-input-multipl {
margin-bottom: 15rpx;
.label {
width: 24%;
.uni-arrow {
width: 14rpx;
height: 9rpx;
background: url('https://img.ichunt.com/images/ichunt/202304/10/e4c72319ad41ce1425f71cc6ec35f111.png') no-repeat center;
background-size: contain;
margin-right: 10rpx;
}
.uni-input {
font-size: 17rpx;
.pic-list {
flex-wrap: wrap;
margin-bottom: 18rpx;
.default {
width: 120rpx;
height: 120rpx;
background: #f5f5f7;
border-radius: 10rpx;
margin-right: 15rpx;
.iconfont {
font-size: 60rpx;
color: #c6c7cc;
}
}
.multipl-input {
width: 76%;
.uni-input {
width: 100%;
height: 45rpx;
background: #ffffff;
border-radius: 10rpx;
border: 1px solid #1969f9;
font-size: 17rpx;
padding-left: 18rpx;
.box {
position: relative;
width: 120rpx;
height: 120rpx;
background: #f5f5f7;
border-radius: 10rpx;
margin-right: 15rpx;
margin-bottom: 15rpx;
image {
width: 120rpx;
height: 120rpx;
}
.timesSymbol {
padding: 0 14rpx;
font-size: 24rpx;
color: #292b33;
font-weight: bold;
.iconfont {
position: absolute;
right: 0;
top: 0;
font-size: 30rpx;
color: #ff3700;
z-index: 9;
}
.unit {
margin-left: 10rpx;
color: #919399;
font-size: 25rpx;
}
}
.textarea-box {
width: 100%;
textarea {
width: 100%;
height: 85rpx;
padding: 10rpx 15rpx;
background: #f5f5f7;
border-radius: 10rpx;
font-size: 16rpx;
box-sizing: border-box;
}
}
.print {
margin-bottom: 27rpx;
.check-box-icon {
width: 20rpx;
height: 20rpx;
background: url('https://img.ichunt.com/images/ichunt/202304/11/0bf30da3e8ce6c476c210173b5f13d51.png') no-repeat center;
background-size: contain;
display: block;
&.curr {
background: url('https://img.ichunt.com/images/ichunt/202304/11/71a74e52e94bcf2e89f8df9817d494c6.png') no-repeat center;
background-size: contain;
}
}
.tt {
font-size: 17rpx;
color: #484b59;
margin-left: 10rpx;
}
}
}
.swiper {
height: 790rpx;
}
}
......@@ -20,23 +20,27 @@
</view>
<view class="total-text" v-if="list.length > 0"><text>{{total}}</text>条数据</view>
</view>
<view class="search-all-box row verCenter">
<view class="row verCenter" style="width: 90%;">
<text class="iconfont icon-juxing1"></text>
<!-- 全量搜索 -->
<template v-if="index == 0">
<input class="uni-input" placeholder="请扫描或输入物流单号" placeholder-style="color:#919399" :focus="is_focus" v-model="searchParams.shipment_number" @input="handleInput(1, $event)" maxlength="-1" />
</template>
<!-- 货品名称 -->
<template v-if="index == 1">
<input class="uni-input" placeholder="请输入货品名称" placeholder-style="color:#919399" :focus="is_focus" v-model="searchParams.goods_name" @input="handleInput(2, $event)" maxlength="-1" />
</template>
<!-- fedex -->
<template v-else-if="index == 2">
<input class="uni-input" placeholder="请输入FedEx" placeholder-style="color:#919399" :focus="is_focus" v-model="searchParams.shipment_number" @input="handleInput(3, $event)" maxlength="-1" />
</template>
<view class="search-all row verCenter bothSide">
<view class="search-all-box row verCenter" style="width: 80%;">
<view class="row verCenter" style="width: 90%;">
<text class="iconfont icon-juxing1"></text>
<!-- 全量搜索 -->
<template v-if="index == 0">
<input class="uni-input" placeholder="请扫描或输入物流单号" placeholder-style="color:#919399" :focus="is_focus" v-model="searchParams.shipment_number" @input="handleInput(1, $event)" maxlength="-1" />
</template>
<!-- 货品名称 -->
<template v-if="index == 1">
<input class="uni-input" placeholder="请输入货品名称" placeholder-style="color:#919399" :focus="is_focus" v-model="searchParams.goods_name" @input="handleInput(2, $event)" maxlength="-1" />
</template>
<!-- fedex -->
<template v-else-if="index == 2">
<input class="uni-input" placeholder="请输入FedEx" placeholder-style="color:#919399" :focus="is_focus" v-model="searchParams.shipment_number" @input="handleInput(3, $event)" maxlength="-1" />
</template>
</view>
<text class="iconfont icon-a-juxing11" @click="clearInput()" v-if="input_flag"></text>
</view>
<text class="iconfont icon-a-juxing11" @click="clearInput()" v-if="input_flag"></text>
<view class="print-btn" @click="print()">打印入仓号</view>
</view>
<!-- 列表数据 -->
<view class="list row bothSide" v-if="list.length > 0">
......@@ -70,8 +74,105 @@
<text class="check-box-icon" :class="{ curr: filter_list.length > 0 && filter_list.length == filter_id.length }"></text>
<text class="text">{{ filter_id.length == 0 ? '全选' : filter_id.length }}</text>
</view>
<view class="btn2 row rowCenter verCenter" @click="print()">打印入仓号</view>
<view class="btn2 row rowCenter verCenter" @click="registration()">分货登记</view>
</view>
<!-- 新增登记 -->
<uni-drawer ref="showRight" mode="right">
<view class="uni-drawer-layer">
<view class="title row rowCenter verCenter">
<text class="iconfont icon-juxing2" @click="closeDrawer()"></text>
<text class="text">新增登记</text>
</view>
<view class="input-wrap column" style="margin-top: 20rpx;">
<view class="label-title"><text style="color: red;">*</text>仓库:</view>
<view class="select-box row">
<picker @change="bindPickerChange($event,1)" :value="warehouse_index" :range="warehouse_arr" :range-key="'name'" style="width: 100%;">
<view class="row verCenter bothSide wrap">
<view class="uni-input">{{ warehouse_index == -1 ? '请选择仓库' : warehouse_arr[warehouse_index].name }}</view>
<view class="uni-arrow"></view>
</view>
</picker>
</view>
</view>
<view class="input-wrap column" style="margin-top: 20rpx;">
<view class="label-title"><text style="color: red;">*</text>到货时间:</view>
<view class="select-box row">
<picker mode="date" :value="formParams.register_time" @change="bindDateChange($event,1)" style="width: 100%;">
<view class="row verCenter bothSide wrap">
<view class="uni-input">{{ formParams.register_time }}</view>
<view class="uni-arrow"></view>
</view>
</picker>
</view>
</view>
<view class="input-wrap column" style="margin-top: 20rpx;">
<view class="label-title"><text style="color: red;">*</text>类型:</view>
<view class="select-box row">
<picker @change="bindPickerChange($event,2)" :value="register_type_index" :range="register_type" style="width: 100%;">
<view class="row verCenter bothSide wrap">
<view class="uni-input">{{ register_type_index == -1 ? '请选择类型' : register_type[register_type_index] }}</view>
<view class="uni-arrow"></view>
</view>
</picker>
</view>
</view>
<view class="input-wrap column" style="margin-top: 20rpx;">
<view class="label-title"><text style="color: red;">*</text>物流公司:</view>
<view class="select-box row">
<picker @change="bindPickerChange($event,3)" :value="logistics_company_index" :range="logistics_company" style="width: 100%;">
<view class="row verCenter bothSide wrap">
<view class="uni-input">{{ logistics_company_index == -1 ? '请选择物流公司' : logistics_company[logistics_company_index] }}</view>
<view class="uni-arrow"></view>
</view>
</picker>
</view>
</view>
<view class="input-wrap column" style="margin-top: 20rpx;">
<view class="row">
<template v-if="formParams.logistics_company != '自提' && formParams.logistics_company != '供应商配送'">
<text style="color: red;font-size: 17rpx;">*</text>
</template>
<text class="label-title">物流单号:</text>
</view>
<view class="input-box">
<input type="text" class="uni-input" placeholder-style="color:#919399" placeholder="请输入物流单号" v-model="formParams.logistics_sn" />
</view>
</view>
<view class="input-wrap column" style="margin-top: 20rpx;">
<view class="row">
<text class="label-title">其他信息:</text>
</view>
<view class="input-box">
<input type="text" class="uni-input" placeholder-style="color:#919399" placeholder="请输入其他信息" v-model="formParams.other_info" />
</view>
</view>
<view class="pack">
<view class="h2 row bothSide verCenter" style="margin-top: 25rpx;">
<view class="row verCenter">
<text style="color: red;">*</text>
<text>登记照片:</text>
<text class="tt">最多只支持{{ maxNum }}张图</text>
</view>
<view class="num">
<text class="t1">{{ image_list.length }}</text>
<text class="t2">/10</text>
</view>
</view>
<view class="pic-list row">
<template v-if="image_list.length > 0">
<view class="box" v-for="(item, index) in image_list" :key="index">
<image :src="item" mode="aspectFill" @click="previewChange(image_list, index)"></image>
<text class="iconfont icon-a-juxing11" @click="deletePic(index)"></text>
</view>
</template>
<view class="default row rowCenter verCenter" @click="chooseImageChange()" v-if="image_list.length < maxNum"><text class="iconfont icon-a-juxing3"></text></view>
</view>
</view>
<view class="btn row rowCenter verCenter">
<view class="row btn1 row rowCenter verCenter" style="width:100%" @click="addSeparateStockInRegister()">确认登记</view>
</view>
</view>
</uni-drawer>
</view>
</template>
......@@ -83,6 +184,14 @@
export default {
data() {
return {
img_upload_url: uni.getStorageSync('img_upload_url') || 'http://image.liexindev.net', //oss系统
noexebshowFalg: true, //控制是否会触发生命周期
warehouse_arr: [],
warehouse_index: 0,
register_type: ['正常登记', '异常登记'],
register_type_index: 0,
logistics_company: ['联邦快递', 'DHL国际快递', '顺丰速运', '供应商配送', '快递送货', '韵达快递', '速尔快递', 'TNT快递', '自提', '京东快递', '优速物流', '顺丰特惠', 'UPS', 'Air', '其他'],
logistics_company_index: -1,
user_email: uni.getStorageSync('name'),
is_focus: true, //获取焦点动态化
input_flag: false,
......@@ -94,18 +203,76 @@
list: [],
filter_list: [], //筛选已选中的列表
filter_id: [], //过滤处理的id
image_list: [], //图片列表
maxNum: 10, //最大上传图片数量
curr: 0,
formParams: {
warehouse_id: '',
register_time: this.getCurrentDate(),
register_type: 1,
logistics_company: '',
logistics_sn: '',
other_info: '',
register_pic: ''
},
searchParams: {
shipment_number: '', //物流单号
goods_name: ''
}
};
},
watch: {
image_list(arr) {
if (arr.length > 0) {
this.formParams.register_pic = arr.join(',');
} else {
this.formParams.register_pic = '';
}
}
},
onShow() {
this.resetChange();
let company_id = uni.getStorageSync('company_id') || 1;
if (company_id == 1) {
this.warehouse_arr = [{ name: '深圳现货仓', value: 7 }, { name: '深圳自营仓', value: 9 }];
this.formParams.warehouse_id = 7;
} else if (company_id == 2) {
this.warehouse_arr = [{ name: '香港仓', value: '10' }];
this.formParams.warehouse_id = 10;
} else if (company_id == 3) {
this.warehouse_arr = [{ name: '华云现货仓', value: '11' }];
this.formParams.warehouse_id = 11;
}
},
methods: {
/**
* 获取日期
*/
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}`;
},
bindDateChange(e, type) {
if (type == 1) {
this.formParams.register_time = e.detail.value;
}
},
bindPickerChange(e, type) {
if (type == 1) {
this.warehouse_index = e.detail.value;
this.formParams.warehouse_id = this.warehouse_arr[e.detail.value].value;
} else if (type == 2) {
this.register_type_index = e.detail.value;
this.formParams.register_type = Number(e.detail.value) + 1;
} else if (type == 3) {
this.logistics_company_index = e.detail.value;
this.formParams.logistics_company = this.logistics_company[e.detail.value];
}
},
/**
* 搜索条件切换
* @param {Object} e
*/
......@@ -211,6 +378,170 @@
});
},
/**
* 选择图片
*/
chooseImageChange() {
this.noexebshowFalg = false;
// 使用 chooseImage选择图片
uni.chooseImage({
count: this.maxNum,
sizeType: ['original', 'compressed'],
sourceType: ['album', 'camera'],
success: chooseImageRes => {
console.log('选择图片成功:', chooseImageRes);
// 显示loading
uni.showLoading({
title: '上传中...'
});
// 获取选择的图片路径数组
const imagePaths = chooseImageRes.tempFilePaths;
// 判断选择的图片数量是否超过最大限制数量
let maxNum = Number(imagePaths.length) + Number(this.image_list.length); //当前上传的+已经上传的
if (maxNum > this.maxNum) {
uni.hideLoading();
uni.showToast({
title: '图片不超过' + this.maxNum + '张',
icon: 'none'
});
return false;
}
// 遍历图片路径数组,对每张图片进行压缩
imagePaths.forEach(imagePath => {
// 使用compressImage 压缩图片
uni.compressImage({
src: imagePath,
quality: 60, //压缩质量,范围0~100,数值越小,质量越低,压缩率越高
success: compressedRes => {
console.log('压缩图片成功:', compressedRes);
// 获取压缩后的图片路径
const compressedImagePath = compressedRes.tempFilePath;
// 在这里处理压缩后的图片,上传到服务器
uni.uploadFile({
url: this.img_upload_url + '/uploadImage?sys_type=4',
filePath: compressedImagePath,
name: 'file',
timeout: 10000,
header: {
'Content-Type': 'multipart/form-data'
},
success: uploadFileRes => {
console.log('服务器上传图片成功:', uploadFileRes);
uni.hideLoading();
let data = JSON.parse(uploadFileRes.data);
if (data.code === 0) {
this.image_list.push(data.data.oss_image_url);
} else {
uni.showToast({
title: data.msg,
icon: 'none'
});
}
},
fail: error => {
uni.showToast({
title: '上传图片失败',
icon: 'none'
});
uni.hideLoading();
}
});
},
fail: err => {
console.log('压缩图片失败:', err);
}
});
});
}
});
},
/**
* 删除图片
* @param {Object} index
*/
deletePic(index) {
this.image_list.splice(index, 1);
},
/**
* 预览图片
* @param {Object} img
* @param {Object} index
*/
previewChange(arr, index) {
this.noexebshowFalg = false;
uni.previewImage({
current: index,
urls: arr
});
},
/**
* 分货登记弹窗
*/
registration() {
this.$refs.showRight.open();
this.image_list = [];
this.warehouse_index = 0; //仓库清空
this.formParams.warehouse_id = this.warehouse_arr[0].value;
this.formParams.register_time = this.getCurrentDate();
this.formParams.register_type = 1;
this.register_type_index = 0;
this.formParams.logistics_company = '';
this.logistics_company_index = -1;
this.formParams.logistics_sn = '';
this.formParams.other_info = '';
this.formParams.register_pic = '';
},
/**
* 确认登记
*/
addSeparateStockInRegister() {
if (!this.formParams.logistics_company) {
uni.showToast({
title: '请选择物流公司',
icon: 'none'
});
return false;
}
if (this.formParams.logistics_company !== '自提' && this.formParams.logistics_company !== '供应商配送') {
if (!this.formParams.logistics_sn) {
uni.showToast({
title: '请输入物流单号',
icon: 'none'
});
return false;
}
}
if (!this.formParams.register_pic) {
uni.showToast({
title: '请上传登记照片',
icon: 'none'
});
return false;
}
this.request(API.addSeparateStockInRegister, 'POST', this.formParams, true).then(res => {
if (res.code === 0) {
uni.showToast({
title: '登记成功',
icon: 'success'
});
setTimeout(() => {
this.$refs.showRight.close();
this.resetChange();
}, 2000)
} else {
uni.showToast({
title: res.msg,
icon: 'none'
});
}
});
},
/**
* 打印入仓号
*/
print() {
......@@ -258,6 +589,9 @@
setTimeout(() => {
this.is_focus = true;
}, 200);
},
closeDrawer() {
this.$refs.showRight.close();
}
}
};
......
......@@ -632,13 +632,13 @@
stockPreCheckTally(precheck_ids) {
if (precheck_ids) {
this.stockPreCheckTallyParams.precheck_ids = precheck_ids;
}
if (!this.stockPreCheckTallyParams.tally_num) {
uni.showToast({
title: '理货数量必填',
icon: 'none'
});
return false;
if (!this.stockPreCheckTallyParams.tally_num) {
uni.showToast({
title: '理货数量必填',
icon: 'none'
});
return false;
}
}
if (!this.stockPreCheckTallyParams.preckeck_imgs) {
uni.showToast({
......
......@@ -379,7 +379,11 @@ const API = {
/**
* 预检单-理货
* */
stockPreCheckTally: API_BASE + '/api/stockIn/stockPreCheck/stockPreCheckTally'
stockPreCheckTally: API_BASE + '/api/stockIn/stockPreCheck/stockPreCheckTally',
/**
* 新增分货登记
* */
addSeparateStockInRegister: API_BASE + '/api/stockIn/stockInRegister/addSeparateStockInRegister'
}
......
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