|
|
@ -296,10 +296,20 @@ |
|
|
|
</el-col> |
|
|
|
<el-col :span="12"> |
|
|
|
<el-form-item label="项目所在地" prop="projectLocation"> |
|
|
|
<el-input |
|
|
|
<!-- <el-input |
|
|
|
v-model="form.projectLocation" |
|
|
|
placeholder="请输入项目所在地" |
|
|
|
/> |
|
|
|
/> --> |
|
|
|
<el-cascader |
|
|
|
:options="areasOptions" |
|
|
|
v-model="form.projectLocation" |
|
|
|
:props="areasOptionProps" |
|
|
|
placeholder="请选择项目所在地" |
|
|
|
clearable |
|
|
|
size="small" |
|
|
|
style="width: 100%" |
|
|
|
> |
|
|
|
</el-cascader> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="12"> |
|
|
@ -447,7 +457,7 @@ |
|
|
|
</el-descriptions-item> |
|
|
|
<el-descriptions-item> |
|
|
|
<template slot="label"> 项目所在地 </template> |
|
|
|
{{ this.performanceRecordMsg.projectLocation }} |
|
|
|
{{ formatProjectLocation(this.performanceRecordMsg) }} |
|
|
|
</el-descriptions-item> |
|
|
|
<el-descriptions-item> |
|
|
|
<template slot="label"> 项目状态 </template> |
|
|
@ -512,7 +522,8 @@ import { |
|
|
|
exportPerformanceRecord, |
|
|
|
} from "@/api/enterprise/performanceRecord"; |
|
|
|
import { getParentQualifications } from "@/api/enterprise/qualifications"; |
|
|
|
|
|
|
|
import { getAreasData } from "@/api/areas/index"; |
|
|
|
import { regionData, codeToText, TextToCode } from "element-china-area-data"; |
|
|
|
import { getToken } from "@/utils/auth"; |
|
|
|
import { getFileStream } from "@/api/system/upload"; |
|
|
|
|
|
|
@ -521,6 +532,11 @@ export default { |
|
|
|
props: ["enterpriseId"], |
|
|
|
data() { |
|
|
|
return { |
|
|
|
areasOptionProps: { |
|
|
|
emitPath: false, //value返回最后一级的 |
|
|
|
checkStrictly: true, //选择任意一级 |
|
|
|
}, |
|
|
|
areasOptions: [], |
|
|
|
// 遮罩层 |
|
|
|
loading: true, |
|
|
|
// 选中数组 |
|
|
@ -591,6 +607,7 @@ export default { |
|
|
|
}; |
|
|
|
}, |
|
|
|
created() { |
|
|
|
this.getTreeData(); |
|
|
|
this.getList(); |
|
|
|
this.getDicts("qualification_type").then((response) => { |
|
|
|
this.qualificationCategoryOptions = response.data; |
|
|
@ -600,6 +617,55 @@ export default { |
|
|
|
}); |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
formatProjectLocation(row) { |
|
|
|
if (row.projectLocation) { |
|
|
|
let provinceCode = row.projectLocation.slice(0, 2); |
|
|
|
let cityCode = row.projectLocation.slice(2, 4); |
|
|
|
let areaCode = row.projectLocation.slice(4, 6); |
|
|
|
if (areaCode != "00") { |
|
|
|
return ( |
|
|
|
codeToText[provinceCode] + |
|
|
|
"-" + |
|
|
|
codeToText[provinceCode + cityCode] + |
|
|
|
"-" + |
|
|
|
codeToText[provinceCode + cityCode + areaCode] |
|
|
|
); |
|
|
|
} else if (cityCode != "00") { |
|
|
|
return ( |
|
|
|
codeToText[provinceCode] + "-" + codeToText[provinceCode + cityCode] |
|
|
|
); |
|
|
|
} else { |
|
|
|
return codeToText[provinceCode]; |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
getTreeData() { |
|
|
|
getAreasData().then((items) => { |
|
|
|
// console.log("getAreasData", items.data); |
|
|
|
let res = []; |
|
|
|
let getChildren = (res, pid) => { |
|
|
|
for (const i of items.data) { |
|
|
|
if (i.parentid === pid) { |
|
|
|
const newItem = { |
|
|
|
label: i.name, |
|
|
|
value: i.id, |
|
|
|
}; |
|
|
|
if (i.layer != 3) newItem.children = []; |
|
|
|
res.push(newItem); |
|
|
|
getChildren(newItem.children, newItem.value); |
|
|
|
} |
|
|
|
} |
|
|
|
}; |
|
|
|
getChildren(res, items.data[0].parentid); |
|
|
|
// console.log("areasOptions", res); |
|
|
|
this.areasOptions = res; |
|
|
|
// 当不是admin时,默认行政区域 |
|
|
|
// if (this.$userProfile.createUid != "admin") { |
|
|
|
// this.queryParams.data.adcd = this.areasOptions[0].value; |
|
|
|
// } |
|
|
|
// return res; |
|
|
|
}); |
|
|
|
}, |
|
|
|
/** 查询工程业绩记录列表 */ |
|
|
|
getList() { |
|
|
|
this.loading = true; |
|
|
|