|
@@ -1,229 +1,186 @@
|
|
|
<template>
|
|
<template>
|
|
|
<div class="app-container">
|
|
<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="hardwareTypeCode">
|
|
|
|
|
|
|
+ <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch">
|
|
|
|
|
+ <el-form-item label="挂锁类型编码" prop="lockTypeCode">
|
|
|
<el-input
|
|
<el-input
|
|
|
- v-model="queryParams.hardwareTypeCode"
|
|
|
|
|
- placeholder="请输入硬件编号"
|
|
|
|
|
|
|
+ v-model="queryParams.lockTypeCode"
|
|
|
|
|
+ placeholder="请输入挂锁类型编码"
|
|
|
clearable
|
|
clearable
|
|
|
@keyup.enter.native="handleQuery"
|
|
@keyup.enter.native="handleQuery"
|
|
|
/>
|
|
/>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
- <el-form-item label="类型名称" prop="hardwareTypeName">
|
|
|
|
|
|
|
+ <el-form-item label="挂锁类型名称" prop="lockTypeName">
|
|
|
<el-input
|
|
<el-input
|
|
|
- v-model="queryParams.hardwareTypeName"
|
|
|
|
|
- placeholder="请输入类型名称"
|
|
|
|
|
|
|
+ v-model="queryParams.lockTypeName"
|
|
|
|
|
+ placeholder="请输入挂锁类型名称"
|
|
|
clearable
|
|
clearable
|
|
|
@keyup.enter.native="handleQuery"
|
|
@keyup.enter.native="handleQuery"
|
|
|
/>
|
|
/>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
|
|
|
|
|
- <el-form-item label="状态" prop="enableFlag">
|
|
|
|
|
- <el-select
|
|
|
|
|
- v-model="queryParams.enableFlag"
|
|
|
|
|
- placeholder="请选择状态"
|
|
|
|
|
- clearable
|
|
|
|
|
- >
|
|
|
|
|
- <el-option label="启用" value="y"></el-option>
|
|
|
|
|
- <el-option label="禁用" value="n"></el-option>
|
|
|
|
|
|
|
|
|
|
- <!-- <el-option-->
|
|
|
|
|
- <!-- v-for="dict in dict.type.mes_order_status"-->
|
|
|
|
|
- <!-- :key="dict.value"-->
|
|
|
|
|
- <!-- :label="dict.label"-->
|
|
|
|
|
- <!-- :value="dict.value"-->
|
|
|
|
|
- <!-- />-->
|
|
|
|
|
- </el-select>
|
|
|
|
|
|
|
+ <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-item>
|
|
|
- <el-form-item style="margin-left: 50px">
|
|
|
|
|
|
|
+ </el-form>
|
|
|
|
|
+ <el-row :gutter="10" class="mb8">
|
|
|
|
|
+ <el-col :span="1.5">
|
|
|
<el-button
|
|
<el-button
|
|
|
type="primary"
|
|
type="primary"
|
|
|
- icon="el-icon-search"
|
|
|
|
|
|
|
+ plain
|
|
|
|
|
+ icon="el-icon-plus"
|
|
|
size="mini"
|
|
size="mini"
|
|
|
- @click="handleQuery"
|
|
|
|
|
- >搜索</el-button
|
|
|
|
|
- >
|
|
|
|
|
- <el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
|
|
|
|
|
- >重置</el-button
|
|
|
|
|
- >
|
|
|
|
|
- </el-form-item>
|
|
|
|
|
- </el-form>
|
|
|
|
|
|
|
+ @click="handleAdd"
|
|
|
|
|
+ v-hasPermi="['system:dept:add']"
|
|
|
|
|
+ >新增
|
|
|
|
|
+ </el-button>
|
|
|
|
|
+ </el-col>
|
|
|
|
|
+ <el-col :span="1.5">
|
|
|
|
|
+ <el-button
|
|
|
|
|
+ type="info"
|
|
|
|
|
+ plain
|
|
|
|
|
+ icon="el-icon-sort"
|
|
|
|
|
+ size="mini"
|
|
|
|
|
+ @click="toggleExpandAll"
|
|
|
|
|
+ >展开/折叠
|
|
|
|
|
+ </el-button>
|
|
|
|
|
+ </el-col>
|
|
|
|
|
+ <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
|
|
|
|
+ </el-row>
|
|
|
|
|
+
|
|
|
<el-table
|
|
<el-table
|
|
|
|
|
+ v-if="refreshTable"
|
|
|
v-loading="loading"
|
|
v-loading="loading"
|
|
|
- :data="machinerytypeList"
|
|
|
|
|
- row-key="id"
|
|
|
|
|
- default-expand-all
|
|
|
|
|
- :tree-props="{ children: 'children', hasChildren: 'hasChildren' }"
|
|
|
|
|
|
|
+ :data="deptList"
|
|
|
|
|
+ row-key="lockTypeId"
|
|
|
|
|
+ :default-expand-all="isExpandAll"
|
|
|
|
|
+ :tree-props="{children: 'children', hasChildren: 'hasChildren'}"
|
|
|
>
|
|
>
|
|
|
- <el-table-column
|
|
|
|
|
- label="硬件编号"
|
|
|
|
|
- width="170px"
|
|
|
|
|
- align="center"
|
|
|
|
|
- prop="hardwareTypeCode"
|
|
|
|
|
- />
|
|
|
|
|
- <el-table-column
|
|
|
|
|
- label="类型名称"
|
|
|
|
|
- width="150px"
|
|
|
|
|
- align="center"
|
|
|
|
|
- prop="hardwareTypeName"
|
|
|
|
|
- :show-overflow-tooltip="true"
|
|
|
|
|
- />
|
|
|
|
|
- <el-table-column label="状态" align="center" prop="enableFlag">
|
|
|
|
|
|
|
+ <el-table-column prop="lockTypeCode" label="挂锁类型编码" width="260"></el-table-column>
|
|
|
|
|
+ <el-table-column prop="lockTypeName" label="挂锁类型名称" width="260"></el-table-column>
|
|
|
|
|
+ <el-table-column prop="lockTypeIcon" label="挂锁类型图标" width="260">
|
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
|
- <el-tag v-if="scope.row.enableFlag == 'y'">启用</el-tag>
|
|
|
|
|
- <el-tag v-else type="danger">禁用</el-tag>
|
|
|
|
|
-
|
|
|
|
|
- <!-- <dict-tag-->
|
|
|
|
|
- <!-- :options="dict.type.mes_order_status"-->
|
|
|
|
|
- <!-- :value="scope.row.enableFlag"-->
|
|
|
|
|
- <!-- />-->
|
|
|
|
|
|
|
+ <img style="width: 50px;height:50px" :src="scope.row.lockTypeIcon" alt="" v-if="scope.row.lockTypeIcon">
|
|
|
|
|
+ <span v-else>-</span>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-table-column>
|
|
|
|
|
+ <el-table-column prop="lockTypeImg" label="挂锁类型图片" width="260">
|
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
|
+ <img style="width: 50px;height:50px" :src="scope.row.lockTypeImg" alt="" v-if="scope.row.lockTypeImg">
|
|
|
|
|
+ <span v-else>-</span>
|
|
|
</template>
|
|
</template>
|
|
|
</el-table-column>
|
|
</el-table-column>
|
|
|
- <!-- <el-table-column label="硬件层级" align="center" prop="level">-->
|
|
|
|
|
- <!-- <template slot-scope="scope">-->
|
|
|
|
|
- <!-- {{-->
|
|
|
|
|
- <!-- scope.row.level == "1"-->
|
|
|
|
|
- <!-- ? "一"-->
|
|
|
|
|
- <!-- : scope.row.level == "2"-->
|
|
|
|
|
- <!-- ? "二"-->
|
|
|
|
|
- <!-- : scope.row.level == "3"-->
|
|
|
|
|
- <!-- ? "三"-->
|
|
|
|
|
- <!-- : scope.row.level-->
|
|
|
|
|
- <!-- }}级-->
|
|
|
|
|
- <!-- </template>-->
|
|
|
|
|
- <!-- </el-table-column>-->
|
|
|
|
|
- <el-table-column label="备注" align="center" prop="remark" />
|
|
|
|
|
- <el-table-column
|
|
|
|
|
- label="操作"
|
|
|
|
|
- align="center"
|
|
|
|
|
- class-name="small-padding fixed-width"
|
|
|
|
|
- >
|
|
|
|
|
|
|
+ <el-table-column prop="lockTypeDescription" label="挂锁类型描述" width="260"></el-table-column>
|
|
|
|
|
+ <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
|
<el-button
|
|
<el-button
|
|
|
size="mini"
|
|
size="mini"
|
|
|
type="text"
|
|
type="text"
|
|
|
icon="el-icon-edit"
|
|
icon="el-icon-edit"
|
|
|
@click="handleUpdate(scope.row)"
|
|
@click="handleUpdate(scope.row)"
|
|
|
- v-hasPermi="['mes:hw:type:edit']"
|
|
|
|
|
- >编辑</el-button
|
|
|
|
|
- >
|
|
|
|
|
|
|
+ v-hasPermi="['mes:md:waa:edit']"
|
|
|
|
|
+ >修改
|
|
|
|
|
+ </el-button>
|
|
|
<el-button
|
|
<el-button
|
|
|
size="mini"
|
|
size="mini"
|
|
|
type="text"
|
|
type="text"
|
|
|
icon="el-icon-plus"
|
|
icon="el-icon-plus"
|
|
|
@click="handleAdd(scope.row)"
|
|
@click="handleAdd(scope.row)"
|
|
|
- v-hasPermi="['mes:hw:type:add']"
|
|
|
|
|
- >新增</el-button
|
|
|
|
|
- >
|
|
|
|
|
|
|
+ v-hasPermi="['mes:md:waa:add']"
|
|
|
|
|
+ >新增
|
|
|
|
|
+ </el-button>
|
|
|
|
|
+
|
|
|
<el-button
|
|
<el-button
|
|
|
v-if="scope.row.parentTypeId != 0"
|
|
v-if="scope.row.parentTypeId != 0"
|
|
|
size="mini"
|
|
size="mini"
|
|
|
type="text"
|
|
type="text"
|
|
|
icon="el-icon-delete"
|
|
icon="el-icon-delete"
|
|
|
@click="handleDelete(scope.row)"
|
|
@click="handleDelete(scope.row)"
|
|
|
- v-hasPermi="['mes:hw:type:remove']"
|
|
|
|
|
- >删除</el-button
|
|
|
|
|
- >
|
|
|
|
|
|
|
+ v-hasPermi="['mes:md:waa:remove']"
|
|
|
|
|
+ >删除
|
|
|
|
|
+ </el-button>
|
|
|
</template>
|
|
</template>
|
|
|
</el-table-column>
|
|
</el-table-column>
|
|
|
</el-table>
|
|
</el-table>
|
|
|
|
|
|
|
|
- <!-- 添加或修改设备类型对话框 -->
|
|
|
|
|
- <el-dialog :title="title" :visible.sync="open" width="700px" append-to-body>
|
|
|
|
|
|
|
+ <!-- 添加或修改部门对话框 -->
|
|
|
|
|
+ <el-dialog :title="title" :visible.sync="open" width="600px" append-to-body>
|
|
|
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
|
|
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
|
|
|
<el-row>
|
|
<el-row>
|
|
|
- <el-col :span="24" v-if="form.parentTypeId !== 0">
|
|
|
|
|
- <el-form-item label="父类型" prop="parentTypeId">
|
|
|
|
|
- <treeselect
|
|
|
|
|
- v-model="form.parentTypeId"
|
|
|
|
|
- :options="machinerytypeOptions"
|
|
|
|
|
- :normalizer="normalizer"
|
|
|
|
|
- placeholder="请选择父类型"
|
|
|
|
|
|
|
+ <el-col :span="18">
|
|
|
|
|
+ <el-form-item label="父级" prop="parentTypeId">
|
|
|
|
|
+ <treeselect style="width: 318px" v-model="form.parentTypeId" :options="deptOptions" :normalizer="normalizer"
|
|
|
|
|
+ placeholder="选择父级"
|
|
|
/>
|
|
/>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
</el-col>
|
|
</el-col>
|
|
|
</el-row>
|
|
</el-row>
|
|
|
|
|
+ <el-form-item label="硬件类型" prop="hardwareTypeId">
|
|
|
|
|
+ <treeselect
|
|
|
|
|
+ v-model="form.hardwareTypeId"
|
|
|
|
|
+ :options="machinerytypeOptions"
|
|
|
|
|
+ :normalizer="normalizer1"
|
|
|
|
|
+ placeholder="请选择硬件类型"
|
|
|
|
|
+ />
|
|
|
|
|
+ </el-form-item>
|
|
|
<el-row>
|
|
<el-row>
|
|
|
<el-col :span="18">
|
|
<el-col :span="18">
|
|
|
- <el-form-item label="锁具编号" prop="lockTypeCode">
|
|
|
|
|
|
|
+ <el-form-item label="挂锁类型名称" prop="lockTypeName">
|
|
|
|
|
+ <el-input
|
|
|
|
|
+ style="width: 318px"
|
|
|
|
|
+ v-model="form.lockTypeName"
|
|
|
|
|
+ placeholder="请输入挂锁类型名称"
|
|
|
|
|
+ />
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ </el-col>
|
|
|
|
|
+ </el-row>
|
|
|
|
|
+ <el-row>
|
|
|
|
|
+ <el-col :span="19">
|
|
|
|
|
+ <el-form-item label="挂锁类型编码" prop="lockTypeCode">
|
|
|
<el-input
|
|
<el-input
|
|
|
|
|
+ style="width: 318px"
|
|
|
v-model="form.lockTypeCode"
|
|
v-model="form.lockTypeCode"
|
|
|
- placeholder="请输入锁具编号"
|
|
|
|
|
|
|
+ placeholder="请输入挂锁类型编码"
|
|
|
/>
|
|
/>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
</el-col>
|
|
</el-col>
|
|
|
- <el-col :span="6">
|
|
|
|
|
- <el-form-item label-width="30">
|
|
|
|
|
|
|
+ <el-col :span="3">
|
|
|
|
|
+ <el-form-item label-width="80">
|
|
|
<el-switch
|
|
<el-switch
|
|
|
|
|
+ style="width: 170px"
|
|
|
v-model="autoGenFlag"
|
|
v-model="autoGenFlag"
|
|
|
active-color="#13ce66"
|
|
active-color="#13ce66"
|
|
|
active-text="自动生成"
|
|
active-text="自动生成"
|
|
|
@change="handleAutoGenChange(autoGenFlag)"
|
|
@change="handleAutoGenChange(autoGenFlag)"
|
|
|
-
|
|
|
|
|
>
|
|
>
|
|
|
</el-switch>
|
|
</el-switch>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
</el-col>
|
|
</el-col>
|
|
|
</el-row>
|
|
</el-row>
|
|
|
-
|
|
|
|
|
<el-row>
|
|
<el-row>
|
|
|
- <el-col :span="12">
|
|
|
|
|
- <el-form-item label="锁具类型名称" prop="lockTypeName">
|
|
|
|
|
|
|
+ <el-col :span="10">
|
|
|
|
|
+ <el-form-item label="挂锁类型描述" prop="lockTypeDescription">
|
|
|
<el-input
|
|
<el-input
|
|
|
- v-model="form.lockTypeName"
|
|
|
|
|
- placeholder="请输入锁具类型名称"
|
|
|
|
|
- />
|
|
|
|
|
- </el-form-item>
|
|
|
|
|
- </el-col>
|
|
|
|
|
- <el-col :span="12">
|
|
|
|
|
- <el-form-item label="状态" prop="enableFlag">
|
|
|
|
|
- <el-radio v-model="form.enableFlag" label="y">启用</el-radio>
|
|
|
|
|
- <el-radio v-model="form.enableFlag" label="n">禁用</el-radio>
|
|
|
|
|
- </el-form-item>
|
|
|
|
|
- </el-col>
|
|
|
|
|
- </el-row>
|
|
|
|
|
- <el-row>
|
|
|
|
|
- <el-col :span="12">
|
|
|
|
|
- <el-form-item label="锁具类型图标" prop="lockTypeIcon">
|
|
|
|
|
- <ImageUpload
|
|
|
|
|
- :limit="1"
|
|
|
|
|
- :value="form.lockTypeIcon"
|
|
|
|
|
- :fileSize="5"
|
|
|
|
|
- @onUploaded="handleIconUplaoded('lockTypeIcon')"
|
|
|
|
|
- @onRemoved="handleIconRemoved('lockTypeIcon')"
|
|
|
|
|
- ></ImageUpload>
|
|
|
|
|
- </el-form-item>
|
|
|
|
|
- </el-col>
|
|
|
|
|
- <el-col :span="12">
|
|
|
|
|
- <el-form-item label="锁具类型图片" prop="lockTypeImg">
|
|
|
|
|
- <ImageUpload
|
|
|
|
|
- :limit="1"
|
|
|
|
|
- :value="form.lockTypeImg"
|
|
|
|
|
- :fileSize="5"
|
|
|
|
|
- @onUploaded="handleIconUplaoded('lockTypeImg')"
|
|
|
|
|
- @onRemoved="handleIconRemoved('lockTypeImg')"
|
|
|
|
|
- ></ImageUpload>
|
|
|
|
|
- </el-form-item>
|
|
|
|
|
- </el-col>
|
|
|
|
|
- </el-row>
|
|
|
|
|
- <el-row>
|
|
|
|
|
- <el-col :span="24">
|
|
|
|
|
- <el-form-item label="备注" prop="remark">
|
|
|
|
|
- <el-input
|
|
|
|
|
- v-model="form.remark"
|
|
|
|
|
type="textarea"
|
|
type="textarea"
|
|
|
- placeholder="请输入内容"
|
|
|
|
|
|
|
+ style="width: 318px"
|
|
|
|
|
+ v-model="form.lockTypeDescription"
|
|
|
|
|
+ placeholder="请输入挂锁类型描述"
|
|
|
/>
|
|
/>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
</el-col>
|
|
</el-col>
|
|
|
</el-row>
|
|
</el-row>
|
|
|
|
|
+ <el-form-item label="挂锁类型图标" prop="lockTypeIcon">
|
|
|
|
|
+ <ImageUpload :limit="1" :value="form.lockTypeIcon" :fileSize="5" @onUploaded="handleImgUplaoded"
|
|
|
|
|
+ @onRemoved="handleImgRemoved"
|
|
|
|
|
+ ></ImageUpload>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ <el-form-item label="挂锁类型图片" prop="lockTypeImg">
|
|
|
|
|
+ <ImageUpload :limit="1" :value="form.lockTypeImg" :fileSize="5" @onUploaded="handleImgUplaoded1"
|
|
|
|
|
+ @onRemoved="handleImgRemoved1"
|
|
|
|
|
+ ></ImageUpload>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+
|
|
|
</el-form>
|
|
</el-form>
|
|
|
<div slot="footer" class="dialog-footer">
|
|
<div slot="footer" class="dialog-footer">
|
|
|
<el-button type="primary" @click="submitForm">确 定</el-button>
|
|
<el-button type="primary" @click="submitForm">确 定</el-button>
|
|
@@ -234,22 +191,16 @@
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
<script>
|
|
|
-import {
|
|
|
|
|
- listLockType,
|
|
|
|
|
- addLockType,
|
|
|
|
|
- getLockTypeInfo,
|
|
|
|
|
- updateLockType,
|
|
|
|
|
- delLockType
|
|
|
|
|
-} from "@/api/mes/locktype/locktype"
|
|
|
|
|
-import Treeselect from "@riophae/vue-treeselect";
|
|
|
|
|
-import "@riophae/vue-treeselect/dist/vue-treeselect.css";
|
|
|
|
|
-import { genCode } from "@/api/system/autocode/rule";
|
|
|
|
|
|
|
+import {listPadLockTypeAPI,getPadLockTypeInfoAPI,addPadLockTypeAPI,updatePadLockTypeAPI,delPadLockTypeAPI} from "@/api/mes/padLockType/padLockType"
|
|
|
|
|
+import Treeselect from '@riophae/vue-treeselect'
|
|
|
|
|
+import '@riophae/vue-treeselect/dist/vue-treeselect.css'
|
|
|
|
|
+import { genCode } from '@/api/system/autocode/rule'
|
|
|
|
|
+import { listHanrwareType } from '@/api/mes/hw/hadrwareType'
|
|
|
|
|
+
|
|
|
export default {
|
|
export default {
|
|
|
- name: "hardwareType",
|
|
|
|
|
- dicts: ["sys_yes_no"],
|
|
|
|
|
- components: {
|
|
|
|
|
- Treeselect,
|
|
|
|
|
- },
|
|
|
|
|
|
|
+ name: 'Dept',
|
|
|
|
|
+ dicts: ['sys_normal_disable'],
|
|
|
|
|
+ components: { Treeselect },
|
|
|
data() {
|
|
data() {
|
|
|
return {
|
|
return {
|
|
|
//自动生成编码
|
|
//自动生成编码
|
|
@@ -257,75 +208,90 @@ export default {
|
|
|
optType: undefined,
|
|
optType: undefined,
|
|
|
// 遮罩层
|
|
// 遮罩层
|
|
|
loading: true,
|
|
loading: true,
|
|
|
|
|
+ // 选中数组
|
|
|
|
|
+ ids: [],
|
|
|
|
|
+ codes: [],
|
|
|
|
|
+ // 非单个禁用
|
|
|
|
|
+ single: true,
|
|
|
|
|
+ // 非多个禁用
|
|
|
|
|
+ multiple: true,
|
|
|
|
|
+ // 地图预览弹框
|
|
|
|
|
+ dialogVisibleMap: false,
|
|
|
// 显示搜索条件
|
|
// 显示搜索条件
|
|
|
showSearch: true,
|
|
showSearch: true,
|
|
|
- // 设备类型表格数据
|
|
|
|
|
- machinerytypeList: [],
|
|
|
|
|
- // 设备类型树选项
|
|
|
|
|
- machinerytypeOptions: [],
|
|
|
|
|
|
|
+ // 表格树数据
|
|
|
|
|
+ deptList: [],
|
|
|
|
|
+ // 部门树选项
|
|
|
|
|
+ deptOptions: [],
|
|
|
// 弹出层标题
|
|
// 弹出层标题
|
|
|
- title: "",
|
|
|
|
|
|
|
+ title: '',
|
|
|
// 是否显示弹出层
|
|
// 是否显示弹出层
|
|
|
open: false,
|
|
open: false,
|
|
|
- // 总条数
|
|
|
|
|
- total: 0,
|
|
|
|
|
|
|
+ // 是否展开,默认全部展开
|
|
|
|
|
+ isExpandAll: true,
|
|
|
|
|
+ // 重新渲染表格状态
|
|
|
|
|
+ refreshTable: true,
|
|
|
// 查询参数
|
|
// 查询参数
|
|
|
queryParams: {
|
|
queryParams: {
|
|
|
- parentTypeId: null,
|
|
|
|
|
- ancestors: null,
|
|
|
|
|
current: 1,
|
|
current: 1,
|
|
|
- size: 10,
|
|
|
|
|
- hardwareTypeCode: "",
|
|
|
|
|
- hardwareTypeName: "",
|
|
|
|
|
- enableFlag: "",
|
|
|
|
|
|
|
+ size: -1,
|
|
|
|
|
+ lockTypeCode: null,
|
|
|
|
|
+ lockTypeName: null,
|
|
|
|
|
+ lockTypeId: null
|
|
|
},
|
|
},
|
|
|
|
|
+ // 总条数
|
|
|
|
|
+ total: 0,
|
|
|
// 表单参数
|
|
// 表单参数
|
|
|
form: {
|
|
form: {
|
|
|
- parentTypeId: 0,
|
|
|
|
|
|
|
+ parentTypeId:0,
|
|
|
},
|
|
},
|
|
|
- EditId: null, //编辑传递id
|
|
|
|
|
|
|
+ machinerytypeOptions:[],//硬件类型
|
|
|
|
|
+ EditId: null, //判断是否是编辑弹框的值
|
|
|
// 表单校验
|
|
// 表单校验
|
|
|
rules: {
|
|
rules: {
|
|
|
- hardwareTypeCode: [
|
|
|
|
|
- { required: true, message: "硬件编号不能为空", trigger: "blur" },
|
|
|
|
|
|
|
+ // parentId: [
|
|
|
|
|
+ // { required: true, message: '父级不能为空', trigger: 'blur' }
|
|
|
|
|
+ // ],
|
|
|
|
|
+
|
|
|
|
|
+ lockTypeCode: [
|
|
|
|
|
+ { required: true, message: '挂锁类型编号不能为空', trigger: 'blur' }
|
|
|
],
|
|
],
|
|
|
- hardwareTypeName: [
|
|
|
|
|
- { required: true, message: "硬件名称不能为空", trigger: "blur" },
|
|
|
|
|
|
|
+ lockTypeName: [
|
|
|
|
|
+ { required: true, message: '挂锁类型名称不能为空', trigger: 'blur' }
|
|
|
],
|
|
],
|
|
|
- },
|
|
|
|
|
- };
|
|
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
},
|
|
},
|
|
|
created() {
|
|
created() {
|
|
|
- this.getList();
|
|
|
|
|
|
|
+ this.getList()
|
|
|
|
|
+ this.getTreeselect()
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
|
- /** 查询设备类型列表 */
|
|
|
|
|
|
|
+ /** 查询部门列表 */
|
|
|
getList() {
|
|
getList() {
|
|
|
- this.loading = true;
|
|
|
|
|
- listLockType(this.queryParams).then((response) => {
|
|
|
|
|
- this.machinerytypeList = this.handleTree(
|
|
|
|
|
- response.data.records,
|
|
|
|
|
- "id",
|
|
|
|
|
- "parentTypeId"
|
|
|
|
|
- );
|
|
|
|
|
- this.loading = false;
|
|
|
|
|
- console.log(this.machinerytypeList, "machinerytypeList");
|
|
|
|
|
- });
|
|
|
|
|
|
|
+ this.loading = true
|
|
|
|
|
+ listPadLockTypeAPI(this.queryParams).then(response => {
|
|
|
|
|
+ debugger;
|
|
|
|
|
+ var depts = this.handleTree(response.data.records, 'lockTypeId', 'parentTypeId', 'children')
|
|
|
|
|
+ this.deptList = depts
|
|
|
|
|
+ this.loading = false
|
|
|
|
|
+ })
|
|
|
},
|
|
},
|
|
|
- /** 转换设备类型数据结构 */
|
|
|
|
|
|
|
+ /** 转换部门数据结构 */
|
|
|
normalizer(node) {
|
|
normalizer(node) {
|
|
|
if (node.children && !node.children.length) {
|
|
if (node.children && !node.children.length) {
|
|
|
- delete node.children;
|
|
|
|
|
|
|
+ delete node.children
|
|
|
}
|
|
}
|
|
|
return {
|
|
return {
|
|
|
- id: node.id,
|
|
|
|
|
- label: node.hardwareTypeName,
|
|
|
|
|
- children: node.children,
|
|
|
|
|
- };
|
|
|
|
|
|
|
+ id: node.lockTypeId,
|
|
|
|
|
+ label: node.lockTypeName,
|
|
|
|
|
+ children: node.children
|
|
|
|
|
+ }
|
|
|
},
|
|
},
|
|
|
- /** 查询设备类型下拉树结构 */
|
|
|
|
|
|
|
+ /** 查询挂锁类型下拉树结构 */
|
|
|
getTreeselect() {
|
|
getTreeselect() {
|
|
|
- listLockType().then((response) => {
|
|
|
|
|
|
|
+ listHanrwareType().then((response) => {
|
|
|
debugger;
|
|
debugger;
|
|
|
this.machinerytypeOptions = [];
|
|
this.machinerytypeOptions = [];
|
|
|
const data = this.handleTree(
|
|
const data = this.handleTree(
|
|
@@ -333,123 +299,155 @@ export default {
|
|
|
"id",
|
|
"id",
|
|
|
"parentTypeId"
|
|
"parentTypeId"
|
|
|
)[0];
|
|
)[0];
|
|
|
- console.log(data, "父类型回显");
|
|
|
|
|
|
|
+ // console.log(data, "父类型回显");
|
|
|
this.machinerytypeOptions.push(data);
|
|
this.machinerytypeOptions.push(data);
|
|
|
});
|
|
});
|
|
|
},
|
|
},
|
|
|
|
|
+ /** 转换设备类型数据结构 */
|
|
|
|
|
+ normalizer1(node) {
|
|
|
|
|
+ if (node.children && !node.children.length) {
|
|
|
|
|
+ delete node.children;
|
|
|
|
|
+ }
|
|
|
|
|
+ return {
|
|
|
|
|
+ id: node.id,
|
|
|
|
|
+ label: node.hardwareTypeName,
|
|
|
|
|
+ children: node.children,
|
|
|
|
|
+ };
|
|
|
|
|
+ },
|
|
|
// 取消按钮
|
|
// 取消按钮
|
|
|
cancel() {
|
|
cancel() {
|
|
|
- this.open = false;
|
|
|
|
|
- this.reset();
|
|
|
|
|
|
|
+ this.open = false
|
|
|
|
|
+ this.reset()
|
|
|
},
|
|
},
|
|
|
// 表单重置
|
|
// 表单重置
|
|
|
reset() {
|
|
reset() {
|
|
|
this.form = {
|
|
this.form = {
|
|
|
- level: "",
|
|
|
|
|
- parentTypeId: 1,
|
|
|
|
|
- ancestors: null,
|
|
|
|
|
- enableFlag: "",
|
|
|
|
|
- remark: null,
|
|
|
|
|
- createBy: null,
|
|
|
|
|
- createTime: null,
|
|
|
|
|
- updateBy: null,
|
|
|
|
|
- updateTime: null,
|
|
|
|
|
- hardwareTypeCode: "",
|
|
|
|
|
- hardwareTypeName: "",
|
|
|
|
|
- };
|
|
|
|
|
- this.resetForm("form");
|
|
|
|
|
|
|
+ parentTypeId: undefined,
|
|
|
|
|
+ lockTypeId:undefined,
|
|
|
|
|
+ lockTypeName:undefined,
|
|
|
|
|
+ lockTypeIcon:undefined,
|
|
|
|
|
+ lockTypeImg:undefined,
|
|
|
|
|
+ lockTypeDescription:undefined,
|
|
|
|
|
+ lockTypeCode:undefined,
|
|
|
|
|
+ }
|
|
|
|
|
+ this.autoGenFlag = false
|
|
|
|
|
+ this.resetForm('form')
|
|
|
},
|
|
},
|
|
|
/** 搜索按钮操作 */
|
|
/** 搜索按钮操作 */
|
|
|
handleQuery() {
|
|
handleQuery() {
|
|
|
- this.getList();
|
|
|
|
|
|
|
+ this.queryParams.current = 1
|
|
|
|
|
+ this.getList()
|
|
|
},
|
|
},
|
|
|
/** 重置按钮操作 */
|
|
/** 重置按钮操作 */
|
|
|
resetQuery() {
|
|
resetQuery() {
|
|
|
- this.resetForm("queryForm");
|
|
|
|
|
- this.handleQuery();
|
|
|
|
|
- },
|
|
|
|
|
- // 层级计数器函数
|
|
|
|
|
- handleChange(value) {
|
|
|
|
|
- console.log(value);
|
|
|
|
|
|
|
+ this.queryParams = {
|
|
|
|
|
+ current: 1,
|
|
|
|
|
+ size: -1,
|
|
|
|
|
+ lockTypeCode: null,
|
|
|
|
|
+ lockTypeName: null,
|
|
|
|
|
+ lockTypeId: null
|
|
|
|
|
+ }
|
|
|
|
|
+ this.resetForm('queryForm')
|
|
|
|
|
+ this.handleQuery()
|
|
|
},
|
|
},
|
|
|
/** 新增按钮操作 */
|
|
/** 新增按钮操作 */
|
|
|
handleAdd(row) {
|
|
handleAdd(row) {
|
|
|
- this.reset();
|
|
|
|
|
- this.getTreeselect();
|
|
|
|
|
- if (row != null && row.id) {
|
|
|
|
|
- this.form.parentTypeId = row.id;
|
|
|
|
|
- } else {
|
|
|
|
|
|
|
+ this.reset()
|
|
|
|
|
+ if (row != undefined) {
|
|
|
|
|
+ this.form.parentTypeId = row.lockTypeId;
|
|
|
|
|
+ }else{
|
|
|
this.form.parentTypeId = 0;
|
|
this.form.parentTypeId = 0;
|
|
|
}
|
|
}
|
|
|
- this.open = true;
|
|
|
|
|
- this.title = "新增硬件类型";
|
|
|
|
|
|
|
+ this.open = true
|
|
|
|
|
+ this.title = '添加工作区域'
|
|
|
|
|
+ listPadLockTypeAPI().then(response => {
|
|
|
|
|
+ this.deptOptions = this.handleTree(response.data.records, 'lockTypeId', 'parentTypeId', 'children')
|
|
|
|
|
+ console.log(this.deptOptions,'this.deptOptions')
|
|
|
|
|
+ })
|
|
|
|
|
+ },
|
|
|
|
|
+ /** 展开/折叠操作 */
|
|
|
|
|
+ toggleExpandAll() {
|
|
|
|
|
+ this.refreshTable = false
|
|
|
|
|
+ this.isExpandAll = !this.isExpandAll
|
|
|
|
|
+ this.$nextTick(() => {
|
|
|
|
|
+ this.refreshTable = true
|
|
|
|
|
+ })
|
|
|
},
|
|
},
|
|
|
/** 修改按钮操作 */
|
|
/** 修改按钮操作 */
|
|
|
handleUpdate(row) {
|
|
handleUpdate(row) {
|
|
|
- this.reset();
|
|
|
|
|
- this.getTreeselect();
|
|
|
|
|
- if (row != null) {
|
|
|
|
|
- this.form.parentTypeId = row.id;
|
|
|
|
|
- }
|
|
|
|
|
- getLockTypeInfo(row.id).then((response) => {
|
|
|
|
|
- this.form = response.data;
|
|
|
|
|
- this.open = true;
|
|
|
|
|
- this.title = "编辑硬件类型";
|
|
|
|
|
- });
|
|
|
|
|
|
|
+ this.reset()
|
|
|
|
|
+ this.EditId = row.lockTypeId || this.ids
|
|
|
|
|
+ getPadLockTypeInfoAPI(row.lockTypeId).then(response => {
|
|
|
|
|
+ this.form = response.data
|
|
|
|
|
+ this.open = true
|
|
|
|
|
+ this.title = '修改挂锁类型'
|
|
|
|
|
+
|
|
|
|
|
+ })
|
|
|
|
|
+ listPadLockTypeAPI().then(response => {
|
|
|
|
|
+ this.deptOptions = this.handleTree(response.data.records, 'lockTypeId', 'parentTypeId', 'children')
|
|
|
|
|
+ })
|
|
|
},
|
|
},
|
|
|
|
|
+
|
|
|
/** 提交按钮 */
|
|
/** 提交按钮 */
|
|
|
- submitForm() {
|
|
|
|
|
- this.$refs["form"].validate((valid) => {
|
|
|
|
|
|
|
+ submitForm: function() {
|
|
|
|
|
+ this.$refs['form'].validate(valid => {
|
|
|
if (valid) {
|
|
if (valid) {
|
|
|
- if (this.form.id != null) {
|
|
|
|
|
- updateLockType(this.form).then((response) => {
|
|
|
|
|
- this.$modal.msgSuccess("修改成功");
|
|
|
|
|
- this.open = false;
|
|
|
|
|
- this.getList();
|
|
|
|
|
- });
|
|
|
|
|
|
|
+ if (this.form.lockTypeId != undefined) {
|
|
|
|
|
+ updatePadLockTypeAPI(this.form).then(response => {
|
|
|
|
|
+ this.$modal.msgSuccess('修改成功')
|
|
|
|
|
+ this.open = false
|
|
|
|
|
+ this.getList()
|
|
|
|
|
+ })
|
|
|
} else {
|
|
} else {
|
|
|
- addLockType(this.form).then((response) => {
|
|
|
|
|
- this.$modal.msgSuccess("新增成功");
|
|
|
|
|
- this.open = false;
|
|
|
|
|
- this.getList();
|
|
|
|
|
- });
|
|
|
|
|
|
|
+ console.log(this.form,'新增工作区域参数')
|
|
|
|
|
+ addPadLockTypeAPI(this.form).then(response => {
|
|
|
|
|
+ this.$modal.msgSuccess('新增成功')
|
|
|
|
|
+ this.open = false
|
|
|
|
|
+ this.getList()
|
|
|
|
|
+ })
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- });
|
|
|
|
|
|
|
+ })
|
|
|
|
|
+ },
|
|
|
|
|
+ /** 删除按钮操作 */
|
|
|
|
|
+ handleDelete(row) {
|
|
|
|
|
+ this.$modal.confirm('是否确认删除名称为"' + row.lockTypeCode + '"的数据项?').then(function() {
|
|
|
|
|
+ return delPadLockTypeAPI(row.lockTypeId)
|
|
|
|
|
+ }).then(() => {
|
|
|
|
|
+ this.getList()
|
|
|
|
|
+ this.$modal.msgSuccess('删除成功')
|
|
|
|
|
+ }).catch(() => {
|
|
|
|
|
+ })
|
|
|
},
|
|
},
|
|
|
//自动生成编码
|
|
//自动生成编码
|
|
|
handleAutoGenChange(autoGenFlag) {
|
|
handleAutoGenChange(autoGenFlag) {
|
|
|
if (autoGenFlag) {
|
|
if (autoGenFlag) {
|
|
|
- genCode("HARDWARE_TYPE_CODE").then((response) => {
|
|
|
|
|
- this.form.hardwareTypeCode = response;
|
|
|
|
|
- });
|
|
|
|
|
|
|
+ genCode('PAD_LOCK_TYPE_CODE').then((response) => {
|
|
|
|
|
+ this.form.lockTypeCode = response
|
|
|
|
|
+ })
|
|
|
} else {
|
|
} else {
|
|
|
- this.form.hardwareTypeCode = null;
|
|
|
|
|
|
|
+ this.form.lockTypeCode = null
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
- /** 删除按钮操作 */
|
|
|
|
|
- handleDelete(row) {
|
|
|
|
|
- const repairIds = row.id || this.ids;
|
|
|
|
|
- const repairCodes = row.hardwareTypeCode;
|
|
|
|
|
- this.$modal
|
|
|
|
|
- .confirm('是否删除硬件编号为"' + repairCodes + '"的硬件类型?')
|
|
|
|
|
- .then(function () {
|
|
|
|
|
- return delHardwareType(repairIds);
|
|
|
|
|
- })
|
|
|
|
|
- .then(() => {
|
|
|
|
|
- this.getList();
|
|
|
|
|
- this.$modal.msgSuccess("删除成功");
|
|
|
|
|
- })
|
|
|
|
|
- .catch(() => {});
|
|
|
|
|
|
|
+ //图片上传成功
|
|
|
|
|
+ handleImgUplaoded(imgUrl) {
|
|
|
|
|
+ console.log(imgUrl,'编辑拿到的图片')
|
|
|
|
|
+ this.form.lockTypeIcon = imgUrl[0].url
|
|
|
},
|
|
},
|
|
|
- //图标上传成功
|
|
|
|
|
- handleIconUplaoded(fieldName, imgUrl) {
|
|
|
|
|
- this.form[fieldName] = imgUrl[0].url;
|
|
|
|
|
|
|
+ //图片移除
|
|
|
|
|
+ handleImgRemoved(imgUrl) {
|
|
|
|
|
+ this.form.lockTypeIcon = null
|
|
|
},
|
|
},
|
|
|
- // 图标移除
|
|
|
|
|
- handleIconRemoved(fieldName) {
|
|
|
|
|
- this.form[fieldName] = null;
|
|
|
|
|
|
|
+ //图片上传成功
|
|
|
|
|
+ handleImgUplaoded1(imgUrl) {
|
|
|
|
|
+ console.log(imgUrl,'编辑拿到的图片')
|
|
|
|
|
+ this.form.lockTypeImg = imgUrl[0].url
|
|
|
},
|
|
},
|
|
|
- },
|
|
|
|
|
-};
|
|
|
|
|
|
|
+ //图片移除
|
|
|
|
|
+ handleImgRemoved1(imgUrl) {
|
|
|
|
|
+ this.form.lockTypeImg = null
|
|
|
|
|
+ },
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+}
|
|
|
</script>
|
|
</script>
|