<!--
|
* @Author: your name
|
* @Date: 2019-10-21 15:40:58
|
* @LastEditTime: 2023-03-03 10:04:09
|
* @LastEditors: vann 984797170@qq.com
|
* @Description: In User Settings Edit
|
* @FilePath: /e:\Demo\cts-web\src\views\area\enterprise\update\EnterpriseBaseInfo.vue
|
-->
|
<template>
|
<div class="dataBack" v-loading="loading">
|
<el-form label-position="right" :model="form" v-show="!loading" ref="form">
|
<el-row>
|
<p class="title">基本信息</p>
|
<enp-input :config.sync="form.channelareaname"></enp-input>
|
<enp-select :config="form.enterprisetype"></enp-select>
|
<enp-input :config.sync="form.enterprisename"></enp-input>
|
<enp-input :config.sync="form.reditcode"></enp-input>
|
<enp-input :config.sync="form.organizationcode"></enp-input>
|
<enp-date :config="form.registerdate"></enp-date>
|
<!-- 注册资本 -->
|
<enp-input :config.sync="form.registeredcapital" @changMoney="changMoney"></enp-input>
|
<enp-input :config.sync="form.companytel" @changMoney="changMoney"></enp-input>
|
<enp-select :config="form.industrytype"></enp-select>
|
<enp-select :config="form.enterprisecategory"></enp-select>
|
<city-select
|
:province.sync="form.registerprovince"
|
:citys.sync="form.registercitys"
|
:county.sync="form.registercounty"
|
></city-select>
|
<enp-input :config.sync="form.registeraddress" isTextArea="textarea"></enp-input>
|
<enp-input :config.sync="form.scope"></enp-input>
|
<city-select
|
:province.sync="form.companyprovince"
|
:citys.sync="form.companycity"
|
:county.sync="form.companycounty"
|
></city-select>
|
<enp-input :config.sync="form.companytualaddress"></enp-input>
|
<!-- 公司组织机构代码 -->
|
<head-office-input
|
:name.sync="form.headenterprisename"
|
:code.sync="form.headorganizationcode"
|
:reditcode.sync="form.headreditcode"
|
></head-office-input>
|
<!-- <enp-input :config="form.headenterprisename"></enp-input>-->
|
<!-- <enp-input :config.sync="form.headorganizationcode"></enp-input>-->
|
<!-- <enp-input :config.sync="form.headreditcode"></enp-input>-->
|
|
<enp-input :config.sync="form.balanceaccount"></enp-input>
|
<enp-input :config.sync="form.balancefictitiousaccount"></enp-input>
|
</el-row>
|
<el-row>
|
<p class="title">联系人信息</p>
|
<enp-input :config.sync="form.contactname"></enp-input>
|
<enp-input :config.sync="form.contactcertid"></enp-input>
|
<enp-input :config.sync="form.contactphone"></enp-input>
|
</el-row>
|
<el-row>
|
<p class="title" v-show="manageForm">经营信息</p>
|
<div ref="manageForm">
|
<enp-input :config.sync="form.stockname"></enp-input>
|
<enp-input :config.sync="form.stockcode"></enp-input>
|
<!-- 前年营业利润(万) -->
|
<enp-input :config.sync="form.lastbeforeyearprofit"></enp-input>
|
<!-- 上年营业利润(万) -->
|
<enp-input :config.sync="form.lastyearprofit"></enp-input>
|
<enp-select :config="form.criterion"></enp-select>
|
<!-- 标准详细计算公式及结果(万) -->
|
<enp-input :config.sync="form.standardtailedresult"></enp-input>
|
<!-- 增长率 -->
|
<!-- <enp-input :config.sync="rateofrise"></enp-input> -->
|
<enp-input :config.sync="form.rateofrise"></enp-input>
|
<enp-input :config.sync="form.totalassets"></enp-input> <!-- 企业总资产 -->
|
<enp-input :config.sync="form.sliabilities"></enp-input> <!-- 企业总负债 -->
|
<!-- 企业净资产 -->
|
<!-- <enp-input :config.sync="netasset"></enp-input> -->
|
<enp-input :config.sync="form.netasset"></enp-input>
|
<!-- 企业负债率 -->
|
<!-- <enp-input :config.sync="debtratio"></enp-input> -->
|
<enp-input :config.sync="form.debtratio"></enp-input>
|
<enp-input :config.sync="form.singleloanlimit"></enp-input>
|
<enp-input :config.sync="form.platformurl"></enp-input>
|
<enp-select :config="form.locationcity"></enp-select>
|
<enp-select :config="form.registercity"></enp-select>
|
<enp-input :config.sync="form.otherexplain"></enp-input>
|
</div>
|
</el-row>
|
<el-row v-if="form.ShareholderInfo.visible">
|
<p class="title">股东信息</p>
|
<shareholder-info-table :object-no="enterpriseParams.tempSerialNo" :object-type="enterpriseParams.objectType"></shareholder-info-table>
|
</el-row>
|
<el-row>
|
<!-- <p class="title" style="margin-top:22px">负面信息</p> -->
|
<enp-input :config.sync="form.gative"></enp-input> <!-- 有无负面信息 -->
|
<enp-select :config="form.lostinformation"></enp-select> <!-- 失信情况 -->
|
<enp-select :config="form.majorlitigation"></enp-select> <!-- 重大诉讼 -->
|
<enp-select :config="form.majorissues"></enp-select> <!-- 重大事项 -->
|
<enp-select :config="form.somethingelse"></enp-select> <!-- 其他事项 -->
|
<enp-input :config.sync="form.badrecord"></enp-input> <!-- 负面信息说明 -->
|
<enp-input :config.sync="form.remarka"></enp-input> <!-- 失信情况说明 -->
|
<enp-input :config.sync="form.remarkb"></enp-input> <!-- 重大诉讼说明 -->
|
<enp-input :config.sync="form.remarkc"></enp-input> <!-- 重大事项说明 -->
|
<enp-input :config.sync="form.remarkd"></enp-input> <!-- 其他事项说明 -->
|
</el-row>
|
<el-row v-if="form.EnpFinancialData.visible">
|
<p class="title">财务数据</p>
|
<financial-data-table :object-no="enterpriseParams.tempSerialNo" :object-type="enterpriseParams.objectType"></financial-data-table>
|
</el-row>
|
<el-row>
|
<p class="title" style="margin-top:22px" v-show="expandForm">拓展人信息</p>
|
<div ref="expandForm">
|
<enp-input :config.sync="form.expanduserid"></enp-input>
|
<enp-input :config.sync="form.expandjobnumber"></enp-input>
|
<enp-input :config.sync="form.objectno"></enp-input>
|
<enp-input :config.sync="form.objecttype"></enp-input>
|
<enp-input :config.sync="form.expandphonenumber"></enp-input>
|
</div>
|
</el-row>
|
<el-row v-if="form.DockingInfo.visible">
|
<p class="title">对接人信息</p>
|
<docking-info-table :object-no="enterpriseParams.tempSerialNo" :object-type="enterpriseParams.objectType"></docking-info-table>
|
</el-row>
|
</el-form>
|
</div>
|
</template>
|
|
<script>
|
import { qryEnpBasicInfo, updateEnterpriseBaseInfo } from '@/api/area/enterprise'
|
import EnpInput from '../components/EnpInput'
|
import EnpSelect from '../components/EnpSelect'
|
import EnpDate from '../components/EnpDate'
|
import CitySelect from '../components/CitySelect'
|
import ShareholderInfoTable from './components/ShareholderInfoTable'
|
import FinancialDataTable from './components/FinancialDataTable'
|
import DockingInfoTable from './components/DockingInfoTable'
|
import HeadOfficeInput from './components/HeadOfficeInput'
|
import { mapState } from 'vuex'
|
|
import { communal } from '@/views/area/mixins'
|
export default {
|
components: { EnpInput, EnpSelect, EnpDate, CitySelect, ShareholderInfoTable, FinancialDataTable, DockingInfoTable, HeadOfficeInput },
|
props: {
|
nextChange: {
|
type: Boolean,
|
default: false
|
},
|
},
|
mixins: [communal],
|
data: function() {
|
return {
|
loading: true,
|
manageForm: true,
|
expandForm: true,
|
form: {
|
channelareaname: '',
|
enterprisetype: '',
|
enterprisename: '',
|
reditcode: '',
|
organizationcode: '',
|
registerdate: '',
|
registeredcapital: '',
|
companytel: '',
|
industrytype: '',
|
enterprisecategory: '',
|
registerprovince: '',
|
registercitys: '',
|
registercounty: '',
|
registeraddress: '',
|
scope: '',
|
companyprovince: '',
|
companycity: '',
|
companycounty: '',
|
companytualaddress: '',
|
headenterprisename: '',
|
headorganizationcode: '',
|
headreditcode: '',
|
balanceaccount: '',
|
balancefictitiousaccount: '',
|
corporatename: '',
|
corporatecerttype: '',
|
corporatecertid: '',
|
stockname: '',
|
stockcode: '',
|
lastbeforeyearprofit: '',
|
lastyearprofit: '',
|
criterion: '',
|
standardtailedresult: '',
|
rateofrise: '',
|
totalassets: '',
|
sliabilities: '',
|
netasset: '',
|
debtratio: '',
|
singleloanlimit: '',
|
platformurl: '',
|
locationcity: '',
|
registercity: '',
|
otherexplain: '',
|
gative: '',
|
lostinformation: '',
|
majorlitigation: '',
|
majorissues: '',
|
somethingelse: '',
|
badrecord: '',
|
remarka: '',
|
remarkb: '',
|
remarkc: '',
|
remarkd: '',
|
expanduserid: '',
|
expandjobnumber: '',
|
objectno: '',
|
objecttype: '',
|
expandphonenumber: '',
|
serialno: '',
|
//
|
ShareholderInfo: '',
|
EnpFinancialData: '',
|
DockingInfo: '',
|
contactname: '', //企业联系人姓名
|
contactcertid: '', //企业联系人证件号
|
contactphone: '', //企业联系人电话
|
},
|
oldForm: {}
|
}
|
},
|
created() {
|
this.initForm()
|
},
|
watch: {
|
// 前年
|
'form.lastbeforeyearprofit.value': function(val) {
|
let { value } = this.form.lastyearprofit
|
val = val.trim()
|
value = value.trim()
|
if (val && value) {
|
let result = (Number(value) - Number(val)) / Number(val) * 100
|
this.form.rateofrise.value = Math.round(result * 100) / 100
|
} else {
|
this.form.rateofrise.value = ''
|
}
|
},
|
// 上年
|
'form.lastyearprofit.value': function(val) {
|
let { value } = this.form.lastbeforeyearprofit
|
val = val.trim()
|
value = value.trim()
|
if (val && value) {
|
let result = (Number(val) - Number(value)) / Number(value) * 100
|
this.form.rateofrise.value = Math.round(result * 100) / 100
|
let rateofriseValue = this.form.rateofrise.value
|
if (rateofriseValue) {
|
// 上年营业利润*(1+增长率)*(1+增长率)
|
let res = (+val) * (1 + rateofriseValue / 100) * (1 + rateofriseValue / 100)
|
this.form.standardtailedresult.value = Math.round(res * 100) / 100
|
}
|
} else {
|
this.form.rateofrise.value = ''
|
this.form.standardtailedresult.value = ''
|
}
|
},
|
// 增长率
|
// 'form.rateofrise.value':function(val){
|
// // console.log(val)
|
// const { value } = this.form.lastyearprofit
|
// value = value.trim()
|
// if (val && value) {
|
// this.form.standardtailedresult.value = (+value) * (1+val) * (1+val)
|
// } else {
|
// this.form.standardtailedresult.value = ''
|
// }
|
// },
|
// 企业总资产
|
'form.totalassets.value': function(val) {
|
let { value } = this.form.sliabilities
|
val = val.trim()
|
value = value.trim()
|
if (val && value) {
|
this.form.netasset.value = (+val) - (value * 1)
|
// 企业资产负债率 = 企业总负债/企业总资产
|
this.form.debtratio.value = Math.round(((value * 1) / (+val)) * 100)
|
} else {
|
this.form.netasset.value = ''
|
this.form.debtratio.value = ''
|
}
|
},
|
// 企业总负债
|
'form.sliabilities.value': function(val) {
|
let { value } = this.form.totalassets
|
val = val.trim()
|
value = value.trim()
|
if (val && value) {
|
this.form.netasset.value = (+value) - (val * 1)
|
this.form.debtratio.value = Math.round(((val * 1) / (+value)) * 100)
|
} else {
|
this.form.netasset.value = ''
|
this.form.debtratio.value = ''
|
}
|
}
|
},
|
computed: {
|
...mapState({
|
enterpriseParams: state => state.risk.enterpriseParams
|
}),
|
// 实时计算 增长率 = (上年营业利润-前年营业利润)/前年营业利润
|
// rateofrise(){
|
// // console.log(this.form.lastbeforeyearprofit)
|
// const { lastbeforeyearprofit,lastyearprofit } = this.form
|
// let tempRateofrise = this.form.rateofrise
|
// if (lastbeforeyearprofit.value && lastyearprofit.value ) {
|
// tempRateofrise.value = ((Number(lastbeforeyearprofit.value) - Number(lastyearprofit.value)) / Number(lastyearprofit.value)) * 100
|
// if (String(tempRateofrise.value).indexOf('.') > -1) {
|
// tempRateofrise.value = Number(tempRateofrise.value).toFixed(2)
|
// }
|
// } else {
|
// tempRateofrise.value = ''
|
// }
|
// return tempRateofrise
|
// },
|
// // 实时计算 企业净资产 = 企业总资产 - 企业总负债
|
// netasset(){
|
// const { totalassets,sliabilities } = this.form
|
// let tempNetasset = this.form.netasset
|
// if (totalassets.value && sliabilities.value ) {
|
// tempNetasset.value = Number(totalassets.value) - Number(sliabilities.value)
|
// } else {
|
// tempNetasset.value = ''
|
// }
|
// return tempNetasset
|
// },
|
// // 实时计算 企业资产负债率 = 企业总负债/企业总资产
|
// debtratio(){
|
// const { totalassets,sliabilities } = this.form
|
// let tempDebtratio = this.form.debtratio
|
// if (totalassets.value && sliabilities.value ) {
|
// tempDebtratio.value = Number(totalassets.value) / Number(sliabilities.value)
|
// if (String(tempDebtratio.value).indexOf('.') > -1) {
|
// tempDebtratio.value = Number(tempDebtratio.value).toFixed(2)
|
// }
|
// } else {
|
// tempDebtratio.value = ''
|
// }
|
// return tempDebtratio
|
// }
|
},
|
methods: {
|
// 初始化表单
|
async initForm() {
|
let params = {
|
serialno: this.enterpriseParams.tempSerialNo
|
}
|
let res = await qryEnpBasicInfo(params)
|
this._.merge(this.form, res.result)
|
Object.assign(this.oldForm, this.form)
|
// console.log(this.form)
|
// console.log(this.oldForm)
|
this.$nextTick(() => {
|
this.manageForm = Boolean(this.$refs['manageForm'].getElementsByClassName('el-col').length > 0)
|
this.expandForm = Boolean(this.$refs['expandForm'].getElementsByClassName('el-col').length > 0)
|
})
|
this.loading = false
|
},
|
// 表单提交
|
handleSubmit() {
|
this.$refs['form'].validate(valid => {
|
if (valid) {
|
let params = {}
|
Object.keys(this.form).forEach(key => {
|
params[key] = this.form[key].value
|
})
|
params.checkFlag = true
|
updateEnterpriseBaseInfo(params).then(res => {
|
if (res.code === '00') {
|
// this.$message.success('提交成功!')
|
this.$emit('handleNextPage', true)
|
}
|
})
|
} else {
|
this.$message.warning('当前页面存在必填项未录入或数据录入错误,请检查!')
|
return false
|
}
|
})
|
},
|
// 保存草稿
|
handleSaveDraft() {
|
let params = {}
|
Object.keys(this.form).forEach(key => {
|
params[key] = this.form[key].value
|
})
|
params.checkFlag = false
|
updateEnterpriseBaseInfo(params).then(res => {
|
if (res.code === '00') {
|
this.$message.success('保存成功!')
|
this.oldForm = Object.assign(this.oldForm, this.form)
|
}
|
})
|
},
|
// 保存
|
handleSave() {
|
this.$refs['form'].validate(valid => {
|
if (valid) {
|
let params = {}
|
Object.keys(this.form).forEach(key => {
|
params[key] = this.form[key].value
|
})
|
params.checkFlag = true
|
updateEnterpriseBaseInfo(params).then(res => {
|
if (res.code === '00') {
|
this.$message.success('保存成功')
|
// this.$emit('handleNextPage', true)
|
this.oldForm = Object.assign(this.oldForm, this.form)
|
}
|
})
|
} else {
|
this.$message.warning('当前页面存在必填项未录入或数据录入错误,请检查!')
|
return false
|
}
|
})
|
},
|
// 只能输入设置数字
|
changMoney(value, config) {
|
// console.log(isNaN(value), value, config)
|
// 数字
|
if (!isNaN(value)) {
|
if (config.name === 'registeredcapital') {
|
this.form[`${config.name}`].value = this.formatMoney(value)
|
}
|
// console.log(config.name)
|
} else {
|
this.form[`${config.name}`].value = ''
|
this.$message.warning(`${config.filedDescription}输入有误,请重新输入!`)
|
}
|
},
|
},
|
beforeRouteLeave (to, from, next) {
|
// console.log(this.form)
|
// console.log(this.oldForm)
|
// console.log(this.nextChange)
|
if (this.nextChange) {
|
for (const key in this.oldForm) {
|
if (this.oldForm.hasOwnProperty(key)) {
|
if (this.oldForm[key].value != this.form[key].value) {
|
// console.log(this.oldForm[key].value)
|
// console.log(this.form[key].value)
|
this.$confirm(`当前页面有未保存的数据,是否放弃保存`, '提示', {
|
confirmButtonText: '是',
|
cancelButtonText: '否',
|
customClass: 'enp_messages_box',
|
confirmButtonClass: 'enp_messages_box_confirm',
|
cancelButtonClass: 'enp_messages_box_cancel',
|
center: true
|
})
|
.then(() => {
|
next()
|
})
|
.catch(() => {
|
this.$emit('notNext')
|
})
|
return
|
}
|
}
|
}
|
}
|
next()
|
}
|
}
|
</script>
|
|
<style scoped></style>
|