|
|
@@ -1,13 +1,6 @@
|
|
|
<template>
|
|
|
<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="SOP编号" prop="sopCode">
|
|
|
<el-input
|
|
|
v-model="queryParams.sopCode"
|
|
|
@@ -19,250 +12,163 @@
|
|
|
<el-form-item label="SOP名称" prop="sopName">
|
|
|
<el-input
|
|
|
v-model="queryParams.sopName"
|
|
|
- placeholder="请输入SOP名称"
|
|
|
+ placeholder="请输入sop名称"
|
|
|
clearable
|
|
|
@keyup.enter.native="handleQuery"
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="状态" prop="sopStatus">
|
|
|
- <el-select v-model="queryParams.sopStatus" placeholder="状态">
|
|
|
- <el-option
|
|
|
- v-for="dict in dict.type.sop_status"
|
|
|
- :key="dict.value"
|
|
|
- :label="dict.label"
|
|
|
- :value="dict.value"
|
|
|
- />
|
|
|
- </el-select>
|
|
|
- </el-form-item>
|
|
|
- <!-- <el-form-item label="车间名称" prop="workshopId">-->
|
|
|
- <!-- <el-select-->
|
|
|
- <!-- v-model="queryParams.workshopId"-->
|
|
|
- <!-- placeholder="请选择车间名称"-->
|
|
|
- <!-- @change="workShopChange"-->
|
|
|
- <!-- >-->
|
|
|
- <!-- <el-option-->
|
|
|
- <!-- v-for="item in this.workshopList"-->
|
|
|
- <!-- :key="item.key"-->
|
|
|
- <!-- :label="item.label"-->
|
|
|
- <!-- :value="item.value"-->
|
|
|
- <!-- />-->
|
|
|
- <!-- </el-select>-->
|
|
|
- <!-- </el-form-item>-->
|
|
|
- <el-form-item label="作业区域" prop="workareaId">
|
|
|
- <treeselect
|
|
|
- style="width: 318px"
|
|
|
- v-model="queryParams.workareaId"
|
|
|
- :options="deptOptions"
|
|
|
- :normalizer="normalizer"
|
|
|
- placeholder="选择作业区域"
|
|
|
- />
|
|
|
-
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="创建时间">
|
|
|
- <el-date-picker
|
|
|
- style="width: 218px"
|
|
|
- v-model="createTime"
|
|
|
- type="daterange"
|
|
|
- align="right"
|
|
|
- unlink-panels
|
|
|
- range-separator="至"
|
|
|
- start-placeholder="开始日期"
|
|
|
- end-placeholder="结束日期"
|
|
|
- :picker-options="pickerOptions"
|
|
|
- >
|
|
|
- </el-date-picker>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="SOP类型" prop="sopType">
|
|
|
- <el-select v-model="queryParams.sopType" placeholder="请选择SOP类型">
|
|
|
- <el-option
|
|
|
- v-for="dict in dict.type.sop_type"
|
|
|
- :key="dict.value"
|
|
|
- :label="dict.label"
|
|
|
- :value="dict.value"
|
|
|
- />
|
|
|
- </el-select>
|
|
|
- </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>
|
|
|
-
|
|
|
<el-row :gutter="10" class="mb8">
|
|
|
<el-col :span="1.5">
|
|
|
- <el-button
|
|
|
- v-no-more-click
|
|
|
- type="primary"
|
|
|
- plain
|
|
|
- icon="el-icon-plus"
|
|
|
- size="mini"
|
|
|
- @click="handleAdd"
|
|
|
- v-hasPermi="['mes:sop:sopm:add']"
|
|
|
- >新增
|
|
|
+ <el-button v-no-more-click
|
|
|
+ type="primary"
|
|
|
+ plain
|
|
|
+ icon="el-icon-plus"
|
|
|
+ size="mini"
|
|
|
+ @click="handleAdd"
|
|
|
+ v-hasPermi="['iscs:sop:add']"
|
|
|
+ >新增
|
|
|
</el-button>
|
|
|
</el-col>
|
|
|
<el-col :span="1.5">
|
|
|
- <el-button
|
|
|
- v-no-more-click
|
|
|
- type="danger"
|
|
|
- plain
|
|
|
- icon="el-icon-delete"
|
|
|
- size="mini"
|
|
|
- :disabled="multiple"
|
|
|
- @click="handleDelete"
|
|
|
- v-hasPermi="['mes:sop:sopm:batchremove']"
|
|
|
- >批量删除
|
|
|
+ <el-button v-no-more-click
|
|
|
+ type="info"
|
|
|
+ plain
|
|
|
+ icon="el-icon-sort"
|
|
|
+ size="mini"
|
|
|
+ @click="toggleExpandAll"
|
|
|
+ >展开/折叠
|
|
|
</el-button>
|
|
|
</el-col>
|
|
|
- <!-- <el-col :span="1.5">-->
|
|
|
- <!-- <el-button v-no-more-click-->
|
|
|
- <!-- 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-table
|
|
|
+ v-if="refreshTable"
|
|
|
v-loading="loading"
|
|
|
- :data="sopList"
|
|
|
- @selection-change="handleSelectionChange"
|
|
|
+ :data="deptList"
|
|
|
>
|
|
|
-
|
|
|
- <el-table-column type="selection" width="55" align="center" />
|
|
|
- <!-- 此处sopId为了实现编辑 误删除 -->
|
|
|
- <!-- <el-table-column
|
|
|
- label="SOPID"
|
|
|
- align="center"
|
|
|
- prop="sopId"
|
|
|
- v-if="(showId = false)"
|
|
|
- /> -->
|
|
|
- <el-table-column
|
|
|
- label="序号"
|
|
|
- align="center"
|
|
|
- prop="sopIndex"
|
|
|
- >
|
|
|
+<!-- <el-table-column prop="sopIndex" label="SOP序号" ></el-table-column>-->
|
|
|
+ <el-table-column prop="sopName" label="SOP名称" ></el-table-column>
|
|
|
+ <el-table-column prop="sopType" label="SOP类型" >
|
|
|
<template slot-scope="scope">
|
|
|
- <el-button v-no-more-click
|
|
|
- type="text"
|
|
|
- @click="handleByOrder(scope.row)"
|
|
|
- >{{scope.row.sopIndex?scope.row.sopIndex:'-'}}</el-button>
|
|
|
+ <dict-tag :options="dict.type.sop_type" :value="scope.row.sopType"/>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column label="SOP编号" align="center" prop="sopCode">
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="SOP名称" align="center" prop="sopName" />
|
|
|
- <el-table-column label="状态" align="center" prop="sopStatus">
|
|
|
+ <el-table-column prop="workstationName" label="所属岗位" >
|
|
|
<template slot-scope="scope">
|
|
|
- <dict-tag
|
|
|
- :options="dict.type.sop_status"
|
|
|
- :value="scope.row.sopStatus"
|
|
|
- />
|
|
|
+ <span>{{ scope.row.workstationName }}</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <!-- <el-table-column label="车间名称" align="center" prop="workshopName">-->
|
|
|
- <!-- </el-table-column>-->
|
|
|
|
|
|
- <el-table-column label="SOP类型" align="center" prop="sopType">
|
|
|
+ <el-table-column prop="machineryName" label="设备/工艺" >
|
|
|
<template slot-scope="scope">
|
|
|
- <dict-tag :options="dict.type.sop_type" :value="scope.row.sopType" />
|
|
|
+ {{ scope.row.machineryName }}
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column label="作业区域" align="center" prop="workareaName">
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="隔离点数量" align="center" prop="pointCount">
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="创建时间" align="center" prop="createTime">
|
|
|
+ <el-table-column label="创建时间" align="center" prop="createTime" width="200">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span>{{ scope.row.createTime }}</span>
|
|
|
+ </template>
|
|
|
</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">
|
|
|
- <el-button
|
|
|
- v-no-more-click
|
|
|
- size="mini"
|
|
|
- type="text"
|
|
|
- icon="el-icon-edit"
|
|
|
- @click="handleUpdate(scope.row)"
|
|
|
- v-hasPermi="['mes:sop:sopm:edit']"
|
|
|
- >编辑
|
|
|
- </el-button>
|
|
|
- <el-button
|
|
|
- v-no-more-click
|
|
|
- size="mini"
|
|
|
- type="text"
|
|
|
- icon="el-icon-view"
|
|
|
- @click="handleLook(scope.row)"
|
|
|
- v-hasPermi="['mes:sop:sopm:progress']"
|
|
|
- >查看
|
|
|
+ <el-button v-no-more-click
|
|
|
+ size="mini"
|
|
|
+ type="text"
|
|
|
+ icon="el-icon-edit"
|
|
|
+ @click="handleUpdate(scope.row)"
|
|
|
+ v-hasPermi="['iscs:sop:edit']"
|
|
|
+ >修改
|
|
|
</el-button>
|
|
|
- <el-button
|
|
|
- v-no-more-click
|
|
|
- size="mini"
|
|
|
- type="text"
|
|
|
- icon="el-icon-delete"
|
|
|
- @click="handleDelete(scope.row)"
|
|
|
- v-hasPermi="['mes:sop:sopm:remove']"
|
|
|
- >删除
|
|
|
+
|
|
|
+ <!-- v-if="scope.row.parentId != 0"-->
|
|
|
+ <el-button v-no-more-click
|
|
|
+
|
|
|
+ size="mini"
|
|
|
+ type="text"
|
|
|
+ icon="el-icon-delete"
|
|
|
+ @click="handleDelete(scope.row)"
|
|
|
+ v-hasPermi="['iscs:sop:remove']"
|
|
|
+ >删除
|
|
|
</el-button>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</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="450px"
|
|
|
- append-to-body
|
|
|
- style="margin-top: 13%"
|
|
|
- >
|
|
|
- <div slot="title" class="dialog-title">
|
|
|
- <i></i>
|
|
|
- <span class="title">sop排序</span>
|
|
|
- </div>
|
|
|
- <el-form
|
|
|
- ref="dialogForm"
|
|
|
- :model="dialogForm"
|
|
|
- label-width="70px"
|
|
|
- >
|
|
|
- <el-form-item label="选择排序" prop="sopIndex" >
|
|
|
- <el-input-number v-model="dialogForm.sopIndex"></el-input-number>
|
|
|
+ <!-- 添加或修改部门对话框 -->
|
|
|
+ <el-dialog :title="title" :visible.sync="open" width="470px" append-to-body>
|
|
|
+ <el-form ref="form" :model="form" :rules="rules" label-width="100px">
|
|
|
+<!-- <el-form-item label="权重序号" prop="sopIndex">-->
|
|
|
+<!-- <el-input v-model="form.sopIndex" placeholder="请输入权重序号"/>-->
|
|
|
+<!-- </el-form-item>-->
|
|
|
+
|
|
|
+<!-- <el-form-item label="SOP名称" prop="sopName">-->
|
|
|
+<!-- <el-input v-model="form.sopName" placeholder="请输入SOP名称"/>-->
|
|
|
+<!-- </el-form-item>-->
|
|
|
+<!-- <el-row>-->
|
|
|
+<!-- <el-col :span="18">-->
|
|
|
+<!-- <el-form-item label="SOP编号" prop="sopCode">-->
|
|
|
+<!-- <el-input-->
|
|
|
+<!-- v-model="form.sopCode"-->
|
|
|
+<!-- placeholder="请输入SOP编号"-->
|
|
|
+<!-- />-->
|
|
|
+<!-- </el-form-item>-->
|
|
|
+<!-- </el-col>-->
|
|
|
+<!-- <el-col :span="6">-->
|
|
|
+<!-- <el-form-item label-width="30">-->
|
|
|
+<!-- <el-switch-->
|
|
|
+<!-- v-model="autoGenFlag"-->
|
|
|
+<!-- active-color="#13ce66"-->
|
|
|
+<!-- active-text="自动生成"-->
|
|
|
+<!-- @change="handleAutoGenChange(autoGenFlag)"-->
|
|
|
+<!-- >-->
|
|
|
+<!-- </el-switch>-->
|
|
|
+<!-- </el-form-item>-->
|
|
|
+<!-- </el-col>-->
|
|
|
+<!-- </el-row>-->
|
|
|
+
|
|
|
+ <el-form-item label="所属岗位" prop="workstationId" >
|
|
|
+ <treeselect v-model="form.workstationId" :options="marsOptions" :normalizer="Marsnormalizer" placeholder="选择岗位"/>
|
|
|
+ </el-form-item>
|
|
|
+<!-- <el-form-item label="所属电柜" prop="lotoId">-->
|
|
|
+<!-- <el-select-->
|
|
|
+<!-- style="width: 300px"-->
|
|
|
+<!-- v-model="form.lotoId"-->
|
|
|
+<!-- placeholder="请选择所属电柜"-->
|
|
|
+<!-- >-->
|
|
|
+<!-- <el-option-->
|
|
|
+<!-- v-for="dict in LotoOptions"-->
|
|
|
+<!-- :key="dict.value"-->
|
|
|
+<!-- :label="dict.label"-->
|
|
|
+<!-- :value="dict.value"-->
|
|
|
+<!-- />-->
|
|
|
+<!-- </el-select>-->
|
|
|
+<!-- </el-form-item>-->
|
|
|
+ <el-form-item label="设备/工艺" prop="machineryId" >
|
|
|
+ <treeselect v-model="form.machineryId" :options="machineryOptions" :normalizer="machinerynormalizer" placeholder="选择设备/工艺"/>
|
|
|
+ </el-form-item>
|
|
|
+
|
|
|
+ <el-form-item label="SOP类型" prop="sopType">
|
|
|
+ <el-select v-model="form.sopType" placeholder="请选择SOP类型" clearable>
|
|
|
+ <el-option
|
|
|
+ v-for="dict in dict.type.sop_type"
|
|
|
+ :key="dict.value"
|
|
|
+ :label="dict.label"
|
|
|
+ :value="dict.value"
|
|
|
+ />
|
|
|
+ </el-select>
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
<div slot="footer" class="dialog-footer">
|
|
|
- <!-- 内部人员确认-->
|
|
|
- <el-button v-no-more-click type="primary" @click="ByOrderconfirm" >确认</el-button>
|
|
|
- <el-button v-no-more-click @click="ByOrdercancel">取 消</el-button>
|
|
|
+ <el-button v-no-more-click type="primary" @click="submitForm">确 定</el-button>
|
|
|
+ <el-button v-no-more-click @click="cancel">取 消</el-button>
|
|
|
</div>
|
|
|
</el-dialog>
|
|
|
</div>
|
|
|
@@ -270,317 +176,237 @@
|
|
|
|
|
|
<script>
|
|
|
import {
|
|
|
- workshoplistAll,
|
|
|
- getIsWorkareaList,
|
|
|
-} from "@/api/mes/spm/segregationPoint";
|
|
|
-import {
|
|
|
- getIsSopPage,
|
|
|
- updateIsSop,
|
|
|
- deleteIsSopBySopIds,
|
|
|
- selectIsSopById,
|
|
|
- updateIsSopIndexAPI
|
|
|
-} 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";
|
|
|
+ getIsMarsSopPage, addinsertIsMarsSop, updateIsMarsSop, deleteIsMarsSopByMarsSopIds, selectIsMarsSopById,updateIsMarsSopIndexAPI
|
|
|
+} from '@/api/mes/sop/sopindex'
|
|
|
+import Treeselect from '@riophae/vue-treeselect'
|
|
|
+import '@riophae/vue-treeselect/dist/vue-treeselect.css'
|
|
|
+import { genCode } from '@/api/system/autocode/rule'
|
|
|
+import { listMarsDept } from '@/api/system/marsdept'
|
|
|
+import {listLoto} from '@/api/mes/lotoStation/lotoStation'
|
|
|
+import { listTechnology } from '@/api/system/machinery'
|
|
|
+import Template from '@/views/print/printtemplate/list.vue'
|
|
|
|
|
|
-import { mapActions } from "vuex";
|
|
|
export default {
|
|
|
- name: "Team",
|
|
|
- components: { Treeselect },
|
|
|
- dicts: ["sop_status", "sop_type"],
|
|
|
+ name: 'Dept',
|
|
|
+ dicts: ['sys_normal_disable','sop_type'],
|
|
|
+ components: { Template, Treeselect },
|
|
|
data() {
|
|
|
return {
|
|
|
- //自动生成编码
|
|
|
- autoGenFlag: false,
|
|
|
// 遮罩层
|
|
|
loading: true,
|
|
|
- // 选中数组
|
|
|
- ids: [],
|
|
|
- codes: [],
|
|
|
- // 非单个禁用
|
|
|
- single: true,
|
|
|
- // 非多个禁用
|
|
|
- multiple: true,
|
|
|
+ //自动生成编码
|
|
|
+ autoGenFlag: false,
|
|
|
// 显示搜索条件
|
|
|
showSearch: true,
|
|
|
- // 总条数
|
|
|
- total: 0,
|
|
|
- // 班组表格数据
|
|
|
- sopList: [],
|
|
|
+ // 表格树数据
|
|
|
+ deptList: [],
|
|
|
+ // mars树选项
|
|
|
+ marsOptions: [],
|
|
|
+ //工艺树
|
|
|
+ sopOptions:[],
|
|
|
+ // 电柜
|
|
|
+ lotoOptions:[],
|
|
|
+ // 设备/工艺
|
|
|
+ machineryOptions:[],
|
|
|
// 弹出层标题
|
|
|
- title: "",
|
|
|
- // 新增或修改
|
|
|
- sopId: null,
|
|
|
- // 车间数据
|
|
|
- workshopList: [],
|
|
|
- // 作业区域数据
|
|
|
- workareaList: [],
|
|
|
- // 部门树选项
|
|
|
- deptOptions: [],
|
|
|
+ title: '',
|
|
|
+ // 是否显示弹出层
|
|
|
+ open: false,
|
|
|
+ // 是否展开,默认全部展开
|
|
|
+ isExpandAll: true,
|
|
|
+ // 重新渲染表格状态
|
|
|
+ refreshTable: true,
|
|
|
// 查询参数
|
|
|
- createTime: "",
|
|
|
queryParams: {
|
|
|
- current: 1,
|
|
|
- size: 10,
|
|
|
- sopCode: null,
|
|
|
- sopName: null,
|
|
|
- sopStatus: null,
|
|
|
- workshopName: null,
|
|
|
- workshopId: null,
|
|
|
- workareaId: null,
|
|
|
- workareaName: null,
|
|
|
- startTime: "",
|
|
|
- endTime: "",
|
|
|
- },
|
|
|
- pickerOptions: {
|
|
|
- shortcuts: [
|
|
|
- {
|
|
|
- text: "最近一周",
|
|
|
- onClick(picker) {
|
|
|
- const end = new Date();
|
|
|
- const start = new Date();
|
|
|
- start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
|
|
|
- picker.$emit("pick", [start, end]);
|
|
|
- },
|
|
|
- },
|
|
|
- {
|
|
|
- text: "最近一个月",
|
|
|
- onClick(picker) {
|
|
|
- const end = new Date();
|
|
|
- const start = new Date();
|
|
|
- start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
|
|
|
- picker.$emit("pick", [start, end]);
|
|
|
- },
|
|
|
- },
|
|
|
- {
|
|
|
- text: "最近三个月",
|
|
|
- onClick(picker) {
|
|
|
- const end = new Date();
|
|
|
- const start = new Date();
|
|
|
- start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
|
|
|
- picker.$emit("pick", [start, end]);
|
|
|
- },
|
|
|
- },
|
|
|
- ],
|
|
|
+ pages:1,
|
|
|
+ size:-1,
|
|
|
+ sopName: undefined,
|
|
|
+ sopCode: undefined
|
|
|
},
|
|
|
+ LotoOptions:[],//电柜绑定
|
|
|
// 表单参数
|
|
|
form: {},
|
|
|
- noShow: false,
|
|
|
- open:false,//排序弹窗
|
|
|
- dialogForm:{}
|
|
|
- };
|
|
|
+ // 表单校验
|
|
|
+ rules: {
|
|
|
+ sopCode: [
|
|
|
+ { required: true, message: 'SOP编码不能为空', trigger: 'blur' }
|
|
|
+ ],
|
|
|
+ sopName: [
|
|
|
+ { required: true, message: 'SOP名称不能为空', trigger: 'blur' }
|
|
|
+ ],
|
|
|
+ workstationId:[
|
|
|
+ { required: true, message: '岗位不能为空', trigger: 'blur' }
|
|
|
+ ],
|
|
|
+ lotoId:[
|
|
|
+ { required: true, message: '电柜不能为空', trigger: 'blur' }
|
|
|
+ ],
|
|
|
+ machineryId:[
|
|
|
+ { required: true, message: '设备/工艺不能为空', trigger: 'blur' }
|
|
|
+ ]
|
|
|
+ }
|
|
|
+ }
|
|
|
},
|
|
|
created() {
|
|
|
- this.getList();
|
|
|
- this.getworkShop();
|
|
|
+ this.getList()
|
|
|
+ },
|
|
|
+ watch:{
|
|
|
+ "form.workstationId":function(newVal,oldVal){
|
|
|
+ if(newVal){
|
|
|
+ const data={
|
|
|
+ pasge:1,
|
|
|
+ size:-1,
|
|
|
+ workstationId:this.form.workstationId
|
|
|
+ }
|
|
|
+ listTechnology(data).then(response => {
|
|
|
+ this.machineryOptions = this.handleTree(response.data.records,"machineryId","parentId")
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
},
|
|
|
-
|
|
|
methods: {
|
|
|
- ...mapActions("sopSelectPoints", [
|
|
|
- "setSopEdit",
|
|
|
- "setSopLook",
|
|
|
- "setMapData",
|
|
|
- ]),
|
|
|
- // sop序号排序函数
|
|
|
- handleByOrder(row){
|
|
|
- this.dialogForm.sopId=row.sopId
|
|
|
- this.dialogForm.sopIndex=row.sopIndex
|
|
|
- this.open=true
|
|
|
- },
|
|
|
- // 取消按钮
|
|
|
- ByOrdercancel() {
|
|
|
- this.open = false
|
|
|
- },
|
|
|
- // 排序函数确认
|
|
|
- ByOrderconfirm(){
|
|
|
- updateIsSopIndexAPI(this.dialogForm).then(res => {
|
|
|
- console.log(res)
|
|
|
- this.open=false
|
|
|
- this.getList()
|
|
|
+ /** 查询部门列表 */
|
|
|
+ getList() {
|
|
|
+ this.loading = true
|
|
|
+ getIsMarsSopPage(this.queryParams).then(response => {
|
|
|
+ debugger;
|
|
|
+ this.deptList = response.data.records
|
|
|
+ this.loading = false
|
|
|
})
|
|
|
- },
|
|
|
- // 格式化日期查询数据
|
|
|
- formatDate(date) {
|
|
|
- if (date && date instanceof Date && !isNaN(date)) {
|
|
|
- // 使用本地时间
|
|
|
- return `${date.getFullYear()}-${String(date.getMonth() + 1).padStart(
|
|
|
- 2,
|
|
|
- "0"
|
|
|
- )}-${String(date.getDate()).padStart(2, "0")}`;
|
|
|
+ const data={
|
|
|
+ pasge:1,
|
|
|
+ size:-1
|
|
|
}
|
|
|
- return null;
|
|
|
+ listMarsDept(data).then(response => {
|
|
|
+ this.marsOptions = this.handleTree(response.data.records,"workstationId","parentId")
|
|
|
+ })
|
|
|
+ listLoto(data).then(response => {
|
|
|
+ this.LotoOptions = response.data.records.map(item => {
|
|
|
+ return {
|
|
|
+ value: item.lotoId,
|
|
|
+ label: item.lotoName
|
|
|
+ }
|
|
|
+ })
|
|
|
+ })
|
|
|
+ listTechnology(data).then(response => {
|
|
|
+ this.machineryOptions = this.handleTree(response.data.records,"machineryId","parentId")
|
|
|
+ })
|
|
|
},
|
|
|
- /** 查询sop列表 */
|
|
|
- getList() {
|
|
|
- this.loading = true;
|
|
|
- // 格式化日期并更新queryParams
|
|
|
- if (Array.isArray(this.createTime) && this.createTime.length === 2) {
|
|
|
- this.queryParams.startTime = this.formatDate(this.createTime[0]);
|
|
|
- this.queryParams.endTime = this.formatDate(this.createTime[1]);
|
|
|
+ /** 转换mars岗位数据结构 */
|
|
|
+ Marsnormalizer(node) {
|
|
|
+ if (node.children && !node.children.length) {
|
|
|
+ delete node.children
|
|
|
+ }
|
|
|
+ return {
|
|
|
+ id: node.workstationId,
|
|
|
+ label: node.workstationName,
|
|
|
+ children: node.children
|
|
|
}
|
|
|
- getIsSopPage(this.queryParams).then((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) {
|
|
|
+ /** 转换mars岗位数据结构 */
|
|
|
+ machinerynormalizer(node) {
|
|
|
if (node.children && !node.children.length) {
|
|
|
- delete node.children;
|
|
|
+ delete node.children
|
|
|
}
|
|
|
return {
|
|
|
- id: node.workareaId,
|
|
|
- label: node.workareaName,
|
|
|
- children: node.children,
|
|
|
- };
|
|
|
- },
|
|
|
- // 获取车间数据
|
|
|
- getworkShop() {
|
|
|
- workshoplistAll().then((response) => {
|
|
|
- // console.log(response, "获取车间数据");
|
|
|
- this.workshopList = response.data.map((item) => {
|
|
|
- return {
|
|
|
- label: item.workshopName,
|
|
|
- value: item.workshopId,
|
|
|
- key: item.workshopCode,
|
|
|
- };
|
|
|
- });
|
|
|
- console.log(this.workshopList[0].value, "数据拿到了吗");
|
|
|
- });
|
|
|
- },
|
|
|
- // 所属车间下拉改变作业区域内容
|
|
|
- workShopChange() {
|
|
|
- // console.log("我被切换了内容");
|
|
|
- this.queryParams.workareaId = "";
|
|
|
- this.getworkArea();
|
|
|
- // console.log(this.workareaList, "数据拿到了吗");
|
|
|
- },
|
|
|
- // 获取作业区域数据
|
|
|
- getworkArea() {
|
|
|
- const workshopId = this.queryParams.workshopId;
|
|
|
- // const workshopId = this.workshopList.map((workshop) => workshop.value);
|
|
|
- console.log(workshopId, "数据格式");
|
|
|
- console.log(workshopId, "workshopId");
|
|
|
- if (workshopId) {
|
|
|
- getIsWorkareaList(workshopId).then((response) => {
|
|
|
- // console.log(response, "获取作业区域数据");
|
|
|
- this.workareaList = response.data.map((item) => {
|
|
|
- return {
|
|
|
- label: item.workareaName,
|
|
|
- value: item.workareaId,
|
|
|
- key: item.workareaCode,
|
|
|
- };
|
|
|
- });
|
|
|
- console.log(this.workareaList, "数据吗");
|
|
|
- });
|
|
|
+ id: node.machineryId,
|
|
|
+ label: node.machineryName,
|
|
|
+ children: node.children
|
|
|
}
|
|
|
},
|
|
|
+
|
|
|
// 取消按钮
|
|
|
cancel() {
|
|
|
- this.reset();
|
|
|
+ this.open = false
|
|
|
+ this.reset()
|
|
|
},
|
|
|
// 表单重置
|
|
|
reset() {
|
|
|
this.form = {
|
|
|
- sopCode: null,
|
|
|
- sopName: null,
|
|
|
- sopStatus: null,
|
|
|
- workshopName: null,
|
|
|
- workareaName: null,
|
|
|
- pointCount: null,
|
|
|
- sopType: null,
|
|
|
- createTime: null,
|
|
|
- };
|
|
|
- this.resetForm("form");
|
|
|
+ sopId: undefined,
|
|
|
+ parentId: undefined,
|
|
|
+ sopName: undefined,
|
|
|
+ }
|
|
|
+ this.autoGenFlag = false;
|
|
|
+ this.resetForm('form')
|
|
|
+ },
|
|
|
+ //自动生成编码
|
|
|
+ handleAutoGenChange(autoGenFlag) {
|
|
|
+ if (autoGenFlag) {
|
|
|
+ genCode("SOP_CODE").then((response) => {
|
|
|
+ console.log(response,'设备工艺编码');
|
|
|
+ this.form.sopCode = response;
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ this.form.sopCode = null;
|
|
|
+ }
|
|
|
},
|
|
|
+
|
|
|
/** 搜索按钮操作 */
|
|
|
handleQuery() {
|
|
|
- this.queryParams.current = 1;
|
|
|
- this.getList();
|
|
|
+ this.getList()
|
|
|
},
|
|
|
/** 重置按钮操作 */
|
|
|
resetQuery() {
|
|
|
- this.createTime = "";
|
|
|
- (this.queryParams.startTime = ""),
|
|
|
- (this.queryParams.endTime = ""),
|
|
|
- this.resetForm("queryForm");
|
|
|
- this.handleQuery();
|
|
|
+ this.resetForm('queryForm')
|
|
|
+ this.handleQuery()
|
|
|
},
|
|
|
- // 多选框选中数据
|
|
|
- handleSelectionChange(selection) {
|
|
|
- this.ids = selection.map((item) => item.sopId);
|
|
|
- this.codes = selection.map((item) => item.sopCode);
|
|
|
- this.single = selection.length !== 1;
|
|
|
- this.multiple = !selection.length;
|
|
|
+
|
|
|
+ /** 展开/折叠操作 */
|
|
|
+ toggleExpandAll() {
|
|
|
+ this.refreshTable = false
|
|
|
+ this.isExpandAll = !this.isExpandAll
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.refreshTable = true
|
|
|
+ })
|
|
|
},
|
|
|
- /** 新增按钮操作a */
|
|
|
- handleAdd() {
|
|
|
- this.reset();
|
|
|
- this.setMapData(null);
|
|
|
- this.setSopLook(false);
|
|
|
- this.$router.push("/mes/sop/sopm/NewSop?sopId=null");
|
|
|
- this.title = "添加隔离点";
|
|
|
- // 新增或修改
|
|
|
- this.sopId = null;
|
|
|
+ /** 新增按钮操作 */
|
|
|
+ handleAdd(row) {
|
|
|
+ this.reset()
|
|
|
+ this.open = true
|
|
|
+ this.title = '添加SOP'
|
|
|
+
|
|
|
+
|
|
|
},
|
|
|
/** 修改按钮操作 */
|
|
|
handleUpdate(row) {
|
|
|
- this.reset();
|
|
|
- this.setSopLook(false);
|
|
|
- this.$router.push(`/mes/sop/sopm/NewSopEdit?sopId=${row.sopId}`);
|
|
|
+ this.reset()
|
|
|
+ selectIsMarsSopById(row.sopId).then(response => {
|
|
|
+ this.form = response.data
|
|
|
+ this.open = true
|
|
|
+ this.title = '修改SOP'
|
|
|
+
|
|
|
+ })
|
|
|
},
|
|
|
- // 查看操作
|
|
|
- handleLook(row) {
|
|
|
- // 设置为true表示作业票里查看不可以点击隔离点
|
|
|
- this.setSopLook(true);
|
|
|
- this.$router.push(`/mes/sop/sopm/sopmLook?sopId=${row.sopId}`);
|
|
|
+ /** 提交按钮 */
|
|
|
+ submitForm: function() {
|
|
|
+ this.$refs['form'].validate(valid => {
|
|
|
+ if (valid) {
|
|
|
+ if (this.form.sopId != undefined) {
|
|
|
+ updateIsMarsSop(this.form).then(response => {
|
|
|
+ this.$modal.msgSuccess('修改成功')
|
|
|
+ this.open = false
|
|
|
+ this.getList()
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ addinsertIsMarsSop(this.form).then(response => {
|
|
|
+ this.$modal.msgSuccess('新增成功')
|
|
|
+ this.open = false
|
|
|
+ this.getList()
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
},
|
|
|
/** 删除按钮操作 */
|
|
|
handleDelete(row) {
|
|
|
- const sopIds = row.sopId || this.ids;
|
|
|
- const sopCodes = row.sopCode || this.codes;
|
|
|
- this.$modal
|
|
|
- .confirm('是否确认删除SOP编号为"' + sopCodes + '"的数据项?')
|
|
|
- .then(function () {
|
|
|
- return deleteIsSopBySopIds(sopIds);
|
|
|
- })
|
|
|
- .then(() => {
|
|
|
- this.getList();
|
|
|
- this.$modal.msgSuccess("删除成功");
|
|
|
- })
|
|
|
- .catch(() => {});
|
|
|
- },
|
|
|
- /** 导出按钮操作 */
|
|
|
- // handleExport() {
|
|
|
- // this.download(
|
|
|
- // "cal/team/export",
|
|
|
- // {
|
|
|
- // ...this.queryParams,
|
|
|
- // },
|
|
|
- // `team_${new Date().getTime()}.xlsx`
|
|
|
- // );
|
|
|
- // },
|
|
|
- },
|
|
|
-};
|
|
|
-</script>
|
|
|
-<style lang="scss" src="@/assets/styles/dialog-title.scss" scoped>
|
|
|
-.el-input-width {
|
|
|
- width: 380px !important;
|
|
|
+ this.$modal.confirm('是否确认删除名称为"' + row.sopName + '"的数据项?').then(function() {
|
|
|
+ return deleteIsMarsSopByMarsSopIds(row.sopId)
|
|
|
+ }).then(() => {
|
|
|
+ this.getList()
|
|
|
+ this.$modal.msgSuccess('删除成功')
|
|
|
+ }).catch(() => {
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
-</style>
|
|
|
+</script>
|