|
|
@@ -1,48 +1,55 @@
|
|
|
<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="teamCode">
|
|
|
+ <el-form
|
|
|
+ :model="queryParams"
|
|
|
+ ref="queryForm"
|
|
|
+ size="small"
|
|
|
+ :inline="true"
|
|
|
+ v-show="showSearch"
|
|
|
+ label-width="100px"
|
|
|
+ >
|
|
|
+ <el-form-item label="隔离点编号" prop="pointCode">
|
|
|
<el-input
|
|
|
- v-model="queryParams.teamCode"
|
|
|
+ v-model="queryParams.pointCode"
|
|
|
placeholder="请输入隔离点编号"
|
|
|
clearable
|
|
|
@keyup.enter.native="handleQuery"
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="隔离点名称" prop="teamCode">
|
|
|
+ <el-form-item label="隔离点名称" prop="pointName">
|
|
|
<el-input
|
|
|
- v-model="queryParams.teamCode"
|
|
|
+ v-model="queryParams.pointName"
|
|
|
placeholder="请输入隔离点名称"
|
|
|
clearable
|
|
|
@keyup.enter.native="handleQuery"
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="状态" prop="calendarType">
|
|
|
+ <!-- <el-form-item label="状态" prop="calendarType">
|
|
|
<el-select v-model="queryParams.calendarType" placeholder="状态">
|
|
|
<el-option>正常</el-option>
|
|
|
<el-option>异常</el-option>
|
|
|
- <!-- <el-option-->
|
|
|
- <!-- v-for="dict in dict.type.mes_calendar_type"-->
|
|
|
- <!-- :key="dict.value"-->
|
|
|
- <!-- :label="dict.label"-->
|
|
|
- <!-- :value="dict.value"-->
|
|
|
- <!-- />-->
|
|
|
</el-select>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="隔离点类型" prop="calendarType">
|
|
|
- <el-select v-model="queryParams.calendarType" placeholder="请选择隔离点类型">
|
|
|
+ </el-form-item> -->
|
|
|
+ <el-form-item label="隔离点类型" prop="pointType">
|
|
|
+ <el-select
|
|
|
+ v-model="queryParams.pointType"
|
|
|
+ placeholder="请选择隔离点类型"
|
|
|
+ >
|
|
|
<el-option
|
|
|
- v-for="dict in dict.type.mes_calendar_type"
|
|
|
+ v-for="dict in dict.type.point_type"
|
|
|
:key="dict.value"
|
|
|
:label="dict.label"
|
|
|
:value="dict.value"
|
|
|
/>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="危险能量类型" prop="calendarType">
|
|
|
- <el-select v-model="queryParams.calendarType" placeholder="请选择危险能量类型">
|
|
|
+ <el-form-item label="危险能量类型" prop="powerType">
|
|
|
+ <el-select
|
|
|
+ v-model="queryParams.powerType"
|
|
|
+ placeholder="请选择危险能量类型"
|
|
|
+ >
|
|
|
<el-option
|
|
|
- v-for="dict in dict.type.mes_calendar_type"
|
|
|
+ v-for="dict in dict.type.power_type"
|
|
|
:key="dict.value"
|
|
|
:label="dict.label"
|
|
|
:value="dict.value"
|
|
|
@@ -51,7 +58,7 @@
|
|
|
</el-form-item>
|
|
|
<el-form-item label="创建时间">
|
|
|
<el-date-picker
|
|
|
- v-model="value2"
|
|
|
+ v-model="createTime"
|
|
|
type="daterange"
|
|
|
align="right"
|
|
|
unlink-panels
|
|
|
@@ -64,8 +71,16 @@
|
|
|
</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-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>
|
|
|
|
|
|
@@ -78,20 +93,9 @@
|
|
|
size="mini"
|
|
|
@click="handleAdd"
|
|
|
v-hasPermi="['mes:spm:seg:add']"
|
|
|
- >新增
|
|
|
+ >新增
|
|
|
</el-button>
|
|
|
</el-col>
|
|
|
- <!-- <el-col :span="1.5">-->
|
|
|
- <!-- <el-button-->
|
|
|
- <!-- type="success"-->
|
|
|
- <!-- plain-->
|
|
|
- <!-- icon="el-icon-edit"-->
|
|
|
- <!-- size="mini"-->
|
|
|
- <!-- :disabled="single"-->
|
|
|
- <!-- @click="handleUpdate"-->
|
|
|
- <!-- v-hasPermi="['mes:cal:team:edit']"-->
|
|
|
- <!-- >修改</el-button>-->
|
|
|
- <!-- </el-col>-->
|
|
|
<el-col :span="1.5">
|
|
|
<el-button
|
|
|
type="danger"
|
|
|
@@ -101,7 +105,7 @@
|
|
|
:disabled="multiple"
|
|
|
@click="handleDelete"
|
|
|
v-hasPermi="['mes:spm:seg:batchremove']"
|
|
|
- >批量删除
|
|
|
+ >批量删除
|
|
|
</el-button>
|
|
|
</el-col>
|
|
|
<!-- <el-col :span="1.5">-->
|
|
|
@@ -114,41 +118,77 @@
|
|
|
<!-- v-hasPermi="['mes:cal:team:export']"-->
|
|
|
<!-- >导出</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="teamList" @selection-change="handleSelectionChange">
|
|
|
- <el-table-column type="selection" width="55" align="center"/>
|
|
|
- <el-table-column label="隔离点编号" align="center" prop="teamCode">
|
|
|
+ <el-table
|
|
|
+ v-loading="loading"
|
|
|
+ :data="teamList"
|
|
|
+ @selection-change="handleSelectionChange"
|
|
|
+ >
|
|
|
+ <el-table-column type="selection" width="55" align="center" />
|
|
|
+ <el-table-column label="隔离点ID" align="center" prop="pointId">
|
|
|
<template slot-scope="scope">
|
|
|
<el-button
|
|
|
type="text"
|
|
|
@click="handleView(scope.row)"
|
|
|
v-hasPermi="['mes:spm:seg:query']"
|
|
|
- >{{ scope.row.teamCode }}
|
|
|
+ >{{ scope.row.pointId }}
|
|
|
</el-button>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column label="隔离点名称" align="center" prop="teamName"/>
|
|
|
- <el-table-column label="状态" align="center" prop="calendarType">
|
|
|
+ <el-table-column label="隔离点编号" align="center" prop="pointCode">
|
|
|
<template slot-scope="scope">
|
|
|
- <dict-tag :options="dict.type.mes_calendar_type" :value="scope.row.calendarType"/>
|
|
|
+ <el-button
|
|
|
+ type="text"
|
|
|
+ @click="handleView(scope.row)"
|
|
|
+ v-hasPermi="['mes:spm:seg:query']"
|
|
|
+ >{{ scope.row.pointCode }}
|
|
|
+ </el-button>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column label="隔离点图片" align="center" prop="remark">
|
|
|
+ <el-table-column label="隔离点名称" align="center" prop="pointName" />
|
|
|
+ <!-- <el-table-column label="状态" align="center" prop="calendarType">
|
|
|
<template slot-scope="scope">
|
|
|
- <img src="" alt="">
|
|
|
+ <dict-tag
|
|
|
+ :options="dict.type.mes_calendar_type"
|
|
|
+ :value="scope.row.calendarType"
|
|
|
+ />
|
|
|
+ </template>
|
|
|
+ </el-table-column> -->
|
|
|
+ <el-table-column label="隔离点图片" align="center" prop="pointPicture">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <img :src="scope.row.pointPicture" alt="" />
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column label="隔离点类型" align="center" prop="remark">
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="存在的作业种类" align="center" prop="remark">
|
|
|
+ <el-table-column label="隔离点类型" align="center" prop="pointType">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <dict-tag
|
|
|
+ :options="dict.type.point_type"
|
|
|
+ :value="scope.row.pointType"
|
|
|
+ />
|
|
|
+ </template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column label="危险能量类型" align="center" prop="remark">
|
|
|
+ <!-- <el-table-column label="存在的作业种类" align="center" prop="remark">
|
|
|
+ </el-table-column> -->
|
|
|
+ <el-table-column label="危险能量类型" align="center" prop="powerType">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <dict-tag
|
|
|
+ :options="dict.type.power_type"
|
|
|
+ :value="scope.row.powerType"
|
|
|
+ />
|
|
|
+ </template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column label="创建时间" align="center" prop="remark">
|
|
|
+ <el-table-column label="创建时间" align="center" prop="createTime">
|
|
|
</el-table-column>
|
|
|
- <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
|
|
+ <el-table-column
|
|
|
+ label="操作"
|
|
|
+ align="center"
|
|
|
+ class-name="small-padding fixed-width"
|
|
|
+ >
|
|
|
<template slot-scope="scope">
|
|
|
<el-button
|
|
|
size="mini"
|
|
|
@@ -156,7 +196,7 @@
|
|
|
icon="el-icon-edit"
|
|
|
@click="handleUpdate(scope.row)"
|
|
|
v-hasPermi="['mes:spm:seg:edit']"
|
|
|
- >编辑
|
|
|
+ >编辑
|
|
|
</el-button>
|
|
|
<el-button
|
|
|
size="mini"
|
|
|
@@ -164,65 +204,115 @@
|
|
|
icon="el-icon-delete"
|
|
|
@click="handleDelete(scope.row)"
|
|
|
v-hasPermi="['mes:spm:seg:remove']"
|
|
|
- >删除
|
|
|
+ >删除
|
|
|
</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"
|
|
|
+ :page.sync="queryParams.current"
|
|
|
+ :limit.sync="queryParams.size"
|
|
|
@pagination="getList"
|
|
|
/>
|
|
|
|
|
|
<!-- 添加或修改班组对话框 -->
|
|
|
- <el-dialog :visible.sync="open" width="660px" append-to-body>
|
|
|
+ <el-dialog :visible.sync="open" width="660px" append-to-body>
|
|
|
<div slot="title" class="dialog-title">
|
|
|
<i></i>
|
|
|
<span class="title">{{ title }}</span>
|
|
|
</div>
|
|
|
<el-form ref="form" :model="form" :rules="rules" label-width="110px">
|
|
|
- <el-form-item label="隔离点编号" prop="teamCode" >
|
|
|
- <el-input style="width: 318px" v-model="form.teamCode" placeholder="请输入隔离点编号" />
|
|
|
+ <el-form-item label="隔离点编号" prop="pointCode">
|
|
|
+ <el-input
|
|
|
+ style="width: 318px"
|
|
|
+ v-model="form.pointCode"
|
|
|
+ placeholder="请输入隔离点编号"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="隔离点名称" prop="pointName">
|
|
|
+ <el-input
|
|
|
+ style="width: 318px"
|
|
|
+ v-model="form.pointName"
|
|
|
+ placeholder="请输入隔离点名称"
|
|
|
+ />
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="隔离点名称" prop="teamCode">
|
|
|
- <el-input style="width: 318px" v-model="form.teamCode" placeholder="请输入隔离点名称" />
|
|
|
+ <el-form-item label="所属车间" prop="workshopId">
|
|
|
+ <el-select
|
|
|
+ style="width: 318px"
|
|
|
+ v-model="form.workshopId"
|
|
|
+ placeholder="请选择所属车间"
|
|
|
+ @change="workShopChange"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="item in this.workshopList"
|
|
|
+ :key="item.key"
|
|
|
+ :label="item.label"
|
|
|
+ :value="item.value"
|
|
|
+ />
|
|
|
+ </el-select>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="隔离点类型" prop="calendarType">
|
|
|
- <el-select style="width: 318px" v-model="form.calendarType" placeholder="请选择隔离点类型">
|
|
|
+ <el-form-item label="所属区域" prop="workareaId">
|
|
|
+ <el-select
|
|
|
+ style="width: 318px"
|
|
|
+ v-model="form.workareaId"
|
|
|
+ placeholder="请选择所属区域"
|
|
|
+ >
|
|
|
<el-option
|
|
|
- v-for="dict in dict.type.mes_calendar_type"
|
|
|
+ v-for="dict in this.workareaList"
|
|
|
:key="dict.value"
|
|
|
:label="dict.label"
|
|
|
:value="dict.value"
|
|
|
/>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="危险能量类型" prop="calendarType">
|
|
|
- <el-select style="width: 318px" v-model="form.calendarType" placeholder="请选择危险能量类型">
|
|
|
+ <el-form-item label="隔离点类型" prop="pointType">
|
|
|
+ <el-select
|
|
|
+ style="width: 318px"
|
|
|
+ v-model="form.pointType"
|
|
|
+ placeholder="请选择隔离点类型"
|
|
|
+ >
|
|
|
<el-option
|
|
|
- v-for="dict in dict.type.mes_calendar_type"
|
|
|
+ v-for="dict in dict.type.point_type"
|
|
|
:key="dict.value"
|
|
|
:label="dict.label"
|
|
|
:value="dict.value"
|
|
|
/>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="隔离点图片" prop="calendarType">
|
|
|
- <ImageUpload :limit="1" :value="form.sipUrl" :fileSize="5" @onUploaded="handleImgUplaoded" @onRemoved="handleImgRemoved" ></ImageUpload>
|
|
|
+ <el-form-item label="危险能量类型" prop="powerType">
|
|
|
+ <el-select
|
|
|
+ style="width: 318px"
|
|
|
+ v-model="form.powerType"
|
|
|
+ placeholder="请选择危险能量类型"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="dict in dict.type.power_type"
|
|
|
+ :key="dict.value"
|
|
|
+ :label="dict.label"
|
|
|
+ :value="dict.value"
|
|
|
+ />
|
|
|
+ </el-select>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="隔离点状态" prop="calendarType">
|
|
|
+ <el-form-item label="隔离点图片" prop="pointPicture">
|
|
|
+ <ImageUpload
|
|
|
+ :limit="1"
|
|
|
+ :value="form.pointPicture"
|
|
|
+ :fileSize="5"
|
|
|
+ @onUploaded="handleImgUplaoded"
|
|
|
+ @onRemoved="handleImgRemoved"
|
|
|
+ ></ImageUpload>
|
|
|
+ </el-form-item>
|
|
|
+ <!-- <el-form-item label="隔离点状态" prop="calendarType">
|
|
|
<el-radio v-model="radio" label="1">启用</el-radio>
|
|
|
<el-radio v-model="radio" label="2">停用</el-radio>
|
|
|
- </el-form-item>
|
|
|
+ </el-form-item> -->
|
|
|
</el-form>
|
|
|
|
|
|
<div slot="footer" class="dialog-footer">
|
|
|
- <el-button type="primary" @click="cancel" v-if="optType =='view'">返回</el-button>
|
|
|
- <el-button type="primary" @click="submitForm" v-else>确 定</el-button>
|
|
|
+ <el-button type="primary" @click="submitForm">确 定</el-button>
|
|
|
<el-button @click="cancel">取 消</el-button>
|
|
|
</div>
|
|
|
</el-dialog>
|
|
|
@@ -230,14 +320,20 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import { listTeam, getTeam, delTeam, addTeam, updateTeam } from '@/api/mes/cal/team'
|
|
|
-
|
|
|
-import { genCode } from '@/api/system/autocode/rule'
|
|
|
+import {
|
|
|
+ getIsIsolationPointPage,
|
|
|
+ addinsertIsIsolationPoint,
|
|
|
+ updateIsIsolationPoint,
|
|
|
+ workshoplistAll,
|
|
|
+ getIsWorkareaList,
|
|
|
+ selectIsIsolationPointById,
|
|
|
+ deleteIsIsolationPointByPointIds,
|
|
|
+} from "@/api/mes/spm/segregationPoint";
|
|
|
+import { genCode } from "@/api/system/autocode/rule";
|
|
|
|
|
|
export default {
|
|
|
- name: 'Team',
|
|
|
-
|
|
|
- dicts: ['mes_calendar_type'],
|
|
|
+ name: "Team",
|
|
|
+ dicts: ["power_type", "point_type"],
|
|
|
data() {
|
|
|
return {
|
|
|
//自动生成编码
|
|
|
@@ -258,202 +354,275 @@ export default {
|
|
|
// 班组表格数据
|
|
|
teamList: [],
|
|
|
// 弹出层标题
|
|
|
- title: '',
|
|
|
+ title: "",
|
|
|
// 是否显示弹出层
|
|
|
open: false,
|
|
|
+ // 车间数据
|
|
|
+ workshopList: [],
|
|
|
+ // 工作区域数据
|
|
|
+ workareaList: [],
|
|
|
+ // 新增或修改
|
|
|
+ pointId: null,
|
|
|
// 查询参数
|
|
|
+ createTime: "",
|
|
|
queryParams: {
|
|
|
- pageNum: 1,
|
|
|
- pageSize: 10,
|
|
|
- teamCode: null,
|
|
|
- teamName: null,
|
|
|
- calendarType: null
|
|
|
+ current: 1,
|
|
|
+ size: 10,
|
|
|
+ pointCode: "",
|
|
|
+ pointName: "",
|
|
|
+ delFlag: "",
|
|
|
+ pointType: "",
|
|
|
+ powerType: "",
|
|
|
+ startTime: "",
|
|
|
+ endTime: "",
|
|
|
},
|
|
|
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])
|
|
|
- }
|
|
|
- }]
|
|
|
+ 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]);
|
|
|
+ },
|
|
|
+ },
|
|
|
+ ],
|
|
|
},
|
|
|
-
|
|
|
- value2: '',
|
|
|
-
|
|
|
// 表单参数
|
|
|
form: {},
|
|
|
// 表单校验
|
|
|
rules: {
|
|
|
- teamCode: [
|
|
|
- { required: true, message: '班组编号不能为空', trigger: 'blur' }
|
|
|
+ pointCode: [
|
|
|
+ { required: true, message: "隔离点编号不能为空", trigger: "blur" },
|
|
|
],
|
|
|
- teamName: [
|
|
|
- { required: true, message: '班组名称不能为空', trigger: 'blur' }
|
|
|
+ pointName: [
|
|
|
+ { required: true, message: "隔离点名称不能为空", trigger: "blur" },
|
|
|
],
|
|
|
- calendarType: [
|
|
|
- { required: true, message: '清选择班组类型', trigger: 'blur' }
|
|
|
- ]
|
|
|
- }
|
|
|
- }
|
|
|
+ workshopId: [
|
|
|
+ { required: true, message: "所属车间不能为空", trigger: "blur" },
|
|
|
+ ],
|
|
|
+ workareaId: [
|
|
|
+ { required: true, message: "所属区域不能为空", trigger: "blur" },
|
|
|
+ ],
|
|
|
+ },
|
|
|
+ };
|
|
|
},
|
|
|
created() {
|
|
|
- this.getList()
|
|
|
+ this.getList();
|
|
|
},
|
|
|
methods: {
|
|
|
- /** 查询班组列表 */
|
|
|
+ // 格式化日期查询数据
|
|
|
+ formatDate(date) {
|
|
|
+ if (date && date instanceof Date && !isNaN(date)) {
|
|
|
+ // 使用本地时间
|
|
|
+ return `${date.getFullYear()}-${String(date.getMonth() + 1).padStart(
|
|
|
+ 2,
|
|
|
+ "0"
|
|
|
+ )}-${String(date.getDate()).padStart(2, "0")}`;
|
|
|
+ }
|
|
|
+ return null;
|
|
|
+ },
|
|
|
+ /** 查询隔离点信息列表 */
|
|
|
getList() {
|
|
|
- this.loading = true
|
|
|
- listTeam(this.queryParams).then(response => {
|
|
|
- this.teamList = response.rows
|
|
|
- this.total = response.total
|
|
|
- this.loading = false
|
|
|
- })
|
|
|
+ this.loading = true;
|
|
|
+ // 格式化日期并更新queryParams
|
|
|
+ if (Array.isArray(this.createTime) && this.createTime.length === 2) {
|
|
|
+ this.queryParams.startTime = this.formatDate(this.createTime[0]);
|
|
|
+ this.queryParams.endTime = this.formatDate(this.createTime[1]);
|
|
|
+ }
|
|
|
+ getIsIsolationPointPage(this.queryParams).then((response) => {
|
|
|
+ // console.log(response, "接口返回结果");
|
|
|
+ this.teamList = response.data.records;
|
|
|
+ this.total = response.data.total;
|
|
|
+ this.loading = false;
|
|
|
+ });
|
|
|
},
|
|
|
//图片上传成功
|
|
|
- handleImgUplaoded(imgUrl){
|
|
|
- this.form.sipUrl = imgUrl;
|
|
|
+ handleImgUplaoded(imgUrl) {
|
|
|
+ this.form.pointPicture = imgUrl;
|
|
|
},
|
|
|
//图片移除
|
|
|
- handleImgRemoved(imgUrl){
|
|
|
- this.form.sipUrl = null;
|
|
|
+ handleImgRemoved(imgUrl) {
|
|
|
+ this.form.pointPicture = null;
|
|
|
},
|
|
|
// 取消按钮
|
|
|
cancel() {
|
|
|
- this.open = false
|
|
|
- this.reset()
|
|
|
+ this.open = false;
|
|
|
+ this.reset();
|
|
|
},
|
|
|
// 表单重置
|
|
|
reset() {
|
|
|
this.form = {
|
|
|
- teamId: null,
|
|
|
- teamCode: null,
|
|
|
- teamName: null,
|
|
|
- calendarType: null,
|
|
|
- remark: null,
|
|
|
- attr1: null,
|
|
|
- attr2: null,
|
|
|
- attr3: null,
|
|
|
- attr4: null,
|
|
|
- createBy: null,
|
|
|
+ pointCode: null,
|
|
|
+ pointName: null,
|
|
|
+ pointPicture: null,
|
|
|
+ pointType: null,
|
|
|
+ powerType: null,
|
|
|
createTime: null,
|
|
|
- updateBy: null,
|
|
|
- updateTime: null
|
|
|
- }
|
|
|
- this.resetForm('form')
|
|
|
+ };
|
|
|
+ this.resetForm("form");
|
|
|
},
|
|
|
/** 搜索按钮操作 */
|
|
|
handleQuery() {
|
|
|
- this.queryParams.pageNum = 1
|
|
|
- this.getList()
|
|
|
+ this.queryParams.current = 1;
|
|
|
+ this.getList();
|
|
|
},
|
|
|
/** 重置按钮操作 */
|
|
|
resetQuery() {
|
|
|
- this.resetForm('queryForm')
|
|
|
- this.handleQuery()
|
|
|
+ this.createTime = "";
|
|
|
+ (this.queryParams.startTime = ""),
|
|
|
+ (this.queryParams.endTime = ""),
|
|
|
+ this.resetForm("queryForm");
|
|
|
+ this.handleQuery();
|
|
|
},
|
|
|
// 多选框选中数据
|
|
|
handleSelectionChange(selection) {
|
|
|
- this.ids = selection.map(item => item.teamId)
|
|
|
- this.single = selection.length !== 1
|
|
|
- this.multiple = !selection.length
|
|
|
+ this.ids = selection.map((item) => item.teamId);
|
|
|
+ this.single = selection.length !== 1;
|
|
|
+ this.multiple = !selection.length;
|
|
|
},
|
|
|
/** 新增按钮操作 */
|
|
|
handleAdd() {
|
|
|
- this.reset()
|
|
|
- this.open = true
|
|
|
- this.title = '添加隔离点'
|
|
|
- this.optType = 'add'
|
|
|
+ this.reset();
|
|
|
+ this.open = true;
|
|
|
+ this.title = "添加隔离点";
|
|
|
+ this.optType = "add";
|
|
|
+ this.pointId = null;
|
|
|
+ this.getworkShop();
|
|
|
},
|
|
|
// 查询明细按钮操作
|
|
|
handleView(row) {
|
|
|
- this.reset()
|
|
|
- const teamId = row.teamId || this.ids
|
|
|
- getTeam(teamId).then(response => {
|
|
|
- this.form = response.data
|
|
|
- this.open = true
|
|
|
- this.title = '查看班组'
|
|
|
- this.optType = 'view'
|
|
|
- })
|
|
|
+ this.reset();
|
|
|
+ const teamId = row.teamId || this.ids;
|
|
|
+ getTeam(teamId).then((response) => {
|
|
|
+ this.form = response.data;
|
|
|
+ this.open = true;
|
|
|
+ this.title = "查看";
|
|
|
+ this.optType = "view";
|
|
|
+ });
|
|
|
},
|
|
|
/** 修改按钮操作 */
|
|
|
handleUpdate(row) {
|
|
|
- this.reset()
|
|
|
- const teamId = row.teamId || this.ids
|
|
|
- getTeam(teamId).then(response => {
|
|
|
- this.form = response.data
|
|
|
- this.open = true
|
|
|
- this.title = '修改隔离点信息'
|
|
|
- this.optType = 'edit'
|
|
|
- })
|
|
|
+ this.reset();
|
|
|
+ this.pointId = row.pointId || this.ids;
|
|
|
+ selectIsIsolationPointById(this.pointId).then((response) => {
|
|
|
+ this.form = response.data;
|
|
|
+ this.open = true;
|
|
|
+ this.title = "修改隔离点信息";
|
|
|
+ this.optType = "edit";
|
|
|
+ });
|
|
|
},
|
|
|
/** 提交按钮 */
|
|
|
submitForm() {
|
|
|
- this.$refs['form'].validate(valid => {
|
|
|
+ this.$refs["form"].validate((valid) => {
|
|
|
if (valid) {
|
|
|
- if (this.form.teamId != null) {
|
|
|
- updateTeam(this.form).then(response => {
|
|
|
- this.$modal.msgSuccess('修改成功')
|
|
|
- this.open = false
|
|
|
- this.getList()
|
|
|
- })
|
|
|
+ console.log(this.pointId, "this.pointId");
|
|
|
+ if (this.pointId != null) {
|
|
|
+ updateIsIsolationPoint(this.form).then((response) => {
|
|
|
+ this.$modal.msgSuccess("修改成功");
|
|
|
+ this.open = false;
|
|
|
+ this.getList();
|
|
|
+ });
|
|
|
} else {
|
|
|
- addTeam(this.form).then(response => {
|
|
|
- this.$modal.msgSuccess('新增成功')
|
|
|
- this.open = false
|
|
|
- this.getList()
|
|
|
- })
|
|
|
+ addinsertIsIsolationPoint(this.form).then((response) => {
|
|
|
+ this.$modal.msgSuccess("新增成功");
|
|
|
+ this.open = false;
|
|
|
+ this.getList();
|
|
|
+ this.pointId = null;
|
|
|
+ });
|
|
|
}
|
|
|
}
|
|
|
- })
|
|
|
+ });
|
|
|
},
|
|
|
/** 删除按钮操作 */
|
|
|
handleDelete(row) {
|
|
|
- const teamIds = row.teamId || this.ids
|
|
|
- this.$modal.confirm('是否确认删除班组编号为"' + teamIds + '"的数据项?').then(function() {
|
|
|
- return delTeam(teamIds)
|
|
|
- }).then(() => {
|
|
|
- this.getList()
|
|
|
- this.$modal.msgSuccess('删除成功')
|
|
|
- }).catch(() => {
|
|
|
- })
|
|
|
+ const teamIds = row.pointId || this.ids;
|
|
|
+ this.$modal
|
|
|
+ .confirm('是否确认删除隔离点编号为"' + teamIds + '"的数据项?')
|
|
|
+ .then(function () {
|
|
|
+ return deleteIsIsolationPointByPointIds(teamIds);
|
|
|
+ })
|
|
|
+ .then(() => {
|
|
|
+ this.getList();
|
|
|
+ this.$modal.msgSuccess("删除成功");
|
|
|
+ })
|
|
|
+ .catch(() => {});
|
|
|
},
|
|
|
/** 导出按钮操作 */
|
|
|
handleExport() {
|
|
|
- this.download('cal/team/export', {
|
|
|
- ...this.queryParams
|
|
|
- }, `team_${new Date().getTime()}.xlsx`)
|
|
|
+ this.download(
|
|
|
+ "cal/team/export",
|
|
|
+ {
|
|
|
+ ...this.queryParams,
|
|
|
+ },
|
|
|
+ `team_${new Date().getTime()}.xlsx`
|
|
|
+ );
|
|
|
},
|
|
|
//自动生成编码
|
|
|
handleAutoGenChange(autoGenFlag) {
|
|
|
if (autoGenFlag) {
|
|
|
- genCode('CAL_TEAM_CODE').then(response => {
|
|
|
- this.form.teamCode = response
|
|
|
- })
|
|
|
+ genCode("CAL_TEAM_CODE").then((response) => {
|
|
|
+ this.form.teamCode = response;
|
|
|
+ });
|
|
|
} else {
|
|
|
- this.form.teamCode = null
|
|
|
+ this.form.teamCode = null;
|
|
|
}
|
|
|
- }
|
|
|
- }
|
|
|
-}
|
|
|
+ },
|
|
|
+ // 获取车间数据
|
|
|
+ getworkShop() {
|
|
|
+ workshoplistAll().then((response) => {
|
|
|
+ // console.log(response, "获取车间数据");
|
|
|
+ this.workshopList = response.data.map((item) => {
|
|
|
+ return {
|
|
|
+ label: item.workshopName,
|
|
|
+ value: item.workshopId,
|
|
|
+ key: item.workshopCode,
|
|
|
+ };
|
|
|
+ });
|
|
|
+ });
|
|
|
+ },
|
|
|
+ // 所属车间下拉改变工作区域内容
|
|
|
+ workShopChange() {
|
|
|
+ this.getworkArea();
|
|
|
+ },
|
|
|
+ // 获取工作区域数据
|
|
|
+ getworkArea() {
|
|
|
+ const workshopId = this.form.workshopId;
|
|
|
+
|
|
|
+ if (workshopId) {
|
|
|
+ getIsWorkareaList(workshopId).then((response) => {
|
|
|
+ // console.log(response, "获取工作区域数据");
|
|
|
+ this.workareaList = response.data.map((item) => {
|
|
|
+ return {
|
|
|
+ label: item.workareaName,
|
|
|
+ value: item.workareaId,
|
|
|
+ key: item.workareaCode,
|
|
|
+ };
|
|
|
+ });
|
|
|
+ });
|
|
|
+ }
|
|
|
+ },
|
|
|
+ },
|
|
|
+};
|
|
|
</script>
|
|
|
<style lang="scss" src="@/assets/styles/dialog-title.scss" scoped>
|
|
|
.el-input-width {
|