1.修正配送接收配送单图片上传数据导致异常的问题

main
董哲奇 1 month ago
parent 8045c7079c
commit e2ae432c7c

@ -128,7 +128,7 @@
<view class="list-title"><text style="color: #fa3534;">*</text>配送单照片</view> <view class="list-title"><text style="color: #fa3534;">*</text>配送单照片</view>
<view class="devpicon"> <view class="devpicon">
<u-upload ref="uUploadps" :auto-upload="false" upload-text='' :max-size="10 * 1024 * 1024" max-count="3" :width="100" :height="100" <u-upload ref="uUploadps" :auto-upload="false" upload-text='' :max-size="10 * 1024 * 1024" max-count="3" :width="100" :height="100"
@on-remove="onRemovePS" @on-choose-complete="onChooseCompletePS" :file-list="itemList.deliveryPhoto" @on-remove="onRemovePS" @on-choose-complete="onChooseCompletePS" :file-list="itemList.deliveryPhoto0"
:deletable="true" :source-type="sourceType" style="background-color: #ecf5ff;"> :deletable="true" :source-type="sourceType" style="background-color: #ecf5ff;">
</u-upload> </u-upload>
</view> </view>
@ -404,6 +404,7 @@ export default {
deliveryCar:'',// deliveryCar:'',//
files: [], files: [],
deliveryPhoto:[], // deliveryPhoto:[], //
deliveryPhoto0:[],
departCode:"", departCode:"",
workshop:"", workshop:"",
location:"", location:"",
@ -667,7 +668,7 @@ export default {
const base64 = evt.target.result.substr(22) const base64 = evt.target.result.substr(22)
console.log("base64",base64) console.log("base64",base64)
resolve(base64) resolve(base64)
that.itemList.deliveryPhoto[index]['url']="data:image/png;base64"+base64; that.itemList.deliveryPhoto0[index]['url']="data:image/png;base64"+base64;
that.$forceUpdate(); that.$forceUpdate();
}; };
@ -694,7 +695,7 @@ export default {
reader.onload = (e) => { reader.onload = (e) => {
const base64 = e.target.result; const base64 = e.target.result;
resolve(base64); resolve(base64);
that.itemList.deliveryPhoto[index]={ that.itemList.deliveryPhoto0[index]={
url:base64 url:base64
}; };
that.$forceUpdate(); that.$forceUpdate();
@ -1277,7 +1278,7 @@ export default {
return false return false
} }
if(!this.itemList.deliveryPhoto||this.itemList.deliveryPhoto.length<1){ if(!this.itemList.deliveryPhoto0&&this.itemList.deliveryPhoto0.length<1){
this.$refs.uToast.show({ this.$refs.uToast.show({
title: "请上传配送单图片!", title: "请上传配送单图片!",
type: "warning", type: "warning",
@ -1288,9 +1289,10 @@ export default {
// //
this.itemList.files=[]; this.itemList.files=[];
this.itemList.deliveryPhoto.forEach(item=>{ this.itemList.deliveryPhoto0.forEach(item=>{
this.itemList.files.push(item.url); this.itemList.files.push(item.url);
}); });
this.itemList.deliveryPhoto=this.itemList.files
this.$forceUpdate(); this.$forceUpdate();
var data=[]; var data=[];

Loading…
Cancel
Save