|
@@ -52,10 +52,25 @@
|
|
</el-form>
|
|
</el-form>
|
|
<el-row :gutter="10" class="mb8">
|
|
<el-row :gutter="10" class="mb8">
|
|
<el-col :span="1.5">
|
|
<el-col :span="1.5">
|
|
- <el-button type="primary" plain size="mini">上传检修方案</el-button>
|
|
|
|
- </el-col>
|
|
|
|
- <el-col :span="1.5">
|
|
|
|
- <el-button type="primary" plain size="mini">上传审批单</el-button>
|
|
|
|
|
|
+ <el-button
|
|
|
|
+ type="warning"
|
|
|
|
+ plain
|
|
|
|
+ icon="el-icon-upload"
|
|
|
|
+ size="mini"
|
|
|
|
+ :disabled="maintenancePalan"
|
|
|
|
+ @click="uploadMaintenanceFile()"
|
|
|
|
+ >上传检修方案</el-button
|
|
|
|
+ >
|
|
|
|
+
|
|
|
|
+ <el-button
|
|
|
|
+ type="danger"
|
|
|
|
+ plain
|
|
|
|
+ icon="el-icon-upload"
|
|
|
|
+ size="mini"
|
|
|
|
+ :disabled="maintenancePalan"
|
|
|
|
+ @click="uploadApproveFile"
|
|
|
|
+ >上传审批单</el-button
|
|
|
|
+ >
|
|
</el-col>
|
|
</el-col>
|
|
<right-toolbar
|
|
<right-toolbar
|
|
:showSearch.sync="showSearch"
|
|
:showSearch.sync="showSearch"
|
|
@@ -63,13 +78,27 @@
|
|
></right-toolbar>
|
|
></right-toolbar>
|
|
</el-row>
|
|
</el-row>
|
|
<div class="table">
|
|
<div class="table">
|
|
- <el-table v-loading="loading" :data="dataList">
|
|
|
|
|
|
+ <el-table
|
|
|
|
+ v-loading="loading"
|
|
|
|
+ :data="dataList"
|
|
|
|
+ @selection-change="handleSelectionChange"
|
|
|
|
+ :row-class-name="getRowClassName"
|
|
|
|
+ >
|
|
|
|
+ <el-table-column type="selection" width="55" align="center" />
|
|
<el-table-column
|
|
<el-table-column
|
|
label="月计划编号"
|
|
label="月计划编号"
|
|
align="center"
|
|
align="center"
|
|
prop="mplanNo"
|
|
prop="mplanNo"
|
|
:show-overflow-tooltip="true"
|
|
:show-overflow-tooltip="true"
|
|
- />
|
|
|
|
|
|
+ >
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
+ <a
|
|
|
|
+ @click="table_show(scope.row, scope.$index)"
|
|
|
|
+ style="color: #00afff; cursor: pointer"
|
|
|
|
+ >{{ scope.row.mplanNo }}</a
|
|
|
|
+ >
|
|
|
|
+ </template>
|
|
|
|
+ </el-table-column>
|
|
<el-table-column
|
|
<el-table-column
|
|
label="开始时间"
|
|
label="开始时间"
|
|
prop="startTm"
|
|
prop="startTm"
|
|
@@ -126,8 +155,18 @@
|
|
class-name="small-padding fixed-width"
|
|
class-name="small-padding fixed-width"
|
|
>
|
|
>
|
|
<template slot-scope="{ row }">
|
|
<template slot-scope="{ row }">
|
|
- <el-button size="mini" type="text">下载检修方案</el-button>
|
|
|
|
- <el-button size="mini" type="text">下载审核单</el-button>
|
|
|
|
|
|
+ <el-button
|
|
|
|
+ size="mini"
|
|
|
|
+ type="text"
|
|
|
|
+ @click="downloadFile(row.maintenanceFileName)"
|
|
|
|
+ >下载检修方案</el-button
|
|
|
|
+ >
|
|
|
|
+ <el-button
|
|
|
|
+ size="mini"
|
|
|
|
+ type="text"
|
|
|
|
+ @click="downloadFile(row.approveFileName)"
|
|
|
|
+ >下载审核单</el-button
|
|
|
|
+ >
|
|
<el-button
|
|
<el-button
|
|
size="mini"
|
|
size="mini"
|
|
type="text"
|
|
type="text"
|
|
@@ -146,22 +185,71 @@
|
|
@pagination="getList"
|
|
@pagination="getList"
|
|
/>
|
|
/>
|
|
</div>
|
|
</div>
|
|
|
|
+
|
|
|
|
+ <!-- 文件上传对话框 -->
|
|
|
|
+ <el-dialog
|
|
|
|
+ :title="fileShow"
|
|
|
|
+ :visible.sync="uploadVisible"
|
|
|
|
+ width="550px"
|
|
|
|
+ append-to-body
|
|
|
|
+ >
|
|
|
|
+ <el-form ref="uploadForm" :model="uploadForm" label-width="100px">
|
|
|
|
+ <el-form-item label="月计划编号" prop="mplanNo">
|
|
|
|
+ <el-input
|
|
|
|
+ v-model="uploadForm.mplanNo"
|
|
|
|
+ placeholder="请输入月计划编号"
|
|
|
|
+ readonly
|
|
|
|
+ />
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item :label="label">
|
|
|
|
+ <fileUpload
|
|
|
|
+ :fileSize="10"
|
|
|
|
+ :limit="1"
|
|
|
|
+ :process="process"
|
|
|
|
+ @success="handleSuccess"
|
|
|
|
+ />
|
|
|
|
+ </el-form-item>
|
|
|
|
+ </el-form>
|
|
|
|
+ <div slot="footer" class="dialog-footer">
|
|
|
|
+ <el-button type="primary" @click="submitForm">确 定</el-button>
|
|
|
|
+ <el-button @click="uploadVisible = false">取 消</el-button>
|
|
|
|
+ </div>
|
|
|
|
+ </el-dialog>
|
|
<Update ref="updateModelRef" @refresh="getList()"></Update>
|
|
<Update ref="updateModelRef" @refresh="getList()"></Update>
|
|
|
|
+ <recordDetails
|
|
|
|
+ v-if="dialog.detailsSave"
|
|
|
|
+ ref="detailsDialog"
|
|
|
|
+ @closed="dialog.detailsSave = false"
|
|
|
|
+ ></recordDetails>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script>
|
|
<script>
|
|
-import moment from "moment";
|
|
|
|
|
|
+import recordDetails from "./details";
|
|
import {
|
|
import {
|
|
maintenanceMonthList,
|
|
maintenanceMonthList,
|
|
- maintenanceMonthDetail,
|
|
|
|
maintenanceMonthUpdate,
|
|
maintenanceMonthUpdate,
|
|
} from "@/api/powerdistribution/maintenance";
|
|
} from "@/api/powerdistribution/maintenance";
|
|
import Update from "./Update.vue";
|
|
import Update from "./Update.vue";
|
|
|
|
+import fileUpload from "../process/components/fileUpload";
|
|
|
|
+import download from "../../../../plugins/download";
|
|
export default {
|
|
export default {
|
|
- components: { Update },
|
|
|
|
|
|
+ components: { Update, fileUpload, recordDetails },
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
|
|
+ // 选中数组
|
|
|
|
+ ids: [],
|
|
|
|
+ // 非单个禁用
|
|
|
|
+ single: true,
|
|
|
|
+ // 非多个禁用
|
|
|
|
+ multiple: true,
|
|
|
|
+ // 检修计划
|
|
|
|
+ maintenancePalan: true,
|
|
|
|
+ uploadForm: {},
|
|
|
|
+ process: {},
|
|
|
|
+ uploadVisible: false,
|
|
|
|
+ fileShow: "",
|
|
|
|
+ label: "",
|
|
dataList: [],
|
|
dataList: [],
|
|
childrenList: [],
|
|
childrenList: [],
|
|
// 显示搜索条件
|
|
// 显示搜索条件
|
|
@@ -181,6 +269,9 @@ export default {
|
|
},
|
|
},
|
|
monthPlanStateList: [],
|
|
monthPlanStateList: [],
|
|
monthPlanStateMap: {},
|
|
monthPlanStateMap: {},
|
|
|
|
+ dialog: {
|
|
|
|
+ detailsSave: false,
|
|
|
|
+ },
|
|
};
|
|
};
|
|
},
|
|
},
|
|
created() {
|
|
created() {
|
|
@@ -188,6 +279,33 @@ export default {
|
|
this.getList();
|
|
this.getList();
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
|
|
+ //查看
|
|
|
|
+ table_show(row) {
|
|
|
|
+ this.dialog.detailsSave = true;
|
|
|
|
+ this.$nextTick(() => {
|
|
|
|
+ this.$refs.detailsDialog.open().setData(row);
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+ getRowClassName({ row }) {
|
|
|
|
+ // 根据row的某些属性决定是否高亮
|
|
|
|
+ if (row.hourNum - row.perHourHouseholdsW != 0) {
|
|
|
|
+ return "highlight-row";
|
|
|
|
+ }
|
|
|
|
+ return "";
|
|
|
|
+ },
|
|
|
|
+ // 多选框选中数据
|
|
|
|
+ handleSelectionChange(selection) {
|
|
|
|
+ this.ids = selection.map((item) => item.id);
|
|
|
|
+ this.single = selection.length !== 1;
|
|
|
|
+ this.multiple = !selection.length;
|
|
|
|
+ if (selection.length == 1 && selection[0].hourNum > 150) {
|
|
|
|
+ this.maintenancePalan = false;
|
|
|
|
+ this.process = selection[0];
|
|
|
|
+ } else {
|
|
|
|
+ this.maintenancePalan = true;
|
|
|
|
+ this.process = null;
|
|
|
|
+ }
|
|
|
|
+ },
|
|
/** 修改按钮操作 */
|
|
/** 修改按钮操作 */
|
|
handleUpdate(row, title) {
|
|
handleUpdate(row, title) {
|
|
this.$refs.updateModelRef.openModel({ ...row }, title);
|
|
this.$refs.updateModelRef.openModel({ ...row }, title);
|
|
@@ -224,6 +342,54 @@ export default {
|
|
this.resetForm("queryForm");
|
|
this.resetForm("queryForm");
|
|
this.handleQuery();
|
|
this.handleQuery();
|
|
},
|
|
},
|
|
|
|
+ uploadMaintenanceFile() {
|
|
|
|
+ this.uploadForm.uploadType = 0;
|
|
|
|
+ Object.assign(this.uploadForm, this.process);
|
|
|
|
+ this.uploadVisible = true;
|
|
|
|
+ this.fileShow = "检修文件上传";
|
|
|
|
+ this.label = "检修文件";
|
|
|
|
+ },
|
|
|
|
+ uploadApproveFile() {
|
|
|
|
+ this.uploadForm.uploadType = 1;
|
|
|
|
+ Object.assign(this.uploadForm, this.process);
|
|
|
|
+ this.uploadVisible = true;
|
|
|
|
+ this.fileShow = "审批手续上传";
|
|
|
|
+ this.label = "审批手续";
|
|
|
|
+ },
|
|
|
|
+ async handleSuccess(data) {
|
|
|
|
+ console.log(data, "tda");
|
|
|
|
+
|
|
|
|
+ Object.assign(data, this.uploadForm);
|
|
|
|
+ if (this.uploadForm.uploadType == 0) {
|
|
|
|
+ this.uploadForm.maintenanceFilePath = data.fileUrl;
|
|
|
|
+ this.uploadForm.maintenanceFileName = data.originalFilename;
|
|
|
|
+ }
|
|
|
|
+ if (this.uploadForm.uploadType == 1) {
|
|
|
|
+ this.uploadForm.approveFilePath = data.fileUrl;
|
|
|
|
+ this.uploadForm.approveFileName = data.originalFilename;
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ /** 提交按钮 */
|
|
|
|
+ submitForm() {
|
|
|
|
+ this.$refs["uploadForm"].validate((valid) => {
|
|
|
|
+ if (valid) {
|
|
|
|
+ if (this.uploadForm.mplanNo != null) {
|
|
|
|
+ maintenanceMonthUpdate(this.uploadForm).then((response) => {
|
|
|
|
+ this.$modal.msgSuccess("修改成功");
|
|
|
|
+ this.uploadVisible = false;
|
|
|
|
+ this.getList();
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+ downloadFile(name) {
|
|
|
|
+ if (!name) {
|
|
|
|
+ this.$message.warning("请先上传文件");
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ download.name(name);
|
|
|
|
+ },
|
|
},
|
|
},
|
|
};
|
|
};
|
|
</script>
|
|
</script>
|