修复错误
This commit is contained in:
parent
ba399760ac
commit
fd23e80350
@ -7,65 +7,129 @@
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="公司名称" prop="company_name">
|
||||
<el-input v-model="formData.company_name" placeholder="请输入公司名称" clearable :disabled="isDisabled"
|
||||
:style="{ width: '100%' }"></el-input>
|
||||
<el-input
|
||||
v-model="formData.company_name"
|
||||
placeholder="请输入公司名称"
|
||||
clearable
|
||||
:disabled="isDisabled"
|
||||
:style="{ width: '100%' }"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="社会代码" prop="organization_code">
|
||||
<el-input :disabled="isDisabled" v-model="formData.organization_code" placeholder="请输入社会代码"
|
||||
clearable :style="{ width: '100%' }"></el-input>
|
||||
<el-input
|
||||
:disabled="isDisabled"
|
||||
v-model="formData.organization_code"
|
||||
placeholder="请输入社会代码"
|
||||
clearable
|
||||
:style="{ width: '100%' }"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="公司类型" prop="company_type">
|
||||
<el-select :disabled="isDisabled" v-model="formData.company_type" placeholder="请选择公司类型"
|
||||
clearable :style="{ width: '100%' }">
|
||||
<el-option v-for="(item, index) in datas.dictTypeLists" :key="index" :label="item.name"
|
||||
:value="item.id"></el-option>
|
||||
<el-select
|
||||
:disabled="isDisabled"
|
||||
v-model="formData.company_type"
|
||||
placeholder="请选择公司类型"
|
||||
clearable
|
||||
:style="{ width: '100%' }"
|
||||
>
|
||||
<el-option
|
||||
v-for="(item, index) in datas.dictTypeLists"
|
||||
:key="index"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="3">
|
||||
<el-form-item label="省" prop="province">
|
||||
<el-select :disabled="isDisabled" v-model="formData.province" placeholder="请选择省" clearable
|
||||
@change="province_change" :style="{ width: '100%' }">
|
||||
<el-option v-for="(item, index) in datas.provinceOptions" :key="index"
|
||||
:label="item.province_name" :value="item.province_code"></el-option>
|
||||
<el-select
|
||||
:disabled="isDisabled"
|
||||
v-model="formData.province"
|
||||
placeholder="请选择省"
|
||||
clearable
|
||||
@change="province_change"
|
||||
:style="{ width: '100%' }"
|
||||
>
|
||||
<el-option
|
||||
v-for="(item, index) in datas.provinceOptions"
|
||||
:key="index"
|
||||
:label="item.province_name"
|
||||
:value="item.province_code"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="3">
|
||||
<el-form-item label="市" prop="city">
|
||||
<el-select :disabled="isDisabled" v-model="formData.city" placeholder="请选择市" clearable
|
||||
@change="city_change" :style="{ width: '100%' }">
|
||||
<el-option v-for="(item, index) in datas.cityOptions" :key="index" :label="item.city_name"
|
||||
:value="item.city_code"></el-option>
|
||||
<el-select
|
||||
:disabled="isDisabled"
|
||||
v-model="formData.city"
|
||||
placeholder="请选择市"
|
||||
clearable
|
||||
@change="city_change"
|
||||
:style="{ width: '100%' }"
|
||||
>
|
||||
<el-option
|
||||
v-for="(item, index) in datas.cityOptions"
|
||||
:key="index"
|
||||
:label="item.city_name"
|
||||
:value="item.city_code"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="3">
|
||||
<el-form-item label="区" prop="area">
|
||||
<el-select :disabled="isDisabled" v-model="formData.area" placeholder="请选择区" clearable
|
||||
@change="area_change" :style="{ width: '100%' }">
|
||||
<el-option v-for="(item, index) in datas.areaOptions" :key="index" :label="item.area_name"
|
||||
:value="item.area_code"></el-option>
|
||||
<el-select
|
||||
:disabled="isDisabled"
|
||||
v-model="formData.area"
|
||||
placeholder="请选择区"
|
||||
clearable
|
||||
@change="area_change"
|
||||
:style="{ width: '100%' }"
|
||||
>
|
||||
<el-option
|
||||
v-for="(item, index) in datas.areaOptions"
|
||||
:key="index"
|
||||
:label="item.area_name"
|
||||
:value="item.area_code"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="3">
|
||||
<el-form-item label="镇" prop="street">
|
||||
<el-select :disabled="isDisabled" v-model="formData.street" placeholder="请选择镇" clearable
|
||||
@change="street_change" :style="{ width: '100%' }">
|
||||
<el-option v-for="(item, index) in datas.streetOptions" :key="index"
|
||||
:label="item.street_name" :value="item.street_code"></el-option>
|
||||
<el-select
|
||||
:disabled="isDisabled"
|
||||
v-model="formData.street"
|
||||
placeholder="请选择镇"
|
||||
clearable
|
||||
@change="street_change"
|
||||
:style="{ width: '100%' }"
|
||||
>
|
||||
<el-option
|
||||
v-for="(item, index) in datas.streetOptions"
|
||||
:key="index"
|
||||
:label="item.street_name"
|
||||
:value="item.street_code"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="地址" prop="address">
|
||||
<el-input :disabled="isDisabled" v-model="formData.address" placeholder="请输入地址" clearable
|
||||
:style="{ width: '100%' }"></el-input>
|
||||
<el-input
|
||||
:disabled="isDisabled"
|
||||
v-model="formData.address"
|
||||
placeholder="请输入地址"
|
||||
clearable
|
||||
:style="{ width: '100%' }"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
@ -75,32 +139,58 @@
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="姓名" prop="master_name">
|
||||
<el-input :disabled="isDisabled" v-model="formData.master_name" placeholder="请输入姓名" clearable
|
||||
:style="{ width: '100%' }"></el-input>
|
||||
<el-input
|
||||
:disabled="isDisabled"
|
||||
v-model="formData.master_name"
|
||||
placeholder="请输入姓名"
|
||||
clearable
|
||||
:style="{ width: '100%' }"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="职务" prop="master_position">
|
||||
<el-input :disabled="isDisabled" v-model="formData.master_position" placeholder="请输入职务"
|
||||
clearable :style="{ width: '100%' }"></el-input>
|
||||
<el-input
|
||||
:disabled="isDisabled"
|
||||
v-model="formData.master_position"
|
||||
placeholder="请输入职务"
|
||||
clearable
|
||||
:style="{ width: '100%' }"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="手机" prop="master_phone">
|
||||
<el-input :disabled="isDisabled" v-model="formData.master_phone" placeholder="请输入手机" clearable
|
||||
:style="{ width: '100%' }"></el-input>
|
||||
<el-input
|
||||
:disabled="isDisabled"
|
||||
v-model="formData.master_phone"
|
||||
placeholder="请输入手机"
|
||||
clearable
|
||||
:style="{ width: '100%' }"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="邮箱" prop="master_email">
|
||||
<el-input :disabled="isDisabled" v-model="formData.master_email" placeholder="请输入邮箱" clearable
|
||||
:style="{ width: '100%' }"></el-input>
|
||||
<el-input
|
||||
:disabled="isDisabled"
|
||||
v-model="formData.master_email"
|
||||
placeholder="请输入邮箱"
|
||||
clearable
|
||||
:style="{ width: '100%' }"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="选择人员" prop="man">
|
||||
<el-input :disabled="isDisabled" v-model="formData.man" placeholder="请选择人员" clearable
|
||||
:style="{ width: '100%' }" @click="isMan = true"></el-input>
|
||||
<el-input
|
||||
:disabled="isDisabled"
|
||||
v-model="formData.man"
|
||||
placeholder="请选择人员"
|
||||
clearable
|
||||
:style="{ width: '100%' }"
|
||||
@click="isMan = true"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
@ -111,33 +201,59 @@
|
||||
<template v-for="(item, index) in formData.other_contacts" :key="index">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="姓名" prop="field120">
|
||||
<el-input :disabled="isDisabled" v-model="item.name" placeholder="请输入姓名" clearable
|
||||
:style="{ width: '100%' }"></el-input>
|
||||
<el-input
|
||||
:disabled="isDisabled"
|
||||
v-model="item.name"
|
||||
placeholder="请输入姓名"
|
||||
clearable
|
||||
:style="{ width: '100%' }"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="职务" prop="field121">
|
||||
<el-input :disabled="isDisabled" v-model="item.position" placeholder="请输入职务" clearable
|
||||
:style="{ width: '100%' }"></el-input>
|
||||
<el-input
|
||||
:disabled="isDisabled"
|
||||
v-model="item.position"
|
||||
placeholder="请输入职务"
|
||||
clearable
|
||||
:style="{ width: '100%' }"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="手机" prop="field122">
|
||||
<el-input :disabled="isDisabled" v-model="item.phone" placeholder="请输入手机" clearable
|
||||
:style="{ width: '100%' }"></el-input>
|
||||
<el-input
|
||||
:disabled="isDisabled"
|
||||
v-model="item.phone"
|
||||
placeholder="请输入手机"
|
||||
clearable
|
||||
:style="{ width: '100%' }"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="邮箱" prop="field123">
|
||||
<el-input :disabled="isDisabled" v-model="item.email" placeholder="请输入邮箱" clearable
|
||||
:style="{ width: '100%' }"></el-input>
|
||||
<el-input
|
||||
:disabled="isDisabled"
|
||||
v-model="item.email"
|
||||
placeholder="请输入邮箱"
|
||||
clearable
|
||||
:style="{ width: '100%' }"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</template>
|
||||
|
||||
<el-col :span="24">
|
||||
<el-form-item label prop="field126">
|
||||
<el-button type="primary" :disabled="isDisabled" size="medium" @click="other">其他联系人</el-button>
|
||||
<el-button
|
||||
type="primary"
|
||||
:disabled="isDisabled"
|
||||
size="medium"
|
||||
@click="other"
|
||||
>其他联系人</el-button
|
||||
>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
@ -147,22 +263,39 @@
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="营业执照" required>
|
||||
<el-upload :disabled="isDisabled" v-model="formData.qualification.business_license"
|
||||
class="avatar-uploader" :data="{ cid: 1 }"
|
||||
action="https://worker-task.lihaink.cn/api/upload/image" :show-file-list="false"
|
||||
:on-success="handleAvatarSuccess" :before-upload="beforeAvatarUpload">
|
||||
<img v-if="formData.qualification.business_license"
|
||||
:src="formData.qualification.business_license" class="avatar" />
|
||||
<el-upload
|
||||
:disabled="isDisabled"
|
||||
v-model="formData.qualification.business_license"
|
||||
class="avatar-uploader"
|
||||
:data="{ cid: 1 }"
|
||||
action="https://worker-task.lihaink.cn/api/upload/image"
|
||||
:show-file-list="false"
|
||||
:on-success="handleAvatarSuccess"
|
||||
:before-upload="beforeAvatarUpload"
|
||||
>
|
||||
<img
|
||||
v-if="formData.qualification.business_license"
|
||||
:src="formData.qualification.business_license"
|
||||
class="avatar"
|
||||
/>
|
||||
<el-icon v-else class="avatar-uploader-icon">
|
||||
<Plus />
|
||||
</el-icon>
|
||||
</el-upload>
|
||||
<el-upload :disabled="isDisabled" v-model="formData.qualification.business_licenseB"
|
||||
class="avatar-uploader" :data="{ cid: 1 }"
|
||||
action="https://worker-task.lihaink.cn/api/upload/image" :show-file-list="false"
|
||||
:on-success="handleAvatarSuccessB">
|
||||
<img v-if="formData.qualification.business_licenseB"
|
||||
:src="formData.qualification.business_licenseB" class="avatar" />
|
||||
<el-upload
|
||||
:disabled="isDisabled"
|
||||
v-model="formData.qualification.business_licenseB"
|
||||
class="avatar-uploader"
|
||||
:data="{ cid: 1 }"
|
||||
action="https://worker-task.lihaink.cn/api/upload/image"
|
||||
:show-file-list="false"
|
||||
:on-success="handleAvatarSuccessB"
|
||||
>
|
||||
<img
|
||||
v-if="formData.qualification.business_licenseB"
|
||||
:src="formData.qualification.business_licenseB"
|
||||
class="avatar"
|
||||
/>
|
||||
<el-icon v-else class="avatar-uploader-icon">
|
||||
<Plus />
|
||||
</el-icon>
|
||||
@ -171,22 +304,40 @@
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="对公银行" required>
|
||||
<el-upload :disabled="isDisabled" v-model="formData.qualification.bank_account"
|
||||
class="avatar-uploader" :data="{ cid: 1 }"
|
||||
action="https://worker-task.lihaink.cn/api/upload/image" :show-file-list="false"
|
||||
:on-success="handleAvatarSuccess_two" :before-upload="beforeAvatarUpload_two">
|
||||
<img v-if="formData.qualification.bank_account" :src="formData.qualification.bank_account"
|
||||
class="avatar" />
|
||||
<el-upload
|
||||
:disabled="isDisabled"
|
||||
v-model="formData.qualification.bank_account"
|
||||
class="avatar-uploader"
|
||||
:data="{ cid: 1 }"
|
||||
action="https://worker-task.lihaink.cn/api/upload/image"
|
||||
:show-file-list="false"
|
||||
:on-success="handleAvatarSuccess_two"
|
||||
:before-upload="beforeAvatarUpload_two"
|
||||
>
|
||||
<img
|
||||
v-if="formData.qualification.bank_account"
|
||||
:src="formData.qualification.bank_account"
|
||||
class="avatar"
|
||||
/>
|
||||
<el-icon v-else class="avatar-uploader-icon">
|
||||
<Plus />
|
||||
</el-icon>
|
||||
</el-upload>
|
||||
<el-upload :disabled="isDisabled" v-model="formData.qualification.bank_accountB"
|
||||
class="avatar-uploader" :data="{ cid: 1 }"
|
||||
action="https://worker-task.lihaink.cn/api/upload/image" :show-file-list="false"
|
||||
:on-success="handleAvatarSuccess_twoB" :before-upload="beforeAvatarUpload_two">
|
||||
<img v-if="formData.qualification.bank_accountB" :src="formData.qualification.bank_accountB"
|
||||
class="avatar" />
|
||||
<el-upload
|
||||
:disabled="isDisabled"
|
||||
v-model="formData.qualification.bank_accountB"
|
||||
class="avatar-uploader"
|
||||
:data="{ cid: 1 }"
|
||||
action="https://worker-task.lihaink.cn/api/upload/image"
|
||||
:show-file-list="false"
|
||||
:on-success="handleAvatarSuccess_twoB"
|
||||
:before-upload="beforeAvatarUpload_two"
|
||||
>
|
||||
<img
|
||||
v-if="formData.qualification.bank_accountB"
|
||||
:src="formData.qualification.bank_accountB"
|
||||
class="avatar"
|
||||
/>
|
||||
<el-icon v-else class="avatar-uploader-icon">
|
||||
<Plus />
|
||||
</el-icon>
|
||||
@ -241,23 +392,23 @@
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12">
|
||||
<el-form-item label-width="100px" label="合同编号" prop="field133">
|
||||
<el-input placeholder="系统自动生成" clearable :style="{ width: '100%' }" :disabled="true"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</el-row>
|
||||
</el-col>
|
||||
<el-col :span="24" class="el-card pt-6">
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="合同上传" required>
|
||||
<!-- <el-upload
|
||||
<el-col :span="12">
|
||||
<el-form-item label-width="100px" label="合同编号" prop="field133">
|
||||
<el-input
|
||||
placeholder="系统自动生成"
|
||||
clearable
|
||||
:style="{ width: '100%' }"
|
||||
:disabled="true"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-col>
|
||||
<el-col :span="24" class="el-card pt-6">
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="合同上传" required>
|
||||
<!-- <el-upload
|
||||
:disabled="isDisabled"
|
||||
class="avatar-uploader"
|
||||
v-model="formData.contract.file"
|
||||
@ -268,19 +419,37 @@
|
||||
|
||||
<el-button size="small" :disabled="isDisabled" type="primary">点击上传</el-button>
|
||||
</el-upload>-->
|
||||
<el-upload :disabled="isDisabled" v-model="formData.contract.file"
|
||||
:headers="{ 'Token': userStore.token }" class="upload-demo"
|
||||
action="https://worker-task.lihaink.cn/adminapi/upload/file" multiple :limit="1">
|
||||
<el-button :disabled="isDisabled" type="primary">上传</el-button>
|
||||
</el-upload>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-col>
|
||||
<el-upload
|
||||
:disabled="isDisabled"
|
||||
v-model="formData.contract.file"
|
||||
:headers="{ Token: userStore.token }"
|
||||
class="upload-demo"
|
||||
action="https://worker-task.lihaink.cn/adminapi/upload/file"
|
||||
multiple
|
||||
:limit="1"
|
||||
>
|
||||
<el-button :disabled="isDisabled" type="primary"
|
||||
>上传</el-button
|
||||
>
|
||||
</el-upload>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-col>
|
||||
</template>
|
||||
<el-col :span="24" class="el-card pt-6">
|
||||
<el-form-item label prop="field139">
|
||||
<el-button v-if="isEdit" type="primary" size="medium" @click="create">修改</el-button>
|
||||
<el-button v-else type="primary" :disabled="isDisabled" size="medium" @click="create">创建</el-button>
|
||||
<el-button v-if="isEdit" type="primary" size="medium" @click="create"
|
||||
>修改</el-button
|
||||
>
|
||||
<el-button
|
||||
v-else
|
||||
type="primary"
|
||||
:disabled="isDisabled"
|
||||
size="medium"
|
||||
@click="create"
|
||||
>创建</el-button
|
||||
>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-form>
|
||||
@ -326,8 +495,8 @@ isDisabled = route.query.read
|
||||
isEdit = route.query.edit
|
||||
// 表单数据
|
||||
const formData = reactive({
|
||||
man: "",
|
||||
id: "",
|
||||
man: '',
|
||||
id: '',
|
||||
// level_two: '',
|
||||
// level_one: '',
|
||||
company_name: '',
|
||||
@ -344,11 +513,11 @@ const formData = reactive({
|
||||
master_email: '',
|
||||
other_contacts: [
|
||||
{
|
||||
name: "",
|
||||
position: "",
|
||||
phone: "",
|
||||
email: "",
|
||||
},
|
||||
name: '',
|
||||
position: '',
|
||||
phone: '',
|
||||
email: ''
|
||||
}
|
||||
],
|
||||
// area_manager: '',
|
||||
// is_contract: '',
|
||||
@ -357,10 +526,10 @@ const formData = reactive({
|
||||
// deposit: '',
|
||||
// deposit_time: '',
|
||||
qualification: {
|
||||
business_license: "",
|
||||
business_licenseB: "",
|
||||
bank_account: "",
|
||||
bank_accountB: "",
|
||||
business_license: '',
|
||||
business_licenseB: '',
|
||||
bank_account: '',
|
||||
bank_accountB: ''
|
||||
},
|
||||
contract: {
|
||||
contract_type: '',
|
||||
@ -369,8 +538,8 @@ const formData = reactive({
|
||||
contract_no: '系统自动生成'
|
||||
},
|
||||
//签约方
|
||||
party_a_name: "",
|
||||
file_image: "",
|
||||
party_a_name: '',
|
||||
file_image: ''
|
||||
// status: ''
|
||||
})
|
||||
|
||||
@ -384,83 +553,83 @@ const datas = reactive({
|
||||
areaOptions: [],
|
||||
streetOptions: [],
|
||||
dictTypeLists: [],
|
||||
contract_type: [],
|
||||
});
|
||||
contract_type: []
|
||||
})
|
||||
// 表单验证
|
||||
const formRules = reactive<any>({
|
||||
company_name: [
|
||||
{
|
||||
required: true,
|
||||
message: "请输入公司名称",
|
||||
trigger: ["blur"],
|
||||
},
|
||||
message: '请输入公司名称',
|
||||
trigger: ['blur']
|
||||
}
|
||||
],
|
||||
organization_code: [
|
||||
{
|
||||
required: true,
|
||||
message: "请输入组织机构代码",
|
||||
trigger: ["blur"],
|
||||
},
|
||||
message: '请输入组织机构代码',
|
||||
trigger: ['blur']
|
||||
}
|
||||
],
|
||||
master_name: [
|
||||
{
|
||||
required: true,
|
||||
message: "请输入主联系人姓名",
|
||||
trigger: ["blur"],
|
||||
},
|
||||
message: '请输入主联系人姓名',
|
||||
trigger: ['blur']
|
||||
}
|
||||
],
|
||||
master_position: [
|
||||
{
|
||||
required: true,
|
||||
message: "请输入主联系人职务",
|
||||
trigger: ["blur"],
|
||||
},
|
||||
message: '请输入主联系人职务',
|
||||
trigger: ['blur']
|
||||
}
|
||||
],
|
||||
master_phone: [
|
||||
{
|
||||
required: true,
|
||||
message: "请输入主联系人手机",
|
||||
trigger: ["blur"],
|
||||
},
|
||||
message: '请输入主联系人手机',
|
||||
trigger: ['blur']
|
||||
}
|
||||
],
|
||||
master_email: [
|
||||
{
|
||||
required: true,
|
||||
message: "请输入主联系人邮箱",
|
||||
trigger: ["blur"],
|
||||
},
|
||||
message: '请输入主联系人邮箱',
|
||||
trigger: ['blur']
|
||||
}
|
||||
],
|
||||
account: [
|
||||
{
|
||||
required: true,
|
||||
message: "请输入账号",
|
||||
trigger: ["blur"],
|
||||
},
|
||||
message: '请输入账号',
|
||||
trigger: ['blur']
|
||||
}
|
||||
],
|
||||
password: [
|
||||
{
|
||||
required: true,
|
||||
message: "请输入密码",
|
||||
trigger: ["blur"],
|
||||
},
|
||||
],
|
||||
});
|
||||
const isCompany = ref(false);
|
||||
message: '请输入密码',
|
||||
trigger: ['blur']
|
||||
}
|
||||
]
|
||||
})
|
||||
const isCompany = ref(false)
|
||||
const isMan = ref(false)
|
||||
|
||||
function customEvent(data: any) {
|
||||
isCompany.value = false;
|
||||
formData.contract.party_a = data.id;
|
||||
formData.party_a_name = data.company_name;
|
||||
isCompany.value = false
|
||||
formData.contract.party_a = data.id
|
||||
formData.party_a_name = data.company_name
|
||||
}
|
||||
function customEventMan(data: any) {
|
||||
isMan.value = false;
|
||||
isMan.value = false
|
||||
console.log(data)
|
||||
// formData.contract.party_a = data.id;
|
||||
formData.man = data.name;
|
||||
formData.man = data.name
|
||||
}
|
||||
function openCompany() {
|
||||
isCompany.value = true;
|
||||
isCompany.value = true
|
||||
}
|
||||
|
||||
// 获取详情
|
||||
@ -468,32 +637,26 @@ const setFormData = async (data: Record<any, any>) => {
|
||||
for (const key in formData) {
|
||||
if (data[key] != null && data[key] != undefined) {
|
||||
//@ts-ignore
|
||||
formData[key] = data[key];
|
||||
formData[key] = data[key]
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
const getDetail = async (row: Record<string, any>) => {
|
||||
const data = await apiCompanyDetail({
|
||||
id: row.id,
|
||||
});
|
||||
setFormData(data);
|
||||
};
|
||||
id: row.id
|
||||
})
|
||||
setFormData(data)
|
||||
}
|
||||
|
||||
//上传图片1
|
||||
const handleAvatarSuccess: UploadProps["onSuccess"] = (
|
||||
response,
|
||||
uploadFile
|
||||
) => {
|
||||
formData.qualification.business_license = response.data.uri;
|
||||
};
|
||||
const handleAvatarSuccessB: UploadProps["onSuccess"] = (
|
||||
response,
|
||||
uploadFile
|
||||
) => {
|
||||
formData.qualification.business_licenseB = response.data.uri;
|
||||
};
|
||||
const beforeAvatarUpload: UploadProps["beforeUpload"] = (rawFile) => {
|
||||
const handleAvatarSuccess: UploadProps['onSuccess'] = (response, uploadFile) => {
|
||||
formData.qualification.business_license = response.data.uri
|
||||
}
|
||||
const handleAvatarSuccessB: UploadProps['onSuccess'] = (response, uploadFile) => {
|
||||
formData.qualification.business_licenseB = response.data.uri
|
||||
}
|
||||
const beforeAvatarUpload: UploadProps['beforeUpload'] = (rawFile) => {
|
||||
// if (rawFile.type !== 'image/jpeg') {
|
||||
// ElMessage.error('Avatar picture must be JPG format!')
|
||||
// return false
|
||||
@ -501,22 +664,16 @@ const beforeAvatarUpload: UploadProps["beforeUpload"] = (rawFile) => {
|
||||
// ElMessage.error('Avatar picture size can not exceed 2MB!')
|
||||
// return false
|
||||
// }
|
||||
return true;
|
||||
};
|
||||
return true
|
||||
}
|
||||
//上传图片2
|
||||
const handleAvatarSuccess_two: UploadProps["onSuccess"] = (
|
||||
response,
|
||||
uploadFile
|
||||
) => {
|
||||
formData.qualification.bank_account = response.data.uri;
|
||||
};
|
||||
const handleAvatarSuccess_twoB: UploadProps["onSuccess"] = (
|
||||
response,
|
||||
uploadFile
|
||||
) => {
|
||||
formData.qualification.bank_accountB = response.data.uri;
|
||||
};
|
||||
const beforeAvatarUpload_two: UploadProps["beforeUpload"] = (rawFile) => {
|
||||
const handleAvatarSuccess_two: UploadProps['onSuccess'] = (response, uploadFile) => {
|
||||
formData.qualification.bank_account = response.data.uri
|
||||
}
|
||||
const handleAvatarSuccess_twoB: UploadProps['onSuccess'] = (response, uploadFile) => {
|
||||
formData.qualification.bank_accountB = response.data.uri
|
||||
}
|
||||
const beforeAvatarUpload_two: UploadProps['beforeUpload'] = (rawFile) => {
|
||||
// if (rawFile.type !== 'image/jpeg') {
|
||||
// ElMessage.error('Avatar picture must be JPG format!')
|
||||
// return false
|
||||
@ -524,18 +681,15 @@ const beforeAvatarUpload_two: UploadProps["beforeUpload"] = (rawFile) => {
|
||||
// ElMessage.error('Avatar picture size can not exceed 2MB!')
|
||||
// return false
|
||||
// }
|
||||
return true;
|
||||
};
|
||||
return true
|
||||
}
|
||||
//上传文件3
|
||||
const handleAvatarSuccess_three: UploadProps["onSuccess"] = (
|
||||
response,
|
||||
uploadFile
|
||||
) => {
|
||||
formData.file_image = response.data.uri;
|
||||
formData.contract.file = response.data.uri;
|
||||
};
|
||||
const handleAvatarSuccess_three: UploadProps['onSuccess'] = (response, uploadFile) => {
|
||||
formData.file_image = response.data.uri
|
||||
formData.contract.file = response.data.uri
|
||||
}
|
||||
|
||||
const beforeAvatarUpload_three: UploadProps["beforeUpload"] = (rawFile) => {
|
||||
const beforeAvatarUpload_three: UploadProps['beforeUpload'] = (rawFile) => {
|
||||
// if (rawFile.type !== 'application/msword') {
|
||||
// ElMessage.error('请选择word格式的文件!')
|
||||
// return false
|
||||
@ -544,96 +698,96 @@ const beforeAvatarUpload_three: UploadProps["beforeUpload"] = (rawFile) => {
|
||||
// ElMessage.error('Avatar picture size can not exceed 2MB!')
|
||||
// return false
|
||||
// }
|
||||
return true;
|
||||
};
|
||||
return true
|
||||
}
|
||||
//增加其他联系人
|
||||
function other() {
|
||||
formData.other_contacts.push({
|
||||
name: "",
|
||||
position: "",
|
||||
phone: "",
|
||||
email: "",
|
||||
});
|
||||
name: '',
|
||||
position: '',
|
||||
phone: '',
|
||||
email: ''
|
||||
})
|
||||
}
|
||||
//获取省份
|
||||
function province_change(value: string) {
|
||||
getCityList();
|
||||
getCityList()
|
||||
}
|
||||
function city_change(value: string) {
|
||||
getAreaList();
|
||||
getAreaList()
|
||||
}
|
||||
function area_change(value: string) {
|
||||
getStreetList();
|
||||
getStreetList()
|
||||
}
|
||||
function street_change(value: string) {
|
||||
formData.street = value;
|
||||
formData.street = value
|
||||
}
|
||||
const getProvinceList = async () => {
|
||||
const data = await apiProvinceList({});
|
||||
datas["provinceOptions"] = data;
|
||||
};
|
||||
const data = await apiProvinceList({})
|
||||
datas['provinceOptions'] = data
|
||||
}
|
||||
const getCityList = async () => {
|
||||
const data = await apiCityList({ city: formData.province });
|
||||
datas["cityOptions"] = data;
|
||||
};
|
||||
const data = await apiCityList({ city: formData.province })
|
||||
datas['cityOptions'] = data
|
||||
}
|
||||
const getAreaList = async () => {
|
||||
const data = await apiAreaList({ area: formData.city });
|
||||
datas["areaOptions"] = data;
|
||||
};
|
||||
const data = await apiAreaList({ area: formData.city })
|
||||
datas['areaOptions'] = data
|
||||
}
|
||||
const getStreetList = async () => {
|
||||
const data = await apiStreetList({ street: formData.area });
|
||||
datas["streetOptions"] = data;
|
||||
};
|
||||
getProvinceList();
|
||||
const data = await apiStreetList({ street: formData.area })
|
||||
datas['streetOptions'] = data
|
||||
}
|
||||
getProvinceList()
|
||||
|
||||
const getcontract_type = async () => {
|
||||
const data = await dictDataLists({ type_id: 7 });
|
||||
datas["contract_type"] = data["lists"];
|
||||
};
|
||||
const data = await dictDataLists({ type_id: 7 })
|
||||
datas['contract_type'] = data['lists']
|
||||
}
|
||||
const getdictTypeLists = async () => {
|
||||
const data = await dictDataLists({ type_id: 6 });
|
||||
datas["dictTypeLists"] = data["lists"];
|
||||
};
|
||||
const data = await dictDataLists({ type_id: 6 })
|
||||
datas['dictTypeLists'] = data['lists']
|
||||
}
|
||||
|
||||
const getDetails = async () => {
|
||||
const data = await apiCompanyDetail({
|
||||
id: route.query.id,
|
||||
});
|
||||
id: route.query.id
|
||||
})
|
||||
Object.keys(formData).forEach((key) => {
|
||||
const stringArr = ["province", "city", "area", "street"];
|
||||
const stringArr = ['province', 'city', 'area', 'street']
|
||||
//@ts-ignore
|
||||
formData[key] = data[key];
|
||||
formData[key] = data[key]
|
||||
if (stringArr.includes(key)) {
|
||||
formData[key] = formData[key].toString();
|
||||
getCityList();
|
||||
getAreaList();
|
||||
getStreetList();
|
||||
formData[key] = formData[key].toString()
|
||||
getCityList()
|
||||
getAreaList()
|
||||
getStreetList()
|
||||
}
|
||||
});
|
||||
formData["party_a_name"] = data["contract"]["party_a_name"];
|
||||
formData["file_image"] = data["contract"]["file"];
|
||||
};
|
||||
getProvinceList();
|
||||
getdictTypeLists();
|
||||
getcontract_type();
|
||||
})
|
||||
formData['party_a_name'] = data['contract']['party_a_name']
|
||||
formData['file_image'] = data['contract']['file']
|
||||
}
|
||||
getProvinceList()
|
||||
getdictTypeLists()
|
||||
getcontract_type()
|
||||
|
||||
const create = async () => {
|
||||
await formRef.value?.validate();
|
||||
const data = { ...formData };
|
||||
await formRef.value?.validate()
|
||||
const data = { ...formData }
|
||||
if (route.query.id) {
|
||||
await apiCompanyEdit(data);
|
||||
await apiCompanyEdit(data)
|
||||
} else {
|
||||
await apiCompanyAdd(data);
|
||||
await apiCompanyAdd(data)
|
||||
}
|
||||
removeTab();
|
||||
router.back();
|
||||
};
|
||||
route.query.id && getDetails();
|
||||
removeTab()
|
||||
router.back()
|
||||
}
|
||||
route.query.id && getDetails()
|
||||
defineExpose({
|
||||
open,
|
||||
setFormData,
|
||||
getDetail,
|
||||
});
|
||||
getDetail
|
||||
})
|
||||
</script>
|
||||
<style>
|
||||
.avatar-uploader .el-upload {
|
||||
|
Loading…
x
Reference in New Issue
Block a user