Browse Source

修改问题

lex 2 năm trước cách đây
mục cha
commit
2da924c493

+ 9 - 1
src/router/routes-teacher.ts

@@ -126,7 +126,15 @@ export default [
         meta: {
           title: '测验详情'
         }
-      }
+      },
+      {
+        path: '/subsidy-exercise-details',
+        name: 'subsidy-exercise-details',
+        component: () => import('@/school/approval-manage/subsidy/details'),
+        meta: {
+          title: '补助明细'
+        }
+      },
 
       //unitDetail 选择阶段自测
     ]

+ 23 - 0
src/school/approval-manage/index.module.less

@@ -228,8 +228,31 @@
       }
     }
     .startTimeBottom {
+      padding-top: 5px;
       font-size: 18px;
       font-weight: bold;
+      display: flex;
+      align-items: center;
+    }
+    .startTimeStatus {
+      margin-right: 12px;
+      font-size: 14px;
+      font-weight: 500;
+      color: #333333;
+      line-height: 20px;
+    }
+    .startTimePosition {
+      font-size: 14px;
+      font-weight: 500;
+      color: #333333;
+      line-height: 20px;
+    }
+    .startTimePositionLook {
+      font-size: 12px;
+      font-weight: 500;
+      line-height: 17px;
+      display: flex;
+      align-items: center;
     }
   }
   .startTime {

+ 189 - 38
src/school/approval-manage/subsidy/details.tsx

@@ -1,39 +1,75 @@
-import { Cell, Grid, GridItem } from 'vant'
-import { defineComponent, onMounted, PropType } from 'vue'
+import { Cell, Grid, GridItem, Icon } from 'vant'
+import { defineComponent, onMounted, PropType, reactive } from 'vue'
 import styles from '../index.module.less'
 import iconA from '../images/icon-photo.png'
 import iconTime from '../images/icon-time.png'
 import iconPrimary from '../images/icon-primary.png'
 import iconError from '../images/icon-error.png'
 import { courseEmnu } from '@/constant'
-import { courseSalaryRecordDetailItem } from './exercise-detail'
 import OSticky from '@/components/o-sticky'
 import OHeader from '@/components/o-header'
 import OEmpty from '@/components/o-empty'
 import dayjs from 'dayjs'
 import { getSecondRPM } from '@/helpers/utils'
+import request from '@/helpers/request'
+import { useRoute } from 'vue-router'
+import { postMessage } from '@/helpers/native-message'
+import { state as baseState } from '@/state'
 
 export default defineComponent({
   name: 'subsidy-detail',
   setup() {
-    const record: ICourseSalaryRecordDetailItem = courseSalaryRecordDetailItem.value! || ''
-    console.log(record)
-    if (Array.isArray(record?.courseScheduleTeacherAttendanceList)) {
-      record.courseScheduleTeacherAttendanceList.forEach((n: any) => {
-        n.times =
-          (n?.startTime ? dayjs(n.startTime).format('YYYY-MM-DD HH:mm') : '') +
-          ' ~ ' +
-          (n?.endTime ? dayjs(n.endTime).format('HH:mm') : '')
-        n.signInTime = n?.signInTime?.split(' ')[1]
-        n.signOutTime = n?.signOutTime?.split(' ')[1]
-      })
+    const route = useRoute()
+    const state = reactive({
+      record: {} as any
+    })
+
+    const getDetails = async () => {
+      try {
+        let result: any = {}
+        if (baseState.platformType === 'TEACHER') {
+          const { data } = await request.get(
+            '/api-teacher/courseScheduleTeacherSalary/detail/' + route.query.id,
+            {}
+          )
+          result = data || {}
+        } else {
+          const { data } = await request.post(
+            '/api-school/schoolWeekSalaryRecord/detailInfoByCourseType',
+            {
+              data: {
+                ...route.query
+              }
+            }
+          )
+          result = data || {}
+        }
+        state.record = result || {}
+        if (Array.isArray(state.record?.courseScheduleTeacherAttendanceList)) {
+          state.record.courseScheduleTeacherAttendanceList.forEach((n: any) => {
+            n.times =
+              (n?.startTime ? dayjs(n.startTime).format('YYYY-MM-DD HH:mm') : '') +
+              ' ~ ' +
+              (n?.endTime ? dayjs(n.endTime).format('HH:mm') : '')
+            n.signInTime = n?.signInTime?.split(' ')[1]
+            n.signOutTime = n?.signOutTime?.split(' ')[1]
+          })
+
+          state.record.courseScheduleTeacherAttendanceList.push({})
+        }
+      } catch {
+        //
+      }
     }
+    onMounted(() => {
+      getDetails()
+    })
     return () => (
       <div>
         <OSticky>
           <OHeader />
         </OSticky>
-        {!!record && (
+        {!!state.record && (
           <div class={styles.wrap}>
             <div class={[styles.item, styles.listItem]}>
               <Cell
@@ -41,41 +77,36 @@ export default defineComponent({
                 center
                 class={styles.listItem}
                 title="补助标准"
-                value={`${record.standardSalary}元/天`}
+                value={`${state.record.standardSalary}元/天`}
               />
               <Cell
                 border={false}
                 center
                 class={styles.listItem}
                 title="补助课程"
-                value={courseEmnu[record.courseType]}
-              />
-              <Cell
-                border={false}
-                center
-                class={styles.listItem}
-                valueClass={styles.valueColor}
-                title="课件使用未达标"
-                value={`-${record.reduceSalary}元`}
-              />
-              <Cell
-                border={false}
-                center
-                class={styles.listItem}
-                valueClass={styles.valueColor}
-                title="早退"
-                value={`-0.00元`}
+                value={courseEmnu[state.record.courseType]}
               />
+              {state.record.attendanceInfoList &&
+                state.record.attendanceInfoList.map((item: any) => (
+                  <Cell
+                    border={false}
+                    center
+                    class={styles.listItem}
+                    valueClass={styles.valueColor}
+                    title={item.reason}
+                    value={`${item.salary}元`}
+                  />
+                ))}
               <Cell
                 border={false}
                 center
                 class={styles.listItem}
                 title="实际补助金额"
-                value={`${record.actualSalary}元`}
+                value={`${state.record.actualSalary}元`}
               />
             </div>
 
-            {record?.courseScheduleTeacherAttendanceList?.map(
+            {state.record?.courseScheduleTeacherAttendanceList?.map(
               (item: ICourseScheduleTeacherAttendance) => (
                 <div class={styles.item}>
                   <Cell center>
@@ -113,14 +144,134 @@ export default defineComponent({
                           <span>签到时间</span>
                           <img src={item.signInStatus === 'NORMAL' ? iconPrimary : iconError} />
                         </div>
-                        <div class={styles.startTimeBottom}>{item.signInTime}</div>
+                        <div class={styles.startTimeBottom}>
+                          <span
+                            class={styles.startTimeStatus}
+                            style={{
+                              color: item.signInStatus === 'NORMAL' ? '' : '#F44541'
+                            }}
+                          >
+                            {item.signInStatusTitle}
+                          </span>
+                          {item.signInTime}
+                        </div>
                       </div>
                       <div class={[styles.timesItem, styles.endTime]}>
                         <div class={styles.startTimeTop}>
+                          <span>签到定位</span>
+                          <img
+                            src={
+                              item.signInLongitudeLatitudeStatus === 'NORMAL'
+                                ? iconPrimary
+                                : iconError
+                            }
+                          />
+                        </div>
+                        <div
+                          class={styles.startTimeBottom}
+                          style={{ justifyContent: 'space-between' }}
+                        >
+                          {item.signInLongitudeLatitude ? (
+                            <>
+                              <span class={styles.startTimePosition}>
+                                {item.signInLongitudeLatitudeStatus === 'NORMAL'
+                                  ? '考勤范围内'
+                                  : '考勤范围外'}
+                              </span>
+                              <span
+                                class={styles.startTimePositionLook}
+                                style={{
+                                  color:
+                                    item.signInLongitudeLatitudeStatus === 'NORMAL'
+                                      ? '#4493F6'
+                                      : '#F44541'
+                                }}
+                                onClick={() => {
+                                  postMessage({
+                                    api: 'sourseMapApi',
+                                    content: {
+                                      type: 'display',
+                                      myPoint: item.schoolLongitudeLatitude,
+                                      orginPoint: item.signInLongitudeLatitude
+                                    }
+                                  })
+                                }}
+                              >
+                                查看定位 <Icon name="arrow" />
+                              </span>
+                            </>
+                          ) : (
+                            <span class={styles.startTimePosition}>暂无定位</span>
+                          )}
+                        </div>
+                      </div>
+                    </div>
+                    <div class={styles.times}>
+                      <div class={[styles.timesItem, styles.startTime]}>
+                        <div class={styles.startTimeTop}>
                           <span>签退时间</span>
                           <img src={item.signOutStatus === 'NORMAL' ? iconPrimary : iconError} />
                         </div>
-                        <div class={styles.startTimeBottom}>{item.signOutTime}</div>
+                        <div class={styles.startTimeBottom}>
+                          <span
+                            class={styles.startTimeStatus}
+                            style={{
+                              color: item.signOutStatus === 'NORMAL' ? '' : '#F44541'
+                            }}
+                          >
+                            {item.signOutStatusTitle}
+                          </span>
+                          {item.signOutTime}
+                        </div>
+                      </div>
+                      <div class={[styles.timesItem, styles.endTime]}>
+                        <div class={styles.startTimeTop}>
+                          <span>签退定位</span>
+                          <img
+                            src={
+                              item.signOutLongitudeLatitudeStatus === 'NORMAL'
+                                ? iconPrimary
+                                : iconError
+                            }
+                          />
+                        </div>
+                        <div
+                          class={styles.startTimeBottom}
+                          style={{ justifyContent: 'space-between' }}
+                        >
+                          {item.signOutLongitudeLatitude ? (
+                            <>
+                              <span class={styles.startTimePosition}>
+                                {item.signOutLongitudeLatitudeStatus === 'NORMAL'
+                                  ? '考勤范围内'
+                                  : '考勤范围外'}
+                              </span>
+                              <span
+                                class={styles.startTimePositionLook}
+                                style={{
+                                  color:
+                                    item.signOutLongitudeLatitudeStatus === 'NORMAL'
+                                      ? '#4493F6'
+                                      : '#F44541'
+                                }}
+                                onClick={() => {
+                                  postMessage({
+                                    api: 'sourseMapApi',
+                                    content: {
+                                      type: 'display',
+                                      myPoint: item.schoolLongitudeLatitude,
+                                      orginPoint: item.signOutLongitudeLatitude
+                                    }
+                                  })
+                                }}
+                              >
+                                查看定位 <Icon name="arrow" />
+                              </span>
+                            </>
+                          ) : (
+                            <span class={styles.startTimePosition}>暂无定位</span>
+                          )}
+                        </div>
                       </div>
                     </div>
                   </div>
@@ -129,7 +280,7 @@ export default defineComponent({
             )}
           </div>
         )}
-        {!record && <OEmpty tips="暂无明细" />}
+        {!state.record && <OEmpty tips="暂无明细" />}
       </div>
     )
   }

+ 5 - 1
src/school/approval-manage/subsidy/exercise-detail.tsx

@@ -106,7 +106,11 @@ export default defineComponent({
                   onClick={() => {
                     courseSalaryRecordDetailItem.value = item
                     router.push({
-                      path: '/subsidy-exercise-details'
+                      path: '/subsidy-exercise-details',
+                      query: {
+                        ...route.query,
+                        courseType: item.courseType
+                      }
                     })
                   }}
                 >

+ 18 - 0
src/school/approval-manage/subsidy/subsidyTypes.ts

@@ -217,6 +217,12 @@ interface ICourseScheduleTeacherAttendance {
   | 'NO_SIGN'
   | 'NO_SIGN_OUT'
   | 'LOCATION_EXCEPTION'
+  /**签到状态(正常、异常、迟到、早退、旷课、未签到)中文 */
+  signInStatusTitle?: string,
+  /** 签到金纬度状态 */
+  signInLongitudeLatitudeStatus?:
+  | 'NORMAL'
+  | 'LOCATION_EXCEPTION'
   /**乐团编号 */
   orchestraId: string
   /**班级名称 */
@@ -251,6 +257,12 @@ interface ICourseScheduleTeacherAttendance {
   | 'NO_SIGN'
   | 'NO_SIGN_OUT'
   | 'LOCATION_EXCEPTION'
+  /**签退状态(正常、异常、迟到、早退、旷课、未签到) */
+  signOutStatusTitle?: string
+  /** 签退经纬度状态 */
+  signOutLongitudeLatitudeStatus?:
+  | 'NORMAL'
+  | 'LOCATION_EXCEPTION'
   /**签退时间 */
   signOutTime: string
   /**课程类型 */
@@ -259,4 +271,10 @@ interface ICourseScheduleTeacherAttendance {
   teacherAvatar: string
   /**班级编号 */
   classGroupId: string
+  /**学校经纬度 */
+  schoolLongitudeLatitude: string
+  /**签退经纬度 */
+  signOutLongitudeLatitude?: string
+  /**签到经纬度 */
+  signInLongitudeLatitude: string
 }

+ 0 - 1
src/school/orchestra/compontent/photo.tsx

@@ -58,7 +58,6 @@ export default defineComponent({
         if (state.selectType === 'add') {
           await request.post('/api-school/orchestraPhotoAlbum/save', {
             data: {
-              orchestraId: route.query.id,
               name: state.photoName
             }
           })