|
|
@@ -5,7 +5,7 @@
|
|
|
<span style="margin-left:20px;">{{orderInfo.productInfo.title}}</span>
|
|
|
<span style="font-size:14px;margin-left:20px;">已上传/总张数:{{orderImage.length}} / {{orderInfo.quantity}}</span>
|
|
|
<span v-if="canUploadNum<0" style="font-size:14px;color:red;margin-left:10px">超出{{0-canUploadNum}}张</span>
|
|
|
- <el-button type="primary" v-if="canUploadNum>0" class="btn" @click="dialogVisible=true,upLoadImg=[],addImage=[],num=0,maxNum=orderInfo.quantity-orderImage.length,chooseName=[]">上传图片</el-button>
|
|
|
+ <el-button type="primary" v-if="canUploadNum>0" class="btn" @click="tip=[],dialogVisible=true,upLoadImg=[],addImage=[],num=0,maxNum=orderInfo.quantity-orderImage.length,chooseName=[]">上传图片</el-button>
|
|
|
|
|
|
<el-button style="float:right;margin:20px;" v-if='canSubmit&&canUploadNum==0' type="warning" class="btn" @click="submit">确定</el-button>
|
|
|
</div>
|
|
|
@@ -18,7 +18,7 @@
|
|
|
<div class="el-upload__tip" slot="tip">只能上传RGB图片类型的jpg/png文件,当前已上传{{addImage.length}}张图片,还可以上传{{canUploadNum-addImage.length}}张</div>
|
|
|
</el-upload> -->
|
|
|
|
|
|
- <el-dialog title="上传图片" class="uploadDialog" :visible.sync="dialogVisible" width="80%" top="50px" :close-on-click-modal='false'>
|
|
|
+ <el-dialog title="上传图片" class="uploadDialog" :class="{uploadSmall:(maxNum<15)}" :visible.sync="dialogVisible" :show-close='(orderInfo.quantity-maxNum+num)==orderImage.length' :width="maxNum>50?'80%':'50%'" :top="maxNum>50?'50px':'15vh'" :close-on-click-modal='false'>
|
|
|
<div v-if="tip.length>0" class="tip" style="margin-bottom:10px;">
|
|
|
<template v-if="tip[0].indexOf('正在压缩')!=-1">
|
|
|
<i class="el-icon-loading"></i>{{tip[0]}}请不要关闭窗口耐心等待
|
|
|
@@ -158,21 +158,14 @@ export default {
|
|
|
})
|
|
|
this.orderImage = res.data
|
|
|
this.realNum = res.data.length
|
|
|
- if (this.realNum) {
|
|
|
- setTimeout(() => {
|
|
|
- loading.close();
|
|
|
- }, 1500);
|
|
|
- }
|
|
|
- else {
|
|
|
- loading.close();
|
|
|
- }
|
|
|
+ loading.close();
|
|
|
|
|
|
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
chooseImg(index) {
|
|
|
- console.log(index)
|
|
|
+ // console.log(index)
|
|
|
},
|
|
|
changeRemark(json) {
|
|
|
if (this.orderImgId.indexOf(json.id) != -1) {
|
|
|
@@ -183,7 +176,7 @@ export default {
|
|
|
|
|
|
},
|
|
|
handleSuccess(res) {
|
|
|
- console.log(res)
|
|
|
+ // console.log(res)
|
|
|
var tips = [...this.tip]
|
|
|
tips.forEach((item, index) => {
|
|
|
var list = item.split('文件正在压缩')
|
|
|
@@ -216,14 +209,14 @@ export default {
|
|
|
this.num = fileList.length
|
|
|
},
|
|
|
handleProgress(e, file) {
|
|
|
- console.log(e, file)
|
|
|
+ // console.log(e, file)
|
|
|
if (e.percent == 100) {
|
|
|
this.tip.splice(0, 0, file.name + '文件正在压缩')
|
|
|
}
|
|
|
|
|
|
},
|
|
|
handleOn(file, fileList) {
|
|
|
- console.log(fileList)
|
|
|
+ // console.log(fileList)
|
|
|
const isJPG = (file.type === 'image/jpeg' || file.type === 'image/png');
|
|
|
if (!isJPG) {
|
|
|
// this.$message.error('上传头像图片只能是 JPG 格式!');
|
|
|
@@ -291,25 +284,45 @@ export default {
|
|
|
},
|
|
|
submit() {
|
|
|
|
|
|
- this.$http.post({
|
|
|
- url: '/userOrder/update',
|
|
|
+
|
|
|
+ this.$http.get({
|
|
|
+ url: '/orderImage/getTotalNum',
|
|
|
data: {
|
|
|
- id: this.orderInfo.id,
|
|
|
- statusFlag: this.orderInfo.statusFlag + 1
|
|
|
+ orderId: this.orderInfo.id,
|
|
|
}
|
|
|
}).then(res => {
|
|
|
- if (res.success) {
|
|
|
+ if (res.data.totalNum != res.data.orderNum) {
|
|
|
+ this.$alert('图片数量有问题,不能上传哦!', '提示', {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ callback: action => {
|
|
|
+ this.getImage()
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ else {
|
|
|
this.$http.post({
|
|
|
- url: '/orderImage/delOssImage',
|
|
|
+ url: '/userOrder/update',
|
|
|
data: {
|
|
|
- orderId: this.orderInfo.id
|
|
|
+ id: this.orderInfo.id,
|
|
|
+ statusFlag: this.orderInfo.statusFlag + 1
|
|
|
}
|
|
|
- })
|
|
|
- this.$message.success('上传图片成功');
|
|
|
- history.back()
|
|
|
+ }).then(res => {
|
|
|
+ if (res.success) {
|
|
|
+ this.$http.post({
|
|
|
+ url: '/orderImage/delOssImage',
|
|
|
+ data: {
|
|
|
+ orderId: this.orderInfo.id
|
|
|
+ }
|
|
|
+ })
|
|
|
+ this.$message.success('上传图片成功');
|
|
|
+ history.back()
|
|
|
|
|
|
+ }
|
|
|
+ })
|
|
|
}
|
|
|
})
|
|
|
+
|
|
|
+
|
|
|
}
|
|
|
},
|
|
|
components: {
|