Commit b3bdfce8 by LJM

照片

parent 73c455b6
......@@ -64,6 +64,17 @@
font-size: 17rpx;
color: #1969f9;
}
.pick_img_list {
flex-wrap: wrap;
.img_list {
width: 120rpx;
height: 120rpx;
background: #f5f5f7;
border-radius: 10rpx;
margin-right: 15rpx;
margin-bottom: 15rpx;
}
}
}
.btn {
position: absolute;
......
......@@ -322,4 +322,61 @@
}
}
}
.h2 {
font-size: 17rpx;
color: #484b59;
font-weight: bold;
margin-bottom: 10rpx;
.tt {
font-size: 17rpx;
color: #919399;
font-weight: normal;
}
.num {
.t1 {
font-size: 13rpx;
color: #1969f9;
}
.t2 {
font-size: 13rpx;
color: #919399;
}
}
}
.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;
}
}
.box {
position: relative;
width: 120rpx;
height: 120rpx;
background: #f5f5f7;
border-radius: 10rpx;
margin-right: 15rpx;
margin-bottom: 15rpx;
image {
width: 120rpx;
height: 120rpx;
}
.iconfont {
position: absolute;
right: 0;
top: 0;
font-size: 30rpx;
color: #ff3700;
z-index: 9;
}
}
}
}
......@@ -48,6 +48,17 @@
font-size: 17rpx;
color: #1969f9;
}
.pick_img_list {
flex-wrap: wrap;
.img_list {
width: 120rpx;
height: 120rpx;
background: #f5f5f7;
border-radius: 10rpx;
margin-right: 15rpx;
margin-bottom: 15rpx;
}
}
}
}
}
......
......@@ -472,6 +472,63 @@
}
}
}
.h2 {
font-size: 17rpx;
color: #484b59;
font-weight: bold;
margin-bottom: 10rpx;
.tt {
font-size: 17rpx;
color: #919399;
font-weight: normal;
}
.num {
.t1 {
font-size: 13rpx;
color: #1969f9;
}
.t2 {
font-size: 13rpx;
color: #919399;
}
}
}
.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;
}
}
.box {
position: relative;
width: 120rpx;
height: 120rpx;
background: #f5f5f7;
border-radius: 10rpx;
margin-right: 15rpx;
margin-bottom: 15rpx;
image {
width: 120rpx;
height: 120rpx;
}
.iconfont {
position: absolute;
right: 0;
top: 0;
font-size: 30rpx;
color: #ff3700;
z-index: 9;
}
}
}
.list-drawer {
margin-top: 15rpx;
.box {
......
......@@ -72,6 +72,10 @@
<text class="label">明细备注:</text>
<text class="text">{{ item.remark }}</text>
</view>
<view class="input-box row" style="flex: 0 0 100%;">
<text class="label">拣货照片:</text>
<view class="pick_img_list row"><image @click="previewChange(item.pick_img_list, i)" class="img_list" :src="v.small_image_url" v-for="(v, i) in item.pick_img_list" :key="i" mode="aspectFill"></image></view>
</view>
</view>
</view>
<!-- 无数据展示 -->
......@@ -97,6 +101,7 @@ import debounce from 'lodash/debounce';
export default {
data() {
return {
noexebshowFalg: true, //控制是否会触发生命周期
input_flag: false,
all_flag: false, //全选标记
page: 1,
......@@ -121,8 +126,10 @@ export default {
this.searchParams.stock_out_sn = options.stock_out_sn;
},
onShow() {
this.resetChange();
this.getData();
if (this.noexebshowFalg) {
this.resetChange();
this.getData();
}
},
methods: {
/**
......@@ -171,6 +178,21 @@ export default {
this.getData();
},
/**
* 预览图片
* @param {Object} img
* @param {Object} index
*/
previewChange(arr, index) {
var data = arr.map(item => {
return item.big_image_url;
});
this.noexebshowFalg = false;
uni.previewImage({
current: index,
urls: data
});
},
/**
* 单号搜索
* @param {Object} event
*/
......@@ -232,7 +254,7 @@ export default {
* 获取列表数据
*/
getData() {
this.request(API.getAllPickedList, 'POST', { page: this.page, limit: this.limit, ...this.searchParams }, false).then(res => {
this.request(API.getAllPickedList, 'POST', { page: this.page, limit: this.limit, ...this.searchParams }, true).then(res => {
if (res.code === 0) {
if (res.data.list.length > 0) {
this.hasMoreData = true;
......
......@@ -234,6 +234,25 @@
<text class="tt" style="max-width: 100%;">{{ detail.customer_name }}</text>
</view>
</view>
<view class="h2 row bothSide verCenter" style="margin-top: 25rpx;">
<view>
<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.small_image_url" 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 class="btn row verCenter bothSide"><view class="btn1 row rowCenter verCenter" @click="pick(detail.lock_id, formParams.pick_qty, detail.stock_out_item_id)">拣 货</view></view>
</view>
</uni-drawer>
......@@ -263,6 +282,25 @@
</view>
</view>
<view class="bor"></view>
<view class="h2 row bothSide verCenter" style="margin-top: 25rpx;">
<view>
<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.small_image_url" 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 class="item-tit">货品明细</view>
<view class="list-drawer">
<scroll-view style="max-height: 755rpx" scroll-y="true">
......@@ -343,6 +381,7 @@ import debounce from 'lodash/debounce';
export default {
data() {
return {
noexebshowFalg: true, //控制是否会触发生命周期
stock_out_sn: '', //标题显示出库单号
lock_ids: [], //出库id集合
input_flag_position_name: false,
......@@ -356,6 +395,8 @@ export default {
detail: {}, //按货品拣货详情
detailContainer: {}, //按容器拣货详情
picked_num: '', //应拣数量
image_list: [], //图片列表
maxNum: 10, //最大上传图片数量
searchParams: {
stock_out_id: '',
position_name: '',
......@@ -379,12 +420,15 @@ export default {
this.searchParams.stock_out_id = options.stock_out_id || '';
},
onShow() {
this.getData();
if (this.noexebshowFalg) {
this.getData();
}
},
methods: {
tab(index) {
this.curr = index;
this.getData();
this.image_list = [];
},
showDrawer(type, data) {
if (type == 1) {
......@@ -408,6 +452,83 @@ export default {
}
},
/**
* 选择图片
*/
chooseImageChange() {
this.noexebshowFalg = false;
var self = this;
uni.chooseImage({
count: self.maxNums,
sourceType: ['album', 'camera'],
success: chooseImageRes => {
uni.showLoading({
title: '上传中...'
});
const tempFilePaths = chooseImageRes.tempFilePaths;
let maxNum = tempFilePaths.length * 1 + self.image_list.length * 1;
if (maxNum > self.maxNum) {
uni.hideLoading();
uni.showToast({
title: '图片不超过' + self.maxNum + '张',
icon: 'error'
});
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'
});
}
},
fail: error => {
uni.hideLoading();
}
});
}
}
});
},
/**
* 删除图片
* @param {Object} index
*/
deletePic(index) {
this.image_list.splice(index, 1);
},
/**
* 预览图片
* @param {Object} img
* @param {Object} index
*/
previewChange(arr, index) {
var data = arr.map(item => {
return item.big_image_url;
});
this.noexebshowFalg = false;
uni.previewImage({
current: index,
urls: data
});
},
/**
* 监听拣货数量
*/
handleInputNumber: debounce(function(event, num) {
......@@ -463,7 +584,10 @@ export default {
pick(lock_id, pick_qty, stock_out_item_id) {
var num = Number(this.detail.lock_qty) - Number(this.detail.pick_qty);
var pick_qty_num = pick_qty * 1;
this.request(API.pick, 'POST', { lock_id: lock_id, pick_qty: pick_qty, stock_out_item_id: stock_out_item_id }, true).then(res => {
var pic_ids = this.image_list.map(item => {
return item.pic_id;
});
this.request(API.pick, 'POST', { lock_id: lock_id, pick_qty: pick_qty, stock_out_item_id: stock_out_item_id, pic_ids: pic_ids.join(',') }, true).then(res => {
if (res.code === 0) {
uni.showToast({
title: '拣货成功',
......
......@@ -63,6 +63,10 @@
<text class="label">复核时间:</text>
<text class="text">{{ item.create_time }}</text>
</view>
<view class="input-box row" style="flex: 0 0 100%;">
<text class="label">复核照片:</text>
<view class="pick_img_list row"><image @click="previewChange(item.recheck_img_list, i)" class="img_list" :src="v.small_image_url" v-for="(v, i) in item.recheck_img_list" :key="i" mode="aspectFill"></image></view>
</view>
</view>
</view>
<!-- 无数据展示 -->
......@@ -87,6 +91,7 @@ import { createArray } from '@/util/util.js';
export default {
data() {
return {
noexebshowFalg: true, //控制是否会触发生命周期
page: 1,
limit: 50,
list: [],
......@@ -114,8 +119,10 @@ export default {
this.stock_out_sn = options.stock_out_sn;
},
onShow() {
this.resetChange();
this.getData();
if (this.noexebshowFalg) {
this.resetChange();
this.getData();
}
},
methods: {
/**
......@@ -155,10 +162,25 @@ export default {
}
},
/**
* 预览图片
* @param {Object} img
* @param {Object} index
*/
previewChange(arr, index) {
var data = arr.map(item => {
return item.big_image_url;
});
this.noexebshowFalg = false;
uni.previewImage({
current: index,
urls: data
});
},
/**
* 获取列表数据
*/
getData() {
this.request(API.getAllCheckedItemList, 'POST', { page: this.page, limit: this.limit, stock_out_sn: this.stock_out_sn }, false).then(res => {
this.request(API.getAllCheckedItemList, 'POST', { page: this.page, limit: this.limit, stock_out_sn: this.stock_out_sn }, true).then(res => {
if (res.code === 0) {
if (res.data.list.length > 0) {
this.hasMoreData = true;
......
......@@ -560,7 +560,7 @@ export default {
uni.hideLoading();
var data = JSON.parse(uploadFileRes.data);
if (data.code === 0) {
self.image_list.push(data.data.oss_file_url);
self.image_list.push(data.data.oss_image_url);
} else {
uni.showToast({
title: '网络出现问题',
......
......@@ -491,7 +491,7 @@ export default {
uni.hideLoading();
var data = JSON.parse(uploadFileRes.data);
if (data.code === 0) {
self.image_list.push(data.data.oss_file_url);
self.image_list.push(data.data.oss_image_url);
} else {
uni.showToast({
title: '网络出现问题',
......
......@@ -5,7 +5,7 @@ const API_BASE_SUPPLIER = 'http://supplier.liexin.net'; //供应商系统
const API_BASE_CRM = 'http://crmnew.liexindev.net'; //CRM系统
const API_BASE = 'http://wms.liexindev.net'; //WMS系统
const API_BASE_LIEXIN = 'http://api.liexin.com'; //api系统
const API_BASE_OSS = 'http://file.liexindev.net'; //oss系统
const API_BASE_OSS = 'http://image.liexindev.net'; //oss系统
// const API_BASE_USER = 'https://user.ichunt.net'; //用户系统
// const API_BASE_ORDER = 'https://order.ichunt.net'; //订单系统
......@@ -14,7 +14,7 @@ const API_BASE_OSS = 'http://file.liexindev.net'; //oss系统
// const API_BASE_CRM = 'https://crm.ichunt.net'; //CRM系统
// const API_BASE = 'https://wms.ichunt.net'; //WMS系统
// const API_BASE_LIEXIN = 'https://api.ichunt.com'; //api系统
// const API_BASE_OSS = 'https://files.ichunt.net'; //oss系统
// const API_BASE_OSS = 'https://image.ichunt.net'; //oss系统
const API = {
......@@ -181,7 +181,7 @@ const API = {
/**
* 上传文件
* */
upload: API_BASE_OSS + '/uploadFile',
upload: API_BASE_OSS + '/uploadImage',
/**
* 标签补打
* */
......
......@@ -32,9 +32,6 @@ const request = (url = '', type = 'GET', param = {}, Loading) => {
header: header,
dataType: 'json',
}).then((response) => {
if (Loading) {
uni.hideLoading();
}
let [error, res] = response;
if (res.data.code == 101) {
uni.navigateTo({
......@@ -43,6 +40,9 @@ const request = (url = '', type = 'GET', param = {}, Loading) => {
return false;
}
resolve(res.data);
if (Loading) {
uni.hideLoading();
}
}).catch(error => {
uni.showToast({
title: '网络出现问题',
......
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