Commit 7b7809f8 by cwq0219

晒单,分类列表

1 parent efb32232
......@@ -59,13 +59,13 @@ export default {
#app {
background: #f4f5fa;
padding: 0px 20px 20px 40px;
position: absolute;
box-sizing: border-box;
width: 100%;
top: 0px;
left: 0px;
overflow-y: auto;
height: 100%;
// position: absolute;
// box-sizing: border-box;
// width: 100%;
// top: 0px;
// left: 0px;
// overflow-y: auto;
// height: 100%;
}
</style>
>
import { http } from '@/main'
const defaultPath = 'scrm.api.shopmall.'
const getListApi = params => {
params.method = `${defaultPath}classify.page.curMerchant`
return http({
url: 'rop-scrm-shopmall/router',
method: 'GET',
data: params,
sign: true
})
}
export default { getListApi }
import { http } from '@/main'
const defaultPath = 'scrm.api.shopmall.'
const getListApi = params => {
params.method = `${defaultPath}orderShareRecord.page`
return http({
url: 'rop-scrm-shopmall/router',
method: 'GET',
data: params,
sign: true
})
}
export default { getListApi }
......@@ -2,7 +2,7 @@ import { http } from '@/main'
const defaultPath = 'scrm.api.shopmall.'
const getZoneList = params => {
const getZoneListApi = params => {
params.method = `${defaultPath}zoneInfo.page`
return http({
url: 'rop-scrm-shopmall/router',
......@@ -44,4 +44,4 @@ const insertZoneApi = params => {
})
}
export default { getZoneList, deleteZoneApi, getZoneInfoApi, insertZoneApi }
export default { getZoneListApi, deleteZoneApi, getZoneInfoApi, insertZoneApi }
......@@ -21,6 +21,30 @@ const staticRoutes = Object.freeze([
path: '/homeSet/index',
component: resolve => require([`@/views/homeSet/index.vue`], resolve),
meta: {}
}
},
{
name: 'orderShare',
path: '/orderShare/index',
component: resolve => require([`@/views/orderShare/index.vue`], resolve),
meta: {}
},
{
name: 'editShare',
path: '/orderShare/editShare',
component: resolve => require([`@/views/orderShare/editShare.vue`], resolve),
meta: {}
},
{
name: 'classifyList',
path: '/zoneList/index',
component: resolve => require([`@/views/classifyList/index.vue`], resolve),
meta: {}
},
{
name: 'editClassify',
path: '/classifyList/editClassify',
component: resolve => require([`@/views/classifyList/editClassify.vue`], resolve),
meta: {}
},
])
export default staticRoutes
<!-- 编辑分类 -->
<template>
<div></div>
</template>
<script>
export default {
name: 'editClassify',
data() {
return {
}
},
components: {},
computed: {},
mounted() {},
methods: {}
}
</script>
<style scoped>
</style>
<!-- 分类管理 -->
<template>
<div class="marketing">
<div class="m-b-20">
<el-button :size="size" type="primary" class="el-icon-plus" @click="handleEdit(1)">新增分类</el-button>
</div>
<div class="container">
<div>
<glsx-combi-form ref="showSearch" labelWidth="90px" :formObj="searchForm" :formData="searchFormData">
<span slot="footer" class="footer-btns">
<el-button :size="size" type="primary" @click="handleSearch">查询</el-button>
<el-button :size="size" type="primary" @click="handleReset">重置</el-button>
</span>
</glsx-combi-form>
</div>
<!-- 表格区域 开始 -->
<GLTable ref="classifyRef" :getListApi="getListApi" :searchForm="tableSearchForm" :tableParams="tableParams" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn">
<div class="table-btns" slot="auth-button" slot-scope="scope">
<el-button type="text" @click="handleEdit(2, scope.scope)">编辑</el-button>
<el-button type="text" @click="handleDelete(scope.scope)">删除</el-button>
<el-button type="text" @click="handleDelete(scope.scope)">置顶</el-button>
</div>
</GLTable>
<!-- 表格区域 end -->
</div>
</div>
</template>
<script>
export default {
name: 'classifyList',
data() {
return {
size: 'small',
searchForm: {
classifyName: '',
createDate: []
},
tableSearchForm: {},
// 搜索
searchFormData: [
{
label: '分类名称',
name: 'classifyName',
type: 'input',
maxlength: 20
},
{
label: '创建日期',
name: 'createDate',
type: 'datePicker',
isClear: true,
pickerOptions: 'beforeRangePickerOptions'
}
],
// 表格
getListApi: this.$apis.classifyList.getListApi,
tableParams: {
listName: 'list',
tableOption: true,
tableColumns: [
{
label: '专区名称',
prop: 'classifyName'
},
{
label: '创建日期',
prop: 'createdDate',
formatter: cellValue => {
return new Date(cellValue.createdDate).toLocaleDateString().replace(/\//g, '-')
}
}
]
},
pageConf: { pageSize: 'pageSize', pageNum: 'currentPage', totalCount: 'total' }
}
},
mounted() {},
methods: {
getParams() {
var params = JSON.parse(JSON.stringify(this.searchForm))
if (this.searchForm.createDate.length) {
params.startTime = new Date(this.searchForm.createDate[0]).toLocaleDateString().replace(/\//g, '-') + ' 00:00:00'
params.endTime = new Date(this.searchForm.createDate[1]).toLocaleDateString().replace(/\//g, '-') + ' 23:59:59'
}
delete params.createDate
return params
},
beforeSearchFn() {
return new Promise(resolve => {
this.tableSearchForm = this.getParams()
delete this.tableSearchForm.createDate
resolve()
})
},
// 1-新增;2-编辑
handleEdit(addOrEdit, row) {
addOrEdit == 1 ? this.$router.push('/classifyList/editClassify/' + addOrEdit) : this.$router.push('/classifyList/editClassify/' + addOrEdit + '/' + row.id)
},
handleDelete(row) {
this.$confirm('是否确认删除该专区?', '删除', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
callback: action => {
if (action == 'confirm') {
// this.$apis.zoneList.deleteZoneApi({ id: row.id }).then(res => {
// this.$message({
// message: res.code == '0' ? '操作成功' : res.message,
// type: res.code == '0' ? 'success' : 'error'
// })
// if (res.code == '0') {
// this.handleSearch()
// }
// })
}
}
})
},
handleSearch() {
this.$refs.classifyRef.refreshTable()
},
handleReset() {
this.searchForm = {
classifyName: '',
createDate: []
}
this.handleSearch()
}
}
}
</script>
<style scoped></style>
......@@ -59,7 +59,7 @@
<script>
// import '@/assets/css/public.scss'
import _ from 'lodash'
import { uploadImg, getMerchantList, getZoneList } from '@/api/modules/common'
import { uploadImg, getMerchantList, getZoneListApi } from '@/api/modules/common'
import { insertLiveRoomApi, getLiveRoomInfoApi } from '@/api/modules/liveRoom'
import glsxCombiForm from '@/components/glsx-combi-form'
// import glsxDialog from '@/components/glsx-dialog'
......@@ -267,7 +267,7 @@ export default {
})
},
getZoneList() {
getZoneList({}).then(res => {
getZoneListApi({}).then(res => {
this.baseData.zoneList = res.list
this.getOptionsList('editFormData', false)
})
......
<!-- 编辑晒单 -->
<template>
<div></div>
</template>
<script>
export default {
name: 'editShare',
data() {
return {
}
},
components: {},
computed: {},
mounted() {},
methods: {}
}
</script>
<style scoped>
</style>
<!-- 晒单管理 -->
<template>
<div class="marketing">
<div class="m-b-20">
<el-button :size="size" type="primary" class="el-icon-plus" @click="handleEdit(1)">我要晒单</el-button>
</div>
<div class="container">
<div>
<glsx-combi-form ref="showSearch" labelWidth="90px" :formObj="searchForm" :formData="searchFormData">
<span slot="footer" class="footer-btns">
<el-button :size="size" type="primary" @click="handleSearch">查询</el-button>
<el-button :size="size" type="primary" @click="handleReset">重置</el-button>
</span>
</glsx-combi-form>
</div>
<!-- 表格区域 开始 -->
<GLTable ref="shareRef" :getListApi="getListApi" :searchForm="tableSearchForm" :tableParams="tableParams" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn">
<div class="table-btns" slot="auth-button" slot-scope="scope">
<el-button type="text" @click="handleEdit(2, scope.scope)">发布</el-button>
<el-button type="text" @click="handleEdit(2, scope.scope)">撤回</el-button>
<el-button type="text" @click="handleDelete(scope.scope)">删除</el-button>
</div>
</GLTable>
<!-- 表格区域 end -->
</div>
</div>
</template>
<script>
export default {
name: 'orderShare',
data() {
return {
size: 'small',
searchForm: {
shareSource: '',
shareStatus: '',
createDate: []
},
tableSearchForm: {},
// 搜索
searchFormData: [
{
label: '创建日期',
name: 'createDate',
type: 'datePicker',
isClear: true,
pickerOptions: 'beforeRangePickerOptions'
},
{
label: '晒单来源',
name: 'shareSource',
type: 'select',
width: '160px',
optionList: [],
optionId: 'confId',
optionLabel: 'confName',
optionsName: 'sourceList'
},
{
label: '晒单状态',
name: 'shareStatus',
type: 'select',
width: '160px',
optionList: [],
optionId: 'confId',
optionLabel: 'confName',
optionsName: 'statusList'
}
],
// 表格
getListApi: this.$apis.orderShare.getListApi,
tableParams: {
listName: 'list',
tableOption: true,
tableColumns: [
{
label: '创建日期',
prop: 'createdDate',
formatter: cellValue => {
return new Date(cellValue.createdDate).toLocaleDateString().replace(/\//g, '-')
}
},
{
label: '晒单来源',
prop: 'shareSource',
formatter: cellValue => {
return this.baseData.sourceList.find(item => item.confId == cellValue.shareSource).confName
}
},
{
label: '晒单状态',
prop: 'shareStatus',
formatter: cellValue => {
return this.baseData.statusList.find(item => item.confId == cellValue.shareStatus).confName
}
}
]
},
pageConf: { pageSize: 'pageSize', pageNum: 'currentPage', totalCount: 'total' },
baseData: {
sourceList: [{
confId: '1',
confName: '广联'
}, {
confId: '2',
confName: '园区店'
}],
statusList: [{
confId: '0',
confName: '未发布'
}, {
confId: '1',
confName: '已发布'
}]
}
}
},
mounted() {
this.getOptionsList('searchFormData',)
},
methods: {
getParams() {
var params = JSON.parse(JSON.stringify(this.searchForm))
if (this.searchForm.createDate.length) {
params.createStartDate = new Date(this.searchForm.createDate[0]).toLocaleDateString().replace(/\//g, '-') + ' 00:00:00'
params.createEndDate = new Date(this.searchForm.createDate[1]).toLocaleDateString().replace(/\//g, '-') + ' 23:59:59'
}
delete params.createDate
return params
},
beforeSearchFn() {
return new Promise(resolve => {
this.tableSearchForm = this.getParams()
delete this.tableSearchForm.createDate
resolve()
})
},
// 1-新增;2-编辑
handleEdit(addOrEdit, row) {
addOrEdit == 1 ? this.$router.push('/orderShare/editShare/' + addOrEdit) : this.$router.push('/orderShare/editShare/' + addOrEdit + '/' + row.id)
},
handleDelete(row) {
this.$confirm('是否确认删除该专区?', '删除', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
callback: action => {
if (action == 'confirm') {
// this.$apis.zoneList.deleteZoneApi({ id: row.id }).then(res => {
// this.$message({
// message: res.code == '0' ? '操作成功' : res.message,
// type: res.code == '0' ? 'success' : 'error'
// })
// if (res.code == '0') {
// this.handleSearch()
// }
// })
}
}
})
},
getOptionsList(formName, hasAll = true, refreshSigle) {
if (refreshSigle) {
var item = this[formName].find(k => k.name == refreshSigle)
var index = this[formName].findIndex(k => k.name == refreshSigle)
this.$set(this[formName][index], 'optionList', this.$common.utils.deepClone(this.baseData[item.optionsName]))
if (hasAll && this.baseData[item.optionsName].length && this.baseData[item.optionsName][0][this[formName][index].optionLabel] !== '全部') {
const temp = {}
temp[this[formName][index].optionId] = ''
temp[this[formName][index].optionLabel] = '全部'
this[formName][index].optionList.unshift(temp)
}
} else {
this[formName].forEach((item, index) => {
if (item.type === 'select' && this.baseData[item.optionsName].length) {
this.$set(this[formName][index], 'optionList', this.$common.utils.deepClone(this.baseData[item.optionsName]))
if (hasAll && this.baseData[item.optionsName].length && this.baseData[item.optionsName][0][this[formName][index].optionLabel] !== '全部') {
const temp = {}
temp[this[formName][index].optionId] = ''
temp[this[formName][index].optionLabel] = '全部'
this[formName][index].optionList.unshift(temp)
}
}
})
}
},
handleSearch() {
this.$refs.shareRef.refreshTable()
},
handleReset() {
this.searchForm = {
shareSource: '',
shareStatus: '',
createDate: []
}
this.handleSearch()
}
}
}
</script>
<style scoped></style>
......@@ -58,13 +58,10 @@ export default {
}
],
// 表格
getListApi: this.$apis.zoneList.getZoneList,
getListApi: this.$apis.zoneList.getZoneListApi,
tableParams: {
listName: 'list',
tableOption: true,
otherOptions: {
label: '启用开关'
},
tableColumns: [
{
label: '专区名称',
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!