Browse Source

安全鉴定清单

master_tdsql
xzt 1 year ago
parent
commit
21aeeedb1c
  1. 54
      src/views/safetyManage/safetyAppraisal/sluice/components/listBaseInfo.vue
  2. 215
      src/views/safetyManage/safetyAppraisal/sluice/components/listSafetyDetection.vue
  3. 170
      src/views/safetyManage/safetyAppraisal/sluice/list.vue

54
src/views/safetyManage/safetyAppraisal/sluice/components/listBaseInfo.vue

@ -2,11 +2,11 @@
<div> <div>
<el-row :gutter="15"> <el-row :gutter="15">
<el-form ref="form" :model="form" :rules="rules" label-width="152px"> <el-form ref="form" :model="form" :rules="rules" label-width="152px">
<!-- <el-col :span="12"> <el-col :span="24">
<el-form-item label="水闸id" prop="sluiceId"> <el-form-item label="水闸名称">
<el-input v-model="form.sluiceId" placeholder="请输入水闸id" /> <el-input v-model="wagaName" disabled />
</el-form-item> </el-form-item>
</el-col> --> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="鉴定日期" prop="identifyTime"> <el-form-item label="鉴定日期" prop="identifyTime">
<el-date-picker <el-date-picker
@ -237,7 +237,7 @@
</el-col> </el-col>
</el-form> </el-form>
</el-row> </el-row>
<div slot="footer" class="dialog-footer"> <div class="btnList">
<el-button type="primary" @click="submitForm"> </el-button> <el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button> <el-button @click="cancel"> </el-button>
</div> </div>
@ -258,6 +258,7 @@ import { getFileStream } from "@/api/system/upload";
export default { export default {
name: "Aqjdxx", name: "Aqjdxx",
props: ["wagaName", "szrwId"],
data() { data() {
return { return {
// //
@ -288,7 +289,7 @@ export default {
pageSize: 10, pageSize: 10,
ids: null, ids: null,
data: { data: {
sluiceId: null, szrwId: null,
identifyTime: null, identifyTime: null,
nextIdentifyTime: null, nextIdentifyTime: null,
safetyEvaluationUnit: null, safetyEvaluationUnit: null,
@ -344,11 +345,23 @@ export default {
methods: { methods: {
/** 查询水闸安全鉴定信息列表 */ /** 查询水闸安全鉴定信息列表 */
getList() { getList() {
this.loading = true; // this.loading = true;
this.queryParams.data.szrwId = this.szrwId;
listAqjdxx(this.queryParams).then((response) => { listAqjdxx(this.queryParams).then((response) => {
this.aqjdxxList = response.records; if (response.records[0]) {
this.total = response.total; this.form = response.records[0];
this.loading = false; if (this.form.safetyEvaluationReport) {
this.fileList1 = JSON.parse(this.form.safetyEvaluationReport);
}
if (this.form.safetyAppraisalReport) {
this.fileList2 = JSON.parse(this.form.safetyAppraisalReport);
}
if (this.form.safetyAppraisalOpinion) {
this.fileList3 = JSON.parse(this.form.safetyAppraisalOpinion);
}
}
// this.total = response.total;
// this.loading = false;
}); });
}, },
// //
@ -367,14 +380,15 @@ export default {
}, },
// //
cancel() { cancel() {
this.open = false; // this.open = false;
this.reset(); // this.reset();
this.$emit("cancelParent");
}, },
// //
reset() { reset() {
this.form = { this.form = {
id: null, id: null,
sluiceId: null, szrwId: null,
identifyTime: null, identifyTime: null,
nextIdentifyTime: null, nextIdentifyTime: null,
safetyEvaluationUnit: null, safetyEvaluationUnit: null,
@ -409,7 +423,7 @@ export default {
pageSize: 10, pageSize: 10,
data: { data: {
id: null, id: null,
sluiceId: null, szrwId: null,
identifyTime: null, identifyTime: null,
nextIdentifyTime: null, nextIdentifyTime: null,
safetyEvaluationUnit: null, safetyEvaluationUnit: null,
@ -480,6 +494,9 @@ export default {
submitForm() { submitForm() {
this.$refs["form"].validate((valid) => { this.$refs["form"].validate((valid) => {
if (valid) { if (valid) {
this.form.safetyEvaluationReport = JSON.stringify(this.fileList1);
this.form.safetyAppraisalReport = JSON.stringify(this.fileList2);
this.form.safetyAppraisalOpinion = JSON.stringify(this.fileList3);
if (this.form.id != null) { if (this.form.id != null) {
updateAqjdxx(this.form).then((response) => { updateAqjdxx(this.form).then((response) => {
if (response.code === 200) { if (response.code === 200) {
@ -489,6 +506,7 @@ export default {
} }
}); });
} else { } else {
this.form.szrwId = this.szrwId;
addAqjdxx(this.form).then((response) => { addAqjdxx(this.form).then((response) => {
if (response.code === 200) { if (response.code === 200) {
this.msgSuccess("新增成功"); this.msgSuccess("新增成功");
@ -581,4 +599,12 @@ export default {
// } // }
// } // }
.btnList {
text-align: right;
// position: fixed;
// bottom: 20px;
// right: 20px;
// z-index: 1;
}
</style> </style>

215
src/views/safetyManage/safetyAppraisal/sluice/components/listSafetyDetection.vue

@ -2,19 +2,9 @@
<div> <div>
<el-row :gutter="15"> <el-row :gutter="15">
<el-form ref="form" :model="form" :rules="rules" label-width="96px"> <el-form ref="form" :model="form" :rules="rules" label-width="96px">
<el-col :span="12"> <el-col :span="24">
<el-form-item label="水闸id" prop="sluiceId"> <el-form-item label="水闸名称">
<el-input v-model="form.sluiceId" placeholder="请输入水闸id" /> <el-input v-model="wagaName" disabled />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="水闸代码" prop="sluiceCode">
<el-input v-model="form.sluiceCode" placeholder="请输入水闸代码" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="水闸名称" prop="sluiceName">
<el-input v-model="form.sluiceName" placeholder="请输入水闸名称" />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
@ -37,7 +27,12 @@
placeholder="请选择闸门型式" placeholder="请选择闸门型式"
style="width: 100%" style="width: 100%"
> >
<el-option label="请选择字典生成" value="" /> <el-option
v-for="dict in gateTypeOptions"
:key="dict.dictValue"
:label="dict.dictLabel"
:value="dict.dictValue"
></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
@ -48,37 +43,83 @@
placeholder="请选择启闭机型式" placeholder="请选择启闭机型式"
style="width: 100%" style="width: 100%"
> >
<el-option label="请选择字典生成" value="" /> <el-option
v-for="dict in hoistTypeOptions"
:key="dict.dictValue"
:label="dict.dictLabel"
:value="dict.dictValue"
></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="24">
<el-form-item label="安全评价" prop="evaluate"> <el-form-item label="安全评价" prop="evaluate">
<el-input <el-input
v-model="form.evaluate" v-model="form.evaluate"
placeholder="请输入闸门和启闭机安全评价" placeholder="请输入闸门和启闭机安全评价"
type="textarea"
/> />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="现场检测成果" prop="testingResults"> <el-form-item label="现场检测成果" prop="testingResults">
<el-input <!-- <el-input
v-model="form.testingResults" v-model="form.testingResults"
placeholder="请输入现场检测成果" placeholder="请输入现场检测成果"
/> /> -->
<el-upload
class="upload-demo"
action="thinking/common/upload"
:headers="headers"
:on-preview="handlePreview"
:on-remove="(file) => handleRemove(file, 'fileList1')"
:before-remove="beforeRemove"
multiple
:on-exceed="handleExceed"
:on-success="(_, fileList) => submitUpload(fileList, 'fileList1')"
: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文件等不超过100M
</div>
</el-upload>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="复核计算成果" prop="calculationResults"> <el-form-item label="复核计算成果" prop="calculationResults">
<el-input <!-- <el-input
v-model="form.calculationResults" v-model="form.calculationResults"
placeholder="请输入复核计算成果" placeholder="请输入复核计算成果"
/> /> -->
<el-upload
class="upload-demo"
action="thinking/common/upload"
:headers="headers"
:on-preview="handlePreview"
:on-remove="(file) => handleRemove(file, 'fileList2')"
:before-remove="beforeRemove"
multiple
:on-exceed="handleExceed"
:on-success="(_, fileList) => submitUpload(fileList, 'fileList2')"
: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文件等不超过100M
</div>
</el-upload>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-form> </el-form>
</el-row> </el-row>
<div slot="footer" class="dialog-footer"> <div class="btnList">
<el-button type="primary" @click="submitForm"> </el-button> <el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button> <el-button @click="cancel"> </el-button>
</div> </div>
@ -94,9 +135,12 @@ import {
updateAqjc, updateAqjc,
exportAqjc, exportAqjc,
} from "@/api/yg/aqjc"; } from "@/api/yg/aqjc";
import { getToken } from "@/utils/auth";
import { getFileStream } from "@/api/system/upload";
export default { export default {
name: "Aqjc", name: "Aqjc",
props: ["wagaName", "szrwId"],
data() { data() {
return { return {
// //
@ -117,13 +161,17 @@ export default {
title: "", title: "",
// //
open: false, open: false,
//
gateTypeOptions: [],
//
hoistTypeOptions: [],
// //
queryParams: { queryParams: {
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
ids: null, ids: null,
data: { data: {
sluiceId: null, szrwId: null,
sluiceCode: null, sluiceCode: null,
sluiceName: null, sluiceName: null,
holesNumber: null, holesNumber: null,
@ -149,32 +197,78 @@ export default {
// //
form: {}, form: {},
// //
rules: {}, rules: {
holesNumber: [
{
pattern: /^[0-9]\d*$/,
message: "请输入正整数,包含0",
trigger: "blur",
},
],
hoistNumber: [
{
pattern: /^[0-9]\d*$/,
message: "请输入正整数,包含0",
trigger: "blur",
},
],
},
//
headers: {
shuili: "water " + getToken(),
},
fileList1: [],
fileList2: [],
}; };
}, },
created() { created() {
this.getList(); this.getList();
this.getDicts("gate_type").then((response) => {
this.gateTypeOptions = response.data;
});
this.getDicts("machine_form").then((response) => {
this.hoistTypeOptions = response.data;
});
}, },
methods: { methods: {
//
gateTypeFormat(row, column) {
return this.selectDictLabel(this.gateTypeOptions, row.gateType);
},
//
hoistTypeFormat(row, column) {
return this.selectDictLabel(this.hoistTypeOptions, row.hoistType);
},
/** 查询水闸安全检测列表 */ /** 查询水闸安全检测列表 */
getList() { getList() {
this.loading = true; // this.loading = true;
this.queryParams.data.szrwId = this.szrwId;
listAqjc(this.queryParams).then((response) => { listAqjc(this.queryParams).then((response) => {
this.aqjcList = response.records; // this.aqjcList = response.records;
this.total = response.total; if (response.records[0]) {
this.loading = false; this.form = response.records[0];
if (this.form.testingResults) {
this.fileList1 = JSON.parse(this.form.testingResults);
}
if (this.form.calculationResults) {
this.fileList2 = JSON.parse(this.form.calculationResults);
}
}
// this.total = response.total;
// this.loading = false;
}); });
}, },
// //
cancel() { cancel() {
this.open = false; // this.open = false;
this.reset(); // this.reset();
this.$emit("cancelParent");
}, },
// //
reset() { reset() {
this.form = { this.form = {
id: null, id: null,
sluiceId: null, szrwId: null,
sluiceCode: null, sluiceCode: null,
sluiceName: null, sluiceName: null,
holesNumber: null, holesNumber: null,
@ -201,7 +295,7 @@ export default {
pageSize: 10, pageSize: 10,
data: { data: {
id: null, id: null,
sluiceId: null, szrwId: null,
sluiceCode: null, sluiceCode: null,
sluiceName: null, sluiceName: null,
holesNumber: null, holesNumber: null,
@ -264,6 +358,8 @@ export default {
submitForm() { submitForm() {
this.$refs["form"].validate((valid) => { this.$refs["form"].validate((valid) => {
if (valid) { if (valid) {
this.form.testingResults = JSON.stringify(this.fileList1);
this.form.calculationResults = JSON.stringify(this.fileList2);
if (this.form.id != null) { if (this.form.id != null) {
updateAqjc(this.form).then((response) => { updateAqjc(this.form).then((response) => {
if (response.code === 200) { if (response.code === 200) {
@ -273,6 +369,7 @@ export default {
} }
}); });
} else { } else {
this.form.szrwId = this.szrwId;
addAqjc(this.form).then((response) => { addAqjc(this.form).then((response) => {
if (response.code === 200) { if (response.code === 200) {
this.msgSuccess("新增成功"); this.msgSuccess("新增成功");
@ -305,6 +402,55 @@ export default {
this.$message.warning("请选择要删除的数据!!"); this.$message.warning("请选择要删除的数据!!");
} }
}, },
//
submitUpload(fileList, name) {
console.log(name, fileList);
this[name].push({
name: fileList.name,
fileName: fileList.response.fileName,
url: fileList.response.url,
uid: fileList.uid,
});
console.log(name, this[name]);
},
handleRemove(file, name) {
// console.log(file, fileList1);
let index = this[name].findIndex((item) => item.uid === file.uid);
//
this[name].splice(index, 1);
},
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
});
},
handleExceed(files, fileList) {
this.$message.warning(
`当前限制选择 3 个文件,本次选择了 ${files.length} 个文件,共选择了 ${
files.length + fileList.length
} 个文件`
);
},
beforeRemove(file, fileList) {
return this.$confirm(`确定移除 ${file.name}`);
},
}, },
}; };
</script> </script>
@ -315,4 +461,11 @@ export default {
// margin-top: 2vh !important; // margin-top: 2vh !important;
// } // }
// } // }
.btnList {
text-align: right;
// position: fixed;
// bottom: 20px;
// right: 20px;
// z-index: 1;
}
</style> </style>

170
src/views/safetyManage/safetyAppraisal/sluice/list.vue

@ -9,21 +9,21 @@
label-width="68px" label-width="68px"
> >
<el-form-item label="水闸名称" prop="wagaName"> <el-form-item label="水闸名称" prop="wagaName">
<el-input <el-select
v-model="queryParams.data.wagaName" v-model="queryParams.data.wagaId"
placeholder="请输入任务id" placeholder="请选择水闸名称"
style="width: 100%"
filterable
clearable clearable
size="small" @change="handleQuery"
@keyup.enter.native="handleQuery"
> >
<el-button <el-option
type="primary" v-for="dict in wagaNameOptions"
slot="append" :key="dict.id"
icon="el-icon-search" :label="dict.wagaName"
size="small" :value="dict.id"
@click="handleQuery" ></el-option>
></el-button> </el-select>
</el-input>
</el-form-item> </el-form-item>
<el-form-item label="计划完成时间" prop="planTime" label-width="96px"> <el-form-item label="计划完成时间" prop="planTime" label-width="96px">
<el-date-picker <el-date-picker
@ -34,6 +34,7 @@
type="date" type="date"
value-format="yyyy-MM-dd" value-format="yyyy-MM-dd"
placeholder="选择计划完成时间" placeholder="选择计划完成时间"
@change="handleQuery"
> >
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
@ -90,12 +91,7 @@
></right-toolbar> ></right-toolbar>
</el-row> </el-row>
<el-table <el-table v-loading="loading" :data="szrwList">
v-loading="loading"
:data="szrwList"
@selection-change="handleSelectionChange"
>
<el-table-column type="selection" width="55" align="center" fixed />
<el-table-column <el-table-column
label="序号" label="序号"
type="index" type="index"
@ -121,6 +117,7 @@
label="水闸类型" label="水闸类型"
align="center" align="center"
prop="wagaType" prop="wagaType"
:formatter="sluiceTypeFormat"
min-width="120" min-width="120"
/> />
<el-table-column <el-table-column
@ -201,13 +198,23 @@
width="1200px" width="1200px"
append-to-body append-to-body
:close-on-click-modal="false" :close-on-click-modal="false"
@close="close"
> >
<el-tabs v-model="activeName" style="margin-bottom: 20px"> <el-tabs v-model="activeName" style="margin-bottom: 20px" v-if="open">
<el-tab-pane label="安全鉴定信息" name="listBaseInfo" :lazy="true"> <el-tab-pane label="安全鉴定信息" name="listBaseInfo" :lazy="true">
<listBaseInfo ref="listBaseInfo" /> <listBaseInfo
ref="listBaseInfo"
:szrwId="szrwId"
:wagaName="wagaName"
@cancelParent="cancel"
/>
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="安全检测" name="listSafetyDetection" :lazy="true"> <el-tab-pane label="安全检测" name="listSafetyDetection" :lazy="true">
<listSafetyDetection /> <listSafetyDetection
:szrwId="szrwId"
:wagaName="wagaName"
@cancelParent="cancel"
/>
</el-tab-pane> </el-tab-pane>
</el-tabs> </el-tabs>
<!-- <div slot="footer" class="dialog-footer"> <!-- <div slot="footer" class="dialog-footer">
@ -219,14 +226,8 @@
</template> </template>
<script> <script>
import { import { listSyxjl } from "@/api/yg/szrw";
listSyxjl, import { listJbxx, getJbxx } from "@/api/yg/jbxx";
getSzrw,
delSzrw,
addSzrw,
updateSzrw,
exportSzrw,
} from "@/api/yg/szrw";
import listBaseInfo from "./components/listBaseInfo.vue"; import listBaseInfo from "./components/listBaseInfo.vue";
import listSafetyDetection from "./components/listSafetyDetection.vue"; import listSafetyDetection from "./components/listSafetyDetection.vue";
@ -257,6 +258,10 @@ export default {
title: "", title: "",
// //
open: false, open: false,
//
sluiceTypeOptions: [],
//
wagaNameOptions: [],
// //
queryParams: { queryParams: {
pageNum: 1, pageNum: 1,
@ -284,12 +289,27 @@ export default {
form: {}, form: {},
// //
rules: {}, rules: {},
szrwId: "",
}; };
}, },
created() { created() {
this.getList(); this.getList();
listJbxx({}).then((res) => {
// console.log(111, res);
this.wagaNameOptions = res.records;
});
this.getDicts("sluice_type").then((response) => {
this.sluiceTypeOptions = response.data;
});
}, },
methods: { methods: {
close() {
this.activeName = "listBaseInfo";
},
//
sluiceTypeFormat(row, column) {
return this.selectDictLabel(this.sluiceTypeOptions, row.wagaType);
},
/** 查询水闸鉴定任务关联列表 */ /** 查询水闸鉴定任务关联列表 */
getList() { getList() {
this.loading = true; this.loading = true;
@ -302,7 +322,7 @@ export default {
// //
cancel() { cancel() {
this.open = false; this.open = false;
this.reset(); // this.reset();
}, },
// //
reset() { reset() {
@ -354,22 +374,12 @@ export default {
this.resetQueryForm(); this.resetQueryForm();
this.handleQuery(); this.handleQuery();
}, },
//
handleSelectionChange(selection) {
this.ids = selection.map((item) => item.id);
this.single = selection.length !== 1;
this.multiple = !selection.length;
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加水闸鉴定任务关联";
},
/** 填按钮操作 */ /** 填按钮操作 */
fillOut(row) { fillOut(row) {
this.reset(); this.reset();
const id = row.id || this.ids; this.szrwId = row.id;
this.wagaName = row.wagaName;
this.open = true; this.open = true;
this.title = "填报安全鉴定信息"; this.title = "填报安全鉴定信息";
// getSzrw(id).then((response) => { // getSzrw(id).then((response) => {
@ -379,73 +389,6 @@ export default {
// }); // });
}, },
examine(row) {}, examine(row) {},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate((valid) => {
if (valid) {
if (this.form.id != null) {
updateSzrw(this.form).then((response) => {
if (response.code === 200) {
this.msgSuccess("修改成功");
this.open = false;
this.getList();
}
});
} else {
addSzrw(this.form).then((response) => {
if (response.code === 200) {
this.msgSuccess("新增成功");
this.open = false;
this.getList();
}
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const ids = row.id || this.ids;
if (ids) {
this.$confirm("是否删除选中的数据?", "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(function () {
return delSzrw(ids);
})
.then(() => {
this.getList();
this.msgSuccess("删除成功");
})
.catch(function () {});
} else {
this.$message.warning("请选择要删除的数据!!");
}
},
/** 导出按钮操作 */
handleExport() {
const queryParams = this.queryParams;
let message = "是否确认导出所有的数据项?";
if (this.ids) {
message = "是否确认导出选中的数据项?";
queryParams.ids = this.ids;
}
this.$confirm(message, "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(function () {
return exportSzrw(queryParams);
})
.then((response) => {
this.downloadFile(response, true, response.msg);
// this.download(response.msg);
})
.catch(function () {});
},
}, },
}; };
</script> </script>
@ -453,8 +396,9 @@ export default {
@import "@/assets/css/dialog.scss"; @import "@/assets/css/dialog.scss";
::v-deep { ::v-deep {
.el-dialog { .el-dialog {
margin-top: 10vh !important; margin-top: 8vh !important;
height: 700px; height: 800px;
overflow: auto;
} }
} }
</style> </style>

Loading…
Cancel
Save