|
|
@@ -49,17 +49,14 @@
|
|
|
<!-- </el-select>-->
|
|
|
<!-- </el-form-item>-->
|
|
|
<el-form-item label="作业区域" prop="workareaId">
|
|
|
- <el-select
|
|
|
- v-model="queryParams.workareaId"
|
|
|
- placeholder="请选择作业区域"
|
|
|
- >
|
|
|
- <el-option
|
|
|
- v-for="dict in this.workareaList"
|
|
|
- :key="dict.value"
|
|
|
- :label="dict.label"
|
|
|
- :value="dict.value"
|
|
|
+ <treeselect
|
|
|
+ style="width: 318px"
|
|
|
+ v-model="queryParams.workareaId"
|
|
|
+ :options="deptOptions"
|
|
|
+ :normalizer="normalizer"
|
|
|
+ placeholder="选择作业区域"
|
|
|
/>
|
|
|
- </el-select>
|
|
|
+
|
|
|
</el-form-item>
|
|
|
<el-form-item label="创建时间">
|
|
|
<el-date-picker
|
|
|
@@ -87,14 +84,19 @@
|
|
|
</el-form-item>
|
|
|
|
|
|
<el-form-item>
|
|
|
- <el-button v-no-more-click
|
|
|
+ <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
|
|
|
+ v-no-more-click
|
|
|
+ icon="el-icon-refresh"
|
|
|
+ size="mini"
|
|
|
+ @click="resetQuery"
|
|
|
>重置</el-button
|
|
|
>
|
|
|
</el-form-item>
|
|
|
@@ -102,7 +104,8 @@
|
|
|
|
|
|
<el-row :gutter="10" class="mb8">
|
|
|
<el-col :span="1.5">
|
|
|
- <el-button v-no-more-click
|
|
|
+ <el-button
|
|
|
+ v-no-more-click
|
|
|
type="primary"
|
|
|
plain
|
|
|
icon="el-icon-plus"
|
|
|
@@ -113,7 +116,8 @@
|
|
|
</el-button>
|
|
|
</el-col>
|
|
|
<el-col :span="1.5">
|
|
|
- <el-button v-no-more-click
|
|
|
+ <el-button
|
|
|
+ v-no-more-click
|
|
|
type="danger"
|
|
|
plain
|
|
|
icon="el-icon-delete"
|
|
|
@@ -190,7 +194,8 @@
|
|
|
class-name="small-padding fixed-width"
|
|
|
>
|
|
|
<template slot-scope="scope">
|
|
|
- <el-button v-no-more-click
|
|
|
+ <el-button
|
|
|
+ v-no-more-click
|
|
|
size="mini"
|
|
|
type="text"
|
|
|
icon="el-icon-edit"
|
|
|
@@ -198,7 +203,8 @@
|
|
|
v-hasPermi="['mes:sop:sopm:edit']"
|
|
|
>编辑
|
|
|
</el-button>
|
|
|
- <el-button v-no-more-click
|
|
|
+ <el-button
|
|
|
+ v-no-more-click
|
|
|
size="mini"
|
|
|
type="text"
|
|
|
icon="el-icon-view"
|
|
|
@@ -206,7 +212,8 @@
|
|
|
v-hasPermi="['mes:sop:sopm:progress']"
|
|
|
>查看
|
|
|
</el-button>
|
|
|
- <el-button v-no-more-click
|
|
|
+ <el-button
|
|
|
+ v-no-more-click
|
|
|
size="mini"
|
|
|
type="text"
|
|
|
icon="el-icon-delete"
|
|
|
@@ -239,11 +246,14 @@ import {
|
|
|
deleteIsSopBySopIds,
|
|
|
selectIsSopById,
|
|
|
} from "@/api/mes/sop/sopindex";
|
|
|
+import Treeselect from "@riophae/vue-treeselect";
|
|
|
+import "@riophae/vue-treeselect/dist/vue-treeselect.css";
|
|
|
+import { listWorkarea } from "@/api/mes/wa/workarea";
|
|
|
|
|
|
import { mapActions } from "vuex";
|
|
|
export default {
|
|
|
name: "Team",
|
|
|
-
|
|
|
+ components: { Treeselect },
|
|
|
dicts: ["sop_status", "sop_type"],
|
|
|
data() {
|
|
|
return {
|
|
|
@@ -272,6 +282,8 @@ export default {
|
|
|
workshopList: [],
|
|
|
// 作业区域数据
|
|
|
workareaList: [],
|
|
|
+ // 部门树选项
|
|
|
+ deptOptions: [],
|
|
|
// 查询参数
|
|
|
createTime: "",
|
|
|
queryParams: {
|
|
|
@@ -354,11 +366,35 @@ export default {
|
|
|
this.queryParams.endTime = this.formatDate(this.createTime[1]);
|
|
|
}
|
|
|
getIsSopPage(this.queryParams).then((response) => {
|
|
|
- console.log(response, "接口返回结果");
|
|
|
+ // console.log(response, "接口返回结果");
|
|
|
this.sopList = response.data.records;
|
|
|
this.total = response.data.total;
|
|
|
this.loading = false;
|
|
|
});
|
|
|
+ const data = {
|
|
|
+ current: 1,
|
|
|
+ size: -1,
|
|
|
+ };
|
|
|
+ listWorkarea(data).then((response) => {
|
|
|
+ this.deptOptions = this.handleTree(
|
|
|
+ response.data.records,
|
|
|
+ "workareaId",
|
|
|
+ "parentId",
|
|
|
+ "children"
|
|
|
+ );
|
|
|
+ console.log(this.deptOptions, "作业区域下拉树形结构");
|
|
|
+ });
|
|
|
+ },
|
|
|
+ /** 转换工作区域数据结构 */
|
|
|
+ normalizer(node) {
|
|
|
+ if (node.children && !node.children.length) {
|
|
|
+ delete node.children;
|
|
|
+ }
|
|
|
+ return {
|
|
|
+ id: node.workareaId,
|
|
|
+ label: node.workareaName,
|
|
|
+ children: node.children,
|
|
|
+ };
|
|
|
},
|
|
|
// 获取车间数据
|
|
|
getworkShop() {
|