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