Commit 82e8cb59 authored by zhanglw's avatar zhanglw

内容管理

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