|
@@ -10,7 +10,7 @@
|
|
|
<br />
|
|
|
3、日志支持每月、每周、每次汇报,可自行根据需要设置“日志积分规则
|
|
|
</div>
|
|
|
- <div class="flex-box-end" style="margin-top: 20px;">
|
|
|
+ <div class="flex-box-end" style="margin-top: 20px;">
|
|
|
<el-button size="small" plain @click="add()">添加日志模板</el-button>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -31,6 +31,7 @@
|
|
|
<el-table-column label="操作">
|
|
|
<template slot-scope="scope">
|
|
|
<div class="flex-box-ce">
|
|
|
+ <div class="blue" @click="refresh(scope.row)" style="margin-right: 10px;cursor: pointer;">刷新汇报记录</div>
|
|
|
<div @click.stop="openSet(scope.row)" style="margin-right: 10px;"><span class="lookQrcode">编辑</span></div>
|
|
|
<div @click.stop="deleteSet(scope.row)"><span class="lookQrcode red">删除</span></div>
|
|
|
</div>
|
|
@@ -38,7 +39,10 @@
|
|
|
</el-table-column>
|
|
|
<template slot="empty">
|
|
|
<noData :isSolt="true">
|
|
|
- <div>您当前没有日志模板,去添加<span style="cursor: pointer;margin-left: 10px;" @click="add()" class="blue">添加</span></div>
|
|
|
+ <div>
|
|
|
+ 您当前没有日志模板,去添加
|
|
|
+ <span style="cursor: pointer;margin-left: 10px;" @click="add()" class="blue">添加</span>
|
|
|
+ </div>
|
|
|
</noData>
|
|
|
</template>
|
|
|
</el-table>
|
|
@@ -146,16 +150,16 @@ export default {
|
|
|
],
|
|
|
isShowName: false,
|
|
|
nameVal: '',
|
|
|
-
|
|
|
+
|
|
|
// 添加模板
|
|
|
- isAdd:false,
|
|
|
+ isAdd: false
|
|
|
};
|
|
|
},
|
|
|
- watch:{
|
|
|
- dialogVisible(val){
|
|
|
- if(!val){
|
|
|
- this.isAdd=false;
|
|
|
- this.selectItem={
|
|
|
+ watch: {
|
|
|
+ dialogVisible(val) {
|
|
|
+ if (!val) {
|
|
|
+ this.isAdd = false;
|
|
|
+ this.selectItem = {
|
|
|
config: { point: 0, upper_limit: 0 },
|
|
|
enable: true,
|
|
|
id: '',
|
|
@@ -171,28 +175,40 @@ export default {
|
|
|
this.getList();
|
|
|
},
|
|
|
methods: {
|
|
|
- deleteSet(e){
|
|
|
+ refresh() {
|
|
|
+ this.$axios('post', '/api/ding/report_sync', data)
|
|
|
+ .then(res => {
|
|
|
+ if (res.data.code == 1) {
|
|
|
+ this.$message.success(res.data.msg);
|
|
|
+ this.getList();
|
|
|
+ this.dialogVisible = false;
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .finally(() => {
|
|
|
+ this.setLoading = false;
|
|
|
+ });
|
|
|
+ },
|
|
|
+ deleteSet(e) {
|
|
|
this.$confirm('确定要删除该日志模板吗?', '提示', {
|
|
|
confirmButtonText: '确定',
|
|
|
cancelButtonText: '取消',
|
|
|
type: 'warning'
|
|
|
}).then(() => {
|
|
|
- this.$axios('DELETE', '/api/integral/report/templates', { id: e.id })
|
|
|
- .then(res => {
|
|
|
- if (res.data.code == 1) {
|
|
|
- this.$message.success("删除成功");
|
|
|
- this.getList();
|
|
|
- }
|
|
|
- })
|
|
|
+ this.$axios('DELETE', '/api/integral/report/templates', { id: e.id }).then(res => {
|
|
|
+ if (res.data.code == 1) {
|
|
|
+ this.$message.success('删除成功');
|
|
|
+ this.getList();
|
|
|
+ }
|
|
|
+ });
|
|
|
});
|
|
|
},
|
|
|
- add(){
|
|
|
- if(this.list.length==20){
|
|
|
+ add() {
|
|
|
+ if (this.list.length == 20) {
|
|
|
this.$message.warning('日志模板最多有20个');
|
|
|
return false;
|
|
|
}
|
|
|
- this.isAdd=true;
|
|
|
- this.dialogVisible=true;
|
|
|
+ this.isAdd = true;
|
|
|
+ this.dialogVisible = true;
|
|
|
},
|
|
|
// 最大值不能大于100
|
|
|
checkCountry(e, id) {
|
|
@@ -222,13 +238,13 @@ export default {
|
|
|
this.isShowName = true;
|
|
|
},
|
|
|
submit(fromName) {
|
|
|
- if(this.isAdd){
|
|
|
+ if (this.isAdd) {
|
|
|
if (!this.selectItem.name) {
|
|
|
this.$message.error('请输入日志名称');
|
|
|
return false;
|
|
|
}
|
|
|
}
|
|
|
- if(this.selectItem.enable){
|
|
|
+ if (this.selectItem.enable) {
|
|
|
if (this.selectItem.config.point == 0) {
|
|
|
this.$message.error('汇报奖励不能为0');
|
|
|
return false;
|
|
@@ -246,8 +262,8 @@ export default {
|
|
|
data.enable = data.enable ? 1 : 0;
|
|
|
data.point = data.config.point;
|
|
|
data.upper_limit = data.config.upper_limit;
|
|
|
- if(this.isAdd){
|
|
|
- data.type='other'
|
|
|
+ if (this.isAdd) {
|
|
|
+ data.type = 'other';
|
|
|
}
|
|
|
this.$axios('post', '/api/integral/report/templates', data)
|
|
|
.then(res => {
|