123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760 |
- import Vue from 'vue'
- import dayjs from 'dayjs'
- import numeral from 'numeral'
- import * as constant from '../constant'
- // 合并数组
- Vue.filter('joinArray', (value, type) => {
- if (!type) {
- type = ' '
- }
- if (typeof value == 'object' && value != null) {
- return value.join(type)
- } else {
- return value
- }
- })
- // 合作单位
- Vue.filter('branchType', (value) => {
- let template = {
- OWN: "自有",
- COOPERATION: "合作",
- LEASE: "租赁"
- }
- return template[value]
- })
- // 商品类型
- Vue.filter('shopType', (value) => {
- let template = {
- "INSTRUMENT": "乐器",
- "ACCESSORIES": "辅件",
- "TEACHING": "教材",
- "STAFF": "教谱",
- "OTHER": "其它",
- }
- return template[value]
- })
- // 乐团学员状态
- Vue.filter('musicGroupStudentType', (value) => {
- let template = {
- NORMAL: "在读",
- LEAVE: "请假",
- QUIT: "退团",
- APPLY: '报名'
- }
- return template[value]
- })
- // 乐团学员状态
- Vue.filter('instrumentType', (value) => {
- let template = {
- GROUP: "团购",
- OWNED: "自备",
- LEASE: "租赁"
- }
- return template[value]
- })
- // 课程类型
- Vue.filter('coursesType', (value) => {
- let template = {
- NORMAL: '声部课',
- SINGLE: '声部课',
- MIX: "合奏课",
- HIGH: "基础技能课",
- VIP: "VIP课",
- DEMO: "试听课",
- COMPREHENSIVE: '综合课',
- // PRACTICE: '练习课',
- ENLIGHTENMENT: '启蒙课',
- TRAINING: '集训课',
- TRAINING_SINGLE: '集训声部课',
- TRAINING_MIX: '集训合奏课',
- CLASSROOM: '课堂课',
- PRACTICE: '网管课',
- COMM: '对外课',
- MUSIC: '乐团课',
- HIGH_ONLINE: '线上基础技能课',
- MUSIC_NETWORK: '乐团网管课'
- }
- return template[value]
- })
- // 课程状态
- Vue.filter('coursesStatus', (value) => {
- let template = {
- NOT_START: "未开始",
- UNDERWAY: "进行中",
- OVER: "已结束"
- }
- return template[value]
- })
- // 考勤类型
- Vue.filter('clockingIn', value => {
- let templateStatus = {
- NORMAL: "正常",
- TRUANT: "旷课",
- LEAVE: "请假",
- QUIT_SCHOOL: "休学",
- DROP_OUT: "退学"
- }
- return templateStatus[value]
- })
- // 学员状态
- Vue.filter('studentTeamStatus', value => {
- let templateStatus = {
- NORMAL: "在读",
- QUIT: "退团",
- QUIT_SCHOOL: "休学",
- APPLY: '报名'
- }
- return templateStatus[value]
- })
- // 时间处理
- Vue.filter('dayjsFormat', (value, format = 'YYYY-MM-DD') => {
- if (value) {
- return dayjs(value).format(format)
- } else {
- return value
- }
- })
- Vue.filter('dayjsFormatWeek', (value) => {
- if (value) {
- return dayjs(value).format('YYYY-MM')
- } else {
- return value
- }
- })
- Vue.filter('dayjsFormatMinute', (value) => {
- if (value) {
- return dayjs(value).format('HH:mm')
- } else {
- return value
- }
- })
- Vue.filter('formatTimer', (value) => {
- if (value) {
- return value.split(' ')[0]
- } else {
- return value
- }
- })
- Vue.filter('timerForMinFormat', (value) => {
- if (value) {
- return value.substring(0, 5)
- } else {
- return value
- }
- })
- Vue.filter('dateForMinFormat', (value) => {
- if (value) {
- return value.substring(0, 16)
- } else {
- return value
- }
- })
- // 乐团状态
- Vue.filter('musicGroupType', (value) => {
- // let template = {
- // APPLY: "报名中",
- // PAY: "缴费中",
- // PREPARE: "筹备中",
- // PROGRESS: "进行中",
- // CANCELED: '取消',
- // PAUSE: '暂停',
- // AUDIT: '审核中',
- // DRAFT: '编辑中',
- // AUDIT_FAILED: '审核失败'
- // }
- return constant.musicGroupType[value]
- })
- Vue.filter('paymentPatternTypeFormat', val => constant.paymentPatternType[val])
- // 支付用户类型
- Vue.filter('payUserTypeFormat', val => constant.payUserType[val])
- // 支付缴费方式
- Vue.filter('userPaymentTypeFormat', val => constant.userPaymentType[val])
- // 课程类型格式化
- Vue.filter('courseTypeFormat', val => constant.courseType[val])
- // 格式化签到签退记录 updateAttendanceEnum
- Vue.filter('updateAttendanceEnum', val => constant.updateAttendanceEnum[val])
- Vue.filter('clientTypeFilter',val=>constant.clientType[val])
- // 教学伴奏
- Vue.filter('clientType',val=>constant.clientStatus[val])
- // 时间处理
- Vue.filter('timer', (value) => {
- if (value) {
- let tempDate = new Date(value)
- let month = tempDate.getHours() >= 10 ? tempDate.getHours() : '0' + tempDate.getHours()
- let days = tempDate.getMinutes() >= 10 ? tempDate.getMinutes() : '0' + tempDate.getMinutes()
- return month + ':' + days
- } else {
- return value
- }
- })
- // 格式化成星期
- Vue.filter('formatWeek', date => {
- let nd = new Date(date)
- let temp = ['星期天', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六']
- return temp[nd.getDay()]
- })
- // 职位
- Vue.filter('jobType', value => {
- let template = {
- ADVISER: "指导老师",
- ACADEMIC: "乐团主管",
- TEACHING: "乐队指导"
- }
- return template[value]
- })
- // 工作类型
- Vue.filter('jobNature', (value) => {
- return constant.jobNature[value]
- })
- // 考勤状态
- Vue.filter('attendanceType', value => {
- let template = {
- 0: "异常",
- 1: "正常",
- 3: "未签到"
- }
- return template[value]
- })
- // 考情签退
- Vue.filter('attendanceOutType', value => {
- let template = {
- 0: "异常",
- 1: "正常",
- 3: "未签退"
- }
- return template[value]
- })
- // 上课类型
- Vue.filter('workType', value => {
- return constant.workType[value]
- })
- // 交易类型
- Vue.filter('orderType', value => {
- let template = {
- APPLY: "报名",
- RENEW: "续费",
- OTHER: "其他",
- SMALL_CLASS_TO_BUY: "VIP购买",
- SPORADIC: '零星收费',
- LUCK: "福袋活动",
- PRACTICE: '网管课',
- PRACTICE_GROUP_BUY: '网管课购买',
- PRACTICE_GROUP_RENEW: '网管课续费',
- REPAIR: '乐器维修',
- OUTORDER: '外部收入',
- GOODS_SELL: '商品销售',
- SUBJECT_CHANGE: '声部更换',
- DOUBLE_ELEVEN2020: '双十一活动',
- DEGREE: '儿童节活动',
- DEGREE_REGISTRATION: '考级报名',
- MAINTENANCE: '乐器保养',
- REPLACEMENT: '乐器置换'
- }
- return template[value]
- })
- //
- Vue.filter('paymentChannelType', value => {
- let template = {
- PER: "个人",
- COM: "公司"
- }
- return template[value]
- })
- // 交易状态
- Vue.filter('dealStatus', value => {
- let template = {
- ING: "交易中",
- SUCCESS: "成功交易",
- FAILED: "交易失败",
- CLOSE: "交易关闭"
- }
- return template[value]
- })
- // 交易状态
- Vue.filter('returnStatus', value => {
- let template = {
- ING: "审核中",
- REJECT: "拒绝",
- WAIT_PAYMENT: "待支付",
- DONE: "完成"
- }
- return template[value]
- })
- // 缴费状态
- Vue.filter('payTypeStatus', val => {
- return constant.payStatus[val]
- })
- // 性别
- Vue.filter('sex', value => {
- let template = ['女', '男']
- return template[value]
- })
- // 服从调剂 isAllowAdjust
- Vue.filter('isAllowAdjust', value => {
- let template = ['否', '是']
- return template[value]
- })
- // 学员缴费状态 paymentStatus
- Vue.filter('paymentStatus', value => {
- let template = ['未开启缴费', '开启缴费', '已缴费']
- return template[value]
- })
- // 乐团状态
- // Vue.filter('teamStatus', value => {
- // let template = {
- // PRE_APPLY: "预报名中",
- // APPLY: "报名中",
- // PAY: "缴费中",
- // PREPARE: "筹备中",
- // PROGRESS: "进行中",
- // PRE_BUILD_FEE: '创建缴费中',
- // CANCELED: '取消',
- // PAUSE: '暂停',
- // AUDIT: '乐团审核中',
- // DRAFT: '编辑中',
- // AUDIT_FAILED: '审核失败',
- // FEE_AUDIT: '费用审核中',
- // CLOSE: '已关闭',
- // }
- // return template[value]
- // })
- // 学生状态
- /**studentStatus */
- Vue.filter('studentStatus', value => {
- let template = ['在读', '已退课', '退课中', '休学']
- return template[value]
- })
- // 学生点名
- Vue.filter('studentRecord', value => {
- let template = {
- NORMAL: "正常",
- TRUANT: "旷课",
- LEAVE: "请假",
- DROP_OUT: "退学",
- '': '未签到'
- }
- return template[value]
- })
- // 是否
- Vue.filter('yesOrNo', value => {
- let template = ['否', '是']
- return template[value]
- })
- // 学员缴费状态
- Vue.filter('studentPay', value => {
- let template = {
- PAID_COMPLETED: "完成缴费",
- NON_PAYMENT: "未缴费",
- PROCESSING: "缴费中",
- }
- return template[value]
- })
- // 学员点名详情
- Vue.filter('studentSign', value => {
- let template = {
- NORMAL: "正常",
- TRUANT: "旷课",
- LEAVE: "请假",
- DROP_OUT: '退学'
- }
- return template[value]
- })
- // 班级类型
- Vue.filter('classType', value => {
- let template = {
- NORMAL: "声部班",
- MIX: '合奏班',
- HIGH: '基础技能班',
- VIP: 'VIP',
- DEMO: '试听',
- SNAP: "临时班",
- PRACTICE: '网管课',
- HIGH_ONLINE: '线上基础技能课',
- MUSIC_NETWORK: '乐团网管课'
- }
- return template[value]
- })
- Vue.filter('teachMode', value => {
- return constant.teachMode[value]
- })
- // 老师状态
- Vue.filter('teacherStatus', value => {
- let template = {
- "0": '正常',
- "1": '冻结',
- "9": '锁定'
- }
- return template[value]
- })
- // vip课状态
- Vue.filter('vipCourseStatus', value => {
- let template = {
- 0: "未开始",
- 1: "报名中",
- 5: "报名结束",
- 2: "进行中",
- 4: "已结束",
- 3: "取消",
- 6:'暂停'
- }
- return template[value]
- })
- // 账号类型
- Vue.filter('accountTypeFormat', value => {
- let template = {
- 0: "对内",
- 1: "对外",
- }
- return template[value]
- })
- // 扣减库存
- Vue.filter('stockTypeFormat', value => {
- let template = {
- INTERNAL: "内部",
- EXTERNAL: "外部",
- ALL: "内部,外部",
- }
- return template[value]
- })
- // 交易状态
- Vue.filter('paymentChannelStatus', value => {
- let template = {
- YQPAY: "双乾",
- BALANCE: "余额",
- ADAPAY: "汇付"
- }
- return template[value]
- })
- // edition
- Vue.filter('editionFilter', value => {
- let template = {
- 'ios-teacher': '苹果-老师端',
- 'ios-student': '苹果-学生端',
- 'ios-education': '苹果-管理端',
- 'android-teacher': '安卓-老师端',
- 'android-student': '安卓-学生端',
- 'android-education': '安卓-管理端',
- }
- return template[value]
- })
- // payStatus 订单支付状态
- Vue.filter('payStatus', value => {
- let template = {
- WAIT_PAY: "等待支付",
- ING: "交易中",
- SUCCESS: '成功交易',
- FAILED: '交易失败',
- CLOSE: '交易关闭'
- }
- return template[value]
- })
- // payType 交易类型
- Vue.filter('payType', value => {
- let template = {
- RECHARGE: "充值",
- WITHDRAW: "提现",
- PAY_FEE: "缴费",
- SPORADIC: "零星收费",
- FILL_ACCOUNT: "人工补账",
- REFUNDS: "退费",
- REWARDS: "奖励",
- WAGE: "工资"
- }
- return template[value]
- })
- // 课程组状态 FINISH
- Vue.filter('courseGroup', value => {
- let template = {
- NORMAL: "正常",
- LOCK: "锁定",
- FINISH: '结束',
- CANCEL: '取消',
- }
- return template[value]
- })
- // 网管课程组
- Vue.filter('comCourseGroup', value => {
- let template = {
- NOT_START: "未开始",
- LOCK: "锁定",
- APPLYING: "报名中",
- NORMAL: "进行中",
- FINISH: '结束',
- CANCEL: '关闭',
- }
- return template[value]
- })
- //网管课类型
- Vue.filter('comType', value => {
- let template = {
- FREE: "免费",
- CHARGE: '收费',
- TRIAL: '试听课',
- CARE_PACKAGE: '关心包',
- COME_ON_PACKAGE: '加油包'
- }
- return template[value]
- })
- // 首充续费
- Vue.filter('firstOrRenewFilter', value => {
- let template = {
- '0': "续费",
- '1': "首次",
- }
- return template[value]
- })
- // 老师时间
- Vue.filter('transTypeFilter', value => {
- let template = {
- 'RECHARGE': "充值",
- 'CONSUME': "建课",
- 'RETURN': "退课",
- 'MANUAL_ADD': "系统充值",
- 'MANUAL_SUB': "系统扣除",
- }
- return template[value]
- })
- // paymentType
- Vue.filter('paymentType', value => {
- let template = {
- 'OFFLINE': "线下",
- 'ONLINE': "线上",
- 'ALL': "全部",
- }
- return template[value]
- })
- Vue.filter('paymentListStatus', value => {
- let template = {
- 0: "未开始",
- 1: "已开启",
- 2: "已结束",
- }
- return template[value]
- })
- // paymentStatus
- Vue.filter('paymentStatusDetall', value => {
- let template = {
- 'PAID_COMPLETED': "已缴费",
- 'PROCESSING': "缴费中",
- 'NON_PAYMENT': "未缴费",
- }
- return template[value]
- })
- Vue.filter('replacementInsFilter', value => {
- let template = {
- 2: "已缴费",
- 1: "缴费中",
- 0: "未缴费",
- }
- return template[value]
- })
- // 课时申诉
- Vue.filter('complaintsStatusEnum', value => {
- let template = {
- 0: "已拒绝",
- 1: "已通过",
- 2: "待处理",
- 3: "已撤销",
- }
- return template[value]
- })
- // 人事状态 isProbationPeriod
- Vue.filter('isProbationPeriod', value => {
- let template = {
- 0: "正式",
- 1: "试用",
- 2: "离职",
- }
- return template[value]
- })
- Vue.filter('visiterType', value => {
- let template = {
- 'TEACHER': "指导老师",
- 'EDU_TEACHER': "乐团主管",
- }
- return template[value]
- })
- // 人力资源人员状态
- Vue.filter('hrStatus', value => {
- let template = {
- 'NOT_EMPLOYED': "未录用",
- 'INTERVIEWING': "面试中",
- 'RESERVE': "储备",
- 'PART_TIME': "兼职",
- 'FULL_TIME': "全职",
- 'DIMISSION': "离职",
- }
- return template[value]
- })
- // 费用类型
- Vue.filter('feeType', value => {
- return constant.feeType[value]
- })
- // 费用项目
- Vue.filter('feeProject', value => {
- return constant.feeProject[value]
- })
- // 销售类型
- Vue.filter('saleType', value => {
- return constant.saleType[value]
- })
- // 缴费状态
- Vue.filter('teamPayStatus', value => {
- const tpl = {
- 0: '按月',
- 1: '按学期',
- 2: '一次性',
- }
- return tpl[value]
- })
- // 金额格式化
- Vue.filter('moneyFormat', value => {
- return numeral(value).format('0,0.00')
- })
- Vue.filter('stockTypeStatus', value => {
- const template = {
- INTERNAL: '内部',
- EXTERNAL: '外部',
- ALL: '全部',
- }
- return template[value]
- })
- // 确认收货类型
- Vue.filter('receiveFormat', value => {
- let template = {
- 'NO_RECEIVE': "未确认",
- 'MANUAL_RECEIVE': "手动确认",
- 'AUTO_RECEIVE': "自动确认",
- }
- return template[value]
- })
- // 缴费方式
- Vue.filter('payOrderType', value => {
- return constant.payOrderType[value]
- })
- // 审核状态 auditType
- Vue.filter('auditType', value => {
- return constant.auditType[value]
- })
- // 审核申请类型 auditPaymentType
- Vue.filter('auditPaymentType', value => {
- return constant.auditPaymentType[value]
- })
- // 销售收入和服务收入
- Vue.filter('orderServer', value => {
- return constant.orderServerType[value]
- })
- // 订单审核状态 orderAuditType
- Vue.filter('orderAuditType', value => {
- constant.orderAuditType[''] = '审核通过'
- return constant.orderAuditType[value]
- })
- Vue.filter('songUseTypeFormat', value => {
- return constant.songUseType[value]
- })
- Vue.filter('rewardModeTypeFormat', value => {
- return constant.rewardModeType[value]
- })
- // 系统日志类型
- Vue.filter('journalTypeFormat', value => {
- return constant.journalType[value]
- })
- // 日程安排 inspectionItem
- Vue.filter('inspectionItemFormat', value => {
- return constant.inspectionItem[value]
- })
- // 学员列表关心包,加油包
- Vue.filter('studentPackage', value => {
- return constant.packageStatus[value]
- })
- // 分部 学年制
- Vue.filter('gradeTypeFormat', value => {
- return constant.gradeType[value]
- })
- // 老师状态
- Vue.filter('ProbationPeriod', value => {
- return constant.ProbationPeriodStatus[value]
- })
- // 下载列表 类型
- // downListType
- Vue.filter('downListType', value => {
- return constant.downListType[value]
- })
- // 退团状态
- Vue.filter('withdrawalStatus', value => {
- return constant.withdrawalStatus[value]
- })
|