Commit 2ffa0ef6 by LJM

复核-箱信息须支持上下滑动

parent cb29bab9
......@@ -263,7 +263,7 @@
.uni-drawer-picking {
width: 100%;
background-color: #ffffff;
padding: 22rpx 22rpx 0 22rpx;
padding: 22rpx 22rpx 100rpx 22rpx;
.title {
position: relative;
.iconfont {
......@@ -429,9 +429,9 @@
}
}
.btn {
position: absolute;
bottom: 0;
position: fixed;
left: 0;
bottom: 0;
width: 100%;
z-index: 99;
.btn0 {
......
......@@ -59,6 +59,10 @@
<text class="tt">{{ item.position_name }}</text>
</view>
<view class="input-box row verCenter">
<text class="label">容器:</text>
<text class="text">{{ item.container_sn }}</text>
</view>
<view class="input-box row verCenter">
<text class="label">入库批次号:</text>
<text class="text">{{ item.stock_in_batch_sn }}</text>
</view>
......@@ -733,54 +737,80 @@ export default {
*/
chooseImageChange() {
this.noexebshowFalg = false;
var self = this;
// 使用 chooseImage选择图片
uni.chooseImage({
count: self.maxNums,
sizeType: ['compressed'],
count: this.maxNum,
sizeType: ['original', 'compressed'],
sourceType: ['album', 'camera'],
success: chooseImageRes => {
console.log('选择图片成功:', chooseImageRes);
// 显示loading
uni.showLoading({
title: '上传中...'
});
const tempFilePaths = chooseImageRes.tempFilePaths;
let maxNum = tempFilePaths.length * 1 + self.image_list.length * 1;
if (maxNum > self.maxNum) {
// 获取选择的图片路径数组
const imagePaths = chooseImageRes.tempFilePaths;
// 判断选择的图片数量是否超过最大限制数量
let maxNum = Number(imagePaths.length) + Number(this.image_list.length); //当前上传的+已经上传的
if (maxNum > this.maxNum) {
uni.hideLoading();
uni.showToast({
title: '图片不超过' + self.maxNum + '张',
icon: 'error'
title: '图片不超过' + this.maxNum + '张',
icon: 'none'
});
return false;
}
for (let i = 0; i < tempFilePaths.length; i++) {
uni.uploadFile({
url: API.upload + '?sys_type=4',
filePath: tempFilePaths[i],
name: 'file',
header: {
'Content-Type': 'multipart/form-data'
},
success: uploadFileRes => {
uni.hideLoading();
var data = JSON.parse(uploadFileRes.data);
if (data.code === 0) {
self.image_list.push({
pic_id: data.data.oss_image_id,
small_image_url: data.data.small_image_url,
big_image_url: data.data.big_image_url
});
} else {
uni.showToast({
title: '网络出现问题',
icon: 'error'
});
}
// 遍历图片路径数组,对每张图片进行压缩
imagePaths.forEach(imagePath => {
// 使用compressImage 压缩图片
uni.compressImage({
src: imagePath,
quality: 50, //压缩质量,范围0~100,数值越小,质量越低,压缩率越高
success: compressedRes => {
console.log('压缩图片成功:', compressedRes);
// 获取压缩后的图片路径
const compressedImagePath = compressedRes.tempFilePath;
// 在这里处理压缩后的图片,上传到服务器
uni.uploadFile({
url: API.upload + '?sys_type=4',
filePath: compressedImagePath,
name: 'file',
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({
pic_id: data.data.oss_image_id,
small_image_url: data.data.small_image_url,
big_image_url: data.data.big_image_url
});
} else {
uni.showToast({
title: data.msg,
icon: 'none'
});
}
},
fail: error => {
console.log('上传图片失败:', error);
uni.hideLoading();
}
});
},
fail: error => {
uni.hideLoading();
fail: err => {
console.log('压缩图片失败:', err);
}
});
}
});
}
});
},
......@@ -831,7 +861,14 @@ export default {
});
this.request(URL, 'POST', { page: this.page, limit: this.limit, ...this.searchParams }, false).then(res => {
if (res.code === 0) {
this.list = res.data.list;
//过滤出应拣数量不为0的数据
if (this.curr == 0) {
var filteredList = res.data.list.filter(item => item.lock_qty - item.pick_qty > 0);
this.list = filteredList;
} else if (this.curr == 1) {
var filteredList = res.data.list.filter(item => item.total_lock_num - item.total_pick_num > 0);
this.list = filteredList;
}
this.filter_list = createArray(this.list.length, false);
typeof callback == 'function' && callback(res.data.list);
} else {
......
......@@ -624,50 +624,76 @@ export default {
*/
chooseImageChange() {
this.noexebshowFalg = false;
var self = this;
// 使用 chooseImage选择图片
uni.chooseImage({
count: self.maxNums,
sizeType: ['compressed'],
count: this.maxNum,
sizeType: ['original', 'compressed'],
sourceType: ['album', 'camera'],
success: chooseImageRes => {
console.log('选择图片成功:', chooseImageRes);
// 显示loading
uni.showLoading({
title: '上传中...'
});
const tempFilePaths = chooseImageRes.tempFilePaths;
let maxNum = tempFilePaths.length * 1 + self.image_list.length * 1;
if (maxNum > self.maxNum) {
// 获取选择的图片路径数组
const imagePaths = chooseImageRes.tempFilePaths;
// 判断选择的图片数量是否超过最大限制数量
let maxNum = Number(imagePaths.length) + Number(this.image_list.length); //当前上传的+已经上传的
if (maxNum > this.maxNum) {
uni.hideLoading();
uni.showToast({
title: '图片不超过' + self.maxNum + '张',
icon: 'error'
title: '图片不超过' + this.maxNum + '张',
icon: 'none'
});
return false;
}
for (let i = 0; i < tempFilePaths.length; i++) {
uni.uploadFile({
url: API.upload + '?sys_type=4',
filePath: tempFilePaths[i],
name: 'file',
header: {
'Content-Type': 'multipart/form-data'
},
success: uploadFileRes => {
uni.hideLoading();
var data = JSON.parse(uploadFileRes.data);
if (data.code === 0) {
self.image_list.push(data.data.oss_image_url);
} else {
uni.showToast({
title: '网络出现问题',
icon: 'error'
});
}
// 遍历图片路径数组,对每张图片进行压缩
imagePaths.forEach(imagePath => {
// 使用compressImage 压缩图片
uni.compressImage({
src: imagePath,
quality: 50, //压缩质量,范围0~100,数值越小,质量越低,压缩率越高
success: compressedRes => {
console.log('压缩图片成功:', compressedRes);
// 获取压缩后的图片路径
const compressedImagePath = compressedRes.tempFilePath;
// 在这里处理压缩后的图片,上传到服务器
uni.uploadFile({
url: API.upload + '?sys_type=4',
filePath: compressedImagePath,
name: 'file',
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 => {
console.log('上传图片失败:', error);
uni.hideLoading();
}
});
},
fail: error => {
uni.hideLoading();
fail: err => {
console.log('压缩图片失败:', err);
}
});
}
});
}
});
},
......
......@@ -494,50 +494,76 @@ export default {
*/
chooseImageChange() {
this.noexebshowFalg = false;
var self = this;
// 使用 chooseImage选择图片
uni.chooseImage({
count: self.maxNums,
sizeType: ['compressed'],
count: this.maxNum,
sizeType: ['original', 'compressed'],
sourceType: ['album', 'camera'],
success: chooseImageRes => {
console.log('选择图片成功:', chooseImageRes);
// 显示loading
uni.showLoading({
title: '上传中...'
});
const tempFilePaths = chooseImageRes.tempFilePaths;
let maxNum = tempFilePaths.length * 1 + self.image_list.length * 1;
if (maxNum > self.maxNum) {
// 获取选择的图片路径数组
const imagePaths = chooseImageRes.tempFilePaths;
// 判断选择的图片数量是否超过最大限制数量
let maxNum = Number(imagePaths.length) + Number(this.image_list.length); //当前上传的+已经上传的
if (maxNum > this.maxNum) {
uni.hideLoading();
uni.showToast({
title: '图片不超过' + self.maxNum + '张',
icon: 'error'
title: '图片不超过' + this.maxNum + '张',
icon: 'none'
});
return false;
}
for (let i = 0; i < tempFilePaths.length; i++) {
uni.uploadFile({
url: API.upload + '?sys_type=4',
filePath: tempFilePaths[i],
name: 'file',
header: {
'Content-Type': 'multipart/form-data'
},
success: uploadFileRes => {
uni.hideLoading();
var data = JSON.parse(uploadFileRes.data);
if (data.code === 0) {
self.image_list.push(data.data.oss_image_url);
} else {
uni.showToast({
title: '网络出现问题',
icon: 'error'
});
}
// 遍历图片路径数组,对每张图片进行压缩
imagePaths.forEach(imagePath => {
// 使用compressImage 压缩图片
uni.compressImage({
src: imagePath,
quality: 50, //压缩质量,范围0~100,数值越小,质量越低,压缩率越高
success: compressedRes => {
console.log('压缩图片成功:', compressedRes);
// 获取压缩后的图片路径
const compressedImagePath = compressedRes.tempFilePath;
// 在这里处理压缩后的图片,上传到服务器
uni.uploadFile({
url: API.upload + '?sys_type=4',
filePath: compressedImagePath,
name: 'file',
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 => {
console.log('上传图片失败:', error);
uni.hideLoading();
}
});
},
fail: error => {
uni.hideLoading();
fail: err => {
console.log('压缩图片失败:', err);
}
});
}
});
}
});
},
......
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