You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1059 lines
32 KiB
1059 lines
32 KiB
<template>
|
|
<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-row :gutter="20" v-show="showSearch">
|
|
<el-col :span="22">
|
|
<el-form
|
|
:model="queryParams"
|
|
ref="queryForm"
|
|
:inline="true"
|
|
v-show="showSearch"
|
|
label-width="70px"
|
|
>
|
|
<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
|
|
type="cyan"
|
|
icon="el-icon-search"
|
|
size="mini"
|
|
@click="handleQuery"
|
|
>搜索</el-button
|
|
> -->
|
|
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
|
|
>重置</el-button
|
|
>
|
|
</el-form-item>
|
|
</el-form>
|
|
</el-col>
|
|
</el-row>
|
|
|
|
<el-row :gutter="10" class="mb8">
|
|
<el-col :span="1.5">
|
|
<el-button
|
|
type="primary"
|
|
icon="el-icon-plus"
|
|
size="mini"
|
|
@click="handleAdd"
|
|
v-hasPermi="['earlyStage:feasibility:add']"
|
|
>新增</el-button
|
|
>
|
|
</el-col>
|
|
<el-col :span="1.5">
|
|
<el-button
|
|
type="success"
|
|
icon="el-icon-edit"
|
|
size="mini"
|
|
:disabled="single"
|
|
@click="handleUpdate"
|
|
v-hasPermi="['earlyStage:proDesign:edit']"
|
|
>修改</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="['earlyStage:proDesign:remove']"
|
|
>删除</el-button
|
|
>
|
|
</el-col>
|
|
|
|
<right-toolbar
|
|
:showSearch.sync="showSearch"
|
|
@queryTable="getList"
|
|
></right-toolbar>
|
|
</el-row>
|
|
|
|
<el-table
|
|
v-loading="loading"
|
|
:data="proDesignList"
|
|
@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="150"
|
|
/>
|
|
<el-table-column
|
|
label="项目编码"
|
|
align="center"
|
|
prop="projectCode"
|
|
min-width="180"
|
|
/>
|
|
<el-table-column
|
|
label="行政区划"
|
|
align="center"
|
|
prop="adcd"
|
|
min-width="180"
|
|
:formatter="formatAdcd"
|
|
/>
|
|
<el-table-column
|
|
label="建设性质"
|
|
align="center"
|
|
prop="constructionNature"
|
|
:formatter="constructionNatureFormat"
|
|
min-width="150"
|
|
/>
|
|
<el-table-column
|
|
label="建设地点"
|
|
align="center"
|
|
prop="constructionLocation"
|
|
min-width="150"
|
|
/>
|
|
<el-table-column
|
|
label="项目单位名称"
|
|
align="center"
|
|
prop="projectUnitName"
|
|
min-width="150"
|
|
/>
|
|
<el-table-column
|
|
label="简介"
|
|
align="center"
|
|
prop="briefIntroduction"
|
|
min-width="180"
|
|
:show-overflow-tooltip="true"
|
|
/>
|
|
<el-table-column
|
|
label="项目用地情况"
|
|
align="center"
|
|
prop="projectLandSituation"
|
|
min-width="150"
|
|
:show-overflow-tooltip="true"
|
|
/>
|
|
<!-- <el-table-column
|
|
label="初步设计概算报告"
|
|
align="center"
|
|
prop="designEstimateReport"
|
|
min-width="150"
|
|
>
|
|
<template slot-scope="scope">
|
|
<div
|
|
v-for="(item, index) in JSON.parse(scope.row.designEstimateReport)"
|
|
:key="item + index"
|
|
>
|
|
<i class="el-icon-document"></i>
|
|
{{ item.name }}
|
|
<i
|
|
class="el-icon-download"
|
|
@click="downloadDesignFile(scope, index)"
|
|
style="cursor: pointer"
|
|
></i>
|
|
</div>
|
|
</template>
|
|
</el-table-column>
|
|
<el-table-column
|
|
label="相关上位规划附件"
|
|
align="center"
|
|
prop="relatedAttachment"
|
|
min-width="180"
|
|
>
|
|
<template slot-scope="scope">
|
|
<div
|
|
v-for="(item, index) in JSON.parse(scope.row.relatedAttachment)"
|
|
:key="item + index"
|
|
>
|
|
<i class="el-icon-document"></i>
|
|
{{ item.name }}
|
|
<i
|
|
class="el-icon-download"
|
|
@click="downloadRelatedFile(scope, index)"
|
|
style="cursor: pointer"
|
|
></i>
|
|
</div>
|
|
</template>
|
|
</el-table-column> -->
|
|
|
|
<el-table-column
|
|
label="操作"
|
|
align="center"
|
|
class-name="small-padding fixed-width"
|
|
width="180"
|
|
fixed="right"
|
|
>
|
|
<template slot-scope="scope">
|
|
<el-button
|
|
size="mini"
|
|
type="text"
|
|
icon="el-icon-view"
|
|
@click="viewInfo(scope.row)"
|
|
>查看</el-button
|
|
>
|
|
<el-button
|
|
size="mini"
|
|
type="text"
|
|
icon="el-icon-edit"
|
|
@click="handleUpdate(scope.row)"
|
|
v-hasPermi="['earlyStage:proDesign:edit']"
|
|
>修改</el-button
|
|
>
|
|
<el-button
|
|
size="mini"
|
|
type="text"
|
|
icon="el-icon-delete"
|
|
@click="handleDelete(scope.row)"
|
|
v-hasPermi="['earlyStage:proDesign:remove']"
|
|
>删除</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"
|
|
style="margin-top: 0"
|
|
append-to-body
|
|
@close="close"
|
|
:close-on-click-modal="false"
|
|
>
|
|
<el-form ref="form" :model="form" :rules="rules" label-width="130px">
|
|
<el-form-item label="项目名称" prop="projectName">
|
|
<!-- <el-input v-model="form.projectName" placeholder="请输入项目名称" /> -->
|
|
<el-select
|
|
v-model="form.projectName"
|
|
placeholder="项目名称"
|
|
filterable
|
|
clearable
|
|
size="small"
|
|
style="width: 100%"
|
|
>
|
|
<el-option
|
|
v-for="dict in projectNameOptions"
|
|
:key="dict.projectName + dict.id"
|
|
:label="dict.projectName + '[' + dict.projectCode + ']'"
|
|
:value="dict.projectName + '[' + dict.projectCode + ']'"
|
|
@click.native="getId(dict)"
|
|
/>
|
|
</el-select>
|
|
</el-form-item>
|
|
<el-form-item label="建设性质" prop="constructionNature">
|
|
<!-- <el-input
|
|
v-model="form.constructionNature"
|
|
placeholder="请输入建设性质"
|
|
/> -->
|
|
<el-select
|
|
v-model="form.constructionNature"
|
|
placeholder="请选择建设性质"
|
|
style="width: 100%"
|
|
clearable
|
|
>
|
|
<el-option
|
|
v-for="dict in constructionNatureOptions"
|
|
:key="dict.dictValue"
|
|
:label="dict.dictLabel"
|
|
:value="dict.dictValue"
|
|
></el-option>
|
|
</el-select>
|
|
</el-form-item>
|
|
<el-form-item label="建设地点" prop="constructionLocation">
|
|
<el-input
|
|
v-model="form.constructionLocation"
|
|
placeholder="请输入建设地点"
|
|
/>
|
|
</el-form-item>
|
|
<el-form-item label="项目单位名称" prop="projectUnitName">
|
|
<el-input
|
|
v-model="form.projectUnitName"
|
|
placeholder="请输入项目单位名称"
|
|
/>
|
|
</el-form-item>
|
|
<el-form-item label="简介" prop="briefIntroduction">
|
|
<el-input
|
|
v-model="form.briefIntroduction"
|
|
placeholder="请输入简介"
|
|
type="textarea"
|
|
/>
|
|
</el-form-item>
|
|
<el-form-item label="项目用地情况" prop="projectLandSituation">
|
|
<el-input
|
|
v-model="form.projectLandSituation"
|
|
placeholder="请输入项目用地情况"
|
|
type="textarea"
|
|
/>
|
|
</el-form-item>
|
|
<el-form-item label="初步设计概算报告" prop="designEstimateReport">
|
|
<!-- <el-input
|
|
v-model="form.designEstimateReport"
|
|
placeholder="请输入初步设计概算报告"
|
|
/> -->
|
|
<el-upload
|
|
class="upload-demo"
|
|
action="thinking/common/upload"
|
|
:headers="headers"
|
|
:before-upload="(file) => $fileBeforeUpload(file, 'fileList')"
|
|
:on-preview="handleDesignPreview"
|
|
:on-remove="handleDesignRemove"
|
|
:before-remove="beforeDesignRemove"
|
|
:on-exceed="handleDesignExceed"
|
|
:on-success="submitDesignUpload"
|
|
:file-list="designFileList"
|
|
>
|
|
<el-button size="small" type="primary" plain>
|
|
<i class="el-icon-upload el-icon--right"></i>
|
|
点击上传
|
|
</el-button>
|
|
<div slot="tip" class="el-upload__tip">
|
|
支持jpg/png/pdf/word/excel文件等,不超过100M
|
|
</div>
|
|
</el-upload>
|
|
</el-form-item>
|
|
<el-form-item label="相关上位规划附件" prop="relatedAttachment">
|
|
<!-- <el-input
|
|
v-model="form.relatedAttachment"
|
|
type="textarea"
|
|
placeholder="请输入内容"
|
|
/> -->
|
|
<el-upload
|
|
class="upload-demo"
|
|
action="thinking/common/upload"
|
|
:headers="headers"
|
|
:before-upload="
|
|
(file) => $fileBeforeUpload(file, 'relatedFileList')
|
|
"
|
|
:on-preview="handleRelatedPreview"
|
|
:on-remove="handleRelatedRemove"
|
|
:before-remove="beforeRelatedRemove"
|
|
:on-exceed="handleRelatedExceed"
|
|
:on-success="submitRelatedUpload"
|
|
:file-list="relatedFileList"
|
|
>
|
|
<el-button size="small" type="primary" plain>
|
|
<i class="el-icon-upload el-icon--right"></i>
|
|
点击上传
|
|
</el-button>
|
|
<div slot="tip" class="el-upload__tip">
|
|
支持jpg/png/pdf/word/excel文件等,不超过100M
|
|
</div>
|
|
</el-upload>
|
|
</el-form-item>
|
|
</el-form>
|
|
<div slot="footer" class="dialog-footer">
|
|
<el-button type="primary" @click="submitForm">确 定</el-button>
|
|
<el-button @click="cancel">取 消</el-button>
|
|
</div>
|
|
</el-dialog>
|
|
|
|
<!--查看 -->
|
|
<el-dialog
|
|
:title="viewTitle"
|
|
:visible.sync="viewOpen"
|
|
width="1200px"
|
|
append-to-body
|
|
@close="closeView"
|
|
:close-on-click-modal="false"
|
|
>
|
|
<!-- 初步设计管理信息 -->
|
|
<div class="infoTitle">初步设计管理信息</div>
|
|
<div class="draLine"></div>
|
|
<div class="content">
|
|
<el-descriptions
|
|
class="margin-top"
|
|
:column="2"
|
|
border
|
|
:labelStyle="{
|
|
'text-align': 'left',
|
|
width: '180px',
|
|
height: '50px',
|
|
}"
|
|
:contentStyle="{ minWidth: '350px' }"
|
|
>
|
|
<el-descriptions-item>
|
|
<template slot="label"> 招标项目名称 </template>
|
|
<!-- {{ this.viewTitle }} -->
|
|
{{
|
|
this.designMsg.projectName +
|
|
"[" +
|
|
this.designMsg.projectCode +
|
|
"]"
|
|
}}
|
|
</el-descriptions-item>
|
|
<el-descriptions-item>
|
|
<template slot="label"> 行政区划 </template>
|
|
{{ formatAdcd(this.designMsg) }}
|
|
</el-descriptions-item>
|
|
<el-descriptions-item>
|
|
<template slot="label"> 建设性质 </template>
|
|
{{ this.constructionNatureFormat(this.designMsg) }}
|
|
</el-descriptions-item>
|
|
<el-descriptions-item>
|
|
<template slot="label"> 建设地点 </template>
|
|
{{ this.designMsg.constructionLocation }}
|
|
</el-descriptions-item>
|
|
<el-descriptions-item>
|
|
<template slot="label"> 项目单位名称 </template>
|
|
{{ this.designMsg.projectUnitName }}
|
|
</el-descriptions-item>
|
|
<el-descriptions-item span="2">
|
|
<template slot="label"> 简介 </template>
|
|
{{ this.designMsg.briefIntroduction }}
|
|
</el-descriptions-item>
|
|
<el-descriptions-item span="2">
|
|
<template slot="label"> 项目用地情况 </template>
|
|
{{ this.designMsg.projectLandSituation }}
|
|
</el-descriptions-item>
|
|
<el-descriptions-item span="2">
|
|
<template slot="label"> 初步设计概算报告 </template>
|
|
<template v-if="this.designMsg.designEstimateReport">
|
|
<div
|
|
v-for="(item, index) in JSON.parse(
|
|
this.designMsg.designEstimateReport
|
|
)"
|
|
:key="item + index"
|
|
>
|
|
{{ item.name }}
|
|
|
|
<i
|
|
class="el-icon-download"
|
|
@click="downloadDesignFile2(item, index)"
|
|
style="cursor: pointer"
|
|
></i>
|
|
</div>
|
|
</template>
|
|
</el-descriptions-item>
|
|
<el-descriptions-item span="2">
|
|
<template slot="label"> 相关上位规划附件 </template>
|
|
<template v-if="this.designMsg.relatedAttachment">
|
|
<div
|
|
v-for="(item, index) in JSON.parse(
|
|
this.designMsg.relatedAttachment
|
|
)"
|
|
:key="item + index"
|
|
>
|
|
{{ item.name }}
|
|
|
|
<i
|
|
class="el-icon-download"
|
|
@click="downloadRelatedFile2(item, index)"
|
|
style="cursor: pointer"
|
|
></i>
|
|
</div>
|
|
</template>
|
|
</el-descriptions-item>
|
|
</el-descriptions>
|
|
</div>
|
|
</el-dialog>
|
|
</div>
|
|
</template>
|
|
|
|
<script>
|
|
import {
|
|
listProDesign,
|
|
getProDesign,
|
|
delProDesign,
|
|
addProDesign,
|
|
updateProDesign,
|
|
exportProDesign,
|
|
} from "@/api/earlyStage/preDesign";
|
|
import {
|
|
listProposal,
|
|
getProposal,
|
|
delProposal,
|
|
addProposal,
|
|
updateProposal,
|
|
exportProposal,
|
|
getProjectCode,
|
|
} from "@/api/earlyStage/proposal";
|
|
import { getToken } from "@/utils/auth";
|
|
import { getFileStream } from "@/api/system/upload";
|
|
import { getAreasData } from "@/api/areas/index";
|
|
import { regionData, codeToText, TextToCode } from "element-china-area-data";
|
|
|
|
export default {
|
|
name: "PreDesign",
|
|
data() {
|
|
return {
|
|
areasOptionProps: {
|
|
emitPath: false,
|
|
checkStrictly: true, //选择任意一级
|
|
// lazy: true,
|
|
// lazyLoad: function qylazyLoad(node) {
|
|
// // node.level = 5;
|
|
// console.log("node", node.level);
|
|
// },
|
|
},
|
|
areasOptions: [],
|
|
// 面包屑,路由信息
|
|
routeList: [
|
|
{
|
|
path: "/project/preDesign",
|
|
routeName: "初步设计管理",
|
|
},
|
|
],
|
|
// 遮罩层
|
|
loading: true,
|
|
// 选中数组
|
|
ids: [],
|
|
// 非单个禁用
|
|
single: true,
|
|
// 非多个禁用
|
|
multiple: true,
|
|
// 显示搜索条件
|
|
showSearch: true,
|
|
// 总条数
|
|
total: 0,
|
|
// 初步设计管理表格数据
|
|
proDesignList: [],
|
|
// 项目名称
|
|
projectNameOptions: [],
|
|
// 建设性质字典
|
|
constructionNatureOptions: [],
|
|
// 弹出层标题
|
|
title: "",
|
|
// 是否显示弹出层
|
|
open: false,
|
|
viewOpen: false,
|
|
// 查询参数
|
|
queryParams: {
|
|
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
|
|
sort: "desc",
|
|
},
|
|
},
|
|
// 表单参数
|
|
form: {},
|
|
// 表单校验
|
|
rules: {
|
|
projectName: [
|
|
{ required: true, message: "请输入项目名称", trigger: "blur" },
|
|
],
|
|
projectUnitName: [
|
|
{ required: true, message: "请输入项目单位名称", trigger: "blur" },
|
|
{ max: 250, message: "字符长度最大为250", trigger: "blur" },
|
|
],
|
|
constructionLocation: [
|
|
{ required: true, message: "请输入建设地点", trigger: "blur" },
|
|
{ max: 250, message: "字符长度最大为250", trigger: "blur" },
|
|
],
|
|
briefIntroduction: [
|
|
{ max: 65500, message: "字符长度最大为65500", trigger: "blur" },
|
|
],
|
|
projectLandSituation: [
|
|
{ max: 65500, message: "字符长度最大为65500", trigger: "blur" },
|
|
],
|
|
},
|
|
// 初步设计概算报告
|
|
designFileList: [],
|
|
// 相关上位规划附件
|
|
relatedFileList: [],
|
|
|
|
// 请求头
|
|
headers: {
|
|
jianwei: "jwtech " + getToken(),
|
|
},
|
|
viewTitle: "",
|
|
designMsg: {},
|
|
projectType: "",
|
|
proNo: "",
|
|
projectCode: "",
|
|
};
|
|
},
|
|
created() {
|
|
this.getTreeData();
|
|
this.getList();
|
|
this.getDicts("CONSTRUCTION_NATURE").then((response) => {
|
|
// 获取规划类型
|
|
this.constructionNatureOptions = response.data;
|
|
});
|
|
},
|
|
methods: {
|
|
formatAdcd(row) {
|
|
if (row.adcd) {
|
|
let provinceCode = row.adcd.slice(0, 2);
|
|
let cityCode = row.adcd.slice(2, 4);
|
|
let areaCode = row.adcd.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;
|
|
});
|
|
},
|
|
handleChange(value) {
|
|
//value为省市区code数组
|
|
if (value) {
|
|
console.log("value", value);
|
|
}
|
|
},
|
|
getId(res) {
|
|
// console.log(res)
|
|
getProposal(res.id).then((response) => {
|
|
console.log("777777777777777", response.data);
|
|
this.projectType = response.data.projectType;
|
|
this.proNo = response.data.proNo;
|
|
this.projectCode = response.data.projectCode;
|
|
this.form.adcd = response.data.adcd;
|
|
});
|
|
},
|
|
/** 查询初步设计管理列表 */
|
|
getList() {
|
|
this.loading = true;
|
|
listProDesign(this.queryParams).then((response) => {
|
|
this.proDesignList = response.records;
|
|
this.total = response.total;
|
|
this.loading = false;
|
|
});
|
|
},
|
|
constructionNatureFormat(row, column) {
|
|
return this.selectDictLabel(
|
|
this.constructionNatureOptions,
|
|
row.constructionNature
|
|
);
|
|
},
|
|
projectNameFormat(row) {
|
|
if (row.projectName) {
|
|
return row.projectName.slice(0, row.projectName.indexOf("["));
|
|
}
|
|
},
|
|
// 表单重置
|
|
reset() {
|
|
this.form = {
|
|
id: null,
|
|
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,
|
|
};
|
|
this.designFileList = [];
|
|
this.relatedFileList = [];
|
|
this.resetForm("form");
|
|
},
|
|
// 查询表单重置
|
|
resetQueryForm() {
|
|
this.queryParams = {
|
|
pageNum: 1,
|
|
pageSize: 10,
|
|
data: {
|
|
id: null,
|
|
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: {
|
|
name: null,
|
|
type: null,
|
|
},
|
|
// 排序方式
|
|
params: {
|
|
// 按哪个字段排序
|
|
orderBy: "create_time",
|
|
// desc降序,升序asc
|
|
sort: "desc",
|
|
},
|
|
};
|
|
this.resetForm("form");
|
|
},
|
|
/** 搜索按钮操作 */
|
|
handleQuery() {
|
|
// this.queryParams.cv.name = "projectName";
|
|
// this.queryParams.cv.type = "like";
|
|
this.queryParams.pageNum = 1;
|
|
this.getList();
|
|
},
|
|
/** 重置按钮操作 */
|
|
resetQuery() {
|
|
this.resetQueryForm();
|
|
this.handleQuery();
|
|
},
|
|
// 多选框选中数据
|
|
handleSelectionChange(selection) {
|
|
this.ids = selection.map((item) => item.id);
|
|
this.single = selection.length !== 1;
|
|
this.multiple = !selection.length;
|
|
},
|
|
/** 新增按钮操作 */
|
|
handleAdd() {
|
|
this.reset();
|
|
listProposal(this.queryParams).then((response) => {
|
|
this.projectNameOptions = response.records;
|
|
console.log("this.projectNameOptions", this.projectNameOptions);
|
|
});
|
|
this.open = true;
|
|
this.title = "添加初步设计管理";
|
|
},
|
|
/** 修改按钮操作 */
|
|
handleUpdate(row) {
|
|
console.log("row", row);
|
|
this.reset();
|
|
const id = row.id || this.ids;
|
|
getProDesign(id).then((response) => {
|
|
this.form = response.data;
|
|
if (response.data.relatedAttachment) {
|
|
this.relatedFileList = JSON.parse(response.data.relatedAttachment);
|
|
}
|
|
if (response.data.designEstimateReport) {
|
|
this.designFileList = JSON.parse(response.data.designEstimateReport);
|
|
}
|
|
this.form.projectName =
|
|
this.form.projectName + "[" + this.form.projectCode + "]";
|
|
this.open = true;
|
|
this.title = "修改初步设计管理";
|
|
});
|
|
listProposal(this.queryParams).then((response) => {
|
|
this.projectNameOptions = response.records;
|
|
});
|
|
},
|
|
/** 提交按钮 */
|
|
submitForm() {
|
|
this.$refs["form"].validate((valid) => {
|
|
if (valid) {
|
|
// 附件
|
|
this.form.relatedAttachment = JSON.stringify(this.relatedFileList);
|
|
this.form.designEstimateReport = JSON.stringify(this.designFileList);
|
|
|
|
if (this.proNo) {
|
|
this.form.proNo = this.proNo;
|
|
}
|
|
if (this.projectCode) {
|
|
this.form.projectCode = this.projectCode;
|
|
}
|
|
if (this.projectType) {
|
|
this.form.projectType = this.projectType;
|
|
}
|
|
if (
|
|
this.form.projectName &&
|
|
this.form.projectName.indexOf("[") != -1
|
|
) {
|
|
this.form.projectName = this.form.projectName.slice(
|
|
0,
|
|
this.form.projectName.indexOf("[")
|
|
);
|
|
}
|
|
if (this.form.id != null) {
|
|
this.form.proNo = this.proNo;
|
|
this.form.projectType = this.projectType;
|
|
updateProDesign(this.form).then((response) => {
|
|
if (response.code === 200) {
|
|
this.msgSuccess("修改成功");
|
|
this.open = false;
|
|
this.getList();
|
|
}
|
|
});
|
|
} else {
|
|
addProDesign(this.form).then((response) => {
|
|
if (response.code === 200) {
|
|
this.msgSuccess("新增成功");
|
|
this.open = false;
|
|
this.getList();
|
|
}
|
|
});
|
|
}
|
|
}
|
|
});
|
|
},
|
|
// 取消按钮
|
|
cancel() {
|
|
this.open = false;
|
|
},
|
|
// 关闭弹窗
|
|
close() {
|
|
this.reset();
|
|
},
|
|
|
|
// 查看信息
|
|
viewInfo(row) {
|
|
this.viewTitle = row.projectName;
|
|
const id = row.id;
|
|
getProDesign(id).then((response) => {
|
|
this.designMsg = response.data;
|
|
console.log("designMsg", this.designMsg);
|
|
this.viewOpen = true;
|
|
});
|
|
},
|
|
// 关闭弹窗
|
|
closeView() {
|
|
this.designMsg = {};
|
|
},
|
|
|
|
/** 删除按钮操作 */
|
|
handleDelete(row) {
|
|
const ids = row.id || this.ids;
|
|
if (ids) {
|
|
this.$confirm("是否删除选中的数据?", "警告", {
|
|
confirmButtonText: "确定",
|
|
cancelButtonText: "取消",
|
|
type: "warning",
|
|
})
|
|
.then(function () {
|
|
return delProDesign(ids);
|
|
})
|
|
.then(() => {
|
|
this.getList();
|
|
this.msgSuccess("删除成功");
|
|
})
|
|
.catch(function () {});
|
|
} else {
|
|
this.$message.warning("请选择要删除的数据!!");
|
|
}
|
|
},
|
|
|
|
// ===================初步设计概算报告========================
|
|
submitDesignUpload(_, fileList) {
|
|
console.log("fileList", fileList);
|
|
this.designFileList.push({
|
|
name: fileList.name,
|
|
fileName: fileList.response.fileName,
|
|
url: fileList.response.url,
|
|
uid: fileList.uid,
|
|
});
|
|
},
|
|
handleDesignRemove(file, fileList) {
|
|
// console.log(file, fileList);
|
|
let index = this.designFileList.findIndex(
|
|
(item) => item.uid === file.uid
|
|
);
|
|
// 删除文件
|
|
this.designFileList.splice(index, 1);
|
|
},
|
|
// 表格中下载
|
|
downloadDesignFile(scope, index) {
|
|
console.log(scope);
|
|
let file = JSON.parse(scope.row.designEstimateReport)[index];
|
|
this.handleRelatedPreview(file);
|
|
},
|
|
// 查看信息中, 下载
|
|
downloadDesignFile2(info, index) {
|
|
console.log(info);
|
|
this.handleDesignPreview(info);
|
|
},
|
|
// 点击预览下载文件
|
|
handleDesignPreview(file) {
|
|
// console.log(file);
|
|
getFileStream({ fileName: file.fileName }).then((res) => {
|
|
const blob = new Blob([res], {
|
|
// type类型后端返回来的数据中会有,根据自己实际进行修改
|
|
// 表格下载为 application/xlsx,压缩包为 application/zip等,
|
|
type: "application/xlsx",
|
|
}); //excel,pdf等
|
|
const href = URL.createObjectURL(blob); //创建新的URL表示指定的blob对象
|
|
const a = document.createElement("a"); //创建a标签
|
|
a.style.display = "none";
|
|
a.href = href; // 指定下载链接
|
|
a.download = file.name; //指定下载文件名
|
|
a.click(); //触发下载
|
|
URL.revokeObjectURL(a.href); //释放URL对象
|
|
});
|
|
},
|
|
handleDesignExceed(files, fileList) {
|
|
this.$message.warning(
|
|
`当前限制选择 3 个文件,本次选择了 ${files.length} 个文件,共选择了 ${
|
|
files.length + fileList.length
|
|
} 个文件`
|
|
);
|
|
},
|
|
beforeDesignRemove(file, fileList) {
|
|
return this.$confirm(`确定移除 ${file.name}?`);
|
|
},
|
|
|
|
// =============相关上位规划附件==========
|
|
submitRelatedUpload(_, fileList) {
|
|
console.log("fileList", fileList);
|
|
this.relatedFileList.push({
|
|
name: fileList.name,
|
|
fileName: fileList.response.fileName,
|
|
url: fileList.response.url,
|
|
uid: fileList.uid,
|
|
});
|
|
},
|
|
handleRelatedRemove(file, fileList) {
|
|
// console.log(file, fileList);
|
|
let index = this.relatedFileList.findIndex(
|
|
(item) => item.uid === file.uid
|
|
);
|
|
// 删除文件
|
|
this.relatedFileList.splice(index, 1);
|
|
},
|
|
// 表格中下载
|
|
downloadRelatedFile(scope, index) {
|
|
// console.log(scope);
|
|
let file = JSON.parse(scope.row.relatedAttachment)[index];
|
|
this.handleRelatedPreview(file);
|
|
},
|
|
// 查看信息中, 下载
|
|
downloadRelatedFile2(info, index) {
|
|
console.log(info);
|
|
this.handleRelatedPreview(info);
|
|
},
|
|
// 点击预览下载文件
|
|
handleRelatedPreview(file) {
|
|
// console.log(file);
|
|
getFileStream({ fileName: file.fileName }).then((res) => {
|
|
const blob = new Blob([res], {
|
|
// type类型后端返回来的数据中会有,根据自己实际进行修改
|
|
// 表格下载为 application/xlsx,压缩包为 application/zip等,
|
|
type: "application/xlsx",
|
|
}); //excel,pdf等
|
|
const href = URL.createObjectURL(blob); //创建新的URL表示指定的blob对象
|
|
const a = document.createElement("a"); //创建a标签
|
|
a.style.display = "none";
|
|
a.href = href; // 指定下载链接
|
|
a.download = file.name; //指定下载文件名
|
|
a.click(); //触发下载
|
|
URL.revokeObjectURL(a.href); //释放URL对象
|
|
});
|
|
},
|
|
handleRelatedExceed(files, fileList) {
|
|
this.$message.warning(
|
|
`当前限制选择 3 个文件,本次选择了 ${files.length} 个文件,共选择了 ${
|
|
files.length + fileList.length
|
|
} 个文件`
|
|
);
|
|
},
|
|
beforeRelatedRemove(file, fileList) {
|
|
return this.$confirm(`确定移除 ${file.name}?`);
|
|
},
|
|
},
|
|
};
|
|
</script>
|
|
<style lang="scss" scoped>
|
|
@import "@/assets/css/dialog.scss";
|
|
::v-deep {
|
|
.el-dialog {
|
|
margin-top: 10vh !important;
|
|
}
|
|
}
|
|
</style>
|
|
|