Browse Source

update

master_tdsql
awsl 1 month ago
parent
commit
ac61c9de25
  1. 3
      src/views/dike/managementGuarantee/standardizationConstruction/listPage/index.vue
  2. 523
      src/views/res/engineeringCondition/reslimit/index.vue
  3. 131
      src/views/res/safetyManage/floodControlManagement/components/msFxzzMember.vue
  4. 421
      src/views/res/safetyManage/floodControlManagement/components/pRTable.vue
  5. 452
      src/views/res/safetyManage/floodControlManagement/components/powerList.vue
  6. 230
      src/views/res/safetyManage/floodControlManagement/components/powerRecords.vue
  7. 5
      src/views/res/safetyManage/floodControlManagement/index.vue
  8. 549
      src/views/res/safetyManage/floodControlManagement/power.vue
  9. 645
      src/views/res/safetyManage/floodControlManagement/preplan.vue
  10. 658
      src/views/res/safetyManage/floodControlManagement/supplies.vue
  11. 818
      src/views/res/safetyManage/floodControlManagement/tissue.vue
  12. 13
      src/views/res/safetyManage/index.vue

3
src/views/dike/managementGuarantee/standardizationConstruction/listPage/index.vue

@ -846,6 +846,7 @@ export default {
updateUid: null,
updateTime: null,
status: null,
auditOpinion:''
};
this.resetForm("form");
},
@ -864,7 +865,7 @@ export default {
createTime: null,
updateUid: null,
updateTime: null,
auditOpinion:''
},
//
params: {

523
src/views/res/engineeringCondition/reslimit/index.vue

@ -1,6 +1,12 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
<el-form
:model="queryParams"
ref="queryForm"
:inline="true"
v-show="showSearch"
label-width="68px"
>
<el-form-item label="水库名称" prop="resName">
<el-input
v-model="queryParams.data.resName"
@ -11,8 +17,16 @@
/>
</el-form-item>
<el-form-item>
<el-button type="cyan" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
<el-button
type="cyan"
icon="el-icon-search"
size="mini"
@click="handleQuery"
>搜索</el-button
>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
>重置</el-button
>
</el-form-item>
</el-form>
@ -24,7 +38,8 @@
size="mini"
@click="handleAdd"
v-hasPermi="['res:examine:add']"
>新增</el-button>
>新增</el-button
>
</el-col>
<el-col :span="1.5">
<el-button
@ -34,7 +49,8 @@
:disabled="single"
@click="handleUpdate"
v-hasPermi="['res:examine:edit']"
>修改</el-button>
>修改</el-button
>
</el-col>
<el-col :span="1.5">
<el-button
@ -44,7 +60,8 @@
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['res:examine:remove']"
>删除</el-button>
>删除</el-button
>
</el-col>
<el-col :span="1.5">
<el-button
@ -53,45 +70,154 @@
size="mini"
@click="handleExport"
v-hasPermi="['res:examine:export']"
>导出</el-button>
>导出</el-button
>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
<right-toolbar
:showSearch.sync="showSearch"
@queryTable="getList"
></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="examineList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" fixed/>
<el-table-column label="序号" type="index" width="50" align="center" fixed/>
<el-table
v-loading="loading"
:data="examineList"
@selection-change="handleSelectionChange"
>
<el-table-column type="selection" width="55" align="center" fixed />
<el-table-column
label="序号"
type="index"
width="50"
align="center"
fixed
/>
<el-table-column label="水库代码" align="center" prop="resCode" min-width="120"/>
<el-table-column label="水库名称" align="center" prop="resName" min-width="120"/>
<el-table-column label="状态" align="center" prop="status" :formatter="statusFormat" min-width="120"/>
<el-table-column label="汛限水位" align="center" prop="floodLimit" min-width="120"/>
<el-table-column label="工程规范设计审批文件" align="center" prop="approveDocuments" min-width="120"/>
<el-table-column label="调整汛限水位" align="center" prop="adjustFloodLimit" min-width="120"/>
<el-table-column label="汛限水位调整意见文件" align="center" prop="adjustmentDocuments" min-width="120"/>
<el-table-column label="降低运行水位意见" align="center" prop="reduceWaterDocuments" min-width="120"/>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="180" fixed="right">
<el-table-column
label="水库代码"
align="center"
prop="resCode"
min-width="120"
/>
<el-table-column
label="水库名称"
align="center"
prop="resName"
min-width="120"
/>
<el-table-column
label="状态"
align="center"
prop="status"
:formatter="statusFormat"
min-width="120"
/>
<el-table-column
label="汛限水位"
align="center"
prop="floodLimit"
min-width="120"
/>
<el-table-column
label="工程规范设计审批文件"
align="center"
prop="approveDocuments"
min-width="120"
>
<template slot-scope="scope">
<div
v-for="(item, index) in JSON.parse(scope.row.approveDocuments)"
:key="item + index"
>
<i class="el-icon-document"></i>
{{ item.name }}
<i
class="el-icon-download"
@click="downloadFile1(scope.row.approveDocuments, index)"
style="cursor: pointer"
></i>
</div>
</template>
</el-table-column>
<el-table-column
label="调整汛限水位"
align="center"
prop="adjustFloodLimit"
min-width="120"
/>
<el-table-column
label="汛限水位调整意见文件"
align="center"
prop="adjustmentDocuments"
min-width="120"
>
<template slot-scope="scope">
<div
v-for="(item, index) in JSON.parse(scope.row.adjustmentDocuments)"
:key="item + index"
>
<i class="el-icon-document"></i>
{{ item.name }}
<i
class="el-icon-download"
@click="downloadFile1(scope.row.adjustmentDocuments, index)"
style="cursor: pointer"
></i>
</div>
</template>
</el-table-column>
<el-table-column
label="降低运行水位意见"
align="center"
prop="reduceWaterDocuments"
min-width="120"
/>
<el-table-column
label="操作"
align="center"
class-name="small-padding fixed-width"
width="180"
fixed="right"
>
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row, true)"
v-if="scope.row.examineStatus !== '0'"
>{{ formatStatusText(scope.row) }}</el-button
>
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
@click="handleUpdate(scope.row, true)"
v-hasPermi="['res:examine:edit']"
>修改</el-button>
v-if="
scope.row.examineStatus == 0 || scope.row.examineStatus == null
"
>修改</el-button
>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
@click="handleDelete(scope.row, true)"
v-hasPermi="['res:examine:remove']"
>删除</el-button>
v-if="
scope.row.examineStatus == 0 ||
scope.row.examineStatus == 2 ||
scope.row.examineStatus == null
"
>删除</el-button
>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
v-show="total > 0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@ -99,41 +225,115 @@
/>
<!-- 添加或修改水库汛限水位对话框 -->
<el-dialog :title="title" :visible.sync="open" width="1200px" append-to-body :close-on-click-modal="false">
<el-dialog
:title="title"
:visible.sync="open"
width="1200px"
append-to-body
:close-on-click-modal="false"
@close="closeDialog"
>
<el-form ref="form" :model="form" :rules="rules" label-width="160px">
<el-form-item label="水库名称" prop="resName">
<link-res :form="form"></link-res>
<link-res
:form="form"
:disabled="!statusBtnShow(['0', '2'])"
></link-res>
</el-form-item>
<el-form-item label="水库代码" prop="resCode">
<el-input v-model="form.resCode" placeholder="请输入水库代码" />
<el-input
v-model="form.resCode"
placeholder="请输入水库代码"
:disabled="!statusBtnShow(['0', '2'])"
/>
</el-form-item>
<el-form-item label="状态">
<el-radio-group v-model="form.status">
<el-radio-group
v-model="form.status"
:disabled="!statusBtnShow(['0', '2'])"
>
<el-radio
v-for="dict in statusOptions"
:key="dict.dictValue"
:label="dict.dictValue"
>{{dict.dictLabel}}</el-radio>
>{{ dict.dictLabel }}</el-radio
>
</el-radio-group>
</el-form-item>
<el-form-item label="汛限水位" prop="floodLimit">
<el-input v-model="form.floodLimit" placeholder="请输入汛限水位" />
<el-input
v-model="form.floodLimit"
placeholder="请输入汛限水位"
:disabled="!statusBtnShow(['0', '2'])"
/>
</el-form-item>
<el-form-item label="工程规范设计审批文件" prop="approveDocuments">
<el-input v-model="form.approveDocuments" placeholder="请输入工程规范设计审批文件" />
<!-- <el-input v-model="form.approveDocuments" placeholder="请输入工程规范设计审批文件" /> -->
<myUpload
:fileList="fileList1"
:disabled="!statusBtnShow(['0', '2'])"
/>
</el-form-item>
<el-form-item label="调整汛限水位" prop="adjustFloodLimit">
<el-input v-model="form.adjustFloodLimit" placeholder="请输入调整汛限水位" />
<el-input
v-model="form.adjustFloodLimit"
placeholder="请输入调整汛限水位"
:disabled="!statusBtnShow(['0', '2'])"
/>
</el-form-item>
<el-form-item label="汛限水位调整意见文件" prop="adjustmentDocuments">
<el-input v-model="form.adjustmentDocuments" placeholder="请输入汛限水位调整意见文件" />
<!-- <el-input
v-model="form.adjustmentDocuments"
placeholder="请输入汛限水位调整意见文件"
/> -->
<myUpload
:fileList="fileList2"
:disabled="!statusBtnShow(['0', '2'])"
/>
</el-form-item>
<el-form-item label="降低运行水位意见" prop="reduceWaterDocuments">
<el-input v-model="form.reduceWaterDocuments" placeholder="请输入降低运行水位意见" />
<el-input
v-model="form.reduceWaterDocuments"
placeholder="请输入降低运行水位意见"
:disabled="!statusBtnShow(['0', '2'])"
/>
</el-form-item>
<el-form-item
label="意见"
prop="auditOpintion"
v-if="statusBtnShow(['1', '2', '3', '4'])"
>
<el-input
type="textarea"
:rows="3"
placeholder="请输入意见"
v-model="form.auditOpintion"
:disabled="!statusBtnShow(['1', '2'])"
>
</el-input>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button
type="primary"
@click="submitForm()"
v-if="statusBtnShow(['0', '1', '2', '3'])"
>{{ formatBtnText() }}</el-button
>
<el-button
type="warning"
@click="submitForm(true)"
v-if="statusBtnShow(['1'])"
> </el-button
>
<el-button
type="primary"
@click="submitForm()"
v-if="statusBtnShow(['0']) || !form.examineStatus"
> </el-button
>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
@ -141,12 +341,22 @@
</template>
<script>
import { listExamine, getExamine, delExamine, addExamine, updateExamine, exportExamine } from "@/api/res/examine";
import {
listExamine,
getExamine,
delExamine,
addExamine,
updateExamine,
exportExamine,
} from "@/api/res/examine";
import LinkRes from "../../../../components/linkNameSelect/linkRes.vue";
import { getFileStream } from "@/api/system/upload";
import linkSluice from "@/components/linkNameSelect/linkSluice.vue";
export default {
name: "Examine",
components: {LinkRes},
components: { LinkRes },
data() {
return {
//
@ -173,10 +383,10 @@ export default {
queryParams: {
pageNum: 1,
pageSize: 10,
ids:null,
data:{
resName: null,
},
ids: null,
data: {
resName: null,
},
//
params: {
//
@ -184,18 +394,26 @@ export default {
// descasc
sort: "desc",
},
},
//
form: {},
//
rules: {
}
rules: {},
fileList1: [],
fileList2: [],
statusHandle: false,
statusType: {
0: "新增",
1: "已上报",
2: "被驳回",
3: "审核通过",
4: "已备案",
},
};
},
created() {
this.getList();
this.getDicts("state_of_flood_limit").then(response => {
this.getDicts("state_of_flood_limit").then((response) => {
this.statusOptions = response.data;
});
},
@ -203,7 +421,7 @@ export default {
/** 查询水库汛限水位列表 */
getList() {
this.loading = true;
listExamine(this.queryParams).then(response => {
listExamine(this.queryParams).then((response) => {
this.examineList = response.records;
this.total = response.total;
this.loading = false;
@ -216,10 +434,13 @@ export default {
//
cancel() {
this.open = false;
this.statusHandle = false;
this.reset();
},
//
reset() {
this.fileList1 = [];
this.fileList2 = [];
this.form = {
id: null,
resCode: null,
@ -235,7 +456,9 @@ export default {
createTime: null,
updateTime: null,
owerDept: null,
remark: null
remark: null,
examineStatus: "0",
auditOpintion: "",
};
this.resetForm("form");
},
@ -244,23 +467,23 @@ export default {
this.queryParams = {
pageNum: 1,
pageSize: 10,
data:{
id: null,
resCode: null,
resName: null,
status: "0",
floodLimit: null,
approveDocuments: null,
adjustFloodLimit: null,
adjustmentDocuments: null,
reduceWaterDocuments: null,
createUid: null,
updateUid: null,
createTime: null,
updateTime: null,
owerDept: null,
remark: null
}
data: {
id: null,
resCode: null,
resName: null,
status: "0",
floodLimit: null,
approveDocuments: null,
adjustFloodLimit: null,
adjustmentDocuments: null,
reduceWaterDocuments: null,
createUid: null,
updateUid: null,
createTime: null,
updateTime: null,
owerDept: null,
remark: null,
},
};
this.resetForm("form");
},
@ -276,9 +499,9 @@ export default {
},
//
handleSelectionChange(selection) {
this.ids = selection.map(item => item.id)
this.single = selection.length!==1
this.multiple = !selection.length
this.ids = selection.map((item) => item.id);
this.single = selection.length !== 1;
this.multiple = !selection.length;
},
/** 新增按钮操作 */
handleAdd() {
@ -286,22 +509,83 @@ export default {
this.open = true;
this.title = "添加水库汛限水位";
},
closeDialog() {
this.fileList1 = [];
this.fileList2 = [];
this.statusHandle = false;
this.reset();
},
formatStatusText(row) {
console.log("formatStatusText", row);
let status = row.examineStatus;
return this.statusType[status];
},
formatBtnText() {
let data = this.form;
let status = JSON.parse(JSON.stringify(data.examineStatus));
switch (status) {
case "0":
return "上 报";
case "1":
return "审 核";
case "2":
return "重新上报";
case "3":
return "备 案";
}
},
statusBtnShow(typeList) {
console.log("statusBtnShowtypeList", typeList);
console.log("statusBtnShowform", this.form);
console.log("-----------");
let data = JSON.parse(JSON.stringify(this.form));
if (data.examineStatus) {
return typeList.includes(data.examineStatus);
} else {
return false;
}
},
/** 修改按钮操作 */
handleUpdate(row) {
handleUpdate(row, statusHandle = false) {
this.statusHandle = statusHandle;
this.reset();
const id = row.id || this.ids
getExamine(id).then(response => {
const id = row.id || this.ids;
getExamine(id).then((response) => {
this.form = response.data;
if (this.form.approveDocuments) {
this.fileList1 = JSON.parse(this.form.approveDocuments);
}
if (this.form.adjustmentDocuments) {
this.fileList1 = JSON.parse(this.form.adjustmentDocuments);
}
this.open = true;
this.title = "修改水库汛限水位";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
submitForm(status) {
this.$refs["form"].validate((valid) => {
if (valid) {
this.form.approveDocuments = JSON.stringify(this.fileList1);
this.form.adjustmentDocuments = JSON.stringify(this.fileList2);
if (this.form.id != null) {
updateExamine(this.form).then(response => {
if (this.statusHandle) {
if (status) {
this.form.examineStatus = "2";
} else if (this.form.examineStatus == "2") {
this.form.examineStatus = "1";
} else if (this.form.examineStatus == "1") {
this.form.examineStatus = "3";
} else {
this.form.examineStatus = parseInt(this.form.examineStatus) + 1;
}
}
updateExamine(this.form).then((response) => {
if (response.code === 200) {
this.msgSuccess("修改成功");
this.open = false;
@ -309,7 +593,9 @@ export default {
}
});
} else {
addExamine(this.form).then(response => {
this.form.examineStatus = "0";
this.form.auditOpinion = "";
addExamine(this.form).then((response) => {
if (response.code === 200) {
this.msgSuccess("新增成功");
this.open = false;
@ -323,49 +609,76 @@ export default {
/** 删除按钮操作 */
handleDelete(row) {
const ids = row.id || this.ids;
if(ids){
this.$confirm("是否删除选中的数据?", "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(function() {
return delExamine(ids);
}).then(() => {
this.getList();
this.msgSuccess("删除成功");
}).catch(function() {});
}else{
this.$message.warning("请选择要删除的数据!!");
if (ids) {
this.$confirm("是否删除选中的数据?", "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(function () {
return delExamine(ids);
})
.then(() => {
this.getList();
this.msgSuccess("删除成功");
})
.catch(function () {});
} else {
this.$message.warning("请选择要删除的数据!!");
}
},
/** 导出按钮操作 */
handleExport() {
const queryParams = this.queryParams;
let message = "是否确认导出所有的数据项?";
if(this.ids){
if (this.ids) {
message = "是否确认导出选中的数据项?";
queryParams.ids = this.ids;
}
this.$confirm(message, "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(function() {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(function () {
return exportExamine(queryParams);
}).then(response => {
this.downloadFile(response, true, response.msg);
})
.then((response) => {
this.downloadFile(response, true, response.msg);
// this.download(response.msg);
}).catch(function() {});
}
}
})
.catch(function () {});
},
downloadFile1(item, index) {
let file = JSON.parse(item)[index];
this.handlePreview(file);
},
//
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
});
},
},
};
</script>
<style lang="scss" scoped>
@import "@/assets/css/dialog.scss";
// ::v-deep {
// .el-dialog {
// margin-top: 2vh !important;
// }
// }
@import "@/assets/css/dialog.scss";
// ::v-deep {
// .el-dialog {
// margin-top: 2vh !important;
// }
// }
</style>

131
src/views/res/safetyManage/floodControlManagement/components/msFxzzMember.vue

@ -0,0 +1,131 @@
<template>
<el-row :gutter="15">
<el-form ref="form" :model="form" :rules="rules" label-width="110px">
<!-- <el-col :span="6">
<el-form-item label="组织id" prop="organizationId">
<el-input v-model="form.organizationId" placeholder="请输入组织id" />
</el-form-item>
</el-col> -->
<el-col :span="6">
<el-form-item label="组织人员名称" prop="name">
<el-input v-model="form.name" placeholder="请输入组织人员名称" />
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="职务" prop="duites">
<el-input v-model="form.duites" placeholder="请输入职务" />
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="电话" prop="phone">
<el-input v-model="form.phone" placeholder="请输入电话" />
</el-form-item>
</el-col>
<el-col :span="6">
<el-button-group>
<el-button icon="el-icon-plus" @click="addFormFarther"></el-button>
<el-button
icon="el-icon-minus"
@click="delFormFarther"
v-if="!isFirst"
></el-button>
</el-button-group>
</el-col>
</el-form>
</el-row>
</template>
<script>
export default {
props: {
isFirst: {
default() {
return false;
},
},
index: {},
status: {},
editItem: {},
addForm: {
type: Function,
default: () => {
console.log(777);
},
},
},
data() {
return {
form: {},
rules: {
name: [
{ required: true, message: "请输入组织人员名称", trigger: "blur" },
],
duites: [
{ required: true, message: "请输入组织人员名称", trigger: "blur" },
],
phone: [
{ required: true, message: "请输入手机号", trigger: "blur" },
{
pattern:
/^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\d{8}$/,
message: "手机号格式不正确",
trigger: "blur",
},
],
},
};
},
created() {
//
if (this.status) {
this.form = this.editItem;
} else {
this.form = {
id: null,
organizationId: null,
name: null,
duites: null,
phone: null,
createUid: null,
updateUid: null,
createTime: null,
updateTime: null,
owerDept: null,
remark: null,
relation: null,
};
}
console.log("this.form in components", this.form);
// form
// if (this.isFirst) {
// this.form = this.firstForm;
// console.log(" this.firstForm;", this.firstForm);
// }
// console.log("isFirst", this.isFirst);
// console.log("markTypeOptions", this.markTypeOptions);
},
watch: {
editItem: {
deep: true,
handler(newVal, oldVal) {
//
this.form = newVal;
// console.log("name", newVal);
},
},
},
methods: {
addFormFarther() {
this.addForm(this.index);
},
delFormFarther() {
this.$emit("delForm", this.form.id, this.index);
},
validateForm() {
this.$refs.form.validate((valid) => (this.valid = valid));
},
validClear() {
this.$refs.form.clearValidate();
},
},
};
</script>

421
src/views/res/safetyManage/floodControlManagement/components/pRTable.vue

@ -0,0 +1,421 @@
<template>
<div>
<div class="listTitle">
<span>{{ recordsType }}</span>
<span class="addBtn" @click="handleAdd">
<i class="el-icon-plus"></i>
添加
</span>
</div>
<el-table v-loading="loading" :data="tableList">
<el-table-column
label="序号"
type="index"
width="50"
align="center"
fixed
/>
<!-- <el-table-column
label="电源id"
align="center"
prop="powerId"
min-width="120"
/>
<el-table-column
label="类型"
align="center"
prop="type"
min-width="120"
/> -->
<el-table-column
label="负责人名称"
align="center"
prop="personName"
min-width="120"
/>
<el-table-column
label="描述"
align="center"
prop="describetion"
min-width="120"
/>
<el-table-column
label="试运行日期"
align="center"
sortable
prop="time"
min-width="120"
>
<template slot-scope="scope">
<span>{{ parseTime(scope.row.time, "{y}-{m}-{d}") }}</span>
</template>
</el-table-column>
<el-table-column
label="操作"
align="center"
class-name="small-padding fixed-width"
width="180"
fixed="right"
>
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
>修改</el-button
>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
>删除</el-button
>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total > 0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 添加或修改水闸备用电源试运行记录对话框 -->
<el-dialog
:title="title"
:visible.sync="open"
width="800px"
append-to-body
:close-on-click-modal="false"
>
<el-form ref="form" :model="form" :rules="rules" label-width="96px">
<!-- <el-form-item label="电源id" prop="powerId">
<el-input v-model="form.powerId" placeholder="请输入电源id" />
</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="personName">
<el-input v-model="form.personName" placeholder="请输入负责人名称" />
</el-form-item>
<el-form-item label="试运行日期" prop="time">
<el-date-picker
clearable
size="small"
style="width: 100%"
v-model="form.time"
type="date"
value-format="yyyy-MM-dd"
placeholder="选择试运行日期"
>
</el-date-picker>
</el-form-item>
<el-form-item label="描述" prop="describetion">
<el-input
v-model="form.describetion"
placeholder="请输入描述"
type="textarea"
/>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import {
listSyxjl,
getSyxjl,
delSyxjl,
addSyxjl,
updateSyxjl,
exportSyxjl,
} from "@/api/yg/syxjl";
export default {
name: "Syxjl",
props: ["activeName", "powerId"],
data() {
return {
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
syxjlList: [],
//
title: "",
//
open: false,
//
queryParams: {
pageNum: 1,
pageSize: 10,
ids: null,
data: {
powerId: null,
type: null,
personName: null,
describetion: null,
time: null,
createUid: null,
updateUid: null,
owerDept: null,
relation: null,
},
//
params: {
//
orderBy: "create_time",
// descasc
sortBy: "desc",
},
},
//
form: {},
//
rules: {
personName: [
{ required: true, message: "请输入负责人名称", trigger: "blur" },
],
time: [
{ required: true, message: "请选择试运行时间", trigger: "blur" },
],
describetion: [
{ required: true, message: "请描述文字", trigger: "blur" },
],
},
};
},
computed: {
recordsType() {
if (this.activeName === "daily") {
return "日常";
} else if (this.activeName === "beforeFlood") {
return "汛前";
} else if (this.activeName === "afterFlood") {
return "汛后";
}
},
tableList() {
let list = [];
if (this.activeName === "daily") {
list = this.syxjlList.filter((res) => res.type == "0");
return list;
} else if (this.activeName === "beforeFlood") {
list = this.syxjlList.filter((res) => res.type == "1");
return list;
} else if (this.activeName === "afterFlood") {
list = this.syxjlList.filter((res) => res.type == "2");
return list;
}
},
recordsTypeCode() {
if (this.activeName === "daily") {
return "0";
} else if (this.activeName === "beforeFlood") {
return "1";
} else if (this.activeName === "afterFlood") {
return "2";
}
},
},
created() {
this.getList();
},
methods: {
/** 查询水闸备用电源试运行记录列表 */
getList() {
this.loading = true;
this.queryParams.data.powerId = this.powerId;
// this.queryParams.data.type = this.recordsTypeCode;
listSyxjl(this.queryParams).then((response) => {
this.syxjlList = response.records;
// this.total = response.total;
this.loading = false;
});
},
//
cancel() {
this.open = false;
this.reset();
},
//
reset() {
this.form = {
id: null,
powerId: null,
type: null,
personName: null,
describetion: null,
time: 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,
powerId: null,
type: null,
personName: null,
describetion: null,
time: null,
createUid: null,
updateUid: null,
createTime: null,
updateTime: null,
owerDept: null,
remark: null,
relation: null,
},
//
params: {
//
orderBy: "create_time",
// descasc
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;
getSyxjl(id).then((response) => {
this.form = response.data;
this.open = true;
this.title = "修改水闸备用电源试运行记录";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate((valid) => {
if (valid) {
if (this.form.id != null) {
updateSyxjl(this.form).then((response) => {
if (response.code === 200) {
this.msgSuccess("修改成功");
this.open = false;
this.getList();
}
});
} else {
this.form.powerId = this.powerId;
this.form.type = this.recordsTypeCode;
addSyxjl(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 delSyxjl(ids);
})
.then(() => {
this.getList();
this.msgSuccess("删除成功");
})
.catch(function () {});
} else {
this.$message.warning("请选择要删除的数据!!");
}
},
},
};
</script>
<style lang="scss" scoped>
@import "@/assets/css/dialog.scss";
::v-deep .el-dialog {
margin-top: 30vh !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;
}
}
.listTitle:nth-child(1) {
margin-top: 0;
}
</style>

452
src/views/res/safetyManage/floodControlManagement/components/powerList.vue

@ -0,0 +1,452 @@
<template>
<div style="padding: 10px">
<div class="listTitle">
<span>备用电源信息</span>
<span class="addBtn" @click="handleAdd">
<i class="el-icon-plus"></i>
添加
</span>
</div>
<el-table v-loading="loading" :data="bydyList">
<el-table-column
label="序号"
type="index"
width="50"
align="center"
fixed
/>
<el-table-column
label="备用电源名称"
align="center"
prop="backupPowerName"
min-width="120"
/>
<el-table-column
label="电源功率"
align="center"
sortable
prop="powerSupplyPower"
min-width="120"
/>
<el-table-column
label="采购时间"
align="center"
sortable
prop="procurementTime"
min-width="120"
>
<template slot-scope="scope">
<span>{{ parseTime(scope.row.procurementTime, "{y}-{m}-{d}") }}</span>
</template>
</el-table-column>
<el-table-column
label="负责人名称"
align="center"
prop="personName"
min-width="120"
/>
<el-table-column
label="负责人电话"
align="center"
prop="personPhone"
min-width="120"
/>
<el-table-column
label="负责人职务"
align="center"
prop="personLevel"
min-width="120"
/>
<el-table-column
label="操作"
align="center"
class-name="small-padding fixed-width"
width="180"
fixed="right"
>
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['sz:bydy:edit']"
>修改</el-button
>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['sz:bydy:remove']"
>删除</el-button
>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total > 0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 添加或修改堤防备用电源信息对话框 -->
<el-dialog
:title="title"
:visible.sync="open"
width="800px"
append-to-body
:close-on-click-modal="false"
>
<el-row :gutter="15">
<el-form ref="form" :model="form" :rules="rules" label-width="110px">
<el-col :span="12">
<el-form-item label="备用电源名称" prop="backupPowerName">
<el-input
v-model="form.backupPowerName"
placeholder="请输入备用电源名称"
/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="电源功率" prop="powerSupplyPower">
<el-input
v-model="form.powerSupplyPower"
placeholder="请输入电源功率"
/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="采购时间" prop="procurementTime">
<el-date-picker
clearable
size="small"
style="width: 100%"
v-model="form.procurementTime"
type="date"
value-format="yyyy-MM-dd"
placeholder="选择采购时间"
>
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="负责人名称" prop="personName">
<el-input
v-model="form.personName"
placeholder="请输入负责人名称"
/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="负责人电话" prop="personPhone">
<el-input
v-model="form.personPhone"
placeholder="请输入负责人电话"
/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="负责人职务" prop="personLevel">
<el-input
v-model="form.personLevel"
placeholder="请输入负责人职务"
/>
</el-form-item>
</el-col>
</el-form>
</el-row>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import {
listBydy,
getBydy,
delBydy,
addBydy,
updateBydy,
exportBydy,
} from "@/api/yg/bydy";
export default {
name: "Bydy",
props: ["prowerTypeId"],
data() {
return {
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
bydyList: [],
//
title: "",
//
open: false,
//
queryParams: {
pageNum: 1,
pageSize: 10,
ids: null,
data: {
bydyzbId: null,
dikeId: null,
backupPowerName: null,
dikeName: null,
powerSupplyPower: null,
procurementTime: null,
personName: null,
personPhone: null,
personLevel: null,
createUid: null,
updateUid: null,
owerDept: null,
relation: null,
},
//
params: {
//
orderBy: "create_time",
// descasc
sortBy: "desc",
},
},
//
form: {},
//
rules: {
backupPowerName: [
{ required: true, message: "请输入备用电源名称", trigger: "blur" },
],
powerSupplyPower: [
{ required: true, message: "请输入电源功率", trigger: "blur" },
{
pattern:
/(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/,
message: "请输入数字,可保留两位小数",
trigger: "blur",
},
],
procurementTime: [
{ required: true, message: "选择采购时间", trigger: "blur" },
],
personName: [
{ required: true, message: "请输入负责人名称", trigger: "blur" },
],
personPhone: [
{ required: true, message: "请输入负责人电话", trigger: "blur" },
{
pattern:
/^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\d{8}$/,
message: "手机号格式不正确",
trigger: "blur",
},
],
personLevel: [
{ required: true, message: "请输入负责人职务", trigger: "blur" },
],
},
};
},
created() {
this.getList();
},
methods: {
/** 查询堤防备用电源信息列表 */
getList() {
this.loading = true;
this.queryParams.data.bydyzbId = this.prowerTypeId;
listBydy(this.queryParams).then((response) => {
this.bydyList = response.records;
this.total = response.total;
this.loading = false;
});
},
//
cancel() {
this.open = false;
this.reset();
},
//
reset() {
this.form = {
id: null,
dikeId: null,
backupPowerName: null,
dikeName: null,
powerSupplyPower: null,
procurementTime: null,
personName: null,
personPhone: null,
personLevel: 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,
dikeId: null,
backupPowerName: null,
dikeName: null,
powerSupplyPower: null,
procurementTime: null,
personName: null,
personPhone: null,
personLevel: null,
createUid: null,
updateUid: null,
createTime: null,
updateTime: null,
owerDept: null,
remark: null,
relation: null,
},
//
params: {
//
orderBy: "create_time",
// descasc
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;
getBydy(id).then((response) => {
this.form = response.data;
this.open = true;
this.title = "修改堤防备用电源信息";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate((valid) => {
if (valid) {
if (this.form.id != null) {
updateBydy(this.form).then((response) => {
if (response.code === 200) {
this.msgSuccess("修改成功");
this.open = false;
this.getList();
}
});
} else {
this.form.bydyzbId = this.prowerTypeId;
addBydy(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 delBydy(ids);
})
.then(() => {
this.getList();
this.msgSuccess("删除成功");
})
.catch(function () {});
} else {
this.$message.warning("请选择要删除的数据!!");
}
},
},
};
</script>
<style lang="scss" scoped>
@import "@/assets/css/dialog.scss";
::v-deep .el-dialog {
margin-top: 25vh !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;
}
}
.listTitle:nth-child(1) {
margin-top: 0;
}
</style>

230
src/views/res/safetyManage/floodControlManagement/components/powerRecords.vue

@ -0,0 +1,230 @@
<template>
<div style="padding: 10px">
<div class="listTitle">
<span>试运行记录</span>
<!-- <span class="addBtn" @click="viewRun">
<i class="el-icon-plus"></i>
添加
</span> -->
</div>
<el-table v-loading="listLoading" :data="bydyList">
<el-table-column
label="序号"
type="index"
width="50"
align="center"
fixed
/>
<el-table-column
label="备用电源名称"
align="center"
prop="backupPowerName"
min-width="120"
/>
<el-table-column
label="电源功率"
align="center"
sortable
prop="powerSupplyPower"
min-width="120"
/>
<el-table-column
label="采购时间"
align="center"
sortable
prop="procurementTime"
min-width="120"
>
<template slot-scope="scope">
<span>{{ parseTime(scope.row.procurementTime, "{y}-{m}-{d}") }}</span>
</template>
</el-table-column>
<el-table-column
label="负责人名称"
align="center"
prop="personName"
min-width="120"
/>
<el-table-column
label="负责人电话"
align="center"
prop="personPhone"
min-width="120"
/>
<el-table-column
label="负责人职务"
align="center"
prop="personLevel"
min-width="120"
/>
<el-table-column
label="操作"
align="center"
class-name="small-padding fixed-width"
width="180"
fixed="right"
>
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-plus"
@click="viewRun(scope.row)"
v-hasPermi="['sz:bydy:viewRun']"
>新增试运行记录</el-button
>
</template>
</el-table-column>
</el-table>
<pagination
v-show="listTotal > 0"
:total="listTotal"
:page.sync="listQueryParams.pageNum"
:limit.sync="listQueryParams.pageSize"
@pagination="getParentList"
/>
<!-- 管理试运行 -->
<el-dialog
:title="title"
:visible.sync="open"
width="1000px"
append-to-body
:close-on-click-modal="false"
>
<el-tabs v-model="activeName" style="margin-bottom: 20px" v-if="open">
<el-tab-pane label="日常" name="daily" :lazy="true">
<pRTable :activeName="activeName" :powerId="powerId" />
</el-tab-pane>
<el-tab-pane label="汛前" name="beforeFlood" :lazy="true">
<pRTable :activeName="activeName" :powerId="powerId" />
</el-tab-pane>
<el-tab-pane label="汛后" name="afterFlood" :lazy="true">
<pRTable :activeName="activeName" :powerId="powerId" />
</el-tab-pane>
</el-tabs>
<!-- <div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div> -->
</el-dialog>
</div>
</template>
<script>
import {
listBydy,
getBydy,
delBydy,
addBydy,
updateBydy,
exportBydy,
} from "@/api/yg/bydy";
import pRTable from "./pRTable.vue";
export default {
name: "Bydy_show",
props: ["prowerTypeId"],
components: {
pRTable,
},
data() {
return {
//
listLoading: true,
//
listTotal: 0,
//
bydyList: [],
//
listQueryParams: {
pageNum: 1,
pageSize: 10,
ids: null,
data: {
bydyzbId: null,
dikeId: null,
backupPowerName: null,
dikeName: null,
powerSupplyPower: null,
procurementTime: null,
personName: null,
personPhone: null,
personLevel: null,
createUid: null,
updateUid: null,
owerDept: null,
relation: null,
},
//
params: {
//
orderBy: "create_time",
// descasc
sortBy: "desc",
},
},
//
title: "",
detailTitle: "",
open: false,
detailOpen: false,
activeName: "daily",
powerId: "",
};
},
created() {
this.getParentList();
},
methods: {
viewRun(row) {
this.title = "试运行记录管理";
this.open = true;
this.powerId = row.id;
},
/** 查询堤防备用电源种类列表 */
getParentList() {
this.listLoading = true;
this.listQueryParams.data.bydyzbId = this.prowerTypeId;
listBydy(this.listQueryParams).then((response) => {
this.bydyList = response.records;
this.listTotal = response.total;
this.listLoading = false;
});
},
},
};
</script>
<style lang="scss" scoped>
@import "@/assets/css/dialog.scss";
::v-deep .el-dialog {
margin-top: 25vh !important;
height: 500px;
}
.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;
}
}
.listTitle:nth-child(1) {
margin-top: 0;
}
</style>

5
src/views/res/safetyManage/floodControlManagement/index.vue

@ -0,0 +1,5 @@
<template>
<div class="app-container">
<router-view />
</div>
</template>

549
src/views/res/safetyManage/floodControlManagement/power.vue

@ -0,0 +1,549 @@
<template>
<div class="">
<el-breadcrumb separator="/" style="margin-bottom: 20px">
<el-breadcrumb-item
v-for="(item, index) in routeList"
:key="item + index"
:to="{ path: item.path }"
>
{{ item.routeName }}
</el-breadcrumb-item>
</el-breadcrumb>
<el-form
:model="queryParams"
ref="queryForm"
:inline="true"
v-show="showSearch"
label-width="68px"
>
<el-form-item label="关联堤防" prop="dikeName">
<el-input
v-model="queryParams.cv.value"
placeholder="请输入堤防名称"
clearable
size="small"
@keyup.enter.native="handleQuery"
>
<el-button
type="primary"
slot="append"
icon="el-icon-search"
size="small"
@click="handleQuery"
></el-button>
</el-input>
</el-form-item>
<!-- <el-form-item label="关联堤防" prop="dikeCode">
<el-select
v-model="queryParams.data.dikeCode"
placeholder="请选择关联堤防"
style="width: 100%"
@change="handleQuery"
>
<el-option
v-for="dict in dikeNameOptions"
:key="dict.id"
:label="dict.dikeName"
:value="dict.dikeCode"
></el-option>
</el-select>
</el-form-item> -->
<el-form-item label="备用电源种类" prop="powerType" label-width="96px">
<el-select
v-model="queryParams.data.powerType"
placeholder="请选择备用电源种类"
clearable
size="small"
@change="handleQuery"
>
<el-option
v-for="dict in powerTypeOptions"
:key="dict.dictValue"
:label="dict.dictLabel"
:value="dict.dictValue"
/>
</el-select>
</el-form-item>
<el-form-item>
<!-- <el-button
type="cyan"
icon="el-icon-search"
size="mini"
@click="handleQuery"
>搜索</el-button
> -->
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">
重置
</el-button>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
icon="el-icon-plus"
size="mini"
@click="handleAdd"
v-hasPermi="['df:bydyzb:add']"
>新增电源种类</el-button
>
</el-col>
<el-col :span="1.5">
<el-button
type="success"
icon="el-icon-edit"
size="mini"
:disabled="single"
@click="handleUpdate"
v-hasPermi="['df:bydyzb:edit']"
>修改</el-button
>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['df:bydyzb:remove']"
>删除</el-button
>
</el-col>
<right-toolbar
:showSearch.sync="showSearch"
@queryTable="getList"
></right-toolbar>
</el-row>
<el-table
v-loading="loading"
:data="bydyzbList"
@selection-change="handleSelectionChange"
>
<el-table-column type="selection" width="55" align="center" fixed />
<el-table-column
label="序号"
type="index"
width="50"
align="center"
fixed
/>
<el-table-column
label="关联堤防"
align="center"
prop="dikeName"
min-width="120"
/>
<!-- <el-table-column
label="关联堤防"
align="center"
prop="dikeCode"
:formatter="dikeCodeFormat"
min-width="120"
/> -->
<el-table-column
label="备用电源数量(字段未有)"
align="center"
prop="powerNumber"
min-width="120"
/>
<el-table-column
label="备用电源种类"
align="center"
prop="powerType"
:formatter="powerTypeFormat"
min-width="120"
/>
<el-table-column
label="操作"
align="center"
class-name="small-padding fixed-width"
width="210"
fixed="right"
>
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['df:bydyzb:edit']"
>修改</el-button
>
<el-button
size="mini"
type="text"
icon="el-icon-plus"
@click="addPowerList(scope.row)"
v-hasPermi="['df:bydyzb:addPowerList']"
>新增电源</el-button
>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['df:bydyzb:remove']"
>删除</el-button
>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total > 0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 添加或修改备用电源种类 -->
<el-dialog
:title="title"
:visible.sync="open"
width="800px"
append-to-body
:close-on-click-modal="false"
>
<el-form ref="form" :model="form" :rules="rules" label-width="110px">
<el-form-item label="关联堤防" prop="dikeCode">
<linkDike :form="form" v-if="open" />
<!-- <el-select
v-model="form.dikeCode"
placeholder="请选择关联堤防"
style="width: 100%"
>
<el-option
v-for="dict in dikeNameOptions"
:key="dict.id"
:label="dict.dikeName"
:value="dict.dikeCode"
></el-option>
</el-select> -->
</el-form-item>
<el-form-item label="备用电源种类" prop="powerType">
<el-select
v-model="form.powerType"
placeholder="请选择备用电源种类"
style="width: 100%"
>
<el-option
v-for="dict in powerTypeOptions"
:key="dict.dictValue"
:label="dict.dictLabel"
:value="dict.dictValue"
></el-option>
</el-select>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
<!-- 备用电源 -->
<el-dialog
:title="addTitle"
:visible.sync="addOpen"
width="1200px"
append-to-body
:close-on-click-modal="false"
@close="close"
>
<el-tabs v-model="activeName" style="margin-bottom: 20px" v-if="addOpen">
<el-tab-pane label="备用电源信息" name="powerList" :lazy="true">
<powerList ref="powerList" :prowerTypeId="prowerTypeId" />
</el-tab-pane>
<el-tab-pane label="试运行记录" name="powerRecords" :lazy="true">
<powerRecords
:prowerTypeId="prowerTypeId"
v-if="activeName === 'powerRecords'"
/>
</el-tab-pane>
</el-tabs>
</el-dialog>
</div>
</template>
<script>
import {
listBydyzb,
getBydyzb,
delBydyzb,
addBydyzb,
updateBydyzb,
exportBydyzb,
} from "@/api/yg/dike/bydyzb";
import { listJbxx, getJbxx } from "@/api/yg/dike/jbxx";
import powerList from "./components/powerList.vue";
import powerRecords from "./components/powerRecords.vue";
import linkDike from "@/components/linkNameSelect/linkDike.vue";
export default {
name: "Bydyzb",
components: {
powerList,
powerRecords,
linkDike,
},
data() {
return {
//
routeList: [
{
path: "/dike/safetyManage/floodControlManagement/power",
routeName: "防汛电源管理",
},
],
activeName: "powerList",
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
bydyzbList: [],
//
title: "",
addTitle: "",
//
open: false,
addOpen: false,
//
powerTypeOptions: [],
//
dikeNameOptions: [],
//
queryParams: {
pageNum: 1,
pageSize: 10,
ids: null,
data: {
dikeCode: null,
powerType: null,
powerModel: null,
dikeName: null,
createUid: null,
updateUid: null,
owerDept: null,
relation: null,
},
cv: {
type: "like",
name: "dikeName",
value: null,
},
//
params: {
//
orderBy: "create_time",
// descasc
sortBy: "desc",
},
},
//
form: {},
//
rules: {
dikeCode: [
{ required: true, message: "请选择关联堤防", trigger: "change" },
],
powerType: [
{ required: true, message: "请选择备用电源种类", trigger: "change" },
],
},
prowerTypeId: "",
};
},
created() {
this.getList();
listJbxx({ data: {} }).then((res) => {
this.dikeNameOptions = res.records;
});
this.getDicts("type_of_power").then((response) => {
this.powerTypeOptions = response.data;
});
},
methods: {
close() {
this.activeName = "powerList";
},
addPowerList(row) {
this.prowerTypeId = row.id;
this.addTitle = "管理备用电源信息";
this.addOpen = true;
},
/** 查询堤防备用电源主列表 */
getList() {
this.loading = true;
listBydyzb(this.queryParams).then((response) => {
this.bydyzbList = response.records;
this.total = response.total;
this.loading = false;
});
},
dikeCodeFormat(row) {
const dikeCode = row.dikeCode;
let data = this.dikeNameOptions.find((res) => res.dikeCode == dikeCode);
if (data) return data.dikeName;
},
//
powerTypeFormat(row, column) {
return this.selectDictLabel(this.powerTypeOptions, row.powerType);
},
//
cancel() {
this.open = false;
this.reset();
},
//
reset() {
this.form = {
id: null,
dikeCode: null,
powerType: null,
powerModel: null,
dikeName: 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,
dikeCode: null,
powerType: null,
powerModel: null,
dikeName: null,
createUid: null,
updateUid: null,
createTime: null,
updateTime: null,
owerDept: null,
remark: null,
relation: null,
},
cv: {
type: "like",
name: "dikeName",
value: null,
},
//
params: {
//
orderBy: "create_time",
// descasc
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;
getBydyzb(id).then((response) => {
this.form = response.data;
this.open = true;
this.title = "修改堤防备用电源主";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate((valid) => {
if (valid) {
if (this.form.id != null) {
updateBydyzb(this.form).then((response) => {
if (response.code === 200) {
this.msgSuccess("修改成功");
this.open = false;
this.getList();
}
});
} else {
addBydyzb(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 delBydyzb(ids);
})
.then(() => {
this.getList();
this.msgSuccess("删除成功");
})
.catch(function () {});
} else {
this.$message.warning("请选择要删除的数据!!");
}
},
},
};
</script>
<style lang="scss" scoped>
@import "@/assets/css/dialog.scss";
::v-deep .el-tabs__content {
height: 500px;
overflow: auto;
}
</style>

645
src/views/res/safetyManage/floodControlManagement/preplan.vue

@ -0,0 +1,645 @@
<template>
<div>
<el-breadcrumb separator="/" style="margin-bottom: 20px">
<el-breadcrumb-item
v-for="(item, index) in routeList"
:key="item + index"
:to="{ path: item.path }"
>
{{ item.routeName }}
</el-breadcrumb-item>
</el-breadcrumb>
<el-form
:model="queryParams"
ref="queryForm"
:inline="true"
v-show="showSearch"
label-width="68px"
>
<el-form-item label="关联堤防" prop="dikeName">
<el-input
v-model="queryParams.cv.value"
placeholder="请输入堤防名称"
clearable
size="small"
@keyup.enter.native="handleQuery"
>
<el-button
type="primary"
slot="append"
icon="el-icon-search"
size="small"
@click="handleQuery"
></el-button>
</el-input>
</el-form-item>
<el-form-item label="预案类型" prop="type">
<el-select
v-model="queryParams.data.type"
placeholder="请选择预案类型"
clearable
size="small"
@change="handleQuery"
>
<el-option
v-for="dict in typeOptions"
:key="dict.dictValue"
:label="dict.dictLabel"
:value="dict.dictValue"
/>
</el-select>
</el-form-item>
<el-form-item>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
>重置</el-button
>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
icon="el-icon-plus"
size="mini"
@click="handleAdd"
v-hasPermi="['df:yaxx:add']"
>新增</el-button
>
</el-col>
<el-col :span="1.5">
<el-button
type="success"
icon="el-icon-edit"
size="mini"
:disabled="single"
@click="handleUpdate"
v-hasPermi="['df:yaxx:edit']"
>修改</el-button
>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['df:yaxx:remove']"
>删除</el-button
>
</el-col>
<right-toolbar
:showSearch.sync="showSearch"
@queryTable="getList"
></right-toolbar>
</el-row>
<el-table
v-loading="loading"
:data="yaxxList"
@selection-change="handleSelectionChange"
>
<el-table-column type="selection" width="55" align="center" fixed />
<el-table-column
label="序号"
type="index"
width="50"
align="center"
fixed
/>
<el-table-column
label="关联堤防"
align="center"
prop="dikeName"
min-width="120"
/>
<!-- <el-table-column
label="关联堤防"
align="center"
prop="dikeCode"
:formatter="dikeCodeFormat"
min-width="120"
/> -->
<!-- <el-table-column
label="堤防代码"
align="center"
prop="dikeCode"
min-width="120"
/>
<el-table-column
label="堤防名称"
align="center"
prop="dikeName"
min-width="120"
/>
<el-table-column
label="堤防类型"
align="center"
prop="dikeType"
min-width="120"
/>
<el-table-column
label="工程规模"
align="center"
prop="engineerScale"
min-width="120"
/> -->
<el-table-column
label="负责人"
align="center"
prop="personName"
min-width="120"
/>
<el-table-column
label="类型"
align="center"
prop="type"
:formatter="typeFormat"
min-width="120"
/>
<el-table-column
label="开展时间"
align="center"
prop="implementationTime"
min-width="120"
sortable
>
<template slot-scope="scope">
<span>{{
parseTime(scope.row.implementationTime, "{y}-{m}-{d}")
}}</span>
</template>
</el-table-column>
<!-- <el-table-column label="预案内容" align="center" prop="planContent" min-width="120"/> -->
<!-- <el-table-column label="图片" align="center" prop="photo" min-width="120"/> -->
<el-table-column
label="操作"
align="center"
class-name="small-padding fixed-width"
width="180"
fixed="right"
>
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['df:yaxx:edit']"
>修改</el-button
>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['df:yaxx:remove']"
>删除</el-button
>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total > 0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 添加或修改堤防预案对话框 -->
<el-dialog
:title="title"
:visible.sync="open"
width="1200px"
append-to-body
:close-on-click-modal="false"
>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="关联堤防" prop="dikeCode">
<linkDike :form="form" v-if="open" />
<!-- <el-select
v-model="form.dikeCode"
placeholder="请选择关联堤防"
style="width: 100%"
>
<el-option
v-for="dict in dikeNameOptions"
:key="dict.id"
:label="dict.dikeName"
:value="dict.id"
></el-option>
</el-select> -->
</el-form-item>
<el-form-item label="负责人" prop="personName">
<el-input v-model="form.personName" placeholder="请输入负责人" />
</el-form-item>
<el-form-item label="类型" prop="type">
<el-select
v-model="form.type"
placeholder="请选择类型"
style="width: 100%"
>
<el-option
v-for="dict in typeOptions"
:key="dict.dictValue"
:label="dict.dictLabel"
:value="dict.dictValue"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="开展时间" prop="implementationTime">
<el-date-picker
clearable
size="small"
style="width: 100%"
v-model="form.implementationTime"
type="date"
value-format="yyyy-MM-dd"
placeholder="选择开展时间"
>
</el-date-picker>
</el-form-item>
<el-form-item label="预案内容" prop="planContent">
<el-input v-model="form.planContent" placeholder="请输入预案内容" />
</el-form-item>
<el-form-item label="培训内容" prop="remark">
<el-input v-model="form.remark"
type="textarea"
placeholder="请输入培训内容" />
</el-form-item>
<el-form-item label="附件" prop="photo">
<!-- <el-input
v-model="form.photo"
type="textarea"
placeholder="请输入内容"
/> -->
<el-upload
class="upload-demo"
:action="uploadUrl"
:headers="headers"
:on-preview="handlePreview"
:on-remove="(file) => handleRemove(file, 'fileList')"
:before-remove="beforeRemove"
multiple
:on-exceed="handleExceed"
:on-success="(_, fileList) => submitUpload(fileList, 'fileList')"
:file-list="fileList"
>
<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>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import {
listYaxx,
getYaxx,
delYaxx,
addYaxx,
updateYaxx,
exportYaxx,
} from "@/api/yg/dike/yaxx";
import { listJbxx, getJbxx } from "@/api/yg/dike/jbxx";
import { getToken } from "@/utils/auth";
import { getFileStream } from "@/api/system/upload";
import linkDike from "@/components/linkNameSelect/linkDike.vue";
export default {
name: "Yaxx",
components: {
linkDike,
},
data() {
return {
//
routeList: [
{
path: "/dike/safetyManage/floodControlManagement/preplan",
routeName: "防汛预案管理",
},
],
uploadUrl: process.env.VUE_APP_BASE_API + "/common/upload",
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
yaxxList: [],
//
title: "",
//
open: false,
//
typeOptions: [],
//
dikeNameOptions: [],
//
queryParams: {
pageNum: 1,
pageSize: 10,
ids: null,
data: {
dikeCode: null,
dikeCode: null,
dikeName: null,
dikeType: null,
engineerScale: null,
personName: null,
type: null,
implementationTime: null,
planContent: null,
photo: null,
createUid: null,
updateUid: null,
owerDept: null,
relation: null,
},
cv: {
type: "like",
name: "dikeName",
value: null,
},
//
params: {
//
orderBy: "create_time",
// descasc
sortBy: "desc",
},
},
//
form: {},
//
rules: {},
//
headers: {
shuili: "water " + getToken(),
},
fileList: [],
};
},
created() {
this.getList();
listJbxx({ data: {} }).then((res) => {
// console.log(111, res);
this.dikeNameOptions = res.records;
});
this.getDicts("prePlan_type").then((response) => {
this.typeOptions = response.data;
});
},
methods: {
dikeCodeFormat(row) {
const id = row.dikeCode;
let data = this.dikeNameOptions.find((res) => res.id == id);
if (data) return data.dikeName;
},
//
typeFormat(row, column) {
return this.selectDictLabel(this.typeOptions, row.type);
},
/** 查询堤防预案列表 */
getList() {
this.loading = true;
listYaxx(this.queryParams).then((response) => {
this.yaxxList = response.records;
this.total = response.total;
this.loading = false;
});
},
//
cancel() {
this.open = false;
this.reset();
},
//
reset() {
this.fileList = [];
this.form = {
id: null,
dikeCode: null,
dikeCode: null,
dikeName: null,
dikeType: null,
engineerScale: null,
personName: null,
type: null,
implementationTime: null,
planContent: null,
photo: 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,
dikeCode: null,
dikeCode: null,
dikeName: null,
dikeType: null,
engineerScale: null,
personName: null,
type: null,
implementationTime: null,
planContent: null,
photo: null,
createUid: null,
updateUid: null,
createTime: null,
updateTime: null,
owerDept: null,
remark: null,
relation: null,
},
cv: {
type: "like",
name: "dikeName",
value: null,
},
params: {
//
orderBy: "create_time",
// descasc
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;
getYaxx(id).then((response) => {
this.form = response.data;
if (this.form.photo) {
this.fileList = JSON.parse(this.form.photo);
console.log(11111, this.fileList);
}
this.open = true;
this.title = "修改堤防预案";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate((valid) => {
if (valid) {
this.form.photo = JSON.stringify(this.fileList);
if (this.form.id != null) {
updateYaxx(this.form).then((response) => {
if (response.code === 200) {
this.msgSuccess("修改成功");
this.open = false;
this.getList();
}
});
} else {
addYaxx(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 delYaxx(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); //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>
<style lang="scss" scoped>
@import "@/assets/css/dialog.scss";
</style>

658
src/views/res/safetyManage/floodControlManagement/supplies.vue

@ -0,0 +1,658 @@
<template>
<div>
<el-breadcrumb separator="/" style="margin-bottom: 20px">
<el-breadcrumb-item
v-for="(item, index) in routeList"
:key="item + index"
:to="{ path: item.path }"
>
{{ item.routeName }}
</el-breadcrumb-item>
</el-breadcrumb>
<el-form
:model="queryParams"
ref="queryForm"
:inline="true"
v-show="showSearch"
label-width="68px"
>
<el-form-item label="关联堤防" prop="dikeName">
<el-input
v-model="queryParams.cv.value"
placeholder="请输入堤防名称"
clearable
size="small"
@keyup.enter.native="handleQuery"
>
<el-button
type="primary"
slot="append"
icon="el-icon-search"
size="small"
@click="handleQuery"
></el-button>
</el-input>
</el-form-item>
<!-- <el-form-item label="关联堤防" prop="dikeCode">
<el-select
v-model="queryParams.data.dikeCode"
placeholder="请选择关联堤防"
style="width: 100%"
@change="handleQuery"
>
<el-option
v-for="dict in dikeNameOptions"
:key="dict.id"
:label="dict.dikeName"
:value="dict.dikeCode"
></el-option>
</el-select>
</el-form-item> -->
<el-form-item label="物资名称" prop="materialName">
<el-input
v-model="queryParams.data.materialName"
placeholder="请输入物资名称"
clearable
size="small"
@keyup.enter.native="handleQuery"
>
<el-button
type="primary"
slot="append"
icon="el-icon-search"
size="small"
@click="handleQuery"
></el-button>
</el-input>
</el-form-item>
<el-form-item label="负责人名称" prop="personName" label-width="84px">
<el-input
v-model="queryParams.data.personName"
placeholder="请输入负责人名称"
clearable
size="small"
@keyup.enter.native="handleQuery"
>
<el-button
type="primary"
slot="append"
icon="el-icon-search"
size="small"
@click="handleQuery"
></el-button>
</el-input>
</el-form-item>
<el-form-item>
<!-- <el-button
type="cyan"
icon="el-icon-search"
size="mini"
@click="handleQuery"
>搜索</el-button
> -->
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
>重置</el-button
>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
icon="el-icon-plus"
size="mini"
@click="handleAdd"
v-hasPermi="['df:fxwz:add']"
>新增</el-button
>
</el-col>
<el-col :span="1.5">
<el-button
type="success"
icon="el-icon-edit"
size="mini"
:disabled="single"
@click="handleUpdate"
v-hasPermi="['df:fxwz:edit']"
>修改</el-button
>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['df:fxwz:remove']"
>删除</el-button
>
</el-col>
<right-toolbar
:showSearch.sync="showSearch"
@queryTable="getList"
></right-toolbar>
</el-row>
<el-table
v-loading="loading"
:data="fxwzList"
@selection-change="handleSelectionChange"
>
<el-table-column type="selection" width="55" align="center" fixed />
<el-table-column
label="序号"
type="index"
width="50"
align="center"
fixed
/>
<el-table-column
label="关联堤防"
align="center"
prop="dikeName"
min-width="120"
/>
<!-- <el-table-column
label="关联堤防"
align="center"
prop="dikeCode"
:formatter="dikeCodeFormat"
min-width="120"
/> -->
<el-table-column
label="物资名称"
align="center"
prop="materialName"
min-width="120"
/>
<!-- <el-table-column
label="堤防名称"
align="center"
prop="dikeName"
min-width="120"
/> -->
<el-table-column
label="负责人名称"
align="center"
prop="personName"
min-width="120"
/>
<el-table-column
label="负责人电话"
align="center"
prop="personPhone"
min-width="120"
/>
<el-table-column
label="负责人职务"
align="center"
prop="personLevel"
min-width="120"
/>
<el-table-column
label="物资数量"
align="center"
sortable
prop="materialNumber"
min-width="120"
/>
<el-table-column
label="采购时间"
align="center"
sortable
prop="procurementTime"
min-width="120"
>
<template slot-scope="scope">
<span>{{ parseTime(scope.row.procurementTime, "{y}-{m}-{d}") }}</span>
</template>
</el-table-column>
<el-table-column
label="物资种类"
align="center"
prop="materialType"
:formatter="materialTypeFormat"
min-width="120"
/>
<el-table-column
label="保质期"
align="center"
sortable
prop="shelfLife"
min-width="120"
/>
<el-table-column
label="操作"
align="center"
class-name="small-padding fixed-width"
width="180"
fixed="right"
>
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['df:fxwz:edit']"
>修改</el-button
>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['df:fxwz:remove']"
>删除</el-button
>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total > 0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 添加或修改堤防防汛物资对话框 -->
<el-dialog
:title="title"
:visible.sync="open"
width="1200px"
append-to-body
:close-on-click-modal="false"
>
<el-form ref="form" :model="form" :rules="rules" label-width="96px">
<el-form-item label="关联堤防" prop="dikeCode">
<linkDike :form="form" v-if="open" />
<!-- <el-select
v-model="form.dikeCode"
placeholder="请选择关联堤防"
style="width: 100%"
>
<el-option
v-for="dict in dikeNameOptions"
:key="dict.id"
:label="dict.dikeName"
:value="dict.dikeCode"
></el-option>
</el-select> -->
</el-form-item>
<el-form-item label="物资名称" prop="materialName">
<el-input v-model="form.materialName" placeholder="请输入物资名称" />
</el-form-item>
<!-- <el-form-item label="堤防名称" prop="dikeName">
<el-input v-model="form.dikeName" placeholder="请输入堤防名称" />
</el-form-item> -->
<el-form-item label="负责人名称" prop="personName">
<el-input v-model="form.personName" placeholder="请输入负责人名称" />
</el-form-item>
<el-form-item label="负责人电话" prop="personPhone">
<el-input v-model="form.personPhone" placeholder="请输入负责人电话" />
</el-form-item>
<el-form-item label="负责人职务" prop="personLevel">
<el-input v-model="form.personLevel" placeholder="请输入负责人职务" />
</el-form-item>
<el-form-item label="物资数量" prop="materialNumber">
<el-input
v-model="form.materialNumber"
placeholder="请输入物资数量"
/>
</el-form-item>
<el-form-item label="采购时间" prop="procurementTime">
<el-date-picker
clearable
size="small"
style="width: 100%"
v-model="form.procurementTime"
type="date"
value-format="yyyy-MM-dd"
placeholder="选择采购时间"
>
</el-date-picker>
</el-form-item>
<el-form-item label="物资种类" prop="materialType">
<el-select
v-model="form.materialType"
placeholder="请选择物资种类"
style="width: 100%"
>
<el-option
v-for="dict in materialTypeOptions"
:key="dict.dictValue"
:label="dict.dictLabel"
:value="dict.dictValue"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="保质期" prop="shelfLife">
<el-input v-model="form.shelfLife" placeholder="请输入保质期" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import {
listFxwz,
getFxwz,
delFxwz,
addFxwz,
updateFxwz,
exportFxwz,
} from "@/api/yg/dike/fxwz";
import { listJbxx, getJbxx } from "@/api/yg/dike/jbxx";
import linkDike from "@/components/linkNameSelect/linkDike.vue";
export default {
name: "Fxwz",
components: {
linkDike,
},
data() {
return {
//
routeList: [
{
path: "/dike/safetyManage/floodControlManagement/supplies",
routeName: "防汛物资管理",
},
],
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
fxwzList: [],
//
title: "",
//
open: false,
//
materialTypeOptions: [],
//
dikeNameOptions: [],
//
queryParams: {
pageNum: 1,
pageSize: 10,
ids: null,
data: {
dikeCode: null,
materialName: null,
dikeName: null,
personName: null,
personPhone: null,
personLevel: null,
materialNumber: null,
procurementTime: null,
materialType: null,
createUid: null,
updateUid: null,
owerDept: null,
relation: null,
},
cv: {
type: "like",
name: "dikeName",
value: null,
},
//
params: {
//
orderBy: "create_time",
// descasc
sortBy: "desc",
},
},
//
form: {},
//
rules: {
dikeCode: [
{ required: true, message: "请选择关联堤防", trigger: "blur" },
],
materialName: [
{ required: true, message: "请输入物资名称", trigger: "blur" },
],
personName: [
{ required: true, message: "请输入负责人名称", trigger: "blur" },
],
personPhone: [
{
pattern:
/^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\d{8}$/,
message: "手机号格式不正确",
trigger: "blur",
},
],
materialNumber: [
{
pattern: /^[1-9]\d*$/,
message: "请输入正整数,不包含0",
trigger: "blur",
},
],
},
};
},
created() {
this.getList();
listJbxx({ data: {} }).then((res) => {
// console.log(111, res);
this.dikeNameOptions = res.records;
});
this.getDicts("types_materials").then((response) => {
this.materialTypeOptions = response.data;
});
},
methods: {
/** 查询堤防防汛物资列表 */
getList() {
this.loading = true;
listFxwz(this.queryParams).then((response) => {
this.fxwzList = response.records;
this.total = response.total;
this.loading = false;
});
},
dikeCodeFormat(row) {
const dikeCode = row.dikeCode;
let data = this.dikeNameOptions.find((res) => res.dikeCode == dikeCode);
if (data) return data.dikeName;
},
//
materialTypeFormat(row, column) {
return this.selectDictLabel(this.materialTypeOptions, row.materialType);
},
//
cancel() {
this.open = false;
this.reset();
},
//
reset() {
this.form = {
id: null,
dikeCode: null,
materialName: null,
dikeName: null,
personName: null,
personPhone: null,
personLevel: null,
materialNumber: null,
procurementTime: null,
materialType: 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,
dikeCode: null,
materialName: null,
dikeName: null,
personName: null,
personPhone: null,
personLevel: null,
materialNumber: null,
procurementTime: null,
materialType: null,
createUid: null,
updateUid: null,
createTime: null,
updateTime: null,
owerDept: null,
remark: null,
relation: null,
},
cv: {
type: "like",
name: "dikeName",
value: null,
},
params: {
//
orderBy: "create_time",
// descasc
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;
getFxwz(id).then((response) => {
this.form = response.data;
this.open = true;
this.title = "修改堤防防汛物资";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate((valid) => {
if (valid) {
if (this.form.id != null) {
updateFxwz(this.form).then((response) => {
if (response.code === 200) {
this.msgSuccess("修改成功");
this.open = false;
this.getList();
}
});
} else {
addFxwz(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 delFxwz(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 exportFxwz(queryParams);
})
.then((response) => {
this.downloadFile(response, true, response.msg);
// this.download(response.msg);
})
.catch(function () {});
},
},
};
</script>
<style lang="scss" scoped>
@import "@/assets/css/dialog.scss";
</style>

818
src/views/res/safetyManage/floodControlManagement/tissue.vue

@ -0,0 +1,818 @@
<template>
<div>
<el-breadcrumb separator="/" style="margin-bottom: 20px">
<el-breadcrumb-item
v-for="(item, index) in routeList"
:key="item + index"
:to="{ path: item.path }"
>
{{ item.routeName }}
</el-breadcrumb-item>
</el-breadcrumb>
<el-form
:model="queryParams"
ref="queryForm"
:inline="true"
v-show="showSearch"
label-width="68px"
>
<el-form-item label="组织名称" prop="organizationName">
<el-input
v-model="queryParams.data.organizationName"
placeholder="请输入组织名称"
clearable
size="small"
@keyup.enter.native="handleQuery"
>
<el-button
type="primary"
slot="append"
icon="el-icon-search"
size="small"
@click="handleQuery"
></el-button>
</el-input>
</el-form-item>
<el-form-item label="所属区划" prop="adcd">
<!-- <el-input
v-model="queryParams.data.adcd"
placeholder="请输入所属区划"
clearable
size="small"
@keyup.enter.native="handleQuery"
/> -->
<el-cascader
v-model="queryParams.data.adcd"
:props="areasOptionProps"
placeholder="请选择所属区划"
clearable
size="small"
style="width: 100%"
@change="handleQuery"
>
</el-cascader>
</el-form-item>
<!-- <el-form-item
label="负责人职务"
prop="chargePersonDuites"
label-width="84px"
>
<el-input
v-model="queryParams.data.chargePersonDuites"
placeholder="请输入负责人职务"
clearable
size="small"
@keyup.enter.native="handleQuery"
/>
</el-form-item> -->
<el-form-item>
<!-- <el-button
type="cyan"
icon="el-icon-search"
size="mini"
@click="handleQuery"
>搜索</el-button
> -->
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
>重置</el-button
>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
icon="el-icon-plus"
size="mini"
@click="handleAdd"
v-hasPermi="['df:fxzz:add']"
>新增</el-button
>
</el-col>
<el-col :span="1.5">
<el-button
type="success"
icon="el-icon-edit"
size="mini"
:disabled="single"
@click="handleUpdate"
v-hasPermi="['df:fxzz:edit']"
>修改</el-button
>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['df:fxzz:remove']"
>删除</el-button
>
</el-col>
<right-toolbar
:showSearch.sync="showSearch"
@queryTable="getList"
></right-toolbar>
</el-row>
<el-table
v-loading="loading"
:data="fxzzList"
@selection-change="handleSelectionChange"
>
<el-table-column type="selection" width="55" align="center" fixed />
<el-table-column
label="序号"
type="index"
width="50"
align="center"
fixed
/>
<el-table-column
label="堤防名称"
align="center"
prop="dikeName"
min-width="120"
/>
<!-- <el-table-column
label="堤防名称"
align="center"
prop="dikeCode"
:formatter="dikeCodeFormat"
min-width="120"
/> -->
<el-table-column
label="组织名称"
align="center"
prop="organizationName"
min-width="120"
/>
<el-table-column
label="所属区划"
align="center"
prop="adcd"
:formatter="$formatAdcd"
min-width="120"
/>
<el-table-column
label="负责人名称"
align="center"
prop="chargePersonName"
min-width="120"
/>
<el-table-column
label="负责人电话"
align="center"
prop="chargePersonPhone"
min-width="120"
/>
<el-table-column
label="负责人职务"
align="center"
prop="chargePersonDuites"
min-width="120"
/>
<el-table-column
label="负责人类型"
align="center"
prop="chargePersonType"
:formatter="typeFormat"
min-width="120"
/>
<!-- <el-table-column
label="成员"
align="center"
prop="member"
min-width="120"
/> -->
<el-table-column
label="操作"
align="center"
class-name="small-padding fixed-width"
width="180"
fixed="right"
>
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['df:fxzz:edit']"
>修改</el-button
>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['df:fxzz:remove']"
>删除</el-button
>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total > 0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 添加或修改防汛组织对话框 -->
<el-dialog
:title="title"
:visible.sync="open"
width="1200px"
append-to-body
:close-on-click-modal="false"
@close="close"
>
<div class="listTitle">
<span>防汛组织信息</span>
<!-- <span class="addBtn" @click="handleAdd('0')">
<i class="el-icon-plus"></i>
添加
</span> -->
</div>
<el-row :gutter="15">
<el-form ref="form" :model="form" :rules="rules" label-width="96px">
<el-form-item label="堤防名称" prop="dikeCode">
<linkDike :form="form" v-if="open" />
<!-- <el-select
v-model="form.dikeCode"
placeholder="请选择堤防名称"
style="width: 100%"
v-scroll="selectSearch"
filterable
clearable
remote
reserve-keyword
:remote-method="remoteMethod"
:loading="selectLoading"
>
<el-option
v-for="dict in dikeNameOptions"
:key="dict.id"
:label="dict.dikeName"
:value="dict.dikeCode"
@click.native="chooseDike(dict)"
></el-option>
</el-select> -->
</el-form-item>
<el-col :span="12">
<el-form-item label="组织名称" prop="organizationName">
<el-input
v-model="form.organizationName"
placeholder="请输入组织名称"
/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="所属区划" prop="adcd">
<!-- <el-input v-model="form.adcd" placeholder="请输入所属区划" /> -->
<el-cascader
:options="areasOptions"
v-model="form.adcd"
:props="areasOptionProps"
placeholder="请选择所属区划"
clearable
size="small"
style="width: 100%"
>
</el-cascader>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="负责人名称" prop="chargePersonName">
<el-input
v-model="form.chargePersonName"
placeholder="请输入负责人名称"
/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="负责人电话" prop="chargePersonPhone">
<el-input
v-model="form.chargePersonPhone"
placeholder="请输入负责人电话"
/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="负责人职务" prop="chargePersonDuites">
<el-input
v-model="form.chargePersonDuites"
placeholder="请输入负责人职务"
/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="负责人类型" prop="chargePersonType">
<el-select
v-model="form.chargePersonType"
placeholder="请选择负责人类型"
style="width: 100%"
>
<el-option
v-for="dict in typeOptions"
:key="dict.dictValue"
:label="dict.dictLabel"
:value="dict.dictValue"
></el-option>
</el-select>
</el-form-item>
</el-col>
</el-form>
</el-row>
<div class="listTitle">
<span>防汛组织成员</span>
<!-- <span class="addBtn" @click="handleAdd('0')">
<i class="el-icon-plus"></i>
添加
</span> -->
</div>
<div class="member" ref="member">
<template v-for="(item, index) in counter">
<msFxzzMember
:ref="'msFxzzMember' + index"
:key="item + index"
:index="index"
:isFirst="index == 0 ? isFirst : false"
:status="isEdit"
:editItem="item"
:addForm="addForm"
@delForm="delForm"
/>
</template>
</div>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import {
listFxzz,
getFxzz,
delFxzz,
addFxzz,
updateFxzz,
exportFxzz,
} from "@/api/yg/dike/fxzz";
import {
listFxzzcy,
getFxzzcy,
delFxzzcy,
addFxzzcy,
updateFxzzcy,
updataAllFxzzcy,
exportFxzzcy,
} from "@/api/yg/dike/fxzzcy";
import { listJbxx, getJbxx } from "@/api/yg/dike/jbxx";
import { getAreasData } from "@/api/areas/index";
import msFxzzMember from "./components/msFxzzMember.vue";
import linkDike from "@/components/linkNameSelect/linkDike.vue";
import { cascaderLazyLoad } from "@/utils/elUtils";
export default {
name: "Fxzz",
components: {
msFxzzMember,
linkDike,
},
data() {
return {
//
routeList: [
{
path: "/dike/safetyManage/floodControlManagement/tissue",
routeName: "防汛组织管理",
},
],
areasOptionProps: {
emitPath: false,
checkStrictly: true, //
expandTrigger: "hover",
lazy: true,
lazyLoad: cascaderLazyLoad,
},
areasOptions: [],
//
loading: true,
selectLoading: false,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
fxzzList: [],
//
title: "",
//
open: false,
//
typeOptions: [],
//
dikeNameOptions: [],
//
dikeNameQueryParams: {
pageNum: 1,
pageSize: 10,
ids: null,
data: {
dikeName: null,
},
//
params: {
//
orderBy: "create_time",
// descasc
sortBy: "desc",
},
},
//
queryParams: {
pageNum: 1,
pageSize: 10,
ids: null,
data: {
organizationName: null,
adcd: null,
chargePersonName: null,
chargePersonPhone: null,
chargePersonDuites: null,
chargePersonType: null,
member: null,
createUid: null,
updateUid: null,
proCode: null,
proNo: null,
owerDept: null,
relation: null,
},
//
params: {
//
orderBy: "create_time",
// descasc
sortBy: "desc",
},
},
//
form: {},
//
rules: {
dikeCode: [
{ required: true, message: "请选择堤防名称", trigger: "blur" },
],
organizationName: [
{ required: true, message: "请输入组织名称", trigger: "blur" },
],
chargePersonPhone: [
{
pattern:
/^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\d{8}$/,
message: "手机号格式不正确",
trigger: "blur",
},
],
},
counter: [{}],
delIdList: [],
isFirst: true,
isEdit: false,
};
},
created() {
this.getList();
listJbxx(this.dikeNameQueryParams).then((res) => {
// console.log(111, res);
this.dikeNameOptions = res.records;
});
this.getTreeData();
this.getDicts("person_dept").then((response) => {
this.typeOptions = response.data;
});
},
methods: {
remoteMethod(query) {
if (query !== "") {
this.selectLoading = true;
// console.log(444, query);
this.dikeNameQueryParams.data.dikeName = query;
listJbxx(this.dikeNameQueryParams).then((res) => {
this.dikeNameOptions = res.records;
this.selectLoading = false;
});
}
},
selectSearch() {
this.dikeNameQueryParams.pageNum += 1;
listJbxx(this.dikeNameQueryParams).then((res) => {
// console.log(111, res);
this.dikeNameOptions = [...this.dikeNameOptions, ...res.records];
// console.log(111, this.dikeNameOptions);
});
},
chooseDike(item) {
this.form.dikeName = item.dikeName;
},
addForm(index) {
// console.log(44444, this.$refs.noticePart.$refs["noticeForm0"]);
//
if (this.counter.length == 1) {
console.log(this.$refs, this.$refs.msFxzzMember0[0]);
this.counter[0] = this.$refs.msFxzzMember0[0].form;
}
//
this.counter.push({});
//
this.$nextTick(() => {
this.counter[this.counter.length - 1] =
this.$refs["msFxzzMember" + (index + 1)][0].form;
console.log(
66666,
this.counter,
this.$refs["msFxzzMember" + (index + 1)][0].form
);
});
},
getTreeData() {
getAreasData().then((items) => {
// console.log("getAreasData", items.data);
let res = [];
let getChildren = (res, pid) => {
for (const i of items.data) {
if (i.parentid === pid) {
const newItem = {
label: i.name,
value: i.id,
};
if (i.layer != 3) newItem.children = [];
res.push(newItem);
getChildren(newItem.children, newItem.value);
}
}
};
getChildren(res, items.data[0].parentid);
console.log(66666666666, res);
this.areasOptions = res;
// return res;
});
},
//
typeFormat(row, column) {
return this.selectDictLabel(this.typeOptions, row.chargePersonType);
},
dikeCodeFormat(row) {
const dikeCode = row.dikeCode;
// const name = await new Promise(function (resolve, reject) {
// getJbxx(id).then((res) => {
// // console.log(111, res);
// resolve(res.data.dikeName);
// });
// });
let data = this.dikeNameOptions.find((res) => res.dikeCode == dikeCode);
if (data) return data.dikeName;
},
/** 查询防汛组织列表 */
getList() {
this.loading = true;
// this.queryParams.data.dikeCode = this.$route.query.baseDataId;
listFxzz(this.queryParams).then((response) => {
this.fxzzList = response.records;
this.total = response.total;
this.loading = false;
});
},
//
cancel() {
this.open = false;
this.reset();
},
//
reset() {
this.delIdList = [];
this.counter = [{}];
this.form = {
id: null,
organizationName: null,
adcd: null,
chargePersonName: null,
chargePersonPhone: null,
chargePersonDuites: null,
chargePersonType: null,
member: null,
createUid: null,
updateUid: null,
createTime: null,
updateTime: null,
proCode: null,
proNo: null,
owerDept: null,
remark: null,
relation: null,
};
this.resetForm("form");
},
//
resetQueryForm() {
this.queryParams = {
pageNum: 1,
pageSize: 10,
data: {
id: null,
organizationName: null,
adcd: null,
chargePersonName: null,
chargePersonPhone: null,
chargePersonDuites: null,
chargePersonType: null,
member: null,
createUid: null,
updateUid: null,
createTime: null,
updateTime: null,
proCode: null,
proNo: null,
owerDept: null,
remark: null,
relation: null,
},
params: {
//
orderBy: "create_time",
// descasc
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.isEdit = false;
this.open = true;
this.title = "添加防汛组织";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
this.isEdit = true;
const id = row.id || this.ids;
const organizationId = row.id || this.ids[0];
console.log(444, id);
getFxzz(id).then((response) => {
this.form = response.data;
this.open = true;
this.title = "修改防汛组织";
});
listFxzzcy({ data: { organizationId: organizationId } }).then((res) => {
console.log(6666, res);
this.counter = res.records;
});
},
close() {
this.$refs.msFxzzMember0[0].validClear();
},
/** 提交按钮 */
submitForm() {
//
let isAllTrue = true;
this.counter.forEach((item, index) => {
this.$refs["msFxzzMember" + index][0].validateForm();
isAllTrue = isAllTrue && this.$refs["msFxzzMember" + index][0].valid;
});
console.log("全部表单是否通过校验", isAllTrue);
this.$refs["form"].validate((valid) => {
if (valid && isAllTrue) {
const C0 =
this.counter.length > 1
? this.counter
: this.$refs["msFxzzMember0"][0].form.name
? [this.$refs["msFxzzMember0"][0].form]
: [];
if (this.isEdit) {
updateFxzz(this.form).then((response) => {
if (response.code === 200) {
C0.forEach((item, index) => {
if (!item.organizationId) {
C0[index].organizationId = this.form.id;
}
});
updataAllFxzzcy(C0).then((res) => {
if (res.code === 200) {
this.msgSuccess("修改成功");
this.open = false;
this.getList();
}
});
}
});
if (this.delIdList.length > 0) delFxzzcy(this.delIdList);
} else {
this.form.cy = C0;
// this.form.dikeCode = this.$route.query.baseDataId;
addFxzz(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 delFxzz(ids);
})
.then(() => {
this.getList();
this.msgSuccess("删除成功");
})
.catch(function () {});
} else {
this.$message.warning("请选择要删除的数据!!");
}
},
//
delForm(itemId, index) {
console.log(111, itemId, index);
this.counter.splice(index, 1);
if (itemId) this.delIdList.push(itemId);
console.log(222, this.delIdList);
},
},
};
</script>
<style lang="scss" scoped>
@import "@/assets/css/dialog.scss";
.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;
}
}
.listTitle:nth-child(1) {
margin-top: 0;
}
</style>

13
src/views/res/safetyManage/index.vue

@ -0,0 +1,13 @@
<template>
<Layout>
<router-view />
</Layout>
</template>
<script>
import Layout from "@/layout";
export default {
components: { Layout },
};
</script>
Loading…
Cancel
Save