Commit 60c62ffb by LJM

bug

parent 2814cc5b
......@@ -362,9 +362,10 @@ export default {
this.closeDrawer();
}, 2000);
} else {
uni.showToast({
title: res.msg,
icon: 'error'
uni.showModal({
itle: '提示',
content: res.msg,
showCancel: false
});
}
});
......
......@@ -39,26 +39,26 @@
</view>
</view>
<view class="section">
<view class="field-item row">
<view class="field-item row" v-if="detail">
<view class="item row verCenter">
<text class="label">入库单号:</text>
<text class="text">ASN2201010001</text>
<text class="text">{{ detail.stock_in_sn }}</text>
</view>
<view class="item row verCenter">
<text class="label">入 仓 号:</text>
<text class="text">A65512</text>
<text class="text">{{ detail.inhouse }}</text>
</view>
<view class="item row verCenter" style="flex: 0 0 100%;">
<text class="label">物流单号:</text>
<text class="text">SF2135661465161</text>
<text class="text">{{ detail.tracking_no }}</text>
</view>
<view class="item row verCenter">
<text class="label">到货时间:</text>
<text class="tt">2023-04-01 11:28:59</text>
<text class="tt">{{ detail.arrival_time_cn }}</text>
</view>
<view class="item row verCenter" style="margin-bottom: 17rpx;">
<text class="label">到货操作人:</text>
<text class="tt">拾贰</text>
<text class="tt">{{ detail.arrival_name }}</text>
</view>
</view>
<view class="bor"></view>
......@@ -66,31 +66,31 @@
<view class="field-item row">
<view class="item row verCenter" style="flex: 0 0 100%;">
<text class="label">货品编码:</text>
<text class="tt" style="max-width: 100%;">6546546416541654665</text>
<text class="tt" style="max-width: 100%;">{{ detail.goods_sn }}</text>
</view>
<view class="item row verCenter" style="flex: 0 0 100%;">
<text class="label">货品名称:</text>
<text class="tt" style="max-width: 100%;">ASD3DAADS22</text>
<text class="tt" style="max-width: 100%;">{{ detail.goods_name }}</text>
</view>
<view class="item row verCenter" style="flex: 0 0 100%;">
<text class="label">标准品牌:</text>
<text class="tt" style="max-width: 100%;">Nexperia</text>
<text class="tt" style="max-width: 100%;">{{ detail.brand_name }}</text>
</view>
<view class="item row verCenter">
<text class="label">货品品质:</text>
<text class="tt">良品</text>
<text class="tt">{{ detail.quality_cn }}</text>
</view>
<view class="item row verCenter">
<text class="label">是否质检:</text>
<text class="text"></text>
<text class="text">{{ detail.is_qc_cn }}</text>
</view>
<view class="item row verCenter">
<text class="label">预期数量:</text>
<text class="tt">100000</text>
<text class="tt">{{ detail.expect_qty }}</text>
</view>
<view class="item row verCenter">
<text class="label">单 位:</text>
<text class="tt">PCS</text>
<text class="tt">{{ detail.goods_unit }}</text>
</view>
</view>
<view class="form-input">
......@@ -104,7 +104,7 @@
</view>
<view class="row verCenter" style="flex: 0 0 278rpx;margin-top: 38rpx;">
<text class="input-title-p1">待理货数量:</text>
<text class="input-title-p2">100000</text>
<text class="input-title-p2">{{ detail.wait_tally_qty }}</text>
</view>
</view>
<view class="row bothSide verCenter input-box-wrap">
......@@ -128,39 +128,21 @@
<view class="h2 row bothSide verCenter" style="margin-top: 34rpx;">
<view>
<text>理货照片:</text>
<text class="tt">最多只支持10张图</text>
<text class="tt">最多只支持{{ maxNum }}张图</text>
</view>
<view class="num">
<text class="t1">0</text>
<text class="t1">{{ image_list.length }}</text>
<text class="t2">/10</text>
</view>
</view>
<view class="pic-list row">
<view class="default row rowCenter verCenter"><text class="iconfont icon-a-juxing3"></text></view>
<view class="box">
<image src="https://img.ichunt.com/images/ichunt/202304/11/372bae650d699de8b3008cace4e4f081.jpg" mode="aspectFill"></image>
<text class="iconfont icon-a-juxing11"></text>
</view>
<view class="box">
<image src="https://img.ichunt.com/images/ichunt/202304/11/372bae650d699de8b3008cace4e4f081.jpg" mode="aspectFill"></image>
<text class="iconfont icon-a-juxing11"></text>
</view>
<view class="box">
<image src="https://img.ichunt.com/images/ichunt/202304/11/372bae650d699de8b3008cace4e4f081.jpg" mode="aspectFill"></image>
<text class="iconfont icon-a-juxing11"></text>
</view>
<view class="box">
<image src="https://img.ichunt.com/images/ichunt/202304/11/372bae650d699de8b3008cace4e4f081.jpg" mode="aspectFill"></image>
<text class="iconfont icon-a-juxing11"></text>
</view>
<view class="box">
<image src="https://img.ichunt.com/images/ichunt/202304/11/372bae650d699de8b3008cace4e4f081.jpg" mode="aspectFill"></image>
<text class="iconfont icon-a-juxing11"></text>
</view>
<view class="box">
<image src="https://img.ichunt.com/images/ichunt/202304/11/372bae650d699de8b3008cace4e4f081.jpg" mode="aspectFill"></image>
<text class="iconfont icon-a-juxing11"></text>
</view>
<template v-if="image_list.length > 0">
<view class="box" v-for="(item, index) in image_list" :key="index">
<image :src="item" 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="print row verCenter">
<text class="check-box-icon curr"></text>
......@@ -174,7 +156,7 @@
<text class="check-box-icon curr"></text>
<text class="text">打印入库标签</text>
</view>
<view class="btn2 row rowCenter verCenter">理 货</view>
<view class="btn2 row rowCenter verCenter" @click="createTallyReceive">理 货</view>
</view>
</view>
</template>
......@@ -306,6 +288,110 @@ export default {
}
});
},
/**
* 选择图片
*/
chooseImageChange() {
this.noexebshowFalg = false;
var self = this;
var time = parseInt(new Date().getTime() / 1000);
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,
filePath: tempFilePaths[i],
name: 'upload',
formData: {
source: '1',
k1: time,
k2: w_md5.hex_md5_32(w_md5.hex_md5_32(String(time)) + 'fh6y5t4rr351d2c3bryi')
},
success: uploadFileRes => {
uni.hideLoading();
var data = JSON.parse(uploadFileRes.data);
if (data.code === 200) {
self.image_list.push(data.data[0]);
} else {
uni.showToast({
title: data.message,
icon: 'error'
});
}
},
fail: error => {
uni.hideLoading();
}
});
}
}
});
},
/**
* 删除图片
* @param {Object} index
*/
deletePic(index) {
this.image_list.splice(index, 1);
},
/**
* 预览图片
* @param {Object} img
* @param {Object} index
*/
previewChange(img, index) {
this.noexebshowFalg = false;
uni.previewImage({
current: index,
urls: img
});
},
/**
* 理货提交
*/
createTallyReceive() {
var params = {
container_id: container_id,
stock_in_id: layui.form.val('tallyReceiveForm').stock_in_id,
stock_in_item_id: this.stock_in_item_id,
tally_qty: layui.form.val('tallyReceiveForm').tally_qty,
date_code: layui.form.val('tallyReceiveForm').date_code,
other_batch_attr: layui.form.val('tallyReceiveForm').other_batch_attr,
tally_remark: layui.form.val('tallyReceiveForm').tally_remark,
image_ids: image_ids.join(','),
coo: layui.form.val('tallyReceiveForm').coo
};
this.request(API.createTallyReceive, 'POST', params, true).then(res => {
if (res.code === 0) {
uni.showToast({
title: '理货成功',
icon: 'success'
});
} else {
uni.showModal({
itle: '提示',
content: res.msg,
showCancel: false
});
}
});
},
showDrawer() {
this.$refs.showRight.open();
},
......
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