123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280 |
- import OHeader from '@/components/o-header'
- import OSticky from '@/components/o-sticky'
- import { Collapse, CollapseItem } from 'vant'
- import { defineComponent, reactive, onMounted } from 'vue'
- import clockIcon from './images/clock-icon.png'
- import styles from './index.module.less'
- import request from '@/helpers/request'
- import { addFormMinute, reduceFormMinute } from '@/helpers/date'
- export default defineComponent({
- name: 'attendance-rule',
- setup() {
- const state = reactive({
- activeNames: ['1', '2', '3']
- })
- const forms = reactive({} as any)
- const getRules = async () => {
- try {
- const { data } = await request.post('/api-backend/sysParamConfig/page', {
- data: {
- page: 1,
- rows: 999,
- group: 'ATTENDANCE'
- }
- })
- if (data.rows) {
- data.rows.forEach((item: any) => {
- forms[item.id] = item.paramValue
- })
- }
- console.log(forms)
- } catch (e) {
- console.log(e)
- }
- }
- onMounted(() => {
- getRules()
- })
- return () => (
- <>
- <OSticky position="top" background="#F8F8F8">
- <OHeader></OHeader>
- </OSticky>
- <div class={styles.attCollapseWrap}>
- <Collapse v-model={state.activeNames}>
- <CollapseItem
- name="1"
- border={false}
- v-slots={{
- title: () => (
- <div class={styles.collapseTitle}>
- <span class={styles.dot}></span>
- 签到规则
- </div>
- )
- }}
- >
- <div>
- <div class={styles.mainMsg}>
- <img src={clockIcon} alt="" class={styles.clockIcon} />
- <p>以课程时间12:00:00 ~ 13:00:00为例</p>
- </div>
- <div class={styles.textWrap}>
- <h4>可签到时间范围:</h4>
- <p>
- 课程<span>开始前{forms[15] ? forms[15] : 0}分钟</span>至课程<span>结束前</span>
- </p>
- <p>时间段:{reduceFormMinute('12:00:00', forms[15])} ~13:00:00 </p>
- </div>
- <div class={styles.textWrap}>
- <h4>正常签到:</h4>
- <p>
- 课程<span>开始前{forms[15] ? forms[15] : 0}分钟</span>至课程
- <span>开始前{forms[16] ? forms[16] : 0}分钟</span>
- 签到 <br />
- GPS定位点在教学点<span>{forms[10] ? forms[10] : 0}米内</span>
- </p>
- <p>
- 时间段:{reduceFormMinute('12:00:00', forms[15])} ~{' '}
- {reduceFormMinute('12:00:00', forms[16])}
- </p>
- </div>
- <div class={styles.textWrap}>
- <h4>异常签到:</h4>
- <p>
- 课程<span>开始前{forms[17] ? forms[17] : 0}分钟</span>后至课程
- <span>开始前</span>
- 签到
- <br />
- GPS定位点在教学点<span>{forms[10] ? forms[10] : 0}米内</span>
- </p>
- <p>时间段:{reduceFormMinute('12:00:00', forms[17])} ~ 12:00:00</p>
- <p>
- 扣除训练补助:
- <span>
- -{forms[18] ? forms[18] : 0}
- {forms[19] == 'MONEY' ? '元' : '%'}
- </span>
- </p>
- </div>
- <div class={styles.textWrap}>
- <h4>迟到:</h4>
- <p>
- 课程<span>开始后{forms[20] ? forms[20] : 0}分钟</span>内签到
- </p>
- <p>时间段:12:00:00 ~ {addFormMinute('12:00:00', forms[20])}</p>
- <p>
- 扣除训练补助:
- <span>
- -{forms[21] ? forms[21] : 0}
- {forms[22] == 'MONEY' ? '元' : '%'}
- </span>
- </p>
- </div>
- <div class={styles.textWrap}>
- <h4>旷课:</h4>
- <p>
- 课程<span>开始后{forms[23] ? forms[23] : 0}分钟</span>至课程<span>结束前</span>
- 签到
- </p>
- <p>
- 时间段:{addFormMinute('12:00:00', forms[23])}后签到(含
- {addFormMinute('12:00:00', forms[23])})
- </p>
- <p>
- 扣除训练补助:
- <span>
- -{forms[24] ? forms[24] : 0}
- {forms[25] == 'MONEY' ? '元' : '%'}
- </span>
- </p>
- </div>
- <div class={styles.textWrap}>
- <h4>未签到:</h4>
- <p>未进行【签到】操作</p>
- <p>
- 扣除训练补助:
- <span>
- -{forms[26] ? forms[26] : 0} {forms[27] == 'MONEY' ? '元' : '%'}
- </span>
- </p>
- </div>
- </div>
- </CollapseItem>
- <CollapseItem
- name="2"
- border={false}
- v-slots={{
- title: () => (
- <div class={styles.collapseTitle}>
- <span class={styles.dot}></span>
- 签退规则
- </div>
- )
- }}
- >
- <div>
- <div class={styles.mainMsg}>
- <img src={clockIcon} alt="" class={styles.clockIcon} />
- <p>以课程时间12:00:00 ~ 13:00:00为例</p>
- </div>
- <div class={styles.textWrap}>
- <h4>可签退时间范围:</h4>
- <p>
- 课程<span>结束后</span>至课程当天24点前
- </p>
- <p>时间段:12:00:00 ~ 23:59:59</p>
- </div>
- <div class={styles.textWrap}>
- <h4>正常签退:</h4>
- <p>
- 课程<span>结束后</span>至课程<span>结束后{forms[28] ? forms[28] : 0}分钟</span>
- 签退 <br />
- GPS定位点在教学点<span>{forms[10] ? forms[10] : 0}米内</span>
- </p>
- <p>时间段:13:00:00 ~ {addFormMinute('13:00:00', forms[28])}</p>
- </div>
- <div class={styles.textWrap}>
- <h4>早退:</h4>
- <p>
- 课程<span>结束前{forms[32] ? forms[32] : 0}分钟</span>内签退
- </p>
- <p>
- 时间段:{reduceFormMinute('13:00:00', forms[32])}前签退(含
- {reduceFormMinute('13:00:00', forms[32])}){' '}
- </p>
- <p>
- 扣除训练补助:
- <span>
- -{forms[33] ? forms[33] : 0}
- {forms[34] == 'MONEY' ? '元' : '%'}
- </span>
- </p>
- </div>
- <div class={styles.textWrap}>
- <h4>异常签退:</h4>
- <p>
- 课程<span>结束前{forms[29] ? forms[29] : 0}分钟</span>至<span>课程结束前</span>
- <br /> 或GPS定位点在教学点<span> {forms[10] ? forms[10] : 0}米内</span>
- </p>
- <p>时间段:{reduceFormMinute('13:00:00', forms[29])} ~ 12:59:59</p>
- <p>
- 扣除训练补助:
- <span>
- -{forms[30] ? forms[30] : 0} {forms[31] == 'MONEY' ? '元' : '%'}
- </span>
- </p>
- </div>
- <div class={styles.textWrap}>
- <h4>未签退:</h4>
- <p>未进行【签退】操作</p>
- <p>
- 扣除训练补助:
- <span>
- -{forms[45] ? forms[45] : 0}
- {forms[38] == 'MONEY' ? '元' : '%'}
- </span>
- </p>
- </div>
- </div>
- </CollapseItem>
- <CollapseItem
- name="3"
- border={false}
- v-slots={{
- title: () => (
- <div class={styles.collapseTitle}>
- <span class={styles.dot}></span>
- GPS定位
- </div>
- )
- }}
- >
- <div>
- <div class={styles.textWrap}>
- <p>
- <span>
- 若签到时间在正常范围内
- <br /> 但同时GPS定位在教学点{forms[10] ? forms[10] : 0}
- 米外
- </span>
- </p>
- <p>
- 扣除训练补助:
- <span>
- - {forms[11] ? forms[11] : 0}
- {forms[12] == 'MONEY' ? '元' : '%'}
- </span>
- </p>
- </div>
- <div class={styles.textWrap}>
- <p>
- <span>
- 若签退时间在正常范围内 <br /> 但同时GPS定位在教学点{forms[10] ? forms[10] : 0}
- 米外
- </span>
- </p>
- <p>
- 扣除训练补助:
- <span>
- - {forms[13] ? forms[13] : 0}
- {forms[14] == 'MONEY' ? '元' : '%'}
- </span>
- </p>
- </div>
- </div>
- </CollapseItem>
- </Collapse>
- </div>
- </>
- )
- }
- })
|