Commit 72271050 by wangyalan-git

用户管理,系统设置

parent abca0593
import request from '@/utils/request'
// 活动列表
export function activityList(params) {
return request({
url: '/activities',
method: 'get',
params
})
}
// 全部活动
export function activityAllList(params) {
return request({
url: '/activities/all',
method: 'get',
params
})
}
// 创建活动
export function createActivity(data) {
return request({
url: '/activities',
method: 'post',
data
})
}
// 修改活动
export function updateActivity(data) {
return request({
url: '/activities',
method: 'put',
data
})
}
// 活动详情
export function activityDetail(id) {
return request({
url: '/activities/' + id,
method: 'get'
})
}
// 删除活动
export function deleteActivity(id) {
return request({
url: '/activities/' + id,
method: 'delete'
})
}
// 活动报名商家列表
export function activityShopList(params) {
return request({
url: '/activities/mcht',
method: 'get',
params
})
}
// 活动报名添加商品
export function enrollActivity(data) {
return request({
url: '/activities/mcht/product',
method: 'post',
data
})
}
// 活动商品列表
export function activityGoods(params) {
return request({
url: '/activities/mcht/product',
method: 'get',
params
})
}
// 活动商品审核
export function activityGoodsAudit(data) {
return request({
url: '/activities/mcht/product',
method: 'put',
data
})
}
// 退出活动
export function exitActivity(data) {
return request({
url: '/activities/mcht/product/exit',
method: 'post',
data
})
}
\ No newline at end of file
import request from '@/utils/request'
// 退货订单列表
export function refundOrderList(params) {
return request({
url: '/afterSales/cancelRecord',
method: 'get',
params: params
})
}
// 退货记录列表
export function refundRecordList(params) {
return request({
url: '/afterSales/record',
method: 'get',
params: params
})
}
// 获取退货单详情
export function getRefundDetail(params) {
return request({
url: '/afterSales/detail',
method: 'get',
params: params
})
}
// 退款
export function refundAmount(params) {
return request({
url: '/afterSales/refund',
method: 'get',
params: params
})
}
// 同意拒绝退货
export function handleRefund(params) {
return request({
url: '/afterSales/operation',
method: 'put',
data: params
})
}
\ No newline at end of file
import request from '@/utils/request'
// 获取文章分类
export function articleClassifyList(params) {
return request({
url: '/classity/list',
method: 'get',
params
})
}
// 获取一级文章分类
export function articleFirstClassifyList(params) {
return request({
url: '/classity/firstList',
method: 'get',
params
})
}
// 添加文章分类
export function addArticleClassify(data) {
return request({
url: '/classity/add',
method: 'put',
data
})
}
// 删除文章分类
export function deleteArticleClassify(params) {
return request({
url: '/classity/delete',
method: 'delete',
params
})
}
// 修改文章分类
export function updateArticleClassify(data) {
return request({
url: '/classity/update',
method: 'put',
data
})
}
// 获取文章列表
export function articleList(params) {
return request({
url: '/article/selList',
method: 'get',
params
})
}
// 添加文章
export function addArticle(data) {
return request({
url: '/article/add',
method: 'put',
data
})
}
// 删除文章
export function deleteArticle(params) {
return request({
url: '/article/del',
method: 'delete',
params
})
}
// 编辑文章
export function updateArticle(data) {
return request({
url: '/article/update',
method: 'put',
data
})
}
// 获取文章详情
export function articleDetail(params) {
return request({
url: '/article/detail',
method: 'get',
params
})
}
\ No newline at end of file
import request from '@/utils/request'
// 属性列表
export function fetchAttributeList (params) {
return request({
url: '/productAttribute/attributList',
method: 'get',
params: params
})
}
// 添加属性
export function createAttribute (data) {
return request({
url: '/productAttribute/create',
method: 'post',
data: data
})
}
// 获取属性
export function getAttribute (id) {
return request({
url: '/productAttribute/' + id,
method: 'get',
})
}
// 修改属性
export function updateAttribute (id, data) {
return request({
url: '/productAttribute/update/' + id,
method: 'post',
data: data
})
}
// 删除属性
export function deleteAttribute (ids) {
return request({
url: '/productAttribute/delete?ids=' + ids,
method: 'post',
})
}
// 移动属性
export function changeAttribute (data) {
return request({
url: '/productAttribute/updateMove',
method: 'post',
params: data
})
}
import request from '@/utils/request'
// 属性分类列表
export function fetchAttributeClassifyList (params) {
return request({
url: '/productAttribute/category/list',
method: 'post',
params: params
})
}
// 添加属性分类
export function createAttributeClassify (data) {
return request({
url: '/productAttribute/category/create',
method: 'post',
params: data
})
}
// 获取属性分类
export function getAttributeClassify (id) {
return request({
url: '/productAttribute/category/' + id,
method: 'get',
})
}
// 修改属性分类
export function updateAttributeClassify (id, data) {
return request({
url: '/productAttribute/category/update/' + id,
method: 'post',
data: data
})
}
// 删除属性分类
export function deleteAttributeClassify (id) {
return request({
url: '/productAttribute/category/delete/' + id,
method: 'get',
})
}
import request from '@/utils/request'
// 属性分组列表
export function fetchAttributeGroupList (params) {
return request({
url: '/productAttributeGroup/list',
method: 'get',
params: params
})
}
// 添加属性分组
export function createAttributeGroup (data) {
return request({
url: '/productAttributeGroup/create',
method: 'post',
data: data
})
}
// 获取属性分组
export function getAttributeGroup (id) {
return request({
url: '/productAttributeGroup/' + id,
method: 'get',
})
}
// 修改属性分组
export function updateAttributeGroup (id, data) {
return request({
url: '/productAttributeGroup/update/' + id,
method: 'post',
data: data
})
}
// 删除属性分组
export function deleteAttributeGroup (data) {
return request({
url: '/productAttributeGroup/delete',
method: 'post',
data: data
})
}
import request from '@/utils/request'
// 属性类型列表
export function fetchAttributeTypeList (params) {
return request({
url: '/productAttribute/type/list',
method: 'get',
params: params
})
}
// 添加属性类型
export function createAttributeType (data) {
return request({
url: '/productAttribute/type/create',
method: 'post',
params: data
})
}
// 获取属性类型
export function getAttributeType (id) {
return request({
url: '/productAttribute/type/updateInfo/' + id,
method: 'get',
})
}
// 修改属性类型
export function updateAttributeType (data) {
return request({
url: '/productAttribute/type/update',
method: 'post',
params: data
})
}
// 删除属性类型
export function deleteAttributeType (data) {
return request({
url: '/productAttribute/type/delete',
method: 'post',
data: data
})
}
/**
* 供应商资料
*/
import request from '@/utils/request'
// 权星后台_插入会员
export function addMember(params) {
return request({
url: '/member/insertMember',
method: 'post',
params: params
})
}
// 权星后台_得到商家会员信息
export function getSupplierList(params) {
return request({
url: '/member/getMerchantMember',
method: 'post',
params: params
})
}
// 权星后台_查询会员分页数据
export function getSupplier(params) {
return request({
url: '/member/getPageList',
method: 'get',
params: params
})
}
// 权星申请供应商分页数据
export function getSupAuditList(params) {
return request({
url: 'pmsSupplierAudit/getPageList',
method: 'get',
params: params
})
}
// 权星申请供应商审核
export function mchtaudit(data) {
return request({
url: '/pmsSupplierAudit/auditSupplier',
method: 'post',
data
})
}
//商家入驻申请列表
export function getAuditList(params) {
return request({
url: '/mch/data/auditlist',
method: 'get',
params: params
})
}
//获取审核供应商详情
export function getAuditDetail(params) {
return request({
url: '/pmsSupplierAudit/getSupplierAuditById',
method: 'get',
params: params
})
}
// 权星后台_根据会员id查询一条会员数据
export function getSupplierDetail(params) {
return request({
url: '/member/selectOneById',
method: 'post',
params: params
})
}
//更新供应商
export function updateMcht(data) {
return request({
url: '/member/updateOneById',
method: 'post',
data: data
})
}
//获取店铺申请列表
export function getShopList(params) {
return request({
url: '/mch/data/shoplist',
method: 'get',
params: params
})
}
//获取店铺详情
export function getShopDetail(params) {
return request({
url: '/mch/data/shopdetail',
method: 'get',
params: params
})
}
//商家入驻申请 -- 平台添加供应商
export function auditApply(data) {
return request({
url: '/mch/data/apply',
method: 'put',
data: data
})
}
//店铺审核
export function shopAudit(data) {
return request({
url: '/mch/data/shopaudit',
method: 'put',
data: data
})
}
//更新店铺
export function updateAccount(data) {
return request({
url: '/mch/data/update',
method: 'put',
data: data
})
}
import request from '@/utils/request'
//获取全部品牌列表
export function getBrandList(params) {
return request({
url: '/brand/listAll',
method: 'get',
params: params
})
}
export function fetchList(params) {
return request({
url: '/brand/list',
method: 'get',
params: params
})
}
// 查看品牌
export function viewBrand(params) {
return request({
url: '/brand/' + params.id,
method: 'get',
params: params
})
}
export function createBrand(data) {
return request({
url: '/brand/create',
method: 'post',
params: data
})
}
export function updateShowStatus(data) {
return request({
url: '/brand/update/showStatus',
method: 'post',
params: data
})
}
export function updateFactoryStatus(data) {
return request({
url: '/brand/update/factoryStatus',
method: 'post',
params: data
})
}
export function deleteBrand(id) {
return request({
url: '/brand/delete/' + id,
method: 'get',
})
}
export function getBrand(id) {
return request({
url: '/brand/' + id,
method: 'get',
})
}
export function updateBrand(id, data) {
return request({
url: '/brand/update/' + id,
method: 'post',
data: data
})
}
export function auditLog(data) {
return request({
url: '/brand/brandLogList',
method: 'get',
params: data
})
}
\ No newline at end of file
import request from '@/utils/request' import request from '@/utils/request'
// 商城配置信息 // 万科后台_得到一条系统配置信息
export function mallConfig(params) { export function getSetting(params) {
return request({ return request({
url: '/sys/mall/settingsList', url: 'vankeConfig/getOne',
method: 'get', method: 'get',
params params
}) })
} }
// 修改商城配置信息
export function updateMallConfig(data) { // 万科后台_修改配置信息
export function editSetting(data) {
return request({ return request({
url: '/sys/mall/updateList', url: 'vankeConfig/insertAndUpdateConfig',
method: 'post', method: 'post',
data data
}) })
} }
// 秒杀时间列表
export function flashTimeList() {
return request({
url: '/sec/kill/time',
method: 'get'
})
}
// 添加秒杀时间
export function createFlashTime(data) {
return request({
url: '/sec/kill/time',
method: 'post',
data
})
}
// 修改秒杀时间
export function updateFlashTime(data) {
return request({
url: '/sec/kill/time',
method: 'put',
data
})
}
// 删除秒杀时间
export function deleteFlashTime(id) {
return request({
url: '/sec/kill/time/' + id,
method: 'delete'
})
}
// 计划任务列表
export function scheduleTaskList() {
return request({
url: '/sys/quartzJob/list',
method: 'get'
})
}
// 暂停计划任务
export function pauseScheduleTask(params) {
return request({
url: '/sys/quartzJob/pause',
method: 'get',
params
})
}
// 恢复计划任务
export function resumeScheduleTask(params) {
return request({
url: '/sys/quartzJob/resume',
method: 'get',
params
})
}
// 修改计划任务
export function updateScheduleTask(data) {
return request({
url: '/sys/quartzJob/edit',
method: 'post',
data
})
}
// 获取key获取字典数据
export function dictDetailByKey(params) {
return request({
url: '/sys/dict/detail/key',
method: 'get',
params
})
}
// 修改字典数据
export function updateDictValue(data) {
return request({
url: '/sys/dict/update/v2',
method: 'put',
data
})
}
// 获取充值配置项
export function rechargeConfig() {
return request({
url: '/recharge/config',
method: 'get'
})
}
// 配置充值配置项
export function configRecharge(data) {
return request({
url: '/recharge/config',
method: 'post',
data
})
}
// 删除充值配置项
export function deleteRechargeConfig(id) {
return request({
url: '/recharge/config/' + id,
method: 'delete'
})
}
// 检索记录
export function searchRecordList(params) {
return request({
url: '/search/record',
method: 'get',
params
})
}
\ No newline at end of file
/**
* 用户管理
*/
import request from '@/utils/request' import request from '@/utils/request'
// 地区列表
export function fetchAreaList(params) {
// 万科后台_用户分页操作
export function getMemberList(params) {
return request({ return request({
url: '/area/getArea', url: 'umsMember/list',
method: 'get', method: 'get',
params: params params
}) })
} }
// 创建地区 // 万科后台_设置为普通管理员
export function createArea(data) { export function setUpAdmin(data) {
return request({ return request({
url: '/area', url: 'umsMember/setUpAdmin',
method: 'post', method: 'post',
data data
}) })
} }
// 删除地区
export function deleteArea(id) { // 万科后台_解除普通管理员
export function cancleAdmin(data) {
return request({ return request({
url: '/area/' + id, url: 'umsMember/cancleAdmin',
method: 'delete' method: 'post',
data
}) })
} }
\ No newline at end of file
...@@ -230,7 +230,6 @@ export const asyncRouterMap = [ ...@@ -230,7 +230,6 @@ export const asyncRouterMap = [
} }
] ]
}, },
{ path: '*', redirect: '/404', hidden: true } { path: '*', redirect: '/404', hidden: true }
] ]
......
...@@ -44,7 +44,7 @@ ...@@ -44,7 +44,7 @@
</el-dialog> </el-dialog>
</template> </template>
<script> <script>
import { addMember,updateMcht } from '@/api/audit' import { addMember,updateMcht } from '@/api/inventory'
// 添加编辑属性 // 添加编辑属性
export default { export default {
......
<template> 
<div class="app-container">
<el-row :gutter="24">
<!-- 一级分类 -->
<el-col :offset="2"
:span="6">
<el-card>
<div class="card-head"
slot="header">
<div class="row-item">
<el-input size="small"
v-model="inputOne"
maxlength="20"
placeholder="省/自治区/直辖市/特别行政区"></el-input>
<el-button size="small"
icon="el-icon-plus"
@click="handleAdd(1)"></el-button>
</div>
<div class="row-item">
<div class="column-item">省/自治区/直辖市/特别行政区</div>
<div class="column-tip">{{list ? list.length : 0}}</div>
</div>
</div>
<el-table :data="list"
border
v-loading="oneLoading"
max-height="500"
:show-header="false"
highlight-current-row
@current-change="selectOneClassify">
<el-table-column>
<template slot-scope="scope">{{scope.row.areaName}}</template>
</el-table-column>
<el-table-column width="50"
align="center">
<template slot-scope="scope">
<el-button type="danger"
circle
size="mini"
icon="el-icon-close"
@click="handleDelete(1, scope.row)"></el-button>
</template>
</el-table-column>
</el-table>
</el-card>
</el-col>
<!-- 二级分类 -->
<el-col v-if="oneClassify"
:offset="1"
:span="6">
<el-card>
<!-- 分类操作 -->
<div class="card-head"
slot="header">
<div class="row-item">
<el-input size="small"
v-model="inputTwo"
maxlength="20"
placeholder="地级市/区"></el-input>
<el-button size="small"
icon="el-icon-plus"
@click="handleAdd(2)"></el-button>
</div>
<div class="row-item">
<div class="column-item">地级市/区</div>
<div class="column-tip">{{twoList ? twoList.length : 0}}</div>
</div>
</div>
<!-- 分类列表 -->
<el-table :data="twoList"
border
v-loading="twoLoading"
max-height="500"
:show-header="false"
highlight-current-row
@current-change="selectTwoClassify">
<el-table-column>
<template slot-scope="scope">{{scope.row.areaName}}</template>
</el-table-column>
<el-table-column width="50"
align="center">
<template slot-scope="scope">
<el-button type="danger"
circle
size="mini"
icon="el-icon-close"
@click="handleDelete(2, scope.row)"></el-button>
</template>
</el-table-column>
</el-table>
</el-card>
</el-col>
<!-- 三级分类 -->
<el-col v-if="twoClassify"
:offset="1"
:span="6">
<el-card>
<!-- 分类操作 -->
<div class="card-head"
slot="header">
<div class="row-item">
<el-input size="small"
v-model="inputThree"
maxlength="20"
placeholder="区/县"></el-input>
<el-button size="small"
icon="el-icon-plus"
@click="handleAdd(3)"></el-button>
</div>
<div class="row-item">
<div class="column-item">区/县</div>
<div class="column-tip">{{threeList ? threeList.length : 0}}</div>
</div>
</div>
<!-- 分类列表 -->
<el-table :data="threeList"
border
v-loading="threeLoading"
max-height="500"
:show-header="false">
<el-table-column>
<template slot-scope="scope">{{scope.row.areaName}}</template>
</el-table-column>
<el-table-column width="50"
align="center">
<template slot-scope="scope">
<el-button type="danger"
circle
size="mini"
icon="el-icon-close"
@click="handleDelete(3, scope.row)"></el-button>
</template>
</el-table-column>
</el-table>
</el-card>
</el-col>
</el-row>
</div>
</template>
<script>
import { fetchAreaList, createArea, deleteArea } from '@/api/area'
export default {
name: 'AreaList',
components: {},
data() {
return {
oneLoading: false,
inputOne: null,
list: null,
oneClassify: null,
twoLoading: false,
inputTwo: null,
twoList: null,
twoClassify: null,
threeLoading: false,
inputThree: null,
threeList: null
}
},
created() {
// 参数 type 1一级分类,parentId 0顶级分类
this.getList(1, 0);
},
methods: {
// 添加分类
handleAdd(type) {
if (type == 1) {
if (!this.inputOne) {
this.$message({ type: 'warning', message: '请输入省/自治区/直辖市/特别行政区名称' })
return
}
this.submitAdd(type, 0, this.inputOne)
} else if (type == 2) {
if (!this.inputTwo) {
this.$message({ type: 'warning', message: '请输入地级市/区名称' })
return
}
this.submitAdd(type, this.oneClassify.id, this.inputTwo)
} else if (type == 3) {
if (!this.inputThree) {
this.$message({ type: 'warning', message: '请输入区/县名称' })
return
}
this.submitAdd(type, this.twoClassify.id, this.inputThree)
}
},
// 请求添加
submitAdd(type, parentId, name) {
let params = {
parentId: parentId,
areaName: name,
areaType: type
}
if (type == 1) {
this.oneLoading = true
} else if (type == 2) {
this.twoLoading = true
} else if (type == 3) {
this.threeLoading = true
}
createArea(params).then(res => {
if (type == 1) {
this.inputOne = null
this.oneLoading = false
} else if (type == 2) {
this.inputTwo = null
this.twoLoading = false
} else if (type == 3) {
this.inputThree = null
this.threeLoading = false
}
this.getList(type, parentId)
})
},
// 选择一级分类
selectOneClassify(row) {
if (!row) {
return
}
this.oneClassify = row
this.twoList = []
this.twoClassify = null
this.threeList = []
// 获取对应的二级分类列表
this.getList(2, row.id)
},
// 选择二级分类
selectTwoClassify(row) {
if (!row) {
return
}
this.twoClassify = row
this.threeList = []
// 获取对应的三级分类列表
this.getList(3, row.id)
},
// 删除分类
handleDelete(type, row) {
this.$confirm('删除该条数据前请确保相关联的数据已经解除关联', '您确定要删除所选地区吗?', {
confirmButtonText: '确定',
cancelButtonText: '取消',
center: true
}).then(() => {
//请求删除标签组
deleteArea(row.id).then(res => {
if (type == 1) {
this.getList(1, 0)
} else if (type == 2) {
this.selectOneClassify(this.oneClassify)
} else if (type == 3) {
this.selectTwoClassify(this.twoClassify)
}
})
})
},
// 请求数据
getList(type, parentId) {
if (type == 1) {
this.oneLoading = true
} else if (type == 2) {
this.twoLoading = true
} else if (type == 3) {
this.threeLoading = true
}
fetchAreaList({ parentId: parentId }).then(res => {
if (type == 1) {
this.oneLoading = false
this.list = res.data
} else if (type == 2) {
this.twoLoading = false
this.twoList = res.data
} else if (type == 3) {
this.threeLoading = false
this.threeList = res.data
}
}).catch(err => {
if (type == 1) {
this.oneLoading = false
} else if (type == 2) {
this.twoLoading = false
} else if (type == 3) {
this.threeLoading = false
}
})
}
}
}
</script>
<style scoped>
.input-width {
width: 200px;
}
.row-item {
display: flex;
flex-direction: row;
align-items: center;
}
.row-item .el-input {
flex: 1;
margin-right: 10px;
}
.row-item .column-item {
flex: 1;
margin-top: 12px;
color: #666;
font-size: 14px;
}
.row-item .column-tip {
text-align: center;
min-width: 40px;
margin-top: 12px;
color: #666;
font-size: 14px;
}
</style>
\ No newline at end of file
<template> 
<div class="app-container">
<!-- 操作栏 -->
<el-card class="operate-container"
shadow="never">
<div class="row-item">
<el-button size="small"
type="primary"
@click="handleAdd">新增分类</el-button>
</div>
</el-card>
<!-- 表格栏 -->
<div class="table-container">
<el-table :data="list"
ref="table"
row-key="id"
:tree-props="{children: 'childrens'}"
v-loading="listLoading"
border>
<el-table-column label="分类层级"
align="center">
<template slot-scope="scope">{{scope.row.classifyLevel | formatLevel}}</template>
</el-table-column>
<el-table-column label="编号"
align="center"
prop="id"></el-table-column>
<el-table-column label="分类名称"
align="center">
<template slot-scope="scope">{{scope.row.classifyName}}</template>
</el-table-column>
<el-table-column label="文章数量"
align="center">
<template slot-scope="scope">{{scope.row.articleCount || 0}}</template>
</el-table-column>
<el-table-column label="更新时间"
align="center">
<template slot-scope="scope">{{scope.row.updateDate || scope.row.createDate | formatTime}}</template>
</el-table-column>
<el-table-column label="操作"
width="340"
align="center">
<template slot-scope="scope">
<el-button v-if="scope.row.classifyLevel == 1"
size="mini"
type="primary"
@click="handleAdd(scope.row)">添加下级</el-button>
<el-button v-if="scope.row.defaultFlag == 1"
size="mini"
type="warning"
@click="handleUpdate(scope.row)">编辑</el-button>
<el-button v-if="scope.row.defaultFlag == 1"
size="mini"
type="danger"
@click="handleDelete(scope.row)">删除</el-button>
<el-button size="mini"
type="success"
@click="handleChange(scope.row)">新增文章</el-button>
</template>
</el-table-column>
</el-table>
</div>
<!-- 弹窗 -->
<article-classify-modal ref="detailModal"
@ok="getList"></article-classify-modal>
<!-- end -->
</div>
</template>
<script>
import { articleClassifyList, deleteArticleClassify } from '@/api/article'
import { formatDate } from '@/utils/date'
import ArticleClassifyModal from './modules/ArticleClassifyModal'
// 文章分类列表
export default {
name: 'articleClassifyList',
components: {
ArticleClassifyModal
},
data () {
return {
list: [],
listLoading: false
}
},
mounted () {
this.getList()
},
filters: {
formatLevel (level) {
if (level == 3) {
return '三级'
} else if (level == 2) {
return '二级'
} else {
return '一级'
}
},
formatTime (time) {
if (!time) {
return '--'
}
let date = new Date(time)
return formatDate(date, 'yyyy-MM-dd hh:mm:ss')
}
},
methods: {
// 添加下级
handleAdd (row) {
this.$refs.detailModal.add(row.id)
},
// 编辑
handleUpdate (row) {
this.$refs.detailModal.detail(row)
},
// 删除
handleDelete (row) {
this.$confirm('删除该分类前请确保相关联的数据已经解除关联', '您确定要删除' + row.classifyName + '分类吗?', {
confirmButtonText: '确定',
cancelButtonText: '取消',
center: true
}).then(() => {
// 请求删除
deleteArticleClassify({ id: row.id }).then(res => {
this.getList()
})
})
},
// 新增文章
handleChange (row) {
this.$router.push({ name: 'editArticle', params: { id: row.id, parentId: row.parentId } })
},
//请求数据
getList () {
this.listLoading = true
articleClassifyList({}).then(res => {
this.listLoading = false
let list = res.data
list.map(item => {
item.hasChildren = item.childres && item.childres.length > 0
})
this.list = list
})
}
}
}
</script>
<style scoped>
.operate-container {
text-align: right;
margin-top: 0;
margin-bottom: 20px;
}
</style>
\ No newline at end of file
<template>
<el-dialog :visible.sync="visible"
:title="title"
center
width="650px">
<el-form :model="model"
ref="classifyForm"
v-loading="loading"
label-width="180px">
<el-form-item label="分类名称:"
prop="classifyName"
:rules="[{ required: true, trigger: 'blur', message: '分类名称不能为空' }]">
<el-input placeholder="请输入分类名称"
class="input-width"
size="small"
v-model="model.classifyName"></el-input>
</el-form-item>
<el-form-item label="上级分类:"
prop="parentId">
<el-select placeholder="请选择上级分类"
class="input-width"
size="small"
:disabled="model.parentId == 0"
v-model="model.parentId">
<el-option v-if="model.parentId == 0"
label="顶级分类"
:value="0"></el-option>
<el-option v-for="item in classifyList"
:key="item.id"
:label="item.classifyName"
:value="item.id"></el-option>
</el-select>
</el-form-item>
</el-form>
<div slot="footer">
<el-button type="primary"
@click="submit">确认</el-button>
<el-button @click="close">取消</el-button>
</div>
</el-dialog>
</template>
<script>
import { addArticleClassify, updateArticleClassify, articleFirstClassifyList } from '@/api/article'
// 添加类型分类
export default {
name: 'articleClassifyModal',
components: {},
data() {
return {
visible: false,
title: null,
loading: false,
model: {
parentId: 0,
classifyLevel: 1,
classifyName: null
},
classifyList: []
}
},
methods: {
init() {
this.model = {
parentId: 0,
classifyLevel: 1,
classifyName: null
}
this.$nextTick(() => {
this.$refs.classifyForm.clearValidate()
})
},
add(parentId) {
this.init()
// 添加数据处理
if (parentId) {
this.model.parentId = parentId
this.model.classifyLevel = 2
this.getParentClassify()
}
this.visible = true
this.title = '新增分类'
},
detail(data) {
this.init()
this.visible = true
this.model = Object.assign({}, data)
if (data.parentId && data.parentId != 0) {
this.getParentClassify()
}
this.title = '编辑分类'
},
getParentClassify() {
articleFirstClassifyList({}).then(res => {
this.classifyList = res.data
})
},
submit() {
// 提交保存
this.$refs.classifyForm.validate((valid) => {
if (valid) {
// 验证通过
this.loading = true
if (this.model.id) {
// 修改类型分类
updateArticleClassify(this.model).then(res => {
this.loading = false
this.visible = false
this.$emit('ok')
}).catch(err => {
this.loading = false
})
} else {
// 添加类型分类
addArticleClassify(this.model).then(res => {
this.loading = false
this.visible = false
this.$emit('ok')
}).catch(err => {
this.loading = false
})
}
}
})
},
close() {
this.$emit('close')
this.visible = false
}
}
}
</script>
<style scoped>
.input-width {
width: 300px;
}
</style>
\ No newline at end of file
<template>
<div class="app-container">
<el-form :model="model"
ref="articleForm"
label-width="150px"
size="small">
<el-form-item label="文章标题:"
prop="title"
:rules="[{required: true, message: '文章标题不能为空', trigger: 'blur'}]">
<el-input v-model="model.title"
placeholder="请输入文章标题"></el-input>
</el-form-item>
<el-form-item label="所属分类:"
prop="paraentClassifyId"
:rules="[{required: true, message: '文章标题不能为空', trigger: 'change'}]">
<el-select v-model="model.paraentClassifyId"
@change="changeClassify">
<el-option v-for="item in classifyList"
:key="item.id"
:label="item.classifyName"
:value="item.id"></el-option>
</el-select>
<el-select v-if="model.paraentClassifyId"
v-model="model.classifyId"
clearable>
<el-option v-for="item in childClassifyList"
:key="item.id"
:label="item.classifyName"
:value="item.id"></el-option>
</el-select>
</el-form-item>
<el-form-item label="文章标题图:"
:rules="[{ required: true, trigger: 'change', message: '文章标题图不能为空'}]">
<single-upload v-model="model.titlePic"></single-upload>
</el-form-item>
<el-form-item :rules="[{required: true, trigger: 'blur', message: '正文内容不能为空'}]"
prop="content"
label="正文内容:">
<tinymce v-model="model.content"></tinymce>
</el-form-item>
<el-form-item label="文章关键词:"
prop="keywords">
<el-input v-model="model.keywords"
placeholder="关键词使用空格分隔,一般不超过64个字符"></el-input>
</el-form-item>
<el-form-item label="文章摘要:"
prop="articleAbstract">
<el-input v-model="model.articleAbstract"
maxlength="255"
placeholder="不超过255个汉字"></el-input>
</el-form-item>
<el-form-item label="文章排序:"
prop="sort">
<el-input v-model.number="model.sort"></el-input>
</el-form-item>
<el-form-item>
<el-button type="primary"
size="medium"
:loading="loading"
@click="save">保存</el-button>
<el-button type="success"
size="medium"
@click="$router.back()">返回</el-button>
</el-form-item>
</el-form>
</div>
</template>
<script>
import { articleClassifyList, addArticle, articleDetail, updateArticle } from '@/api/article'
import Tinymce from '@/components/Tinymce'
import SingleUpload from '@/components/Upload/singleUpload'
const defaultArticle = {
title: null,
paraentClassifyId: null,
classifyId: null,
titlePic: null,
content: null,
keywords: null,
articleAbstract: null,
showFlag: 0,
sort: null
}
export default {
name: "EditArticle",
components: { Tinymce, SingleUpload },
data() {
return {
loading: false,
model: Object.assign({}, defaultArticle),
classifyList: [],
childClassifyList: []
}
},
created() {
let params = this.$route.params
if (params.id) {
if (params.parentId && params.parentId != 0) {
this.model.paraentClassifyId = params.parentId
this.model.classifyId = params.id
} else {
this.model.paraentClassifyId = params.id
}
}
let query = this.$route.query
if (query.id) {
articleDetail({ articleId: query.id }).then(res => {
this.model = res.data
this.changeClassify(this.model.paraentClassifyId)
})
}
this.init()
},
methods: {
init() {
articleClassifyList({}).then(res => {
this.classifyList = res.data
if (this.model.paraentClassifyId) {
this.changeClassify(this.model.paraentClassifyId)
}
})
},
changeClassify(val) {
this.classifyList.forEach(item => {
if (item.id == val) {
this.childClassifyList = item.childrens
}
})
},
save() {
this.$refs.articleForm.validate((valid) => {
if (valid) {
this.loading = true
if (this.model.id) {
updateArticle(this.model).then(res => {
this.$message.success('保存成功')
this.$router.back()
this.loading = false
}).catch(err => {
this.loading = false
})
} else {
addArticle(this.model).then(res => {
this.$message.success('保存成功')
this.$router.back()
this.loading = false
}).catch(err => {
this.loading = false
})
}
}
})
}
}
}
</script>
<style scoped>
.app-container {
margin: 0 auto;
padding-top: 50px;
width: 930px;
}
</style>
<template> 
<el-card>
<!-- 操作栏 -->
<el-card class="filter-container"
shadow="never">
<el-form :inline="true"
:model="listQuery"
size="small">
<el-form-item label="所属分类:">
<el-select v-model="listQuery.paraentClassifyId"
clearable
@change="changeClassify">
<el-option v-for="item in classifyList"
:key="item.id"
:label="item.classifyName"
:value="item.id"></el-option>
</el-select>
<el-select v-model="listQuery.classifyId"
clearable>
<el-option v-for="item in childClassifyList"
:key="item.id"
:label="item.classifyName"
:value="item.id"></el-option>
</el-select>
</el-form-item>
<el-form-item label="文章搜索:">
<el-input v-model="listQuery.title"
clearable></el-input>
</el-form-item>
<!-- 筛选操作 -->
<el-form-item>
<el-button type="primary"
@click="handleSearchList"
size="small">搜索</el-button>
</el-form-item>
<el-button class="btn-add"
size="small"
type="primary"
@click="handleAdd">添加文章</el-button>
</el-form>
</el-card>
<!-- 表格栏 -->
<div class="table-container">
<el-table :data="list"
ref="table"
row-key="id"
v-loading="listLoading"
border>
<el-table-column label="编码"
align="center"
prop="id">
</el-table-column>
<el-table-column label="标题"
align="center"
prop="title">
</el-table-column>
<el-table-column label="分类"
align="center"
prop="classifyName">
</el-table-column>
<el-table-column label="排序"
align="center">
<template slot-scope="scope">
<el-input v-model="scope.row.sort"
@blur="changeSort(scope.row)"></el-input>
</template>
</el-table-column>
<el-table-column label="更新时间"
align="center">
<template slot-scope="scope">{{scope.row.updateDate || scope.row.createDate | formatTime}}</template>
</el-table-column>
<el-table-column label="是否显示"
align="center">
<template slot-scope="scope">
<el-switch v-model="scope.row.showFlag"
@change="changeShow(scope.row)"
:inactive-value="1"
:active-value="0"></el-switch>
</template>
</el-table-column>
<el-table-column label="操作"
width="160"
align="center">
<template slot-scope="scope">
<el-button size="mini"
type="warning"
@click="handleUpdate(scope.row)">编辑</el-button>
<el-button size="mini"
type="danger"
@click="handleDelete(scope.row)">删除</el-button>
</template>
</el-table-column>
</el-table>
</div>
<!-- 分页栏 -->
<div class="pagination-container">
<el-pagination background
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
layout="total, sizes, prev, pager, next, jumper"
:current-page.sync="listQuery.pageNum"
:page-size="listQuery.pageSize"
:page-sizes="[10,30,50]"
:total="total">
</el-pagination>
</div>
</el-card>
</template>
<script>
import { articleClassifyList, articleList, deleteArticle, updateArticle } from '@/api/article'
import { formatDate } from '@/utils/date'
// 文章管理列表
export default {
name: 'ArticleManagement',
components: {},
data() {
return {
listQuery: {
pageNum: 1,
pageSize: 10
},
total: 0,
classifyList: [],
childClassifyList: [],
list: [],
listLoading: false
}
},
mounted() {
this.init()
},
filters: {
formatTime(time) {
if (!time) {
return '--'
}
let date = new Date(time)
return formatDate(date, 'yyyy-MM-dd hh:mm:ss')
}
},
methods: {
init() {
articleClassifyList({}).then(res => {
this.classifyList = res.data
})
this.getList()
},
changeClassify(val) {
this.classifyList.forEach(item => {
if (item.id == val) {
this.childClassifyList = item.childrens
}
})
},
handleSearchList() {
this.listQuery.pageNum = 1
this.getList()
},
handleSizeChange(val) {
this.listQuery.pageNum = 1
this.listQuery.pageSize = val
this.getList()
},
handleCurrentChange(val) {
this.listQuery.pageNum = val
this.getList()
},
// 更改排序
changeSort(row) {
updateArticle(row).then(res => {
this.getList()
})
},
// 更过显示状态
changeShow(row) {
updateArticle(row).then(res => {
this.getList()
})
},
// 添加
handleAdd() {
this.$router.push('editArticle')
},
// 编辑
handleUpdate(row) {
this.$router.push({ path: 'editArticle', query: { id: row.id } })
},
// 删除
handleDelete(row) {
this.$confirm('删除后将不能恢复请谨慎操作', '您确定要删除该文章吗?', {
confirmButtonText: '确定',
cancelButtonText: '取消',
center: true
}).then(() => {
// 请求删除
deleteArticle({ articleId: row.id }).then(res => {
this.getList()
})
})
},
//请求数据
getList() {
this.listLoading = true
articleList(this.listQuery).then(res => {
this.listLoading = false
this.list = res.data.list
this.total = res.data.total
}).catch(err => {
this.listLoading = false
})
}
}
}
</script>
<style scoped>
</style>
\ No newline at end of file
<template> 
<el-card>
<!-- 搜索栏 -->
<el-card class="filter-container"
shadow="never">
<el-form :inline="true"
:model="listQuery"
size="small">
<el-form-item label="广告位置:">
<el-select size="small"
clearable
placeholder="请选择广告位置"
v-model="listQuery.adPositionId">
<el-option v-for="item in adPositionOptions"
:key="item.id"
:label="item.name"
:value="item.id"></el-option>
</el-select>
</el-form-item>
<el-form-item label="广告执行状态:">
<el-select size="small"
placeholder="请选择广告状态"
v-model="listQuery.adExecuteStatus">
<el-option v-for="item in statusOptions"
:key="item.id"
:label="item.name"
:value="item.id"></el-option>
</el-select>
</el-form-item>
<el-form-item label="广告名称:">
<el-input size="small"
placeholder="请选输入广告名称"
v-model="listQuery.adName">
</el-input>
</el-form-item>
<el-form-item label="广告商家:">
<el-input size="small"
placeholder="请选输入广告商家"
v-model="listQuery.mchtAccount">
</el-input>
</el-form-item>
<el-form-item>
<el-button type="primary"
@click="handleSearchList"
size="small">搜索</el-button>
</el-form-item>
<el-button class="btn-add"
size="small"
type="primary"
@click="handleAdd">添加广告</el-button>
</el-form>
</el-card>
<!-- 表格栏 -->
<div class="table-container">
<el-table :data="list"
ref="table"
row-key="id"
v-loading="listLoading"
border>
<el-table-column label="编码"
align="center">
<template slot-scope="scope">{{scope.row.id}}</template>
</el-table-column>
<el-table-column label="广告名称"
align="center">
<template slot-scope="scope">{{scope.row.adName}}</template>
</el-table-column>
<el-table-column label="广告图"
align="center">
<template slot-scope="scope">
<el-image :src="scope.row.adPic"
:preview-src-list="[scope.row.adPic]"></el-image>
</template>
</el-table-column>
<el-table-column label="广告商家"
align="center">
<template slot-scope="scope">{{ scope.row.userType == 1 ? '平台' : scope.row.mchtAccount }}</template>
</el-table-column>
<el-table-column label="广告位(名称)"
align="center">
<template slot-scope="scope">{{scope.row.adPositionName}}</template>
</el-table-column>
<el-table-column label="联系人信息"
align="center">
<template slot-scope="scope">{{scope.row.adContactPerson}}-{{scope.row.adContactPhone}}-{{scope.row.adContactEmail}}</template>
</el-table-column>
<el-table-column label="开始日期"
align="center">
<template slot-scope="scope">{{scope.row.beginDate | formatDate}}</template>
</el-table-column>
<el-table-column label="结束日期"
align="center">
<template slot-scope="scope">{{scope.row.endDate | formatDate}}</template>
</el-table-column>
<el-table-column label="点击次数"
align="center">
<template slot-scope="scope">{{scope.row.clickNum}}</template>
</el-table-column>
<el-table-column label="操作"
width="220"
align="center">
<template slot-scope="scope">
<el-button size="mini"
type="primary"
@click="handleUpdate(scope.row)">编辑</el-button>
<el-button v-if="scope.row.status == 0"
size="mini"
type="warning"
@click="changeStatus(scope.row)">开启</el-button>
<el-button v-else
size="mini"
type="info"
@click="changeStatus(scope.row)">关闭</el-button>
<el-button size="mini"
type="danger"
@click="handleDelete(scope.row)">删除</el-button>
</template>
</el-table-column>
</el-table>
</div>
<!-- 分页栏 -->
<div class="pagination-container">
<el-pagination background
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
layout="total, sizes, prev, pager, next, jumper"
:current-page.sync="listQuery.pageNum"
:page-size="listQuery.pageSize"
:page-sizes="[10,30,50]"
:total="total">
</el-pagination>
</div>
<!-- 弹窗 -->
<banner-modal ref="bannerModal"
@ok="getList"></banner-modal>
</el-card>
</template>
<script>
import bannerModal from './modules/bannerModal'
import { bannerList, bannerPositionList, deleteBanner, changeStatus } from '@/api/banner'
import moment from 'moment'
// 广告位置管理
export default {
name: 'bannerList',
components: {
bannerModal
},
data () {
return {
listQuery: {
pageSize: 10,
pageNum: 1,
adPositionId: null,
adExecuteStatus: 0,
adName: null,
mchtAccount: null
},
adPositionOptions: [],
statusOptions: [{
id: 0,
name: '全部广告'
}, {
id: 1,
name: '正在播放'
}, {
id: 2,
name: '即将到期'
}, {
id: 3,
name: '已结束广告'
}],
total: 0,
list: [],
listLoading: false
}
},
mounted () {
if (this.$route.params.id) {
this.listQuery.adPositionId = this.$route.params.id
}
this.init()
},
filters: {
formatDate (date) {
return moment(date).format('YYYY-MM-DD')
}
},
methods: {
init () {
this.getList()
// 获取广告位数据
bannerPositionList({ pageNum: 1, pageSize: 1000 }).then(res => {
this.adPositionOptions = res.data.list
})
},
// 表格页数改变
handleSizeChange (val) {
this.listQuery.pageNum = 1
this.listQuery.pageSize = val
this.getList()
},
// 表格页码改变
handleCurrentChange (val) {
this.listQuery.pageNum = val
this.getList()
},
// 搜索
handleSearchList () {
this.getList()
},
// 添加
handleAdd () {
this.$refs.bannerModal.add()
},
// 修改广告状态
changeStatus (row) {
const status = row.status
this.$confirm('', '您确定要' + (status == 0 ? '开启' : '关闭') + '所选广告吗?', {
confirmButtonText: '确定',
cancelButtonText: '取消',
center: true
}).then(() => {
// 请求删除
this.listLoading = true
changeStatus({ id: row.id, adStatus: 1 - status }).then(res => {
this.listLoading = false
this.getList()
}).catch(err => {
this.listLoading = false
})
})
},
// 编辑
handleUpdate (row) {
this.$refs.bannerModal.detail(row)
},
// 删除
handleDelete (row) {
this.$confirm('删除该条数据前请确保相关联的数据已经解除关联', '您确定要删除所选广告吗?', {
confirmButtonText: '确定',
cancelButtonText: '取消',
center: true
}).then(() => {
// 请求删除
this.listLoading = true
deleteBanner({ id: row.id }).then(res => {
this.listLoading = false
this.getList()
}).catch(err => {
this.listLoading = false
})
})
},
//请求数据
getList () {
this.listLoading = true
bannerList(this.listQuery, this.listQuery).then(res => {
this.listLoading = false
this.list = res.data.list
this.total = res.data.total
}).catch(err => {
this.listLoading = false
})
}
}
}
</script>
<style scoped>
.operate-container {
text-align: right;
margin-top: 0;
margin-bottom: 20px;
}
</style>
\ No newline at end of file
<template>
<el-dialog :visible.sync="visible"
:title="title"
center
width="750px">
<!-- start -->
<!-- 广告信息 -->
<el-form :model="model"
class="section"
size="small"
ref="bannerForm"
v-loading="loading"
label-width="200px">
<!-- 内容布局 -->
<div class="scroll-container"
ref="scrollContainer">
<el-form-item label="广告主:"
:rules="[{ required: true, trigger: 'change', message: '广告主不能为空' }]">
<el-radio-group v-model="model.userType">
<el-radio :label="1">平台</el-radio>
<el-radio :label="2">商家</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item v-if="model.userType == 2"
label="商家账号:"
prop="mchtAccount"
:rules="[{ required: true, trigger: 'blur', message: '商家账号不能为空' }]">
<el-input placeholder="请输入广告位名称"
v-model="model.name"></el-input>
</el-form-item>
<el-form-item label="广告名称:"
prop="adName"
:rules="[{ required: true, trigger: 'blur', message: '广告名称不能为空' }]">
<el-input placeholder="请输入广告名称"
v-model="model.adName"></el-input>
</el-form-item>
<el-form-item label="广告位置:"
prop="adPositionId"
:rules="[{ required: true, trigger: 'change', message: '广告位置不能为空' }]">
<el-select v-model="model.adPositionId"
placeholder="请选择广告位置">
<el-option v-for="item in adPositionOptions"
:key="item.id"
:label="item.name"
:value="item.id"></el-option>
</el-select>
</el-form-item>
<el-form-item label="广告起止时间:"
prop="date"
:rules="[{ required: true, trigger: 'change', message: '广告起止时间不能为空' }]">
<el-date-picker v-model="model.date"
type="daterange"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期">
</el-date-picker>
</el-form-item>
<el-form-item label="广告链接:"
prop="linkValue">
<el-input placeholder="请输入广告链接"
v-model="model.linkValue"></el-input>
</el-form-item>
<el-form-item label="上传广告图片:"
prop="adPic"
:rules="[{ required: true, trigger: 'blur', message: '广告图片不能为空' }]">
<single-upload v-model="model.adPic"></single-upload>
</el-form-item>
<!-- <el-form-item label="或图片网址:"
prop="adPic">
<el-input placeholder="请输入图片网址"
v-model="model.adPic"></el-input>
</el-form-item> -->
<el-form-item label="图片切换方式:">
<el-radio-group v-model="model.switchMode">
<el-radio :label="0">滑动</el-radio>
<el-radio :label="1">渐变</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="广告大标题:"
prop="adBigTitle">
<el-input placeholder="请输入广告大标题"
v-model="model.adBigTitle"></el-input>
</el-form-item>
<el-form-item label="广告小标题:"
prop="adSmallTitle">
<el-input placeholder="请输入广告小标题"
v-model="model.adSmallTitle"></el-input>
</el-form-item>
<el-form-item label="是否展示:">
<el-radio-group v-model="model.status">
<el-radio :label="1"></el-radio>
<el-radio :label="0"></el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="广告联系人:"
prop="adContactPerson">
<el-input placeholder="请输入联系人"
v-model="model.adContactPerson"></el-input>
</el-form-item>
<el-form-item label="联系邮箱:"
prop="adContactEmail">
<el-input placeholder="请输入联系邮箱"
v-model="model.adContactEmail"></el-input>
</el-form-item>
<el-form-item label="联系电话:"
prop="adContactPhone">
<el-input placeholder="请输入联系电话"
v-model="model.adContactPhone"></el-input>
</el-form-item>
</div>
</el-form>
<!-- 底部操作栏 -->
<div slot="footer">
<el-button type="primary"
size="medium"
@click="submit">确认</el-button>
</div>
<!-- end -->
</el-dialog>
</template>
<script>
import { addBanner, updateBanner, bannerPositionList } from '@/api/banner'
import singleUpload from '@/components/Upload/singleUpload'
const defaultModel = {
userType: 1,
adName: null,
adPositionId: null,
date: null,
linkValue: null,
adPic: null,
switchMode: 0,
adBigTitle: null,
adSmallTitle: null,
status: 1,
adContactPerson: null,
adContactEmail: null,
adContactPhone: null
}
export default {
name: 'bannerModal',
components: {
singleUpload
},
data() {
return {
visible: false,
title: null,
loading: false,
adPositionOptions: [],
model: Object.assign({}, defaultModel)
}
},
methods: {
init() {
// 获取广告位数据
bannerPositionList({ pageNum: 1, pageSize: 1000 }).then(res => {
this.adPositionOptions = res.data.list
})
},
add() {
this.init()
this.model = Object.assign({}, defaultModel)
this.visible = true
this.title = '添加广告'
this.$nextTick(() => {
this.$refs.bannerForm.clearValidate()
this.$refs.scrollContainer.scrollTop = 0
})
},
detail(row) {
this.init()
this.model = Object.assign({ date: [] }, row)
this.model.date = [this.moment(row.beginDate), this.moment(row.endDate)]
this.visible = true
this.title = '编辑广告'
this.$nextTick(() => {
this.$refs.bannerForm.clearValidate()
this.$refs.scrollContainer.scrollTop = 0
})
},
close() {
this.$emit('close')
this.visible = false
},
submit() {
// 提交
this.$refs.bannerForm.validate((valid) => {
if (valid) {
this.loading = true
this.model.beginDate = this.model.date[0]
this.model.endDate = this.model.date[1]
if (this.model.id) {
// 修改广告
updateBanner(this.model).then(res => {
this.loading = false
this.$emit('ok')
this.visible = false
}).catch(err => {
this.loading = false
})
} else {
// 添加广告
addBanner(this.model).then(res => {
this.loading = false
this.$emit('ok')
this.visible = false
}).catch(err => {
this.loading = false
})
}
}
})
}
}
}
</script>
<style scoped>
.scroll-container {
max-height: 50vh;
overflow: hidden;
overflow-y: auto;
}
.section .el-input,
.section .el-textarea,
.section .el-select,
.section .el-date-editor,
.section .el-cascader {
width: 400px;
}
.operation {
text-align: center;
}
</style>
\ No newline at end of file
<template> 
<el-card>
<!-- 操作栏 -->
<!-- <el-card class="operate-container"
shadow="never">
<div class="row-item">
<el-button size="small"
type="primary"
@click="handleAdd()">添加广告位</el-button>
</div>
</el-card> -->
<!-- 表格栏 -->
<el-table :data="list"
ref="table"
row-key="id"
v-loading="listLoading"
border>
<el-table-column label="广告位编码"
align="center">
<template slot-scope="scope">{{scope.row.type}}</template>
</el-table-column>
<el-table-column label="广告位名称"
align="center">
<template slot-scope="scope">{{scope.row.name}}</template>
</el-table-column>
<el-table-column label="位置宽度(像素)"
align="center">
<template slot-scope="scope">{{scope.row.width}}</template>
</el-table-column>
<el-table-column label="位置高度(像素)"
align="center">
<template slot-scope="scope">{{scope.row.high}}</template>
</el-table-column>
<el-table-column label="广告位描述"
align="center">
<template slot-scope="scope">{{scope.row.description}}</template>
</el-table-column>
<el-table-column label="操作"
width="180"
align="center">
<template slot-scope="scope">
<el-button size="mini"
type="success"
@click="lookDetail(scope.row)">查看</el-button>
<el-button size="mini"
type="primary"
@click="handleUpdate(scope.row)">编辑</el-button>
<!-- <el-button size="mini"
type="danger"
@click="handleDelete(scope.row)">删除</el-button> -->
</template>
</el-table-column>
</el-table>
<!-- 分页栏 -->
<div class="pagination-container">
<el-pagination background
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
layout="total, sizes, prev, pager, next, jumper"
:current-page.sync="listQuery.pageNum"
:page-size="listQuery.pageSize"
:page-sizes="[10,30,50]"
:total="total">
</el-pagination>
<!-- 弹窗 -->
<position-modal ref="positionModal"
@ok="getList"></position-modal>
</div>
</el-card>
</template>
<script>
import positionModal from './modules/positionModal'
import { bannerPositionList, deleteBannerPosition } from '@/api/banner'
// 广告位置管理
export default {
name: 'bannerPosition',
components: {
positionModal
},
data() {
return {
listQuery: {
pageSize: 10,
pageNum: 1
},
total: 0,
list: [],
listLoading: false
}
},
mounted() {
this.getList()
},
methods: {
// 表格页数改变
handleSizeChange(val) {
this.listQuery.pageNum = 1
this.listQuery.pageSize = val
this.getList()
},
// 表格页码改变
handleCurrentChange(val) {
this.listQuery.pageNum = val
this.getList()
},
// 添加
handleAdd() {
this.$refs.positionModal.add()
},
// 查看
lookDetail(row) {
this.$router.push({ name: 'bannerList', params: { id: row.id } })
},
// 编辑
handleUpdate(row) {
this.$refs.positionModal.detail(row)
},
// 删除
handleDelete(row) {
this.$confirm('删除该条数据前请确保相关联的数据已经解除关联', '您确定要删除所选广告位吗?', {
confirmButtonText: '确定',
cancelButtonText: '取消',
center: true
}).then(() => {
// 请求删除
this.listLoading = true
deleteBannerPosition({ id: row.id }).then(res => {
this.listLoading = false
this.getList()
}).catch(err => {
this.listLoading = false
})
})
},
//请求数据
getList() {
this.listLoading = true
bannerPositionList(this.listQuery).then(res => {
this.listLoading = false
this.list = res.data.list
this.total = res.data.total
}).catch(err => {
this.listLoading = false
})
}
}
}
</script>
<style scoped>
.operate-container {
text-align: right;
margin-top: 0;
margin-bottom: 20px;
}
</style>
\ No newline at end of file
<template>
<el-dialog :visible.sync="visible"
:title="title"
center
width="800px">
<!-- start -->
<!-- 内容布局 -->
<div class="scroll-container">
<!-- 广告位置信息 -->
<el-form :model="model"
class="section"
size="small"
ref="positionForm"
v-loading="loading"
label-width="200px">
<el-form-item label="广告位名称:"
prop="name"
:rules="[{ required: true, trigger: 'blur', message: '广告位名称不能为空' }]">
<el-input placeholder="请输入广告位名称"
v-model="model.name"></el-input>
</el-form-item>
<el-form-item label="广告位宽度:"
prop="width"
:rules="[{ required: true, trigger: 'blur', message: '广告位宽度不能为空' }]">
<el-input placeholder="请输入广告位宽度"
v-model.number="model.width"></el-input>
<label>像素</label>
</el-form-item>
<el-form-item label="广告位高度:"
prop="high"
:rules="[{ required: true, trigger: 'blur', message: '广告位高度不能为空' }]">
<el-input placeholder="请输入广告位高度"
v-model.number="model.high"></el-input>
<label>像素</label>
</el-form-item>
<el-form-item label="广告位描述:"
prop="description">
<el-input placeholder="请输入广告位描述"
v-model="model.description"></el-input>
</el-form-item>
<el-form-item label="是否展示:">
<el-radio-group v-model="model.isShow">
<el-radio :label="1"></el-radio>
<el-radio :label="0"></el-radio>
</el-radio-group>
</el-form-item>
</el-form>
</div>
<!-- 底部操作栏 -->
<div slot="footer">
<el-button type="primary"
size="medium"
@click="submit">确认</el-button>
</div>
<!-- end -->
</el-dialog>
</template>
<script>
import { addBannerPosition, updateBannerPosition } from '@/api/banner'
const defaultModel = {
name: null,
width: null,
high: null,
description: null,
isShow: 1
}
export default {
name: 'PositionModal',
data () {
return {
visible: false,
title: null,
loading: false,
model: Object.assign({}, defaultModel)
}
},
methods: {
add () {
this.model = Object.assign({}, defaultModel)
this.visible = true
this.title = '添加广告位'
},
detail (row) {
this.model = Object.assign({}, row)
this.visible = true
this.title = '编辑广告位'
},
close () {
this.$emit('close')
this.visible = false
},
submit () {
// 提交
this.$refs.positionForm.validate((valid) => {
if (valid) {
this.loading = true
if (this.model.id) {
// 修改广告位
updateBannerPosition(this.model).then(res => {
this.loading = false
this.$emit('ok')
this.visible = false
}).catch(err => {
this.loading = false
})
} else {
// 添加广告位
addBannerPosition(this.model).then(res => {
this.loading = false
this.$emit('ok')
this.visible = false
}).catch(err => {
this.loading = false
})
}
}
})
}
}
}
</script>
<style scoped>
.scroll-container {
max-height: 50vh;
overflow: hidden;
overflow-y: auto;
}
.section .el-input,
.section .el-textarea,
.section .el-select,
.section .el-cascader {
width: 400px;
}
.operation {
text-align: center;
}
</style>
\ No newline at end of file
<!--快递鸟账号配置-->
<template>
<el-dialog :visible.sync="visible"
:title="title"
center
width="680px">
<el-form ref="ruleForm" :model="model" label-width="150px" :rules="rules">
<el-form-item label="快递公司: ">
<label>{{ name }}</label>
</el-form-item>
<el-form-item label="账号: " prop="account">
<el-input v-model="model.account" placeholder="请输入账号"></el-input>
</el-form-item>
<el-form-item label="密码: " prop="passwd">
<el-input v-model="model.passwd" placeholder="请输入密码"></el-input>
</el-form-item>
<el-form-item label="月结编码: ">
<el-input v-model="model.monthlyInvoicing" placeholder="请输入月结编码"></el-input>
</el-form-item>
<el-form-item label="网点标识: ">
<el-input v-model="model.outletIdentification" placeholder="请输入网点标识"></el-input>
</el-form-item>
<el-form-item label="付款方式: ">
<el-select placeholder="请选择付款类型"
v-model="model.paymentMethod">
<el-option v-for="item in typeOptions"
:key="item.id"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="模板尺寸: ">
<el-input v-model="model.templateSize" placeholder="请输入模板尺寸"></el-input>
</el-form-item>
</el-form>
<div slot="footer">
<el-button type="primary"
@click="submit()">提交</el-button>
<el-button @click="cancel()">取消</el-button>
</div>
</el-dialog>
</template>
<script>
import { postExpresses,kuaidn} from '@/api/kuaid'
import { Message, MessageBox } from 'element-ui'
// 添加类型分类
export default {
name:"ExpressesModel",
data () {
return {
visible: false,
title: '快递鸟账号配置',
name: null,
amountTip: null,//提现金额
model:{
account: null,
expressId: null,
mchtId: this.$store.getters.userId,
monthlyInvoicing:null,
outletIdentification:null,
passwd:null,
paymentMethod:null,
templateSize:null
},
codeShow:true,
codeCount:'',
timer:null,
//<!--表单 require-->
rules: {
account: [
{ required: true, message: '请输入账号', trigger: 'blur' }
],
passwd: [
{ required: true, message: '请输入密码', trigger: 'blur' },
]
},
//付款方式
typeOptions: [
{
id:0,
name:'先付'
},
{
id:1,
name:'到付'
},
{
id:2,
name:'月结'
},
{
id:3,
name:'第三方支付'
}
]
}
},
methods: {
init(row){
this.visible = true;
console.log(row);
this.name = row.expressName;
this.model.expressId = row.id;
},
//取消
cancel() {
this.visible = false;
},
//提交
submit(){
this.$refs.ruleForm.validate((valid) => {
if (valid) {
this.postExpresses();
}
})
},
/**
* 网络请求
*/
//快递鸟配置
kuaidn() {
kuaidn(this.model).then(response => {
Message({
message: '安装成功',
type: 'success',
duration: 3 * 1000
})
this.$emit('ok');
this.visible = false;
}).catch(err => {
})
},
//安装
postExpresses() {
var params = {mchtId:this.$store.getters.userId,expressId:this.model.expressId,status:"1"}
postExpresses(params).then(response => {
this.kuaidn();
}).catch(err => {
})
}
}
}
</script>
<style scoped>
</style>
\ No newline at end of file
<template> 
<el-card>
<!-- 表格栏 -->
<el-table :data="list"
ref="table"
row-key="id"
v-loading="listLoading"
border>
<el-table-column label="配送方式名称11"
align="center">
<template slot-scope="scope">{{scope.row.expressName}}</template>
</el-table-column>
<el-table-column label="网址"
align="center">
<template slot-scope="scope">{{scope.row.url}}</template>
</el-table-column>
<el-table-column label="快递鸟打印"
align="center">
<template slot-scope="scope">{{scope.row.kdniaoFlag == 1? '是' : '否'}}</template>
</el-table-column>
<el-table-column label="默认方式"
align="center">
<!-- <template slot-scope="scope"> -->
<template slot-scope="scope">{{scope.row.defaultPrintFlag == 1? '是' : '否'}}</template>
<!-- <el-switch v-model="scope.row.defaultPrintFlag"
:active-value="1"></el-switch> -->
<!-- </template> -->
</el-table-column>
<el-table-column label="排序"
align="center">
<template slot-scope="scope">{{scope.row.rate}}</template>
</el-table-column>
<el-table-column label="操作"
width="140"
align="center">
<template slot-scope="scope">
<el-button size="small"
type="text"
@click="installation(scope.$index, scope.row)"
v-if="!scope.row.supplier">安装</el-button>
<el-button size="small"
type="text"
@click="uninstall(scope.$index, scope.row)"
v-else-if="scope.row.supplier.status == 1">卸载</el-button>
<el-button size="small"
type="text"
@click="installation(scope.$index, scope.row)"
v-else-if="scope.row.supplier.status == 0">安装</el-button>
</template>
</el-table-column>
</el-table>
<!-- 弹窗 -->
<ExpressesModel ref="detailModal"
@ok="fetchExpresses"></ExpressesModel>
<!-- end -->
</el-card>
</template>
<script>
import { fetchExpresses, postExpresses } from '@/api/kuaid'
import ExpressesModel from "@/views/psm/deliveryWay/expressesModel"
import { Message, MessageBox } from 'element-ui'
// 配送方式列表
export default {
name: 'Delivery',
components: {
ExpressesModel
},
data() {
return {
listLoading: false,//table row是否显示加载效果 这边先给false 应该到时候数据请求成功就设置为false
list: [],
}
},
created() {
this.fetchExpresses()
},
methods: {
// 安装
installation(index, row) {
this.$confirm('你确定安装所选配送方式吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$refs.detailModal.init(row)
})
},
//卸载
uninstall(index, row) {
this.$confirm('你确定卸载所选配送方式吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.postExpresses(row.id)
})
},
/**
* 网络请求
*/
//请求数据
fetchExpresses() {
this.listLoading = true;
fetchExpresses(this.$store.getters.userId).then(response => {
this.listLoading = false
this.list = response.data
}).catch(err => {
this.listLoading = false
})
},
//卸载
postExpresses(expressId) {
var params = { mchtId: this.$store.getters.userId, expressId: expressId, status: 0 }
postExpresses(params).then(response => {
Message({
message: '卸载成功',
type: 'success',
duration: 3 * 1000
})
this.fetchExpresses()
})
}
}
}
</script>
<style scoped>
</style>
\ No newline at end of file
<template>
<el-dialog :visible.sync="visible"
:title="title"
center
width="650px">
<el-form :model="model"
ref="classifyForm"
v-loading="loading"
label-width="180px">
<el-form-item label="分类名称:"
prop="classifyName"
:rules="[{ required: true, trigger: 'blur', message: '分类名称不能为空' }]">
<el-input placeholder="请输入分类名称"
class="input-width"
size="small"
v-model="model.classifyName"></el-input>
</el-form-item>
</el-form>
<div slot="footer">
<el-button type="primary"
@click="submit">确认</el-button>
<el-button @click="close">取消</el-button>
</div>
</el-dialog>
</template>
<script>
import { createFeedbackClassify, updateFeedbackClassify } from '@/api/feedback'
// 添加类型分类
export default {
name: 'feedbackClassifyModal',
components: {},
data() {
return {
visible: false,
title: null,
loading: false,
model: {
count: 0,
classifyName: null
}
}
},
methods: {
init() {
this.model = {
count: 0,
classifyName: null
}
this.$nextTick(() => {
this.$refs.classifyForm.clearValidate()
})
},
add(parentId) {
this.init()
// 添加数据处理
this.visible = true
this.title = '新增分类'
},
detail(data) {
this.init()
this.visible = true
this.model = Object.assign({}, data)
this.title = '编辑分类'
},
submit() {
// 提交保存
this.$refs.classifyForm.validate((valid) => {
if (valid) {
// 验证通过
this.loading = true
if (this.model.id) {
// 修改类型分类
updateFeedbackClassify(this.model).then(res => {
this.loading = false
this.visible = false
this.$emit('ok')
}).catch(err => {
this.loading = false
})
} else {
// 添加类型分类
createFeedbackClassify(this.model).then(res => {
this.loading = false
this.visible = false
this.$emit('ok')
}).catch(err => {
this.loading = false
})
}
}
})
},
close() {
this.$emit('close')
this.visible = false
}
}
}
</script>
<style scoped>
.input-width {
width: 300px;
}
</style>
\ No newline at end of file
<template> 
<div class="app-container">
<!-- 操作栏 -->
<el-card class="operate-container"
shadow="never">
<div class="row-item">
<el-button size="small"
type="primary"
@click="handleAdd">新增分类</el-button>
</div>
</el-card>
<!-- 表格栏 -->
<div class="table-container">
<el-table :data="list"
v-loading="listLoading"
border>
<el-table-column label="编号"
align="center"
prop="id">
</el-table-column>
<el-table-column label="分类名称"
align="center">
<template slot-scope="scope">{{scope.row.classifyName}}</template>
</el-table-column>
<el-table-column label="反馈数量"
align="center">
<template slot-scope="scope">{{scope.row.count || 0}}</template>
</el-table-column>
<el-table-column label="创建时间"
align="center">
<template slot-scope="scope">{{scope.row.createDate || scope.row.updateDate | formatTime}}</template>
</el-table-column>
<el-table-column label="操作"
width="220"
align="center">
<template slot-scope="scope">
<el-button size="mini"
type="success"
@click="handleLook(scope.row)">查看</el-button>
<el-button size="mini"
type="warning"
@click="handleUpdate(scope.row)">编辑</el-button>
<el-button size="mini"
type="danger"
@click="handleDelete(scope.row)">删除</el-button>
</template>
</el-table-column>
</el-table>
</div>
<!-- 弹窗 -->
<feedback-classify-dialog ref="detailDialog"
@ok="getList"></feedback-classify-dialog>
<!-- end -->
</div>
</template>
<script>
import { feedbackClassifyList, deleteFeedbackClassify } from '@/api/feedback'
import { formatDate } from '@/utils/date'
import FeedbackClassifyDialog from './components/FeedbackClassifyDialog'
// 意见反馈分类列表
export default {
name: 'FeedbackClassifyList',
components: {
FeedbackClassifyDialog
},
data() {
return {
list: [],
listLoading: false
}
},
mounted() {
this.getList()
},
filters: {
formatTime(time) {
if (!time) {
return '--'
}
let date = new Date(time)
return formatDate(date, 'yyyy-MM-dd hh:mm:ss')
}
},
methods: {
// 添加
handleAdd(row) {
this.$refs.detailDialog.add()
},
handleLook(row) {
this.$router.push({ path: 'feedbackManagement', query: { classifyId: row.id } })
},
// 编辑
handleUpdate(row) {
this.$refs.detailDialog.detail(row)
},
// 删除
handleDelete(row) {
this.$confirm('删除该分类前请确保相关联的数据已经解除关联', '您确定要删除' + row.classifyName + '分类吗?', {
confirmButtonText: '确定',
cancelButtonText: '取消',
center: true
}).then(() => {
// 请求删除
deleteFeedbackClassify({ id: row.id }).then(res => {
this.getList()
})
})
},
//请求数据
getList() {
this.listLoading = true
feedbackClassifyList().then(res => {
this.listLoading = false
this.list = res.data
})
}
}
}
</script>
<style scoped>
.operate-container {
text-align: right;
margin-top: 0;
margin-bottom: 20px;
}
</style>
\ No newline at end of file
<template>
<el-dialog :visible.sync="visible"
:title="title"
center
width="960px">
<!-- start -->
<!-- titla -->
<div class="title-info">
<div>{{feedback.title}}</div>
<div>发布人:{{feedback.putBy}}<span></span>发布时间:{{feedback.createDate || feedback.updateDate | formatTime}}</div>
</div>
<el-divider></el-divider>
<div class="scroll-container"
ref="scrollContainer">
<div v-html="feedback.content"></div>
</div>
<!-- 处理意见 -->
<el-form :model="model"
v-loading="loading"
ref="handleForm"
label-width="300px">
<el-form-item label="处理意见:"
prop="opinion"
:rules="[{required: true, message: '处理意见不能为空', trigger: 'blur'}]">
<el-input class="input-width"
v-model="model.opinion"></el-input>
</el-form-item>
</el-form>
<div slot="footer">
<el-button type="primary"
@click="submit">确认</el-button>
<el-button @click="close">取消</el-button>
</div>
<!-- end -->
</el-dialog>
</template>
<script>
import { feedbackDetail, handleFeedback } from '@/api/feedback'
import { formatDate } from '@/utils/date'
// 处理意见反馈
export default {
name: 'FeedbackDialog',
data() {
return {
visible: false,
title: null,
loading: false,
id: null,
feedback: {},
model: {
opinion: null
}
}
},
filters: {
formatTime(time) {
if (!time) {
return '--'
}
let date = new Date(time)
return formatDate(date, 'yyyy-MM-dd hh:mm:ss')
}
},
methods: {
init() {
this.model = { opinion: null }
this.$nextTick(() => {
this.$refs.handleForm.clearValidate()
this.$refs.scrollContainer.scrollTop = 0
})
},
// 获取详情
detail(id) {
this.id = id
this.init()
this.visible = true
this.title = '反馈详情'
this.loading = true
feedbackDetail({ id: id }).then(res => {
this.feedback = res.data
this.loading = false
}).catch(err => {
this.loading = false
this.close()
})
},
// 提交保存
submit() {
this.$refs.handleForm.validate((valid) => {
if (valid) {
this.loading = true
this.feedback.opinion = this.model.opinion
handleFeedback(this.feedback).then(res => {
this.loading = false
this.visible = false
this.$emit('ok')
}).catch(err => {
this.loading = false
})
}
})
},
close() {
this.$emit('close')
this.visible = false
}
}
}
</script>
<style scoped>
.scroll-container {
max-height: 50vh;
overflow: hidden;
overflow-y: auto;
margin-bottom: 30px;
}
.title-info div {
font-size: 16px;
color: #333;
text-align: center;
}
.title-info div:last-child {
font-size: 14px;
color: #666;
margin-top: 20px;
}
.title-info span {
margin-left: 100px;
}
.input-width {
width: 300px;
}
</style>
\ No newline at end of file
<template> 
<el-card>
<!-- 操作栏 -->
<el-card class="filter-container"
shadow="never">
<el-form :inline="true"
:model="listQuery"
size="small">
<el-form-item label="所属分类:">
<el-select v-model="listQuery.classifyId"
clearable>
<el-option v-for="item in classifyList"
:key="item.id"
:label="item.classifyName"
:value="item.id"></el-option>
</el-select>
</el-form-item>
<el-form-item label="反馈标题:">
<el-input v-model="listQuery.keyword"
clearable></el-input>
</el-form-item>
<!-- 筛选操作 -->
<el-form-item>
<el-button type="primary"
@click="handleSearchList"
size="small">搜索</el-button>
</el-form-item>
</el-form>
</el-card>
<!-- 表格栏 -->
<div class="table-container">
<el-table :data="list"
ref="table"
row-key="id"
v-loading="listLoading"
border>
<el-table-column label="编码"
align="center"
prop="id">
</el-table-column>
<el-table-column label="标题"
align="center"
prop="title">
</el-table-column>
<el-table-column label="分类"
align="center"
prop="classifyName">
</el-table-column>
<el-table-column label="提交人"
align="center"
prop="putBy">
</el-table-column>
<el-table-column label="发布时间"
align="center">
<template slot-scope="scope">{{scope.row.createDate | formatTime}}</template>
</el-table-column>
<el-table-column label="处理意见"
align="center"
prop="opinion">
</el-table-column>
<el-table-column label="操作"
width="160"
align="center">
<template slot-scope="scope">
<el-button size="mini"
type="warning"
@click="handleUpdate(scope.row)">处理</el-button>
<el-button size="mini"
type="danger"
@click="handleDelete(scope.row)">删除</el-button>
</template>
</el-table-column>
</el-table>
</div>
<!-- 分页栏 -->
<div class="pagination-container">
<el-pagination background
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
layout="total, sizes, prev, pager, next, jumper"
:current-page.sync="listQuery.pageNum"
:page-size="listQuery.pageSize"
:page-sizes="[10,30,50]"
:total="total">
</el-pagination>
</div>
<!-- 弹窗 -->
<feedback-dialog ref="feedbackDialog"
@ok="getList"></feedback-dialog>
</el-card>
</template>
<script>
import { feedbackList, feedbackClassifyList, deleteFeedback } from '@/api/feedback'
import { formatDate } from '@/utils/date'
import FeedbackDialog from './components/FeedbackDialog'
const defaultListQuery = {
classifyId: null,
keyword: null,
pageNum: 1,
pageSize: 10
}
// 意见反馈列表
export default {
name: 'FeedbackManagement',
components: {
FeedbackDialog
},
data() {
return {
listQuery: Object.assign({}, defaultListQuery),
total: 0,
classifyList: [],
list: [],
listLoading: false
}
},
mounted() {
if (this.$route.query.classifyId) {
this.listQuery.classifyId = this.$route.query.classifyId
}
this.init()
},
filters: {
formatTime(time) {
if (!time) {
return '--'
}
let date = new Date(time)
return formatDate(date, 'yyyy-MM-dd hh:mm:ss')
}
},
methods: {
init() {
feedbackClassifyList().then(res => {
this.classifyList = res.data
})
this.getList()
},
handleSearchList() {
this.listQuery.pageNum = 1
this.getList()
},
handleSizeChange(val) {
this.listQuery.pageNum = 1
this.listQuery.pageSize = val
this.getList()
},
handleCurrentChange(val) {
this.listQuery.pageNum = val
this.getList()
},
// 编辑
handleUpdate(row) {
this.$refs.feedbackDialog.detail(row.id)
},
// 删除
handleDelete(row) {
this.$confirm('删除后将不能恢复请谨慎操作', '您确定要删除该意见反馈吗?', {
confirmButtonText: '确定',
cancelButtonText: '取消',
center: true
}).then(() => {
// 请求删除
deleteFeedback({ id: row.id }).then(res => {
this.getList()
})
})
},
//请求数据
getList() {
this.listLoading = true
feedbackList(this.listQuery).then(res => {
this.listLoading = false
this.list = res.data.list
this.total = res.data.total
}).catch(err => {
this.listLoading = false
})
}
}
}
</script>
<style scoped>
</style>
\ No newline at end of file
<template>
<el-dialog :visible.sync="visible"
:title="title"
center
width="560px">
<el-form :model="model"
ref="timeForm"
v-loading="loading"
label-width="180px">
<el-form-item label="秒杀开始时间:"
prop="beginTime"
:rules="[{ required: true, trigger: 'change', message: '秒杀开始时间不能为空' }]">
<el-time-picker v-model="model.beginTime"
format="HH:mm"
value-format="HH:mm"
placeholder="选择时间">
</el-time-picker>
</el-form-item>
<el-form-item label="秒杀结束时间:"
prop="endTime"
:rules="[{ required: true, trigger: 'change', message: '秒杀结束时间不能为空' }]">
<el-time-picker v-model="model.endTime"
format="HH:mm"
value-format="HH:mm"
placeholder="选择时间">
</el-time-picker>
</el-form-item>
</el-form>
<div slot="footer">
<el-button type="primary"
@click="submit">确认</el-button>
<el-button @click="close">取消</el-button>
</div>
</el-dialog>
</template>
<script>
import { createFlashTime, updateFlashTime } from '@/api/setting'
const defaultModel = {
beginTime: null,
endTime: null
}
// 添加秒杀时间
export default {
name: 'flashTimeDialog',
data() {
return {
visible: false,
title: null,
loading: false,
model: Object.assign({}, defaultModel)
}
},
methods: {
add() {
// 添加数据处理
this.model = Object.assign({}, defaultModel)
this.$nextTick(() => {
this.$refs.timeForm.clearValidate()
})
this.visible = true
this.title = '添加秒杀时间'
},
detail(data) {
this.model = data
this.visible = true
this.title = '编辑秒杀时间'
},
submit() {
// 提交保存
this.$refs.timeForm.validate((valid) => {
if (valid) {
// 验证通过
this.loading = true
//判断修改或添加
if (this.model.id) {
// 修改时间段
updateFlashTime(this.model).then(res => {
this.loading = false
this.visible = false
this.$emit('ok')
}).catch(err => {
this.loading = false
})
} else {
//创建时间段
this.loading = true
createFlashTime(this.model).then(res => {
this.loading = false
this.visible = false
this.$emit('ok')
}).catch(err => {
this.loading = false
})
}
}
})
},
close() {
this.$emit('close')
this.visible = false
}
}
}
</script>
<style scoped>
</style>
\ No newline at end of file
<template> 
<el-card>
<!-- 操作栏 -->
<el-card class="operate-container"
shadow="never">
<div class="row-item">
<el-button size="small"
type="primary"
@click="handleAdd">新增时间</el-button>
</div>
</el-card>
<!-- 表格栏 -->
<div class="table-container">
<el-table :data="list"
ref="table"
row-key="id"
v-loading="listLoading"
border>
<el-table-column label="序号"
align="center">
<template slot-scope="scope">{{scope.$index + 1}}</template>
</el-table-column>
<el-table-column label="开始时间"
align="center"
prop="beginTime">
</el-table-column>
<el-table-column label="结束时间"
align="center"
prop="endTime">
</el-table-column>
<el-table-column label="秒杀商品数量"
align="center"
prop="productNum">
</el-table-column>
<el-table-column label="操作"
width="160"
align="center">
<template slot-scope="scope">
<el-button size="mini"
type="warning"
@click="handleUpdate(scope.row)">编辑</el-button>
<el-button size="mini"
type="danger"
@click="handleDelete(scope.row)">删除</el-button>
</template>
</el-table-column>
</el-table>
</div>
<!-- 弹窗 -->
<flash-time-dialog ref="timeDialog"
@ok="getList"></flash-time-dialog>
</el-card>
</template>
<script>
import { flashTimeList, deleteFlashTime } from '@/api/setting'
import FlashTimeDialog from './components/FlashTimeDialog'
// 秒杀时间列表
export default {
name: 'flashTimeList',
components: {
FlashTimeDialog
},
data() {
return {
list: [],
listLoading: false
}
},
mounted() {
this.getList()
},
methods: {
// 添加
handleAdd() {
this.$refs.timeDialog.add()
},
// 编辑
handleUpdate(row) {
this.$refs.timeDialog.detail(row)
},
// 删除
handleDelete(row) {
this.$confirm('删除后将不能恢复请谨慎操作', '您确定要删除该秒杀时间吗?', {
confirmButtonText: '确定',
cancelButtonText: '取消',
center: true
}).then(() => {
// 请求删除
deleteFlashTime(row.id).then(res => {
this.getList()
})
})
},
//请求数据
getList() {
this.listLoading = true
flashTimeList(this.listQuery).then(res => {
this.listLoading = false
this.list = res.data.list
}).catch(err => {
this.listLoading = false
})
}
}
}
</script>
<style scoped>
.operate-container {
text-align: right;
margin-top: 0;
margin-bottom: 20px;
}
</style>
\ No newline at end of file
<template>
<div class="floor">
<div class="title">内容类型:</div>
<el-select v-model="storeyTypeId"
size="small"
placeholder="请选择类型"
@change="changeType">
<el-option v-for="item in typeList"
:key="item.id"
:label="item.name"
:value="item.id"></el-option>
</el-select>
<!-- 商品 -->
<div v-if="storeyTypeId == 1">
<div class="title">选择商品类目:</div>
<el-select size="small"
v-model="classifyId">
<el-option v-for="item in classifyList"
:key="item.id"
:label="item.name"
:value="item.id"></el-option>
</el-select>
<div class="title">筛选类型:</div>
<el-select size="small"
v-model="goods.filterType">
<el-option v-for="item in goodsFilterList"
:key="item.id"
:label="item.name"
:value="item.id"></el-option>
</el-select>
<div class="title">单个商品展示样式:</div>
<el-select size="small"
v-model="goods.showType">
<el-option v-for="item in goodsShowList"
:key="item.id"
:label="item.name"
:value="item.id"></el-option>
</el-select>
</div>
<!-- 商家 -->
<div v-else-if="storeyTypeId == 2">
<div class="title">选择档口市场:</div>
<el-select size="small"
v-model="shop.stallId">
<el-option v-for="item in stallList"
:key="item.id"
:label="item.name"
:value="item.id"></el-option>
</el-select>
<div class="title">选择主营类目:</div>
<el-select size="small"
v-model="classifyId">
<el-option v-for="item in classifyList"
:key="item.id"
:label="item.name"
:value="item.id"></el-option>
</el-select>
<div class="title">筛选类型:</div>
<el-select size="small"
v-model="shop.filterType">
<el-option v-for="item in shopFilterList"
:key="item.id"
:label="item.name"
:value="item.id"></el-option>
</el-select>
<div class="title">单个商家展示样式:</div>
<el-select size="small"
v-model="shop.showType">
<el-option v-for="item in shopShowList"
:key="item.id"
:label="item.name"
:value="item.id"></el-option>
</el-select>
</div>
<!-- 品牌 -->
<div v-else-if="storeyTypeId == 3">
<div class="title">所属类目:</div>
<el-select size="small"
v-model="classifyId">
<el-option v-for="item in classifyList"
:key="item.id"
:label="item.name"
:value="item.id"></el-option>
</el-select>
<div class="title">筛选类型:</div>
<el-select size="small"
v-model="brand.filterType">
<el-option v-for="item in brandFilterList"
:key="item.id"
:label="item.name"
:value="item.id"></el-option>
</el-select>
<div class="title">单个品牌展示样式:</div>
<el-select size="small"
v-model="brand.showType">
<el-option v-for="item in brandShowList"
:key="item.id"
:label="item.name"
:value="item.id"></el-option>
</el-select>
</div>
<!-- 服务 -->
<div v-else-if="storeyTypeId == 4">
<div class="title">所属类目:</div>
<el-select size="small"
v-model="classifyId">
<el-option v-for="item in classifyList"
:key="item.id"
:label="item.name"
:value="item.id"></el-option>
</el-select>
<div class="title">展示内容:</div>
<el-select size="small"
v-model="service.contentType">
<el-option v-for="item in serviceContentList"
:key="item.id"
:label="item.name"
:value="item.id"></el-option>
</el-select>
<div class="title">筛选类型:</div>
<el-select v-if="service.contentType == 1"
size="small"
v-model="service.filterType">
<el-option v-for="item in serviceFilterList"
:key="item.id"
:label="item.name"
:value="item.id"></el-option>
</el-select>
<el-select v-else
size="small"
v-model="service.filterType">
<el-option v-for="item in serviceFilterTwoList"
:key="item.id"
:label="item.name"
:value="item.id"></el-option>
</el-select>
<div class="title">单个服务展示样式:</div>
<el-select size="small"
v-model="service.showType">
<el-option v-for="item in serviceShowList"
:key="item.id"
:label="item.name"
:value="item.id"></el-option>
</el-select>
</div>
<!-- 活动 -->
<div v-else-if="storeyTypeId == 5">
<div class="title">展示活动:</div>
<el-select size="small"
v-model="activity.activityId">
<el-option v-for="item in activityList"
:key="item.id"
:label="item.name"
:value="item.id"></el-option>
</el-select>
<div class="title">展示内容:</div>
<el-select size="small"
v-model="activity.contentType">
<el-option v-for="item in activityContentList"
:key="item.id"
:label="item.name"
:value="item.id"></el-option>
</el-select>
<div class="title">筛选类型:</div>
<el-select v-if="activity.contentType == 1"
size="small"
v-model="activity.filterType">
<el-option v-for="item in activityFilterList"
:key="item.id"
:label="item.name"
:value="item.id"></el-option>
</el-select>
<el-select v-else
size="small"
v-model="activity.filterType">
<el-option v-for="item in activityFilterTwoList"
:key="item.id"
:label="item.name"
:value="item.id"></el-option>
</el-select>
<div class="title">单个内容展示样式:</div>
<el-select v-if="activity.contentType == 1"
size="small"
v-model="activity.showType">
<el-option v-for="item in activityShowList"
:key="item.id"
:label="item.name"
:value="item.id"></el-option>
</el-select>
<el-select v-else
size="small"
v-model="activity.showType">
<el-option v-for="item in activityShowTwoList"
:key="item.id"
:label="item.name"
:value="item.id"></el-option>
</el-select>
</div>
<!-- 广告 -->
<div v-else-if="storeyTypeId == 6">
<div class="title">图片名称:</div>
<el-input size="small"
v-model="banner.name"></el-input>
<div class="title">图片链接:</div>
<el-input size="small"
v-model="banner.imgUrl"></el-input>
<div class="title">图片:</div>
<el-image :src="banner.img"
:preview-src-list="[banner.img]"></el-image>
<single-upload :showList='false'
v-model="banner.img"></single-upload>
</div>
<!-- 文章 -->
<div v-else-if="storeyTypeId == 7">
<div class="title">选择文章类别:</div>
<el-select size="small"
v-model="article.classifyId">
<el-option v-for="item in articleClassifyList"
:key="item.id"
:label="item.classifyName"
:value="item.id"></el-option>
</el-select>
<div class="title">筛选类型:</div>
<el-select size="small"
v-model="article.filterType">
<el-option v-for="item in articleFilterList"
:key="item.id"
:label="item.name"
:value="item.id"></el-option>
</el-select>
<div class="title">单篇展示样式:</div>
<el-select size="small"
v-model="article.showType">
<el-option v-for="item in articleShowList"
:key="item.id"
:label="item.name"
:value="item.id"></el-option>
</el-select>
</div>
<!-- 营销 -->
<div v-else-if="storeyTypeId == 8">
<div class="title">选择营销类别:</div>
<el-select size="small"
v-model="marketing.classifyType">
<el-option v-for="item in marketingClassifyType"
:key="item.id"
:label="item.name"
:value="item.id"></el-option>
</el-select>
<div class="title">筛选类型:</div>
<el-select size="small"
v-model="marketing.filterType">
<el-option v-for="item in marketingFilterList"
:key="item.id"
:label="item.name"
:value="item.id"></el-option>
</el-select>
<div class="title">单个商品展示样式:</div>
<el-select size="small"
v-model="marketing.showType">
<el-option v-for="item in marketingShowList"
:key="item.id"
:label="item.name"
:value="item.id"></el-option>
</el-select>
</div>
<!-- 视频 -->
<div v-else-if="storeyTypeId == 9">
<div class="title">选择商品类目:</div>
<el-select size="small"
v-model="classifyId">
<el-option v-for="item in classifyList"
:key="item.id"
:label="item.name"
:value="item.id"></el-option>
</el-select>
<div class="title">筛选类型:</div>
<el-select size="small"
v-model="video.filterType">
<el-option v-for="item in videoFilterList"
:key="item.id"
:label="item.name"
:value="item.id"></el-option>
</el-select>
<div class="title">单个视频展示样式:</div>
<el-select size="small"
v-model="video.showType">
<el-option v-for="item in videoShowList"
:key="item.id"
:label="item.name"
:value="item.id"></el-option>
</el-select>
</div>
<!-- 优惠券 -->
<div v-else-if="storeyTypeId == 10">
<div class="title">筛选类型:</div>
<el-select size="small"
v-model="coupon.filterType">
<el-option v-for="item in couponFilterList"
:key="item.id"
:label="item.name"
:value="item.id"></el-option>
</el-select>
<div class="title">单个优惠券展示样式:</div>
<el-select size="small"
v-model="coupon.showType">
<el-option v-for="item in couponShowList"
:key="item.id"
:label="item.name"
:value="item.id"></el-option>
</el-select>
</div>
<!-- 公用数据 -->
<div v-if="storeyTypeId && storeyTypeId != 6">
<div class="title">展示多少列:</div>
<el-select size="small"
v-model="column">
<el-option v-for="item in columnList"
:key="item.id"
:label="item.name"
:value="item.id"></el-option>
</el-select>
<div class="title">展示多少行:</div>
<el-select size="small"
v-model="row">
<el-option v-for="item in rowList"
:key="item.id"
:label="item.name"
:value="item.id"></el-option>
</el-select>
<div class="title">展示换页数:</div>
<el-select size="small"
v-model="page">
<el-option v-for="item in pageList"
:key="item.id"
:label="item.name"
:value="item.id"></el-option>
</el-select>
</div>
<!-- 保存 -->
<div v-if="storeyTypeId">
<el-button type="danger"
size="small"
@click="save">保存</el-button>
</div>
</div>
</template>
<script>
import { floorType, stallList } from '@/api/floor'
import { fetchClassifyList } from '@/api/classify'
import { activityList } from '@/api/activity'
import { articleFirstClassifyList } from '@/api/article'
import singleUpload from '@/components/Upload/singleUpload'
// 楼层列组件
export default {
name: 'floorColumn',
props: {
value: Object
},
components: {
singleUpload
},
data() {
return {
loading: false,
typeList: [],
storeyTypeId: null,
classifyId: null,
column: null,
row: null,
page: null,
classifyList: [],
stallList: [],
goodsFilterList: [{ name: '上新数量', id: 1 }, { name: '销售数量', id: 2 }, { name: '浏览数量', id: 3 }, { name: '评价数量', id: 4 }, { name: '评分分数', id: 5 }],
goodsShowList: [{ name: '竖长形', id: 1 }, { name: '横宽型', id: 2 }],
shopFilterList: [{ name: '商品销量', id: 1 }, { name: '商品数量', id: 2 }, { name: '加入时间', id: 3 }, { name: '上新数量(一周)', id: 4 }, { name: '收藏数量', id: 5 }, { name: '分销商数量', id: 6 }, { name: '店铺评分', id: 7 }],
shopShowList: [{ name: '商家概要', id: 1 }, { name: '商家及商品', id: 2 }],
brandFilterList: [{ name: '商品销量', id: 1 }, { name: '商品数量', id: 2 }, { name: '上新数量(一周)', id: 3 }],
brandShowList: [{ name: '品牌log', id: 1 }, { name: '品牌缩略', id: 2 }],
serviceContentList: [{ name: '服务', id: 1 }, { name: '服务商', id: 2 }],
serviceFilterList: [{ name: '浏览数量', id: 1 }, { name: '上新时间', id: 2 }],
serviceFilterTwoList: [{ name: '服务数量', id: 1 }, { name: '加入时间', id: 2 }],
serviceShowList: [{ name: '竖长形', id: 1 }, { name: '横宽型', id: 2 }],
activityList: [],
activityContentList: [{ name: '活动参与商家', id: 1 }, { name: '活动参与商品', id: 2 }],
activityFilterList: [{ name: '商品销量', id: 1 }, { name: '商品数量', id: 2 }, { name: '加入时间', id: 3 }, { name: '上新数量(一周)', id: 4 }, { name: '收藏数量', id: 5 }, { name: '分销商数量', id: 6 }, { name: '店铺评分', id: 7 }],
activityFilterTwoList: [{ name: '上新数量', id: 1 }, { name: '销售数量', id: 2 }, { name: '浏览数量', id: 3 }, { name: '评价数量', id: 4 }, { name: '评分分数', id: 5 }],
activityShowList: [{ name: '商家概要', id: 1 }, { name: '商家及商品', id: 2 }],
activityShowTwoList: [{ name: '竖长形', id: 1 }, { name: '横宽型', id: 2 }],
articleClassifyList: [],
articleFilterList: [{ name: '发布时间', id: 1 }, { name: '浏览数量', id: 2 }, { name: '点赞数量', id: 3 }],
articleShowList: [{ name: '文章图文缩略(左右)', id: 1 }, { name: '文章图文缩略(上下)', id: 2 }],
marketingClassifyType: [{ name: '满减', id: 1 }, { name: '拼货', id: 2 }, { name: '秒杀', id: 3 }],
marketingFilterList: [{ name: '销售数量', id: 1 }, { name: '参与时间', id: 2 }, { name: '库存数量', id: 3 }],
marketingShowList: [{ name: '竖长形', id: 1 }, { name: '横宽型', id: 2 }],
videoFilterList: [{ name: '上新数量', id: 1 }, { name: '销售数量', id: 2 }, { name: '浏览数量', id: 3 }, { name: '评价数量', id: 4 }, { name: '评分分数', id: 5 }, { name: '视频播放量', id: 6 }],
videoShowList: [{ name: '视频播放', id: 1 }, { name: '商品视频缩略-横', id: 2 }, { name: '商品视频缩略-竖', id: 3 }],
couponFilterList: [{ name: '平台券', id: 1 }, { name: '商家券', id: 2 }],
couponShowList: [{ name: '优惠券(大)', id: 1 }, { name: '优惠券(大)', id: 2 }],
columnList: [],
rowList: [],
pageList: [],
goods: {
filterType: null,
showType: null
},
shop: {
stallId: null,
filterType: null,
showType: null
},
brand: {
filterType: null,
showType: null
},
service: {
contentType: null,
filterType: null,
showType: null
},
activity: {
activityId: null,
contentType: null,
filterType: null,
showType: null
},
banner: {
name: null,
imgUrl: null,
img: null
},
article: {
classifyId: null,
filterType: null,
showType: null
},
marketing: {
classifyType: null,
filterType: null,
showType: null
},
video: {
filterType: null,
showType: null
},
coupon: {
filterType: null,
showType: null
}
}
},
created() {
this.init()
if (this.value.storeyTypeId) {
this.storeyTypeId = this.value.storeyTypeId
this.changeType(this.storeyTypeId)
this.value.pmsStoreyTypeContents.forEach(item => {
this.typeToValue(item)
})
}
},
methods: {
init() {
floorType().then(res => {
this.typeList = res.data
})
for (let i = 1; i < 7; i++) {
this.columnList.push({ name: i, id: i })
if (i < 5) {
this.rowList.push({ name: i, id: i })
}
this.pageList.push({ name: i, id: i })
}
},
typeToValue(item) {
switch (item.contentType) {
case 1:
this.shop.stallId = Number(item.linkValue)
break
case 2:
this.classifyId = Number(item.linkValue)
break
case 3:
this.shop.filterType = Number(item.linkValue)
break
case 4:
this.shop.showType = Number(item.linkValue)
break
case 5:
this.column = Number(item.linkValue)
break
case 6:
this.row = Number(item.linkValue)
break
case 7:
this.page = Number(item.linkValue)
break
case 8:
this.brand.filterType = Number(item.linkValue)
break
case 9:
this.brand.showType = Number(item.linkValue)
break
case 10:
this.service.contentType = Number(item.linkValue)
break
case 11:
this.service.filterType = Number(item.linkValue)
break
case 12:
this.service.showType = Number(item.linkValue)
break
case 13:
this.activity.activityId = Number(item.linkValue)
break
case 14:
this.activity.contentType = Number(item.linkValue)
break
case 15:
this.activity.filterType = Number(item.linkValue)
break
case 16:
this.activity.showType = Number(item.linkValue)
break
case 17:
this.article.classifyId = Number(item.linkValue)
break
case 18:
this.article.filterType = Number(item.linkValue)
break
case 19:
this.article.showType = Number(item.linkValue)
break
case 20:
this.marketing.classifyType = Number(item.linkValue)
break
case 21:
this.marketing.filterType = Number(item.linkValue)
break
case 22:
this.marketing.showType = Number(item.linkValue)
break
case 23:
this.goods.filterType = Number(item.linkValue)
break
case 24:
this.goods.showType = Number(item.linkValue)
break
case 25:
this.video.filterType = Number(item.linkValue)
break
case 26:
this.video.showType = Number(item.linkValue)
break
case 27:
this.banner.name = item.linkValue
break
case 28:
this.banner.imgUrl = item.linkValue
break
case 29:
this.banner.img = item.linkValue
break
case 30:
this.service.filterType = Number(item.linkValue)
break
case 31:
this.activity.filterType = Number(item.linkValue)
break
case 32:
this.activity.showType = Number(item.linkValue)
break
case 33:
this.coupon.filterType = Number(item.linkValue)
break
case 34:
this.coupon.showType = Number(item.linkValue)
break
}
},
getClassify() {
// 获取一级类目数据
if (this.classifyList && this.classifyList.length > 0) {
return
}
fetchClassifyList({ parentId: 0 }).then(res => {
this.classifyList = res.data
})
},
getStallList() {
stallList({ pageNum: 1, pageSize: 100, sortType: 1 }).then(res => {
this.stallList = res.data.list
})
},
getActivityList() {
activityList({}).then(res => {
this.activityList = res.data
})
},
getArticleClassifyList() {
articleFirstClassifyList({}).then(res => {
this.articleClassifyList = res.data
})
},
changeType(value) {
switch (value) {
case 1:
case 3:
case 4:
case 9:
this.getClassify()
break
case 2:
this.getClassify()
this.getStallList()
break
case 5:
this.getActivityList()
break
case 7:
this.getArticleClassifyList()
break
}
},
save() {
// 类容类型
// 1:档口市场
// 2:主营类目
// 3:商家->筛选类型(1商品销量 2商品数量 3加入时间 4上新数量(一周) 5收藏数量 6分销商数量 7店铺评分)
// 4:商家->单个商家展示的样式(1商家概要 2商家及商品)
// 5:展示多少列
// 6:展示多少行
// 7:展示换页数
// 8:品牌->筛选类型(1商品销量 2商品数量 3上新数量一周)
// 9:品牌->单个品牌展示样式(1品牌log 2品牌缩略图)
// 10:服务->展示内容(1服务 2服务商)
// 11:服务->筛选类型(1浏览数量 2上新时间)
// 12:服务->单个服务展示样式(1竖长形 2横宽型)
// 13:活动->展示活动
// 14:活动->展示内容(1商家 2商品)
// 15:活动->筛选类型(1商品销量 2商品数量 3加入时间 4上新数量(一周) 5收藏数量 6分销商数量 7店铺评分)
// 16:活动->单个商家展示的样式(1商家概要 2商家及商品)
// 17:文章->文章类别
// 18:文章->筛选类型(1发布时间 2浏览数量 3点赞数量)
// 19:文章->单篇展示样式(1文章图文缩略(左右) 2文章图文缩略(上下))
// 20:营销->营销类别(1满减 2拼货 3秒杀)
// 21:营销->筛选类型(1销售数量 2参与时间 3库存数量)
// 22:营销->单个商品展示样式(1竖长形 2横宽型)
// 23:商品->筛选类型(1上新数量 2销售数量 3浏览数量 4评价数量 5评分分数)
// 24:商品->单个商品展示样式(1竖长形 2横宽型)
// 25:视频->筛选类型(1上新数量 2销售数量 3浏览数量 4评价数量 5评分分数 6视频播放量)
// 26:视频->单个视频展示样式(1视频播发 2商品视频缩略-横 3商品视频缩略-竖)
// 27:广告->图片名称
// 28:广告->图片链接
// 29:广告->图片
// 30:服务->服务商类型:筛选类型(1服务数量 2加入时间)
// 31:活动->商品:筛选类型(1上新时间 2销售数量 3浏览数量 4评价数量 5评价分数)
// 32:活动->商品:单个商品展示的样式(1竖长形 2横宽型)
// 33:优惠券->筛选类型(1平台券 2商家券)
// 34:优惠券->单个优惠券展示样式(1大 2小)
let pmsStoreyTypeContents = []
this.value.storeyTypeId = this.storeyTypeId
switch (this.value.storeyTypeId) {
case 1:
let goods = this.goods
pmsStoreyTypeContents.push({
contentType: 2,
linkValue: this.classifyId,
storeyTypeId: this.value.storeyTypeId
})
pmsStoreyTypeContents.push({
contentType: 23,
linkValue: goods.filterType,
storeyTypeId: this.value.storeyTypeId
})
pmsStoreyTypeContents.push({
contentType: 24,
linkValue: goods.showType,
storeyTypeId: this.value.storeyTypeId
})
break
case 2:
let shop = this.shop
pmsStoreyTypeContents.push({
contentType: 1,
linkValue: shop.stallId,
storeyTypeId: this.value.storeyTypeId
})
pmsStoreyTypeContents.push({
contentType: 2,
linkValue: this.classifyId,
storeyTypeId: this.value.storeyTypeId
})
pmsStoreyTypeContents.push({
contentType: 3,
linkValue: shop.filterType,
storeyTypeId: this.value.storeyTypeId
})
pmsStoreyTypeContents.push({
contentType: 4,
linkValue: shop.showType,
storeyTypeId: this.value.storeyTypeId
})
break
case 3:
let brand = this.brand
pmsStoreyTypeContents.push({
contentType: 2,
linkValue: this.classifyId,
storeyTypeId: this.value.storeyTypeId
})
pmsStoreyTypeContents.push({
contentType: 8,
linkValue: brand.filterType,
storeyTypeId: this.value.storeyTypeId
})
pmsStoreyTypeContents.push({
contentType: 9,
linkValue: brand.showType,
storeyTypeId: this.value.storeyTypeId
})
break
case 4:
let service = this.service
pmsStoreyTypeContents.push({
contentType: 10,
linkValue: service.classifyType,
storeyTypeId: this.value.storeyTypeId
})
pmsStoreyTypeContents.push({
contentType: service.contentType == 1 ? 11 : 30,
linkValue: service.filterType,
storeyTypeId: this.value.storeyTypeId
})
pmsStoreyTypeContents.push({
contentType: 12,
linkValue: service.showType,
storeyTypeId: this.value.storeyTypeId
})
break
case 5:
let activity = this.activity
pmsStoreyTypeContents.push({
contentType: 13,
linkValue: activity.activityId,
storeyTypeId: this.value.storeyTypeId
})
pmsStoreyTypeContents.push({
contentType: 14,
linkValue: activity.contentType,
storeyTypeId: this.value.storeyTypeId
})
pmsStoreyTypeContents.push({
contentType: activity.contentType == 1 ? 15 : 31,
linkValue: activity.filterType,
storeyTypeId: this.value.storeyTypeId
})
pmsStoreyTypeContents.push({
contentType: activity.contentType == 1 ? 16 : 32,
linkValue: activity.showType,
storeyTypeId: this.value.storeyTypeId
})
break
case 6:
let banner = this.banner
pmsStoreyTypeContents.push({
contentType: 27,
linkValue: banner.name,
storeyTypeId: this.value.storeyTypeId
})
pmsStoreyTypeContents.push({
contentType: 28,
linkValue: banner.imgUrl,
storeyTypeId: this.value.storeyTypeId
})
pmsStoreyTypeContents.push({
contentType: 29,
linkValue: banner.img,
storeyTypeId: this.value.storeyTypeId
})
break
case 7:
let article = this.article
pmsStoreyTypeContents.push({
contentType: 17,
linkValue: article.classifyId,
storeyTypeId: this.value.storeyTypeId
})
pmsStoreyTypeContents.push({
contentType: 18,
linkValue: article.filterType,
storeyTypeId: this.value.storeyTypeId
})
pmsStoreyTypeContents.push({
contentType: 19,
linkValue: article.showType,
storeyTypeId: this.value.storeyTypeId
})
break
case 8:
let marketing = this.marketing
pmsStoreyTypeContents.push({
contentType: 20,
linkValue: marketing.classifyType,
storeyTypeId: this.value.storeyTypeId
})
pmsStoreyTypeContents.push({
contentType: 21,
linkValue: marketing.filterType,
storeyTypeId: this.value.storeyTypeId
})
pmsStoreyTypeContents.push({
contentType: 22,
linkValue: marketing.showType,
storeyTypeId: this.value.storeyTypeId
})
break
case 9:
let video = this.video
pmsStoreyTypeContents.push({
contentType: 25,
linkValue: video.filterType,
storeyTypeId: this.value.storeyTypeId
})
pmsStoreyTypeContents.push({
contentType: 26,
linkValue: video.showType,
storeyTypeId: this.value.storeyTypeId
})
break
case 10:
let coupon = this.coupon
pmsStoreyTypeContents.push({
contentType: 2,
linkValue: this.classifyId,
storeyTypeId: this.value.storeyTypeId
})
pmsStoreyTypeContents.push({
contentType: 33,
linkValue: coupon.filterType,
storeyTypeId: this.value.storeyTypeId
})
pmsStoreyTypeContents.push({
contentType: 34,
linkValue: coupon.showType,
storeyTypeId: this.value.storeyTypeId
})
break
}
// 公告参数
if (this.value.storeyTypeId != 6) {
pmsStoreyTypeContents.push({
contentType: 5,
linkValue: this.column,
storeyTypeId: this.value.storeyTypeId
})
pmsStoreyTypeContents.push({
contentType: 6,
linkValue: this.row,
storeyTypeId: this.value.storeyTypeId
})
pmsStoreyTypeContents.push({
contentType: 7,
linkValue: this.page,
storeyTypeId: this.value.storeyTypeId
})
}
this.value.pmsStoreyTypeContents = pmsStoreyTypeContents
this.$message.success('保存成功')
}
}
}
</script>
<style scoped>
.floor {
padding: 20px 0;
text-align: center;
}
.title {
padding: 10px 0;
font-size: 15px;
color: #666666;
}
.floor .el-image {
margin-bottom: 10px;
width: 150px;
height: 150px;
}
.floor .el-input,
.floor .el-textarea,
.floor .el-select,
.floor .el-date-editor,
.floor .el-cascader {
width: 150px;
}
.floor .el-button {
margin-top: 20px;
}
</style>
\ No newline at end of file
<template>
<el-card>
<!-- 楼层信息 -->
<el-form :model="model"
class="section"
size="small"
ref="floorForm"
label-width="200px">
<!-- 内容布局 -->
<el-form-item label="楼层名称:"
prop="pmsStoreyManage.name"
:rules="[{ required: true, trigger: 'blur', message: '楼层名称不能为空' }]">
<el-input placeholder="四字以内,将作为标题和导航"
maxlength="4"
v-model="model.pmsStoreyManage.name"></el-input>
</el-form-item>
<el-form-item label="楼层标题是否显示:"
prop="pmsStoreyManage.isShowTitle">
<el-radio-group v-model="model.pmsStoreyManage.isShowTitle">
<el-radio :label="1"></el-radio>
<el-radio :label="0"></el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="楼层描述:"
prop="pmsStoreyManage.storeyDescribe"
:rules="[{ required: true, trigger: 'blur', message: '楼层描述不能为空' }]">
<el-input placeholder="描述楼层所展示的内容"
v-model="model.pmsStoreyManage.storeyDescribe"></el-input>
</el-form-item>
<el-form-item label="楼层是否展示:"
prop="pmsStoreyManage.isShowStorey">
<el-radio-group v-model="model.pmsStoreyManage.isShowStorey">
<el-radio :label="1"></el-radio>
<el-radio :label="0"></el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="楼层主体内容类别:"
prop="pmsStoreyManage.storeyTypeId"
:rules="[{ required: true, trigger: 'change', message: '楼层主体内容类别不能为空' }]">
<el-select v-model="model.pmsStoreyManage.storeyTypeId"
placeholder="请选择类型">
<el-option v-for="item in typeList"
:key="item.id"
:label="item.name"
:value="item.id"></el-option>
</el-select>
</el-form-item>
<el-form-item label="楼层样式:"
prop="pmsStoreyManage.storeyStyle"
:rules="[{ required: true, trigger: 'change', message: '楼层样式不能为空' }]">
<el-select v-model="model.pmsStoreyManage.storeyStyle"
placeholder="请选择类型"
@change="changeStyle">
<el-option v-for="item in styleOptions"
:key="item.id"
:label="item.name"
:value="item.id"></el-option>
</el-select>
</el-form-item>
<el-form-item label="楼层是否增加横幅:"
prop="pmsStoreyManage.isShowBanner">
<el-radio-group v-model="model.pmsStoreyManage.isShowBanner">
<el-radio :label="1"></el-radio>
<el-radio :label="0"></el-radio>
</el-radio-group>
</el-form-item>
<el-form-item v-if="model.pmsStoreyManage.isShowBanner == 1"
label="横幅图片:"
prop="pmsStoreyManage.bannerPic"
:rules="[{ required: true, trigger: 'blur', message: '横幅图片不能为空' }]">
<single-upload v-model="model.pmsStoreyManage.bannerPic"></single-upload>
</el-form-item>
<el-form-item label="楼层排序:"
prop="pmsStoreyManage.sort"
:rules="[{ required: true, trigger: 'blur', message: '广告排序不能为空' }]">
<el-input placeholder="三位数,数目大的排在后面(下方)"
v-model="model.pmsStoreyManage.sort"></el-input>
</el-form-item>
</el-form>
<!-- 内容数据 -->
<div v-if="model.pmsStoreyManage.storeyStyle">
<el-row type="flex"
class="floor-row"
justify="space-between">
<el-col v-for="(item,index) in model.pmsStoreySequences"
:class="index % 2 == 0 ? 'dark' : ''"
:span="item.span"
:key="index">
<floor-column v-model="item.value"></floor-column>
</el-col>
</el-row>
<div class="operation">
<!-- <el-button type="success"
@click="preview">楼层预览</el-button> -->
<el-button type="primary"
:loading="loading"
@click="submit">保存设定</el-button>
</div>
</div>
</el-card>
</template>
<script>
import { getFloor, addFloor, updateFloor, floorType } from '@/api/floor'
import singleUpload from '@/components/Upload/singleUpload'
import floorColumn from './components/floorColumn'
const defaultModel = {
pmsStoreyManage: {
name: null,
isShowTitle: 1,
storeyDescribe: null,
isShowStorey: 1,
storeyTypeId: null,
storeyStyle: null,
isShowBanner: 0,
bannerPic: null,
sort: null
},
pmsStoreySequences: []
}
export default {
name: 'floor',
components: {
singleUpload,
floorColumn
},
data() {
return {
loading: false,
model: Object.assign({}, defaultModel),
typeList: [],
styleOptions: [{
name: '一列',
id: 1
}, {
name: '二列(左窄又宽)',
id: 2
}, {
name: '二列(左宽右窄)',
id: 3
}, {
name: '二列(左右均等)',
id: 4
}, {
name: '三列(左中右均等)',
id: 5
}, {
name: '三列(左右窄中间宽)',
id: 6
}, {
name: '四列',
id: 7
}]
}
},
created() {
if (this.$route.query.id) {
this.detail(this.$route.query.id)
} else {
this.add()
}
this.getTypeList()
},
methods: {
getTypeList() {
floorType().then(res => {
this.typeList = res.data
})
},
add() {
this.model = Object.assign({}, defaultModel)
},
detail(id) {
this.loading = true
getFloor({ id }).then(res => {
this.loading = false
this.model = res.data
this.changeStyle(this.model.pmsStoreyManage.storeyStyle)
this.model.storeySequenceVos.forEach((item, index) => {
this.model.pmsStoreySequences.forEach((citem, cindex) => {
if (index == cindex) {
citem.value.storeyTypeId = item.pmsStoreySequence.storeyTypeId
citem.value.pmsStoreyTypeContents = item.pmsStoreyTypeContents
}
})
})
}).catch(err => {
this.loading = false
})
},
changeStyle(value) {
// 更换楼层样式
let floorStyle = []
switch (value) {
case 1:
floorStyle.push({
span: 24,
value: { storeyTypeId: null }
})
break
case 2:
floorStyle.push({
span: 6,
value: {}
})
floorStyle.push({
span: 18,
value: {}
})
break
case 3:
floorStyle.push({
span: 18,
value: {}
})
floorStyle.push({
span: 6,
value: {}
})
break
case 4:
floorStyle.push({
span: 12,
value: {}
})
floorStyle.push({
span: 12,
value: {}
})
break
case 5:
for (let i = 0; i < 3; i++) {
floorStyle.push({
span: 8,
value: {}
})
}
break
case 6:
floorStyle.push({
span: 6,
value: {}
})
floorStyle.push({
span: 12,
value: {}
})
floorStyle.push({
span: 6,
value: {}
})
break
case 7:
for (let i = 0; i < 4; i++) {
floorStyle.push({
span: 6,
value: {}
})
}
break
}
this.model.pmsStoreySequences = floorStyle
},
// 预览楼层
preview() {
},
// 保存设定
submit() {
this.$refs.floorForm.validate((valid) => {
if (valid) {
let pmsStoreyManage = this.model.pmsStoreyManage
this.typeList.forEach(item => {
if (item.id == pmsStoreyManage.storeyTypeId) {
pmsStoreyManage.storeyTypeName = item.name
}
})
let params = {
pmsStoreyManage: this.model.pmsStoreyManage,
storeySequenceVos: []
}
let isSuccess = true
this.model.pmsStoreySequences.forEach((item, index) => {
if (!item.value.pmsStoreyTypeContents || item.value.pmsStoreyTypeContents.length == 0) {
isSuccess = false
}
params.storeySequenceVos.push({
pmsStoreySequence: {
sort: index,
storeyTypeId: item.value.storeyTypeId
},
pmsStoreyTypeContents: item.value.pmsStoreyTypeContents
})
})
if (!isSuccess) {
this.$message.error('请先保存楼层样式内容')
return
}
this.loading = true
if (this.model.pmsStoreyManage.id) {
// 修改楼层
updateFloor(params).then(res => {
this.loading = false
this.$router.back()
}).catch(err => {
this.loading = false
})
} else {
// 添加楼层
addFloor(params).then(res => {
this.loading = false
this.$router.back()
}).catch(err => {
this.loading = false
})
}
}
})
}
}
}
</script>
<style scoped>
.section {
margin: 0 auto;
width: 720px;
}
.section .el-input,
.section .el-textarea,
.section .el-select,
.section .el-date-editor,
.section .el-cascader {
width: 400px;
}
.floor-row {
margin: 30px auto;
width: 800px;
border: 1px solid #dcdcdc;
}
.floor-row .dark {
background-color: whitesmoke;
}
.operation {
text-align: center;
}
</style>
\ No newline at end of file
<template> 
<el-card>
<!-- 操作栏 -->
<el-card class="operate-container"
shadow="never">
<div class="row-item">
<el-button size="small"
type="primary"
@click="handleAdd">添加楼层</el-button>
</div>
</el-card>
<!-- 表格栏 -->
<el-table :data="list"
ref="table"
row-key="id"
v-loading="listLoading"
border>
<el-table-column label="排序"
align="center"
width="60"
prop="sort">
</el-table-column>
<el-table-column label="楼层(标题)名称"
align="center"
prop="name">
</el-table-column>
<el-table-column label="主要内容类别"
align="center"
prop="storeyTypeName">
</el-table-column>
<el-table-column label="楼层描述"
align="center"
prop="storeyDescribe">
</el-table-column>
<el-table-column label="是否展示"
align="center">
<template slot-scope="scope">{{scope.row.isShowStorey | formatShow}}</template>
</el-table-column>
<el-table-column label="操作"
width="180"
align="center">
<template slot-scope="scope">
<!-- <el-button size="mini"
type="success"
@click="lookDetail(scope.row)">预览</el-button> -->
<el-button size="mini"
type="primary"
@click="handleUpdate(scope.row)">编辑</el-button>
<el-button size="mini"
type="danger"
@click="handleDelete(scope.row)">删除</el-button>
</template>
</el-table-column>
</el-table>
<!-- 分页栏 -->
<div class="pagination-container">
<el-pagination background
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
layout="total, sizes, prev, pager, next, jumper"
:current-page.sync="listQuery.pageNum"
:page-size="listQuery.pageSize"
:page-sizes="[10,30,50]"
:total="total">
</el-pagination>
</div>
</el-card>
</template>
<script>
import { fetchFloorList, deleteFloor } from '@/api/floor'
// 广告位置管理
export default {
name: 'floorManagement',
components: {},
data() {
return {
listQuery: {
pageSize: 10,
pageNum: 1
},
total: 0,
list: [],
listLoading: false
}
},
mounted() {
this.getList()
},
filters: {
formatShow(value) {
if (value == 1) {
return '是'
} else {
return '否'
}
}
},
methods: {
// 表格页数改变
handleSizeChange(val) {
this.listQuery.pageNum = 1
this.listQuery.pageSize = val
this.getList()
},
// 表格页码改变
handleCurrentChange(val) {
this.listQuery.pageNum = val
this.getList()
},
// 添加
handleAdd() {
this.$router.push('floor')
},
// 查看
lookDetail(row) {
},
// 编辑
handleUpdate(row) {
this.$router.push({ name: 'floor', query: { id: row.id } })
},
// 删除
handleDelete(row) {
this.$confirm('删除该条数据前请确保相关联的数据已经解除关联', '您确定要删除所选楼层吗?', {
confirmButtonText: '确定',
cancelButtonText: '取消',
center: true
}).then(() => {
// 请求删除
this.listLoading = true
deleteFloor({ id: row.id }).then(res => {
this.listLoading = false
this.getList()
}).catch(err => {
this.listLoading = false
})
})
},
//请求数据
getList() {
this.listLoading = true
fetchFloorList(this.listQuery).then(res => {
this.listLoading = false
this.list = res.data.list
this.total = res.data.total
}).catch(err => {
this.listLoading = false
})
}
}
}
</script>
<style scoped>
.operate-container {
text-align: right;
margin-top: 0;
margin-bottom: 20px;
}
</style>
\ No newline at end of file
<template>
<el-form :model="model"
v-loading="loading"
:rules="rules"
size="small"
ref="templateForm"
label-width="120px"
class="container">
<el-form-item label="所属供应商:"
prop="mchtId">
<el-select v-model="model.mchtId"
class="input-width"
placeholder="请选择所属供应商">
<el-option v-for="item in supplierOptions"
:key="item.id"
:label="item.enterpriseName || item.account"
:value="item.memberId">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="模板类型:"
prop="templateType">
<el-select v-model="model.templateType"
placeholder="请选择类型"
clearable
size="small"
class="input-width">
<el-option label="自定义"
:value="1"></el-option>
<el-option label="运费模板"
:value="2"></el-option>
</el-select>
</el-form-item>
<el-form-item label="模板名称:"
prop="name">
<el-input v-model="model.name"
placeholder="请输入模版名称"></el-input>
</el-form-item>
<el-form-item label="运费标题:"
prop="feightTitle">
<el-input v-model="model.feightTitle"
placeholder="请输入运费标题"></el-input>
</el-form-item>
<el-form-item label="计算方式:"
prop="calculation">
<el-radio-group v-model="model.calculation">
<el-radio :label="0">不计重量和件数</el-radio>
<el-radio :label="1">按商品件数</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="免费额度:"
prop="freeLimit">
<el-input v-model.number="model.freeLimit"
placeholder="请输入免费额度"></el-input>
</el-form-item>
<el-form-item label="配送地区:">
<el-table :data="data"
border>
<el-table-column label="运送到"
align="center"
prop="cityNames">
</el-table-column>
<el-table-column label="运费(元)"
align="center">
<template slot-scope="scope">
<el-input v-model="scope.row.amount"
clearable></el-input>
</template>
</el-table-column>
<el-table-column label="操作"
width="180"
align="center">
<template slot-scope="scope">
<el-button type="warning"
size="mini"
@click="handleUpdateArea(scope.row)">编辑
</el-button>
<el-button type="danger"
size="mini"
@click="handleDeleteArea(scope.$index)">删除
</el-button>
</template>
</el-table-column>
</el-table>
<el-button type="primary"
size="medium"
style="margin-top:15px"
@click="handleAdd">添加地区</el-button>
</el-form-item>
<el-form-item label="快递方式:">
<el-table :data="list"
border>
<el-table-column label="快递名称"
align="center"
prop="expressNames">
</el-table-column>
<el-table-column label="额外运费(元)"
align="center">
<template slot-scope="scope">
<el-input v-model="scope.row.amount"
clearable></el-input>
</template>
</el-table-column>
<el-table-column label="操作"
width="180"
align="center">
<template slot-scope="scope">
<el-button type="warning"
size="mini"
@click="handleUpdateExpress(scope.row)">编辑
</el-button>
<el-button type="danger"
size="mini"
@click="handleDeleteExpress(scope.$index)">删除
</el-button>
</template>
</el-table-column>
</el-table>
<el-button type="primary"
size="medium"
style="margin-top:15px"
@click="expressAdd">添加快递</el-button>
</el-form-item>
<el-form-item label-width="350px"
style="margin-top: 30px;">
<el-button type="primary"
size="medium"
@click="submitForm('templateForm')">{{model.id ? '修改' : '创建'}}</el-button>
<el-button type="info"
size="medium"
@click="goback">取消</el-button>
</el-form-item>
<!-- 弹窗 -->
<RegionModal ref="detailModal"
@ok="getArea"></RegionModal>
<ExpressModal ref="expressModal"
@ok="getExpress"></ExpressModal>
</el-form>
</template>
<script>
import RegionModal from './modules/RegionModal'
import ExpressModal from './modules/ExpressModal'
import { getSupplierList } from '@/api/audit'
import { addTheTemplate, updateTheTemplate, getFreight } from '@/api/freightManage'
export default {
name: 'addTemplate',
components: {
RegionModal,
ExpressModal
},
data() {
return {
data: [],
list: [],
loading: false,
supplierOptions: [],
model: {
id: null,
templateType: 1,
name: '',
manageList: [],
feightTitle: '',
calculation: 0,
freeLimit: '',
mchtId: ''
},
rules: {
mchtId: [
{ required: true, message: '请选择所属供应商', trigger: 'change' }
],
name: [
{ required: true, message: '请输入模板名称', trigger: 'blur' }
],
feightTitle: [
{ required: true, message: '请输入运费标题', trigger: 'blur' }
],
calculation: [
{ required: true, message: '请选择计算方式', trigger: 'change' }
]
}
}
},
created() {
if (this.$route.query.id) {
this.model.id = this.$route.query.id
this.getDetail()
}
this.supplierList()
},
methods: {
supplierList() {
getSupplierList({
pageSize: 1000,
pageNum: 1,
audit: 2,
accountState: 1
}).then(res => {
this.supplierOptions = res.data.list
})
},
getDetail() {
this.loading = true
getFreight(this.model.id).then(res => {
this.loading = false
this.model = res.data
this.data = this.model.manageList.filter(item => item.type == 1)
this.list = this.model.manageList.filter(item => item.type == 2)
}).catch(err => {
this.loading = false
})
},
// 获取弹窗地区信息
getArea(areaList, row) {
let obj = {
type: 1,
provinceIds: null,
cityIds: null,
cityNames: null,
amount: 0
}
let name = ''
let provinceIdList = []
let cityIdList = []
areaList.forEach((item) => {
provinceIdList.push(item.id)
name += item.areaName
if (item.checkCities && item.checkCities.length > 0) {
name += ':'
let cityNameList = []
item.checkCities.forEach((citem) => {
item.cities.forEach((city) => {
if (citem == city.id) {
cityIdList.push(city.id)
cityNameList.push(city.areaName)
}
})
})
name += cityNameList.join(',')
} else {
item.cities.forEach(item => {
cityIdList.push(item.id)
})
}
name += ';'
})
obj.provinceIds = provinceIdList.join(',')
obj.cityIds = cityIdList.join(',')
obj.cityNames = name
if (row) {
row.provinceIds = obj.provinceIds
row.cityIds = obj.cityIds
row.cityNames = obj.cityNames
} else {
this.data.push(obj)
}
},
// 获取弹窗快递信息
getExpress(expressList, row) {
//定义一个对象
let obj = {
type: 2,
expressIds: null,
expressNames: null,
amount: 0
}
let nameList = []
let idList = []
expressList.forEach((item) => {
nameList.push(item.expressName)
idList.push(item.id)
})
obj.expressIds = idList.join(',')
obj.expressNames = nameList.join(',')
if (row) {
row.expressIds = obj.expressIds
row.expressNames = obj.expressNames
} else {
this.list.push(obj)
}
},
// 添加地区
handleAdd() {
this.$refs.detailModal.add()
},
// 添加快递
expressAdd() {
if (!this.model.mchtId) {
this.$message.info('请先选择所属供应商')
return
}
this.$refs.expressModal.add(this.model.mchtId)
},
// 编辑地区
handleUpdateArea(row) {
this.$refs.detailModal.detail(row)
},
// 删除地区
handleDeleteArea(index) {
this.$confirm('删除该数据前请确保不需要该条数据', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
center: true
}).then(() => {
this.data.splice(index, 1)
})
},
// 编辑快递
handleUpdateExpress(row) {
this.$refs.expressModal.detail(row, this.model.mchtId)
},
// 删除快递
handleDeleteExpress(index) {
this.$confirm('删除该数据前请确保不需要该条数据', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
center: true
}).then(() => {
this.list.splice(index, 1)
})
},
submitForm(formName) {
this.$refs[formName].validate((valid) => {
if (valid) {
this.loading = true
let manageList = []
// 处理地区数据
manageList = manageList.concat(this.data)
// 处理快递数据
manageList = manageList.concat(this.list)
this.model.manageList = manageList
// 判断更新或添加
if (this.model.id) {
// 更新模板
updateTheTemplate(this.model.id, this.model).then(res => {
this.loading = false
this.goback()
}).catch(err => {
this.loading = false
})
} else {
// 创建模板
addTheTemplate(this.model).then(res => {
this.loading = false
this.goback()
}).catch(err => {
this.loading = false
})
}
}
})
},
goback() {
this.$router.back()
}
}
}
</script>
<style lang="scss" scoped>
.container {
width: 800px;
margin: 50px auto;
}
.input-width {
width: 320px;
}
</style>
<template>
<div class="app-container">
<!-- 操作栏 -->
<el-card class="operate-container"
shadow="never">
<!-- 添加新模板 -->
<el-button style="float: right; margin-bottom:15px"
class="search-button"
type="primary"
size="small"
@click="addTemplate">添加新模板</el-button>
<!-- 表格 -->
<div class="table-container">
<el-table :data="list"
v-loading="listLoading"
border>
<el-table-column label="编号"
align="center">
<template slot-scope="scope">{{scope.row.id}}</template>
</el-table-column>
<el-table-column label="商家名称"
align="center"
prop="mchtName">
</el-table-column>
<el-table-column label="模板名称"
align="center"
prop="name">
</el-table-column>
<el-table-column label="运费标题"
align="center"
prop="feightTitle">
</el-table-column>
<el-table-column label="模板类型"
align="center">
<template slot-scope="scope">{{scope.row.templateType | formatStatus}}</template>
</el-table-column>
<el-table-column label="更新时间"
align="center">
<template slot-scope="scope">{{scope.row.createDate | formatDate}}</template>
</el-table-column>
<el-table-column label="操作"
width="180"
align="center">
<template slot-scope="scope">
<el-button type="warning"
size="mini"
@click="handleEdit(scope.row)">编辑
</el-button>
<el-button type="danger"
size="mini"
@click="handleDelete(scope.row)">删除
</el-button>
</template>
</el-table-column>
</el-table>
</div>
</el-card>
</div>
</template>
<script>
import { formatDate } from '@/utils/date'
import { freightList, deleteTheTemplate } from '@/api/freightManage'
// 运费管理
export default {
name: "freightManage",
components: {},
data() {
return {
listQuery: {},
list: [],
listLoading: true
}
},
created() {
this.getList()
},
filters: {
formatDate(time) {
if (time == null || time === '') {
return '--'
}
let date = new Date(time)
return formatDate(date, 'yyyy-MM-dd hh:mm:ss')
},
formatStatus(value) {
if (value === 1) {
return '自定义'
} else {
return '运费模板'
}
}
},
methods: {
// 删除模板
handleDelete(row) {
this.$confirm('是否要删除该模板', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
center: true
}).then(() => {
deleteTheTemplate(row.id).then(res => {
this.$message({
message: '删除成功',
type: 'success',
duration: 1000
})
this.getList()
})
})
},
// 添加新模板
addTemplate() {
this.$router.push({ path: 'addTemplate' })
},
// 编辑新模板
handleEdit(row) {
this.$router.push({ path: 'addTemplate', query: { id: row.id } })
},
// 获取运费管理列表
getList() {
this.listLoading = true
freightList(this.listQuery).then(res => {
this.listLoading = false
this.list = res.data
}).catch(err => {
this.listLoading = false
})
}
}
}
</script>
<style lang="scss" scoped>
.operate-container {
font-size: 14px;
color: #606266;
padding: 0 15px;
margin-top: 0;
}
.mt15 {
margin-top: 15px;
}
.batch-operate-container {
width: 100%;
padding: 0 10px;
}
</style>
\ No newline at end of file
<template>
<el-dialog :visible.sync="visible"
:title="title"
center
width="600px">
<el-form :model="model"
ref="expressForm"
v-loading="loading"
label-width="180px">
<div class="scroll-container"
ref="scrollContainer">
<el-radio-group v-model="expressId">
<el-radio v-for="item in expresses"
style="margin:10px"
:label="item.id"
:key="item.id">{{item.expressName}}</el-radio>
</el-radio-group>
</div>
</el-form>
<div slot="footer">
<el-button type="primary"
size="small"
@click="submit">确认</el-button>
<el-button size="small"
@click="close">取消</el-button>
</div>
</el-dialog>
</template>
<script>
import { fetchExpresses } from '@/api/expresses'
// 添加编辑快递
export default {
name: 'ExpressModal',
data() {
return {
expressId: null,
expresses: [],
visible: false,
title: null,
loading: false,
model: null,
mchtId: null
}
},
methods: {
// 添加
add(mchtId) {
// 添加数据处理
this.mchtId = mchtId
this.model = null
this.expressId = null
this.visible = true
this.title = '选择快递'
this.getExpresses()
},
// 编辑
detail(row, mchtId) {
this.model = row
this.mchtId = mchtId
let selectList = (row.expressIds ? row.expressIds.split(',') : []).map(item => {
return Number(item)
})
if (selectList && selectList.length > 0) {
this.expressId = selectList[0]
}
this.visible = true
this.title = '编辑快递'
this.getExpresses()
},
// 获取快递信息
getExpresses() {
fetchExpresses({ mchtId: this.mchtId }).then(res => {
let data = res.data
this.expresses = res.data
})
},
// 提交
submit() {
//选择快递传入快递名称
let expressList = []
this.expresses.forEach(item => {
if (item.id == this.expressId) {
expressList.push(item)
}
})
this.$emit('ok', expressList, this.model)
this.close()
},
// 关闭
close() {
this.$emit('close')
this.visible = false
}
}
}
</script>
<style scoped>
.scroll-container {
max-height: 50vh;
overflow: hidden;
overflow-y: auto;
}
</style>
\ No newline at end of file
<template>
<el-dialog :visible.sync="visible"
:title="title"
center
width="900px">
<el-form :model="model"
ref="regionForm"
style="padding:30px"
v-loading="loading"
label-width="180px">
<div class="scroll-container"
ref="scrollContainer">
<el-checkbox :indeterminate="isIndeterminate"
v-model="checkAll"
@change="handleCheckAllChange">全选</el-checkbox>
<div style="margin: 15px 0;"></div>
<!-- 获取省市地区 -->
<el-checkbox-group v-model="checkedProvince"
@change="handleCheckedChange">
<el-checkbox v-for="(item, index) in province"
style="width:190px;margin:5px 0"
@change="getCity(index)"
:label="item.id"
:key="item.id">{{item.areaName}}
<el-dropdown trigger="click">
<span class="el-dropdown-link"
@click="getCity(index)">
<i class="el-icon-arrow-down el-icon--right"></i>
</span>
<el-dropdown-menu class="prefectural"
style="width:600px;padding:20px"
slot="dropdown">
<el-checkbox-group v-model="item.checkCities">
<el-checkbox style="width:150px;margin:5px"
v-for="city in item.cities"
:label="city.id"
:key="city.id">{{city.areaName}} </el-checkbox>
</el-checkbox-group>
</el-dropdown-menu>
</el-dropdown>
</el-checkbox>
</el-checkbox-group>
</div>
</el-form>
<div slot="footer">
<el-button type="primary"
@click="submit">确认</el-button>
<el-button @click="close">取消</el-button>
</div>
</el-dialog>
</template>
<script>
import { fetchAreaList } from '@/api/area'
// 添加类型分类
export default {
name: 'RegionModal',
data() {
return {
checkAll: false,
checkedProvince: [],
province: [],
isIndeterminate: false,
visible: false,
title: null,
loading: false,
model: null
}
},
methods: {
// 全选改变
handleCheckAllChange(val) {
this.checkedProvince = []
this.isIndeterminate = false
if (val) {
this.loading = true
this.province.forEach((item, index) => {
this.checkedProvince.push(item.id)
this.getCity(index)
})
this.loading = false
}
},
// 选择改变
handleCheckedChange(value) {
let checkedCount = value.length
this.checkAll = checkedCount === this.province.length
this.isIndeterminate = checkedCount > 0 && checkedCount < this.province.length
},
// 添加
add() {
this.model = null
this.checkedProvince = []
this.isIndeterminate = false
this.getArea()
this.visible = true
this.title = '选择地区'
},
// 编辑
detail(row) {
this.model = row
this.checkedProvince = (row.provinceIds ? row.provinceIds.split(',') : []).map(item => {
return Number(item)
})
this.isIndeterminate = this.checkedProvince.length > 0
this.getArea()
this.visible = true
this.title = '编辑地区'
},
// 获取省级数据
getArea() {
this.loading = true
fetchAreaList({ parentId: 0 }).then(res => {
this.loading = false
let data = res.data
this.province = data.map(item => {
item.cities = []
item.checkCities = []
return item
})
}).catch(err => {
this.loading = false
})
},
// 获取市级数据
getCity(index) {
let item = this.province[index]
//判断item里是否有城市且至少一个
if (item.cities && item.cities.length > 0) {
return
}
fetchAreaList({ parentId: item.id }).then(res => {
let data = res.data
item.cities = data
})
},
// 确定提交
submit() {
// 选择地区-传入地区列表
let areaList = []
for (let index in this.province) {
let item = this.province[index]
for (let index in this.checkedProvince) {
let items = this.checkedProvince[index]
if (item.id == items) {
areaList.push(item)
}
}
}
this.$emit('ok', areaList, this.model)
this.close()
},
// 关闭
close() {
this.$emit('close')
this.visible = false
}
}
}
</script>
<style scoped>
</style>
\ No newline at end of file
<template>
<el-dialog :visible.sync="visible"
:title="title"
center
width="800px">
<!-- start -->
<!-- 内容布局 -->
<div class="scroll-container">
<!-- 运费模版信息 -->
<el-form :model="model"
class="section"
size="small"
ref="settingForm"
v-loading="loading"
label-width="200px">
<el-form-item label="商家名称:"
prop="shopName">
<el-input placeholder="请输入商家名称"
v-model="model.shopName"></el-input>
</el-form-item>
<el-form-item label="模版类型:"
prop="type">
<el-select v-model="model.type">
<el-option label="自定义"
:value="0"></el-option>
<el-option label="快递模版"
:value="1"></el-option>
</el-select>
</el-form-item>
<el-form-item label="模版名称:"
prop="name"
:rules="[{ required: true, trigger: 'blur', message: '模版名称不能为空' }]">
<el-input placeholder="请输入模版"
v-model="model.name"></el-input>
</el-form-item>
<el-form-item label="运费标题:"
prop="title">
<el-input placeholder="请输入运费标题"
v-model="model.title"></el-input>
</el-form-item>
<el-form-item label="计算方式:"
prop="method">
<el-radio-group v-model="model.method">
<el-radio :label="0">不计重量和件数</el-radio>
<el-radio :label="1">按商品件数</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="免费额度:"
prop="free">
<el-input placeholder="请输入免费额度"
v-model="model.free"></el-input>
</el-form-item>
<el-form-item label="配送地区:">
<!-- -->
</el-form-item>
<el-form-item label="快递方式:">
<!-- -->
</el-form-item>
</el-form>
</div>
<!-- 底部操作栏 -->
<div slot="footer">
<el-button type="primary"
size="medium"
@click="submit">确认</el-button>
</div>
<!-- end -->
</el-dialog>
</template>
<script>
export default {
name: 'FreightModal',
data() {
return {
visible: false,
title: null,
loading: false,
model: {}
}
},
methods: {
detail(id) {
this.id = id
this.model = {}
this.visible = true
this.title = '运费模版'
},
close() {
this.$emit('close')
this.visible = false
},
submit() {
// 创建
}
}
}
</script>
<style scoped>
.scroll-container {
max-height: 50vh;
overflow: hidden;
overflow-y: auto;
}
.section .el-input,
.section .el-textarea,
.section .el-select,
.section .el-cascader {
width: 400px;
}
.operation {
text-align: center;
}
</style>
\ No newline at end of file
<template> 
<el-card>
<!-- 表格栏 -->
<el-table :data="list"
ref="table"
row-key="id"
v-loading="listLoading"
border>
<el-table-column label="插件名称"
align="center">
<template slot-scope="scope">{{scope.row.name}}</template>
</el-table-column>
<el-table-column label="更新日期"
align="center">
<template slot-scope="scope">{{scope.row.updateTime}}</template>
</el-table-column>
<el-table-column label="启用"
align="center">
<template slot-scope="scope">
<el-switch v-model="scope.row.isOpen"
:active-value="1"></el-switch>
</template>
</el-table-column>
<el-table-column label="操作"
width="80"
align="center">
<template slot-scope="scope">
<el-button size="small"
type="text"
@click="handleUpdate(scope.row)">安装</el-button>
</template>
</el-table-column>
</el-table>
<!-- 弹窗 -->
<!-- end -->
</el-card>
</template>
<script>
// 配送方式列表
export default {
name: 'LoginSetting',
components: {
},
data() {
return {
list: [],
listLoading: false
}
},
mounted() {
this.getList()
},
methods: {
// 编辑
handleUpdate(row) {
},
//请求数据
getList() {
}
}
}
</script>
<style scoped>
</style>
\ No newline at end of file
<template>
<el-dialog :visible.sync="visible"
:title="title"
center
width="600px">
<!-- start -->
<!-- 内容布局 -->
<div class="scroll-container">
<!-- 邮箱信息 -->
<el-form :model="model"
class="section"
size="small"
ref="settingForm"
v-loading="loading"
label-width="120px">
<el-form-item label="消息类型:"
prop="name"
:rules="[{ required: true, trigger: 'blur', message: '消息类型不能为空' }]">
<el-input placeholder="请输入消息类型"
readonly
v-model="model.name"></el-input>
</el-form-item>
<el-form-item label="短信签名:"
prop="sign"
:rules="[{ required: true, trigger: 'blur', message: '短信签名不能为空' }]">
<el-input placeholder="请输入短信签名"
v-model="model.sign"></el-input>
</el-form-item>
<el-form-item label="短信模版名称:"
prop="title"
:rules="[{ required: true, trigger: 'blur', message: '短信模版名称不能为空' }]">
<el-input placeholder="请输入短信模版名称"
v-model="model.title"></el-input>
</el-form-item>
<el-form-item label="短信内容:"
prop="content"
:rules="[{ required: true, trigger: 'blur', message: '短信内容不能为空' }]">
<el-input placeholder="请输入短信内容"
type="textarea"
rows="5"
v-model="model.content"></el-input>
</el-form-item>
</el-form>
</div>
<!-- 底部操作栏 -->
<div slot="footer">
<el-button type="primary"
size="medium"
@click="submit">确认</el-button>
</div>
<!-- end -->
</el-dialog>
</template>
<script>
export default {
name: 'LoginConfigModal',
data() {
return {
visible: false,
title: null,
loading: false,
model: {}
}
},
methods: {
detail(id) {
this.id = id
this.model = {}
this.visible = true
this.title = '登录配置'
},
close() {
this.$emit('close')
this.visible = false
},
submit() {
// 创建
}
}
}
</script>
<style scoped>
.scroll-container {
max-height: 50vh;
overflow: hidden;
overflow-y: auto;
}
.section .el-input,
.section .el-textarea,
.section .el-select,
.section .el-cascader {
width: 360px;
}
.operation {
text-align: center;
}
</style>
\ No newline at end of file
<template>
<el-card>
<el-tabs v-model="active">
<el-tab-pane label="1.平台信息"
name="1">
<platform-info></platform-info>
</el-tab-pane>
<el-tab-pane label="2.基本设置"
name="2">
<basic-setting></basic-setting>
</el-tab-pane>
<el-tab-pane label="3.显示设置"
name="3">
<display-setting></display-setting>
</el-tab-pane>
<el-tab-pane label="4.购物流程"
name="4">
<shopping-flow></shopping-flow>
</el-tab-pane>
<el-tab-pane label="5.扩展信息"
name="5">
<extended-setting></extended-setting>
</el-tab-pane>
<el-tab-pane label="6.Logo设置"
name="6">
<logo-setting></logo-setting>
</el-tab-pane>
</el-tabs>
</el-card>
</template>
<script>
import platformInfo from './modules/platformInfo'
import basicSetting from './modules/basicSetting'
import displaySetting from './modules/displaySetting'
import shoppingFlow from './modules/shoppingFlow'
import extendedSetting from './modules/extendedSetting'
import logoSetting from './modules/logoSetting'
export default {
name: 'MallSetup',
components: {
platformInfo,
basicSetting,
displaySetting,
shoppingFlow,
extendedSetting,
logoSetting
},
data() {
return {
active: '1'
}
}
}
</script>
<style>
</style>
<template>
<el-card shadow="never">
<el-form :model="model"
v-loading="loading"
size="small"
ref="basicForm"
label-width="200px">
<el-form-item label="ICP证书或ICP备案证书号:"
:rules="[{required: true, trigger: 'blur', message: 'ICP证书或ICP备案证书号不能为空'}]"
prop="icp">
<el-input placeholder="ICP证书或ICP备案证书号"
v-model="model.icp"></el-input>
</el-form-item>
<el-form-item label="ICP备案证书文件:"
prop="icpImg">
<single-upload v-model="model.icpImg"></single-upload>
</el-form-item>
<el-form-item label="用户评论显示:"
prop="commentType">
<el-radio-group v-model="model.commentType">
<el-radio :label="1">审后展示</el-radio>
<el-radio :label="0">展示后审</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="页面统计代码:"
prop="staticsCode">
<el-input placeholder="页面统计代码"
type="textarea"
v-model="model.staticsCode"></el-input>
</el-form-item>
<el-form-item label="站点访问统计是否开启:"
prop="openStatics">
<el-radio-group v-model="model.openStatics">
<el-radio :label="0"></el-radio>
<el-radio :label="1"></el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="是否开启会员邮箱验证:"
prop="emailAuth">
<el-radio-group v-model="model.emailAuth">
<el-radio :label="0"></el-radio>
<el-radio :label="1"></el-radio>
</el-radio-group>
</el-form-item>
</el-form>
<div class="operation">
<el-button type="primary"
size="medium"
:loading="loading"
@click="submit">确认</el-button>
</div>
</el-card>
</template>
<script>
import SingleUpload from '@/components/Upload/singleUpload'
import { mallConfig, updateMallConfig } from '@/api/setting'
export default {
name: 'BasicSetting',
components: { SingleUpload },
data() {
return {
loading: false,
dictData: [],
model: {
icp: null,
icpImg: null,
commentType: null,
staticsCode: null,
openStatics: null,
emailAuth: null
}
}
},
created() {
mallConfig({ status: 1 }).then(res => {
this.dictData = res.data || []
this.dictData.forEach(item => {
this.dictToValue(item)
})
})
},
methods: {
dictToValue(item) {
switch (item.dictKey) {
case 'J_mallIcp':
this.model.icp = item.name
break
case 'J_mallIcpPicture':
this.model.icpImg = item.name
break
case 'J_userComment':
this.model.commentType = item.name
break
case 'J_statisticsCode':
this.model.staticsCode = item.name
break
case 'J_accessStatistics':
this.model.openStatics = Number(item.name)
break
case 'J_mailboxVerification':
this.model.emailAuth = Number(item.name)
break
}
},
valueToDict() {
this.dictData.forEach(item => {
switch (item.dictKey) {
case 'J_mallIcp':
item.name = this.model.icp
break
case 'J_mallIcpPicture':
item.name = this.model.icpImg
break
case 'J_userComment':
item.name = this.model.commentType
break
case 'J_statisticsCode':
item.name = this.model.staticsCode
break
case 'J_accessStatistics':
item.name = this.model.openStatics
break
case 'J_mailboxVerification':
item.name = this.model.emailAuth
break
}
})
},
submit() {
this.$refs['basicForm'].validate((valid) => {
if (valid) {
this.loading = true
this.valueToDict()
updateMallConfig(this.dictData).then(res => {
this.loading = false
this.$message.success('保存成功')
}).catch(err => {
this.loading = false
})
}
})
}
}
}
</script>
<style scoped>
.el-form {
max-width: 600px;
margin: 0 auto;
}
.tip {
font-size: 12px;
color: #999;
}
.operation {
text-align: center;
}
</style>
<template>
<el-card shadow="never">
<el-form :model="model"
v-loading="loading"
size="small"
ref="displayForm"
label-width="210px">
<el-form-item label="首页搜索显示的关键字:"
prop="searchKeys">
<el-input placeholder="关键字之间以空格分隔"
v-model="model.searchKeys"></el-input>
</el-form-item>
<el-form-item label="时间格式:"
prop="timeFormate">
<el-input placeholder="时间格式"
v-model="model.timeFormat"></el-input>
</el-form-item>
<el-form-item label="货币格式:"
prop="moneyFormat">
<el-input placeholder="货币格式"
v-model="model.moneyFormat"></el-input>
</el-form-item>
<el-form-item label="缩略图宽度(像素):"
prop="imgWidth">
<el-input placeholder="缩略图宽度(像素)"
v-model="model.imgWidth"></el-input>
</el-form-item>
<el-form-item label="缩略图高度(像素):"
prop="imgHeight">
<el-input placeholder="缩略图高度(像素)"
v-model.number="model.imgHeight"></el-input>
</el-form-item>
<el-form-item label="销量排行数量:"
prop="saleRankCount">
<el-input placeholder="销量排行数量"
v-model.number="model.saleRankCount"></el-input>
</el-form-item>
<el-form-item label="历史浏览数量:"
prop="historyCount">
<el-input placeholder="历史浏览数量"
v-model.number="model.historyCount"></el-input>
</el-form-item>
<el-form-item label="最新公告显示数量:"
prop="noticeCount">
<el-input placeholder="最新公告显示数量"
v-model.number="model.noticeCount"></el-input>
</el-form-item>
<el-form-item label="是否开启自动确认收货:"
prop="autoReceive">
<el-radio-group v-model="model.autoReceive">
<el-radio :label="0"></el-radio>
<el-radio :label="1"></el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="退换货上传图片凭证数量限制:"
prop="refundImgCount">
<el-input placeholder="退换货上传图片凭证数量限制"
v-model.number="model.refundImgCount"></el-input>
</el-form-item>
<el-form-item label="晒单缩略图高度(像素):"
prop="commentImgHeight">
<el-input placeholder="晒单缩略图高度(像素)"
v-model.number="model.commentImgHeight"></el-input>
</el-form-item>
<el-form-item label="晒单缩略图宽度(像素):"
prop="commentImgWidth">
<el-input placeholder="晒单缩略图宽度(像素)"
v-model.number="model.commentImgWidth"></el-input>
</el-form-item>
<el-form-item label="首页是否显示订单轮播:"
prop="orderBanner">
<el-radio-group v-model="model.orderBanner">
<el-radio :label="0"></el-radio>
<el-radio :label="1"></el-radio>
</el-radio-group>
</el-form-item>
</el-form>
<div class="operation">
<el-button type="primary"
size="medium"
:loading="loading"
@click="submit">确认</el-button>
</div>
</el-card>
</template>
<script>
import { mallConfig, updateMallConfig } from '@/api/setting'
export default {
name: 'DisplaySetting',
components: {},
data() {
return {
loading: false,
dictData: [],
model: {
searchKeys: null,
timeFormat: null,
moneyFormat: null,
imgWidth: null,
imgHeight: null,
saleRankCount: null,
historyCount: null,
noticeCount: null,
autoReceive: null,
refundImgCount: null,
commentImgHeight: null,
commentImgWidth: null,
orderBanner: null
}
}
},
created() {
mallConfig({ status: 2 }).then(res => {
this.dictData = res.data || []
this.dictData.forEach(item => {
this.dictToValue(item)
})
})
},
methods: {
dictToValue(item) {
switch (item.dictKey) {
case 'X_searchKeywords':
this.model.searchKeys = item.name
break
case 'X_timeFormat':
this.model.timeFormat = item.name
break
case 'X_currencyFormat':
this.model.moneyFormat = item.name
break
case 'X_thumbnailWidth':
this.model.imgWidth = item.name
break
case 'X_thumbnailHeight':
this.model.imgHeight = item.name
break
case 'X_salesRanking':
this.model.saleRankCount = item.name
break
case 'X_historyBrowsing':
this.model.historyCount = item.name
break
case 'X_latestAnnouncement':
this.model.noticeCount = item.name
break
case 'X_confirmReceipt':
this.model.autoReceive = Number(item.name) || 0
break
case 'X_uploadImage':
this.model.refundImgCount = item.name
break
case 'X_copyThumbnailHeight':
this.model.commentImgHeight = item.name
break
case 'X_thumbnailThumbnailWidth':
this.model.commentImgWidth = item.name
break
case 'X_orderRotation':
this.model.orderBanner = Number(item.name) || 0
break
}
},
valueToDict() {
this.dictData.forEach(item => {
switch (item.dictKey) {
case 'X_searchKeywords':
item.name = this.model.searchKeys
break
case 'X_timeFormat':
item.name = this.model.timeFormat
break
case 'X_currencyFormat':
item.name = this.model.moneyFormat
break
case 'X_thumbnailWidth':
item.name = this.model.imgWidth
break
case 'X_thumbnailHeight':
item.name = this.model.imgHeight
break
case 'X_salesRanking':
item.name = this.model.saleRankCount
break
case 'X_historyBrowsing':
item.name = this.model.historyCount
break
case 'X_latestAnnouncement':
item.name = this.model.noticeCount
break
case 'X_confirmReceipt':
item.name = this.model.autoReceive
break
case 'X_uploadImage':
item.name = this.model.refundImgCount
break
case 'X_copyThumbnailHeight':
item.name = this.model.commentImgHeight
break
case 'X_thumbnailThumbnailWidth':
item.name = this.model.commentImgWidth
break
case 'X_orderRotation':
item.name = this.model.orderBanner
break
}
})
},
submit() {
this.$refs['displayForm'].validate((valid) => {
if (valid) {
this.loading = true
this.valueToDict()
updateMallConfig(this.dictData).then(res => {
this.loading = false
this.$message.success('保存成功')
}).catch(err => {
this.loading = false
})
}
})
}
}
}
</script>
<style scoped>
.el-form {
max-width: 600px;
margin: 0 auto;
}
.tip {
font-size: 12px;
color: #999;
}
.operation {
text-align: center;
}
</style>
<template>
<el-card shadow="never">
<el-form :model="model"
v-loading="loading"
size="small"
ref="extendedForm"
label-width="230px">
<el-form-item label="会员登录/注册邮箱验证是否开启:"
prop="memberEmailAuth">
<el-radio-group v-model="model.memberEmailAuth">
<el-radio :label="0"></el-radio>
<el-radio :label="1"></el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="会员帐号安全验证级别:"
prop="memberAccountAuth">
<el-radio-group v-model="model.memberAccountAuth">
<el-radio :label="0">邮箱验证</el-radio>
<el-radio :label="1">手机验证</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="腾讯地图密钥:"
prop="mapKey">
<el-input placeholder="腾讯地图密钥"
v-model="model.mapKey"></el-input>
</el-form-item>
<el-form-item label="是否开启首页弹出广告:"
prop="homeAdv">
<el-radio-group v-model="model.homeAdv">
<el-radio :label="0"></el-radio>
<el-radio :label="1"></el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="电子面单是否启用:"
prop="electronicOrder">
<el-radio-group v-model="model.electronicOrder">
<el-radio :label="0"></el-radio>
<el-radio :label="1"></el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="有效支付时间(分钟):"
prop="effectPayTime">
<el-input placeholder="设置为0时不限时间"
v-model.number="model.effectPayTime"></el-input>
</el-form-item>
<el-form-item label="热门搜索关键词:"
prop="hotSearchKeys">
<el-input placeholder="请使用逗号分隔"
v-model.number="model.hotSearchKeys"></el-input>
</el-form-item>
</el-form>
<div class="operation">
<el-button type="primary"
size="medium"
:loading="loading"
@click="submit">确认</el-button>
</div>
</el-card>
</template>
<script>
import { mallConfig, updateMallConfig } from '@/api/setting'
export default {
name: 'ExtendedSetting',
components: {},
data() {
return {
loading: false,
dictData: [],
model: {
memberEmailAuth: 0,
memberAccountAuth: 0,
mapKey: null,
homeAdv: 0,
electronicOrder: 0,
effectPayTime: null,
hotSearchKeys: null
}
}
},
created() {
mallConfig({ status: 4 }).then(res => {
this.dictData = res.data || []
this.dictData.forEach(item => {
this.dictToValue(item)
})
})
},
methods: {
dictToValue(item) {
switch (item.dictKey) {
case 'K_mailboxVerification':
this.model.memberEmailAuth = Number(item.name)
break
case 'K_safetyVerification':
this.model.memberAccountAuth = Number(item.name)
break
case 'K_mapKey':
this.model.mapKey = item.name
break
case 'K_popupAds':
this.model.homeAdv = Number(item.name)
break
case 'K_electronicSingle':
this.model.electronicOrder = Number(item.name)
break
case 'K_paymentTime':
this.model.effectPayTime = item.name
break
case 'K_popular_keywords':
this.model.hotSearchKeys = item.name
break
}
},
valueToDict() {
this.dictData.forEach(item => {
switch (item.dictKey) {
case 'K_mailboxVerification':
item.name = this.model.memberEmailAuth
break
case 'K_safetyVerification':
item.name = this.model.memberAccountAuth
break
case 'K_mapKey':
item.name = this.model.mapKey
break
case 'K_popupAds':
item.name = this.model.homeAdv
break
case 'K_electronicSingle':
item.name = this.model.electronicOrder
break
case 'K_paymentTime':
item.name = this.model.effectPayTime
break
case 'K_popular_keywords':
item.name = this.model.hotSearchKeys
break
}
})
},
submit() {
this.$refs['extendedForm'].validate((valid) => {
if (valid) {
this.loading = true
this.valueToDict()
updateMallConfig(this.dictData).then(res => {
this.loading = false
this.$message.success('保存成功')
}).catch(err => {
this.loading = false
})
}
})
}
}
}
</script>
<style scoped>
.el-form {
max-width: 600px;
margin: 0 auto;
}
.tip {
font-size: 12px;
color: #999;
}
.operation {
text-align: center;
}
</style>
\ No newline at end of file
<template>
<el-card shadow="never">
<el-form :model="model"
v-loading="loading"
size="small"
ref="logoForm"
label-width="200px">
<el-form-item label="用户注册与登录页面Logo:"
prop="marketLogo">
<single-upload v-model="model.marketLogo"></single-upload>
</el-form-item>
<el-form-item label="平台后台登录页Logo:"
prop="platformLogo">
<single-upload v-model="model.platformLogo"></single-upload>
</el-form-item>
<el-form-item label="管理后台Logo:"
prop="manageLogo">
<single-upload v-model="model.manageLogo"></single-upload>
</el-form-item>
<el-form-item label="订单打印Logo:"
prop="printLogo">
<single-upload v-model="model.printLogo"></single-upload>
</el-form-item>
</el-form>
<div class="operation">
<el-button type="primary"
size="medium"
:loading="loading"
@click="submit">确认</el-button>
</div>
</el-card>
</template>
<script>
import SingleUpload from '@/components/Upload/singleUpload'
import { mallConfig, updateMallConfig } from '@/api/setting'
export default {
name: 'LogoSetting',
components: { SingleUpload },
data() {
return {
loading: false,
dictData: [],
model: {
marketLogo: null,
platformLogo: null,
manageLogo: null,
printLogo: null
}
}
},
created() {
mallConfig({ status: 5 }).then(res => {
this.dictData = res.data || []
this.dictData.forEach(item => {
this.dictToValue(item)
})
})
},
methods: {
dictToValue(item) {
switch (item.dictKey) {
case 'L_memberLogo':
this.model.marketLogo = item.name
break
case 'L_platformLogo':
this.model.platformLogo = item.name
break
case 'L_backstageLogo':
this.model.manageLogo = item.name
break
case 'L_orderPrintLogo':
this.model.printLogo = item.name
break
}
},
valueToDict() {
this.dictData.forEach(item => {
switch (item.dictKey) {
case 'L_memberLogo':
item.name = this.model.marketLogo
break
case 'L_platformLogo':
item.name = this.model.platformLogo
break
case 'L_backstageLogo':
item.name = this.model.manageLogo
break
case 'L_orderPrintLogo':
item.name = this.model.printLogo
break
}
})
},
submit() {
this.$refs['logoForm'].validate((valid) => {
if (valid) {
this.loading = true
this.valueToDict()
updateMallConfig(this.dictData).then(res => {
this.loading = false
this.$message.success('保存成功')
}).catch(err => {
this.loading = false
})
}
})
}
}
}
</script>
<style scoped>
.el-form {
max-width: 600px;
margin: 0 auto;
}
.tip {
font-size: 12px;
color: #999;
}
.operation {
text-align: center;
}
</style>
<template>
<el-card shadow="never">
<el-form :model="model"
v-loading="loading"
size="small"
ref="infoForm"
label-width="120px">
<el-form-item label="公司名称:"
:rules="[{required: true, trigger: 'blur', message: '公司名称不能为空'}]"
prop="companyName">
<el-input placeholder="公司名称"
v-model="model.companyName"></el-input>
</el-form-item>
<el-form-item label="商城名称:"
:rules="[{required: true, trigger: 'blur', message: '商品名称不能为空'}]"
prop="name">
<el-input placeholder="商城名称"
v-model="model.name"></el-input>
</el-form-item>
<el-form-item label="商城标题"
prop="title">
<el-input placeholder="商城标题"
v-model="model.title"></el-input>
</el-form-item>
<el-form-item label="商城描述:"
prop="desc">
<el-input placeholder="商城描述"
v-model="model.desc"></el-input>
</el-form-item>
<el-form-item label="商城关键字:"
prop="keyword">
<el-input placeholder="商城关键字"
v-model="model.keyword"></el-input>
</el-form-item>
<el-form-item label="商城详细地址:"
prop="address">
<el-input placeholder="商城地址"
v-model="model.address"></el-input>
</el-form-item>
<el-form-item label="客服QQ号码:"
prop="qq">
<el-input placeholder="客服QQ号码"
v-model="model.qq"></el-input>
</el-form-item>
<el-form-item label="客服邮箱:"
prop="email">
<el-input placeholder="客服邮箱"
v-model="model.email"></el-input>
</el-form-item>
<el-form-item label="客服电话:"
:rules="[{required: true, trigger: 'blur', message: '客服电话不能为空'}]"
prop="phone">
<el-input placeholder="客服电话"
v-model="model.phone"></el-input>
</el-form-item>
<el-form-item label="商城Logo:"
:rules="[{required: true, trigger: 'change', message: '商城Logo不能为空'}]"
prop="logo">
<single-upload v-model="model.logo"></single-upload>
<div class="tip">
<div>图片不能超过50K,图片格式为jpg/png</div>
</div>
</el-form-item>
<el-form-item label="是否关闭注册:"
prop="disableRegist">
<el-radio-group v-model="model.disableRegist">
<el-radio :label="0"></el-radio>
<el-radio :label="1"></el-radio>
</el-radio-group>
</el-form-item>
</el-form>
<div class="operation">
<el-button type="primary"
size="medium"
:loading="loading"
@click="submit">保存</el-button>
</div>
</el-card>
</template>
<script>
import SingleUpload from '@/components/Upload/singleUpload'
import { mallConfig, updateMallConfig } from '@/api/setting'
export default {
name: 'PlatformInfo',
components: { SingleUpload },
data() {
return {
loading: false,
dictData: null,
model: {
companyName: null,
name: null,
title: null,
desc: null,
keyword: null,
address: null,
qq: null,
email: null,
phone: null,
logo: null,
disableRegist: 1
}
}
},
created() {
mallConfig({ status: 0 }).then(res => {
this.dictData = res.data || []
this.dictData.forEach(item => {
this.dictToValue(item)
})
})
},
methods: {
dictToValue(item) {
switch (item.dictKey) {
case 'P_companyName':
this.model.companyName = item.name
break
case 'P_mallName':
this.model.name = item.name
break
case 'P_mallTitle':
this.model.title = item.name
break
case 'P_mallDescribe':
this.model.desc = item.name
break
case 'P_mallKeywords':
this.model.keyword = item.name
break
case 'P_mallSite':
this.model.address = item.name
break
case 'P_serviceQQ':
this.model.qq = item.name
break
case 'P_serviceMailbox':
this.model.email = item.name
break
case 'P_servicePhone':
this.model.phone = item.name
break
case 'P_mallLogo':
this.model.logo = item.name
break
case 'P_mallRegister':
this.model.disableRegist = Number(item.name)
break
}
},
valueToDict() {
this.dictData.forEach(item => {
switch (item.dictKey) {
case 'P_companyName':
item.name = this.model.companyName
break
case 'P_mallName':
item.name = this.model.name
break
case 'P_mallTitle':
item.name = this.model.title
break
case 'P_mallDescribe':
item.name = this.model.desc
break
case 'P_mallKeywords':
item.name = this.model.keyword
break
case 'P_mallSite':
item.name = this.model.address
break
case 'P_serviceQQ':
item.name = this.model.qq
break
case 'P_serviceMailbox':
item.name = this.model.email
break
case 'P_servicePhone':
item.name = this.model.phone
break
case 'P_mallLogo':
item.name = this.model.logo
break
case 'P_mallRegister':
item.name = this.model.disableRegist
break
}
})
},
submit() {
this.$refs['infoForm'].validate((valid) => {
if (valid) {
this.loading = true
this.valueToDict()
updateMallConfig(this.dictData).then(res => {
this.loading = false
this.$message.success('保存成功')
}).catch(err => {
this.loading = false
})
}
})
}
}
}
</script>
<style scoped>
.el-form {
max-width: 600px;
margin: 0 auto;
}
.tip {
font-size: 12px;
color: #999;
}
.operation {
text-align: center;
}
</style>
<template>
<el-card shadow="never">
<el-form :model="model"
v-loading="loading"
size="small"
ref="shoppingForm"
label-width="230px">
<el-form-item label="能否开具发票:"
prop="canBill">
<el-radio-group v-model="model.canBill">
<el-radio :label="0"></el-radio>
<el-radio :label="1">不能</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="确认订单是否自动发送邮件:"
prop="sureOrderEmail">
<el-radio-group v-model="model.sureOrderEmail">
<el-radio :label="0"></el-radio>
<el-radio :label="1"></el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="发货时是否发送邮件:"
prop="deliveryOrderEmail">
<el-radio-group v-model="model.deliveryOrderEmail">
<el-radio :label="0"></el-radio>
<el-radio :label="1"></el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="订单设置为无效时是否发送邮件:"
prop="invaildOrderEmail">
<el-radio-group v-model="model.invaildOrderEmail">
<el-radio :label="0"></el-radio>
<el-radio :label="1"></el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="订单设为已付款时是否必填备注:"
prop="payOrderRemark">
<el-radio-group v-model="model.payOrderRemark">
<el-radio :label="0"></el-radio>
<el-radio :label="1"></el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="订单设为未付款时是否必填备注:"
prop="orderOrderRemark">
<el-radio-group v-model="model.orderOrderRemark">
<el-radio :label="0"></el-radio>
<el-radio :label="1"></el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="订单设为已发货时是否必填备注:"
prop="shippedOrderRemark">
<el-radio-group v-model="model.shippedOrderRemark">
<el-radio :label="0"></el-radio>
<el-radio :label="1"></el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="订单设为收货确认是否必填备注:"
prop="receivedOrderRemark">
<el-radio-group v-model="model.receivedOrderRemark">
<el-radio :label="0"></el-radio>
<el-radio :label="1"></el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="订单设为退货是否必填备注:"
prop="refundOrderRemark">
<el-radio-group v-model="model.refundOrderRemark">
<el-radio :label="0"></el-radio>
<el-radio :label="1"></el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="订单设为无效时是否必填备注:"
prop="invaildOrderRemark">
<el-radio-group v-model="model.invaildOrderRemark">
<el-radio :label="0"></el-radio>
<el-radio :label="1"></el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="取消订单是否必填备注:"
prop="cancelOrderRemark">
<el-radio-group v-model="model.cancelOrderRemark">
<el-radio :label="0"></el-radio>
<el-radio :label="1"></el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="发票开具明细:"
prop="invoiceDetail">
<el-input placeholder="要求开发票时候可以选择的内容,一行代表一个选项"
v-model="model.invoiceDetail"
type="textarea"
:rows="5"></el-input>
</el-form-item>
<el-form-item label="最小购物金额:"
:rules="[{required: true, trigger: 'blur', message: '最小购物金额不能为空'}]"
prop="minOrderAmount">
<el-input placeholder="此金额以上才能提交订单"
v-model="model.minOrderAmount"></el-input>
</el-form-item>
<el-form-item label="减少库存的时机:"
prop="inventoryReduction">
<el-radio-group v-model="model.inventoryReduction">
<el-radio :label="0">付款时</el-radio>
<el-radio :label="1">下单时</el-radio>
<el-radio :label="2">发货时</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="增加销量的时机:"
prop="increaseSale">
<el-radio-group v-model="model.increaseSale">
<el-radio :label="0">付款时</el-radio>
<el-radio :label="1">发货时</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="发货日期起可退换货时间:"
:rules="[{required: true, trigger: 'blur', message: '发货日期起可退换货时间不能为空'}]"
prop="canRefundDay">
<el-input placeholder="以天为单位"
v-model.number="model.canRefundDay"></el-input>
</el-form-item>
</el-form>
<div class="operation">
<el-button type="primary"
size="medium"
:loading="loading"
@click="submit">确认</el-button>
</div>
</el-card>
</template>
<script>
import { mallConfig, updateMallConfig } from '@/api/setting'
export default {
name: 'ShoppingFlow',
components: {},
data() {
return {
loading: false,
dictData: [],
model: {
canBill: 0,
sureOrderEmail: 0,
deliveryOrderEmail: 0,
invaildOrderEmail: 0,
payOrderRemark: 0,
orderOrderRemark: 0,
shippedOrderRemark: 0,
receivedOrderRemark: 0,
refundOrderRemark: 0,
invaildOrderRemark: 0,
cancelOrderRemark: 0,
invoiceDetail: null,
minOrderAmount: null,
inventoryReduction: 0,
increaseSale: 0,
canRefundDay: null
}
}
},
created() {
mallConfig({ status: 3 }).then(res => {
this.dictData = res.data || []
this.dictData.forEach(item => {
this.dictToValue(item)
})
})
},
methods: {
dictToValue(item) {
switch (item.dictKey) {
case 'G_invoicing':
this.model.canBill = Number(item.name)
break
case 'G_automaticMail':
this.model.sureOrderEmail = Number(item.name)
break
case 'G_fahuAutomaticMail':
this.model.deliveryOrderEmail = Number(item.name)
break
case 'G_dingdanAutomaticMail':
this.model.invaildOrderEmail = Number(item.name)
break
case 'G_ddyifukuanMandatoryNote':
this.model.payOrderRemark = Number(item.name)
break
case 'G_ddweifukuanMandatoryNote':
this.model.orderOrderRemark = Number(item.name)
break
case 'G_ddyifahouMandatoryNote':
this.model.shippedOrderRemark = Number(item.name)
break
case 'G_ddshouhuoMandatoryNote':
this.model.receivedOrderRemark = Number(item.name)
break
case 'G_ddtuihuoMandatoryNote':
this.model.refundOrderRemark = Number(item.name)
break
case 'G_ddwuxiaoMandatoryNote':
this.model.invaildOrderRemark = Number(item.name)
break
case 'G_ddquxiaoMandatoryNote':
this.model.cancelOrderRemark = Number(item.name)
break
case 'G_invoicingDetails':
this.model.invoiceDetail = item.name
break
case 'G_minimumAmount':
this.model.minOrderAmount = item.name
break
case 'G_inventoryReduction':
this.model.inventoryReduction = Number(item.name)
break
case 'G_increaseSales':
this.model.increaseSale = Number(item.name)
break
case 'G_barterTime':
this.model.canRefundDay = item.name
break
}
},
valueToDict() {
this.dictData.forEach(item => {
switch (item.dictKey) {
case 'G_invoicing':
item.name = this.model.canBill
break
case 'G_automaticMail':
item.name = this.model.sureOrderEmail
break
case 'G_fahuAutomaticMail':
item.name = this.model.deliveryOrderEmail
break
case 'G_dingdanAutomaticMail':
item.name = this.model.invaildOrderEmail
break
case 'G_ddyifukuanMandatoryNote':
item.name = this.model.payOrderRemark
break
case 'G_ddweifukuanMandatoryNote':
item.name = this.model.orderOrderRemark
break
case 'G_ddyifahouMandatoryNote':
item.name = this.model.shippedOrderRemark
break
case 'G_ddshouhuoMandatoryNote':
item.name = this.model.receivedOrderRemark
break
case 'G_ddtuihuoMandatoryNote':
item.name = this.model.refundOrderRemark
break
case 'G_ddwuxiaoMandatoryNote':
item.name = this.model.invaildOrderRemark
break
case 'G_ddquxiaoMandatoryNote':
item.name = this.model.cancelOrderRemark
break
case 'G_invoicingDetails':
item.name = this.model.invoiceDetail
break
case 'G_minimumAmount':
item.name = this.model.minOrderAmount
break
case 'G_inventoryReduction':
item.name = this.model.inventoryReduction
break
case 'G_increaseSales':
item.name = this.model.increaseSale
break
case 'G_barterTime':
item.name = this.model.canRefundDay
break
}
})
},
submit() {
this.$refs['shoppingForm'].validate((valid) => {
if (valid) {
this.loading = true
this.valueToDict()
updateMallConfig(this.dictData).then(res => {
this.loading = false
this.$message.success('保存成功')
}).catch(err => {
this.loading = false
})
}
})
}
}
}
</script>
<style scoped>
.el-form {
max-width: 600px;
margin: 0 auto;
}
.tip {
font-size: 12px;
color: #999;
}
.operation {
text-align: center;
}
</style>
<template>
<el-dialog :visible.sync="visible"
:title="title"
center
width="650px">
<el-form :model="model"
ref="menuForm"
v-loading="loading"
label-width="180px">
<el-form-item label="栏目名称:"
prop="columnName"
:rules="[{ required: true, trigger: 'blur', message: '栏目名称不能为空' }]">
<el-input placeholder="请输入栏目名称"
class="input-width"
size="small"
v-model="model.columnName"></el-input>
</el-form-item>
<el-form-item label="对应链接:"
prop="link"
:rules="[{ required: true, trigger: 'blur', message: '对应链接不能为空' }]">
<el-input placeholder="请输入对应链接"
class="input-width"
size="small"
v-model="model.link"></el-input>
</el-form-item>
<el-form-item label="排序:"
prop="sort"
:rules="[{ required: true, trigger: 'blur', message: '排序不能为空' }]">
<el-input placeholder="填入1-99之间的数字"
class="input-width"
size="small"
v-model.number="model.sort"></el-input>
</el-form-item>
<el-form-item label="是否展示:"
prop="columnName">
<el-radio-group v-model="model.showFlag">
<el-radio :label="0"></el-radio>
<el-radio :label="1"></el-radio>
</el-radio-group>
</el-form-item>
</el-form>
<div slot="footer">
<el-button type="primary"
:loading="loading"
@click="submit">确认</el-button>
<el-button @click="close">取消</el-button>
</div>
</el-dialog>
</template>
<script>
import { createMarketMenu, updateMarketMenu } from '@/api/marketMenu'
const defaultModel = {
columnName: null,
link: null,
sort: null,
showFlag: 0
}
// 添加自定义栏目
export default {
name: 'MarketMenuDialog',
components: {},
data() {
return {
visible: false,
title: null,
loading: false,
model: Object.assign({}, defaultModel)
}
},
methods: {
init() {
this.model = Object.assign({}, defaultModel)
this.$nextTick(() => {
this.$refs.menuForm.clearValidate()
})
},
add(parentId) {
this.init()
// 添加数据处理
this.visible = true
this.title = '添加自定义栏目'
},
detail(data) {
this.init()
this.visible = true
this.model = Object.assign({}, data)
this.title = '编辑自定义栏目'
},
submit() {
// 提交保存
this.$refs.menuForm.validate((valid) => {
if (valid) {
// 验证通过
this.loading = true
if (this.model.id) {
// 修改自定义栏目
updateMarketMenu(this.model).then(res => {
this.loading = false
this.visible = false
this.$emit('ok')
}).catch(err => {
this.loading = false
})
} else {
// 添加自定义栏目
createMarketMenu(this.model).then(res => {
this.loading = false
this.visible = false
this.$emit('ok')
}).catch(err => {
this.loading = false
})
}
}
})
},
close() {
this.$emit('close')
this.visible = false
}
}
}
</script>
<style scoped>
.input-width {
width: 300px;
}
</style>
\ No newline at end of file
<template> 
<div class="app-container">
<!-- 操作栏 -->
<el-card class="operate-container"
shadow="never">
<div class="row-item">
<el-button size="small"
type="primary"
@click="handleAdd">添加栏目</el-button>
</div>
</el-card>
<!-- 表格栏 -->
<div class="table-container">
<el-table :data="list"
v-loading="listLoading"
border>
<el-table-column label="序号"
align="center">
<template slot-scope="scope">{{scope.$index + 1}}</template>
</el-table-column>
<el-table-column label="栏目名称"
align="center"
prop="columnName">
</el-table-column>
<el-table-column label="对应链接"
align="center"
prop="link">
</el-table-column>
<el-table-column label="更改时间"
align="center">
<template slot-scope="scope">{{scope.row.createDate || scope.row.updateDate | formatTime}}</template>
</el-table-column>
<el-table-column label="排序"
align="center"
prop="sort">
</el-table-column>
<el-table-column label="是否展示"
align="center">
<template slot-scope="scope">{{scope.row.showFlag == 0 ? '是' : '否'}}</template>
</el-table-column>
<el-table-column label="操作"
width="160"
align="center">
<template slot-scope="scope">
<el-button size="mini"
type="warning"
@click="handleUpdate(scope.row)">编辑</el-button>
<el-button size="mini"
type="danger"
@click="handleDelete(scope.row)">删除</el-button>
</template>
</el-table-column>
</el-table>
</div>
<!-- 分页栏 -->
<div class="pagination-container">
<el-pagination background
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
layout="total, sizes, prev, pager, next, jumper"
:current-page.sync="listQuery.pageNum"
:page-size="listQuery.pageSize"
:page-sizes="[10,30,50]"
:total="total">
</el-pagination>
</div>
<!-- 弹窗 -->
<menu-dialog ref="detailDialog"
@ok="getList"></menu-dialog>
<!-- end -->
</div>
</template>
<script>
import { marketMenuList } from '@/api/marketMenu'
import { formatDate } from '@/utils/date'
import MenuDialog from './components/MenuDialog'
const defaultListQuery = {
pageNum: 1,
pageSize: 10
}
// 商城自定义栏目列表
export default {
name: 'marketMenuList',
components: {
MenuDialog
},
data() {
return {
list: [],
total: 0,
listQuery: Object.assign({}, defaultListQuery),
listLoading: false
}
},
mounted() {
this.getList()
},
filters: {
formatTime(time) {
if (!time) {
return '--'
}
let date = new Date(time)
return formatDate(date, 'yyyy-MM-dd hh:mm:ss')
}
},
methods: {
handleSizeChange(val) {
this.listQuery.pageNum = 1
this.listQuery.pageSize = val
this.getList()
},
handleCurrentChange(val) {
this.listQuery.pageNum = val
this.getList()
},
// 添加
handleAdd(row) {
this.$refs.detailDialog.add()
},
// 编辑
handleUpdate(row) {
this.$refs.detailDialog.detail(row)
},
// 删除
handleDelete(row) {
this.$confirm('', '您确定要删除' + row.columnNmae + '栏目吗?', {
confirmButtonText: '确定',
cancelButtonText: '取消',
center: true
}).then(() => {
// 请求删除
deleteFeedbackClassify({ id: row.id }).then(res => {
this.getList()
})
})
},
//请求数据
getList() {
this.listLoading = true
marketMenuList(this.listQuery).then(res => {
this.listLoading = false
this.list = res.data.list
this.total = res.data.total
}).catch(err => {
this.listLoading = false
})
}
}
}
</script>
<style scoped>
.operate-container {
text-align: right;
margin-top: 0;
margin-bottom: 20px;
}
</style>
\ No newline at end of file
<template> 
<el-card>
<!-- 表格栏 -->
<el-table :data="list"
ref="table"
row-key="id"
v-loading="listLoading"
border>
<el-table-column label="消息类型"
align="center">
<template slot-scope="scope">{{scope.row.name}}</template>
</el-table-column>
<el-table-column align="center">
<template slot="header"
slot-scope="scope">
邮件通知(<el-button type="text"
@click="configEmail(scope)">配置</el-button>
</template>
<template slot-scope="scope">
<el-switch v-model="scope.row.isOpen"
disabled
:active-value="1"></el-switch>
<el-button type="text"
@click="handleEmail(scope.row)">编辑</el-button>
</template>
</el-table-column>
<el-table-column align="center">
<template slot="header"
slot-scope="scope">
手机短信(<el-button type="text"
@click="configSms(scope)">配置</el-button>
</template>
<template slot-scope="scope">
<el-switch v-model="scope.row.isOpen"
disabled
:active-value="1"></el-switch>
<el-button type="text"
@click="handleSms(scope.row)">编辑</el-button>
</template>
</el-table-column>
</el-table>
<!-- 弹窗 -->
<email-config-modal ref="emailModal"
@ok="getList"></email-config-modal>
<email-setting-modal ref="emailSettingModal"
@ok="getList"></email-setting-modal>
<sms-config-modal ref="smsModal"
@ok="getList"></sms-config-modal>
<sms-setting-modal ref="smsSettingModal"
@ok="getList"></sms-setting-modal>
<!-- end -->
</el-card>
</template>
<script>
import emailConfigModal from './modules/emailConfigModal'
import emailSettingModal from './modules/emailSettingModal'
import smsConfigModal from './modules/smsConfigModal'
import smsSettingModal from './modules/smsSettingModal'
// 消息设置
export default {
name: 'MessageSetting',
components: {
emailConfigModal,
emailSettingModal,
smsConfigModal,
smsSettingModal
},
data() {
return {
list: [],
listLoading: false
}
},
mounted() {
this.getList()
},
methods: {
// 邮件通知配置
configEmail() {
this.$refs.emailModal.detail()
},
// 手机短信配置
configSms() {
this.$refs.smsModal.detail()
},
// 编辑邮箱
handleEmail(row) {
this.$refs.emailSettingModal.detail(row.id)
},
// 编辑邮箱
handleSms(row) {
this.$refs.smsSettingModal.detail(row.id)
},
//请求数据
getList() {
}
}
}
</script>
<style scoped>
\ No newline at end of file
<template>
<el-dialog :visible.sync="visible"
:title="title"
center
width="800px">
<!-- start -->
<!-- 内容布局 -->
<div class="scroll-container">
<!-- 支付方式信息 -->
<el-form :model="model"
class="section"
size="small"
ref="configForm"
v-loading="loading"
label-width="200px">
<el-form-item label="SMTP服务器:"
prop="server"
:rules="[{ required: true, trigger: 'blur', message: 'SMTP服务器不能为空' }]">
<el-input placeholder="请输入SMTP服务器"
v-model="model.server"></el-input>
</el-form-item>
<el-form-item label="SMTP服务器端口:"
prop="port"
:rules="[{ required: true, trigger: 'blur', message: 'SMTP服务器端口不能为空' }]">
<el-input placeholder="请输入SMTP服务器端口"
v-model="model.port"></el-input>
</el-form-item>
<el-form-item label="SMTP用户名:"
prop="account"
:rules="[{ required: true, trigger: 'blur', message: 'SMTP用户名不能为空' }]">
<el-input placeholder="请输入SMTP用户名"
v-model="model.account"></el-input>
</el-form-item>
<el-form-item label="SMTP用户密码:"
prop="password"
:rules="[{ required: true, trigger: 'blur', message: 'SMTP用户密码不能为空' }]">
<el-input placeholder="请输入SMTP用户密码"
v-model="model.password"></el-input>
</el-form-item>
<el-form-item label="显示名称:"
prop="showName">
<el-input placeholder="请输入显示名称"
v-model="model.showName"></el-input>
</el-form-item>
</el-form>
</div>
<!-- 底部操作栏 -->
<div slot="footer">
<el-button type="primary"
size="medium"
@click="submit">确认</el-button>
</div>
<!-- end -->
</el-dialog>
</template>
<script>
export default {
name: 'EmailConfigModal',
data() {
return {
visible: false,
title: null,
loading: false,
model: {}
}
},
methods: {
detail(id) {
this.id = id
this.model = {}
this.visible = true
this.title = '邮件通知配置'
},
close() {
this.$emit('close')
this.visible = false
},
submit() {
// 创建
}
}
}
</script>
<style scoped>
.scroll-container {
max-height: 50vh;
overflow: hidden;
overflow-y: auto;
}
.section .el-input,
.section .el-textarea,
.section .el-select,
.section .el-cascader {
width: 400px;
}
.operation {
text-align: center;
}
</style>
\ No newline at end of file
<template>
<el-dialog :visible.sync="visible"
:title="title"
center
width="600px">
<!-- start -->
<!-- 内容布局 -->
<div class="scroll-container">
<!-- 邮箱信息 -->
<el-form :model="model"
class="section"
size="small"
ref="settingForm"
v-loading="loading"
label-width="100px">
<el-form-item label="消息类型"
prop="name"
:rules="[{ required: true, trigger: 'blur', message: '消息类型不能为空' }]">
<el-input placeholder="请输入消息类型"
readonly
v-model="model.name"></el-input>
</el-form-item>
<el-form-item label="邮件标题"
prop="title"
:rules="[{ required: true, trigger: 'blur', message: '邮件标题不能为空' }]">
<el-input placeholder="请输入邮件标题"
v-model="model.title"></el-input>
</el-form-item>
<el-form-item label="模版内容"
prop="content"
:rules="[{ required: true, trigger: 'blur', message: '模版内容不能为空' }]">
<el-input placeholder="请输入模版内容"
type="textarea"
rows="5"
v-model="model.content"></el-input>
</el-form-item>
</el-form>
</div>
<!-- 底部操作栏 -->
<div slot="footer">
<el-button type="primary"
size="medium"
@click="submit">确认</el-button>
</div>
<!-- end -->
</el-dialog>
</template>
<script>
export default {
name: 'EmailSettingModal',
data() {
return {
visible: false,
title: null,
loading: false,
model: {}
}
},
methods: {
detail(id) {
this.id = id
this.model = {}
this.visible = true
this.title = '邮件通知设置'
},
close() {
this.$emit('close')
this.visible = false
},
submit() {
// 创建
}
}
}
</script>
<style scoped>
.scroll-container {
max-height: 50vh;
overflow: hidden;
overflow-y: auto;
}
.section .el-input,
.section .el-textarea,
.section .el-select,
.section .el-cascader {
width: 400px;
}
.operation {
text-align: center;
}
</style>
\ No newline at end of file
<template>
<el-dialog :visible.sync="visible"
:title="title"
center
width="800px">
<!-- start -->
<!-- 内容布局 -->
<div class="scroll-container">
<!-- 支付方式信息 -->
<el-form :model="model"
class="section"
size="small"
ref="configForm"
v-loading="loading"
label-width="200px">
<el-form-item label="剩余短信数量:"
prop="count">
<el-input placeholder="剩余短信数量"
readonly
v-model="model.count"></el-input>
</el-form-item>
<el-form-item label="AppKey:"
prop="appKey"
:rules="[{ required: true, trigger: 'blur', message: 'AppKey不能为空' }]">
<el-input placeholder="请输入AppKey:"
v-model="model.appKey"></el-input>
</el-form-item>
<el-form-item label="AppSecret:"
prop="appSecret"
:rules="[{ required: true, trigger: 'blur', message: 'AppSecret不能为空' }]">
<el-input placeholder="请输入AppSecret"
v-model="model.appSecret"></el-input>
</el-form-item>
</el-form>
</div>
<!-- 底部操作栏 -->
<div slot="footer">
<el-button type="primary"
size="medium"
@click="submit">确认</el-button>
</div>
<!-- end -->
</el-dialog>
</template>
<script>
export default {
name: 'SmsConfigModal',
data() {
return {
visible: false,
title: null,
loading: false,
model: {}
}
},
methods: {
detail(id) {
this.id = id
this.model = {}
this.visible = true
this.title = '邮件通知配置'
},
close() {
this.$emit('close')
this.visible = false
},
submit() {
// 创建
}
}
}
</script>
<style scoped>
.scroll-container {
max-height: 50vh;
overflow: hidden;
overflow-y: auto;
}
.section .el-input,
.section .el-textarea,
.section .el-select,
.section .el-cascader {
width: 400px;
}
.operation {
text-align: center;
}
</style>
\ No newline at end of file
<template>
<el-dialog :visible.sync="visible"
:title="title"
center
width="600px">
<!-- start -->
<!-- 内容布局 -->
<div class="scroll-container">
<!-- 邮箱信息 -->
<el-form :model="model"
class="section"
size="small"
ref="settingForm"
v-loading="loading"
label-width="120px">
<el-form-item label="消息类型:"
prop="name"
:rules="[{ required: true, trigger: 'blur', message: '消息类型不能为空' }]">
<el-input placeholder="请输入消息类型"
readonly
v-model="model.name"></el-input>
</el-form-item>
<el-form-item label="短信签名:"
prop="sign"
:rules="[{ required: true, trigger: 'blur', message: '短信签名不能为空' }]">
<el-input placeholder="请输入短信签名"
v-model="model.sign"></el-input>
</el-form-item>
<el-form-item label="短信模版名称:"
prop="title"
:rules="[{ required: true, trigger: 'blur', message: '短信模版名称不能为空' }]">
<el-input placeholder="请输入短信模版名称"
v-model="model.title"></el-input>
</el-form-item>
<el-form-item label="短信内容:"
prop="content"
:rules="[{ required: true, trigger: 'blur', message: '短信内容不能为空' }]">
<el-input placeholder="请输入短信内容"
type="textarea"
rows="5"
v-model="model.content"></el-input>
</el-form-item>
</el-form>
</div>
<!-- 底部操作栏 -->
<div slot="footer">
<el-button type="primary"
size="medium"
@click="submit">确认</el-button>
</div>
<!-- end -->
</el-dialog>
</template>
<script>
export default {
name: 'SmsSettingModal',
data() {
return {
visible: false,
title: null,
loading: false,
model: {}
}
},
methods: {
detail(id) {
this.id = id
this.model = {}
this.visible = true
this.title = '短信通知设置'
},
close() {
this.$emit('close')
this.visible = false
},
submit() {
// 创建
}
}
}
</script>
<style scoped>
.scroll-container {
max-height: 50vh;
overflow: hidden;
overflow-y: auto;
}
.section .el-input,
.section .el-textarea,
.section .el-select,
.section .el-cascader {
width: 360px;
}
.operation {
text-align: center;
}
</style>
\ No newline at end of file
<template> 
<el-card>
<!-- 表格栏 -->
<el-table :data="list"
ref="table"
row-key="id"
v-loading="listLoading"
border>
<el-table-column label="支付方式名称"
align="center">
<template slot-scope="scope">{{scope.row.tips}}</template>
</el-table-column>
<el-table-column label="支付方式描述"
align="center">
<template slot-scope="scope">{{scope.row.dictKey}}</template>
</el-table-column>
<el-table-column label="是否启用"
align="center">
<template slot-scope="scope">
<el-switch v-model="scope.row.name"
@change="changeStatus(scope.row)"
active-value="1"
inactive-value="0"></el-switch>
</template>
</el-table-column>
</el-table>
<!-- 弹窗 -->
<alipay-modal ref="alipayModal"
@ok="getList"></alipay-modal>
<!-- end -->
</el-card>
</template>
<script>
import alipayModal from './modules/alipayModal'
import { mallConfig, updateMallConfig } from '@/api/setting'
// 属性分类列表
export default {
name: 'PayWay',
components: {
alipayModal
},
data() {
return {
list: [],
listLoading: false
}
},
mounted() {
this.getList()
},
methods: {
// 编辑
handleUpdate(row) {
this.$refs.alipayModal.detail(row.id)
},
changeStatus(row) {
updateMallConfig([row]).then(res => {
this.$message.success('修改成功')
}).catch(err => {
this.getList()
})
},
//请求数据
getList() {
mallConfig({ status: 7 }).then(res => {
this.list = res.data
})
}
}
}
</script>
<style scoped>
</style>
\ No newline at end of file
<template>
<el-dialog :visible.sync="visible"
:title="title"
center
width="800px">
<!-- start -->
<!-- 内容布局 -->
<div class="scroll-container">
<!-- 支付方式信息 -->
<el-form :model="model"
class="section"
size="small"
ref="payForm"
v-loading="loading"
label-width="200px">
<el-form-item label="支付方式名称:"
prop="name"
:rules="[{ required: true, trigger: 'blur', message: '支付方式名称不能为空' }]">
<el-input placeholder="请输入支付方式名称"
v-model="model.name"></el-input>
</el-form-item>
<el-form-item label="支付方式描述:"
prop="description">
<el-input placeholder="请输入支付方式描述"
type="textarea"
v-model="model.description"></el-input>
</el-form-item>
<el-form-item label="支付宝帐号:"
prop="alipay"
:rules="[{ required: true, trigger: 'blur', message: '支付宝帐号不能为空' }]">
<el-input placeholder="请输入支付宝帐号"
v-model="model.alipay"></el-input>
</el-form-item>
<el-form-item label="交易安全校验码:"
prop="safeCode"
:rules="[{ required: true, trigger: 'blur', message: '交易安全校验码不能为空' }]">
<el-input placeholder="请输入交易安全校验码"
v-model="model.safeCode"></el-input>
</el-form-item>
<el-form-item label="合作者身份PID:"
prop="pid"
:rules="[{ required: true, trigger: 'blur', message: '合作者身份PID不能为空' }]">
<el-input placeholder="请输入合作者身份PID"
v-model="model.pid"></el-input>
</el-form-item>
<el-form-item label="选择接口类型:"
prop="interfaceType">
<el-select placeholder="请选择"
v-model="model.interfaceType"></el-select>
</el-form-item>
<el-form-item label="选择接口模式:"
prop="interfaceMode">
<el-select placeholder="请选择接口模式"
v-model="model.interfaceMode"></el-select>
</el-form-item>
<el-form-item label="应用APP的ID:"
prop="appId"
:rules="[{ required: true, trigger: 'blur', message: '应用APP的ID不能为空' }]">
<el-input placeholder="请输入应用APP的ID"
v-model="model.appId"></el-input>
</el-form-item>
<el-form-item label="支付宝证书公钥:"
prop="alipayKey"
:rules="[{ required: true, trigger: 'blur', message: '支付宝证书公钥不能为空' }]">
<el-input placeholder="请输入支付宝证书公钥"
type="textArea"
v-model="model.alipayKey"></el-input>
</el-form-item>
<el-form-item label="商户证书私钥:"
prop="alipayScrect"
:rules="[{ required: true, trigger: 'blur', message: '商户证书私钥不能为空' }]">
<el-input placeholder="请输入商户证书私钥"
v-model="model.alipayScrect"></el-input>
</el-form-item>
<el-form-item label="支付手续费:"
prop="rate">
<el-input v-model="model.rate"></el-input>
</el-form-item>
<el-form-item label="在线支付:"
prop="isOpen">
<el-radio-group v-model="model.isOpen">
<el-radio :label="1"></el-radio>
</el-radio-group>
</el-form-item>
</el-form>
</div>
<!-- 底部操作栏 -->
<div slot="footer">
<el-button type="primary"
size="small"
@click="submit">确认</el-button>
</div>
<!-- end -->
</el-dialog>
</template>
<script>
export default {
name: 'AlipayModal',
data() {
return {
visible: false,
title: null,
loading: false,
model: {}
}
},
methods: {
detail(id) {
this.id = id
this.model = {}
this.visible = true
this.title = '支付宝支付'
},
close() {
this.$emit('close')
this.visible = false
},
submit() {
// 创建
}
}
}
</script>
<style scoped>
.scroll-container {
max-height: 50vh;
overflow: hidden;
overflow-y: auto;
}
.section .el-input,
.section .el-textarea,
.section .el-select,
.section .el-cascader {
width: 400px;
}
.operation {
text-align: center;
}
</style>
\ No newline at end of file
<template> 
<el-card>
<!-- 表格栏 -->
<el-table :data="list"
ref="table"
row-key="id"
v-loading="listLoading"
border>
<el-table-column label="计划任务名称"
align="center">
<template slot-scope="scope">{{scope.row.name}}</template>
</el-table-column>
<el-table-column label="计划任务描述"
align="center">
<template slot-scope="scope">{{scope.row.description}}</template>
</el-table-column>
<el-table-column label="执行表达式"
align="center">
<template slot-scope="scope">{{scope.row.cronExpression}}</template>
</el-table-column>
<el-table-column label="是否启用"
width="100"
align="center">
<template slot-scope="scope">
<el-switch v-model="scope.row.status"
@change="changeStatus(scope.row)"
:active-value="0"
:inactive-value="-1"></el-switch>
</template>
</el-table-column>
<el-table-column label="操作"
width="100"
align="center">
<template slot-scope="scope">
<el-button size="mini"
type="warning"
@click="handleUpdate(scope.row)">编辑</el-button>
<!-- <el-button size="mini"
type="primary"
@click="handleExecute(scope.row)">执行</el-button> -->
</template>
</el-table-column>
</el-table>
<!-- 弹窗 -->
<schedule-task-modal ref="taskModal"
@ok="getList"></schedule-task-modal>
<!-- end -->
</el-card>
</template>
<script>
import scheduleTaskModal from './modules/scheduleTaskModal'
import { scheduleTaskList, pauseScheduleTask, resumeScheduleTask } from '@/api/setting'
// 计划任务列表
export default {
name: 'scheduleTaskList',
components: {
scheduleTaskModal
},
data() {
return {
list: [],
listLoading: false
}
},
mounted() {
this.getList()
},
methods: {
// 编辑
handleUpdate(row) {
this.$refs.taskModal.detail(row)
},
// 执行
handleExecute(row) {
},
// 暂停和恢复
changeStatus(row) {
let params = {
jobClassName: row.jobClassName
}
if (row.status == 0) {
resumeScheduleTask(params).then(res => {
this.$message.success('启动成功')
}).catch(err => {
this.getList()
})
} else {
pauseScheduleTask(params).then(res => {
this.$message.success('禁用成功')
}).catch(err => {
this.getList()
})
}
},
//请求数据
getList() {
this.listLoading = true
scheduleTaskList().then(res => {
this.listLoading = false
this.list = res.data
}).catch(err => {
this.listLoading = false
})
}
}
}
</script>
<style scoped>
\ No newline at end of file
<template>
<el-dialog :visible.sync="visible"
:title="title"
center
width="800px">
<!-- start -->
<!-- 内容布局 -->
<div class="scroll-container">
<!-- 计划任务信息 -->
<el-form :model="model"
class="section"
size="small"
ref="taskForm"
v-loading="loading"
label-width="200px">
<el-form-item label="计划任务名称:"
prop="name"
:rules="[{ required: true, trigger: 'blur', message: '计划任务名称不能为空' }]">
<el-input placeholder="请输入计划任务名称"
v-model="model.name"></el-input>
</el-form-item>
<el-form-item label="计划任务描述:"
prop="description">
<el-input placeholder="请输入计划任务描述"
type="textarea"
v-model="model.description"></el-input>
</el-form-item>
<el-form-item label="执行表达式:"
prop="cronExpression"
:rules="[{ required: true, trigger: 'change', message: '执行表达式不能为空' }]">
<el-input placeholder="请输入执行表达式"
v-model="model.cronExpression"></el-input>
</el-form-item>
</el-form>
</div>
<!-- 底部操作栏 -->
<div slot="footer">
<el-button type="primary"
size="medium"
@click="submit">确认</el-button>
</div>
<!-- end -->
</el-dialog>
</template>
<script>
import { updateScheduleTask } from '@/api/setting'
export default {
name: 'ScheduleTaskModal',
data() {
return {
visible: false,
title: '计划任务',
loading: false,
model: {}
}
},
methods: {
detail(data) {
this.model = Object.assign({}, data)
this.visible = true
this.title = '计划任务'
},
close() {
this.$emit('close')
this.visible = false
},
submit() {
// 创建
this.$refs.taskForm.validate((valid) => {
if (valid) {
updateScheduleTask(this.model).then(res => {
this.loading = false
this.$emit('ok')
this.visible = false
}).catch(err => {
this.loading = false
})
}
})
}
}
}
</script>
<style scoped>
.scroll-container {
max-height: 50vh;
overflow: hidden;
overflow-y: auto;
}
.section .el-input,
.section .el-textarea,
.section .el-select,
.section .el-cascader {
width: 400px;
}
.operation {
text-align: center;
}
</style>
\ No newline at end of file
<template> 
<el-card>
<!-- 表格栏 -->
<el-table :data="list"
ref="table"
row-key="id"
v-loading="listLoading"
border>
<el-table-column label="关键词"
align="center">
<template slot-scope="scope">{{scope.row.word}}</template>
</el-table-column>
<el-table-column label="总搜索"
align="center">
<template slot-scope="scope">{{scope.row.totalCount}}</template>
</el-table-column>
<el-table-column label="本月"
align="center">
<template slot-scope="scope">{{scope.row.thisMonthCount}}</template>
</el-table-column>
<el-table-column label="本周"
align="center">
<template slot-scope="scope">{{scope.row.thisWeekCount}}</template>
</el-table-column>
<el-table-column label="今日"
align="center">
<template slot-scope="scope">{{scope.row.todayCount}}</template>
</el-table-column>
</el-table>
<!-- 分页栏 -->
<div class="pagination-container">
<el-pagination background
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
layout="total, sizes, prev, pager, next, jumper"
:current-page.sync="listQuery.pageNum"
:page-size="listQuery.pageSize"
:page-sizes="[10,30,50]"
:total="total">
</el-pagination>
</div>
<!-- end -->
</el-card>
</template>
<script>
import { searchRecordList } from '@/api/setting'
const defaultListQuery = {
pageNum: 1,
pageSize: 10
}
// 配送方式列表
export default {
name: 'searchRecord',
components: {},
data() {
return {
total: 0,
list: [],
listQuery: Object.assign({}, defaultListQuery),
listLoading: false
}
},
mounted() {
this.getList()
},
methods: {
// 表格页数改变
handleSizeChange(val) {
this.listQuery.pageNum = 1
this.listQuery.pageSize = val
this.getList()
},
// 表格页码改变
handleCurrentChange(val) {
this.listQuery.pageNum = val
this.getList()
},
//请求数据
getList() {
this.listLoading = true
searchRecordList(this.listQuery).then(res => {
this.listLoading = false
this.list = res.data.list
this.total = res.data.total
}).catch(err => {
this.listLoading = false
})
}
}
}
</script>
<style scoped>
</style>
\ No newline at end of file
<template>
<el-card>
<!-- 添加档口 -->
<el-card class="operate-container"
shadow="never">
<div class="row-item">
<el-button size="small"
type="primary"
@click="handleAdd">添加档口</el-button>
</div>
</el-card>
<!-- 表格栏 -->
<el-table :data="list"
v-loading="listLoading"
border>
<el-table-column label="序号"
width="80"
align="center">
<template slot-scope="scope">{{scope.$index + 1}}</template>
</el-table-column>
<el-table-column label="档口名称"
align="center">
<template slot-scope="scope">{{scope.row.name}}</template>
</el-table-column>
<el-table-column label="所在区位"
align="center">
<template slot-scope="scope">{{scope.row | formatAddress}}</template>
</el-table-column>
<el-table-column label="经营类目"
align="center">
<template slot-scope="scope">{{scope.row.businessCategory}}</template>
</el-table-column>
<el-table-column label="分区"
align="center">
<template slot-scope="scope">{{scope.row.stallArea}}</template>
</el-table-column>
<el-table-column label="添加时间"
align="center">
<template slot-scope="scope">{{scope.row.createDate | updateDate}}</template>
</el-table-column>
<el-table-column label="操作"
align="center"
width="180px">
<template slot-scope="scope">
<el-button size="small"
type="warning"
@click="handleUpdate(scope.row)">编辑</el-button>
<el-button size="small"
type="danger"
@click="handleDelete(scope.row)">删除</el-button>
</template>
</el-table-column>
</el-table>
<!-- 分页栏 -->
<div class="pagination-container">
<el-pagination background
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
layout="total, sizes, prev, pager, next, jumper"
:current-page.sync="listQuery.pageNum"
:page-size="listQuery.pageSize"
:page-sizes="[5,10,15]"
:total="total">
</el-pagination>
</div>
<!-- 弹窗 -->
<site-modal ref="siteModal"
@ok="getList"></site-modal>
</el-card>
</template>
<script>
import { formatDate } from '@/utils/date'
import siteModal from './modules/siteModal'
import { getStallList, deleteStall } from '@/api/siteManagement'
// 档口位置管理
export default {
name: 'siteManagement',
components: {
siteModal
},
data() {
return {
listQuery: {
pageNum: 1,
pageSize: 10,
sortType: 1
},
total: 0,
list: [],
listLoading: false
}
},
created() {
this.getList()
},
filters: {
//更新时间
updateDate(time) {
if (time == null || time == '') {
return 'N/A'
}
let date = new Date(time)
return formatDate(date, 'yyyy-MM-dd hh:mm:ss')
},
formatAddress(row) {
return row.provinceName + row.cityName + row.areaName + row.addressDetail
}
},
methods: {
// 表格页数改变
handleSizeChange(val) {
this.listQuery.pageNum = 1
this.listQuery.pageSize = val
this.getList()
},
// 表格页码改变
handleCurrentChange(val) {
this.listQuery.pageNum = val
this.getList()
},
// 添加
handleAdd() {
this.$refs.siteModal.add()
},
// 编辑
handleUpdate(row) {
this.$refs.siteModal.detail(row)
},
// 删除
handleDelete(row) {
this.$confirm('是否要删除该数据', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
center: true,
type: 'warning'
}).then(() => {
deleteStall({ id: row.id }).then(res => {
this.$message({
message: '删除成功',
type: 'success',
duration: 1000
})
this.getList()
})
})
},
//请求列表数据
getList() {
this.listLoading = true
getStallList(this.listQuery).then(res => {
this.listLoading = false
this.list = res.data.list
this.total = Number(res.data.total)
}).catch(err => {
this.listLoading = false
})
}
}
}
</script>
<style scoped>
.operate-container {
text-align: right;
margin-top: 0;
margin-bottom: 20px;
}
</style>
<template>
<el-dialog :visible.sync="visible"
:title="title"
center
width="800px">
<!-- 内容布局 -->
<div class="scroll-container">
<!-- 档口市场信息 -->
<el-form :model="model"
class="section"
size="small"
ref="ruleForm"
v-loading="loading"
label-width="200px">
<el-form-item label="档口名称:"
prop="pmsStallPositionManage.name"
:rules="[{ required: true, trigger: 'blur', message: '档口名称不能为空' }]">
<el-input placeholder="请输入档口名称"
v-model="model.pmsStallPositionManage.name"></el-input>
</el-form-item>
<el-form-item label="所在地区:"
prop="area"
:rules="[{ required: true, trigger: 'change', message: '所在地区不能为空' }]">
<el-cascader v-model="model.area"
size="small"
expand-trigger="hover"
:props="props"></el-cascader>
</el-form-item>
<el-form-item label="详细地址:"
prop="pmsStallPositionManage.addressDetail">
<el-input placeholder="请输入详细地址"
v-model="model.pmsStallPositionManage.addressDetail"></el-input>
</el-form-item>
<el-form-item label="经营类目:"
prop="pmsStallPositionManage.businessCategory"
:rules="[{ required: true, trigger: 'blur', message: '经营类目不能为空' }]">
<el-input placeholder="请输入经营类目"
v-model="model.pmsStallPositionManage.businessCategory"></el-input>
</el-form-item>
<el-form-item label="档口分区:"
prop="stallName">
<el-input placeholder="请输入档口分区"
type="textarea"
:rows="5"
v-model="model.stallName"></el-input>
<label class="font"
style="position:absolute;
margin-left:20px;
color:#8080809e">
一行一个区域,<br>例如一层A区</label>
</el-form-item>
<el-form-item label="上传档口宣传图片:"
prop="pmsStallPositionManage.pic"
:rules="[{ required: true, trigger: 'blur', message: '广告图片不能为空' }]">
<single-upload v-model="model.pmsStallPositionManage.pic"></single-upload>
<div class="remark">
<div class="uploadRemark">图片不能超过1M,图片格式为jpg/png</div>
</div>
</el-form-item>
</el-form>
</div>
<!-- 底部操作栏 -->
<div slot="footer">
<el-button type="primary"
size="medium"
@click="submit">保存</el-button>
</div>
<!-- end -->
</el-dialog>
</template>
<script>
import { fetchAreaList } from '@/api/area'
import { createStall, updateStall, stallInfo } from '@/api/siteManagement'
import SingleUpload from '@/components/Upload/singleUpload'
const defaultModel = {
pmsStallPositionManage: {
id: null,
name: null,
addressDetail: null,
businessCategory: null,
pic: null,
},
area: [],
stallName: ''
}
export default {
name: 'siteModal',
components: {
SingleUpload
},
data() {
return {
visible: false,
title: null,
loading: false,
model: Object.assign({}, defaultModel),
fileList: [],
//添加地区级联
props: {
lazy: true,
lazyLoad(row, resolve) {
if (row.level == 0) {
row.value = 0
}
fetchAreaList({
parentId: row.value
}).then(res => {
let list = res.data
list.map(item => {
item.value = item.id
item.label = item.areaName
item.leaf = item.areaType >= 3
})
resolve(list)
})
}
},
}
},
methods: {
//上传档口宣传图片
handleChange(file, fileList) {
this.file = fileList
},
//数据添加处理
add() {
this.model = Object.assign({}, defaultModel)
this.visible = true
this.title = '添加档口市场'
},
detail(data) {
let row = Object.assign({}, data)
this.model = {
pmsStallPositionManage: row,
stallName: row.stallArea ? row.stallArea.split(',').join('\n') : '',
area: [row.provinceId, row.cityId, row.areaId]
}
this.visible = true
this.title = '编辑档口市场'
},
submit() {
// 提交保存
this.$refs.ruleForm.validate((valid) => {
if (valid) {
//验证通过
this.loading = true
//定义对象获取档口分区名称
let stallAreas = []
let names = this.model.stallName.split("\n")
names.forEach((item) => {
stallAreas.push({ name: item })
})
this.model.stallAreas = stallAreas
this.model.pmsStallPositionManage.provinceId = this.model.area[0]
this.model.pmsStallPositionManage.cityId = this.model.area[1]
this.model.pmsStallPositionManage.areaId = this.model.area[2]
//判断修改或添加
if (this.model.pmsStallPositionManage.id) {
//修改数据
updateStall(this.model).then(res => {
this.loading = false
this.visible = false
this.$emit('ok')
}).catch(err => {
this.loading = false
})
} else {
//添加档口市场
this.loading = true
createStall(this.model).then(res => {
this.loading = false
this.visible = false
this.$emit('ok')
}).catch(err => {
this.loading = false
})
}
}
})
},
//获取省市区
getArea(id) {
fetchAreaList({ parentId: id }).then(res => {
let data = res.data
if (id == 0) {
this.province = data
} else {
this.cities = data
}
})
},
close() {
this.$emit('close')
this.visible = false
}
}
}
</script>
<style scoped>
.scroll-container {
max-height: 50vh;
overflow: hidden;
overflow-y: auto;
}
.section .el-input,
.section .el-textarea,
.section .el-select,
.section .el-cascader {
width: 400px;
}
.operation {
text-align: center;
}
.remark {
display: flex;
flex-direction: column;
font-family: "微软雅黑";
font-size: 12px;
color: #999999;
margin-top: 10px;
}
.remark div {
line-height: 1.8;
}
.uploadRemark {
font-family: "微软雅黑";
font-size: 12px;
color: #999999;
}
</style>
\ No newline at end of file
<template>  <template> 
<el-card class="form-container" shadow="never"> <el-card class="form-container" shadow="never">
<el-form :model="orderSetting" <el-form :model="setting"
ref="orderSettingForm" ref="orderSettingForm"
:rules="rules"> :rules="rules">
<el-form-item prop="orderTimeout"> <el-form-item prop="stockWarning">
<div>物品数量少于多少预警(个/件):</div> <div>物品数量少于多少预警(个/件):</div>
<el-input v-model="orderSetting.orderTimeout" class="input-width"> <el-input v-model="setting.stockWarning" class="input-width">
</el-input> </el-input>
</el-form-item> </el-form-item>
<el-form-item prop="receiveTimeout"> <el-form-item prop="receiveInterval">
<div>物品领用间隔时间(小时):</div> <div>物品领用间隔时间(小时):</div>
<el-input v-model="orderSetting.receiveTimeout" class="input-width"> <el-input v-model="setting.receiveInterval" class="input-width">
</el-input> </el-input>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
...@@ -22,33 +22,42 @@ ...@@ -22,33 +22,42 @@
</el-card> </el-card>
</template> </template>
<script> <script>
import {getOrderSetting,updateOrderSetting} from '@/api/orderSetting'; import {getSetting,editSetting} from '@/api/setting';
const defaultOrderSetting = { const defaultOrderSetting = {
id: null, id: null,
orderTimeout: 0, stockWarning: 0,
receiveTimeout: 0, receiveInterval: 0
finishTimeout: 0,
}; };
const checkTime = (rule, value, callback) => { const checkTime = (rule, value, callback) => {
if (!value) { if (value === '') {
return callback(new Error('时间不能为空')); callback(new Error('请输入'))
} } else {
console.log("checkTime",value); let myReg = /^\d{1,}$/
let intValue = parseInt(value); if (!myReg.test(value)) {
if (!Number.isInteger(intValue)) { callback(new Error('请输入数字值'))
return callback(new Error('请输入数字值')); }
callback()
} }
callback(); }
}; // const checkTime = (rule, value, callback) => {
// if (!value) {
// return callback(new Error('时间不能为空'));
// }
// console.log("checkTime",value);
// let intValue = parseInt(value);
// if (!Number.isInteger(intValue)) {
// return callback(new Error('请输入数字值'));
// }
// callback();
// };
export default { export default {
name: 'setting', name: 'setting',
data() { data() {
return { return {
orderSetting: Object.assign({}, defaultOrderSetting), setting: Object.assign({}, defaultOrderSetting),
rules: { rules: {
orderTimeout:{validator: checkTime, trigger: 'blur' }, stockWarning:{validator: checkTime, trigger: 'blur' },
receiveTimeout: {validator: checkTime, trigger: 'blur' }, receiveInterval: {validator: checkTime, trigger: 'blur' }
finishTimeout: {validator: checkTime, trigger: 'blur' }
} }
} }
}, },
...@@ -64,7 +73,7 @@ export default { ...@@ -64,7 +73,7 @@ export default {
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
updateOrderSetting(this.orderSetting).then(response=>{ editSetting(this.setting).then(response=>{
this.$message({ this.$message({
type: 'success', type: 'success',
message: '提交成功!', message: '提交成功!',
...@@ -82,8 +91,14 @@ export default { ...@@ -82,8 +91,14 @@ export default {
}); });
}, },
getDetail(){ getDetail(){
getOrderSetting().then(response=>{ getSetting().then(res=>{
this.orderSetting=response.data; if(res.data){
this.setting={
id: res.data.id,
receiveInterval: res.data.receiveInterval,
stockWarning: res.data.stockWarning
}
}
}) })
} }
} }
......
...@@ -44,11 +44,11 @@ ...@@ -44,11 +44,11 @@
align="center"> align="center">
<template slot-scope="scope">{{scope.row.description}}</template> <template slot-scope="scope">{{scope.row.description}}</template>
</el-table-column> </el-table-column>
<el-table-column label="用户数" <!-- <el-table-column label="用户数"-->
width="100" <!-- width="100"-->
align="center"> <!-- align="center">-->
<template slot-scope="scope">{{scope.row.adminCount}}</template> <!-- <template slot-scope="scope">{{scope.row.adminCount}}</template>-->
</el-table-column> <!-- </el-table-column>-->
<el-table-column label="添加时间" <el-table-column label="添加时间"
width="160" width="160"
align="center"> align="center">
......
...@@ -62,9 +62,9 @@ ...@@ -62,9 +62,9 @@
width="220" width="220"
align="center"> align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button size="mini" <!-- <el-button size="mini"-->
type="success" <!-- type="success"-->
@click="addDepot(scope.row)">添加库房</el-button> <!-- @click="addDepot(scope.row)">添加库房</el-button>-->
<el-button size="mini" <el-button size="mini"
type="success" type="success"
@click="lookDetail(scope.row)">删除</el-button> @click="lookDetail(scope.row)">删除</el-button>
...@@ -94,8 +94,8 @@ ...@@ -94,8 +94,8 @@
</template> </template>
<script> <script>
import moment from 'moment' import moment from 'moment'
import { getSupplier, getAuditDetail, updateMcht } from '@/api/audit' import { getSupplier, getAuditDetail, updateMcht } from '@/api/admin'
import AddDepot from './modules/AddDepot' import AddDepot from './modules/AddAdmin'
// 列表查询参数默认值 // 列表查询参数默认值
const defaultListQuery = { const defaultListQuery = {
pageNum: 1, pageNum: 1,
......
...@@ -12,24 +12,26 @@ ...@@ -12,24 +12,26 @@
placeholder="请输入用户名称"></el-input> placeholder="请输入用户名称"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="部门:"> <el-form-item label="部门:">
<el-select v-model="listQuery.status" <el-select v-model="listQuery.departId"
class="input-width" class="input-width"
clearable clearable
placeholder="请选择部门"> placeholder="请选择部门">
<el-option v-for="item in statusOptions" <el-option v-for="item in departmentOptions"
:key="item.value" :key="item.id"
:label="item.label" :label="item.name"
:value="item.value"></el-option> :value="item.id"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" <el-button type="primary"
@click="handleSearchList" @click="handleSearchList"
icon="el-icon-search" icon="el-icon-search"
size="small">搜索</el-button> size="small">搜索
</el-button>
<el-button @click="handleResetSearch" <el-button @click="handleResetSearch"
icon="el-icon-refresh" icon="el-icon-refresh"
size="small">重置</el-button> size="small">重置
</el-button>
</el-form-item> </el-form-item>
<el-button class="btn-add" <el-button class="btn-add"
size="small" size="small"
...@@ -51,19 +53,19 @@ ...@@ -51,19 +53,19 @@
width="50"></el-table-column> width="50"></el-table-column>
<el-table-column label="姓名" <el-table-column label="姓名"
align="center"> align="center">
<template slot-scope="scope">{{scope.row.username}}</template> <template slot-scope="scope">{{scope.row.name}}</template>
</el-table-column> </el-table-column>
<el-table-column label="AD用户" <el-table-column label="AD用户"
align="center"> align="center">
<template slot-scope="scope">{{scope.row.phone || '--'}}</template> <template slot-scope="scope">{{scope.row.jobNo || '--'}}</template>
</el-table-column> </el-table-column>
<el-table-column label="部门" <el-table-column label="部门"
align="center"> align="center">
<template slot-scope="scope">{{scope.row.email || '--'}}</template> <template slot-scope="scope">{{scope.row.departName || '--'}}</template>
</el-table-column> </el-table-column>
<el-table-column label="联系方式" <el-table-column label="联系方式"
align="center"> align="center">
<template slot-scope="scope">{{scope.row.status | formatStatus}}</template> <template slot-scope="scope">{{scope.row.phone}}</template>
</el-table-column> </el-table-column>
<el-table-column label="操作" <el-table-column label="操作"
width="220" width="220"
...@@ -71,7 +73,8 @@ ...@@ -71,7 +73,8 @@
<template slot-scope="scope"> <template slot-scope="scope">
<el-button size="mini" <el-button size="mini"
type="success" type="success"
@click="lookDetail(scope.row)">设置为管理员</el-button> @click="handleSet(scope.row)">设置为管理员
</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
...@@ -91,44 +94,31 @@ ...@@ -91,44 +94,31 @@
</el-card> </el-card>
<!-- end --> <!-- end -->
<!-- 弹窗 --> <!-- 弹窗 -->
<add-supplier ref="addSupplier" <add-admin ref="addAdmin"
@ok="getList"></add-supplier> @ok="getList"></add-admin>
<!-- end --> <!-- end -->
</div> </div>
</template> </template>
<script> <script>
import moment from 'moment' import moment from 'moment'
import { getSupplier, getAuditDetail, updateMcht } from '@/api/audit' import { getMemberList, getAuditDetail, updateMcht } from '@/api/user'
import AddSupplier from './modules/AddAdmin' import { getDepartmentList} from '@/api/inventory'
import AddAdmin from './modules/AddAdmin'
// 列表查询参数默认值 // 列表查询参数默认值
const defaultListQuery = { const defaultListQuery = {
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
accouuntType: 0, name: null,
name: '', departId: null
phone: '',
status: ''
} }
// 账号状态数据
const defaultStatusOptions = [
{
label: '启用',
value: 1
},
{
label: '禁用',
value: 0
}
]
// 管理员入驻账号列表
export default { export default {
name: 'UserList', name: 'UserList',
components: {AddSupplier}, components: { AddAdmin },
data() { data() {
return { return {
departmentOptions: [],
listQuery: Object.assign({}, defaultListQuery), listQuery: Object.assign({}, defaultListQuery),
statusOptions: defaultStatusOptions,
list: [], list: [],
total: 0, total: 0,
listLoading: false, listLoading: false,
...@@ -137,6 +127,7 @@ export default { ...@@ -137,6 +127,7 @@ export default {
}, },
created() { created() {
this.getList() this.getList()
this.getDepartmentList()
}, },
filters: { filters: {
formatTime(time) { formatTime(time) {
...@@ -144,19 +135,14 @@ export default { ...@@ -144,19 +135,14 @@ export default {
return '--' return '--'
} }
return moment(time).format('YYYY-MM-DD HH:mm:ss') return moment(time).format('YYYY-MM-DD HH:mm:ss')
},
formatStatus(status) {
if (status == 0) {
return '禁用'
} else {
return '启用'
}
} }
}, },
methods: { methods: {
// 添加管理员 // 部门
handleAdd () { getDepartmentList() {
this.$refs.addSupplier.add() getDepartmentList().then(res => {
this.departmentOptions = res.data.list
})
}, },
handleResetSearch() { handleResetSearch() {
this.listQuery = Object.assign({}, defaultListQuery) this.listQuery = Object.assign({}, defaultListQuery)
...@@ -182,7 +168,7 @@ export default { ...@@ -182,7 +168,7 @@ export default {
getList() { getList() {
this.listLoading = true this.listLoading = true
//请求数据 //请求数据
getSupplier(this.listQuery).then(res => { getMemberList(this.listQuery).then(res => {
this.listLoading = false this.listLoading = false
this.list = res.data.list this.list = res.data.list
this.total = res.data.total this.total = res.data.total
...@@ -190,45 +176,13 @@ export default { ...@@ -190,45 +176,13 @@ export default {
this.listLoading = false this.listLoading = false
}) })
}, },
handleStatus(row) { // 添加管理员
// 账号禁用 handleAdd() {
if (row.status == 0) { this.$refs.addSupplier.add()
this.$confirm('确定启用该账号', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
//启用接口
this.updateMcht(row, 1)
})
} else if (row.status == 1) {
this.$confirm('确定禁用该账号?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
//禁用接口
this.updateMcht(row, 0)
})
}
},
//管理员账户启用/禁用
updateMcht(row, status) {
let params = { id: row.id, status: status }
updateMcht(params).then(res => {
this.$message.success(status == 1 ? '启用成功' : '禁用成功')
this.getList()
})
},
// 查看
lookDetail(row) {
row.audit = false
row.flag = true
this.$router.push({ name: 'distributorDetail', params: row })
}, },
//编辑 // 设置为管理员
editDetail(id) { handleSet(row) {
this.$refs.addSupplier.detail(id) this.$refs.addAdmin.add(row)
} }
} }
} }
......
...@@ -10,85 +10,49 @@ ...@@ -10,85 +10,49 @@
label-width="200px"> label-width="200px">
<div class="scroll-container" <div class="scroll-container"
ref="scrollContainer"> ref="scrollContainer">
<el-form-item label="管理员名称:" <el-form-item label="用户名称:"
:rules="[{required: true, trigger: 'blur', message: '管理员名称不能为空'}]" prop="username"
prop="name"> :rules="[{ required: true, message: '用户名称不能为空', trigger: 'blur' }]">
<el-input size="small" <el-input v-model="model.username"
class="input-width" :disabled="isEdit"
v-model="model.name"></el-input> class="input-width"></el-input>
<div class="tip">可使用手机号作为用户名称</div>
</el-form-item> </el-form-item>
<el-form-item label="管理员账号:" <el-form-item label="登录密码:"
:rules="[{required: true, trigger: 'blur', message: '管理员账号不能为空'}]"
prop="username">
<el-input size="small"
class="input-width"
v-model="model.username"></el-input>
</el-form-item>
<el-form-item label="手机号:"
:rules="[ {
required: true,
validator: validatePhone,
trigger: 'blur'
}]"
prop="phone">
<el-input size="small"
class="input-width"
v-model="model.phone"></el-input>
</el-form-item>
<el-form-item
v-if="!this.id"
label="密码:"
prop="password" prop="password"
:rules="[{ required: true, trigger: 'blur', message: '密码不能为空' }]"> :rules="[{ required: true, message: '登录密码不能为空', trigger: 'blur' }]">
<el-input size="small" <el-input
class="input-width" :maxlength="6"
v-model="model.password" v-model="model.password"
show-password type="password"
auto-complete="new-password"></el-input> auto-complete="new-password"
class="input-width"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="邮箱:" <el-form-item label="库房:"
:rules="[ prop="stockRoomId"
{ required: true, message: '请输入邮箱地址', trigger: 'blur' }, :rules="[{ required: true, trigger: 'change', message: '请选择库房' }]">
{ type: 'email', message: '请输入正确的邮箱地址', trigger: ['blur', 'change'] } <el-select size="small"
]" class="input-width"
prop="email"> v-model="model.stockRoomId">
<el-input size="small" <el-option
class="input-width" v-for="item in depotOptions"
v-model="model.email"></el-input> :key="item.id"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
</el-form-item> </el-form-item>
<el-form-item label="说明:" <el-form-item label="角色分配:"
prop="personalizedSignature"> prop="roleId"
<el-input size="small" :rules="[{ required: true, message: '角色不能为空', trigger: 'change' }]">
type="textarea" <el-select v-model="model.roleId"
class="input-width" class="input-width">
v-model="model.personalizedSignature"></el-input> <el-option v-for="item in allRoleList"
:key="item.id"
:label="item.name"
:value="item.id"></el-option>
</el-select>
</el-form-item> </el-form-item>
<!-- <el-form-item label="结算方式:"-->
<!-- prop="payType">-->
<!-- <el-select size="small"-->
<!-- class="input-width"-->
<!-- v-model="model.payType">-->
<!-- <el-option-->
<!-- v-for="item in payOptions"-->
<!-- :key="item.value"-->
<!-- :label="item.label"-->
<!-- :value="item.value">-->
<!-- </el-option>-->
<!-- </el-select>-->
<!-- </el-form-item>-->
<!-- <el-form-item label="结算周期:"-->
<!-- prop="cycleType">-->
<!-- <el-select size="small"-->
<!-- class="input-width"-->
<!-- v-model="model.cycleType">-->
<!-- <el-option-->
<!-- v-for="item in cycleOptions"-->
<!-- :key="item.value"-->
<!-- :label="item.label"-->
<!-- :value="item.value">-->
<!-- </el-option>-->
<!-- </el-select>-->
<!-- </el-form-item>-->
</div> </div>
</el-form> </el-form>
<div slot="footer"> <div slot="footer">
...@@ -101,100 +65,105 @@ ...@@ -101,100 +65,105 @@
</el-dialog> </el-dialog>
</template> </template>
<script> <script>
import { addMember, getSupplierDetail,updateMcht } from '@/api/audit' import { setUpAdmin } from '@/api/user'
import { fetchAllRoleList } from '@/api/role'
import { getStockRooms } from '@/api/inventory'
// 添加编辑属性 // 添加编辑属性
export default { export default {
name: 'AddAdmin', name: 'AddAdmin',
data () { data() {
const validatePhone = (rule, value, callback) => {
if (value === '') {
callback(new Error('请填写手机号码'))
} else {
if (!(/^1(3|4|5|6|7|8|9)\d{9}$/.test(value))) {
callback(new Error('手机号码格式有误'))
} else {
callback()
}
}
}
return { return {
allRoleList: [],
depotOptions: [],
visible: false, visible: false,
title: null, title: null,
loading: false, loading: false,
id: null, id: null,
model: {}, model: {},
validatePhone: validatePhone, isEdit: false
cycleOptions: [{ value: 1, label: '7天' }, { value: 2, label: '15天' }, { value: 3, label: '30天' }],
payOptions: [{ value: 1, label: '指定账期1' }, { value: 2, label: '指定账期2' }, { value: 3, label: '指定账期3' }]
} }
}, },
methods: { methods: {
init () { // 库房
this.model = { getStockRooms() {
phone: null, getStockRooms().then(res => {
username: null, this.depotOptions = res.data.list
name: null, })
password:null, },
accouuntType: 0, // 角色分配
personalizedSignature: null, fetchAllRoleList() {
email: null fetchAllRoleList().then(response => {
} this.allRoleList = response.data
})
},
init() {
this.fetchAllRoleList()
this.getStockRooms()
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.myForm.clearValidate() this.$refs.myForm.clearValidate()
this.$refs.scrollContainer.scrollTop = 0 this.$refs.scrollContainer.scrollTop = 0
}) })
}, },
add () { add(row) {
this.id = null this.id = null
this.init()
this.visible = true this.visible = true
this.title = '添加管理员'
},
detail (id) {
this.id = id
this.init() this.init()
this.visible = true this.model = {
this.title = '编辑管理员' departId: row.departId,
this.loading = true roleId: null,
getSupplierDetail({ id: id }).then(res => { stockRoomId: null,
this.model = res.data password: null,
this.loading = false username: null,
}).catch(err => { id: row.id,
this.loading = false memberId: row.id
this.close() }
}) this.title = '设置管理员'
}, },
// detail(id) {
// this.id = id
// this.init()
// this.visible = true
// this.title = '编辑管理员'
// this.loading = true
// getSupplierDetail({ id: id }).then(res => {
// this.model = res.data
// this.loading = false
// }).catch(err => {
// this.loading = false
// this.close()
// })
// },
// 提交保存 // 提交保存
submit () { submit() {
this.$refs.myForm.validate((valid) => { this.$refs.myForm.validate((valid) => {
if (valid) { if (valid) {
// 验证通过 // 验证通过
if (this.id) { // if (this.id) {
// 修改属性 // // 修改属性
this.loading = true // this.loading = true
updateMcht(this.model).then(res => { // updateMcht(this.model).then(res => {
this.loading = false // this.loading = false
this.visible = false // this.visible = false
this.$emit('ok') // this.$emit('ok')
}).catch(err => { // }).catch(err => {
this.loading = false // this.loading = false
}) // })
} else { // } else {
// 添加属性 // 添加属性
this.loading = true this.loading = true
addMember(this.model).then(res => { setUpAdmin(this.model).then(res => {
this.loading = false this.loading = false
this.visible = false this.visible = false
this.$emit('ok') this.$emit('ok')
}).catch(err => { }).catch(err => {
this.loading = false this.loading = false
}) })
} // }
} }
}) })
}, },
close () { close() {
this.$emit('close') this.$emit('close')
this.visible = false this.visible = false
} }
...@@ -214,6 +183,7 @@ export default { ...@@ -214,6 +183,7 @@ export default {
.tip { .tip {
color: #999; color: #999;
font-size: 12px; font-size: 10px;
line-height: 30px;
} }
</style> </style>
<template>
<el-dialog :visible.sync="visible"
:title="title"
center
width="720px">
<!-- start -->
<el-form :model="model"
ref="myForm"
v-loading="loading"
label-width="200px">
<div class="scroll-container"
ref="scrollContainer">
<el-form-item label="库房:"
prop="cycleType"
:rules="[{ required: true, trigger: 'blur', message: '请选择库房' }]">
<el-select size="small"
class="input-width"
v-model="model.cycleType">
<el-option
v-for="item in cycleOptions"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</el-form-item>
</div>
</el-form>
<div slot="footer">
<el-button type="primary"
@click="submit">确认
</el-button>
<el-button @click="close">取消</el-button>
</div>
<!-- end -->
</el-dialog>
</template>
<script>
import { addMember, getSupplierDetail,updateMcht } from '@/api/audit'
// 添加编辑属性
export default {
name: 'AddAdmin',
data () {
return {
visible: false,
title: null,
loading: false,
id: null,
model: {},
cycleOptions: [{ value: 1, label: '7天' }, { value: 2, label: '15天' }, { value: 3, label: '30天' }]
}
},
methods: {
init () {
this.model = {
cycleType: null
}
this.$nextTick(() => {
this.$refs.myForm.clearValidate()
this.$refs.scrollContainer.scrollTop = 0
})
},
add () {
this.id = null
this.init()
this.visible = true
this.title = '添加库房'
},
detail (id) {
this.id = id
this.init()
this.visible = true
this.title = '编辑管理员'
this.loading = true
getSupplierDetail({ id: id }).then(res => {
this.model = res.data
this.loading = false
}).catch(err => {
this.loading = false
this.close()
})
},
// 提交保存
submit () {
this.$refs.myForm.validate((valid) => {
if (valid) {
// 验证通过
if (this.id) {
// 修改属性
this.loading = true
updateMcht(this.model).then(res => {
this.loading = false
this.visible = false
this.$emit('ok')
}).catch(err => {
this.loading = false
})
} else {
// 添加属性
this.loading = true
addMember(this.model).then(res => {
this.loading = false
this.visible = false
this.$emit('ok')
}).catch(err => {
this.loading = false
})
}
}
})
},
close () {
this.$emit('close')
this.visible = false
}
}
}
</script>
<style scoped>
.scroll-container {
max-height: 50vh;
overflow: hidden;
overflow-y: auto;
}
.input-width {
width: 300px;
}
.tip {
color: #999;
font-size: 12px;
}
</style>
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