Selaa lähdekoodia

Merge branch 'wxlNew' into iteration_adminOptimiz

lex-xin 4 vuotta sitten
vanhempi
commit
4ccffa0df0

Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 0 - 0
dist/index.html


+ 5 - 0
dist/static/css/chunk-27d213b0.5fb79823.css

@@ -0,0 +1,5 @@
+<<<<<<< HEAD:dist/static/css/chunk-ba2bab20.6c4a215b.css
+.process[data-v-cd5d302a]{padding:10px;max-height:600px;overflow-y:auto}.select[data-v-57651dcb]{font-size:14px}.btnList[data-v-57651dcb]{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row;-webkit-box-pack:start;-ms-flex-pack:start;justify-content:flex-start;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.btnList div[data-v-57651dcb]{margin-right:15px}
+=======
+.process[data-v-f049a426]{padding:10px;max-height:600px;overflow-y:auto}.select[data-v-7a08b034]{font-size:14px}.btnList[data-v-7a08b034]{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row;-webkit-box-pack:start;-ms-flex-pack:start;justify-content:flex-start;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.btnList div[data-v-7a08b034]{margin-right:15px}
+>>>>>>> master:dist/static/css/chunk-27d213b0.5fb79823.css

Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 0 - 0
dist/static/css/chunk-35005cb0.4da03be6.css


Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 0 - 0
dist/static/css/chunk-62a7845a.ab7964a8.css


Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 0 - 0
dist/static/css/chunk-999e9a5c.0161fe92.css


+ 5 - 0
dist/static/css/chunk-ba2bab20.6c4a215b.css

@@ -0,0 +1,5 @@
+<<<<<<< HEAD:dist/static/css/chunk-ba2bab20.6c4a215b.css
+.process[data-v-cd5d302a]{padding:10px;max-height:600px;overflow-y:auto}.select[data-v-57651dcb]{font-size:14px}.btnList[data-v-57651dcb]{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row;-webkit-box-pack:start;-ms-flex-pack:start;justify-content:flex-start;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.btnList div[data-v-57651dcb]{margin-right:15px}
+=======
+.process[data-v-f049a426]{padding:10px;max-height:600px;overflow-y:auto}.select[data-v-7a08b034]{font-size:14px}.btnList[data-v-7a08b034]{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row;-webkit-box-pack:start;-ms-flex-pack:start;justify-content:flex-start;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.btnList div[data-v-7a08b034]{margin-right:15px}
+>>>>>>> master:dist/static/css/chunk-27d213b0.5fb79823.css

Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 0 - 0
dist/static/css/chunk-eaa0afec.238b85ee.css


Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 0 - 0
dist/static/js/app.03d9b0da.js


Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 0 - 0
dist/static/js/chunk-1445e5ae.679bed79.js


Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 0 - 0
dist/static/js/chunk-14af6d4a.33877683.js


Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 0 - 0
dist/static/js/chunk-29a09b8f.97f7e729.js


Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 1 - 0
dist/static/js/chunk-47c365ea.db2aefd4.js


Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 1 - 0
dist/static/js/chunk-6605bc01.27930294.js


Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 0 - 0
dist/static/js/chunk-6af53446.afb9d41f.js


Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 0 - 0
dist/static/js/chunk-704289ef.33729d94.js


Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 0 - 0
dist/static/js/chunk-7e9b0612.9786dcbb.js


Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 0 - 0
dist/static/js/chunk-f55f91f0.1d231603.js


Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 1 - 0
dist/static/js/chunk-f55f91f0.dfd1737f.js


+ 7 - 0
src/constant/index.js

@@ -137,6 +137,13 @@ export const songUseType = {
   COMMON: '公用',
 }
 
+export const journalType = {
+  SYSTEM: '系统通知',
+  STUDENT: '学生申诉',
+  MUSICGROUP: '退团退课',
+  LEAVE: '请假处理',
+  VIPAPPLY: 'VIP申请审核',
+}
 export const jobNature = {
   PART_TIME: "兼职",
   FULL_TIME: "全职",

+ 4 - 0
src/utils/vueFilter.js

@@ -699,3 +699,7 @@ Vue.filter('songUseTypeFormat', value => {
 Vue.filter('rewardModeTypeFormat', value => {
   return constant.rewardModeType[value]
 })
+// 系统日志类型
+Vue.filter('journalTypeFormat', value => {
+  return constant.journalType[value]
+})

+ 71 - 0
src/views/workBenchManager/journal/index copy.vue

@@ -0,0 +1,71 @@
+<template>
+  <div class="m-container">
+    <h2>
+      <div class="squrt"></div>系统日志
+    </h2>
+    <div class="m-core">
+      <el-tabs type="border-card"
+               v-model.trim="activeIndex"
+               @tab-click="handleClick">
+        <el-tab-pane label="系统通知"
+                     v-if="permissionList.journalItem"
+                     name='0'>
+          <item v-if="activeIndex == 0" />
+        </el-tab-pane>
+        <el-tab-pane label="学员申诉"
+                     v-if="permissionList.studentComplain"
+                     name='1'>
+          <studentComplain v-if="activeIndex == 1" />
+        </el-tab-pane>
+        <el-tab-pane label="退团退课"
+                     v-if="permissionList.musicGroupCourse"
+                     name='2'>
+          <musicGroup v-if="activeIndex == 2" />
+        </el-tab-pane>
+        <el-tab-pane label="请假处理"
+                     v-if="permissionList.leaveOperation"
+                     name='3'>
+          <leaveOperation v-if="activeIndex == 3" />
+        </el-tab-pane>
+        <el-tab-pane label="VIP申请审核"
+                     v-if="permissionList.vipApply"
+                     name='4'>
+          <vipApply v-if="activeIndex == 4" />
+        </el-tab-pane>
+      </el-tabs>
+    </div>
+  </div>
+</template>
+<script>
+import item from './journalItem'
+import studentComplain from './studentComplain'
+import musicGroup from './musicGroup'
+import leaveOperation from './leaveOperation'
+import vipApply from './vipApply'
+import { permission } from '@/utils/directivePage'
+export default {
+  components: {
+    item, studentComplain, musicGroup, leaveOperation, vipApply
+  },
+  name: 'journal',
+  data () {
+    return {
+      activeIndex: '0',
+      permissionList: {
+        journalItem: permission('/journalItem'),
+        studentComplain: permission('/studentComplain'),
+        musicGroupCourse: permission('/musicGroupCourse'),
+        leaveOperation: permission('/leaveOperation'),
+        vipApply: permission('/vipApply')
+      }
+    }
+  },
+  methods: {
+    handleClick (val) {
+      this.activeIndex = val.name
+    }
+  }
+}
+</script>
+<style lang="scss" scoped>
+</style>

+ 164 - 46
src/views/workBenchManager/journal/index.vue

@@ -4,65 +4,183 @@
       <div class="squrt"></div>系统日志
     </h2>
     <div class="m-core">
-      <el-tabs type="border-card"
-               v-model.trim="activeIndex"
-               @tab-click="handleClick">
-        <el-tab-pane label="系统通知"
-                     v-if="permissionList.journalItem"
-                     name='0'>
-          <item v-if="activeIndex == 0" />
-        </el-tab-pane>
-        <el-tab-pane label="学员申诉"
-                     v-if="permissionList.studentComplain"
-                     name='1'>
-          <studentComplain v-if="activeIndex == 1" />
-        </el-tab-pane>
-        <el-tab-pane label="退团退课"
-                     v-if="permissionList.musicGroupCourse"
-                     name='2'>
-          <musicGroup v-if="activeIndex == 2" />
-        </el-tab-pane>
-        <el-tab-pane label="请假处理"
-                     v-if="permissionList.leaveOperation"
-                     name='3'>
-          <leaveOperation v-if="activeIndex == 3" />
-        </el-tab-pane>
-        <el-tab-pane label="VIP申请审核"
-                     v-if="permissionList.vipApply"
-                     name='4'>
-          <vipApply v-if="activeIndex == 4" />
-        </el-tab-pane>
+      <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 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-select>
+        </el-form-item>
+        <!-- <el-form-item>
+          <el-date-picker :clearable="false"
+                          v-model="searchForm.month"
+                          type="date"
+                          placeholder="选择年月"></el-date-picker>
+        </el-form-item> -->
+        <el-form-item>
+          <el-button type="danger" @click="onSearch">搜索</el-button>
+        </el-form-item>
+      </el-form>
+      <div class="tableWrap">
+        <el-table style="width: 100%"
+                  :header-cell-style="{background:'#EDEEF0',color:'#444'}"
+                  :data="tableList">
+          <el-table-column label="申请人" prop="userId" width="100px">
+            <template slot-scope="scope">
+              <el-badge :is-dot="!scope.row.readStatus" style="vertical-align: sub;"></el-badge>
+              {{ scope.row.userId }}
+            </template>
+          </el-table-column>
+          <el-table-column align="center" label="申请时间" prop="createOn"></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" @click="onLook(scope.row)">查看</el-button>
+            </template>
+          </el-table-column>
+        </el-table>
+        <pagination :total="pageInfo.total"
+                    :page.sync="pageInfo.page"
+                    :limit.sync="pageInfo.limit"
+                    :page-sizes="pageInfo.page_size"
+                    @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-model v-if="dialogStudent"
+               :dialogDetail="dialogDetail"
+               @close="dialogStudent = false" />
+    </el-dialog>
+    <!-- 请假 -->
+    <el-dialog :title="dialogTitle"
+               :visible.sync="dialogLeave"
+               width="800px">
+      <leave-model v-if="dialogLeave"
+               :dialogDetail="dialogDetail"
+               @close="dialogLeave = false" />
+    </el-dialog>
+    <!-- 请假 -->
+    <el-dialog :title="dialogTitle"
+               :visible.sync="dialogVipApply"
+               width="500px">
+      <vip-apply-model v-if="dialogVipApply"
+               :dialogDetail="dialogDetail"
+               @close="dialogVipApply = false" />
+    </el-dialog>
   </div>
 </template>
 <script>
-import item from './journalItem'
-import studentComplain from './studentComplain'
-import musicGroup from './musicGroup'
-import leaveOperation from './leaveOperation'
-import vipApply from './vipApply'
-import { permission } from '@/utils/directivePage'
+import cleanDeep from 'clean-deep';
+import pagination from "@/components/Pagination/index";
+import { queryCountOfUnread, sysMessageList, setRead } from '@/api/journal'
+import { journalType } from '@/constant'
+import StudentModel from './model/student'
+import LeaveModel from './model/leave'
+import vipApplyModel from './model/vipApply'
 export default {
-  components: {
-    item, studentComplain, musicGroup, leaveOperation, vipApply
-  },
+  components: { pagination, StudentModel, LeaveModel, vipApplyModel },
   name: 'journal',
   data () {
     return {
-      activeIndex: '0',
-      permissionList: {
-        journalItem: permission('/journalItem'),
-        studentComplain: permission('/studentComplain'),
-        musicGroupCourse: permission('/musicGroupCourse'),
-        leaveOperation: permission('/leaveOperation'),
-        vipApply: permission('/vipApply')
+      dialogSystem: false,
+      dialogStudent: false,
+      dialogLeave: false,
+      dialogVipApply: false,
+      dialogTitle: null,
+      dialogDetail: {},
+      searchForm: {
+        search: null,
+        group: 'SYSTEM',
+        readStatus: 0
+      },
+      tableList: [],
+      pageInfo: {
+        // 分页规则
+        limit: 10, // 限制显示条数
+        page: 1, // 当前页
+        total: 0, // 总条数
+        page_size: [10, 20, 40, 50] // 选择限制显示条数
       }
     }
   },
+  mounted() {
+    this.getList()
+  },
   methods: {
-    handleClick (val) {
-      this.activeIndex = val.name
+    onSearch() {
+      this.pageInfo.page = 1
+      this.getList()
+    },
+    onTabClick(elm) {
+      // 判断 group 是否一致
+      const searchForm = this.searchForm
+      if(elm.$attrs.value == searchForm.group) {
+        return
+      }
+      searchForm.group = elm.$attrs.value
+      this.getList()
+    },
+    async getList() {
+      const pageInfo = this.pageInfo
+      const params = Object.assign({}, this.searchForm)
+      params.rows = pageInfo.limit
+      params.page = pageInfo.page
+      await sysMessageList(params).then(res => {
+        if (res.code == 200) {
+          this.tableList = res.data.rows
+          pageInfo.total = res.data.total
+        }
+      })
+    },
+    async onLook(row) {
+      // 把当前消息变成已读
+      if(row.readStatus != 1) {
+        await setRead({ id: row.id })
+        row.readStatus = 1 // 手动把消息变一下状态
+      }
+      this.dialogTitle = journalType[row.group]
+      this.dialogDetail = 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;
+      }
     }
   }
 }

+ 180 - 0
src/views/workBenchManager/journal/model/leave.vue

@@ -0,0 +1,180 @@
+<template>
+    <div>
+        <el-form ref="leaveForm"
+                 :model="leaveForm"
+                 class="leaveForm"
+                 label-width="100px">
+            <el-alert title="已拒绝" show-icon center v-if="leaveForm.status == 'REJECT'" :closable="false" class="alert" type="error"></el-alert>
+            <el-alert title="已同意" show-icon center v-if="leaveForm.status == 'PASS'" :closable="false" class="alert" type="success"></el-alert>
+            <el-form-item label="开始时间">
+                <el-input disabled v-model.trim="leaveForm.startTime"></el-input>
+            </el-form-item>
+            <el-form-item label="结束时间">
+                <el-input disabled v-model.trim="leaveForm.endTime"></el-input>
+            </el-form-item>
+            <el-form-item label="备注">
+                <el-input type="textarea" disabled v-model.trim="leaveForm.remark"></el-input>
+            </el-form-item>
+        </el-form>
+        <!-- vip -->
+        <el-table :data="vipCourse"
+                    style="width: 100%"
+                    :header-cell-style="{background:'#EDEEF0',color:'#444'}">
+            <el-table-column label="编号" prop="before.id"></el-table-column>
+            <el-table-column label="类型"
+                            width="100px">
+                <template slot-scope="scope">
+                    {{ scope.row.before.type == "VIP" ? 'VIP课' : '乐团课' }}
+                </template>
+            </el-table-column>
+            <el-table-column label="班名"
+                            width="140px">
+                <template slot-scope="scope">
+                    <tooltip :content="scope.row.before.name" />
+                </template>
+            </el-table-column>
+            <el-table-column label="调整前日期">
+                <template slot-scope="scope">
+                    {{ scope.row.before.classDate | formatTimer }}
+                </template>
+            </el-table-column>
+            <el-table-column label="上课时间">
+                <template slot-scope="scope">
+                    {{ scope.row.before.startClassTime | getFormatTime(scope.row.before.endClassTime) }}
+                </template>
+            </el-table-column>
+            <el-table-column label="调整后日期">
+            <template slot-scope="scope"
+                        v-if="scope.row.before.type == 'VIP'">
+                {{ scope.row.after.classDate | formatTimer }}
+            </template>
+            </el-table-column>
+            <el-table-column label="调整后时间">
+            <template slot-scope="scope"
+                        v-if="scope.row.before.type == 'VIP'">
+                {{ scope.row.after.startClassTime | getFormatTime(scope.row.after.endClassTime) }}
+            </template>
+            </el-table-column>
+        </el-table>
+
+        <el-table :data="musicGroupCourse"
+                    style="width: 100%; padding-top: 10px;"
+                    :header-cell-style="{background:'#EDEEF0',color:'#444'}">
+            <el-table-column label="乐团编号"
+                            prop="before.musicGroupId">
+            </el-table-column>
+            <el-table-column label="类型">
+            <template slot-scope="scope">
+                {{ scope.row.before.type == "VIP" ? 'VIP课' : '乐团课' }}
+            </template>
+            </el-table-column>
+            <el-table-column label="班名">
+                <template slot-scope="scope">
+                    <tooltip :content="scope.row.before.name" />
+                </template>
+            </el-table-column>
+            <el-table-column label="调整前日期">
+                <template slot-scope="scope">
+                    {{ scope.row.before.classDate | formatTimer }}
+                </template>
+            </el-table-column>
+            <el-table-column label="上课时间">
+                <template slot-scope="scope">
+                    {{ scope.row.before.startClassTime | getFormatTime(scope.row.before.endClassTime) }}
+                </template>
+            </el-table-column>
+        </el-table>
+        <div slot="footer" class="dialog-footer" v-permission="'teacherLeaveRecord/approve'" v-if="leaveForm.status == 'ING'">
+            <el-button type="primary" @click="onSubmit('leaveForm', 'PASS')">确 定</el-button>
+            <el-button type="danger" @click="onSubmit('leaveForm', 'REJECT')">拒 绝</el-button>
+        </div>
+    </div>
+</template>
+
+<script>
+import { leaveQueryDetail, approve } from '@/api/journal'
+import Tooltip from '@/components/Tooltip'
+import dayjs from 'dayjs'
+export default {
+    props: ['dialogDetail'],
+    components: { Tooltip },
+    data() {
+        return {
+            leaveForm: {},
+            musicGroupCourse: [],
+            vipCourse: [],
+        }
+    },
+    mounted() {
+        this.__init()
+    },
+    methods: {
+        async __init() {
+            let { memo } = this.dialogDetail
+            memo = memo ? JSON.parse(memo) : null
+            if(!memo) { // 判断是否有参数
+                this.$message.error('参数有误')
+                return
+            }
+            await leaveQueryDetail({ id: memo.leaveRecordId }).then(res => {
+                let result = res.data
+                if (res.code == 200) {
+                    this.leaveForm = result
+                    let tempJson = result.coursesScheduleJson ? JSON.parse(result.coursesScheduleJson) : []
+                    let musicGroupCourse = []
+                    let vipCourse = []
+                    tempJson.forEach(item => {
+                        if (item.before.type == 'VIP') {
+                            vipCourse.push(item)
+                        } else {
+                            musicGroupCourse.push(item)
+                        }
+                    })
+                    this.musicGroupCourse = musicGroupCourse
+                    this.vipCourse = vipCourse
+                }
+            })
+        },
+        async onSubmit(formName, type) {
+            const params = {
+                id: this.leaveForm.id,
+                status: type,
+                userId: this.leaveForm.userId
+            }
+            const str = type == 'PASS' ? '同意' : '拒绝'
+            this.$confirm(`您确定${str}该请假申请吗?`, '提示', {
+                confirmButtonText: '确定',
+                cancelButtonText: '取消',
+                type: 'warning'
+            }).then(async () => {
+                await approve(params).then(res => {
+                    if (res.code == 200) {
+                        this.$message.success('处理成功')
+                        this.$listeners.close()
+                    } else {
+                        this.$message.error(res.msg)
+                    }
+                })
+            }).catch(() => {
+                //
+            })
+        }
+    },
+    filters: {
+        getFormatTime (tempA, tempB) {
+            return dayjs(tempA).format('HH') + ':' + dayjs(tempA).format('mm') + '-' + dayjs(tempB).format('HH') + ':' + dayjs(tempB).format('mm')
+        }
+    }
+}
+</script>
+
+<style lang="less" scoped>
+.dialog-footer{
+    margin-top: 20px;
+    display: block;
+    text-align: right;
+}
+.alert {
+   margin-bottom: 10px;
+}
+</style>

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

@@ -0,0 +1,171 @@
+<template>
+    <div>
+        <el-form ref="studentForm"
+                 :model="rateForm"
+                 v-if="studentForm"
+                 class="studentForm"
+                 label-width="110px">
+            <el-alert title="已拒绝" show-icon center v-if="studentForm.complaints.status == 'REJECT'" :closable="false" class="alert" type="error"></el-alert>
+            <el-alert title="已同意" show-icon center 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-permission="'courseSchedule/courseScheduleCommplaintAudit'" 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) {
+            const params = {
+                id: this.studentForm.complaints.id
+            }
+            if(type == 'reject') {
+                this.$confirm('您确定拒绝吗?', '提示', {
+                    confirmButtonText: '确定',
+                    cancelButtonText: '取消',
+                    type: 'warning'
+                }).then(async () => {
+                    params.status = 'REJECT'
+                    params.studentLiabilityRatio = 0
+                    params.teacherLiabilityRatio = 0
+                    await this.onComm(params)
+                }).catch(() => {
+                    //
+                });
+            } else {
+                this.$refs[formName].validate(async (valid) => {
+                    if(valid) {
+                        params.status = 'PASS'
+                        params.studentLiabilityRatio = this.rateForm.studentRate
+                        params.teacherLiabilityRatio = this.rateForm.teacherRate
+                        await this.onComm(params)
+                    }
+                })
+            }
+        },
+        async onComm(params) {
+            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>

+ 122 - 0
src/views/workBenchManager/journal/model/vipApply.vue

@@ -0,0 +1,122 @@
+<template>
+    <div>
+        <el-form ref="vipForm"
+                 :model="vipForm"
+                 class="vipForm"
+                 label-width="110px">
+            <el-alert title="已拒绝" show-icon center v-if="vipForm.auditStatus == 'REJECT'" :closable="false" class="alert" type="error"></el-alert>
+            <el-alert title="已同意" show-icon center v-if="vipForm.auditStatus == 'PASS'" :closable="false" class="alert" type="success"></el-alert>
+            <el-form-item label="开始时间">
+                <el-input disabled v-model.trim="vipForm.createTime"></el-input>
+            </el-form-item>
+            <el-form-item label="老师姓名">
+                <el-input disabled v-model.trim="vipForm.userName"></el-input>
+            </el-form-item>
+            <el-form-item label="线上课数">
+                <el-input disabled v-model.trim="vipForm.onlineClassesNum"></el-input>
+            </el-form-item>
+            <el-form-item label="线上课单价">
+                <el-input disabled v-model.trim="vipForm.onlineClassesUnitPrice"></el-input>
+            </el-form-item>
+            <el-form-item label="线上课课酬">
+                <el-input disabled v-model.trim="vipForm.onlineTeacherSalary"></el-input>
+            </el-form-item>
+            <el-form-item label="线下课数">
+                <el-input disabled v-model.trim="vipForm.offlineClassesNum"></el-input>
+            </el-form-item>
+            <el-form-item label="线下课单价">
+                <el-input disabled v-model.trim="vipForm.offlineClassesUnitPrice"></el-input>
+            </el-form-item>
+            <el-form-item label="线下课课酬">
+                <el-input disabled v-model.trim="vipForm.offlineTeacherSalary"></el-input>
+            </el-form-item>
+            <el-form-item label="科目名">
+                <el-input disabled v-model.trim="vipForm.subjectName"></el-input>
+            </el-form-item>
+            <el-form-item label="活动名称">
+                <el-input disabled v-model.trim="vipForm.vipGroupActivityName"></el-input>
+            </el-form-item>
+            <el-form-item label="商品价格">
+                <el-input disabled v-model.trim="vipForm.totalPrice"></el-input>
+            </el-form-item>
+            <el-form-item label="原因" prop="memo" :rules="[{ required: true, message: '请输入原因', trigger: 'blur' }]">
+                <el-input type="textarea" :disabled="vipForm.auditStatus !== 'ING'" v-model.trim="vipForm.memo"></el-input>
+            </el-form-item>
+        </el-form>
+        <div slot="footer" class="dialog-footer" v-permission="'vipGroupManage/vipApplyAudit'" v-if="vipForm.auditStatus === 'ING'">
+            <el-button type="primary" @click="onSubmit('vipForm', 'PASS')">确 定</el-button>
+            <el-button type="danger" @click="onSubmit('vipForm', 'REJECT')">拒 绝</el-button>
+        </div>
+    </div>
+</template>
+
+<script>
+import { getVipGroupDetailForAudit } from '@/api/vipSeting'
+import { vipApplyAudit } from '@/api/journal'
+export default {
+    props: ['dialogDetail'],
+    data() {
+        return {
+            vipForm: {},
+        }
+    },
+    mounted() {
+        this.__init()
+    },
+    methods: {
+        async __init() {
+            let { memo } = this.dialogDetail
+            memo = memo ? JSON.parse(memo) : null
+            if(!memo) { // 判断是否有参数
+                this.$message.error('参数有误')
+                return
+            }
+            await getVipGroupDetailForAudit({  vipGroupId: memo.vipGroupId }).then(res => {
+                let result = res.data
+                if (res.code == 200) {
+                    this.vipForm = result
+                }
+            })
+        },
+        async onSubmit(formName, type) {
+            const params = {
+                vipGroupId: this.vipForm.id,
+                reason: this.vipForm.memo,
+                auditStatus: type,
+            }
+            this.$refs[formName].validate(async (valid) => {
+                if(valid) {
+                    const str = type == 'PASS' ? '同意' : '拒绝'
+                    this.$confirm(`您确定${str}申请吗?`, '提示', {
+                        confirmButtonText: '确定',
+                        cancelButtonText: '取消',
+                        type: 'warning'
+                    }).then(async () => {
+                        await vipApplyAudit(params).then(res => {
+                            if (res.code == 200) {
+                                this.$message.success('处理成功')
+                                this.$listeners.close()
+                            } else {
+                                this.$message.error(res.msg)
+                            }
+                        })
+                    }).catch(() => {
+                        //
+                    })
+                }
+            })
+        }
+    }
+}
+</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)
         }
       })
     }

Kaikkia tiedostoja ei voida näyttää, sillä liian monta tiedostoa muuttui tässä diffissä