Ver Fonte

Merge branch '10/23-test' of http://git.dayaedu.com/molingzhide/dy-admin-manager into 10/23-test

Xiao_Mo há 4 anos atrás
pai
commit
25dc441514

+ 61 - 131
src/views/resetTeaming/components/resetPayList.vue

@@ -27,30 +27,18 @@
       <!-- <div class="newBand"
            @click="newPay"
            v-permission="'musicGroupPaymentCalender/add'">新建缴费</div> -->
-      <div
-        class="newBand"
-        @click="newUserPay"
-        v-permission="'musicGroupPaymentCalender/add'"
-      >
-        新建学员缴费
-      </div>
-      <div
-        class="newBand"
-        @click="newSchoolPay"
-        v-permission="'musicGroupPaymentCalender/add'"
-      >
-        新建学校缴费
-      </div>
-      <div
-        class="newBand"
-        v-permission="'/studentPayBase'"
-        @click="setStudentPay"
-      >
-        学员缴费设置
-      </div>
-      <div class="newBand" v-if="!isNewGropu" @click="onCreateQRCode">
-        续费二维码
-      </div>
+      <div class="newBand"
+           @click="newUserPay"
+           v-permission="'musicGroupPaymentCalender/add'">新建学员缴费</div>
+      <div class="newBand"
+           @click="newSchoolPay"
+           v-permission="'musicGroupPaymentCalender/add'">新建学校缴费</div>
+      <div class="newBand"
+           v-permission="'/studentPayBase'"
+           @click="setStudentPay">学员缴费设置</div>
+      <!-- <div class="newBand"
+      v-if="!isNewGropu"
+           @click="onCreateQRCode">续费二维码</div> -->
     </div>
     <div class="tableWrap">
       <el-table
@@ -144,28 +132,24 @@
             </div>
           </template>
         </el-table-column>
-        <el-table-column
-          align="center"
-          prop="memo"
-          label="备注"
-          width="200px"
-        ></el-table-column>
-        <el-table-column label="操作" width="100px" fixed="right">
+        <el-table-column align="center"
+                         prop="memo"
+                         label="备注"></el-table-column>
+        <el-table-column label="操作" fixed="right" min-width="150px">
           <template slot-scope="scope">
             <div>
-              <el-button
-                type="text"
-                @click="lookDetail(scope.row)"
-                v-permission="'/strudentPayInfo'"
-                >查看</el-button
-              >
-              <el-button
-                type="text"
-                v-if="scope.row.status == 'REJECT'"
-                v-permission="'musicGroupPaymentCalender/updateStartTime'"
-                @click="resetPay(scope.row)"
-                >修改</el-button
-              >
+              <el-button type="text"
+                         @click="lookDetail(scope.row)"
+                         v-permission="'/strudentPayInfo'">查看</el-button>
+              <el-button type="text"
+                         v-if="scope.row.paymentStatus == 0"
+                         v-permission="'musicGroupPaymentCalender/updateStartTime'"
+                         @click="resetPay(scope.row)">修改</el-button>
+              <el-button type="text"
+                         v-permission="'musicGroupPaymentCalender/del'"
+                         v-if="scope.row.paymentStatus == 0"
+                         @click="detelePay(scope.row)">删除</el-button>
+              <el-button type="text" v-if="!isNewGropu" @click="onCreateQRCode(scope.row)">续费二维码</el-button>
             </div>
           </template>
         </el-table-column>
@@ -356,29 +340,22 @@
       />
     </el-dialog>
 
-    <el-dialog title="续费二维码" :visible.sync="qrcodeStatus" width="300px">
-      <div class="left-code">
-        <div id="qrcode" class="qrcode code" ref="qrCodeUrl"></div>
-        <p class="code-url" v-if="codeUrl">{{ codeUrl }}</p>
-      </div>
-    </el-dialog>
-    <el-dialog
-      title="学员选择"
-      :visible.sync="chioseStudentVisible"
-      destroy-on-close
-      append-to-body
-      width="800px"
-    >
-      <setStudentFee
-        @chioseStudent="chioseStudent"
-        ref="setStudentFee"
-        :clearTale="clearStduent"
-      ></setStudentFee>
-      <div slot="footer" class="dialog-footer">
+    <el-dialog title="学员选择"
+               :visible.sync="chioseStudentVisible"
+               destroy-on-close
+               append-to-body
+               width='800px'>
+      <setStudentFee @chioseStudent='chioseStudent'
+                     ref='setStudentFee'
+                     :clearTale="clearStduent"></setStudentFee>
+      <div slot="footer"
+           class="dialog-footer">
         <el-button @click="chioseStudentVisible = false">取 消</el-button>
         <el-button type="primary" @click="submitNewPay">确 定</el-button>
       </div>
     </el-dialog>
