27 changed files with 435 additions and 26 deletions
-
2canvas-container/assets/font_icon/iconfont.json
-
2src/api/commodity.js
-
46src/api/sharesetting.js
-
2src/components/basics/couponTable.vue
-
2src/components/basics/productTable.vue
-
9src/styles/elDialog.scss
-
2src/views/active/couponlist/index.vue
-
2src/views/active/discountlist/index.vue
-
2src/views/active/index.vue
-
2src/views/active/politelist/index.vue
-
2src/views/active/seckilllist/index.vue
-
2src/views/ad/coverConfig/index.vue
-
2src/views/comment/commentSys/index.vue
-
2src/views/comment/keyword/index.vue
-
2src/views/customer/customerMage/index.vue
-
4src/views/customer/tips/index.vue
-
2src/views/finance/application/index.vue
-
2src/views/finance/bond/index.vue
-
2src/views/finance/overview/index.vue
-
2src/views/integral/record.vue
-
2src/views/member/memberList/index.vue
-
4src/views/member/tips/index.vue
-
2src/views/notice/history.vue
-
2src/views/renovation/commoditySystem/index.vue
-
2src/views/risk/IPBlacklist/index.vue
-
2src/views/risk/userBlacklist/index.vue
-
354src/views/sharesetting/index.vue
@ -0,0 +1,46 @@ |
|||
import request from '@/utils/request' |
|||
|
|||
// 分账设置管理查询
|
|||
export function sharesettingGetall(data) { |
|||
return request({ |
|||
url: '/sharesetting/getAll', |
|||
method: 'post', |
|||
data |
|||
}) |
|||
} |
|||
|
|||
// 分账设置详情查询
|
|||
export function sharesettingGetById(data) { |
|||
return request({ |
|||
url: '/sharesetting/getById', |
|||
method: 'post', |
|||
data |
|||
}) |
|||
} |
|||
|
|||
// 修改分账设置
|
|||
export function sharesettingSave(data) { |
|||
return request({ |
|||
url: '/sharesetting/save', |
|||
method: 'post', |
|||
data |
|||
}) |
|||
} |
|||
|
|||
// 修改分账设置
|
|||
export function sharesettingUpdate(data) { |
|||
return request({ |
|||
url: '/sharesetting/update', |
|||
method: 'post', |
|||
data |
|||
}) |
|||
} |
|||
|
|||
// 删除分账设置
|
|||
export function sharesettingDelete(data) { |
|||
return request({ |
|||
url: '/sharesetting/delete', |
|||
method: 'post', |
|||
data |
|||
}) |
|||
} |
@ -0,0 +1,354 @@ |
|||
<template> |
|||
<div class="comment_manage_page"> |
|||
<div class="content"> |
|||
<el-tabs v-model="formParams.shareSettingTargetTypeStr" @tab-click="selectItem"> |
|||
<el-tab-pane |
|||
v-for="(item, index) in tabList" |
|||
:key="index" |
|||
:label="item.name" |
|||
:name="item.id.toString()" |
|||
/> |
|||
</el-tabs> |
|||
<div class="toolbar"> |
|||
<el-form :inline="true" :model="formParams"> |
|||
<el-form-item> |
|||
<el-button type="primary" @click="insert">新增</el-button> |
|||
</el-form-item> |
|||
</el-form> |
|||
</div> |
|||
|
|||
<div class="content_table"> |
|||
<div class="table"> |
|||
<el-table :data="tableData" border style="width: 100%" :header-cell-style="{ background: '#EEF3FF', color: '#333333' }"> |
|||
<el-table-column label="Logo" > |
|||
<template slot-scope="scope"> |
|||
<img width="80" |
|||
height="80" |
|||
:src="scope.row.avater" |
|||
> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column prop="name" label="名称" /> |
|||
<el-table-column prop="shareRate" label="分账抽成比例" > |
|||
<template slot-scope="scope"> |
|||
<span>{{scope.row.shareRate}}%</span> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column prop="shareCalcType" label="分账抽成方式" > |
|||
<template slot-scope="scope"> |
|||
<span v-if="scope.row.shareCalcType == 1">按成本</span> |
|||
<span v-if="scope.row.shareCalcType == 0">按销售额</span> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column label="操作"> |
|||
<template slot-scope="scope"> |
|||
<el-button type="text" @click="details(scope.row)">编辑</el-button> |
|||
<el-button type="text" @click="deletes(scope.row.shareSettingId)">删除</el-button> |
|||
</template> |
|||
</el-table-column> |
|||
</el-table> |
|||
<div class="fenye"> |
|||
<el-pagination |
|||
:current-page="currentPage" |
|||
:page-sizes="[10, 20, 50, 100]" |
|||
:page-size="10" |
|||
layout="total, sizes, prev, pager, next, jumper" |
|||
:total="total" |
|||
@size-change="handleSizeChange" |
|||
@current-change="handleCurrentChange" |
|||
/> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<!-- ******************************************************弹框开始***************************************************************** --> |
|||
<!-- 新增或者编辑评论弹框 --> |
|||
<el-dialog |
|||
:title="addForm.shareSettingId && addForm.shareSettingId > 0 ? '修改分账比例设置' : '新增分账比例设置'" |
|||
:visible.sync="dialogVisible" |
|||
:close-on-click-modal="false" |
|||
:before-close="handleClose" |
|||
width="60%" |
|||
center |
|||
> |
|||
<div> |
|||
<el-form :model="addForm" label-width="100px"> |
|||
<el-form-item v-if="addForm.shareTargetType != 1" |
|||
:label="addForm.shareTargetType == 1 ? '商品分类Id' : (addForm.shareTargetType == 2 ? '商家Id' : '商品Id')" prop="shareTargetId"> |
|||
|
|||
<el-input v-model="addForm.shareTargetId" type="number" maxlength="20" |
|||
:placeholder="addForm.shareTargetType == 1 ? '请输入商品分类Id' : (addForm.shareTargetType == 2 ? '请输入商家Id' : '请输入商品Id')" /> |
|||
</el-form-item> |
|||
<el-form-item label="商品分类" v-else prop="classifyId"> |
|||
<el-cascader |
|||
v-model="addForm.classifyId" |
|||
:options="classifyList" |
|||
clearable |
|||
:props="{ |
|||
checkStrictly: false, |
|||
label:'categoryName', |
|||
value:'id', |
|||
children:'childs' |
|||
}" |
|||
@change="handleChangeCascader" |
|||
/> |
|||
</el-form-item> |
|||
<el-form-item label="分账方式" prop="shareCalcType" style="display:none"> |
|||
<el-radio-group v-model="addForm.shareCalcType"> |
|||
<el-radio :label="1">按利润</el-radio> |
|||
<el-radio :label="0">按销售额</el-radio> |
|||
</el-radio-group> |
|||
</el-form-item> |
|||
<el-form-item label="分账比例" prop="shareRate"> |
|||
<template slot-scope="scope"> |
|||
<!-- <el-input v-model="scope.row.price" type="number" oninput="value=value.replace(/-/, '')" /> --> |
|||
<el-input-number v-model="addForm.shareRate" :controls="true" :max="100" :min="0" :precision="4" :step="0.0001" /> |
|||
</template> |
|||
</el-form-item> |
|||
</el-form> |
|||
</div> |
|||
<span slot="footer" class="dialog-footer"> |
|||
<el-button @click="dialogVisible = false">取 消</el-button> |
|||
<el-button type="primary" @click="addForm_enter('ruleForm')">确 定</el-button> |
|||
</span> |
|||
|
|||
</el-dialog> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
import { |
|||
sharesettingGetall, |
|||
sharesettingGetById, |
|||
sharesettingSave, |
|||
sharesettingUpdate, |
|||
sharesettingDelete |
|||
} from '@/api/sharesetting' |
|||
import { |
|||
getClassify |
|||
} from '@/api/commodity' |
|||
export default { |
|||
data() { |
|||
return { |
|||
formParams : { |
|||
shareTargetType: 1, |
|||
shareSettingTargetTypeStr: "1", //分账设置目标类型,1:商品分类 2、商家 3、商品 |
|||
page: 1, |
|||
pageSize: 10 |
|||
}, |
|||
date: [], |
|||
tableData: [], |
|||
tabList: [ |
|||
{ name: '商品分类', id: 1 }, |
|||
{ name: '商家', id: 2 }, |
|||
{ name: '商品', id:3 } |
|||
], |
|||
total: 1, |
|||
currentPage: 1, |
|||
dialogVisible: false, |
|||
classifyList:[], |
|||
addForm:{ |
|||
shareSettingId:0, |
|||
name:"", |
|||
avater:"", |
|||
classifyId:0, |
|||
shareTargetId:0, |
|||
shareTargetType:0, |
|||
shareCalcType:0, |
|||
shareRate:0, |
|||
|
|||
} |
|||
} |
|||
}, |
|||
computed : { |
|||
}, |
|||
created() { |
|||
}, |
|||
mounted() { |
|||
this.getList(this.formParams) |
|||
this.selectClassifyList() |
|||
}, |
|||
methods: { |
|||
async selectClassifyList() { |
|||
const res = await getClassify() |
|||
this.classifyList = this.classifyFilterList(res.data) |
|||
}, |
|||
classifyFilterList(data) { |
|||
data.forEach(i => { |
|||
if (i.childs.length) { |
|||
this.classifyFilterList(i.childs) |
|||
} else { |
|||
i.childs = null |
|||
} |
|||
}) |
|||
return data |
|||
}, |
|||
handleChangeCascader() { |
|||
console.log(this.addForm.classifyId) |
|||
}, |
|||
handleSizeChange(val) { |
|||
this.formParams.pageSize = val |
|||
this.getList(this.formParams) |
|||
}, |
|||
handleCurrentChange(val) { |
|||
this.formParams.page = val |
|||
this.getList(this.formParams) |
|||
}, |
|||
selectItem(tab, event) { |
|||
this.formParams.shareSettingTargetTypeStr = tab.name |
|||
this.formParams.shareTargetType = parseInt(this.formParams.shareSettingTargetTypeStr) |
|||
this.getList(this.formParams) |
|||
}, |
|||
insert(){ |
|||
//点击新增 |
|||
this.addForm = { |
|||
shareSettingId:0, |
|||
name:"", |
|||
avater:"", |
|||
classifyId:0, |
|||
shareTargetId:0, |
|||
shareTargetType:this.formParams.shareTargetType, |
|||
shareCalcType:0, |
|||
shareRate:0, |
|||
} |
|||
this.dialogVisible = true |
|||
}, |
|||
async deletes(id) { |
|||
const res = await sharesettingDelete({ |
|||
shareSettingId: id |
|||
}) |
|||
if (res.code === '') { |
|||
this.$message.success('删除成功') |
|||
this.getList(this.formParams) |
|||
} |
|||
}, |
|||
// 详情 |
|||
async details(row) { |
|||
this.state = row.state |
|||
this.dialogVisible = true |
|||
const res = await commentSysGetById({ commentId: row.commentId }) |
|||
this.commentId = row.commentId |
|||
this.commentDetails = res.data |
|||
}, |
|||
// 确认新增字典 |
|||
addForm_enter(ruleForm) { |
|||
if(this.addForm.shareRate < 0){ |
|||
this.$message({ |
|||
message: '税率必须大于或者等于0', |
|||
type: 'warning' |
|||
}) |
|||
return false |
|||
} |
|||
if(this.addForm.shareRate > 100){ |
|||
this.$message({ |
|||
message: '税率必须小于或等于100', |
|||
type: 'warning' |
|||
}) |
|||
return false |
|||
} |
|||
|
|||
if(this.addForm.shareTargetType == 1){ |
|||
this.addForm.classifyId = Array.isArray(this.addForm.classifyId) ? this.addForm.classifyId[this.addForm.classifyId.length - 1] : this.addForm.classifyId |
|||
this.addForm.shareTargetId = this.addForm.classifyId |
|||
} |
|||
if (this.addForm.shareSettingId && this.addForm.shareSettingId > 0) { |
|||
sharesettingUpdate(this.addForm).then(res => { |
|||
console.log(res) |
|||
if (res.code === '') { |
|||
this.$message({ |
|||
message: '修改成功', |
|||
type: 'success' |
|||
}) |
|||
} |
|||
this.getList(this.formParams) |
|||
this.dialogVisible = false |
|||
}) |
|||
} else { |
|||
sharesettingSave(this.addForm).then(res => { |
|||
console.log(res) |
|||
if (res.code === '') { |
|||
this.$message({ |
|||
message: '新增成功', |
|||
type: 'success' |
|||
}) |
|||
} |
|||
this.getList(this.formParams) |
|||
this.dialogVisible = false |
|||
}) |
|||
|
|||
} |
|||
}, |
|||
handleClose() { |
|||
this.dialogVisible = false |
|||
}, |
|||
// 初始化查询所有数据 |
|||
async getList(formParams) { |
|||
const res = await sharesettingGetall(formParams) |
|||
this.tableData = res.data.list |
|||
this.total = res.data.total |
|||
} |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style lang='scss' scoped> |
|||
@import url("../../styles/elDialog.scss"); |
|||
.comment_manage_page { |
|||
padding: 20px; |
|||
background: #FFFFFF; |
|||
border-radius: 10px; |
|||
} |
|||
.pinStyle { |
|||
.comment { |
|||
margin-bottom: 20px; |
|||
display: flex; |
|||
align-items: center; |
|||
.com_left { |
|||
font-size: 20px; |
|||
color: #333333; |
|||
margin-right: 20px; |
|||
} |
|||
.com_right { |
|||
font-size: 18px; |
|||
color: #333333; |
|||
} |
|||
} |
|||
.comment_imgList { |
|||
display: flex; |
|||
margin-bottom: 20px; |
|||
align-items: center; |
|||
.img_left { |
|||
font-size: 20px; |
|||
color: #333333; |
|||
margin-right: 20px; |
|||
width: 60px; |
|||
} |
|||
.imgList { |
|||
display: flex; |
|||
justify-content: flex-start; |
|||
align-items: center; |
|||
flex-wrap: wrap; |
|||
.el-image { |
|||
width: 200px; |
|||
height: 134px; |
|||
border-radius: 4px; |
|||
margin-right: 20px; |
|||
margin-bottom: 20px; |
|||
} |
|||
} |
|||
} |
|||
.line { |
|||
width: 890px; |
|||
height: 1px; |
|||
background: #e0e5eb; |
|||
margin: 0 auto; |
|||
margin-bottom: 33px; |
|||
} |
|||
.addComment { |
|||
font-size: 20px; |
|||
color: #ff7911; |
|||
margin-bottom: 20px; |
|||
} |
|||
} |
|||
</style> |
|||
|
Write
Preview
Loading…
Cancel
Save
Reference in new issue