3 changed files with 975 additions and 2 deletions
@ -0,0 +1,502 @@ |
|||
<template> |
|||
<div> |
|||
<el-descriptions |
|||
class="margin-top" |
|||
:column="2" |
|||
border |
|||
:labelStyle="{ |
|||
'text-align': 'left', |
|||
width: '180px', |
|||
height: '50px', |
|||
}" |
|||
:contentStyle="{}" |
|||
> |
|||
<el-descriptions-item> |
|||
<template slot="label"> 水闸名称 </template> |
|||
{{ this.wagaName }} |
|||
</el-descriptions-item> |
|||
<el-descriptions-item> |
|||
<template slot="label"> 鉴定日期 </template> |
|||
{{ this.form.identifyTime }} |
|||
</el-descriptions-item> |
|||
<el-descriptions-item> |
|||
<template slot="label"> 下次鉴定日期 </template> |
|||
{{ this.form.nextIdentifyTime }} |
|||
</el-descriptions-item> |
|||
<el-descriptions-item> |
|||
<template slot="label"> 安全评价单位 </template> |
|||
{{ this.form.safetyEvaluationUnit }} |
|||
</el-descriptions-item> |
|||
<el-descriptions-item> |
|||
<template slot="label"> 单位资质 </template> |
|||
{{ this.form.unitQualification }} |
|||
</el-descriptions-item> |
|||
<el-descriptions-item> |
|||
<template slot="label"> 审定部门 </template> |
|||
{{ this.form.approvalDepartment }} |
|||
</el-descriptions-item> |
|||
<el-descriptions-item> |
|||
<template slot="label"> 审定部门级别 </template> |
|||
{{ approvalDepartmentLevelFormat(this.form) }} |
|||
</el-descriptions-item> |
|||
<el-descriptions-item> |
|||
<template slot="label"> 安全类别 </template> |
|||
{{ securityCategoryFormat(this.form) }} |
|||
</el-descriptions-item> |
|||
<el-descriptions-item> |
|||
<template slot="label"> 防洪安全鉴定意见 </template> |
|||
{{ this.form.floodControlOpinions }} |
|||
</el-descriptions-item> |
|||
<el-descriptions-item> |
|||
<template slot="label"> 结构安全鉴定意见 </template> |
|||
{{ this.form.structuralOpinion }} |
|||
</el-descriptions-item> |
|||
<el-descriptions-item> |
|||
<template slot="label"> 渗流安全鉴定意见 </template> |
|||
{{ this.form.seepageOpinion }} |
|||
</el-descriptions-item> |
|||
<el-descriptions-item> |
|||
<template slot="label"> 抗震安全鉴定意见 </template> |
|||
{{ this.form.seismicOpinion }} |
|||
</el-descriptions-item> |
|||
<el-descriptions-item> |
|||
<template slot="label"> 金属结构安全鉴定意见 </template> |
|||
{{ this.form.metalStructuralOpinion }} |
|||
</el-descriptions-item> |
|||
<el-descriptions-item> |
|||
<template slot="label"> 鉴定工程存在主要问题 </template> |
|||
{{ this.form.mainIssues }} |
|||
</el-descriptions-item> |
|||
<el-descriptions-item> |
|||
<template slot="label"> 其他工程问题 </template> |
|||
{{ this.form.otherEngineerIssues }} |
|||
</el-descriptions-item> |
|||
<el-descriptions-item> |
|||
<template slot="label"> 水闸安全评价报告 </template> |
|||
<template v-if="this.form.safetyEvaluationReport"> |
|||
<div |
|||
v-for="(item, index) in JSON.parse( |
|||
this.form.safetyEvaluationReport |
|||
)" |
|||
:key="item + index" |
|||
> |
|||
{{ item.name }} |
|||
|
|||
<i |
|||
class="el-icon-download" |
|||
@click="downloadFile2(item, index)" |
|||
style="cursor: pointer" |
|||
></i> |
|||
</div> |
|||
</template> |
|||
</el-descriptions-item> |
|||
<el-descriptions-item> |
|||
<template slot="label"> 安全鉴定报告 </template> |
|||
<template v-if="this.form.safetyAppraisalReport"> |
|||
<div |
|||
v-for="(item, index) in JSON.parse(this.form.safetyAppraisalReport)" |
|||
:key="item + index" |
|||
> |
|||
{{ item.name }} |
|||
|
|||
<i |
|||
class="el-icon-download" |
|||
@click="downloadFile2(item, index)" |
|||
style="cursor: pointer" |
|||
></i> |
|||
</div> |
|||
</template> |
|||
</el-descriptions-item> |
|||
<el-descriptions-item> |
|||
<template slot="label"> 安全鉴定意见 </template> |
|||
<template v-if="this.form.safetyAppraisalOpinion"> |
|||
<div |
|||
v-for="(item, index) in JSON.parse( |
|||
this.form.safetyAppraisalOpinion |
|||
)" |
|||
:key="item + index" |
|||
> |
|||
{{ item.name }} |
|||
|
|||
<i |
|||
class="el-icon-download" |
|||
@click="downloadFile2(item, index)" |
|||
style="cursor: pointer" |
|||
></i> |
|||
</div> |
|||
</template> |
|||
</el-descriptions-item> |
|||
</el-descriptions> |
|||
|
|||
<!-- <div class="btnList"> |
|||
<el-button type="primary">通过</el-button> |
|||
<el-button>不通过</el-button> |
|||
</div> --> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
import { |
|||
listAqjdxx, |
|||
getAqjdxx, |
|||
delAqjdxx, |
|||
addAqjdxx, |
|||
updateAqjdxx, |
|||
exportAqjdxx, |
|||
} from "@/api/yg/aqjdxx"; |
|||
import { getToken } from "@/utils/auth"; |
|||
import { getFileStream } from "@/api/system/upload"; |
|||
|
|||
export default { |
|||
name: "Aqjdxx", |
|||
props: ["wagaName", "szrwId"], |
|||
data() { |
|||
return { |
|||
// 遮罩层 |
|||
loading: true, |
|||
// 选中数组 |
|||
ids: [], |
|||
// 非单个禁用 |
|||
single: true, |
|||
// 非多个禁用 |
|||
multiple: true, |
|||
// 显示搜索条件 |
|||
showSearch: true, |
|||
// 总条数 |
|||
total: 0, |
|||
// 水闸安全鉴定信息表格数据 |
|||
aqjdxxList: [], |
|||
// 弹出层标题 |
|||
title: "", |
|||
// 是否显示弹出层 |
|||
open: false, |
|||
// 审定部门级别字典 |
|||
approvalDepartmentLevelOptions: [], |
|||
// 安全类别字典 |
|||
securityCategoryOptions: [], |
|||
// 查询参数 |
|||
queryParams: { |
|||
pageNum: 1, |
|||
pageSize: 10, |
|||
ids: null, |
|||
data: { |
|||
szrwId: null, |
|||
identifyTime: null, |
|||
nextIdentifyTime: null, |
|||
safetyEvaluationUnit: null, |
|||
unitQualification: null, |
|||
approvalDepartment: null, |
|||
approvalDepartmentLevel: null, |
|||
securityCategory: null, |
|||
floodControlOpinions: null, |
|||
structuralOpinion: null, |
|||
seepageOpinion: null, |
|||
seismicOpinion: null, |
|||
metalStructuralOpinion: null, |
|||
otherEngineerIssues: null, |
|||
mainIssues: null, |
|||
safetyEvaluationReport: null, |
|||
safetyAppraisalReport: null, |
|||
safetyAppraisalOpinion: null, |
|||
createUid: null, |
|||
updateUid: null, |
|||
owerDept: null, |
|||
relation: null, |
|||
}, |
|||
// 排序方式 |
|||
params: { |
|||
// 按哪个字段排序 |
|||
orderBy: "create_time", |
|||
// desc降序,升序asc |
|||
sortBy: "desc", |
|||
}, |
|||
}, |
|||
// 表单参数 |
|||
form: {}, |
|||
// 表单校验 |
|||
rules: {}, |
|||
// 请求头 |
|||
headers: { |
|||
shuili: "water " + getToken(), |
|||
}, |
|||
fileList1: [], |
|||
fileList2: [], |
|||
fileList3: [], |
|||
}; |
|||
}, |
|||
created() { |
|||
this.getList(); |
|||
this.getDicts("approval_department_levels").then((response) => { |
|||
this.approvalDepartmentLevelOptions = response.data; |
|||
}); |
|||
this.getDicts("security_category").then((response) => { |
|||
this.securityCategoryOptions = response.data; |
|||
}); |
|||
}, |
|||
methods: { |
|||
/** 查询水闸安全鉴定信息列表 */ |
|||
getList() { |
|||
// this.loading = true; |
|||
this.queryParams.data.szrwId = this.szrwId; |
|||
listAqjdxx(this.queryParams).then((response) => { |
|||
if (response.records[0]) { |
|||
this.form = response.records[0]; |
|||
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; |
|||
}); |
|||
}, |
|||
// 审定部门级别字典翻译 |
|||
approvalDepartmentLevelFormat(row, column) { |
|||
return this.selectDictLabel( |
|||
this.approvalDepartmentLevelOptions, |
|||
row.approvalDepartmentLevel |
|||
); |
|||
}, |
|||
// 安全类别字典翻译 |
|||
securityCategoryFormat(row, column) { |
|||
return this.selectDictLabel( |
|||
this.securityCategoryOptions, |
|||
row.securityCategory |
|||
); |
|||
}, |
|||
// 取消按钮 |
|||
cancel() { |
|||
// this.open = false; |
|||
// this.reset(); |
|||
this.$emit("cancelParent"); |
|||
}, |
|||
// 表单重置 |
|||
reset() { |
|||
this.form = { |
|||
id: null, |
|||
szrwId: null, |
|||
identifyTime: null, |
|||
nextIdentifyTime: null, |
|||
safetyEvaluationUnit: null, |
|||
unitQualification: null, |
|||
approvalDepartment: null, |
|||
approvalDepartmentLevel: null, |
|||
securityCategory: null, |
|||
floodControlOpinions: null, |
|||
structuralOpinion: null, |
|||
seepageOpinion: null, |
|||
seismicOpinion: null, |
|||
metalStructuralOpinion: null, |
|||
otherEngineerIssues: null, |
|||
mainIssues: null, |
|||
safetyEvaluationReport: null, |
|||
safetyAppraisalReport: null, |
|||
safetyAppraisalOpinion: null, |
|||
createUid: null, |
|||
updateUid: null, |
|||
createTime: null, |
|||
updateTime: null, |
|||
owerDept: null, |
|||
remark: null, |
|||
relation: null, |
|||
}; |
|||
this.resetForm("form"); |
|||
}, |
|||
// 查询表单重置 |
|||
resetQueryForm() { |
|||
this.queryParams = { |
|||
pageNum: 1, |
|||
pageSize: 10, |
|||
data: { |
|||
id: null, |
|||
szrwId: null, |
|||
identifyTime: null, |
|||
nextIdentifyTime: null, |
|||
safetyEvaluationUnit: null, |
|||
unitQualification: null, |
|||
approvalDepartment: null, |
|||
approvalDepartmentLevel: null, |
|||
securityCategory: null, |
|||
floodControlOpinions: null, |
|||
structuralOpinion: null, |
|||
seepageOpinion: null, |
|||
seismicOpinion: null, |
|||
metalStructuralOpinion: null, |
|||
otherEngineerIssues: null, |
|||
mainIssues: null, |
|||
safetyEvaluationReport: null, |
|||
safetyAppraisalReport: null, |
|||
safetyAppraisalOpinion: null, |
|||
createUid: null, |
|||
updateUid: null, |
|||
createTime: null, |
|||
updateTime: null, |
|||
owerDept: null, |
|||
remark: null, |
|||
relation: null, |
|||
}, |
|||
params: { |
|||
// 按哪个字段排序 |
|||
orderBy: "create_time", |
|||
// desc降序,升序asc |
|||
sortBy: "desc", |
|||
}, |
|||
}; |
|||
this.resetForm("form"); |
|||
}, |
|||
/** 搜索按钮操作 */ |
|||
handleQuery() { |
|||
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(); |
|||
this.open = true; |
|||
this.title = "添加水闸安全鉴定信息"; |
|||
}, |
|||
/** 修改按钮操作 */ |
|||
handleUpdate(row) { |
|||
this.reset(); |
|||
const id = row.id || this.ids; |
|||
getAqjdxx(id).then((response) => { |
|||
this.form = response.data; |
|||
this.open = true; |
|||
this.title = "修改水闸安全鉴定信息"; |
|||
}); |
|||
}, |
|||
/** 提交按钮 */ |
|||
submitForm() { |
|||
this.$refs["form"].validate((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) { |
|||
updateAqjdxx(this.form).then((response) => { |
|||
if (response.code === 200) { |
|||
this.msgSuccess("修改成功"); |
|||
this.open = false; |
|||
this.getList(); |
|||
} |
|||
}); |
|||
} else { |
|||
this.form.szrwId = this.szrwId; |
|||
addAqjdxx(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 delAqjdxx(ids); |
|||
}) |
|||
.then(() => { |
|||
this.getList(); |
|||
this.msgSuccess("删除成功"); |
|||
}) |
|||
.catch(function () {}); |
|||
} else { |
|||
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); //创建新的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对象 |
|||
}); |
|||
}, |
|||
handleExceed(files, fileList) { |
|||
this.$message.warning( |
|||
`当前限制选择 3 个文件,本次选择了 ${files.length} 个文件,共选择了 ${ |
|||
files.length + fileList.length |
|||
} 个文件` |
|||
); |
|||
}, |
|||
beforeRemove(file, fileList) { |
|||
return this.$confirm(`确定移除 ${file.name}?`); |
|||
}, |
|||
}, |
|||
}; |
|||
</script> |
|||
<style lang="scss" scoped> |
|||
@import "@/assets/css/dialog.scss"; |
|||
// ::v-deep { |
|||
// .el-dialog { |
|||
// margin-top: 2vh !important; |
|||
|
|||
// } |
|||
// } |
|||
|
|||
.btnList { |
|||
margin-top: 20px; |
|||
text-align: right; |
|||
// position: fixed; |
|||
// bottom: 20px; |
|||
// right: 20px; |
|||
// z-index: 1; |
|||
} |
|||
</style> |
@ -0,0 +1,424 @@ |
|||
<template> |
|||
<div> |
|||
<el-descriptions |
|||
class="margin-top" |
|||
:column="2" |
|||
border |
|||
:labelStyle="{ |
|||
'text-align': 'left', |
|||
width: '180px', |
|||
height: '50px', |
|||
}" |
|||
:contentStyle="{}" |
|||
> |
|||
<el-descriptions-item :span="2"> |
|||
<template slot="label"> 水闸名称 </template> |
|||
{{ this.wagaName }} |
|||
</el-descriptions-item> |
|||
<el-descriptions-item> |
|||
<template slot="label"> 闸门数量 </template> |
|||
{{ this.form.holesNumber }} |
|||
</el-descriptions-item> |
|||
<el-descriptions-item> |
|||
<template slot="label"> 启闭机数量 </template> |
|||
{{ this.form.hoistNumber }} |
|||
</el-descriptions-item> |
|||
<el-descriptions-item> |
|||
<template slot="label"> 闸门型式 </template> |
|||
{{ gateTypeFormat(this.form) }} |
|||
</el-descriptions-item> |
|||
<el-descriptions-item> |
|||
<template slot="label"> 启闭机型式 </template> |
|||
{{ hoistTypeFormat(this.form) }} |
|||
</el-descriptions-item> |
|||
<el-descriptions-item :span="2"> |
|||
<template slot="label"> 安全评价 </template> |
|||
{{ this.form.evaluate }} |
|||
</el-descriptions-item> |
|||
|
|||
<el-descriptions-item> |
|||
<template slot="label"> 现场检测成果 </template> |
|||
<template v-if="this.form.testingResults"> |
|||
<div |
|||
v-for="(item, index) in JSON.parse(this.form.testingResults)" |
|||
:key="item + index" |
|||
> |
|||
{{ item.name }} |
|||
|
|||
<i |
|||
class="el-icon-download" |
|||
@click="downloadFile2(item, index)" |
|||
style="cursor: pointer" |
|||
></i> |
|||
</div> |
|||
</template> |
|||
</el-descriptions-item> |
|||
<el-descriptions-item> |
|||
<template slot="label"> 复核计算成果 </template> |
|||
<template v-if="this.form.calculationResults"> |
|||
<div |
|||
v-for="(item, index) in JSON.parse(this.form.calculationResults)" |
|||
:key="item + index" |
|||
> |
|||
{{ item.name }} |
|||
|
|||
<i |
|||
class="el-icon-download" |
|||
@click="downloadFile2(item, index)" |
|||
style="cursor: pointer" |
|||
></i> |
|||
</div> |
|||
</template> |
|||
</el-descriptions-item> |
|||
</el-descriptions> |
|||
|
|||
<!-- <div class="btnList"> |
|||
<el-button type="primary" @click="submitForm">保 存</el-button> |
|||
<el-button @click="cancel">取 消</el-button> |
|||
</div> --> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
import { |
|||
listAqjc, |
|||
getAqjc, |
|||
delAqjc, |
|||
addAqjc, |
|||
updateAqjc, |
|||
exportAqjc, |
|||
} from "@/api/yg/aqjc"; |
|||
import { getToken } from "@/utils/auth"; |
|||
import { getFileStream } from "@/api/system/upload"; |
|||
|
|||
export default { |
|||
name: "Aqjc", |
|||
props: ["wagaName", "szrwId"], |
|||
data() { |
|||
return { |
|||
// 遮罩层 |
|||
loading: true, |
|||
// 选中数组 |
|||
ids: [], |
|||
// 非单个禁用 |
|||
single: true, |
|||
// 非多个禁用 |
|||
multiple: true, |
|||
// 显示搜索条件 |
|||
showSearch: true, |
|||
// 总条数 |
|||
total: 0, |
|||
// 水闸安全检测表格数据 |
|||
aqjcList: [], |
|||
// 弹出层标题 |
|||
title: "", |
|||
// 是否显示弹出层 |
|||
open: false, |
|||
// 闸门型式字典 |
|||
gateTypeOptions: [], |
|||
// 启闭机型式字典 |
|||
hoistTypeOptions: [], |
|||
// 查询参数 |
|||
queryParams: { |
|||
pageNum: 1, |
|||
pageSize: 10, |
|||
ids: null, |
|||
data: { |
|||
szrwId: null, |
|||
sluiceCode: null, |
|||
sluiceName: null, |
|||
holesNumber: null, |
|||
hoistNumber: null, |
|||
gateType: null, |
|||
hoistType: null, |
|||
evaluate: null, |
|||
testingResults: null, |
|||
calculationResults: null, |
|||
createUid: null, |
|||
updateUid: null, |
|||
owerDept: null, |
|||
relation: null, |
|||
}, |
|||
// 排序方式 |
|||
params: { |
|||
// 按哪个字段排序 |
|||
orderBy: "create_time", |
|||
// desc降序,升序asc |
|||
sortBy: "desc", |
|||
}, |
|||
}, |
|||
// 表单参数 |
|||
form: {}, |
|||
// 表单校验 |
|||
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() { |
|||
this.getList(); |
|||
this.getDicts("gate_type").then((response) => { |
|||
this.gateTypeOptions = response.data; |
|||
}); |
|||
this.getDicts("machine_form").then((response) => { |
|||
this.hoistTypeOptions = response.data; |
|||
}); |
|||
}, |
|||
methods: { |
|||
// 闸门型式字典翻译 |
|||
gateTypeFormat(row, column) { |
|||
return this.selectDictLabel(this.gateTypeOptions, row.gateType); |
|||
}, |
|||
// 启闭机型式字典翻译 |
|||
hoistTypeFormat(row, column) { |
|||
return this.selectDictLabel(this.hoistTypeOptions, row.hoistType); |
|||
}, |
|||
/** 查询水闸安全检测列表 */ |
|||
getList() { |
|||
// this.loading = true; |
|||
this.queryParams.data.szrwId = this.szrwId; |
|||
listAqjc(this.queryParams).then((response) => { |
|||
// this.aqjcList = response.records; |
|||
if (response.records[0]) { |
|||
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() { |
|||
// this.open = false; |
|||
// this.reset(); |
|||
this.$emit("cancelParent"); |
|||
}, |
|||
// 表单重置 |
|||
reset() { |
|||
this.form = { |
|||
id: null, |
|||
szrwId: null, |
|||
sluiceCode: null, |
|||
sluiceName: null, |
|||
holesNumber: null, |
|||
hoistNumber: null, |
|||
gateType: null, |
|||
hoistType: null, |
|||
evaluate: null, |
|||
testingResults: null, |
|||
calculationResults: null, |
|||
createUid: null, |
|||
updateUid: null, |
|||
createTime: null, |
|||
updateTime: null, |
|||
owerDept: null, |
|||
remark: null, |
|||
relation: null, |
|||
}; |
|||
this.resetForm("form"); |
|||
}, |
|||
// 查询表单重置 |
|||
resetQueryForm() { |
|||
this.queryParams = { |
|||
pageNum: 1, |
|||
pageSize: 10, |
|||
data: { |
|||
id: null, |
|||
szrwId: null, |
|||
sluiceCode: null, |
|||
sluiceName: null, |
|||
holesNumber: null, |
|||
hoistNumber: null, |
|||
gateType: null, |
|||
hoistType: null, |
|||
evaluate: null, |
|||
testingResults: null, |
|||
calculationResults: null, |
|||
createUid: null, |
|||
updateUid: null, |
|||
createTime: null, |
|||
updateTime: null, |
|||
owerDept: null, |
|||
remark: null, |
|||
relation: null, |
|||
}, |
|||
params: { |
|||
// 按哪个字段排序 |
|||
orderBy: "create_time", |
|||
// desc降序,升序asc |
|||
sortBy: "desc", |
|||
}, |
|||
}; |
|||
this.resetForm("form"); |
|||
}, |
|||
/** 搜索按钮操作 */ |
|||
handleQuery() { |
|||
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(); |
|||
this.open = true; |
|||
this.title = "添加水闸安全检测"; |
|||
}, |
|||
/** 修改按钮操作 */ |
|||
handleUpdate(row) { |
|||
this.reset(); |
|||
const id = row.id || this.ids; |
|||
getAqjc(id).then((response) => { |
|||
this.form = response.data; |
|||
this.open = true; |
|||
this.title = "修改水闸安全检测"; |
|||
}); |
|||
}, |
|||
/** 提交按钮 */ |
|||
submitForm() { |
|||
this.$refs["form"].validate((valid) => { |
|||
if (valid) { |
|||
this.form.testingResults = JSON.stringify(this.fileList1); |
|||
this.form.calculationResults = JSON.stringify(this.fileList2); |
|||
if (this.form.id != null) { |
|||
updateAqjc(this.form).then((response) => { |
|||
if (response.code === 200) { |
|||
this.msgSuccess("修改成功"); |
|||
this.open = false; |
|||
this.getList(); |
|||
} |
|||
}); |
|||
} else { |
|||
this.form.szrwId = this.szrwId; |
|||
addAqjc(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 delAqjc(ids); |
|||
}) |
|||
.then(() => { |
|||
this.getList(); |
|||
this.msgSuccess("删除成功"); |
|||
}) |
|||
.catch(function () {}); |
|||
} else { |
|||
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); //创建新的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对象 |
|||
}); |
|||
}, |
|||
handleExceed(files, fileList) { |
|||
this.$message.warning( |
|||
`当前限制选择 3 个文件,本次选择了 ${files.length} 个文件,共选择了 ${ |
|||
files.length + fileList.length |
|||
} 个文件` |
|||
); |
|||
}, |
|||
beforeRemove(file, fileList) { |
|||
return this.$confirm(`确定移除 ${file.name}?`); |
|||
}, |
|||
}, |
|||
}; |
|||
</script> |
|||
<style lang="scss" scoped> |
|||
@import "@/assets/css/dialog.scss"; |
|||
// ::v-deep { |
|||
// .el-dialog { |
|||
// margin-top: 2vh !important; |
|||
// } |
|||
// } |
|||
.btnList { |
|||
text-align: right; |
|||
// position: fixed; |
|||
// bottom: 20px; |
|||
// right: 20px; |
|||
// z-index: 1; |
|||
} |
|||
</style> |
Loading…
Reference in new issue