diff --git a/src/utils/util.ts b/src/utils/util.ts index 5f44fec..95a0773 100644 --- a/src/utils/util.ts +++ b/src/utils/util.ts @@ -1,6 +1,7 @@ import { isObject } from '@vue/shared' import { cloneDeep } from 'lodash' import moment from 'moment' +import { listSecond } from '@/api/org/department' /** * @description 添加单位 @@ -170,16 +171,16 @@ export const formatTimeText = (seconds: number) => { } // 分钟 if (seconds < 3600) { - return `${ Math.floor(seconds / 60) }分${ seconds % 60 }秒` + return `${Math.floor(seconds / 60)}分${seconds % 60}秒` } // 小时 if (seconds < 86400) { const remainder = seconds % 3600; - return `${ Math.floor(seconds / 3600) }小时${ parseInt(seconds % 3600 / 60) }分` + return `${Math.floor(seconds / 3600)}小时${parseInt(seconds % 3600 / 60)}分` } // 天 const remainder = seconds % 86400; - return `${ Math.floor(seconds / 86400) }天${ parseInt(seconds % 86400 / 3600) }小时` + return `${Math.floor(seconds / 86400)}天${parseInt(seconds % 86400 / 3600)}小时` } /** @@ -279,7 +280,7 @@ export function validatorIdCard(rule: object, code: string, callback: any) { } if (!code.match(idCardReg)) { return callback(new Error('请输入正确的身份证号码')) - } + } if (!city[code.substr(0, 2)]) { // 区域数组中不包含需验证的身份证前两位 return callback(new Error('请输入正确的身份证号码')) @@ -324,4 +325,49 @@ export function validatorPhone(rule: object, phonenumber: string, callback: any) return callback(new Error('请输入正确的手机号码')) } callback() -} \ No newline at end of file +} + +export function getAppealType(appealState: String) { + switch (appealState) { + case '1': + return 'primary' + case '2': + return 'success' + case '3': + return 'danger' + + default: + break; + } + +} + +export function getAppealName(appealState: String) { + switch (appealState) { + case '0': return '未审诉' + case '1': return '申诉中' + case '2': return '申诉成功' + case '3': return '已驳回' + } +} + +export function getAppealDept(handlingDept) { + if (handlingDept === 1) { + return Promise.resolve('市局专班'); + } else { + return new Promise((resolve, reject) => { + listSecond().then((res) => { + for (let item of res) { + if (item.id === handlingDept) { + resolve(item.name); + return; + } + } + resolve(null); // 如果循环结束都没找到,resolve为null + }).catch((err) => { + console.error(err); + reject(err); // 如果请求失败,reject这个promise + }); + }); + } +} diff --git a/src/views/work/Dissatisfied.vue b/src/views/work/Dissatisfied.vue index 2b3025b..febb097 100644 --- a/src/views/work/Dissatisfied.vue +++ b/src/views/work/Dissatisfied.vue @@ -117,7 +117,16 @@ 未签收 - + + + +