Commit 8b9e92e0 authored by 高宇's avatar 高宇

关联企业 修复部分bug

parent edd78e12
...@@ -39,6 +39,16 @@ const thousand = { ...@@ -39,6 +39,16 @@ const thousand = {
} else { } else {
return s return s
} }
},
//用于会显示,带有小数点的数字转化为千分位
decimalFmoney(num) {
const res=num.toString().replace(/\d+/, function(n){ // 先提取小数点前后的整数部分
//(\d)(?=(\d{3})正则的意思是匹配连续三个数结尾的数字,例如1234,1后面有234连续三个数的数字,就可以匹配上,匹配的是1这个数字。如果是123,因为1后面是两位数,所以就匹配不上了
return n.replace(/(\d)(?=(\d{3})+$)/g,function($1){
return $1+",";
});
})
return res;
} }
} }
export default thousand export default thousand
...@@ -887,8 +887,8 @@ export default { ...@@ -887,8 +887,8 @@ export default {
// document.getElementsByClassName('AffiliatedEnterprises-module')[0].scrollIntoView(true) // document.getElementsByClassName('AffiliatedEnterprises-module')[0].scrollIntoView(true)
// }, // },
mounted() { mounted() {
this.getAffiliateInfo() this.getAffiliateInfo() //
this.getAddressJson() this.getAddressJson() //获取地址json数据
// this.changTitle() // this.changTitle()
}, },
methods: { methods: {
...@@ -1228,28 +1228,61 @@ export default { ...@@ -1228,28 +1228,61 @@ export default {
} }
this.form = res.data[0] this.form = res.data[0]
this.form.registeredCapital = this.thousand.rmoney(res.data[0].registeredCapital)
this.Intellectual[0].intellectualProperty = this.form.intellectualProperty this.form.registeredCapital = this.thousand.decimalFmoney(res.data[0].registeredCapital)
this.Intellectual[0].patentsNumber = this.form.patentsNumber this.Intellectual[0].intellectualProperty = this.thousand.fmoney(this.form.intellectualProperty)
this.Intellectual[0].trademarksNumber = this.form.trademarksNumber this.Intellectual[0].patentsNumber = this.thousand.fmoney(this.form.patentsNumber)
this.Intellectual[0].softwareWorksNumber = this.form.softwareWorksNumber this.Intellectual[0].trademarksNumber =this.thousand.fmoney(this.form.trademarksNumber)
this.Intellectual[0].softwareWorksNumber = this.thousand.fmoney(this.form.softwareWorksNumber)
this.ProjectInformation[0].projectStatus = this.form.projectStatus this.ProjectInformation[0].projectStatus = this.form.projectStatus
this.ProjectInformation[0].projectInvestment = this.form.projectInvestment this.ProjectInformation[0].projectInvestment =this.thousand.fmoney(this.form.projectInvestment)
this.ProjectInformation[0].implementationTime = this.form.implementationTime this.ProjectInformation[0].implementationTime = this.form.implementationTime
this.VehicleInformation[0].graduateCompanies = this.form.graduateCompanies this.VehicleInformation[0].graduateCompanies = this.form.graduateCompanies
this.VehicleInformation[0].carrierDominanceArea = this.form.carrierDominanceArea this.VehicleInformation[0].carrierDominanceArea = this.form.carrierDominanceArea
this.VehicleInformation[0].incubationCompanies = this.form.incubationCompanies this.VehicleInformation[0].incubationCompanies = this.form.incubationCompanies
if (res.data[0].userEnterpriseOperateRelativeList.length >=1 && res.data[0].userEnterpriseOperateRelativeList.length <=3){
for (var i =0;i<res.data[0].userEnterpriseOperateRelativeList.length; i++){
// console.log(res.rows[0].userEnterpriseOperateRelativeList[i].year)
this.form.userEnterpriseOperateRelativeList[i].year = res.data[0].userEnterpriseOperateRelativeList[i].year
this.form.userEnterpriseOperateRelativeList[i].operatingIncome = this.thousand.fmoney(res.data[0].userEnterpriseOperateRelativeList[i].operatingIncome)
this.form.userEnterpriseOperateRelativeList[i].tax = this.thousand.fmoney(res.data[0].userEnterpriseOperateRelativeList[i].tax)
this.form.userEnterpriseOperateRelativeList[i].assetTotal = this.thousand.fmoney(res.data[0].userEnterpriseOperateRelativeList[i].assetTotal)
this.form.userEnterpriseOperateRelativeList[i].netProfit = this.thousand.fmoney(res.data[0].userEnterpriseOperateRelativeList[i].netProfit)
this.form.userEnterpriseOperateRelativeList[i].mainBusinessIncome = this.thousand.fmoney(res.data[0].userEnterpriseOperateRelativeList[i].mainBusinessIncome)
this.form.userEnterpriseOperateRelativeList[i].researchInvestment = this.thousand.fmoney(res.data[0].userEnterpriseOperateRelativeList[i].mainBusinessIncome)
}
}else if (res.data[0].userEnterpriseOperateRelativeList.length ===0) {
this.form.userEnterpriseOperateRelativeList = [
{
year: '2022',
assetTotal: '',
netProfit: '',
operatingIncome: '',
mainBusinessIncome: '',
tax: '',
researchInvestment: ''
},
{
year: '2021',
assetTotal: '',
netProfit: '',
operatingIncome: '',
mainBusinessIncome: '',
tax: '',
researchInvestment: ''
},
{
year: '2020',
assetTotal: '',
netProfit: '',
operatingIncome: '',
mainBusinessIncome: '',
tax: '',
researchInvestment: ''
}
]
}
console.log('form=>', this.form) console.log('form=>', this.form)
// if (this.form.address !== '' && this.form.address != null) {
// var province = this.form.address.slice(0, 4)
// var city = this.form.address.slice(4, 8)
// var area = this.form.address.slice(8, 12)
// var address = []
// address.push(province)
// address.push(city)
// address.push(area)
// this.address = address
// }
this.dialog.dialogVisible = false this.dialog.dialogVisible = false
// location.reload() // location.reload()
this.$emit('reload', '关联企业') this.$emit('reload', '关联企业')
...@@ -1385,7 +1418,7 @@ export default { ...@@ -1385,7 +1418,7 @@ export default {
}, },
/** 切换中移除企业**/ /** 切换中移除企业**/
async deleteInfo(row) { async deleteInfo(row) {
console.log(row.id) // console.log(row.id)
const deleteInfoById = await this.$confirm('<span style="color: #333333;font-size: 15px;">确定要移除企业么</span>', '提示', { const deleteInfoById = await this.$confirm('<span style="color: #333333;font-size: 15px;">确定要移除企业么</span>', '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
...@@ -1400,7 +1433,7 @@ export default { ...@@ -1400,7 +1433,7 @@ export default {
deleteEnterprisesInterface(row.id).then(res => { deleteEnterprisesInterface(row.id).then(res => {
if (res.code === 200) { if (res.code === 200) {
getCurrentAffiliatedEnterprises().then(res => { getCurrentAffiliatedEnterprises().then(res => {
console.log(res.data) // console.log(res.data)
this.EnterprisesList = res.data this.EnterprisesList = res.data
// console.log(this.EnterprisesList) // console.log(this.EnterprisesList)
}) })
...@@ -1418,7 +1451,7 @@ export default { ...@@ -1418,7 +1451,7 @@ export default {
/** 完善信息**/ /** 完善信息**/
updataInfo(row) { updataInfo(row) {
// 显示企业id // 显示企业id
console.log(row.id) // console.log(row.id)
this.$router.push({ this.$router.push({
path: '/personalCenter/components/AffiliatedEnterprisesUpdate', path: '/personalCenter/components/AffiliatedEnterprisesUpdate',
query: { query: {
...@@ -1429,14 +1462,14 @@ export default { ...@@ -1429,14 +1462,14 @@ export default {
/** 切换企业**/ /** 切换企业**/
switchEnterprises() { switchEnterprises() {
console.log('切换企业') console.log('切换企业')
console.log("this.form.id>>>>>", this.form.id) // console.log("this.form.id>>>>>", this.form.id)
console.log("当前企业id为>>>>>", this.currentEnterprisesId) // console.log("当前企业id为>>>>>", this.currentEnterprisesId)
this.dialog.dialogVisible = true this.dialog.dialogVisible = true
console.log('-------------------') // console.log('-------------------')
getCurrentAffiliatedEnterprises().then(res => { getCurrentAffiliatedEnterprises().then(res => {
this.EnterprisesList = res.data this.EnterprisesList = res.data
console.log('this.EnterprisesList->', this.EnterprisesList) // console.log('this.EnterprisesList->', this.EnterprisesList)
console.log('this.form.id', this.form.id) // console.log('this.form.id', this.form.id)
this.$nextTick().then(() => { this.$nextTick().then(() => {
this.EnterprisesList.forEach(item => { this.EnterprisesList.forEach(item => {
if (item.id === this.form.id) { if (item.id === this.form.id) {
...@@ -1449,9 +1482,9 @@ export default { ...@@ -1449,9 +1482,9 @@ export default {
/** 接口测试**/ /** 接口测试**/
test() { test() {
getAffiliate().then(res => { getAffiliate().then(res => {
console.log(res) // console.log(res)
}).catch(err => { }).catch(err => {
console.log(err) // console.log(err)
}) })
}, },
/** 编辑**/ /** 编辑**/
...@@ -1469,7 +1502,7 @@ export default { ...@@ -1469,7 +1502,7 @@ export default {
getAffiliateInfo() { getAffiliateInfo() {
getAffiliate().then(res => { getAffiliate().then(res => {
if (res.code === 200) { if (res.code === 200) {
console.log(res) // console.log(res)
const list1 = [] const list1 = []
const list2 = [] const list2 = []
const list3 = [] const list3 = []
...@@ -1480,47 +1513,34 @@ export default { ...@@ -1480,47 +1513,34 @@ export default {
} else { } else {
this.listStatus = 1 this.listStatus = 1
this.form = res.rows[0] this.form = res.rows[0]
// this.form.name = res.rows[0].name
// console.log("this.form.name>>>",this.form.name)
// console.log("res.rows[0].userEnterpriseTabRelativeList>>>",res.rows[0].userEnterpriseTabRelativeList)
for (var i = 0; i < res.rows[0].userEnterpriseTabRelativeList.length; i++) { for (var i = 0; i < res.rows[0].userEnterpriseTabRelativeList.length; i++) {
if (res.rows[0].userEnterpriseTabRelativeList[i].type === '1') { if (res.rows[0].userEnterpriseTabRelativeList[i].type === '1') {
list1.push(res.rows[0].userEnterpriseTabRelativeList[i].tabId) list1.push(res.rows[0].userEnterpriseTabRelativeList[i].tabId)
// console.log(' 企业类型')
} else if (res.rows[0].userEnterpriseTabRelativeList[i].type === '2') { } else if (res.rows[0].userEnterpriseTabRelativeList[i].type === '2') {
// console.log(' 企业性质')
list2.push(res.rows[0].userEnterpriseTabRelativeList[i].tabId) list2.push(res.rows[0].userEnterpriseTabRelativeList[i].tabId)
} else if (res.rows[0].userEnterpriseTabRelativeList[i].type === '3') { } else if (res.rows[0].userEnterpriseTabRelativeList[i].type === '3') {
// console.log(' 所属领域')
list3.push(res.rows[0].userEnterpriseTabRelativeList[i].tabId) list3.push(res.rows[0].userEnterpriseTabRelativeList[i].tabId)
} else if (res.rows[0].userEnterpriseTabRelativeList[i].type === '4') { } else if (res.rows[0].userEnterpriseTabRelativeList[i].type === '4') {
// console.log(' 企业资质')
list4.push(res.rows[0].userEnterpriseTabRelativeList[i].tabId) list4.push(res.rows[0].userEnterpriseTabRelativeList[i].tabId)
} else if (res.rows[0].userEnterpriseTabRelativeList[i].type === '5') { } else if (res.rows[0].userEnterpriseTabRelativeList[i].type === '5') {
// console.log(' 企业技术能力')
list5.push(res.rows[0].userEnterpriseTabRelativeList[i].tabId) list5.push(res.rows[0].userEnterpriseTabRelativeList[i].tabId)
} }
} }
this.form.registeredCapital = this.thousand.decimalFmoney(res.rows[0].registeredCapital)
this.form.registeredCapital = this.thousand.rmoney(res.rows[0].registeredCapital)
// console.log(" this.form.registeredCapital>>>", this.form.registeredCapital)
this.currentEnterprisesId = this.form.id this.currentEnterprisesId = this.form.id
this.Intellectual[0].intellectualProperty = this.form.intellectualProperty this.Intellectual[0].intellectualProperty = this.thousand.fmoney(this.form.intellectualProperty)
this.Intellectual[0].patentsNumber = this.form.patentsNumber this.Intellectual[0].patentsNumber = this.thousand.fmoney(this.form.patentsNumber)
this.Intellectual[0].trademarksNumber = this.form.trademarksNumber this.Intellectual[0].trademarksNumber = this.thousand.fmoney(this.form.trademarksNumber)
this.Intellectual[0].softwareWorksNumber = this.form.softwareWorksNumber this.Intellectual[0].softwareWorksNumber = this.thousand.fmoney(this.form.softwareWorksNumber)
this.ProjectInformation[0].projectStatus = this.form.projectStatus this.ProjectInformation[0].projectStatus = this.form.projectStatus
this.ProjectInformation[0].projectInvestment = this.form.projectInvestment this.ProjectInformation[0].projectInvestment = this.thousand.decimalFmoney(this.form.projectInvestment)
this.ProjectInformation[0].implementationTime = this.form.implementationTime this.ProjectInformation[0].implementationTime = this.form.implementationTime
this.VehicleInformation[0].graduateCompanies = this.form.graduateCompanies this.VehicleInformation[0].graduateCompanies = this.form.graduateCompanies
this.VehicleInformation[0].carrierDominanceArea = this.form.carrierDominanceArea this.VehicleInformation[0].carrierDominanceArea = this.form.carrierDominanceArea
this.VehicleInformation[0].incubationCompanies = this.form.incubationCompanies this.VehicleInformation[0].incubationCompanies = this.form.incubationCompanies
console.log(this.form.address) // console.log(this.form.address)
// console.log('this.form.address', this.form.address)
this.object1.tabId = list1 this.object1.tabId = list1
console.log(this.form.enterpriseType) // console.log(this.form.enterpriseType)
// console.log('this.form.enterpriseType>', this.form.enterpriseType)
this.object2.tabId = list2 this.object2.tabId = list2
this.object3.tabId = list3 this.object3.tabId = list3
this.object4.tabId = list4 this.object4.tabId = list4
...@@ -1529,7 +1549,7 @@ export default { ...@@ -1529,7 +1549,7 @@ export default {
policyTabGetByName('企业类型').then(res => { policyTabGetByName('企业类型').then(res => {
if (res.code === 200) { if (res.code === 200) {
this.enterpriseType = res.data[0].childrenList this.enterpriseType = res.data[0].childrenList
console.log("this.enterpriseType>>>>", res.data[0].childrenList) // console.log("this.enterpriseType>>>>", res.data[0].childrenList)
if (this.typeName1.length > 0) { if (this.typeName1.length > 0) {
this.typeName1 = [] this.typeName1 = []
} }
...@@ -1537,7 +1557,7 @@ export default { ...@@ -1537,7 +1557,7 @@ export default {
this.object1.tabId.forEach(item => { this.object1.tabId.forEach(item => {
this.typeName1.push(this.enterpriseType.find(optionItem => optionItem.id === item).name) this.typeName1.push(this.enterpriseType.find(optionItem => optionItem.id === item).name)
console.log("this.typeName1>>>>",this.typeName1) // console.log("this.typeName1>>>>",this.typeName1)
}) })
} }
}) })
...@@ -1546,26 +1566,26 @@ export default { ...@@ -1546,26 +1566,26 @@ export default {
// console.log("res.data[0].childrenList>>>",res.data[0].childrenList) // console.log("res.data[0].childrenList>>>",res.data[0].childrenList)
this.EnterpriseNature = res.data[0].childrenList this.EnterpriseNature = res.data[0].childrenList
if (this.typeName2.length > 0) { if (this.typeName2.length > 0) {
console.log('this.typeName2.length', this.typeName2.length) // console.log('this.typeName2.length', this.typeName2.length)
this.typeName2 = [] this.typeName2 = []
} }
this.object2.tabId.forEach(item => { this.object2.tabId.forEach(item => {
this.typeName2.push(this.EnterpriseNature.find(optionItem => optionItem.id === item).name) this.typeName2.push(this.EnterpriseNature.find(optionItem => optionItem.id === item).name)
}) })
console.log("this.typeName2",this.typeName2) // console.log("this.typeName2",this.typeName2)
} }
}) })
policyTabGetByName('所属领域').then(res => { policyTabGetByName('所属领域').then(res => {
if (res.code === 200) { if (res.code === 200) {
this.BelongsField = res.data[0].childrenList this.BelongsField = res.data[0].childrenList
if (this.typeName3.length > 0) { if (this.typeName3.length > 0) {
console.log('this.typeName3.length', this.typeName3.length) // console.log('this.typeName3.length', this.typeName3.length)
this.typeName3 = [] this.typeName3 = []
} }
console.log('this.typeName3.length', this.typeName3.length) // console.log('this.typeName3.length', this.typeName3.length)
this.object3.tabId.forEach(item => { this.object3.tabId.forEach(item => {
console.log('typeName3', item) // console.log('typeName3', item)
this.typeName3.push(this.BelongsField.find(optionItem => optionItem.id === item).name) this.typeName3.push(this.BelongsField.find(optionItem => optionItem.id === item).name)
}) })
} }
...@@ -1574,12 +1594,12 @@ export default { ...@@ -1574,12 +1594,12 @@ export default {
if (res.code === 200) { if (res.code === 200) {
this.EnterpriseQualification = res.data[0].childrenList this.EnterpriseQualification = res.data[0].childrenList
if (this.typeName4.length > 0) { if (this.typeName4.length > 0) {
console.log('this.typeName4.length', this.typeName4.length) // console.log('this.typeName4.length', this.typeName4.length)
this.typeName4 = [] this.typeName4 = []
} }
console.log('this.typeName4.length', this.typeName4.length) // console.log('this.typeName4.length', this.typeName4.length)
this.object4.tabId.forEach(item => { this.object4.tabId.forEach(item => {
console.log('item', item) // console.log('item', item)
this.typeName4.push(this.EnterpriseQualification.find(optionItem => optionItem.id === item).name) this.typeName4.push(this.EnterpriseQualification.find(optionItem => optionItem.id === item).name)
}) })
} }
...@@ -1588,16 +1608,59 @@ export default { ...@@ -1588,16 +1608,59 @@ export default {
if (res.code === 200) { if (res.code === 200) {
this.EnterpriseTechnical = res.data[0].childrenList this.EnterpriseTechnical = res.data[0].childrenList
if (this.typeName5.length > 0) { if (this.typeName5.length > 0) {
console.log('this.typeName5.length', this.typeName5.length) // console.log('this.typeName5.length', this.typeName5.length)
this.typeName5 = [] this.typeName5 = []
} }
console.log('this.typeName5.length', this.typeName5.length) // console.log('this.typeName5.length', this.typeName5.length)
this.object5.tabId.forEach(item => { this.object5.tabId.forEach(item => {
console.log('item', item) // console.log('item', item)
this.typeName5.push(this.EnterpriseTechnical.find(optionItem => optionItem.id === item).name) this.typeName5.push(this.EnterpriseTechnical.find(optionItem => optionItem.id === item).name)
}) })
} }
}) })
if (res.rows[0].userEnterpriseOperateRelativeList.length >=1 && res.rows[0].userEnterpriseOperateRelativeList.length <=3){
for (var i =0;i<res.rows[0].userEnterpriseOperateRelativeList.length; i++){
// console.log(res.rows[0].userEnterpriseOperateRelativeList[i].year)
this.form.userEnterpriseOperateRelativeList[i].year = res.rows[0].userEnterpriseOperateRelativeList[i].year
this.form.userEnterpriseOperateRelativeList[i].operatingIncome = this.thousand.fmoney(res.rows[0].userEnterpriseOperateRelativeList[i].operatingIncome)
this.form.userEnterpriseOperateRelativeList[i].tax = this.thousand.fmoney(res.rows[0].userEnterpriseOperateRelativeList[i].tax)
this.form.userEnterpriseOperateRelativeList[i].assetTotal = this.thousand.fmoney(res.rows[0].userEnterpriseOperateRelativeList[i].assetTotal)
this.form.userEnterpriseOperateRelativeList[i].netProfit = this.thousand.fmoney(res.rows[0].userEnterpriseOperateRelativeList[i].netProfit)
this.form.userEnterpriseOperateRelativeList[i].mainBusinessIncome = this.thousand.fmoney(res.rows[0].userEnterpriseOperateRelativeList[i].mainBusinessIncome)
this.form.userEnterpriseOperateRelativeList[i].researchInvestment = this.thousand.fmoney(res.rows[0].userEnterpriseOperateRelativeList[i].mainBusinessIncome)
}
}else if (res.rows[0].userEnterpriseOperateRelativeList.length ===0) {
this.form.userEnterpriseOperateRelativeList = [
{
year: '2022',
assetTotal: '',
netProfit: '',
operatingIncome: '',
mainBusinessIncome: '',
tax: '',
researchInvestment: ''
},
{
year: '2021',
assetTotal: '',
netProfit: '',
operatingIncome: '',
mainBusinessIncome: '',
tax: '',
researchInvestment: ''
},
{
year: '2020',
assetTotal: '',
netProfit: '',
operatingIncome: '',
mainBusinessIncome: '',
tax: '',
researchInvestment: ''
}
]
}
} }
} }
}) })
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment