|
@@ -20,11 +20,12 @@
|
|
|
<view style="padding-left: 10rpx;">
|
|
|
<view style='flex-wrap:wrap;' class='flex'>
|
|
|
<view v-for='(item,index) in imgList2' v-if="imgList2 && imgList2.length > 0"
|
|
|
- style="position: relative;margin-left: 20rpx;">
|
|
|
- <view class="delete_img" @click="deleteImg(index)">
|
|
|
- <u-icon size='4' name="close"></u-icon>
|
|
|
- </view>
|
|
|
- <image :src="item.appendixPath" mode="" style="width: 100px;height: 100px;border:1px solid #ccc;border-radius: 5rpx;"></image>
|
|
|
+ style="position: relative;margin-left: 20rpx;">
|
|
|
+ <view class="delete_img" @click="deleteImg(index)">
|
|
|
+ <u-icon size='4' name="close"></u-icon>
|
|
|
+ </view>
|
|
|
+ <image :src="item.appendixPath" mode=""
|
|
|
+ style="width: 100px;height: 100px;border:1px solid #ccc;border-radius: 5rpx;"></image>
|
|
|
</view>
|
|
|
<view class="biankuang" @click="uploadClick" v-if="imgList2.length < 9">
|
|
|
<view class="tubiao">
|
|
@@ -33,8 +34,8 @@
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
-
|
|
|
- <!-- <upload :file-list='businesslicense' class="upload" ref="upload" :action="action" :max-size="maxSize"
|
|
|
+
|
|
|
+ <!-- <upload :file-list='businesslicense' class="upload" ref="upload" :action="action" :max-size="maxSize"
|
|
|
delIconSize='30' delBgColor='rgba(0,0,0,0.4)' delIcon="trash" :max-count="9"
|
|
|
:size-type="['compressed']" @on-success="getImgUrl" @on-remove="onRemove"
|
|
|
:before-upload="filterFileType"></upload> -->
|
|
@@ -80,7 +81,7 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
- import * as config from '../../config'
|
|
|
+ import * as config from '../../config'
|
|
|
import upload from '@/components/upload_small.vue';
|
|
|
import selectAddress from "@/components/selectAddress.vue"
|
|
|
import {
|
|
@@ -96,8 +97,8 @@
|
|
|
searchPlaceHolder: '选择地区',
|
|
|
placeTitle: '交货地',
|
|
|
imgList: [],
|
|
|
- imgList2:[],
|
|
|
- disabled:false,
|
|
|
+ imgList2: [],
|
|
|
+ disabled: false,
|
|
|
showNickname: false,
|
|
|
dataObj: {
|
|
|
userId: '',
|
|
@@ -132,7 +133,7 @@
|
|
|
action: this.$uploadUrl,
|
|
|
maxSize: 50 * 1024 * 1024, //限制文件大小 50M
|
|
|
isAdd: false,
|
|
|
- num:0
|
|
|
+ num: 0
|
|
|
};
|
|
|
},
|
|
|
onShow() {
|
|
@@ -162,57 +163,57 @@
|
|
|
imgList: {
|
|
|
handler: function() {
|
|
|
var that = this
|
|
|
- setTimeout(()=>{
|
|
|
+ setTimeout(() => {
|
|
|
that.$api.doRequest('get', 'appendix/query/getFileList', {
|
|
|
- appendixIds: that.imgList.toString()
|
|
|
- }).then(res => {
|
|
|
- that.imgList2 = res.data.data
|
|
|
- that.$forceUpdate()
|
|
|
- })
|
|
|
- },1000)
|
|
|
-
|
|
|
+ appendixIds: that.imgList.toString()
|
|
|
+ }).then(res => {
|
|
|
+ that.imgList2 = res.data.data
|
|
|
+ that.$forceUpdate()
|
|
|
+ })
|
|
|
+ }, 1000)
|
|
|
+
|
|
|
},
|
|
|
deep: true,
|
|
|
- immediate:true
|
|
|
+ immediate: true
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
deleteImg(index) {
|
|
|
- this.num=this.imgList.length
|
|
|
+ this.num = this.imgList.length
|
|
|
this.imgList.splice(index, 1)
|
|
|
},
|
|
|
async uploadClick() {
|
|
|
let baseUrlNew = config.def().baseUrlNew
|
|
|
let pcUserInfo = uni.getStorageSync('pcUserInfo')
|
|
|
- console.log('baseUrlNew',baseUrlNew)
|
|
|
- if(!pcUserInfo){
|
|
|
+ console.log('baseUrlNew', baseUrlNew)
|
|
|
+ if (!pcUserInfo) {
|
|
|
uni.showToast({
|
|
|
- title:"登录已失效,请重新登录"
|
|
|
+ title: "登录已失效,请重新登录"
|
|
|
})
|
|
|
- return
|
|
|
+ return
|
|
|
}
|
|
|
await uni.chooseImage({
|
|
|
- count:9,
|
|
|
+ count: 9,
|
|
|
success: (chooseImageRes) => {
|
|
|
- console.log('chooseImageRes',chooseImageRes)
|
|
|
+ console.log('chooseImageRes', chooseImageRes)
|
|
|
let files = []
|
|
|
for (let item of chooseImageRes.tempFiles) {
|
|
|
files.push({
|
|
|
name: 'fileName',
|
|
|
- url : item.path
|
|
|
+ url: item.path
|
|
|
});
|
|
|
}
|
|
|
console.log(files)
|
|
|
for (let i = 0; i < files.length; i++) {
|
|
|
this.num++
|
|
|
- if(this.num<10){
|
|
|
+ if (this.num < 10) {
|
|
|
console.log(this.num)
|
|
|
uni.uploadFile({
|
|
|
url: baseUrlNew + 'appendix/api/uploadFiles',
|
|
|
// url: baseUrlNew+'appendix/api/uploadFiles', //仅为示例,非真实的接口地址
|
|
|
// files: files[i],
|
|
|
- filePath:files[i].url,
|
|
|
- name:files[i].name,
|
|
|
+ filePath: files[i].url,
|
|
|
+ name: files[i].name,
|
|
|
formData: {
|
|
|
// fileName: chooseImageRes.tempFiles[0],
|
|
|
companyId: pcUserInfo.compId,
|
|
@@ -223,15 +224,16 @@
|
|
|
console.log(JSON.parse(uploadFileRes.data))
|
|
|
var data = JSON.parse(uploadFileRes.data).data
|
|
|
data.compId = pcUserInfo.compId
|
|
|
- this.$api.doRequest('post', '/appendix/api/saveFilesApp', {
|
|
|
- newAppendixs: [data],
|
|
|
- oldAppendixIds: ""
|
|
|
- }).then(res => {
|
|
|
-
|
|
|
+ this.$api.doRequest('post',
|
|
|
+ '/appendix/api/saveFilesApp', {
|
|
|
+ newAppendixs: [data],
|
|
|
+ oldAppendixIds: ""
|
|
|
+ }).then(res => {
|
|
|
+
|
|
|
console.log(res.data.data)
|
|
|
this.imgList.push(res.data.data[0])
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
+
|
|
|
})
|
|
|
console.log(uploadFileRes.data);
|
|
|
},
|
|
@@ -239,12 +241,12 @@
|
|
|
console.log(res);
|
|
|
}
|
|
|
});
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
break;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
}
|
|
|
});
|
|
|
},
|
|
@@ -337,7 +339,7 @@
|
|
|
this.$api.doRequest('post', '/transactionExchangeInfo/addInfo', this.dataObj).then(res => {
|
|
|
console.log(res)
|
|
|
if (res.data.code == 200) {
|
|
|
- this.num=0
|
|
|
+ this.num = 0
|
|
|
uni.navigateBack({
|
|
|
delta: 1
|
|
|
})
|
|
@@ -351,18 +353,18 @@
|
|
|
})
|
|
|
},
|
|
|
dateFormat(time) {
|
|
|
- let date = new Date(time);
|
|
|
- let year = date.getFullYear();
|
|
|
- // 在日期格式中,月份是从0开始的,因此要加0,使用三元表达式在小于10的前面加0,以达到格式统一 如 09:11:05
|
|
|
- let month = date.getMonth() + 1 < 10 ? "0" + (date.getMonth() + 1) : date.getMonth() + 1;
|
|
|
- let day = date.getDate() < 10 ? "0" + date.getDate() : date.getDate();
|
|
|
- let hours = date.getHours() < 10 ? "0" + date.getHours() : date.getHours();
|
|
|
- let minutes = date.getMinutes() < 10 ? "0" + date.getMinutes() : date.getMinutes();
|
|
|
- let seconds = date.getSeconds() < 10 ? "0" + date.getSeconds() : date.getSeconds();
|
|
|
- // 拼接
|
|
|
- return year + "-" + month + "-" + day + " " + hours + ":" + minutes + ":" + seconds;
|
|
|
- // return year + "-" + month + "-" + day;
|
|
|
- },
|
|
|
+ let date = new Date(time);
|
|
|
+ let year = date.getFullYear();
|
|
|
+ // 在日期格式中,月份是从0开始的,因此要加0,使用三元表达式在小于10的前面加0,以达到格式统一 如 09:11:05
|
|
|
+ let month = date.getMonth() + 1 < 10 ? "0" + (date.getMonth() + 1) : date.getMonth() + 1;
|
|
|
+ let day = date.getDate() < 10 ? "0" + date.getDate() : date.getDate();
|
|
|
+ let hours = date.getHours() < 10 ? "0" + date.getHours() : date.getHours();
|
|
|
+ let minutes = date.getMinutes() < 10 ? "0" + date.getMinutes() : date.getMinutes();
|
|
|
+ let seconds = date.getSeconds() < 10 ? "0" + date.getSeconds() : date.getSeconds();
|
|
|
+ // 拼接
|
|
|
+ return year + "-" + month + "-" + day + " " + hours + ":" + minutes + ":" + seconds;
|
|
|
+ // return year + "-" + month + "-" + day;
|
|
|
+ },
|
|
|
selectAddress(val) {
|
|
|
console.log(val)
|
|
|
console.log(this.dataObj.tranType)
|
|
@@ -582,28 +584,31 @@
|
|
|
bottom: 30rpx;
|
|
|
width: 90%;
|
|
|
}
|
|
|
+
|
|
|
.biankuang {
|
|
|
// border: 1px dashed #AFB3BF;
|
|
|
border-radius: 10rpx;
|
|
|
width: 200rpx;
|
|
|
height: 200rpx;
|
|
|
margin-left: 20rpx;
|
|
|
- text-align:center;
|
|
|
+ text-align: center;
|
|
|
line-height: 220rpx;
|
|
|
- background:#F5F6FA;
|
|
|
+ background: #F5F6FA;
|
|
|
+
|
|
|
.upload {
|
|
|
width: 46rpx;
|
|
|
height: 46rpx;
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
.delete_img {
|
|
|
position: absolute;
|
|
|
z-index: 100;
|
|
|
right: 0px;
|
|
|
- border-radius:0 5rpx 0 10px;
|
|
|
+ border-radius: 0 5rpx 0 10px;
|
|
|
color: #ffffff;
|
|
|
font-size: 28rpx;
|
|
|
-
|
|
|
+
|
|
|
border: 1px;
|
|
|
// border-radius: 5rpx;
|
|
|
width: 40rpx;
|
|
@@ -611,13 +616,14 @@
|
|
|
background-color: rgba(17, 26, 52, 0.50);
|
|
|
text-align: center;
|
|
|
}
|
|
|
- /deep/.pickerClass{
|
|
|
+
|
|
|
+ /deep/.pickerClass {
|
|
|
width: 80%;
|
|
|
position: absolute;
|
|
|
- right:11px;
|
|
|
- padding:0 30px 0 0;
|
|
|
- top:50%;
|
|
|
+ right: 11px;
|
|
|
+ padding: 0 30px 0 0;
|
|
|
+ top: 50%;
|
|
|
transform: translateY(-50%);
|
|
|
- z-index:2
|
|
|
+ z-index: 2
|
|
|
}
|
|
|
</style>
|