|
@@ -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="workareaCode">
|
|
<el-form-item label="工作区域编码" prop="workareaCode">
|
|
|
<el-input
|
|
<el-input
|
|
|
v-model="queryParams.workareaCode"
|
|
v-model="queryParams.workareaCode"
|
|
@@ -19,7 +25,11 @@
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
|
|
|
|
|
<el-form-item label="状态" prop="status">
|
|
<el-form-item label="状态" prop="status">
|
|
|
- <el-select v-model="queryParams.status" placeholder="工作区域状态" clearable>
|
|
|
|
|
|
|
+ <el-select
|
|
|
|
|
+ v-model="queryParams.status"
|
|
|
|
|
+ placeholder="工作区域状态"
|
|
|
|
|
+ clearable
|
|
|
|
|
+ >
|
|
|
<el-option
|
|
<el-option
|
|
|
v-for="dict in dict.type.sys_normal_disable"
|
|
v-for="dict in dict.type.sys_normal_disable"
|
|
|
:key="dict.value"
|
|
:key="dict.value"
|
|
@@ -29,33 +39,51 @@
|
|
|
</el-select>
|
|
</el-select>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
<el-form-item>
|
|
<el-form-item>
|
|
|
- <el-button v-no-more-click type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
|
|
|
|
- <el-button v-no-more-click icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
|
|
|
|
|
|
+ <el-button
|
|
|
|
|
+ v-no-more-click
|
|
|
|
|
+ type="primary"
|
|
|
|
|
+ icon="el-icon-search"
|
|
|
|
|
+ size="mini"
|
|
|
|
|
+ @click="handleQuery"
|
|
|
|
|
+ >搜索</el-button
|
|
|
|
|
+ >
|
|
|
|
|
+ <el-button
|
|
|
|
|
+ v-no-more-click
|
|
|
|
|
+ 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">
|
|
|
<el-col :span="1.5">
|
|
<el-col :span="1.5">
|
|
|
- <el-button v-no-more-click
|
|
|
|
|
|
|
+ <el-button
|
|
|
|
|
+ v-no-more-click
|
|
|
type="primary"
|
|
type="primary"
|
|
|
plain
|
|
plain
|
|
|
icon="el-icon-plus"
|
|
icon="el-icon-plus"
|
|
|
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">
|
|
|
- <el-button v-no-more-click
|
|
|
|
|
|
|
+ <el-button
|
|
|
|
|
+ v-no-more-click
|
|
|
type="info"
|
|
type="info"
|
|
|
plain
|
|
plain
|
|
|
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
|
|
@@ -64,50 +92,81 @@
|
|
|
:data="deptList"
|
|
:data="deptList"
|
|
|
row-key="workareaId"
|
|
row-key="workareaId"
|
|
|
:default-expand-all="isExpandAll"
|
|
:default-expand-all="isExpandAll"
|
|
|
- :tree-props="{children: 'children', hasChildren: 'hasChildren'}"
|
|
|
|
|
|
|
+ :tree-props="{ children: 'children', hasChildren: 'hasChildren' }"
|
|
|
>
|
|
>
|
|
|
- <el-table-column prop="workareaCode" label="作业区域编码" width="260"></el-table-column>
|
|
|
|
|
- <el-table-column prop="workareaName" label="作业区域名称" width="260"></el-table-column>
|
|
|
|
|
- <el-table-column prop="orderNum" label="排序" width="200"></el-table-column>
|
|
|
|
|
|
|
+ <el-table-column
|
|
|
|
|
+ prop="workareaCode"
|
|
|
|
|
+ label="作业区域编码"
|
|
|
|
|
+ width="260"
|
|
|
|
|
+ ></el-table-column>
|
|
|
|
|
+ <el-table-column
|
|
|
|
|
+ prop="workareaName"
|
|
|
|
|
+ label="作业区域名称"
|
|
|
|
|
+ width="260"
|
|
|
|
|
+ ></el-table-column>
|
|
|
|
|
+ <el-table-column
|
|
|
|
|
+ prop="orderNum"
|
|
|
|
|
+ label="排序"
|
|
|
|
|
+ width="200"
|
|
|
|
|
+ ></el-table-column>
|
|
|
<el-table-column prop="status" label="状态" width="100">
|
|
<el-table-column prop="status" label="状态" width="100">
|
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
|
- <dict-tag :options="dict.type.sys_normal_disable" :value="scope.row.status"/>
|
|
|
|
|
|
|
+ <dict-tag
|
|
|
|
|
+ :options="dict.type.sys_normal_disable"
|
|
|
|
|
+ :value="scope.row.status"
|
|
|
|
|
+ />
|
|
|
</template>
|
|
</template>
|
|
|
</el-table-column>
|
|
</el-table-column>
|
|
|
- <el-table-column label="作业区域地图" align="center" prop="create" width="200">
|
|
|
|
|
|
|
+ <el-table-column
|
|
|
|
|
+ label="作业区域地图"
|
|
|
|
|
+ align="center"
|
|
|
|
|
+ prop="create"
|
|
|
|
|
+ width="200"
|
|
|
|
|
+ >
|
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
|
- <el-button v-no-more-click size="mini" type="text" @click="look(scope.row)"
|
|
|
|
|
- >预览
|
|
|
|
|
|
|
+ <el-button
|
|
|
|
|
+ v-no-more-click
|
|
|
|
|
+ size="mini"
|
|
|
|
|
+ type="text"
|
|
|
|
|
+ @click="look(scope.row)"
|
|
|
|
|
+ >预览
|
|
|
</el-button>
|
|
</el-button>
|
|
|
</template>
|
|
</template>
|
|
|
</el-table-column>
|
|
</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">
|
|
<template slot-scope="scope">
|
|
|
- <el-button v-no-more-click
|
|
|
|
|
|
|
+ <el-button
|
|
|
|
|
+ v-no-more-click
|
|
|
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:md:waa:edit']"
|
|
v-hasPermi="['mes:md:waa:edit']"
|
|
|
- >修改
|
|
|
|
|
|
|
+ >修改
|
|
|
</el-button>
|
|
</el-button>
|
|
|
- <el-button v-no-more-click
|
|
|
|
|
|
|
+ <el-button
|
|
|
|
|
+ v-no-more-click
|
|
|
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:md:waa:add']"
|
|
v-hasPermi="['mes:md:waa:add']"
|
|
|
- >新增
|
|
|
|
|
|
|
+ >新增
|
|
|
</el-button>
|
|
</el-button>
|
|
|
|
|
|
|
|
- <el-button v-no-more-click
|
|
|
|
|
|
|
+ <el-button
|
|
|
|
|
+ v-no-more-click
|
|
|
v-if="scope.row.parentId != 0"
|
|
v-if="scope.row.parentId != 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:md:waa:remove']"
|
|
v-hasPermi="['mes:md:waa:remove']"
|
|
|
- >删除
|
|
|
|
|
|
|
+ >删除
|
|
|
</el-button>
|
|
</el-button>
|
|
|
</template>
|
|
</template>
|
|
|
</el-table-column>
|
|
</el-table-column>
|
|
@@ -119,8 +178,12 @@
|
|
|
<el-row>
|
|
<el-row>
|
|
|
<el-col :span="18">
|
|
<el-col :span="18">
|
|
|
<el-form-item label="上级作业区域" prop="parentId">
|
|
<el-form-item label="上级作业区域" prop="parentId">
|
|
|
- <treeselect style="width: 318px" v-model="form.parentId" :options="deptOptions" :normalizer="normalizer"
|
|
|
|
|
- placeholder="选择上级作业区域"
|
|
|
|
|
|
|
+ <treeselect
|
|
|
|
|
+ style="width: 318px"
|
|
|
|
|
+ v-model="form.parentId"
|
|
|
|
|
+ :options="deptOptions"
|
|
|
|
|
+ :normalizer="normalizer"
|
|
|
|
|
+ placeholder="选择上级作业区域"
|
|
|
/>
|
|
/>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
</el-col>
|
|
</el-col>
|
|
@@ -139,7 +202,12 @@
|
|
|
<el-row>
|
|
<el-row>
|
|
|
<el-col :span="18">
|
|
<el-col :span="18">
|
|
|
<el-form-item label="显示排序" prop="orderNum">
|
|
<el-form-item label="显示排序" prop="orderNum">
|
|
|
- <el-input-number style="width: 318px" v-model="form.orderNum" controls-position="right" :min="0"/>
|
|
|
|
|
|
|
+ <el-input-number
|
|
|
|
|
+ style="width: 318px"
|
|
|
|
|
+ v-model="form.orderNum"
|
|
|
|
|
+ controls-position="right"
|
|
|
|
|
+ :min="0"
|
|
|
|
|
+ />
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
</el-col>
|
|
</el-col>
|
|
|
</el-row>
|
|
</el-row>
|
|
@@ -176,9 +244,13 @@
|
|
|
<el-row>
|
|
<el-row>
|
|
|
<el-col :span="18">
|
|
<el-col :span="18">
|
|
|
<el-form-item label="区域地图" prop="mapImg">
|
|
<el-form-item label="区域地图" prop="mapImg">
|
|
|
- <ImageUpload :limit="1" :value="form.mapImg" :fileSize="5" @onUploaded="handleImgUplaoded"
|
|
|
|
|
- @onRemoved="handleImgRemoved"
|
|
|
|
|
- ></ImageUpload>
|
|
|
|
|
|
|
+ <ImageUploadSingle
|
|
|
|
|
+ :limit="1"
|
|
|
|
|
+ :value="form.mapImg"
|
|
|
|
|
+ :fileSize="5"
|
|
|
|
|
+ @onUploaded="handleImgUplaoded"
|
|
|
|
|
+ @onRemoved="handleImgRemoved"
|
|
|
|
|
+ ></ImageUploadSingle>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
</el-col>
|
|
</el-col>
|
|
|
</el-row>
|
|
</el-row>
|
|
@@ -207,7 +279,9 @@
|
|
|
</el-row>
|
|
</el-row>
|
|
|
</el-form>
|
|
</el-form>
|
|
|
<div slot="footer" class="dialog-footer">
|
|
<div slot="footer" class="dialog-footer">
|
|
|
- <el-button v-no-more-click type="primary" @click="submitForm">确 定</el-button>
|
|
|
|
|
|
|
+ <el-button v-no-more-click type="primary" @click="submitForm"
|
|
|
|
|
+ >确 定</el-button
|
|
|
|
|
+ >
|
|
|
<el-button v-no-more-click @click="cancel">取 消</el-button>
|
|
<el-button v-no-more-click @click="cancel">取 消</el-button>
|
|
|
</div>
|
|
</div>
|
|
|
</el-dialog>
|
|
</el-dialog>
|
|
@@ -221,15 +295,15 @@ import {
|
|
|
addWorkarea,
|
|
addWorkarea,
|
|
|
updateWorkarea,
|
|
updateWorkarea,
|
|
|
delWorkarea,
|
|
delWorkarea,
|
|
|
- listAllWorkshop
|
|
|
|
|
-} from '@/api/mes/wa/workarea'
|
|
|
|
|
-import Treeselect from '@riophae/vue-treeselect'
|
|
|
|
|
-import '@riophae/vue-treeselect/dist/vue-treeselect.css'
|
|
|
|
|
-import { genCode } from '@/api/system/autocode/rule'
|
|
|
|
|
|
|
+ listAllWorkshop,
|
|
|
|
|
+} from "@/api/mes/wa/workarea";
|
|
|
|
|
+import Treeselect from "@riophae/vue-treeselect";
|
|
|
|
|
+import "@riophae/vue-treeselect/dist/vue-treeselect.css";
|
|
|
|
|
+import { genCode } from "@/api/system/autocode/rule";
|
|
|
|
|
|
|
|
export default {
|
|
export default {
|
|
|
- name: 'Dept',
|
|
|
|
|
- dicts: ['sys_normal_disable'],
|
|
|
|
|
|
|
+ name: "Dept",
|
|
|
|
|
+ dicts: ["sys_normal_disable"],
|
|
|
components: { Treeselect },
|
|
components: { Treeselect },
|
|
|
data() {
|
|
data() {
|
|
|
return {
|
|
return {
|
|
@@ -254,7 +328,7 @@ export default {
|
|
|
// 部门树选项
|
|
// 部门树选项
|
|
|
deptOptions: [],
|
|
deptOptions: [],
|
|
|
// 弹出层标题
|
|
// 弹出层标题
|
|
|
- title: '',
|
|
|
|
|
|
|
+ title: "",
|
|
|
// 是否显示弹出层
|
|
// 是否显示弹出层
|
|
|
open: false,
|
|
open: false,
|
|
|
// 是否展开,默认全部展开
|
|
// 是否展开,默认全部展开
|
|
@@ -267,14 +341,14 @@ export default {
|
|
|
size: -1,
|
|
size: -1,
|
|
|
workareaCode: null,
|
|
workareaCode: null,
|
|
|
workareaName: null,
|
|
workareaName: null,
|
|
|
- workareaType: null
|
|
|
|
|
|
|
+ workareaType: null,
|
|
|
},
|
|
},
|
|
|
// 总条数
|
|
// 总条数
|
|
|
total: 0,
|
|
total: 0,
|
|
|
// 表单参数
|
|
// 表单参数
|
|
|
form: {
|
|
form: {
|
|
|
- workshopId:0,
|
|
|
|
|
- parentId:0,
|
|
|
|
|
|
|
+ workshopId: 0,
|
|
|
|
|
+ parentId: 0,
|
|
|
},
|
|
},
|
|
|
WorkShopListOptions: null, //所属车间下拉数据
|
|
WorkShopListOptions: null, //所属车间下拉数据
|
|
|
EditId: null, //判断是否是编辑弹框的值
|
|
EditId: null, //判断是否是编辑弹框的值
|
|
@@ -284,49 +358,49 @@ export default {
|
|
|
// { required: true, message: '父级不能为空', trigger: 'blur' }
|
|
// { required: true, message: '父级不能为空', trigger: 'blur' }
|
|
|
// ],
|
|
// ],
|
|
|
orderNum: [
|
|
orderNum: [
|
|
|
- { required: true, message: '显示排序不能为空', trigger: 'blur' }
|
|
|
|
|
|
|
+ { required: true, message: "显示排序不能为空", trigger: "blur" },
|
|
|
],
|
|
],
|
|
|
workareaCode: [
|
|
workareaCode: [
|
|
|
- { required: true, message: '区域编号不能为空', trigger: 'blur' }
|
|
|
|
|
|
|
+ { required: true, message: "区域编号不能为空", trigger: "blur" },
|
|
|
],
|
|
],
|
|
|
workareaName: [
|
|
workareaName: [
|
|
|
- { required: true, message: '区域名称不能为空', trigger: 'blur' }
|
|
|
|
|
|
|
+ { required: true, message: "区域名称不能为空", trigger: "blur" },
|
|
|
],
|
|
],
|
|
|
workareaType: [
|
|
workareaType: [
|
|
|
- { required: true, message: '清选择区域类型', trigger: 'blur' }
|
|
|
|
|
- ]
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ { required: true, message: "清选择区域类型", trigger: "blur" },
|
|
|
|
|
+ ],
|
|
|
|
|
+ },
|
|
|
|
|
+ };
|
|
|
},
|
|
},
|
|
|
created() {
|
|
created() {
|
|
|
- this.getList()
|
|
|
|
|
|
|
+ this.getList();
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
|
/** 查询部门列表 */
|
|
/** 查询部门列表 */
|
|
|
getList() {
|
|
getList() {
|
|
|
- this.loading = true
|
|
|
|
|
- listWorkarea(this.queryParams).then(response => {
|
|
|
|
|
|
|
+ this.loading = true;
|
|
|
|
|
+ listWorkarea(this.queryParams).then((response) => {
|
|
|
debugger;
|
|
debugger;
|
|
|
- var depts = this.handleTree(response.data.records, 'workareaId')
|
|
|
|
|
- this.deptList = depts
|
|
|
|
|
- this.loading = false
|
|
|
|
|
- })
|
|
|
|
|
|
|
+ var depts = this.handleTree(response.data.records, "workareaId");
|
|
|
|
|
+ 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.workareaId,
|
|
id: node.workareaId,
|
|
|
label: node.workareaName,
|
|
label: node.workareaName,
|
|
|
- children: node.children
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ children: node.children,
|
|
|
|
|
+ };
|
|
|
},
|
|
},
|
|
|
// 取消按钮
|
|
// 取消按钮
|
|
|
cancel() {
|
|
cancel() {
|
|
|
- this.open = false
|
|
|
|
|
- this.reset()
|
|
|
|
|
|
|
+ this.open = false;
|
|
|
|
|
+ this.reset();
|
|
|
},
|
|
},
|
|
|
// 表单重置
|
|
// 表单重置
|
|
|
reset() {
|
|
reset() {
|
|
@@ -339,15 +413,15 @@ export default {
|
|
|
workareaId: null,
|
|
workareaId: null,
|
|
|
workareaName: null,
|
|
workareaName: null,
|
|
|
workareaType: null,
|
|
workareaType: null,
|
|
|
- workshopId: null
|
|
|
|
|
- }
|
|
|
|
|
- this.autoGenFlag = false
|
|
|
|
|
- this.resetForm('form')
|
|
|
|
|
|
|
+ workshopId: null,
|
|
|
|
|
+ };
|
|
|
|
|
+ this.autoGenFlag = false;
|
|
|
|
|
+ this.resetForm("form");
|
|
|
},
|
|
},
|
|
|
/** 搜索按钮操作 */
|
|
/** 搜索按钮操作 */
|
|
|
handleQuery() {
|
|
handleQuery() {
|
|
|
- this.queryParams.current = 1
|
|
|
|
|
- this.getList()
|
|
|
|
|
|
|
+ this.queryParams.current = 1;
|
|
|
|
|
+ this.getList();
|
|
|
},
|
|
},
|
|
|
/** 重置按钮操作 */
|
|
/** 重置按钮操作 */
|
|
|
resetQuery() {
|
|
resetQuery() {
|
|
@@ -356,99 +430,109 @@ export default {
|
|
|
size: -1,
|
|
size: -1,
|
|
|
workareaCode: null,
|
|
workareaCode: null,
|
|
|
workareaName: null,
|
|
workareaName: null,
|
|
|
- workareaType: null
|
|
|
|
|
- }
|
|
|
|
|
- this.resetForm('queryForm')
|
|
|
|
|
- this.handleQuery()
|
|
|
|
|
|
|
+ workareaType: null,
|
|
|
|
|
+ };
|
|
|
|
|
+ this.resetForm("queryForm");
|
|
|
|
|
+ this.handleQuery();
|
|
|
},
|
|
},
|
|
|
/** 新增按钮操作 */
|
|
/** 新增按钮操作 */
|
|
|
handleAdd(row) {
|
|
handleAdd(row) {
|
|
|
- this.reset()
|
|
|
|
|
|
|
+ this.reset();
|
|
|
if (row != undefined) {
|
|
if (row != undefined) {
|
|
|
- this.form.workshopId=0
|
|
|
|
|
|
|
+ this.form.workshopId = 0;
|
|
|
this.form.parentId = row.workareaId;
|
|
this.form.parentId = row.workareaId;
|
|
|
- }else{
|
|
|
|
|
- this.form.workshopId=0
|
|
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.form.workshopId = 0;
|
|
|
this.form.parentId = 0;
|
|
this.form.parentId = 0;
|
|
|
}
|
|
}
|
|
|
- this.open = true
|
|
|
|
|
- this.title = '添加工作区域'
|
|
|
|
|
- listWorkarea().then(response => {
|
|
|
|
|
- this.deptOptions = this.handleTree(response.data.records, 'workareaId', 'parentId', 'children')
|
|
|
|
|
- })
|
|
|
|
|
|
|
+ this.open = true;
|
|
|
|
|
+ this.title = "添加工作区域";
|
|
|
|
|
+ listWorkarea().then((response) => {
|
|
|
|
|
+ this.deptOptions = this.handleTree(
|
|
|
|
|
+ response.data.records,
|
|
|
|
|
+ "workareaId",
|
|
|
|
|
+ "parentId",
|
|
|
|
|
+ "children"
|
|
|
|
|
+ );
|
|
|
|
|
+ });
|
|
|
},
|
|
},
|
|
|
/** 展开/折叠操作 */
|
|
/** 展开/折叠操作 */
|
|
|
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.workareaId || this.ids
|
|
|
|
|
- getWorkareaInfo(row.workareaId).then(response => {
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
- this.form = response.data
|
|
|
|
|
- this.open = true
|
|
|
|
|
- this.title = '修改工作区域'
|
|
|
|
|
-
|
|
|
|
|
- })
|
|
|
|
|
- listWorkarea().then(response => {
|
|
|
|
|
- this.deptOptions = this.handleTree(response.data.records, 'workareaId', 'parentId', 'children')
|
|
|
|
|
- })
|
|
|
|
|
|
|
+ this.reset();
|
|
|
|
|
+ this.EditId = row.workareaId || this.ids;
|
|
|
|
|
+ getWorkareaInfo(row.workareaId).then((response) => {
|
|
|
|
|
+ this.form = response.data;
|
|
|
|
|
+ this.open = true;
|
|
|
|
|
+ this.title = "修改工作区域";
|
|
|
|
|
+ });
|
|
|
|
|
+ listWorkarea().then((response) => {
|
|
|
|
|
+ this.deptOptions = this.handleTree(
|
|
|
|
|
+ response.data.records,
|
|
|
|
|
+ "workareaId",
|
|
|
|
|
+ "parentId",
|
|
|
|
|
+ "children"
|
|
|
|
|
+ );
|
|
|
|
|
+ });
|
|
|
},
|
|
},
|
|
|
//图片上传成功
|
|
//图片上传成功
|
|
|
handleImgUplaoded(imgUrl) {
|
|
handleImgUplaoded(imgUrl) {
|
|
|
- console.log(imgUrl,'编辑拿到的图片')
|
|
|
|
|
- this.form.mapImg = imgUrl[0].url
|
|
|
|
|
|
|
+ console.log(imgUrl, "编辑拿到的图片");
|
|
|
|
|
+ this.form.mapImg = imgUrl[0].url;
|
|
|
},
|
|
},
|
|
|
//图片移除
|
|
//图片移除
|
|
|
handleImgRemoved(imgUrl) {
|
|
handleImgRemoved(imgUrl) {
|
|
|
- this.form.mapImg = null
|
|
|
|
|
|
|
+ this.form.mapImg = null;
|
|
|
},
|
|
},
|
|
|
/** 提交按钮 */
|
|
/** 提交按钮 */
|
|
|
- submitForm: function() {
|
|
|
|
|
- this.$refs['form'].validate(valid => {
|
|
|
|
|
|
|
+ submitForm: function () {
|
|
|
|
|
+ this.$refs["form"].validate((valid) => {
|
|
|
if (valid) {
|
|
if (valid) {
|
|
|
if (this.form.workareaId != undefined) {
|
|
if (this.form.workareaId != undefined) {
|
|
|
- updateWorkarea(this.form).then(response => {
|
|
|
|
|
- this.$modal.msgSuccess('修改成功')
|
|
|
|
|
- this.open = false
|
|
|
|
|
- this.getList()
|
|
|
|
|
- })
|
|
|
|
|
|
|
+ updateWorkarea(this.form).then((response) => {
|
|
|
|
|
+ this.$modal.msgSuccess("修改成功");
|
|
|
|
|
+ this.open = false;
|
|
|
|
|
+ this.getList();
|
|
|
|
|
+ });
|
|
|
} else {
|
|
} else {
|
|
|
- console.log(this.form,'新增工作区域参数')
|
|
|
|
|
- addWorkarea(this.form).then(response => {
|
|
|
|
|
- this.$modal.msgSuccess('新增成功')
|
|
|
|
|
- this.open = false
|
|
|
|
|
- this.getList()
|
|
|
|
|
- })
|
|
|
|
|
|
|
+ console.log(this.form, "新增工作区域参数");
|
|
|
|
|
+ addWorkarea(this.form).then((response) => {
|
|
|
|
|
+ this.$modal.msgSuccess("新增成功");
|
|
|
|
|
+ this.open = false;
|
|
|
|
|
+ this.getList();
|
|
|
|
|
+ });
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- })
|
|
|
|
|
|
|
+ });
|
|
|
},
|
|
},
|
|
|
/** 删除按钮操作 */
|
|
/** 删除按钮操作 */
|
|
|
handleDelete(row) {
|
|
handleDelete(row) {
|
|
|
- this.$modal.confirm('是否确认删除名称为"' + row.workareaCode + '"的数据项?').then(function() {
|
|
|
|
|
- return delWorkarea(row.workareaId)
|
|
|
|
|
- }).then(() => {
|
|
|
|
|
- this.getList()
|
|
|
|
|
- this.$modal.msgSuccess('删除成功')
|
|
|
|
|
- }).catch(() => {
|
|
|
|
|
- })
|
|
|
|
|
|
|
+ this.$modal
|
|
|
|
|
+ .confirm('是否确认删除名称为"' + row.workareaCode + '"的数据项?')
|
|
|
|
|
+ .then(function () {
|
|
|
|
|
+ return delWorkarea(row.workareaId);
|
|
|
|
|
+ })
|
|
|
|
|
+ .then(() => {
|
|
|
|
|
+ this.getList();
|
|
|
|
|
+ this.$modal.msgSuccess("删除成功");
|
|
|
|
|
+ })
|
|
|
|
|
+ .catch(() => {});
|
|
|
},
|
|
},
|
|
|
//自动生成编码
|
|
//自动生成编码
|
|
|
handleAutoGenChange(autoGenFlag) {
|
|
handleAutoGenChange(autoGenFlag) {
|
|
|
if (autoGenFlag) {
|
|
if (autoGenFlag) {
|
|
|
- genCode('WORKAREA_CODE').then((response) => {
|
|
|
|
|
- this.form.workareaCode = response
|
|
|
|
|
- })
|
|
|
|
|
|
|
+ genCode("WORKAREA_CODE").then((response) => {
|
|
|
|
|
+ this.form.workareaCode = response;
|
|
|
|
|
+ });
|
|
|
} else {
|
|
} else {
|
|
|
- this.form.workareaCode = null
|
|
|
|
|
|
|
+ this.form.workareaCode = null;
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
// 地图预览
|
|
// 地图预览
|
|
@@ -458,8 +542,6 @@ export default {
|
|
|
this.$router.push(`/mes/md/workarea/index/MapData?workareaId=${data}`);
|
|
this.$router.push(`/mes/md/workarea/index/MapData?workareaId=${data}`);
|
|
|
// this.dialogVisibleMap = true; // 显示地图预览弹框
|
|
// this.dialogVisibleMap = true; // 显示地图预览弹框
|
|
|
},
|
|
},
|
|
|
-
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
-}
|
|
|
|
|
|
|
+ },
|
|
|
|
|
+};
|
|
|
</script>
|
|
</script>
|