新增凭证录入时回显甲方公司
This commit is contained in:
parent
dde799e222
commit
46680f8985
@ -77,4 +77,9 @@ export function getDepositRechargeTransferVoucherList(params: any) {
|
|||||||
return request.get({ url: '/company/getDepositRechargeTransferVoucherList', params })
|
return request.get({ url: '/company/getDepositRechargeTransferVoucherList', params })
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 根据公司id获取甲方公司信息
|
||||||
|
export function getPartyAbyCompanyId(params: any) {
|
||||||
|
return request.get({ url: '/company/getPartyA', params })
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -4,16 +4,32 @@
|
|||||||
ref="popupRef"
|
ref="popupRef"
|
||||||
:title="popupTitle"
|
:title="popupTitle"
|
||||||
:async="true"
|
:async="true"
|
||||||
width="550px"
|
width="580px"
|
||||||
@confirm="handleSubmit"
|
@confirm="handleSubmit"
|
||||||
@close="handleClose"
|
@close="handleClose"
|
||||||
>
|
>
|
||||||
<el-form
|
<el-form
|
||||||
ref="formRef"
|
ref="formRef"
|
||||||
:model="formData"
|
:model="formData"
|
||||||
label-width="90px"
|
label-width="120px"
|
||||||
:rules="formRules"
|
:rules="formRules"
|
||||||
>
|
>
|
||||||
|
<el-form-item label="甲方公司名称">
|
||||||
|
<el-input
|
||||||
|
readonly
|
||||||
|
v-model="partyA.company_name"
|
||||||
|
clearable
|
||||||
|
placeholder=""
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="甲方对公账号">
|
||||||
|
<el-input
|
||||||
|
readonly
|
||||||
|
v-model="partyA.qualification.corporate_account"
|
||||||
|
clearable
|
||||||
|
placeholder=""
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
<el-form-item label="公司名称" prop="company_name">
|
<el-form-item label="公司名称" prop="company_name">
|
||||||
<el-input
|
<el-input
|
||||||
readonly
|
readonly
|
||||||
@ -83,11 +99,7 @@ import type {
|
|||||||
} from "element-plus";
|
} from "element-plus";
|
||||||
import { genFileId } from "element-plus";
|
import { genFileId } from "element-plus";
|
||||||
import Popup from "@/components/popup/index.vue";
|
import Popup from "@/components/popup/index.vue";
|
||||||
import {
|
import { getPartyAbyCompanyId } from "@/api/company";
|
||||||
apiWithdrawAdd,
|
|
||||||
apiWithdrawEdit,
|
|
||||||
apiWithdrawDetail,
|
|
||||||
} from "@/api/withdraw";
|
|
||||||
import { timeFormat } from "@/utils/util";
|
import { timeFormat } from "@/utils/util";
|
||||||
import type { PropType } from "vue";
|
import type { PropType } from "vue";
|
||||||
import { depositRechargeTransferVoucher } from "@/api/company.ts";
|
import { depositRechargeTransferVoucher } from "@/api/company.ts";
|
||||||
@ -187,11 +199,6 @@ const handleFile = (e: any) => {
|
|||||||
formData.voucher = e.data.uri;
|
formData.voucher = e.data.uri;
|
||||||
};
|
};
|
||||||
|
|
||||||
// 查看凭证
|
|
||||||
const openTransfer = (uri: any) => {
|
|
||||||
window.open(uri);
|
|
||||||
};
|
|
||||||
|
|
||||||
// 获取详情
|
// 获取详情
|
||||||
const setFormData = async (data: Record<any, any>) => {
|
const setFormData = async (data: Record<any, any>) => {
|
||||||
let obj = {
|
let obj = {
|
||||||
@ -206,17 +213,40 @@ const setFormData = async (data: Record<any, any>) => {
|
|||||||
formData[key] = data[key];
|
formData[key] = data[key];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
getDetail();
|
||||||
};
|
};
|
||||||
|
|
||||||
const getDetail = async (row: Record<string, any>) => {
|
// 甲方公司信息
|
||||||
const data = await apiWithdrawDetail({
|
const partyA = reactive({
|
||||||
id: row.id,
|
company_name: "",
|
||||||
|
qualification: {
|
||||||
|
corporate_account: "",
|
||||||
|
},
|
||||||
|
});
|
||||||
|
const getDetail = async () => {
|
||||||
|
getPartyAbyCompanyId({
|
||||||
|
company_id: formData.id,
|
||||||
|
}).then((data) => {
|
||||||
|
partyA["company_name"] = data["company_name"];
|
||||||
|
if (typeof data.qualification == "string") {
|
||||||
|
data.qualification = JSON.parse(data.qualification);
|
||||||
|
partyA.qualification.corporate_account =
|
||||||
|
data.qualification.corporate_account;
|
||||||
|
} else {
|
||||||
|
partyA.qualification.corporate_account =
|
||||||
|
data.qualification.corporate_account;
|
||||||
|
}
|
||||||
|
if (!partyA.qualification.corporate_account) {
|
||||||
|
ElMessage.error("甲方公司没有对公账号,请补充账号后再试");
|
||||||
|
}
|
||||||
});
|
});
|
||||||
setFormData(data);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// 提交按钮
|
// 提交按钮
|
||||||
const handleSubmit = async () => {
|
const handleSubmit = async () => {
|
||||||
|
if (!partyA.company_name) return ElMessage.error("甲方公司不可为空");
|
||||||
|
if (!partyA.qualification.corporate_account)
|
||||||
|
return ElMessage.error("甲方公司对公账户不可为空");
|
||||||
if (!formData.id) return ElMessage.error("请先选择公司");
|
if (!formData.id) return ElMessage.error("请先选择公司");
|
||||||
await formRef.value?.validate();
|
await formRef.value?.validate();
|
||||||
const data = { ...formData };
|
const data = { ...formData };
|
||||||
@ -244,7 +274,6 @@ const handleClose = () => {
|
|||||||
defineExpose({
|
defineExpose({
|
||||||
open,
|
open,
|
||||||
setFormData,
|
setFormData,
|
||||||
getDetail,
|
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
Loading…
x
Reference in New Issue
Block a user