瀏覽代碼

计划流程

zhaoyun 6 月之前
父節點
當前提交
da823cb9e8

+ 44 - 0
src/api/powerdistribution/process.js

@@ -0,0 +1,44 @@
+import request from '@/utils/request'
+
+// 查询检修计划全流程管理列表
+export function listProcess(query) {
+  return request({
+    url: '/powerdistribution/process/list',
+    method: 'get',
+    params: query
+  })
+}
+
+// 查询检修计划全流程管理详细
+export function getProcess(id) {
+  return request({
+    url: '/powerdistribution/process/' + id,
+    method: 'get'
+  })
+}
+
+// 新增检修计划全流程管理
+export function addProcess(data) {
+  return request({
+    url: '/powerdistribution/process',
+    method: 'post',
+    data: data
+  })
+}
+
+// 修改检修计划全流程管理
+export function updateProcess(data) {
+  return request({
+    url: '/powerdistribution/process',
+    method: 'put',
+    data: data
+  })
+}
+
+// 删除检修计划全流程管理
+export function delProcess(id) {
+  return request({
+    url: '/powerdistribution/process/' + id,
+    method: 'delete'
+  })
+}

+ 138 - 0
src/views/distributionnetwork/maintenance/process/details.vue

@@ -0,0 +1,138 @@
+<template>
+	<el-drawer :title="`[`+form.planCode+`]检修计划全流程管理`" :visible.sync="visible" :size="650" destroy-on-close @closed="$emit('closed')">
+		<el-container v-loading="loading">
+			<el-main>
+				<el-form>
+					<el-row :gutter="24">
+						<el-col :lg="12">
+							<el-form-item label="月计划编号" prop="planCode">{{form.planCode}}
+							</el-form-item>
+						</el-col>
+						<el-col :lg="12">
+							<el-form-item label="停电设备数" prop="powerOutageDevices">{{form.powerOutageDevices}}
+							</el-form-item>
+						</el-col>
+					</el-row>
+					
+					</el-form-item>
+					<el-row :gutter="24">
+						<el-col :lg="12">
+							<el-form-item label="月计划时户数" prop="perHourHouseholdsM">
+							<template >
+									<el-tag type="danger" effect="dark" v-if="form.perHourHouseholdsM >form.perHourHouseholdsW">{{form.perHourHouseholdsM}}</el-tag>
+								    <el-tag type="success" effect="dark"  v-else>{{form.perHourHouseholdsM}}</el-tag>
+							</template>
+							</el-form-item>
+						</el-col>
+						<el-col :lg="12">
+							<el-form-item label="周计划时户数" prop="perHourHouseholdsW">
+							<template >
+								    <el-tag type="success" effect="dark" >{{form.perHourHouseholdsW}}</el-tag>
+							</template>
+							</el-form-item>
+						</el-col>
+					</el-row>
+					<el-row :gutter="24">
+						<el-col :lg="12">
+							<el-form-item label="市州单位" prop="city">{{form.city}}
+							</el-form-item>
+						</el-col>
+						<el-col :lg="12">
+							<el-form-item label="区县单位" prop="county">{{form.county}}
+							</el-form-item>
+						</el-col>
+					</el-row>
+					<el-row :gutter="24">
+						<el-col :lg="12">
+							<el-form-item label="供电服务站/所" prop="station">{{form.station}}
+							</el-form-item>
+						</el-col>
+						<el-col :lg="12">
+							<el-form-item label="申报单位" prop="declarAgency">{{form.declarAgency}}
+							</el-form-item>
+						</el-col>
+					</el-row>
+					<el-row :gutter="24">
+						<el-col :lg="12">
+							<el-form-item label="线路编号" prop="lineCode">{{form.lineCode}}
+							</el-form-item>
+						</el-col>
+						<el-col :lg="12">
+							<el-form-item label="线路名称" prop="lineName">{{form.lineName}}
+							</el-form-item>
+						</el-col>
+					</el-row>
+					<el-row :gutter="24">
+						<el-col :lg="12">
+							<el-form-item label="检修方案" prop="powerOutageStart">{{form.powerOutageStart}}
+							</el-form-item>
+						</el-col>
+						<el-col :lg="12">
+							<el-form-item label="审批单" prop="powerOutageEnd">{{form.powerOutageEnd}} 
+							</el-form-item>
+						</el-col>
+					</el-row>
+				</el-form>
+				<el-footer style="text-align: center;">
+					<el-button @click="visible=false">关闭</el-button>
+				</el-footer>
+			</el-main>
+		</el-container>
+	</el-drawer>
+</template>
+
+<script>
+export default {
+	emits: ['success', 'closed'],
+	components: {
+	},
+	data() {
+		return {
+			loading: false,
+			form: {
+				recordId: "",
+				sortNo: 0,
+				userName: "",
+				year: "",
+				month: "",
+				postSalary: 0,
+				levelSalary: 0,
+				foodSalary: 0,
+				otherPassSalary: 0,
+				transportSalary: 0,
+				postAllowance: 0,
+				sumAmount: 0,
+				pensoin: 0,
+				unemployment: 0,
+				medical: 0,
+				accumulationFund: 0,
+				tax: 0,
+				costOther: 0,
+				realCost: 0,
+				realSalary: 0,
+				msgType: "",
+				remark:""
+			},
+			visible: false,
+			isSaveing: false,
+		}
+	},
+	mounted() {
+
+	},
+	methods: {
+		//显示
+		open(){
+			this.visible = true;
+			return this;
+		},
+		//表单注入数据
+		setData(data){
+			this.form= data
+		}
+	}
+}
+</script>
+
+<style>
+</style>

