|
@@ -1,6 +1,12 @@
|
|
|
<template>
|
|
<template>
|
|
|
<div class="app-container">
|
|
<div class="app-container">
|
|
|
- <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch">
|
|
|
|
|
|
|
+ <el-form
|
|
|
|
|
+ :model="queryParams"
|
|
|
|
|
+ ref="queryForm"
|
|
|
|
|
+ size="small"
|
|
|
|
|
+ :inline="true"
|
|
|
|
|
+ v-show="showSearch"
|
|
|
|
|
+ >
|
|
|
<el-form-item label="挂锁类型编码" prop="lockTypeCode">
|
|
<el-form-item label="挂锁类型编码" prop="lockTypeCode">
|
|
|
<el-input
|
|
<el-input
|
|
|
v-model="queryParams.lockTypeCode"
|
|
v-model="queryParams.lockTypeCode"
|
|
@@ -18,10 +24,17 @@
|
|
|
/>
|
|
/>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
|
|
|
|
|
-
|
|
|
|
|
<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-item>
|
|
|
</el-form>
|
|
</el-form>
|
|
|
<el-row :gutter="10" class="mb8">
|
|
<el-row :gutter="10" class="mb8">
|
|
@@ -33,7 +46,7 @@
|
|
|
size="mini"
|
|
size="mini"
|
|
|
@click="handleAdd"
|
|
@click="handleAdd"
|
|
|
v-hasPermi="['system:dept:add']"
|
|
v-hasPermi="['system:dept:add']"
|
|
|
- >新增
|
|
|
|
|
|
|
+ >新增
|
|
|
</el-button>
|
|
</el-button>
|
|
|
</el-col>
|
|
</el-col>
|
|
|
<el-col :span="1.5">
|
|
<el-col :span="1.5">
|
|
@@ -43,10 +56,13 @@
|
|
|
icon="el-icon-sort"
|
|
icon="el-icon-sort"
|
|
|
size="mini"
|
|
size="mini"
|
|
|
@click="toggleExpandAll"
|
|
@click="toggleExpandAll"
|
|
|
- >展开/折叠
|
|
|
|
|
|
|
+ >展开/折叠
|
|
|
</el-button>
|
|
</el-button>
|
|
|
</el-col>
|
|
</el-col>
|
|
|
- <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
|
|
|
|
|
|
+ <right-toolbar
|
|
|
|
|
+ :showSearch.sync="showSearch"
|
|
|
|
|
+ @queryTable="getList"
|
|
|
|
|
+ ></right-toolbar>
|
|
|
</el-row>
|
|
</el-row>
|
|
|
|
|
|
|
|
<el-table
|
|
<el-table
|
|
@@ -55,24 +71,50 @@
|
|
|
:data="deptList"
|
|
:data="deptList"
|
|
|
row-key="lockTypeId"
|
|
row-key="lockTypeId"
|
|
|
:default-expand-all="isExpandAll"
|
|
:default-expand-all="isExpandAll"
|
|
|
- :tree-props="{children: 'children', hasChildren: 'hasChildren'}"
|
|
|
|
|
|
|
+ :tree-props="{ children: 'children', hasChildren: 'hasChildren' }"
|
|
|
>
|
|
>
|
|
|
- <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="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">
|
|
<el-table-column prop="lockTypeIcon" label="挂锁类型图标" width="260">
|
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
|
- <img style="width: 50px;height:50px" :src="scope.row.lockTypeIcon" alt="" v-if="scope.row.lockTypeIcon">
|
|
|
|
|
|
|
+ <img
|
|
|
|
|
+ style="width: 50px; height: 50px"
|
|
|
|
|
+ :src="scope.row.lockTypeIcon"
|
|
|
|
|
+ alt=""
|
|
|
|
|
+ v-if="scope.row.lockTypeIcon"
|
|
|
|
|
+ />
|
|
|
<span v-else>-</span>
|
|
<span v-else>-</span>
|
|
|
</template>
|
|
</template>
|
|
|
</el-table-column>
|
|
</el-table-column>
|
|
|
<el-table-column prop="lockTypeImg" label="挂锁类型图片" width="260">
|
|
<el-table-column prop="lockTypeImg" label="挂锁类型图片" width="260">
|
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
|
- <img style="width: 50px;height:50px" :src="scope.row.lockTypeImg" alt="" v-if="scope.row.lockTypeImg">
|
|
|
|
|
|
|
+ <img
|
|
|
|
|
+ style="width: 50px; height: 50px"
|
|
|
|
|
+ :src="scope.row.lockTypeImg"
|
|
|
|
|
+ alt=""
|
|
|
|
|
+ v-if="scope.row.lockTypeImg"
|
|
|
|
|
+ />
|
|
|
<span v-else>-</span>
|
|
<span v-else>-</span>
|
|
|
</template>
|
|
</template>
|
|
|
</el-table-column>
|
|
</el-table-column>
|
|
|
- <el-table-column prop="lockTypeDescription" label="挂锁类型描述" width="260"></el-table-column>
|
|
|
|
|
- <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"
|
|
@@ -80,7 +122,7 @@
|
|
|
icon="el-icon-edit"
|
|
icon="el-icon-edit"
|
|
|
@click="handleUpdate(scope.row)"
|
|
@click="handleUpdate(scope.row)"
|
|
|
v-hasPermi="['mes:md:waa:edit']"
|
|
v-hasPermi="['mes:md:waa:edit']"
|
|
|
- >修改
|
|
|
|
|
|
|
+ >修改
|
|
|
</el-button>
|
|
</el-button>
|
|
|
<el-button
|
|
<el-button
|
|
|
size="mini"
|
|
size="mini"
|
|
@@ -88,7 +130,7 @@
|
|
|
icon="el-icon-plus"
|
|
icon="el-icon-plus"
|
|
|
@click="handleAdd(scope.row)"
|
|
@click="handleAdd(scope.row)"
|
|
|
v-hasPermi="['mes:md:waa:add']"
|
|
v-hasPermi="['mes:md:waa:add']"
|
|
|
- >新增
|
|
|
|
|
|
|
+ >新增
|
|
|
</el-button>
|
|
</el-button>
|
|
|
|
|
|
|
|
<el-button
|
|
<el-button
|
|
@@ -98,20 +140,24 @@
|
|
|
icon="el-icon-delete"
|
|
icon="el-icon-delete"
|
|
|
@click="handleDelete(scope.row)"
|
|
@click="handleDelete(scope.row)"
|
|
|
v-hasPermi="['mes:md:waa:remove']"
|
|
v-hasPermi="['mes:md:waa:remove']"
|
|
|
- >删除
|
|
|
|
|
|
|
+ >删除
|
|
|
</el-button>
|
|
</el-button>
|
|
|
</template>
|
|
</template>
|
|
|
</el-table-column>
|
|
</el-table-column>
|
|
|
</el-table>
|
|
</el-table>
|
|
|
|
|
|
|
|
- <!-- 添加或修改部门对话框 -->
|
|
|
|
|
|
|
+ <!-- 添加或修改锁具类型对话框 -->
|
|
|
<el-dialog :title="title" :visible.sync="open" width="600px" 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="18">
|
|
<el-col :span="18">
|
|
|
<el-form-item label="父级" prop="parentTypeId">
|
|
<el-form-item label="父级" prop="parentTypeId">
|
|
|
- <treeselect style="width: 318px" v-model="form.parentTypeId" :options="deptOptions" :normalizer="normalizer"
|
|
|
|
|
- placeholder="选择父级"
|
|
|
|
|
|
|
+ <treeselect
|
|
|
|
|
+ style="width: 318px"
|
|
|
|
|
+ v-model="form.parentTypeId"
|
|
|
|
|
+ :options="deptOptions"
|
|
|
|
|
+ :normalizer="normalizer"
|
|
|
|
|
+ placeholder="选择父级"
|
|
|
/>
|
|
/>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
</el-col>
|
|
</el-col>
|
|
@@ -171,16 +217,23 @@
|
|
|
</el-col>
|
|
</el-col>
|
|
|
</el-row>
|
|
</el-row>
|
|
|
<el-form-item label="挂锁类型图标" prop="lockTypeIcon">
|
|
<el-form-item label="挂锁类型图标" prop="lockTypeIcon">
|
|
|
- <ImageUpload :limit="1" :value="form.lockTypeIcon" :fileSize="5" @onUploaded="handleImgUplaoded"
|
|
|
|
|
- @onRemoved="handleImgRemoved"
|
|
|
|
|
|
|
+ <ImageUpload
|
|
|
|
|
+ :limit="1"
|
|
|
|
|
+ :value="form.lockTypeIcon"
|
|
|
|
|
+ :fileSize="5"
|
|
|
|
|
+ @onUploaded="handleImgUplaoded"
|
|
|
|
|
+ @onRemoved="handleImgRemoved"
|
|
|
></ImageUpload>
|
|
></ImageUpload>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
<el-form-item label="挂锁类型图片" prop="lockTypeImg">
|
|
<el-form-item label="挂锁类型图片" prop="lockTypeImg">
|
|
|
- <ImageUpload :limit="1" :value="form.lockTypeImg" :fileSize="5" @onUploaded="handleImgUplaoded1"
|
|
|
|
|
- @onRemoved="handleImgRemoved1"
|
|
|
|
|
|
|
+ <ImageUpload
|
|
|
|
|
+ :limit="1"
|
|
|
|
|
+ :value="form.lockTypeImg"
|
|
|
|
|
+ :fileSize="5"
|
|
|
|
|
+ @onUploaded="handleImgUplaoded1"
|
|
|
|
|
+ @onRemoved="handleImgRemoved1"
|
|
|
></ImageUpload>
|
|
></ImageUpload>
|
|
|
</el-form-item>
|
|
</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>
|
|
@@ -191,15 +244,21 @@
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
<script>
|
|
|
-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'
|
|
|
|
|
|
|
+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: 'Dept',
|
|
|
|
|
- dicts: ['sys_normal_disable'],
|
|
|
|
|
|
|
+ name: "Dept",
|
|
|
|
|
+ dicts: ["sys_normal_disable"],
|
|
|
components: { Treeselect },
|
|
components: { Treeselect },
|
|
|
data() {
|
|
data() {
|
|
|
return {
|
|
return {
|
|
@@ -224,7 +283,7 @@ export default {
|
|
|
// 部门树选项
|
|
// 部门树选项
|
|
|
deptOptions: [],
|
|
deptOptions: [],
|
|
|
// 弹出层标题
|
|
// 弹出层标题
|
|
|
- title: '',
|
|
|
|
|
|
|
+ title: "",
|
|
|
// 是否显示弹出层
|
|
// 是否显示弹出层
|
|
|
open: false,
|
|
open: false,
|
|
|
// 是否展开,默认全部展开
|
|
// 是否展开,默认全部展开
|
|
@@ -237,15 +296,15 @@ export default {
|
|
|
size: -1,
|
|
size: -1,
|
|
|
lockTypeCode: null,
|
|
lockTypeCode: null,
|
|
|
lockTypeName: null,
|
|
lockTypeName: null,
|
|
|
- lockTypeId: null
|
|
|
|
|
|
|
+ lockTypeId: null,
|
|
|
},
|
|
},
|
|
|
// 总条数
|
|
// 总条数
|
|
|
total: 0,
|
|
total: 0,
|
|
|
// 表单参数
|
|
// 表单参数
|
|
|
form: {
|
|
form: {
|
|
|
- parentTypeId:0,
|
|
|
|
|
|
|
+ parentTypeId: 0,
|
|
|
},
|
|
},
|
|
|
- machinerytypeOptions:[],//硬件类型
|
|
|
|
|
|
|
+ machinerytypeOptions: [], //硬件类型
|
|
|
EditId: null, //判断是否是编辑弹框的值
|
|
EditId: null, //判断是否是编辑弹框的值
|
|
|
// 表单校验
|
|
// 表单校验
|
|
|
rules: {
|
|
rules: {
|
|
@@ -254,40 +313,44 @@ export default {
|
|
|
// ],
|
|
// ],
|
|
|
|
|
|
|
|
lockTypeCode: [
|
|
lockTypeCode: [
|
|
|
- { required: true, message: '挂锁类型编号不能为空', trigger: 'blur' }
|
|
|
|
|
|
|
+ { required: true, message: "挂锁类型编号不能为空", trigger: "blur" },
|
|
|
],
|
|
],
|
|
|
lockTypeName: [
|
|
lockTypeName: [
|
|
|
- { required: true, message: '挂锁类型名称不能为空', trigger: 'blur' }
|
|
|
|
|
|
|
+ { required: true, message: "挂锁类型名称不能为空", trigger: "blur" },
|
|
|
],
|
|
],
|
|
|
-
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ },
|
|
|
|
|
+ };
|
|
|
},
|
|
},
|
|
|
created() {
|
|
created() {
|
|
|
- this.getList()
|
|
|
|
|
- this.getTreeselect()
|
|
|
|
|
|
|
+ this.getList();
|
|
|
|
|
+ this.getTreeselect();
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
|
/** 查询部门列表 */
|
|
/** 查询部门列表 */
|
|
|
getList() {
|
|
getList() {
|
|
|
- this.loading = true
|
|
|
|
|
- listPadLockTypeAPI(this.queryParams).then(response => {
|
|
|
|
|
|
|
+ this.loading = true;
|
|
|
|
|
+ listPadLockTypeAPI(this.queryParams).then((response) => {
|
|
|
debugger;
|
|
debugger;
|
|
|
- var depts = this.handleTree(response.data.records, 'lockTypeId', 'parentTypeId', 'children')
|
|
|
|
|
- this.deptList = depts
|
|
|
|
|
- this.loading = false
|
|
|
|
|
- })
|
|
|
|
|
|
|
+ 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.lockTypeId,
|
|
id: node.lockTypeId,
|
|
|
label: node.lockTypeName,
|
|
label: node.lockTypeName,
|
|
|
- children: node.children
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ children: node.children,
|
|
|
|
|
+ };
|
|
|
},
|
|
},
|
|
|
/** 查询挂锁类型下拉树结构 */
|
|
/** 查询挂锁类型下拉树结构 */
|
|
|
getTreeselect() {
|
|
getTreeselect() {
|
|
@@ -316,27 +379,27 @@ export default {
|
|
|
},
|
|
},
|
|
|
// 取消按钮
|
|
// 取消按钮
|
|
|
cancel() {
|
|
cancel() {
|
|
|
- this.open = false
|
|
|
|
|
- this.reset()
|
|
|
|
|
|
|
+ this.open = false;
|
|
|
|
|
+ this.reset();
|
|
|
},
|
|
},
|
|
|
// 表单重置
|
|
// 表单重置
|
|
|
reset() {
|
|
reset() {
|
|
|
this.form = {
|
|
this.form = {
|
|
|
parentTypeId: undefined,
|
|
parentTypeId: undefined,
|
|
|
- lockTypeId:undefined,
|
|
|
|
|
- lockTypeName:undefined,
|
|
|
|
|
- lockTypeIcon:undefined,
|
|
|
|
|
- lockTypeImg:undefined,
|
|
|
|
|
- lockTypeDescription:undefined,
|
|
|
|
|
- lockTypeCode:undefined,
|
|
|
|
|
- }
|
|
|
|
|
- this.autoGenFlag = false
|
|
|
|
|
- this.resetForm('form')
|
|
|
|
|
|
|
+ lockTypeId: undefined,
|
|
|
|
|
+ lockTypeName: undefined,
|
|
|
|
|
+ lockTypeIcon: undefined,
|
|
|
|
|
+ lockTypeImg: undefined,
|
|
|
|
|
+ lockTypeDescription: undefined,
|
|
|
|
|
+ lockTypeCode: undefined,
|
|
|
|
|
+ };
|
|
|
|
|
+ this.autoGenFlag = false;
|
|
|
|
|
+ this.resetForm("form");
|
|
|
},
|
|
},
|
|
|
/** 搜索按钮操作 */
|
|
/** 搜索按钮操作 */
|
|
|
handleQuery() {
|
|
handleQuery() {
|
|
|
- this.queryParams.current = 1
|
|
|
|
|
- this.getList()
|
|
|
|
|
|
|
+ this.queryParams.current = 1;
|
|
|
|
|
+ this.getList();
|
|
|
},
|
|
},
|
|
|
/** 重置按钮操作 */
|
|
/** 重置按钮操作 */
|
|
|
resetQuery() {
|
|
resetQuery() {
|
|
@@ -345,109 +408,120 @@ export default {
|
|
|
size: -1,
|
|
size: -1,
|
|
|
lockTypeCode: null,
|
|
lockTypeCode: null,
|
|
|
lockTypeName: null,
|
|
lockTypeName: null,
|
|
|
- lockTypeId: null
|
|
|
|
|
- }
|
|
|
|
|
- this.resetForm('queryForm')
|
|
|
|
|
- this.handleQuery()
|
|
|
|
|
|
|
+ lockTypeId: null,
|
|
|
|
|
+ };
|
|
|
|
|
+ this.resetForm("queryForm");
|
|
|
|
|
+ this.handleQuery();
|
|
|
},
|
|
},
|
|
|
/** 新增按钮操作 */
|
|
/** 新增按钮操作 */
|
|
|
handleAdd(row) {
|
|
handleAdd(row) {
|
|
|
- this.reset()
|
|
|
|
|
|
|
+ this.reset();
|
|
|
if (row != undefined) {
|
|
if (row != undefined) {
|
|
|
this.form.parentTypeId = row.lockTypeId;
|
|
this.form.parentTypeId = row.lockTypeId;
|
|
|
- }else{
|
|
|
|
|
|
|
+ } else {
|
|
|
this.form.parentTypeId = 0;
|
|
this.form.parentTypeId = 0;
|
|
|
}
|
|
}
|
|
|
- this.open = true
|
|
|
|
|
- this.title = '添加工作区域'
|
|
|
|
|
- listPadLockTypeAPI().then(response => {
|
|
|
|
|
- this.deptOptions = this.handleTree(response.data.records, 'lockTypeId', 'parentTypeId', 'children')
|
|
|
|
|
- console.log(this.deptOptions,'this.deptOptions')
|
|
|
|
|
- })
|
|
|
|
|
|
|
+ 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() {
|
|
toggleExpandAll() {
|
|
|
- this.refreshTable = false
|
|
|
|
|
- this.isExpandAll = !this.isExpandAll
|
|
|
|
|
|
|
+ this.refreshTable = false;
|
|
|
|
|
+ this.isExpandAll = !this.isExpandAll;
|
|
|
this.$nextTick(() => {
|
|
this.$nextTick(() => {
|
|
|
- this.refreshTable = true
|
|
|
|
|
- })
|
|
|
|
|
|
|
+ this.refreshTable = true;
|
|
|
|
|
+ });
|
|
|
},
|
|
},
|
|
|
/** 修改按钮操作 */
|
|
/** 修改按钮操作 */
|
|
|
handleUpdate(row) {
|
|
handleUpdate(row) {
|
|
|
- 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')
|
|
|
|
|
- })
|
|
|
|
|
|
|
+ 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: function() {
|
|
|
|
|
- this.$refs['form'].validate(valid => {
|
|
|
|
|
|
|
+ submitForm: function () {
|
|
|
|
|
+ this.$refs["form"].validate((valid) => {
|
|
|
if (valid) {
|
|
if (valid) {
|
|
|
if (this.form.lockTypeId != undefined) {
|
|
if (this.form.lockTypeId != undefined) {
|
|
|
- updatePadLockTypeAPI(this.form).then(response => {
|
|
|
|
|
- this.$modal.msgSuccess('修改成功')
|
|
|
|
|
- this.open = false
|
|
|
|
|
- this.getList()
|
|
|
|
|
- })
|
|
|
|
|
|
|
+ updatePadLockTypeAPI(this.form).then((response) => {
|
|
|
|
|
+ this.$modal.msgSuccess("修改成功");
|
|
|
|
|
+ this.open = false;
|
|
|
|
|
+ this.getList();
|
|
|
|
|
+ });
|
|
|
} else {
|
|
} else {
|
|
|
- console.log(this.form,'新增工作区域参数')
|
|
|
|
|
- addPadLockTypeAPI(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) {
|
|
handleDelete(row) {
|
|
|
- this.$modal.confirm('是否确认删除名称为"' + row.lockTypeCode + '"的数据项?').then(function() {
|
|
|
|
|
- return delPadLockTypeAPI(row.lockTypeId)
|
|
|
|
|
- }).then(() => {
|
|
|
|
|
- this.getList()
|
|
|
|
|
- this.$modal.msgSuccess('删除成功')
|
|
|
|
|
- }).catch(() => {
|
|
|
|
|
- })
|
|
|
|
|
|
|
+ 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('PAD_LOCK_TYPE_CODE').then((response) => {
|
|
|
|
|
- this.form.lockTypeCode = response
|
|
|
|
|
- })
|
|
|
|
|
|
|
+ genCode("PAD_LOCK_TYPE_CODE").then((response) => {
|
|
|
|
|
+ this.form.lockTypeCode = response;
|
|
|
|
|
+ });
|
|
|
} else {
|
|
} else {
|
|
|
- this.form.lockTypeCode = null
|
|
|
|
|
|
|
+ this.form.lockTypeCode = null;
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
//图片上传成功
|
|
//图片上传成功
|
|
|
handleImgUplaoded(imgUrl) {
|
|
handleImgUplaoded(imgUrl) {
|
|
|
- console.log(imgUrl,'编辑拿到的图片')
|
|
|
|
|
- this.form.lockTypeIcon = imgUrl[0].url
|
|
|
|
|
|
|
+ console.log(imgUrl, "编辑拿到的图片");
|
|
|
|
|
+ this.form.lockTypeIcon = imgUrl[0].url;
|
|
|
},
|
|
},
|
|
|
//图片移除
|
|
//图片移除
|
|
|
handleImgRemoved(imgUrl) {
|
|
handleImgRemoved(imgUrl) {
|
|
|
- this.form.lockTypeIcon = null
|
|
|
|
|
|
|
+ this.form.lockTypeIcon = null;
|
|
|
},
|
|
},
|
|
|
//图片上传成功
|
|
//图片上传成功
|
|
|
handleImgUplaoded1(imgUrl) {
|
|
handleImgUplaoded1(imgUrl) {
|
|
|
- console.log(imgUrl,'编辑拿到的图片')
|
|
|
|
|
- this.form.lockTypeImg = imgUrl[0].url
|
|
|
|
|
|
|
+ console.log(imgUrl, "编辑拿到的图片");
|
|
|
|
|
+ this.form.lockTypeImg = imgUrl[0].url;
|
|
|
},
|
|
},
|
|
|
//图片移除
|
|
//图片移除
|
|
|
handleImgRemoved1(imgUrl) {
|
|
handleImgRemoved1(imgUrl) {
|
|
|
- this.form.lockTypeImg = null
|
|
|
|
|
|
|
+ this.form.lockTypeImg = null;
|
|
|
},
|
|
},
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
-}
|
|
|
|
|
|
|
+ },
|
|
|
|
|
+};
|
|
|
</script>
|
|
</script>
|