2 changed files with 504 additions and 3 deletions
@ -1,3 +1,491 @@ |
|||
<template> |
|||
<div>qiye</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 label="绑定状态" prop="bindStatus"> |
|||
<el-select |
|||
v-model="queryParams.data.bindStatus" |
|||
placeholder="请选择绑定状态" |
|||
filterable |
|||
clearable |
|||
size="small" |
|||
style="width: 100%" |
|||
@change="handleQuery" |
|||
> |
|||
<el-option label="未绑定" value="0" /> |
|||
<el-option label="已绑定" value="1" /> |
|||
</el-select> |
|||
</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-popconfirm |
|||
icon="el-icon-info" |
|||
icon-color="green" |
|||
title="确定绑定吗" |
|||
@confirm="handleAdd" |
|||
> |
|||
<el-button |
|||
slot="reference" |
|||
type="primary" |
|||
icon="el-icon-plus" |
|||
size="mini" |
|||
:disabled="multiple" |
|||
>绑定新项目</el-button |
|||
> |
|||
</el-popconfirm> |
|||
</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 |
|||
:selectable="checkSelectable" |
|||
/> |
|||
<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="proNo" |
|||
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-popconfirm |
|||
icon="el-icon-info" |
|||
icon-color="green" |
|||
title="确定绑定吗" |
|||
@confirm="handleAdd(scope.row)" |
|||
> |
|||
<el-button |
|||
slot="reference" |
|||
size="mini" |
|||
type="text" |
|||
icon="el-icon-connection" |
|||
v-if="scope.row.bindStatus === '0'" |
|||
>绑定</el-button |
|||
> |
|||
</el-popconfirm> |
|||
<el-button |
|||
size="mini" |
|||
type="text" |
|||
icon="el-icon-connection" |
|||
v-if="scope.row.bindStatus === '1'" |
|||
>已绑定</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 { legalLinkEnterprise, legalEnterpriseList } from "@/api/common"; |
|||
import { getAreasData } from "@/api/areas/index"; |
|||
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, |
|||
pageSize: 10, |
|||
ids: null, |
|||
data: { |
|||
projectName: null, |
|||
adcd: null, |
|||
}, |
|||
// 排序方式 |
|||
params: { |
|||
// 按哪个字段排序 |
|||
orderBy: "create_time", |
|||
// desc降序,升序asc |
|||
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() { |
|||
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: { |
|||
checkSelectable(row) { |
|||
return row.bindStatus === "0"; |
|||
}, |
|||
getList() { |
|||
this.loading = true; |
|||
legalEnterpriseList(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) { |
|||
legalLinkEnterprise(proNos).then((res) => { |
|||
if (res.code === 200) { |
|||
this.msgSuccess("绑定成功"); |
|||
// this.open = false; |
|||
this.getList(); |
|||
} |
|||
}); |
|||
// } |
|||
// }); |
|||
}, |
|||
}, |
|||
}; |
|||
</script> |
|||
|
Loading…
Reference in new issue