|
@@ -1,12 +1,12 @@
|
|
|
<template>
|
|
<template>
|
|
|
- <div class="container">
|
|
|
|
|
|
|
+ <div class="container" v-loading='loading' element-loading-text="上传图片中,时间或许会很久,请耐心等待哦!">
|
|
|
<div class="top" v-if="orderInfo.productInfo">
|
|
<div class="top" v-if="orderInfo.productInfo">
|
|
|
<span>订单号:{{orderInfo.orderCode}}</span>
|
|
<span>订单号:{{orderInfo.orderCode}}</span>
|
|
|
<span style="margin-left:20px;">{{orderInfo.productInfo.title}}</span>
|
|
<span style="margin-left:20px;">{{orderInfo.productInfo.title}}</span>
|
|
|
<el-select v-if="!isChange" size="mini" style="float:right;margin-top:25px;width:120px" clearable v-model="unFinished" placeholder="筛选状态" @change="getImage">
|
|
<el-select v-if="!isChange" size="mini" style="float:right;margin-top:25px;width:120px" clearable v-model="unFinished" placeholder="筛选状态" @change="getImage">
|
|
|
- <el-option key="0" label="未上传" value="1">
|
|
|
|
|
|
|
+ <el-option key="1" label="未上传" value="1">
|
|
|
</el-option>
|
|
</el-option>
|
|
|
- <el-option key="1" label="已上传" value="0">
|
|
|
|
|
|
|
+ <el-option key="0" label="已上传" value="0">
|
|
|
</el-option>
|
|
</el-option>
|
|
|
</el-select>
|
|
</el-select>
|
|
|
<el-button type="primary" size="mini" style="float:right;margin-top:25px;margin-right:20px" class="btn" plain @click="dialogVisible=true,upLoadImg=[],addImage=[],num=0">批量上传</el-button>
|
|
<el-button type="primary" size="mini" style="float:right;margin-top:25px;margin-right:20px" class="btn" plain @click="dialogVisible=true,upLoadImg=[],addImage=[],num=0">批量上传</el-button>
|
|
@@ -23,7 +23,7 @@
|
|
|
<div class="imgList" style="margin-top:50px;">
|
|
<div class="imgList" style="margin-top:50px;">
|
|
|
<div class="title" style="color:#FB6E08">成<br/>片</div>
|
|
<div class="title" style="color:#FB6E08">成<br/>片</div>
|
|
|
<div style="display:inline-block;vertical-align: middle" v-for="(item,index) in orderImage">
|
|
<div style="display:inline-block;vertical-align: middle" v-for="(item,index) in orderImage">
|
|
|
- <single-upload-title v-if="!item.finishedImage||item.statusFlag==2" class="box" :nowIndex='index' :url='url' @input="changeImg" :title='"上传成片"' :width='120' :height='150'>
|
|
|
|
|
|
|
+ <single-upload-title v-if="!item.finishedImage||item.statusFlag==2" class="box" :needName='item.imageName' :nowIndex='index' :url='url' @input="changeImg" @start='loading=true' :title='"上传成片"' :width='120' :height='150'>
|
|
|
</single-upload-title>
|
|
</single-upload-title>
|
|
|
<img-item v-if="item.finishedImage" :isChange='isChange' @changeRemark="changeRemark" :label='"finishedImage"' :index='index' :img='item' :imgStyle='"storeUpload"' @delImg='getImage' style="display:inline-block;margin:0 30px 0 0;vertical-align: middle;"></img-item>
|
|
<img-item v-if="item.finishedImage" :isChange='isChange' @changeRemark="changeRemark" :label='"finishedImage"' :index='index' :img='item' :imgStyle='"storeUpload"' @delImg='getImage' style="display:inline-block;margin:0 30px 0 0;vertical-align: middle;"></img-item>
|
|
|
|
|
|
|
@@ -50,7 +50,15 @@
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
<el-dialog title="上传图片" :visible.sync="dialogVisible" width="400px" :close-on-click-modal='false'>
|
|
<el-dialog title="上传图片" :visible.sync="dialogVisible" width="400px" :close-on-click-modal='false'>
|
|
|
- <el-upload class="upload-demo" :file-list="upLoadImg" drag :action="url" multiple :before-upload="handleOn" :on-success='handleSuccess' :on-remove="handleRemove">
|
|
|
|
|
|
|
+ <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]}}请不要关闭窗口耐心等待
|
|
|
|
|
+ </template>
|
|
|
|
|
+ <template v-else>
|
|
|
|
|
+ {{tip[0]}}
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <el-upload class="upload-demo" :file-list="upLoadImg" drag :action="url" multiple :before-upload="handleOn" :on-success='handleSuccess' :on-progress='handleProgress' :on-remove="handleRemove">
|
|
|
<i class="el-icon-upload"></i>
|
|
<i class="el-icon-upload"></i>
|
|
|
<div class="el-upload__text">将文件拖到此处,或
|
|
<div class="el-upload__text">将文件拖到此处,或
|
|
|
<em>点击上传</em>
|
|
<em>点击上传</em>
|
|
@@ -58,10 +66,10 @@
|
|
|
<div class="el-upload__tip" slot="tip">只能上传jpg/png文件,当前已上传{{addImage.length}}张图片,还可以上传张</div>
|
|
<div class="el-upload__tip" slot="tip">只能上传jpg/png文件,当前已上传{{addImage.length}}张图片,还可以上传张</div>
|
|
|
</el-upload>
|
|
</el-upload>
|
|
|
|
|
|
|
|
- <span slot="footer" class="dialog-footer">
|
|
|
|
|
|
|
+ <!-- <span slot="footer" class="dialog-footer">
|
|
|
<el-button @click="dialogVisible = false">取 消</el-button>
|
|
<el-button @click="dialogVisible = false">取 消</el-button>
|
|
|
<el-button type="primary" @click="upload" :loading="isLoading">确 定</el-button>
|
|
<el-button type="primary" @click="upload" :loading="isLoading">确 定</el-button>
|
|
|
- </span>
|
|
|
|
|
|
|
+ </span> -->
|
|
|
</el-dialog>
|
|
</el-dialog>
|
|
|
|
|
|
|
|
</div>
|
|
</div>
|
|
@@ -98,6 +106,22 @@ export default {
|
|
|
this.isChange = true
|
|
this.isChange = true
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ // //获取全部修图数量
|
|
|
|
|
+ // this.$http.get({
|
|
|
|
|
+ // url: '/orderImage/page',
|
|
|
|
|
+ // data: {
|
|
|
|
|
+ // orderId: this.$route.query.orderId,
|
|
|
|
|
+ // currentPage: 1,
|
|
|
|
|
+ // pageNumber: 1,
|
|
|
|
|
+ // repairId: this.$route.query.repairId,
|
|
|
|
|
+ // }
|
|
|
|
|
+ // }).then(res => {
|
|
|
|
|
+ // if (res.success) {
|
|
|
|
|
+
|
|
|
|
|
+ // this.allNumber = res.data.page.totalNumber;
|
|
|
|
|
+ // }
|
|
|
|
|
+ // })
|
|
|
|
|
+
|
|
|
|
|
|
|
|
|
|
|
|
|
},
|
|
},
|
|
@@ -116,10 +140,18 @@ export default {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
return num
|
|
return num
|
|
|
|
|
+ },
|
|
|
|
|
+ orderImgId() {
|
|
|
|
|
+ var list = []
|
|
|
|
|
+ this.orderImage.forEach(item => {
|
|
|
|
|
+ list.push(item.id)
|
|
|
|
|
+ })
|
|
|
|
|
+ return list
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
data() {
|
|
data() {
|
|
|
return {
|
|
return {
|
|
|
|
|
+ tip: [],
|
|
|
orderInfo: {},
|
|
orderInfo: {},
|
|
|
dialogVisible: false,
|
|
dialogVisible: false,
|
|
|
addImage: [],
|
|
addImage: [],
|
|
@@ -135,13 +167,24 @@ export default {
|
|
|
notUp: 0,
|
|
notUp: 0,
|
|
|
allNumber: 0,
|
|
allNumber: 0,
|
|
|
num: 0,
|
|
num: 0,
|
|
|
- isLoading: false
|
|
|
|
|
|
|
+ isLoading: false,
|
|
|
|
|
+ loading: false
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
|
- handleOn() {
|
|
|
|
|
- this.num++
|
|
|
|
|
- this.isLoading = true
|
|
|
|
|
|
|
+ handleOn(file) {
|
|
|
|
|
+ const isJPG = (file.type === 'image/jpeg' || file.type === 'image/png');
|
|
|
|
|
+ if (!isJPG) {
|
|
|
|
|
+ // this.$message.error('上传头像图片只能是 JPG 格式!');
|
|
|
|
|
+ }
|
|
|
|
|
+ else {
|
|
|
|
|
+ this.num++
|
|
|
|
|
+ this.isLoading = true
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ return isJPG
|
|
|
},
|
|
},
|
|
|
changeRemark() {
|
|
changeRemark() {
|
|
|
if (!this.repairId) {
|
|
if (!this.repairId) {
|
|
@@ -183,7 +226,12 @@ export default {
|
|
|
pageNumber: 7,
|
|
pageNumber: 7,
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ //普通审核筛选
|
|
|
|
|
+ if (this.unFinished) {
|
|
|
|
|
+ data.unFinished = this.unFinished
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
|
|
+ //返修筛选
|
|
|
if (this.$route.query.repairId) {
|
|
if (this.$route.query.repairId) {
|
|
|
data.repairId = this.$route.query.repairId
|
|
data.repairId = this.$route.query.repairId
|
|
|
if (data.unFinished == '1') {
|
|
if (data.unFinished == '1') {
|
|
@@ -206,8 +254,11 @@ export default {
|
|
|
if (res.success) {
|
|
if (res.success) {
|
|
|
this.orderImage = res.data.pp
|
|
this.orderImage = res.data.pp
|
|
|
this.totalNumber = res.data.page.totalNumber;
|
|
this.totalNumber = res.data.page.totalNumber;
|
|
|
|
|
+ this.allNumber = res.data.page.totalNumber;
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
|
|
+
|
|
|
|
|
+ //未上传数量
|
|
|
this.$http.get({
|
|
this.$http.get({
|
|
|
url: '/orderImage/all',
|
|
url: '/orderImage/all',
|
|
|
data: {
|
|
data: {
|
|
@@ -220,20 +271,7 @@ export default {
|
|
|
this.notUp = res.data.length
|
|
this.notUp = res.data.length
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
- this.$http.get({
|
|
|
|
|
- url: '/orderImage/page',
|
|
|
|
|
- data: {
|
|
|
|
|
- orderId: this.$route.query.orderId,
|
|
|
|
|
- currentPage: 1,
|
|
|
|
|
- pageNumber: 1,
|
|
|
|
|
- repairId: this.$route.query.repairId,
|
|
|
|
|
- }
|
|
|
|
|
- }).then(res => {
|
|
|
|
|
- if (res.success) {
|
|
|
|
|
|
|
|
|
|
- this.allNumber = res.data.page.totalNumber;
|
|
|
|
|
- }
|
|
|
|
|
- })
|
|
|
|
|
},
|
|
},
|
|
|
chooseImg(index) {
|
|
chooseImg(index) {
|
|
|
console.log(index)
|
|
console.log(index)
|
|
@@ -253,13 +291,37 @@ export default {
|
|
|
this.addImage = list
|
|
this.addImage = list
|
|
|
this.num = this.addImage.length
|
|
this.num = this.addImage.length
|
|
|
},
|
|
},
|
|
|
- handleSuccess(res) {
|
|
|
|
|
- res.data.forEach(item => {
|
|
|
|
|
- this.addImage.push(item)
|
|
|
|
|
|
|
+ handleProgress(e, file) {
|
|
|
|
|
+ if (e.percent == 100) {
|
|
|
|
|
+ this.tip.splice(0, 0, file.name + '文件正在压缩')
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ handleSuccess(res, flie) {
|
|
|
|
|
+ console.log(res)
|
|
|
|
|
+ var tips = [...this.tip]
|
|
|
|
|
+ tips.forEach((item, index) => {
|
|
|
|
|
+ var list = item.split('文件正在压缩')
|
|
|
|
|
+ if (list[0] === flie.name) {
|
|
|
|
|
+ tips.splice(index, 1)
|
|
|
|
|
+ }
|
|
|
})
|
|
})
|
|
|
- if (this.num == this.addImage.length) {
|
|
|
|
|
- this.isLoading = false
|
|
|
|
|
|
|
+ tips.splice(0, 0, flie.name + '文件上传成功')
|
|
|
|
|
+ this.tip = tips
|
|
|
|
|
+ setTimeout(() => {
|
|
|
|
|
+ var tips = [...this.tip]
|
|
|
|
|
+ tips.forEach((item, index) => {
|
|
|
|
|
+ if (item.indexOf('文件上传成功') != -1) {
|
|
|
|
|
+ tips.splice(index, 1)
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ this.tip = tips
|
|
|
|
|
+ }, 1000)
|
|
|
|
|
+ if (res.success) {
|
|
|
|
|
+ if (this.orderImgId.indexOf(res.data[0].id) != -1) {
|
|
|
|
|
+ this.orderImage.splice(this.orderImgId.indexOf(res.data[0].id), 1, res.data[0])
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
},
|
|
},
|
|
|
delImg(index) {
|
|
delImg(index) {
|
|
|
this.addImage.splice(index, 1)
|
|
this.addImage.splice(index, 1)
|
|
@@ -324,7 +386,7 @@ export default {
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
if (this.$route.query.repairId) {
|
|
if (this.$route.query.repairId) {
|
|
|
- if (this.orderInfo.orderRepairList.length == 3) {
|
|
|
|
|
|
|
+ if (this.orderInfo.orderRepairList.length == 3 && this.orderInfo.orderRepairList[this.orderInfo.orderRepairList.length - 1].typeFlag == 2) {
|
|
|
this.$http.post({
|
|
this.$http.post({
|
|
|
url: '/orderRepair/update',
|
|
url: '/orderRepair/update',
|
|
|
data: {
|
|
data: {
|
|
@@ -337,15 +399,27 @@ export default {
|
|
|
url: '/userOrder/update',
|
|
url: '/userOrder/update',
|
|
|
data: {
|
|
data: {
|
|
|
id: this.orderInfo.id,
|
|
id: this.orderInfo.id,
|
|
|
- statusFlag: 5
|
|
|
|
|
|
|
+ statusFlag: 3
|
|
|
}
|
|
}
|
|
|
}).then(res2 => {
|
|
}).then(res2 => {
|
|
|
if (res2.success) {
|
|
if (res2.success) {
|
|
|
- this.$message.success('提交成功');
|
|
|
|
|
- history.back()
|
|
|
|
|
-
|
|
|
|
|
|
|
+ // this.$message.success('提交成功');
|
|
|
|
|
+ // history.back()
|
|
|
|
|
+
|
|
|
|
|
+ this.$http.post({
|
|
|
|
|
+ url: '/userOrder/confirm',
|
|
|
|
|
+ data: {
|
|
|
|
|
+ id: this.orderInfo.id,
|
|
|
|
|
+ }
|
|
|
|
|
+ }).then(res3 => {
|
|
|
|
|
+ if (res3.success) {
|
|
|
|
|
+ this.$message.success('提交成功');
|
|
|
|
|
+ history.back()
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
}
|
|
}
|
|
@@ -384,7 +458,9 @@ export default {
|
|
|
|
|
|
|
|
},
|
|
},
|
|
|
changeImg(newVal) {
|
|
changeImg(newVal) {
|
|
|
- this.updateImg(newVal.index, newVal.img.url, newVal.img.imageSize, newVal.artworkUrl)
|
|
|
|
|
|
|
+ this.$message.success('提交成功');
|
|
|
|
|
+ this.loading = false
|
|
|
|
|
+ this.getImage()
|
|
|
},
|
|
},
|
|
|
updateImg(index, img, size, artworkUrl) {
|
|
updateImg(index, img, size, artworkUrl) {
|
|
|
this.$http.post({
|
|
this.$http.post({
|
|
@@ -399,7 +475,7 @@ export default {
|
|
|
}).then(res => {
|
|
}).then(res => {
|
|
|
if (res.success) {
|
|
if (res.success) {
|
|
|
this.getImage()
|
|
this.getImage()
|
|
|
- this.$message.success('提交成功');
|
|
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
}
|
|
}
|