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++) {
// 遍历图片路径数组,对每张图片进行压缩
imagePaths.forEach(imagePath => {
// 使用compressImage 压缩图片
uni.compressImage({
src: imagePath,
quality: 50, //压缩质量,范围0~100,数值越小,质量越低,压缩率越高
success: compressedRes => {
console.log('压缩图片成功:', compressedRes);
// 获取压缩后的图片路径
const compressedImagePath = compressedRes.tempFilePath;
// 在这里处理压缩后的图片,上传到服务器
uni.uploadFile({ uni.uploadFile({
url: API.upload + '?sys_type=4', url: API.upload + '?sys_type=4',
filePath: tempFilePaths[i], filePath: compressedImagePath,
name: 'file', name: 'file',
header: { header: {
'Content-Type': 'multipart/form-data' 'Content-Type': 'multipart/form-data'
}, },
success: uploadFileRes => { success: uploadFileRes => {
console.log('服务器上传图片成功:', uploadFileRes);
uni.hideLoading(); uni.hideLoading();
var data = JSON.parse(uploadFileRes.data); let data = JSON.parse(uploadFileRes.data);
if (data.code === 0) { if (data.code === 0) {
self.image_list.push({ this.image_list.push({
pic_id: data.data.oss_image_id, pic_id: data.data.oss_image_id,
small_image_url: data.data.small_image_url, small_image_url: data.data.small_image_url,
big_image_url: data.data.big_image_url big_image_url: data.data.big_image_url
}); });
} else { } else {
uni.showToast({ uni.showToast({
title: '网络出现问题', title: data.msg,
icon: 'error' icon: 'none'
}); });
} }
}, },
fail: error => { fail: error => {
console.log('上传图片失败:', error);
uni.hideLoading(); uni.hideLoading();
} }
}); });
},
fail: err => {
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 {
......
...@@ -101,9 +101,13 @@ ...@@ -101,9 +101,13 @@
<text class="label">其他批次属性:</text> <text class="label">其他批次属性:</text>
<text class="text">{{ item.other_batch_attr }}</text> <text class="text">{{ item.other_batch_attr }}</text>
</view> </view>
<view class="input-box row verCenter" v-if="item.customer_material_number"> <view class="input-box row verCenter">
<text class="label">客户物料编码:</text> <text class="label">销 售 员:</text>
<text class="text">{{ item.customer_material_number }}</text> <text class="text">{{ item.sale_name }}</text>
</view>
<view class="input-box row">
<text class="label">客户:</text>
<text class="desc">{{ item.customer_name }}</text>
</view> </view>
<view class="input-box row verCenter"> <view class="input-box row verCenter">
<text class="label">待复核数:</text> <text class="label">待复核数:</text>
...@@ -113,13 +117,9 @@ ...@@ -113,13 +117,9 @@
<text class="label">已复核数:</text> <text class="label">已复核数:</text>
<text class="text" style="color: #F98119;">{{ item.recheck_qty }}</text> <text class="text" style="color: #F98119;">{{ item.recheck_qty }}</text>
</view> </view>
<view class="input-box row verCenter"> <view class="input-box row verCenter" style="flex: 0 0 100%;" v-if="item.customer_material_number">
<text class="label">销 售 员:</text> <text class="label">客户物料编码:</text>
<text class="text">{{ item.sale_name }}</text> <text class="text">{{ item.customer_material_number }}</text>
</view>
<view class="input-box row">
<text class="label">客户:</text>
<text class="desc">{{ item.customer_name }}</text>
</view> </view>
<view class="input-box row"> <view class="input-box row">
<text class="label">主单仓库备注:</text> <text class="label">主单仓库备注:</text>
...@@ -153,7 +153,7 @@ ...@@ -153,7 +153,7 @@
<text class="text">{{ item.task_num }}</text> <text class="text">{{ item.task_num }}</text>
</view> </view>
<view class="input-box row verCenter"> <view class="input-box row verCenter">
<text class="label">合计应拣数量:</text> <text class="label">合计复核数量:</text>
<text class="text">{{ item.total_check_num }}</text> <text class="text">{{ item.total_check_num }}</text>
</view> </view>
<view class="btn row rowCenter verCenter" @click="showDrawer(2, item)">选择</view> <view class="btn row rowCenter verCenter" @click="showDrawer(2, item)">选择</view>
...@@ -503,7 +503,8 @@ ...@@ -503,7 +503,8 @@
</uni-drawer> </uni-drawer>
<!-- 箱信息 --> <!-- 箱信息 -->
<uni-drawer ref="showBoxInfo" mode="right"> <uni-drawer ref="showBoxInfo" mode="right">
<view class="uni-drawer-picking box-drawer"> <view class="uni-drawer-picking box-drawer" style="height: 100%;">
<scroll-view scroll-y="true" style="height: 100%;overflow-y: scroll;">
<view class="title row rowCenter verCenter"> <view class="title row rowCenter verCenter">
<text class="iconfont icon-juxing2" @click="closeBox()"></text> <text class="iconfont icon-juxing2" @click="closeBox()"></text>
<text class="text">箱信息</text> <text class="text">箱信息</text>
...@@ -545,6 +546,7 @@ ...@@ -545,6 +546,7 @@
<view class="btn0 row rowCenter verCenter" @click="closeBox()">取 消</view> <view class="btn0 row rowCenter verCenter" @click="closeBox()">取 消</view>
<view class="btn1 row rowCenter verCenter" style="width: 50%;" @click="updatePackInfo()">确认</view> <view class="btn1 row rowCenter verCenter" style="width: 50%;" @click="updatePackInfo()">确认</view>
</view> </view>
</scroll-view>
</view> </view>
</uni-drawer> </uni-drawer>
</view> </view>
...@@ -713,54 +715,80 @@ export default { ...@@ -713,54 +715,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++) {
// 遍历图片路径数组,对每张图片进行压缩
imagePaths.forEach(imagePath => {
// 使用compressImage 压缩图片
uni.compressImage({
src: imagePath,
quality: 50, //压缩质量,范围0~100,数值越小,质量越低,压缩率越高
success: compressedRes => {
console.log('压缩图片成功:', compressedRes);
// 获取压缩后的图片路径
const compressedImagePath = compressedRes.tempFilePath;
// 在这里处理压缩后的图片,上传到服务器
uni.uploadFile({ uni.uploadFile({
url: API.upload + '?sys_type=4', url: API.upload + '?sys_type=4',
filePath: tempFilePaths[i], filePath: compressedImagePath,
name: 'file', name: 'file',
header: { header: {
'Content-Type': 'multipart/form-data' 'Content-Type': 'multipart/form-data'
}, },
success: uploadFileRes => { success: uploadFileRes => {
console.log('服务器上传图片成功:', uploadFileRes);
uni.hideLoading(); uni.hideLoading();
var data = JSON.parse(uploadFileRes.data); let data = JSON.parse(uploadFileRes.data);
if (data.code === 0) { if (data.code === 0) {
self.image_list.push({ this.image_list.push({
pic_id: data.data.oss_image_id, pic_id: data.data.oss_image_id,
small_image_url: data.data.small_image_url, small_image_url: data.data.small_image_url,
big_image_url: data.data.big_image_url big_image_url: data.data.big_image_url
}); });
} else { } else {
uni.showToast({ uni.showToast({
title: '网络出现问题', title: data.msg,
icon: 'error' icon: 'none'
}); });
} }
}, },
fail: error => { fail: error => {
console.log('上传图片失败:', error);
uni.hideLoading(); uni.hideLoading();
} }
}); });
},
fail: err => {
console.log('压缩图片失败:', err);
} }
});
});
} }
}); });
}, },
...@@ -959,8 +987,14 @@ export default { ...@@ -959,8 +987,14 @@ export default {
if (res.code === 0) { if (res.code === 0) {
if (res.data.list.length > 0) { if (res.data.list.length > 0) {
//过滤出待复核不为0的数据 //过滤出待复核不为0的数据
if (this.curr == 0) {
var filteredList = res.data.list.filter(item => item.no_recheck_qty > 0); var filteredList = res.data.list.filter(item => item.no_recheck_qty > 0);
this.list = filteredList; this.list = filteredList;
} else if (this.curr == 1) {
var filteredList = res.data.list.filter(item => item.total_check_num > 0);
this.list = filteredList;
}
this.filter_list = createArray(filteredList.length, false); this.filter_list = createArray(filteredList.length, false);
typeof callback == 'function' && callback(filteredList); typeof callback == 'function' && callback(filteredList);
} 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++) {
// 遍历图片路径数组,对每张图片进行压缩
imagePaths.forEach(imagePath => {
// 使用compressImage 压缩图片
uni.compressImage({
src: imagePath,
quality: 50, //压缩质量,范围0~100,数值越小,质量越低,压缩率越高
success: compressedRes => {
console.log('压缩图片成功:', compressedRes);
// 获取压缩后的图片路径
const compressedImagePath = compressedRes.tempFilePath;
// 在这里处理压缩后的图片,上传到服务器
uni.uploadFile({ uni.uploadFile({
url: API.upload + '?sys_type=4', url: API.upload + '?sys_type=4',
filePath: tempFilePaths[i], filePath: compressedImagePath,
name: 'file', name: 'file',
header: { header: {
'Content-Type': 'multipart/form-data' 'Content-Type': 'multipart/form-data'
}, },
success: uploadFileRes => { success: uploadFileRes => {
console.log('服务器上传图片成功:', uploadFileRes);
uni.hideLoading(); uni.hideLoading();
var data = JSON.parse(uploadFileRes.data); let data = JSON.parse(uploadFileRes.data);
if (data.code === 0) { if (data.code === 0) {
self.image_list.push(data.data.oss_image_url); this.image_list.push(data.data.oss_image_url);
} else { } else {
uni.showToast({ uni.showToast({
title: '网络出现问题', title: data.msg,
icon: 'error' icon: 'none'
}); });
} }
}, },
fail: error => { fail: error => {
console.log('上传图片失败:', error);
uni.hideLoading(); uni.hideLoading();
} }
}); });
},
fail: err => {
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++) {
// 遍历图片路径数组,对每张图片进行压缩
imagePaths.forEach(imagePath => {
// 使用compressImage 压缩图片
uni.compressImage({
src: imagePath,
quality: 50, //压缩质量,范围0~100,数值越小,质量越低,压缩率越高
success: compressedRes => {
console.log('压缩图片成功:', compressedRes);
// 获取压缩后的图片路径
const compressedImagePath = compressedRes.tempFilePath;
// 在这里处理压缩后的图片,上传到服务器
uni.uploadFile({ uni.uploadFile({
url: API.upload + '?sys_type=4', url: API.upload + '?sys_type=4',
filePath: tempFilePaths[i], filePath: compressedImagePath,
name: 'file', name: 'file',
header: { header: {
'Content-Type': 'multipart/form-data' 'Content-Type': 'multipart/form-data'
}, },
success: uploadFileRes => { success: uploadFileRes => {
console.log('服务器上传图片成功:', uploadFileRes);
uni.hideLoading(); uni.hideLoading();
var data = JSON.parse(uploadFileRes.data); let data = JSON.parse(uploadFileRes.data);
if (data.code === 0) { if (data.code === 0) {
self.image_list.push(data.data.oss_image_url); this.image_list.push(data.data.oss_image_url);
} else { } else {
uni.showToast({ uni.showToast({
title: '网络出现问题', title: data.msg,
icon: 'error' icon: 'none'
}); });
} }
}, },
fail: error => { fail: error => {
console.log('上传图片失败:', error);
uni.hideLoading(); 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