|
|
@@ -13,8 +13,8 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="bodyArea">
|
|
|
- <div class="statusBox" :class="{none: true}">
|
|
|
- <p>{{'已入驻'}}</p>
|
|
|
+ <div class="statusBox" :class="{none: !(statusObj.isOk)}">
|
|
|
+ <p>{{statusObj.name}}</p>
|
|
|
</div>
|
|
|
|
|
|
<div class="nameBox">
|
|
|
@@ -244,6 +244,17 @@
|
|
|
this.getDraftInfo()
|
|
|
this.getTypeList()
|
|
|
},
|
|
|
+ computed: {
|
|
|
+ statusObj() {
|
|
|
+ let status = Number(this.data.status || 0)
|
|
|
+ let nameList = ['未申请', '审核中', '已入驻', '拒绝']
|
|
|
+ let o = {
|
|
|
+ isOk: status === 2,
|
|
|
+ name: nameList[status]
|
|
|
+ }
|
|
|
+ return o
|
|
|
+ }
|
|
|
+ },
|
|
|
async mounted() {
|
|
|
},
|
|
|
methods: {
|
|
|
@@ -308,10 +319,13 @@
|
|
|
formData.append("file", file);
|
|
|
formData.append("original_filename", file.name);
|
|
|
this.uploading = true;
|
|
|
- this.apiPrepareUpload(file, (res, baseUrl)=>{
|
|
|
- if (res.code === 200) {
|
|
|
- this.dataItem.file = baseUrl + res.url
|
|
|
- this.fileList = [{name:file.name, url: this.dataItem.file}]
|
|
|
+ this.apiPrepareUpload(file, (res)=>{
|
|
|
+ if (res.data && res.data.status === 1) {
|
|
|
+ let url = res.data.data.url
|
|
|
+ this.dataItem.file = url
|
|
|
+ this.fileList = [{name:file.name, url: url}]
|
|
|
+ } else {
|
|
|
+ this.$message.error('上传失败')
|
|
|
}
|
|
|
})
|
|
|
return false
|
|
|
@@ -382,7 +396,7 @@
|
|
|
}
|
|
|
}
|
|
|
p.provider_id = this.data.id
|
|
|
-
|
|
|
+ console.log("添加案例", this.dataItem, p)
|
|
|
let isEdit = !!p.id
|
|
|
if (!p.title || p.title.length < 2 || p.title.length > 20) {
|
|
|
this.$message.warning('请填写2-20字符的案例名称!')
|
|
|
@@ -404,7 +418,11 @@
|
|
|
this.$axios.post(url, p).then(res => {
|
|
|
if (Number(res.data.status) === 1) {
|
|
|
this.dataItem.id = 4
|
|
|
- this.data.successful_case.push(this.dataItem)
|
|
|
+ if (!isEdit) {
|
|
|
+ this.data.successful_case.push(this.dataItem)
|
|
|
+ } else {
|
|
|
+ this.getDraftInfo()
|
|
|
+ }
|
|
|
this.dataItem = {
|
|
|
provider_id: 0, title: '', logo: '', description: '', file: '',
|
|
|
}
|
|
|
@@ -468,6 +486,7 @@
|
|
|
this.$message.success('保存成功')
|
|
|
} else {
|
|
|
this.$message.success('发布成功')
|
|
|
+ location.href = "/wo/" + this.$store.state.userinfo.uid
|
|
|
}
|
|
|
}
|
|
|
})
|