Files
yunzhupaas-web-vue3/src/views/mdm/company/Form.vue

1893 lines
67 KiB
Vue
Raw Normal View History

2026-04-21 17:48:26 +08:00
<template>
<BasicDrawer
v-bind="$attrs"
@register="registerDrawer"
2026-05-06 09:39:16 +08:00
width="1000px"
2026-04-21 17:48:26 +08:00
showFooter
:cancelText="t('common.cancelText', '取消')"
:okText="t('common.okText', '确定')"
@ok="handleSubmit"
:closeFunc="onClose">
<template #title>
<a-space :size="10">
<div class="text-16px font-medium">{{ title }}</div>
<a-space-compact size="small" block v-if="dataForm.id">
<a-tooltip :title="t('common.prevRecord')">
<a-button size="small" :disabled="getPrevDisabled" @click="handlePrev">
<i class="icon-ym icon-ym-caret-left text-10px"></i>
</a-button>
</a-tooltip>
<a-tooltip :title="t('common.nextRecord')">
<a-button size="small" :disabled="getNextDisabled" @click="handleNext">
<i class="icon-ym icon-ym-caret-right text-10px"></i>
</a-button>
</a-tooltip>
</a-space-compact>
</a-space>
</template>
<template #insertFooter>
<div class="float-left mt-5px">
<yunzhupaasCheckboxSingle v-model:value="submitType" :label="continueText" />
</div>
</template>
<a-row class="p-10px dynamic-form">
<!-- 表单 -->
<a-form
:colon="false"
size="middle"
layout="horizontal"
labelAlign="right"
:labelCol="{ style: { width: '100px' } }"
:model="dataForm"
:rules="dataRule"
ref="formRef">
<a-row :gutter="15">
<!-- 具体表单 -->
<a-col :span="8" class="ant-col-item">
<a-form-item name="company_code">
<template #label>企业编码 </template>
<YunzhupaasInput
v-model:value="dataForm.company_code"
@change="changeData('company_code', -1)"
2026-05-06 09:39:16 +08:00
placeholder="系统自动生成"
readonly
:style="{ width: '100%' }">
2026-04-21 17:48:26 +08:00
</YunzhupaasInput>
</a-form-item>
</a-col>
<a-col :span="8" class="ant-col-item">
<a-form-item name="company_name">
<template #label>企业名称 </template>
<YunzhupaasInput
v-model:value="dataForm.company_name"
@change="changeData('company_name', -1)"
placeholder="请输入企业名称"
:maxlength="200"
:allowClear="true"
:style="{ width: '100%' }"
:maskConfig="maskConfig.company_name"
:showCount="false">
</YunzhupaasInput>
</a-form-item>
</a-col>
<a-col :span="8" class="ant-col-item">
<a-form-item name="short_name">
<template #label>简称/昵称 </template>
<YunzhupaasInput
v-model:value="dataForm.short_name"
@change="changeData('short_name', -1)"
placeholder="请输入简称/昵称"
:maxlength="50"
:allowClear="true"
:style="{ width: '100%' }"
:maskConfig="maskConfig.short_name"
:showCount="false">
</YunzhupaasInput>
</a-form-item>
</a-col>
<a-col :span="8" class="ant-col-item">
<a-form-item name="entity_type">
<template #label>类型 </template>
<YunzhupaasRadio
v-model:value="dataForm.entity_type"
@change="changeData('entity_type', -1)"
:templateJson="state.interfaceRes.entity_type"
:style="{ width: '100%' }"
size="default"
:options="optionsObj.entity_typeOptions"
:fieldNames="optionsObj.entity_typeProps"
direction="horizontal"
optionType="default">
</YunzhupaasRadio>
</a-form-item>
</a-col>
2026-05-06 09:39:16 +08:00
<a-col :span="8" class="ant-col-item">
2026-04-21 17:48:26 +08:00
<a-form-item name="credit_code">
2026-05-06 09:39:16 +08:00
<template #label> {{ dataForm.entity_type === 'IND' ? '身份证' : '社会信用代码' }} </template>
2026-04-21 17:48:26 +08:00
<YunzhupaasInput
v-model:value="dataForm.credit_code"
@change="changeData('credit_code', -1)"
placeholder="请输入社会信用代码"
:maxlength="100"
:allowClear="true"
:style="{ width: '100%' }"
:maskConfig="maskConfig.credit_code"
:showCount="false">
</YunzhupaasInput>
</a-form-item>
</a-col>
2026-05-06 09:39:16 +08:00
<a-col :span="8" class="ant-col-item" v-if="dataForm.entity_type=='ORG'">
<a-form-item name="org_id">
<template #label>归属组织 </template>
<YunzhupaasOrganizeSelect
v-model:value="dataForm.org_id"
@change="changeData('org_id', -1)"
placeholder="请选择"
2026-04-21 17:48:26 +08:00
:allowClear="true"
:style="{ width: '100%' }"
:showSearch="false"
2026-05-06 09:39:16 +08:00
selectType="all">
</YunzhupaasOrganizeSelect>
2026-04-21 17:48:26 +08:00
</a-form-item>
</a-col>
2026-05-06 09:39:16 +08:00
<a-col :span="8" class="ant-col-item" v-if="dataForm.entity_type=='ORG'">
<a-form-item name="province_id">
<template #label>所属地区 </template>
<YunzhupaasAreaSelect
v-model:value="dataForm.province_id"
@change="changeData('province_id', -1)"
placeholder="请选择所属地区"
:allowClear="true"
:style="{ width: '100%' }"
:showSearch="false"
:level="2">
</YunzhupaasAreaSelect>
</a-form-item>
</a-col>
<a-col :span="8" class="ant-col-item" v-if="dataForm.entity_type=='ORG'">
2026-04-21 17:48:26 +08:00
<a-form-item name="tax_type">
<template #label>纳税人类别 </template>
<YunzhupaasSelect
v-model:value="dataForm.tax_type"
@change="changeData('tax_type', -1)"
placeholder="请选择纳税人类别"
:templateJson="state.interfaceRes.tax_type"
:allowClear="true"
:style="{ width: '100%' }"
:showSearch="false"
:options="optionsObj.tax_typeOptions"
:fieldNames="optionsObj.tax_typeProps">
</YunzhupaasSelect>
</a-form-item>
</a-col>
2026-05-06 09:39:16 +08:00
<a-col :span="8" class="ant-col-item" v-if="dataForm.entity_type=='ORG'">
2026-04-21 17:48:26 +08:00
<a-form-item name="enterprise_scale">
<template #label>企业规模 </template>
<YunzhupaasSelect
v-model:value="dataForm.enterprise_scale"
@change="changeData('enterprise_scale', -1)"
placeholder="请选择企业规模"
:templateJson="state.interfaceRes.enterprise_scale"
:allowClear="true"
:style="{ width: '100%' }"
:showSearch="false"
:options="optionsObj.enterprise_scaleOptions"
:fieldNames="optionsObj.enterprise_scaleProps">
</YunzhupaasSelect>
</a-form-item>
</a-col>
2026-05-06 09:39:16 +08:00
<a-col :span="8" class="ant-col-item" v-if="dataForm.entity_type=='ORG'">
2026-04-21 17:48:26 +08:00
<a-form-item name="enterprise_nature">
<template #label>企业类型 </template>
<YunzhupaasSelect
v-model:value="dataForm.enterprise_nature"
@change="changeData('enterprise_nature', -1)"
placeholder="请选择企业类型"
:templateJson="state.interfaceRes.enterprise_nature"
:allowClear="true"
:style="{ width: '100%' }"
:showSearch="false"
:options="optionsObj.enterprise_natureOptions"
:fieldNames="optionsObj.enterprise_natureProps">
</YunzhupaasSelect>
</a-form-item>
</a-col>
2026-05-06 09:39:16 +08:00
<a-col :span="8" class="ant-col-item" v-if="dataForm.entity_type=='ORG'">
2026-04-21 17:48:26 +08:00
<a-form-item name="industry_code">
<template #label>行业代码 </template>
<YunzhupaasSelect
v-model:value="dataForm.industry_code"
@change="changeData('industry_code', -1)"
placeholder="请选择行业代码"
:templateJson="state.interfaceRes.industry_code"
:allowClear="true"
:style="{ width: '100%' }"
:showSearch="false"
:options="optionsObj.industry_codeOptions"
:fieldNames="optionsObj.industry_codeProps">
</YunzhupaasSelect>
</a-form-item>
</a-col>
2026-05-06 09:39:16 +08:00
<a-col :span="8" class="ant-col-item" v-if="dataForm.entity_type=='ORG'">
2026-04-21 17:48:26 +08:00
<a-form-item name="registration_date">
<template #label>成立日期 </template>
<YunzhupaasDatePicker
v-model:value="dataForm.registration_date"
@change="changeData('registration_date', -1)"
placeholder="请选择成立日期"
:allowClear="true"
:style="{ width: '100%' }"
format="yyyy-MM-dd"
:startTime="getRelationDate(false, 1, 1, '', '')"
:endTime="getRelationDate(false, 1, 1, '', '')">
</YunzhupaasDatePicker>
</a-form-item>
</a-col>
<a-col :span="8" class="ant-col-item">
<a-form-item name="registered_capital">
<template #label>注册资本 </template>
<YunzhupaasInputNumber
v-model:value="dataForm.registered_capital"
@change="changeData('registered_capital', -1)"
placeholder="请输入注册资本"
:style="{ width: '100%' }"
:max="999999"
:step="1"
:precision="4"
addonAfter="万元"
:controls="false">
</YunzhupaasInputNumber>
</a-form-item>
</a-col>
<a-col :span="8" class="ant-col-item">
<a-form-item name="legal_representative">
<template #label>法定代表人 </template>
<YunzhupaasInput
v-model:value="dataForm.legal_representative"
@change="changeData('legal_representative', -1)"
placeholder="请输入法定代表人"
:maxlength="50"
:allowClear="true"
:style="{ width: '100%' }"
:maskConfig="maskConfig.legal_representative"
:showCount="false">
</YunzhupaasInput>
</a-form-item>
</a-col>
<a-col :span="8" class="ant-col-item">
<a-form-item name="phone">
<template #label>联系电话 </template>
<YunzhupaasInput
v-model:value="dataForm.phone"
@change="changeData('phone', -1)"
placeholder="请输入联系电话"
:maxlength="11"
:allowClear="true"
:style="{ width: '100%' }"
:maskConfig="maskConfig.phone"
:showCount="false">
</YunzhupaasInput>
</a-form-item>
</a-col>
<a-col :span="8" class="ant-col-item">
<a-form-item name="email">
<template #label>邮箱 </template>
<YunzhupaasInput
v-model:value="dataForm.email"
@change="changeData('email', -1)"
placeholder="请输入邮箱"
:maxlength="100"
:allowClear="true"
:style="{ width: '100%' }"
:maskConfig="maskConfig.email"
:showCount="false">
</YunzhupaasInput>
</a-form-item>
</a-col>
<a-col :span="8" class="ant-col-item">
<a-form-item name="website">
<template #label>网站 </template>
<YunzhupaasInput
v-model:value="dataForm.website"
@change="changeData('website', -1)"
placeholder="请输入网站"
:maxlength="100"
:allowClear="true"
:style="{ width: '100%' }"
:maskConfig="maskConfig.website"
:showCount="false">
</YunzhupaasInput>
</a-form-item>
</a-col>
<a-col :span="8" class="ant-col-item">
<a-form-item name="address">
<template #label>地址 </template>
<YunzhupaasInput
v-model:value="dataForm.address"
@change="changeData('address', -1)"
placeholder="请输入地址"
:maxlength="200"
:allowClear="true"
:style="{ width: '100%' }"
:maskConfig="maskConfig.address"
:showCount="false">
</YunzhupaasInput>
</a-form-item>
</a-col>
<a-col :span="24" class="ant-col-item">
<a-form-item name="business_scope">
<template #label>经营范围 </template>
<YunzhupaasTextarea
v-model:value="dataForm.business_scope"
@change="changeData('business_scope', -1)"
placeholder="请输入经营范围"
:maxlength="200"
:allowClear="true"
:style="{ width: '100%' }"
:autoSize="{ minRows: 3, maxRows: 3 }"
:showCount="false">
</YunzhupaasTextarea>
</a-form-item>
</a-col>
<a-col :span="24" class="ant-col-item">
<a-form-item name="remark">
<template #label>备注 </template>
<YunzhupaasTextarea
v-model:value="dataForm.remark"
@change="changeData('remark', -1)"
placeholder="请输入备注"
:allowClear="true"
:style="{ width: '100%' }"
:autoSize="{ minRows: 2, maxRows: 2 }"
:showCount="false">
</YunzhupaasTextarea>
</a-form-item>
</a-col>
<a-col :span="24" class="ant-col-item">
<a-tabs v-model:activeKey="state.activetabformItemfe79ef" tabPosition="top" class="mb-20">
2026-05-06 09:39:16 +08:00
<a-tab-pane tab="银行卡信息" key="2" forceRender>
2026-04-21 17:48:26 +08:00
<a-row :gutter="15">
<a-col :span="24" class="ant-col-item mb-20px">
<a-form-item>
<a-table
2026-05-06 09:39:16 +08:00
:data-source="dataForm.mdmCompanyBankList"
:columns="mdmCompanyBankColumns"
2026-04-21 17:48:26 +08:00
size="small"
:pagination="false"
:scroll="{ x: 'max-content' }"
2026-05-06 09:39:16 +08:00
:rowSelection="getmdmCompanyBankRowSelection"
2026-04-21 17:48:26 +08:00
rowKey="yunzhupaasId">
<template #headerCell="{ column }">
<span class="required-sign" v-if="column.required">*</span>
{{ column.title }}
<BasicHelp :text="column.tipLabel" v-if="column.tipLabel && column.title" />
</template>
<template #bodyCell="{ column, index, record }">
<template v-if="column.key === 'index'">{{ index + 1 }}</template>
2026-05-06 09:39:16 +08:00
<template v-if="column.key === 'bank_name'">
2026-04-21 17:48:26 +08:00
<YunzhupaasInput
2026-05-06 09:39:16 +08:00
v-model:value="record.bank_name"
@change="changeData('mdmCompanyBankbank_name', index)"
placeholder="请输入开户行"
:maxlength="20"
2026-04-21 17:48:26 +08:00
:allowClear="true"
:style="{ width: '100%' }"
2026-05-06 09:39:16 +08:00
:maskConfig="maskConfig.mdmCompanyBankbank_name"
2026-04-21 17:48:26 +08:00
:showCount="false">
</YunzhupaasInput>
</template>
2026-05-06 09:39:16 +08:00
<template v-if="column.key === 'bank_account_name'">
2026-04-21 17:48:26 +08:00
<YunzhupaasInput
2026-05-06 09:39:16 +08:00
v-model:value="record.bank_account_name"
@change="changeData('mdmCompanyBankbank_account_name', index)"
placeholder="请输入账户名"
2026-04-21 17:48:26 +08:00
:maxlength="20"
:allowClear="true"
:style="{ width: '100%' }"
2026-05-06 09:39:16 +08:00
:maskConfig="maskConfig.mdmCompanyBankbank_account_name"
2026-04-21 17:48:26 +08:00
:showCount="false">
</YunzhupaasInput>
</template>
2026-05-06 09:39:16 +08:00
<template v-if="column.key === 'bank_account_number'">
2026-04-21 17:48:26 +08:00
<YunzhupaasInput
2026-05-06 09:39:16 +08:00
v-model:value="record.bank_account_number"
@change="changeData('mdmCompanyBankbank_account_number', index)"
placeholder="请输入银行账号"
:maxlength="20"
2026-04-21 17:48:26 +08:00
:allowClear="true"
:style="{ width: '100%' }"
2026-05-06 09:39:16 +08:00
:maskConfig="maskConfig.mdmCompanyBankbank_account_number"
2026-04-21 17:48:26 +08:00
:showCount="false">
</YunzhupaasInput>
</template>
2026-05-06 09:39:16 +08:00
<template v-if="column.key === 'bank_province'">
2026-04-21 17:48:26 +08:00
<YunzhupaasInput
2026-05-06 09:39:16 +08:00
v-model:value="record.bank_province"
@change="changeData('mdmCompanyBankbank_province', index)"
placeholder="请输入开户行城市"
:maxlength="20"
2026-04-21 17:48:26 +08:00
:allowClear="true"
:style="{ width: '100%' }"
2026-05-06 09:39:16 +08:00
:maskConfig="maskConfig.mdmCompanyBankbank_province"
2026-04-21 17:48:26 +08:00
:showCount="false">
</YunzhupaasInput>
</template>
<template v-if="column.key === 'remark'">
<YunzhupaasInput
v-model:value="record.remark"
2026-05-06 09:39:16 +08:00
@change="changeData('mdmCompanyBankremark', index)"
2026-04-21 17:48:26 +08:00
placeholder="请输入备注"
2026-05-06 09:39:16 +08:00
:maxlength="200"
2026-04-21 17:48:26 +08:00
:allowClear="true"
:style="{ width: '100%' }"
2026-05-06 09:39:16 +08:00
:maskConfig="maskConfig.mdmCompanyBankremark"
2026-04-21 17:48:26 +08:00
:showCount="false">
</YunzhupaasInput>
</template>
<template v-if="column.key === 'action'">
<a-space>
2026-05-06 09:39:16 +08:00
<a-button class="action-btn" type="link" @click="copyMdmCompanyBankRow(index)" size="small">
2026-04-21 17:48:26 +08:00
{{ t('common.copyText', '复制') }}
</a-button>
2026-05-06 09:39:16 +08:00
<a-button class="action-btn" type="link" color="error" @click="removeMdmCompanyBankRow(index, true)" size="small">
2026-04-21 17:48:26 +08:00
{{ t('common.delText', '删除') }}
</a-button>
</a-space>
</template>
</template>
</a-table>
<a-space class="input-table-footer-btn">
2026-05-06 09:39:16 +08:00
<a-button type="primary" preIcon="icon-ym icon-ym-btn-add" @click="addMdmCompanyBankRow"> {{ t('common.add1Text', '添加') }} </a-button>
<a-button type="danger" preIcon="icon-ym icon-ym-btn-clearn" @click="batchRemoveMdmCompanyBankRow(true)">
2026-04-21 17:48:26 +08:00
{{ t('common.batchDelText', '批量删除') }}
</a-button>
</a-space>
</a-form-item>
</a-col>
</a-row>
</a-tab-pane>
2026-05-06 09:39:16 +08:00
<a-tab-pane tab="发票抬头" key="1" forceRender>
2026-04-21 17:48:26 +08:00
<a-row :gutter="15">
<a-col :span="24" class="ant-col-item mb-20px">
<a-form-item>
<a-table
2026-05-06 09:39:16 +08:00
:data-source="dataForm.companyInvoiceList"
:columns="companyInvoiceColumns"
2026-04-21 17:48:26 +08:00
size="small"
:pagination="false"
:scroll="{ x: 'max-content' }"
2026-05-06 09:39:16 +08:00
:rowSelection="getcompanyInvoiceRowSelection"
2026-04-21 17:48:26 +08:00
rowKey="yunzhupaasId">
<template #headerCell="{ column }">
<span class="required-sign" v-if="column.required">*</span>
{{ column.title }}
<BasicHelp :text="column.tipLabel" v-if="column.tipLabel && column.title" />
</template>
<template #bodyCell="{ column, index, record }">
<template v-if="column.key === 'index'">{{ index + 1 }}</template>
2026-05-06 09:39:16 +08:00
<template v-if="column.key === 'title_code'">
2026-04-21 17:48:26 +08:00
<YunzhupaasInput
2026-05-06 09:39:16 +08:00
v-model:value="record.title_code"
@change="changeData('companyInvoicetitle_code', index)"
placeholder="系统自动生成"
readonly
:style="{ width: '100%' }">
</YunzhupaasInput>
</template>
<template v-if="column.key === 'title_name'">
<YunzhupaasInput
v-model:value="record.title_name"
@change="changeData('companyInvoicetitle_name', index)"
placeholder="请输入联系人"
:maxlength="10"
2026-04-21 17:48:26 +08:00
:allowClear="true"
:style="{ width: '100%' }"
2026-05-06 09:39:16 +08:00
:maskConfig="maskConfig.companyInvoicetitle_name"
2026-04-21 17:48:26 +08:00
:showCount="false">
</YunzhupaasInput>
</template>
2026-05-06 09:39:16 +08:00
<template v-if="column.key === 'credit_code'">
2026-04-21 17:48:26 +08:00
<YunzhupaasInput
2026-05-06 09:39:16 +08:00
v-model:value="record.credit_code"
@change="changeData('companyInvoicecredit_code', index)"
placeholder="请输入联系人职务"
2026-04-21 17:48:26 +08:00
:maxlength="20"
:allowClear="true"
:style="{ width: '100%' }"
2026-05-06 09:39:16 +08:00
:maskConfig="maskConfig.companyInvoicecredit_code"
2026-04-21 17:48:26 +08:00
:showCount="false">
</YunzhupaasInput>
</template>
2026-05-06 09:39:16 +08:00
<template v-if="column.key === 'tax_type'">
<YunzhupaasSelect
v-model:value="record.tax_type"
@change="changeData('companyInvoicetax_type', index)"
placeholder="请选择纳税人类别"
:templateJson="state.interfaceRes.companyInvoicetax_type"
:allowClear="true"
:style="{ width: '100%' }"
:showSearch="false"
:options="optionsObj.companyInvoicetax_typeOptions"
:fieldNames="optionsObj.companyInvoicetax_typeProps">
</YunzhupaasSelect>
</template>
<template v-if="column.key === 'address'">
2026-04-21 17:48:26 +08:00
<YunzhupaasInput
2026-05-06 09:39:16 +08:00
v-model:value="record.address"
@change="changeData('companyInvoiceaddress', index)"
placeholder="请输入联系人邮箱"
:maxlength="50"
2026-04-21 17:48:26 +08:00
:allowClear="true"
:style="{ width: '100%' }"
2026-05-06 09:39:16 +08:00
:maskConfig="maskConfig.companyInvoiceaddress"
2026-04-21 17:48:26 +08:00
:showCount="false">
</YunzhupaasInput>
</template>
2026-05-06 09:39:16 +08:00
<template v-if="column.key === 'phone'">
2026-04-21 17:48:26 +08:00
<YunzhupaasInput
2026-05-06 09:39:16 +08:00
v-model:value="record.phone"
@change="changeData('companyInvoicephone', index)"
placeholder="请输入联系人邮箱"
:maxlength="50"
2026-04-21 17:48:26 +08:00
:allowClear="true"
:style="{ width: '100%' }"
2026-05-06 09:39:16 +08:00
:maskConfig="maskConfig.companyInvoicephone"
2026-04-21 17:48:26 +08:00
:showCount="false">
</YunzhupaasInput>
</template>
2026-05-06 09:39:16 +08:00
<template v-if="column.key === 'bank_name'">
<YunzhupaasInput
v-model:value="record.bank_name"
@change="changeData('companyInvoicebank_name', index)"
placeholder="请输入联系人邮箱"
:maxlength="50"
:allowClear="true"
:style="{ width: '100%' }"
:maskConfig="maskConfig.companyInvoicebank_name"
:showCount="false">
</YunzhupaasInput>
</template>
<template v-if="column.key === 'bank_account'">
<YunzhupaasInput
v-model:value="record.bank_account"
@change="changeData('companyInvoicebank_account', index)"
placeholder="请输入联系人邮箱"
:maxlength="50"
:allowClear="true"
:style="{ width: '100%' }"
:maskConfig="maskConfig.companyInvoicebank_account"
:showCount="false">
</YunzhupaasInput>
</template>
<template v-if="column.key === 'is_defalut'">
<YunzhupaasSwitch v-model:value="record.is_defalut" @change="changeData('companyInvoiceis_defalut', index)"> </YunzhupaasSwitch>
</template>
<template v-if="column.key === 'is_valid'">
<YunzhupaasSwitch v-model:value="record.is_valid" @change="changeData('companyInvoiceis_valid', index)"> </YunzhupaasSwitch>
</template>
2026-04-21 17:48:26 +08:00
<template v-if="column.key === 'remark'">
<YunzhupaasInput
v-model:value="record.remark"
2026-05-06 09:39:16 +08:00
@change="changeData('companyInvoiceremark', index)"
2026-04-21 17:48:26 +08:00
placeholder="请输入备注"
2026-05-06 09:39:16 +08:00
:maxlength="50"
2026-04-21 17:48:26 +08:00
:allowClear="true"
:style="{ width: '100%' }"
2026-05-06 09:39:16 +08:00
:maskConfig="maskConfig.companyInvoiceremark"
2026-04-21 17:48:26 +08:00
:showCount="false">
</YunzhupaasInput>
</template>
<template v-if="column.key === 'action'">
<a-space>
2026-05-06 09:39:16 +08:00
<a-button class="action-btn" type="link" @click="copyCompanyInvoiceRow(index)" size="small">
2026-04-21 17:48:26 +08:00
{{ t('common.copyText', '复制') }}
</a-button>
2026-05-06 09:39:16 +08:00
<a-button class="action-btn" type="link" color="error" @click="removeCompanyInvoiceRow(index, true)" size="small">
2026-04-21 17:48:26 +08:00
{{ t('common.delText', '删除') }}
</a-button>
</a-space>
</template>
</template>
</a-table>
<a-space class="input-table-footer-btn">
2026-05-06 09:39:16 +08:00
<a-button type="primary" preIcon="icon-ym icon-ym-btn-add" @click="addCompanyInvoiceRow"> {{ t('common.add1Text', '添加') }} </a-button>
<a-button type="danger" preIcon="icon-ym icon-ym-btn-clearn" @click="batchRemoveCompanyInvoiceRow(true)">
2026-04-21 17:48:26 +08:00
{{ t('common.batchDelText', '批量删除') }}
</a-button>
</a-space>
</a-form-item>
</a-col>
</a-row>
</a-tab-pane>
</a-tabs>
</a-col>
<!-- 表单结束 -->
</a-row>
</a-form>
</a-row>
</BasicDrawer>
</template>
<script lang="ts" setup>
import { create, update, getInfo } from './helper/api';
import { reactive, toRefs, nextTick, ref, unref, computed, toRaw, inject } from 'vue';
import { BasicDrawer, useDrawer } from '@/components/Drawer';
import { yunzhupaasRelationForm } from '@/components/yunzhupaas';
import { useMessage } from '@/hooks/web/useMessage';
import { useI18n } from '@/hooks/web/useI18n';
import { useUserStore } from '@/store/modules/user';
import type { FormInstance } from 'ant-design-vue';
import { thousandsFormat, getDateTimeUnit, getTimeUnit } from '@/utils/yunzhupaas';
import { getDictionaryDataSelector } from '@/api/systemData/dictionary';
import { getDataInterfaceRes } from '@/api/systemData/dataInterface';
import dayjs from 'dayjs';
// 表单权限
import { usePermission } from '@/hooks/web/usePermission';
import { cloneDeep } from 'lodash-es';
import { buildUUID } from '@/utils/uuid';
import { CaretRightOutlined } from '@ant-design/icons-vue';
interface State {
dataForm: any;
tableRows: any;
dataRule: any;
optionsObj: any;
childIndex: any;
isEdit: any;
interfaceRes: any;
//可选范围默认值
ableAll: any;
//掩码配置
maskConfig: any;
//定位属性
locationScope: any;
activetabformItemfe79ef: any;
selectedmdmCompanyBankRowKeys: any;
2026-05-06 09:39:16 +08:00
selectedcompanyInvoiceRowKeys: any;
2026-04-21 17:48:26 +08:00
extraOptions: any;
title: string;
continueText: string;
allList: any[];
currIndex: number;
isContinue: boolean;
submitType: number;
showContinueBtn: boolean;
}
const emit = defineEmits(['reload']);
const getLeftTreeActiveInfo: (() => any) | null = inject('getLeftTreeActiveInfo', null);
const userStore = useUserStore();
const userInfo = userStore.getUserInfo;
const { createMessage, createConfirm } = useMessage();
const { t } = useI18n();
const [registerDrawer, { openDrawer, setDrawerProps }] = useDrawer();
const formRef = ref<FormInstance>();
2026-05-06 09:39:16 +08:00
const mdmCompanyBankColumns: any[] = computed(() => {
2026-04-21 17:48:26 +08:00
let list = [
{
2026-05-06 09:39:16 +08:00
title: '开户行',
dataIndex: 'bank_name',
key: 'bank_name',
2026-04-21 17:48:26 +08:00
labelWidth: '',
span: '24',
tipLabel: '',
required: false,
style: { width: '100%' },
align: 'left',
fixed: false,
2026-05-06 09:39:16 +08:00
formP: 'bank_name',
2026-04-21 17:48:26 +08:00
},
{
2026-05-06 09:39:16 +08:00
title: '账户名',
dataIndex: 'bank_account_name',
key: 'bank_account_name',
2026-04-21 17:48:26 +08:00
labelWidth: '',
span: '24',
tipLabel: '',
required: false,
style: { width: '100%' },
align: 'left',
fixed: false,
2026-05-06 09:39:16 +08:00
formP: 'bank_account_name',
2026-04-21 17:48:26 +08:00
},
{
2026-05-06 09:39:16 +08:00
title: '银行账号',
dataIndex: 'bank_account_number',
key: 'bank_account_number',
2026-04-21 17:48:26 +08:00
labelWidth: '',
span: '24',
tipLabel: '',
required: false,
style: { width: '100%' },
align: 'left',
fixed: false,
2026-05-06 09:39:16 +08:00
formP: 'bank_account_number',
2026-04-21 17:48:26 +08:00
},
{
2026-05-06 09:39:16 +08:00
title: '开户行城市',
dataIndex: 'bank_province',
key: 'bank_province',
2026-04-21 17:48:26 +08:00
labelWidth: '',
span: '24',
tipLabel: '',
required: false,
style: { width: '100%' },
align: 'left',
fixed: false,
2026-05-06 09:39:16 +08:00
formP: 'bank_province',
2026-04-21 17:48:26 +08:00
},
{
title: '备注',
dataIndex: 'remark',
key: 'remark',
labelWidth: '',
span: '24',
tipLabel: '',
required: false,
style: { width: '100%' },
align: 'left',
fixed: false,
formP: 'remark',
},
];
list.push({ title: t('component.table.action'), showLabel: true, dataIndex: 'action', key: 'action', align: 'center', fixed: 'right', width: 100 });
const indexColumn = { title: t('component.table.index'), showLabel: true, dataIndex: 'index', key: 'index', align: 'center', fixed: 'left', width: 50 };
//子表复杂表头-处理
let columnList = list;
let complexHeaderList: any[] = [];
if (complexHeaderList.length) {
let childColumns: any[] = [];
let firstChildColumns: string[] = [];
for (let i = 0; i < complexHeaderList.length; i++) {
const e = complexHeaderList[i];
e.title = e.fullNameI18nCode ? t(e.fullNameI18nCode, e.fullName) : e.fullName;
e.align = e.align;
e.children = [];
e.yunzhupaasKey = 'complexHeader';
if (e.childColumns?.length) {
childColumns.push(...e.childColumns);
for (let k = 0; k < e.childColumns.length; k++) {
const item = e.childColumns[k];
for (let j = 0; j < list.length; j++) {
const o = list[j];
if (o.key == item && o.fixed !== 'left' && o.fixed !== 'right') e.children.push({ ...o });
}
}
}
if (e.children.length) firstChildColumns.push(e.children[0].key);
}
complexHeaderList = complexHeaderList.filter(o => o.children.length);
let newList: any[] = [];
for (let i = 0; i < list.length; i++) {
const e = list[i];
if (!childColumns.includes(e.key) || e.fixed === 'left' || e.fixed === 'right') {
newList.push(e);
} else {
if (firstChildColumns.includes(e.key)) {
const item = complexHeaderList.find(o => o.childColumns.includes(e.key));
newList.push(item);
}
}
}
columnList = newList;
}
let columns = [indexColumn, ...columnList];
const leftFixedList = columns.filter(o => o.fixed === 'left');
const rightFixedList = columns.filter(o => o.fixed === 'right');
const noFixedList = columns.filter(o => o.fixed !== 'left' && o.fixed !== 'right');
return [...leftFixedList, ...noFixedList, ...rightFixedList];
});
2026-05-06 09:39:16 +08:00
const getmdmCompanyBankHasBatchBtn = computed(() => {
2026-04-21 17:48:26 +08:00
let flist: any[] = [
{ btnIcon: 'icon-ym icon-ym-btn-add', show: true, label: '添加', btnType: 'primary', value: 'add', labelI18nCode: 'common.add1Text' },
{
btnIcon: 'icon-ym icon-ym-btn-clearn',
showConfirm: 'true',
show: true,
label: '批量删除',
btnType: 'danger',
value: 'batchRemove',
labelI18nCode: 'common.batchDelText',
},
];
return flist?.length && flist.some(o => o.value == 'batchRemove' && !!o.show);
});
2026-05-06 09:39:16 +08:00
const getmdmCompanyBankRowSelection = computed(() => {
if (!unref(getmdmCompanyBankHasBatchBtn)) return undefined;
2026-04-21 17:48:26 +08:00
const rowSelection = {
2026-05-06 09:39:16 +08:00
selectedRowKeys: state.selectedmdmCompanyBankRowKeys,
2026-04-21 17:48:26 +08:00
onChange: (selectedRowKeys: string[]) => {
2026-05-06 09:39:16 +08:00
state.selectedmdmCompanyBankRowKeys = selectedRowKeys;
2026-04-21 17:48:26 +08:00
},
};
return rowSelection;
});
2026-05-06 09:39:16 +08:00
const companyInvoiceColumns: any[] = computed(() => {
2026-04-21 17:48:26 +08:00
let list = [
{
2026-05-06 09:39:16 +08:00
title: '发票抬头编码',
dataIndex: 'title_code',
key: 'title_code',
labelWidth: '',
span: '24',
tipLabel: '',
required: false,
style: { width: '100%' },
align: 'left',
fixed: false,
formP: 'title_code',
},
{
title: '发票抬头名称',
dataIndex: 'title_name',
key: 'title_name',
labelWidth: '',
span: '24',
tipLabel: '',
required: false,
style: { width: '100%' },
align: 'left',
fixed: false,
formP: 'title_name',
},
{
title: '纳税人识别号',
dataIndex: 'credit_code',
key: 'credit_code',
labelWidth: '',
span: '24',
tipLabel: '',
required: false,
style: { width: '100%' },
align: 'left',
fixed: false,
formP: 'credit_code',
},
{
title: '纳税人类别',
dataIndex: 'tax_type',
key: 'tax_type',
labelWidth: '',
span: '8',
tipLabel: '',
required: false,
style: { width: '100%' },
align: 'left',
fixed: false,
formP: 'tax_type',
},
{
title: '地址',
dataIndex: 'address',
key: 'address',
labelWidth: '',
span: '24',
tipLabel: '',
required: false,
style: { width: '100%' },
align: 'left',
fixed: false,
formP: 'address',
},
{
title: '电话',
dataIndex: 'phone',
key: 'phone',
labelWidth: '',
span: '24',
tipLabel: '',
required: false,
style: { width: '100%' },
align: 'left',
fixed: false,
formP: 'phone',
},
{
title: '开户银行',
2026-04-21 17:48:26 +08:00
dataIndex: 'bank_name',
key: 'bank_name',
labelWidth: '',
span: '24',
tipLabel: '',
required: false,
style: { width: '100%' },
align: 'left',
fixed: false,
formP: 'bank_name',
},
{
2026-05-06 09:39:16 +08:00
title: '银行账户',
dataIndex: 'bank_account',
key: 'bank_account',
2026-04-21 17:48:26 +08:00
labelWidth: '',
span: '24',
tipLabel: '',
required: false,
style: { width: '100%' },
align: 'left',
fixed: false,
2026-05-06 09:39:16 +08:00
formP: 'bank_account',
2026-04-21 17:48:26 +08:00
},
{
2026-05-06 09:39:16 +08:00
title: '是否默认',
dataIndex: 'is_defalut',
key: 'is_defalut',
2026-04-21 17:48:26 +08:00
labelWidth: '',
span: '24',
tipLabel: '',
required: false,
2026-05-06 09:39:16 +08:00
style: '',
2026-04-21 17:48:26 +08:00
align: 'left',
fixed: false,
2026-05-06 09:39:16 +08:00
formP: 'is_defalut',
2026-04-21 17:48:26 +08:00
},
{
2026-05-06 09:39:16 +08:00
title: '是否有效',
dataIndex: 'is_valid',
key: 'is_valid',
2026-04-21 17:48:26 +08:00
labelWidth: '',
span: '24',
tipLabel: '',
required: false,
2026-05-06 09:39:16 +08:00
style: '',
2026-04-21 17:48:26 +08:00
align: 'left',
fixed: false,
2026-05-06 09:39:16 +08:00
formP: 'is_valid',
2026-04-21 17:48:26 +08:00
},
{
title: '备注',
dataIndex: 'remark',
key: 'remark',
labelWidth: '',
span: '24',
tipLabel: '',
required: false,
style: { width: '100%' },
align: 'left',
fixed: false,
formP: 'remark',
},
];
list.push({ title: t('component.table.action'), showLabel: true, dataIndex: 'action', key: 'action', align: 'center', fixed: 'right', width: 100 });
const indexColumn = { title: t('component.table.index'), showLabel: true, dataIndex: 'index', key: 'index', align: 'center', fixed: 'left', width: 50 };
//子表复杂表头-处理
let columnList = list;
let complexHeaderList: any[] = [];
if (complexHeaderList.length) {
let childColumns: any[] = [];
let firstChildColumns: string[] = [];
for (let i = 0; i < complexHeaderList.length; i++) {
const e = complexHeaderList[i];
e.title = e.fullNameI18nCode ? t(e.fullNameI18nCode, e.fullName) : e.fullName;
e.align = e.align;
e.children = [];
e.yunzhupaasKey = 'complexHeader';
if (e.childColumns?.length) {
childColumns.push(...e.childColumns);
for (let k = 0; k < e.childColumns.length; k++) {
const item = e.childColumns[k];
for (let j = 0; j < list.length; j++) {
const o = list[j];
if (o.key == item && o.fixed !== 'left' && o.fixed !== 'right') e.children.push({ ...o });
}
}
}
if (e.children.length) firstChildColumns.push(e.children[0].key);
}
complexHeaderList = complexHeaderList.filter(o => o.children.length);
let newList: any[] = [];
for (let i = 0; i < list.length; i++) {
const e = list[i];
if (!childColumns.includes(e.key) || e.fixed === 'left' || e.fixed === 'right') {
newList.push(e);
} else {
if (firstChildColumns.includes(e.key)) {
const item = complexHeaderList.find(o => o.childColumns.includes(e.key));
newList.push(item);
}
}
}
columnList = newList;
}
let columns = [indexColumn, ...columnList];
const leftFixedList = columns.filter(o => o.fixed === 'left');
const rightFixedList = columns.filter(o => o.fixed === 'right');
const noFixedList = columns.filter(o => o.fixed !== 'left' && o.fixed !== 'right');
return [...leftFixedList, ...noFixedList, ...rightFixedList];
});
2026-05-06 09:39:16 +08:00
const getcompanyInvoiceHasBatchBtn = computed(() => {
2026-04-21 17:48:26 +08:00
let flist: any[] = [
{ btnIcon: 'icon-ym icon-ym-btn-add', show: true, label: '添加', btnType: 'primary', value: 'add', labelI18nCode: 'common.add1Text' },
{
btnIcon: 'icon-ym icon-ym-btn-clearn',
showConfirm: 'true',
show: true,
label: '批量删除',
btnType: 'danger',
value: 'batchRemove',
labelI18nCode: 'common.batchDelText',
},
];
return flist?.length && flist.some(o => o.value == 'batchRemove' && !!o.show);
});
2026-05-06 09:39:16 +08:00
const getcompanyInvoiceRowSelection = computed(() => {
if (!unref(getcompanyInvoiceHasBatchBtn)) return undefined;
2026-04-21 17:48:26 +08:00
const rowSelection = {
2026-05-06 09:39:16 +08:00
selectedRowKeys: state.selectedcompanyInvoiceRowKeys,
2026-04-21 17:48:26 +08:00
onChange: (selectedRowKeys: string[]) => {
2026-05-06 09:39:16 +08:00
state.selectedcompanyInvoiceRowKeys = selectedRowKeys;
2026-04-21 17:48:26 +08:00
},
};
return rowSelection;
});
const state = reactive<State>({
dataForm: {
company_code: undefined,
company_name: undefined,
short_name: undefined,
entity_type: 'ORG',
credit_code: undefined,
2026-05-06 09:39:16 +08:00
org_id: userInfo.organizeIdList ? userInfo.organizeIdList : '',
province_id: [],
2026-04-21 17:48:26 +08:00
tax_type: '',
enterprise_scale: '',
enterprise_nature: '',
industry_code: '',
registration_date: undefined,
registered_capital: undefined,
legal_representative: undefined,
phone: undefined,
email: undefined,
website: undefined,
address: undefined,
business_scope: undefined,
remark: undefined,
mdmCompanyBankList: [],
2026-05-06 09:39:16 +08:00
companyInvoiceList: [],
2026-04-21 17:48:26 +08:00
},
tableRows: {
mdmCompanyBankList: {
bank_name: '',
bank_account_name: '',
bank_account_number: '',
bank_province: '',
remark: '',
enabledmark: undefined,
},
2026-05-06 09:39:16 +08:00
companyInvoiceList: {
title_code: '',
title_name: '',
credit_code: '',
tax_type: '',
address: '',
phone: '',
bank_name: '',
bank_account: '',
is_defalut: 0,
is_valid: 0,
remark: '',
enabledmark: undefined,
},
2026-04-21 17:48:26 +08:00
},
dataRule: {
2026-05-06 09:39:16 +08:00
company_name: [
2026-04-21 17:48:26 +08:00
{
required: true,
message: t('sys.validate.textRequiredSuffix', '不能为空'),
trigger: 'blur',
},
],
2026-05-06 09:39:16 +08:00
credit_code: [
2026-04-21 17:48:26 +08:00
{
required: true,
message: t('sys.validate.textRequiredSuffix', '不能为空'),
trigger: 'blur',
},
],
2026-05-06 09:39:16 +08:00
org_id: [
2026-04-21 17:48:26 +08:00
{
required: true,
2026-05-06 09:39:16 +08:00
message: t('sys.validate.arrayRequiredPrefix ', '请至少选择一个'),
trigger: 'change',
2026-04-21 17:48:26 +08:00
},
],
phone: [
{
pattern: /^1[3456789]\d{9}$|^0\d{2,3}-?\d{7,8}$/,
message: t('sys.validate.telephone', '请输入正确的电话号码'),
trigger: 'blur',
},
],
email: [
{
pattern: /^[a-z0-9]+([._\-]*[a-z0-9])*@([a-z0-9]+[-a-z0-9]*[a-z0-9]+.){1,63}[a-z0-9]+$/,
message: t('sys.validate.email', '请输入正确的邮箱'),
trigger: 'blur',
},
],
},
optionsObj: {
entity_typeOptions: [
{ fullName: '企业', id: 'ORG' },
{ fullName: '个人', id: 'IND' },
],
entity_typeProps: { label: 'fullName', value: 'id' },
tax_typeOptions: [
{ fullName: '一般纳税人', id: 'GENERAL' },
{ fullName: '小规模纳税人', id: 'SMALL' },
],
tax_typeProps: { label: 'fullName', value: 'id' },
enterprise_scaleOptions: [],
enterprise_scaleProps: { label: 'fullName', value: 'enCode' },
enterprise_natureOptions: [],
enterprise_natureProps: { label: 'fullName', value: 'enCode' },
industry_codeOptions: [],
industry_codeProps: { label: 'fullName', value: 'enCode' },
2026-05-06 09:39:16 +08:00
companyInvoicetax_typeOptions: [
{ fullName: '一般纳税人', id: 'GENERAL' },
{ fullName: '小规模纳税人', id: 'SMALL' },
],
companyInvoicetax_typeProps: { label: 'fullName', value: 'id' },
2026-04-21 17:48:26 +08:00
},
childIndex: -1,
isEdit: false,
interfaceRes: {
mdmCompanyBankbank_name: [],
mdmCompanyBankbank_account_name: [],
industry_code: [],
2026-05-06 09:39:16 +08:00
companyInvoiceaddress: [],
2026-04-21 17:48:26 +08:00
remark: [],
2026-05-06 09:39:16 +08:00
companyInvoicephone: [],
2026-04-21 17:48:26 +08:00
mdmCompanyBankbank_province: [],
2026-05-06 09:39:16 +08:00
companyInvoicetitle_name: [],
companyInvoicecredit_code: [],
companyInvoicetax_type: [],
companyInvoiceis_valid: [],
2026-04-21 17:48:26 +08:00
credit_code: [],
mdmCompanyBankbank_account_number: [],
company_code: [],
email: [],
2026-05-06 09:39:16 +08:00
companyInvoiceis_defalut: [],
2026-04-21 17:48:26 +08:00
website: [],
address: [],
legal_representative: [],
enterprise_nature: [],
2026-05-06 09:39:16 +08:00
companyInvoicetitle_code: [],
2026-04-21 17:48:26 +08:00
registered_capital: [],
2026-05-06 09:39:16 +08:00
companyInvoicebank_account: [],
2026-04-21 17:48:26 +08:00
business_scope: [],
mdmCompanyBankremark: [],
2026-05-06 09:39:16 +08:00
companyInvoiceremark: [],
2026-04-21 17:48:26 +08:00
entity_type: [],
registration_date: [],
2026-05-06 09:39:16 +08:00
province_id: [],
2026-04-21 17:48:26 +08:00
tax_type: [],
phone: [],
2026-05-06 09:39:16 +08:00
org_id: [],
2026-04-21 17:48:26 +08:00
company_name: [],
2026-05-06 09:39:16 +08:00
companyInvoicebank_name: [],
2026-04-21 17:48:26 +08:00
short_name: [],
enterprise_scale: [],
},
//可选范围默认值
ableAll: {},
//掩码配置
maskConfig: {
2026-05-06 09:39:16 +08:00
company_name: {
2026-04-21 17:48:26 +08:00
prefixType: 1,
useUnrealMask: false,
maskType: 1,
unrealMaskLength: 1,
prefixLimit: 0,
suffixLimit: 0,
filler: '*',
prefixSpecifyChar: '',
suffixType: 1,
ignoreChar: '',
suffixSpecifyChar: '',
},
2026-05-06 09:39:16 +08:00
short_name: {
2026-04-21 17:48:26 +08:00
prefixType: 1,
useUnrealMask: false,
maskType: 1,
unrealMaskLength: 1,
prefixLimit: 0,
suffixLimit: 0,
filler: '*',
prefixSpecifyChar: '',
suffixType: 1,
ignoreChar: '',
suffixSpecifyChar: '',
},
2026-05-06 09:39:16 +08:00
credit_code: {
2026-04-21 17:48:26 +08:00
prefixType: 1,
useUnrealMask: false,
maskType: 1,
unrealMaskLength: 1,
prefixLimit: 0,
suffixLimit: 0,
filler: '*',
prefixSpecifyChar: '',
suffixType: 1,
ignoreChar: '',
suffixSpecifyChar: '',
},
2026-05-06 09:39:16 +08:00
legal_representative: {
2026-04-21 17:48:26 +08:00
prefixType: 1,
useUnrealMask: false,
maskType: 1,
unrealMaskLength: 1,
prefixLimit: 0,
suffixLimit: 0,
filler: '*',
prefixSpecifyChar: '',
suffixType: 1,
ignoreChar: '',
suffixSpecifyChar: '',
},
2026-05-06 09:39:16 +08:00
phone: {
2026-04-21 17:48:26 +08:00
prefixType: 1,
useUnrealMask: false,
maskType: 1,
unrealMaskLength: 1,
prefixLimit: 0,
suffixLimit: 0,
filler: '*',
prefixSpecifyChar: '',
suffixType: 1,
ignoreChar: '',
suffixSpecifyChar: '',
},
2026-05-06 09:39:16 +08:00
email: {
2026-04-21 17:48:26 +08:00
prefixType: 1,
useUnrealMask: false,
maskType: 1,
unrealMaskLength: 1,
prefixLimit: 0,
suffixLimit: 0,
filler: '*',
prefixSpecifyChar: '',
suffixType: 1,
ignoreChar: '',
suffixSpecifyChar: '',
},
2026-05-06 09:39:16 +08:00
website: {
2026-04-21 17:48:26 +08:00
prefixType: 1,
useUnrealMask: false,
maskType: 1,
unrealMaskLength: 1,
prefixLimit: 0,
suffixLimit: 0,
filler: '*',
prefixSpecifyChar: '',
suffixType: 1,
ignoreChar: '',
suffixSpecifyChar: '',
},
2026-05-06 09:39:16 +08:00
address: {
2026-04-21 17:48:26 +08:00
prefixType: 1,
useUnrealMask: false,
maskType: 1,
unrealMaskLength: 1,
prefixLimit: 0,
suffixLimit: 0,
filler: '*',
prefixSpecifyChar: '',
suffixType: 1,
ignoreChar: '',
suffixSpecifyChar: '',
},
2026-05-06 09:39:16 +08:00
mdmCompanyBankbank_name: {
2026-04-21 17:48:26 +08:00
prefixType: 1,
useUnrealMask: false,
maskType: 1,
unrealMaskLength: 1,
prefixLimit: 0,
suffixLimit: 0,
filler: '*',
prefixSpecifyChar: '',
suffixType: 1,
ignoreChar: '',
suffixSpecifyChar: '',
},
2026-05-06 09:39:16 +08:00
mdmCompanyBankbank_account_name: {
2026-04-21 17:48:26 +08:00
prefixType: 1,
useUnrealMask: false,
maskType: 1,
unrealMaskLength: 1,
prefixLimit: 0,
suffixLimit: 0,
filler: '*',
prefixSpecifyChar: '',
suffixType: 1,
ignoreChar: '',
suffixSpecifyChar: '',
},
2026-05-06 09:39:16 +08:00
mdmCompanyBankbank_account_number: {
2026-04-21 17:48:26 +08:00
prefixType: 1,
useUnrealMask: false,
maskType: 1,
unrealMaskLength: 1,
prefixLimit: 0,
suffixLimit: 0,
filler: '*',
prefixSpecifyChar: '',
suffixType: 1,
ignoreChar: '',
suffixSpecifyChar: '',
},
2026-05-06 09:39:16 +08:00
mdmCompanyBankbank_province: {
2026-04-21 17:48:26 +08:00
prefixType: 1,
useUnrealMask: false,
maskType: 1,
unrealMaskLength: 1,
prefixLimit: 0,
suffixLimit: 0,
filler: '*',
prefixSpecifyChar: '',
suffixType: 1,
ignoreChar: '',
suffixSpecifyChar: '',
},
2026-05-06 09:39:16 +08:00
mdmCompanyBankremark: {
2026-04-21 17:48:26 +08:00
prefixType: 1,
useUnrealMask: false,
maskType: 1,
unrealMaskLength: 1,
prefixLimit: 0,
suffixLimit: 0,
filler: '*',
prefixSpecifyChar: '',
suffixType: 1,
ignoreChar: '',
suffixSpecifyChar: '',
},
2026-05-06 09:39:16 +08:00
companyInvoicetitle_name: {
2026-04-21 17:48:26 +08:00
prefixType: 1,
useUnrealMask: false,
maskType: 1,
unrealMaskLength: 1,
prefixLimit: 0,
suffixLimit: 0,
filler: '*',
prefixSpecifyChar: '',
suffixType: 1,
ignoreChar: '',
suffixSpecifyChar: '',
},
2026-05-06 09:39:16 +08:00
companyInvoicecredit_code: {
2026-04-21 17:48:26 +08:00
prefixType: 1,
useUnrealMask: false,
maskType: 1,
unrealMaskLength: 1,
prefixLimit: 0,
suffixLimit: 0,
filler: '*',
prefixSpecifyChar: '',
suffixType: 1,
ignoreChar: '',
suffixSpecifyChar: '',
},
2026-05-06 09:39:16 +08:00
companyInvoiceaddress: {
2026-04-21 17:48:26 +08:00
prefixType: 1,
useUnrealMask: false,
maskType: 1,
unrealMaskLength: 1,
prefixLimit: 0,
suffixLimit: 0,
filler: '*',
prefixSpecifyChar: '',
suffixType: 1,
ignoreChar: '',
suffixSpecifyChar: '',
},
2026-05-06 09:39:16 +08:00
companyInvoicephone: {
2026-04-21 17:48:26 +08:00
prefixType: 1,
useUnrealMask: false,
maskType: 1,
unrealMaskLength: 1,
prefixLimit: 0,
suffixLimit: 0,
filler: '*',
prefixSpecifyChar: '',
suffixType: 1,
ignoreChar: '',
suffixSpecifyChar: '',
},
2026-05-06 09:39:16 +08:00
companyInvoicebank_name: {
2026-04-21 17:48:26 +08:00
prefixType: 1,
useUnrealMask: false,
maskType: 1,
unrealMaskLength: 1,
prefixLimit: 0,
suffixLimit: 0,
filler: '*',
prefixSpecifyChar: '',
suffixType: 1,
ignoreChar: '',
suffixSpecifyChar: '',
},
2026-05-06 09:39:16 +08:00
companyInvoicebank_account: {
prefixType: 1,
useUnrealMask: false,
maskType: 1,
unrealMaskLength: 1,
prefixLimit: 0,
suffixLimit: 0,
filler: '*',
prefixSpecifyChar: '',
suffixType: 1,
ignoreChar: '',
suffixSpecifyChar: '',
},
companyInvoiceremark: {
2026-04-21 17:48:26 +08:00
prefixType: 1,
useUnrealMask: false,
maskType: 1,
unrealMaskLength: 1,
prefixLimit: 0,
suffixLimit: 0,
filler: '*',
prefixSpecifyChar: '',
suffixType: 1,
ignoreChar: '',
suffixSpecifyChar: '',
},
},
//定位属性
locationScope: {},
2026-05-06 09:39:16 +08:00
activetabformItemfe79ef: '2',
2026-04-21 17:48:26 +08:00
selectedmdmCompanyBankRowKeys: [],
2026-05-06 09:39:16 +08:00
selectedcompanyInvoiceRowKeys: [],
2026-04-21 17:48:26 +08:00
extraOptions: {},
title: '',
continueText: '',
allList: [],
currIndex: 0,
isContinue: false,
submitType: 0,
showContinueBtn: true,
});
const { title, continueText, showContinueBtn, dataRule, dataForm, optionsObj, ableAll, maskConfig, submitType } = toRefs(state);
const getPrevDisabled = computed(() => state.currIndex === 0);
const getNextDisabled = computed(() => state.currIndex === state.allList.length - 1);
// 表单权限
const { hasFormP } = usePermission();
defineExpose({ init });
function init(data) {
state.submitType = 0;
state.isContinue = false;
state.title = !data.id ? t('common.add2Text', '新增') : t('common.editText', '编辑');
state.continueText = !data.id ? t('common.continueAndAddText', '确定并新增') : t('common.continueText', '确定并继续');
setFormProps({ continueLoading: false });
state.dataForm.id = data.id;
openDrawer();
state.allList = data.allList;
state.currIndex = state.allList.length && data.id ? state.allList.findIndex(item => item.id === data.id) : 0;
nextTick(() => {
getForm().resetFields();
state.dataForm.mdmCompanyBankList = [];
2026-05-06 09:39:16 +08:00
state.dataForm.companyInvoiceList = [];
2026-04-21 17:48:26 +08:00
setTimeout(initData, 0);
});
}
function initData() {
changeLoading(true);
2026-05-06 09:39:16 +08:00
state.activetabformItemfe79ef = '2';
2026-04-21 17:48:26 +08:00
if (state.dataForm.id) {
getData(state.dataForm.id);
} else {
//初始化options
getenterprise_scaleOptions();
getenterprise_natureOptions();
getindustry_codeOptions();
if (state.dataForm.mdmCompanyBankList) {
for (let i = 0; i < state.dataForm.mdmCompanyBankList.length; i++) {
state.childIndex = i;
state.dataForm.mdmCompanyBankList[i].yunzhupaasId = buildUUID();
}
}
2026-05-06 09:39:16 +08:00
if (state.dataForm.companyInvoiceList) {
for (let i = 0; i < state.dataForm.companyInvoiceList.length; i++) {
state.childIndex = i;
state.dataForm.companyInvoiceList[i].yunzhupaasId = buildUUID();
}
}
2026-04-21 17:48:26 +08:00
// 设置默认值
state.dataForm = {
company_code: undefined,
company_name: undefined,
short_name: undefined,
entity_type: 'ORG',
credit_code: undefined,
2026-05-06 09:39:16 +08:00
org_id: userInfo.organizeIdList ? userInfo.organizeIdList : '',
province_id: [],
2026-04-21 17:48:26 +08:00
tax_type: '',
enterprise_scale: '',
enterprise_nature: '',
industry_code: '',
registration_date: undefined,
registered_capital: undefined,
legal_representative: undefined,
phone: undefined,
email: undefined,
website: undefined,
address: undefined,
business_scope: undefined,
remark: undefined,
mdmCompanyBankList: [],
2026-05-06 09:39:16 +08:00
companyInvoiceList: [],
2026-04-21 17:48:26 +08:00
};
if (getLeftTreeActiveInfo) state.dataForm = { ...state.dataForm, ...(getLeftTreeActiveInfo() || {}) };
state.childIndex = -1;
changeLoading(false);
}
}
function getForm() {
const form = unref(formRef);
if (!form) {
throw new Error('form is null!');
}
return form;
}
function getData(id) {
getInfo(id).then(res => {
state.dataForm = res.data || {};
getenterprise_scaleOptions();
getenterprise_natureOptions();
getindustry_codeOptions();
if (state.dataForm.mdmCompanyBankList) {
for (let i = 0; i < state.dataForm.mdmCompanyBankList.length; i++) {
state.childIndex = i;
state.dataForm.mdmCompanyBankList[i].yunzhupaasId = buildUUID();
}
}
2026-05-06 09:39:16 +08:00
if (state.dataForm.companyInvoiceList) {
for (let i = 0; i < state.dataForm.companyInvoiceList.length; i++) {
state.childIndex = i;
state.dataForm.companyInvoiceList[i].yunzhupaasId = buildUUID();
}
}
2026-04-21 17:48:26 +08:00
state.childIndex = -1;
changeLoading(false);
});
}
async function handleSubmit(type) {
try {
const values = await getForm()?.validate();
if (!values) return;
if (!mdmCompanyBankExist()) return;
2026-05-06 09:39:16 +08:00
if (!companyInvoiceExist()) return;
2026-04-21 17:48:26 +08:00
setFormProps({ confirmLoading: true });
const formMethod = state.dataForm.id ? update : create;
formMethod(state.dataForm)
.then(res => {
createMessage.success(res.msg);
setFormProps({ confirmLoading: false });
if (state.submitType == 1) {
initData();
state.isContinue = true;
} else {
setFormProps({ open: false });
emit('reload');
}
})
.catch(() => {
setFormProps({ confirmLoading: false });
});
} catch (_) {}
}
function handlePrev() {
state.currIndex--;
handleGetNewInfo();
}
function handleNext() {
state.currIndex++;
handleGetNewInfo();
}
function handleGetNewInfo() {
changeLoading(true);
getForm().resetFields();
const id = state.allList[state.currIndex].id;
getData(id);
}
function setFormProps(data) {
setDrawerProps(data);
}
function changeLoading(loading) {
setDrawerProps({ loading });
}
async function onClose() {
if (state.isContinue) emit('reload');
return true;
}
function changeData(model, index) {
state.isEdit = false;
state.childIndex = index;
for (let key in state.interfaceRes) {
if (key != model) {
let faceReList = state.interfaceRes[key];
for (let i = 0; i < faceReList.length; i++) {
let relationField = faceReList[i].relationField;
if (relationField) {
let modelAll = relationField.split('-');
let faceMode = '';
let faceMode2 = modelAll.length == 2 ? modelAll[0].substring(0, modelAll[0].length - 4) + modelAll[1] : '';
for (let i = 0; i < modelAll.length; i++) {
faceMode += modelAll[i];
}
if (faceMode == model || faceMode2 == model) {
let options = 'get' + key + 'Options';
eval(options)(true);
changeData(key, index);
}
}
}
}
}
}
function changeDataFormData(type, data, model, index, defaultValue) {
if (!state.isEdit) {
if (type == 2) {
for (let i = 0; i < state.dataForm[data].length; i++) {
if (index == -1) {
state.dataForm[data][i][model] = defaultValue;
} else if (index == i) {
state.dataForm[data][i][model] = defaultValue;
}
}
} else {
state.dataForm[data] = defaultValue;
}
}
}
2026-05-06 09:39:16 +08:00
function addMdmCompanyBankRow() {
2026-04-21 17:48:26 +08:00
let item = {
2026-05-06 09:39:16 +08:00
bank_name: undefined,
bank_account_name: undefined,
bank_account_number: undefined,
bank_province: undefined,
2026-04-21 17:48:26 +08:00
remark: undefined,
yunzhupaasId: buildUUID(),
};
2026-05-06 09:39:16 +08:00
state.dataForm.mdmCompanyBankList.push(item);
state.childIndex = state.dataForm.mdmCompanyBankList.length - 1;
2026-04-21 17:48:26 +08:00
state.childIndex = -1;
}
2026-05-06 09:39:16 +08:00
function removeMdmCompanyBankRow(index, showConfirm = false) {
2026-04-21 17:48:26 +08:00
if (showConfirm) {
createConfirm({
iconType: 'warning',
title: '提示',
content: '此操作将永久删除该数据, 是否继续?',
onOk: () => {
2026-05-06 09:39:16 +08:00
state.dataForm.mdmCompanyBankList.splice(index, 1);
2026-04-21 17:48:26 +08:00
},
});
} else {
2026-05-06 09:39:16 +08:00
state.dataForm.mdmCompanyBankList.splice(index, 1);
2026-04-21 17:48:26 +08:00
}
}
2026-05-06 09:39:16 +08:00
function copyMdmCompanyBankRow(index) {
let item = cloneDeep(state.dataForm.mdmCompanyBankList[index]);
2026-04-21 17:48:26 +08:00
let copyData = {};
2026-05-06 09:39:16 +08:00
for (let i = 0; i < unref(mdmCompanyBankColumns).length; i++) {
const cur = unref(mdmCompanyBankColumns)[i];
2026-04-21 17:48:26 +08:00
if (cur.key != 'index' && cur.key != 'action') {
if (cur.children?.length && cur.yunzhupaasKey == 'complexHeader') {
for (let j = 0; j < cur.children.length; j++) {
copyData[cur.children[j].key] = item[cur.children[j].key];
}
} else {
copyData[cur.key] = item[cur.key];
}
}
}
const copyItem = { ...copyData, yunzhupaasId: buildUUID() };
2026-05-06 09:39:16 +08:00
state.dataForm.mdmCompanyBankList.push(copyItem);
state.childIndex = state.dataForm.mdmCompanyBankList.length - 1;
2026-04-21 17:48:26 +08:00
state.childIndex = -1;
}
2026-05-06 09:39:16 +08:00
function batchRemoveMdmCompanyBankRow(showConfirm = false) {
if (!state.selectedmdmCompanyBankRowKeys.length) return createMessage.error('请选择一条数据');
2026-04-21 17:48:26 +08:00
const handleRemove = () => {
2026-05-06 09:39:16 +08:00
state.dataForm.mdmCompanyBankList = state.dataForm.mdmCompanyBankList.filter(o => !state.selectedmdmCompanyBankRowKeys.includes(o.yunzhupaasId));
2026-04-21 17:48:26 +08:00
nextTick(() => {
2026-05-06 09:39:16 +08:00
state.selectedmdmCompanyBankRowKeys = [];
2026-04-21 17:48:26 +08:00
});
};
if (showConfirm) {
createConfirm({
iconType: 'warning',
title: '提示',
content: '此操作将永久删除该数据, 是否继续?',
onOk: () => {
handleRemove();
},
});
} else {
handleRemove();
}
}
2026-05-06 09:39:16 +08:00
function mdmCompanyBankExist() {
2026-04-21 17:48:26 +08:00
let isOk = true;
2026-05-06 09:39:16 +08:00
for (let i = 0; i < state.dataForm.mdmCompanyBankList.length; i++) {
const e = state.dataForm.mdmCompanyBankList[i];
2026-04-21 17:48:26 +08:00
}
return isOk;
}
2026-05-06 09:39:16 +08:00
function addCompanyInvoiceRow() {
2026-04-21 17:48:26 +08:00
let item = {
2026-05-06 09:39:16 +08:00
title_code: undefined,
title_name: undefined,
credit_code: undefined,
tax_type: '',
companyInvoicetax_typeOptions: state.optionsObj.companyInvoicetax_typeOptions,
address: undefined,
phone: undefined,
2026-04-21 17:48:26 +08:00
bank_name: undefined,
2026-05-06 09:39:16 +08:00
bank_account: undefined,
is_defalut: 0,
is_valid: 0,
2026-04-21 17:48:26 +08:00
remark: undefined,
yunzhupaasId: buildUUID(),
};
2026-05-06 09:39:16 +08:00
state.dataForm.companyInvoiceList.push(item);
state.childIndex = state.dataForm.companyInvoiceList.length - 1;
2026-04-21 17:48:26 +08:00
state.childIndex = -1;
}
2026-05-06 09:39:16 +08:00
function removeCompanyInvoiceRow(index, showConfirm = false) {
2026-04-21 17:48:26 +08:00
if (showConfirm) {
createConfirm({
iconType: 'warning',
title: '提示',
content: '此操作将永久删除该数据, 是否继续?',
onOk: () => {
2026-05-06 09:39:16 +08:00
state.dataForm.companyInvoiceList.splice(index, 1);
2026-04-21 17:48:26 +08:00
},
});
} else {
2026-05-06 09:39:16 +08:00
state.dataForm.companyInvoiceList.splice(index, 1);
2026-04-21 17:48:26 +08:00
}
}
2026-05-06 09:39:16 +08:00
function copyCompanyInvoiceRow(index) {
let item = cloneDeep(state.dataForm.companyInvoiceList[index]);
item.title_code = '';
2026-04-21 17:48:26 +08:00
let copyData = {};
2026-05-06 09:39:16 +08:00
for (let i = 0; i < unref(companyInvoiceColumns).length; i++) {
const cur = unref(companyInvoiceColumns)[i];
2026-04-21 17:48:26 +08:00
if (cur.key != 'index' && cur.key != 'action') {
if (cur.children?.length && cur.yunzhupaasKey == 'complexHeader') {
for (let j = 0; j < cur.children.length; j++) {
copyData[cur.children[j].key] = item[cur.children[j].key];
}
} else {
copyData[cur.key] = item[cur.key];
}
}
}
const copyItem = { ...copyData, yunzhupaasId: buildUUID() };
2026-05-06 09:39:16 +08:00
state.dataForm.companyInvoiceList.push(copyItem);
state.childIndex = state.dataForm.companyInvoiceList.length - 1;
2026-04-21 17:48:26 +08:00
state.childIndex = -1;
}
2026-05-06 09:39:16 +08:00
function batchRemoveCompanyInvoiceRow(showConfirm = false) {
if (!state.selectedcompanyInvoiceRowKeys.length) return createMessage.error('请选择一条数据');
2026-04-21 17:48:26 +08:00
const handleRemove = () => {
2026-05-06 09:39:16 +08:00
state.dataForm.companyInvoiceList = state.dataForm.companyInvoiceList.filter(o => !state.selectedcompanyInvoiceRowKeys.includes(o.yunzhupaasId));
2026-04-21 17:48:26 +08:00
nextTick(() => {
2026-05-06 09:39:16 +08:00
state.selectedcompanyInvoiceRowKeys = [];
2026-04-21 17:48:26 +08:00
});
};
if (showConfirm) {
createConfirm({
iconType: 'warning',
title: '提示',
content: '此操作将永久删除该数据, 是否继续?',
onOk: () => {
handleRemove();
},
});
} else {
handleRemove();
}
}
2026-05-06 09:39:16 +08:00
function companyInvoiceExist() {
2026-04-21 17:48:26 +08:00
let isOk = true;
2026-05-06 09:39:16 +08:00
for (let i = 0; i < state.dataForm.companyInvoiceList.length; i++) {
const e = state.dataForm.companyInvoiceList[i];
2026-04-21 17:48:26 +08:00
}
return isOk;
}
//数据选项--数据字典初始化方法
function getenterprise_scaleOptions() {
2026-05-06 09:39:16 +08:00
getDictionaryDataSelector('enterpriseScale').then(res => {
2026-04-21 17:48:26 +08:00
state.optionsObj.enterprise_scaleOptions = res.data.list;
});
}
//数据选项--数据字典初始化方法
function getenterprise_natureOptions() {
getDictionaryDataSelector('9b542177a477488994ce09fff3c93901').then(res => {
state.optionsObj.enterprise_natureOptions = res.data.list;
});
}
//数据选项--数据字典初始化方法
function getindustry_codeOptions() {
getDictionaryDataSelector('d59a3cf65f9847dbb08be449e3feae16').then(res => {
state.optionsObj.industry_codeOptions = res.data.list;
});
}
function getRelationDate(timeRule, timeType, timeTarget, timeValueData, dataValue) {
let timeDataValue: any = null;
let timeValue = Number(timeValueData);
if (timeRule) {
if (timeType == 1) {
timeDataValue = timeValue;
} else if (timeType == 2) {
timeDataValue = dataValue;
} else if (timeType == 3) {
timeDataValue = new Date().getTime();
} else if (timeType == 4 || timeType == 5) {
const type = getTimeUnit(timeTarget);
const method = timeType == 4 ? 'subtract' : 'add';
timeDataValue = dayjs()[method](timeValue, type).valueOf();
}
}
return timeDataValue;
}
function getRelationTime(timeRule, timeType, timeTarget, timeValue, formatType, dataValue) {
let format = formatType == 'HH:mm' ? 'HH:mm:00' : formatType;
let timeDataValue: any = null;
if (timeRule) {
if (timeType == 1) {
timeDataValue = timeValue || '00:00:00';
if (timeDataValue.split(':').length == 3) {
timeDataValue = timeDataValue;
} else {
timeDataValue = timeDataValue + ':00';
}
} else if (timeType == 2) {
timeDataValue = dataValue;
} else if (timeType == 3) {
timeDataValue = dayjs().format(format);
} else if (timeType == 4 || timeType == 5) {
const type = getTimeUnit(timeTarget + 3);
const method = timeType == 4 ? 'subtract' : 'add';
timeDataValue = dayjs()[method](timeValue, type).format(format);
}
}
return timeDataValue;
}
</script>