61 changed files with 1651 additions and 350 deletions
Before Width: | Height: | Size: 66 KiB After Width: | Height: | Size: 26 KiB |
@ -0,0 +1,15 @@ |
|||
{ |
|||
"$shared": { |
|||
"version": "v1", |
|||
"identifier": "wally", |
|||
"credential": "111111" |
|||
}, |
|||
"dev": { |
|||
"name": "dev", |
|||
"url": "http://192.168.0.99/gateway" |
|||
}, |
|||
"local": { |
|||
"version": "v2", |
|||
"url": "http://192.168.0.99/gateway" |
|||
} |
|||
} |
@ -0,0 +1,79 @@ |
|||
@dev = http://127.0.0.1:7270/v1.0/ |
|||
@test = https://test.tall.wiki/datang/v1.0/ |
|||
@www = http://www.tall.wiki/gateway/yanyuan/v2.0/ |
|||
@type = content-type: application/json;charset=utf-8 |
|||
|
|||
###网站轮播图查询 |
|||
POST {{test}}/carousel/query |
|||
{{type}} |
|||
|
|||
{ |
|||
"param":{ |
|||
"showPage":"0000" |
|||
} |
|||
} |
|||
|
|||
###列表查询 |
|||
GET {{test}}/content/list?showPage=0201&showPage=0210&year=&showType=1&pageNum=1&pageSize=5 |
|||
|
|||
###详情查询 |
|||
GET {{test}}/content/detail?introId=&showPage=0101 |
|||
|
|||
### 查询条件 |
|||
GET {{test}}/content/condition?showPage=0101 |
|||
### 查询常量 |
|||
GET {{test}}/constant/get?code=otherLink |
|||
|
|||
|
|||
-- 后台接口 |
|||
|
|||
### 登录 928bfd2577490322a6e19b793691467e |
|||
# @name login |
|||
POST {{test}}/back/home/login HTTP/1.1 |
|||
{{type}} |
|||
|
|||
{ |
|||
"userName":"admin", |
|||
"password": "123456" |
|||
} |
|||
|
|||
### 查询菜单 |
|||
POST {{test}}back/home/menus HTTP/1.1 |
|||
{{type}} |
|||
Authorization: {{login.response.body.$.data.token}} |
|||
|
|||
{ |
|||
|
|||
} |
|||
|
|||
|
|||
### 添加用户 |
|||
POST {{test}}/admin/add HTTP/1.1 |
|||
Authorization: {{login.response.body.$.data.token}} |
|||
{{type}} |
|||
|
|||
{ |
|||
"avatarUrl":"https://img2.baidu.com/it/u=1111829880,955526888&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=500", |
|||
"userName":"admin", |
|||
"password": "123456", |
|||
"realName":"张三", |
|||
"phone":"15500000000" |
|||
} |
|||
### 添加用户 |
|||
POST {{test}}/back/contentIntro/list HTTP/1.1 |
|||
{{type}} |
|||
|
|||
{ |
|||
|
|||
} |
|||
|
|||
### 查询轮播图列表 |
|||
POST {{test}}/back/carousel/queryCarousel HTTP/1.1 |
|||
Authorization: {{login.response.body.$.data.token}} |
|||
{{type}} |
|||
|
|||
{ |
|||
"pageNum": 1, |
|||
"pageSize":10, |
|||
"showPage":"" |
|||
} |
@ -0,0 +1,178 @@ |
|||
import request from '@/utils/request' |
|||
const carousel = '/back/carousel' |
|||
|
|||
/** |
|||
* 查询轮播图列表 |
|||
* @param params |
|||
* @returns {Promise<T | never>} |
|||
* @constructor |
|||
*/ |
|||
export function POST_QUERY_CAROUSEL(params) { |
|||
return request({ |
|||
url: `${carousel}/queryCarousel`, |
|||
method: 'post', |
|||
data:params |
|||
}).then(res => res.data.data) |
|||
} |
|||
|
|||
/** |
|||
* 删除轮播图 |
|||
* @param params |
|||
* @returns {Promise<T | never>} |
|||
* @constructor |
|||
*/ |
|||
export function POST_DELETE_CAROUSEL(params) { |
|||
return request({ |
|||
url: `${carousel}/deleteCarousel`, |
|||
method: 'post', |
|||
data:params |
|||
}).then(res => res.data.data) |
|||
} |
|||
|
|||
/** |
|||
* 设备分润 -- 分润详情 |
|||
* @param params |
|||
* @returns {Promise<T | never>} |
|||
* @constructor |
|||
*/ |
|||
export function DETAIL_EQUIPMENT_LIST(params) { |
|||
return request({ |
|||
url: "/api/admin/deviceRoyalties/detail", |
|||
method: 'get', |
|||
params |
|||
}).then(res => res.data.data) |
|||
} |
|||
|
|||
/** |
|||
* 设备分润 -- 分润总数 |
|||
* @param params |
|||
* @returns {Promise<T | never>} |
|||
* @constructor |
|||
*/ |
|||
export function COUNT_EQUIPMENT_LIST(params) { |
|||
return request({ |
|||
url: "/api/admin/deviceRoyalties/count", |
|||
method: 'get', |
|||
params |
|||
}).then(res => res.data.data) |
|||
} |
|||
|
|||
|
|||
/** |
|||
* 设备分润 -- 生效 |
|||
* @param params |
|||
* @returns {Promise<T | never>} |
|||
* @constructor |
|||
*/ |
|||
export function ENABLE_EQUIPMENT_LIST(params) { |
|||
return request({ |
|||
url: "/api/admin/deviceRoyalties/enable", |
|||
method: 'post', |
|||
params |
|||
}).then(res => res.data.data) |
|||
} |
|||
|
|||
|
|||
/** |
|||
* 设备分润 -- 失效 |
|||
* @param params |
|||
* @returns {Promise<T | never>} |
|||
* @constructor |
|||
*/ |
|||
export function DISABLE_EQUIPMENT_LIST(params) { |
|||
return request({ |
|||
url: "/api/admin/deviceRoyalties/disable", |
|||
method: 'post', |
|||
params |
|||
}).then(res => res.data.data) |
|||
} |
|||
|
|||
|
|||
|
|||
|
|||
|
|||
/** |
|||
* 场地分润 -- 列表 |
|||
* @param params |
|||
* @returns {Promise<T | never>} |
|||
* @constructor |
|||
*/ |
|||
export function GET_FIELD_LIST(params) { |
|||
return request({ |
|||
url: "/api/admin/locationRoyalties", |
|||
method: 'get', |
|||
params |
|||
}).then(res => res.data.data) |
|||
} |
|||
|
|||
/** |
|||
* 场地分润 -- 保存分润 |
|||
* @param params |
|||
* @returns {Promise<T | never>} |
|||
* @constructor |
|||
*/ |
|||
export function POST_FIELD_LIST(params) { |
|||
return request({ |
|||
url: "/api/admin/locationRoyalties", |
|||
method: 'post', |
|||
data:params |
|||
}).then(res => res.data.data) |
|||
} |
|||
|
|||
/** |
|||
* 场地分润 -- 分润总数 |
|||
* @param params |
|||
* @returns {Promise<T | never>} |
|||
* @constructor |
|||
*/ |
|||
export function COUNT_FIELD_LIST(params) { |
|||
return request({ |
|||
url: "/api/admin/locationRoyalties/count", |
|||
method: 'get', |
|||
params |
|||
}).then(res => res.data.data) |
|||
} |
|||
|
|||
/** |
|||
* 场地分润 -- 分润详情 |
|||
* @param params |
|||
* @returns {Promise<T | never>} |
|||
* @constructor |
|||
*/ |
|||
export function DETAIL_FIELD_LIST(params) { |
|||
return request({ |
|||
url: "/api/admin/locationRoyalties/detail", |
|||
method: 'get', |
|||
params |
|||
}).then(res => res.data.data) |
|||
} |
|||
|
|||
|
|||
/** |
|||
* 场地分润 -- 生效 |
|||
* @param params |
|||
* @returns {Promise<T | never>} |
|||
* @constructor |
|||
*/ |
|||
export function ENABLE_FIELD_LIST(params) { |
|||
return request({ |
|||
url: "/api/admin/locationRoyalties/enable", |
|||
method: 'get', |
|||
params |
|||
}).then(res => res.data.data) |
|||
} |
|||
|
|||
|
|||
/** |
|||
* 场地分润 -- 失效 |
|||
* @param params |
|||
* @returns {Promise<T | never>} |
|||
* @constructor |
|||
*/ |
|||
export function DISABLE_FIELD_LIST(params) { |
|||
return request({ |
|||
url: "/api/admin/locationRoyalties/disable", |
|||
method: 'get', |
|||
params |
|||
}).then(res => res.data.data) |
|||
} |
Before Width: | Height: | Size: 8.7 KiB After Width: | Height: | Size: 26 KiB |
@ -0,0 +1,118 @@ |
|||
<template> |
|||
<el-row> |
|||
<el-col :span="24" style="margin-bottom: 10px;"> |
|||
<div class="grid-content bg-purple-dark"> |
|||
<el-col :span="12"> |
|||
<div class="grid-content bg-purple">分润对象:</div> |
|||
</el-col> |
|||
<el-col :span="12"> |
|||
<div class="grid-content bg-purple-light">分润比例:</div> |
|||
</el-col> |
|||
</div> |
|||
</el-col> |
|||
<el-col :span="24" v-for="(item,index) in lists" style="margin-bottom: 10px;"> |
|||
<el-form :inline="true" class="demo-form-inline"> |
|||
<div class="grid-content bg-purple-dark"> |
|||
<el-row :gutter="15"> |
|||
<el-col :span="10"> |
|||
<div class="grid-content bg-purple"> |
|||
<el-select v-model="item.userId" :value="item.userId" placeholder="选择分润对象"> |
|||
<el-option v-for="opi in accounts" :label="opi.name" :value="opi.id"></el-option> |
|||
</el-select> |
|||
</div> |
|||
</el-col> |
|||
<el-col :span="10"> |
|||
<div class="grid-content bg-purple-light"> |
|||
<el-input placeholder="" @input="limitMax(item.rate,index)" v-model="item.rate" max="100" min="1"></el-input> |
|||
</div> |
|||
</el-col> |
|||
<el-col :span="4"> |
|||
<div class="grid-content bg-purple-light"> |
|||
<el-button type="danger" @click="deleteObj(index)" icon="el-icon-delete"></el-button> |
|||
</div> |
|||
</el-col> |
|||
|
|||
</el-row> |
|||
</div> |
|||
</el-form> |
|||
</el-col> |
|||
<el-button @click="addObj">添加分润对象</el-button> |
|||
</el-row> |
|||
</template> |
|||
|
|||
<script> |
|||
import {GET_ACCOUNT_LIST} from '@/api/privilegeManagement' |
|||
import {DETAIL_FIELD_LIST} from '@/api/distribution' |
|||
import Alert from "@/utils/alert"; |
|||
|
|||
export default { |
|||
name: "detailsOfDistribution", |
|||
props: ['currId'], |
|||
data() { |
|||
return { |
|||
lists: [], |
|||
accounts: [] |
|||
} |
|||
}, |
|||
watch: { |
|||
currId() { |
|||
|
|||
} |
|||
}, |
|||
mounted() { |
|||
this.getAccounts(); |
|||
this.getDetail(); |
|||
}, |
|||
methods: { |
|||
getDetail() { |
|||
let params = { |
|||
id: this.currId |
|||
}; |
|||
DETAIL_FIELD_LIST(params).then(res => { |
|||
this.lists = res |
|||
}) |
|||
}, |
|||
/** |
|||
* 添加分润对象 |
|||
*/ |
|||
addObj() { |
|||
let obj = { |
|||
userId: '', |
|||
rate: '' |
|||
}; |
|||
this.lists.push(obj) |
|||
}, |
|||
|
|||
/** |
|||
* 删除分润对象 |
|||
*/ |
|||
deleteObj(idx) { |
|||
let lists = []; |
|||
this.lists.map((item, index) => { |
|||
if (idx != index) { |
|||
lists.push(item) |
|||
} |
|||
return item; |
|||
}); |
|||
this.lists = lists |
|||
}, |
|||
getAccounts() { |
|||
GET_ACCOUNT_LIST().then(res => { |
|||
this.accounts = res; |
|||
}) |
|||
}, |
|||
limitMax(val, idx) { |
|||
if (val >= 100 || val <= 0) { |
|||
Alert.fail('值不能大于100,小于0'); |
|||
val = '' |
|||
} |
|||
|
|||
this.lists[idx].rate = val; |
|||
} |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style rel="stylesheet/scss" lang="scss" scoped> |
|||
|
|||
</style> |
@ -0,0 +1,60 @@ |
|||
<template> |
|||
<div class="form-container"> |
|||
<el-form :inline="true" :model="formInline" class="demo-form-inline"> |
|||
<el-form-item label="场地"> |
|||
<el-select v-model="formInline.locationId" value="" placeholder="场地"> |
|||
<el-option label="全部" value=""></el-option> |
|||
<el-option v-for="item in locationId" :label="item.name" :value="item.id"></el-option> |
|||
</el-select> |
|||
</el-form-item> |
|||
<el-form-item style="padding-left:30px"> |
|||
<el-button type="default" @click="resetForm1('formInline')">重置</el-button> |
|||
<el-button type="primary" @click="onSubmit">查询</el-button> |
|||
</el-form-item> |
|||
</el-form> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
import {GET_LOCATIONS} from '@/api/common' |
|||
|
|||
export default { |
|||
name: 'form-container', |
|||
props: ['label'], |
|||
data() { |
|||
return { |
|||
formInline: { |
|||
locationId: '' |
|||
}, |
|||
locationId: '' |
|||
} |
|||
}, |
|||
mounted() { |
|||
this.getLocationId(); |
|||
}, |
|||
methods: { |
|||
getLocationId() { |
|||
GET_LOCATIONS().then(res => { |
|||
this.locationId = res |
|||
}) |
|||
}, |
|||
onSubmit() { |
|||
this.$emit('submit', this.formInline) |
|||
}, |
|||
resetForm1() { |
|||
this.formInline = { |
|||
name: '' |
|||
}; |
|||
this.$emit('resetForm'); |
|||
|
|||
} |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style rel="stylesheet/scss" lang="scss" scoped> |
|||
.form-container { |
|||
padding: 20px; |
|||
background: #fff; |
|||
} |
|||
</style> |
@ -0,0 +1,280 @@ |
|||
<template> |
|||
<div> |
|||
<div class="table"> |
|||
<el-table |
|||
:data="lists" |
|||
style="width: 100%"> |
|||
<el-table-column |
|||
prop="id" |
|||
label="序号" |
|||
type="index" |
|||
align="center"> |
|||
</el-table-column> |
|||
<el-table-column |
|||
prop="name" |
|||
label="图片" |
|||
align="center"> |
|||
<template slot-scope="lists"> |
|||
<img :src="lists.row.url" width="100%" alt="" @click="openPic(lists.row.url)"> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column |
|||
prop="name" |
|||
label="位置" |
|||
align="center"> |
|||
<template slot-scope="lists"> |
|||
{{ setCode(lists.row.showPage) }} |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column |
|||
prop="name" |
|||
label="状态" |
|||
align="center"> |
|||
<template slot-scope="lists"> |
|||
<el-tag v-if="lists.row.recStatus === 0">正常</el-tag> |
|||
<el-tag v-if="lists.row.recStatus === 1" type="info">禁用</el-tag> |
|||
<el-tag v-if="lists.row.recStatus === 2" type="danger">删除</el-tag> |
|||
</template> |
|||
</el-table-column> |
|||
|
|||
<el-table-column |
|||
fixed="right" |
|||
label="操作" |
|||
align="center" |
|||
> |
|||
<template slot-scope="lists"> |
|||
<el-button |
|||
type="primary" |
|||
icon="el-icon-edit" |
|||
style="margin-right: 15px;" |
|||
@click="editModal(lists.row.id)" |
|||
size="mini"> |
|||
编辑 |
|||
</el-button> |
|||
|
|||
<el-popover |
|||
placement="top" |
|||
width="160" |
|||
:value="visible"> |
|||
<p>这是一段内容这是一段内容确定删除吗?</p> |
|||
<div style="text-align: right; margin: 0"> |
|||
<el-button size="mini" type="text" @click="visible = false">取消</el-button> |
|||
<el-button type="danger" size="mini" plain @click="deleteItem(lists.row.id)">确定</el-button> |
|||
</div> |
|||
<el-button slot="reference" @click="visible = true" type="danger" icon="el-icon-delete" size="mini">删除</el-button> |
|||
</el-popover> |
|||
|
|||
</template> |
|||
</el-table-column> |
|||
</el-table> |
|||
<div class="pagination"> |
|||
<el-pagination |
|||
background |
|||
:page-size="pageSize" |
|||
layout="prev, pager, next" |
|||
:total="count" |
|||
@current-change="currentChange" |
|||
> |
|||
</el-pagination> |
|||
</div> |
|||
</div> |
|||
|
|||
<el-dialog |
|||
width="400px" |
|||
:show-close="false" |
|||
:visible.sync="isEdit"> |
|||
<details-of-distribution ref="distribution" :currId="id" v-if="isEdit"></details-of-distribution> |
|||
<div slot="footer" class="dialog-footer"> |
|||
<el-button @click="isEdit = false">取消</el-button> |
|||
<el-button type="primary" @click="determine('ruleForm')">确定</el-button> |
|||
</div> |
|||
</el-dialog> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
const DetailsOfDistribution = () => import('./detailsOfDistribution.vue'); |
|||
|
|||
import Banner from '@/components/Banner'; |
|||
import { |
|||
POST_QUERY_CAROUSEL, |
|||
POST_DELETE_CAROUSEL |
|||
} from '@/api/carousel' |
|||
import Alert from "@/utils/alert"; |
|||
import {pageSize} from '../../config'; |
|||
import {tabList} from '../../filters/code'; |
|||
|
|||
export default { |
|||
name: "index", |
|||
props: { |
|||
showPage: { |
|||
type: String, |
|||
default: "0000" |
|||
} |
|||
}, |
|||
data() { |
|||
return { |
|||
count: 0, |
|||
id: '', |
|||
isEdit: false, |
|||
tabList, |
|||
lists: [], |
|||
pageSize: 10, |
|||
pageNum: 1, |
|||
visible: false, |
|||
params: { |
|||
from: 0, |
|||
size: pageSize, |
|||
locationId: '' |
|||
} |
|||
} |
|||
}, |
|||
mounted() { |
|||
this.getList() |
|||
}, |
|||
components: { |
|||
DetailsOfDistribution, |
|||
Banner |
|||
}, |
|||
methods: { |
|||
/** |
|||
* 获取轮播图列表 |
|||
*/ |
|||
getList() { |
|||
const { pageNum, pageSize, showPage } = this; |
|||
const params = { |
|||
pageNum, |
|||
pageSize, |
|||
showPage |
|||
}; |
|||
POST_QUERY_CAROUSEL(params).then(res => { |
|||
this.lists = res.list |
|||
this.pageNum = res.pageNum |
|||
this.pageSize = res.pageSize |
|||
this.count = res.size |
|||
}); |
|||
}, |
|||
|
|||
/** |
|||
* 分页 |
|||
*/ |
|||
currentChange(res) { |
|||
this.pageNum = res; |
|||
this.getList() |
|||
}, |
|||
|
|||
// 查看图片 |
|||
openPic(pic){ |
|||
window.open(pic) |
|||
}, |
|||
|
|||
// 设置显示位置 |
|||
setCode(showPage){ |
|||
const item = this.tabList.find((item) => item.code == showPage) |
|||
return item.title |
|||
}, |
|||
|
|||
editModal(id) { |
|||
this.isEdit = true; |
|||
this.id = id; |
|||
}, |
|||
|
|||
/** |
|||
* 删除 |
|||
*/ |
|||
deleteItem(id) { |
|||
const params = { |
|||
id |
|||
}; |
|||
// POST_DELETE_CAROUSEL(params).then(() => { |
|||
// this.getList() |
|||
// }); |
|||
this.visible = false |
|||
}, |
|||
/** |
|||
* 已发布 |
|||
* @constructor |
|||
*/ |
|||
PUBLISHED(id) { |
|||
let params = { |
|||
id |
|||
}; |
|||
// DISABLE_FIELD_LIST(params).then((res) => { |
|||
// let lists = []; |
|||
// this.lists.map((item) => { |
|||
// if (item.id == id) { |
|||
// item.stateText = '失效中'; |
|||
// item.enabled = false; |
|||
// } |
|||
// lists.push(item); |
|||
// return item; |
|||
// }); |
|||
// this.lists = lists; |
|||
// Alert.success("已失效"); |
|||
// }); |
|||
}, |
|||
/** |
|||
* 已暂停或者待发布 |
|||
* @constructor |
|||
*/ |
|||
PAUSEDANDPENDING(id) { |
|||
let params = { |
|||
id |
|||
}; |
|||
// ENABLE_FIELD_LIST(params).then((res) => { |
|||
// let lists = []; |
|||
// this.lists.map((item) => { |
|||
// if (item.id == id) { |
|||
// item.stateText = '生效中'; |
|||
// item.enabled = true; |
|||
// } |
|||
// lists.push(item); |
|||
// return item; |
|||
// }); |
|||
// this.lists = lists; |
|||
// Alert.success("已生效"); |
|||
// }); |
|||
}, |
|||
determine() { |
|||
let that = this; |
|||
let child = this.$refs.distribution.lists; |
|||
let params = { |
|||
id: this.id, |
|||
items: child |
|||
}; |
|||
|
|||
for (let index in child) { |
|||
if (!child[index].rate || !child[index].userId) { |
|||
Alert.fail("值不能为空"); |
|||
return false; |
|||
} |
|||
} |
|||
|
|||
for (let i = 0; i < child.length; i++) { |
|||
for (let j = i + 1; j < child.length; j++) { |
|||
if (child[i].userId == child[j].userId) { |
|||
Alert.fail("分润对象不能一样"); |
|||
return false; |
|||
} |
|||
|
|||
} |
|||
} |
|||
// POST_FIELD_LIST(params).then(res => { |
|||
// Alert.success("添加成功"); |
|||
// that.isEdit = false; |
|||
// that.getList(); |
|||
// }); |
|||
} |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style lang="scss" scoped> |
|||
.table { |
|||
background: #fff; |
|||
} |
|||
|
|||
.pagination { |
|||
margin-top: 20px; |
|||
} |
|||
</style> |
@ -0,0 +1,118 @@ |
|||
<template> |
|||
<el-row> |
|||
<el-col :span="24" style="margin-bottom: 10px;"> |
|||
<div class="grid-content bg-purple-dark"> |
|||
<el-col :span="12"> |
|||
<div class="grid-content bg-purple">分润对象:</div> |
|||
</el-col> |
|||
<el-col :span="12"> |
|||
<div class="grid-content bg-purple-light">分润比例:</div> |
|||
</el-col> |
|||
</div> |
|||
</el-col> |
|||
<el-col :span="24" v-for="(item,index) in lists" style="margin-bottom: 10px;"> |
|||
<el-form :inline="true" class="demo-form-inline"> |
|||
<div class="grid-content bg-purple-dark"> |
|||
<el-row :gutter="15"> |
|||
<el-col :span="10"> |
|||
<div class="grid-content bg-purple"> |
|||
<el-select v-model="item.userId" :value="item.userId" placeholder="选择分润对象"> |
|||
<el-option v-for="opi in accounts" :label="opi.name" :value="opi.id"></el-option> |
|||
</el-select> |
|||
</div> |
|||
</el-col> |
|||
<el-col :span="10"> |
|||
<div class="grid-content bg-purple-light"> |
|||
<el-input placeholder="" @input="limitMax(item.rate,index)" v-model="item.rate" max="100" min="1"></el-input> |
|||
</div> |
|||
</el-col> |
|||
<el-col :span="4"> |
|||
<div class="grid-content bg-purple-light"> |
|||
<el-button type="danger" @click="deleteObj(index)" icon="el-icon-delete"></el-button> |
|||
</div> |
|||
</el-col> |
|||
|
|||
</el-row> |
|||
</div> |
|||
</el-form> |
|||
</el-col> |
|||
<el-button @click="addObj">添加分润对象</el-button> |
|||
</el-row> |
|||
</template> |
|||
|
|||
<script> |
|||
import {GET_ACCOUNT_LIST} from '@/api/privilegeManagement' |
|||
import {DETAIL_FIELD_LIST} from '@/api/distribution' |
|||
import Alert from "@/utils/alert"; |
|||
|
|||
export default { |
|||
name: "detailsOfDistribution", |
|||
props: ['currId'], |
|||
data() { |
|||
return { |
|||
lists: [], |
|||
accounts: [] |
|||
} |
|||
}, |
|||
watch: { |
|||
currId() { |
|||
|
|||
} |
|||
}, |
|||
mounted() { |
|||
this.getAccounts(); |
|||
this.getDetail(); |
|||
}, |
|||
methods: { |
|||
getDetail() { |
|||
let params = { |
|||
id: this.currId |
|||
}; |
|||
DETAIL_FIELD_LIST(params).then(res => { |
|||
this.lists = res |
|||
}) |
|||
}, |
|||
/** |
|||
* 添加分润对象 |
|||
*/ |
|||
addObj() { |
|||
let obj = { |
|||
userId: '', |
|||
rate: '' |
|||
}; |
|||
this.lists.push(obj) |
|||
}, |
|||
|
|||
/** |
|||
* 删除分润对象 |
|||
*/ |
|||
deleteObj(idx) { |
|||
let lists = []; |
|||
this.lists.map((item, index) => { |
|||
if (idx != index) { |
|||
lists.push(item) |
|||
} |
|||
return item; |
|||
}); |
|||
this.lists = lists |
|||
}, |
|||
getAccounts() { |
|||
GET_ACCOUNT_LIST().then(res => { |
|||
this.accounts = res; |
|||
}) |
|||
}, |
|||
limitMax(val, idx) { |
|||
if (val >= 100 || val <= 0) { |
|||
Alert.fail('值不能大于100,小于0'); |
|||
val = '' |
|||
} |
|||
|
|||
this.lists[idx].rate = val; |
|||
} |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style rel="stylesheet/scss" lang="scss" scoped> |
|||
|
|||
</style> |
@ -0,0 +1,60 @@ |
|||
<template> |
|||
<div class="form-container"> |
|||
<el-form :inline="true" :model="formInline" class="demo-form-inline"> |
|||
<el-form-item label="场地"> |
|||
<el-select v-model="formInline.locationId" value="" placeholder="场地"> |
|||
<el-option label="全部" value=""></el-option> |
|||
<el-option v-for="item in locationId" :label="item.name" :value="item.id"></el-option> |
|||
</el-select> |
|||
</el-form-item> |
|||
<el-form-item style="padding-left:30px"> |
|||
<el-button type="default" @click="resetForm1('formInline')">重置</el-button> |
|||
<el-button type="primary" @click="onSubmit">查询</el-button> |
|||
</el-form-item> |
|||
</el-form> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
import {GET_LOCATIONS} from '@/api/common' |
|||
|
|||
export default { |
|||
name: 'form-container', |
|||
props: ['label'], |
|||
data() { |
|||
return { |
|||
formInline: { |
|||
locationId: '' |
|||
}, |
|||
locationId: '' |
|||
} |
|||
}, |
|||
mounted() { |
|||
this.getLocationId(); |
|||
}, |
|||
methods: { |
|||
getLocationId() { |
|||
GET_LOCATIONS().then(res => { |
|||
this.locationId = res |
|||
}) |
|||
}, |
|||
onSubmit() { |
|||
this.$emit('submit', this.formInline) |
|||
}, |
|||
resetForm1() { |
|||
this.formInline = { |
|||
name: '' |
|||
}; |
|||
this.$emit('resetForm'); |
|||
|
|||
} |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style rel="stylesheet/scss" lang="scss" scoped> |
|||
.form-container { |
|||
padding: 20px; |
|||
background: #fff; |
|||
} |
|||
</style> |
@ -0,0 +1,268 @@ |
|||
<template> |
|||
<div> |
|||
<form-container @submit="submitForm" @resetForm="resetForm"></form-container> |
|||
<div class="table"> |
|||
<el-table |
|||
:data="lists" |
|||
style="width: 100%"> |
|||
<el-table-column |
|||
prop="name" |
|||
label="场地图片"> |
|||
<template slot-scope="lists"> |
|||
<img :src="lists.row.image" width="70" height="70" alt=""> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column |
|||
prop="name" |
|||
label="名称"> |
|||
</el-table-column> |
|||
<el-table-column |
|||
prop="locationName" |
|||
label="场地地址"> |
|||
</el-table-column> |
|||
<el-table-column |
|||
prop="users" |
|||
label="分润人数"> |
|||
</el-table-column> |
|||
<el-table-column |
|||
prop="stateText" |
|||
label="状态"> |
|||
</el-table-column> |
|||
|
|||
<el-table-column |
|||
fixed="right" |
|||
label="操作" |
|||
> |
|||
<template slot-scope="lists"> |
|||
<span |
|||
type="text" |
|||
size="small" |
|||
class="option-span" |
|||
@click="suspensionOfRelease(lists.row.id,lists.row.enabled)" |
|||
> |
|||
<span>{{lists.row.enabled==true?"暂停":"发布"}}</span> |
|||
</span> |
|||
<span |
|||
type="text" |
|||
size="small" |
|||
style="margin: 0 5px;" |
|||
class="option-span" |
|||
@click="editModal(lists.row.id)" |
|||
> |
|||
<span>编辑</span> |
|||
</span> |
|||
</template> |
|||
</el-table-column> |
|||
</el-table> |
|||
<div class="pagination"> |
|||
<el-pagination |
|||
background |
|||
:page-size="params.size" |
|||
layout="prev, pager, next" |
|||
:total="count" |
|||
@current-change="currentChange" |
|||
> |
|||
</el-pagination> |
|||
</div> |
|||
</div> |
|||
|
|||
<el-dialog |
|||
width="400px" |
|||
:show-close="false" |
|||
:visible.sync="isEdit"> |
|||
<details-of-distribution ref="distribution" :currId="id" v-if="isEdit"></details-of-distribution> |
|||
<div slot="footer" class="dialog-footer"> |
|||
<el-button @click="isEdit = false">取消</el-button> |
|||
<el-button type="primary" @click="determine('ruleForm')">确定</el-button> |
|||
</div> |
|||
</el-dialog> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
const FormContainer = () => import('./form.vue'); |
|||
const DetailsOfDistribution = () => import('./detailsOfDistribution.vue'); |
|||
import Banner from '@/components/Banner'; |
|||
import { |
|||
GET_FIELD_LIST, |
|||
POST_FIELD_LIST, |
|||
ENABLE_FIELD_LIST, |
|||
DISABLE_FIELD_LIST, |
|||
COUNT_FIELD_LIST |
|||
} from '@/api/distribution' |
|||
import Alert from "@/utils/alert"; |
|||
import {pageSize} from '../../config'; |
|||
|
|||
export default { |
|||
name: "index", |
|||
data() { |
|||
return { |
|||
count: 0, |
|||
id: '', |
|||
isEdit: false, |
|||
lists: [], |
|||
params: { |
|||
from: 0, |
|||
size: pageSize, |
|||
locationId: '' |
|||
} |
|||
} |
|||
}, |
|||
mounted() { |
|||
this.getList() |
|||
}, |
|||
components: { |
|||
FormContainer, |
|||
DetailsOfDistribution, |
|||
Banner |
|||
}, |
|||
methods: { |
|||
submitForm(res) { |
|||
this.params = { |
|||
...this.params, |
|||
locationId: res.locationId, |
|||
}; |
|||
this.getList() |
|||
}, |
|||
resetForm() { |
|||
this.params = { |
|||
from: 0, |
|||
size: pageSize, |
|||
locationId: '' |
|||
}; |
|||
this.getList() |
|||
}, |
|||
getList() { |
|||
GET_FIELD_LIST(this.params).then(res => { |
|||
res.map((item) => { |
|||
item.stateText = item.enabled ? '生效中' : '失效中'; |
|||
item.locationName = item.province + item.city + item.district + item.name; |
|||
return item |
|||
}); |
|||
this.lists = res |
|||
}); |
|||
|
|||
COUNT_FIELD_LIST(this.params).then(res => { |
|||
this.count = res |
|||
}) |
|||
}, |
|||
|
|||
/** |
|||
* 分页 |
|||
*/ |
|||
currentChange(res) { |
|||
this.params = { |
|||
...this.params, |
|||
from: parseInt(res - 1) * this.params.size, |
|||
size: pageSize, |
|||
}; |
|||
this.getList() |
|||
}, |
|||
|
|||
editModal(id) { |
|||
this.isEdit = true; |
|||
this.id = id; |
|||
}, |
|||
|
|||
/** |
|||
* 状态操作 |
|||
*/ |
|||
suspensionOfRelease(id, enabled) { |
|||
if (enabled) { |
|||
this.PUBLISHED(id) |
|||
} else { |
|||
this.PAUSEDANDPENDING(id) |
|||
} |
|||
}, |
|||
/** |
|||
* 已发布 |
|||
* @constructor |
|||
*/ |
|||
PUBLISHED(id) { |
|||
let params = { |
|||
id |
|||
}; |
|||
DISABLE_FIELD_LIST(params).then((res) => { |
|||
let lists = []; |
|||
this.lists.map((item) => { |
|||
if (item.id == id) { |
|||
item.stateText = '失效中'; |
|||
item.enabled = false; |
|||
} |
|||
lists.push(item); |
|||
return item; |
|||
}); |
|||
this.lists = lists; |
|||
Alert.success("已失效"); |
|||
}); |
|||
}, |
|||
/** |
|||
* 已暂停或者待发布 |
|||
* @constructor |
|||
*/ |
|||
PAUSEDANDPENDING(id) { |
|||
let params = { |
|||
id |
|||
}; |
|||
ENABLE_FIELD_LIST(params).then((res) => { |
|||
let lists = []; |
|||
this.lists.map((item) => { |
|||
if (item.id == id) { |
|||
item.stateText = '生效中'; |
|||
item.enabled = true; |
|||
} |
|||
lists.push(item); |
|||
return item; |
|||
}); |
|||
this.lists = lists; |
|||
Alert.success("已生效"); |
|||
}); |
|||
}, |
|||
determine() { |
|||
let that = this; |
|||
let child = this.$refs.distribution.lists; |
|||
let params = { |
|||
id: this.id, |
|||
items: child |
|||
}; |
|||
|
|||
for (let index in child) { |
|||
if (!child[index].rate || !child[index].userId) { |
|||
Alert.fail("值不能为空"); |
|||
return false; |
|||
} |
|||
} |
|||
|
|||
for (let i = 0; i < child.length; i++) { |
|||
for (let j = i + 1; j < child.length; j++) { |
|||
if (child[i].userId == child[j].userId) { |
|||
Alert.fail("分润对象不能一样"); |
|||
return false; |
|||
} |
|||
|
|||
} |
|||
} |
|||
POST_FIELD_LIST(params).then(res => { |
|||
Alert.success("添加成功"); |
|||
that.isEdit = false; |
|||
that.getList(); |
|||
}); |
|||
} |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style rel="stylesheet/scss" lang="scss" scoped> |
|||
.table { |
|||
background: #fff; |
|||
|
|||
.option-span { |
|||
color: #a90500; |
|||
cursor: pointer; |
|||
} |
|||
} |
|||
|
|||
.pagination { |
|||
margin-top: 20px; |
|||
} |
|||
</style> |
@ -0,0 +1,292 @@ |
|||
export const tabList = [ |
|||
{ |
|||
title: '首页', |
|||
code: '0000', |
|||
}, |
|||
// 公司概况
|
|||
{ |
|||
title: '公司简介', |
|||
code: '0101', |
|||
}, |
|||
{ |
|||
title: '公司领导', |
|||
code: '0102', |
|||
}, |
|||
{ |
|||
title: '组织架构', |
|||
code: '0103', |
|||
}, |
|||
{ |
|||
title: '企业VI', |
|||
code: '0104', |
|||
}, |
|||
{ |
|||
title: '联系方式', |
|||
code: '0105', |
|||
}, |
|||
// 新闻中心
|
|||
{ |
|||
title: '集团新闻', |
|||
code: '0201', |
|||
}, |
|||
{ |
|||
title: '省公司新闻', |
|||
code: '0202', |
|||
}, |
|||
{ |
|||
title: '公司新闻', |
|||
code: '0203', |
|||
}, |
|||
{ |
|||
title: '图片新闻', |
|||
code: '0204', |
|||
}, |
|||
{ |
|||
title: '热点专题', |
|||
code: '0205', |
|||
}, |
|||
{ |
|||
title: '媒体关注', |
|||
code: '0206', |
|||
}, |
|||
{ |
|||
title: '视频新闻', |
|||
code: '0207', |
|||
}, |
|||
{ |
|||
title: '专题片', |
|||
code: '0208', |
|||
}, |
|||
{ |
|||
title: '企业画册', |
|||
code: '0209', |
|||
}, |
|||
{ |
|||
title: '现场风采', |
|||
code: '0210', |
|||
}, |
|||
// 党的建设
|
|||
{ |
|||
title: '中心组学习', |
|||
code: '0301', |
|||
}, |
|||
{ |
|||
title: '示范党委', |
|||
code: '0302', |
|||
}, |
|||
{ |
|||
title: '党支部达标', |
|||
code: '0303', |
|||
}, |
|||
{ |
|||
title: '群团工作', |
|||
code: '0304', |
|||
}, |
|||
{ |
|||
title: '党建动态', |
|||
code: '0305', |
|||
}, |
|||
{ |
|||
title: '党风廉政', |
|||
code: '0306', |
|||
}, |
|||
// 安全生产
|
|||
{ |
|||
title: '安全会议', |
|||
code: '0401', |
|||
}, |
|||
{ |
|||
title: '安全生产记录', |
|||
code: '0402', |
|||
}, |
|||
{ |
|||
title: '应急管理', |
|||
code: '0403', |
|||
}, |
|||
{ |
|||
title: '三讲一落实', |
|||
code: '0404', |
|||
}, |
|||
{ |
|||
title: '曝光台', |
|||
code: '0405', |
|||
}, |
|||
// 通知公告
|
|||
{ |
|||
title: '通知', |
|||
code: '0501', |
|||
}, |
|||
{ |
|||
title: '通报', |
|||
code: '0502', |
|||
}, |
|||
{ |
|||
title: '公告', |
|||
code: '0503', |
|||
}, |
|||
{ |
|||
title: '值班安排', |
|||
code: '0504', |
|||
}, |
|||
{ |
|||
title: '浮窗', |
|||
code: '0505', |
|||
}, |
|||
// 信息公开
|
|||
{ |
|||
title: '基本信息', |
|||
code: '0601', |
|||
}, |
|||
{ |
|||
title: '经营管理', |
|||
code: '0602', |
|||
}, |
|||
{ |
|||
title: '公司公告', |
|||
code: '0603', |
|||
}, |
|||
{ |
|||
title: '社会责任', |
|||
code: '0604', |
|||
}, |
|||
{ |
|||
title: '关于信息公开', |
|||
code: '0605', |
|||
}, |
|||
// 审批事项
|
|||
{ |
|||
title: '公务用车', |
|||
code: '', |
|||
}, |
|||
{ |
|||
title: '领导干部外出报备', |
|||
code: '', |
|||
}, |
|||
{ |
|||
title: '疫情防控', |
|||
code: '', |
|||
}, |
|||
{ |
|||
title: '用印申请', |
|||
code: '', |
|||
}, |
|||
{ |
|||
title: '业务招待事项', |
|||
code: '', |
|||
}, |
|||
{ |
|||
title: '会议室使用', |
|||
code: '', |
|||
}, |
|||
{ |
|||
title: '办公用品领用', |
|||
code: '', |
|||
}, |
|||
// 制度资料
|
|||
{ |
|||
title: '集团公司制度', |
|||
code: '0801', |
|||
}, |
|||
{ |
|||
title: '山西公司制度', |
|||
code: '0802', |
|||
}, |
|||
{ |
|||
title: '行业标准与制度', |
|||
code: '0803', |
|||
}, |
|||
{ |
|||
title: '公司制度', |
|||
code: '0804', |
|||
}, |
|||
{ |
|||
title: '地方规章', |
|||
code: '0805', |
|||
}, |
|||
{ |
|||
title: '培训课件', |
|||
code: '0806', |
|||
}, |
|||
{ |
|||
title: '培训影像', |
|||
code: '0807', |
|||
}, |
|||
{ |
|||
title: '科技创新', |
|||
code: '0808', |
|||
}, |
|||
// 部门首页
|
|||
{ |
|||
title: '总经理工作部', |
|||
code: '0901', |
|||
}, |
|||
{ |
|||
title: '计划营销部', |
|||
code: '0902', |
|||
}, |
|||
{ |
|||
title: '财务管理部', |
|||
code: '0903', |
|||
}, |
|||
{ |
|||
title: '人力资源部', |
|||
code: '0904', |
|||
}, |
|||
{ |
|||
title: '党群工作部', |
|||
code: '0905', |
|||
}, |
|||
{ |
|||
title: '纪委办公室(审计部)', |
|||
code: '0906', |
|||
}, |
|||
{ |
|||
title: '燃料采购部', |
|||
code: '0907', |
|||
}, |
|||
{ |
|||
title: '物资管理部', |
|||
code: '0908', |
|||
}, |
|||
{ |
|||
title: '项目开发部', |
|||
code: '0909', |
|||
}, |
|||
{ |
|||
title: '燃料质量验收部', |
|||
code: '0910', |
|||
}, |
|||
{ |
|||
title: '安全监督部', |
|||
code: '0911', |
|||
}, |
|||
{ |
|||
title: '设备部', |
|||
code: '0912', |
|||
}, |
|||
{ |
|||
title: '发电部', |
|||
code: '0913', |
|||
}, |
|||
{ |
|||
title: '维护部', |
|||
code: '0914', |
|||
}, |
|||
{ |
|||
title: '热工专业', |
|||
code: '0915', |
|||
}, |
|||
{ |
|||
title: '电气专业', |
|||
code: '0916', |
|||
}, |
|||
// 其他
|
|||
{ |
|||
title: '光荣榜', |
|||
code: '9902', |
|||
}, |
|||
{ |
|||
title: '今天我出境', |
|||
code: '9903', |
|||
}, |
|||
] |
@ -0,0 +1,25 @@ |
|||
import Layout from '@/views/layout/Layout' |
|||
|
|||
const others = { |
|||
path: '/others', |
|||
component: Layout, |
|||
meta: {title: '其他', icon: 'dingdan', noCache: true, affix: false}, |
|||
children: [ |
|||
{ |
|||
path: '/others1', |
|||
code: '9902', |
|||
component: () => import('@/views/lists/index'), |
|||
name: '光荣榜', |
|||
meta: {title: '光荣榜', noCache: false, affix: false} |
|||
}, |
|||
{ |
|||
path: '/others2', |
|||
code: '9903', |
|||
component: () => import('@/views/lists/index'), |
|||
name: '今天我出境', |
|||
meta: {title: '今天我出境', noCache: false, affix: false}, |
|||
}, |
|||
] |
|||
}; |
|||
|
|||
export default others |
@ -1,269 +1,40 @@ |
|||
<template> |
|||
<div> |
|||
<form-container @submit="submitForm" @resetForm="resetForm"></form-container> |
|||
<div class="table"> |
|||
<el-table |
|||
:data="lists" |
|||
style="width: 100%"> |
|||
<el-table-column |
|||
prop="name" |
|||
label="场地图片"> |
|||
<template slot-scope="lists"> |
|||
<img :src="lists.row.image" width="70" height="70" alt=""> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column |
|||
prop="name" |
|||
label="名称"> |
|||
</el-table-column> |
|||
<el-table-column |
|||
prop="locationName" |
|||
label="场地地址"> |
|||
</el-table-column> |
|||
<el-table-column |
|||
prop="users" |
|||
label="分润人数"> |
|||
</el-table-column> |
|||
<el-table-column |
|||
prop="stateText" |
|||
label="状态"> |
|||
</el-table-column> |
|||
|
|||
<el-table-column |
|||
fixed="right" |
|||
label="操作" |
|||
> |
|||
<template slot-scope="lists"> |
|||
<span |
|||
type="text" |
|||
size="small" |
|||
class="option-span" |
|||
@click="suspensionOfRelease(lists.row.id,lists.row.enabled)" |
|||
> |
|||
<span>{{lists.row.enabled==true?"暂停":"发布"}}</span> |
|||
</span> |
|||
<span |
|||
type="text" |
|||
size="small" |
|||
style="margin: 0 5px;" |
|||
class="option-span" |
|||
@click="editModal(lists.row.id)" |
|||
> |
|||
<span>编辑</span> |
|||
</span> |
|||
</template> |
|||
</el-table-column> |
|||
</el-table> |
|||
<div class="pagination"> |
|||
<el-pagination |
|||
background |
|||
:page-size="params.size" |
|||
layout="prev, pager, next" |
|||
:total="count" |
|||
@current-change="currentChange" |
|||
> |
|||
</el-pagination> |
|||
</div> |
|||
</div> |
|||
|
|||
<el-dialog |
|||
width="400px" |
|||
:show-close="false" |
|||
:visible.sync="isEdit"> |
|||
<details-of-distribution ref="distribution" :currId="id" v-if="isEdit"></details-of-distribution> |
|||
<div slot="footer" class="dialog-footer"> |
|||
<el-button @click="isEdit = false">取消</el-button> |
|||
<el-button type="primary" @click="determine('ruleForm')">确定</el-button> |
|||
</div> |
|||
</el-dialog> |
|||
|
|||
<div class="pa-4 white"> |
|||
<el-tabs type="border-card" v-model="activeName" @tab-click="handleClick(activeName)"> |
|||
<el-tab-pane label="轮播图管理" name="IMAGE"> |
|||
<banner :showPage="showPage" /> |
|||
</el-tab-pane> |
|||
<el-tab-pane label="详情页管理" name="DETAIL"> |
|||
<detail /> |
|||
</el-tab-pane> |
|||
</el-tabs> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
const FormContainer = () => import('./form.vue'); |
|||
const DetailsOfDistribution = () => import('./detailsOfDistribution.vue'); |
|||
import { |
|||
GET_FIELD_LIST, |
|||
POST_FIELD_LIST, |
|||
ENABLE_FIELD_LIST, |
|||
DISABLE_FIELD_LIST, |
|||
COUNT_FIELD_LIST |
|||
} from '@/api/distribution' |
|||
import Alert from "@/utils/alert"; |
|||
import {pageSize} from '../../config'; |
|||
import Banner from '@/components/Banner'; |
|||
import Detail from '@/components/Detail'; |
|||
|
|||
export default { |
|||
name: "index", |
|||
components: { |
|||
Banner, |
|||
Detail |
|||
}, |
|||
data() { |
|||
return { |
|||
count: 0, |
|||
id: '', |
|||
isEdit: false, |
|||
lists: [], |
|||
params: { |
|||
from: 0, |
|||
size: pageSize, |
|||
locationId: '' |
|||
} |
|||
activeName: 'IMAGE', |
|||
showPage: '0000' |
|||
} |
|||
}, |
|||
mounted() { |
|||
this.getList() |
|||
}, |
|||
components: { |
|||
FormContainer, |
|||
DetailsOfDistribution |
|||
}, |
|||
methods: { |
|||
submitForm(res) { |
|||
this.params = { |
|||
...this.params, |
|||
locationId: res.locationId, |
|||
}; |
|||
this.getList() |
|||
}, |
|||
resetForm() { |
|||
this.params = { |
|||
from: 0, |
|||
size: pageSize, |
|||
locationId: '' |
|||
}; |
|||
this.getList() |
|||
}, |
|||
getList() { |
|||
GET_FIELD_LIST(this.params).then(res => { |
|||
res.map((item) => { |
|||
item.stateText = item.enabled ? '生效中' : '失效中'; |
|||
item.locationName = item.province + item.city + item.district + item.name; |
|||
return item |
|||
}); |
|||
this.lists = res |
|||
}); |
|||
|
|||
COUNT_FIELD_LIST(this.params).then(res => { |
|||
this.count = res |
|||
}) |
|||
handleClick() { |
|||
console.log('切换tab'); |
|||
}, |
|||
|
|||
/** |
|||
* 分页 |
|||
*/ |
|||
currentChange(res) { |
|||
this.params = { |
|||
...this.params, |
|||
from: parseInt(res - 1) * this.params.size, |
|||
size: pageSize, |
|||
}; |
|||
this.getList() |
|||
}, |
|||
|
|||
editModal(id) { |
|||
this.isEdit = true; |
|||
this.id = id; |
|||
}, |
|||
|
|||
/** |
|||
* 状态操作 |
|||
*/ |
|||
suspensionOfRelease(id, enabled) { |
|||
if (enabled) { |
|||
this.PUBLISHED(id) |
|||
} else { |
|||
this.PAUSEDANDPENDING(id) |
|||
} |
|||
}, |
|||
/** |
|||
* 已发布 |
|||
* @constructor |
|||
*/ |
|||
PUBLISHED(id) { |
|||
let params = { |
|||
id |
|||
}; |
|||
DISABLE_FIELD_LIST(params).then((res) => { |
|||
let lists = []; |
|||
this.lists.map((item) => { |
|||
if (item.id == id) { |
|||
item.stateText = '失效中'; |
|||
item.enabled = false; |
|||
} |
|||
lists.push(item); |
|||
return item; |
|||
}); |
|||
this.lists = lists; |
|||
Alert.success("已失效"); |
|||
}); |
|||
}, |
|||
/** |
|||
* 已暂停或者待发布 |
|||
* @constructor |
|||
*/ |
|||
PAUSEDANDPENDING(id) { |
|||
let params = { |
|||
id |
|||
}; |
|||
ENABLE_FIELD_LIST(params).then((res) => { |
|||
let lists = []; |
|||
this.lists.map((item) => { |
|||
if (item.id == id) { |
|||
item.stateText = '生效中'; |
|||
item.enabled = true; |
|||
} |
|||
lists.push(item); |
|||
return item; |
|||
}); |
|||
this.lists = lists; |
|||
Alert.success("已生效"); |
|||
}); |
|||
}, |
|||
determine() { |
|||
let that = this; |
|||
let child = this.$refs.distribution.lists; |
|||
let params = { |
|||
id: this.id, |
|||
items: child |
|||
}; |
|||
|
|||
for (let index in child) { |
|||
if (!child[index].rate || !child[index].userId) { |
|||
Alert.fail("值不能为空"); |
|||
return false; |
|||
} |
|||
} |
|||
|
|||
for (let i = 0; i < child.length; i++) { |
|||
for (let j = i + 1; j < child.length; j++) { |
|||
if (child[i].userId == child[j].userId) { |
|||
Alert.fail("分润对象不能一样"); |
|||
return false; |
|||
} |
|||
|
|||
} |
|||
} |
|||
POST_FIELD_LIST(params).then(res => { |
|||
Alert.success("添加成功"); |
|||
that.isEdit = false; |
|||
that.getList(); |
|||
}); |
|||
} |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style rel="stylesheet/scss" lang="scss" scoped> |
|||
.table { |
|||
margin-top: 20px; |
|||
padding: 30px; |
|||
background: #fff; |
|||
|
|||
.option-span { |
|||
color: #409EFF; |
|||
cursor: pointer; |
|||
} |
|||
} |
|||
|
|||
.pagination { |
|||
margin-top: 20px; |
|||
} |
|||
</style> |
|||
|
Loading…
Reference in new issue