调账申请api接口实现、收入确认api接口实现

This commit is contained in:
雷校云
2025-12-11 15:26:41 +08:00
parent 480e7ac0d1
commit 4098de60b0
6 changed files with 59 additions and 11 deletions

View File

@@ -0,0 +1,25 @@
import request from "@/utils/request";
const AUTH_BASE_URL = "/api2";
/*
* 调账申请
* */
// 新增调账申请
export const FinanceLoan = (data: any) => {
const formData = new FormData();
formData.append("times", data.times);
formData.append("ContractNo", data.ContractNo);
formData.append("CustomerID", data.CustomerID);
formData.append("amount", data.amount);
formData.append("situation", data.situation);
formData.append("personincharge", data.personincharge);
return request({
url: `${AUTH_BASE_URL}/finance/loan`,
method: "post",
data: formData,
headers: {
"Content-Type": "multipart/form-data",
},
});
};

View File

@@ -21,15 +21,9 @@ export const userLogin = (data: any) => {
};
// 人员展示接口
export const UserGetInfo = (account: string) => {
const formData = new FormData();
formData.append("account", account);
export const UserGetInfo = () => {
return request({
url: `${AUTH_BASE_URL}/user/get_info`,
method: "post",
data: formData,
headers: {
"Content-Type": "multipart/form-data",
},
});
};

View File

@@ -0,0 +1,25 @@
import request from "@/utils/request";
const AUTH_BASE_URL = "/api2";
/*
* 收入确认
* */
// 新增收入确认
export const FinanceConfirm = (data: any) => {
const formData = new FormData();
formData.append("times", data.times);
formData.append("ContractNo", data.ContractNo);
formData.append("CustomerID", data.CustomerID);
formData.append("amount", data.amount);
formData.append("allocate", data.allocate);
formData.append("personincharge", data.personincharge);
return request({
url: `${AUTH_BASE_URL}/finance/confirm`,
method: "post",
data: formData,
headers: {
"Content-Type": "multipart/form-data",
},
});
};

View File

@@ -15,9 +15,11 @@ import MixLayout from "@/layouts/modes/mix/index.vue";
import Settings from "./components/Settings/index.vue";
import { LayoutMode } from "@/enums/settings/layout-enum";
import { defaultSettings } from "@/settings";
import { useUserStore } from "@/store/index";
const { currentLayout } = useLayout();
const route = useRoute();
const userStore = useUserStore();
/// Select the corresponding component based on the current layout mode
const currentLayoutComponent = computed(() => {
@@ -36,6 +38,9 @@ const currentLayoutComponent = computed(() => {
/// Whether to show the settings panel
const isShowSettings = computed(() => defaultSettings.showSettings);
onMounted(() => {
userStore.getUserInfo();
});
</script>
<style lang="scss" scoped>

View File

@@ -32,7 +32,6 @@ export const useUserStore = defineStore("user", () => {
AuthStorage.setTokens(accessToken, refreshToken, rememberMe.value);
userLogin(LoginFormData)
.then(() => {
getUserInfo(LoginFormData.username);
resolve();
})
.catch((error) => {
@@ -50,9 +49,9 @@ export const useUserStore = defineStore("user", () => {
*
* @returns {UserInfo} 用户信息
*/
function getUserInfo(username: string) {
function getUserInfo() {
return new Promise<UserInfo>((resolve, reject) => {
UserGetInfo(username)
UserGetInfo()
.then((res: any) => {
if (!res) {
reject("Verification failed, please Login again.");

View File

@@ -1,7 +1,7 @@
import { ElButton, ElDialog } from "element-plus";
import { Component, DefineComponent } from "vue";
import { h, createApp } from "vue";
import { debounce, throttle } from "@/utils/auxiliaryFunction";
import { throttle } from "@/utils/auxiliaryFunction";
// 定义模态框属性接口
interface ModalProps {