|
|
@@ -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">上传图片</el-button>
|
|
|
+ <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 style="float:right;margin:20px;" v-if='canSubmit&&canUploadNum==0' type="warning" class="btn" @click="submit">确定</el-button>
|
|
|
</div>
|
|
|
@@ -32,7 +32,7 @@
|
|
|
<div class="el-upload__text">将文件拖到此处,或
|
|
|
<em>点击上传</em>
|
|
|
</div>
|
|
|
- <div class="el-upload__tip" slot="tip">只能上传RGB图片类型的jpg/png文件,已上传/总张数:{{orderImage.length}} / {{orderInfo.quantity}}</div>
|
|
|
+ <div class="el-upload__tip" slot="tip">只能上传RGB图片类型的jpg/png文件,已上传/总张数:{{orderImage.length}} / {{orderInfo.quantity}} 还可以选择{{maxNum-num}}张</div>
|
|
|
</el-upload>
|
|
|
</el-dialog>
|
|
|
|
|
|
@@ -112,6 +112,13 @@ export default {
|
|
|
})
|
|
|
return list
|
|
|
},
|
|
|
+ orderImgName() {
|
|
|
+ var list = []
|
|
|
+ this.orderImage.forEach(item => {
|
|
|
+ list.push(item.imageName)
|
|
|
+ })
|
|
|
+ return list
|
|
|
+ },
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
@@ -126,7 +133,8 @@ export default {
|
|
|
tip: [],
|
|
|
realNum: 0,
|
|
|
maxNum: 0,
|
|
|
- AddImageloading: false
|
|
|
+ AddImageloading: false,
|
|
|
+ chooseName: []
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
@@ -205,7 +213,7 @@ export default {
|
|
|
|
|
|
},
|
|
|
handleError(file, fileList) {
|
|
|
- this.num = list.length
|
|
|
+ this.num = fileList.length
|
|
|
},
|
|
|
handleProgress(e, file) {
|
|
|
console.log(e, file)
|
|
|
@@ -221,10 +229,20 @@ export default {
|
|
|
// this.$message.error('上传头像图片只能是 JPG 格式!');
|
|
|
}
|
|
|
else {
|
|
|
- this.loading = true
|
|
|
- this.num++
|
|
|
+ if (this.chooseName.indexOf(file.name) != -1) {
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ if (this.orderImgName.indexOf(file.name) != -1) {
|
|
|
+ return false
|
|
|
+ }
|
|
|
+
|
|
|
+ this.chooseName.push(file.name)
|
|
|
+ }
|
|
|
|
|
|
|
|
|
+ this.loading = true
|
|
|
+ this.num++
|
|
|
}
|
|
|
|
|
|
|