You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

1320 lines
50 KiB

<template>
<div class="app-container">
<div class="tab-header webtop">
<div>{{ viewTitle }}</div>
<div>
<el-button type="primary" size="medium" @click="handleCreate()">保存</el-button>
<el-button type="primary" size="medium">提交</el-button>
<el-button type="info" size="medium" @click="handleReturn()">关闭</el-button>
</div>
</div>
<div class="listconadd">
<el-form ref="dataForm" :model="temp" label-position="right" class="formadd" :rules="rules">
<div class="title">基本信息</div>
<el-row style="border-top: 1px solid #DFE6EC">
<el-col :span="4" class="tleftb">
<span><span style="color: red">*</span>所属经销商</span>
</el-col>
<el-col :span="20">
<el-form-item prop="pDistributorName">
<el-select v-model="temp.pDistributorName" style="width: 30%" placeholder="请选择" @change="pDistributorSidChange" clearable>
<el-option v-for="item in pDistributorSid_list" :key="item.sid" :label="item.disName" :value="item.disName"/>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="4" class="tleftb">
<span><span style="color: red">*</span>经销商名称</span>
</el-col>
<el-col :span="8">
<el-form-item prop="disName">
<el-input v-model="temp.disName" maxlength="125" placeholder="" class="addinputw" clearable/>
</el-form-item>
</el-col>
<el-col :span="4" class="tleftb">
<span>统一社会信用代码</span>
</el-col>
<el-col :span="8">
<el-form-item>
<el-input v-model="temp.registNum" maxlength="125" placeholder="请填写统一社会信用代码" class="addinputw" clearable/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="4" class="tleftb">
<span><span style="color: red">*</span>注册地址</span>
</el-col>
<el-col :span="20"> <!--@change="getShen" @change="getShen" @change="getQu"-->
<el-form-item prop="registDetailAddress">
<!-- <el-select v-model="registProvinceSid" filterable placeholder="请选择省" class="filter-item" style="width:12%"-->
<!-- @change="getShen">-->
<!-- <el-option v-for="item in inputProvinceList" :key="item.sid" :label="item.name" :value="item.sid"/>-->
<!-- </el-select>-->
<!-- <el-select v-model="registcitySid" filterable placeholder="请选择市" class="filter-item" style="width:12%"-->
<!-- @change="getShi">-->
<!-- <el-option v-for="item in inputCityList" :key="item.sid" :label="item.name" :value="item.sid"/>-->
<!-- </el-select>-->
<!-- <el-select v-model="registcountSid" filterable placeholder="请选择县" class="filter-item" style="width:12%"-->
<!-- @change="getQu">-->
<!-- <el-option v-for="item in inputCountyList" :key="item.sid" :label="item.name" :value="item.sid"/>-->
<!-- </el-select>-->
<el-input v-model="temp.registDetailAddress" maxlength="125" placeholder="请填写详细地址" style="width:63%" clearable/> <!-- temp.registDetailAddress -->
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="4" class="tleftb">
<span>实际经营地址</span>
</el-col>
<el-col :span="20">
<el-form-item prop="">
<el-select v-model="managementProvinceCode" filterable placeholder="请选择省" class="filter-item" style="width: 12%" @change="getSheng02">
<el-option v-for="item in inputProvinceList02" :key="item.sid" :label="item.name" :value="item.districtCode"/>
</el-select>
<el-select v-model="managementcityCode" filterable placeholder="请选择市" class="filter-item" style="width: 12%" @change="getShi02">
<el-option v-for="item in inputCityList02" :key="item.sid" :label="item.name" :value="item.districtCode"/>
</el-select>
<el-select v-model="managementcountCode" filterable placeholder="请选择县" class="filter-item" style="width: 12%" @change="getQu02">
<el-option v-for="item in inputCountyList02" :key="item.sid" :label="item.name" :value="item.districtCode"/>
</el-select>
<el-input v-model="temp.managementDetailAddress" maxlength="125" placeholder="请填写详细地址" style="width:63%" clearable/> <!-- temp.managementDetailAddress -->
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="4" class="tleftb">
<span>成立日期</span>
</el-col>
<el-col :span="4">
<el-form-item prop="setUpTime">
<el-date-picker
class="addinputw"
v-model="temp.setUpTime"
type="date"
value-format="yyyy-MM-dd"
placeholder="选择日期"
:picker-options="pickerOptions"
>
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="4" class="tleftb">
<span>开始合作日期</span>
</el-col>
<el-col :span="4">
<el-form-item prop="startCoopDate">
<el-date-picker
class="addinputw"
v-model="temp.startCoopDate"
type="date"
value-format="yyyy-MM-dd"
placeholder="选择日期"
>
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="4" class="tleftb">
<span>是否担保</span>
</el-col>
<el-col :span="4">
<el-form-item prop="isGuarantee">
<el-radio v-model="temp.isGuarantee" label="1">是</el-radio>
<el-radio v-model="temp.isGuarantee" label="0">否</el-radio>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="4" class="tleftb">
<span><span style="color: red">*</span>实际控制人</span>
</el-col>
<el-col :span="4">
<el-form-item prop="legalName">
<el-input v-model="temp.legalName" maxlength="125" placeholder="" class="addinputw" clearable/>
</el-form-item>
</el-col>
<el-col :span="4" class="tleftb">
<span>身份证号码</span>
</el-col>
<el-col :span="4">
<el-form-item>
<el-input v-model="temp.legalIdCard" maxlength="125" placeholder="" class="addinputw" clearable/>
</el-form-item>
</el-col>
<el-col :span="4" class="tleftb">
<span><span style="color: red">*</span>手机号码</span>
</el-col>
<el-col :span="4">
<el-form-item prop="legalMobile">
<el-input v-model="temp.legalMobile" maxlength="125" placeholder="" class="addinputw" clearable/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="4" class="tleftb">
<span>企业联系人</span>
</el-col>
<el-col :span="4">
<el-form-item prop="contract">
<el-input v-model="temp.contract" maxlength="125" placeholder="" class="addinputw" clearable/>
</el-form-item>
</el-col>
<el-col :span="4" class="tleftb">
<span>手机号码</span>
</el-col>
<el-col :span="4">
<el-form-item prop="mobile">
<el-input v-model="temp.mobile" maxlength="125" placeholder="" class="addinputw" clearable/>
</el-form-item>
</el-col>
<el-col :span="4" class="tleftb"/>
<el-col :span="4"/>
</el-row>
<div class="title">开票信息</div>
<el-row>
<el-col :span="4" class="tleftb">
<span>单位名称</span>
</el-col>
<el-col :span="8">
<el-form-item>
{{ temp.disName }}
<!-- <el-input v-model="" readonly maxlength="125" placeholder="" class="addinputw" />-->
</el-form-item>
</el-col>
<el-col :span="4" class="tleftb">
<span>税号</span>
</el-col>
<el-col :span="8">
<el-form-item>
<span>{{ temp.registNum }}</span>
</el-form-item>
<!-- <el-input v-model="" readonly maxlength="125" placeholder="" class="addinputw" />-->
</el-col>
</el-row>
<el-row>
<el-col :span="4" class="tleftb">
<span>地址</span>
</el-col>
<el-col :span="8">
<el-form-item prop="">
<span>{{ temp.registDetailAddress }}</span>
<!-- <span>{{ registProvince + registcity + registcount + temp.registDetailAddress}}</span>-->
<!-- <el-input v-model="" readonly maxlength="125" placeholder="" class="addinputw"/>-->
</el-form-item>
</el-col>
<el-col :span="4" class="tleftb">
<span><span style="color: red">*</span>联系电话</span>
</el-col>
<el-col :span="8">
<el-form-item prop="invoPhone">
<el-input v-model="temp.invoPhone" maxlength="125" placeholder="" class="addinputw" clearable/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="4" class="tleftb">
<span><span style="color: red">*</span>开户行</span>
</el-col>
<el-col :span="8">
<el-form-item prop="invoBank">
<el-input v-model="temp.invoBank" maxlength="125" placeholder="" class="addinputw" clearable/>
</el-form-item>
</el-col>
<el-col :span="4" class="tleftb">
<span><span style="color: red">*</span>银行账号</span>
</el-col>
<el-col :span="8">
<el-form-item prop="invoBankNum">
<el-input v-model="temp.invoBankNum" maxlength="125" placeholder="" class="addinputw" clearable/>
</el-form-item>
</el-col>
</el-row>
<div class="titcon">
<div class="title">人员列表</div>
<div class="baocun">
<el-button type="primary" size="small" icon="el-icon-plus" class="btntopblueline" @click="addRenyuan()">新增
</el-button>
</div>
</div>
<el-table :key="tableKey" v-loading="listLoading" :data="list" :index="index" border style="width: 100%">
<el-table-column fixed width="80px" label="序号" type="index" :index="index + 1" align="center"/>
<el-table-column label="操作" align="center" width="250px" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button size="mini" type="danger" @click="handleCheck(list[scope.$index])">删除</el-button>
</template>
</el-table-column>
<el-table-column label="姓名" align="center">
<template slot-scope="scope">
<el-input v-model="scope.row.name" maxlength="125" placeholder="" class="addinputw" clearable/>
</template>
</el-table-column>
<el-table-column label="身份" align="center">
<template slot-scope="scope">
<el-select v-model="scope.row.identityKey" class="addinputw" placeholder="请选择身份" @change="identityChange(scope.row,scope.row.identityKey)" clearable>
<el-option v-for="item in identity_list" :key="item.dictKey" :label="item.dictValue" :value="item.dictKey"/>
</el-select>
</template>
</el-table-column>
<el-table-column label="手机号码" align="center">
<template slot-scope="scope" prop="mobile">
<el-input v-model="scope.row.mobile" maxlength="125" placeholder="" class="addinputw" clearable/>
</template>
</el-table-column>
<el-table-column label="备注" align="center">
<template slot-scope="scope">
<el-input v-model="scope.row.remarks" maxlength="125" placeholder="" class="addinputw" clearable/>
</template>
</el-table-column>
</el-table>
<div class="title">附件清单</div>
<div class="headline">
<div style="margin-left: 5px;font-weight: bold">营业执照</div>
<div>
<multifileUpload :accept="accept" ref="divUpload" :reminder="false" :showfile="false" @handleSuccess="filesAdd($event, '0001')" @handleRemove="filesRemove"/>
</div>
</div>
<el-table :key="businessLicenseKey" :data="list1" border style="width: 100%">
<el-table-column label="操作" align="center">
<template slot-scope="scope">
<div class="balanceStyle">
<el-button type="primary" size="small" @click="handLook(scope.row)">查看</el-button>
<el-button type="danger" size="small" @click="handDelete(scope.row, '0001')">删除</el-button>
</div>
</template>
</el-table-column>
<el-table-column label="文件名" align="center">
<template slot-scope="scope">
<span>{{ scope.row.fileName }}</span>
</template>
</el-table-column>
<el-table-column label="文件类型" align="center">
<template slot-scope="scope">
<span>{{ scope.row.fileType }}</span>
</template>
</el-table-column>
<el-table-column label="上传人" align="center">
<template slot-scope="scope">
<span>{{ scope.row.name }}</span>
</template>
</el-table-column>
<el-table-column label="上传时间" align="center">
<template slot-scope="scope">
<span>{{ scope.row.createTime }}</span>
</template>
</el-table-column>
</el-table>
<div class="headline">
<div style="margin-left: 5px;font-weight: bold">道路运输许可证</div>
<div>
<multifileUpload :accept="accept" ref="divUpload" :reminder="false" :showfile="false" @handleSuccess="filesAdd($event, '0002')" @handleRemove="filesRemove"/>
</div>
</div>
<el-table :key="roadTransportKey" :data="list2" border style="width: 100%">
<el-table-column label="操作" align="center">
<template slot-scope="scope">
<div class="balanceStyle">
<el-button type="primary" size="small" @click="handLook(scope.row)">查看</el-button>
<el-button type="danger" size="small" @click="handDelete(scope.row, '0002')">删除</el-button>
</div>
</template>
</el-table-column>
<el-table-column label="文件名" align="center">
<template slot-scope="scope">
<span>{{ scope.row.fileName }}</span>
</template>
</el-table-column>
<el-table-column label="文件类型" align="center">
<template slot-scope="scope">
<span>{{ scope.row.fileType }}</span>
</template>
</el-table-column>
<el-table-column label="上传人" align="center">
<template slot-scope="scope">
<span>{{ scope.row.name }}</span>
</template>
</el-table-column>
<el-table-column label="上传时间" align="center">
<template slot-scope="scope">
<span>{{ scope.row.createTime }}</span>
</template>
</el-table-column>
</el-table>
<div class="headline">
<div style="margin-left: 5px;font-weight: bold">法人身份证</div>
<div>
<multifileUpload :accept="accept" ref="divUpload" :reminder="false" :showfile="false" @handleSuccess="filesAdd($event, '0003')" @handleRemove="filesRemove"/>
</div>
</div>
<el-table :key="corporateIdentityCardKey" :data="list3" border style="width: 100%">
<el-table-column label="操作" align="center">
<template slot-scope="scope">
<div class="balanceStyle">
<el-button type="primary" size="small" @click="handLook(scope.row)">查看</el-button>
<el-button type="danger" size="small" @click="handDelete(scope.row, '0003')">删除</el-button>
</div>
</template>
</el-table-column>
<el-table-column label="文件名" align="center">
<template slot-scope="scope">
<span>{{ scope.row.fileName }}</span>
</template>
</el-table-column>
<el-table-column label="文件类型" align="center">
<template slot-scope="scope">
<span>{{ scope.row.fileType }}</span>
</template>
</el-table-column>
<el-table-column label="上传人" align="center">
<template slot-scope="scope">
<span>{{ scope.row.name }}</span>
</template>
</el-table-column>
<el-table-column label="上传时间" align="center">
<template slot-scope="scope">
<span>{{ scope.row.createTime }}</span>
</template>
</el-table-column>
</el-table>
<div class="headline">
<div style="margin-left: 5px;font-weight: bold">其他资料</div>
<div>
<multifileUpload :accept="accept" ref="divUpload" :reminder="false" :showfile="false" @handleSuccess="filesAdd($event, '0004')" @handleRemove="filesRemove"/>
</div>
</div>
<el-table :key="otherDetailsKey" :data="list4" border style="width: 100%">
<el-table-column label="操作" align="center">
<template slot-scope="scope">
<div class="balanceStyle">
<el-button type="primary" size="small" @click="handLook(scope.row)">查看</el-button>
<!-- <el-link :href="scope.row.filePath" target="_blank" type="primary">-->
<!-- <el-button type="primary" size="small">查看</el-button>-->
<!-- </el-link>-->
<el-button type="danger" size="small" @click="handDelete(scope.row, '0004')">删除</el-button>
</div>
</template>
</el-table-column>
<el-table-column label="文件名" align="center">
<template slot-scope="scope">
<span>{{ scope.row.fileName }}</span>
</template>
</el-table-column>
<el-table-column label="文件类型" align="center">
<template slot-scope="scope">
<span>{{ scope.row.fileType }}</span>
</template>
</el-table-column>
<el-table-column label="上传人" align="center">
<template slot-scope="scope">
<span>{{ scope.row.name }}</span>
</template>
</el-table-column>
<el-table-column label="上传时间" align="center">
<template slot-scope="scope">
<span>{{ scope.row.createTime }}</span>
</template>
</el-table-column>
</el-table>
</el-form>
</div>
<el-dialog :visible="dialogVisible" append-to-body :before-close="handColse">
<img width="100%" :src="dialogImageUrl" alt=""/>
</el-dialog>
</div>
</template>
<script>
import { details, getOneLevelList, SaveList, Update } from '@/api/jichuxinxi/baseaffiliatcompany'
import { getCity, getCounty, getProvince } from '@/api/portal/areaPicker' // 省市区
import { selectListOrg } from '@/api/jichuxinxi/basemanufacturer'
import { typeValues } from '@/api/jichuxinxi/dictcommons'
import { deleteFilesOss } from '@/api/jichuxinxi/baseaffiliatcompany.js'
import multifileUpload from '@/components/uploadFile/multifileUpload.vue'
import { getUseOrgByUserSid } from '@/api/jichuxinxi/brandManagement'
export default {
name: 'GuakaogongsiAdd',
components: {
multifileUpload
},
data() {
var validCascader = (rule, value, callback) => {
if (this.useOrgArry.length === 0) {
callback(new Error('请填写使用组织'))
} else {
callback()
}
}
var checkSubmit = (rule, value, callback) => {
const Submit = /^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\d{8}$/
if (Submit.test(value)) {
return callback()
}
callback(new Error('请输入正确的手机号'))
}
var checkIDcard = (rule, value, callback) => {
const Submit = /^[1-9]\d{5}[1-9]\d{3}((0[1-9])|(1[0-2]))((0[1-9])|([1-2][0-9])|(3[0-1]))\d{3}(\d|x|X)$/
if (Submit.test(value)) {
return callback()
}
callback(new Error('请输入正确的身份证号'))
}
var checkKaipiaoDianhua = (rule, value, callback) => {
const BanGongDianHua = /\d{3}-\d{8}|\d{4}-\d{7}/
if (BanGongDianHua.test(value)) {
return callback()
}
callback(new Error('请输入单位开票信息联系电话'))
}
return {
pickerOptions: {
disabledDate(time) {
return time.getTime() > Date.now()
}
},
disabled: true,
list: [], // 人员列表
list1: [], // 营业执照
list2: [], // 道路运输许可证
list3: [], // 法人身份证
list4: [], // 其他资料
// perList: [], //人员list
// yyzzList: [], //营业执照附件list
// dlysxkzList: [], //道路运输许可证附件list// 数据传输对象
// frsfzList: [], //法人身份证附件list//数据传输对象
// qtzlList: [], //其他资料附件list array
FormLoading: false,
tableKey: 0,
businessLicenseKey: 1,
roadTransportKey: 2,
corporateIdentityCardKey: 3,
otherDetailsKey: 4,
listLoading: false,
index: 0,
accept: '.jpg,.jpeg,.png,.JPG,.JPEG,.PNG',
registDetailAddress: '', // 注册地址详细
managementAll: '', // 经营地址详细
registProvince: '', // 注册省name
registcity: '', // 注册市
registcount: '', // 注册县
registProvinceSid: '', // 注册省sid
registcitySid: '', // 注册市
registcountSid: '', // 注册县
managementProvince: '', // 经营省
managementcity: '', // 经营市
managementcount: '', // 经营县
managementProvinceCode: '', // 经营省code
managementcityCode: '', // 经营市code
managementcountCode: '', // 经营县code
pDistributorSid_list: [],
temp: {
sid: '',
contract: '', // 联系人
createOrg: '', // 创建组织
createOrgName: '', // 创建组织名称
disName: '', // 经销商名称
invoBank: '', // 开票开户行
invoBankNum: '', // 开票银行账号
invoPhone: '', // 开票联系电话
isGuarantee: '', // 是否担保 0是/:'1,//否
legalIdCard: '', // 实际控制人身份证号码
legalMobile: '', // 实际控制人手机号码
legalName: '', // 实际控制人姓名
managementAddress: '', // 经营地址(省市:'县,//)
managementDetailAddress: '', // 实际经营地址
managementAddressCode: '',
mobile: '', // 联系人手机号码
pDistributorName: '', // 所属经销商名字
pDistributorSid: '', // 所属经销商sid
registAddress: '', // 注册(登记)地址(省市县) false
registDetailAddress: '', // 注册(登记)地址
registNum: '', // 统一社会信用代码
setUpTime: '', // 成立时间
useOrg: '', // 使用组织
useOrgName: '', // 使用组织名称
userSid: window.sessionStorage.getItem('userSid'), // 用户sid
perList: [], // 人员list
yyzzList: [], // 营业执照附件list
dlysxkzList: [], // 道路运输许可证附件list// 数据传输对象
frsfzList: [], // 法人身份证附件list//数据传输对象
qtzlList: [] // 其他资料附件list array
},
viewTitle: '',
province: [],
city: [],
count: [],
dialogStatus: '', // 对话框状态
registNumType: 'registNumType',
NumType: [],
useOrgArr: [],
options: [],
props: {
value: 'sid',
label: 'name',
children: 'children',
multiple: true
},
identity_list: [],
deCode: [],
inputProvinceList: [],
inputCityList: [],
inputCountyList: [],
inputProvinceList02: [],
inputCityList02: [],
inputCountyList02: [],
dialogImageUrl: '',
dialogVisible: false,
dataArr: [],
rules: {
pDistributorName: [{ required: true, message: '请选择所属经销商', trigger: 'change' }],
disName: [{ required: true, message: '请填写经销商名称', trigger: 'blur' }],
registAll: [{ required: true, message: '请填写注册地址', trigger: 'blur' }],
legalName: [{ required: true, message: '请填写实际控制人姓名', trigger: 'blur' }],
legalMobile: [{ required: true, validator: checkSubmit, message: '请填写实际控制人联系电话', trigger: 'blur' }],
invoPhone: [{ required: true, validator: checkKaipiaoDianhua, message: '请填写单位开票信息联系电话', trigger: 'change' }],
invoBank: [{ required: true, message: '请填写开户行', trigger: 'blur' }],
invoBankNum: [{ required: true, message: '请填写银行账号', trigger: 'blur' }]
}
}
},
methods: {
init() {
this.setaDter()
this.huoquSheng()
this.huoquSheng02()
this.getZuZhi()
this.getListOrgAll()
},
showAdd() {
this.viewTitle = '【新增】经销商'
this.dialogStatus = 'add'
this.init()
this.getLevelList(this.temp.pDistributorSid)
console.log('新增进去的页面', this.temp)
},
showEdit(sids) {
this.init()
this.viewTitle = '【编辑】经销商'
this.dialogStatus = 'edit'
console.log('huixian', sids)
details(sids).then((response) => {
if (response.code === '200') {
this.list = response.data.perList
this.list1 = response.data.yyzzList
this.list2 = response.data.dlysxkzList
this.list3 = response.data.frsfzList
this.list4 = response.data.qtzlList
this.temp = response.data
this.temp.sid = sids
// this.registProvinceSid = response.data.registAddressProvince
// this.registcitySid = response.data.registAddressCity
// this.registcountSid = response.data.registAddressCounty
// this.registProvince = response.data.registAddressProvince
// this.registcity = response.data.registAddressCity
// this.registcount = response.data.registAddressCounty
if (this.temp.managementAddressCode !== '') {
const managementcount_codes = this.temp.managementAddressCode.split('')
this.managementProvinceCode = managementcount_codes[0] + managementcount_codes[1] + '0000'
getProvince().then((res) => {
if (res.code === '200') {
this.inputProvinceList02 = res.data
console.log('回显省02', this.inputProvinceList02)
let bb = ''
this.inputProvinceList02.forEach((e) => {
if (e.districtCode === this.managementProvinceCode) {
bb = {
name: e.name,
districtCode: e.districtCode,
sid: e.sid
}
}
})
this.managementProvince = bb.name
var sid = {
sid: bb.sid
}
getCity(sid).then((res) => {
if (res.code === '200') {
this.inputCityList02 = res.data
console.log('回显市02', this.inputCityList02)
this.managementcityCode = managementcount_codes[0] + managementcount_codes[1] + managementcount_codes[2] + managementcount_codes[3] + '00'
let cc = ''
this.inputCityList02.forEach((e) => {
if (e.districtCode === this.managementcityCode) {
cc = {
name: e.name,
districtCode: e.districtCode,
sid: e.sid
}
}
})
this.managementcity = cc.name
var sid02 = {
sid: cc.sid
}
getCounty(sid02).then((res) => {
if (res.code === '200') {
this.inputCountyList02 = res.data
console.log('回显市03', this.inputCountyList02)
this.managementcountCode = this.temp.managementAddressCode
let dd = ''
this.inputCountyList02.forEach((e) => {
if (e.districtCode === this.managementcountCode) {
dd = {
name: e.name,
districtCode: e.districtCode,
sid: e.sid
}
}
})
this.managementcount = dd.name
}
})
}
})
}
})
}
this.getLevelList(sids)
}
})
},
getListOrgAll() {
const userSid = window.sessionStorage.getItem('userSid')
getUseOrgByUserSid({ userSid: userSid }).then((res) => {
if (res.success) {
console.log('获取当前使用人分公司', res.data)
this.temp.createOrg = res.data.sid
this.temp.createOrgName = res.data.name
this.temp.useOrg = res.data.sid
this.temp.useOrgName = res.data.name
}
})
},
getLevelList(sid) {
getOneLevelList({ sid: sid }).then((res) => {
if (res.code === '200') {
this.pDistributorSid_list = res.data
}
})
},
// 注册地址 --------------------------------
huoquSheng() {
getProvince().then((res) => {
console.log('注册省:', res)
if (res.code === '200') {
this.inputProvinceList = res.data
}
})
},
getShen(value) {
let bb = ''
this.inputProvinceList.forEach((e) => {
if (e.sid === value) {
bb = {
name: e.name,
districtCode: e.districtCode,
sid: e.sid
}
}
})
// 这里是把code的值赋给province省字段
this.registProvince = bb.name
console.log('注册地址-省', this.registProvince)
this.huoquShi(bb.sid)
},
huoquShi(sid1) {
var sid = {
sid: sid1
}
getCity(sid).then((res) => {
console.log('2222市', res)
if (res.code === '200') {
this.inputCityList = res.data
}
})
},
getShi(value) {
let bb = ''
this.inputCityList.forEach((e) => {
if (e.sid === value) {
bb = {
name: e.name,
districtCode: e.districtCode,
sid: e.sid
}
}
})
this.registcity = bb.name
console.log('注册地址-市', this.registcity)
this.huoquXian(bb.sid)
},
huoquXian(sid1) {
var sid = {
sid: sid1
}
getCounty(sid).then((res) => {
console.log('333县', res)
if (res.code === '200') {
this.inputCountyList = res.data
}
})
},
getQu(value) {
let bb = ''
this.inputCountyList.forEach((e) => {
if (e.sid === value) {
bb = {
name: e.name,
districtCode: e.districtCode,
sid: e.sid
}
}
})
this.registcount = bb.name
console.log('注册地址-区/县', this.registcount)
this.deCode.push(bb.districtCode)
},
// 实际经营地址 --------------------------------
huoquSheng02() {
getProvince().then((res) => {
console.log('注册省:', res)
if (res.code === '200') {
this.inputProvinceList02 = res.data
}
})
},
getSheng02(value) {
let bb = ''
this.inputProvinceList02.forEach((e) => {
if (e.districtCode === value) {
bb = {
name: e.name,
districtCode: e.districtCode,
sid: e.sid
}
}
})
// 这里是把code的值赋给province省字段
this.managementProvince = bb.name
this.managementProvinceCode = bb.districtCode
this.huoquShi02(bb.sid)
},
huoquShi02(sid1) {
var sid = {
sid: sid1
}
this.inputCityList02 = []
this.managementcityCode = ''
this.inputCountyList02 = []
this.managementcountCode = ''
getCity(sid).then((res) => {
if (res.code === '200') {
this.inputCityList02 = res.data
console.log('市02', this.inputCityList02)
}
})
},
getShi02(value) {
let bb = ''
this.inputCityList02.forEach((e) => {
if (e.districtCode === value) {
bb = {
name: e.name,
districtCode: e.districtCode,
sid: e.sid
}
}
})
this.managementcity = bb.name
this.huoquXian02(bb.sid)
},
huoquXian02(sid1) {
var sid = {
sid: sid1
}
getCounty(sid).then((res) => {
console.log('333县', res)
if (res.code === '200') {
this.inputCountyList02 = res.data
}
})
},
getQu02(value) {
let bb = ''
this.inputCountyList02.forEach((e) => {
if (e.districtCode === value) {
bb = {
name: e.name,
districtCode: e.districtCode,
sid: e.sid
}
}
})
this.managementcount = bb.name
this.temp.managementAddressCode = bb.districtCode
this.deCode.push(bb.districtCode)
},
setaDter() {
typeValues({
type: this.registNumType
}).then((res) => {
if (res.code === '200') {
this.NumType = res.data
}
})
typeValues({
type: 'identity'
}).then((res) => {
if (res.code === '200') {
this.identity_list = res.data
}
})
},
// 人员身份
identityChange(row, identityKey) {
const choosetItem = this.identity_list.filter((item) => item.dictKey == identityKey)
row.identityValue = choosetItem[0].dictValue
console.log('name:', row.identityValue, 'key:', row.identityKey)
},
// 上级经销商
pDistributorSidChange(val) {
const choosetItem = this.pDistributorSid_list.filter((item) => item.disName == val)
console.log('上级经销商', choosetItem[0])
if (choosetItem[0]) {
this.temp.pDistributorSid = choosetItem[0].sid
}
console.log('name:', this.temp.pDistributorName, 'key:', this.temp.pDistributorSid)
},
usrOrgArryChange(e) {
console.log('选中结果:' + JSON.stringify(e))
var result = ''
if (e.length > 0) {
// 循环多选项
e.forEach((item) => {
var last_id = item[item.length - 1]
// 循环查找名字
this.select_temp = '' // 临时遍历,用来保存选中结果
this.findOrgId(last_id, this.options)
result = result + this.select_temp + ','
})
}
if (result !== '') {
result = result.substring(0, result.length - 1)
}
this.temp.useOrgName = result
console.log('选中名称:' + this.temp.useOrgName)
},
// --- 循环查询
findOrgId(id, options) {
for (var i = 0; i < options.length; i++) {
if (id === options[i].sid) {
this.select_temp = options[i].name // 保存找到的内容
return true
} else {
// 判断是否最后一级
if (options[i].children !== undefined) {
// 不是的话查询下一级
if (this.findOrgId(id, options[i].children)) {
return true
}
}
}
}
},
// 组织
getZuZhi() {
selectListOrg().then((res) => {
if (res.code === '200') {
this.options = res.data
this.zuzhi0(this.options)
}
})
},
zuzhi0(data) {
data.forEach((e) => {
if (e.children) {
if (e.children.length !== 0) {
this.zuzhi0(e.children)
} else {
delete e.children
this.dataArr.push(e)
return
}
}
})
},
getDengJi(value) {
let bb = null
this.NumType.forEach((e) => {
if (e.dictKey === value) {
bb = {
type: 'registNumType',
name: e.dictValue,
vaule: e.dictKey
}
}
})
this.temp.registNumTypeValue = bb.name
},
filesAdd(item, val) {
var arrayList = []
arrayList = item.data
var nowDate = new Date()
var date = {
year: nowDate.getFullYear(),
month: nowDate.getMonth() + 1,
day: nowDate.getDate()
}
var dayDate = date.year + '-' + (date.month >= 10 ? date.month : '0' + date.month) + '-' + (date.day >= 10 ? date.day : '0' + date.day)
console.log(dayDate)
if (val === '0001') {
this.list1.push({
name: window.sessionStorage.getItem('name'),
fileName: arrayList.sourceFileName.substr(0, arrayList.sourceFileName.lastIndexOf('.')),
fileType: arrayList.sourceFileName.substr(arrayList.sourceFileName.lastIndexOf('.')),
attachType: val,
fileSize: arrayList.size,
filePath: arrayList.fullUrl,
createTime: dayDate
})
} else if (val === '0002') {
this.list2.push({
name: window.sessionStorage.getItem('name'),
fileName: arrayList.sourceFileName.substr(0, arrayList.sourceFileName.lastIndexOf('.')),
fileType: arrayList.sourceFileName.substr(arrayList.sourceFileName.lastIndexOf('.')),
attachType: val,
fileSize: arrayList.size,
filePath: arrayList.fullUrl,
createTime: dayDate
})
} else if (val === '0003') {
this.list3.push({
name: window.sessionStorage.getItem('name'),
fileName: arrayList.sourceFileName.substr(0, arrayList.sourceFileName.lastIndexOf('.')),
fileType: arrayList.sourceFileName.substr(arrayList.sourceFileName.lastIndexOf('.')),
attachType: val,
fileSize: arrayList.size,
filePath: arrayList.fullUrl,
createTime: dayDate
})
} else if (val === '0004') {
this.list4.push({
name: window.sessionStorage.getItem('name'),
fileName: arrayList.sourceFileName.substr(0, arrayList.sourceFileName.lastIndexOf('.')),
fileType: arrayList.sourceFileName.substr(arrayList.sourceFileName.lastIndexOf('.')),
attachType: val,
fileSize: arrayList.size,
filePath: arrayList.fullUrl,
createTime: dayDate
})
}
console.log(this.list4, 856856)
},
// 新增人员
addRenyuan() {
this.list.push({
linkType: '',
mobile: '',
name: '',
remarks: ''
})
},
// 删除人员列表一条数据
handleCheck(row) {
this.list.splice(this.list.indexOf(row), 1)
},
handLook(row) {
console.log('查看图片', row)
this.dialogVisible = true
this.dialogImageUrl = row.filePath
console.log('查看图片', this.dialogImageUrl)
},
handColse() {
this.dialogVisible = false
},
handDelete(row, val) {
if (val === '0001') {
this.list1.forEach((e, index) => {
if (e.filePath === row.filePath) {
this.list1.splice(index, 1)
}
})
} else if (val === '0002') {
this.list2.forEach((e, index) => {
if (e.filePath === row.filePath) {
this.list2.splice(index, 1)
}
})
} else if (val === '0003') {
this.list3.forEach((e, index) => {
if (e.filePath === row.filePath) {
this.list3.splice(index, 1)
}
})
} else if (val === '0004') {
this.list4.forEach((e, index) => {
if (e.filePath === row.filePath) {
this.list4.splice(index, 1)
}
})
}
},
filesRemove(item) {
console.log(item)
},
// 添加数据 !!!!!!!其中注释的代码不可删!!!!!!!其中注释的代码不可删!!!!!!!其中注释的代码不可删!!!!!!!
handleCreate() {
if (this.temp.pDistributorName == '') {
this.temp.pDistributorName = '无'
this.temp.pDistributorSid = '0'
}
// this.temp.registDetailAddress = this.registProvince + this.registcity + this.registcount + this.registAll
// this.temp.managementDetailAddress = this.managementProvince + this.managementcity + this.managementcount + this.managementAll
this.$refs['dataForm'].validate((valid) => {
if (valid) {
this.temp.provinceCode = this.managementProvinceCode
this.temp.cityCode = this.managementcityCode
this.temp.managementAddressCode = this.managementcountCode
this.temp.managementDetailAddressProvince = this.managementProvince
this.temp.managementDetailAddressCity = this.managementcity
this.temp.managementDetailAddressCounty = this.managementcount
// if (this.dialogStatus == 'add') {
// if (!this.temp.registAddress) {
// this.temp.registAddress = this.registProvince + '-' + this.registcity + '-' + this.registcount
// console.log('新增注册地址', this.temp.registAddress)
//
// }
// if (!this.temp.managementAddress && this.managementProvince && this.managementcity && this.managementcount) {
// this.temp.managementAddress = this.managementProvince + this.managementcity + this.managementcount
console.log('新增、编辑经营地址', this.temp.managementAddress)
// }
// }
// if (this.dialogStatus == 'edit') {
// if (!this.registProvince) {
// this.temp.registAddress = this.registProvince + '-' + this.registcity + '-' + this.registcount
// console.log('编辑注册地址', this.temp.registAddress)
// }
// if (this.managementProvince !== '') {
// this.temp.managementAddress = this.managementProvince + '-' + this.managementcity + '-' + this.managementcount
// console.log('编辑经营地址', this.temp.managementAddress)
// }
// }
this.FormLoading = true
if (this.temp.sid === '') {
this.temp.perList = this.list
for (var a = 0; a < this.list1.length; a++) {
console.log('list1', this.list1[a])
this.temp.yyzzList.push({
attachType: '0001',
name: this.list1[a].name,
fileName: this.list1[a].fileName,
filePath: this.list1[a].filePath,
fileSize: this.list1[a].fileSize,
fileType: this.list1[a].fileType
})
}
for (var b = 0; b < this.list2.length; b++) {
this.temp.dlysxkzList.push({
attachType: '0002',
name: this.list2[b].name,
fileName: this.list2[b].fileName,
filePath: this.list2[b].filePath,
fileSize: this.list2[b].fileSize,
fileType: this.list2[b].fileType
})
}
for (var c = 0; c < this.list3.length; c++) {
this.temp.frsfzList.push({
attachType: '0003',
name: this.list3[c].name,
fileName: this.list3[c].fileName,
filePath: this.list3[c].filePath,
fileSize: this.list3[c].fileSize,
fileType: this.list3[c].fileType
})
}
for (var i = 0; i < this.list4.length; i++) {
this.temp.qtzlList.push({
attachType: '0004',
name: this.list4[i].name,
fileName: this.list4[i].fileName,
filePath: this.list4[i].filePath,
fileSize: this.list4[i].fileSize,
fileType: this.list4[i].fileType
})
}
SaveList(this.temp).then((response) => {
console.log('返回值:', response)
this.FormLoading = false
if (response.code === '200') {
this.handleReturn('true')
} else {
this.$notify({
title: '提示',
message: '添加失败',
type: 'error',
duration: 2000
})
}
})
} else {
console.log('123456789')
// if (this.useOrgArry) {
// var abc = []
// this.useOrgArry.forEach((e) => {
// console.log('77777777', e)
// abc.push(e[e.length - 1])
// })
// this.temp.useOrg = abc.toString()
// console.log('abcabc', this.temp.useOrg)
// }
this.temp.perList = this.list
console.log(this.list1, this.list2, this.list3, this.list4)
this.temp.yyzzList = this.list1
this.temp.dlysxkzList = this.list2
this.temp.frsfzList = this.list3
this.temp.qtzlList = this.list4
console.log('temp', this.temp)
Update(this.temp).then((response) => {
console.log('response', response)
this.FormLoading = false
if (response.code === '200') {
this.handleReturn('true')
} else {
this.$notify({
title: '失败',
message: '修改失败',
type: 'error'
})
}
})
}
}
})
},
// 返回
handleReturn(isreload) {
this.registProvince = '' // 注册省name
this.registcity = '' // 注册市name
this.registcount = '' // 注册县name
this.managementProvince = '' // 经营省name
this.managementcity = '' // 经营市name
this.managementcount = ''// 经营县name
this.registProvinceSid = '' // 注册省
this.registcitySid = '' // 注册市
this.registcountSid = '' // 注册县
this.managementProvinceCode = '' // 经营省code
this.managementcityCode = '' // 经营市code
this.managementcountCode = '' // 经营县code
this.registAll = ''
this.managementAll = ''
this.temp = {
sid: '',
contract: '', // 联系人
createOrg: '', // 创建组织
createOrgName: '', // 创建组织名称
disName: '', // 经销商名称
invoBank: '', // 开票开户行
invoBankNum: '', // 开票银行账号
invoPhone: '', // 开票联系电话
isGuarantee: '', // 是否担保 0是/:'1,//否
legalIdCard: '', // 实际控制人身份证号码
legalMobile: '', // 实际控制人手机号码
legalName: '', // 实际控制人姓名
managementAddress: '', // 经营地址(省市:'县,//)
managementDetailAddress: '', // 实际经营地址
managementAddressCode: '',
mobile: '', // 联系人手机号码
pDistributorName: '', // 所属经销商名字
pDistributorSid: '', // 所属经销商sid
registAddress: '', // 注册(登记)地址(省市县) false
registDetailAddress: '', // 注册(登记)地址
registNum: '', // 统一社会信用代码
setUpTime: '', // 成立时间
useOrg: '', // 使用组织
useOrgName: '', // 使用组织名称
userSid: window.sessionStorage.getItem('userSid'), // 用户sid
perList: [], // 人员list
yyzzList: [], // 营业执照附件list
dlysxkzList: [], // 道路运输许可证附件list// 数据传输对象
frsfzList: [], // 法人身份证附件list//数据传输对象
qtzlList: [] // 其他资料附件list array
}
this.list = []
this.list1 = []
this.list2 = []
this.list3 = []
this.list4 = []
this.$refs['dataForm'].resetFields()
if (isreload === 'true') this.$emit('reloadlist')
this.$emit('doback')
},
// 删除文件
deleteFile(val, index) {
const fullPath = {
fullPath: val
}
deleteFilesOss(fullPath).then((re) => {
if (re.code === '200') {
this.$notify({
title: '提示',
message: '删除成功',
type: 'success',
duration: 2000
})
}
})
}
}
}
</script>
<style scoped>
.title {
text-align: left;
}
.tleftb {
text-align: right;
float: left;
font-size: 14px;
color: #606266;
line-height: 40px !important;
font-weight: 600;
}
.wlInfo {
text-align: center;
font-size: 28px;
line-height: 90px;
}
.headline {
height: 40px;
padding: 10px;
font-weight: bold;
display: flex;
background-color: #ffffff;
justify-content: space-between;
border: 1px solid #DFE6EC;
align-items: center;
}
.title_three {
height: 40px;
padding: 10px;
background-color: #0294d7;
color: #ffffff;
}
.listconadd {
padding: 0 20px;
}
.addinputw {
width: 90% !important;
}
</style>