Commit 2ffa0ef6 by LJM

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

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