lex 2 年之前
父節點
當前提交
8a71c846b6

+ 4 - 1
src/school/attendance-rules/component/range.tsx

@@ -91,10 +91,13 @@ export default defineComponent({
         const submitData = dataCompare(beforeData.value, forms)
         if (submitData.length > 0) {
           await request.post('/api-school/schoolParamConfig/update', {
+            hideLoading: false,
             data: { configs: [...submitData], group: 'ATTENDANCE' }
           })
         }
-        showToast('保存成功')
+        setTimeout(() => {
+          showToast('保存成功')
+        }, 200)
       } catch {
         //
       }

+ 13 - 8
src/school/attendance-rules/component/sigin-in-rule.tsx

@@ -28,7 +28,9 @@ export default defineComponent({
   setup() {
     const statusList = reactive({
       show1: false,
-      show2: false
+      show2: false,
+      show3: false,
+      show4: false
     })
     const beforeData: any = shallowRef({}) // 储存原始数据
     const forms = reactive({} as any)
@@ -127,10 +129,13 @@ export default defineComponent({
         const submitData = dataCompare(beforeData.value, forms)
         if (submitData.length > 0) {
           await request.post('/api-school/schoolParamConfig/update', {
+            hideLoading: false,
             data: { configs: [...submitData], group: 'ATTENDANCE' }
           })
         }
-        showToast('保存成功')
+        setTimeout(() => {
+          showToast('保存成功')
+        }, 200)
       } catch {
         //
       }
@@ -311,7 +316,7 @@ export default defineComponent({
                       {{
                         extra: () => (
                           <Popover
-                            v-model:show={statusList.show1}
+                            v-model:show={statusList.show2}
                             class={styles.popover}
                             actions={actions}
                             onSelect={(val: any) => {
@@ -320,7 +325,7 @@ export default defineComponent({
                           >
                             {{
                               reference: () => (
-                                <div class={[styles.unit, statusList.show1 && styles.active]}>
+                                <div class={[styles.unit, statusList.show2 && styles.active]}>
                                   {configUnit[forms['late_sign_in_fee_type']]}
                                 </div>
                               )
@@ -368,7 +373,7 @@ export default defineComponent({
                       {{
                         extra: () => (
                           <Popover
-                            v-model:show={statusList.show1}
+                            v-model:show={statusList.show3}
                             class={styles.popover}
                             actions={actions}
                             onSelect={(val: any) => {
@@ -377,7 +382,7 @@ export default defineComponent({
                           >
                             {{
                               reference: () => (
-                                <div class={[styles.unit, statusList.show1 && styles.active]}>
+                                <div class={[styles.unit, statusList.show3 && styles.active]}>
                                   {configUnit[forms['absence_sign_in_fee_type']]}
                                 </div>
                               )
@@ -413,7 +418,7 @@ export default defineComponent({
                     {{
                       extra: () => (
                         <Popover
-                          v-model:show={statusList.show1}
+                          v-model:show={statusList.show4}
                           class={styles.popover}
                           actions={actions}
                           onSelect={(val: any) => {
@@ -422,7 +427,7 @@ export default defineComponent({
                         >
                           {{
                             reference: () => (
-                              <div class={[styles.unit, statusList.show1 && styles.active]}>
+                              <div class={[styles.unit, statusList.show4 && styles.active]}>
                                 {configUnit[forms['not_sign_in_fee_type']]}
                               </div>
                             )

+ 25 - 12
src/school/attendance-rules/component/sigin-out-rule.tsx

@@ -29,7 +29,8 @@ export default defineComponent({
   setup() {
     const statusList = reactive({
       show1: false,
-      show2: false
+      show2: false,
+      show3: false
     })
     const beforeData: any = shallowRef({}) // 储存原始数据
     const forms = reactive({} as any)
@@ -85,31 +86,43 @@ export default defineComponent({
       }
       if (
         forms['abnormal_sign_out_fee'] > 100 &&
-        forms['sign_in_attendance_type'] === 'PERCENTAGE'
+        forms['abnormal_sign_out_fee_type'] === 'PERCENTAGE'
       ) {
         showToast('异常签退扣减金额输入有误')
         return
       }
 
-      if (!forms['sign_out_attendance']) {
-        showToast('请输入退扣减金额')
+      if (!forms['premise_sign_out_fee']) {
+        showToast('请输入退扣减金额')
         return
       }
       if (
-        forms['sign_out_attendance'] > 100 &&
-        forms['sign_out_attendance_type'] === 'PERCENTAGE'
+        forms['premise_sign_out_fee'] > 100 &&
+        forms['premise_sign_out_fee_type'] === 'PERCENTAGE'
       ) {
-        showToast('签退扣减金额输入有误')
+        showToast('早退扣减金额输入有误')
+        return
+      }
+
+      if (!forms['not_sign_out_fee']) {
+        showToast('请输入未签退扣减金额')
+        return
+      }
+      if (forms['not_sign_out_fee'] > 100 && forms['not_sign_out_fee_type'] === 'PERCENTAGE') {
+        showToast('未签退扣减金额输入有误')
         return
       }
       try {
         const submitData = dataCompare(beforeData.value, forms)
         if (submitData.length > 0) {
           await request.post('/api-school/schoolParamConfig/update', {
+            hideLoading: false,
             data: { configs: [...submitData], group: 'ATTENDANCE' }
           })
         }
-        showToast('保存成功')
+        setTimeout(() => {
+          showToast('保存成功')
+        }, 200)
       } catch {
         //
       }
@@ -252,7 +265,7 @@ export default defineComponent({
                       {{
                         extra: () => (
                           <Popover
-                            v-model:show={statusList.show1}
+                            v-model:show={statusList.show2}
                             class={styles.popover}
                             actions={actions}
                             onSelect={(val: any) => {
@@ -261,7 +274,7 @@ export default defineComponent({
                           >
                             {{
                               reference: () => (
-                                <div class={[styles.unit, statusList.show1 && styles.active]}>
+                                <div class={[styles.unit, statusList.show2 && styles.active]}>
                                   {configUnit[forms['premise_sign_out_fee_type']]}
                                 </div>
                               )
@@ -298,7 +311,7 @@ export default defineComponent({
                     {{
                       extra: () => (
                         <Popover
-                          v-model:show={statusList.show1}
+                          v-model:show={statusList.show3}
                           class={styles.popover}
                           actions={actions}
                           onSelect={(val: any) => {
@@ -307,7 +320,7 @@ export default defineComponent({
                         >
                           {{
                             reference: () => (
-                              <div class={[styles.unit, statusList.show1 && styles.active]}>
+                              <div class={[styles.unit, statusList.show3 && styles.active]}>
                                 {configUnit[forms['not_sign_out_fee_type']]}
                               </div>
                             )

二進制
src/school/attendance/images/icon-setting.png


+ 7 - 1
src/school/attendance/index.module.less

@@ -15,10 +15,16 @@
 .stickyAttendance {
   :global {
     .van-tab--active {
-      color: var(--van-primary)
+      color: var(--van-primary);
     }
     .van-tabs__line {
       bottom: 20px;
     }
   }
 }
+.iconSetting {
+  width: 24px;
+  height: 24px;
+  background: url('./images/icon-setting.png') no-repeat center center;
+  background-size: contain;
+}

+ 12 - 1
src/school/attendance/index.tsx

@@ -26,7 +26,18 @@ export default defineComponent({
     return () => (
       <>
         <OSticky position="top" background="#F8F8F8" onGetHeight={getHeight} ref={stickyRef}>
-          <OHeader border={false}></OHeader>
+          <OHeader border={false}>
+            {{
+              right: () => (
+                <span
+                  class={styles.iconSetting}
+                  onClick={() => {
+                    router.push('/attendance-rules')
+                  }}
+                ></span>
+              )
+            }}
+          </OHeader>
         </OSticky>
 
         <Tabs

二進制
src/school/practice-rewards/images/bg.png


二進制
src/school/practice-rewards/images/card-bg.png


+ 12 - 32
src/school/practice-rewards/index.module.less

@@ -1,3 +1,9 @@
+.practiceRewards {
+  min-height: 100vh;
+  background: url('./images/bg.png') no-repeat top right #fff0e8;
+  background-size: contain;
+}
+
 .btn {
   border-radius: 13px;
   border: 1px solid #f67146;
@@ -39,36 +45,19 @@
 }
 
 .headerContainer {
-  background-color: #fff;
-  padding: 12px 13px 20px;
+  // padding: 0 13px;
+  background: url('./images/card-bg.png') no-repeat center center;
+  background-size: contain;
+  height: 186px;
+  box-sizing: content-box;
   .headerContent {
     position: relative;
     padding: 15px 20px 25px;
-    background: linear-gradient(135deg, #ff9a60 0%, #ff6040 100%);
+    // background: linear-gradient(135deg, #ff9a60 0%, #ff6040 100%);
     border-radius: 10px;
     font-size: 16px;
     font-weight: bold;
     color: #fff;
-
-    &::after {
-      display: block;
-      position: absolute;
-      left: 0;
-      bottom: 0;
-      content: ' ';
-      height: 56px;
-      width: 100%;
-      background: url('./images/icon-bg.png') no-repeat center bottom;
-      background-size: contain;
-    }
-
-    .iconEye {
-      position: absolute;
-      right: 20px;
-      top: 14px;
-      display: inline-block;
-      font-size: 24px;
-    }
   }
   .priceCount {
     padding: 10px 0 15px;
@@ -78,15 +67,6 @@
     color: #ffffff;
     line-height: 45px;
   }
-  .countRewards {
-    padding-top: 15px;
-    font-weight: 500;
-    font-size: 14px;
-    span {
-      font-weight: bold;
-      font-family: DINA;
-    }
-  }
 }
 
 .grid {

+ 6 - 44
src/school/practice-rewards/index.tsx

@@ -27,15 +27,6 @@ export default defineComponent({
       }
     })
 
-    const salaryRate = computed(() => {
-      const salary = state.statistics
-      if (salary.totalTrainingSalary) {
-        return (salary.waitSalary / salary.totalTrainingSalary) * 100
-      } else {
-        return 0
-      }
-    })
-
     const getStatistics = async () => {
       try {
         const { data } = await request.post('/api-school/schoolWeekSalaryRecord/trainingStatistics')
@@ -71,10 +62,10 @@ export default defineComponent({
       getList()
     })
     return () => (
-      <>
-        <OSticky position="top" style={{ background: '#fff' }}>
-          <OHeader border={false}>
-            {{
+      <div class={styles.practiceRewards}>
+        <OSticky position="top" style={{ background: 'transparent' }}>
+          <OHeader border={false} background={'transparent'}>
+            {/* {{
               right: () => (
                 <span
                   class={styles.btn}
@@ -94,43 +85,14 @@ export default defineComponent({
                   结算记录
                 </span>
               )
-            }}
+            }} */}
           </OHeader>
           <div class={styles.headerContainer}>
             <div class={styles.headerContent}>
-              {/* closed-eye eye-o */}
-              <Icon
-                class={styles.iconEye}
-                name={state.seeType === 'see' ? 'eye-o' : 'closed-eye'}
-                onClick={() => {
-                  if (state.seeType === 'see') {
-                    localStorage.setItem('practice-rewards-see-type', 'hide')
-                    state.seeType = 'hide'
-                  } else {
-                    localStorage.setItem('practice-rewards-see-type', 'see')
-                    state.seeType = 'see'
-                  }
-                }}
-              />
               <div class={styles.priceTitle}>待结算金额 (元)</div>
               <div class={styles.priceCount}>
                 {state.seeType === 'see' ? moneyFormat(state.statistics.waitSalary) : '****'}
               </div>
-              <Progress
-                color="#fff"
-                trackColor="#E7441A"
-                showPivot={false}
-                percentage={salaryRate.value}
-                strokeWidth={8}
-              />
-              {/* <div class={styles.countRewards}>
-                累计奖励 (元) :
-                <span>
-                  {state.seeType === 'see'
-                    ? moneyFormat(state.statistics.totalTrainingSalary)
-                    : '****'}
-                </span>
-              </div> */}
             </div>
           </div>
         </OSticky>
@@ -180,7 +142,7 @@ export default defineComponent({
         ) : (
           <OEmpty btnStatus={false} tips="暂无练习奖励记录" />
         )}
-      </>
+      </div>
     )
   }
 })

+ 8 - 6
src/views/attendance-rule/index.tsx

@@ -8,9 +8,12 @@ import request from '@/helpers/request'
 import { addFormMinute, reduceFormMinute } from '@/helpers/date'
 import { useRect } from '@vant/use'
 import { Html5Event } from 'plyr'
+import { useRoute } from 'vue-router'
+import { state as baseState } from '@/state'
 export default defineComponent({
   name: 'attendance-rule',
   setup() {
+    const route = useRoute()
     const state = reactive({
       activeNames: '',
       wrapHeight: 0
@@ -19,15 +22,14 @@ export default defineComponent({
     const forms = reactive({} as any)
     const getRules = async () => {
       try {
-        const { data } = await request.post('/api-backend/sysParamConfig/page', {
-          data: {
-            page: 1,
-            rows: 999,
+        const { data } = await request.get(baseState.platformApi + '/schoolParamConfig/list', {
+          params: {
+            schoolId: route.query.schoolId,
             group: 'ATTENDANCE'
           }
         })
-        if (data.rows) {
-          data.rows.forEach((item: any) => {
+        if (data) {
+          data.forEach((item: any) => {
             forms[item.id] = item.paramValue
           })
         }