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,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