lex-xin 4 anos atrás
pai
commit
55d5dd558b

+ 2 - 0
debug.log

@@ -2,3 +2,5 @@
 [1127/100753.385:ERROR:directory_reader_win.cc(43)] FindFirstFile: 系统找不到指定的路径。 (0x3)
 [1127/100753.402:ERROR:filesystem_win.cc(129)] GetFileAttributes C:\Users\lex\AppData\Local\Google\Chrome\User Data\Crashpad\attachments\6cd524b3-9b87-4263-8992-de833b809784: 系统找不到指定的路径。 (0x3)
 [1127/100753.406:ERROR:filesystem_win.cc(129)] GetFileAttributes C:\Users\lex\AppData\Local\Google\Chrome\User Data\Crashpad\attachments\8b20b593-2a91-4130-9aa1-1910ad894bc8: 系统找不到指定的路径。 (0x3)
+[1127/151852.697:ERROR:filesystem_win.cc(129)] GetFileAttributes C:\Users\lex\AppData\Local\Google\Chrome\User Data\Crashpad\attachments\49509a15-3940-4f7a-900c-18ec901b5f9f: 系统找不到指定的路径。 (0x3)
+[1127/151913.823:ERROR:http_transport_win.cc(276)] WinHttpSendRequest: 操作成功完成。 (0x0)

+ 68 - 42
src/views/workBenchManager/journal/index.vue

@@ -4,31 +4,22 @@
       <div class="squrt"></div>系统日志
     </h2>
     <div class="m-core">
+      <el-tabs @tab-click="onTabClick">
+        <el-tab-pane label="系统通知" value="SYSTEM"></el-tab-pane>
+        <el-tab-pane label="学生申诉" value="STUDENT"></el-tab-pane>
+        <!-- <el-tab-pane label="退团退课" value="MUSICGROUP"></el-tab-pane> -->
+        <el-tab-pane label="请假处理" value="LEAVE"></el-tab-pane>
+        <el-tab-pane label="VIP申请审核" value="VIPAPPLY"></el-tab-pane>
+      </el-tabs>
       <el-form :inline="true"
                 ref="searchForm"
                :model="searchForm">
-        <!-- <el-form-item>
-          <el-input v-model.trim="searchForm.search"
-                    @keyup.enter.native="search"
-                    placeholder="课程编号、课程组名称"></el-input>
-        </el-form-item> -->
-        <el-form-item prop="group">
-          <el-select v-model.trim="searchForm.group"
-                     clearable
-                     placeholder="日志类型">
-            <el-option label="系统通知" value="SYSTEM"></el-option>
-            <el-option label="学生申诉" value="STUDENT"></el-option>
-            <el-option label="退团退课" value="MUSICGROUP"></el-option>
-            <el-option label="请假处理" value="LEAVE"></el-option>
-            <el-option label="VIP申请审核" value="VIPAPPLY"></el-option>
-          </el-select>
-        </el-form-item>
         <el-form-item prop="readStatus">
           <el-select v-model.trim="searchForm.readStatus"
                      clearable
                      placeholder="日志状态">
-            <el-option label="已读" value="1"></el-option>
-            <el-option label="未读" value="0"></el-option>
+            <el-option label="已读" :value="1"></el-option>
+            <el-option label="未读" :value="0"></el-option>
           </el-select>
         </el-form-item>
         <!-- <el-form-item>
@@ -39,10 +30,8 @@
         </el-form-item> -->
         <el-form-item>
           <el-button type="danger" @click="onSearch">搜索</el-button>
-          <el-button type="primary" @click="onSearchReset('searchForm')">重置</el-button>
         </el-form-item>
       </el-form>
-
       <div class="tableWrap">
         <el-table style="width: 100%"
                   :header-cell-style="{background:'#EDEEF0',color:'#444'}"
@@ -54,18 +43,12 @@
             </template>
           </el-table-column>
           <el-table-column align="center" label="申请时间" prop="createOn"></el-table-column>
-          <el-table-column align="center" label="类型">
-            <template slot-scope="scope">
-              {{ scope.row.group | journalTypeFormat }}
-            </template>
-          </el-table-column>
           <el-table-column align="center" label="内容" prop="content"></el-table-column>
           <el-table-column align="center"
                            label="操作"
                            fixed="right">
             <template slot-scope="scope">
-              <el-button type="text" v-if="scope.row.readStatus != 1">已读</el-button>
-              <el-button type="text">查看</el-button>
+              <el-button type="text" @click="onLook(scope.row)">查看</el-button>
             </template>
           </el-table-column>
         </el-table>
@@ -76,21 +59,46 @@
                     @pagination="getList" />
       </div>
     </div>
