|
@@ -10,7 +10,8 @@
|
|
|
<br />
|
|
|
3、日志支持每月、每周、每次汇报,可自行根据需要设置“日志积分规则
|
|
|
</div>
|
|
|
- <div class="flex-box-end" style="margin-top: 20px;">
|
|
|
+ <div class="flex-box-end" style="margin-top: 20px;">
|
|
|
+ <el-button v-if="$authoritys() != 'dept_manager' && $authoritys() != 'employee'" type="primary" @click="isShowLog = true">刷新汇报记录</el-button>
|
|
|
<el-button size="small" plain @click="add()">添加日志模板</el-button>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -31,7 +32,6 @@
|
|
|
<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>
|
|
@@ -111,6 +111,22 @@
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
</el-dialog>
|
|
|
+ <el-dialog title="刷新日志记录" :visible.sync="isShowLog" top="25vh" width="520px" class="dialog" :close-on-click-modal="false" :close-on-press-escape="false">
|
|
|
+ <el-form :model="logData" ref="setForm2" label-width="110px">
|
|
|
+ <el-form-item label="日志汇报要求" prop="type" :rules="[{ required: true, message: '请选择汇报要求' }]">
|
|
|
+ <el-select class="widthInput" v-model="logData.type" placeholder="请选择" style="width: 250px;">
|
|
|
+ <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value"></el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="选择日期" prop="target_date" :rules="[{ required: true, message: '请选择汇报要求' }]">
|
|
|
+ <el-date-picker :picker-options="pickerOptions" v-model="logData.target_date" type="date" value-format="yyyy-MM-dd" placeholder="选择日期" style="width: 250px;"></el-date-picker>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ <span slot="footer" class="dialog-footer">
|
|
|
+ <el-button @click="isShowLog = false">取 消</el-button>
|
|
|
+ <el-button type="primary" @click="refresh('setForm2')">确 定</el-button>
|
|
|
+ </span>
|
|
|
+ </el-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
@@ -125,6 +141,11 @@ export default {
|
|
|
ding_enable: true,
|
|
|
list: [],
|
|
|
dialogVisible: false,
|
|
|
+ pickerOptions: {
|
|
|
+ disabledDate(time) {
|
|
|
+ return time.getTime() > Date.now() - 8.64e7;
|
|
|
+ }
|
|
|
+ },
|
|
|
selectItem: {
|
|
|
config: { point: 0, upper_limit: 0 },
|
|
|
enable: true,
|
|
@@ -152,7 +173,13 @@ export default {
|
|
|
nameVal: '',
|
|
|
|
|
|
// 添加模板
|
|
|
- isAdd: false
|
|
|
+ isAdd: false,
|
|
|
+
|
|
|
+ isShowLog: false,
|
|
|
+ logData: {
|
|
|
+ type: 1,
|
|
|
+ target_date: ''
|
|
|
+ }
|
|
|
};
|
|
|
},
|
|
|
watch: {
|
|
@@ -175,18 +202,35 @@ export default {
|
|
|
this.getList();
|
|
|
},
|
|
|
methods: {
|
|
|
- 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;
|
|
|
+ refresh(fromName) {
|
|
|
+ this.$refs[fromName].validate(valid => {
|
|
|
+ if (valid) {
|
|
|
+ let type='';
|
|
|
+ if(this.logData.type==1){
|
|
|
+ type='daily'
|
|
|
+ }else if(this.logData.type==2){
|
|
|
+ type='weekly'
|
|
|
+ }else{
|
|
|
+ type='monthly'
|
|
|
}
|
|
|
- })
|
|
|
- .finally(() => {
|
|
|
- this.setLoading = false;
|
|
|
- });
|
|
|
+ let data = {
|
|
|
+ type: type,
|
|
|
+ employee_id: this.$getUserData().id,
|
|
|
+ target_date: this.logData.target_date
|
|
|
+ };
|
|
|
+ this.$axios('post', '/api/ding/report_sync', data)
|
|
|
+ .then(res => {
|
|
|
+ this.$message.success('已刷新');
|
|
|
+ })
|
|
|
+ .finally(() => {
|
|
|
+ this.logData={
|
|
|
+ type: 1,
|
|
|
+ target_date: ''
|
|
|
+ };
|
|
|
+ this.isShowLog = false;
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
},
|
|
|
deleteSet(e) {
|
|
|
this.$confirm('确定要删除该日志模板吗?', '提示', {
|