|
|
@ -17,8 +17,23 @@ |
|
|
|
:wrapper-col="formItemLayout.wrapperCol" |
|
|
|
class="mb-3" |
|
|
|
label="公司名称" |
|
|
|
required |
|
|
|
> |
|
|
|
<a-input placeholder="请输入公司名称..." v-model.trim="platform.companyname" /> |
|
|
|
<a-auto-complete |
|
|
|
@search="handleSearchTasks" |
|
|
|
@select="onSelect" |
|
|
|
placeholder="公司名称" |
|
|
|
v-model="platform.companyname" |
|
|
|
> |
|
|
|
<template slot="dataSource"> |
|
|
|
<a-select-option |
|
|
|
:key="task.id" |
|
|
|
:value="`${task.id}`" |
|
|
|
v-for="task in dataSource" |
|
|
|
>{{ task.company }}</a-select-option> |
|
|
|
</template> |
|
|
|
</a-auto-complete> |
|
|
|
<!-- <a-input placeholder="请输入公司名称..." v-model.trim="platform.companyname" /> --> |
|
|
|
</a-form-item> |
|
|
|
<!-- 产品名称 --> |
|
|
|
<a-form-item |
|
|
@ -26,6 +41,7 @@ |
|
|
|
:wrapper-col="formItemLayout.wrapperCol" |
|
|
|
class="mb-3" |
|
|
|
label="产品名称" |
|
|
|
required |
|
|
|
> |
|
|
|
<a-input placeholder="请输入需求名称..." v-model.trim="platform.name" /> |
|
|
|
</a-form-item> |
|
|
@ -44,6 +60,7 @@ |
|
|
|
:wrapper-col="formItemLayout.wrapperCol" |
|
|
|
class="mb-3" |
|
|
|
label="产品图片" |
|
|
|
required |
|
|
|
> |
|
|
|
<a-upload |
|
|
|
:action="action" |
|
|
@ -67,6 +84,7 @@ |
|
|
|
:wrapper-col="formItemLayout.wrapperCol" |
|
|
|
class="mb-3" |
|
|
|
label="产品分类" |
|
|
|
required |
|
|
|
> |
|
|
|
<a-checkbox-group @change="onChange" class="line-height-30"> |
|
|
|
<a-checkbox |
|
|
@ -82,6 +100,7 @@ |
|
|
|
:wrapper-col="formItemLayout.wrapperCol" |
|
|
|
class="mb-3" |
|
|
|
label="产品简介" |
|
|
|
required |
|
|
|
> |
|
|
|
<a-textarea |
|
|
|
placeholder="请输入产品简介..." |
|
|
@ -95,6 +114,7 @@ |
|
|
|
:wrapper-col="formItemLayout.wrapperCol" |
|
|
|
class="mb-3" |
|
|
|
label="产品详情" |
|
|
|
required |
|
|
|
> |
|
|
|
<quill-editor |
|
|
|
:options="editorOption" |
|
|
@ -133,13 +153,15 @@ |
|
|
|
</a-modal> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
|
|
|
|
<script> |
|
|
|
import debounce from 'lodash/debounce'; |
|
|
|
import { mapState } from 'vuex'; |
|
|
|
import { quillEditor } from 'vue-quill-editor'; //调用编辑器 |
|
|
|
import 'quill/dist/quill.core.css'; |
|
|
|
import 'quill/dist/quill.snow.css'; |
|
|
|
import 'quill/dist/quill.bubble.css'; |
|
|
|
import { upload, addProduct, selModel } from 'config/api'; |
|
|
|
import { upload, addProduct, selModel, queryInfo } from 'config/api'; |
|
|
|
|
|
|
|
const formItemLayout = { |
|
|
|
labelCol: { span: 5 }, |
|
|
@ -176,6 +198,7 @@ export default { |
|
|
|
name: 'Enroll', |
|
|
|
components: { quillEditor }, |
|
|
|
data() { |
|
|
|
this.handleSearchTasks = debounce(this.handleSearchTasks, 500); |
|
|
|
return { |
|
|
|
form: this.$form.createForm(this, { name: 'submit' }), |
|
|
|
visible: false, |
|
|
@ -224,6 +247,7 @@ export default { |
|
|
|
}, |
|
|
|
hideMessage: null, |
|
|
|
productLists: [], // 产品类目 |
|
|
|
dataSource: [], |
|
|
|
}; |
|
|
|
}, |
|
|
|
|
|
|
@ -234,6 +258,26 @@ export default { |
|
|
|
}, |
|
|
|
|
|
|
|
methods: { |
|
|
|
// 模糊搜索 选择公司信息 |
|
|
|
async handleSearchTasks() { |
|
|
|
try { |
|
|
|
const params = { param: { company: this.platform.companyname } }; |
|
|
|
const res = await queryInfo(params); |
|
|
|
const { code, msg, data } = res.data; |
|
|
|
if (code === 200) { |
|
|
|
this.dataSource = data; |
|
|
|
} else { |
|
|
|
this.$message.error(msg); |
|
|
|
} |
|
|
|
} catch (error) { |
|
|
|
console.log(error); |
|
|
|
} |
|
|
|
}, |
|
|
|
onSelect(value) { |
|
|
|
const item = this.dataSource.find(item => item.id === +value); |
|
|
|
this.platform.companyname = item.company; |
|
|
|
}, |
|
|
|
|
|
|
|
onEditorReady(editor) { |
|
|
|
// 准备编辑器 |
|
|
|
}, |
|
|
@ -309,9 +353,33 @@ export default { |
|
|
|
this.visible = false; |
|
|
|
}, |
|
|
|
// 点击确定 |
|
|
|
handleOk() { |
|
|
|
this.subMitAdd(); |
|
|
|
// this.$message.success('发榜成功,等待审核'); |
|
|
|
async handleOk() { |
|
|
|
const { companyname, name, pic, modelIds, synopsis, needContent } = this.platform; |
|
|
|
if (!companyname) { |
|
|
|
this.$message.error('请输入公司名称'); |
|
|
|
return; |
|
|
|
} |
|
|
|
if (!name) { |
|
|
|
this.$message.error('请输入产品名称'); |
|
|
|
return; |
|
|
|
} |
|
|
|
if (!pic) { |
|
|
|
this.$message.error('请上传产品图片'); |
|
|
|
return; |
|
|
|
} |
|
|
|
if (!modelIds) { |
|
|
|
this.$message.error('请输入产品分类'); |
|
|
|
return; |
|
|
|
} |
|
|
|
if (!synopsis) { |
|
|
|
this.$message.error('请输入产品简介'); |
|
|
|
return; |
|
|
|
} |
|
|
|
if (!needContent) { |
|
|
|
this.$message.error('请输入产品详情'); |
|
|
|
return; |
|
|
|
} |
|
|
|
await this.subMitAdd(); |
|
|
|
}, |
|
|
|
handleCancel1() { |
|
|
|
this.visible1 = false; |
|
|
|