Commit 82e8cb59 authored by zhanglw's avatar zhanglw

内容管理

parent 1007d0fc
......@@ -194,6 +194,43 @@ export const HttpReq = {
return res
})
},
// 内容管理-新增供应商列表页面
addSupplierListPage: function(data) {
return request({
url: '/api/bsw/supplierListPage/addSupplierListPage',
method: 'post',
data: data
}).then((res) => {
return res
})
},
// 内容管理-修改供应商列表页中供应商详情(排序、展示产品)
updateSupplierListPage: function(data) {
return request({
url: '/api/bsw/supplierListPage/updateSupplierListPage',
method: 'put',
data: data
}).then((res) => {
return res
})
},
// 内容管理-供应商列表批量发布
releaseSupplierListPage: function(data) {
return request({
url: '/api/bsw/supplierListPage/releaseSupplierListPage',
method: 'put',
data: data
}).then((res) => {
return res
})
},
// 内容管理-查询单个供应商列表页
querySupplierListPageById: function(params) {
return request({
url: '/api/bsw/supplierListPage/querySupplierListPageById?' + qs.stringify(params, { indices: false }),
method: 'get'
})
},
// 内容管理-供应商列表查询
querySupplierListPage: function(params) {
return request({
......@@ -201,6 +238,57 @@ export const HttpReq = {
method: 'get'
})
},
// 内容管理-查询产品列表页
queryProductListPage: function(params) {
return request({
url: '/api/bsw/productListPage/queryProductListPage?' + qs.stringify(params, { indices: false }),
method: 'get'
})
},
// 内容管理-查询首页内容列表页
queryHomePage: function(params) {
return request({
url: '/api/bsw/homePage/queryHomePage?' + qs.stringify(params, { indices: false }),
method: 'get'
})
},
// 内容管理-查询单个首页内容列表页
queryHomePageById: function(params) {
return request({
url: '/api/bsw/homePage/queryHomePageById?' + qs.stringify(params, { indices: false }),
method: 'get'
})
},
// 内容管理-新增首页内容
addHomePage: function(data) {
return request({
url: '/api/bsw/homePage/addHomePage',
method: 'post',
data: data
}).then((res) => {
return res
})
},
// 内容管理-修改首页内容
updateHomePage: function(data) {
return request({
url: '/api/bsw/homePage/updateHomePage',
method: 'put',
data: data
}).then((res) => {
return res
})
},
// 内容管理-首页管理批量发布
releaseHomePage: function(data) {
return request({
url: '/api/bsw/homePage/releaseHomePage',
method: 'put',
data: data
}).then((res) => {
return res
})
},
xxx: null
}
}
......
......@@ -2,7 +2,7 @@
<!-- 表单渲染 -->
<el-dialog append-to-body :close-on-click-modal="false" :before-close="cancelView" :visible="visible" :title="title" width="860px">
<el-form ref="formViewRef" :model="formData" :rules="rules" :status-icon="true" label-width="240px">
<el-form-item label="位置:" class="form-cell" prop="xxx">
<el-form-item label="位置:" class="form-cell" prop="type">
<div class="cell-box">
<el-select v-model="formData.type" placeholder="无" class="cell-select">
<el-option v-for="item in dict.home_setting" :key="item.value" :label="item.label" :value="item.value" />
......@@ -10,185 +10,185 @@
</div>
</el-form-item>
<div v-if="formData.type==='1'">
<el-form-item label="操作名称:" class="form-cell" prop="xxx">
<el-form-item label="操作名称:" class="form-cell" prop="operationName">
<div class="cell-box">
<el-input v-model="formData.xxx" placeholder="单行输入" class="cell-input" />
<el-input v-model="formData.operationName" placeholder="单行输入" class="cell-input" />
</div>
</el-form-item>
<el-form-item label="频道名称:" class="form-cell" prop="xxx">
<el-form-item label="频道名称:" class="form-cell" prop="channelName">
<div class="cell-box">
<el-input v-model="formData.xxx" placeholder="单行输入" class="cell-input" />
<el-input v-model="formData.channelName" placeholder="单行输入" class="cell-input" />
</div>
</el-form-item>
<el-form-item label="链接:" class="form-cell" prop="xxx">
<el-form-item label="链接:" class="form-cell" prop="url">
<div class="cell-box">
<el-input v-model="formData.xxx" placeholder="单行输入" class="cell-input" />
<el-input v-model="formData.url" placeholder="单行输入" class="cell-input" />
</div>
</el-form-item>
<el-form-item label="顺序:" class="form-cell" prop="operatingPeriod">
<div class="cell-box">
<el-input v-model.number="formData.index" type="number" placeholder="请输入数字" class="cell-input" />
<el-input v-model.number="formData.sort" type="number" placeholder="请输入数字" class="cell-input" />
</div>
</el-form-item>
</div>
<div v-if="formData.type==='2'">
<el-form-item label="操作名称:" class="form-cell" prop="xxx">
<el-form-item label="操作名称:" class="form-cell" prop="operationName">
<div class="cell-box">
<el-input v-model="formData.xxx" placeholder="单行输入" class="cell-input" />
<el-input v-model="formData.operationName" placeholder="单行输入" class="cell-input" />
</div>
</el-form-item>
<el-form-item label="搜索类型:" class="form-cell" prop="xxx">
<el-form-item label="搜索类型:" class="form-cell" prop="searchType">
<div class="cell-box">
<el-select v-model="formData.xx" placeholder="无" class="cell-select">
<el-select v-model="formData.searchType" placeholder="无" class="cell-select">
<el-option v-for="item in dict.home_setting_2" :key="item.value" :label="item.label" :value="item.value" />
</el-select>
</div>
</el-form-item>
<el-form-item label="内容:" class="form-cell" prop="xxx">
<el-form-item label="内容:" class="form-cell" prop="content">
<div class="cell-box">
<el-input v-model="formData.xxx" placeholder="单行输入" class="cell-input" />
<el-input v-model="formData.content" placeholder="单行输入" class="cell-input" />
</div>
</el-form-item>
<el-form-item label="顺序:" class="form-cell" prop="operatingPeriod">
<el-form-item label="顺序:" class="form-cell" prop="sort">
<div class="cell-box">
<el-input v-model.number="formData.index" type="number" placeholder="请输入数字" class="cell-input" />
<el-input v-model.number="formData.sort" type="number" placeholder="请输入数字" class="cell-input" />
</div>
</el-form-item>
</div>
<div v-if="formData.type==='3'">
<el-form-item label="操作名称:" class="form-cell" prop="xxx">
<el-form-item label="操作名称:" class="form-cell" prop="operationName">
<div class="cell-box">
<el-input v-model="formData.xxx" placeholder="单行输入" class="cell-input" />
<el-input v-model="formData.operationName" placeholder="单行输入" class="cell-input" />
</div>
</el-form-item>
<el-form-item label="供应商ID:" class="form-cell" prop="xxx">
<el-form-item label="供应商ID:" class="form-cell" prop="supplierId">
<div class="cell-box">
<el-input v-model="formData.xxx" placeholder="单行输入" class="cell-input" />
<el-input v-model="formData.supplierId" placeholder="单行输入" class="cell-input" />
</div>
</el-form-item>
<el-form-item label="供应商名称:" class="form-cell" prop="xxx">
<el-form-item label="供应商名称:" class="form-cell" prop="supplierName">
<div class="cell-box">
<el-input v-model="formData.xxx" placeholder="单行输入" class="cell-input" />
<el-input v-model="formData.supplierName" placeholder="单行输入" class="cell-input" />
</div>
</el-form-item>
<el-form-item label="是否设置为钻石供应商:" class="form-cell" prop="supplierLevel">
<el-form-item label="是否设置为钻石供应商:" class="form-cell" prop="diamondSupplier">
<div class="cell-box">
<el-radio-group v-model="formData.xxx" size="mini">
<el-radio label="0"></el-radio>
<el-radio-group v-model="formData.diamondSupplier" size="mini">
<el-radio label=""></el-radio>
<el-radio label="1"></el-radio>
</el-radio-group>
</div>
</el-form-item>
<el-form-item label="是否设置为热门供应商:" class="form-cell" prop="supplierLevel">
<el-form-item label="是否设置为热门供应商:" class="form-cell" prop="popularSupplier">
<div class="cell-box">
<el-radio-group v-model="formData.xxx" size="mini">
<el-radio label="0"></el-radio>
<el-radio-group v-model="formData.popularSupplier" size="mini">
<el-radio label=""></el-radio>
<el-radio label="1"></el-radio>
</el-radio-group>
</div>
</el-form-item>
<el-form-item label="顺序:" class="form-cell" prop="operatingPeriod">
<el-form-item label="顺序:" class="form-cell" prop="sort">
<div class="cell-box">
<el-input v-model.number="formData.index" type="number" placeholder="请输入数字" class="cell-input" />
<el-input v-model.number="formData.sort" type="number" placeholder="请输入数字" class="cell-input" />
</div>
</el-form-item>
</div>
<div v-if="formData.type==='4'">
<el-form-item label="操作名称:" class="form-cell" prop="xxx">
<el-form-item label="操作名称:" class="form-cell" prop="operationName">
<div class="cell-box">
<el-input v-model="formData.xxx" placeholder="单行输入" class="cell-input" />
<el-input v-model="formData.operationName" placeholder="单行输入" class="cell-input" />
</div>
</el-form-item>
<el-form-item label="产品分类:" class="form-cell" prop="xxx">
<el-form-item label="产品分类:" class="form-cell" prop="productType">
<div class="cell-box">
<el-select v-model="formData.xxx" placeholder="无" class="cell-select">
<el-select v-model="formData.productType" placeholder="无" class="cell-select">
<el-option v-for="item in dict.product_type" :key="item.value" :label="item.label" :value="item.value" />
</el-select>
</div>
</el-form-item>
<el-form-item label="产品ID:" class="form-cell" prop="xxx">
<el-form-item label="产品ID:" class="form-cell" prop="productId">
<div class="cell-box">
<el-input v-model="formData.xxx" placeholder="单行输入" class="cell-input" />
<el-input v-model="formData.productId" placeholder="单行输入" class="cell-input" />
</div>
</el-form-item>
<el-form-item label="产品运营名称:" class="form-cell" prop="xxx">
<el-form-item label="产品运营名称:" class="form-cell" prop="productOperationName">
<div class="cell-box">
<el-input v-model="formData.xxx" placeholder="单行输入" class="cell-input" />
<el-input v-model="formData.productOperationName" placeholder="单行输入" class="cell-input" />
</div>
</el-form-item>
<el-form-item label="是否设置为信得过产品:" class="form-cell" prop="supplierLevel">
<el-form-item label="是否设置为信得过产品:" class="form-cell" prop="trustworthyProduct">
<div class="cell-box">
<el-radio-group v-model="formData.xxx" size="mini">
<el-radio label="0"></el-radio>
<el-radio-group v-model="formData.trustworthyProduct" size="mini">
<el-radio label=""></el-radio>
<el-radio label="1"></el-radio>
</el-radio-group>
</div>
</el-form-item>
<el-form-item label="是否设置为热门产品:" class="form-cell" prop="supplierLevel">
<el-form-item label="是否设置为热门产品:" class="form-cell" prop="popularProduct">
<div class="cell-box">
<el-radio-group v-model="formData.xxx" size="mini">
<el-radio label="0"></el-radio>
<el-radio-group v-model="formData.popularProduct" size="mini">
<el-radio label=""></el-radio>
<el-radio label="1"></el-radio>
</el-radio-group>
</div>
</el-form-item>
<el-form-item label="顺序:" class="form-cell" prop="operatingPeriod">
<el-form-item label="顺序:" class="form-cell" prop="index">
<div class="cell-box">
<el-input v-model.number="formData.index" type="number" placeholder="请输入数字" class="cell-input" />
<el-input v-model.number="formData.sort" type="number" placeholder="请输入数字" class="cell-input" />
</div>
</el-form-item>
</div>
<div v-if="formData.type==='5'">
<el-form-item label="操作名称:" class="form-cell" prop="xxx">
<el-form-item label="操作名称:" class="form-cell" prop="operationName">
<div class="cell-box">
<el-input v-model="formData.xxx" placeholder="单行输入" class="cell-input" />
<el-input v-model="formData.operationName" placeholder="单行输入" class="cell-input" />
</div>
</el-form-item>
<el-form-item label="排行榜类型:" class="form-cell" prop="xxx">
<el-form-item label="排行榜类型:" class="form-cell" prop="rankingType">
<div class="cell-box">
<el-select v-model="formData.xxx" placeholder="无" class="cell-select">
<el-select v-model="formData.rankingType" placeholder="无" class="cell-select">
<el-option v-for="item in dict.home_setting_5" :key="item.value" :label="item.label" :value="item.value" />
</el-select>
</div>
</el-form-item>
<el-form-item v-if="formData.xxx==='2'" label="供应商ID:" class="form-cell" prop="xxx">
<el-form-item v-if="formData.rankingType==='1'" label="供应商ID:" class="form-cell" prop="supplierId">
<div class="cell-box">
<el-input v-model="formData.xxx" placeholder="单行输入" class="cell-input" />
<el-input v-model="formData.supplierId" placeholder="单行输入" class="cell-input" />
</div>
</el-form-item>
<el-form-item v-else label="产品ID:" class="form-cell" prop="xxx">
<el-form-item v-else label="产品ID:" class="form-cell" prop="productId">
<div class="cell-box">
<el-input v-model="formData.xxx" placeholder="单行输入" class="cell-input" />
<el-input v-model="formData.productId" placeholder="单行输入" class="cell-input" />
</div>
</el-form-item>
<el-form-item v-if="formData.xxx==='2'" label="供应商名称:" class="form-cell" prop="xxx">
<el-form-item v-if="formData.rankingType==='1'" label="供应商名称:" class="form-cell" prop="supplierName">
<div class="cell-box">
<el-input v-model="formData.xxx" placeholder="单行输入" class="cell-input" />
<el-input v-model="formData.supplierName" placeholder="单行输入" class="cell-input" />
</div>
</el-form-item>
<el-form-item v-else label="产品运营名称:" class="form-cell" prop="xxx">
<el-form-item v-else label="产品运营名称:" class="form-cell" prop="productOperationName">
<div class="cell-box">
<el-input v-model="formData.xxx" placeholder="单行输入" class="cell-input" />
<el-input v-model="formData.productOperationName" placeholder="单行输入" class="cell-input" />
</div>
</el-form-item>
<el-form-item label="顺序:" class="form-cell" prop="operatingPeriod">
<el-form-item label="顺序:" class="form-cell" prop="sort">
<div class="cell-box">
<el-input v-model.number="formData.index" type="number" placeholder="请输入数字" class="cell-input" />
<el-input v-model.number="formData.sort" type="number" placeholder="请输入数字" class="cell-input" />
</div>
</el-form-item>
</div>
<div v-if="formData.type==='6'">
<el-form-item label="操作名称:" class="form-cell" prop="xxx">
<el-form-item label="操作名称:" class="form-cell" prop="operationName">
<div class="cell-box">
<el-input v-model="formData.xxx" placeholder="单行输入" class="cell-input" />
<el-input v-model="formData.operationName" placeholder="单行输入" class="cell-input" />
</div>
</el-form-item>
<el-form-item label="合作伙伴名称名称:" class="form-cell" prop="xxx">
<el-form-item label="合作伙伴名称名称:" class="form-cell" prop="partnerName">
<div class="cell-box">
<el-input v-model="formData.xxx" placeholder="单行输入" class="cell-input" />
<el-input v-model="formData.partnerName" placeholder="单行输入" class="cell-input" />
</div>
</el-form-item>
<el-form-item label="合作伙伴LOGO:" class="form-cell" prop="xxx">
<el-form-item label="合作伙伴LOGO:" class="form-cell" prop="partnerLogo">
<div class="cell-box">
<el-upload
ref="uploadCom"
......@@ -209,45 +209,45 @@
</el-dialog>
</div>
</el-form-item>
<el-form-item label="链接:" class="form-cell" prop="xxx">
<el-form-item label="链接:" class="form-cell" prop="url">
<div class="cell-box">
<el-input v-model="formData.xxx" placeholder="单行输入" class="cell-input" />
<el-input v-model="formData.url" placeholder="单行输入" class="cell-input" />
</div>
</el-form-item>
<el-form-item label="顺序:" class="form-cell" prop="operatingPeriod">
<el-form-item label="顺序:" class="form-cell" prop="sort">
<div class="cell-box">
<el-input v-model.number="formData.index" type="number" placeholder="请输入数字" class="cell-input" />
<el-input v-model.number="formData.sort" type="number" placeholder="请输入数字" class="cell-input" />
</div>
</el-form-item>
</div>
<div v-if="formData.type==='7'">
<el-form-item label="操作名称:" class="form-cell" prop="xxx">
<el-form-item label="操作名称:" class="form-cell" prop="operationName">
<div class="cell-box">
<el-input v-model="formData.xxx" placeholder="单行输入" class="cell-input" />
<el-input v-model="formData.operationName" placeholder="单行输入" class="cell-input" />
</div>
</el-form-item>
<el-form-item label="链接名称:" class="form-cell" prop="xxx">
<el-form-item label="链接名称:" class="form-cell" prop="linkName">
<div class="cell-box">
<el-input v-model="formData.xxx" placeholder="单行输入" class="cell-input" />
<el-input v-model="formData.linkName" placeholder="单行输入" class="cell-input" />
</div>
</el-form-item>
<el-form-item label="链接:" class="form-cell" prop="xxx">
<el-form-item label="链接:" class="form-cell" prop="url">
<div class="cell-box">
<el-input v-model="formData.xxx" placeholder="单行输入" class="cell-input" />
<el-input v-model="formData.url" placeholder="单行输入" class="cell-input" />
</div>
</el-form-item>
<el-form-item label="顺序:" class="form-cell" prop="operatingPeriod">
<el-form-item label="顺序:" class="form-cell" prop="sort">
<div class="cell-box">
<el-input v-model.number="formData.index" type="number" placeholder="请输入数字" class="cell-input" />
<el-input v-model.number="formData.sort" type="number" placeholder="请输入数字" class="cell-input" />
</div>
</el-form-item>
</div>
</el-form>
<div slot="footer" class="dialog-footer" style="text-align: center">
<el-button @click="cancelView">关闭</el-button>
<el-button type="danger" @click="submitForm()">预览</el-button>
<!-- <el-button type="danger" @click="submitForm()">预览</el-button>-->
<el-button type="primary" @click="submitForm()">保存</el-button>
<el-button type="success" @click="submitForm()">发布</el-button>
<el-button v-if="formData.homePageId" type="success" @click="submitForm(true)">发布</el-button>
</div>
</el-dialog>
</template>
......@@ -267,14 +267,28 @@ export default {
title: '添加首页内容',
formData: {
type: '1',
xxx: '',
index: 999,
id: null
operationName: '', // 操作名称
channelName: '', // 频道名称
url: '', // 链接
searchType: '', // 搜索类型
content: '', // 内容
supplierId: '', // 供应商id
supplierName: '', // 供应商名称
popularSupplier: '', // 是否热门供应商
diamondSupplier: '', // 是否设置为钻石供应商
productType: '', // 产品分类
productId: '', // 产品ID
productOperationName: '', // 产品运营名称
trustworthyProduct: '', // 是否设置为信得过产品
popularProduct: '', // 是否设置为热门产品
rankingType: '1', // 排行榜类型
partnerName: '', // 合作伙伴名称名称
partnerLogo: '', // 合作伙伴LOGO
linkName: '', // 链接名称
sort: 1, // 顺序
homePageId: null
},
rules: {
enterpriseName: { required: true, message: '请填写企业名称', trigger: 'blur' },
businessScopeIntroduction: { required: true, message: '请填写业务范围介绍', trigger: 'blur' }
}
rules: {}
}
},
mounted() {
......@@ -293,21 +307,53 @@ export default {
cancelView() {
this.hideView()
},
submitForm() {
console.log(this.formData)
release() {
HttpReq.backstageApi.releaseHomePage({ ids: [this.formData.homePageId] }).then((res) => {
this.$notify({
title: res.msg,
type: res.code === 200 ? 'success' : 'error',
duration: 2500
})
if (res.code === 200) {
this.cancelView()
this.$parent.loadData()
}
})
},
submitForm(isRelease) {
this.$refs.formViewRef.validate((valid, obj) => {
if (valid) {
// HttpReq.backstageApi.addCustomer(this.formData).then((res) => {
// this.$notify({
// title: res.msg,
// type: 'success',
// duration: 2500
// })
// if (res.code === 200) {
// this.cancelView()
// this.$parent.loadData()
// }
// })
if (this.formData.homePageId) {
HttpReq.backstageApi.updateHomePage(this.formData).then((res) => {
this.$notify({
title: res.msg,
type: res.code === 200 ? 'success' : 'error'
})
if (res.code === 200) {
if (isRelease) {
this.release()
} else {
this.cancelView()
this.$parent.loadData()
}
}
})
} else {
HttpReq.backstageApi.addHomePage(this.formData).then((res) => {
this.$notify({
title: res.msg,
type: res.code === 200 ? 'success' : 'error'
})
if (res.code === 200) {
if (isRelease) {
this.release()
} else {
this.cancelView()
this.$parent.loadData()
}
}
})
}
} else {
this.$message({
message: '表单信息有误,请核对无误后提交!',
......@@ -316,8 +362,43 @@ export default {
}
})
},
loadData() {
loadData(homePageId) {
this.formData = {
type: '1',
operationName: '', // 操作名称
channelName: '', // 频道名称
url: '', // 链接
searchType: '', // 搜索类型
content: '', // 内容
supplierId: '', // 供应商id
supplierName: '', // 供应商名称
popularSupplier: '', // 是否热门供应商
diamondSupplier: '', // 是否设置为钻石供应商
productType: '', // 产品分类
productId: '', // 产品ID
productOperationName: '', // 产品运营名称
trustworthyProduct: '', // 是否设置为信得过产品
popularProduct: '', // 是否设置为热门产品
rankingType: '1', // 排行榜类型
partnerName: '', // 合作伙伴名称名称
partnerLogo: '', // 合作伙伴LOGO
linkName: '', // 链接名称
sort: 1, // 顺序
homePageId: null
}
if (homePageId) {
HttpReq.backstageApi.queryHomePageById({ homePageId }).then((res) => {
if (res.code === 200) {
this.formData = Object.assign(this.formData, res.data)
} else {
this.$message({
message: res.msg,
type: 'error'
})
}
})
}
this.showView()
},
handleExceed() {
this.$message({
......
......@@ -2,14 +2,14 @@
<div class="app-container">
<!--工具栏-->
<div class="head-container">
<el-select v-model="query.area" clearable placeholder="请选择位置" style="width: 150px">
<el-option v-for="item in dict.product_type" :key="item.value" :label="item.label" :value="item.value" />
<el-select v-model="query.type" clearable placeholder="请选择位置" style="width: 150px">
<el-option v-for="item in dict.home_setting" :key="item.value" :label="item.label" :value="item.value" />
</el-select>
<el-input v-model="query.username" clearable placeholder="请输入操作名称" style="width:280px;" />
<el-input v-model="query.operationName" clearable placeholder="请输入操作名称" style="width:280px;" />
<el-select v-model="query.status" clearable placeholder="请选择状态" style="width: 120px">
<el-option v-for="item in dict.issue_status" :key="item.value" :label="item.label" :value="item.value" />
</el-select>
<date-range-picker v-model="query.createTime" start-placeholder="维护开始日期" style="width: 280px" />
<date-range-picker v-model="query.updateTime" start-placeholder="维护开始日期" style="width: 280px" />
<el-button type="success" icon="el-icon-search" @click="toSearch">搜索</el-button>
<el-button type="warning" icon="el-icon-refresh" @click="clearLimit">重置</el-button>
</div>
......@@ -18,7 +18,7 @@
<el-button type="primary" icon="el-icon-circle-plus-outline" @click="toAdd">添加</el-button>
</div>
<div style="text-align: right">
<el-button type="success" icon="el-icon-finished" :disabled="!multipleSelection.length" @click="batchOperate(true)">批量发布</el-button>
<el-button type="success" icon="el-icon-finished" :disabled="!multipleSelection.length" @click="batchOperate(1)">批量发布</el-button>
</div>
</div>
<!-- 表格 -->
......@@ -26,19 +26,19 @@
<el-table id="dataTable" ref="dataTable" v-loading="loading" :data="tableData" tooltip-effect="dark" style="width:auto;min-height: 70vh" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" />
<el-table-column type="index" width="55" label="序号" :index="indexMethod" />
<el-table-column prop="area" label="位置" width="200" />
<el-table-column prop="xxx" label="操作名称" />
<el-table-column prop="type" label="位置" width="200" :formatter="(row, col, val)=>{return dict.label.home_setting[val]}" />
<el-table-column prop="operationName" label="操作名称" />
<el-table-column label="状态" width="100">
<template slot-scope="scope">
<div :style="'color:'+textColors[scope.row.status]">{{ dict.label.issue_status[scope.row.status] }}</div>
</template>
</el-table-column>
<el-table-column prop="xxx" label="最后维护日期" align="center" width="200" />
<el-table-column prop="xxx" label="操作" align="right" width="240">
<el-table-column prop="updateTime" label="最后维护日期" align="center" width="200" />
<el-table-column label="操作" align="right" width="240">
<template slot-scope="scope">
<el-tooltip v-if="scope.row.status==='1'" content="发布"><el-button round plain type="success" icon="el-icon-finished" @click="toEdit(scope.row)" /></el-tooltip>
<el-tooltip v-if="scope.row.status==='1'" content="发布"><el-button round plain type="success" icon="el-icon-finished" @click="batchOperate(1, scope.row)" /></el-tooltip>
<el-tooltip content="编辑"><el-button round plain type="primary" icon="el-icon-edit-outline" @click="toEdit(scope.row)" /></el-tooltip>
<el-tooltip content="查看"><el-button round plain icon="el-icon-view" @click="toEdit(scope.row)" /></el-tooltip>
<el-tooltip content="查看"><el-button round plain icon="el-icon-view" @click="toView(scope.row)" /></el-tooltip>
<el-tooltip content="删除"><el-button round plain type="danger" icon="el-icon-delete" @click="toDelete(scope.row)" /></el-tooltip>
</template>
</el-table-column>
......@@ -56,7 +56,7 @@ import addPage from './add'
export default {
components: { DateRangePicker, addPage },
dicts: ['issue_status', 'product_type', 'area_province'],
dicts: ['issue_status', 'home_setting'],
data() {
return {
textColors: ['#ccc', '#bba', '#32cd32'],
......@@ -84,47 +84,44 @@ export default {
this.multipleSelection = val
},
loadData() {
var sort = 'id,desc'
var param = { ...this.query }
param.page = this.page
param.pageSize = this.pageSize
param.sort = sort
this.tableData = [
{ username: '张三', area: '火星', status: '1', enabled: false, xxx: '2023-05-09' },
{ username: '张三', area: '火星', status: '2', enabled: false, xxx: '2023-05-09' },
{ username: '张三', area: '火星', status: '1', enabled: false, xxx: '2023-05-09' }
]
this.total = 2
Object.keys(this.query).length !== 0 && Object.keys(this.query).forEach(item => {
if (this.query[item] === null || this.query[item] === '') this.query[item] = undefined
})
HttpReq.backstageApi.queryHomePage({
page: this.page - 1,
pageSize: this.pageSize,
...this.query
}).then((res) => {
this.tableData = res.data.data
this.total = res.data.total
})
},
batchOperate(opt) {
if (!this.multipleSelection.length) {
batchOperate(type, row) {
if (!row && !this.multipleSelection.length) {
return this.$message({
message: '未选取数据',
type: 'info'
})
}
if (opt) {
console.log('启用', this.multipleSelection)
} else {
console.log('启用', this.multipleSelection)
}
},
changeEnabled(data, val) {
this.$confirm('此操作将 "' + this.dict.label.user_status[val] + '" ' + data.username + ', 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
}).catch(() => {
data.enabled = !data.enabled
HttpReq.backstageApi.releaseHomePage({
ids: row ? [row.homePageId] : this.multipleSelection.map(item => { return item.homePageId })
}).then((res) => {
this.$notify({
title: res.msg,
type: res.code === 200 ? 'success' : 'error',
duration: 2500
})
this.loadData()
})
},
toAdd() {
this.$refs.addPage.showView()
this.$refs.addPage.loadData()
},
toEdit(item) {
this.$refs.addPage.loadData(item.homePageId)
},
toView(item) {
this.$refs.addPage.loadData(item.homePageId)
},
toDelete(item) {
......
......@@ -4,7 +4,9 @@
<el-form ref="formViewRef" :model="formData" :rules="rules" :status-icon="true" label-width="240px">
<el-form-item label="产品类型名称:" class="form-cell" prop="xxx">
<div class="cell-box">
<el-input v-model="formData.xxx" disabled placeholder="单行输入" class="cell-input" />
<el-select v-model="formData.productType" disabled placeholder="无" class="cell-select">
<el-option v-for="item in dict.product_type" :key="item.value" :label="item.label" :value="item.value" />
</el-select>
</div>
</el-form-item>
<el-form-item label="产品ID:" class="form-cell" prop="xxx">
......@@ -27,13 +29,13 @@ import { getToken } from '@/utils/auth'
import { HttpReq } from '@/api/common'
export default {
dicts: ['supplier_rank'],
dicts: ['product_type'],
data() {
return {
visible: false,
title: '内容管理供应商设置',
formData: {
xxx: '',
productType: '',
dataList: [
{ id: '123', index: '1' },
{ id: '222', index: '2' },
......@@ -84,7 +86,22 @@ export default {
}
})
},
loadData(id) {
loadData(productListPageId) {
// if (productListPageId) {
// HttpReq.backstageApi.querySupplierListPageById({ productListPageId }).then((res) => {
// if (res.code === 200) {
// this.formData = Object.assign(this.formData, res.data)
// if (this.formData.productIdList) {
// const arr = this.formData.productIdList.split(';')
// }
// } else {
// this.$message({
// message: res.msg,
// type: 'error'
// })
// }
// })
// }
this.showView()
}
}
......
......@@ -2,11 +2,13 @@
<div class="app-container">
<!--工具栏-->
<div class="head-container">
<el-input v-model="query.username" clearable placeholder="请输入产品类型名称" style="width:280px;" />
<el-select v-model="query.productType" clearable placeholder="请选择产品类型" style="width: 150px">
<el-option v-for="item in dict.product_type" :key="item.value" :label="item.label" :value="item.value" />
</el-select>
<el-select v-model="query.status" clearable placeholder="请选择状态" style="width: 120px">
<el-option v-for="item in dict.issue_status" :key="item.value" :label="item.label" :value="item.value" />
</el-select>
<date-range-picker v-model="query.createTime" start-placeholder="维护开始日期" style="width: 280px" />
<date-range-picker v-model="query.updateTime" start-placeholder="维护开始日期" style="width: 280px" />
<el-button type="success" icon="el-icon-search" @click="toSearch">搜索</el-button>
<el-button type="warning" icon="el-icon-refresh" @click="clearLimit">重置</el-button>
</div>
......@@ -15,14 +17,14 @@
<div class="content">
<el-table id="dataTable" ref="dataTable" v-loading="loading" :data="tableData" tooltip-effect="dark" style="width:auto;min-height: 70vh">
<el-table-column type="index" width="55" label="序号" :index="indexMethod" />
<el-table-column prop="area" label="产品类型名称" />
<el-table-column prop="productType" label="产品类型名称" :formatter="(row, col, val)=>{return dict.label.product_type[val]}" />
<el-table-column label="状态" width="100">
<template slot-scope="scope">
<div :style="'color:'+textColors[scope.row.status]">{{ dict.label.issue_status[scope.row.status] }}</div>
</template>
</el-table-column>
<el-table-column prop="xxx" label="最后维护日期" align="center" width="200" />
<el-table-column prop="xxx" label="操作" align="right" width="240">
<el-table-column prop="updateTime" label="最后维护日期" align="center" width="200" />
<el-table-column label="操作" align="right" width="240">
<template slot-scope="scope">
<el-tooltip v-if="scope.row.status==='1'" content="发布"><el-button round plain type="success" icon="el-icon-finished" @click="toEdit(scope.row)" /></el-tooltip>
<el-tooltip content="设置"><el-button round plain icon="el-icon-s-tools" @click="toEdit(scope.row)" /></el-tooltip>
......@@ -70,17 +72,18 @@ export default {
this.multipleSelection = val
},
loadData() {
var sort = 'id,desc'
var param = { ...this.query }
param.page = this.page
param.pageSize = this.pageSize
param.sort = sort
this.tableData = [
{ username: '张三', area: '火星', status: '1', enabled: false, xxx: '2023-05-09' },
{ username: '张三', area: '火星', status: '2', enabled: false, xxx: '2023-05-09' },
{ username: '张三', area: '火星', status: '1', enabled: false, xxx: '2023-05-09' }
]
this.total = 2
// 清除参数无值的情况
Object.keys(this.query).length !== 0 && Object.keys(this.query).forEach(item => {
if (this.query[item] === null || this.query[item] === '') this.query[item] = undefined
})
HttpReq.backstageApi.queryProductListPage({
page: this.page - 1,
pageSize: this.pageSize,
...this.query
}).then((res) => {
this.tableData = res.data.data
this.total = res.data.total
})
},
batchOperate(opt) {
if (!this.multipleSelection.length) {
......@@ -95,19 +98,8 @@ export default {
console.log('启用', this.multipleSelection)
}
},
changeEnabled(data, val) {
this.$confirm('此操作将 "' + this.dict.label.user_status[val] + '" ' + data.username + ', 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
}).catch(() => {
data.enabled = !data.enabled
})
},
toEdit(item) {
this.$refs.editPage.loadData(item.customerId)
this.$refs.editPage.loadData(item.productListPageId)
},
toSearch() {
this.page = 1
......
......@@ -9,7 +9,7 @@
</el-form-item>
<el-form-item label="供应商ID:" class="form-cell" prop="xxx">
<div class="cell-box">
<el-input v-model="formData.supplierId" placeholder="单行输入" class="cell-input" />
<el-input v-model="formData.customerId" placeholder="单行输入" class="cell-input" />
</div>
</el-form-item>
<el-form-item label="标识设置:" class="form-cell" prop="supplierLevel">
......@@ -21,25 +21,25 @@
</el-form-item>
<el-form-item label="顺序:" class="form-cell" prop="operatingPeriod">
<div class="cell-box">
<el-input v-model.number="formData.index" type="number" placeholder="请输入数字" class="cell-input" />
<el-input v-model.number="formData.sort" type="number" placeholder="请输入数字" class="cell-input" />
</div>
</el-form-item>
<el-form-item label="展示产品ID:" class="form-cell" prop="xxx">
<el-form-item label="展示产品ID:" class="form-cell">
<div class="cell-box">
<el-input v-model="formData.xxx" placeholder="单行输入" class="cell-input" />
<el-input v-model="formData.pid0" placeholder="单行输入" class="cell-input" />
</div>
<div class="cell-box">
<el-input v-model="formData.xxx" placeholder="单行输入" class="cell-input" />
<el-input v-model="formData.pid1" placeholder="单行输入" class="cell-input" />
</div>
<div class="cell-box">
<el-input v-model="formData.xxx" placeholder="单行输入" class="cell-input" />
<el-input v-model="formData.pid2" placeholder="单行输入" class="cell-input" />
</div>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer" style="text-align: center">
<el-button @click="cancelView">关闭</el-button>
<el-button type="primary" @click="saveForm()">保存</el-button>
<el-button type="success" @click="submitForm()">发布</el-button>
<el-button type="primary" @click="submitForm()">保存</el-button>
<el-button v-if="formData.supplierListPageId" type="success" @click="submitForm(true)">发布</el-button>
</div>
</el-dialog>
</template>
......@@ -55,9 +55,14 @@ export default {
title: '内容管理供应商设置',
formData: {
supplierName: '',
supplierId: '',
customerId: '',
mark: '1',
id: null
sort: '999',
pid0: '',
pid1: '',
pid2: '',
productIdList: '',
supplierListPageId: null
},
rules: {}
}
......@@ -71,34 +76,98 @@ export default {
hideView() {
this.$refs.formViewRef.resetFields()
this.visible = false
this.formData = {
supplierName: '',
customerId: '',
mark: '1',
sort: '999',
pid0: '',
pid1: '',
pid2: '',
productIdList: '',
supplierListPageId: null
}
},
cancelView() {
this.hideView()
},
saveForm() {},
submitForm() {
release() {
HttpReq.backstageApi.releaseSupplierListPage({ ids: [this.formData.supplierListPageId] }).then((res) => {
this.$notify({
title: res.msg,
type: res.code === 200 ? 'success' : 'error',
duration: 2500
})
if (res.code === 200) {
this.cancelView()
this.$parent.loadData()
}
})
},
submitForm(isRelease) {
this.$refs.formViewRef.validate((valid, obj) => {
if (valid) {
// HttpReq.backstageApi.updateCustomerDetail(this.formData).then((res) => {
// this.$notify({
// title: res.msg,
// type: 'success',
// duration: 2500
// })
// if (res.code === 200) {
// this.cancelView()
// this.$parent.loadData()
// }
// })
// } else {
// this.$message({
// message: '表单信息有误,请核对无误后提交!',
// type: 'error'
// })
this.formData.productIdList = [this.formData.pid0, this.formData.pid1, this.formData.pid2].join(';')
if (this.formData.supplierListPageId) {
HttpReq.backstageApi.updateSupplierListPage(this.formData).then((res) => {
this.$notify({
title: res.msg,
type: res.code === 200 ? 'success' : 'error',
duration: 2500
})
if (res.code === 200) {
if (isRelease) {
this.release()
} else {
this.cancelView()
this.$parent.loadData()
}
}
})
} else {
HttpReq.backstageApi.addSupplierListPage(this.formData).then((res) => {
this.$notify({
title: res.msg,
type: res.code === 200 ? 'success' : 'error',
duration: 2500
})
if (res.code === 200) {
if (isRelease) {
this.release()
} else {
this.cancelView()
this.$parent.loadData()
}
}
})
}
} else {
this.$message({
message: '表单信息有误,请核对无误后提交!',
type: 'error'
})
}
})
},
loadData(id) {
loadData(supplierListPageId) {
if (supplierListPageId) {
HttpReq.backstageApi.querySupplierListPageById({ supplierListPageId }).then((res) => {
if (res.code === 200) {
this.formData = Object.assign(this.formData, res.data)
if (this.formData.productIdList) {
const arr = this.formData.productIdList.split(';')
this.formData.pid0 = arr[0]
this.formData.pid1 = arr[1]
this.formData.pid2 = arr[2]
}
} else {
this.$message({
message: res.msg,
type: 'error'
})
}
})
}
this.showView()
}
}
......
......@@ -5,14 +5,14 @@
<el-select v-model="query.area" clearable placeholder="请选择地区" style="width: 150px">
<el-option v-for="item in dict.area_province" :key="item.value" :label="item.label" :value="item.value" />
</el-select>
<el-select v-model="query.status" clearable placeholder="请选择标识" style="width: 120px">
<el-select v-model="query.mark" clearable placeholder="请选择标识" style="width: 120px">
<el-option v-for="item in dict.supplier_rank" :key="item.value" :label="item.label" :value="item.value" />
</el-select>
<el-input v-model="query.username" clearable placeholder="请输入供应商名称" style="width:280px;" />
<el-input v-model="query.supplierName" clearable placeholder="请输入供应商名称" style="width:280px;" />
<el-select v-model="query.status" clearable placeholder="请选择状态" style="width: 120px">
<el-option v-for="item in dict.issue_status" :key="item.value" :label="item.label" :value="item.value" />
</el-select>
<date-range-picker v-model="query.createTime" start-placeholder="维护开始日期" style="width: 280px" />
<date-range-picker v-model="query.updateTime" start-placeholder="维护开始日期" style="width: 280px" />
<el-button type="success" icon="el-icon-search" @click="toSearch">搜索</el-button>
<el-button type="warning" icon="el-icon-refresh" @click="clearLimit">重置</el-button>
</div>
......@@ -21,7 +21,7 @@
<el-button type="primary" icon="el-icon-circle-plus-outline" @click="toAdd">添加</el-button>
</div>
<div style="text-align: right">
<el-button type="success" icon="el-icon-finished" :disabled="!multipleSelection.length" @click="batchOperate(true)">批量发布</el-button>
<el-button type="success" icon="el-icon-finished" :disabled="!multipleSelection.length" @click="batchOperate(1)">批量发布</el-button>
</div>
</div>
<!-- 表格 -->
......@@ -30,7 +30,7 @@
<el-table-column type="selection" width="55" />
<el-table-column type="index" width="55" label="序号" :index="indexMethod" />
<el-table-column prop="mark" label="标识" width="200" :formatter="(row, col, val)=>{return dict.label.supplier_rank[val]}" />
<el-table-column prop="supplierName" label="供应产品名称" />
<el-table-column prop="supplierName" label="供应名称" />
<el-table-column label="状态" width="100">
<template slot-scope="scope">
<div :style="'color:'+textColors[scope.row.status]">{{ dict.label.issue_status[scope.row.status] }}</div>
......@@ -39,7 +39,7 @@
<el-table-column prop="updateTime" label="最后维护日期" align="center" width="200" />
<el-table-column label="操作" align="right" width="240">
<template slot-scope="scope">
<el-tooltip v-if="scope.row.status==='1'" content="发布"><el-button round plain type="success" icon="el-icon-finished" @click="toEdit(scope.row)" /></el-tooltip>
<el-tooltip v-if="scope.row.status==='1'" content="发布"><el-button round plain type="success" icon="el-icon-finished" @click="batchOperate(1, scope.row)"/></el-tooltip>
<el-tooltip content="设置"><el-button round plain icon="el-icon-s-tools" @click="toEdit(scope.row)" /></el-tooltip>
</template>
</el-table-column>
......@@ -98,35 +98,29 @@ export default {
this.total = res.data.total
})
},
batchOperate(opt) {
if (!this.multipleSelection.length) {
batchOperate(type, row) {
if (!row && !this.multipleSelection.length) {
return this.$message({
message: '未选取数据',
type: 'info'
})
}
if (opt) {
console.log('启用', this.multipleSelection)
} else {
console.log('启用', this.multipleSelection)
}
},
changeEnabled(data, val) {
this.$confirm('此操作将 "' + this.dict.label.user_status[val] + '" ' + data.username + ', 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
}).catch(() => {
data.enabled = !data.enabled
HttpReq.backstageApi.releaseSupplierListPage({
ids: row ? [row.supplierListPageId] : this.multipleSelection.map(item => { return item.supplierListPageId })
}).then((res) => {
this.$notify({
title: res.msg,
type: res.code === 200 ? 'success' : 'error',
duration: 2500
})
this.loadData()
})
},
toAdd() {
this.$refs.editPage.loadData()
},
toEdit(item) {
this.$refs.editPage.loadData(item.customerId)
this.$refs.editPage.loadData(item.supplierListPageId)
},
toSearch() {
this.page = 1
......
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