|
@ -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); //创建新的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> |
|
|
</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> |
|
|