+ 421 - 0
src/views/distributionnetwork/maintenance/process/index.vue

@@ -0,0 +1,421 @@
+<template>
+  <div class="app-container">
+    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
+      <el-form-item label="月计划编号" prop="planCode" label-width="120">
+        <el-input
+          v-model="queryParams.planCode"
+          placeholder="请输入月计划编号"
+          clearable
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+    
+      </el-form-item>
+    
+      </el-form-item>
+      <el-form-item label="区县单位" prop="county">
+        <el-input
+          v-model="queryParams.county"
+          placeholder="请输入区县单位"
+          clearable
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="供电所" prop="station">
+        <el-input
+          v-model="queryParams.station"
+          placeholder="请输入所属供电所"
+          clearable
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <!--el-form-item label="线路编号" prop="lineCode">
+        <el-input
+          v-model="queryParams.lineCode"
+          placeholder="请输入线路编号"
+          clearable
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item-->
+      <el-form-item label="线路名称" prop="lineName">
+        <el-input
+          v-model="queryParams.lineName"
+          placeholder="请输入线路名称"
+          clearable
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+
+     
+      
+      <el-form-item>
+        <el-button type="primary" 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="success"
+          plain
+          icon="el-icon-upload"
+          size="mini"
+          :disabled="single"
+          @click=""
+          v-hasPermi="['powerdistribution:process:edit']"
+        >人工上传</el-button>
+      </el-col>
+     
+      <el-col :span="1.5">
+        <el-button
+          type="warning"
+          plain
+          icon="el-icon-upload"
+          size="mini"
+		   :disabled="maintenancePalan"
+          @click=""
+          v-hasPermi="['powerdistribution:process:export']"
+        >上传检修方案</el-button>
+      </el-col>
+	  <el-col :span="1.5">
+	    <el-button
+	      type="danger"
+	      plain
+	      icon="el-icon-upload"
+	      size="mini"
+		   :disabled="maintenancePalan"
+	      @click=""
+	      v-hasPermi="['powerdistribution:process:export']"
+	    >上传审批单</el-button>
+	  </el-col>
+      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
+    </el-row>
+
+    <el-table v-loading="loading" :data="processList" @selection-change="handleSelectionChange"
+	    :row-class-name="getRowClassName"
+	>
+      <el-table-column type="selection" width="55" align="center" />
+      <el-table-column label="月计划编号" align="center" prop="planCode"  width="150">
+		  <template slot-scope="scope">
+				<a @click="table_show(scope.row, scope.$index)" style="color:blue;cursor:pointer">{{scope.row.planCode}}</a>
+		  </template>
+	  </el-table-column>
+      <el-table-column label="停电设备数" align="center" prop="powerOutageDevices" />
+      <el-table-column label="月计划时户数" align="center" prop="perHourHouseholdsM" />
+      <el-table-column label="周计划时户数" align="center" prop="perHourHouseholdsW" />
+      <el-table-column label="市州单位" align="center" prop="city" width="150" />
+      <el-table-column label="区县单位" align="center" prop="county" width="180"/>
+      <el-table-column label="供电服务站/所" align="center" prop="station" width="120" :show-overflow-tooltip="true"/>
+      <el-table-column label="线路编号" align="center" prop="lineCode"  width="120"/>
+      <el-table-column label="线路名称" align="center" prop="lineName" width="130" />
+	  <el-table-column label="人工计划时户数" align="center" prop="perHourHouseholdsArtif" />
+	  <el-table-column label="是否超目标" align="center">
+		  <template slot-scope="scope">
+		  		<el-tag type="warning" effect="dark"  v-if="scope.row.perHourHouseholdsArtif>scope.row.perHourHouseholdsM">超目标</el-tag>
+		  		<el-tag type="success" effect="dark"  v-else>正常</el-tag>
+		  </template>
+	  </el-table-column>
+      <el-table-column label="申报单位" align="center" prop="declarAgency"  width="150"/>
+      <el-table-column label="检修方案" align="center" prop="isMaintenance">
+		  <template slot-scope="scope">
+		  		<span v-if="scope.row.isMaintenance=='1'">待上传</span>
+		  		<span type="info" effect="dark"  v-if="scope.row.isMaintenance=='0'">不需要</span>
+				<span type="success" effect="dark"  v-if="scope.row.isMaintenance=='2'">已上传</span>
+		  </template>
+	  </el-table-column>
+      <el-table-column label="审批单" align="center" prop="isApprove">
+		  <template slot-scope="scope">
+		  		<span v-if="scope.row.isApprove=='1'">待上传</span>
+		  		<span type="info" effect="dark"  v-if="scope.row.isApprove=='0'">不需要</span>
+		  		<span type="success" effect="dark"  v-if="scope.row.isApprove=='2'">已上传</span>
+		  </template>
+	  </el-table-column>
+      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
+        <template slot-scope="scope">
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-edit"
+            @click="handleUpdate(scope.row)"
+            v-hasPermi="['powerdistribution:process:edit']"
+          >修改</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="650px" append-to-body>
+      <el-form ref="form" :model="form" :rules="rules" label-width="100px">
+        <el-form-item label="月计划编号" prop="planCode">
+          <el-input v-model="form.planCode" placeholder="请输入月计划编号"  readonly/>
+        </el-form-item>
+		<el-row :gutter="24">
+			<el-col :lg="12">
+				<el-form-item label="停电设备数" prop="powerOutageDevices">
+				  <el-input-number v-model="form.powerOutageDevices" placeholder="请输入月计划停电设备数" min="0"/>
+				</el-form-item>
+			</el-col>
+			<el-col :lg="12">
+        <el-form-item label="时户数" prop="perHourHouseholdsM">
+				<el-input-number v-model="form.perHourHouseholdsM" placeholder="请输入月计划时户数" min="0"/>
+        </el-form-item>
+		</el-col>
+		</el-row>
+        <el-row :gutter="24">
+			<el-col :lg="12">
+        <el-form-item label="所属市公司" prop="city">
+          <el-input v-model="form.city" placeholder="请输入所属市公司" readonly/>
+        </el-form-item>
+			</el-col>
+		<el-col :lg="12">
+        <el-form-item label="所属县公司" prop="county">
+          <el-input v-model="form.county" placeholder="请输入所属县公司" readonly/>
+        </el-form-item>
+			</el-col>
+		</el-row>
+		<el-row :gutter="24">
+			<el-col :lg="12">
+        <el-form-item label="所属供电所" prop="station">
+          <el-input v-model="form.station" placeholder="请输入所属供电所" readonly/>
+        </el-form-item>
+			</el-col>
+		<el-col :lg="12">
+		<el-form-item label="申报单位" prop="declarAgency">
+		  <el-input v-model="form.declarAgency" placeholder="请输入申报单位" readonly/>
+		</el-form-item>
+			</el-col>
+		</el-row>
+		<el-row :gutter="24">
+			<el-col :lg="12">
+        <el-form-item label="线路编号" prop="lineCode">
+          <el-input v-model="form.lineCode" placeholder="请输入线路编号" readonly/>
+        </el-form-item>
+			</el-col>
+		<el-col :lg="12">
+        <el-form-item label="线路名称" prop="lineName">
+          <el-input v-model="form.lineName" placeholder="请输入线路名称" readonly/>
+        </el-form-item>
+			</el-col>
+       	</el-row>
+      </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>
+	<recordDetails v-if="dialog.detailsSave" ref="detailsDialog" @closed="dialog.detailsSave=false"></recordDetails>
+  </div>
+</template>
+
+<script>
+import { listProcess, getProcess, delProcess, addProcess, updateProcess } from "@/api/powerdistribution/process";
+import recordDetails from './details'
+export default {
+  name: "Process",
+  components: {
+  	recordDetails
+  },
+  data() {
+    return {
+		dialog: {
+			detailsSave:false
+		},
+      // 遮罩层
+      loading: true,
+      // 选中数组
+      ids: [],
+      // 非单个禁用
+      single: true,
+      // 非多个禁用
+      multiple: true,
+	  
+	  // 检修计划
+	  maintenancePalan: true,
+      // 显示搜索条件
+      showSearch: true,
+      // 总条数
+      total: 0,
+      // 检修计划全流程管理表格数据
+      processList: [],
+      // 弹出层标题
+      title: "",
+      // 是否显示弹出层
+      open: false,
+      // 查询参数
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        planCode: null,
+        powerOutageDevices: null,
+        perHourHouseholdsM: null,
+        perHourHouseholdsW: null,
+        city: null,
+        county: null,
+        station: null,
+        lineCode: null,
+        lineName: null,
+        perHourHouseholdsArtif: null,
+        declarAgency: null,
+        isMaintenance: null,
+        isApprove: null,
+        maintenanceFilePath: null,
+        approveFilePath: null,
+      },
+      // 表单参数
+      form: {},
+      // 表单校验
+      rules: {
+      }
+    };
+  },
+  created() {
+    this.getList();
+  },
+  methods: {
+    /** 查询检修计划全流程管理列表 */
+    getList() {
+      this.loading = true;
+      listProcess(this.queryParams).then(response => {
+        this.processList = response.rows;
+        this.total = response.total;
+        this.loading = false;
+      });
+    },
+    // 取消按钮
+    cancel() {
+      this.open = false;
+      this.reset();
+    },
+    // 表单重置
+    reset() {
+      this.form = {
+        id: null,
+        planCode: null,
+        powerOutageDevices: null,
+        perHourHouseholdsM: null,
+        perHourHouseholdsW: null,
+        city: null,
+        county: null,
+        station: null,
+        lineCode: null,
+        lineName: null,
+        perHourHouseholdsArtif: null,
+        declarAgency: null,
+        isMaintenance: null,
+        isApprove: null,
+        maintenanceFilePath: null,
+        approveFilePath: null,
+        createBy: null,
+        createTime: null,
+        updateBy: null,
+        updateTime: null
+      };
+      this.resetForm("form");
+    },
+    /** 搜索按钮操作 */
+    handleQuery() {
+      this.queryParams.pageNum = 1;
+      this.getList();
+    },
+    /** 重置按钮操作 */
+    resetQuery() {
+      this.resetForm("queryForm");
+      this.handleQuery();
+    },
+    // 多选框选中数据
+    handleSelectionChange(selection) {
+      this.ids = selection.map(item => item.id)
+      this.single = selection.length!==1
+      this.multiple = !selection.length
+	  if(selection.length==1 && selection[0].isMaintenance>0){
+		   this.maintenancePalan=false;
+	  }else{
+		   this.maintenancePalan=true;
+	  }
+
+    },
+    /** 新增按钮操作 */
+    handleAdd() {
+      this.reset();
+      this.open = true;
+      this.title = "添加检修计划全流程管理";
+    },
+    /** 修改按钮操作 */
+    handleUpdate(row) {
+      this.reset();
+      const id = row.id || this.ids
+      getProcess(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) {
+            updateProcess(this.form).then(response => {
+              this.$modal.msgSuccess("修改成功");
+              this.open = false;
+              this.getList();
+            });
+          } else {
+            addProcess(this.form).then(response => {
+              this.$modal.msgSuccess("新增成功");
+              this.open = false;
+              this.getList();
+            });
+          }
+        }
+      });
+    },
+    /** 删除按钮操作 */
+    handleDelete(row) {
+      const ids = row.id || this.ids;
+      this.$modal.confirm('是否确认删除检修计划全流程管理编号为"' + ids + '"的数据项?').then(function() {
+        return delProcess(ids);
+      }).then(() => {
+        this.getList();
+        this.$modal.msgSuccess("删除成功");
+      }).catch(() => {});
+    },
+    /** 导出按钮操作 */
+    handleExport() {
+      this.download('powerdistribution/process/export', {
+        ...this.queryParams
+      }, `process_${new Date().getTime()}.xlsx`)
+    },
+	//查看
+	table_show(row){
+		this.dialog.detailsSave = true
+		this.$nextTick(() => {
+			this.$refs.detailsDialog.open().setData(row)
+		})
+	},
+	    getRowClassName({ row }) {
+	      // 根据row的某些属性决定是否高亮
+	      if (row.perHourHouseholdsM-row.perHourHouseholdsW!=0) {
+	        return 'highlight-row';
+	      }
+	      return '';
+	    }
+  }
+};
+</script>
+<style>
+/* 通过自定义类名添加高亮样式 */
+.highlight-row {
+  background-color: #ff0000; /* 浅绿色背景色 */
+  color: #ff0000; /* 绿色文字 */
+}
+</style>