Commit 4e0a71ab by baihong

奖励新增,奖励编辑

parent c7eb0ff6
......@@ -95,6 +95,7 @@ const _HttpService = {
postObj: (url, data, config) => {
const _selfConfig = {
headers: {
language: "cn",
"Content-Type": "application/json",
"X-Access-Token":
sessionStorage.getItem("token") || "1b8cc15a59947ce27dd62b"
......@@ -108,6 +109,7 @@ const _HttpService = {
putObj: (url, data, config) => {
const _selfConfig = {
headers: {
language: "cn",
"Content-Type": "application/json",
"X-Access-Token":
sessionStorage.getItem("token") || "1b8cc15a59947ce27dd62b"
......@@ -130,6 +132,7 @@ const _HttpService = {
get: (url, data, config) => {
const _selfConfig = {
headers: {
language: "cn",
"Content-Type": "application/json",
"X-Access-Token":
sessionStorage.getItem("token") || "1b8cc15a59947ce27dd62b"
......@@ -144,9 +147,10 @@ const _HttpService = {
delete: (url, data, config) => {
const _selfConfig = {
headers: {
language: "cn",
"Content-Type": "application/json",
"X-Access-Token":
sessionStorage.getItem("token") || "1b8cc15a59947ce27dd62b"
sessionStorage.getItem("token") || "1b8cc15a59947ce27dd62b"
},
data: JSON.stringify(data),
setLoading: true
......
......@@ -5,8 +5,9 @@
<p slot="title">早起人数统计</p>
<div class="dateBox">
<DatePicker
@on-change="search"
v-model="date"
format="yyyy/MM/dd"
format="yyyy-MM-dd"
type="daterange"
placement="bottom-end"
placeholder="Select date"
......@@ -39,11 +40,11 @@ export default {
resize() {
this.dom.resize();
},
search() {
search(p) {
let params = {
language: "cn",
startDate: this.date[0],
endDate: this.date[1]
startDate: p && p.length ? p[0] : "2021-01-01",
endDate: p && p.length ? p[1] : "2021-09-15"
};
queryList(params).then(res => {
const option = {
......@@ -59,8 +60,8 @@ export default {
xAxis: {
type: "category",
boundaryGap: false,
data: res.map((p)=>{
return p.group_date
data: res.map(p => {
return p.group_date;
})
},
yAxis: {
......@@ -71,17 +72,17 @@ export default {
name: "报名人数",
type: "line",
stack: "总量",
data: res.map((p)=>{
return p.apply_num
})
data: res.map(p => {
return p.apply_num;
})
},
{
name: "签到人数",
type: "line",
stack: "总量",
data: res.map((p)=>{
return p.clock_num
})
data: res.map(p => {
return p.clock_num;
})
}
]
};
......
......@@ -79,31 +79,23 @@
</div>
</div>
<Table
v-if="tab === '3'"
v-if="tab === '3' || tab === '4'"
:loading="$store.state.app.isLoading"
border
ref="selection"
:columns="newoldcolumns"
:data="data"
>
<template slot-scope="{ row }" slot="action">
<a @click="edit(row)">编辑</a>
<template slot-scope="{ row }" slot="award_type">
{{ row.award_type === 1 ? "优惠券" : "真我币" }}
</template>
</Table>
<Table
v-if="tab === '4'"
:loading="$store.state.app.isLoading"
border
ref="selection"
:columns="newoldcolumns"
:data="data"
>
<template slot-scope="{ row }" slot="action">
<a @click="edit(row)">编辑</a>
<a style="margin-left:10px" @click="del(row)">删除</a>
</template>
</Table>
<div class="editor" v-if="tab === '6'">
<editor />
<editor v-model="content" />
<div class="topSearch" style="margin-top: 20px;">
<div class="left">
<Button type="primary" @click="goDetail">取消</Button>
......@@ -118,8 +110,7 @@
v-model="modalVisible"
width="600"
:mask-closable="false"
:styles="styles"
@on-close="close"
@on-close="modalVisible = false"
>
<Form
ref="formValidate"
......@@ -175,6 +166,7 @@ export default {
},
data() {
return {
content: "",
payData: [
{
break_time: "",
......@@ -270,7 +262,7 @@ export default {
},
{
title: "模板编号",
slot: "template_code"
key: "template_code"
},
{
title: "获奖概率",
......@@ -290,6 +282,9 @@ export default {
let type = val === "3" ? 1 : 2;
this.getjllist(type);
}
if (val === "6") {
this.getRu();
}
},
immediate: true
}
......@@ -306,30 +301,53 @@ export default {
},
submit() {
this.formValidate.type = this.tab === "3" ? 1 : 2;
this.formValidate.uuid = sessionStorage.getItem('admin_uuid')
this.formValidate.award_rate = Number(this.formValidate.award_rate)
this.formValidate.uuid = sessionStorage.getItem("admin_uuid");
this.formValidate.award_rate = Number(this.formValidate.award_rate);
if (this.add) {
addConfigAward(this.formValidate).then(res => {
console.log(res);
this.$Message.success("新增成功!");
this.modalVisible = false;
let type = this.tab === "3" ? 1 : 2;
this.getjllist(type);
});
} else {
editConfigAward(this.formValidate).then(res => {
console.log(res);
this.$Message.success("编辑成功!");
this.modalVisible = false;
let type = this.tab === "3" ? 1 : 2;
this.getjllist(type);
});
}
},
del() {
deleteConfigAward(id).then(res => {
console.log(res);
del(p) {
deleteConfigAward({
awardId: p.id
}).then(res => {
this.$Message.success("删除成功!");
this.modalVisible = false;
let type = this.tab === "3" ? 1 : 2;
this.getjllist(type);
});
},
edit(p) {
this.add = false;
this.formValidate.award_name = p.award_name;
this.formValidate.award_type = p.award_type;
this.formValidate.award_rate = p.award_rate;
this.formValidate.template_code = p.template_code;
this.formValidate.id = p.id;
this.modalVisible = true;
},
getjllist(type) {
configAwards(type).then(res => {
this.data = res;
});
},
getRu() {
getActivityConfigRule(1).then(res => {
getActivityConfigRule({
language: "cn",
ruleType: 1
}).then(res => {
this.data = res;
});
},
......
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