+
+    <el-dialog :title="dialogTitle"
+               :visible.sync="dialogSystem"
+               width="400px">
+      <el-row>
+        <el-col :span="24">{{ dialogDetail.content }}</el-col>
+      </el-row>
+      <div slot="footer">
+        <el-button type="primary" @click="dialogSystem = false">确 定</el-button>
+      </div>
+    </el-dialog>
+
+    <el-dialog :title="dialogTitle"
+               :visible.sync="dialogStudent"
+               width="500px">
+      <student v-if="dialogStudent"
+               :dialogDetail="dialogDetail"
+               @close="dialogStudent = false" />
+    </el-dialog>
   </div>
 </template>
 <script>
 import cleanDeep from 'clean-deep';
 import pagination from "@/components/Pagination/index";
 import { queryCountOfUnread, sysMessageList, setRead } from '@/api/journal'
+import { journalType } from '@/constant'
+import Student from './model/student'
 export default {
-  components: { pagination },
+  components: { pagination, Student },
   name: 'journal',
   data () {
     return {
+      dialogSystem: false,
+      dialogStudent: false,
+      dialogTitle: null,
+      dialogDetail: {},
       searchForm: {
         search: null,
-        group: null,
-        readStatus: null
+        group: 'SYSTEM',
+        readStatus: 0
       },
       tableList: [],
       pageInfo: {
@@ -106,22 +114,17 @@ export default {
     this.getList()
   },
   methods: {
-    __init () {
-      // 未读消息
-      // queryCountOfUnread().then(res => {
-      //   if (res.code == 200) {
-      //     if (res.data && res.data.SYSTEM) {
-      //       this.noReadMessage = res.data.SYSTEM
-      //     }
-      //   }
-      // })
-    },
     onSearch() {
       this.pageInfo.page = 1
       this.getList()
     },
-    onSearchReset(formName) {
-      this.$refs[formName].resetFields()
+    onTabClick(elm) {
+      // 判断 group 是否一致
+      const searchForm = this.searchForm
+      if(elm.$attrs.value == searchForm.group) {
+        return
+      }
+      searchForm.group = elm.$attrs.value
       this.getList()
     },
     async getList() {
@@ -135,6 +138,29 @@ export default {
           pageInfo.total = res.data.total
         }
       })
+    },
+    async onLook(row) {
+      switch(row.group) {
+        case 'SYSTEM':
+          this.dialogSystem = true
+          break;
+        case 'STUDENT':
+          this.dialogStudent = true
+          break;
+        case 'LEAVE':
+          this.dialogLeave = true
+          break;
+        case 'VIPAPPLY':
+          this.dialogVipApply = true
+          break;
+      }
+      // 把当前消息变成已读
+      if(row.readStatus != 1) {
+        await setRead({ id: row.id })
+        row.readStatus = 1 // 手动把消息变一下状态
+      }
+      this.dialogTitle = journalType[row.group]
+      this.dialogDetail = row
     }
   }
 }

+ 159 - 0
src/views/workBenchManager/journal/model/student.vue

@@ -0,0 +1,159 @@
+<template>
+    <div>
+        <el-form ref="studentForm"
+                 :model="rateForm"
+                 v-if="studentForm"
+                 class="studentForm"
+                 label-width="110px">
+            <el-alert title="已拒绝" v-if="studentForm.complaints.status == 'REJECT'" :closable="false" class="alert" type="error"></el-alert>
+            <el-alert title="已处理" v-if="studentForm.complaints.status == 'PASS'" :closable="false" class="alert" type="success"></el-alert>
+            <el-form-item label="发起投诉时间">
+                <el-input disabled v-model.trim="studentForm.courseSchedule.createTime"></el-input>
+            </el-form-item>
+            <el-form-item label="学员姓名">
+                <el-input disabled v-model.trim="studentForm.complaints.user.username"></el-input>
+            </el-form-item>
+            <el-form-item label="课程名称">
+                <el-input disabled v-model.trim="studentForm.courseSchedule.name"></el-input>
+            </el-form-item>
+            <el-form-item label="课程时间">
+                <!-- {{ showMessage.courseSchedule.classDate | formatTimer }} {{ showMessage.courseSchedule.startClassTime | timer }} -->
+                <el-input disabled v-model.trim="studentForm.courseSchedule.classDate"></el-input>
+            </el-form-item>
+            <el-form-item label="老师名称">
+                <el-input disabled v-model.trim="studentForm.courseSchedule.teacher.username"></el-input>
+            </el-form-item>
+            <el-form-item label="投诉理由">
+                <el-input type="textarea" disabled v-model.trim="studentForm.complaints.reason"></el-input>
+            </el-form-item>
+            <el-alert title="责任比" :closable="false" class="alert" type="info"></el-alert>
+            <el-form-item label="老师比例"
+                          prop="teacherRate"
+                          :rules="[{ required: true, message: '请输入老师比例', trigger: 'blur'},
+                            { required: true, validator: validateRate, trigger: 'blur' }]">
+                <el-input type="number"
+                      @mousewheel.native.prevent
+                      :disabled="studentForm.complaints.status !== 'ING'"
+                      v-model.number="rateForm.teacherRate"
+                      placeholder="请输入内容">
+                    <template slot="append">%</template>
+                </el-input>
+            </el-form-item>
+            <el-form-item label="学生比例"
+                          prop="studentRate"
+                          :rules="[{ required: true, message: '请输入学生比例', trigger: 'blur'},
+                            { required: true, validator: validateRate, trigger: 'blur' }]">
+                <el-input type="number"
+                      @mousewheel.native.prevent
+                      :disabled="studentForm.complaints.status !== 'ING'"
+                      v-model.number="rateForm.studentRate"
+                      placeholder="请输入内容">
+                <template slot="append">%</template>
+              </el-input>
+            </el-form-item>
+        </el-form>
+        <div slot="footer" class="dialog-footer" v-if="studentForm && studentForm.complaints.status === 'ING'">
+            <el-button type="primary" @click="onSubmit('studentForm', 'submit')">确 定</el-button>
+            <el-button type="danger" @click="onSubmit('studentForm', 'reject')">拒 绝</el-button>
+        </div>
+    </div>
+</template>
+
+<script>
+import { queryCourseScheduleComplaintsDetail, courseScheduleCommplaintAudit } from '@/api/journal'
+const validateRate = (rule, value, callback) => {
+    if (value == '' && typeof value == 'string' || value == null) {
+        callback(new Error('请输入比例'))
+    } else if (value < 0 || value > 100) {
+        callback(new Error('比例必须在0~100之间'))
+    } else {
+        callback()
+    }
+}
+export default {
+    props: ['dialogDetail'],
+    data() {
+        return {
+            validateRate: validateRate,
+            studentForm: null,
+            rateForm: {
+                studentRate: null,
+                teacherRate: null
+            }
+        }
+    },
+    mounted() {
+        this.__init()
+    },
+    methods: {
+        async __init() {
+            let { memo } = this.dialogDetail
+            memo = memo ? JSON.parse(memo) : null
+            if(!memo) { // 判断是否有参数
+                this.$message.error('参数有误')
+                return
+            }
+            await queryCourseScheduleComplaintsDetail({ courseScheduleComplaintsId: memo.courseScheduleComplaintsId }).then(res => {
+                let result = res.data
+                if (res.code == 200) {
+                    this.studentForm = result
+                    const { complaints } = result
+                    if (complaints.status != 'ING') {
+                        this.rateForm.teacherRate = complaints.teacherLiabilityRatio
+                        this.rateForm.studentRate = complaints.studentLiabilityRatio
+                    }
+                }
+            })
+        },
+        async onSubmit(formName, type) {
+            this.$refs[formName].validate(async (valid) => {
+                if(valid) {
+                    const params = {
+                        id: this.studentForm.complaints.id
+                    }
+                    if(type == 'submit') {
+                        params.status = 'PASS'
+                        params.studentLiabilityRatio = this.rateForm.studentRate
+                        params.teacherLiabilityRatio = this.rateForm.teacherRate
+                    } else if (type == 'reject') {
+                        params.status = 'REJECT'
+                        params.studentLiabilityRatio = 0
+                        params.teacherLiabilityRatio = 0
+                    }
+                    await courseScheduleCommplaintAudit(params).then(res => {
+                        if (res.code == 200) {
+                            this.$message.success('处理成功')
+                            this.$listeners.close()
+                        } else {
+                            this.$message.error(res.msg)
+                        }
+                    })
+                }
+            })
+        }
+    },
+    watch: {
+        'rateForm.teacherRate' (newValue, old) {
+            if (newValue) {
+                this.rateForm.studentRate = parseInt(100 - newValue)
+            }
+        },
+        'rateForm.studentRate' (newValue, old) {
+            if (newValue) {
+                this.rateForm.teacherRate = parseInt(100 - newValue)
+            }
+        }
+    },
+}
+</script>
+
+<style lang="less" scoped>
+.dialog-footer{
+    margin-top: 20px;
+    display: block;
+    text-align: right;
+}
+.alert {
+   margin-bottom: 10px;
+}
+</style>

+ 1 - 1
src/views/workBenchManager/journal/studentComplain.vue

@@ -308,7 +308,7 @@ export default {
           this.$message.success('处理成功')
           this.getCourseDetail(id)
         } else {
-          this.$message.errot(res.msg)
+          this.$message.error(res.msg)
         }
       })
     }