Browse Source

在建-质量管理大体完成

dev_kxc
xzt 1 year ago
parent
commit
9f7be586bd
  1. 13
      jwtech-admin-page/src/views/building/projectInfo/projectProcess/index.vue
  2. 3
      jwtech-admin-page/src/views/building/projectInfo/projectProcess/peasantWorkerSystem/index.vue
  3. 368
      jwtech-admin-page/src/views/building/projectInfo/projectProcess/qualityControl/options/components/viewReport.vue
  4. 113
      jwtech-admin-page/src/views/building/projectInfo/projectProcess/qualityControl/options/engineeringQualityInspection.vue
  5. 2
      jwtech-admin-page/src/views/building/projectInfo/projectProcess/qualityControl/options/itemDivision/components/itemDivisionManage.vue
  6. 656
      jwtech-admin-page/src/views/building/projectInfo/projectProcess/qualityControl/options/safetyRecord.vue

13
jwtech-admin-page/src/views/building/projectInfo/projectProcess/index.vue

@ -128,6 +128,17 @@
> >
<investment :proNo="formData.proNo" :proCode="formData.proCode" /> <investment :proNo="formData.proNo" :proCode="formData.proCode" />
</el-tab-pane> </el-tab-pane>
<el-tab-pane
label="农民工制度管理"
name="peasantWorkerSystem"
:disabled="!routeList[1].isEdit"
:lazy="true"
>
<peasantWorkerSystem
:proNo="formData.proNo"
:proCode="formData.proCode"
/>
</el-tab-pane>
<el-tab-pane <el-tab-pane
label="项目验收" label="项目验收"
name="projectAcceptance" name="projectAcceptance"
@ -155,6 +166,7 @@ import scheduleManagement from "./scheduleManagement.vue";
import supervisionAndManagement from "./supervisionAndManagement/index.vue"; import supervisionAndManagement from "./supervisionAndManagement/index.vue";
import projectLegalPersonEvaluation from "./projectLegalPersonEvaluation.vue"; import projectLegalPersonEvaluation from "./projectLegalPersonEvaluation.vue";
import investment from "./investment/index.vue"; import investment from "./investment/index.vue";
import peasantWorkerSystem from "./peasantWorkerSystem/index.vue";
import projectAcceptance from "./projectAcceptance.vue"; import projectAcceptance from "./projectAcceptance.vue";
import { import {
listInfo, listInfo,
@ -178,6 +190,7 @@ export default {
supervisionAndManagement, supervisionAndManagement,
projectLegalPersonEvaluation, projectLegalPersonEvaluation,
investment, investment,
peasantWorkerSystem,
projectAcceptance, projectAcceptance,
}, },
data() { data() {

3
jwtech-admin-page/src/views/building/projectInfo/projectProcess/peasantWorkerSystem/index.vue

@ -0,0 +1,3 @@
<template>
<div>55555555</div>
</template>

368
jwtech-admin-page/src/views/building/projectInfo/projectProcess/qualityControl/options/components/viewReport.vue

@ -1,5 +1,182 @@
<template> <template>
<div>检测报告统计</div> <div>
<el-table
v-loading="loading"
:data="tableList"
:header-cell-style="{ border: 'solid 1px #D9D9D9' }"
>
<el-table-column label="序号" type="index" width="100" align="center" />
<el-table-column label="项目法人委托检测" align="center">
<el-table-column label="报告总数" align="center" prop="total0" />
<el-table-column
label="不合格报告数"
align="center"
prop="isFalse0"
width="110"
>
<template slot-scope="scope">
<div style="color: red">{{ scope.row.isFalse0 }}</div>
</template>
</el-table-column>
<el-table-column label="合格率" align="center" prop="rate0" />
</el-table-column>
<el-table-column label="监理单位平行检测" align="center">
<el-table-column label="报告总数" align="center" prop="total1" />
<el-table-column
label="不合格报告数"
align="center"
prop="isFalse1"
width="110"
>
<template slot-scope="scope">
<div style="color: red">{{ scope.row.isFalse0 }}</div>
</template>
</el-table-column>
<el-table-column label="合格率" align="center" prop="rate1" />
</el-table-column>
<el-table-column label="施工单位检测" align="center">
<el-table-column label="报告总数" align="center" prop="total2" />
<el-table-column
label="不合格报告数"
align="center"
prop="isFalse2"
width="110"
>
<template slot-scope="scope">
<div style="color: red">{{ scope.row.isFalse0 }}</div>
</template>
</el-table-column>
<el-table-column label="合格率" align="center" prop="rate2" />
</el-table-column>
<el-table-column
label="操作"
align="center"
class-name="small-padding fixed-width"
width="180"
>
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-view"
@click="viewDetailReport(scope.row)"
>查看报告详情</el-button
>
</template>
</el-table-column>
</el-table>
<!-- 查看报告详情 -->
<el-dialog
title="查看报告详情"
:visible.sync="open"
width="1100px"
append-to-body
:close-on-click-modal="false"
>
<el-table v-loading="reportLoading" :data="reportDetailList">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="序号" type="index" width="50" align="center" />
<el-table-column
label="检测报告名称"
align="center"
prop="reportAttachmentName"
/>
<el-table-column
label="检测报告类型"
align="center"
prop="reportType"
:formatter="reportTypeFormatter"
/>
<el-table-column
label="检测报告"
align="center"
prop="reportAttachment"
>
<template slot-scope="scope">
<div
v-for="(item, index) in JSON.parse(
scope.row.reportAttachment
? scope.row.reportAttachment
: JSON.stringify({})
)"
:key="item + index"
>
<i class="el-icon-document"></i>
{{ item.name }}
<i
class="el-icon-download"
@click="downloadFile(scope, index)"
style="cursor: pointer"
></i>
</div>
</template>
</el-table-column>
<el-table-column
label="是否合格"
align="center"
prop="isOk"
:formatter="isOkFormatter"
>
<template slot-scope="scope">
<div :class="scope.row.isOk == 0 ? 'no' : 'yes'">
{{ isOkFormatter(scope.row) }}
</div>
</template>
</el-table-column>
<el-table-column
label="工程监测id"
align="center"
prop="supervisionId"
/>
<el-table-column
label="上传时间"
align="center"
prop="uploadTime"
width="180"
>
<template slot-scope="scope">
<span>{{ parseTime(scope.row.uploadTime, "{y}-{m}-{d}") }}</span>
</template>
</el-table-column>
<el-table-column
label="操作"
align="center"
class-name="small-padding fixed-width"
>
<template slot-scope="scope">
<!-- <el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['build:attachment:edit']"
>修改</el-button
> -->
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDeleteReport(scope.row)"
v-hasPermi="['build:attachment:remove']"
>删除</el-button
>
</template>
</el-table-column>
</el-table>
<pagination
v-show="reportTotal > 0"
:total="reportTotal"
:page.sync="reportQueryParams.pageNum"
:limit.sync="reportQueryParams.pageSize"
@pagination="getReportList"
/>
</el-dialog>
</div>
</template> </template>
<script> <script>
import { import {
@ -11,18 +188,205 @@ import {
updateAttachment, updateAttachment,
exportAttachment, exportAttachment,
} from "@/api/build/attachment"; } from "@/api/build/attachment";
import { getToken } from "@/utils/auth";
import { getFileStream } from "@/api/system/upload";
export default { export default {
props: ["supervisionId"], props: ["supervisionId"],
data() {
return {
loading: false,
reportLoading: false,
open: false,
tableList: [],
tableData: {},
reportDetailList: [],
//
whetherOptions: [],
//
qualityInspectionReportOptions: [],
//
reportQueryParams: {
pageNum: 1,
pageSize: 3,
ids: null,
data: {
supervisionId: null,
reportAttachment: null,
isOk: null,
reportAttachmentName: null,
uploadTime: null,
remarks: null,
createUid: null,
updateUid: null,
owerDept: null,
reportType: null,
},
//
params: {
//
orderBy: "create_time",
// descasc
sort: "desc",
},
},
reportTotal: 0,
supervision_id: "",
//
headers: {
jianwei: "jwtech " + getToken(),
},
};
},
created() { created() {
this.getList();
this.getDicts("whether").then((response) => {
this.whetherOptions = response.data;
});
this.getDicts("project_quality_inspection_report").then((response) => {
this.qualityInspectionReportOptions = response.data;
});
},
methods: {
isOkFormatter(row) {
return this.selectDictLabel(this.whetherOptions, row.isOk);
},
reportTypeFormatter(row) {
return this.selectDictLabel(
this.qualityInspectionReportOptions,
row.reportType
);
},
getList() {
this.loading = true;
listAttachmentRate({ listAttachmentRate({
data: { data: {
supervisionId: this.supervisionId, supervisionId: this.supervisionId,
}, },
}).then((res) => { }).then((res) => {
console.log(5484864684684, res); console.log(5484864684684, res);
let newObj = {};
res.data.forEach((item, index) => {
newObj = {
...newObj,
["total" + item.type]: item.total,
["isFalse" + item.type]: item.isFalse,
["rate" + item.type]: item.rate.toFixed(0) + "%",
};
});
console.log("newObj", newObj);
this.tableList.push(newObj);
this.tableData = newObj;
console.log("this.tableData", this.tableData);
this.loading = false;
});
},
//
getReportList() {
this.reportLoading = true;
// this.queryParams.data.proNo = this.proNo;
// this.queryParams.data.proCode = this.proCode;
this.reportQueryParams.data.supervisionId = this.supervision_id;
listAttachment(this.reportQueryParams).then((response) => {
this.reportDetailList = response.records;
console.log("this.reportDetailList", this.reportDetailList);
this.reportTotal = response.total;
this.reportLoading = false;
});
},
viewDetailReport(row) {
this.open = true;
this.supervision_id = row.id;
this.getReportList();
},
/** 删除报告按钮操作 */
handleDeleteReport(row) {
const ids = row.id || this.ids;
if (ids) {
this.$confirm("是否删除选中的数据?", "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(function () {
return delAttachment(ids);
})
.then(() => {
this.getReportList();
this.msgSuccess("删除成功");
})
.catch(function () {});
} else {
this.$message.warning("请选择要删除的数据!!");
}
},
//
submitUpload(_, fileList) {
console.log("fileList", fileList);
this.fileList.push({
name: fileList.name,
fileName: fileList.response.fileName,
url: fileList.response.url,
uid: fileList.uid,
});
// this.reportForm.reportAttachment = JSON.stringify(this.fileList);
// this.$refs.reportForm.validateField("reportAttachment");
// this.$refs.uploadItem.clearValidate();
},
//
downloadFile(scope, index) {
console.log(scope);
let file = JSON.parse(scope.row.reportAttachment)[index];
this.handlePreview(file);
},
// ,
downloadFile2(info, index) {
console.log(info);
this.handlePreview(info);
},
handleRemove(file, fileList) {
// console.log(file, fileList);
let index = this.fileList.findIndex((item) => item.uid === file.uid);
//
this.fileList.splice(index, 1);
},
//
handlePreview(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); //URLblob
const a = document.createElement("a"); //a
a.style.display = "none";
a.href = href; //
a.download = file.name; //
a.click(); //
URL.revokeObjectURL(a.href); //URL
}); });
}, },
methods: {}, beforeRemove(file, fileList) {
return this.$confirm(`确定移除 ${file.name}`);
},
},
}; };
</script> </script>
<style lang="scss" scoped>
@import "@/assets/css/dialog.scss";
::v-deep {
.el-dialog {
// margin-top: 10vh !important;
height: 500px;
overflow-y: auto;
}
}
.no {
color: #f13939;
}
.yes {
color: #36b29e;
}
</style>

