lex 2 anos atrás
pai
commit
81fa0c5118

+ 3 - 0
src/school/approval-manage/course-adjust.tsx

@@ -219,6 +219,9 @@ export default defineComponent({
 
                 forms.startTime = ''
               }}
+              onDestory={() => {
+                getList()
+              }}
               v-model:calendarDate={state.calendarDate}
             />
           </OPopup>

+ 1 - 1
src/school/companion-teacher/companion-detail.tsx

@@ -197,7 +197,7 @@ export default defineComponent({
           {state.classList.length <= 0 && <OEmpty btnStatus={false} tips="暂无班级" />}
         </CellGroup>
 
-        {state.detail.delFalg && (
+        {state.detail.id && !state.detail.delFlag && (
           <OSticky position="bottom">
             <div class={['btnGroup']} style={{ paddingLeft: '13px', paddingRight: '13px' }}>
               <Button type="primary" round block onClick={onDetail}>

+ 3 - 9
src/school/companion-teacher/index.tsx

@@ -86,7 +86,6 @@ export default defineComponent({
     const getDetail = async (id: string | number) => {
       try {
         const res = await request.get('/api-school/schoolStaff/detail/' + id)
-        console.log(res, 'res')
         form.schoolName = res.data.schoolName
         form.schoolId = res.data.schoolId
         form.url =
@@ -203,8 +202,8 @@ export default defineComponent({
             immediateCheck={false}
           >
             {form.list.map((item: any) => (
-              <CellGroup inset style={{ marginBottom: '12px' }}>
-                <Cell center isLink class={styles.manageCell} onClick={() => onDetail(item)}>
+              <CellGroup inset style={{ marginBottom: '12px' }} onClick={() => onDetail(item)}>
+                <Cell center isLink class={styles.manageCell}>
                   {{
                     icon: () => (
                       <Image class={styles.img} src={item.avatar ? item.avatar : iconTeacher} />
@@ -316,12 +315,7 @@ export default defineComponent({
           </div>
         </Popup>
 
-        <Popup
-          v-model:show={form.showMessage}
-          position="bottom"
-          style={{ background: 'transparent' }}
-          safeAreaInsetBottom={true}
-        >
+        <Popup v-model:show={form.showMessage} position="bottom" safeAreaInsetBottom={true}>
           <div class={styles.codeContainer}>
             <div class={styles.codeBottom}>
               <Icon

+ 4 - 1
src/school/manage-teacher/manage-detail.tsx

@@ -74,7 +74,10 @@ export default defineComponent({
 
         <CellGroup inset class={styles.detailCellGroup}>
           <Cell title={'手机号码'} value={detail.value.nickname}></Cell>
-          <Cell title={'性别'} value={detail.value.gender ? '男' : '女'}></Cell>
+          <Cell
+            title={'性别'}
+            value={detail.value.gender == 1 ? '男' : detail.value.gender == 0 ? '女' : ''}
+          ></Cell>
         </CellGroup>
 
         {/* 判断是否有权限 */}

+ 4 - 4
src/school/orchestra/compontent/information.tsx

@@ -55,12 +55,12 @@ export default defineComponent({
       state.actionType = val.value
 
       if (val.value === 'up') {
-        state.params.startTime = dayjs().year() + '-03-01 00:00:00'
-        state.params.endTime = dayjs().year() + '-09-01 00:00:00'
+        state.params.startTime = state.currentData[0] + '-03-01 00:00:00'
+        state.params.endTime = state.currentData[0] + '-09-01 00:00:00'
       } else if (val.value === 'down') {
         console.log(dayjs().add(1, 'year'), 'dayjs().add(1, ')
-        state.params.startTime = dayjs().year() + '-09-01 00:00:00'
-        state.params.endTime = dayjs().add(1, 'year').year() + '-03-01 00:00:00'
+        state.params.startTime = state.currentData[0] + '-09-01 00:00:00'
+        state.params.endTime = Number(state.currentData[0]) + 1 + '-03-01 00:00:00'
       }
       onSearch()
     }

+ 4 - 4
src/school/orchestra/compontent/plan.tsx

@@ -51,12 +51,12 @@ export default defineComponent({
       state.actionType = val.value
 
       if (val.value === 'up') {
-        state.params.startTime = dayjs().year() + '-03-01 00:00:00'
-        state.params.endTime = dayjs().year() + '-09-01 00:00:00'
+        state.params.startTime = state.currentData[0] + '-03-01 00:00:00'
+        state.params.endTime = state.currentData[0] + '-09-01 00:00:00'
       } else if (val.value === 'down') {
         console.log(dayjs().add(1, 'year'), 'dayjs().add(1, ')
-        state.params.startTime = dayjs().year() + '-09-01 00:00:00'
-        state.params.endTime = dayjs().add(1, 'year').year() + '-03-01 00:00:00'
+        state.params.startTime = state.currentData[0] + '-09-01 00:00:00'
+        state.params.endTime = Number(state.currentData[0]) + 1 + '-03-01 00:00:00'
       }
       onSearch()
     }

+ 1 - 1
src/school/orchestra/modal/student-list.tsx

@@ -100,7 +100,7 @@ export default defineComponent({
             ...state.params,
             subjectId: props.subjectId,
             orchestraId: state.orchestra.id,
-            classId: state.class.id
+            currentGradeNum: state.class.id
           }
         })
         state.listState.loading = false

+ 1 - 0
src/school/orchestra/modal/teacher-list.tsx

@@ -104,6 +104,7 @@ export default defineComponent({
     watch(
       () => props.courseType,
       () => {
+        console.log(props.courseType, 'course')
         forms.params.courseType = props.courseType
         onSearch()
       }

+ 5 - 4
src/school/train-planning/component/standard/index.tsx

@@ -273,11 +273,9 @@ export default defineComponent({
             prevMonth={(date: Date) => getList(date)}
             onSelect={(date: any) => {
               forms.calendarStatus = false
-              console.log(date, 'data')
-              if (forms.trainStartDate == date) {
-                console.log('true ------')
-              }
+
               forms.trainStartDate = date
+              forms.trainStartTime = null
 
               const days = dayjs(date).day()
               const selectDays = weekdays[days === 0 ? 6 : days - 1]
@@ -292,6 +290,9 @@ export default defineComponent({
                 }
               })
             }}
+            onDestory={() => {
+              getList()
+            }}
             v-model:calendarDate={forms.calendarDate}
           />
         </OPopup>

+ 13 - 3
src/school/train-planning/modal/calendar/index.tsx

@@ -47,6 +47,13 @@ export default defineComponent({
     selectDay: {
       type: Function,
       default: (obj: any) => {}
+    },
+    /**
+     * 销毁时
+     * */
+    onDestory: {
+      type: Function,
+      default: () => {}
     }
   },
   data() {
@@ -80,14 +87,14 @@ export default defineComponent({
   mounted() {
     // 初始化标题和最大显示日期
     this.subtitle = dayjs(this.calendarDate || new Date())
-      .add(1, 'day')
+      // .add(1, 'day')
       .format('YYYY年MM月')
     this.maxDate = dayjs(this.calendarDate || new Date())
-      .add(1, 'day')
+      // .add(1, 'day')
       .endOf('month')
       .toDate()
     this.minDate = dayjs(this.calendarDate || new Date())
-      .add(1, 'day')
+      // .add(1, 'day')
       .toDate()
 
     console.log(this.list, 'this.list')
@@ -150,6 +157,9 @@ export default defineComponent({
       this.$emit('update:calendarDate', dayjs(date).format('YYYY-MM-DD'))
     }
   },
+  unmounted() {
+    this.onDestory()
+  },
   render() {
     return (
       <div class={styles.calendarContainer}>

+ 19 - 1
src/school/train-planning/modal/practice-class/index.tsx

@@ -15,7 +15,7 @@ import {
   Popup,
   Tag
 } from 'vant'
-import { defineComponent, onMounted, reactive } from 'vue'
+import { defineComponent, onMounted, reactive, watch } from 'vue'
 import styles from './index.module.less'
 import iconTeacher from '@common/images/icon_teacher.png'
 import { state as baseState } from '@/state'
@@ -37,6 +37,7 @@ export default defineComponent({
       orchestraId: null as any,
       orchestraName: null as any,
       orchestraList: [] as any,
+      isClick: false,
       list: [] as any,
       listState: {
         dataShow: true, // 判断是否有数据
@@ -85,6 +86,8 @@ export default defineComponent({
     const getList = async () => {
       // 查询没有设置指导老师的班级
       try {
+        if (forms.isClick) return
+        forms.isClick = true
         const { data } = await request.post('/api-school/classGroup/page', {
           data: {
             page: 1,
@@ -95,6 +98,7 @@ export default defineComponent({
             // orchestraType: 'DELIVERY'
           }
         })
+        forms.isClick = false
         // 班级数据
         forms.listState.loading = false
         const result = data || {}
@@ -109,9 +113,23 @@ export default defineComponent({
       } catch {
         forms.listState.dataShow = false
         forms.listState.finished = true
+        forms.isClick = false
       }
     }
 
+    // 监听班级类型变化
+    watch(
+      () => props.classType,
+      () => {
+        forms.params.page = 1
+        forms.list = []
+        forms.listState.dataShow = true // 判断是否有数据
+        forms.listState.loading = false
+        forms.listState.finished = false
+        getList()
+      }
+    )
+
     const onSelect = (type: string) => {
       forms.checkboxRefs[type].toggle()
     }

+ 25 - 17
src/student/music-group/pre-apply/component/order.tsx

@@ -87,10 +87,18 @@ export default defineComponent({
             paramName: 'refund_reason'
           }
         })
-
-        form.resionList = data.paramValue.split('\n')
-        form.resionList.push('其它原因')
-        // console.log(form.resionList, 'resionList')
+        const temp = data.paramValue.split('\n') || []
+        temp.forEach((item: any, index: number) => {
+          form.resionList.push({
+            text: item,
+            value: index + 1
+          })
+        })
+        form.resionList.push({
+          text: '其它原因',
+          value: 999
+        })
+        console.log(form.resionList, 'resionList')
       } catch {
         //
       }
@@ -99,22 +107,22 @@ export default defineComponent({
     // 确认退费
     const onConfirmRefund = async () => {
       try {
-        const status = form.checked === form.resionList.length - 1 && form.resion
-        if (form.checked) {
+        const status = form.checked === 999 && !form.resion
+        console.log(form.checked)
+        if (!form.checked) {
           showToast('请选择原因')
           return
         } else if (status) {
           showToast('请输入原因')
           return
         }
-        console.log({
-          merOrderNo: form.refundSelect.orderNo,
-          refundReason: status ? form.resion : form.resionList[form.checked]
-        })
+
+        const refundReason = form.resionList.find((item: any) => item.value === form.checked)
+
         await request.post('/api-student/userPaymentOrder/refundPayment', {
           data: {
             merOrderNo: form.refundSelect.orderNo,
-            refundReason: status ? form.resion : form.resionList[form.checked]
+            refundReason: refundReason.text
           }
         })
       } catch {
@@ -207,7 +215,7 @@ export default defineComponent({
 
         <Popup v-model:show={form.refundStatus} round style={{ width: '90%' }}>
           <div class={styles.container}>
-            <div class={[styles.dialogTitle, styles.dialogRefund]}>
+            <div class={styles.dialogTitle}>
               <i></i>
               申请退款
             </div>
@@ -223,16 +231,16 @@ export default defineComponent({
 
               <RadioGroup v-model={form.checked}>
                 {form.resionList &&
-                  form.resionList.map((item: any, index: number) => (
-                    <Cell style="padding: 16px 0;" onClick={() => (form.checked = index)}>
+                  form.resionList.map((item: any) => (
+                    <Cell style="padding: 16px 0;" onClick={() => (form.checked = item.value)}>
                       {{
-                        icon: () => <Radio name={index} />,
-                        title: () => <span style={'padding-left: 6px'}>{item}</span>
+                        icon: () => <Radio name={item.value} />,
+                        title: () => <span style={'padding-left: 6px'}>{item.text}</span>
                       }}
                     </Cell>
                   ))}
               </RadioGroup>
-              {form.checked === form.resionList.length - 1 && (
+              {form.checked === 999 && (
                 <Field
                   class={styles.phoneName}
                   v-model={form.resion}

+ 24 - 16
src/student/trade-record/component/paid-list.tsx

@@ -126,10 +126,18 @@ export default defineComponent({
             paramName: 'refund_reason'
           }
         })
-
-        form.resionList = data.paramValue.split('\n')
-        form.resionList.push('其它原因')
-        // console.log(form.resionList, 'resionList')
+        const temp = data.paramValue.split('\n') || []
+        temp.forEach((item: any, index: number) => {
+          form.resionList.push({
+            text: item,
+            value: index + 1
+          })
+        })
+        form.resionList.push({
+          text: '其它原因',
+          value: 999
+        })
+        console.log(form.resionList, 'resionList')
       } catch {
         //
       }
@@ -138,22 +146,22 @@ export default defineComponent({
     // 确认退费
     const onConfirmRefund = async () => {
       try {
-        const status = form.checked === form.resionList.length - 1 && form.resion
-        if (form.checked) {
+        const status = form.checked === 999 && !form.resion
+        console.log(form.checked)
+        if (!form.checked) {
           showToast('请选择原因')
           return
         } else if (status) {
           showToast('请输入原因')
           return
         }
-        console.log({
-          merOrderNo: form.refundSelect.orderNo,
-          refundReason: status ? form.resion : form.resionList[form.checked]
-        })
+
+        const refundReason = form.resionList.find((item: any) => item.value === form.checked)
+
         await request.post('/api-student/userPaymentOrder/refundPayment', {
           data: {
             merOrderNo: form.refundSelect.orderNo,
-            refundReason: status ? form.resion : form.resionList[form.checked]
+            refundReason: refundReason.text
           }
         })
       } catch {
@@ -296,16 +304,16 @@ export default defineComponent({
 
               <RadioGroup v-model={form.checked}>
                 {form.resionList &&
-                  form.resionList.map((item: any, index: number) => (
-                    <Cell style="padding: 16px 0;" onClick={() => (form.checked = index)}>
+                  form.resionList.map((item: any) => (
+                    <Cell style="padding: 16px 0;" onClick={() => (form.checked = item.value)}>
                       {{
-                        icon: () => <Radio name={index} />,
-                        title: () => <span style={'padding-left: 6px'}>{item}</span>
+                        icon: () => <Radio name={item.value} />,
+                        title: () => <span style={'padding-left: 6px'}>{item.text}</span>
                       }}
                     </Cell>
                   ))}
               </RadioGroup>
-              {form.checked === form.resionList.length - 1 && (
+              {form.checked === 999 && (
                 <Field
                   class={styles.phoneName}
                   v-model={form.resion}

+ 0 - 1
src/student/trade-record/component/refund-list.tsx

@@ -89,7 +89,6 @@ export default defineComponent({
       getList()
 
       Object.keys(orderType).forEach((key) => {
-        console.log(key)
         form.typeArray.push({
           text: orderType[key],
           value: key

+ 0 - 1
src/student/trade-record/component/wait-pay.tsx

@@ -119,7 +119,6 @@ export default defineComponent({
       getList()
 
       Object.keys(orderType).forEach((key) => {
-        console.log(key)
         form.typeArray.push({
           text: orderType[key],
           value: key

+ 10 - 2
src/student/trade-record/index.tsx

@@ -10,8 +10,9 @@ import styles from './index.module.less'
 export default defineComponent({
   name: 'trade-record',
   setup() {
+    const tabs = sessionStorage.getItem('tradeRecordTabs')
     const state = reactive({
-      tabValue: 'paid' as 'wait_pay' | 'paid' | 'refund',
+      tabValue: (tabs || 'wait_pay') as 'wait_pay' | 'paid' | 'refund',
       height: 50
     })
     const tabsRef = ref()
@@ -24,7 +25,14 @@ export default defineComponent({
       <div class={styles.tradeRecord}>
         <OSticky position="top">
           <div ref={tabsRef}>
-            <Tabs lineWidth={20} lineHeight={4} v-model:active={state.tabValue}>
+            <Tabs
+              lineWidth={20}
+              lineHeight={4}
+              v-model:active={state.tabValue}
+              onChange={(val: any) => {
+                sessionStorage.setItem('tradeRecordTabs', val)
+              }}
+            >
               <Tab title="待完成" name="wait_pay"></Tab>
               <Tab title="已完成" name="paid"></Tab>
               <Tab title="退费" name="refund"></Tab>