mo 3 years ago
parent
commit
ec85a14e75

+ 2 - 1
src/router/notKeepAliveList.js

@@ -118,5 +118,6 @@ export default [
   '/business/liveClassDetail',
   '/liveClassManager',
   '/tenantApply',
-  '/platformAdminManger' // 平台员工管理
+  '/platformAdminManger', // 平台员工管理
+  '/studentManager/smallStudentManager'
 ]

+ 14 - 0
src/utils/searchArray.js

@@ -583,6 +583,20 @@ export const visitChiose1 = [{
     }]
   },
   {
+    value: '小课回访',
+    label: '小课回访',
+    children: [{
+      value: 'VIP课回访',
+      label: 'VIP课回访'
+    },{
+      value: '乐理课回访',
+      label: '乐理课回访'
+    },{
+      value: '网管课回访',
+      label: '网管课回访'
+    }]
+  },
+  {
     value: '团练宝',
     label: '团练宝',
     children: [{

+ 29 - 29
src/views/smallStudentManager/api.js

@@ -1,29 +1,29 @@
-import request2 from '@/utils/request2'
-
-// 获取首页数据
-export const studentSmallClassStatisticsSum = data => request2({
-  url: '/api-web/studentStatistics/studentSmallClassStatisticsSum',
-  params: data,
-  method: 'get',
-})
-
-
-// 获取首页数据
-export const studentSmallClassStatisticsSumForDate = data => request2({
-  url: '/api-web/studentStatistics/studentSmallClassStatisticsSumForDate',
-  data: data,
-  requestType: 'form',
-  method: 'post',
-})
-
-
-// 获取首页数据
-export const queryPage = data => request2({
-  url: '/api-web/studentStatistics/queryPage',
-  data: data,
-  requestType: 'form',
-  method: 'post',
-})
-
-// studentStatistics/queryPage分页查询
-// studentStatistics/studentSmallClassStatisticsSum?groupType=VIP汇总
+import request2 from '@/utils/request2'
+
+// 学员数据统计
+export const studentSmallClassStatisticsSum = data => request2({
+  url: '/api-web/studentStatistics/studentSmallClassStatisticsSum',
+  params: data,
+  method: 'get',
+})
+
+
+// 剩余课时统计
+export const studentSmallClassStatisticsSumForDate = data => request2({
+  url: '/api-web/studentStatistics/studentSmallClassStatisticsSumForDate',
+  data: data,
+  requestType: 'form',
+  method: 'post',
+})
+
+
+// 获取首页数据
+export const queryPage = data => request2({
+  url: '/api-web/studentStatistics/queryPage',
+  data: data,
+  requestType: 'form',
+  method: 'post',
+})
+
+// studentStatistics/queryPage分页查询
+// studentStatistics/studentSmallClassStatisticsSum?groupType=VIP汇总

+ 192 - 0
src/views/smallStudentManager/components/addVisit.vue

@@ -0,0 +1,192 @@
+<template>
+  <div>
+    <el-form
+      :model="visitForm"
+      label-width="120px"
+      label-position="right"
+      ref="visitForm"
+      :rules="visitRules"
+    >
+      <el-form-item label="学生姓名">
+        <p>{{ userName }}</p>
+      </el-form-item>
+      <el-form-item label="回访类型" prop="visitType">
+        <el-cascader
+          :disabled="isMainGo || !!useVisitType"
+          expand-trigger="hover"
+          clearable
+          style="width: 80% !important"
+          placeholder="请选择回访类型"
+          :options="visitChiose"
+          v-model="visitForm.visitType"
+        >
+        </el-cascader>
+      </el-form-item>
+      <el-form-item label="回访日期" prop="visitTime">
+        <el-date-picker
+          v-model.trim="visitForm.visitTime"
+          align="right"
+          type="date"
+          style="width: 80% !important"
+          placeholder="选择日期"
+          value-format="yyyy-MM-dd"
+          :picker-options="pickerOptions"
+        ></el-date-picker>
+      </el-form-item>
+      <el-form-item label="学员情况" prop="overview">
+        <el-input
+          type="textarea"
+          v-model="visitForm.overview"
+          style="width: 80% !important"
+          placeholder="请输入学员情况"
+          :rows="3"
+          maxlength="50"
+          show-word-limit
+        ></el-input>
+      </el-form-item>
+      <el-form-item label="家长反馈" prop="feedbackType">
+        <el-radio-group v-model="visitForm.feedbackType">
+          <el-radio-button
+            :label="item.value"
+            v-for="(item, index) in feedbackTypeList"
+            :key="index"
+            >{{ item.label }}</el-radio-button
+          >
+        </el-radio-group>
+      </el-form-item>
+      <el-form-item label="原因" prop="feedback" :rules="[{ required: isRequire, message: '请输入家长反馈内容' }]">
+        <el-input
+          type="textarea"
+          v-model="visitForm.feedback"
+          style="width: 80% !important"
+          placeholder="原因"
+          :rows="3"
+          maxlength="50"
+          show-word-limit
+        ></el-input>
+      </el-form-item>
+    </el-form>
+    <div
+      slot="footer"
+      class="dialog-footer"
+      style="text-align: right; margin-right: 15%"
+    >
+      <el-button @click="$emit('close')">取 消</el-button>
+      <el-button type="primary" @click="submitAddVisit">确 定</el-button>
+    </div>
+  </div>
+</template>
+<script>
+import cleanDeep from "clean-deep";
+import {
+  visitChiose,
+  visitChiose1,
+  feedbackTypeList,
+} from "@/utils/searchArray";
+import { addVisit } from "@/views/returnVisitManager/api";
+export default {
+  // useVisitType 自定义回访类型
+  props: ["useVisitType","detail", "username", "isMainGo", ],
+  data() {
+    return {
+      feedbackTypeList,
+      visitChiose,
+      visitForm: {
+        musicGroupId: "",
+        overview: "",
+        purpose: "",
+        studentId: "",
+        type: "",
+        visitTime: "",
+        visitType: "",
+        feedback: "",
+        studentName: "",
+        feedbackType: "",
+      },
+      visitRules: {
+        overview: [{ required: true, message: "请输入学生近况" }],
+        feedback: [{ required: true, message: "请输入家长反馈" }],
+        visitTime: [{ required: true, message: "请输入回访时间" }],
+        visitType: [{ required: true, message: "请选择回访类型" }],
+        feedbackType: [{ required: true, message: "请选择家长反馈" }],
+      },
+      recordVisible: false,
+      workVisible: false,
+      pickerOptions: {
+        firstDayOfWeek: 1,
+        disabledDate(time) {
+          return time.getTime() > new Date().getTime();
+        },
+      },
+    };
+  },
+  mounted() {
+    console.log(this.useVisitType,'useVisitType',this.detail)
+    if (this.isMainGo) {
+      this.visitChiose = visitChiose1;
+      this.$set(this.visitForm, "visitType", ["常规回访", "考勤申诉"]);
+    } else if (this.useVisitType) {
+
+      this.visitChiose = visitChiose1;
+      this.$set(this.visitForm, "visitType", this.useVisitType);
+    } else {
+      this.visitChiose = visitChiose;
+    }
+  },
+  computed: {
+    userName() {
+      return (
+        this.username ||
+        this.detail.user?.username ||
+        this.detail.realName ||
+        this.detail.userName ||
+        this.detail.studentName
+      );
+    },
+    studentId() {
+      return this.detail.userId || this.detail.studentId;
+    },
+    isRequire(){
+      if(this.visitForm.feedbackType == 'THINKING' || this.visitForm.feedbackType == 'PENDING_PAYMENT'){
+        return false
+      }else {
+        return true
+      }
+    }
+  },
+  methods: {
+    submitAddVisit() {
+      this.$refs.visitForm.validate((res) => {
+        if (res) {
+          const { visitType, ...rest } = this.visitForm;
+          const data = {
+            ...rest,
+            objectId: this.detail.id,
+            studentName: this.userName,
+            musicGroupId: this.detail.musicGroupId,
+            studentId: this.studentId,
+            type: visitType[0],
+            purpose: visitType[1],
+          };
+          addVisit(cleanDeep(data)).then((res) => {
+            if (res.code === 200) {
+              this.$message.success("保存成功");
+              this.$emit("close");
+              this.$emit("submited");
+            }
+          });
+        }
+      });
+    },
+  },
+
+};
+</script>
+<style lang="scss" scoped>
+.visitBtnWrap {
+  position: absolute;
+  right: 90px;
+  top: 82px;
+  z-index: 20;
+}
+</style>

+ 19 - 15
src/views/smallStudentManager/components/tableList.vue

@@ -316,7 +316,7 @@
         </el-table-column>
         <el-table-column align="center" width="180px" label="操作">
           <template slot-scope="scope">
-            <el-button type="text" @click="setStudent(scope.row)"
+            <el-button type="text" @click="recordVisit(scope.row)"
               >回访记录</el-button
             >
           </template>
@@ -331,6 +331,15 @@
         @pagination="getList"
       />
     </div>
+     <el-dialog
+      title="回访记录"
+      width="1000px"
+      v-if="visitVisiable"
+      :close-on-click-modal="false"
+      :visible.sync="visitVisiable"
+    >
+      <visiList  :studentId='activeRow.userId' :studentName="activeRow.studentBasicInfo.userName" :groupType="groupType"/>
+    </el-dialog>
   </div>
 </template>
 
@@ -339,11 +348,13 @@ import pagination from "@/components/Pagination/index";
 import { queryPage } from "../api";
 import { feedbackTypeList } from "@/utils/searchArray";
 import { getTimes } from "@/utils";
+import visiList from './visiList.vue'
 export default {
   name: "tableList",
   props: ["groupType"],
   components: {
     pagination,
+    visiList
   },
   data() {
     return {
@@ -360,15 +371,7 @@ export default {
         timer: "",
       },
       tableList: [
-        {
-          name: "",
-          phone: "",
-          organName: "",
-          teacherName: "",
-          createTime: "",
-          status: "",
-          id: "",
-        },
+
       ],
       feedbackTypeList,
       pageInfo: {
@@ -378,6 +381,8 @@ export default {
         total: 0, // 总条数
         page_size: [10, 20, 40, 50], // 选择限制显示条数
       },
+      visitVisiable:false,
+      activeRow:null
     };
   },
   async mounted() {
@@ -414,11 +419,6 @@ export default {
       } catch {}
     },
     gotoStudent(search) {
-      // this.$router.push({
-      //   name: "teamCourseList",
-      //   params: { courseIdSearch: row.id },
-      // });
-
       this.$router.push({
         name: "studentList",
         params: { search: search },
@@ -429,6 +429,10 @@ export default {
         name: "teacherList",
         params: { search: search },
       });
+    },
+    recordVisit(row){
+      this.activeRow = row;
+      this.visitVisiable = true
     }
   },
 };

+ 208 - 108
src/views/smallStudentManager/components/visiList.vue

@@ -1,128 +1,228 @@
 <template>
-   <div class="m-core">
-      <save-form
-        :inline="true"
-        @submit="search"
-        @reset="onReSet"
-        :model="searchForm"
-      >
-        <el-form-item prop="teacher">
-          <el-input
-            placeholder="老师姓名、编号"
-            v-model.trim="searchForm.teacher"
-          ></el-input>
-        </el-form-item>
-        <el-form-item prop="visiterType">
-          <el-select
-            v-model.trim="searchForm.visiterType"
-            placeholder="请选择角色"
-            clearable
-            filterable
-          >
-            <el-option value="TEACHER" label="指导老师"></el-option>
-            <el-option value="EDU_TEACHER" label="乐团主管"></el-option>
-          </el-select>
-        </el-form-item>
-        <!-- @change="handleChange" -->
-        <el-form-item prop="feedbackType">
-           <el-select
-            v-model.trim="searchForm.feedbackType"
-            placeholder="请选择回访结果"
-            clearable
-            filterable
-          >
-            <el-option :value="item.value" :label="item.label" v-for="(item,index) in feedbackTypeList" :key="index"></el-option>
-
-          </el-select>
-        </el-form-item>
-        <el-form-item>
-          <el-date-picker
-            v-model.trim="searchForm.timer"
-            style="width: 420px"
-            type="daterange"
-            value-format="yyyy-MM-dd"
-            range-separator="至"
-            start-placeholder="回访开始日期"
-            end-placeholder="回访结束日期"
-            :picker-options="{
-              firstDayOfWeek: 1,
-            }"
-          >
-          </el-date-picker>
-        </el-form-item>
-        <el-form-item>
-          <el-button type="danger" native-type="submit">搜索</el-button>
-          <el-button native-type="reset" type="primary">重置</el-button>
-        </el-form-item>
-      </save-form>
-      <div class="tableWrap">
-        <el-table
-          :data="tableList"
-          :header-cell-style="{ background: '#EDEEF0', color: '#444' }"
+  <div class="m-core">
+    <el-form :inline="true" :model="searchForm">
+      <el-form-item prop="teacher">
+        <el-input
+          placeholder="老师姓名、编号"
+          v-model.trim="searchForm.teacher"
+        ></el-input>
+      </el-form-item>
+      <el-form-item prop="visiterType">
+        <el-select
+          v-model.trim="searchForm.visiterType"
+          placeholder="请选择角色"
+          clearable
+          filterable
         >
-          <el-table-column align="center" prop="teacherName" label="老师姓名">
-            <template slot-scope="scope">
-              <copy-text>{{ scope.row.teacherName }}</copy-text>
-            </template>
-          </el-table-column>
-          <el-table-column align="center" prop="visiterType" label="角色">
-            <template slot-scope="scope">
-              <div>
-                {{ scope.row.visiterType | visiterType }}
-              </div>
-            </template>
-          </el-table-column>
-
-
+          <el-option value="TEACHER" label="指导老师"></el-option>
+          <el-option value="EDU_TEACHER" label="乐团主管"></el-option>
+        </el-select>
+      </el-form-item>
+      <!-- @change="handleChange" -->
+      <el-form-item prop="feedbackType">
+        <el-select
+          v-model.trim="searchForm.feedbackType"
+          placeholder="请选择回访结果"
+          clearable
+          filterable
+        >
+          <el-option
+            :value="item.value"
+            :label="item.label"
+            v-for="(item, index) in feedbackTypeList"
+            :key="index"
+          ></el-option>
+        </el-select>
+      </el-form-item>
+      <el-form-item>
+        <el-date-picker
+          key="visiList"
+          v-model.trim="searchForm.timer"
+          style="width: 420px"
+          type="daterange"
+          value-format="yyyy-MM-dd"
+          range-separator="至"
+          start-placeholder="回访开始日期"
+          end-placeholder="回访结束日期"
+          :picker-options="{
+            firstDayOfWeek: 1,
+          }"
+        >
+        </el-date-picker>
+      </el-form-item>
+      <el-form-item>
+        <el-button type="danger" @click="search">搜索</el-button>
+        <el-button type="primary" @click="onReSet">重置</el-button>
+      </el-form-item>
+    </el-form>
+    <auth auths="sysCoupon/add">
+      <el-button type="primary" style="margin-bottom: 20px" @click="addVisit"
+        >新增回访</el-button
+      >
+    </auth>
+    <div class="tableWrap">
+      <el-table
+        :data="tableList"
+        :header-cell-style="{ background: '#EDEEF0', color: '#444' }"
+      >
+        <el-table-column align="center" prop="teacherName" label="老师姓名">
+          <template slot-scope="scope">
+            <copy-text>{{ scope.row.teacherName }}</copy-text>
+          </template>
+        </el-table-column>
+        <el-table-column align="center" prop="visiterType" label="角色">
+          <template slot-scope="scope">
+            <div>
+              {{ scope.row.visiterType | visiterType }}
+            </div>
+          </template>
+        </el-table-column>
 
-          <el-table-column align="center" prop="visitTime" label="回访时间">
-            <template slot-scope="scope">
-              <div>
-                {{
-                  scope.row.visitTime ? scope.row.visitTime.split(" ")[0] : "--"
-                }}
-              </div>
-            </template>
-          </el-table-column>
-                <el-table-column align="center" prop="type" label="回访结果">
-                  <template slot-scope="scope">
-                    <div>
-                      {{scope.row.feedbackType | feedbackTypeFilter}}
-                    </div>
-                  </template>
-          </el-table-column>
-        </el-table>
-        <pagination
-          sync
-          :total.sync="rules.total"
-          :page.sync="rules.page"
-          :limit.sync="rules.limit"
-          :page-sizes="rules.page_size"
-          @pagination="getList"
-        />
-      </div>
+        <el-table-column align="center" prop="visitTime" label="回访时间">
+          <template slot-scope="scope">
+            <div>
+              {{
+                scope.row.visitTime ? scope.row.visitTime.split(" ")[0] : "--"
+              }}
+            </div>
+          </template>
+        </el-table-column>
+        <el-table-column align="center" prop="type" label="回访结果">
+          <template slot-scope="scope">
+            <div>
+              {{ scope.row.feedbackType | feedbackTypeFilter }}
+            </div>
+          </template>
+        </el-table-column>
+        <el-table-column align="center" prop="type" label="原因">
+          <template slot-scope="scope">
+            <div>
+              <overflow-text
+                width="100%"
+                :text="scope.row.feedback"
+              ></overflow-text>
+            </div>
+          </template>
+        </el-table-column>
+      </el-table>
+      <pagination
+        sync
+        :total.sync="rules.total"
+        :page.sync="rules.page"
+        :limit.sync="rules.limit"
+        :page-sizes="rules.page_size"
+        @pagination="getList"
+      />
     </div>
+    <el-dialog
+      title="新增回访"
+      width="800px"
+      v-if="visitVisiable"
+      :close-on-click-modal="false"
+      :visible.sync="visitVisiable"
+      append-to-body
+    >
+      <addVisit
+        :detail="detail"
+        :useVisitType="useVisitType"
+        @close="visitVisiable = false"
+        @submited="getList"
+
+      />
+    </el-dialog>
+  </div>
 </template>
 <script>
-import {feedbackTypeList} from '@/utils/searchArray'
+import { feedbackTypeList } from "@/utils/searchArray";
+import { getVisitList } from "@/views/returnVisitManager/api";
+import pagination from "@/components/Pagination/index";
+import { getTimes } from "@/utils";
+import cleanDeep from "clean-deep";
+import addVisit from "./addVisit";
 export default {
-  data(){
+  components: { pagination, addVisit },
+  props: ["studentId", "studentName", "groupType"],
+  data() {
     return {
-      feedbackTypeList,
-        rules: {
+      searchForm: {
+        teacher: "",
+        visiterType: "",
+        feedbackType: "",
+        timer: [],
+      },
+      rules: {
         // 分页规则
         limit: 10, // 限制显示条数
         page: 1, // 当前页
         total: 0, // 总条数
         page_size: [10, 20, 40, 50], // 选择限制显示条数
       },
+      tableList: [],
+      feedbackTypeList: feedbackTypeList,
+      visitVisiable: false,
+      detail: null,
+      useVisitType: null,
+    };
+  },
+  mounted() {
+
+    this.searchForm.studentId = this.studentId;
+
+    this.getList();
+  },
+  methods: {
+    search() {
+      this.rules.page = 1;
+      this.getList();
+    },
+    onReSet() {
+      this.searchForm = {
+        teacher: "",
+        visiterType: "",
+        feedbackType: "",
+        timer: [],
+      };
+      this.search();
+    },
+    getList() {
+      // cleanDeep
+      let { timer, ...rest } = this.searchForm;
+      let params = {
+        studentId: this.studentId,
+        ...rest,
+        page: this.rules.page,
+        rows: this.rules.limit,
+        ...getTimes(timer, ["startTime", "endTime"]),
+      };
+      getVisitList(cleanDeep(params)).then((res) => {
+        if (res.code == 200) {
+          this.tableList = res.data.rows;
+          this.rules.total = res.data.total;
+        }
+      });
+    },
+    addVisit() {
+      // 新增回访
+      // row.userId = row.studentId;
+      // detail   userId userName
+      // this.detail = row;
+      this.detail = {
+        userId: this.studentId,
+        userName: this.studentName,
+      };
+     if (this.groupType == "PRACTICE") {
+      this.useVisitType = ["小课回访", "网管课回访"];
+    } else if (this.groupType == "THEORY") {
+      this.useVisitType = ["小课回访", "乐理课回访"];
+    } else {
+      this.useVisitType = ["小课回访", "VIP课回访"];
     }
+    console.log(this.detail ,this.useVisitType)
+      this.visitVisiable = true;
+    },
   },
-  mounted(){},
-  methods:{}
-}
+};
 </script>
 
 <style lang="scss" scoped>
-
 </style>

+ 47 - 47
src/views/smallStudentManager/index.vue

@@ -1,47 +1,47 @@
-<!--  -->
-<template>
-  <div class="m-container">
-    <h2>
-      <div class="squrt"></div>
-      小课学员管理
-    </h2>
-    <div class="m-core">
-      <tab-router
-        v-model.trim="activeIndex"
-        type="card"
-        @tab-click="handleClick"
-      >
-        <el-tab-pane label="VIP课" lazy name="1">
-          <vipClass v-if="activeIndex === '1'" />
-        </el-tab-pane>
-        <el-tab-pane label="乐理课" lazy name="2">
-          <theoryClass v-if="activeIndex === '2'" />
-        </el-tab-pane>
-        <el-tab-pane label="网管课" lazy name="3">
-          <auditionClass v-if="activeIndex === '3'" />
-        </el-tab-pane>
-      </tab-router>
-    </div>
-  </div>
-</template>
-
-<script>
-import vipClass from './vipClass';
-import theoryClass from './theoryClass';
-import auditionClass from './auditionClass';
-export default {
-  components: { vipClass, theoryClass, auditionClass },
-  data() {
-    return {
-      activeIndex: "1",
-    };
-  },
-  methods: {
-    handleClick(evt) {
-      // this.changeHash(evt.name);
-    },
-  },
-};
-</script>
-<style lang='scss' scoped>
-</style>
+<!--  -->
+<template>
+  <div class="m-container">
+    <h2>
+      <div class="squrt"></div>
+      小课学员管理
+    </h2>
+    <div class="m-core">
+      <tab-router
+        v-model.trim="activeIndex"
+        type="card"
+        @tab-click="handleClick"
+      >
+        <el-tab-pane label="VIP课" lazy name="1"  v-permission="'smallStudentManager/vipClass'">
+          <vipClass v-if="activeIndex === '1'" />
+        </el-tab-pane>
+        <el-tab-pane label="乐理课" lazy name="2" v-permission="'smallStudentManager/theoryClass'">
+          <theoryClass v-if="activeIndex === '2'" />
+        </el-tab-pane>
+        <el-tab-pane label="网管课" lazy name="3"  v-permission="'smallStudentManager/PRACTICE'">
+          <auditionClass v-if="activeIndex === '3'" />
+        </el-tab-pane>
+      </tab-router>
+    </div>
+  </div>
+</template>
+
+<script>
+import vipClass from './vipClass';
+import theoryClass from './theoryClass';
+import auditionClass from './auditionClass';
+export default {
+  components: { vipClass, theoryClass, auditionClass },
+  data() {
+    return {
+      activeIndex: "1",
+    };
+  },
+  methods: {
+    handleClick(evt) {
+      // this.changeHash(evt.name);
+    },
+  },
+};
+</script>
+<style lang='scss' scoped>
+</style>