+
+    <qr-code v-model="qrcodeStatus" title="续费二维码" :codeUrl="codeUrl" />
   </div>
 </template>
 <script>
@@ -387,28 +364,19 @@ import { getToken } from "@/utils/auth";
 import pagination from "@/components/Pagination/index";
 import load from "@/utils/loading";
 import qs from "qs";
-import dayjs from "dayjs";
-import QRCode from "qrcodejs2";
-import { vaildStudentUrl } from "@/utils/validate";
-import {
-  addMusicGroupPaymentCalender,
-  getMusicGroupPaymentCalender,
-  resetMusicGroupPaymentCalender,
-  delMusicGroupPaymentCalender,
-} from "@/api/buildTeam";
-import {
-  musicGroupPaymentCalenderQueryPage,
-  getMusicGroupStu,
-  musicGroupPaymentCalenderDetailBatchAdd,
-} from "../api";
-import setStudentFee from "./studentPayBase";
-import userPayForm from "../modals/user-pay-form";
-import schoolPayForm from "../modals/school-pay-form";
-import review from "../modals/review";
-import reviewDetail from "../modals/review-detail";
-import { userPaymentType } from "@/constant";
-import { objectToOptions } from "@/utils";
-import { payOrderTypeList } from "@/utils/searchArray";
+import dayjs from 'dayjs'
+import QrCode from "@/components/QrCode/index";
+import { vaildStudentUrl } from '@/utils/validate'
+import { addMusicGroupPaymentCalender, getMusicGroupPaymentCalender, resetMusicGroupPaymentCalender, delMusicGroupPaymentCalender } from "@/api/buildTeam";
+import { musicGroupPaymentCalenderQueryPage, getMusicGroupStu, musicGroupPaymentCalenderDetailBatchAdd } from '../api'
+import setStudentFee from './studentPayBase'
+import userPayForm from '../modals/user-pay-form'
+import schoolPayForm from '../modals/school-pay-form'
+import review from '../modals/review'
+import reviewDetail from '../modals/review-detail'
+import { userPaymentType } from '@/constant'
+import { objectToOptions } from '@/utils'
+import { payOrderTypeList}  from "@/utils/searchArray";
 export default {
   props: ["baseInfo", "isNewGropu"],
   components: {
@@ -416,6 +384,7 @@ export default {
     setStudentFee,
     userPayForm,
     schoolPayForm,
+    QrCode,
     review,
     reviewDetail,
   },
@@ -459,8 +428,6 @@ export default {
         },
       },
       qrcodeStatus: false, // 生成二维码
-      qrcodes: true,
-      qrcode: null,
       codeUrl: null,
       chioseStudentVisible: false,
       chioseStudentList: [],
@@ -514,14 +481,9 @@ export default {
       this.activeRow = null
       this.userVisible = true;
     },
-    getList() {
-      let musicGroupId = this.$route.query.id;
-      musicGroupPaymentCalenderQueryPage({
-        page: this.rules.page,
-        rows: this.rules.limit,
-        musicGroupId,
-        payUserType: this.searchForm.payUserType,
-      }).then((res) => {
+    getList () {
+      let musicGroupId = this.$route.query.id
+      return musicGroupPaymentCalenderQueryPage({ page: this.rules.page, rows: this.rules.limit, musicGroupId, payUserType:this.searchForm.payUserType }).then(res => {
         if (res.code == 200) {
           this.rules.total = res.data.total;
           this.tableList = res.data.rows;
@@ -533,36 +495,9 @@ export default {
         this.payForm.paymentValidEndDate = null;
       }
     },
-    async payedSubmited(data) {
-      try {
-        await this.getList();
-        this.chioseStudentVisible = true;
-        if (data) {
-          this.musicGroupPaymentCalenderId = data.musicGroupPaymentCalenderId;
-        }
-      } catch (error) {}
-    },
-    onCreateQRCode() {
-      // 生成报名二维码
-      this.qrcodeStatus = true;
-      let id = this.$route.query.id;
-
-      let teamName = this.$route.query.name;
-      setTimeout(() => {
-        document.getElementById("qrcode").innerHTML = "";
-        this.qrcode = new QRCode("qrcode", {
-          width: 200,
-          height: 200,
-          colorDark: "#000000",
-          colorLight: "#ffffff",
-          correctLevel: QRCode.CorrectLevel.H,
-        });
-        this.qrcode.makeCode(
-          vaildStudentUrl() + "/#/SporadicLogin?type=renew&musicGroupId=" + id
-        );
-        this.codeUrl =
-          vaildStudentUrl() + "/#/SporadicLogin?type=renew&musicGroupId=" + id;
-      }, 500);
+    onCreateQRCode (row) { // 生成报名二维码
+      this.qrcodeStatus = true
+      this.codeUrl = vaildStudentUrl() + '/#/musicGroupRenew?calenderId=' + row.id
     },
     chioseStudent(val) {
       this.chioseStudentList = val;
@@ -711,12 +646,7 @@ export default {
     chioseStudentVisible() {
       this.chioseStudentList = [];
     },
-    qrcodeStatus(val) {
-      if (!val) {
-        this.qrcode.clear();
-      }
-    },
-    payVisible(val) {
+    payVisible (val) {
       if (!val) {
         this.payForm = {
           startPaymentDate: null,

+ 21 - 4
src/views/teamDetail/components/modals/classroom-setting.vue

@@ -68,7 +68,7 @@
 import { getMusicCourseSettingsWithStudents, classGroupUpdate } from '@/api/buildTeam'
 import courseItem from "./classroom-setting-item";
 export default {
-  props: ["teacherList", "activeType", "courseTypeList", 'cooperationList', 'musicGroupId', 'detail'],
+  props: ["teacherList", "activeType", "courseTypeList", 'cooperationList', 'musicGroupId', 'detail', 'studentSubmitedData'],
   components: {
     courseItem,
   },
@@ -80,6 +80,7 @@ export default {
         classs: {}
       },
       collapses: [0],
+      courseTimes: {}
     };
   },
   created() {
@@ -92,12 +93,28 @@ export default {
     this.form.classs = classs
   },
   async mounted() {
-    console.log(this.detail)
     try {
-      await getMusicCourseSettingsWithStudents({
+      const studentIds = this.detail ? this.detail.subjectIdList : this.studentSubmitedData.seleched.join(',')
+      const res = await getMusicCourseSettingsWithStudents({
         musicGroupId: this.musicGroupId,
-        studentIds: this.detail.subjectIdList
+        studentIds: studentIds
       })
+      const classs = {}
+      const courseTimes = {}
+      for (const item of res.data) {
+        courseTimes[item.courseType] = item
+      }
+      for (const key in this.form.classs) {
+        if (this.form.classs.hasOwnProperty(key)) {
+          const item = this.form.classs[key]
+          if (courseTimes[key]) {
+            classs[key] = item
+          }
+        }
+      }
+      console.log(classs)
+      this.$set(this.form, 'classs', classs)
+      this.courseTimes = courseTimes
     } catch (error) {}
   },
   methods: {

+ 4 - 0
src/views/teamDetail/components/modals/select-student.vue

@@ -117,6 +117,10 @@ export default {
       }
       this.$refs.form.validate(valid => {
         if (valid) {
+          this.$listeners.submited({
+            seleched: this.seleched,
+            name: this.form.name
+          })
           this.$listeners.close()
         }
       })

+ 7 - 0
src/views/teamDetail/components/resetClass.vue

@@ -160,6 +160,7 @@
         :studentList="studentList"
         :soundList="soundList"
         :activeType="activeType"
+        @submited="studentSubmited"
         @close="studentVisible = false"
       />
     </el-dialog>
@@ -306,6 +307,7 @@
         :courseTypeList="courseTypeList"
         :cooperationList="cooperationList"
         :detail="infoDetail"
+        :studentSubmitedData="studentSubmitedData"
         @close="infoVisible = false"
       />
     </el-dialog>
@@ -773,6 +775,7 @@ export default {
       topForm: {
         classType: ""
       },
+      studentSubmitedData: null,
       infoDetail: null,
       classTimeList,
       tableList: [],
@@ -953,6 +956,10 @@ export default {
       // 获取分部所有老师
       // 助教是从员工表里选
     },
+    studentSubmited(data) {
+      this.studentSubmitedData = data
+      this.infoVisible = true
+    },
     recourse (row) {
       (this.weekList = [
         {