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.
 
 
 
 
 
 

917 lines
33 KiB

<template>
<div class="app-container">
<div class="tab-header webtop">
<div>{{ viewTitle }}</div>
<div>
<el-button type="primary" size="small" @click="handleCreate()">保存</el-button>
<el-button type="primary" size="small" @click="submit()">提交</el-button>
</div>
</div>
<div class="">
<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 filterable>
<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>
</el-col>
<el-col :span="20">
<el-form-item>
<el-input v-model="temp.registDetailAddress" maxlength="125" placeholder="请填写详细地址" style="width:63%" clearable/>
</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="temp.provinceCode" 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="temp.cityCode" 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="temp.managementAddressCode" 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/>
</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-group v-model="temp.isGuarantee">
<el-radio label="是">是</el-radio>
<el-radio label="否">否</el-radio>
</el-radio-group>
</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-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-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>
</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.invoPhone" 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="8">
<el-form-item>
<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>
</el-col>
<el-col :span="8">
<el-form-item>
<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="temp.perList" :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(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-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, submit } from '@/api/jichuxinxi/baseaffiliatcompany'
import { getCity, getCounty, getProvince } from '@/api/portal/areaPicker' // 省市区
import { typeValues } from '@/api/jichuxinxi/dictcommons'
import multifileUpload from '@/components/uploadFile/multifileUpload.vue'
import { getOrgSidByPath, fetchBySid } from '@/api/jichuxinxi/dictcommons'
export default {
name: 'JingXiaoShangEdit',
components: {
multifileUpload
},
data() {
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 (!value) {
return callback(new Error('请填写实际控制人联系电话'))
} else if (!Submit.test(value)) {
return callback(new Error('请输入正确的手机号'))
} else {
callback()
}
}
return {
pickerOptions: {
disabledDate(time) {
return time.getTime() > Date.now()
}
},
viewTitle: '',
dialogStatus: '', // 对话框状态
dialogImageUrl: '',
dialogVisible: false,
list1: [], // 营业执照
list2: [], // 道路运输许可证
list3: [], // 法人身份证
list4: [], // 其他资料
FormLoading: false,
tableKey: 0,
businessLicenseKey: 1,
roadTransportKey: 2,
corporateIdentityCardKey: 3,
otherDetailsKey: 4,
listLoading: false,
index: 0,
accept: '.jpg,.jpeg,.png,.JPG,.JPEG,.PNG',
pDistributorSid_list: [],
NumType: [],
identity_list: [],
inputProvinceList02: [],
inputCityList02: [],
inputCountyList02: [],
temp: {
cityCode: '',
contract: '',
createOrg: '',
createOrgName: '',
disLevelKey: '',
disLevelValue: '',
disName: '',
dlysxkzList: [],
frsfzList: [],
invoBank: '',
invoBankNum: '',
invoPhone: '',
isGuarantee: '',
isGuaranteeKey: '',
legalIdCard: '',
legalMobile: '',
legalName: '',
managementAddressCode: '',
managementDetailAddress: '',
managementDetailAddressCity: '',
managementDetailAddressCounty: '',
managementDetailAddressProvince: '',
mobile: '',
orgSidPath: '',
pDistributorName: '',
pDistributorSid: '',
pdisName: '',
perList: [],
provinceCode: '',
qtzlList: [],
registDetailAddress: '',
registNum: '',
setUpTime: '',
sid: '',
startCoopDate: '',
useOrg: '',
useOrgName: '',
userSid: '',
yyzzList: []
},
rules: {
pDistributorName: [{ required: true, message: '请选择所属经销商', trigger: 'change' }],
disName: [{ required: true, message: '请填写经销商名称', trigger: 'blur' }],
legalName: [{ required: true, message: '请填写实际控制人姓名', trigger: 'blur' }],
legalMobile: [{ required: true, validator: checkSubmit, trigger: 'blur' }]
}
}
},
created() {
console.log('url:' + window.location.href)
var one = window.location.href.indexOf('&data') + 6
const data = window.location.href.substr(one) // url解码unescape()已从web中移除,尽量不使用
const obj = JSON.parse(decodeURIComponent(data))
this.showInfo(obj.businessSid)
},
mounted() {
window.parent.postMessage({
cmd: 'returnHeight',
params: {
// 告诉父级页面,子页面的弹框高度。
code: 2,
data: 500 + 'px'
}
}, '*')
},
methods: {
init() {
this.setaDter()
this.huoquSheng02()
},
// 实际经营地址 --------------------------------
huoquSheng02() {
getProvince().then((res) => {
console.log('注册省:', res)
if (res.success) {
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.temp.managementDetailAddressProvince = bb.name
this.huoquShi02(bb.sid)
},
huoquShi02(sid1) {
var sid = {
sid: sid1
}
this.inputCityList02 = []
this.inputCountyList02 = []
getCity(sid).then((res) => {
if (res.success) {
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.temp.managementDetailAddressCity = bb.name
this.huoquXian02(bb.sid)
},
huoquXian02(sid1) {
var sid = {
sid: sid1
}
getCounty(sid).then((res) => {
console.log('333县', res)
if (res.success) {
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.temp.managementDetailAddressCounty = bb.name
},
setaDter() {
typeValues({ type: 'registNumType' }).then((res) => {
if (res.success) {
this.NumType = res.data
}
})
typeValues({ type: 'identity' }).then((res) => {
if (res.success) {
this.identity_list = res.data
}
})
},
showInfo(sids) {
this.init()
this.viewTitle = '【编辑】经销商'
this.dialogStatus = 'edit'
details(sids).then((response) => {
if (response.success) {
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.instanceId = response.data.procInsId
this.getLevelList(sids)
if (this.temp.managementAddressCode !== '') {
getProvince().then((res) => {
if (res.success) {
this.inputProvinceList02 = res.data
let bb = ''
this.inputProvinceList02.forEach((e) => {
if (e.districtCode === this.temp.provinceCode) {
bb = {
name: e.name,
districtCode: e.districtCode,
sid: e.sid
}
}
})
var sid = {
sid: bb.sid
}
getCity(sid).then((res) => {
if (res.success) {
this.inputCityList02 = res.data
let cc = ''
this.inputCityList02.forEach((e) => {
if (e.districtCode === this.temp.cityCode) {
cc = {
name: e.name,
districtCode: e.districtCode,
sid: e.sid
}
}
})
var sid02 = {
sid: cc.sid
}
getCounty(sid02).then((res) => {
if (res.success) {
this.inputCountyList02 = res.data
}
})
}
})
}
})
}
}
})
},
getLevelList(sid) {
getOneLevelList({ sid: sid }).then((res) => {
if (res.success) {
this.pDistributorSid_list = res.data
}
})
},
// 人员身份
identityChange(row, identityKey) {
const choosetItem = this.identity_list.filter((item) => item.dictKey === identityKey)
if (choosetItem.length > 0 && choosetItem !== null) {
row.identityValue = choosetItem[0].dictValue
} else {
row.identityValue = ''
}
},
// 上级经销商
pDistributorSidChange(val) {
const choosetItem = this.pDistributorSid_list.filter((item) => item.disName === val)
if (choosetItem.length > 0 && choosetItem !== null) {
this.temp.pDistributorSid = choosetItem[0].sid
} else {
this.temp.pDistributorSid = ''
}
},
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
})
}
},
// 新增人员
addRenyuan() {
this.temp.perList.push({
linkType: '',
mobile: '',
name: '',
remarks: ''
})
},
// 删除人员列表一条数据
handleCheck(index) {
this.temp.perList.splice(index, 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.$refs['dataForm'].validate((valid) => {
if (valid) {
if (this.temp.isGuarantee === '是') {
this.temp.isGuaranteeKey = '1'
} else if (this.temp.isGuarantee === '否') {
this.temp.isGuaranteeKey = '0'
}
this.FormLoading = true
if (this.temp.sid === '') {
SaveList(this.temp).then((response) => {
this.FormLoading = false
if (response.success) {
this.$message({ showClose: true, type: 'success', message: '保存成功' })
// 子页面向父级页面传递值(关闭弹框)
window.parent.postMessage({
cmd: 'returnHeight',
params: {
// 操作成功,告诉父级页面关闭弹框
code: 1
}
}, '*')
} else {
this.$notify({
title: '提示',
message: '添加失败',
type: 'error',
duration: 2000
})
}
})
} else {
this.temp.yyzzList = this.list1
this.temp.dlysxkzList = this.list2
this.temp.frsfzList = this.list3
this.temp.qtzlList = this.list4
Update(this.temp).then((response) => {
this.FormLoading = false
if (response.success) {
this.$message({ showClose: true, type: 'success', message: '保存成功' })
// 子页面向父级页面传递值(关闭弹框)
window.parent.postMessage({
cmd: 'returnHeight',
params: {
// 操作成功,告诉父级页面关闭弹框
code: 1
}
}, '*')
} else {
this.$notify({
title: '失败',
message: '修改失败',
type: 'error'
})
}
})
}
}
})
},
submit() {
if (this.temp.pDistributorName === '') {
this.temp.pDistributorName = '无'
this.temp.pDistributorSid = '0'
}
this.$refs['dataForm'].validate((valid) => {
if (valid) {
if (this.temp.isGuarantee === '是') {
this.temp.isGuaranteeKey = '1'
} else if (this.temp.isGuarantee === '否') {
this.temp.isGuaranteeKey = '0'
}
this.FormLoading = true
this.temp.yyzzList = this.list1
this.temp.dlysxkzList = this.list2
this.temp.frsfzList = this.list3
this.temp.qtzlList = this.list4
submit(this.temp).then((response) => {
this.FormLoading = false
if (response.success) {
this.$message({ showClose: true, type: 'success', message: '操作成功' })
// 子页面向父级页面传递值(关闭弹框)
window.parent.postMessage({
cmd: 'returnHeight',
params: {
// 操作成功,告诉父级页面关闭弹框
code: 1
}
}, '*')
} else {
this.$notify({
title: '提示',
message: '添加失败',
type: 'error',
duration: 2000
})
}
})
}
})
}
}
}
</script>
<style scoped>
.headline {
height: 40px;
padding: 10px;
font-weight: bold;
display: flex;
background-color: #ffffff;
justify-content: space-between;
border: 1px solid #DFE6EC;
align-items: center;
}
.addinputw {
width: 90% !important;
}
</style>