|
@@ -1,20 +1,33 @@
|
|
<template>
|
|
<template>
|
|
<div class="app-container">
|
|
<div class="app-container">
|
|
- <el-button type="primary" @click="openDialog(false, null)" :loading="loading">添加</el-button>
|
|
|
|
|
|
+ <el-button size="small" type="primary" @click="openDialog(false, null)" :loading="loading">添加</el-button>
|
|
<el-table :data="cooperations" style="width: 100%">
|
|
<el-table :data="cooperations" style="width: 100%">
|
|
<el-table-column type="index" width="50"></el-table-column>
|
|
<el-table-column type="index" width="50"></el-table-column>
|
|
<el-table-column label="产品图片" width="200">
|
|
<el-table-column label="产品图片" width="200">
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
- <el-image style="width: 200px; height: 200px" :src="scope.row.imageUrl"></el-image>
|
|
|
|
|
|
+ <el-image :src="scope.row.imageUrl"></el-image>
|
|
|
|
+ <!-- style="width: 200px; height: 200px" -->
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
<el-table-column prop="title" label="产品名称" width="150"></el-table-column>
|
|
<el-table-column prop="title" label="产品名称" width="150"></el-table-column>
|
|
|
|
+ <el-table-column prop="introduction" label="产品类型">
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
+ <span v-if="scope.row.type == 0">塑料产品</span>
|
|
|
|
+ <span v-else-if="scope.row.type == 1">物联网产品</span>
|
|
|
|
+ <span v-else-if="scope.row.type == 2">成品</span>
|
|
|
|
+ <span v-else-if="scope.row.type == 3">3D打印及检测服务</span>
|
|
|
|
+ <span v-else-if="scope.row.type == 4">模具和加工设备能力</span>
|
|
|
|
+ <span v-else-if="scope.row.type == 5">专利和政府政策服务</span>
|
|
|
|
+ <span v-else-if="scope.row.type == 6">融资服务</span>
|
|
|
|
+ <span v-else>未知</span>
|
|
|
|
+ </template>
|
|
|
|
+ </el-table-column>
|
|
<el-table-column prop="introduction" label="产品描述"></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 prop="address" label="产品地址" width="300"></el-table-column>
|
|
<el-table-column label="操作" width="180">
|
|
<el-table-column label="操作" width="180">
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
- <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 size="small" @click="openDialog(true, scope.$index)" :loading="loading">编辑</el-button>
|
|
|
|
+ <el-button size="small" type="danger" @click="deleteCooperation(scope.row.id)" :loading="loading">删除</el-button>
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
</el-table>
|
|
</el-table>
|
|
@@ -22,10 +35,21 @@
|
|
<!-- 添加和编辑的dialog -->
|
|
<!-- 添加和编辑的dialog -->
|
|
<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="title">
|
|
<el-input v-model="cooperationsForm.title" 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="type">
|
|
|
|
+ <el-select v-model="cooperationsForm.type" placeholder="请选择产品类型" style="width:380px">
|
|
|
|
+ <el-option label="塑料产品" :value="0"></el-option>
|
|
|
|
+ <el-option label="物联网产品" :value="1"></el-option>
|
|
|
|
+ <el-option label="成品" :value="2"></el-option>
|
|
|
|
+ <el-option label="3D打印及检测服务" :value="3"></el-option>
|
|
|
|
+ <el-option label="模具和加工设备能力" :value="4"></el-option>
|
|
|
|
+ <el-option label="专利和政府政策服务" :value="5"></el-option>
|
|
|
|
+ <el-option label="融资服务" :value="6"></el-option>
|
|
|
|
+ </el-select>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item label="产品描述" prop="introduction">
|
|
<el-input v-model="cooperationsForm.introduction" 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">
|
|
@@ -33,7 +57,7 @@
|
|
</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">
|
|
- <el-button type="primary" :loading="loading">上传一张图片</el-button>
|
|
|
|
|
|
+ <el-button size="small" type="primary" :loading="loading">上传一张图片</el-button>
|
|
</el-upload>
|
|
</el-upload>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
</el-form>
|
|
</el-form>
|
|
@@ -58,13 +82,15 @@
|
|
id: null,
|
|
id: null,
|
|
title: null,
|
|
title: null,
|
|
introduction: null,
|
|
introduction: null,
|
|
|
|
+ type: null,
|
|
address: null,
|
|
address: null,
|
|
image: null
|
|
image: null
|
|
},
|
|
},
|
|
rules: {
|
|
rules: {
|
|
title: [{ required: true, message: "请输入产品名称", trigger: "blur" }],
|
|
title: [{ required: true, message: "请输入产品名称", trigger: "blur" }],
|
|
introduction: [{ required: true, message: "请输入产品描述", trigger: "blur"}],
|
|
introduction: [{ required: true, message: "请输入产品描述", trigger: "blur"}],
|
|
- address: [{ required: true, message: "请输入产品地址", trigger: "blur"}]
|
|
|
|
|
|
+ address: [{ required: true, message: "请输入产品地址", trigger: "blur"}],
|
|
|
|
+ type: [{ required: true, message: "请选择产品类型", trigger: "change" }]
|
|
}
|
|
}
|
|
};
|
|
};
|
|
},
|
|
},
|
|
@@ -76,12 +102,14 @@
|
|
this.cooperationsForm.id = this.cooperations[index].id;
|
|
this.cooperationsForm.id = this.cooperations[index].id;
|
|
this.cooperationsForm.title = this.cooperations[index].title;
|
|
this.cooperationsForm.title = this.cooperations[index].title;
|
|
this.cooperationsForm.introduction = this.cooperations[index].introduction;
|
|
this.cooperationsForm.introduction = this.cooperations[index].introduction;
|
|
|
|
+ this.cooperationsForm.type = this.cooperations[index].type;
|
|
this.cooperationsForm.address = this.cooperations[index].address;
|
|
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.title = "";
|
|
this.cooperationsForm.title = "";
|
|
this.cooperationsForm.introduction = "";
|
|
this.cooperationsForm.introduction = "";
|
|
|
|
+ this.cooperationsForm.type = 0;
|
|
this.cooperationsForm.address = "";
|
|
this.cooperationsForm.address = "";
|
|
this.cooperationsForm.image = null;
|
|
this.cooperationsForm.image = null;
|
|
}
|
|
}
|
|
@@ -142,6 +170,7 @@
|
|
var form = new FormData();
|
|
var form = new FormData();
|
|
form.append("title", this.cooperationsForm.title);
|
|
form.append("title", this.cooperationsForm.title);
|
|
form.append("introduction", this.cooperationsForm.introduction);
|
|
form.append("introduction", this.cooperationsForm.introduction);
|
|
|
|
+ form.append("type", this.cooperationsForm.type);
|
|
form.append("address", this.cooperationsForm.address);
|
|
form.append("address", this.cooperationsForm.address);
|
|
//新增记录 并且 没有图片时
|
|
//新增记录 并且 没有图片时
|
|
if (this.cooperationsForm.image == null && this.editing == false) {
|
|
if (this.cooperationsForm.image == null && this.editing == false) {
|