2024-01-23 17:05:40 +08:00
|
|
|
|
<template>
|
2024-03-27 16:45:22 +08:00
|
|
|
|
<a-card :body-style="{padding: '24px 32px'}" :bordered='false'>
|
|
|
|
|
<a-form @submit='handleSubmit' :form='form' :label-col='{ span: 4 }' :wrapper-col='{ span: 6 }'>
|
|
|
|
|
<a-tabs :defaultActiveKey='defaultActiveKey' @change='callback'>
|
|
|
|
|
<a-tab-pane tab='企业详情' key='1'>
|
|
|
|
|
<a-form-item style='display:none'>
|
|
|
|
|
<a-input v-decorator="['id']" />
|
2024-01-23 17:05:40 +08:00
|
|
|
|
</a-form-item>
|
|
|
|
|
<a-row>
|
2024-03-27 16:45:22 +08:00
|
|
|
|
<a-col :span='12'>
|
|
|
|
|
<a-form-item :labelCol='labelColHalf' :wrapperCol='wrapperColHalf' label='企业名称'>
|
|
|
|
|
<a-input placeholder='企业名称'
|
|
|
|
|
v-decorator="['name', {rules: [{required: true, message: '请输入企业名称'}]}]" />
|
2024-01-23 17:05:40 +08:00
|
|
|
|
</a-form-item>
|
|
|
|
|
</a-col>
|
2024-03-27 16:45:22 +08:00
|
|
|
|
<a-col :span='12'>
|
|
|
|
|
<a-form-item :labelCol='labelColHalf' :wrapperCol='wrapperColHalf' label='简称'>
|
|
|
|
|
<a-input placeholder='简称' v-decorator="['shortName']" />
|
2024-01-23 17:05:40 +08:00
|
|
|
|
</a-form-item>
|
|
|
|
|
</a-col>
|
2024-03-27 16:45:22 +08:00
|
|
|
|
<a-col :span='12'>
|
|
|
|
|
<a-form-item :labelCol='labelColHalf' :wrapperCol='wrapperColHalf' label='企业类型'>
|
|
|
|
|
<a-select
|
|
|
|
|
v-decorator="['type', {initialValue:'COMPANY',rules: [{required: true, message: '请选择企业类型'}]}]">
|
|
|
|
|
<a-select-option value='COMPANY'>公司</a-select-option>
|
|
|
|
|
<a-select-option value='PERSON'>个人</a-select-option>
|
2024-01-23 17:05:40 +08:00
|
|
|
|
</a-select>
|
|
|
|
|
</a-form-item>
|
|
|
|
|
</a-col>
|
2024-03-27 16:45:22 +08:00
|
|
|
|
<a-col :span='12'>
|
|
|
|
|
<a-form-item :labelCol='labelColHalf' :wrapperCol='wrapperColHalf' label='企业状态'>
|
|
|
|
|
<a-select
|
|
|
|
|
v-decorator="['customerStatus', {initialValue:'DEAL',rules: [{required: true, message: '请选择企业状态'}]}]">
|
|
|
|
|
<a-select-option value='POTENTIAL'>潜在企业</a-select-option>
|
|
|
|
|
<a-select-option value='PURPOSE'>意向企业</a-select-option>
|
|
|
|
|
<a-select-option value='DEAL'>成交企业</a-select-option>
|
|
|
|
|
<a-select-option value='LOSE'>流失企业</a-select-option>
|
2024-01-23 17:05:40 +08:00
|
|
|
|
</a-select>
|
|
|
|
|
</a-form-item>
|
|
|
|
|
</a-col>
|
2024-03-27 16:45:22 +08:00
|
|
|
|
|
|
|
|
|
<a-col :span='12'>
|
2024-04-03 12:00:44 +08:00
|
|
|
|
<a-form-item :labelCol='labelColHalf' :wrapperCol='wrapperColHalf' label='所属地区'>
|
|
|
|
|
<a-select v-decorator="['tenantId', {rules: [{ required: true, message: '请选择所属地区' }]}]"
|
|
|
|
|
@change='selectTenant'
|
|
|
|
|
:disabled='tenantEnable'>
|
|
|
|
|
<a-select-option v-for='item in tenantList' :key='item.id'>{{ item.name }}</a-select-option>
|
|
|
|
|
</a-select>
|
|
|
|
|
</a-form-item>
|
|
|
|
|
</a-col>
|
|
|
|
|
<a-col :span='12'>
|
|
|
|
|
<a-form-item :labelCol='labelColHalf' :wrapperCol='wrapperColHalf' label='所属园区'>
|
|
|
|
|
<a-select v-decorator="['parkId', {rules: [{ required: true, message: '请选择所属园区' }]}]"
|
|
|
|
|
@change='selectPark'
|
|
|
|
|
:disabled='parkEnable'>
|
|
|
|
|
<a-select-option v-for='item in parkList' :key='item.id'>{{ item.name }}</a-select-option>
|
|
|
|
|
</a-select>
|
|
|
|
|
</a-form-item>
|
|
|
|
|
</a-col>
|
|
|
|
|
|
|
|
|
|
<a-col :span='12'>
|
|
|
|
|
<a-form-item :labelCol='labelColHalf' :wrapperCol='wrapperColHalf' label='所属楼宇'>
|
|
|
|
|
<a-select v-decorator="['buildingId', {rules: [{ required: true, message: '请选择所属楼宇' }]}]"
|
|
|
|
|
@change='selectBuilding'>
|
|
|
|
|
<a-select-option v-for='item in buildingList' :key='item.id'>{{ item.buildingName }}</a-select-option>
|
|
|
|
|
</a-select>
|
|
|
|
|
</a-form-item>
|
|
|
|
|
</a-col>
|
|
|
|
|
<a-col :span='12'>
|
|
|
|
|
<a-form-item :labelCol='labelColHalf' :wrapperCol='wrapperColHalf' label='所属楼层'>
|
|
|
|
|
<a-select v-decorator="['buildingDetailIds',{rules: [{ required: true, message: '请选择所属楼层' }]}]"
|
|
|
|
|
placeholder='所属楼层'
|
|
|
|
|
mode='multiple'
|
|
|
|
|
@change='selectBuildingDetail'>
|
|
|
|
|
<a-select-option v-for='item in buildingDetailList' :key='item.id' :value='item.id'>
|
2024-03-27 16:45:22 +08:00
|
|
|
|
{{ item.floorName }}
|
|
|
|
|
</a-select-option>
|
|
|
|
|
</a-select>
|
|
|
|
|
</a-form-item>
|
|
|
|
|
</a-col>
|
2024-04-03 12:00:44 +08:00
|
|
|
|
|
2024-03-27 16:45:22 +08:00
|
|
|
|
<a-col :span='12'>
|
2024-04-03 12:00:44 +08:00
|
|
|
|
<a-form-item :labelCol='labelColHalf' :wrapperCol='wrapperColHalf' label='所属房间'>
|
|
|
|
|
<a-select v-decorator="['roomIds',{rules: [{ required: true, message: '选择所属房间' }]}]"
|
|
|
|
|
placeholder='所属房间'
|
|
|
|
|
mode='multiple'>
|
2024-03-27 16:45:22 +08:00
|
|
|
|
<a-select-option v-for='item in roomList' :key='item.id' :value='item.id'>
|
|
|
|
|
{{ item.name }}
|
|
|
|
|
</a-select-option>
|
|
|
|
|
</a-select>
|
|
|
|
|
</a-form-item>
|
|
|
|
|
</a-col>
|
|
|
|
|
|
2024-03-28 13:55:11 +08:00
|
|
|
|
<a-col :span='12'>
|
2024-03-28 14:57:06 +08:00
|
|
|
|
<a-form-item :labelCol='labelColHalf' :wrapperCol='wrapperColHalf' label='入住时间'>
|
2024-03-28 13:55:11 +08:00
|
|
|
|
<a-date-picker
|
|
|
|
|
format='YYYY-MM-DD HH:mm'
|
|
|
|
|
valueFormat='YYYY-MM-DD HH:mm:ss'
|
|
|
|
|
:show-time="{ format: 'HH:mm' }"
|
2024-03-28 14:57:06 +08:00
|
|
|
|
v-decorator="['startDate',{rules: [{ required: true, message: '选择入住时间' }]}]"
|
2024-03-28 13:55:11 +08:00
|
|
|
|
type='date'
|
2024-03-28 14:57:06 +08:00
|
|
|
|
placeholder='入住时间'
|
|
|
|
|
style='width: 100%'
|
2024-03-28 13:55:11 +08:00
|
|
|
|
/>
|
|
|
|
|
</a-form-item>
|
|
|
|
|
</a-col>
|
|
|
|
|
<a-col :span='12'>
|
2024-03-28 14:57:06 +08:00
|
|
|
|
<a-form-item :labelCol='labelColHalf' :wrapperCol='wrapperColHalf' label='租期结束时间'>
|
2024-03-28 13:55:11 +08:00
|
|
|
|
<a-date-picker
|
|
|
|
|
format='YYYY-MM-DD HH:mm'
|
|
|
|
|
valueFormat='YYYY-MM-DD HH:mm:ss'
|
|
|
|
|
:show-time="{ format: 'HH:mm' }"
|
2024-03-28 14:57:06 +08:00
|
|
|
|
v-decorator="['endDate',{rules: [{ required: true, message: '选择租期结束时间' }]}]"
|
2024-03-28 13:55:11 +08:00
|
|
|
|
type='date'
|
2024-03-28 14:57:06 +08:00
|
|
|
|
placeholder='租期结束时间'
|
|
|
|
|
style='width: 100%'
|
2024-03-28 13:55:11 +08:00
|
|
|
|
/>
|
|
|
|
|
</a-form-item>
|
|
|
|
|
</a-col>
|
2024-03-27 16:45:22 +08:00
|
|
|
|
|
|
|
|
|
<a-col :span='12'>
|
|
|
|
|
<a-form-item :labelCol='labelColHalf' :wrapperCol='wrapperColHalf' label='所属行业'>
|
|
|
|
|
<a-input placeholder='所属行业' v-decorator="['sector']" />
|
2024-01-23 17:05:40 +08:00
|
|
|
|
</a-form-item>
|
|
|
|
|
</a-col>
|
2024-03-27 16:45:22 +08:00
|
|
|
|
<a-col :span='12'>
|
|
|
|
|
<a-form-item :labelCol='labelColHalf' :wrapperCol='wrapperColHalf' label='所属国家'>
|
|
|
|
|
<a-input placeholder='所属国家' v-decorator="['country']" />
|
2024-01-23 17:05:40 +08:00
|
|
|
|
</a-form-item>
|
|
|
|
|
</a-col>
|
2024-03-27 16:45:22 +08:00
|
|
|
|
<a-col :span='12'>
|
|
|
|
|
<a-form-item :labelCol='labelColHalf' :wrapperCol='wrapperColHalf' label='过程管理'>
|
2024-01-23 17:05:40 +08:00
|
|
|
|
<a-select v-decorator="['process']">
|
2024-03-27 16:45:22 +08:00
|
|
|
|
<a-select-option value='FIRST_VISIT'>初次拜访</a-select-option>
|
|
|
|
|
<a-select-option value='NEED_GUID'>需求引导分析</a-select-option>
|
|
|
|
|
<a-select-option value='COMPETE'>竞争阶段</a-select-option>
|
|
|
|
|
<a-select-option value='PREDETERMINE'>预定阶段</a-select-option>
|
|
|
|
|
<a-select-option value='CONTRACT'>合同阶段</a-select-option>
|
2024-01-23 17:05:40 +08:00
|
|
|
|
</a-select>
|
|
|
|
|
</a-form-item>
|
|
|
|
|
</a-col>
|
2024-03-27 16:45:22 +08:00
|
|
|
|
<a-col :span='12'>
|
|
|
|
|
<a-form-item :labelCol='labelColHalf' :wrapperCol='wrapperColHalf' label='联系人'>
|
2024-04-02 17:32:50 +08:00
|
|
|
|
<a-input placeholder='联系人'
|
|
|
|
|
v-decorator="['contacts',{rules: [{ required: true, message: '请输入联系人' }]}]" />
|
2024-01-23 17:05:40 +08:00
|
|
|
|
</a-form-item>
|
|
|
|
|
</a-col>
|
2024-03-27 16:45:22 +08:00
|
|
|
|
<a-col :span='12'>
|
|
|
|
|
<a-form-item :labelCol='labelColHalf' :wrapperCol='wrapperColHalf' label='联系电话'>
|
2024-04-03 12:00:44 +08:00
|
|
|
|
<a-input placeholder='联系电话'
|
|
|
|
|
v-decorator="['phone',{rules: [{ required: true, message: '请输入联系电话' }]}]" />
|
2024-01-23 17:05:40 +08:00
|
|
|
|
</a-form-item>
|
|
|
|
|
</a-col>
|
2024-03-27 16:45:22 +08:00
|
|
|
|
<a-col :span='12'>
|
|
|
|
|
<a-form-item :labelCol='labelColHalf' :wrapperCol='wrapperColHalf' label='邮箱'>
|
|
|
|
|
<a-input placeholder='邮箱' v-decorator="['email']" />
|
2024-01-23 17:05:40 +08:00
|
|
|
|
</a-form-item>
|
|
|
|
|
</a-col>
|
2024-03-27 16:45:22 +08:00
|
|
|
|
<a-col :span='12'>
|
|
|
|
|
<a-form-item :labelCol='labelColHalf' :wrapperCol='wrapperColHalf' label='统一信用代码'>
|
|
|
|
|
<a-input placeholder='统一信用代码' v-decorator="['creditNo']" />
|
|
|
|
|
<a-button type='primary' @click='getQiXinBasicInfo'>同步工商数据</a-button>
|
2024-01-23 17:05:40 +08:00
|
|
|
|
</a-form-item>
|
|
|
|
|
</a-col>
|
2024-03-27 16:45:22 +08:00
|
|
|
|
<a-col :span='12'>
|
|
|
|
|
<a-form-item :labelCol='labelColHalf' :wrapperCol='wrapperColHalf' label='邮编'>
|
|
|
|
|
<a-input placeholder='邮编' v-decorator="['postalCode']" />
|
2024-01-23 17:05:40 +08:00
|
|
|
|
</a-form-item>
|
|
|
|
|
</a-col>
|
2024-03-27 16:45:22 +08:00
|
|
|
|
<a-col :span='24'>
|
|
|
|
|
<a-form-item :labelCol='labelCol' :wrapperCol='wrapperCol' label='通讯地址'>
|
|
|
|
|
<a-input placeholder='通讯地址' v-decorator="['mailAddress']" />
|
2024-01-23 17:05:40 +08:00
|
|
|
|
</a-form-item>
|
|
|
|
|
</a-col>
|
2024-03-27 16:45:22 +08:00
|
|
|
|
<a-col :span='24'>
|
|
|
|
|
<a-form-item :labelCol='labelCol' :wrapperCol='wrapperCol' label='上传公司头像'
|
|
|
|
|
extra='尺寸建议:宽160px,高160px'>
|
2024-01-23 17:05:40 +08:00
|
|
|
|
<a-upload
|
|
|
|
|
v-decorator="['headImg']"
|
2024-03-27 16:45:22 +08:00
|
|
|
|
list-type='picture-card'
|
|
|
|
|
class='avatar-uploader'
|
|
|
|
|
:show-upload-list='false'
|
|
|
|
|
:action='uploadUrl'
|
|
|
|
|
:headers='headers'
|
|
|
|
|
:before-upload='beforeUpload'
|
|
|
|
|
@change='handleChange'
|
2024-01-23 17:05:40 +08:00
|
|
|
|
>
|
2024-03-27 16:45:22 +08:00
|
|
|
|
<img v-if='imageUrl' :src='imageUrl' style='width: 102px; height: 102px' />
|
2024-01-23 17:05:40 +08:00
|
|
|
|
<div v-else>
|
|
|
|
|
<a-icon :type="loading ? 'loading' : 'plus'" />
|
2024-03-27 16:45:22 +08:00
|
|
|
|
<div class='ant-upload-text'> 上传</div>
|
2024-01-23 17:05:40 +08:00
|
|
|
|
</div>
|
|
|
|
|
</a-upload>
|
|
|
|
|
</a-form-item>
|
|
|
|
|
</a-col>
|
2024-03-27 16:45:22 +08:00
|
|
|
|
<a-col :span='24'>
|
|
|
|
|
<a-form-item :labelCol='labelCol' :wrapperCol='wrapperCol' label='上传照片墙'>
|
2024-01-23 17:05:40 +08:00
|
|
|
|
<a-upload
|
|
|
|
|
v-decorator="['bannerImages', {rules: [{ required: false, message: '上传照片墙' }]}]"
|
2024-03-27 16:45:22 +08:00
|
|
|
|
list-type='picture-card'
|
|
|
|
|
class='avatar-uploader'
|
|
|
|
|
:file-list='fileList'
|
|
|
|
|
:action='uploadUrl'
|
|
|
|
|
:headers='headers'
|
|
|
|
|
@preview='handlePreview'
|
|
|
|
|
@change='handleChangeFileList'
|
2024-01-23 17:05:40 +08:00
|
|
|
|
>
|
2024-03-27 16:45:22 +08:00
|
|
|
|
<div v-if='fileList.length < 4'>
|
|
|
|
|
<a-icon type='plus' />
|
|
|
|
|
<div class='ant-upload-text'> 上传</div>
|
2024-01-23 17:05:40 +08:00
|
|
|
|
</div>
|
|
|
|
|
</a-upload>
|
2024-03-27 16:45:22 +08:00
|
|
|
|
<a-modal :visible='previewVisible' :footer='null' @cancel='handleCancel'>
|
|
|
|
|
<img style='width: 100%' :src='previewImage' />
|
2024-01-23 17:05:40 +08:00
|
|
|
|
</a-modal>
|
|
|
|
|
</a-form-item>
|
|
|
|
|
</a-col>
|
2024-03-27 16:45:22 +08:00
|
|
|
|
<a-col :span='8'>
|
|
|
|
|
<a-form-item :labelCol='labelColOneThird' :wrapperCol='wrapperColOneThird' label='渠道类型'>
|
2024-01-23 17:05:40 +08:00
|
|
|
|
<a-select v-decorator="['channelType']">
|
2024-03-27 16:45:22 +08:00
|
|
|
|
<a-select-option value='AGENT'>中介公司</a-select-option>
|
|
|
|
|
<a-select-option value='AD'>广告</a-select-option>
|
|
|
|
|
<a-select-option value='COOPERATE'>合作推荐</a-select-option>
|
|
|
|
|
<a-select-option value='MY_CHANNEL'>自开发渠道</a-select-option>
|
2024-01-23 17:05:40 +08:00
|
|
|
|
</a-select>
|
|
|
|
|
</a-form-item>
|
|
|
|
|
</a-col>
|
2024-03-27 16:45:22 +08:00
|
|
|
|
<a-col :span='8'>
|
|
|
|
|
<a-form-item :labelCol='labelColOneThird' :wrapperCol='wrapperColOneThird' label='渠道名称'>
|
|
|
|
|
<a-input placeholder='渠道名称' v-decorator="['channelName']" />
|
2024-01-23 17:05:40 +08:00
|
|
|
|
</a-form-item>
|
|
|
|
|
</a-col>
|
2024-03-27 16:45:22 +08:00
|
|
|
|
<a-col :span='8'>
|
|
|
|
|
<a-form-item :labelCol='labelColOneThird' :wrapperCol='wrapperColOneThird' label='是否黑名单'>
|
2024-04-03 12:00:44 +08:00
|
|
|
|
<a-switch :checked='mdl.isBlacklist' @change='onChangeBlacklist'
|
2024-03-27 16:45:22 +08:00
|
|
|
|
v-decorator="['isBlacklist']" />
|
2024-01-23 17:05:40 +08:00
|
|
|
|
</a-form-item>
|
|
|
|
|
</a-col>
|
2024-03-27 16:45:22 +08:00
|
|
|
|
<a-col :span='24'>
|
|
|
|
|
<a-form-item :labelCol='labelCol' :wrapperCol='wrapperColOneThird' label='企业备注'>
|
|
|
|
|
<a-input placeholder='企业备注' v-decorator="['remark']" />
|
2024-01-23 17:05:40 +08:00
|
|
|
|
</a-form-item>
|
|
|
|
|
</a-col>
|
2024-03-27 16:45:22 +08:00
|
|
|
|
<a-col :span='24'>
|
|
|
|
|
<a-form-item :labelCol='labelCol' :wrapperCol='wrapperCol' label='工商注册号'>
|
|
|
|
|
<a-input placeholder='工商注册号' v-decorator="['regNo']" />
|
2024-01-23 17:05:40 +08:00
|
|
|
|
</a-form-item>
|
|
|
|
|
</a-col>
|
2024-03-27 16:45:22 +08:00
|
|
|
|
<a-col :span='12'>
|
|
|
|
|
<a-form-item :labelCol='labelColHalf' :wrapperCol='wrapperColHalf' label='组织机构代码'>
|
|
|
|
|
<a-input placeholder='组织机构代码' v-decorator="['orgNo']" />
|
2024-01-23 17:05:40 +08:00
|
|
|
|
</a-form-item>
|
|
|
|
|
</a-col>
|
2024-03-27 16:45:22 +08:00
|
|
|
|
<a-col :span='12'>
|
|
|
|
|
<a-form-item :labelCol='labelColHalf' :wrapperCol='wrapperColHalf' label='法人名'>
|
|
|
|
|
<a-input placeholder='法人名' v-decorator="['operName']" />
|
2024-01-23 17:05:40 +08:00
|
|
|
|
</a-form-item>
|
|
|
|
|
</a-col>
|
2024-03-27 16:45:22 +08:00
|
|
|
|
<a-col :span='12'>
|
|
|
|
|
<a-form-item :labelCol='labelColHalf' :wrapperCol='wrapperColHalf' label='经营状态'>
|
|
|
|
|
<a-input placeholder='经营状态' v-decorator="['status']" />
|
2024-01-23 17:05:40 +08:00
|
|
|
|
</a-form-item>
|
|
|
|
|
</a-col>
|
2024-03-27 16:45:22 +08:00
|
|
|
|
<a-col :span='12'>
|
|
|
|
|
<a-form-item :labelCol='labelColHalf' :wrapperCol='wrapperColHalf' label='公司类型(企业性质)'>
|
|
|
|
|
<a-input placeholder='公司类型(企业性质)' v-decorator="['econKind']" />
|
2024-01-23 17:05:40 +08:00
|
|
|
|
</a-form-item>
|
|
|
|
|
</a-col>
|
2024-03-27 16:45:22 +08:00
|
|
|
|
<a-col :span='12'>
|
|
|
|
|
<a-form-item :labelCol='labelColHalf' :wrapperCol='wrapperColHalf' label='注册资金'>
|
|
|
|
|
<a-input placeholder='注册资金' v-decorator="['registCapi']" />
|
2024-01-23 17:05:40 +08:00
|
|
|
|
</a-form-item>
|
|
|
|
|
</a-col>
|
2024-03-27 16:45:22 +08:00
|
|
|
|
<a-col :span='12'>
|
|
|
|
|
<a-form-item :labelCol='labelColHalf' :wrapperCol='wrapperColHalf' label='登记机关'>
|
|
|
|
|
<a-input placeholder='登记机关'
|
2024-03-28 14:57:06 +08:00
|
|
|
|
v-decorator="['belongOrg']" />
|
2024-01-23 17:05:40 +08:00
|
|
|
|
</a-form-item>
|
|
|
|
|
</a-col>
|
2024-03-27 16:45:22 +08:00
|
|
|
|
<a-col :span='24'>
|
|
|
|
|
<a-form-item :labelCol='labelCol' :wrapperCol='wrapperCol' label='注册地址'>
|
|
|
|
|
<a-input placeholder='注册地址'
|
2024-03-28 14:57:06 +08:00
|
|
|
|
v-decorator="['address']" />
|
2024-01-23 17:05:40 +08:00
|
|
|
|
</a-form-item>
|
|
|
|
|
</a-col>
|
2024-03-27 16:45:22 +08:00
|
|
|
|
<a-col :span='24'>
|
|
|
|
|
<a-form-item :labelCol='labelCol' :wrapperCol='wrapperCol' label='经营范围'>
|
2024-01-23 17:05:40 +08:00
|
|
|
|
<!-- <a-input placeholder="经营范围" v-decorator="['scope']" /> -->
|
2024-03-27 16:45:22 +08:00
|
|
|
|
<a-textarea placeholder='经营范围' v-decorator="['scope']"
|
|
|
|
|
:autoSize='{ minRows: 3, maxRows: 5 }'></a-textarea>
|
2024-01-23 17:05:40 +08:00
|
|
|
|
</a-form-item>
|
|
|
|
|
</a-col>
|
|
|
|
|
</a-row>
|
2024-03-27 16:45:22 +08:00
|
|
|
|
<a-form-item :wrapperCol='{ span: 24 }' style='text-align: center'>
|
|
|
|
|
<a-button htmlType='submit' type='primary'>提交</a-button>
|
|
|
|
|
<a-button icon='rollback' style='margin-left: 8px' @click='rollback'>关闭</a-button>
|
2024-01-23 17:05:40 +08:00
|
|
|
|
</a-form-item>
|
|
|
|
|
</a-tab-pane>
|
2024-03-27 16:45:22 +08:00
|
|
|
|
<a-tab-pane tab='关联合同' key='2' forceRender v-if='$route.query.customerId'>
|
|
|
|
|
<div style='margin: 10px'>
|
|
|
|
|
<a-button type='primary' @click='navContract'>新增合同</a-button>
|
2024-01-23 17:05:40 +08:00
|
|
|
|
</div>
|
|
|
|
|
<a-table
|
2024-03-27 16:45:22 +08:00
|
|
|
|
:pagination='false'
|
|
|
|
|
:columns='contractColumns'
|
|
|
|
|
:dataSource='contractData'
|
|
|
|
|
rowKey='id'
|
2024-01-23 17:05:40 +08:00
|
|
|
|
>
|
2024-03-27 16:45:22 +08:00
|
|
|
|
<div slot='sn' slot-scope='text, record' style='cursor:pointer;color:#1890ff'
|
|
|
|
|
@click='handleDetail(record.id)'>
|
2024-01-23 17:05:40 +08:00
|
|
|
|
<span>{{ text }}</span>
|
|
|
|
|
</div>
|
2024-03-27 16:45:22 +08:00
|
|
|
|
<span slot='serial' slot-scope='text, record, index'>
|
2024-01-23 17:05:40 +08:00
|
|
|
|
{{ index + 1 }}
|
|
|
|
|
</span>
|
2024-03-27 16:45:22 +08:00
|
|
|
|
<span slot='status' slot-scope='text'>
|
2024-01-23 17:05:40 +08:00
|
|
|
|
{{ text | statusFilter }}
|
|
|
|
|
</span>
|
|
|
|
|
</a-table>
|
|
|
|
|
</a-tab-pane>
|
2024-04-01 18:09:33 +08:00
|
|
|
|
<a-tab-pane tab='企业员工管理' key='3' v-if='$route.query.customerId'>
|
2024-03-27 16:45:22 +08:00
|
|
|
|
<div style='margin: 10px'>
|
|
|
|
|
<a-button type='primary' @click='$refs.contactModal.add({ customerId: $route.query.customerId })'>
|
2024-04-01 18:09:33 +08:00
|
|
|
|
新建企业员工
|
2024-03-27 16:45:22 +08:00
|
|
|
|
</a-button>
|
2024-04-02 08:49:14 +08:00
|
|
|
|
<a-button style='margin-left: 30px' type='success' @click='importUser'>
|
|
|
|
|
导入用户
|
|
|
|
|
</a-button>
|
2024-01-23 17:05:40 +08:00
|
|
|
|
</div>
|
2024-04-02 17:32:50 +08:00
|
|
|
|
<a-table :pagination='false' :columns='contactsItemColumns'
|
|
|
|
|
:dataSource='contactsItemData'
|
|
|
|
|
ref='userTable'
|
|
|
|
|
rowKey='id'>
|
|
|
|
|
<span slot='gender' slot-scope='text, record'>
|
|
|
|
|
{{ record.gender === '1' ? '女' : '男' }}
|
|
|
|
|
</span>
|
|
|
|
|
<span slot='num' slot-scope='text, record'>
|
|
|
|
|
<a @click='handleDeviceTable(record)'>{{ record.num }}</a>
|
|
|
|
|
</span>
|
2024-03-27 16:45:22 +08:00
|
|
|
|
<template slot='operation' slot-scope='text, record'>
|
2024-04-02 17:32:50 +08:00
|
|
|
|
<a-button type='link' @click='$refs.contactModal.add(record)'>编辑</a-button>
|
|
|
|
|
<a-divider type='vertical' />
|
2024-03-27 16:45:22 +08:00
|
|
|
|
<a-popconfirm @confirm='handleDeleteContact(record)'>
|
2024-04-02 17:32:50 +08:00
|
|
|
|
|
2024-03-27 16:45:22 +08:00
|
|
|
|
<template slot='title'>
|
2024-01-23 17:05:40 +08:00
|
|
|
|
<span>确定删除 {{ record.name }} 吗?</span>
|
|
|
|
|
</template>
|
2024-03-27 16:45:22 +08:00
|
|
|
|
<a-icon slot='icon' type='question-circle-o' style='color: red' />
|
|
|
|
|
<a-button type='link'>删除</a-button>
|
2024-01-23 17:05:40 +08:00
|
|
|
|
</a-popconfirm>
|
|
|
|
|
</template>
|
|
|
|
|
</a-table>
|
|
|
|
|
</a-tab-pane>
|
2024-03-27 16:45:22 +08:00
|
|
|
|
<a-tab-pane tab='相关文件' key='4' v-if='$route.query.customerId'>
|
|
|
|
|
<customer-attachment-list :customer-id='$route.query.customerId'></customer-attachment-list>
|
2024-03-24 16:50:05 +08:00
|
|
|
|
|
2024-01-23 17:05:40 +08:00
|
|
|
|
</a-tab-pane>
|
|
|
|
|
</a-tabs>
|
|
|
|
|
</a-form>
|
2024-03-27 16:45:22 +08:00
|
|
|
|
<customer-contacts-modal ref='contactModal' @ok='handleContactSaved' />
|
2024-04-02 17:32:50 +08:00
|
|
|
|
<a-modal v-model='visible' title='导入用户' @ok='handleFileOk'>
|
2024-04-02 13:43:54 +08:00
|
|
|
|
<div style='display: flex'>
|
|
|
|
|
<a-upload
|
2024-04-02 17:32:50 +08:00
|
|
|
|
:fileList='fileList'
|
|
|
|
|
:headers='headers'
|
|
|
|
|
accept='.xlsx,.xls'
|
|
|
|
|
@change='customChange'
|
|
|
|
|
:customRequest='customRequest'>
|
|
|
|
|
<a-button type='primary'>导入用户数据</a-button>
|
2024-04-02 13:43:54 +08:00
|
|
|
|
</a-upload>
|
2024-04-02 17:32:50 +08:00
|
|
|
|
<a-button style='margin-left: 40px' type='primary' @click='exportTemplate'>导出用户模板</a-button>
|
2024-04-02 13:43:54 +08:00
|
|
|
|
</div>
|
2024-04-02 08:49:14 +08:00
|
|
|
|
|
|
|
|
|
</a-modal>
|
2024-04-02 17:32:50 +08:00
|
|
|
|
<a-modal v-model='visible1' title='设备授权' width='500px' @ok='itemHandleOk()'>
|
|
|
|
|
<div class='table-page-search-wrapper'>
|
|
|
|
|
<a-form layout='inline'>
|
|
|
|
|
<a-row :gutter='48'>
|
|
|
|
|
<a-col :md='8' :sm='24'>
|
|
|
|
|
<span class='table-page-search-submitButtons'>
|
|
|
|
|
<!-- 查询有问题-->
|
|
|
|
|
<a-button type='primary' @click='$refs.table.refresh(true)'>查询</a-button>
|
|
|
|
|
<a-button style='margin-left: 8px' @click='() => (deviceQueryParam = {})'>重置</a-button>
|
|
|
|
|
</span>
|
|
|
|
|
</a-col>
|
|
|
|
|
</a-row>
|
|
|
|
|
</a-form>
|
|
|
|
|
</div>
|
|
|
|
|
<div class='table-operator'>
|
|
|
|
|
</div>
|
|
|
|
|
<a-table
|
|
|
|
|
size='default'
|
|
|
|
|
ref='itemTable'
|
|
|
|
|
rowKey='id'
|
|
|
|
|
:rowSelection='{ selectedRowKeys: selectedDeviceRowKeys, onChange: onDeviceSelectChange }'
|
|
|
|
|
:columns='deviceColumns'
|
|
|
|
|
:dataSource='deviceData'
|
|
|
|
|
>
|
|
|
|
|
<span slot='floorName' slot-scope='text, record'>
|
|
|
|
|
{{ record.buildName + record.roomName }}
|
|
|
|
|
</span>
|
|
|
|
|
</a-table>
|
|
|
|
|
</a-modal>
|
|
|
|
|
|
|
|
|
|
|
2024-01-23 17:05:40 +08:00
|
|
|
|
</a-card>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script>
|
2024-04-02 13:43:54 +08:00
|
|
|
|
|
2024-04-03 12:00:44 +08:00
|
|
|
|
import { getTenantList } from '@/api/tenant'
|
|
|
|
|
|
2024-04-02 17:32:50 +08:00
|
|
|
|
let downloadLoadingInstance
|
2024-01-23 17:05:40 +08:00
|
|
|
|
import moment from 'moment'
|
|
|
|
|
import storage from 'store'
|
|
|
|
|
import { ACCESS_TOKEN } from '@/store/mutation-types'
|
2024-03-27 16:45:22 +08:00
|
|
|
|
import {
|
|
|
|
|
saveCustomer,
|
|
|
|
|
getCustomer,
|
|
|
|
|
getQiXinBasicInfo,
|
|
|
|
|
getStaffList,
|
2024-04-01 18:09:33 +08:00
|
|
|
|
selectCustomerStaffList,
|
2024-04-02 08:49:14 +08:00
|
|
|
|
updateStaffByCustomer,
|
2024-04-02 13:43:54 +08:00
|
|
|
|
importData,
|
2024-04-02 17:32:50 +08:00
|
|
|
|
exportTemplate,
|
|
|
|
|
selectUserDeviceList,
|
|
|
|
|
selectEquipmentListById,
|
|
|
|
|
saveUserEquipment
|
2024-03-27 16:45:22 +08:00
|
|
|
|
} from '@/api/admin/customer'
|
|
|
|
|
import {
|
|
|
|
|
getFloorList,
|
2024-04-03 12:00:44 +08:00
|
|
|
|
getRoomListByFloorId,
|
|
|
|
|
getRoomListByBuildIdsRq
|
2024-03-27 16:45:22 +08:00
|
|
|
|
} from '@/api/admin/meeting/roomContent'
|
2024-01-23 17:05:40 +08:00
|
|
|
|
import { getCustomerContractList } from '@/api/admin/customerContract'
|
|
|
|
|
import CustomerContactsModal from './modules/CustomerContactsModal.vue'
|
|
|
|
|
import CustomerAttachmentList from './modules/CustomerAttachmentList.vue'
|
|
|
|
|
import pick from 'lodash.pick'
|
2024-04-02 13:43:54 +08:00
|
|
|
|
import { message } from 'ant-design-vue'
|
|
|
|
|
import { download } from '@/utils/request'
|
2024-04-03 12:00:44 +08:00
|
|
|
|
import { getParkList } from '@/api/admin/park'
|
|
|
|
|
import { getBuildingList } from '@/api/admin/building'
|
|
|
|
|
import { getBuildingDetailList } from '@/api/admin/buildingDetail'
|
|
|
|
|
import { getInfo } from '@/api/login'
|
2024-04-02 17:32:50 +08:00
|
|
|
|
|
2024-01-23 17:05:40 +08:00
|
|
|
|
export default {
|
|
|
|
|
name: 'BaseForm',
|
|
|
|
|
components: {
|
|
|
|
|
CustomerContactsModal,
|
|
|
|
|
CustomerAttachmentList
|
|
|
|
|
},
|
2024-03-27 16:45:22 +08:00
|
|
|
|
data() {
|
2024-01-23 17:05:40 +08:00
|
|
|
|
return {
|
|
|
|
|
id: '',
|
|
|
|
|
defaultActiveKey: '1',
|
|
|
|
|
// 合同行
|
|
|
|
|
contractColumns: [
|
|
|
|
|
{
|
|
|
|
|
title: '合同编号',
|
|
|
|
|
dataIndex: 'sn',
|
|
|
|
|
scopedSlots: { customRender: 'sn' }
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: '物管合同号',
|
|
|
|
|
dataIndex: 'pmSn'
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: '合同名称',
|
|
|
|
|
dataIndex: 'name'
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: '签订时间',
|
|
|
|
|
dataIndex: 'signDate'
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: '记租时间',
|
|
|
|
|
dataIndex: 'startDate'
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: '到期时间',
|
|
|
|
|
dataIndex: 'endDate'
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: '状态',
|
|
|
|
|
dataIndex: 'status',
|
|
|
|
|
scopedSlots: { customRender: 'status' }
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: '签订人',
|
|
|
|
|
dataIndex: 'operName'
|
|
|
|
|
}
|
|
|
|
|
],
|
|
|
|
|
// 联系人列表表头
|
|
|
|
|
contactsItemColumns: [
|
|
|
|
|
{
|
2024-03-24 16:50:05 +08:00
|
|
|
|
title: '昵称',
|
2024-03-27 16:45:22 +08:00
|
|
|
|
dataIndex: 'username'
|
2024-01-23 17:05:40 +08:00
|
|
|
|
},
|
|
|
|
|
{
|
2024-03-24 16:50:05 +08:00
|
|
|
|
title: '手机号',
|
2024-03-27 16:45:22 +08:00
|
|
|
|
dataIndex: 'mobile'
|
2024-01-23 17:05:40 +08:00
|
|
|
|
},
|
2024-04-02 17:32:50 +08:00
|
|
|
|
{
|
|
|
|
|
title: '授权设备数量',
|
|
|
|
|
dataIndex: 'num',
|
|
|
|
|
scopedSlots: { customRender: 'num' }
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
2024-04-02 13:43:54 +08:00
|
|
|
|
{
|
|
|
|
|
title: '性别',
|
2024-04-02 17:32:50 +08:00
|
|
|
|
dataIndex: 'gender',
|
|
|
|
|
scopedSlots: { customRender: 'gender' }
|
|
|
|
|
|
2024-04-02 13:43:54 +08:00
|
|
|
|
},
|
2024-01-23 17:05:40 +08:00
|
|
|
|
{
|
|
|
|
|
title: '操作',
|
|
|
|
|
key: 'operation',
|
|
|
|
|
scopedSlots: { customRender: 'operation' }
|
|
|
|
|
}
|
|
|
|
|
],
|
2024-04-03 12:00:44 +08:00
|
|
|
|
deviceColumns: [
|
2024-04-02 17:32:50 +08:00
|
|
|
|
{
|
|
|
|
|
title: '设备名称',
|
|
|
|
|
dataIndex: 'equipmentName'
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: '设备编号',
|
|
|
|
|
dataIndex: 'equipmentNum'
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: '所属地区',
|
|
|
|
|
dataIndex: 'floorName',
|
|
|
|
|
scopedSlots: { customRender: 'floorName' }
|
|
|
|
|
|
2024-04-03 12:00:44 +08:00
|
|
|
|
}
|
2024-04-02 17:32:50 +08:00
|
|
|
|
],
|
2024-04-03 12:00:44 +08:00
|
|
|
|
deviceData: [],
|
2024-01-23 17:05:40 +08:00
|
|
|
|
labelColHalf: {
|
|
|
|
|
span: 6
|
|
|
|
|
},
|
|
|
|
|
wrapperColHalf: {
|
|
|
|
|
span: 18
|
|
|
|
|
},
|
|
|
|
|
labelColOneThird: {
|
|
|
|
|
span: 9
|
|
|
|
|
},
|
|
|
|
|
wrapperColOneThird: {
|
|
|
|
|
span: 15
|
|
|
|
|
},
|
|
|
|
|
labelCol: {
|
|
|
|
|
xs: { span: 24 },
|
|
|
|
|
sm: { span: 3 }
|
|
|
|
|
},
|
|
|
|
|
wrapperCol: {
|
|
|
|
|
xs: { span: 24 },
|
|
|
|
|
sm: { span: 21 }
|
|
|
|
|
},
|
|
|
|
|
contractData: [],
|
|
|
|
|
orderPaymentData: [],
|
|
|
|
|
orderRefundsData: [],
|
|
|
|
|
orderShippingData: [],
|
|
|
|
|
orderReturnsData: [],
|
|
|
|
|
contactsItemData: [],
|
2024-04-02 17:32:50 +08:00
|
|
|
|
|
2024-04-03 12:00:44 +08:00
|
|
|
|
selectedDeviceRowKeys: [],
|
|
|
|
|
selectedRowKeys: [],
|
2024-03-12 16:23:34 +08:00
|
|
|
|
uploadUrl: process.env.VUE_APP_API_BASE_URL + '/api/dfs/upload',
|
2024-01-23 17:05:40 +08:00
|
|
|
|
headers: {
|
|
|
|
|
Authorization: 'Bearer ' + storage.get(ACCESS_TOKEN)
|
|
|
|
|
},
|
|
|
|
|
fileList: [],
|
|
|
|
|
previewVisible: false,
|
|
|
|
|
previewImage: '',
|
|
|
|
|
loading: false,
|
|
|
|
|
imageUrl: '',
|
2024-04-03 12:00:44 +08:00
|
|
|
|
userId: '',
|
2024-01-23 17:05:40 +08:00
|
|
|
|
// form
|
2024-03-27 16:45:22 +08:00
|
|
|
|
form: this.$form.createForm(this),
|
2024-04-02 17:32:50 +08:00
|
|
|
|
file: '',
|
|
|
|
|
visible: false,
|
2024-04-03 12:00:44 +08:00
|
|
|
|
visible1: false,
|
|
|
|
|
tenantList: [], // 地区
|
|
|
|
|
parkList: [], // 园区
|
|
|
|
|
buildingList: [], // 楼宇
|
|
|
|
|
buildingDetailList: [], // 楼层
|
|
|
|
|
roomList: [], //房间
|
|
|
|
|
tenantEnable: false,
|
|
|
|
|
parkEnable: false,
|
2024-04-04 14:14:01 +08:00
|
|
|
|
mdl: {},
|
|
|
|
|
|
2024-01-23 17:05:40 +08:00
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
filters: {
|
2024-03-27 16:45:22 +08:00
|
|
|
|
statusFilter(type) {
|
2024-01-23 17:05:40 +08:00
|
|
|
|
const statusMap = {
|
|
|
|
|
'DRAFT': '草稿',
|
|
|
|
|
'APPROVING': '待审批',
|
|
|
|
|
'APPROVED': '已审批',
|
|
|
|
|
'REFUSE': '已拒绝',
|
|
|
|
|
'EXECUTING': '执行中',
|
|
|
|
|
'VOIDED': '已作废',
|
|
|
|
|
'OVERDUE': '已到期',
|
|
|
|
|
'END': '已结束'
|
|
|
|
|
}
|
|
|
|
|
return statusMap[type]
|
|
|
|
|
}
|
|
|
|
|
},
|
2024-03-27 16:45:22 +08:00
|
|
|
|
created() {
|
2024-01-23 17:05:40 +08:00
|
|
|
|
this.id = this.$route.query.customerId
|
|
|
|
|
if (this.$route.query.types) {
|
|
|
|
|
this.defaultActiveKey = '2'
|
|
|
|
|
}
|
|
|
|
|
this.handleInit()
|
2024-04-02 17:32:50 +08:00
|
|
|
|
this.selectUserDeviceList()
|
2024-04-03 12:00:44 +08:00
|
|
|
|
// 查询地区
|
|
|
|
|
this.getTenantData()
|
2024-04-03 13:40:42 +08:00
|
|
|
|
// 获取用户详细信息
|
|
|
|
|
this.getUserDetail();
|
2024-01-23 17:05:40 +08:00
|
|
|
|
},
|
|
|
|
|
methods: {
|
2024-04-04 14:14:01 +08:00
|
|
|
|
|
2024-04-03 12:00:44 +08:00
|
|
|
|
// 获取用户详细信息
|
|
|
|
|
getUserDetail() {
|
|
|
|
|
getInfo().then(res => {
|
|
|
|
|
console.log('getUserDetail', res)
|
|
|
|
|
this.userDetail = res
|
|
|
|
|
// 园区:5
|
|
|
|
|
if (this.userDetail.roleIds && this.userDetail.roleIds.length > 0 && this.userDetail.roleIds[0] == 5) {
|
|
|
|
|
//
|
|
|
|
|
// 判断:是新增就查询园区
|
|
|
|
|
const { customerId } = this.$route.query
|
|
|
|
|
if (!customerId) {
|
|
|
|
|
// 选择地区 -> 查询园区
|
|
|
|
|
this.selectTenant(this.userDetail.tenantId)
|
|
|
|
|
// 选择园区 -> 查询楼宇
|
|
|
|
|
this.selectPark(this.userDetail.parkId)
|
|
|
|
|
}
|
|
|
|
|
//
|
|
|
|
|
// 不可编辑
|
|
|
|
|
this.tenantEnable = true
|
|
|
|
|
this.parkEnable = true
|
|
|
|
|
// 关联地区和园区
|
|
|
|
|
this.mdl.parkId = this.userDetail.parkId
|
|
|
|
|
this.mdl.tenantId = this.userDetail.tenantId
|
|
|
|
|
this.form.setFieldsValue({
|
|
|
|
|
parkId: this.mdl.parkId,
|
|
|
|
|
tenantId: this.mdl.tenantId
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
// 查询地区
|
|
|
|
|
getTenantData() {
|
|
|
|
|
getTenantList().then(res => {
|
|
|
|
|
this.tenantList = res.rows
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
// 选择地区 -> 查询园区
|
|
|
|
|
selectTenant(id) {
|
|
|
|
|
console.log('selectTenant', id)
|
|
|
|
|
// 清空数据
|
|
|
|
|
this.mdl.parkId = null // 园区
|
|
|
|
|
this.mdl.buildingId = null // 楼宇
|
|
|
|
|
this.mdl.buildingDetailIds = [] // 楼层
|
|
|
|
|
this.mdl.roomIds = [] // 所属房间
|
|
|
|
|
|
|
|
|
|
this.form.setFieldsValue({
|
|
|
|
|
parkId: null, // 园区
|
|
|
|
|
buildingId: null, // 楼宇
|
|
|
|
|
buildingDetailIds: [], // 楼层
|
|
|
|
|
roomIds: [] // 所属房间
|
|
|
|
|
})
|
|
|
|
|
// 查询园区
|
|
|
|
|
getParkList({
|
|
|
|
|
tenantId: id
|
|
|
|
|
}).then(res => {
|
|
|
|
|
this.parkList = res.rows
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
// 选择园区 -> 查询楼宇
|
|
|
|
|
selectPark(id) {
|
|
|
|
|
// 清空数据
|
|
|
|
|
this.mdl.buildingId = null // 楼宇
|
|
|
|
|
this.mdl.buildingDetailIds = [] // 楼层
|
|
|
|
|
this.mdl.roomIds = [] // 所属房间
|
|
|
|
|
|
|
|
|
|
this.form.setFieldsValue({
|
|
|
|
|
buildingId: null, // 楼宇
|
|
|
|
|
buildingDetailIds: [], // 楼层
|
|
|
|
|
roomIds: [] // 所属房间
|
|
|
|
|
})
|
|
|
|
|
// 查询楼宇
|
|
|
|
|
getBuildingList({
|
|
|
|
|
parkId: id
|
|
|
|
|
}).then(res => {
|
|
|
|
|
this.buildingList = res.rows
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
// 选择楼宇 -> 查询楼层
|
|
|
|
|
selectBuilding(id) {
|
|
|
|
|
// 清空数据
|
|
|
|
|
this.mdl.buildingDetailIds = [] // 楼层
|
|
|
|
|
this.mdl.roomIds = [] // 所属房间
|
|
|
|
|
|
|
|
|
|
this.form.setFieldsValue({
|
|
|
|
|
buildingDetailIds: [], // 楼层
|
|
|
|
|
roomIds: [] // 所属房间
|
|
|
|
|
})
|
|
|
|
|
// 查询楼层
|
|
|
|
|
getBuildingDetailList({
|
|
|
|
|
buildingId: id
|
|
|
|
|
}).then(res => {
|
|
|
|
|
this.buildingDetailList = res.rows
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
// 选择楼层 -> 查询房间
|
|
|
|
|
selectBuildingDetail(buildingDetailId) {
|
|
|
|
|
console.log('buildingDetailId', buildingDetailId)
|
|
|
|
|
// 查询房间
|
|
|
|
|
this.getRoomListByFloorIdMethod(buildingDetailId)
|
|
|
|
|
},
|
|
|
|
|
// 查询房间
|
|
|
|
|
getRoomListByFloorIdMethod(buildingDetailIds, ids) {
|
|
|
|
|
// 清空数据
|
|
|
|
|
this.mdl.roomIds = [] // 所属房间
|
|
|
|
|
|
|
|
|
|
this.form.setFieldsValue({
|
|
|
|
|
roomIds: [] // 所属房间
|
|
|
|
|
})
|
|
|
|
|
// 查询房间
|
|
|
|
|
getRoomListByBuildIdsRq({
|
|
|
|
|
'ids': ids,
|
|
|
|
|
'buildingDetailIds': buildingDetailIds,
|
|
|
|
|
'type': 0
|
|
|
|
|
}).then((res) => {
|
|
|
|
|
this.roomList = res.data
|
|
|
|
|
})
|
|
|
|
|
},
|
2024-04-02 17:32:50 +08:00
|
|
|
|
//获取设备数量
|
2024-04-03 12:00:44 +08:00
|
|
|
|
handleDeviceTable(record) {
|
2024-04-02 17:32:50 +08:00
|
|
|
|
this.visible1 = true
|
2024-04-03 12:00:44 +08:00
|
|
|
|
this.userId = record.id
|
|
|
|
|
selectEquipmentListById({ userId: record.id }).then(res => {
|
|
|
|
|
if (res.data) {
|
2024-04-02 17:32:50 +08:00
|
|
|
|
this.selectedDeviceRowKeys = res.data.map(d => d.id)
|
|
|
|
|
this.selectedRowKeys = res.data
|
2024-04-03 12:00:44 +08:00
|
|
|
|
} else {
|
2024-04-02 17:32:50 +08:00
|
|
|
|
this.selectedDeviceRowKeys = []
|
|
|
|
|
this.selectedRowKeys = []
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
//设备选中事件
|
2024-04-03 12:00:44 +08:00
|
|
|
|
onDeviceSelectChange(selectedRowKeys, selectedRows) {
|
2024-04-02 17:32:50 +08:00
|
|
|
|
this.selectedDeviceRowKeys = selectedRowKeys
|
|
|
|
|
this.selectedRowKeys = selectedRows
|
|
|
|
|
|
|
|
|
|
},
|
2024-04-03 12:00:44 +08:00
|
|
|
|
itemHandleOk() {
|
2024-04-02 17:32:50 +08:00
|
|
|
|
saveUserEquipment(
|
|
|
|
|
{
|
2024-04-03 12:00:44 +08:00
|
|
|
|
userId: this.userId,
|
|
|
|
|
userIds: this.selectedDeviceRowKeys
|
2024-04-02 17:32:50 +08:00
|
|
|
|
}
|
2024-04-03 12:00:44 +08:00
|
|
|
|
).then(res => {
|
2024-04-03 14:16:01 +08:00
|
|
|
|
this.getContastsList()
|
2024-04-03 12:00:44 +08:00
|
|
|
|
this.visible1 = false
|
2024-04-02 17:32:50 +08:00
|
|
|
|
this.$message.success(res.msg)
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
//获取所有设备
|
2024-04-03 12:00:44 +08:00
|
|
|
|
selectUserDeviceList() {
|
|
|
|
|
selectUserDeviceList().then(res => {
|
2024-04-02 17:32:50 +08:00
|
|
|
|
this.deviceData = res.data
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
exportTemplate() {
|
2024-04-04 14:14:01 +08:00
|
|
|
|
const baseURL = process.env.VUE_APP_API_BASE_URL
|
|
|
|
|
window.open(`${baseURL}/admin/staff/exportTemplate`)
|
2024-04-02 13:43:54 +08:00
|
|
|
|
},
|
2024-04-04 14:14:01 +08:00
|
|
|
|
// downloadFile(data) {
|
|
|
|
|
// let fileName = '客户导入模板'
|
|
|
|
|
//
|
|
|
|
|
// let link = document.createElement('a')
|
|
|
|
|
// let blob = new Blob([data], { type: 'application/vnd.ms-excel;charset=utf-8' })
|
|
|
|
|
// console.log(blob)
|
|
|
|
|
// link.style.display = 'none'
|
|
|
|
|
// link.download = fileName + '.xlsx'
|
|
|
|
|
// link.href = URL.createObjectURL(blob)
|
|
|
|
|
// // link.setAttribute('download', fileName+'.xlsx');
|
|
|
|
|
// document.body.appendChild(link)
|
|
|
|
|
// link.click()
|
|
|
|
|
// URL.revokeObjectURL(link.href) // 释放URL 对象
|
|
|
|
|
// document.body.removeChild(link)
|
|
|
|
|
// },
|
2024-04-02 13:43:54 +08:00
|
|
|
|
|
2024-04-02 08:49:14 +08:00
|
|
|
|
|
2024-04-02 17:32:50 +08:00
|
|
|
|
customRequest(file) {
|
2024-04-02 08:49:14 +08:00
|
|
|
|
// file 是上传的文件 其内容会在放在下面截图中
|
|
|
|
|
// 后端需要接受的参数是 formData数据,
|
|
|
|
|
// uploadFile 我自己的接口
|
2024-04-02 13:43:54 +08:00
|
|
|
|
|
|
|
|
|
const formData = new FormData()
|
|
|
|
|
formData.append('file', file.file)
|
2024-04-02 08:49:14 +08:00
|
|
|
|
console.log(file)
|
2024-04-02 13:43:54 +08:00
|
|
|
|
importData(formData).then(res => {
|
|
|
|
|
if (res.code == 0) {
|
2024-04-02 08:49:14 +08:00
|
|
|
|
// 调用组件内方法, 设置为成功状态
|
|
|
|
|
file.onSuccess(res, file.file)
|
|
|
|
|
file.status = 'done'
|
2024-04-02 17:32:50 +08:00
|
|
|
|
this.visible = false
|
2024-04-02 13:43:54 +08:00
|
|
|
|
this.$message.success(res.msg)
|
2024-04-02 08:49:14 +08:00
|
|
|
|
} else {
|
|
|
|
|
file.onError()
|
|
|
|
|
file.status = 'error'
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
|
2024-04-02 17:32:50 +08:00
|
|
|
|
handleFileChange(info) {
|
2024-04-02 08:49:14 +08:00
|
|
|
|
this.fileList = info.fileList
|
|
|
|
|
|
|
|
|
|
if (info.file.status === 'done') {
|
|
|
|
|
const result = info.file.response
|
2024-04-02 17:32:50 +08:00
|
|
|
|
this.file = info.file.response
|
2024-04-02 08:49:14 +08:00
|
|
|
|
this.fileName = result.fileName
|
|
|
|
|
}
|
2024-04-02 13:43:54 +08:00
|
|
|
|
},
|
2024-04-02 17:32:50 +08:00
|
|
|
|
customChange() {
|
2024-04-02 13:43:54 +08:00
|
|
|
|
|
2024-04-02 08:49:14 +08:00
|
|
|
|
},
|
|
|
|
|
//导入用户数据
|
2024-04-02 17:32:50 +08:00
|
|
|
|
importUser() {
|
2024-04-02 08:49:14 +08:00
|
|
|
|
this.visible = true
|
|
|
|
|
},
|
2024-04-02 17:32:50 +08:00
|
|
|
|
handleFileOk() {
|
2024-04-02 08:49:14 +08:00
|
|
|
|
console.log(this.file)
|
2024-04-02 17:32:50 +08:00
|
|
|
|
importData({ file: this.file }).then(res => {
|
2024-04-02 08:49:14 +08:00
|
|
|
|
console.log(res)
|
|
|
|
|
})
|
|
|
|
|
},
|
2024-03-27 16:45:22 +08:00
|
|
|
|
handleDetail(id) {
|
|
|
|
|
this.$router.push({
|
|
|
|
|
name: 'customerContractDetailModal',
|
|
|
|
|
query: { id: id, customerId: this.$route.query.customerId, url: 'customerEdit' }
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
navContract(e) {
|
2024-01-23 17:05:40 +08:00
|
|
|
|
this.$router.push({ name: 'customerContractEdit', query: { customerId: this.id, url: 'customerEdit' } })
|
|
|
|
|
},
|
2024-03-27 16:45:22 +08:00
|
|
|
|
onChangeBlacklist(checked) {
|
2024-04-03 12:00:44 +08:00
|
|
|
|
this.mdl.isBlacklist = checked
|
2024-01-23 17:05:40 +08:00
|
|
|
|
},
|
2024-03-27 16:45:22 +08:00
|
|
|
|
getQiXinBasicInfo() {
|
2024-01-23 17:05:40 +08:00
|
|
|
|
var keyword = this.form.getFieldValue('creditNo')
|
|
|
|
|
getQiXinBasicInfo({ 'keyword': keyword }).then(res => {
|
|
|
|
|
if (res.code === 0) {
|
|
|
|
|
var qiXinResult = JSON.parse(res.data)
|
|
|
|
|
if (!(isNaN(qiXinResult) && !isNaN(Date.parse(qiXinResult.endDate)))) {
|
|
|
|
|
qiXinResult.endDate = null
|
|
|
|
|
}
|
|
|
|
|
this.form.setFieldsValue(pick(qiXinResult, 'creditNo', 'regNo', 'status', 'orgNo', 'operName', 'econKind', 'startDate', 'registCapi', 'endDate', 'address', 'scope', 'delFlag', 'belongOrg', 'remark'))
|
|
|
|
|
} else {
|
|
|
|
|
this.$message.error('同步工商信息失败:' + res.msg)
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
},
|
2024-03-27 16:45:22 +08:00
|
|
|
|
handleInit() {
|
2024-01-23 17:05:40 +08:00
|
|
|
|
const { customerId } = this.$route.query
|
|
|
|
|
if (customerId) {
|
|
|
|
|
getCustomer(customerId).then(res => {
|
2024-04-03 12:00:44 +08:00
|
|
|
|
this.mdl = Object.assign(this.mdl, res)
|
|
|
|
|
let copyMdl = JSON.parse(JSON.stringify(this.mdl))
|
2024-01-23 17:05:40 +08:00
|
|
|
|
// 头像
|
2024-04-03 12:00:44 +08:00
|
|
|
|
if (this.mdl.headImg) {
|
|
|
|
|
this.imageUrl = process.env.VUE_APP_API_BASE_URL + this.mdl.headImg
|
2024-01-23 17:05:40 +08:00
|
|
|
|
}
|
|
|
|
|
// 照片墙
|
2024-04-03 12:00:44 +08:00
|
|
|
|
this.mdl.bannerImages.forEach((item, i) => {
|
2024-01-23 17:05:40 +08:00
|
|
|
|
item.url = process.env.VUE_APP_API_BASE_URL + item.url
|
|
|
|
|
})
|
2024-04-03 12:00:44 +08:00
|
|
|
|
this.fileList = this.mdl.bannerImages
|
|
|
|
|
// 选择地区 -> 查询园区
|
|
|
|
|
if (copyMdl.tenantId) {
|
|
|
|
|
this.mdl = JSON.parse(JSON.stringify(copyMdl))
|
|
|
|
|
this.selectTenant(copyMdl.tenantId)
|
|
|
|
|
}
|
|
|
|
|
// 选择园区 -> 查询楼宇
|
|
|
|
|
if (copyMdl.parkId) {
|
|
|
|
|
this.mdl = JSON.parse(JSON.stringify(copyMdl))
|
|
|
|
|
this.selectPark(copyMdl.parkId)
|
|
|
|
|
}
|
|
|
|
|
// 选择楼宇 -> 查询楼层
|
|
|
|
|
if (copyMdl.buildingId) {
|
|
|
|
|
this.mdl = JSON.parse(JSON.stringify(copyMdl))
|
|
|
|
|
this.selectBuilding(copyMdl.buildingId)
|
|
|
|
|
}
|
|
|
|
|
// 选择楼层 -> 查询房间
|
|
|
|
|
if (copyMdl.buildingDetailIds) {
|
|
|
|
|
this.mdl = JSON.parse(JSON.stringify(copyMdl))
|
|
|
|
|
this.getRoomListByFloorIdMethod(copyMdl.buildingDetailIds, copyMdl.roomIds)
|
|
|
|
|
}
|
|
|
|
|
// 防止替换
|
|
|
|
|
this.mdl = JSON.parse(JSON.stringify(copyMdl))
|
|
|
|
|
//
|
|
|
|
|
this.form.setFieldsValue(pick(this.mdl, 'id', 'name', 'shortName', 'type', 'customerStatus',
|
|
|
|
|
'sector', 'country', 'process', 'contacts', 'phone', 'email', 'creditNo', 'mailAddress',
|
|
|
|
|
'postalCode', 'channelType', 'channelName', 'isBlacklist', 'regNo', 'status', 'orgNo',
|
|
|
|
|
'operName', 'econKind', 'startDate', 'registCapi', 'endDate',
|
|
|
|
|
'address', 'scope', 'delFlag', 'belongOrg', 'remark', 'headImg', 'bannerImages',
|
|
|
|
|
'roomId', 'buildId', 'roomIds', 'buildingDetailIds', 'tenantId', 'parkId',
|
|
|
|
|
'buildingId'))
|
|
|
|
|
//
|
2024-01-23 17:05:40 +08:00
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
this.getContastsList()
|
|
|
|
|
this.getContractList()
|
|
|
|
|
},
|
2024-03-27 16:45:22 +08:00
|
|
|
|
onChange(date, dateString) {
|
2024-01-23 17:05:40 +08:00
|
|
|
|
console.log(date, dateString)
|
|
|
|
|
},
|
|
|
|
|
// handler
|
2024-03-27 16:45:22 +08:00
|
|
|
|
handleSubmit(e) {
|
2024-01-23 17:05:40 +08:00
|
|
|
|
e.preventDefault()
|
|
|
|
|
this.form.validateFields((err, values) => {
|
|
|
|
|
if (!err) {
|
|
|
|
|
// eslint-disable-next-line no-console
|
|
|
|
|
const bannerImages = []
|
|
|
|
|
this.fileList.forEach((file, index) => {
|
|
|
|
|
// 添加原来的
|
|
|
|
|
if (file.hasOwnProperty('name') && file.hasOwnProperty('url') && file.hasOwnProperty('uid')) {
|
|
|
|
|
bannerImages.push({ 'name': file.name, 'url': file.name, 'uid': index })
|
|
|
|
|
}
|
|
|
|
|
if (file.status === 'done' && file.response.code === 0) {
|
|
|
|
|
const data = file.response
|
|
|
|
|
bannerImages.push({ 'name': data.fileName, 'url': data.fileName, 'uid': index })
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
// 照片墙
|
|
|
|
|
values.bannerImages = bannerImages
|
|
|
|
|
console.log('Received values of form: ', values)
|
2024-03-28 16:28:05 +08:00
|
|
|
|
// values.startDate = moment(values.startDate).format('YYYY-MM-DD')
|
|
|
|
|
// console.log(values.startDate)
|
2024-01-23 17:05:40 +08:00
|
|
|
|
this.confirmLoading = true
|
|
|
|
|
saveCustomer(values).then(res => {
|
|
|
|
|
if (res.code === 0) {
|
|
|
|
|
this.$message.success('保存成功')
|
|
|
|
|
this.$emit('ok')
|
|
|
|
|
this.visible = false
|
|
|
|
|
this.rollback()
|
|
|
|
|
} else {
|
|
|
|
|
this.$message.error(res.msg)
|
|
|
|
|
}
|
|
|
|
|
}).catch(() => {
|
|
|
|
|
this.$message.error('系统错误,请稍后再试')
|
|
|
|
|
}).finally(() => {
|
|
|
|
|
this.confirmLoading = false
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
},
|
2024-03-27 16:45:22 +08:00
|
|
|
|
rollback() {
|
2024-01-23 17:05:40 +08:00
|
|
|
|
this.$router.push('/admin/service/customer')
|
|
|
|
|
},
|
|
|
|
|
// 联系人列表
|
2024-03-27 16:45:22 +08:00
|
|
|
|
getContastsList() {
|
2024-03-24 16:50:05 +08:00
|
|
|
|
let param = {
|
|
|
|
|
customerId: this.$route.query.customerId
|
|
|
|
|
}
|
2024-04-01 18:09:33 +08:00
|
|
|
|
selectCustomerStaffList(param).then(res => {
|
2024-03-27 16:45:22 +08:00
|
|
|
|
this.contactsItemData = res.rows
|
2024-01-23 17:05:40 +08:00
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
// 合同列表
|
2024-03-27 16:45:22 +08:00
|
|
|
|
getContractList() {
|
2024-01-23 17:05:40 +08:00
|
|
|
|
getCustomerContractList({ customerId: this.$route.query.customerId }).then(res => {
|
|
|
|
|
// console.log(res)
|
|
|
|
|
if (res.code === 0) {
|
|
|
|
|
this.contractData = res.rows
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
// 新增联系人回调
|
2024-03-27 16:45:22 +08:00
|
|
|
|
handleContactSaved() {
|
2024-01-23 17:05:40 +08:00
|
|
|
|
this.getContastsList()
|
|
|
|
|
},
|
|
|
|
|
// 删除联系人
|
2024-03-27 16:45:22 +08:00
|
|
|
|
handleDeleteContact(contactInfo) {
|
2024-03-28 15:06:49 +08:00
|
|
|
|
console.log(contactInfo)
|
2024-04-09 10:03:41 +08:00
|
|
|
|
contactInfo.icsCustomerId = this.$route.query.customerId
|
2024-03-28 15:06:49 +08:00
|
|
|
|
// contactInfo.
|
|
|
|
|
updateStaffByCustomer(contactInfo).then(res => {
|
2024-01-23 17:05:40 +08:00
|
|
|
|
if (res.code === 0) {
|
|
|
|
|
this.$message.success('删除成功')
|
|
|
|
|
this.deleteVisible = false
|
|
|
|
|
this.getContastsList()
|
|
|
|
|
} else {
|
|
|
|
|
this.$message.error(res.msg)
|
|
|
|
|
}
|
|
|
|
|
}).catch(() => {
|
|
|
|
|
this.$message.error('系统错误,请稍后再试')
|
|
|
|
|
}).finally(() => {
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
|
2024-03-27 16:45:22 +08:00
|
|
|
|
beforeUpload(file) {
|
2024-01-23 17:05:40 +08:00
|
|
|
|
const isJpgOrPng = file.type === 'image/jpeg' || file.type === 'image/png'
|
|
|
|
|
if (!isJpgOrPng) {
|
|
|
|
|
this.$message.error('You can only upload JPG file!')
|
|
|
|
|
}
|
|
|
|
|
const isLt2M = file.size / 1024 / 1024 < 2
|
|
|
|
|
if (!isLt2M) {
|
|
|
|
|
this.$message.error('图片必须小于 2MB!')
|
|
|
|
|
}
|
|
|
|
|
return isJpgOrPng && isLt2M
|
|
|
|
|
},
|
2024-03-27 16:45:22 +08:00
|
|
|
|
handleChange(info) {
|
2024-01-23 17:05:40 +08:00
|
|
|
|
if (info.file.status === 'uploading') {
|
|
|
|
|
this.loading = true
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
if (info.file.status === 'done') {
|
|
|
|
|
const { form: { setFieldsValue } } = this
|
|
|
|
|
const result = info.file.response
|
|
|
|
|
// 设置值
|
|
|
|
|
this.$nextTick(() => {
|
|
|
|
|
setFieldsValue({
|
|
|
|
|
headImg: result.fileName
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
// Get this url from response in real world.
|
|
|
|
|
getBase64(info.file.originFileObj, imageUrl => {
|
|
|
|
|
this.imageUrl = imageUrl
|
|
|
|
|
this.loading = false
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
},
|
2024-03-27 16:45:22 +08:00
|
|
|
|
async handlePreview(file) {
|
2024-01-23 17:05:40 +08:00
|
|
|
|
if (!file.url && !file.preview) {
|
|
|
|
|
file.preview = await getBase64FileList(file.originFileObj)
|
|
|
|
|
}
|
|
|
|
|
this.previewImage = file.url || file.preview
|
|
|
|
|
this.previewVisible = true
|
|
|
|
|
},
|
2024-03-27 16:45:22 +08:00
|
|
|
|
handleCancel() {
|
2024-01-23 17:05:40 +08:00
|
|
|
|
this.previewVisible = false
|
|
|
|
|
},
|
|
|
|
|
// 上传照片墙
|
2024-03-27 16:45:22 +08:00
|
|
|
|
handleChangeFileList({ fileList }) {
|
2024-01-23 17:05:40 +08:00
|
|
|
|
this.fileList = fileList
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 上传头像
|
2024-03-27 16:45:22 +08:00
|
|
|
|
function getBase64(img, callback) {
|
2024-01-23 17:05:40 +08:00
|
|
|
|
const reader = new FileReader()
|
|
|
|
|
reader.addEventListener('load', () => callback(reader.result))
|
|
|
|
|
reader.readAsDataURL(img)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 上传照片墙
|
2024-03-27 16:45:22 +08:00
|
|
|
|
function getBase64FileList(file) {
|
2024-01-23 17:05:40 +08:00
|
|
|
|
return new Promise((resolve, reject) => {
|
|
|
|
|
const reader = new FileReader()
|
|
|
|
|
reader.readAsDataURL(file)
|
|
|
|
|
reader.onload = () => resolve(reader.result)
|
|
|
|
|
reader.onerror = error => reject(error)
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<style>
|
2024-03-27 16:45:22 +08:00
|
|
|
|
.avatar-uploader > .ant-upload {
|
|
|
|
|
width: 102px;
|
|
|
|
|
height: 102px;
|
|
|
|
|
}
|
2024-01-23 17:05:40 +08:00
|
|
|
|
|
2024-03-27 16:45:22 +08:00
|
|
|
|
.ant-upload-select-picture-card i {
|
|
|
|
|
font-size: 32px;
|
|
|
|
|
color: #999;
|
|
|
|
|
}
|
2024-01-23 17:05:40 +08:00
|
|
|
|
|
2024-03-27 16:45:22 +08:00
|
|
|
|
.ant-upload-select-picture-card .ant-upload-text {
|
|
|
|
|
margin-top: 8px;
|
|
|
|
|
color: #666;
|
|
|
|
|
}
|
2024-01-23 17:05:40 +08:00
|
|
|
|
</style>
|