<template>
|
<div>
|
<el-dialog
|
title="企业准入信息"
|
:visible.sync="show"
|
:close-on-click-modal="false"
|
center
|
width="850px">
|
<el-form :model="form" ref="form" v-if="show">
|
<el-col :span="12">
|
<el-form-item label="企业准入类型:" prop="enterpriseaccesstype" :rules="rules('企业准入类型')">
|
<el-select v-model="form.enterpriseaccesstype" filterable clearable placeholder="请选择">
|
<!-- <el-option label="普通企业" value="02"></el-option>-->
|
<!-- <el-option label="核心企业" value="01"></el-option>-->
|
<el-option
|
v-for="(item, index) in options"
|
:key="index"
|
:label="item.valueDesc"
|
:value="item.value">
|
</el-option>
|
</el-select>
|
</el-form-item>
|
</el-col>
|
<!-- <el-col :span="12">
|
<el-form-item label="公司类型:" prop="companytype" :rules="rules('公司类型')" v-if="companytypeShow">
|
<el-select v-model="form.companytype" filterable clearable placeholder="请选择">
|
<el-option label="总公司" value="01"></el-option>
|
<el-option label="子公司" value="02"></el-option>
|
</el-select>
|
</el-form-item>
|
</el-col> -->
|
<el-col :span="12">
|
<el-form-item label="企业工商登记名:" prop="enterprisename" :rules="rules('企业工商登记名')">
|
<el-input v-model="form.enterprisename"></el-input>
|
</el-form-item>
|
</el-col>
|
<el-col :span="12">
|
<el-form-item label="统一社会信用码:" prop="reditcode" :rules="rules('统一社会信用码')">
|
<el-input v-model="form.reditcode"></el-input>
|
</el-form-item>
|
</el-col>
|
</el-form>
|
<div slot="footer" class="dialog-footer">
|
<el-button class="blueBtn" type="primary" size="mini" @click="handleSubmit">新增</el-button>
|
</div>
|
</el-dialog>
|
</div>
|
</template>
|
|
<script>
|
import { saveEnpAdmit, qryEnpDetailParams, enterpriseQryCondition } from '@/api/area/enterprise'
|
export default {
|
props: ['showDialog'],
|
data: function() {
|
return {
|
companytypeShow: false,
|
form: {
|
// companytype: '',
|
enterpriseaccesstype: '',
|
enterprisename: '',
|
reditcode: '',
|
},
|
options: ''
|
}
|
},
|
created() {
|
this.initSelect()
|
},
|
computed: {
|
show: {
|
get() {
|
return this.showDialog
|
},
|
set() {
|
this.$refs['form'].resetFields()
|
this.$emit('update:showDialog', false)
|
}
|
}
|
},
|
watch: {
|
'form.enterpriseaccesstype': function (newVal) {
|
// this.companytypeShow = Boolean(newVal === '01')
|
// if (newVal === '02') {
|
// this.form.companytype = ''
|
// }
|
}
|
},
|
methods: {
|
initSelect(value) {
|
let params = { conditionName: 'EnpAccessType' }
|
enterpriseQryCondition(params).then(res => {
|
this.options = res.result
|
})
|
},
|
async handleSubmit() {
|
// *企业准入类型:01 核心企业 ,02 普通企业
|
// *公司类型:01 总公司, 02 子公司
|
let submit = ''
|
this.$refs['form'].validate((valid) => {
|
if (valid) {
|
submit = true
|
} else {
|
return false
|
}
|
})
|
if (submit) {
|
let addRes = await saveEnpAdmit(this.form)
|
if (addRes.code === '00') {
|
let params = {
|
creditCode: addRes.result.creditCode,
|
serialno: addRes.result.serialno,
|
searchType: 1,
|
clickType: 0 // 点击类型(详情传1 继续处理传0)
|
}
|
let res = await qryEnpDetailParams(params)
|
let enterpriseParams = {
|
clickType: 0,
|
...res.result
|
}
|
this.$store.commit('SET_enterpriseParams', enterpriseParams)
|
this.$router.push({ path: '/area/enterprise/update/enterpriseBaseInfo' })
|
}
|
}
|
},
|
rules(rule) {
|
return { required: true, message: '请输入' + rule, trigger: 'blur' }
|
},
|
}
|
}
|
</script>
|
|
<style lang="stylus" scoped>
|
>>> .el-dialog__header
|
padding-top 40px
|
.el-dialog__title
|
font-size 18px
|
// font-family PingFangSC-Medium,PingFangSC
|
font-weight bold
|
color #222222
|
line-height 25px
|
>>> .el-dialog__body
|
height 100px
|
>>> .el-dialog__footer
|
padding-bottom 30px
|
.dialog-footer
|
.blueBtn
|
background-color rgba(0,129,240,1)
|
border-radius 4px
|
color rgba(255,255,255,1)
|
padding 0
|
width 120px
|
height 30px
|
span
|
font-size 14px
|
height 20px
|
font-weight 400
|
line-height 20px
|
</style>
|