|
|
@ -1,11 +1,247 @@ |
|
|
|
<template> |
|
|
|
<div>xaingmu</div> |
|
|
|
<div class="app-container"> |
|
|
|
<!-- 面包屑 --> |
|
|
|
<el-breadcrumb separator="/" style="margin-bottom: 20px"> |
|
|
|
<el-breadcrumb-item |
|
|
|
v-for="(item, index) in routeList" |
|
|
|
:key="item + index" |
|
|
|
:to="{ path: item.path }" |
|
|
|
>{{ item.routeName }}</el-breadcrumb-item |
|
|
|
> |
|
|
|
</el-breadcrumb> |
|
|
|
|
|
|
|
<el-form |
|
|
|
:model="queryParams" |
|
|
|
ref="queryForm" |
|
|
|
:inline="true" |
|
|
|
v-show="showSearch" |
|
|
|
> |
|
|
|
<el-form-item label="项目名称" prop="projectName"> |
|
|
|
<el-input |
|
|
|
v-model="queryParams.data.projectName" |
|
|
|
placeholder="请输入项目名称" |
|
|
|
clearable |
|
|
|
size="small" |
|
|
|
@keyup.enter.native="handleQuery" |
|
|
|
> |
|
|
|
<el-button |
|
|
|
type="primary" |
|
|
|
slot="append" |
|
|
|
icon="el-icon-search" |
|
|
|
size="small" |
|
|
|
@click="handleQuery" |
|
|
|
></el-button> |
|
|
|
</el-input> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="行政区划" prop="adcd"> |
|
|
|
<el-cascader |
|
|
|
:options="areasOptions" |
|
|
|
v-model="queryParams.data.adcd" |
|
|
|
:props="areasOptionProps" |
|
|
|
placeholder="请选择行政区划" |
|
|
|
clearable |
|
|
|
size="small" |
|
|
|
style="width: 100%" |
|
|
|
@change="handleQuery" |
|
|
|
> |
|
|
|
</el-cascader> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item> |
|
|
|
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery" |
|
|
|
>重置</el-button |
|
|
|
> |
|
|
|
</el-form-item> |
|
|
|
</el-form> |
|
|
|
|
|
|
|
<el-row :gutter="10" class="mb8"> |
|
|
|
<el-col :span="1.5"> |
|
|
|
<el-button |
|
|
|
type="primary" |
|
|
|
icon="el-icon-plus" |
|
|
|
size="mini" |
|
|
|
:disabled="multiple" |
|
|
|
@click="handleAdd" |
|
|
|
v-hasPermi="['bind:project:add']" |
|
|
|
>绑定新项目</el-button |
|
|
|
> |
|
|
|
</el-col> |
|
|
|
<!-- <el-col :span="1.5"> |
|
|
|
<el-button |
|
|
|
type="danger" |
|
|
|
icon="el-icon-delete" |
|
|
|
size="mini" |
|
|
|
:disabled="multiple" |
|
|
|
@click="handleDelete" |
|
|
|
v-hasPermi="['bind:project:remove']" |
|
|
|
>解除绑定</el-button |
|
|
|
> |
|
|
|
</el-col> --> |
|
|
|
<right-toolbar |
|
|
|
:showSearch.sync="showSearch" |
|
|
|
@queryTable="getList" |
|
|
|
></right-toolbar> |
|
|
|
</el-row> |
|
|
|
|
|
|
|
<el-table |
|
|
|
v-loading="loading" |
|
|
|
:data="infoList" |
|
|
|
@selection-change="handleSelectionChange" |
|
|
|
> |
|
|
|
<el-table-column type="selection" width="55" align="center" fixed /> |
|
|
|
<el-table-column |
|
|
|
label="序号" |
|
|
|
type="index" |
|
|
|
width="50" |
|
|
|
align="center" |
|
|
|
fixed |
|
|
|
/> |
|
|
|
|
|
|
|
<el-table-column |
|
|
|
label="项目名称" |
|
|
|
align="center" |
|
|
|
prop="projectName" |
|
|
|
min-width="120" |
|
|
|
/> |
|
|
|
<el-table-column |
|
|
|
label="项目编码" |
|
|
|
align="center" |
|
|
|
prop="proCode" |
|
|
|
min-width="120" |
|
|
|
/> |
|
|
|
<el-table-column |
|
|
|
label="行政区划" |
|
|
|
align="center" |
|
|
|
prop="adcd" |
|
|
|
min-width="120" |
|
|
|
:formatter="$formatAdcd" |
|
|
|
/> |
|
|
|
<el-table-column |
|
|
|
label="绑定状态" |
|
|
|
align="center" |
|
|
|
prop="bindStatus" |
|
|
|
min-width="120" |
|
|
|
> |
|
|
|
<template slot-scope="scope"> |
|
|
|
{{ scope.row.bindStatus === "1" ? "已绑定" : "未绑定" }} |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<!-- <el-table-column |
|
|
|
label="项目类型" |
|
|
|
align="center" |
|
|
|
prop="projectType" |
|
|
|
:formatter="projectTypeFormat" |
|
|
|
min-width="120" |
|
|
|
/> |
|
|
|
<el-table-column |
|
|
|
label="建设性质" |
|
|
|
align="center" |
|
|
|
prop="constructionNature" |
|
|
|
:formatter="constructionNatureFormat" |
|
|
|
min-width="120" |
|
|
|
/> |
|
|
|
|
|
|
|
<el-table-column |
|
|
|
label="总投资金额(万元)" |
|
|
|
align="center" |
|
|
|
prop="total" |
|
|
|
min-width="150" |
|
|
|
/> --> |
|
|
|
<el-table-column |
|
|
|
label="操作" |
|
|
|
align="center" |
|
|
|
class-name="small-padding fixed-width" |
|
|
|
min-width="180" |
|
|
|
fixed="right" |
|
|
|
> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<el-button |
|
|
|
size="mini" |
|
|
|
type="text" |
|
|
|
icon="el-icon-connection" |
|
|
|
@click="handleAdd(scope.row)" |
|
|
|
>绑定</el-button |
|
|
|
> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
</el-table> |
|
|
|
|
|
|
|
<pagination |
|
|
|
v-show="total > 0" |
|
|
|
:total="total" |
|
|
|
:page.sync="queryParams.pageNum" |
|
|
|
:limit.sync="queryParams.pageSize" |
|
|
|
@pagination="getList" |
|
|
|
/> |
|
|
|
|
|
|
|
<!-- 添加或修改项目基本信息管理对话框 --> |
|
|
|
<!-- <el-dialog |
|
|
|
:title="title" |
|
|
|
:visible.sync="open" |
|
|
|
width="1200px" |
|
|
|
append-to-body |
|
|
|
:close-on-click-modal="false" |
|
|
|
> |
|
|
|
<el-form |
|
|
|
ref="form" |
|
|
|
:model="form" |
|
|
|
:rules="rules" |
|
|
|
label-width="180px" |
|
|
|
label-position="top" |
|
|
|
> |
|
|
|
<el-form-item label="项目名称" prop="projectName"> |
|
|
|
<el-select |
|
|
|
v-model="form.projectName" |
|
|
|
placeholder="请输入项目名称" |
|
|
|
filterable |
|
|
|
clearable |
|
|
|
size="small" |
|
|
|
style="width: 100%" |
|
|
|
multiple |
|
|
|
> |
|
|
|
<el-option |
|
|
|
v-for="dict in projectNameOptions" |
|
|
|
:key="dict.projectName + dict.id" |
|
|
|
:label="dict.projectName" |
|
|
|
:value="dict.proNo" |
|
|
|
/> |
|
|
|
</el-select> |
|
|
|
</el-form-item> |
|
|
|
</el-form> |
|
|
|
|
|
|
|
<div class="dialog-footer" slot="footer"> |
|
|
|
<el-button type="primary" @click="submitForm">确 定</el-button> |
|
|
|
<el-button @click="cancel">取 消</el-button> |
|
|
|
</div> |
|
|
|
</el-dialog> --> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
<script> |
|
|
|
import { legalLinkProject, legalProjectList } from "@/api/common"; |
|
|
|
import { getAreasData } from "@/api/areas/index"; |
|
|
|
import { listProDesign, getProDesign } from "@/api/earlyStage/preDesign"; |
|
|
|
export default { |
|
|
|
data() { |
|
|
|
return { |
|
|
|
// 遮罩层 |
|
|
|
loading: true, |
|
|
|
// 显示搜索条件 |
|
|
|
showSearch: true, |
|
|
|
// 总条数 |
|
|
|
total: 0, |
|
|
|
// 项目绑定数据 |
|
|
|
infoList: [], |
|
|
|
// 面包屑,路由信息 |
|
|
|
routeList: [ |
|
|
|
{ |
|
|
|
path: "/projectAndEnterpriseBindingMange/projectBinding", |
|
|
|
routeName: "项目绑定", |
|
|
|
}, |
|
|
|
], |
|
|
|
areasOptions: [], |
|
|
|
areasOptionProps: { |
|
|
|
emitPath: false, |
|
|
|
checkStrictly: true, //选择任意一级 |
|
|
|
}, |
|
|
|
// 查询参数 |
|
|
|
queryParams: { |
|
|
|
pageNum: 1, |
|
|
@ -23,12 +259,190 @@ export default { |
|
|
|
sortBy: "desc", |
|
|
|
}, |
|
|
|
}, |
|
|
|
proQueryParams: { |
|
|
|
pageNum: 1, |
|
|
|
pageSize: 10, |
|
|
|
ids: null, |
|
|
|
data: { |
|
|
|
projectName: null, |
|
|
|
constructionNature: null, |
|
|
|
constructionLocation: null, |
|
|
|
projectUnitName: null, |
|
|
|
briefIntroduction: null, |
|
|
|
projectLandSituation: null, |
|
|
|
designEstimateReport: null, |
|
|
|
relatedAttachment: null, |
|
|
|
projectCode: null, |
|
|
|
proNo: null, |
|
|
|
createUid: null, |
|
|
|
createTime: null, |
|
|
|
updateUid: null, |
|
|
|
updateTime: null, |
|
|
|
owerDept: null, |
|
|
|
}, |
|
|
|
cv: {}, |
|
|
|
// 排序方式 |
|
|
|
params: { |
|
|
|
// 按哪个字段排序 |
|
|
|
orderBy: "create_time", |
|
|
|
// desc降序,升序asc |
|
|
|
sortBy: "desc", |
|
|
|
}, |
|
|
|
}, |
|
|
|
open: false, |
|
|
|
title: "", |
|
|
|
// 非多个禁用 |
|
|
|
multiple: true, |
|
|
|
// 选中的项目数组 |
|
|
|
proNos: [], |
|
|
|
// 表单参数 |
|
|
|
form: {}, |
|
|
|
rules: { |
|
|
|
projectName: [ |
|
|
|
{ required: true, message: "请选择关联的项目", trigger: "blur" }, |
|
|
|
], |
|
|
|
}, |
|
|
|
// 重大项目字典 |
|
|
|
zd_projectTypeOptions: [], |
|
|
|
// 面上项目字典 |
|
|
|
ms_projectTypeOptions: [], |
|
|
|
// 建设性质字典 |
|
|
|
constructionNatureOptions: [], |
|
|
|
//项目名称 |
|
|
|
projectNameOptions: [], |
|
|
|
}; |
|
|
|
}, |
|
|
|
created() { |
|
|
|
legalProjectList(this.queryParams).then((res) => { |
|
|
|
console.log(res); |
|
|
|
this.getList(); |
|
|
|
this.getDicts("CONSTRUCTION_NATURE").then((response) => { |
|
|
|
this.constructionNatureOptions = response.data; |
|
|
|
}); |
|
|
|
this.getDicts("major_project").then((response) => { |
|
|
|
// console.log("4444444444444444", response.data); |
|
|
|
this.zd_projectTypeOptions = response.data; |
|
|
|
}); |
|
|
|
this.getDicts("general_project").then((response) => { |
|
|
|
// console.log("5555555555555", response.data); |
|
|
|
this.ms_projectTypeOptions = response.data; |
|
|
|
}); |
|
|
|
|
|
|
|
this.getTreeData(); |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
getList() { |
|
|
|
this.loading = true; |
|
|
|
legalProjectList(this.queryParams).then((res) => { |
|
|
|
this.infoList = res.records; |
|
|
|
this.total = res.total; |
|
|
|
console.log("this.infoList", this.infoList); |
|
|
|
this.loading = false; |
|
|
|
}); |
|
|
|
}, |
|
|
|
// 建设性质字典 |
|
|
|
constructionNatureFormat(row, column) { |
|
|
|
return this.selectDictLabel( |
|
|
|
this.constructionNatureOptions, |
|
|
|
row.constructionNature |
|
|
|
); |
|
|
|
}, |
|
|
|
// 项目类型字典翻译 |
|
|
|
projectTypeFormat(row, column) { |
|
|
|
if (row.isMajor == "zd") { |
|
|
|
return this.selectDictLabel( |
|
|
|
this.zd_projectTypeOptions, |
|
|
|
row.projectType |
|
|
|
); |
|
|
|
} else if (row.isMajor == "ms") { |
|
|
|
return this.selectDictLabel( |
|
|
|
this.ms_projectTypeOptions, |
|
|
|
row.projectType |
|
|
|
); |
|
|
|
} |
|
|
|
}, |
|
|
|
// 取消按钮 |
|
|
|
cancel() { |
|
|
|
this.open = false; |
|
|
|
}, |
|
|
|
/** 搜索按钮操作 */ |
|
|
|
handleQuery() { |
|
|
|
this.queryParams.pageNum = 1; |
|
|
|
this.getList(); |
|
|
|
}, |
|
|
|
/** 重置按钮操作 */ |
|
|
|
resetQuery() { |
|
|
|
this.resetQueryForm(); |
|
|
|
this.handleQuery(); |
|
|
|
}, |
|
|
|
// 查询表单重置 |
|
|
|
resetQueryForm() { |
|
|
|
this.queryParams = { |
|
|
|
pageNum: 1, |
|
|
|
pageSize: 10, |
|
|
|
data: { |
|
|
|
projectName: null, |
|
|
|
adcd: null, |
|
|
|
}, |
|
|
|
// 排序方式 |
|
|
|
params: { |
|
|
|
// 按哪个字段排序 |
|
|
|
orderBy: "create_time", |
|
|
|
// desc降序,升序asc |
|
|
|
sortBy: "desc", |
|
|
|
}, |
|
|
|
}; |
|
|
|
this.resetForm("form"); |
|
|
|
}, |
|
|
|
getTreeData() { |
|
|
|
getAreasData().then((items) => { |
|
|
|
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); |
|
|
|
this.areasOptions = res; |
|
|
|
}); |
|
|
|
}, |
|
|
|
// 多选框选中数据 |
|
|
|
handleSelectionChange(selection) { |
|
|
|
this.proNos = selection.map((item) => item.proNo); |
|
|
|
this.multiple = !selection.length; |
|
|
|
console.log(1111, this.proNos); |
|
|
|
}, |
|
|
|
|
|
|
|
/** 新增按钮操作 */ |
|
|
|
handleAdd(row) { |
|
|
|
// listProDesign(this.proQueryParams).then((response) => { |
|
|
|
// this.projectNameOptions = response.records; |
|
|
|
// }); |
|
|
|
// this.open = true; |
|
|
|
// this.title = "绑定项目"; |
|
|
|
let proNos = row.proNo ? [row.proNo] : this.proNos; |
|
|
|
// this.form.proNo = proNos; |
|
|
|
this.submitForm(proNos); |
|
|
|
}, |
|
|
|
submitForm(proNos) { |
|
|
|
// this.$refs["form"].validate((valid) => { |
|
|
|
// if (valid) { |
|
|
|
legalLinkProject(proNos).then((res) => { |
|
|
|
if (res.code === 200) { |
|
|
|
this.msgSuccess("绑定成功"); |
|
|
|
// this.open = false; |
|
|
|
this.getList(); |
|
|
|
} |
|
|
|
}); |
|
|
|
// } |
|
|
|
// }); |
|
|
|
}, |
|
|
|
}, |
|
|
|
}; |
|
|
|
</script> |
|
|
|