Commit 374d4d02 by LJM

add

parent 364b6029
<template>
<view class="tally-fixBox">
<view class="input-box row bothSide verCenter">
<input class="uni-input" placeholder="输入或扫描箱号" placeholder-style="color:#000;font-weight: bold;" v-model="keyword" @input="handleInput($event)" :focus="is_focus" />
<input class="uni-input" placeholder="输入或扫描箱号" placeholder-style="color:#000;font-weight: bold;" v-model="keyword" @input="handleInput($event)" :focus="is_focus" />
<view class="btn row rowCenter verCenter" @click="add()">添 加</view>
</view>
<view class="list" v-if="list.length > 0">
......
......@@ -130,7 +130,14 @@
</view>
<view class="pb16 row verCenter bothSide" style="margin-top: 24rpx;">
<view class="row verCenter">
<text class="t3 w130">已入库数量:</text>
<!-- 完全理货 -->
<template v-if="item.tally_status == 3">
<text class="t3 w130">已入库数量:</text>
</template>
<!-- 1未理货2部分理货 -->
<template v-else>
<text class="t3 w130">入库数量:</text>
</template>
<view class="input-text">
<input class="uni-input" :disabled="item.tally_status == 3" type="number" inputmode="numeric" placeholder="输入" placeholder-style="color:#000;font-weight: bold;" v-model="form[index].tally_num" />
</view>
......@@ -734,7 +741,7 @@
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(1);
this.getTallyData();
} else {
uni.showToast({
title: res.err_msg,
......
<template>
<view class="unboxing">
<view class="input-box row bothSide verCenter">
<input class="uni-input" placeholder="输入或扫描箱号" placeholder-style="color:#000;font-weight: bold;" v-model="box_sn" @input="handleInput($event,1)" />
<input class="uni-input" placeholder="输入或扫描箱号" placeholder-style="color:#000;font-weight: bold;" v-model="box_sn" @input="handleInput($event,1)" />
<template v-if="tallyData.detail && tallyData.detail.length > 0">
<view class="btn1 row rowCenter verCenter" @click="closeBox()">重新封箱</view>
</template>
......@@ -262,6 +262,7 @@
chooseImageChange(key) {
this.noexebshowFalg = false;
// 使用 chooseImage选择图片
// #ifdef MP-WEIXIN
uni.chooseMedia({
count: 5,
mediaType: ['image'],
......@@ -339,6 +340,86 @@
});
}
});
// #endif
// #ifdef APP-PLUS
uni.chooseImage({
count: 5,
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 > 5) {
uni.hideLoading();
uni.showToast({
title: '图片不超过5张',
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: API.uploadImageHk + '?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[key].push(data.data.oss_image_url);
this.$forceUpdate();
} else {
uni.showToast({
title: data.msg,
icon: 'none'
});
}
},
fail: () => {
uni.hideLoading();
uni.showToast({
title: '上传图片失败',
icon: 'none'
});
}
});
},
fail: err => {
console.log('压缩图片失败:', err);
}
});
});
}
});
// #endif
},
/**
* 预览图片
......
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