|
@@ -1,13 +1,6 @@
|
|
|
<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 :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,33 +12,27 @@
|
|
|
<el-form-item label="工作区域名称" prop="workareaName">
|
|
<el-form-item label="工作区域名称" prop="workareaName">
|
|
|
<el-input
|
|
<el-input
|
|
|
v-model="queryParams.workareaName"
|
|
v-model="queryParams.workareaName"
|
|
|
- placeholder="请输入隔离点名称"
|
|
|
|
|
|
|
+ placeholder="请输入工作区域名称"
|
|
|
clearable
|
|
clearable
|
|
|
@keyup.enter.native="handleQuery"
|
|
@keyup.enter.native="handleQuery"
|
|
|
/>
|
|
/>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
- <el-form-item label="工作区域类型" prop="workareaType">
|
|
|
|
|
- <el-input
|
|
|
|
|
- v-model="queryParams.workareaType"
|
|
|
|
|
- placeholder="请输入工作区域类型"
|
|
|
|
|
- clearable
|
|
|
|
|
- @keyup.enter.native="handleQuery"
|
|
|
|
|
- />
|
|
|
|
|
|
|
+
|
|
|
|
|
+ <el-form-item label="状态" prop="status">
|
|
|
|
|
+ <el-select v-model="queryParams.status" placeholder="工作区域状态" clearable>
|
|
|
|
|
+ <el-option
|
|
|
|
|
+ v-for="dict in dict.type.sys_normal_disable"
|
|
|
|
|
+ :key="dict.value"
|
|
|
|
|
+ :label="dict.label"
|
|
|
|
|
+ :value="dict.value"
|
|
|
|
|
+ />
|
|
|
|
|
+ </el-select>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
<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">
|
|
|
<el-col :span="1.5">
|
|
<el-col :span="1.5">
|
|
|
<el-button
|
|
<el-button
|
|
@@ -54,110 +41,47 @@
|
|
|
icon="el-icon-plus"
|
|
icon="el-icon-plus"
|
|
|
size="mini"
|
|
size="mini"
|
|
|
@click="handleAdd"
|
|
@click="handleAdd"
|
|
|
- v-hasPermi="['mes:md:waa:add']"
|
|
|
|
|
- >新增
|
|
|
|
|
|
|
+ v-hasPermi="['system:dept:add']"
|
|
|
|
|
+ >新增
|
|
|
</el-button>
|
|
</el-button>
|
|
|
</el-col>
|
|
</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-col :span="1.5">
|
|
|
<el-button
|
|
<el-button
|
|
|
- type="danger"
|
|
|
|
|
|
|
+ type="info"
|
|
|
plain
|
|
plain
|
|
|
- icon="el-icon-delete"
|
|
|
|
|
|
|
+ icon="el-icon-sort"
|
|
|
size="mini"
|
|
size="mini"
|
|
|
- :disabled="multiple"
|
|
|
|
|
- @click="handleDelete"
|
|
|
|
|
- v-hasPermi="['mes:md:waa:batchremove']"
|
|
|
|
|
- >批量删除
|
|
|
|
|
|
|
+ @click="toggleExpandAll"
|
|
|
|
|
+ >展开/折叠
|
|
|
</el-button>
|
|
</el-button>
|
|
|
</el-col>
|
|
</el-col>
|
|
|
- <!-- <el-col :span="1.5">-->
|
|
|
|
|
- <!-- <el-button-->
|
|
|
|
|
- <!-- type="warning"-->
|
|
|
|
|
- <!-- plain-->
|
|
|
|
|
- <!-- icon="el-icon-download"-->
|
|
|
|
|
- <!-- size="mini"-->
|
|
|
|
|
- <!-- @click="handleExport"-->
|
|
|
|
|
- <!-- 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-row>
|
|
|
|
|
|
|
|
<el-table
|
|
<el-table
|
|
|
|
|
+ v-if="refreshTable"
|
|
|
v-loading="loading"
|
|
v-loading="loading"
|
|
|
- :data="workareaList"
|
|
|
|
|
- @selection-change="handleSelectionChange"
|
|
|
|
|
|
|
+ :data="deptList"
|
|
|
|
|
+ row-key="workareaId"
|
|
|
|
|
+ :default-expand-all="isExpandAll"
|
|
|
|
|
+ :tree-props="{children: 'children', hasChildren: 'hasChildren'}"
|
|
|
>
|
|
>
|
|
|
- <el-table-column type="selection" width="55" align="center" />
|
|
|
|
|
- <!-- <el-table-column label="工作区域Id" align="center" prop="workareaId">
|
|
|
|
|
|
|
+ <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">
|
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
|
- <el-button
|
|
|
|
|
- type="text"
|
|
|
|
|
- @click="handleView(scope.row)"
|
|
|
|
|
- v-hasPermi="['mes:md:waa:query']"
|
|
|
|
|
- >{{ scope.row.workareaId }}
|
|
|
|
|
- </el-button>
|
|
|
|
|
- </template>
|
|
|
|
|
- </el-table-column> -->
|
|
|
|
|
- <el-table-column label="工作区域编码" align="center" prop="workareaCode">
|
|
|
|
|
- <template slot-scope="scope">
|
|
|
|
|
- <el-button
|
|
|
|
|
- type="text"
|
|
|
|
|
- @click="handleView(scope.row)"
|
|
|
|
|
- v-hasPermi="['mes:md:waa:query']"
|
|
|
|
|
- >{{ scope.row.workareaCode }}
|
|
|
|
|
- </el-button>
|
|
|
|
|
|
|
+ <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="workareaName"
|
|
|
|
|
- />
|
|
|
|
|
- <el-table-column
|
|
|
|
|
- label="工作区域类型"
|
|
|
|
|
- align="center"
|
|
|
|
|
- prop="workareaType"
|
|
|
|
|
- />
|
|
|
|
|
- <el-table-column label="所属车间" align="center" prop="workshopName" />
|
|
|
|
|
-
|
|
|
|
|
- <!-- <el-table-column label="状态" align="center" prop="calendarType">-->
|
|
|
|
|
- <!-- <template slot-scope="scope">-->
|
|
|
|
|
- <!-- <dict-tag :options="dict.type.mes_calendar_type" :value="scope.row.calendarType"/>-->
|
|
|
|
|
- <!-- </template>-->
|
|
|
|
|
- <!-- </el-table-column>-->
|
|
|
|
|
- <el-table-column label="地图" align="center" prop="map">
|
|
|
|
|
- <!-- <template slot-scope="scope">
|
|
|
|
|
- {{ scope.row.map }}
|
|
|
|
|
- </template> -->
|
|
|
|
|
|
|
+ <el-table-column label="作业区域地图" align="center" prop="create" width="200">
|
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
|
<el-button size="mini" type="text" @click="look(scope.row)"
|
|
<el-button 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" prop="remark">-->
|
|
|
|
|
- <!-- </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
|
|
<el-button
|
|
|
size="mini"
|
|
size="mini"
|
|
@@ -165,101 +89,125 @@
|
|
|
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"
|
|
|
|
|
+ type="text"
|
|
|
|
|
+ icon="el-icon-plus"
|
|
|
|
|
+ @click="handleAdd(scope.row)"
|
|
|
|
|
+ v-hasPermi="['mes:md:waa:add']"
|
|
|
|
|
+ >新增
|
|
|
|
|
+ </el-button>
|
|
|
|
|
+
|
|
|
|
|
+ <el-button
|
|
|
|
|
+ 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>
|
|
|
</el-table>
|
|
</el-table>
|
|
|
|
|
|
|
|
- <pagination
|
|
|
|
|
- v-show="total > 0"
|
|
|
|
|
- :total="total"
|
|
|
|
|
- :page.sync="queryParams.current"
|
|
|
|
|
- :limit.sync="queryParams.size"
|
|
|
|
|
- @pagination="getList"
|
|
|
|
|
- />
|
|
|
|
|
- <!-- 添加或修改班组对话框 -->
|
|
|
|
|
- <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="workareaName">
|
|
|
|
|
- <el-input
|
|
|
|
|
- style="width: 318px"
|
|
|
|
|
- v-model="form.workareaName"
|
|
|
|
|
- placeholder="请输入区域名称"
|
|
|
|
|
- />
|
|
|
|
|
- </el-form-item>
|
|
|
|
|
|
|
+ <!-- 添加或修改部门对话框 -->
|
|
|
|
|
+ <el-dialog :title="title" :visible.sync="open" width="600px" append-to-body>
|
|
|
|
|
+ <el-form ref="form" :model="form" :rules="rules" label-width="120px">
|
|
|
|
|
+ <el-row>
|
|
|
|
|
+ <el-col :span="18">
|
|
|
|
|
+ <el-form-item label="上级作业区域" prop="parentId">
|
|
|
|
|
+ <treeselect style="width: 318px" v-model="form.parentId" :options="deptOptions" :normalizer="normalizer"
|
|
|
|
|
+ placeholder="选择上级作业区域"
|
|
|
|
|
+ />
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ </el-col>
|
|
|
|
|
+ </el-row>
|
|
|
|
|
+ <el-row>
|
|
|
|
|
+ <el-col :span="18">
|
|
|
|
|
+ <el-form-item label="作业区域名称" prop="workareaName">
|
|
|
|
|
+ <el-input
|
|
|
|
|
+ style="width: 318px"
|
|
|
|
|
+ v-model="form.workareaName"
|
|
|
|
|
+ placeholder="请输入区域名称"
|
|
|
|
|
+ />
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ </el-col>
|
|
|
|
|
+ </el-row>
|
|
|
|
|
+ <el-row>
|
|
|
|
|
+ <el-col :span="18">
|
|
|
|
|
+ <el-form-item label="显示排序" prop="orderNum">
|
|
|
|
|
+ <el-input-number style="width: 318px" v-model="form.orderNum" controls-position="right" :min="0"/>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ </el-col>
|
|
|
|
|
+ </el-row>
|
|
|
|
|
+
|
|
|
<el-row>
|
|
<el-row>
|
|
|
- <el-col :span="13">
|
|
|
|
|
|
|
+ <el-col :span="19">
|
|
|
<el-form-item label="区域编码" prop="workareaCode">
|
|
<el-form-item label="区域编码" prop="workareaCode">
|
|
|
<el-input
|
|
<el-input
|
|
|
|
|
+ style="width: 318px"
|
|
|
v-model="form.workareaCode"
|
|
v-model="form.workareaCode"
|
|
|
placeholder="请输入区域编码"
|
|
placeholder="请输入区域编码"
|
|
|
/>
|
|
/>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
</el-col>
|
|
</el-col>
|
|
|
- <el-col :span="5">
|
|
|
|
|
|
|
+ <el-col :span="3">
|
|
|
<el-form-item label-width="80">
|
|
<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)"
|
|
|
- v-if="optType != 'view'"
|
|
|
|
|
>
|
|
>
|
|
|
</el-switch>
|
|
</el-switch>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
</el-col>
|
|
</el-col>
|
|
|
</el-row>
|
|
</el-row>
|
|
|
- <el-form-item label="区域类型" prop="workareaType">
|
|
|
|
|
- <el-input
|
|
|
|
|
- style="width: 318px"
|
|
|
|
|
- v-model="form.workareaType"
|
|
|
|
|
- placeholder="请输入区域类型"
|
|
|
|
|
- />
|
|
|
|
|
- </el-form-item>
|
|
|
|
|
- <el-form-item label="所属车间" prop="workshopId">
|
|
|
|
|
- <el-select
|
|
|
|
|
- style="width: 318px"
|
|
|
|
|
- v-model="form.workshopId"
|
|
|
|
|
- placeholder="请选择所属车间"
|
|
|
|
|
- >
|
|
|
|
|
- <el-option
|
|
|
|
|
- v-for="dict in this.WorkShopListOptions"
|
|
|
|
|
- :key="dict.key"
|
|
|
|
|
- :label="dict.label"
|
|
|
|
|
- :value="dict.value"
|
|
|
|
|
- />
|
|
|
|
|
- </el-select>
|
|
|
|
|
- </el-form-item>
|
|
|
|
|
- <el-form-item label="地图" prop="map">
|
|
|
|
|
- <el-input
|
|
|
|
|
- style="width: 318px"
|
|
|
|
|
- v-model="form.map"
|
|
|
|
|
- placeholder="请输入地图"
|
|
|
|
|
- />
|
|
|
|
|
- <!-- <ImageUpload :limit="1" :value="form.map" :fileSize="5" @onUploaded="handleImgUplaoded" @onRemoved="handleImgRemoved" ></ImageUpload>-->
|
|
|
|
|
|
|
+ <el-form-item label="区域状态">
|
|
|
|
|
+ <el-radio-group v-model="form.status">
|
|
|
|
|
+ <el-radio :label="'0'">启用</el-radio>
|
|
|
|
|
+ <el-radio :label="'1'">禁用</el-radio>
|
|
|
|
|
+ </el-radio-group>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
- <!-- <el-form-item label="备注" prop="remark">-->
|
|
|
|
|
- <!-- <el-input style="width: 318px" type="textarea" v-model="form.remark" placeholder="请输入备注" />-->
|
|
|
|
|
- <!-- </el-form-item>-->
|
|
|
|
|
|
|
+ <el-row>
|
|
|
|
|
+ <el-col :span="18">
|
|
|
|
|
+ <el-form-item label="区域地图" prop="map">
|
|
|
|
|
+ <ImageUpload :limit="1" :value="form.map" :fileSize="5" @onUploaded="handleImgUplaoded"
|
|
|
|
|
+ @onRemoved="handleImgRemoved"
|
|
|
|
|
+ ></ImageUpload>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ </el-col>
|
|
|
|
|
+ </el-row>
|
|
|
|
|
+ <el-row>
|
|
|
|
|
+ <el-col :span="10">
|
|
|
|
|
+ <el-form-item label="地图json" prop="map">
|
|
|
|
|
+ <el-input
|
|
|
|
|
+ style="width: 318px"
|
|
|
|
|
+ v-model="form.map"
|
|
|
|
|
+ placeholder="请输入地图json"
|
|
|
|
|
+ />
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ </el-col>
|
|
|
|
|
+ </el-row>
|
|
|
|
|
+ <el-row>
|
|
|
|
|
+ <el-col :span="10">
|
|
|
|
|
+ <el-form-item label="备注" prop="remark">
|
|
|
|
|
+ <el-input
|
|
|
|
|
+ type="textarea"
|
|
|
|
|
+ style="width: 318px"
|
|
|
|
|
+ v-model="form.remark"
|
|
|
|
|
+ placeholder="请输入备注"
|
|
|
|
|
+ />
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ </el-col>
|
|
|
|
|
+ </el-row>
|
|
|
</el-form>
|
|
</el-form>
|
|
|
<div slot="footer" class="dialog-footer">
|
|
<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>
|
|
<el-button @click="cancel">取 消</el-button>
|
|
|
</div>
|
|
</div>
|
|
|
</el-dialog>
|
|
</el-dialog>
|
|
@@ -273,16 +221,16 @@ import {
|
|
|
addWorkarea,
|
|
addWorkarea,
|
|
|
updateWorkarea,
|
|
updateWorkarea,
|
|
|
delWorkarea,
|
|
delWorkarea,
|
|
|
- listAllWorkshop,
|
|
|
|
|
-} from "@/api/mes/wa/workarea";
|
|
|
|
|
-
|
|
|
|
|
-import { genCode } from "@/api/system/autocode/rule";
|
|
|
|
|
-import { mapActions, mapState } from "vuex";
|
|
|
|
|
|
|
+ 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: "index",
|
|
|
|
|
- dicts: ["mes_calendar_type"],
|
|
|
|
|
-
|
|
|
|
|
|
|
+ name: 'Dept',
|
|
|
|
|
+ dicts: ['sys_normal_disable'],
|
|
|
|
|
+ components: { Treeselect },
|
|
|
data() {
|
|
data() {
|
|
|
return {
|
|
return {
|
|
|
//自动生成编码
|
|
//自动生成编码
|
|
@@ -297,180 +245,208 @@ export default {
|
|
|
single: true,
|
|
single: true,
|
|
|
// 非多个禁用
|
|
// 非多个禁用
|
|
|
multiple: true,
|
|
multiple: true,
|
|
|
- // 显示搜索条件
|
|
|
|
|
- showSearch: true,
|
|
|
|
|
// 地图预览弹框
|
|
// 地图预览弹框
|
|
|
dialogVisibleMap: false,
|
|
dialogVisibleMap: false,
|
|
|
- // 总条数
|
|
|
|
|
- total: 0,
|
|
|
|
|
- // 班组表格数据
|
|
|
|
|
- workareaList: [],
|
|
|
|
|
|
|
+ // 显示搜索条件
|
|
|
|
|
+ showSearch: true,
|
|
|
|
|
+ // 表格树数据
|
|
|
|
|
+ deptList: [],
|
|
|
|
|
+ // 部门树选项
|
|
|
|
|
+ deptOptions: [],
|
|
|
// 弹出层标题
|
|
// 弹出层标题
|
|
|
- title: "",
|
|
|
|
|
|
|
+ title: '',
|
|
|
// 是否显示弹出层
|
|
// 是否显示弹出层
|
|
|
open: false,
|
|
open: false,
|
|
|
|
|
+ // 是否展开,默认全部展开
|
|
|
|
|
+ isExpandAll: true,
|
|
|
|
|
+ // 重新渲染表格状态
|
|
|
|
|
+ refreshTable: true,
|
|
|
// 查询参数
|
|
// 查询参数
|
|
|
queryParams: {
|
|
queryParams: {
|
|
|
current: 1,
|
|
current: 1,
|
|
|
- size: 10,
|
|
|
|
|
|
|
+ size: -1,
|
|
|
workareaCode: null,
|
|
workareaCode: null,
|
|
|
workareaName: null,
|
|
workareaName: null,
|
|
|
- workareaType: null,
|
|
|
|
|
|
|
+ workareaType: null
|
|
|
},
|
|
},
|
|
|
|
|
+ // 总条数
|
|
|
|
|
+ total: 0,
|
|
|
// 表单参数
|
|
// 表单参数
|
|
|
- form: {},
|
|
|
|
|
|
|
+ form: {
|
|
|
|
|
+ workshopId:0,
|
|
|
|
|
+ parentId:0,
|
|
|
|
|
+ },
|
|
|
WorkShopListOptions: null, //所属车间下拉数据
|
|
WorkShopListOptions: null, //所属车间下拉数据
|
|
|
EditId: null, //判断是否是编辑弹框的值
|
|
EditId: null, //判断是否是编辑弹框的值
|
|
|
// 表单校验
|
|
// 表单校验
|
|
|
rules: {
|
|
rules: {
|
|
|
|
|
+ // parentId: [
|
|
|
|
|
+ // { required: true, message: '父级不能为空', trigger: 'blur' }
|
|
|
|
|
+ // ],
|
|
|
|
|
+ orderNum: [
|
|
|
|
|
+ { 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) => {
|
|
|
|
|
- console.log(response, "获取工作取区域allList ");
|
|
|
|
|
- this.workareaList = response.data.records;
|
|
|
|
|
- this.total = response.data.total;
|
|
|
|
|
- this.loading = false;
|
|
|
|
|
- });
|
|
|
|
|
- // 获取所有车间信息
|
|
|
|
|
- listAllWorkshop().then((response) => {
|
|
|
|
|
- console.log(response, "车间信息");
|
|
|
|
|
- this.WorkShopListOptions = response.data.map((item) => {
|
|
|
|
|
- return {
|
|
|
|
|
- label: item.workshopName,
|
|
|
|
|
- value: item.workshopId,
|
|
|
|
|
- key: item.workshopCode,
|
|
|
|
|
- };
|
|
|
|
|
- });
|
|
|
|
|
- });
|
|
|
|
|
|
|
+ this.loading = true
|
|
|
|
|
+ listWorkarea(this.queryParams).then(response => {
|
|
|
|
|
+ debugger;
|
|
|
|
|
+ var depts = this.handleTree(response.data.records, 'workareaId')
|
|
|
|
|
+ this.deptList = depts
|
|
|
|
|
+ this.loading = false
|
|
|
|
|
+ })
|
|
|
|
|
+ },
|
|
|
|
|
+ /** 转换部门数据结构 */
|
|
|
|
|
+ normalizer(node) {
|
|
|
|
|
+ if (node.children && !node.children.length) {
|
|
|
|
|
+ delete node.children
|
|
|
|
|
+ }
|
|
|
|
|
+ return {
|
|
|
|
|
+ id: node.workareaId,
|
|
|
|
|
+ label: node.workareaName,
|
|
|
|
|
+ children: node.children
|
|
|
|
|
+ }
|
|
|
},
|
|
},
|
|
|
-
|
|
|
|
|
// 取消按钮
|
|
// 取消按钮
|
|
|
cancel() {
|
|
cancel() {
|
|
|
- this.open = false;
|
|
|
|
|
- this.reset();
|
|
|
|
|
|
|
+ this.open = false
|
|
|
|
|
+ this.reset()
|
|
|
},
|
|
},
|
|
|
// 表单重置
|
|
// 表单重置
|
|
|
reset() {
|
|
reset() {
|
|
|
this.form = {
|
|
this.form = {
|
|
|
|
|
+ parentId: undefined,
|
|
|
|
|
+ orderNum: undefined,
|
|
|
remark: null,
|
|
remark: null,
|
|
|
map: null,
|
|
map: null,
|
|
|
workareaCode: null,
|
|
workareaCode: null,
|
|
|
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() {
|
|
|
this.queryParams = {
|
|
this.queryParams = {
|
|
|
current: 1,
|
|
current: 1,
|
|
|
- size: 10,
|
|
|
|
|
|
|
+ size: -1,
|
|
|
workareaCode: null,
|
|
workareaCode: null,
|
|
|
workareaName: null,
|
|
workareaName: null,
|
|
|
- workareaType: null,
|
|
|
|
|
- };
|
|
|
|
|
- this.resetForm("queryForm");
|
|
|
|
|
- this.handleQuery();
|
|
|
|
|
- },
|
|
|
|
|
- // 多选框选中数据
|
|
|
|
|
- handleSelectionChange(selection) {
|
|
|
|
|
- this.ids = selection.map((item) => item.workareaId);
|
|
|
|
|
- this.codes = selection.map((item) => item.workareaCode);
|
|
|
|
|
- this.single = selection.length !== 1;
|
|
|
|
|
- this.multiple = !selection.length;
|
|
|
|
|
|
|
+ workareaType: null
|
|
|
|
|
+ }
|
|
|
|
|
+ this.resetForm('queryForm')
|
|
|
|
|
+ this.handleQuery()
|
|
|
},
|
|
},
|
|
|
/** 新增按钮操作 */
|
|
/** 新增按钮操作 */
|
|
|
- handleAdd() {
|
|
|
|
|
- this.reset();
|
|
|
|
|
- this.open = true;
|
|
|
|
|
- this.title = "添加工作区域";
|
|
|
|
|
- this.optType = "add";
|
|
|
|
|
- this.EditId = null;
|
|
|
|
|
|
|
+ handleAdd(row) {
|
|
|
|
|
+ this.reset()
|
|
|
|
|
+ if (row != undefined) {
|
|
|
|
|
+ this.form.workshopId=0
|
|
|
|
|
+ this.form.parentId = row.workareaId;
|
|
|
|
|
+ }else{
|
|
|
|
|
+ this.form.workshopId=0
|
|
|
|
|
+ this.form.parentId = 0;
|
|
|
|
|
+ }
|
|
|
|
|
+ this.open = true
|
|
|
|
|
+ this.title = '添加工作区域'
|
|
|
|
|
+ listWorkarea().then(response => {
|
|
|
|
|
+ this.deptOptions = this.handleTree(response.data.records, 'workareaId', 'parentId', 'children')
|
|
|
|
|
+ })
|
|
|
},
|
|
},
|
|
|
- // 查询明细按钮操作
|
|
|
|
|
- handleView(row) {
|
|
|
|
|
- this.reset();
|
|
|
|
|
- this.EditId = row.workareaId || this.ids;
|
|
|
|
|
- getWorkareaInfo(this.EditId).then((response) => {
|
|
|
|
|
- this.form = response.data;
|
|
|
|
|
- this.open = true;
|
|
|
|
|
- this.title = "查看工作区域";
|
|
|
|
|
- this.optType = "view";
|
|
|
|
|
- });
|
|
|
|
|
|
|
+ /** 展开/折叠操作 */
|
|
|
|
|
+ toggleExpandAll() {
|
|
|
|
|
+ this.refreshTable = false
|
|
|
|
|
+ this.isExpandAll = !this.isExpandAll
|
|
|
|
|
+ this.$nextTick(() => {
|
|
|
|
|
+ this.refreshTable = true
|
|
|
|
|
+ })
|
|
|
},
|
|
},
|
|
|
/** 修改按钮操作 */
|
|
/** 修改按钮操作 */
|
|
|
handleUpdate(row) {
|
|
handleUpdate(row) {
|
|
|
- this.reset();
|
|
|
|
|
- this.EditId = row.workareaId || this.ids;
|
|
|
|
|
- console.log(row, "row");
|
|
|
|
|
- getWorkareaInfo(this.EditId).then((response) => {
|
|
|
|
|
- console.log(response, "获取单条工作区域数据");
|
|
|
|
|
- this.form = response.data;
|
|
|
|
|
- this.open = true;
|
|
|
|
|
- this.title = "修改工作区域信息";
|
|
|
|
|
- this.optType = "edit";
|
|
|
|
|
- });
|
|
|
|
|
|
|
+ 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) {
|
|
|
|
|
+ this.form.map = imgUrl
|
|
|
|
|
+ },
|
|
|
|
|
+ //图片移除
|
|
|
|
|
+ handleImgRemoved(imgUrl) {
|
|
|
|
|
+ this.form.map = null
|
|
|
},
|
|
},
|
|
|
/** 提交按钮 */
|
|
/** 提交按钮 */
|
|
|
- submitForm() {
|
|
|
|
|
- this.$refs["form"].validate((valid) => {
|
|
|
|
|
|
|
+ submitForm: function() {
|
|
|
|
|
+ this.$refs['form'].validate(valid => {
|
|
|
if (valid) {
|
|
if (valid) {
|
|
|
if (this.EditId != null) {
|
|
if (this.EditId != null) {
|
|
|
- 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 {
|
|
|
- addWorkarea(this.form).then((response) => {
|
|
|
|
|
- this.$modal.msgSuccess("新增成功");
|
|
|
|
|
- this.open = false;
|
|
|
|
|
- this.EditId = null;
|
|
|
|
|
- this.getList();
|
|
|
|
|
- });
|
|
|
|
|
|
|
+ console.log(this.form,'新增工作区域参数')
|
|
|
|
|
+ addWorkarea(this.form).then(response => {
|
|
|
|
|
+ this.$modal.msgSuccess('新增成功')
|
|
|
|
|
+ this.open = false
|
|
|
|
|
+ this.getList()
|
|
|
|
|
+ })
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- });
|
|
|
|
|
|
|
+ })
|
|
|
},
|
|
},
|
|
|
/** 删除按钮操作 */
|
|
/** 删除按钮操作 */
|
|
|
handleDelete(row) {
|
|
handleDelete(row) {
|
|
|
- const teamIds = row.workareaId || this.ids;
|
|
|
|
|
- const workareaCodes = row.workareaCode || this.codes;
|
|
|
|
|
- this.$modal
|
|
|
|
|
- .confirm('是否确认删除工作区域编码为"' + workareaCodes + '"的数据项?')
|
|
|
|
|
- .then(function () {
|
|
|
|
|
- return delWorkarea(teamIds);
|
|
|
|
|
- })
|
|
|
|
|
- .then(() => {
|
|
|
|
|
- this.getList();
|
|
|
|
|
- this.$modal.msgSuccess("删除成功");
|
|
|
|
|
|
|
+ this.$modal.confirm('是否确认删除名称为"' + row.workareaCode + '"的数据项?').then(function() {
|
|
|
|
|
+ return delWorkarea(row.workareaId)
|
|
|
|
|
+ }).then(() => {
|
|
|
|
|
+ this.getList()
|
|
|
|
|
+ this.$modal.msgSuccess('删除成功')
|
|
|
|
|
+ }).catch(() => {
|
|
|
|
|
+ })
|
|
|
|
|
+ },
|
|
|
|
|
+ //自动生成编码
|
|
|
|
|
+ handleAutoGenChange(autoGenFlag) {
|
|
|
|
|
+ if (autoGenFlag) {
|
|
|
|
|
+ genCode('WORKAREA_CODE').then((response) => {
|
|
|
|
|
+ this.form.workareaCode = response
|
|
|
})
|
|
})
|
|
|
- .catch(() => {});
|
|
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.form.workareaCode = null
|
|
|
|
|
+ }
|
|
|
},
|
|
},
|
|
|
// 地图预览
|
|
// 地图预览
|
|
|
look(row) {
|
|
look(row) {
|
|
@@ -481,30 +457,8 @@ 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; // 显示地图预览弹框
|
|
|
},
|
|
},
|
|
|
- updateMapData(selectedPoints) {
|
|
|
|
|
- // Sync mapData with the selected points in MapData
|
|
|
|
|
- this.mapData = selectedPoints;
|
|
|
|
|
- },
|
|
|
|
|
|
|
|
|
|
- // 地图弹框关闭按钮
|
|
|
|
|
- handleClose() {
|
|
|
|
|
- this.dialogVisibleMap = false;
|
|
|
|
|
- },
|
|
|
|
|
- //自动生成编码
|
|
|
|
|
- handleAutoGenChange(autoGenFlag) {
|
|
|
|
|
- if (autoGenFlag) {
|
|
|
|
|
- genCode("WORKAREA_CODE").then((response) => {
|
|
|
|
|
- this.form.workareaCode = response;
|
|
|
|
|
- });
|
|
|
|
|
- } else {
|
|
|
|
|
- this.form.workareaCode = null;
|
|
|
|
|
- }
|
|
|
|
|
- },
|
|
|
|
|
- },
|
|
|
|
|
-};
|
|
|
|
|
-</script>
|
|
|
|
|
-<style lang="scss" src="@/assets/styles/dialog-title.scss" scoped>
|
|
|
|
|
-.el-input-width {
|
|
|
|
|
- width: 380px !important;
|
|
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
-</style>
|
|
|
|
|
|
|
+</script>
|