lex 2 år sedan
förälder
incheckning
3b21b6c2ed

+ 1 - 1
src/school/approval-manage/course-adjust.tsx

@@ -251,7 +251,7 @@ export default defineComponent({
           >
             <Timer
               timerList={state.timerList}
-              times={state.trainTimer}
+              times={courseDetail.value.singleCourseTime || 0}
               onClose={() => (state.showPopoverCourseTime = false)}
               onConfirm={(val: any) => {
                 forms.startTime = dayjs(val).format('YYYY-MM-DD HH:mm:ss')

+ 3 - 1
src/school/mass-message/component/manage-list/index.tsx

@@ -170,7 +170,9 @@ export default defineComponent({
                 <CellGroup inset style={{ marginBottom: '12px' }} onClick={() => onSelect(item.id)}>
                   <Cell center class={styles.cellTeacher} valueClass={styles.checkboxValue}>
                     {{
-                      icon: () => <Image class={styles.img} src={item.avatar || iconTeacher} />,
+                      icon: () => (
+                        <Image class={styles.img} src={item.avatar || iconTeacher} fit="cover" />
+                      ),
                       title: () => (
                         <div class={styles.content}>
                           <p class={[styles.name, 'van-ellipsis']}>{item.nickname}</p>

+ 3 - 1
src/school/mass-message/component/student-list/index.tsx

@@ -158,7 +158,9 @@ export default defineComponent({
                 <CellGroup inset style={{ marginBottom: '12px' }} onClick={() => onSelect(item.id)}>
                   <Cell center class={styles.cellTeacher} valueClass={styles.checkboxValue}>
                     {{
-                      icon: () => <Image class={styles.img} src={item.avatar || iconTeacher} />,
+                      icon: () => (
+                        <Image class={styles.img} src={item.avatar || iconTeacher} fit="cover" />
+                      ),
                       title: () => (
                         <div class={styles.content}>
                           <p class={[styles.name, 'van-ellipsis']}>{item.nickname}</p>

+ 3 - 1
src/school/mass-message/component/teacher-list/teacher-list.tsx

@@ -171,7 +171,9 @@ export default defineComponent({
                 <CellGroup inset style={{ marginBottom: '12px' }} onClick={() => onSelect(item.id)}>
                   <Cell center class={styles.cellTeacher} valueClass={styles.checkboxValue}>
                     {{
-                      icon: () => <Image class={styles.img} src={item.avatar || iconTeacher} />,
+                      icon: () => (
+                        <Image class={styles.img} src={item.avatar || iconTeacher} fit="cover" />
+                      ),
                       title: () => (
                         <div class={styles.content}>
                           <p class={[styles.name, 'van-ellipsis']}>{item.nickname}</p>

+ 5 - 5
src/school/mass-message/create-message.tsx

@@ -224,12 +224,14 @@ export default defineComponent({
         const { data } = await request.get('/api-school/imMessageBatchSending/detail/' + forms.id)
         forms.sendType = data.sendType
         forms.textMessage = data.textMessage
+        forms.sendTime = data.sendTime
+        forms.type = data.sendStatus
         const receives = data.receives || []
         const tempList: any = {
           class: [] as any,
           teacher: [] as any,
           student: [] as any,
-          manage: [] as any
+          school: [] as any
         }
         receives.forEach((item: any) => {
           const temp = {
@@ -263,11 +265,9 @@ export default defineComponent({
           })
         })
         forms.attachments = tempAtt
-
-        forms.sendTime = data.sendTime
-        forms.type = data.sendStatus
-      } catch {
+      } catch (e: any) {
         //
+        console.log(e, 'e')
       }
     }
 

+ 6 - 3
src/school/mass-message/index.tsx

@@ -137,14 +137,17 @@ export default defineComponent({
                     title: () => (
                       <div class={styles.time}>
                         <Icon name="clock-o" class={styles.clockO} />
-                        {item.sendStatus === 'WAIT' ? item.createTime : ''}
-                        {item.sendStatus === 'SEND' ? item.sendTime : ''}
+                        {/* {item.sendStatus === 'WAIT' ? item.createTime : ''} */}
+                        {/* {item.sendStatus === 'SEND' ? item.sendTime : ''} */}
+                        {item.sendTime}
                       </div>
                     ),
                     value: () => <span>{snedStatus[item.sendStatus]}</span>
                   }}
                 </Cell>
-                <Cell valueClass={styles.messageContent}>{item.textMessage}</Cell>
+                <Cell valueClass={[styles.messageContent, 'van-multi-ellipsis--l3']}>
+                  {item.textMessage}
+                </Cell>
               </CellGroup>
             ))}
           </List>

+ 1 - 1
src/school/mass-message/select-sned.tsx

@@ -56,7 +56,7 @@ export default defineComponent({
       const list = props.selectList || {}
       state.selectClass = list.class || []
       state.selectTeacher = list.teacher || []
-      state.selectManage = list.manage || []
+      state.selectManage = list.school || []
       state.selectStudent = list.student || []
     }
 

+ 30 - 16
src/school/orchestra/compontent/information.tsx

@@ -1,6 +1,6 @@
 import OSticky from '@/components/o-sticky'
 import { Button, DatePicker, Grid, GridItem, Icon, Image, List, Picker, Popover, Popup } from 'vant'
-import { defineComponent, nextTick, onMounted, reactive } from 'vue'
+import { computed, defineComponent, nextTick, onMounted, reactive } from 'vue'
 import styles from './information.module.less'
 import iconSaveImage from '../images/icon-save-image.png'
 import iconWechat from '../images/icon-wechat.png'
@@ -13,7 +13,15 @@ import dayjs from 'dayjs'
 
 export default defineComponent({
   name: 'detail-information',
-  setup() {
+  props: {
+    termTimes: {
+      type: Object,
+      default: {}
+    }
+  },
+  setup(props) {
+    const startTime = computed(() => props.termTimes.start)
+    const endTime = computed(() => props.termTimes.end)
     const route = useRoute()
     const state = reactive({
       timeShow: false,
@@ -38,8 +46,8 @@ export default defineComponent({
       },
 
       params: {
-        startTime: dayjs().year() - 1 + '-09-01 00:00:00',
-        endTime: dayjs(dayjs().year() + '-03-01 00:00:00')
+        startTime: dayjs(dayjs().year() + startTime.value).format('YYYY-MM-DD HH:mm:ss'),
+        endTime: dayjs(dayjs().year() + endTime.value)
           .subtract(1, 'day')
           .format('YYYY-MM-DD HH:mm:ss'),
         page: 1,
@@ -51,7 +59,6 @@ export default defineComponent({
 
     // 选择学期
     const onSelect = (val: any) => {
-      console.log(val)
       state.actionTerm.forEach((item: any) => {
         item.color = null
       })
@@ -60,32 +67,39 @@ export default defineComponent({
       state.actionType = val.value
 
       if (val.value === 'up') {
-        state.params.startTime = Number(state.currentData[0]) - 1 + '-09-01 00:00:00'
-        state.params.endTime = dayjs(state.currentData[0] + '-03-01 00:00:00')
+        state.params.startTime = dayjs(Number(state.currentData[0]) - 1 + startTime.value).format(
+          'YYYY-MM-DD HH:mm:ss'
+        )
+        state.params.endTime = dayjs(Number(state.currentData[0]) + endTime.value)
           .subtract(1, 'day')
           .format('YYYY-MM-DD HH:mm:ss')
       } else if (val.value === 'down') {
-        console.log(dayjs().add(1, 'year'), 'dayjs().add(1, ')
-        state.params.startTime = dayjs(state.currentData[0] + '-03-01 00:00:00')
+        state.params.startTime = dayjs(Number(state.currentData[0]) + endTime.value).format(
+          'YYYY-MM-DD HH:mm:ss'
+        )
+        state.params.endTime = dayjs(Number(state.currentData[0]) + startTime.value)
           .subtract(1, 'day')
           .format('YYYY-MM-DD HH:mm:ss')
-        state.params.endTime = Number(state.currentData[0]) + '-09-01 00:00:00'
       }
       onSearch()
     }
 
     const onConfirmDate = (date: any) => {
       state.currentData = date.selectedValues
-      if (state.actionType == 'up') {
-        state.params.startTime = Number(date.selectedValues[0]) - 1 + '-09-01 00:00:00'
-        state.params.endTime = dayjs(date.selectedValues[0] + '-03-01 00:00:00')
+      if (state.actionType === 'up') {
+        state.params.startTime = dayjs(Number(state.currentData[0]) - 1 + startTime.value).format(
+          'YYYY-MM-DD HH:mm:ss'
+        )
+        state.params.endTime = dayjs(Number(state.currentData[0]) + endTime.value)
           .subtract(1, 'day')
           .format('YYYY-MM-DD HH:mm:ss')
-      } else if (state.actionType == 'down') {
-        state.params.startTime = dayjs(date.selectedValues[0] + '-03-01 00:00:00')
+      } else if (state.actionType === 'down') {
+        state.params.startTime = dayjs(Number(state.currentData[0]) + endTime.value).format(
+          'YYYY-MM-DD HH:mm:ss'
+        )
+        state.params.endTime = dayjs(Number(state.currentData[0]) + startTime.value)
           .subtract(1, 'day')
           .format('YYYY-MM-DD HH:mm:ss')
-        state.params.endTime = Number(date.selectedValues[0]) + '-09-01 00:00:00'
       }
       state.timeShow = false
       onSearch()

+ 4 - 0
src/school/orchestra/compontent/photo-detail.tsx

@@ -166,6 +166,10 @@ export default defineComponent({
     // 上传图片
     const onSubmitPhoto = async () => {
       try {
+        if (state.fileList.length <= 0) {
+          showToast('请上传照片')
+          return
+        }
         const files = state.fileList.map((file: any) => {
           return file.src
         })

+ 35 - 16
src/school/orchestra/compontent/plan.tsx

@@ -2,14 +2,22 @@ import OEmpty from '@/components/o-empty'
 import request from '@/helpers/request'
 import dayjs from 'dayjs'
 import { Cell, DatePicker, Icon, Image, List, Popover, Popup } from 'vant'
-import { defineComponent, onMounted, reactive } from 'vue'
+import { computed, defineComponent, onMounted, reactive } from 'vue'
 import { useRoute } from 'vue-router'
 import styles from './plan.module.less'
 import iconTeacher from '@common/images/icon_teacher.png'
 
 export default defineComponent({
   name: 'plan',
-  setup() {
+  props: {
+    termTimes: {
+      type: Object,
+      default: {}
+    }
+  },
+  setup(props) {
+    const startTime = computed(() => props.termTimes.start)
+    const endTime = computed(() => props.termTimes.end)
     const route = useRoute()
     const state = reactive({
       timeShow: false,
@@ -34,8 +42,8 @@ export default defineComponent({
       },
 
       params: {
-        startTime: dayjs().year() - 1 + '-09-01 00:00:00',
-        endTime: dayjs(dayjs().year() + '-03-01 00:00:00')
+        startTime: dayjs(dayjs().year() + startTime.value).format('YYYY-MM-DD HH:mm:ss'),
+        endTime: dayjs(dayjs().year() + endTime.value)
           .subtract(1, 'day')
           .format('YYYY-MM-DD HH:mm:ss'),
         page: 1,
@@ -53,32 +61,39 @@ export default defineComponent({
       state.actionType = val.value
 
       if (val.value === 'up') {
-        state.params.startTime = Number(state.currentData[0]) - 1 + '-09-01 00:00:00'
-        state.params.endTime = dayjs(state.currentData[0] + '-03-01 00:00:00')
+        state.params.startTime = dayjs(Number(state.currentData[0]) - 1 + startTime.value).format(
+          'YYYY-MM-DD HH:mm:ss'
+        )
+        state.params.endTime = dayjs(Number(state.currentData[0]) + endTime.value)
           .subtract(1, 'day')
           .format('YYYY-MM-DD HH:mm:ss')
       } else if (val.value === 'down') {
-        console.log(dayjs().add(1, 'year'), 'dayjs().add(1, ')
-        state.params.startTime = dayjs(state.currentData[0] + '-03-01 00:00:00')
+        state.params.startTime = dayjs(Number(state.currentData[0]) + endTime.value).format(
+          'YYYY-MM-DD HH:mm:ss'
+        )
+        state.params.endTime = dayjs(Number(state.currentData[0]) + startTime.value)
           .subtract(1, 'day')
           .format('YYYY-MM-DD HH:mm:ss')
-        state.params.endTime = Number(state.currentData[0]) + '-09-01 00:00:00'
       }
       onSearch()
     }
 
     const onConfirmDate = (date: any) => {
       state.currentData = date.selectedValues
-      if (state.actionType == 'up') {
-        state.params.startTime = Number(date.selectedValues[0]) - 1 + '-09-01 00:00:00'
-        state.params.endTime = dayjs(date.selectedValues[0] + '-03-01 00:00:00')
+      if (state.actionType === 'up') {
+        state.params.startTime = dayjs(Number(state.currentData[0]) - 1 + startTime.value).format(
+          'YYYY-MM-DD HH:mm:ss'
+        )
+        state.params.endTime = dayjs(Number(state.currentData[0]) + endTime.value)
           .subtract(1, 'day')
           .format('YYYY-MM-DD HH:mm:ss')
-      } else if (state.actionType == 'down') {
-        state.params.startTime = dayjs(date.selectedValues[0] + '-03-01 00:00:00')
+      } else if (state.actionType === 'down') {
+        state.params.startTime = dayjs(Number(state.currentData[0]) + endTime.value).format(
+          'YYYY-MM-DD HH:mm:ss'
+        )
+        state.params.endTime = dayjs(Number(state.currentData[0]) + startTime.value)
           .subtract(1, 'day')
           .format('YYYY-MM-DD HH:mm:ss')
-        state.params.endTime = Number(date.selectedValues[0]) + '-09-01 00:00:00'
       }
       state.timeShow = false
       onSearch()
@@ -191,7 +206,11 @@ export default defineComponent({
                 <Cell center>
                   {{
                     icon: () => (
-                      <Image class={styles.img} src={item.teacherAvatar || iconTeacher} />
+                      <Image
+                        class={styles.img}
+                        src={item.teacherAvatar || iconTeacher}
+                        fit="cover"
+                      />
                     ),
                     title: () => (
                       <>

+ 2 - 2
src/school/orchestra/create-orchestra/index.tsx

@@ -234,14 +234,14 @@ export default defineComponent({
         </OPopup>
 
         {/* 选择学生 */}
-        <OPopup v-model:modelValue={state.studentStatus} style="background: #f8f8f8;">
+        <OPopup v-model:modelValue={state.studentStatus} style="background: #f8f8f8;" destroy>
           <StudentList
             orchestraList={state.orchestraList}
             subjectId={state.selectSubjectStudents.id}
             selectStudentIds={state.selectSubjectStudents.students}
             onClose={() => (state.studentStatus = false)}
             onSelect={(item: any) => {
-              console.log(item, 'select student')
+              // console.log(item, 'select student')
               state.selectSubjectStudents.students = [...item]
             }}
           />

+ 4 - 4
src/school/orchestra/create-orchestra/select-teacher.tsx

@@ -110,7 +110,7 @@ export default defineComponent({
         <OSticky position="bottom">
           <div class={['btnGroup']}>
             <Button type="primary" round block onClick={onSubmit}>
-              创建成
+              创建
             </Button>
           </div>
         </OSticky>
@@ -123,8 +123,8 @@ export default defineComponent({
               state.selectTeacher.teacher = item
               forms.teacherStatus = false
 
-              console.log(state.selectTeacher, 'select')
-              console.log(state.selectSubjects, 'state.selectSubjects')
+              // console.log(state.selectTeacher, 'select')
+              // console.log(state.selectSubjects, 'state.selectSubjects')
             }}
           />
         </OPopup>
@@ -132,7 +132,7 @@ export default defineComponent({
         <Dialog
           v-model:show={forms.status}
           message="乐团创建完成,是否需要排课?"
-          messageAlign="left"
+          messageAlign="center"
           confirmButtonText="去排课"
           cancelButtonText="暂不排课"
           showCancelButton

+ 2 - 0
src/school/orchestra/modal/student-list.tsx

@@ -152,11 +152,13 @@ export default defineComponent({
     watch(
       () => props.selectStudentIds,
       () => {
+        console.log(props.selectStudentIds, 'watch')
         state.check = [...props.selectStudentIds]
       }
     )
 
     onMounted(() => {
+      console.log(props.selectStudentIds, 'onmount')
       // 判断年级
       if (baseState.user.data.school?.schoolSystem === 'sixYearSystem') {
         state.classList.push({ text: '六年级', value: 6 })

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

@@ -131,7 +131,7 @@ export default defineComponent({
           <OSearch
             inputBackground="white"
             background="#F8F8F8"
-            placeholder="老师名称/手机号"
+            placeholder="老师名称"
             onSearch={(val: any) => {
               forms.params.keyword = val
               onSearch()

+ 31 - 4
src/school/orchestra/orchestra-detail.tsx

@@ -1,7 +1,8 @@
 import OHeader from '@/components/o-header'
 import OSticky from '@/components/o-sticky'
+import request from '@/helpers/request'
 import { Sticky, Tab, Tabs } from 'vant'
-import { defineComponent, ref } from 'vue'
+import { defineComponent, onMounted, ref } from 'vue'
 import Information from './compontent/information'
 import Photo from './compontent/photo'
 import Plan from './compontent/plan'
@@ -11,14 +12,40 @@ export default defineComponent({
   name: 'orchestra-detail',
   setup() {
     const tabs = sessionStorage.getItem('orchestra-detail-tab')
-    console.log(tabs, 'tabs')
+    // console.log(tabs, 'tabs')
     const tabValue = ref(tabs || 'information')
     sessionStorage.removeItem('orchestra-detail-tab')
     const tabHeight = ref('auto')
+    const termTimes = ref({
+      start: '09-01',
+      end: '03-01'
+    })
 
+    // 获取头部高度
     const onGetHeight = (height: any) => {
       tabHeight.value = height
     }
+
+    const getDefaultParams = async () => {
+      // last_term_time 上学期
+      // next_term_time 下学期
+      const { data } = await request.get('/api-school/sysParamConfig/queryByParamNameList', {
+        params: {
+          paramNames: 'last_term_time,next_term_time'
+        }
+      })
+
+      ;(data || []).forEach((item: any) => {
+        if (item.paramName === 'last_term_time') {
+          termTimes.value.start = item.paramValue
+        } else if (item.paramName === 'next_term_time') {
+          termTimes.value.end = item.paramValue
+        }
+      })
+    }
+
+    getDefaultParams()
+
     return () => (
       <div class={styles.orchestraDetail}>
         <OSticky position="top" onGetHeight={onGetHeight}>
@@ -31,8 +58,8 @@ export default defineComponent({
           </Tabs>
         </OSticky>
 
-        {tabValue.value === 'information' && <Information />}
-        {tabValue.value === 'plan' && <Plan />}
+        {tabValue.value === 'information' && <Information termTimes={termTimes.value} />}
+        {tabValue.value === 'plan' && <Plan termTimes={termTimes.value} />}
         {tabValue.value === 'photo' && <Photo height={tabHeight.value} />}
       </div>
     )

+ 8 - 20
src/school/train-planning/component/course-preview/index.tsx

@@ -1,18 +1,6 @@
 import OHeader from '@/components/o-header'
 import OSticky from '@/components/o-sticky'
-import {
-  Button,
-  Cell,
-  CellGroup,
-  Dialog,
-  Icon,
-  Image,
-  showConfirmDialog,
-  showToast,
-  Tab,
-  Tabs,
-  Tag
-} from 'vant'
+import { Button, Cell, CellGroup, Dialog, Icon, Image, showToast, Tab, Tabs, Tag } from 'vant'
 import { defineComponent, onMounted, reactive, ref } from 'vue'
 import styles from './index.module.less'
 import iconTimer from '../../images/icon-timer.png'
@@ -29,6 +17,7 @@ export default defineComponent({
     // SAME_SCHOOL_TEACHER("同学校老师课程冲突"),
     // DIFF_SCHOOL_TEACHER("不同学校老师课程冲突"),
     // STUDENT("学生课程冲突"),
+    // LEAVE 请假冲突
     const route = useRoute()
     const router = useRouter()
     const state = reactive({
@@ -50,8 +39,7 @@ export default defineComponent({
         const { data } = await request.post('/api-school/orchestra/trainingPlanListCache', {
           requestType: 'form',
           data: {
-            cacheId: route.query.cacheId,
-            classGroupId: forms.selectClassGroupId || null
+            cacheId: route.query.cacheId
           }
         })
         // 初始化数据
@@ -83,10 +71,10 @@ export default defineComponent({
     // 格式化班级数据
     const formatClasses = async (data: any) => {
       // 判断是否有班级编号,如果有就说明接口只会返回该班的数据
-      if (forms.selectClassGroupId) {
-        forms.planList.course[forms.selectClassGroupId] = data || []
-        return
-      }
+      // if (forms.selectClassGroupId) {
+      //   forms.planList.course[forms.selectClassGroupId] = data || []
+      //   return
+      // }
 
       // 初始化乐团
       const orchestra: any = []
@@ -309,7 +297,7 @@ export default defineComponent({
                     {item.conflictType && item.conflictType.includes('SAME_SCHOOL_TEACHER') && (
                       <Tag
                         class={styles.conflict}
-                        color="#F44541"
+                        color="#ff8057"
                         size="large"
                         onClick={() => {
                           state.conflictMessage = '伴学指导在本学校时间有冲突'

+ 12 - 1
src/school/train-planning/component/practice/index.tsx

@@ -30,7 +30,13 @@ import OSticky from '@/components/o-sticky'
 
 export default defineComponent({
   name: 'practice',
-  setup() {
+  props: {
+    address: {
+      type: String,
+      default: ''
+    }
+  },
+  setup(props) {
     const router = useRouter()
 
     // 查询没有设置指导老师的班级
@@ -78,6 +84,11 @@ export default defineComponent({
         return
       }
 
+      if (!props.address) {
+        showToast('您所在的学校暂未设置地址')
+        return
+      }
+
       // 初始化 训练详情
       const classPracticeList: any = []
       forms.classType.forEach((item: any) => {

+ 12 - 1
src/school/train-planning/component/standard/index.tsx

@@ -31,7 +31,13 @@ import { forms } from '../../create'
 
 export default defineComponent({
   name: 'standard',
-  setup() {
+  props: {
+    address: {
+      type: String,
+      default: ''
+    }
+  },
+  setup(props) {
     const route = useRoute()
     const router = useRouter()
     // const forms = reactive({
@@ -147,6 +153,11 @@ export default defineComponent({
         return
       }
 
+      if (!props.address) {
+        showToast('您所在的学校暂未设置地址')
+        return
+      }
+
       router.push('/train-content')
     }
 

+ 19 - 3
src/school/train-planning/index.tsx

@@ -1,7 +1,9 @@
 import OHeader from '@/components/o-header'
 import OSticky from '@/components/o-sticky'
+import request from '@/helpers/request'
+import { state } from '@/state'
 import { Sticky, Tab, Tabs } from 'vant'
-import { defineComponent, ref } from 'vue'
+import { defineComponent, onMounted, ref } from 'vue'
 import Practice from './component/practice'
 import Standard from './component/standard'
 import { resestState } from './create'
@@ -12,7 +14,21 @@ export default defineComponent({
   setup() {
     const trainType = sessionStorage.getItem('trainType')
     const tabValue = ref(trainType || 'standard')
+    const address = ref('')
     // sessionStorage.removeItem('trainType')
+
+    const getSchoolDetail = async () => {
+      try {
+        const { data } = await request.get(`/api-school/school/detail/${state.user.data.school.id}`)
+        address.value = data.address || ''
+      } catch {
+        //
+      }
+    }
+
+    onMounted(() => {
+      getSchoolDetail()
+    })
     return () => (
       <div class={styles.train}>
         <OSticky position="top">
@@ -33,8 +49,8 @@ export default defineComponent({
           </Tabs>
         </OSticky>
 
-        {tabValue.value === 'standard' && <Standard />}
-        {tabValue.value === 'practice' && <Practice />}
+        {tabValue.value === 'standard' && <Standard address={address.value} />}
+        {tabValue.value === 'practice' && <Practice address={address.value} />}
       </div>
     )
   }

+ 1 - 1
src/student/member-center/index.tsx

@@ -292,7 +292,7 @@ export default defineComponent({
             class={styles.btn}
             onClick={this.onSubmit}
           >
-            立即开通
+            {this.userInfo.isVip ? '立即续费' : '立即开通'}
           </Button>
         </div>
       </div>