diff --git a/src/api/receive-apply/index.js b/src/api/receive-apply/index.js index b2c63fc4..1509a561 100644 --- a/src/api/receive-apply/index.js +++ b/src/api/receive-apply/index.js @@ -19,16 +19,16 @@ export function getReceiveApplyDetailsApi(query) { // 获取审核记录详情 export function getAuditingDetailsApi(query) { return request({ - url: '/material//sysWorkflowNode/listByTaskId', + url: '/material/sysWorkflowNode/listByTaskId', method: 'get', params: query }) } // 审核提交接口 -export function submitAuditingApi(query) { +export function submitAuditingApi(data) { return request({ - url: '/material/ma_type/getMaTypeTreeSelect', - method: 'get', - params: query + url: '/material/sysWorkflowRecordHistory/update', + method: 'post', + data }) } diff --git a/src/api/reduction-apply/index.js b/src/api/reduction-apply/index.js index 1bb90408..0e71c358 100644 --- a/src/api/reduction-apply/index.js +++ b/src/api/reduction-apply/index.js @@ -16,10 +16,10 @@ export function getReceiveApplyDetailsApi(query) { params: query }) } -// 获取减免申请记录详情 +// 获取减免申请审核记录详情 export function getAuditingDetailsApi(query) { return request({ - url: '/material//sysWorkflowNode/listByTaskId', + url: '/material/sysWorkflowNode/listByTaskId', method: 'get', params: query }) diff --git a/src/store/modules/user.js b/src/store/modules/user.js index b660b65c..2e676312 100644 --- a/src/store/modules/user.js +++ b/src/store/modules/user.js @@ -1,4 +1,4 @@ -import { login, logout, getInfo, refreshToken, getPhoneCode, isLogin,isAdmin} from '@/api/login' +import { login, logout, getInfo, refreshToken, getPhoneCode, isLogin, isAdmin } from '@/api/login' import { getToken, setToken, setExpiresIn, removeToken } from '@/utils/auth' // 更严格的手机号和邮箱正则表达式 @@ -6,157 +6,168 @@ const phonePattern = /^(\+86)?1[3-9]\d{9}$/ // 支持前缀 +86 const emailPattern = /^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/ // 构建 payload 函数 -const buildPayload = ({ loginMethod, username, password, uuid, code, mobile, verificationCode,phoneUuid }) => { - let loginType = '' - if (loginMethod === 'mobile') { - loginType = phonePattern.test(mobile.trim()) ? 'PHONE_OTP' : emailPattern.test(mobile.trim()) ? 'EMAIL_OTP' : 'PHONE_OTP' - return { - username: mobile.trim(), - verificationCode, - uuid, - code, - loginType, - phoneUuid +const buildPayload = ({ loginMethod, username, password, uuid, code, mobile, verificationCode, phoneUuid }) => { + let loginType = '' + if (loginMethod === 'mobile') { + loginType = phonePattern.test(mobile.trim()) + ? 'PHONE_OTP' + : emailPattern.test(mobile.trim()) + ? 'EMAIL_OTP' + : 'PHONE_OTP' + return { + username: mobile.trim(), + verificationCode, + uuid, + code, + loginType, + phoneUuid + } + } else { + loginType = phonePattern.test(username.trim()) + ? 'PHONE_PASSWORD' + : emailPattern.test(username.trim()) + ? 'EMAIL_PASSWORD' + : 'USERNAME_PASSWORD' + return { + username: username.trim(), + password, + verificationCode, + uuid, + code, + loginType, + phoneUuid + } } - } else { - loginType = phonePattern.test(username.trim()) ? 'PHONE_PASSWORD' : emailPattern.test(username.trim()) ? 'EMAIL_PASSWORD' : 'USERNAME_PASSWORD' - return { - username: username.trim(), - password, - verificationCode, - uuid, - code, - loginType, - phoneUuid - } - } } const user = { - state: { - token: getToken(), - id: '', - name: '', - avatar: '', - roles: [], - permissions: [] - }, + state: { + token: getToken(), + id: '', + name: '', + avatar: '', + roles: [], + permissions: [] + }, - mutations: { - SET_TOKEN(state, token) { - state.token = token + mutations: { + SET_TOKEN(state, token) { + state.token = token + }, + SET_EXPIRES_IN(state, time) { + state.expires_in = time + }, + SET_ID(state, id) { + state.id = id + }, + SET_NAME(state, name) { + state.name = name + }, + SET_AVATAR(state, avatar) { + state.avatar = avatar + }, + SET_ROLES(state, roles) { + state.roles = roles + }, + SET_PERMISSIONS(state, permissions) { + state.permissions = permissions + } }, - SET_EXPIRES_IN(state, time) { - state.expires_in = time - }, - SET_ID(state, id) { - state.id = id - }, - SET_NAME(state, name) { - state.name = name - }, - SET_AVATAR(state, avatar) { - state.avatar = avatar - }, - SET_ROLES(state, roles) { - state.roles = roles - }, - SET_PERMISSIONS(state, permissions) { - state.permissions = permissions + + actions: { + IsLogin({ commit }, userInfo) { + const payload = buildPayload(userInfo) + return isLogin(payload) + .then(res => res) + .catch(error => Promise.reject(error)) + }, + IsAdmin({ commit }, userInfo) { + const payload = buildPayload(userInfo) + return isAdmin(payload) + .then(res => res) + .catch(error => Promise.reject(error)) + }, + + // 登录 + Login({ commit }, userInfo) { + const payload = buildPayload(userInfo) + return login(payload) + .then(res => { + const { access_token, expires_in } = res.data + setToken(access_token) + commit('SET_TOKEN', access_token) + setExpiresIn(expires_in) + commit('SET_EXPIRES_IN', expires_in) + return res + }) + .catch(error => Promise.reject(error)) + }, + + // 获取手机验证码 + GetPhoneCode({ commit }, userInfo) { + const payload = { + username: userInfo.mobile.trim(), + uuid: userInfo.uuid, + code: userInfo.code, + phoneUuid: userInfo.phoneUuid, + verificationCodeType: userInfo.mobileCodeType + } + return getPhoneCode(payload) + .then(res => res) + .catch(error => Promise.reject(error)) + }, + + // 获取用户信息 + GetInfo({ commit }) { + return getInfo() + .then(res => { + const user = res.user + const avatar = user.avatar ? user.avatar : require('@/assets/images/profile.jpg') + commit('SET_ROLES', res.roles && res.roles.length > 0 ? res.roles : ['ROLE_DEFAULT']) + commit('SET_PERMISSIONS', res.permissions) + commit('SET_ID', user.userId) + commit('SET_NAME', user.userName) + commit('SET_AVATAR', avatar) + + // 存取用户的userId + sessionStorage.setItem('userId', res.user.userId) + return res + }) + .catch(error => Promise.reject(error)) + }, + + // 刷新 token + RefreshToken({ commit, state }) { + return refreshToken(state.token) + .then(res => { + const expiresIn = res.data + setExpiresIn(expiresIn) + commit('SET_EXPIRES_IN', expiresIn) + }) + .catch(error => Promise.reject(error)) + }, + + // 退出登录 + LogOut({ commit, state }) { + return logout(state.token) + .then(() => { + commit('SET_TOKEN', '') + commit('SET_ROLES', []) + commit('SET_PERMISSIONS', []) + removeToken() + }) + .catch(error => Promise.reject(error)) + }, + + // 前端退出 + FedLogOut({ commit }) { + return new Promise(resolve => { + commit('SET_TOKEN', '') + removeToken() + resolve() + }) + } } - }, - - actions: { - IsLogin({ commit }, userInfo) { - const payload = buildPayload(userInfo) - return isLogin(payload) - .then(res => res) - .catch(error => Promise.reject(error)) - }, - IsAdmin({ commit }, userInfo) { - const payload = buildPayload(userInfo) - return isAdmin(payload) - .then(res => res) - .catch(error => Promise.reject(error)) - }, - - // 登录 - Login({ commit }, userInfo) { - const payload = buildPayload(userInfo) - return login(payload) - .then(res => { - const { access_token, expires_in } = res.data - setToken(access_token) - commit('SET_TOKEN', access_token) - setExpiresIn(expires_in) - commit('SET_EXPIRES_IN', expires_in) - return res; - }) - .catch(error => Promise.reject(error)) - }, - - // 获取手机验证码 - GetPhoneCode({ commit }, userInfo) { - const payload = { - username: userInfo.mobile.trim(), - uuid: userInfo.uuid, - code: userInfo.code, - phoneUuid: userInfo.phoneUuid, - verificationCodeType: userInfo.mobileCodeType - } - return getPhoneCode(payload) - .then(res => res) - .catch(error => Promise.reject(error)) - }, - - // 获取用户信息 - GetInfo({ commit }) { - return getInfo() - .then(res => { - const user = res.user - const avatar = user.avatar ? user.avatar : require('@/assets/images/profile.jpg') - commit('SET_ROLES', res.roles && res.roles.length > 0 ? res.roles : ['ROLE_DEFAULT']) - commit('SET_PERMISSIONS', res.permissions) - commit('SET_ID', user.userId) - commit('SET_NAME', user.userName) - commit('SET_AVATAR', avatar) - return res - }) - .catch(error => Promise.reject(error)) - }, - - // 刷新 token - RefreshToken({ commit, state }) { - return refreshToken(state.token) - .then(res => { - const expiresIn = res.data - setExpiresIn(expiresIn) - commit('SET_EXPIRES_IN', expiresIn) - }) - .catch(error => Promise.reject(error)) - }, - - // 退出登录 - LogOut({ commit, state }) { - return logout(state.token) - .then(() => { - commit('SET_TOKEN', '') - commit('SET_ROLES', []) - commit('SET_PERMISSIONS', []) - removeToken() - }) - .catch(error => Promise.reject(error)) - }, - - // 前端退出 - FedLogOut({ commit }) { - return new Promise(resolve => { - commit('SET_TOKEN', '') - removeToken() - resolve() - }) - } - } } export default user diff --git a/src/views/business-examine/receive-apply/business-details.vue b/src/views/business-examine/receive-apply/business-details.vue index c3d57386..9da96494 100644 --- a/src/views/business-examine/receive-apply/business-details.vue +++ b/src/views/business-examine/receive-apply/business-details.vue @@ -1,113 +1,125 @@ diff --git a/src/views/business-examine/receive-apply/index.vue b/src/views/business-examine/receive-apply/index.vue index 72bb616e..eb7e9c5e 100644 --- a/src/views/business-examine/receive-apply/index.vue +++ b/src/views/business-examine/receive-apply/index.vue @@ -91,19 +91,23 @@ @@ -226,7 +230,8 @@ export default { name: 'receive-apply-details', query: { id: row.id, - taskId: row.taskId + taskId: row.taskId, + type } }) // 跳转审核详情页面 }, diff --git a/src/views/business-examine/reduction-apply/business-details.vue b/src/views/business-examine/reduction-apply/business-details.vue index df91fa72..afd4e889 100644 --- a/src/views/business-examine/reduction-apply/business-details.vue +++ b/src/views/business-examine/reduction-apply/business-details.vue @@ -68,7 +68,7 @@
合计: - {{ totalAmount }} / 元 + {{ totalAmount.toFixed(2) }} / 元
@@ -106,7 +106,7 @@
@@ -132,7 +132,6 @@ export default { }, data() { return { - opinion: '', detailsInfo: {}, content: `测试996`, steps: [ @@ -144,7 +143,15 @@ export default { detailsList: [], auditingList: [], fileList: [], - totalAmount: 0 + totalAmount: 0, + auditingParams: { + nodeId: '', // 当前审核记录的id + nextNodeId: '', // 下个流程节点ID + isAccept: '', // 审批结果 1. 通过 2. 驳回 + remark: '', // 审核意见 + typeId: '', // 当前审核记录中的 typeId + taskId: '' // 外层列表的taskId + } } }, created() { @@ -156,7 +163,10 @@ export default { }, methods: { // 通过 - onSubmitPass() {}, + onSubmitPass() { + // 组装参数 + const auditingParams = {} + }, // 驳回 onSubmitReject() {}, // 获取数据详情 和 审核记录详情