Commit 3ad5ad53 authored by 赵啸非's avatar 赵啸非

Merge remote-tracking branch 'origin/master'

parents 7ee844a6 d098f2cb
......@@ -222,7 +222,11 @@ export default {
// 格式化单元格数据
formatterDate(row, column) {
//console.log("date:",row,column)
return formatterDate(row, column)
if(formatterDate(row, column)){
return formatterDate(row, column)
}else{
return '--'
}
},
// 格式化单元格数据 只要年月日
formatterDateOnly(row, column) {
......
......@@ -4,7 +4,7 @@
<slot name="prepend"></slot>
<slot>
<el-button v-if="!noSaveBtn" type="primary" @click='$emit("submit")' icon='el-icon-circle-check-outline'>保存</el-button>
<el-button v-if="!noCancelBtn" @click="$router.go(-1)" icon='el-icon-circle-close-outline'>取消</el-button>
<el-button v-if="!noCancelBtn" @click='$emit("cancel")' icon='el-icon-circle-close-outline'>取消</el-button>
</slot>
<slot name="append"></slot>
</el-form-item>
......
......@@ -54,9 +54,9 @@
{label: "联系电话", prop: "contactPhone"},
{label: "经营地址", prop: "businessAdress"},
{label: "经营地址", prop: "businessAdress",formatter: this.formatters},
{label: "描述", prop: "companyIntroduction"},
{label: "描述", prop: "companyIntroduction",formatter: this.formatters},
{label: "更新时间", prop: "createTime", formatter: this.formatterDate},
......
......@@ -105,22 +105,22 @@
{type: "index",label: "序号",width: 50},
{label: "内容", prop: "content"},
{label: "内容", prop: "content",formatter: this.formatter},
{label: "真实姓名", prop: "feedbackName"},
{label: "联系电话", prop: "contactInfo"},
{label: "真实姓名", prop: "feedbackName",formatter: this.formatter},
{label: "联系电话", prop: "contactInfo",formatter: this.formatter},
{label: "单位名称", prop: "companyName"},
{label: "单位名称", prop: "companyName",formatter: this.formatter},
{label: "邮箱地址", prop: "email"},
{label: "邮箱地址", prop: "email",formatter: this.formatter},
{label: "提交时间", prop: "createTime", formatter: this.formatterDate},
{label: "是否回复 ", prop: "reply",formatter: this.formatter},
{label: "回复人", prop: "replyPerson"},
{label: "回复人", prop: "replyPerson",formatter: this.formatter},
// {label: "反馈类型 ", prop: "feedbackType",formatter: this.formatter},
......
......@@ -52,7 +52,7 @@
{label: "标签名称", prop: "labelName"},
{label: "标签描述", prop: "labelDesc"},
{label: "标签描述", prop: "labelDesc",formatter: this.formatters},
{label: "标签图标", prop: "labelLogoPath",formatter: (row) => {
......
......@@ -53,7 +53,7 @@
{label: "职位名称", prop: "positionName"},
{label: "职位编码", prop: "positionCode"},
{label: "职位编码", prop: "positionCode",formatter: this.formatters},
{
label: "操作",
......
......@@ -6,41 +6,55 @@
:direction="direction"
:destroy-on-close="true"
size="90%">
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
<el-row>
<Field label="产品名称" prop="productName" v-model="form.productName" placeholder="请输入产品名称,名称唯一"/>
<Field label="产品slogan" prop="productSlogan" v-model="form.productSlogan" placeholder="请输入产品slogan"/>
<el-form ref="form" :model="form" :rules="rules" label-width="120px" >
<div class="form">
<div class="formleft">
<el-row>
<Field label="产品名称" prop="productName" v-model="form.productName" placeholder="请输入产品名称,名称唯一"/>
</el-row>
<el-row>
<Field label="产品slogan" prop="productSlogan" v-model="form.productSlogan" placeholder="请输入产品slogan"/>
</el-row>
<el-row>
<Field label="产品分类" prop="categoryId" v-model="form.categoryId" :multiple="true" type="select" :enumData="dict.categoryId" placeholder="请选择产品分类"/>
<!-- <Field label="所属企业" prop="companyId" v-model="form.companyId" :multiple="true" type="select" :enumData="dict.companyId" placeholder="请选择所属企业"/> -->
<Field label="产品分类" prop="categoryId" v-model="form.categoryId" :multiple="true" type="select" :enumData="dict.categoryId" placeholder="请选择产品分类"/>
<!-- <Field label="所属企业" prop="companyId" v-model="form.companyId" :multiple="true" type="select" :enumData="dict.companyId" placeholder="请选择所属企业"/> -->
<!-- <Field label="产品图标"><imageUpload v-model="form.productLogoPath" prePath="/file/preview"/></Field> -->
<Field label="产品封面图片" prop="productFacePath" ><imageUpload v-model="form.productFacePath" prePath="/file/preview"/> </Field>
<Field label="宣传形式" type="radio" :enumData="['轮播图','短视频']" ></Field>
<Field label="轮播图"><imageUpload v-model="form.productPicPath" prePath="/file/preview"/></Field>
<Field label="短视频"><fileUpload v-model="form.productVideoPath" prePath="/file/fileupload"/></Field>
<Field label="产品简介" prop="productIntroduction" v-model="form.productIntroduction" type="textarea" placeholder="请输入产品简介"/>
<Field label="产品详情" prop="productDetail" placeholder="请输入产品详情"><editor v-model="form.productDetail" :min-height="256"/></Field>
<!-- <Field label="发布时间" prop="publishTime" v-model="form.publishTime" type="date" /> -->
<Field label="是否热门" prop="hot" v-model="form.hot" type="radio" :enumData="dict.hot" placeholder="请选择是否热门"/>
<!-- <Field label="备注" prop="productRemark" v-model="form.productRemark" type="textarea" placeholder="请输入备注"/> -->
</el-row>
<el-divider content-position="center">产品常见问题信息</el-divider>
<br/>
<el-row style="margin-left: 10px" :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button type="primary" icon="el-icon-plus" size="mini" @click="handleAddProductQuestion">添加</el-button>
</el-col>
<el-col :span="1.5">
<el-button type="danger" icon="el-icon-delete" size="mini" @click="handleDeleteProductQuestion">删除</el-button>
</el-col>
</el-row>
<el-table :data="productQuestionList" :row-class-name="rowProductQuestionIndex" @selection-change="handleProductQuestionSelectionChange" ref="productQuestion">
<el-table-column type="selection" width="50" align="center" />
<el-table-column label="序号" align="center" prop="index" width="50"/>
<!-- <Field label="产品图标"><imageUpload v-model="form.productLogoPath" prePath="/file/preview"/></Field> -->
</el-row>
<el-row>
<Field label="产品封面图片" prop="productFacePath" ><imageUpload v-model="form.productFacePath" prePath="/file/preview"/> </Field>
</el-row>
<el-row>
<Field label="宣传形式" type="radio" :enumData="propagandaList" v-model="nowPropaganda" :field="nowPropaganda" @emit="changeNowprop"></Field>
</el-row>
<el-row>
<Field label="轮播图" v-if="nowPropaganda==0"><imageUpload v-model="form.productPicPath" prePath="/file/preview"/></Field>
</el-row>
<el-row>
<Field label="短视频" v-if="nowPropaganda==1"><fileUpload v-model="form.productVideoPath" prePath="/file/fileupload"/></Field>
</el-row>
<el-row>
<Field label="产品简介" prop="productIntroduction" v-model="form.productIntroduction" type="textarea" placeholder="请输入产品简介"/>
<!-- <Field label="发布时间" prop="publishTime" v-model="form.publishTime" type="date" /> -->
</el-row>
<el-row>
<Field label="是否热门" prop="hot" v-model="form.hot" type="radio" :enumData="dict.hot" placeholder="请选择是否热门"/>
<!-- <Field label="备注" prop="productRemark" v-model="form.productRemark" type="textarea" placeholder="请输入备注"/> -->
</el-row>
</div>
<div class="formright">
<div class="tabs">
<div class="tab" :class="nowtab==1?'activetab':''" @click="changeTab(1)">产品详情</div>
<div class="tab" :class="nowtab==2?'activetab':''" @click="changeTab(2)">常见问题</div>
</div>
<div class="content" v-show="nowtab==1">
<editor v-model="form.productDetail" :min-height="100"/>
</div>
<div class="content" v-show="nowtab==2">
<el-table :data="productQuestionList" :row-class-name="rowProductQuestionIndex" @selection-change="handleProductQuestionSelectionChange" ref="productQuestion">
<el-table-column label="序号" align="center" prop="index" width="50"/>
<el-table-column label="问题" prop="question">
<template slot-scope="scope">
<el-input v-model="scope.row.question" placeholder="请输入问题" />
......@@ -51,10 +65,28 @@
<el-input v-model="scope.row.answer" placeholder="请输入常见问题回答" />
</template>
</el-table-column>
<el-table-column label="操作" width="240" align="center">
<template slot-scope="scope">
<Confirm @confirm="handleDeleteCompanyPatents(scope.row)" message="确定要删除该条知识产权吗?">
<div class="del">删除</div>
</Confirm>
</template>
</el-table-column>
</el-table>
<el-row style="margin:10px 0;display: flex;justify-content: center;" :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button type="primary" icon="el-icon-plus" @click="handleAddProductQuestion">新增常见问题</el-button>
</el-col>
</el-row>
</el-table>
<form-buttons @submit='submitForm' v-if="pageInfo.type!='view'" noCancelBtn />
</div>
</div>
</div>
<!-- 保存按钮 -->
<form-buttons @submit='onSubmitForm' @cancel='cancelForm' v-if="pageInfo.type!='view'" class="formbtns" />
</el-form>
</el-drawer>
......@@ -73,6 +105,10 @@
},
data() {
return {
propagandaList:['轮播图','短视频'],
// 当前宣传形式
nowPropaganda:0,
nowtab:1,
// 子表选中数据
checkedProductQuestion: [],
// 产品常见问题表格数据
......@@ -123,6 +159,39 @@
},
methods: {
// 重写提交表单
onSubmitForm(){
// 由于宣传形式修改,只能存在一种,所以当选中一种时另外一种清空
if(this.nowPropaganda===0){
// 选中轮播图
this.form.productVideoPath = ''
}else{
// 选中短视频
this.form.productPicPath = ''
}
this.submitForm()
},
// 修改宣传形式
changeNowprop(val){
this.nowPropaganda = val
},
// 问题删除
handleDeleteCompanyPatents(row) {
console.log(row);
// 由于有一些知识产权还没有id,所以这里删除选用的是字段中带的index
this.productQuestionList = this.productQuestionList.filter(
item => item.index !== row.index
);
this.form.productQuestionList = this.productQuestionList;
},
cancelForm(){
this.open = false
},
changeTab(nowtab){
this.nowtab = nowtab
this.$forceUpdate()
},
/** 产品常见问题序号 */
rowProductQuestionIndex({ row, rowIndex }) {
row.index = rowIndex + 1;
......@@ -160,6 +229,12 @@
if(data.entity.productQuestionList) {
this.productQuestionList = data.entity.productQuestionList;
}
// 判断有无短视频,如果有短视频那么更改为短视频选项
if(data.entity.productVideoPath){
this.nowPropaganda = 1
}else{
this.nowPropaganda = 0
}
return data
},
/** 编辑 */
......@@ -237,3 +312,56 @@
},
};
</script>
<style lang="less" scoped>
.del {
color: red;
}
.formbtns {
display: flex;
justify-content: flex-end;
align-items: center;
height: 60px;
margin-top: 30px;
padding-right: 30px;
border-top: 1px solid #dcdcdc;
}
.tabs{
background: #dcdcdc59;
height: 50px;
display: flex;
padding-left: 10px;
.tab{
height: 100%;
line-height: 50px;
padding: 0 20px;
width: 120px;
align-items: center;
// display: flex;
// justify-content: center;
// align-content: center;
}
.activetab{
background: white;
}
}
.form{
display: flex;
.formleft{
width: 600px;
border-right: 1px solid gainsboro;
flex-shrink: 0;
flex-grow: 0;
}
.el-col-12{
width: 96% !important;
}
.formright{
margin-left: 10px;
width: 100%;
.content{
margin-top: 10px;
width: 100%;
}
}
}
</style>
\ No newline at end of file
......@@ -126,7 +126,7 @@
{label: "所属企业", prop: "companyId",formatter: this.formatters},
{label: "产品介绍", prop: "productIntroduction" , width: 500},
{label: "产品介绍", prop: "productIntroduction" , width: 500,formatter: this.formatters},
{label: "发布时间", prop: "publishTime", formatter: this.formatterDate},
......
......@@ -76,7 +76,7 @@
{label: "联系电话", prop: "phoneNumber"},
{label: "邮件地址", prop: "email"},
{label: "邮件地址", prop: "email",formatter: this.formatters},
{label: "所属公司", prop: "companyIds",formatter: this.formatters},
......
......@@ -56,9 +56,9 @@
{type: "selection", width: 60},
{type: "index",label: "序号",width: 50},
{label: "被查看员工姓名", prop: "staffName"},
{label: "被查看员工姓名", prop: "staffName", formatter: this.formatter},
{label: "查看人名称", prop: "viewName"},
{label: "查看人名称", prop: "viewName", formatter: this.formatter},
{label: "创建用户", prop: "createUserId", formatter: this.formatter},
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment