|
|
<template>
|
|
|
<div class="app-container">
|
|
|
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="100px">
|
|
|
<el-form-item label="计划编码" prop="planCode">
|
|
|
<el-input
|
|
|
v-model="queryParams.planCode"
|
|
|
placeholder="请输入计划编码"
|
|
|
clearable
|
|
|
@keyup.enter.native="handleQuery"
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="计划名称" prop="planName">
|
|
|
<el-input
|
|
|
v-model="queryParams.planName"
|
|
|
placeholder="请输入计划名称"
|
|
|
clearable
|
|
|
@keyup.enter.native="handleQuery"
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="车间" prop="planWorkshop">
|
|
|
<el-select v-model="queryParams.planWorkshop" placeholder="请选择车间" clearable>
|
|
|
<el-option
|
|
|
v-for="work in workCenterList"
|
|
|
:key="work.factoryCode"
|
|
|
:label="work.factoryName"
|
|
|
:value="work.factoryCode"
|
|
|
/>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
<el-form-item v-if="false" label="产线" prop="planProdLine">
|
|
|
<el-input
|
|
|
v-model="queryParams.planProdLine"
|
|
|
placeholder="请输入产线"
|
|
|
clearable
|
|
|
@keyup.enter.native="handleQuery"
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
<el-form-item v-if="false" label="设备名称" prop="equipmentName">
|
|
|
<el-input
|
|
|
v-model="queryParams.equipmentName"
|
|
|
placeholder="请输入设备名称"
|
|
|
clearable
|
|
|
@keyup.enter.native="handleQuery"
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
<el-form-item v-if="false" label="设备编码" prop="equipmentCode">
|
|
|
<el-input
|
|
|
v-model="queryParams.equipmentCode"
|
|
|
placeholder="请输入设备编码"
|
|
|
clearable
|
|
|
@keyup.enter.native="handleQuery"
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
<el-form-item v-if="false" label="循环周期" prop="planLoop">
|
|
|
<el-input
|
|
|
v-model="queryParams.planLoop"
|
|
|
placeholder="请输入循环周期"
|
|
|
clearable
|
|
|
@keyup.enter.native="handleQuery"
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
<el-form-item v-if="false" label="循环周期类型" prop="planLoopType">
|
|
|
<el-select v-model="queryParams.planLoopType" placeholder="请选择循环周期类型" clearable>
|
|
|
<el-option
|
|
|
v-for="dict in dict.type.device_loop_type"
|
|
|
:key="dict.value"
|
|
|
:label="dict.label"
|
|
|
:value="dict.value"
|
|
|
/>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
<el-form-item v-if="false" label="循环执行时间开始" prop="planLoopStart">
|
|
|
<el-date-picker clearable
|
|
|
v-model="queryParams.planLoopStart"
|
|
|
type="date"
|
|
|
value-format="yyyy-MM-dd"
|
|
|
placeholder="请选择循环执行时间开始">
|
|
|
</el-date-picker>
|
|
|
</el-form-item>
|
|
|
<el-form-item v-if="false" label="循环执行时间结束" prop="planLoopEnd">
|
|
|
<el-date-picker clearable
|
|
|
v-model="queryParams.planLoopEnd"
|
|
|
type="date"
|
|
|
value-format="yyyy-MM-dd"
|
|
|
placeholder="请选择循环执行时间结束">
|
|
|
</el-date-picker>
|
|
|
</el-form-item>
|
|
|
<el-form-item v-if="false" label="保养人员" prop="planPerson">
|
|
|
<el-input
|
|
|
v-model="queryParams.planPerson"
|
|
|
placeholder="请输入保养人员"
|
|
|
clearable
|
|
|
@keyup.enter.native="handleQuery"
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="计划状态" prop="planStatus">
|
|
|
<el-select v-model="queryParams.planStatus" placeholder="请选择计划状态" clearable>
|
|
|
<el-option
|
|
|
v-for="dict in dict.type.sys_normal_disable"
|
|
|
:key="dict.value"
|
|
|
:label="dict.label"
|
|
|
:value="dict.value"
|
|
|
/>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="保养类型" prop="planStatus">
|
|
|
<el-select v-model="queryParams.upkeep" placeholder="请选择计划状态" clearable>
|
|
|
<el-option
|
|
|
v-for="dict in dict.type.device_upkeep_type"
|
|
|
:key="dict.value"
|
|
|
:label="dict.label"
|
|
|
:value="dict.value"
|
|
|
/>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
<el-form-item v-if="false" label="是否可生产-限制" prop="planRestrict">
|
|
|
<el-input
|
|
|
v-model="queryParams.planRestrict"
|
|
|
placeholder="请输入是否可生产-限制"
|
|
|
clearable
|
|
|
@keyup.enter.native="handleQuery"
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
<el-form-item v-if="false" label="是否委外" prop="planOutsource">
|
|
|
<el-input
|
|
|
v-model="queryParams.planOutsource"
|
|
|
placeholder="请输入是否委外"
|
|
|
clearable
|
|
|
@keyup.enter.native="handleQuery"
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
<el-form-item v-if="false" label="委外工单编码" prop="workCode">
|
|
|
<el-input
|
|
|
v-model="queryParams.workCode"
|
|
|
placeholder="请输入委外工单编码"
|
|
|
clearable
|
|
|
@keyup.enter.native="handleQuery"
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
<el-form-item v-if="false" label="工厂" prop="factoryCode">
|
|
|
<el-input
|
|
|
v-model="queryParams.factoryCode"
|
|
|
placeholder="请输入工厂"
|
|
|
clearable
|
|
|
@keyup.enter.native="handleQuery"
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
<el-form-item v-if="false" label="备用字段1" prop="attr1">
|
|
|
<el-input
|
|
|
v-model="queryParams.attr1"
|
|
|
placeholder="请输入备用字段1"
|
|
|
clearable
|
|
|
@keyup.enter.native="handleQuery"
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
<el-form-item v-if="false" label="备用字段2" prop="attr2">
|
|
|
<el-input
|
|
|
v-model="queryParams.attr2"
|
|
|
placeholder="请输入备用字段2"
|
|
|
clearable
|
|
|
@keyup.enter.native="handleQuery"
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
<el-form-item v-if="false" label="备用字段3" prop="attr3">
|
|
|
<el-input
|
|
|
v-model="queryParams.attr3"
|
|
|
placeholder="请输入备用字段3"
|
|
|
clearable
|
|
|
@keyup.enter.native="handleQuery"
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
<el-form-item v-if="false" label="删除标志" prop="delFlag">
|
|
|
<el-input
|
|
|
v-model="queryParams.delFlag"
|
|
|
placeholder="请输入删除标志"
|
|
|
clearable
|
|
|
@keyup.enter.native="handleQuery"
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
<el-form-item v-if="false" label="创建人" prop="createBy">
|
|
|
<el-input
|
|
|
v-model="queryParams.createBy"
|
|
|
placeholder="请输入创建人"
|
|
|
clearable
|
|
|
@keyup.enter.native="handleQuery"
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
<el-form-item v-if="false" label="创建时间" prop="createTime">
|
|
|
<el-date-picker
|
|
|
v-model="queryParams.createTimeArray"
|
|
|
type="daterange"
|
|
|
align="right"
|
|
|
unlink-panels
|
|
|
range-separator="至"
|
|
|
start-placeholder="开始日期"
|
|
|
end-placeholder="结束日期"
|
|
|
value-format="yyyy-MM-dd"
|
|
|
:picker-options="pickerOptions">
|
|
|
</el-date-picker>
|
|
|
</el-form-item>
|
|
|
<el-form-item v-if="false" label="更新人" prop="updateBy">
|
|
|
<el-input
|
|
|
v-model="queryParams.updateBy"
|
|
|
placeholder="请输入更新人"
|
|
|
clearable
|
|
|
@keyup.enter.native="handleQuery"
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
<el-form-item v-if="false" label="更新时间" prop="updateTime">
|
|
|
<el-date-picker
|
|
|
v-model="queryParams.updateTimeArray"
|
|
|
type="daterange"
|
|
|
align="right"
|
|
|
unlink-panels
|
|
|
range-separator="至"
|
|
|
start-placeholder="开始日期"
|
|
|
end-placeholder="结束日期"
|
|
|
value-format="yyyy-MM-dd"
|
|
|
:picker-options="pickerOptions">
|
|
|
</el-date-picker>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="循环范围开始" prop="planLoopStart">
|
|
|
<el-date-picker
|
|
|
v-model="queryParams.loopStartArray"
|
|
|
type="daterange"
|
|
|
align="right"
|
|
|
unlink-panels
|
|
|
range-separator="至"
|
|
|
start-placeholder="开始日期"
|
|
|
end-placeholder="结束日期"
|
|
|
value-format="yyyy-MM-dd"
|
|
|
:picker-options="pickerOptions">
|
|
|
</el-date-picker>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="循环范围结束" prop="planLoopEnd">
|
|
|
<el-date-picker
|
|
|
v-model="queryParams.loopEndArray"
|
|
|
type="daterange"
|
|
|
align="right"
|
|
|
unlink-panels
|
|
|
range-separator="至"
|
|
|
start-placeholder="开始日期"
|
|
|
end-placeholder="结束日期"
|
|
|
value-format="yyyy-MM-dd"
|
|
|
:picker-options="pickerOptions">
|
|
|
</el-date-picker>
|
|
|
</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="primary"
|
|
|
plain
|
|
|
icon="el-icon-plus"
|
|
|
size="mini"
|
|
|
@click="handleAdd"
|
|
|
v-hasPermi="['device:upkeepPlan:add']"
|
|
|
>添加计划
|
|
|
</el-button>
|
|
|
</el-col>
|
|
|
<el-col v-if="false" :span="1.5">
|
|
|
<el-button
|
|
|
type="success"
|
|
|
plain
|
|
|
icon="el-icon-edit"
|
|
|
size="mini"
|
|
|
@click="handleUpdate"
|
|
|
v-hasPermi="['device:upkeepPlan:add']"
|
|
|
>委外计划
|
|
|
</el-button>
|
|
|
</el-col>
|
|
|
<el-col :span="1.5">
|
|
|
<el-button
|
|
|
type="danger"
|
|
|
plain
|
|
|
icon="el-icon-delete"
|
|
|
size="mini"
|
|
|
:disabled="multiple"
|
|
|
@click="handleDelete"
|
|
|
v-hasPermi="['device:upkeepPlan:remove']"
|
|
|
>删除
|
|
|
</el-button>
|
|
|
</el-col>
|
|
|
<el-col :span="1.5">
|
|
|
<el-button
|
|
|
type="warning"
|
|
|
plain
|
|
|
icon="el-icon-download"
|
|
|
size="mini"
|
|
|
@click="handleExport"
|
|
|
v-hasPermi="['device:upkeepPlan:export']"
|
|
|
>导出
|
|
|
</el-button>
|
|
|
</el-col>
|
|
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
|
|
</el-row>
|
|
|
|
|
|
<el-table v-loading="loading" :data="upkeepPlanList" @selection-change="handleSelectionChange">
|
|
|
<el-table-column type="selection" width="55" align="center"/>
|
|
|
<el-table-column width="60" align="center" label="序号" type="index" fixed></el-table-column>
|
|
|
<el-table-column v-if="false" label="主键" align="center" prop="planId"/>
|
|
|
<el-table-column width="150" label="计划编码" align="center" prop="planCode" fixed/>
|
|
|
<el-table-column width="150" label="计划名称" align="center" prop="planName"/>
|
|
|
<el-table-column width="150" label="生成规则" align="center" prop="calculationRule">
|
|
|
<template slot-scope="scope">
|
|
|
{{ scope.row.calculationRule == "0" ? "按照固定周期" : scope.row.one == "1" ? "按照上次保养时间" : "单次" }}
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column label="车间编码" align="center" prop="planWorkshop"/>
|
|
|
<el-table-column width="150" label="车间" align="center" prop="workCenterName"/>
|
|
|
<el-table-column v-if="false" label="产线" align="center" prop="planProdLine"/>
|
|
|
<el-table-column v-if="false" label="设备名称" align="center" prop="equipmentName"/>
|
|
|
<el-table-column v-if="false" label="设备编码" align="center" prop="equipmentCode"/>
|
|
|
<el-table-column label="循环周期" align="center" prop="planLoop"/>
|
|
|
<el-table-column width="150" label="循环周期类型" align="center" prop="planLoopType">
|
|
|
<template slot-scope="scope">
|
|
|
<dict-tag :options="dict.type.device_loop_type" :value="scope.row.planLoopType"/>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column label="循环范围开始" align="center" prop="planLoopStart" width="180">
|
|
|
<template slot-scope="scope">
|
|
|
<span>{{ parseTime(scope.row.planLoopStart, '{y}-{m}-{d}') }}</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column label="循环范围结束" align="center" prop="planLoopEnd" width="180">
|
|
|
<template slot-scope="scope">
|
|
|
<span>{{ parseTime(scope.row.planLoopEnd, '{y}-{m}-{d}') }}</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column v-if="false" label="保养人员" align="center" prop="planPerson"/>
|
|
|
<el-table-column label="计划状态" align="center" prop="planStatus">
|
|
|
<template slot-scope="scope">
|
|
|
<dict-tag :options="dict.type.sys_normal_disable" :value="scope.row.planStatus"/>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column v-if="false" label="是否可生产-限制" align="center" prop="planRestrict"/>
|
|
|
<el-table-column v-if="false" label="维护类型" align="center" prop="planType"/>
|
|
|
<el-table-column label="保养类型" align="center" prop="upkeep">
|
|
|
<template slot-scope="scope">
|
|
|
<dict-tag :options="dict.type.device_upkeep_type" :value="scope.row.upkeep"/>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column label="委外人员" align="center" prop="workPerson"/>
|
|
|
<el-table-column label="委外单位" align="center" prop="workOutsourcingUnit"/>
|
|
|
<el-table-column label="联系方式" align="center" prop="workConnection"/>
|
|
|
<el-table-column label="原因" align="center" prop="workReason"/>
|
|
|
<el-table-column v-if="false" label="委外工单编码" align="center" prop="workCode"/>
|
|
|
<el-table-column v-if="false" label="工厂" align="center" prop="factoryCode"/>
|
|
|
<el-table-column v-if="false" label="备用字段1" align="center" prop="attr1"/>
|
|
|
<el-table-column v-if="false" label="备用字段2" align="center" prop="attr2"/>
|
|
|
<el-table-column v-if="false" label="备用字段3" align="center" prop="attr3"/>
|
|
|
<el-table-column v-if="false" label="删除标志" align="center" prop="delFlag"/>
|
|
|
<el-table-column label="创建人" align="center" prop="createBy"/>
|
|
|
<el-table-column label="创建时间" align="center" prop="createTime" width="180">
|
|
|
<template slot-scope="scope">
|
|
|
<span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d}') }}</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column label="更新人" align="center" prop="updateBy"/>
|
|
|
<el-table-column label="更新时间" align="center" prop="updateTime" width="180">
|
|
|
<template slot-scope="scope">
|
|
|
<span>{{ parseTime(scope.row.updateTime, '{y}-{m}-{d}') }}</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column width="180" label="操作" align="center" class-name="small-padding fixed-width" fixed="right">
|
|
|
<template slot-scope="scope">
|
|
|
<el-button
|
|
|
size="mini"
|
|
|
type="text"
|
|
|
icon="el-icon-edit"
|
|
|
@click="handleUpdate(scope.row)"
|
|
|
v-hasPermi="['device:upkeepPlan:edit']"
|
|
|
>修改
|
|
|
</el-button>
|
|
|
<el-button
|
|
|
size="mini"
|
|
|
type="text"
|
|
|
icon="el-icon-delete"
|
|
|
@click="handleDelete(scope.row)"
|
|
|
v-hasPermi="['device:upkeepPlan: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 v-loading="planLoading" :title="title" :visible.sync="open" width="900px" append-to-body>
|
|
|
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
|
|
<div class="my-step-mar">
|
|
|
<el-steps :active="upkeepSteps" finish-status="success" align-center>
|
|
|
<el-step title="保养计划基本信息"></el-step>
|
|
|
<el-step title="选择设备、保养项"></el-step>
|
|
|
<el-step title="人员" v-if="this.form.upkeep == '0'"></el-step>
|
|
|
<el-step title="委外信息" v-if="this.form.upkeep == '1'"></el-step>
|
|
|
</el-steps>
|
|
|
<!-- 保养计划基本信息 -->
|
|
|
<div class="my-step-body" v-if="this.upkeepSteps==0">
|
|
|
<el-row>
|
|
|
<el-col :offset="2" :span="8">
|
|
|
<el-form-item label="保养名称:">
|
|
|
<el-input v-model="form.planName" placeholder="请输入保养名称"/>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="8" :offset="1">
|
|
|
<el-form-item label="车间:">
|
|
|
<el-select v-model="form.planWorkshop" placeholder="请选择车间" clearable>
|
|
|
<el-option
|
|
|
v-for="item in workCenterList"
|
|
|
:key="item.factoryCode"
|
|
|
:label="item.factoryName"
|
|
|
:value="item.factoryCode">
|
|
|
</el-option>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
<el-row>
|
|
|
<el-col :offset="2" :span="20">
|
|
|
<el-form-item label-width="110px" label="保养生成规则:">
|
|
|
<el-radio v-model="form.calculationRule" label="0">按固定周期</el-radio>
|
|
|
<el-radio v-model="form.calculationRule" label="1">按上次保养时间</el-radio>
|
|
|
<el-radio v-model="form.calculationRule" label="2">单次</el-radio>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
<el-row>
|
|
|
<div v-if="form.calculationRule != '2' ">
|
|
|
<el-col :offset="2" :span="8">
|
|
|
<el-form-item label="循环周期:">
|
|
|
<el-input-number v-model="form.planLoop" label=""></el-input-number>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="2">
|
|
|
<el-select v-model="form.planLoopType" placeholder="周期">
|
|
|
<el-option
|
|
|
v-for="dict in dict.type.device_loop_type"
|
|
|
:key="dict.value"
|
|
|
:label="dict.label"
|
|
|
:value="dict.value"
|
|
|
/>
|
|
|
</el-select>
|
|
|
</el-col>
|
|
|
<el-col :offset="2" :span="22">
|
|
|
<el-form-item label-width="100px" label="保养时间范围">
|
|
|
<el-date-picker
|
|
|
@change="changeArray"
|
|
|
v-model="form.planTimeArray"
|
|
|
type="datetimerange"
|
|
|
range-separator="至"
|
|
|
start-placeholder="开始时间"
|
|
|
end-placeholder="结束时间">
|
|
|
</el-date-picker>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
</div>
|
|
|
<div v-else>
|
|
|
<el-col :offset="2" :span="8">
|
|
|
<el-form-item label-width="100px" label="保养开始时间">
|
|
|
<el-date-picker
|
|
|
v-model="form.planLoopStart"
|
|
|
type="date"
|
|
|
value-format="yyyy-MM-dd"
|
|
|
placeholder="选择日期">
|
|
|
</el-date-picker>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
</div>
|
|
|
</el-row>
|
|
|
<el-row>
|
|
|
<el-col :offset="2" :span="10">
|
|
|
<el-form-item label-width="110px" label="是否停机保养:">
|
|
|
<el-radio v-model="form.shutDown" label="1">停机保养</el-radio>
|
|
|
<el-radio v-model="form.shutDown" label="0">开机保养</el-radio>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="10">
|
|
|
<el-form-item label-width="110px" label="保养类型:">
|
|
|
<el-radio v-model="form.upkeep" label="0">内部</el-radio>
|
|
|
<el-radio v-model="form.upkeep" label="1">委外</el-radio>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
</div>
|
|
|
<!-- 选择设备、保养项 -->
|
|
|
<div class="my-step-body" v-if="this.upkeepSteps==1">
|
|
|
<el-row>
|
|
|
<el-col class="my-step-mar" :span="24">
|
|
|
<el-input
|
|
|
placeholder="请输入设备编码,按搜索按钮查询"
|
|
|
v-model="equipmentItemSearch"
|
|
|
class="input-with-select"
|
|
|
style="width: 400px"
|
|
|
>
|
|
|
<el-button
|
|
|
slot="append"
|
|
|
icon="el-icon-search"
|
|
|
@click="equipmentItemQuery"
|
|
|
></el-button>
|
|
|
</el-input>
|
|
|
<el-button
|
|
|
type="primary"
|
|
|
plain
|
|
|
size="mini"
|
|
|
@click="equipmentItemReset"
|
|
|
>重置</el-button>
|
|
|
<el-button
|
|
|
type="primary"
|
|
|
plain
|
|
|
size="mini"
|
|
|
@click="selectEquBtn">
|
|
|
选择设备
|
|
|
</el-button>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
<el-table
|
|
|
border
|
|
|
:data="form.equipmentItem"
|
|
|
stripe
|
|
|
style="width: 100%">
|
|
|
<el-table-column
|
|
|
prop="equipmentCode"
|
|
|
label="设备编码"
|
|
|
width="180">
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
|
prop="equipmentName"
|
|
|
label="设备名称"
|
|
|
width="180">
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
|
prop="itemTempName"
|
|
|
label="部位"
|
|
|
width="300">
|
|
|
<template slot-scope="scope">
|
|
|
<div v-html="scope.row.equPlanDetailList.filter(detail => detail.equPlanStandardList.filter(standard => standard.showFlag == false).length == 0).map(item => item.itemName).join(',')"></div>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
|
v-if="false"
|
|
|
prop="spareOnList"
|
|
|
label="备件"
|
|
|
width="300">
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
|
width="150"
|
|
|
fixed="right"
|
|
|
label="操作"
|
|
|
>
|
|
|
<template slot-scope="scope">
|
|
|
<el-button @click="editorTheItem(scope.row)" type="text" size="small">检查项</el-button>
|
|
|
<el-button @click="selectSpareBtn(scope.row)" type="text" size="small">备件</el-button>
|
|
|
<el-button @click="delTheEquItem(scope.row)" type="text" size="small">删除</el-button>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
|
<!-- 编辑检查项弹窗 -->
|
|
|
<el-dialog
|
|
|
title="编辑检查项"
|
|
|
:visible.sync="editorItem"
|
|
|
width="50%"
|
|
|
append-to-body
|
|
|
>
|
|
|
<!-- 编辑检查标准 -->
|
|
|
<el-table
|
|
|
border
|
|
|
:data="itemDetailList"
|
|
|
v-loading="detailLoading"
|
|
|
stripe
|
|
|
@selection-change="selectChangeEqu"
|
|
|
style="width: 100%">
|
|
|
<el-table-column
|
|
|
prop="itemName"
|
|
|
label="部位">
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
|
prop="itemMethod"
|
|
|
label="方法">
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
|
prop="itemTools"
|
|
|
label="工具">
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
|
width="200"
|
|
|
prop="standardName"
|
|
|
label="检查标准">
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
|
prop="standardTypeName"
|
|
|
label="标准类型">
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
|
fixed="right"
|
|
|
label="操作"
|
|
|
>
|
|
|
<template slot-scope="scope">
|
|
|
<el-button @click="delStandard(scope.row)" type="text" size="small">删除</el-button>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
|
<span slot="footer" class="dialog-footer">
|
|
|
<el-button type="primary" @click="standardBtn">确 定</el-button>
|
|
|
</span>
|
|
|
</el-dialog>
|
|
|
<!-- 选择设备弹窗 -->
|
|
|
<el-dialog
|
|
|
title="选择设备"
|
|
|
:visible.sync="selectEqu"
|
|
|
width="1100px"
|
|
|
append-to-body
|
|
|
>
|
|
|
<el-form :model="equipmentQuery" ref="queryBPForm" size="small" :inline="true" v-show="showSearch"
|
|
|
label-width="68px">
|
|
|
<el-form-item label="组线" prop="groupLine">
|
|
|
<el-select v-model="equipmentQuery.groupLine" placeholder="请选择组线">
|
|
|
<el-option
|
|
|
v-for="group in groupLineList"
|
|
|
:key="group.equipmentCode"
|
|
|
:label="group.equipmentName"
|
|
|
:value="group.equipmentCode"
|
|
|
/>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="设备编码">
|
|
|
<el-input
|
|
|
v-model="equipmentQuery.equipmentCode"
|
|
|
placeholder="请输入设备编码"
|
|
|
clearable
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="设备名称">
|
|
|
<el-input
|
|
|
v-model="equipmentQuery.equipmentName"
|
|
|
placeholder="请输入设备名称"
|
|
|
clearable
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
<el-form-item v-if="false" label="设备类型">
|
|
|
<el-input
|
|
|
v-model="equipmentQuery.equipmentName"
|
|
|
placeholder="请输入设备类型"
|
|
|
clearable
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
<el-form-item>
|
|
|
<el-button type="primary" icon="el-icon-search" size="mini" @click="getEquList">搜索</el-button>
|
|
|
<el-button icon="el-icon-refresh" size="mini" @click="resetEqu">重置</el-button>
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
<!-- 搜索-设备列表 -->
|
|
|
<el-table
|
|
|
:data="queryEquipment"
|
|
|
v-loading="equLoading"
|
|
|
stripe
|
|
|
@selection-change="selectChangeEqu"
|
|
|
style="width: 100%">
|
|
|
<el-table-column type="selection" width="55" align="center"/>
|
|
|
<el-table-column
|
|
|
prop="equipmentCode"
|
|
|
label="设备编码">
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
|
prop="equipmentName"
|
|
|
label="设备名称">
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
|
prop="equipmentTypeName"
|
|
|
label="设备类型">
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
|
prop="workshopName"
|
|
|
label="工作中心">
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
|
|
|
|
<pagination
|
|
|
v-show="equTotal>0"
|
|
|
:total="equTotal"
|
|
|
:page.sync="equipmentQuery.pageNum"
|
|
|
:limit.sync="equipmentQuery.pageSize"
|
|
|
@pagination="getEquList"
|
|
|
/>
|
|
|
|
|
|
<span slot="footer" class="dialog-footer">
|
|
|
<el-button @click="selectEqu = false">取 消</el-button>
|
|
|
<el-button type="primary" @click="confirmSelectEquBtn">确 定</el-button>
|
|
|
</span>
|
|
|
</el-dialog>
|
|
|
|
|
|
<!-- 选择备件弹窗 -->
|
|
|
<el-dialog
|
|
|
title="备件领用"
|
|
|
:visible.sync="spareDialog"
|
|
|
width="50%"
|
|
|
append-to-body
|
|
|
>
|
|
|
<!-- 备件申领 -->
|
|
|
<el-row>
|
|
|
<el-col class="my-step-mar" :span="1.5">
|
|
|
<el-button
|
|
|
type="primary"
|
|
|
plain
|
|
|
size="mini"
|
|
|
@click="choseSpareBtn">
|
|
|
选择备件
|
|
|
</el-button>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
<el-table
|
|
|
border
|
|
|
:data="chooseSpareList"
|
|
|
v-loading="spareLoading"
|
|
|
stripe
|
|
|
style="width: 100%">
|
|
|
<el-table-column
|
|
|
prop="materialCode"
|
|
|
label="备件号">
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
|
prop="materialDesc"
|
|
|
label="备件名称">
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
|
prop="spareType"
|
|
|
label="备件类型">
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
|
prop="applyNum"
|
|
|
label="领用数量">
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
|
fixed="right"
|
|
|
label="操作"
|
|
|
>
|
|
|
<template slot-scope="scope">
|
|
|
<el-button @click="delSpareList(scope.row)" type="text" size="small">删除</el-button>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
|
|
|
|
<!-- 选择备件 -->
|
|
|
<el-dialog
|
|
|
title="选择备件"
|
|
|
:visible.sync="selectSpareDialog"
|
|
|
width="60%"
|
|
|
append-to-body
|
|
|
>
|
|
|
<el-form :model="spareQuery" ref="queryBPForm" size="small" :inline="true" v-show="showSearch"
|
|
|
label-width="68px">
|
|
|
<el-form-item label="备件编码">
|
|
|
<el-input
|
|
|
v-model="spareQuery.materialCode"
|
|
|
placeholder="请输入备件编码"
|
|
|
clearable
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="备件名称">
|
|
|
<el-input
|
|
|
v-model="spareQuery.materialDesc"
|
|
|
placeholder="请输入备件名称"
|
|
|
clearable
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
<el-form-item v-if="false" label="备件类型">
|
|
|
<el-input
|
|
|
v-model="spareQuery.spareType"
|
|
|
placeholder="请输入备件类型"
|
|
|
clearable
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
<el-form-item>
|
|
|
<el-button type="primary" icon="el-icon-search" size="mini" @click="getSpareList">搜索</el-button>
|
|
|
<el-button icon="el-icon-refresh" size="mini" @click="resetSpare">重置</el-button>
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
<!-- 搜索-备件列表 -->
|
|
|
<el-table
|
|
|
:data="spareList"
|
|
|
v-loading="spareLoading"
|
|
|
stripe
|
|
|
@selection-change="selectChangeSpare"
|
|
|
style="width: 100%">
|
|
|
<el-table-column type="selection" width="55" align="center"/>
|
|
|
<el-table-column
|
|
|
prop="materialCode"
|
|
|
label="备件号">
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
|
prop="materialDesc"
|
|
|
label="备件名称">
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
|
prop="spareType"
|
|
|
label="备件类型">
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
|
prop="amount"
|
|
|
label="库存数量">
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
|
prop="storageAmount"
|
|
|
label="冻结数量">
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
|
prop="applyNum"
|
|
|
label="领用数量">
|
|
|
<template slot-scope="scope">
|
|
|
<el-input size="small" v-model="scope.row.applyNum" @change="handleEdit(scope.$index,scope.row)"></el-input>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
|
|
|
|
<pagination
|
|
|
v-show="spareTotal>0"
|
|
|
:total="spareTotal"
|
|
|
:page.sync="spareQuery.pageNum"
|
|
|
:limit.sync="spareQuery.pageSize"
|
|
|
@pagination="getSpareList"
|
|
|
/>
|
|
|
|
|
|
<span slot="footer" class="dialog-footer">
|
|
|
<el-button @click="selectSpareDialog = false">取 消</el-button>
|
|
|
<el-button type="primary" @click="confirmSelectSpareBtn">确 定</el-button>
|
|
|
</span>
|
|
|
</el-dialog>
|
|
|
|
|
|
</el-dialog>
|
|
|
|
|
|
</div>
|
|
|
<!-- 人员 -->
|
|
|
<div class="my-step-body" v-if="this.upkeepSteps==2 && this.form.upkeep == '0' ">
|
|
|
<el-row>
|
|
|
<el-col :span="24" :offset="1">
|
|
|
<el-transfer
|
|
|
:titles="['人员','已选择人员']"
|
|
|
filterable
|
|
|
:filter-method="filterMethod"
|
|
|
filter-placeholder="请输入人员名称"
|
|
|
v-model="selectPersonList"
|
|
|
:data="personList">
|
|
|
</el-transfer>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
</div>
|
|
|
<!-- 委外信息 -->
|
|
|
<div class="my-step-body" v-if="this.upkeepSteps==2 && this.form.upkeep == '1'">
|
|
|
<el-row>
|
|
|
<el-col :span="8">
|
|
|
<el-form-item label="委外单位:">
|
|
|
<el-input v-model="form.workOutsourcingUnit" placeholder="请输入委外单位"/>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="7" :offset="1">
|
|
|
<el-form-item label="委外人员:">
|
|
|
<el-input v-model="form.workPerson" placeholder="请输入委外人员"/>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="7" :offset="1">
|
|
|
<el-form-item label="联系方式:">
|
|
|
<el-input v-model="form.workConnection" placeholder="请输入联系方式"/>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
<el-row>
|
|
|
<el-col :span="24">
|
|
|
<el-form-item label="委外原因:">
|
|
|
<el-input
|
|
|
type="textarea"
|
|
|
autosize
|
|
|
placeholder="请输入委外原因"
|
|
|
v-model="form.workReason">
|
|
|
</el-input>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
</div>
|
|
|
</div>
|
|
|
</el-form>
|
|
|
<div slot="footer" class="dialog-footer">
|
|
|
<el-button style="margin-top: 12px;" v-if="this.upkeepSteps > 0" @click="stepLast">上一步</el-button>
|
|
|
<el-button style="margin-top: 12px;" v-if="this.upkeepSteps < 2" @click="stepNext">下一步</el-button>
|
|
|
<el-button type="primary" v-if="this.upkeepSteps == 2" @click="submitForm">提 交</el-button>
|
|
|
</div>
|
|
|
</el-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
import {
|
|
|
listUpkeepPlan,
|
|
|
getUpkeepPlan,
|
|
|
delUpkeepPlan,
|
|
|
addUpkeepPlan,
|
|
|
updateUpkeepPlan,
|
|
|
formatEquItem, setSpareList, querySpareList, formatEquItemNoCondition
|
|
|
} from "@/api/device/upkeepPlan";
|
|
|
import {
|
|
|
addPlan,
|
|
|
delPlan,
|
|
|
getEquList, getGroupLine,
|
|
|
getPersonList,
|
|
|
getWorkCenter,
|
|
|
initUpdatePlanInfo,
|
|
|
listPlan, updatePlan
|
|
|
} from "@/api/device/plan";
|
|
|
|
|
|
export default {
|
|
|
name: "UpkeepPlan",
|
|
|
dicts: ['device_loop_type', 'sys_normal_disable','device_upkeep_type'],
|
|
|
data() {
|
|
|
return {
|
|
|
equipmentItemSearch: '',//检查项搜索框值
|
|
|
equipmentItemList:[],
|
|
|
// 设备组线
|
|
|
groupLineList:[],
|
|
|
// 备件选择list
|
|
|
spareOnList:[],
|
|
|
// 备件选择
|
|
|
selectSpareDialog:false,
|
|
|
// 日期范围选择快捷
|
|
|
pickerOptions: {
|
|
|
shortcuts: [{
|
|
|
text: '最近一周',
|
|
|
onClick(picker) {
|
|
|
const end = new Date();
|
|
|
const start = new Date();
|
|
|
start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
|
|
|
picker.$emit('pick', [start, end]);
|
|
|
}
|
|
|
}, {
|
|
|
text: '最近一个月',
|
|
|
onClick(picker) {
|
|
|
const end = new Date();
|
|
|
const start = new Date();
|
|
|
start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
|
|
|
picker.$emit('pick', [start, end]);
|
|
|
}
|
|
|
}, {
|
|
|
text: '最近三个月',
|
|
|
onClick(picker) {
|
|
|
const end = new Date();
|
|
|
const start = new Date();
|
|
|
start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
|
|
|
picker.$emit('pick', [start, end]);
|
|
|
}
|
|
|
}]
|
|
|
},
|
|
|
// 加载
|
|
|
planLoading: false,
|
|
|
// 选中的备件
|
|
|
selOnSpare: [],
|
|
|
// 申领数量
|
|
|
applyNum: null,
|
|
|
// 申领数量弹出层
|
|
|
applyNumDialog: false,
|
|
|
// 已经选择的备件数
|
|
|
chooseSpareList: [],
|
|
|
// 备件总条数
|
|
|
spareTotal: 0,
|
|
|
// 备件table加载
|
|
|
spareLoading: false,
|
|
|
// 选择备件弹窗
|
|
|
spareDialog: false,
|
|
|
// 备件list
|
|
|
spareList: [],
|
|
|
// 保养人员选择穿梭框
|
|
|
personList: [],
|
|
|
selectPersonList: [],
|
|
|
// 工作中心list
|
|
|
workCenterList: [],
|
|
|
// 编辑检查标准list
|
|
|
itemDetailList: [],
|
|
|
// 编辑检查标准loading
|
|
|
detailLoading: false,
|
|
|
// 选中的设备信息
|
|
|
selectEquList: [],
|
|
|
// 设备信息loading
|
|
|
equLoading: false,
|
|
|
// 搜索到的设备总数
|
|
|
equTotal: 0,
|
|
|
// 搜索到的设备list
|
|
|
queryEquipment: [],
|
|
|
// 备件弹窗搜索条件
|
|
|
spareQuery: {
|
|
|
materialCode: null,
|
|
|
materialDesc: null,
|
|
|
pageNum: 1,
|
|
|
pageSize: 10,
|
|
|
},
|
|
|
// 设备弹窗搜索条件
|
|
|
equipmentQuery: {
|
|
|
equipmentCode: null,
|
|
|
equipmentName: null,
|
|
|
workshopCode: null,
|
|
|
groupLine:null,
|
|
|
pageNum: 1,
|
|
|
pageSize: 10,
|
|
|
},
|
|
|
// 选择设备弹窗
|
|
|
selectEqu: false,
|
|
|
// 编辑检查项弹窗
|
|
|
editorItem: false,
|
|
|
// 步骤
|
|
|
upkeepSteps: 0,
|
|
|
// 遮罩层
|
|
|
loading: true,
|
|
|
// 选中数组
|
|
|
ids: [],
|
|
|
// 非单个禁用
|
|
|
single: true,
|
|
|
// 非多个禁用
|
|
|
multiple: true,
|
|
|
// 显示搜索条件
|
|
|
showSearch: true,
|
|
|
// 总条数
|
|
|
total: 0,
|
|
|
// 保养计划表格数据
|
|
|
upkeepPlanList: [],
|
|
|
// 弹出层标题
|
|
|
title: "",
|
|
|
// 是否显示弹出层
|
|
|
open: false,
|
|
|
// 查询参数
|
|
|
queryParams: {
|
|
|
pageNum: 1,
|
|
|
pageSize: 10,
|
|
|
planCode: null,
|
|
|
planName: null,
|
|
|
planWorkshop: null,
|
|
|
planProdLine: null,
|
|
|
equipmentName: null,
|
|
|
equipmentCode: null,
|
|
|
planLoop: null,
|
|
|
planLoopType: null,
|
|
|
planLoopStart: null,
|
|
|
planLoopEnd: null,
|
|
|
planPerson: null,
|
|
|
planStatus: null,
|
|
|
planRestrict: null,
|
|
|
planType: 'maintenance',
|
|
|
planOutsource: null,
|
|
|
workCode: null,
|
|
|
factoryCode: null,
|
|
|
attr1: null,
|
|
|
attr2: null,
|
|
|
attr3: null,
|
|
|
delFlag: null,
|
|
|
createBy: null,
|
|
|
createTime: null,
|
|
|
updateBy: null,
|
|
|
updateTime: null,
|
|
|
createTimeArray: [],
|
|
|
updateTimeArray: [],
|
|
|
loopEndArray: [],
|
|
|
loopStartArray: [],
|
|
|
},
|
|
|
// 表单参数
|
|
|
form: {
|
|
|
selectSpareList: [],
|
|
|
equipmentItem: [],
|
|
|
shutDown: '0',
|
|
|
calculationRule: '0',
|
|
|
planLoopType: 'day',
|
|
|
planLoop: null,
|
|
|
upkeep: '1',
|
|
|
planName: null,
|
|
|
planWorkshop: null,
|
|
|
personList:[],
|
|
|
planTimeArray:[],
|
|
|
},
|
|
|
// 表单校验
|
|
|
rules: {}
|
|
|
};
|
|
|
},
|
|
|
created() {
|
|
|
this.getList();
|
|
|
this.setWorkCenter();
|
|
|
},
|
|
|
methods: {
|
|
|
equipmentItemQuery() {
|
|
|
const tableData = this.form.equipmentItem;
|
|
|
this.form.equipmentItem = this.equipmentItemList;//整个表重新赋值
|
|
|
this.form.equipmentItem = tableData.filter(
|
|
|
(data) => !this.equipmentItemSearch || data.equipmentCode.toLowerCase().includes(this.equipmentItemSearch.toLowerCase())
|
|
|
)
|
|
|
},
|
|
|
|
|
|
equipmentItemReset() {
|
|
|
this.form.equipmentItem = this.equipmentItemList;
|
|
|
this.equipmentItemSearch = '';
|
|
|
},
|
|
|
// 备件选择btn
|
|
|
choseSpareBtn(){
|
|
|
// 清理缓存
|
|
|
this.spareOnList = [];
|
|
|
// 打开选择备件弹窗
|
|
|
this.selectSpareDialog = true;
|
|
|
},
|
|
|
// 备件数量
|
|
|
handleEdit(index, row) {
|
|
|
// 库存数量-冻结数量
|
|
|
if ((Number(row.amount)-Number(row.storageAmount)) < Number(row.applyNum)) {
|
|
|
this.$message({
|
|
|
message: '领用最大数量为:'+(Number(row.amount)-Number(row.storageAmount)),
|
|
|
type: 'warning'
|
|
|
})
|
|
|
row.applyNum = (Number(row.amount)-Number(row.storageAmount));
|
|
|
}
|
|
|
},
|
|
|
// 备件选择完成按钮
|
|
|
spareChangeCom() {
|
|
|
this.spareDialog = false;
|
|
|
},
|
|
|
// 备件数量改变
|
|
|
changeApplySpareNum(e) {
|
|
|
for (let i = 0; i < this.selOnSpare.length; i++) {
|
|
|
if (this.selOnSpare[i].amount < e) {
|
|
|
this.$message({
|
|
|
message: '超过库存数量!',
|
|
|
type: 'warning'
|
|
|
})
|
|
|
return;
|
|
|
}
|
|
|
this.selOnSpare[i].applyNum = e;
|
|
|
}
|
|
|
},
|
|
|
// 删除备件-备件数量
|
|
|
delSpareList(e) {
|
|
|
for (let i = 0; i < this.chooseSpareList.length; i++){
|
|
|
if (this.chooseSpareList[i].materialCode == e.materialCode) {
|
|
|
this.chooseSpareList.splice(i,1);
|
|
|
this.$message({
|
|
|
message: '删除成功!',
|
|
|
type: 'success'
|
|
|
})
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
// 选择备件-添加备件
|
|
|
addSpareList(e) {
|
|
|
for (let i = 0; i < this.chooseSpareList.length; i++){
|
|
|
if (this.chooseSpareList[i].materialCode == e.materialCode) {
|
|
|
this.$message({
|
|
|
message: '不可重复添加!',
|
|
|
type: 'warning'
|
|
|
})
|
|
|
return;
|
|
|
}
|
|
|
}
|
|
|
this.chooseSpareList.push(e);
|
|
|
this.$message({
|
|
|
message: '添加成功!',
|
|
|
type: 'success'
|
|
|
})
|
|
|
},
|
|
|
// 改变保养周期事件-弃用
|
|
|
changeArray(e) {
|
|
|
if (this.form.planLoop == null) {
|
|
|
this.$message({
|
|
|
message: '请输入循环周期!',
|
|
|
type: 'warning'
|
|
|
})
|
|
|
this.form.planTimeArray = [];
|
|
|
return
|
|
|
}
|
|
|
if (this.form.planLoopType == null) {
|
|
|
this.$message({
|
|
|
message: '请选择循环类型!',
|
|
|
type: 'warning'
|
|
|
})
|
|
|
this.form.planTimeArray = [];
|
|
|
return
|
|
|
}
|
|
|
//
|
|
|
// // 检验
|
|
|
// if (this.form.planLoopType == 'day') {
|
|
|
// // 计算日期差值(以毫秒为单位)
|
|
|
// let diff = this.form.planTimeArray[1].getTime() - this.form.planTimeArray[0].getTime();
|
|
|
// // 转换为天数
|
|
|
// let days = Math.floor(diff / (1000 * 60 * 60 * 24));
|
|
|
//
|
|
|
// if (days > this.form.planLoop) {
|
|
|
// this.$message({
|
|
|
// message: '可执行时间范围为' + days + '天,循环周期为' + days + '天,超过循环周期' + (days - this.form.planLoop) + '天,请重新选择执行时间!',
|
|
|
// type: 'warning'
|
|
|
// })
|
|
|
// this.form.planTimeArray = [];
|
|
|
// return
|
|
|
// }
|
|
|
// }
|
|
|
//
|
|
|
// if (this.form.planLoopType == 'week') {
|
|
|
// // 计算日期差值(以毫秒为单位)
|
|
|
// let diff = this.form.planTimeArray[1].getTime() - this.form.planTimeArray[0].getTime();
|
|
|
// // 转换为周数
|
|
|
// let weeks = Math.floor(diff / (1000 * 60 * 60 * 24 * 7));
|
|
|
//
|
|
|
// if (weeks > (this.form.planLoop / 7)) {
|
|
|
// this.$message({
|
|
|
// message: '可执行时间范围为' + weeks + '周,循环周期为' + weeks + '周,超过循环周期' + (weeks * 7 - this.form.planLoop) + '天,请重新选择执行时间!',
|
|
|
// type: 'warning'
|
|
|
// })
|
|
|
// this.form.planTimeArray = [];
|
|
|
// return
|
|
|
// }
|
|
|
// }
|
|
|
//
|
|
|
// if (this.form.planLoopType == 'month') {
|
|
|
// let monthsDiff = (this.form.planTimeArray[1].getFullYear() - this.form.planTimeArray[0].getFullYear()) * 12 + this.form.planTimeArray[1].getMonth() - this.form.planTimeArray[0].getMonth();
|
|
|
//
|
|
|
// if (monthsDiff > this.form.planLoop) {
|
|
|
// this.$message({
|
|
|
// message: '可执行时间范围为' + monthsDiff + '月,循环周期为' + monthsDiff + '月,超过循环周期' + (monthsDiff - this.form.planLoop) + '月,请重新选择执行时间!',
|
|
|
// type: 'warning'
|
|
|
// })
|
|
|
// this.form.planTimeArray = [];
|
|
|
// return
|
|
|
// }
|
|
|
// }
|
|
|
//
|
|
|
// if (this.form.planLoopType == 'season') {
|
|
|
// let monthsDiff = (this.form.planTimeArray[1].getFullYear() - this.form.planTimeArray[0].getFullYear()) * 12 + this.form.planTimeArray[1].getMonth() - this.form.planTimeArray[0].getMonth();
|
|
|
//
|
|
|
// if (monthsDiff * 3 > this.form.planLoop) {
|
|
|
// this.$message({
|
|
|
// message: '可执行时间范围为' + monthsDiff * 3 + '季度,循环周期为' + monthsDiff * 3 + '季度,超过循环周期' + (monthsDiff - this.form.planLoop) + '月,请重新选择执行时间!',
|
|
|
// type: 'warning'
|
|
|
// })
|
|
|
// this.form.planTimeArray = [];
|
|
|
// return
|
|
|
// }
|
|
|
// }
|
|
|
//
|
|
|
// if (this.form.planLoopType == 'year') {
|
|
|
// // 计算年份差值
|
|
|
// let yearsDiff = this.form.planTimeArray[1].getFullYear() - this.form.planTimeArray[0].getFullYear();
|
|
|
//
|
|
|
// if (yearsDiff > this.form.planLoop) {
|
|
|
// this.$message({
|
|
|
// message: '可执行时间范围为' + yearsDiff + '年,循环周期为' + yearsDiff + '年,超过循环周期' + (yearsDiff - this.form.planLoop) + '年,请重新选择执行时间!',
|
|
|
// type: 'warning'
|
|
|
// })
|
|
|
// this.form.planTimeArray = [];
|
|
|
// return
|
|
|
// }
|
|
|
// }
|
|
|
|
|
|
},
|
|
|
// 选择备件确定按钮
|
|
|
confirmSelectSpareBtn() {
|
|
|
if (this.spareOnList.length == 0) {
|
|
|
this.$message({
|
|
|
message: "请勾选要申领的备件!",
|
|
|
type: "warning"
|
|
|
})
|
|
|
return
|
|
|
}
|
|
|
|
|
|
for (let i = 0; i < this.chooseSpareList.length; i++){
|
|
|
for (let j = 0; j < this.spareOnList.length; j++) {
|
|
|
if (this.chooseSpareList[i].materialCode == this.spareOnList[j].materialCode) {
|
|
|
this.$message({
|
|
|
message: '不可重复添加!',
|
|
|
type: 'warning'
|
|
|
})
|
|
|
return;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
for (let j = 0; j < this.spareOnList.length; j++) {
|
|
|
if (this.spareOnList[j].applyNum == null) {
|
|
|
this.spareOnList[j].applyNum=1;
|
|
|
}
|
|
|
this.chooseSpareList.push(this.spareOnList[j]);
|
|
|
}
|
|
|
|
|
|
this.$message({
|
|
|
message: '添加成功!',
|
|
|
type: 'success'
|
|
|
})
|
|
|
|
|
|
// 关闭备件选择弹窗
|
|
|
this.selectSpareDialog = false;
|
|
|
},
|
|
|
// 多选备件按钮
|
|
|
selectChangeSpare(e) {
|
|
|
// 清理缓存
|
|
|
this.spareOnList = [];
|
|
|
// 置入值
|
|
|
this.spareOnList = e;
|
|
|
},
|
|
|
// 备件搜索重置按钮
|
|
|
resetSpare() {
|
|
|
this.spareQuery = {
|
|
|
materialCode: null,
|
|
|
materialDesc: null,
|
|
|
pageNum: 1,
|
|
|
pageSize: 10,
|
|
|
};
|
|
|
this.setSpareList();
|
|
|
},
|
|
|
// 获取备件信息
|
|
|
setSpareList() {
|
|
|
querySpareList(this.spareQuery).then(response => {
|
|
|
this.spareTotal = response.total;
|
|
|
this.spareList = response.rows;
|
|
|
this.spareLoading = false;
|
|
|
})
|
|
|
},
|
|
|
// 搜索备件按钮
|
|
|
getSpareList() {
|
|
|
this.setSpareList()
|
|
|
},
|
|
|
// 选择备件按钮操作
|
|
|
selectSpareBtn(e) {
|
|
|
this.setSpareList();
|
|
|
if (e.spareList == null) {
|
|
|
e.spareList = [];
|
|
|
}
|
|
|
this.chooseSpareList = e.spareList;
|
|
|
this.spareDialog = true;
|
|
|
},
|
|
|
// 获取设备List-置入穿梭框信息
|
|
|
setPerson() {
|
|
|
getPersonList().then(response => {
|
|
|
for (let i = 0; i < response.data.length; i++) {
|
|
|
this.personList.push({
|
|
|
label: response.data[i].nickName + '(' + response.data[i].userName + ')',
|
|
|
key: response.data[i].userName,
|
|
|
})
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
// 保养人员穿梭框
|
|
|
filterMethod(query, item) {
|
|
|
return item.label.indexOf(query) > -1;
|
|
|
},
|
|
|
// 获取工作中心
|
|
|
setWorkCenter() {
|
|
|
getWorkCenter().then(response => {
|
|
|
this.workCenterList = response.data;
|
|
|
})
|
|
|
},
|
|
|
// 编辑标准确认按钮
|
|
|
standardBtn() {
|
|
|
this.editorItem = false;
|
|
|
},
|
|
|
// 删除标准
|
|
|
delStandard(e) {
|
|
|
e.showFlag = false;
|
|
|
for (let i = 0; i < this.itemDetailList.length; i++) {
|
|
|
if (this.itemDetailList[i].detailCode == e.detailCode) {
|
|
|
this.itemDetailList[i].showFlag = false;
|
|
|
this.itemDetailList.splice(i, 1);
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
// 点击编辑设备-保养项目
|
|
|
editorTheItem(e) {
|
|
|
|
|
|
// 清除缓存
|
|
|
this.itemDetailList = [];
|
|
|
|
|
|
let qw = 1;
|
|
|
|
|
|
for (let i = 0; i < this.form.equipmentItem.length; i++) {
|
|
|
|
|
|
if (e.equipmentCode == this.form.equipmentItem[i].equipmentCode) {
|
|
|
|
|
|
for (let j = 0; j < this.form.equipmentItem[i].equPlanDetailList.length; j++) {
|
|
|
|
|
|
// 部位
|
|
|
var itemName = this.form.equipmentItem[i].equPlanDetailList[j].itemName;
|
|
|
// 方法
|
|
|
var itemMethod = this.form.equipmentItem[i].equPlanDetailList[j].itemMethod;
|
|
|
// 工具
|
|
|
var itemTools = this.form.equipmentItem[i].equPlanDetailList[j].itemTools;
|
|
|
// // 周期
|
|
|
// var itemLoop = this.form.equipmentItem[i].equPlanDetailList[j].itemLoop;
|
|
|
// var itemLoopType = this.form.equipmentItem[i].equPlanDetailList[j].itemLoopType;
|
|
|
|
|
|
for (let k = 0; k < this.form.equipmentItem[i].equPlanDetailList[j].equPlanStandardList.length; k++) {
|
|
|
|
|
|
if (this.form.equipmentItem[i].equPlanDetailList[j].equPlanStandardList[k].showFlag == true) {
|
|
|
|
|
|
this.form.equipmentItem[i].equPlanDetailList[j].equPlanStandardList[k].itemName = itemName;
|
|
|
this.form.equipmentItem[i].equPlanDetailList[j].equPlanStandardList[k].itemMethod = itemMethod;
|
|
|
this.form.equipmentItem[i].equPlanDetailList[j].equPlanStandardList[k].itemTools = itemTools;
|
|
|
// this.form.equipmentItem[i].equPlanDetailList[j].equPlanStandardList[k].itemLoop = itemLoop;
|
|
|
// this.form.equipmentItem[i].equPlanDetailList[j].equPlanStandardList[k].itemLoopType = itemLoopType;
|
|
|
|
|
|
|
|
|
if (this.form.equipmentItem[i].equPlanDetailList[j].equPlanStandardList[k].standardType == "qualitative") {
|
|
|
this.form.equipmentItem[i].equPlanDetailList[j].equPlanStandardList[k].standardTypeName = "定性";
|
|
|
} else {
|
|
|
this.form.equipmentItem[i].equPlanDetailList[j].equPlanStandardList[k].standardTypeName = "定量";
|
|
|
}
|
|
|
this.itemDetailList.push(this.form.equipmentItem[i].equPlanDetailList[j].equPlanStandardList[k]);
|
|
|
}
|
|
|
|
|
|
}
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
this.editorItem = true;
|
|
|
},
|
|
|
// 删除设备-保养项
|
|
|
delTheEquItem(e) {
|
|
|
for (let i = 0; i < this.form.equipmentItem.length; i++) {
|
|
|
if (this.form.equipmentItem[i].equipmentCode == e.equipmentCode) {
|
|
|
this.form.equipmentItem.splice(i, 1);
|
|
|
}
|
|
|
this.equipmentItemList = this.form.equipmentItem;//用equipmentItemList当暂时的存储表
|
|
|
}
|
|
|
},
|
|
|
// 选择设备确认按钮
|
|
|
confirmSelectEquBtn() {
|
|
|
// 查询是否已经选择过
|
|
|
for (let i = 0; i < this.form.equipmentItem.length; i++) {
|
|
|
for (let j = 0; j < this.selectEquList.length; j++) {
|
|
|
if (this.form.equipmentItem[i].equipmentCode == this.selectEquList[j].equipmentCode) {
|
|
|
this.$message({
|
|
|
message: "存在已选择的设备!",
|
|
|
type: "warning"
|
|
|
})
|
|
|
return
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
// 设置循环周期,用来后端格式化处理设备信息
|
|
|
for (let i = 0; i < this.selectEquList.length; i++) {
|
|
|
this.selectEquList[i].itemLoop = this.form.planLoop;
|
|
|
this.selectEquList[i].itemLoopType = this.form.planLoopType;
|
|
|
}
|
|
|
|
|
|
// 处理信息
|
|
|
if (this.form.calculationRule == "2"){
|
|
|
formatEquItem(this.selectEquList).then(response => {
|
|
|
|
|
|
for (let i = 0; i < response.data.length; i++) {
|
|
|
this.form.equipmentItem.push(response.data[i]);
|
|
|
}
|
|
|
this.equipmentItemList = this.form.equipmentItem;//用equipmentItemList当暂时的存储表
|
|
|
this.selectEqu = false;
|
|
|
})
|
|
|
}else {
|
|
|
formatEquItemNoCondition(this.selectEquList).then(response => {
|
|
|
|
|
|
for (let i = 0; i < response.data.length; i++) {
|
|
|
this.form.equipmentItem.push(response.data[i]);
|
|
|
}
|
|
|
|
|
|
this.selectEqu = false;
|
|
|
})
|
|
|
}
|
|
|
|
|
|
},
|
|
|
// 选择设备多选操作
|
|
|
selectChangeEqu(e) {
|
|
|
this.selectEquList = e;
|
|
|
},
|
|
|
// 获取设备信息
|
|
|
getEquList() {
|
|
|
this.equLoading = true;
|
|
|
this.equipmentQuery.workshopCode = this.form.planWorkshop;
|
|
|
getEquList(this.equipmentQuery).then(response => {
|
|
|
this.equTotal = response.total;
|
|
|
this.queryEquipment = response.rows;
|
|
|
this.equLoading = false;
|
|
|
})
|
|
|
},
|
|
|
// 点击选择设备按钮
|
|
|
selectEquBtn() {
|
|
|
this.equipmentQuery = {
|
|
|
equipmentCode: null,
|
|
|
equipmentName: null,
|
|
|
workshopCode: null,
|
|
|
groupLine:null,
|
|
|
pageNum: 1,
|
|
|
pageSize: 10,
|
|
|
};
|
|
|
// 获取设备组线信息
|
|
|
getGroupLine().then(response => {
|
|
|
this.groupLineList = response.data;
|
|
|
// this.equipmentQuery.groupLine = response.data[0].equipmentCode;
|
|
|
this.getEquList();
|
|
|
})
|
|
|
|
|
|
this.selectEqu = true;
|
|
|
},
|
|
|
// 上一步
|
|
|
stepLast() {
|
|
|
this.upkeepSteps--;
|
|
|
},
|
|
|
// 下一步
|
|
|
stepNext() {
|
|
|
if (this.upkeepSteps == 0) {
|
|
|
if (this.form.planName == null) {
|
|
|
this.$message({
|
|
|
message: "计划名称不能为空!",
|
|
|
type: "warning"
|
|
|
})
|
|
|
return
|
|
|
}
|
|
|
if (this.form.planLoop <= 0 && this.form.calculationRule !=2) {
|
|
|
this.$message({
|
|
|
message: "循环周期不可小于等于’0‘!",
|
|
|
type: "warning"
|
|
|
})
|
|
|
return
|
|
|
}
|
|
|
if (this.form.planTimeArray.length == 0 && this.form.calculationRule != "2") {
|
|
|
this.$message({
|
|
|
message: "循环时间范围不能为空!",
|
|
|
type: "warning"
|
|
|
})
|
|
|
return
|
|
|
}
|
|
|
if (this.form.planLoopStart == null && this.form.calculationRule == "2") {
|
|
|
this.$message({
|
|
|
message: "开始时间不可为空!",
|
|
|
type: "warning"
|
|
|
})
|
|
|
return
|
|
|
}
|
|
|
if (this.form.planWorkshop == null) {
|
|
|
this.$message({
|
|
|
message: "车间不能为空!",
|
|
|
type: "warning"
|
|
|
})
|
|
|
return
|
|
|
}
|
|
|
}
|
|
|
if (this.upkeepSteps == 1) {
|
|
|
if (this.form.equipmentItem.length == 0) {
|
|
|
this.$message({
|
|
|
message: "请选择设备!",
|
|
|
type: "warning"
|
|
|
})
|
|
|
return
|
|
|
}
|
|
|
}
|
|
|
this.upkeepSteps++;
|
|
|
},
|
|
|
/** 查询保养计划列表 */
|
|
|
getList() {
|
|
|
this.loading = true;
|
|
|
listPlan(this.queryParams).then(response => {
|
|
|
this.upkeepPlanList = response.rows;
|
|
|
|
|
|
this.total = response.total;
|
|
|
this.loading = false;
|
|
|
});
|
|
|
},
|
|
|
// 取消按钮
|
|
|
cancel() {
|
|
|
this.open = false;
|
|
|
this.reset();
|
|
|
},
|
|
|
// 表单重置
|
|
|
reset() {
|
|
|
this.form = {
|
|
|
planId: null,
|
|
|
planCode: null,
|
|
|
planName: null,
|
|
|
planWorkshop: null,
|
|
|
planProdLine: null,
|
|
|
equipmentName: null,
|
|
|
equipmentCode: null,
|
|
|
planLoop: null,
|
|
|
planLoopType: 'day',
|
|
|
planLoopStart: null,
|
|
|
planLoopEnd: null,
|
|
|
planPerson: null,
|
|
|
planStatus: null,
|
|
|
planRestrict: null,
|
|
|
planType: 'maintenance',
|
|
|
planOutsource: null,
|
|
|
workCode: null,
|
|
|
factoryCode: null,
|
|
|
attr1: null,
|
|
|
attr2: null,
|
|
|
attr3: null,
|
|
|
delFlag: null,
|
|
|
createBy: null,
|
|
|
createTime: null,
|
|
|
updateBy: null,
|
|
|
updateTime: null,
|
|
|
upkeep: '0',
|
|
|
calculationRule: '0',
|
|
|
shutDown: '0',
|
|
|
equipmentItem: [],
|
|
|
personList:[],
|
|
|
selectSpareList: [],
|
|
|
planTimeArray:[],
|
|
|
workPerson: null,
|
|
|
workOutsourcingUnit: null,
|
|
|
workConnection: null,
|
|
|
workReason: null,
|
|
|
loopEndArray: [],
|
|
|
loopStartArray: [],
|
|
|
};
|
|
|
this.resetForm("form");
|
|
|
},
|
|
|
// 重置设备搜索
|
|
|
resetEqu() {
|
|
|
this.equipmentQuery = {
|
|
|
equipmentCode: null,
|
|
|
equipmentName: null,
|
|
|
workshopCode: null,
|
|
|
groupLine:this.groupLineList[0].equipmentCode,
|
|
|
pageNum: 1,
|
|
|
pageSize: 10,
|
|
|
};
|
|
|
this.getEquList();
|
|
|
},
|
|
|
/** 搜索按钮操作 */
|
|
|
handleQuery() {
|
|
|
this.queryParams.pageNum = 1;
|
|
|
this.getList();
|
|
|
},
|
|
|
/** 重置按钮操作 */
|
|
|
resetQuery() {
|
|
|
this.resetForm("queryForm");
|
|
|
// 重置日期范围
|
|
|
this.queryParams.createTimeArray = [];
|
|
|
this.queryParams.updateTimeArray = [];
|
|
|
this.queryParams.loopEndArray = [];
|
|
|
this.queryParams.loopStartArray = [];
|
|
|
this.queryParams.upkeep = null;
|
|
|
this.handleQuery();
|
|
|
},
|
|
|
// 多选框选中数据
|
|
|
handleSelectionChange(selection) {
|
|
|
this.ids = selection.map(item => item.planId)
|
|
|
this.single = selection.length !== 1
|
|
|
this.multiple = !selection.length
|
|
|
},
|
|
|
/** 新增按钮操作 */
|
|
|
handleAdd() {
|
|
|
this.reset();
|
|
|
// 清除缓存
|
|
|
this.resetQuery();
|
|
|
this.queryEquipment = [];
|
|
|
this.upkeepSteps = 0;
|
|
|
this.selectPersonList = [];
|
|
|
this.personList = [];
|
|
|
|
|
|
this.setPerson();
|
|
|
this.setWorkCenter();
|
|
|
this.open = true;
|
|
|
this.title = "添加保养计划";
|
|
|
},
|
|
|
/** 修改按钮操作 */
|
|
|
handleUpdate(row) {
|
|
|
this.loading = true;
|
|
|
this.reset();
|
|
|
// 清除缓存
|
|
|
this.queryEquipment = [];
|
|
|
this.upkeepSteps = 0;
|
|
|
this.selectPersonList = [];
|
|
|
this.personList = [];
|
|
|
this.setPerson();
|
|
|
this.setWorkCenter();
|
|
|
|
|
|
initUpdatePlanInfo(row).then(response => {
|
|
|
this.form = response.data;
|
|
|
this.selectPersonList = response.data.personListVO;
|
|
|
|
|
|
for (let i = 0; i < this.form.equipmentItem.length; i++) {
|
|
|
if (this.form.equipmentItem[i].itemTempName == null) {
|
|
|
this.form.equipmentItem[i].itemTempName = '';
|
|
|
}
|
|
|
for (let j = 0; j < this.form.equipmentItem[i].equPlanDetailList.length; j++) {
|
|
|
this.form.equipmentItem[i].itemTempName = this.form.equipmentItem[i].itemTempName + this.form.equipmentItem[i].equPlanDetailList[j].itemName + ","
|
|
|
}
|
|
|
}
|
|
|
//把数组放入
|
|
|
this.equipmentItemList = [];
|
|
|
for (let i = 0; i < response.data.equipmentItem.length; i++) {
|
|
|
this.equipmentItemList.push(response.data.equipmentItem[i]);
|
|
|
};
|
|
|
this.loading = false;
|
|
|
this.open = true;
|
|
|
this.title = "修改计划";
|
|
|
})
|
|
|
},
|
|
|
/** 提交按钮 */
|
|
|
submitForm() {
|
|
|
this.$refs["form"].validate(valid => {
|
|
|
if (valid) {
|
|
|
if (this.selectPersonList.length == 0 && this.form.upkeep == "0") {
|
|
|
this.$message({
|
|
|
message: "请请选择人员!",
|
|
|
type: "warning"
|
|
|
})
|
|
|
return
|
|
|
}
|
|
|
if (this.form.upkeep == "1") {
|
|
|
if (this.form.workOutsourcingUnit == null) {
|
|
|
this.$message({
|
|
|
message: "委外单位不可为空!",
|
|
|
type: "warning"
|
|
|
})
|
|
|
return
|
|
|
}
|
|
|
if (this.form.workPerson == null) {
|
|
|
this.$message({
|
|
|
message: "委外人员不可为空!",
|
|
|
type: "warning"
|
|
|
})
|
|
|
return
|
|
|
}
|
|
|
if (this.form.workConnection == null) {
|
|
|
this.$message({
|
|
|
message: "联系方式不可为空!",
|
|
|
type: "warning"
|
|
|
})
|
|
|
return
|
|
|
}
|
|
|
}
|
|
|
if(this.form.calculationRule == "2"){
|
|
|
this.form.planTimeArray = null;
|
|
|
this.form.planLoopEnd = this.form.planLoopStart;
|
|
|
}
|
|
|
this.planLoading = true;
|
|
|
if (this.form.planId != null) {
|
|
|
this.form.personList = this.selectPersonList.map(item => {
|
|
|
return{
|
|
|
userName: item.toString()
|
|
|
}
|
|
|
});
|
|
|
updatePlan(this.form).then(response => {
|
|
|
this.planLoading = false;
|
|
|
this.$modal.msgSuccess("修改成功");
|
|
|
this.open = false;
|
|
|
this.getList();
|
|
|
});
|
|
|
} else {
|
|
|
this.form.personList = this.selectPersonList.map(item => {
|
|
|
return{
|
|
|
userName: item.toString()
|
|
|
}
|
|
|
});
|
|
|
addPlan(this.form).then(response => {
|
|
|
this.planLoading = false;
|
|
|
this.$modal.msgSuccess("新增成功");
|
|
|
this.open = false;
|
|
|
this.getList();
|
|
|
});
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
/** 删除按钮操作 */
|
|
|
handleDelete(row) {
|
|
|
const planIds = row.planId || this.ids;
|
|
|
|
|
|
var planCodes = '';
|
|
|
// 处理信息
|
|
|
for (let i = 0; i < this.upkeepPlanList.length; i++) {
|
|
|
for (let j = 0; j < planIds.length; j++) {
|
|
|
if (planIds[j] == this.upkeepPlanList[i].planId) {
|
|
|
planCodes = planCodes + this.upkeepPlanList[i].planCode + ',';
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
if (planCodes == '') {
|
|
|
for (let i = 0; i < this.upkeepPlanList.length; i++) {
|
|
|
if (planIds == this.upkeepPlanList[i].planId) {
|
|
|
planCodes = this.upkeepPlanList[i].planCode;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
this.$modal.confirm('是否确认删除计划编号为"' + planCodes + '"的数据项?').then(function () {
|
|
|
return delPlan(planIds);
|
|
|
}).then(response => {
|
|
|
if (response.code != 500) {
|
|
|
this.$modal.msgSuccess("删除成功");
|
|
|
this.getList();
|
|
|
}
|
|
|
}).catch(() => {
|
|
|
});
|
|
|
},
|
|
|
/** 导出按钮操作 */
|
|
|
handleExport() {
|
|
|
this.download('device/upkeepPlan/export', {
|
|
|
...this.queryParams
|
|
|
}, `upkeepPlan_${new Date().getTime()}.xlsx`)
|
|
|
}
|
|
|
}
|
|
|
};
|
|
|
</script>
|
|
|
<style>
|
|
|
.my-step-mar {
|
|
|
margin-left: 10px;
|
|
|
margin-right: 10px;
|
|
|
}
|
|
|
|
|
|
.my-step-body {
|
|
|
margin-top: 15px;
|
|
|
}
|
|
|
|
|
|
.el-transfer-panel {
|
|
|
width: 250px !important;
|
|
|
}
|
|
|
</style>
|