113
jwtech-admin-page/src/views/building/projectInfo/projectProcess/qualityControl/options/engineeringQualityInspection.vue

@ -298,10 +298,12 @@
<!-- 上传报告弹出框 --> <!-- 上传报告弹出框 -->
<el-dialog <el-dialog
class="reportForm"
:title="reportTitle" :title="reportTitle"
:visible.sync="reportOpen" :visible.sync="reportOpen"
width="1200px" width="1200px"
append-to-body append-to-body
@close="closeReportDia"
:close-on-click-modal="false" :close-on-click-modal="false"
> >
<!-- ===============上传检测报告==================== --> <!-- ===============上传检测报告==================== -->
@ -323,7 +325,7 @@
/> />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="24"> <el-col :span="12">
<el-form-item label="检测报告类型" prop="reportType"> <el-form-item label="检测报告类型" prop="reportType">
<!-- <el-input <!-- <el-input
v-model="reportForm.reportType" v-model="reportForm.reportType"
@ -346,8 +348,35 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12">
<el-form-item label="是否合格" prop="isOk">
<!-- <el-input
v-model="reportForm.isOk"
placeholder="请选择是否合格"
/> -->
<el-select
v-model="reportForm.isOk"
placeholder="请选择是否合格"
filterable
clearable
size="small"
style="width: 100%"
>
<el-option
v-for="dict in whetherOptions"
:key="dict.dictLabel + dict.id"
:label="dict.dictLabel"
:value="dict.dictValue"
/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="24"> <el-col :span="24">
<el-form-item label="检测报告" prop="reportAttachment"> <el-form-item
label="检测报告"
prop="reportAttachment"
ref="uploadItem"
>
<!-- <el-input <!-- <el-input
v-model="reportForm.reportAttachment" v-model="reportForm.reportAttachment"
placeholder="请输入检测报告" placeholder="请输入检测报告"
@ -373,29 +402,7 @@
</el-upload> </el-upload>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="24">
<el-form-item label="是否合格" prop="isOk">
<!-- <el-input
v-model="reportForm.isOk"
placeholder="请选择是否合格"
/> -->
<el-select
v-model="reportForm.isOk"
placeholder="请选择是否合格"
filterable
clearable
size="small"
style="width: 100%"
>
<el-option
v-for="dict in whetherOptions"
:key="dict.dictLabel + dict.id"
:label="dict.dictLabel"
:value="dict.dictValue"
/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="24"> <el-col :span="24">
<div style="margin-bottom: 20px; text-align: center"> <div style="margin-bottom: 20px; text-align: center">
<el-button @click="submitReportForm">保存报告</el-button> <el-button @click="submitReportForm">保存报告</el-button>
@ -451,17 +458,24 @@
align="center" align="center"
prop="isOk" prop="isOk"
:formatter="isOkFormatter" :formatter="isOkFormatter"
/> >
<template slot-scope="scope">
<div :class="scope.row.isOk == 0 ? 'no' : 'yes'">
{{ isOkFormatter(scope.row) }}
</div>
</template>
</el-table-column>
<el-table-column <el-table-column
label="工程监测id" label="工程监测id"
align="center" align="center"
prop="supervisionId" prop="supervisionId"
min-width="120"
/> />
<el-table-column <el-table-column
label="上传时间" label="上传时间"
align="center" align="center"
prop="uploadTime" prop="uploadTime"
width="180" min-width="120"
> >
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ parseTime(scope.row.uploadTime, "{y}-{m}-{d}") }}</span> <span>{{ parseTime(scope.row.uploadTime, "{y}-{m}-{d}") }}</span>
@ -497,7 +511,6 @@
<pagination <pagination
v-show="reportTotal > 0" v-show="reportTotal > 0"
:total="reportTotal" :total="reportTotal"
:pageSizes="[3, 10, 20, 50, 100]"
:page.sync="reportQueryParams.pageNum" :page.sync="reportQueryParams.pageNum"
:limit.sync="reportQueryParams.pageSize" :limit.sync="reportQueryParams.pageSize"
@pagination="getReportList" @pagination="getReportList"
@ -560,6 +573,13 @@ export default {
viewReport, viewReport,
}, },
data() { data() {
const validateRepoer = (rule, value, callback) => {
if (!this.reportForm.reportAttachment) {
callback(new Error("请上传检测报告"));
} else {
callback();
}
};
return { return {
// //
loading: true, loading: true,
@ -644,7 +664,8 @@ export default {
{ required: true, message: "请输入检测报告名称", trigger: "blur" }, { required: true, message: "请输入检测报告名称", trigger: "blur" },
], ],
reportAttachment: [ reportAttachment: [
{ required: true, message: "请上传检测报告", trigger: "blur" }, // { required: true, message: "", trigger: "change" },
{ required: true, validator: validateRepoer, trigger: "change" },
], ],
reportType: [ reportType: [
{ required: true, message: "请选择检测报告类型", trigger: "blur" }, { required: true, message: "请选择检测报告类型", trigger: "blur" },
@ -682,6 +703,9 @@ export default {
}); });
}, },
methods: { methods: {
closeReportDia() {
this.fileList = [];
},
isOkFormatter(row) { isOkFormatter(row) {
return this.selectDictLabel(this.whetherOptions, row.isOk); return this.selectDictLabel(this.whetherOptions, row.isOk);
}, },
@ -694,7 +718,7 @@ export default {
viewreport(row) { viewreport(row) {
this.viewOpen = true; this.viewOpen = true;
this.supervision_id = row.id; this.supervision_id = row.id;
console.log("row.id", row.id); // console.log("row.id", row.id);
}, },
getTreeData() { getTreeData() {
getAreasData().then((items) => { getAreasData().then((items) => {
@ -825,7 +849,7 @@ export default {
this.reportLoading = true; this.reportLoading = true;
// this.queryParams.data.proNo = this.proNo; // this.queryParams.data.proNo = this.proNo;
// this.queryParams.data.proCode = this.proCode; // this.queryParams.data.proCode = this.proCode;
// this.reportQueryParams.data.supervisionId = this.supervision_id; this.reportQueryParams.data.supervisionId = this.supervision_id;
listAttachment(this.reportQueryParams).then((response) => { listAttachment(this.reportQueryParams).then((response) => {
// listAttachment({ data: { supervisionId: this.supervision_id } }).then((response) => { // listAttachment({ data: { supervisionId: this.supervision_id } }).then((response) => {
this.attachmentList = response.records; this.attachmentList = response.records;
@ -836,9 +860,18 @@ export default {
}, },
submitReportForm() { submitReportForm() {
let now = new Date(); let now = new Date();
if (this.fileList.length > 0) {
this.reportForm.reportAttachment = JSON.stringify(this.fileList);
} else {
this.reportForm.reportAttachment = "";
}
console.log("reportAttachment", this.reportForm.reportAttachment);
// this.$refs.reportForm.validateField("reportAttachment");
this.$refs["reportForm"].validate((valid) => { this.$refs["reportForm"].validate((valid) => {
if (valid) { if (valid) {
this.reportForm.uploadTime = this.parseTime(now, "{y}-{m}-{d}"); this.reportForm.uploadTime = this.parseTime(now, "{y}-{m}-{d}");
this.reportForm.supervisionId = this.supervision_id;
if (this.reportForm.id != null) { if (this.reportForm.id != null) {
updateAttachment(this.reportForm).then((response) => { updateAttachment(this.reportForm).then((response) => {
if (response.code === 200) { if (response.code === 200) {
@ -873,7 +906,7 @@ export default {
/** 上次报告按钮操作 */ /** 上次报告按钮操作 */
handleUpdateReport(row) { handleUpdateReport(row) {
this.supervision_id = row.id; this.supervision_id = row.id;
this.reportForm.supervisionId = row.id; // this.reportForm.supervisionId = row.id;
this.reportTitle = "上传工程质量检测报告"; this.reportTitle = "上传工程质量检测报告";
this.reportOpen = true; this.reportOpen = true;
this.getReportList(); this.getReportList();
@ -960,7 +993,9 @@ export default {
url: fileList.response.url, url: fileList.response.url,
uid: fileList.uid, uid: fileList.uid,
}); });
this.reportForm.reportAttachment = JSON.stringify(this.fileList); // this.reportForm.reportAttachment = JSON.stringify(this.fileList);
// this.$refs.reportForm.validateField("reportAttachment");
// this.$refs.uploadItem.clearValidate();
}, },
// //
downloadFile(scope, index) { downloadFile(scope, index) {
@ -1012,6 +1047,12 @@ export default {
overflow-y: auto; overflow-y: auto;
} }
} }
// .reportTitle ::v-deep .el-dialog {
// margin-top: 2vh !important;
// height: 950px;
// overflow-y: auto;
// }
.listTitle { .listTitle {
font-size: 14px; font-size: 14px;
padding-left: 10px; padding-left: 10px;
@ -1031,4 +1072,10 @@ export default {
color: #31a08e; color: #31a08e;
} }
} }
.no {
color: #f13939;
}
.yes {
color: #36b29e;
}
</style> </style>

2
jwtech-admin-page/src/views/building/projectInfo/projectProcess/qualityControl/options/itemDivision/components/itemDivisionManage.vue

@ -1,6 +1,6 @@
<template> <template>
<div> <div>
<el-table :data="tableDta"> <el-table :data="tableDta" v-loading="loading">
<!-- <el-table-column type="selection" width="55" align="center" fixed /> --> <!-- <el-table-column type="selection" width="55" align="center" fixed /> -->
<el-table-column <el-table-column

656
jwtech-admin-page/src/views/building/projectInfo/projectProcess/qualityControl/options/safetyRecord.vue

@ -1,194 +1,183 @@
<template> <template>
<div class="app-container"> <div class="app-container">
<el-form <div class="listTitle">
:model="queryParams" <span>整体措施方案</span>
ref="queryForm" <span class="addBtn" @click="handleAdd(1)">
:inline="true" <i class="el-icon-plus"></i>
v-show="showSearch" 添加
label-width="68px" </span>
> </div>
<el-form-item label="年度" prop="year"> <el-table v-loading="loading" :data="filingsList1">
<el-input <el-table-column label="序号" type="index" width="50" align="center" />
v-model="queryParams.data.year"
placeholder="请输入年度" <el-table-column
clearable label="年度"
size="small" align="center"
@keyup.enter.native="handleQuery" prop="year"
/> min-width="120"
</el-form-item>
<el-form-item label="批复单位" prop="approvalUnit">
<el-input
v-model="queryParams.data.approvalUnit"
placeholder="请输入批复单位"
clearable
size="small"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="批复单位" prop="approvalOpinionNumber">
<el-input
v-model="queryParams.data.approvalOpinionNumber"
placeholder="请输入批复单位"
clearable
size="small"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="批复单位" prop="filingsUnit">
<el-input
v-model="queryParams.data.filingsUnit"
placeholder="请输入批复单位"
clearable
size="small"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="批复单位" prop="type">
<el-select
v-model="queryParams.data.type"
placeholder="请选择批复单位"
clearable
size="small"
>
<el-option label="请选择字典生成" value="" />
</el-select>
</el-form-item>
<el-form-item label="批复单位" prop="createUid">
<el-input
v-model="queryParams.data.createUid"
placeholder="请输入批复单位"
clearable
size="small"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="批复单位" prop="updateUid">
<el-input
v-model="queryParams.data.updateUid"
placeholder="请输入批复单位"
clearable
size="small"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="批复单位" prop="proCode">
<el-input
v-model="queryParams.data.proCode"
placeholder="请输入批复单位"
clearable
size="small"
@keyup.enter.native="handleQuery"
/> />
</el-form-item> <el-table-column
<el-form-item label="批复单位" prop="proNo"> label="内容描述"
<el-input align="center"
v-model="queryParams.data.proNo" prop="content"
placeholder="请输入批复单位" min-width="120"
clearable
size="small"
@keyup.enter.native="handleQuery"
/> />
</el-form-item> <el-table-column
<el-form-item label="批复单位" prop="owerDept"> label="备注"
<el-input align="center"
v-model="queryParams.data.owerDept" prop="remarks"
placeholder="请输入批复单位" min-width="120"
clearable
size="small"
@keyup.enter.native="handleQuery"
/> />
</el-form-item> <el-table-column
<el-form-item> label="附件"
<el-button align="center"
type="cyan" prop="attachment"
icon="el-icon-search" min-width="120"
size="mini"
@click="handleQuery"
>搜索</el-button
> >
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery" <template slot-scope="scope">
>重置</el-button <div
v-for="(item, index) in JSON.parse(
scope.row.attachment ? scope.row.attachment : JSON.stringify({})
)"
:key="item + index"
> >
</el-form-item> <i class="el-icon-document"></i>
</el-form> {{ item.name }}
<i
class="el-icon-download"
@click="downloadFile(scope, index)"
style="cursor: pointer"
></i>
</div>
</template>
</el-table-column>
<el-row :gutter="10" class="mb8"> <el-table-column
<el-col :span="1.5"> label="操作"
<el-button align="center"
type="primary" class-name="small-padding fixed-width"
icon="el-icon-plus" width="180"
size="mini" fixed="right"
@click="handleAdd"
v-hasPermi="['build:filings:add']"
>新增</el-button
> >
</el-col> <template slot-scope="scope">
<el-col :span="1.5">
<el-button <el-button
type="success"
icon="el-icon-edit"
size="mini" size="mini"
:disabled="single" type="text"
@click="handleUpdate" icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['build:filings:edit']" v-hasPermi="['build:filings:edit']"
>修改</el-button >修改</el-button
> >
</el-col>
<el-col :span="1.5">
<el-button <el-button
type="danger"
icon="el-icon-delete"
size="mini" size="mini"
:disabled="multiple" type="text"
@click="handleDelete" icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['build:filings:remove']" v-hasPermi="['build:filings:remove']"
>删除</el-button >删除</el-button
> >
</el-col> </template>
<el-col :span="1.5"> </el-table-column>
<el-button </el-table>
type="warning"
icon="el-icon-download"
size="mini"
@click="handleExport"
v-hasPermi="['build:filings:export']"
>导出</el-button
>
</el-col>
<right-toolbar
:showSearch.sync="showSearch"
@queryTable="getList"
></right-toolbar>
</el-row>
<el-table <div class="listTitle">
v-loading="loading" <span>度汛方案</span>
:data="filingsList" <span class="addBtn" @click="handleAdd(2)">
@selection-change="handleSelectionChange" <i class="el-icon-plus"></i>
> 添加
<el-table-column type="selection" width="55" align="center" /> </span>
</div>
<el-table v-loading="loading" :data="filingsList2">
<el-table-column label="序号" type="index" width="50" align="center" /> <el-table-column label="序号" type="index" width="50" align="center" />
<el-table-column
<el-table-column label="年度" align="center" prop="year" /> label="年度"
<el-table-column label="内容描述" align="center" prop="content" /> align="center"
<el-table-column label="内容描述" align="center" prop="remarks" /> prop="year"
<el-table-column label="批复单位" align="center" prop="approvalUnit" /> min-width="120"
/>
<el-table-column <el-table-column
label="批复单位" label="批复单位"
align="center" align="center"
prop="approvalUnit"
min-width="120"
/>
<el-table-column
label="备案单位"
align="center"
prop="filingsUnit"
min-width="120"
/>
<el-table-column
label="批复意见文号"
align="center"
prop="approvalOpinionNumber" prop="approvalOpinionNumber"
min-width="120"
/> />
<el-table-column label="批复单位" align="center" prop="filingsUnit" />
<el-table-column label="批复单位" align="center" prop="type" /> <el-table-column
<el-table-column label="批复单位" align="center" prop="createUid" /> label="内容描述"
<el-table-column label="批复单位" align="center" prop="updateUid" /> align="center"
<el-table-column label="批复单位" align="center" prop="proCode" /> prop="content"
<el-table-column label="批复单位" align="center" prop="proNo" /> min-width="120"
<el-table-column label="批复单位" align="center" prop="owerDept" /> />
<el-table-column
label="备案内容"
align="center"
prop="filingsContent"
min-width="120"
>
<template slot-scope="scope">
<div
v-for="(item, index) in JSON.parse(
scope.row.filingsContent
? scope.row.filingsContent
: JSON.stringify({})
)"
:key="item + index"
>
<i class="el-icon-document"></i>
{{ item.name }}
<i
class="el-icon-download"
@click="downloadFile(scope, index)"
style="cursor: pointer"
></i>
</div>
</template>
</el-table-column>
<el-table-column
label="批复意见"
align="center"
prop="approvalOpinion"
min-width="120"
>
<template slot-scope="scope">
<div
v-for="(item, index) in JSON.parse(
scope.row.approvalOpinion
? scope.row.approvalOpinion
: JSON.stringify({})
)"
:key="item + index"
>
<i class="el-icon-document"></i>
{{ item.name }}
<i
class="el-icon-download"
@click="downloadFile(scope, index)"
style="cursor: pointer"
></i>
</div>
</template>
</el-table-column>
<el-table-column <el-table-column
label="操作" label="操作"
align="center" align="center"
class-name="small-padding fixed-width" class-name="small-padding fixed-width"
width="180"
fixed="right"
> >
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button
@ -211,65 +200,152 @@
</el-table-column> </el-table-column>
</el-table> </el-table>
<pagination <!-- <pagination
v-show="total > 0" v-show="total > 0"
:total="total" :total="total"
:page.sync="queryParams.pageNum" :page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize" :limit.sync="queryParams.pageSize"
@pagination="getList" @pagination="getList"
/> /> -->
<!-- 添加或修改安全备案对话框 --> <!-- 添加或修改安全备案对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body> <el-dialog
<el-form ref="form" :model="form" :rules="rules" label-width="80px"> :title="title"
:visible.sync="open"
width="1200px"
append-to-body
@close="closeDialog"
:close-on-click-modal="false"
>
<el-form ref="form" :model="form" :rules="rules" label-width="110px">
<el-form-item label="年度" prop="year"> <el-form-item label="年度" prop="year">
<el-input v-model="form.year" placeholder="请输入年度" /> <!-- <el-input v-model="form.year" placeholder="请输入年度" /> -->
<el-date-picker
v-model="form.year"
type="year"
placeholder="请选择年度"
style="width: 100%"
value-format="yyyy"
>
</el-date-picker>
</el-form-item> </el-form-item>
<el-form-item label="内容描述" prop="content"> <el-form-item label="内容描述" prop="content" v-if="form.type == 1">
<el-input <el-input
v-model="form.content" v-model="form.content"
type="textarea" type="textarea"
placeholder="请输入内容" placeholder="请输入内容"
/> />
</el-form-item> </el-form-item>
<el-form-item label="内容描述" prop="remarks"> <el-form-item label="备注" prop="remarks" v-if="form.type == 1">
<el-input <el-input
v-model="form.remarks" v-model="form.remarks"
type="textarea" type="textarea"
placeholder="请输入内容" placeholder="请输入内容"
/> />
</el-form-item> </el-form-item>
<el-form-item label="批复单位" prop="approvalUnit"> <el-form-item label="附件" prop="attachment" v-if="form.type == 1">
<!-- <el-input
v-model="form.attachment"
type="textarea"
placeholder="请输入内容"
/> -->
<el-upload
class="upload-demo"
action="thinking/common/upload"
:headers="headers"
:on-preview="handlePreview"
:on-remove="handleRemove1"
:before-remove="beforeRemove"
multiple
:on-success="submitUpload1"
:file-list="fileList1"
>
<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="approvalUnit"
v-if="form.type == 2"
>
<el-input v-model="form.approvalUnit" placeholder="请输入批复单位" /> <el-input v-model="form.approvalUnit" placeholder="请输入批复单位" />
</el-form-item> </el-form-item>
<el-form-item label="批复单位" prop="approvalOpinionNumber"> <el-form-item
label="批复意见文号"
prop="approvalOpinionNumber"
v-if="form.type == 2"
>
<el-input <el-input
v-model="form.approvalOpinionNumber" v-model="form.approvalOpinionNumber"
placeholder="请输入批复单位" placeholder="请输入批复意见文号"
/> />
</el-form-item> </el-form-item>
<el-form-item label="批复单位" prop="filingsUnit"> <el-form-item label="备案单位" prop="filingsUnit" v-if="form.type == 2">
<el-input v-model="form.filingsUnit" placeholder="请输入批复单位" /> <el-input v-model="form.filingsUnit" placeholder="请输入备案单位" />
</el-form-item>
<el-form-item label="批复单位" prop="type">
<el-select v-model="form.type" placeholder="请选择批复单位">
<el-option label="请选择字典生成" value="" />
</el-select>
</el-form-item>
<el-form-item label="批复单位" prop="createUid">
<el-input v-model="form.createUid" placeholder="请输入批复单位" />
</el-form-item>
<el-form-item label="批复单位" prop="updateUid">
<el-input v-model="form.updateUid" placeholder="请输入批复单位" />
</el-form-item> </el-form-item>
<el-form-item label="批复单位" prop="proCode"> <el-form-item
<el-input v-model="form.proCode" placeholder="请输入批复单位" /> label="备案内容"
</el-form-item> prop="filingsContent"
<el-form-item label="批复单位" prop="proNo"> v-if="form.type == 2"
<el-input v-model="form.proNo" placeholder="请输入批复单位" /> >
<!-- <el-input
v-model="form.filingsContent"
placeholder="请输入备案内容"
/> -->
<el-upload
class="upload-demo"
action="thinking/common/upload"
:headers="headers"
:on-preview="handlePreview"
:on-remove="handleRemove2"
:before-remove="beforeRemove"
multiple
:on-success="submitUpload2"
:file-list="fileList2"
>
<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>
<el-form-item label="批复单位" prop="owerDept"> <el-form-item
<el-input v-model="form.owerDept" placeholder="请输入批复单位" /> label="批复意见"
prop="approvalOpinion"
v-if="form.type == 2"
>
<!-- <el-input
v-model="form.approvalOpinion"
placeholder="请输入批复意见"
/> -->
<el-upload
class="upload-demo"
action="thinking/common/upload"
:headers="headers"
:on-preview="handlePreview"
:on-remove="handleRemove3"
:before-remove="beforeRemove"
multiple
:on-success="submitUpload3"
:file-list="fileList3"
>
<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>
</el-form> </el-form>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
@ -289,9 +365,12 @@ import {
updateFilings, updateFilings,
exportFilings, exportFilings,
} from "@/api/build/filings"; } from "@/api/build/filings";
import { getToken } from "@/utils/auth";
import { getFileStream } from "@/api/system/upload";
export default { export default {
name: "Filings", name: "Filings",
props: ["proNo", "proCode"],
data() { data() {
return { return {
// //
@ -307,7 +386,8 @@ export default {
// //
total: 0, total: 0,
// //
filingsList: [], filingsList1: [],
filingsList2: [],
// //
title: "", title: "",
// //
@ -336,18 +416,33 @@ export default {
form: {}, form: {},
// //
rules: {}, rules: {},
fileList1: [],
fileList2: [],
fileList3: [],
//
headers: {
jianwei: "jwtech " + getToken(),
},
}; };
}, },
created() { created() {
this.getList(); this.getList();
}, },
methods: { methods: {
closeDialog() {
this.fileList1 = [];
this.fileList2 = [];
this.fileList3 = [];
},
/** 查询安全备案列表 */ /** 查询安全备案列表 */
getList() { getList() {
this.loading = true; this.loading = true;
this.queryParams.data.proNo = this.proNo;
this.queryParams.data.proCode = this.proCode;
listFilings(this.queryParams).then((response) => { listFilings(this.queryParams).then((response) => {
this.filingsList = response.records; this.filingsList1 = response.records.filter((item) => item.type == 1);
this.total = response.total; this.filingsList2 = response.records.filter((item) => item.type == 2);
// this.total = response.total;
this.loading = false; this.loading = false;
}); });
}, },
@ -419,10 +514,15 @@ export default {
this.multiple = !selection.length; this.multiple = !selection.length;
}, },
/** 新增按钮操作 */ /** 新增按钮操作 */
handleAdd() { handleAdd(type) {
this.reset(); this.reset();
this.open = true; this.open = true;
this.title = "添加安全备案"; this.form.type = type;
if (this.form.type == 1) {
this.title = "添加整体措施方案";
} else {
this.title = "添加度汛方案";
}
}, },
/** 修改按钮操作 */ /** 修改按钮操作 */
handleUpdate(row) { handleUpdate(row) {
@ -431,13 +531,35 @@ export default {
getFilings(id).then((response) => { getFilings(id).then((response) => {
this.form = response.data; this.form = response.data;
this.open = true; this.open = true;
this.title = "修改安全备案"; // console.log("this.form", this.form);
if (this.form.type == 1) {
this.title = "修改整体措施方案";
if (response.data.attachment)
this.fileList1 = JSON.parse(response.data.attachment);
} else {
this.title = "修改度汛方案";
if (response.data.filingsContent)
this.fileList2 = JSON.parse(response.data.filingsContent);
if (response.data.approvalOpinion)
this.fileList3 = JSON.parse(response.data.approvalOpinion);
}
}); });
}, },
/** 提交按钮 */ /** 提交按钮 */
submitForm() { submitForm() {
this.$refs["form"].validate((valid) => { this.$refs["form"].validate((valid) => {
if (valid) { if (valid) {
this.form.proNo = this.proNo;
this.form.proCode = this.proCode;
if (this.fileList1.length > 0) {
this.form.attachment = JSON.stringify(this.fileList1);
}
if (this.fileList2.length > 0) {
this.form.filingsContent = JSON.stringify(this.fileList2);
}
if (this.fileList3.length > 0) {
this.form.approvalOpinion = JSON.stringify(this.fileList3);
}
if (this.form.id != null) { if (this.form.id != null) {
updateFilings(this.form).then((response) => { updateFilings(this.form).then((response) => {
if (response.code === 200) { if (response.code === 200) {
@ -479,28 +601,126 @@ export default {
this.$message.warning("请选择要删除的数据!!"); this.$message.warning("请选择要删除的数据!!");
} }
}, },
/** 导出按钮操作 */ //
handleExport() { submitUpload1(_, fileList) {
const queryParams = this.queryParams; console.log("fileList1", fileList);
let message = "是否确认导出所有的数据项?"; this.fileList1.push({
if (this.ids) { name: fileList.name,
message = "是否确认导出选中的数据项?"; fileName: fileList.response.fileName,
queryParams.ids = this.ids; url: fileList.response.url,
} uid: fileList.uid,
this.$confirm(message, "警告", { });
confirmButtonText: "确定", },
cancelButtonText: "取消", handleRemove1(file, fileList) {
type: "warning", // console.log(file, fileList);
}) let index = this.fileList1.findIndex((item) => item.uid === file.uid);
.then(function () { //
return exportFilings(queryParams); this.fileList1.splice(index, 1);
}) },
.then((response) => { //
this.downloadFile(response, true, response.msg); downloadFile_1(scope, index) {
// this.download(response.msg); console.log(scope);
}) let file = JSON.parse(scope.row.attachment)[index];
.catch(function () {}); this.handlePreview(file);
},
//
submitUpload2(_, fileList) {
console.log("fileList2", fileList);
this.fileList2.push({
name: fileList.name,
fileName: fileList.response.fileName,
url: fileList.response.url,
uid: fileList.uid,
});
},
handleRemove2(file, fileList) {
// console.log(file, fileList);
let index = this.fileList2.findIndex((item) => item.uid === file.uid);
//
this.fileList2.splice(index, 1);
},
//
downloadFile_2(scope, index) {
console.log(scope);
let file = JSON.parse(scope.row.filingsContent)[index];
this.handlePreview(file);
},
//
submitUpload3(_, fileList) {
console.log("fileList3", fileList);
this.fileList3.push({
name: fileList.name,
fileName: fileList.response.fileName,
url: fileList.response.url,
uid: fileList.uid,
});
},
handleRemove3(file, fileList) {
// console.log(file, fileList);
let index = this.fileList3.findIndex((item) => item.uid === file.uid);
//
this.fileList3.splice(index, 1);
},
//
downloadFile_3(scope, index) {
console.log(scope);
let file = JSON.parse(scope.row.approvalOpinion)[index];
this.handlePreview(file);
},
// ,
downloadFile2(info, index) {
console.log(info);
this.handlePreview(info);
},
//
handlePreview(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); //URLblob
const a = document.createElement("a"); //a
a.style.display = "none";
a.href = href; //
a.download = file.name; //
a.click(); //
URL.revokeObjectURL(a.href); //URL
});
},
beforeRemove(file, fileList) {
return this.$confirm(`确定移除 ${file.name}`);
}, },
}, },
}; };
</script> </script>
<style lang="scss" scoped>
@import "@/assets/css/dialog.scss";
// ::v-deep {
// .el-dialog {
// margin-top: 10vh !important;
// }
// }
.listTitle {
font-size: 14px;
padding-left: 10px;
padding-right: 30px;
margin: 20px 0;
border-left: 2px solid #36b29e;
display: flex;
justify-content: space-between;
span:nth-child(1) {
font-weight: bold;
}
.addBtn {
color: #36b29e;
cursor: pointer;
}
.addBtn:hover {
color: #31a08e;
}
}
</style>

Loading…
Cancel
Save