|
@@ -8,19 +8,11 @@
|
|
<el-image style="width: 200px; height: 200px" :src="scope.row.imageUrl"></el-image>
|
|
<el-image style="width: 200px; height: 200px" :src="scope.row.imageUrl"></el-image>
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
- <el-table-column prop="name" label="产品名称" width="150"></el-table-column>
|
|
|
|
- <el-table-column prop="description" label="产品描述"></el-table-column>
|
|
|
|
- <el-table-column label="产品地址" width="150">
|
|
|
|
|
|
+ <el-table-column prop="title" label="产品名称" width="150"></el-table-column>
|
|
|
|
+ <el-table-column prop="introduction" label="产品描述"></el-table-column>
|
|
|
|
+ <el-table-column prop="address" label="产品地址" width="300"></el-table-column>
|
|
|
|
+ <el-table-column label="操作" width="180">
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
- <span v-if="scope.row.type == 0">客户</span>
|
|
|
|
- <span v-else-if="scope.row.type == 1">高校</span>
|
|
|
|
- <span v-else>未知</span>
|
|
|
|
- </template>
|
|
|
|
- </el-table-column>
|
|
|
|
- <el-table-column label="操作" width="300">
|
|
|
|
- <template slot-scope="scope">
|
|
|
|
- <el-button v-if="scope.row.sticky == 0" @click="switchSticky(scope.row.id)">置顶</el-button>
|
|
|
|
- <el-button v-else @click="switchSticky(scope.row.id)" type="primary">取消置顶</el-button>
|
|
|
|
<el-button @click="openDialog(true, scope.$index)" :loading="loading">编辑</el-button>
|
|
<el-button @click="openDialog(true, scope.$index)" :loading="loading">编辑</el-button>
|
|
<el-button type="danger" @click="deleteCooperation(scope.row.id)" :loading="loading">删除</el-button>
|
|
<el-button type="danger" @click="deleteCooperation(scope.row.id)" :loading="loading">删除</el-button>
|
|
</template>
|
|
</template>
|
|
@@ -31,13 +23,13 @@
|
|
<el-dialog title="公司产品" :visible.sync="addDialogVisible" width="500px">
|
|
<el-dialog title="公司产品" :visible.sync="addDialogVisible" width="500px">
|
|
<el-form ref="form" :model="cooperationsForm" :rules="rules" label-width="80px">
|
|
<el-form ref="form" :model="cooperationsForm" :rules="rules" label-width="80px">
|
|
<el-form-item label="产品名称" prop="name">
|
|
<el-form-item label="产品名称" prop="name">
|
|
- <el-input v-model="cooperationsForm.name" placeholder="请输入产品名称" clearable></el-input>
|
|
|
|
|
|
+ <el-input v-model="cooperationsForm.title" placeholder="请输入产品名称" clearable></el-input>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
<el-form-item label="产品描述" prop="description">
|
|
<el-form-item label="产品描述" prop="description">
|
|
- <el-input v-model="cooperationsForm.description" placeholder="请输入产品描述" clearable></el-input>
|
|
|
|
|
|
+ <el-input v-model="cooperationsForm.introduction" placeholder="请输入产品描述" clearable></el-input>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
<el-form-item label="产品地址" prop="type">
|
|
<el-form-item label="产品地址" prop="type">
|
|
- <el-input v-model="cooperationsForm.type" placeholder="请输入产品地址" clearable></el-input>
|
|
|
|
|
|
+ <el-input v-model="cooperationsForm.address" placeholder="请输入产品地址" clearable></el-input>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
<el-form-item>
|
|
<el-form-item>
|
|
<el-upload ref="upload" action="customize" :http-request="uploadDiscardFile" :limit="1" :before-remove="beforeRemove">
|
|
<el-upload ref="upload" action="customize" :http-request="uploadDiscardFile" :limit="1" :before-remove="beforeRemove">
|
|
@@ -64,14 +56,15 @@
|
|
cooperations: [],
|
|
cooperations: [],
|
|
cooperationsForm: {
|
|
cooperationsForm: {
|
|
id: null,
|
|
id: null,
|
|
- name: null,
|
|
|
|
- description: null,
|
|
|
|
- type: null,
|
|
|
|
|
|
+ title: null,
|
|
|
|
+ introduction: null,
|
|
|
|
+ address: null,
|
|
image: null
|
|
image: null
|
|
},
|
|
},
|
|
rules: {
|
|
rules: {
|
|
- name: [{ required: true, message: "请输入活动名称", trigger: "blur" }],
|
|
|
|
- type: [{ required: true, message: "请选择合作方种类", trigger: "change"}]
|
|
|
|
|
|
+ title: [{ required: true, message: "请输入产品名称", trigger: "blur" }],
|
|
|
|
+ introduction: [{ required: true, message: "请输入产品描述", trigger: "blur"}],
|
|
|
|
+ address: [{ required: true, message: "请输入产品地址", trigger: "blur"}]
|
|
}
|
|
}
|
|
};
|
|
};
|
|
},
|
|
},
|
|
@@ -81,15 +74,15 @@
|
|
this.editing = isEdit;
|
|
this.editing = isEdit;
|
|
if (this.editing) {
|
|
if (this.editing) {
|
|
this.cooperationsForm.id = this.cooperations[index].id;
|
|
this.cooperationsForm.id = this.cooperations[index].id;
|
|
- this.cooperationsForm.name = this.cooperations[index].name;
|
|
|
|
- this.cooperationsForm.description = this.cooperations[index].description;
|
|
|
|
- this.cooperationsForm.type = this.cooperations[index].type;
|
|
|
|
|
|
+ this.cooperationsForm.title = this.cooperations[index].title;
|
|
|
|
+ this.cooperationsForm.introduction = this.cooperations[index].introduction;
|
|
|
|
+ this.cooperationsForm.address = this.cooperations[index].address;
|
|
this.cooperationsForm.image = null;
|
|
this.cooperationsForm.image = null;
|
|
} else {
|
|
} else {
|
|
this.cooperationsForm.id = null;
|
|
this.cooperationsForm.id = null;
|
|
- this.cooperationsForm.name = "";
|
|
|
|
- this.cooperationsForm.description = "";
|
|
|
|
- this.cooperationsForm.type = 0;
|
|
|
|
|
|
+ this.cooperationsForm.title = "";
|
|
|
|
+ this.cooperationsForm.introduction = "";
|
|
|
|
+ this.cooperationsForm.address = "";
|
|
this.cooperationsForm.image = null;
|
|
this.cooperationsForm.image = null;
|
|
}
|
|
}
|
|
this.addDialogVisible = true;
|
|
this.addDialogVisible = true;
|
|
@@ -99,11 +92,12 @@
|
|
getCooperations() {
|
|
getCooperations() {
|
|
this.loading = true;
|
|
this.loading = true;
|
|
request({
|
|
request({
|
|
- url: "/cooperations/getCooperations",
|
|
|
|
- method: "post"
|
|
|
|
|
|
+ url: "/companyproducts/companyProductsList",
|
|
|
|
+ method: "post",
|
|
|
|
+ params: {pageSize: 9999999}
|
|
})
|
|
})
|
|
.then(response => {
|
|
.then(response => {
|
|
- this.cooperations = response.data.cooperations;
|
|
|
|
|
|
+ this.cooperations = response.data.records;
|
|
this.loading = false;
|
|
this.loading = false;
|
|
})
|
|
})
|
|
.catch(error => {
|
|
.catch(error => {
|
|
@@ -118,7 +112,7 @@
|
|
//删除合作信息
|
|
//删除合作信息
|
|
deleteCooperation(id) {
|
|
deleteCooperation(id) {
|
|
request({
|
|
request({
|
|
- url: "/cooperations/deleteCooperation",
|
|
|
|
|
|
+ url: "/companyproducts/del",
|
|
method: "post",
|
|
method: "post",
|
|
params: { id: id }
|
|
params: { id: id }
|
|
})
|
|
})
|
|
@@ -146,9 +140,9 @@
|
|
if (valid) {
|
|
if (valid) {
|
|
this.loading = true;
|
|
this.loading = true;
|
|
var form = new FormData();
|
|
var form = new FormData();
|
|
- form.append("name", this.cooperationsForm.name);
|
|
|
|
- form.append("description", this.cooperationsForm.description);
|
|
|
|
- form.append("type", this.cooperationsForm.type);
|
|
|
|
|
|
+ form.append("title", this.cooperationsForm.title);
|
|
|
|
+ form.append("introduction", this.cooperationsForm.introduction);
|
|
|
|
+ form.append("address", this.cooperationsForm.address);
|
|
//新增记录 并且 没有图片时
|
|
//新增记录 并且 没有图片时
|
|
if (this.cooperationsForm.image == null && this.editing == false) {
|
|
if (this.cooperationsForm.image == null && this.editing == false) {
|
|
//如果没上传文件的话
|
|
//如果没上传文件的话
|
|
@@ -159,13 +153,13 @@
|
|
return;
|
|
return;
|
|
//有图片时
|
|
//有图片时
|
|
} else if (this.cooperationsForm.image != null) {
|
|
} else if (this.cooperationsForm.image != null) {
|
|
- form.append("multipartFile", this.cooperationsForm.image);
|
|
|
|
|
|
+ form.append("file", this.cooperationsForm.image);
|
|
}
|
|
}
|
|
if (this.cooperationsForm.id != null) {
|
|
if (this.cooperationsForm.id != null) {
|
|
form.append("id", this.cooperationsForm.id);
|
|
form.append("id", this.cooperationsForm.id);
|
|
}
|
|
}
|
|
request({
|
|
request({
|
|
- url: this.editing? "/cooperations/editCooperation" : "/cooperations/addCooperation",
|
|
|
|
|
|
+ url: "/companyproducts/addAndUpdate",
|
|
method: "post",
|
|
method: "post",
|
|
data: form
|
|
data: form
|
|
})
|
|
})
|