|
|
|
@ -1,112 +1,148 @@ |
|
|
|
|
<template> |
|
|
|
|
<div> |
|
|
|
|
<el-card shadow="hover" class="mgb20"> |
|
|
|
|
<el-card shadow="hover" |
|
|
|
|
class="mgb20"> |
|
|
|
|
<div class="flex-between"> |
|
|
|
|
<div class="per_title" v-preventReClick @click="back"> |
|
|
|
|
<div class="per_title" |
|
|
|
|
v-preventReClick |
|
|
|
|
@click="back"> |
|
|
|
|
<i class="el-icon-arrow-left"></i> |
|
|
|
|
<span class="per_back">返回</span> |
|
|
|
|
<span class="per_school" v-text="form.id ? '编辑方案' : '新建方案'"></span> |
|
|
|
|
<span class="per_school" |
|
|
|
|
v-text="form.id ? '编辑方案' : '新建方案'"></span> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
</el-card> |
|
|
|
|
<div class="page"> |
|
|
|
|
<el-form :model="form" :rules="rules" class="input-form model" label-width="140px"> |
|
|
|
|
<el-form :model="form" |
|
|
|
|
:rules="rules" |
|
|
|
|
class="input-form model" |
|
|
|
|
label-width="140px"> |
|
|
|
|
<div class="item-line"> |
|
|
|
|
<el-form-item prop="title" label="标题"> |
|
|
|
|
<el-input |
|
|
|
|
placeholder="请输入标题" |
|
|
|
|
<el-form-item prop="title" |
|
|
|
|
label="标题"> |
|
|
|
|
<el-input placeholder="请输入标题" |
|
|
|
|
v-model.trim="form.title" |
|
|
|
|
clearable |
|
|
|
|
maxlength="30" |
|
|
|
|
class="inline-input" |
|
|
|
|
></el-input> |
|
|
|
|
class="inline-input"></el-input> |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item prop="classificationId" label="所属分类"> |
|
|
|
|
<el-select style="width: 234px;" v-model="form.classificationId"> |
|
|
|
|
<el-form-item prop="classificationId" |
|
|
|
|
label="所属分类"> |
|
|
|
|
<el-select style="width: 234px;" |
|
|
|
|
v-model="form.classificationId"> |
|
|
|
|
<template v-for="item in classifications"> |
|
|
|
|
<el-option |
|
|
|
|
v-if="item.id" |
|
|
|
|
<el-option v-if="item.id" |
|
|
|
|
:key="item.id" |
|
|
|
|
:label="item.classificationName" |
|
|
|
|
:value="item.id"> |
|
|
|
|
</el-option> |
|
|
|
|
</template> |
|
|
|
|
</el-select> |
|
|
|
|
<el-button class="set-btn" type="primary" @click="setClass">设置</el-button> |
|
|
|
|
<el-button class="set-btn" |
|
|
|
|
type="primary" |
|
|
|
|
@click="setClass">设置</el-button> |
|
|
|
|
</el-form-item> |
|
|
|
|
</div> |
|
|
|
|
<el-form-item prop="applicableMajor" label="适用专业"> |
|
|
|
|
<el-input |
|
|
|
|
style="width: 940px" |
|
|
|
|
<el-form-item prop="applicableMajor" |
|
|
|
|
label="适用专业"> |
|
|
|
|
<el-input style="width: 940px" |
|
|
|
|
type="textarea" |
|
|
|
|
v-model.trim="form.applicableMajor" |
|
|
|
|
:rows="3" |
|
|
|
|
clearable |
|
|
|
|
></el-input> |
|
|
|
|
clearable></el-input> |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item prop="schemeIntroduction" label="方案简介"> |
|
|
|
|
<el-input |
|
|
|
|
style="width: 940px" |
|
|
|
|
<el-form-item prop="schemeIntroduction" |
|
|
|
|
label="方案简介"> |
|
|
|
|
<el-input style="width: 940px" |
|
|
|
|
type="textarea" |
|
|
|
|
v-model.trim="form.schemeIntroduction" |
|
|
|
|
:rows="3" |
|
|
|
|
clearable |
|
|
|
|
></el-input> |
|
|
|
|
clearable></el-input> |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item prop="product" label="产品"> |
|
|
|
|
<el-input |
|
|
|
|
style="width: 940px" |
|
|
|
|
type="textarea" |
|
|
|
|
v-model.trim="form.product" |
|
|
|
|
:rows="3" |
|
|
|
|
clearable |
|
|
|
|
></el-input> |
|
|
|
|
<el-form-item prop="product" |
|
|
|
|
label="产品"> |
|
|
|
|
<el-button style="margin-bottom: 5px" |
|
|
|
|
type="primary" |
|
|
|
|
@click="showProduct">请选择</el-button> |
|
|
|
|
<div> |
|
|
|
|
<el-tag v-for="(tag, i) in form.productList" |
|
|
|
|
:key="i" |
|
|
|
|
class="tag" |
|
|
|
|
closable |
|
|
|
|
@close="delCheckedProduct(i)"> |
|
|
|
|
{{tag.productName}} |
|
|
|
|
</el-tag> |
|
|
|
|
</div> |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item prop="schemeFile" label="方案文件"> |
|
|
|
|
<el-upload |
|
|
|
|
:before-upload="fileBeforeUpload" |
|
|
|
|
<el-form-item prop="schemeFile" |
|
|
|
|
label="方案文件"> |
|
|
|
|
<el-upload :before-upload="fileBeforeUpload" |
|
|
|
|
:on-success="uploadSuccessFile" |
|
|
|
|
:action="this.api.fileUploadNakadai" |
|
|
|
|
:file-list="fileList" |
|
|
|
|
:limit="1" |
|
|
|
|
:on-exceed="handleExceed" |
|
|
|
|
:headers="headers" |
|
|
|
|
> |
|
|
|
|
:headers="headers"> |
|
|
|
|
<el-button>上传</el-button> |
|
|
|
|
</el-upload> |
|
|
|
|
</el-form-item> |
|
|
|
|
</el-form> |
|
|
|
|
<div class="btns"> |
|
|
|
|
<el-button type="primary" @click="submit(1)">发布</el-button> |
|
|
|
|
<el-button type="primary" |
|
|
|
|
@click="submit(1)">发布</el-button> |
|
|
|
|
<el-button @click="submit(0)">保存草稿</el-button> |
|
|
|
|
<el-button @click="back">取消</el-button> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
<el-dialog title="所属分类设置" :visible.sync="classVisible" width="500px" :close-on-click-modal="false" class="manage-dia" :before-close="closeClass"> |
|
|
|
|
<el-dialog title="所属分类设置" |
|
|
|
|
:visible.sync="classVisible" |
|
|
|
|
width="500px" |
|
|
|
|
:close-on-click-modal="false" |
|
|
|
|
class="manage-dia" |
|
|
|
|
:before-close="closeClass"> |
|
|
|
|
<div class="plus"> |
|
|
|
|
<i class="el-icon-circle-plus-outline" @click="addClass"></i> |
|
|
|
|
<i class="el-icon-circle-plus-outline" |
|
|
|
|
@click="addClass"></i> |
|
|
|
|
</div> |
|
|
|
|
<el-table :data="classifications" ref="table" header-align="center" row-key="id"> |
|
|
|
|
<el-table-column type="index" width="60" label="序号" align="center"></el-table-column> |
|
|
|
|
<el-table-column prop="classificationName" label="分类名称" align="center" min-width="130"> |
|
|
|
|
<el-table :data="classifications" |
|
|
|
|
ref="table" |
|
|
|
|
header-align="center" |
|
|
|
|
row-key="id"> |
|
|
|
|
<el-table-column type="index" |
|
|
|
|
width="60" |
|
|
|
|
label="序号" |
|
|
|
|
align="center"></el-table-column> |
|
|
|
|
<el-table-column prop="classificationName" |
|
|
|
|
label="分类名称" |
|
|
|
|
align="center" |
|
|
|
|
min-width="130"> |
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
<el-input |
|
|
|
|
v-if="scope.row.edit" |
|
|
|
|
<el-input v-if="scope.row.edit" |
|
|
|
|
placeholder="请输入分类名称" |
|
|
|
|
v-model="scope.row.classificationName" |
|
|
|
|
clearable |
|
|
|
|
maxlength="30" |
|
|
|
|
></el-input> |
|
|
|
|
maxlength="30"></el-input> |
|
|
|
|
<span v-else>{{ scope.row.classificationName }}</span> |
|
|
|
|
</template> |
|
|
|
|
</el-table-column> |
|
|
|
|
<el-table-column prop="updateTime1" label="是否引用" align="center" min-width="60">否</el-table-column> |
|
|
|
|
<el-table-column label="操作" align="center" min-width="60"> |
|
|
|
|
<el-table-column prop="updateTime1" |
|
|
|
|
label="是否引用" |
|
|
|
|
align="center" |
|
|
|
|
min-width="60">否</el-table-column> |
|
|
|
|
<el-table-column label="操作" |
|
|
|
|
align="center" |
|
|
|
|
min-width="60"> |
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
<i v-if="scope.row.edit" class="el-icon-check edit" @click="submitClass(scope.row)"></i> |
|
|
|
|
<i v-else class="el-icon-edit edit" @click="editClass(scope.row)"></i> |
|
|
|
|
<i class="el-icon-delete del" @click="delClass(scope.row, scope.$index)"></i> |
|
|
|
|
<i v-if="scope.row.edit" |
|
|
|
|
class="el-icon-check edit" |
|
|
|
|
@click="submitClass(scope.row)"></i> |
|
|
|
|
<i v-else |
|
|
|
|
class="el-icon-edit edit" |
|
|
|
|
@click="editClass(scope.row)"></i> |
|
|
|
|
<i class="el-icon-delete del" |
|
|
|
|
@click="delClass(scope.row, scope.$index)"></i> |
|
|
|
|
</template> |
|
|
|
|
</el-table-column> |
|
|
|
|
</el-table> |
|
|
|
@ -114,6 +150,112 @@ |
|
|
|
|
<el-button @click="closeClass">返回</el-button> |
|
|
|
|
</span> |
|
|
|
|
</el-dialog> |
|
|
|
|
|
|
|
|
|
<el-dialog :visible.sync="productVisible" |
|
|
|
|
width="1200px" |
|
|
|
|
center |
|
|
|
|
custom-class="product-dia"> |
|
|
|
|
<div class="product-wrap"> |
|
|
|
|
<div class="item type"> |
|
|
|
|
<div class="title-wrap flex-center"> |
|
|
|
|
<p class="addhr_tag"></p> |
|
|
|
|
<span>产品分类</span> |
|
|
|
|
</div> |
|
|
|
|
<ul class="types"> |
|
|
|
|
<li v-for="(item, i) in productCategories" |
|
|
|
|
:key="i" |
|
|
|
|
:class="{active: curType == item.classificationId}" |
|
|
|
|
@click="typeClick(item)"> |
|
|
|
|
{{ item.classificationName }} |
|
|
|
|
</li> |
|
|
|
|
</ul> |
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
<div class="item products"> |
|
|
|
|
<div class="title-wrap flex-center"> |
|
|
|
|
<p class="addhr_tag"></p> |
|
|
|
|
<span>产品列表</span> |
|
|
|
|
</div> |
|
|
|
|
<el-input class="mgb10" |
|
|
|
|
placeholder="请输入产品名称" |
|
|
|
|
prefix-icon="el-icon-search" |
|
|
|
|
v-model.trim="keyword" |
|
|
|
|
clearable></el-input> |
|
|
|
|
<el-table :data="products" |
|
|
|
|
class="table" |
|
|
|
|
ref="table" |
|
|
|
|
stripe |
|
|
|
|
header-align="center" |
|
|
|
|
max-height="470" |
|
|
|
|
@selection-change="handleSelectionChange" |
|
|
|
|
row-key="mallId"> |
|
|
|
|
<el-table-column type="selection" |
|
|
|
|
width="55" |
|
|
|
|
align="center" |
|
|
|
|
:reserve-selection="true"></el-table-column> |
|
|
|
|
<el-table-column type="index" |
|
|
|
|
width="55" |
|
|
|
|
label="序号" |
|
|
|
|
align="center"></el-table-column> |
|
|
|
|
<el-table-column prop="productName" |
|
|
|
|
label="产品名称" |
|
|
|
|
align="center"></el-table-column> |
|
|
|
|
<el-table-column prop="supplierName" |
|
|
|
|
label="厂商" |
|
|
|
|
align="center"></el-table-column> |
|
|
|
|
</el-table> |
|
|
|
|
<div class="pagination"> |
|
|
|
|
<el-pagination background |
|
|
|
|
layout="total, prev, pager, next" |
|
|
|
|
:total="total" |
|
|
|
|
@current-change="handleCurrentChange" |
|
|
|
|
:current-page="page"> |
|
|
|
|
</el-pagination> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
<div class="item checked"> |
|
|
|
|
<div class="title-wrap flex-center"> |
|
|
|
|
<p class="addhr_tag"></p> |
|
|
|
|
<span>已选择产品({{ checkeds.length }}个)</span> |
|
|
|
|
</div> |
|
|
|
|
<el-table :data="checkeds" |
|
|
|
|
class="table" |
|
|
|
|
stripe |
|
|
|
|
header-align="center" |
|
|
|
|
max-height="470"> |
|
|
|
|
<el-table-column type="index" |
|
|
|
|
width="55" |
|
|
|
|
label="序号" |
|
|
|
|
align="center"></el-table-column> |
|
|
|
|
<el-table-column prop="productName" |
|
|
|
|
label="产品名称" |
|
|
|
|
align="center"></el-table-column> |
|
|
|
|
<el-table-column prop="supplierName" |
|
|
|
|
label="厂商" |
|
|
|
|
align="center"></el-table-column> |
|
|
|
|
<el-table-column prop="typeName" |
|
|
|
|
label="产品类型" |
|
|
|
|
align="center"></el-table-column> |
|
|
|
|
<el-table-column label="操作" |
|
|
|
|
align="center" |
|
|
|
|
width="55"> |
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
<i :class="['el-icon-delete rm', {disabled: scope.row.disabled}]" |
|
|
|
|
@click="delProduct(scope.$index, scope.row)"></i> |
|
|
|
|
</template> |
|
|
|
|
</el-table-column> |
|
|
|
|
</el-table> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
<span slot="footer" |
|
|
|
|
class="dialog-footer"> |
|
|
|
|
<el-button @click="productVisible = false">取 消</el-button> |
|
|
|
|
<el-button type="primary" |
|
|
|
|
@click="productSubmit">确 定</el-button> |
|
|
|
|
</span> |
|
|
|
|
</el-dialog> |
|
|
|
|
</div> |
|
|
|
|
</template> |
|
|
|
|
<script> |
|
|
|
@ -124,7 +266,7 @@ import editorConfig from '@/utils/editor' |
|
|
|
|
import Cropper from '@/components/img-upload/Cropper' |
|
|
|
|
import Axios from 'axios' |
|
|
|
|
export default { |
|
|
|
|
data() { |
|
|
|
|
data () { |
|
|
|
|
return { |
|
|
|
|
headers: { |
|
|
|
|
token: sessionStorage.getItem('token') |
|
|
|
@ -134,7 +276,7 @@ export default { |
|
|
|
|
id: this.$route.query.id || '', |
|
|
|
|
applicableMajor: '', |
|
|
|
|
classificationId: '', |
|
|
|
|
product: '', |
|
|
|
|
productList: [], |
|
|
|
|
fileName: '', |
|
|
|
|
schemeFile: '', |
|
|
|
|
title: '', |
|
|
|
@ -173,7 +315,19 @@ export default { |
|
|
|
|
classifications: [], |
|
|
|
|
classVisible: false, |
|
|
|
|
labels: [], |
|
|
|
|
labelVisible: false |
|
|
|
|
labelVisible: false, |
|
|
|
|
|
|
|
|
|
productVisible: false, |
|
|
|
|
productCategories: [], |
|
|
|
|
curType: 1, |
|
|
|
|
checkeds: [], |
|
|
|
|
total: 0, |
|
|
|
|
page: 1, |
|
|
|
|
pageSize: 10, |
|
|
|
|
products: [], |
|
|
|
|
multipleSelection: [], |
|
|
|
|
keyword: '', |
|
|
|
|
loading: false, |
|
|
|
|
}; |
|
|
|
|
}, |
|
|
|
|
components: { |
|
|
|
@ -183,14 +337,20 @@ export default { |
|
|
|
|
watch: { |
|
|
|
|
// 监听信息是否有更改,有的话页面离开的时候要询问是否要保存 |
|
|
|
|
form: { |
|
|
|
|
handler(val){ |
|
|
|
|
handler (val) { |
|
|
|
|
this.updateTime++ |
|
|
|
|
}, |
|
|
|
|
deep:true |
|
|
|
|
deep: true |
|
|
|
|
}, |
|
|
|
|
keyword: function (val) { |
|
|
|
|
clearTimeout(this.searchTimer); |
|
|
|
|
this.searchTimer = setTimeout(() => { |
|
|
|
|
this.initData(); |
|
|
|
|
}, 500); |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
// 页面离开的时候如果没有保存则提示 |
|
|
|
|
beforeRouteLeave(to, from, next) { |
|
|
|
|
beforeRouteLeave (to, from, next) { |
|
|
|
|
if (this.submiting) { |
|
|
|
|
next() |
|
|
|
|
} else if (!this.pass) { |
|
|
|
@ -210,21 +370,22 @@ export default { |
|
|
|
|
next() |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
mounted() { |
|
|
|
|
mounted () { |
|
|
|
|
this.getArticle() |
|
|
|
|
}, |
|
|
|
|
methods: { |
|
|
|
|
// 详情 |
|
|
|
|
getArticle() { |
|
|
|
|
getArticle () { |
|
|
|
|
const { id } = this.form |
|
|
|
|
id ? this.$post(`${this.api.findByIdScheme}?id=${id}`).then(({ data }) => { |
|
|
|
|
if (data.schemeFile) this.fileList = [{name: data.fileName, url: data.schemeFile}] |
|
|
|
|
if (data.schemeFile) this.fileList = [{ name: data.fileName, url: data.schemeFile }] |
|
|
|
|
if (!data.productList) data.productList = [] |
|
|
|
|
this.form = data |
|
|
|
|
this.getClassification(1) |
|
|
|
|
}).catch(err => {}) : this.getClassification(1) |
|
|
|
|
}).catch(err => { }) : this.getClassification(1) |
|
|
|
|
}, |
|
|
|
|
// 获取所属分类 |
|
|
|
|
getClassification(detail) { |
|
|
|
|
getClassification (detail) { |
|
|
|
|
this.$post(`${this.api.queryClassificationByType}?typeId=3`).then(({ data }) => { |
|
|
|
|
this.classifications = data |
|
|
|
|
// 如果所选分类被删除,则清空分类id |
|
|
|
@ -235,14 +396,14 @@ export default { |
|
|
|
|
this.updateTime = 0 |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
}).catch(err => {}) |
|
|
|
|
}).catch(err => { }) |
|
|
|
|
}, |
|
|
|
|
// 显示所属分类弹框 |
|
|
|
|
setClass() { |
|
|
|
|
setClass () { |
|
|
|
|
this.classVisible = true |
|
|
|
|
}, |
|
|
|
|
// 新增所属分类 |
|
|
|
|
addClass() { |
|
|
|
|
addClass () { |
|
|
|
|
this.classifications.push({ |
|
|
|
|
edit: true, |
|
|
|
|
id: '', |
|
|
|
@ -250,11 +411,11 @@ export default { |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
// 编辑所属分类 |
|
|
|
|
editClass(row) { |
|
|
|
|
editClass (row) { |
|
|
|
|
this.$set(row, 'edit', 1) |
|
|
|
|
}, |
|
|
|
|
// 删除所属分类 |
|
|
|
|
delClass(row, i) { |
|
|
|
|
delClass (row, i) { |
|
|
|
|
if (row.id) { |
|
|
|
|
this.$confirm('确定要删除吗?', '提示', { |
|
|
|
|
type: 'warning' |
|
|
|
@ -262,14 +423,14 @@ export default { |
|
|
|
|
this.$post(`${this.api.batchDeletionParnerClass}?ids=${row.id}`).then(res => { |
|
|
|
|
Util.successMsg('删除成功') |
|
|
|
|
this.getClassification() |
|
|
|
|
}).catch(res => {}) |
|
|
|
|
}).catch(() => {}) |
|
|
|
|
}).catch(res => { }) |
|
|
|
|
}).catch(() => { }) |
|
|
|
|
} else { |
|
|
|
|
this.classifications.splice(i, 1) |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
// 提交所属分类 |
|
|
|
|
submitClass(row, showMsg = 1) { |
|
|
|
|
submitClass (row, showMsg = 1) { |
|
|
|
|
if (!row.classificationName) return Util.errorMsg('请输入分类名称') |
|
|
|
|
this.$post(`${this.api.checkForHeavyParnerClass}?classificationName=${row.classificationName}&typeId=1&classificationId=${row.id}`).then(res => { |
|
|
|
|
this.$post(this.api[row.id ? 'updateParnerClass' : 'saveParnerClass'], { |
|
|
|
@ -279,11 +440,11 @@ export default { |
|
|
|
|
}).then(res => { |
|
|
|
|
showMsg && Util.successMsg((row.id ? '修改' : '新增') + '成功') |
|
|
|
|
this.getClassification() |
|
|
|
|
}).catch(res => {}) |
|
|
|
|
}).catch(res => {}) |
|
|
|
|
}).catch(res => { }) |
|
|
|
|
}).catch(res => { }) |
|
|
|
|
}, |
|
|
|
|
// 关闭所属分类 |
|
|
|
|
closeClass() { |
|
|
|
|
closeClass () { |
|
|
|
|
const list = this.classifications |
|
|
|
|
if (list.find(e => e.edit && e.classificationName)) { |
|
|
|
|
this.$confirm('所填写内容暂未保存,是否保存?', '提示', { |
|
|
|
@ -303,23 +464,108 @@ export default { |
|
|
|
|
if (!list.find(e => e.id == this.form.classificationId)) this.form.classificationId = '' |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 选择产品 |
|
|
|
|
showProduct () { |
|
|
|
|
// this.multipleSelection = this.form.productList |
|
|
|
|
this.getCategory() |
|
|
|
|
this.checkeds = [] |
|
|
|
|
// debugger |
|
|
|
|
this.productVisible = true |
|
|
|
|
this.page = 1 |
|
|
|
|
this.getProduct(1) |
|
|
|
|
}, |
|
|
|
|
// 获取产品分类 |
|
|
|
|
async getCategory () { |
|
|
|
|
const res = await this.$get(this.api.productCategoryList) |
|
|
|
|
this.productCategories = res.classificationList |
|
|
|
|
}, |
|
|
|
|
// 产品分类点击回调 |
|
|
|
|
typeClick (item) { |
|
|
|
|
// this.$refs.table.clearSelection() |
|
|
|
|
this.curType = item.classificationId |
|
|
|
|
console.log("🚀 ~ file: schemeSet.vue:472 ~ typeClick ~ curType:", this.checkeds) |
|
|
|
|
this.initData() |
|
|
|
|
}, |
|
|
|
|
// 产品列表 |
|
|
|
|
async getProduct (set) { |
|
|
|
|
const { page } = await this.$post(this.api.listOfGoods, { |
|
|
|
|
pageNum: this.page, |
|
|
|
|
pageSize: this.pageSize, |
|
|
|
|
productClassification: this.curType, |
|
|
|
|
hotTag: 1, |
|
|
|
|
sort: 0, |
|
|
|
|
isShelves: 0, |
|
|
|
|
productName: this.keyword |
|
|
|
|
}) |
|
|
|
|
this.products = page.records |
|
|
|
|
this.total = page.total |
|
|
|
|
|
|
|
|
|
if (set) { |
|
|
|
|
const { table } = this.$refs |
|
|
|
|
table.clearSelection() |
|
|
|
|
this.form.productList.forEach(e => { |
|
|
|
|
table.toggleRowSelection(e, true) |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
initData () { |
|
|
|
|
this.page = 1 |
|
|
|
|
this.getProduct() |
|
|
|
|
}, |
|
|
|
|
handleCurrentChange (val) { |
|
|
|
|
this.page = val; |
|
|
|
|
this.getData(); |
|
|
|
|
}, |
|
|
|
|
handleSelectionChange (val) { |
|
|
|
|
console.log("🚀 ~ file: schemeSet.vue:516 ~ handleSelectionChange ~ val:", val) |
|
|
|
|
this.checkeds = JSON.parse(JSON.stringify(val)) |
|
|
|
|
this.multipleSelection = val |
|
|
|
|
}, |
|
|
|
|
// 删除已选产品 |
|
|
|
|
delProduct (i, row) { |
|
|
|
|
this.$confirm("确定要删除吗?", "提示", { |
|
|
|
|
type: "warning" |
|
|
|
|
}).then(() => { |
|
|
|
|
this.checkeds.splice(i, 1) |
|
|
|
|
}).catch(() => { }) |
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
// 选择产品提交 |
|
|
|
|
productSubmit () { |
|
|
|
|
const result = [] |
|
|
|
|
this.checkeds.map(e => { |
|
|
|
|
result.push({ |
|
|
|
|
mallId: e.mallId, |
|
|
|
|
productName: e.productName, |
|
|
|
|
schemeId: this.form.id |
|
|
|
|
}) |
|
|
|
|
}) |
|
|
|
|
this.form.productList = result |
|
|
|
|
this.productVisible = false |
|
|
|
|
}, |
|
|
|
|
// 删除产品 |
|
|
|
|
delCheckedProduct (i) { |
|
|
|
|
this.form.productList.splice(i, 1) |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
// 附件上传之前的钩子 |
|
|
|
|
fileBeforeUpload(file) { |
|
|
|
|
fileBeforeUpload (file) { |
|
|
|
|
this.uploading++ |
|
|
|
|
}, |
|
|
|
|
// 附件上传成功 |
|
|
|
|
uploadSuccessFile({ filesResult }) { |
|
|
|
|
uploadSuccessFile ({ filesResult }) { |
|
|
|
|
this.form.fileName = filesResult.originalFileName |
|
|
|
|
this.form.schemeFile = filesResult.fileUrl |
|
|
|
|
}, |
|
|
|
|
// 上传文件 |
|
|
|
|
handleExceed(files, fileList) { |
|
|
|
|
handleExceed (files, fileList) { |
|
|
|
|
Util.warningMsg( |
|
|
|
|
`当前限制选择 1 个文件,如需更换,请删除上一个文件再重新选择!` |
|
|
|
|
) |
|
|
|
|
}, |
|
|
|
|
// 返回 |
|
|
|
|
back() { |
|
|
|
|
back () { |
|
|
|
|
this.pass = true |
|
|
|
|
// 更改了信息才需要提示 |
|
|
|
|
if (this.updateTime) { |
|
|
|
@ -335,27 +581,27 @@ export default { |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
// 更新附件的状态为发布 |
|
|
|
|
updateFile(files, form, quoteId) { |
|
|
|
|
updateFile (files, form, quoteId) { |
|
|
|
|
files.map(e => { |
|
|
|
|
this.$post(this.api.updateFile, { |
|
|
|
|
id: e, |
|
|
|
|
isRelease: form.isRelease, |
|
|
|
|
quote: form.title, |
|
|
|
|
quoteId |
|
|
|
|
}).then(res => {}).catch(err => {}) |
|
|
|
|
}).then(res => { }).catch(err => { }) |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
// 提交 |
|
|
|
|
submit(isRelease, next) { |
|
|
|
|
submit (isRelease, next) { |
|
|
|
|
if (this.submiting) return false |
|
|
|
|
const form = JSON.parse(JSON.stringify(this.form)) |
|
|
|
|
if (!form.title) return Util.errorMsg('请填写标题') |
|
|
|
|
// 如果是发布 |
|
|
|
|
if (isRelease) { |
|
|
|
|
if (!form.classificationId) return Util.errorMsg('请选择所属分类') |
|
|
|
|
if (!form.applicableMajor ) return Util.errorMsg('请输入适用专业') |
|
|
|
|
if (!form.applicableMajor) return Util.errorMsg('请输入适用专业') |
|
|
|
|
if (!form.schemeIntroduction) return Util.errorMsg('请输入方案简介') |
|
|
|
|
if (!form.product) return Util.errorMsg('请输入产品') |
|
|
|
|
if (!form.productList.length) return Util.errorMsg('请选择产品') |
|
|
|
|
if (!form.schemeFile) return Util.errorMsg('请上传方案文件') |
|
|
|
|
} |
|
|
|
|
// if (this.uploading) return Util.errorMsg('文件正在上传,请上传完成后再发布') |
|
|
|
@ -383,112 +629,10 @@ export default { |
|
|
|
|
</script> |
|
|
|
|
|
|
|
|
|
<style lang="scss" scoped> |
|
|
|
|
$upload-width: 220px; |
|
|
|
|
$upload-height: 102px; |
|
|
|
|
$upload-lg-height: 102px; |
|
|
|
|
/deep/ .avatar-uploader { |
|
|
|
|
.el-upload { |
|
|
|
|
position: relative; |
|
|
|
|
width: $upload-width; |
|
|
|
|
height: $upload-height; |
|
|
|
|
border: 1px solid #DCDEE0; |
|
|
|
|
border-radius: 2px; |
|
|
|
|
cursor: pointer; |
|
|
|
|
overflow: hidden; |
|
|
|
|
.uploader-default { |
|
|
|
|
display: flex; |
|
|
|
|
height: $upload-height; |
|
|
|
|
flex-direction: column; |
|
|
|
|
justify-content: center; |
|
|
|
|
align-items: center; |
|
|
|
|
text-align: center; |
|
|
|
|
background: #FAFAFA; |
|
|
|
|
p { |
|
|
|
|
margin-top: 10px; |
|
|
|
|
font-size: 14px; |
|
|
|
|
color: #333; |
|
|
|
|
line-height: 20px; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
&.avatar-uploader-lg { |
|
|
|
|
.el-upload { |
|
|
|
|
width: 100%; |
|
|
|
|
max-width: 820px; |
|
|
|
|
height: $upload-lg-height; |
|
|
|
|
|
|
|
|
|
.uploader-default { |
|
|
|
|
height: $upload-lg-height; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
.avatar { |
|
|
|
|
display: block; |
|
|
|
|
width: $upload-width; |
|
|
|
|
height: $upload-height; |
|
|
|
|
} |
|
|
|
|
.avatar-lg { |
|
|
|
|
display: block; |
|
|
|
|
width: 100%; |
|
|
|
|
height: $upload-lg-height; |
|
|
|
|
} |
|
|
|
|
.el-upload__tip { |
|
|
|
|
margin-top: 0; |
|
|
|
|
p { |
|
|
|
|
font-size: 12px; |
|
|
|
|
color: #333; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
.style-wrap { |
|
|
|
|
display: flex; |
|
|
|
|
margin-top: 10px; |
|
|
|
|
.label { |
|
|
|
|
margin-right: 30px; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
.styles { |
|
|
|
|
display: flex; |
|
|
|
|
flex-wrap: wrap; |
|
|
|
|
width: 955px; |
|
|
|
|
// height: 320px; |
|
|
|
|
margin-top: 20px; |
|
|
|
|
overflow: auto; |
|
|
|
|
li { |
|
|
|
|
margin: 0 20px 10px 0; |
|
|
|
|
text-align: center; |
|
|
|
|
cursor: pointer; |
|
|
|
|
&:hover .review { |
|
|
|
|
border-color: #2962FF; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
.review { |
|
|
|
|
display: flex; |
|
|
|
|
justify-content: center; |
|
|
|
|
align-items: center; |
|
|
|
|
width: 170px; |
|
|
|
|
height: 112px; |
|
|
|
|
margin-bottom: 10px; |
|
|
|
|
border: 1px solid #DCDEE0; |
|
|
|
|
border-radius: 2px; |
|
|
|
|
img { |
|
|
|
|
width: 80px; |
|
|
|
|
} |
|
|
|
|
.is-link { |
|
|
|
|
width: 50px; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
.info { |
|
|
|
|
position: absolute; |
|
|
|
|
top: 8px; |
|
|
|
|
left: -32px; |
|
|
|
|
cursor: pointer; |
|
|
|
|
} |
|
|
|
|
.plus { |
|
|
|
|
margin-bottom: 10px; |
|
|
|
|
font-size: 18px; |
|
|
|
|
color: #9278FF; |
|
|
|
|
color: #9278ff; |
|
|
|
|
text-align: right; |
|
|
|
|
cursor: pointer; |
|
|
|
|
} |
|
|
|
@ -496,7 +640,8 @@ $upload-lg-height: 102px; |
|
|
|
|
margin-left: 10px !important; |
|
|
|
|
} |
|
|
|
|
.manage-dia { |
|
|
|
|
.edit, .del { |
|
|
|
|
.edit, |
|
|
|
|
.del { |
|
|
|
|
font-size: 14px; |
|
|
|
|
cursor: pointer; |
|
|
|
|
} |
|
|
|
@ -524,12 +669,13 @@ $upload-lg-height: 102px; |
|
|
|
|
} |
|
|
|
|
.line { |
|
|
|
|
margin-bottom: 24px; |
|
|
|
|
border-bottom: 1px dashed #C2C2C2; |
|
|
|
|
border-bottom: 1px dashed #c2c2c2; |
|
|
|
|
} |
|
|
|
|
.el-form-item--small.el-form-item { |
|
|
|
|
margin-bottom: 24px; |
|
|
|
|
} |
|
|
|
|
.el-input, .el-select { |
|
|
|
|
.el-input, |
|
|
|
|
.el-select { |
|
|
|
|
width: 300px; |
|
|
|
|
} |
|
|
|
|
.el-select .el-input { |
|
|
|
@ -538,16 +684,56 @@ $upload-lg-height: 102px; |
|
|
|
|
.el-textarea { |
|
|
|
|
width: 550px; |
|
|
|
|
} |
|
|
|
|
.auto, .auto .el-input { |
|
|
|
|
.auto, |
|
|
|
|
.auto .el-input { |
|
|
|
|
width: auto; |
|
|
|
|
} |
|
|
|
|
.el-form-item.is-required:not(.is-no-asterisk) > .el-form-item__label:before { |
|
|
|
|
font-size: 18px; |
|
|
|
|
vertical-align: -4px; |
|
|
|
|
color: #F5222D; |
|
|
|
|
color: #f5222d; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
.btns { |
|
|
|
|
text-align: center; |
|
|
|
|
} |
|
|
|
|
.tag { |
|
|
|
|
margin: 0 5px 5px 0; |
|
|
|
|
} |
|
|
|
|
/deep/.product-dia { |
|
|
|
|
.product-wrap { |
|
|
|
|
display: flex; |
|
|
|
|
} |
|
|
|
|
.title-wrap { |
|
|
|
|
margin-bottom: 15px; |
|
|
|
|
} |
|
|
|
|
.item { |
|
|
|
|
width: 130px; |
|
|
|
|
max-height: 600px; |
|
|
|
|
margin-right: 20px; |
|
|
|
|
overflow: hidden; |
|
|
|
|
} |
|
|
|
|
.types { |
|
|
|
|
li { |
|
|
|
|
margin: 10px 0; |
|
|
|
|
cursor: pointer; |
|
|
|
|
&.active { |
|
|
|
|
color: #9278ff; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
.products { |
|
|
|
|
width: 400px; |
|
|
|
|
} |
|
|
|
|
.checked { |
|
|
|
|
flex: 1; |
|
|
|
|
.el-table .cell { |
|
|
|
|
font-size: 12px; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
.rm { |
|
|
|
|
font-size: 16px; |
|
|
|
|
cursor: pointer; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
</style> |