Commit 059087f1 authored by zhanglw's avatar zhanglw

求购留言

parent 954ca425
...@@ -124,6 +124,14 @@ export const constantRouterMap = [ ...@@ -124,6 +124,14 @@ export const constantRouterMap = [
}, },
hidden: true hidden: true
}, },
{
path: '/publish/otherInfo',
meta: { title: '留言页', noCache: true },
component: (resolve) => {
return require(['@/views/homepage/publish/otherInfo'], resolve)
},
hidden: true
},
{ {
path: '/backstage', path: '/backstage',
component: Layout, component: Layout,
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
<el-option v-for="item in [{value:undefined,label:'全部产品'}, ...dict.product_type]" :key="item.value" :label="item.label" :value="item.value" /> <el-option v-for="item in [{value:undefined,label:'全部产品'}, ...dict.product_type]" :key="item.value" :label="item.label" :value="item.value" />
</el-select> </el-select>
<el-select v-model="query.area" placeholder="区域" style="width: 100px"> <el-select v-model="query.area" placeholder="区域" style="width: 100px">
<el-option v-for="item in [{value:undefined,label:'区域'}, ...dict.area_province]" :key="item.value" :label="item.label" :value="item.value" /> <el-option v-for="item in [{value:undefined,label:'全地区'}, ...dict.area_province]" :key="item.value" :label="item.label" :value="item.value" />
</el-select> </el-select>
<el-button icon="el-icon-search" class="btn">搜索</el-button> <el-button icon="el-icon-search" class="btn">搜索</el-button>
</div> </div>
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
</div> </div>
<div class="line-btn" style="padding-top: 42px;"> <div class="line-btn" style="padding-top: 42px;">
<div class="btn-o" style="padding: 10px" @click="goToDetails(null, '/publish/supplyInfo/all')">我要供应</div> <div class="btn-o" style="padding: 10px" @click="goToDetails(null, '/publish/supplyInfo/all')">我要供应</div>
<div class="btn-o" style="padding: 10px">我要采购</div> <div class="btn-o" style="padding: 10px" @click="goToDetails(null, '/publish/buyInfo/all')">我要采购</div>
</div> </div>
<div class="line-btn" style="padding-top: 30px"> <div class="line-btn" style="padding-top: 30px">
<div v-for="(item,index) in dict.product_type" :key="index" class="btn-b" :class="currentProductTypeObj===item?'active':''" @mouseenter="changeProductPush(item)">{{ item.label }}</div> <div v-for="(item,index) in dict.product_type" :key="index" class="btn-b" :class="currentProductTypeObj===item?'active':''" @mouseenter="changeProductPush(item)">{{ item.label }}</div>
...@@ -136,11 +136,11 @@ ...@@ -136,11 +136,11 @@
</div></el-col> </div></el-col>
</el-row> </el-row>
<div class="line-btn" style="padding-top: 64px;"> <div class="line-btn" style="padding-top: 64px;">
<div class="btn-o" style="padding: 10px">我要供应</div> <div class="btn-o" style="padding: 10px" @click="goToDetails(null, '/publish/supplyInfo/all')">我要供应</div>
<div class="btn-o" style="padding: 10px">我要采购</div> <div class="btn-o" style="padding: 10px" @click="goToDetails(null, '/publish/buyInfo/all')">我要采购</div>
</div> </div>
<div class="line-btn" style="padding: 30px 0;"> <div class="line-btn" style="padding: 30px 0;">
<div class="btn-l">没有我需要的,我要留言</div> <div class="btn-l" @click="goToDetails(null, '/publish/otherInfo')">没有我需要的,我要留言</div>
</div> </div>
<!--合作伙伴 --> <!--合作伙伴 -->
<div class="line-title"><div class="title-point" /><span class="title-text">合作伙伴 </span></div> <div class="line-title"><div class="title-point" /><span class="title-text">合作伙伴 </span></div>
......
...@@ -15,9 +15,92 @@ ...@@ -15,9 +15,92 @@
<el-breadcrumb separator-class="el-icon-arrow-right"> <el-breadcrumb separator-class="el-icon-arrow-right">
<el-breadcrumb-item :to="{ path: '/home' }">首页</el-breadcrumb-item> <el-breadcrumb-item :to="{ path: '/home' }">首页</el-breadcrumb-item>
<el-breadcrumb-item :to="{ path: '/publish' }">信息发布</el-breadcrumb-item> <el-breadcrumb-item :to="{ path: '/publish' }">信息发布</el-breadcrumb-item>
<el-breadcrumb-item>我要求购{{ title }}</el-breadcrumb-item> <el-breadcrumb-item>我要求购{{ title }}产品</el-breadcrumb-item>
</el-breadcrumb> </el-breadcrumb>
</div> </div>
<div class="form-table-box">
<el-form ref="formViewRef" :model="formData" :rules="rules" :status-icon="true" label-width="240px">
<el-form-item label="产品名称:" class="form-cell" prop="productName">
<div class="cell-box">
<el-input v-model="formData.productName" placeholder="请输入产品名称" class="cell-input" />
</div>
</el-form-item>
<el-form-item label="产品分类:" class="form-cell" required style="margin: 0">
<div class="cell-box" style="display: flex">
<el-form-item prop="productType">
<el-select v-model="formData.productType" placeholder="产品大类" style="width: 240px" @change="changeProductType">
<el-option v-for="item in productTypeOpts" :key="item.id" :label="item.label" :value="item.value" />
</el-select>
</el-form-item>
<el-form-item prop="productSubType" style="margin-left: 5px">
<el-select v-model="formData.productSubType" placeholder="产品小类" style="width: 320px">
<el-option v-for="item in productSubTypeOpts" :key="item.id" :label="item.label" :value="item.value" />
</el-select>
</el-form-item>
</div>
</el-form-item>
<el-form-item label="产品价格区间(元):" class="form-cell" style="margin: 0">
<div class="cell-box" style="display: flex">
<el-form-item prop="minPrice">
<el-input v-model.number="formData.minPrice" placeholder="价格区间下限" class="cell-input" style="width: 300px" />
</el-form-item>
<div style="width: 20px;text-align: center">~</div>
<el-form-item prop="maxPrice">
<el-input v-model.number="formData.maxPrice" placeholder="价格区间上限" class="cell-input" style="width: 300px" />
</el-form-item>
</div>
</el-form-item>
<el-form-item label="产品需求说明:" class="form-cell" prop="consultationContent">
<div class="cell-box">
<el-input v-model="formData.consultationContent" type="textarea" placeholder="请输入文本内容" maxlength="1000" :autosize="{ minRows: 12, maxRows: 12}" show-word-limit resize="none" class="cell-input" />
</div>
</el-form-item>
<el-form-item label="联系方式:" required class="form-cell">
<div class="cell-box" style="max-width: 600px">
<el-row>
<el-col :span="10" class="grid-content">
<div class="grid-label">联系人</div>
</el-col>
<el-col :span="14" class="grid-content">
<el-form-item prop="contactPerson" style="margin: 0">
<el-input v-model="formData.contactPerson" placeholder="请留下姓名" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="10" class="grid-content">
<div class="grid-label">联系电话</div>
</el-col>
<el-col :span="14" class="grid-content">
<el-form-item prop="contactPersonPhone" style="margin: 0">
<el-input v-model="formData.contactPersonPhone" placeholder="请留下联系电话" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="10" class="grid-content">
<div class="grid-label">电子邮箱</div>
</el-col>
<el-col :span="14" class="grid-content">
<el-input v-model="formData.contactPersonEmail" placeholder="请留下电子邮箱" />
</el-col>
</el-row>
<el-row>
<el-col :span="10" class="grid-content">
<div class="grid-label">联系地址</div>
</el-col>
<el-col :span="14" class="grid-content">
<el-input v-model="formData.contactPersonDetailAddress" placeholder="请留下联系地址" />
</el-col>
</el-row>
</div>
</el-form-item>
</el-form>
<div style="width: 100%;text-align: center">
<el-button @click="cancelView">返回</el-button>
<el-button type="primary" @click="submitForm()">提交</el-button>
</div>
</div>
</div> </div>
</div> </div>
<home-footer ref="homeFooter" /> <home-footer ref="homeFooter" />
...@@ -29,16 +112,72 @@ import titleMenus from '../components/titleMenusV2' ...@@ -29,16 +112,72 @@ import titleMenus from '../components/titleMenusV2'
import userLogin from '../components/userLoginV2' import userLogin from '../components/userLoginV2'
import languageSetting from '../components/languageSettingV2' import languageSetting from '../components/languageSettingV2'
import homeFooter from '../components/homeFooter' import homeFooter from '../components/homeFooter'
import { getToken } from '@/utils/auth'
import { HttpReq } from '@/api/common'
export default { export default {
components: { titleMenus, userLogin, languageSetting, homeFooter }, components: { titleMenus, userLogin, languageSetting, homeFooter },
dicts: [], dicts: ['product_rank', 'product_type', 'product_type_1', 'product_type_2', 'product_type_3', 'product_type_4', 'product_type_5', 'product_type_6', 'product_type_7'],
data() { data() {
const checkPrice = (rule, value, callback) => {
if (!value) {
return callback()
}
if (!Number.isInteger(value)) {
return callback(new Error('请输入数字值'))
}
setTimeout(() => {
if (this.formData.minPrice && value < this.formData.minPrice) {
return callback(new Error('区间值错误'))
}
if (this.formData.maxPrice && value > this.formData.maxPrice) {
return callback(new Error('区间值错误'))
}
return callback()
}, 500)
}
return { return {
title: '',
uploadHeaders: { 'Authorization': getToken() },
imgSrcStart: process.env.VUE_APP_BASE_API, imgSrcStart: process.env.VUE_APP_BASE_API,
title: '产品', editor: false, // 富文本对象
throttle: null, // 节流器 dialogImageUrl: '',
throttleTime: 300 dialogImageVisible: false,
visible: false,
tagTypes: ['', 'primary', 'success', 'warning', 'danger', 'info', 'info', 'info'],
productTypeOpts: [],
productSubTypeOpts: [],
inputVisible: false,
inputValue: '',
productFeature: [], // 产品特点tag列表
formData: {
productId: null,
customerId: null, // 供应商id
enterpriseName: '', // 供应商名称
productName: '', // 产品名称
productType: '', // 产品大类
productSubType: null, // 产品小类
minPrice: null, // 价格区间-小
maxPrice: null, // 价格区间-大
productFeature: null, // 产品特点
consultationContent: '', // 需求说明
contactPerson: '', // 联系人
contactPersonPhone: '', // 电话
contactPersonEmail: '', // 邮箱
contactPersonDetailAddress: '', // 地址
rank: '1' // 产品品级
},
rules: {
productType: { required: true, message: '请选择产品分类', trigger: 'blur' },
contactPerson: { required: true, message: '请留下姓名', trigger: 'blur' },
contactPersonPhone: { required: true, message: '请留下联系电话', trigger: 'blur' },
minPrice: [
{ validator: checkPrice, trigger: 'blur' }
],
maxPrice: [
{ validator: checkPrice, trigger: 'blur' }
]
}
} }
}, },
mounted() { mounted() {
...@@ -48,11 +187,47 @@ export default { ...@@ -48,11 +187,47 @@ export default {
}, },
methods: { methods: {
onDictReady(dict) { onDictReady(dict) {
if (this.$route.params.type === 'hardware') {
this.title = '硬件'
this.productTypeOpts = dict.product_type.slice(0, 4)
} else if (this.$route.params.type === 'other') {
this.title = '其他'
this.productTypeOpts = dict.product_type.slice(4)
} else {
this.title = ''
this.productTypeOpts = dict.product_type
}
this.loadData()
},
cancelView() {
this.$router.push({ path: `/publish` })
},
submitForm() {
this.$refs.formViewRef.validate(valid => {
if (valid) {
HttpReq.backstageApi.addProduct(this.formData).then((res) => {
this.$notify({
title: res.msg,
type: 'success',
duration: 2500
})
if (res.code === 200) {
alert(666)
}
})
} else {
this.$message({
message: '表单信息有误,请核对无误后提交!',
type: 'error'
})
}
})
},
changeProductType() {
this.formData.productSubType = null
this.productSubTypeOpts = this.dict['product_type_' + this.formData.productType]
}, },
goTop() { loadData() {
document.body.scrollTop = 0
document.documentElement.scrollTop = 0
} }
} }
} }
...@@ -80,6 +255,14 @@ export default { ...@@ -80,6 +255,14 @@ export default {
font-family: Source Han Sans CN; font-family: Source Han Sans CN;
font-weight: 400; font-weight: 400;
} }
.form-table-box {
width: 1080px;
margin: 20px auto;
padding: 30px;
border: 1px solid rgba(0,0,0,0.12);
box-shadow: 1px 2px 8px 0 rgba(0,0,0,0.12);
border-radius: 10px;
}
.head-box { .head-box {
width: 100vw; width: 100vw;
top: 0; top: 0;
...@@ -164,4 +347,64 @@ export default { ...@@ -164,4 +347,64 @@ export default {
background: #1961C5; background: #1961C5;
} }
} }
.grid-content {
border: 1px solid rgba(100, 100, 100, 0.3);
padding: 0;
}
.grid-label {
background: #dedede;
padding: 0 10px;
}
.editor{
text-align:left;
width: 680px;
}
::v-deep .w-e-text-container {
height: 560px !important;
}
.cell-box {
min-width: 120px;
.cell-input {
width: 620px;
}
.cell-select {
width: 320px;
}
.el-tag + .el-tag {
margin-left: 10px;
}
.button-new-tag {
margin-left: 10px;
height: 28px;
line-height: 24px;
padding: 0 8px;
}
.input-new-tag {
width: 140px;
height: 28px;
margin-left: 10px;
vertical-align: bottom;
}
>>>.el-input__inner {
border: 1px solid rgba(100, 100, 100, 0.1);
border-bottom: 1px solid rgba(100, 100, 100, 0.2);
border-radius: 5px;
}
>>>.el-input.is-disabled .el-input__inner {
border-radius: 0;
border: 0;
border-bottom: 1px solid rgba(100, 100, 100, 0.4);
background: white;
cursor: text;
}
>>>.el-input.is-disabled .el-input__icon {
cursor: text;
}
>>>.el-icon-circle-check {
color: #13ce66;
}
//>>>.el-icon-arrow-up:before {
// content: '';
//}
}
</style> </style>
<template>
<div class="page-body">
<div class="head-box">
<div class="head-box-top">
<div class="top-call" />
<div class="top-call"><img src="@/assets/home_images/gemho_logo_b.png"></div>
<div class="top-call"><title-menus ref="titleMenus" menu-index="7" style="padding-top: 15px" /></div>
<div class="top-call"><user-login ref="userLogin" /></div>
<div class="top-call"><language-setting ref="languageSetting" /></div>
</div>
</div>
<div class="content-box">
<div style="width: 88%;padding-left: 9%;">
<div class="showcase">
<el-breadcrumb separator-class="el-icon-arrow-right">
<el-breadcrumb-item :to="{ path: '/home' }">首页</el-breadcrumb-item>
<el-breadcrumb-item>我要留言</el-breadcrumb-item>
</el-breadcrumb>
</div>
<div class="form-table-box">
<el-form ref="formViewRef" :model="formData" :rules="rules" :status-icon="true" label-width="240px">
<el-form-item label="留言内容类型:" class="form-cell" prop="consultType">
<div class="cell-box">
<el-select v-model="formData.consultType" placeholder="产品大类" style="width: 300px">
<el-option label="深度合作" value="8" />
<el-option label="采购其它" value="9" />
<el-option label="其它问题" value="10" />
</el-select>
</div>
</el-form-item>
<el-form-item label="标题:" class="form-cell" prop="title">
<div class="cell-box">
<el-input v-model="formData.title" placeholder="请输入产品名称" class="cell-input" />
</div>
</el-form-item>
<el-form-item label="内容:" class="form-cell" prop="consultationContent">
<div class="cell-box">
<el-input v-model="formData.consultationContent" type="textarea" placeholder="请输入文本内容" maxlength="1000" :autosize="{ minRows: 12, maxRows: 12}" show-word-limit resize="none" class="cell-input" />
</div>
</el-form-item>
<el-form-item label="联系方式:" required class="form-cell">
<div class="cell-box" style="max-width: 600px">
<el-row>
<el-col :span="10" class="grid-content">
<div class="grid-label">联系人</div>
</el-col>
<el-col :span="14" class="grid-content">
<el-form-item prop="contactPerson" style="margin: 0">
<el-input v-model="formData.contactPerson" placeholder="请留下姓名" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="10" class="grid-content">
<div class="grid-label">联系电话</div>
</el-col>
<el-col :span="14" class="grid-content">
<el-form-item prop="contactPersonPhone" style="margin: 0">
<el-input v-model="formData.contactPersonPhone" placeholder="请留下联系电话" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="10" class="grid-content">
<div class="grid-label">电子邮箱</div>
</el-col>
<el-col :span="14" class="grid-content">
<el-input v-model="formData.contactPersonEmail" placeholder="请留下电子邮箱" />
</el-col>
</el-row>
<el-row>
<el-col :span="10" class="grid-content">
<div class="grid-label">联系地址</div>
</el-col>
<el-col :span="14" class="grid-content">
<el-input v-model="formData.contactPersonDetailAddress" placeholder="请留下联系地址" />
</el-col>
</el-row>
</div>
</el-form-item>
</el-form>
<div style="width: 100%;text-align: center">
<el-button @click="cancelView">返回</el-button>
<el-button type="primary" @click="submitForm()">提交</el-button>
</div>
</div>
</div>
</div>
<home-footer ref="homeFooter" />
<el-backtop />
</div>
</template>
<script>
import titleMenus from '../components/titleMenusV2'
import userLogin from '../components/userLoginV2'
import languageSetting from '../components/languageSettingV2'
import homeFooter from '../components/homeFooter'
import { getToken } from '@/utils/auth'
import { HttpReq } from '@/api/common'
export default {
components: { titleMenus, userLogin, languageSetting, homeFooter },
dicts: [],
data() {
return {
title: '',
uploadHeaders: { 'Authorization': getToken() },
imgSrcStart: process.env.VUE_APP_BASE_API,
editor: false, // 富文本对象
dialogImageUrl: '',
dialogImageVisible: false,
visible: false,
tagTypes: ['', 'primary', 'success', 'warning', 'danger', 'info', 'info', 'info'],
productTypeOpts: [],
productSubTypeOpts: [],
inputVisible: false,
inputValue: '',
productFeature: [], // 产品特点tag列表
formData: {
title: '', // 标题
consultType: '', // 留言类型
consultationContent: '', // 需求说明
contactPerson: '', // 联系人
contactPersonPhone: '', // 电话
contactPersonEmail: '', // 邮箱
contactPersonDetailAddress: '', // 地址
rank: '1' // 产品品级
},
rules: {
consultType: { required: true, message: '请选择留言类型', trigger: 'blur' },
title: { required: true, message: '请填写标题', trigger: 'blur' },
consultationContent: { required: true, message: '请填写留言内容', trigger: 'blur' },
contactPerson: { required: true, message: '请留下姓名', trigger: 'blur' },
contactPersonPhone: { required: true, message: '请留下联系电话', trigger: 'blur' }
}
}
},
mounted() {
this.$nextTick(() => {
})
},
methods: {
onDictReady(dict) {
},
cancelView() {
this.$router.push({ path: `/home` })
},
submitForm() {
this.$refs.formViewRef.validate(valid => {
if (valid) {
HttpReq.backstageApi.addProduct(this.formData).then((res) => {
this.$notify({
title: res.msg,
type: 'success',
duration: 2500
})
if (res.code === 200) {
alert(666)
}
})
} else {
this.$message({
message: '表单信息有误,请核对无误后提交!',
type: 'error'
})
}
})
},
loadData() {
}
}
}
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
.touch {
cursor:pointer;
}
.clear {
clear: both
}
.inline-block {
display: inline-block;
}
.ellipsis {
display: -webkit-box;
-webkit-box-orient: vertical;
overflow: hidden;
-webkit-line-clamp: 2;
text-overflow: ellipsis;
}
.showcase {
padding: 1px 0;
font-size: 20px;
font-family: Source Han Sans CN;
font-weight: 400;
}
.form-table-box {
width: 1080px;
margin: 20px auto;
padding: 30px;
border: 1px solid rgba(0,0,0,0.12);
box-shadow: 1px 2px 8px 0 rgba(0,0,0,0.12);
border-radius: 10px;
}
.head-box {
width: 100vw;
top: 0;
position: fixed;
background: none repeat scroll 0 0 white;
z-index: 999;
box-shadow: 0px 3px 7px 0px rgba(0,0,0,0.2);
.head-box-top {
display: flex;
justify-content: space-evenly;
align-items: center;
.top-call {
height: 80px;
padding-top: 15px;
}
}
}
.content-box {
min-height: 70vh;
margin-top: 94px;
font-family: Source Han Sans CN;
user-select: none;
}
.line-btn {
display: flex;
justify-content: center;
font-family: Source Han Sans CN;
font-weight: 400;
.btn-o {
margin: 0 25px;
width: 360px;
padding: 6px 10px;
background: #F7601A;
box-shadow: 0 3px 6px 0 rgba(0,0,0,0.2);
text-align: center;
border: 1px solid transparent;
font-size: 22px;
color: #FFFFFF;
cursor:pointer;
user-select: none;
}
.btn-o:hover {
border: 1px solid rgba(30, 144, 255, 0.8);
color: #1482f0;
}
.btn-l {
margin: 0 25px;
width: 360px;
padding: 10px;
background: #1961C5;
box-shadow: 0 3px 6px 0 rgba(0,0,0,0.2);
text-align: center;
border: 1px solid transparent;
font-size: 22px;
color: #FFFFFF;
cursor:pointer;
user-select: none;
}
.btn-l:hover {
border: 1px solid rgba(0,0,0,0.3);
color: #F7601A;
}
.btn-b {
margin: 0 10px;
width: 168px;
padding: 6px;
background: #EFF6FF;
border: 1px solid transparent;
box-shadow: 0 1px 2px 0 rgba(0,0,0,0.2);
text-align: center;
font-size: 20px;
color: #1961C5;
cursor:pointer;
user-select: none;
}
.btn-b:hover {
border: 1px solid rgba(30, 144, 255, 0.9);
}
.active {
color: #FFFFFF;
font-weight: 400;
background: #1961C5;
}
}
.grid-content {
border: 1px solid rgba(100, 100, 100, 0.3);
padding: 0;
}
.grid-label {
background: #dedede;
padding: 0 10px;
}
.editor{
text-align:left;
width: 680px;
}
::v-deep .w-e-text-container {
height: 560px !important;
}
.cell-box {
min-width: 120px;
.cell-input {
width: 620px;
}
.cell-select {
width: 320px;
}
.el-tag + .el-tag {
margin-left: 10px;
}
.button-new-tag {
margin-left: 10px;
height: 28px;
line-height: 24px;
padding: 0 8px;
}
.input-new-tag {
width: 140px;
height: 28px;
margin-left: 10px;
vertical-align: bottom;
}
>>>.el-input__inner {
border: 1px solid rgba(100, 100, 100, 0.1);
border-bottom: 1px solid rgba(100, 100, 100, 0.2);
border-radius: 5px;
}
>>>.el-input.is-disabled .el-input__inner {
border-radius: 0;
border: 0;
border-bottom: 1px solid rgba(100, 100, 100, 0.4);
background: white;
cursor: text;
}
>>>.el-input.is-disabled .el-input__icon {
cursor: text;
}
>>>.el-icon-circle-check {
color: #13ce66;
}
//>>>.el-icon-arrow-up:before {
// content: '';
//}
}
</style>
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
<el-breadcrumb separator-class="el-icon-arrow-right"> <el-breadcrumb separator-class="el-icon-arrow-right">
<el-breadcrumb-item :to="{ path: '/home' }">首页</el-breadcrumb-item> <el-breadcrumb-item :to="{ path: '/home' }">首页</el-breadcrumb-item>
<el-breadcrumb-item :to="{ path: '/publish' }">信息发布</el-breadcrumb-item> <el-breadcrumb-item :to="{ path: '/publish' }">信息发布</el-breadcrumb-item>
<el-breadcrumb-item>我要供应{{ title }}</el-breadcrumb-item> <el-breadcrumb-item>我要供应{{ title }}产品</el-breadcrumb-item>
</el-breadcrumb> </el-breadcrumb>
</div> </div>
<div class="form-table-box"> <div class="form-table-box">
...@@ -28,12 +28,12 @@ ...@@ -28,12 +28,12 @@
<el-form-item label="产品分类:" class="form-cell" required style="margin: 0"> <el-form-item label="产品分类:" class="form-cell" required style="margin: 0">
<div class="cell-box" style="display: flex"> <div class="cell-box" style="display: flex">
<el-form-item prop="productType"> <el-form-item prop="productType">
<el-select v-model="formData.productType" placeholder="产品大类" style="width: 120px" @change="changeProductType"> <el-select v-model="formData.productType" placeholder="产品大类" style="width: 240px" @change="changeProductType">
<el-option v-for="item in productTypeOpts" :key="item.id" :label="item.label" :value="item.value" /> <el-option v-for="item in productTypeOpts" :key="item.id" :label="item.label" :value="item.value" />
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item prop="productSubType" style="margin-left: 5px"> <el-form-item prop="productSubType" style="margin-left: 5px">
<el-select v-model="formData.productSubType" placeholder="产品小类" style="width: 160px"> <el-select v-model="formData.productSubType" placeholder="产品小类" style="width: 320px">
<el-option v-for="item in productSubTypeOpts" :key="item.id" :label="item.label" :value="item.value" /> <el-option v-for="item in productSubTypeOpts" :key="item.id" :label="item.label" :value="item.value" />
</el-select> </el-select>
</el-form-item> </el-form-item>
...@@ -144,11 +144,11 @@ ...@@ -144,11 +144,11 @@
<el-form-item label="产品价格区间(元):" class="form-cell" required style="margin: 0"> <el-form-item label="产品价格区间(元):" class="form-cell" required style="margin: 0">
<div class="cell-box" style="display: flex"> <div class="cell-box" style="display: flex">
<el-form-item prop="minPrice"> <el-form-item prop="minPrice">
<el-input v-model.number="formData.minPrice" placeholder="价格区间下限" class="cell-input" style="width: 180px" /> <el-input v-model.number="formData.minPrice" placeholder="价格区间下限" class="cell-input" style="width: 300px" />
</el-form-item> </el-form-item>
<div style="width: 20px;text-align: center">~</div> <div style="width: 20px;text-align: center">~</div>
<el-form-item prop="maxPrice"> <el-form-item prop="maxPrice">
<el-input v-model.number="formData.maxPrice" placeholder="价格区间上限" class="cell-input" style="width: 180px" /> <el-input v-model.number="formData.maxPrice" placeholder="价格区间上限" class="cell-input" style="width: 300px" />
</el-form-item> </el-form-item>
</div> </div>
</el-form-item> </el-form-item>
...@@ -216,8 +216,8 @@ ...@@ -216,8 +216,8 @@
</el-form> </el-form>
<div style="width: 100%;text-align: center"> <div style="width: 100%;text-align: center">
<el-button @click="cancelView">返回</el-button> <el-button @click="cancelView">返回</el-button>
<el-button type="primary" @click="submitForm()">保存</el-button> <el-button type="success" @click="submitForm()">保存</el-button>
<el-button type="warning" @click="submitForm()">提交</el-button> <el-button type="primary" @click="submitForm()">提交</el-button>
</div> </div>
</div> </div>
</div> </div>
...@@ -259,7 +259,7 @@ export default { ...@@ -259,7 +259,7 @@ export default {
}, 500) }, 500)
} }
return { return {
title: '产品', title: '',
uploadHeaders: { 'Authorization': getToken() }, uploadHeaders: { 'Authorization': getToken() },
imgSrcStart: process.env.VUE_APP_BASE_API, imgSrcStart: process.env.VUE_APP_BASE_API,
editor: false, // 富文本对象 editor: false, // 富文本对象
...@@ -332,12 +332,14 @@ export default { ...@@ -332,12 +332,14 @@ export default {
}, },
methods: { methods: {
onDictReady(dict) { onDictReady(dict) {
console.log(this.$route.params.type)
if (this.$route.params.type === 'hardware') { if (this.$route.params.type === 'hardware') {
this.title = '硬件'
this.productTypeOpts = dict.product_type.slice(0, 4) this.productTypeOpts = dict.product_type.slice(0, 4)
} else if (this.$route.params.type === 'other') { } else if (this.$route.params.type === 'other') {
this.title = '其他'
this.productTypeOpts = dict.product_type.slice(4) this.productTypeOpts = dict.product_type.slice(4)
} else { } else {
this.title = ''
this.productTypeOpts = dict.product_type this.productTypeOpts = dict.product_type
} }
this.loadData() this.loadData()
...@@ -589,7 +591,7 @@ export default { ...@@ -589,7 +591,7 @@ export default {
.cell-box { .cell-box {
min-width: 120px; min-width: 120px;
.cell-input { .cell-input {
width: 420px; width: 620px;
} }
.cell-select { .cell-select {
width: 220px; width: 220px;
......
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