Procházet zdrojové kódy

修改部分mars分配人需求与数据权限

pm před 10 měsíci
rodič
revize
0fe4e99a78

+ 1 - 1
src/api/mes/job/job.js

@@ -81,7 +81,7 @@ export function updateJobToFinish(data) {
     data:data
   })
 }
-//mars八大步骤作业票执行 取消作业票
+//mars八大步骤作业票执行 取消作业票
 export function updateJobToCancel(data) {
   return request({
     url: '/iscs/ticket/updateJobToCancel',

+ 21 - 4
src/components/tinymce/example/Index.vue

@@ -1,11 +1,13 @@
 <template>
   <div>
-    <Tinymce v-model="defaultValue" :height="300" placeholder="在这里输入文字" />
+    <Tinymce v-model="defaultValue" :height="660" placeholder="在这里输入文字" />
+    <el-button type="primary" style="float:right;margin: 10px" @click="save">保存</el-button>
   </div>
 </template>
 
 <script>
 import Tinymce from '../index.vue'
+import {updateTechnology,getTechnologyInfo} from "../../../api/system/machinery"
 
 export default {
   components: {
@@ -16,7 +18,8 @@ export default {
   },
   data() {
     return {
-      defaultValue: '<p>配置文档参阅:http://tinymce.ax-z.cn</p>'
+      defaultValue: '',
+      form:null,
     }
   },
   computed: {
@@ -26,13 +29,27 @@ export default {
 
   },
   created() {
-
+  this.getInfo()
   },
   mounted() {
 
   },
   methods: {
-
+    getInfo(){
+      getTechnologyInfo(this.$route.query.machineryId).then((response) => {
+        this.form=response.data
+        this.defaultValue=response.data.remark
+      })
+    },
+    save(){
+      this.form.remark=this.defaultValue
+      updateTechnology(this.form).then(response => {
+        console.log(response,'更新设备工艺')
+        if(response.data){
+          this.$message.success('保存成功')
+        }
+      })
+    }
   }
 }
 </script>

+ 1 - 1
src/components/tinymce/index.vue

@@ -1,5 +1,5 @@
 <template>
-  <textarea :id="tinymceId" style="visibility: hidden" />
+  <textarea :id="tinymceId" style="visibility: hidden;" />
 </template>
 
 <script>

+ 526 - 0
src/views/mes/job/joblist/index.vue

@@ -0,0 +1,526 @@
+<template>
+  <div class="app-container">
+    <el-form
+      :model="queryParams"
+      ref="queryForm"
+      size="small"
+      :inline="true"
+      v-show="showSearch"
+      label-width="100px"
+    >
+
+      <el-form-item label="作业票名称" prop="ticketName">
+        <el-input
+          v-model="queryParams.ticketName"
+          placeholder="请输入作业票名称"
+          clearable
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="设备/工艺" prop="machineryId">
+        <treeselect
+          style="width: 218px"
+          v-model="queryParams.machineryId"
+          :options="TechnologyOptions"
+          :normalizer="Technologynormalizer"
+          placeholder="选择设备工艺"
+        />
+      </el-form-item>
+      <el-form-item label="岗位" prop="workstationId">
+        <treeselect
+          style="width: 218px"
+          v-model="queryParams.workstationId"
+          :options="marsOptions"
+          :normalizer="normalizer"
+          placeholder="选择岗位"
+        />
+      </el-form-item>
+      <el-form-item label="状态" prop="ticketStatus">
+        <el-select v-model="queryParams.ticketStatus" placeholder="状态">
+          <el-option
+            v-for="dict in dict.type.ticket_status"
+            :key="dict.value"
+            :label="dict.label"
+            :value="dict.value"
+          />
+        </el-select>
+      </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="作业类型" prop="ticketType">
+        <el-select
+          v-model="queryParams.ticketType"
+          placeholder="请选择作业类型"
+        >
+          <el-option
+            v-for="dict in dict.type.ticket_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-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('hasSop')"
+                   v-hasPermi="['mes:job:jobm:add']"
+        >新增sop作业票
+        </el-button>
+      </el-col>
+<!--      <el-col :span="1.5">-->
+<!--        <el-button v-no-more-click-->
+<!--                   type="primary"-->
+<!--                   plain-->
+<!--                   icon="el-icon-plus"-->
+<!--                   size="mini"-->
+<!--                   @click="handleAdd('noSop')"-->
+<!--                   v-hasPermi="['mes:job:jobm: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>
+      </el-col>
+      <right-toolbar
+        :showSearch.sync="showSearch"
+        @queryTable="getList"
+      ></right-toolbar>
+    </el-row>
+
+    <el-table
+      v-loading="loading"
+      :data="jobList"
+      @selection-change="handleSelectionChange"
+    >
+      <el-table-column type="selection" width="55" align="center" />
+      <el-table-column label="作业票名称" align="center" prop="ticketName" width="270"/>
+      <el-table-column label="所属岗位" align="center" prop="workstationName">
+      </el-table-column>
+      <el-table-column label="设备工艺" align="center" prop="machineryName"></el-table-column>
+      <el-table-column label="状态" align="center" prop="ticketStatus">
+        <template slot-scope="scope">
+          <dict-tag
+            :options="dict.type.ticket_status"
+            :value="scope.row.ticketStatus"
+          />
+        </template>
+      </el-table-column>
+      <el-table-column label="作业类型" align="center" prop="ticketType">
+        <template slot-scope="scope">
+          <dict-tag
+            :options="dict.type.ticket_type"
+            :value="scope.row.ticketType"
+          />
+        </template>
+      </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>
+      <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:job:jobm:edit']"-->
+<!--          >编辑-->
+<!--          </el-button>-->
+<!--          <el-button v-no-more-click-->
+<!--                     size="mini"-->
+<!--                     type="text"-->
+<!--                     icon="el-icon-view"-->
+<!--                     @click="handleLook(scope.row)"-->
+<!--                     v-hasPermi="['mes:job:jobm:progress']"-->
+<!--          >查看-->
+<!--          </el-button>-->
+          <el-button v-no-more-click
+                     size="mini"
+                     type="text"
+                     icon="el-icon-delete"
+                     @click="handleDelete(scope.row)"
+                     v-hasPermi="['mes:job:jobm: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"
+    />
+  </div>
+</template>
+
+<script>
+import {
+  getJobTicketInfo,
+  listJobTicket,
+  deleteIsJobTicket,
+} from "@/api/mes/job/job";
+
+import { genCode } from "@/api/system/autocode/rule";
+import { mapActions } from "vuex";
+
+import Treeselect from "@riophae/vue-treeselect";
+import "@riophae/vue-treeselect/dist/vue-treeselect.css";
+
+import { listMarsDept } from '@/api/system/marsdept'
+import { listTechnology } from '@/api/system/machinery'
+export default {
+  name: "Team",
+  components: { Treeselect },
+  dicts: ["ticket_type", "ticket_status"],
+  data() {
+    return {
+      //自动生成编码
+      autoGenFlag: false,
+      optType: undefined,
+      // 遮罩层
+      loading: true,
+      // 选中数组
+      ids: [],
+      codes: [],
+      // 非单个禁用
+      single: true,
+      // 非多个禁用
+      multiple: true,
+      // 显示搜索条件
+      showSearch: true,
+      // 总条数
+      total: 0,
+      // 班组表格数据
+      jobList: [],
+      //mars岗位树选项
+      marsOptions: [],
+      // 弹出层标题
+      title: "",
+      // 是否显示弹出层
+      open: false,
+      // 车间数据
+      workshopList: [],
+      // 作业区域数据
+      workareaList: [],
+      // 查询参数
+      createTime: "",
+      queryParams: {
+        current: 1,
+        size: 10,
+        ticketCode: null,
+        ticketName: null,
+        ticketStatus: null,
+        workshopId: null,
+        workareaId: null,
+        ticketType: 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]);
+            },
+          },
+        ],
+      },
+      // 表单参数
+      form: {},
+      TechnologyOptions:[],//设备工艺查询下拉
+      //
+    };
+  },
+  created() {
+    this.getList();
+
+  },
+
+  methods: {
+    ...mapActions("sopSelectPoints", [
+      "setSopEdit",
+      "setSopLook",
+      "setJobLook",
+      "selectSopPoints",
+      "PointTableData",
+      "PointTableData",
+      "setMapData",
+      'setVisibleSopSelect'
+    ]),
+    // 格式化日期查询数据
+    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")}`;
+      }
+      return null;
+    },
+    /** 查询班组列表 */
+    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]);
+      }
+      listJobTicket(this.queryParams).then((response) => {
+        console.log(response, "response--作业票列表");
+        this.jobList = response.data.records;
+        this.total = response.data.total;
+        this.loading = false;
+      });
+
+      const data={
+        pasge:1,
+        size:-1
+      }
+      listMarsDept(data).then(response => {
+        this.marsOptions = this.handleTree(response.data.records,"workstationId","parentId")
+      })
+      listTechnology(data).then((response) => {
+        this.TechnologyOptions = this.handleTree(response.data.records,"machineryId","parentId")
+      })
+    },
+    /** 转换部门数据结构 */
+    normalizer(node) {
+      if (node.children && !node.children.length) {
+        delete node.children;
+      }
+      return {
+        id: node.workstationId,
+        label: node.workstationName,
+        children: node.children,
+      };
+    },
+    Technologynormalizer(node) {
+      if (node.children &&!node.children.length) {
+        delete node.children;
+      }
+      return {
+        id: node.machineryId,
+        label: node.machineryName,
+        children: node.children,
+      };
+    },
+
+    // 取消按钮
+    cancel() {
+      this.open = false;
+      this.reset();
+    },
+    // 表单重置
+    reset() {
+      this.form = {
+        ticketCode: null,
+        ticketName: null,
+        ticketStatus: null,
+        workstationId: null,
+        workstationName: null,
+        ticketType: null,
+        pointCount: null,
+        createTime: null,
+      };
+      this.resetForm("form");
+    },
+    /** 搜索按钮操作 */
+    handleQuery() {
+      this.queryParams.current = 1;
+      this.getList();
+    },
+    /** 重置按钮操作 */
+    resetQuery() {
+      this.createTime = "";
+      (this.queryParams.startTime = ""),
+        (this.queryParams.endTime = ""),
+
+        this.resetForm("queryForm");
+      this.handleQuery();
+    },
+    // 多选框选中数据
+    handleSelectionChange(selection) {
+      this.ids = selection.map((item) => item.ticketId);
+      this.codes = selection.map((item) => item.ticketName);
+      this.single = selection.length !== 1;
+      this.multiple = !selection.length;
+    },
+    /** 新增按钮操作 */
+    handleAdd(val) {
+      if(val=='hasSop'){
+        this.setVisibleSopSelect(true)
+      }else {
+        this.setVisibleSopSelect(false)
+      }
+      this.reset();
+      this.open = true;
+      this.selectSopPoints(null);
+      this.PointTableData(null);
+      // this.$router.push(`/mes/job/jobm/NewOperations?ticketId=null`);//黄总原来的作业票新增
+      this.$router.push({
+        name:'NewMarsJob'
+      });
+      this.title = "添加隔离点";
+      this.optType = "add";
+      this.setSopLook(false);
+      this.setMapData(null);
+    },
+    // 查看
+    handleLook(row) {
+      // 设置为true表示作业票里查看不可以点击隔离点
+      this.setSopLook(true);
+      this.$router.push(`/mes/job/jobm/lookWork?ticketId=${row.ticketId}`);
+    },
+
+    /** 修改按钮操作 */
+    handleUpdate(row) {
+      console.log(row,'作业票编辑拿到的row');
+      this.reset();
+      const teamId = row.ticketId || this.ids;
+      this.setSopLook(false);
+      // 如果编辑的是带有sop模板的 就不允许点击 新增或者删除隔离点
+
+      this.$router.push(
+        `/mes/job/jobm/NewOperationsEdit?ticketId=${row.ticketId}`
+      );
+      getJobTicketInfo(teamId).then((response) => {
+        this.form = response.data;
+        this.open = true;
+        this.title = "修改隔离点信息";
+        this.optType = "edit";
+      });
+    },
+    /** 提交按钮 */
+    submitForm() {
+      this.$refs["form"].validate((valid) => {
+        if (valid) {
+          if (this.form.teamId != null) {
+            updateTeam(this.form).then((response) => {
+              this.$modal.msgSuccess("修改成功");
+              this.open = false;
+              this.getList();
+            });
+          } else {
+            addTeam(this.form).then((response) => {
+              this.$modal.msgSuccess("新增成功");
+              this.open = false;
+              this.getList();
+            });
+          }
+        }
+      });
+    },
+    /** 删除按钮操作 */
+    handleDelete(row) {
+      const teamIds = row.ticketId || this.ids;
+      const ticketNames = row.ticketName || this.codes;
+      this.$modal
+        .confirm('是否确认删除作业票编号为"' + ticketNames + '"的数据项?')
+        .then(function () {
+          return deleteIsJobTicket(teamIds);
+        })
+        .then(() => {
+          this.getList();
+          this.$modal.msgSuccess("删除成功");
+        })
+        .catch(() => {});
+    },
+    /** 导出按钮操作 */
+    handleExport() {
+      this.download(
+        "cal/team/export",
+        {
+          ...this.queryParams,
+        },
+        `team_${new Date().getTime()}.xlsx`
+      );
+    },
+    //自动生成编码
+    handleAutoGenChange(autoGenFlag) {
+      if (autoGenFlag) {
+        genCode("CAL_TEAM_CODE").then((response) => {
+          this.form.teamCode = response;
+        });
+      } else {
+        this.form.teamCode = null;
+      }
+    },
+  },
+};
+</script>
+<style lang="scss" src="@/assets/styles/dialog-title.scss" scoped>
+.el-input-width {
+  width: 380px !important;
+}
+</style>

+ 273 - 239
src/views/mes/job/jobm/NewMarsJob.vue

@@ -5,54 +5,6 @@
       <el-radio-button label="second">选择SOP</el-radio-button>
       <el-radio-button label="third">作业详情</el-radio-button>
     </el-radio-group>
-    <!-- <div
-      style="
-        display: flex;
-        justify-content: center;
-        align-items: center;
-        position: relative;
-      "
-      v-show="tabPosition == 'first'"
-    >
-      <img
-        style="width: 1250px; height: 700px"
-        src="@/assets/images/marsBg.png"
-        alt=""
-      />
-      <img
-        v-for="(ticket, index) in TicketListPage"
-        :key="ticket.ticketId"
-        :style="{
-          width: '35px',
-          cursor: 'pointer',
-          height: '35px',
-          position: 'absolute',
-          top: '220px',
-          left: `calc(700px + 40px * ${index})`,
-        }"
-        :src="require('@/assets/images/marsPoint.png')"
-        alt=""
-        @click="handleTicketClick(ticket)"
-      />
-      <img
-        v-for="(ticket, index) in COCOTicketListPage"
-        :key="ticket.ticketId"
-        :style="{
-          width: '35px',
-          cursor: 'pointer',
-          height: '35px',
-          position: 'absolute',
-          top: '440px',
-          left: `calc(880px + 40px * ${index})`,
-        }"
-        :src="require('@/assets/images/marsPoint.png')"
-        alt=""
-        @click="handleTicketClick(ticket)"
-      />
-      <div class="deptXLG" @click="handelChange('second', 8, 'R&R')">R&R</div>
-      <div class="deptCCO" @click="handelChange('second', 7, 'CCO')">CCO</div>
-    </div> -->
-
     <div
       style="
         display: flex;
@@ -131,7 +83,7 @@
         :data="marsSopPage"
         @selection-change="handleSelectionChange"
       >
-        <el-table-column type="selection" width="55" align="center" />
+        <el-table-column type="selection" width="55" align="center"/>
         <el-table-column
           label="设备/工艺名称"
           align="center"
@@ -163,7 +115,8 @@
         type="primary"
         style="margin-left: 140px"
         @click="handelChange('third')"
-        >开始执行</el-button
+      >开始执行
+      </el-button
       >
     </div>
     <div
@@ -179,7 +132,7 @@
             <div slot="header" class="clearfix">
               <span>工艺/设备 工艺图</span>
             </div>
-            <img style="margin-left: 25%" :src="this.machineryImg" alt="" />
+            <img style="margin-left: 25%" :src="this.machineryImg" alt=""/>
           </el-card>
         </div>
         <div class="left-bottom">
@@ -244,25 +197,27 @@
                         </span>
                         <span v-if="scope.row.conflictJobNum !== null">
                           <i class="el-icon-s-claim">{{
-                            scope.row.conflictJobNum
-                          }}</i>
+                              scope.row.conflictJobNum
+                            }}</i>
                         </span>
                       </template>
                     </el-table-column>
                     <el-table-column label="状态" prop="stepStatus">
                       <template slot-scope="scope">
-                        <span v-if="scope.row.stepStatus !== '1'">
-                          <el-button
-                            type="primary"
-                            plain
-                            size="small"
-                            @click="addInside(scope.row)"
-                            >{{
-                              scope.row.stepIndex == "3" ? "分配" : "执行"
-                            }}</el-button
-                          >
+                        <!-- 判断逻辑 -->
+                        <span
+                          v-if="scope.row.stepIndex == '3' && (scope.row.stepStatus !== '1' || !isStepFourExecuted)"
+                        >
+                             <el-button
+                               type="primary"
+                               plain
+                               size="small"
+                               @click="addInside(scope.row)"
+                             >
+                               分配
+                             </el-button>
                         </span>
-                        <span v-if="scope.row.stepStatus == '1'">
+                        <span v-if="scope.row.stepIndex == '3' && scope.row.stepStatus === '1' && isStepFourExecuted">
                           <span
                             style="
                               display: inline-block;
@@ -274,9 +229,35 @@
                             "
                           ></span>
                           <span>已执行</span>
+                      </span>
+
+                        <!-- 其他步骤 -->
+                        <span v-if="scope.row.stepIndex != '3' && scope.row.stepStatus !== '1'">
+                            <el-button
+                              type="primary"
+                              plain
+                              size="small"
+                              @click="addInside(scope.row)"
+                            >
+                              执行
+                            </el-button>
+                       </span>
+                        <span v-if="scope.row.stepIndex != '3' && scope.row.stepStatus === '1'">
+                            <span
+                              style="
+                                display: inline-block;
+                                width: 8px;
+                                height: 8px;
+                                margin: 1%;
+                                border-radius: 50%;
+                                background: #6aabfb;
+                              "
+                            ></span>
+                            <span>已执行</span>
                         </span>
                       </template>
                     </el-table-column>
+
                     <el-table-column
                       label="内容"
                       prop="stepContent"
@@ -295,7 +276,7 @@
                             type="text"
                             size="small"
                             @click="checkDetail(scope.row)"
-                            >查看</el-button
+                          >查看</el-button
                           >
                         </span>
                       </template>
@@ -306,13 +287,15 @@
             </div>
           </div>
           <el-button style="float: right" type="primary" @click="finshJobticket"
-            >结束作业</el-button
+          >结束作业
+          </el-button
           >
           <el-button
             style="float: right; margin-right: 10px"
             type="danger"
             @click="cancelJobticket"
-            >取消作业</el-button
+          >取消作业
+          </el-button
           >
         </el-card>
       </div>
@@ -332,6 +315,7 @@
               clearable
               style="width: 230px"
               @change="handlelockerChage"
+              @clear="handlelockerClear"
             >
               <el-option
                 v-for="dict in this.listLockerOption"
@@ -350,14 +334,16 @@
             <el-table
               :data="insideTableData"
               stripe
+              ref="insideTable"
               height="400"
               @selection-change="InSelectionChange"
               :header-cell-style="{
                 'background-color': '#afccfd',
                 color: 'white',
               }"
+
             >
-              <el-table-column type="selection" width="55" align="center" />
+              <el-table-column type="selection" width="55" align="center"/>
               <el-table-column prop="userId" label="内部人员Id">
               </el-table-column>
               <el-table-column prop="nickName" label="姓名">
@@ -372,6 +358,7 @@
             <el-table
               :data="outsideTableData"
               stripe
+              ref="outsideTable"
               height="400"
               @selection-change="OutSelectionChange"
               :header-cell-style="{
@@ -379,7 +366,7 @@
                 color: 'white',
               }"
             >
-              <el-table-column type="selection" width="55" align="center" />
+              <el-table-column type="selection" width="55" align="center"/>
               <el-table-column prop="userId" label="外部人员Id">
               </el-table-column>
               <el-table-column prop="nickName" label="姓名">
@@ -403,8 +390,8 @@
               <el-table-column prop="userType" label="来源">
                 <template slot-scope="scope">
                   <span style="color: #2a87ff">{{
-                    scope.row.userType == "0" ? "内部" : "外部"
-                  }}</span>
+                      scope.row.userType == '0' ? '内部' : '外部'
+                    }}</span>
                 </template>
               </el-table-column>
               <el-table-column label="操作" width="80">
@@ -427,7 +414,8 @@
       </el-form>
       <div slot="footer" class="dialog-footer">
         <el-button v-no-more-click type="primary" @click="confirmAddUser"
-          >确认</el-button
+        >确认
+        </el-button
         >
         <el-button v-no-more-click @click="cancel">取 消</el-button>
       </div>
@@ -496,13 +484,13 @@
                     <span
                       v-else-if="scope.row.jobStatus == 4"
                       style="font-size: 20px; line-height: 30px"
-                      >🔒</span
+                    >🔒</span
                     >
                     <!-- 显示对号 -->
                     <span
                       v-else-if="scope.row.jobStatus == 5"
                       style="font-size: 20px; line-height: 30px"
-                      >✓</span
+                    >✓</span
                     >
                   </div>
                 </template>
@@ -536,13 +524,13 @@
                     <span
                       v-else-if="scope.row.jobStatus == 4"
                       style="font-size: 20px; line-height: 30px"
-                      >🔒</span
+                    >🔒</span
                     >
                     <!-- 显示对号 -->
                     <span
                       v-else-if="scope.row.jobStatus == 5"
                       style="font-size: 20px; line-height: 30px"
-                      >✓</span
+                    >✓</span
                     >
                   </div>
                 </template>
@@ -576,13 +564,13 @@
                     <span
                       v-else-if="scope.row.pointStatus == 1"
                       style="font-size: 20px; line-height: 30px"
-                      >🔒</span
+                    >🔒</span
                     >
                     <!-- 显示对号 -->
                     <span
                       v-else-if="scope.row.pointStatus == 2"
                       style="font-size: 20px; line-height: 30px"
-                      >✓</span
+                    >✓</span
                     >
                   </div>
                 </template>
@@ -605,10 +593,10 @@
 </template>
 
 <script>
-import { listMarsDept } from "@/api/system/marsdept";
-import { getTechnologyInfo, listTechnology } from "@/api/system/machinery";
-import Template from "@/views/print/printtemplate/list.vue";
-import { getIsMarsSopPage } from "@/api/mes/sop/sopindex";
+import { listMarsDept } from '@/api/system/marsdept'
+import { getTechnologyInfo, listTechnology } from '@/api/system/machinery'
+import Template from '@/views/print/printtemplate/list.vue'
+import { getIsMarsSopPage } from '@/api/mes/sop/sopindex'
 import {
   addJobTicket,
   addJobUsers,
@@ -619,23 +607,23 @@ import {
   listJobTicket,
   updateJobStep,
   updateJobToCancel,
-  updateJobToFinish,
-} from "@/api/mes/job/job";
-import MapData from "@/views/mes/job/jobm/Mapdata.vue";
-import { getUserList } from "@/api/mes/workCard";
-import { getJobPlayTicketInfo } from "@/api/mes/jobplay/jobplay";
-import { getLotoInfo, getLotoMapInfo } from "@/api/mes/lotoStation/lotoStation";
+  updateJobToFinish
+} from '@/api/mes/job/job'
+import MapData from '@/views/mes/job/jobm/Mapdata.vue'
+import { getUserList } from '@/api/mes/workCard'
+import { getJobPlayTicketInfo } from '@/api/mes/jobplay/jobplay'
+import { getLotoInfo, getLotoMapInfo } from '@/api/mes/lotoStation/lotoStation'
 
 export default {
-  name: "NewSop",
+  name: 'NewSop',
   components: { Template, MapData },
-  dicts: ["sop_type", "ticket_status"],
+  dicts: ['sop_type', 'ticket_status'],
   data() {
     return {
-      tabPosition: "first",
-      selectedOption: "",
+      tabPosition: 'first',
+      selectedOption: '',
       marsSopPage: [], //岗位对应sop列表
-      marsSopTitle: "", //岗位后 对应展示sop
+      marsSopTitle: '', //岗位后 对应展示sop
       marsDeptList: [],
       listLockerOption: [], //上锁人下拉数据
       form: null, //存储选中的设备工艺sop列表数据
@@ -649,11 +637,11 @@ export default {
       insideTableData: [], //内部人员表格
       AllUserTable: [], //所有选中人员列表
       dialogForm: {
-        nickName: "",
-        username: "",
+        nickName: '',
+        username: ''
       },
       // 弹出层标题
-      title: "",
+      title: '',
       // 弹框中显示的form表单内容
       newticketUserDTOList: [], //为了上锁人单独传递数据
       FiveDetailvisible: false, //第五步详情弹窗
@@ -664,176 +652,221 @@ export default {
       TicketListPage: [], //作业票列表page接口传递的数据 底图循环渲染图标 RR岗位作业票
       selectPointList: [], //隔离点选中的表格渲染
       COCOTicketListPage: [], //CCO岗位的作业票
-      scaleFactor: 1, // 缩放比例,初始值为1
-    };
+      scaleFactor: 1 // 缩放比例,初始值为1
+    }
   },
   computed: {
     filteredSopTypes() {
       const sopTypesInMarsSopPage = this.marsSopPage.map(
         (item) => item.sopType
-      );
+      )
       return this.dict.type.sop_type.filter((option) =>
         sopTypesInMarsSopPage.includes(option.value)
-      );
+      )
+    },
+    isStepFourExecuted() {
+      const stepFour = this.EightStepForm.find((step) => step.stepIndex == "4");
+      return stepFour && stepFour.stepStatus === '1';
     },
   },
 
   mounted() {
-    this.getList();
+    this.getList()
   },
   methods: {
     handleTicketClick(data) {
-      console.log(data, "查看作业票详情");
-      this.ticketId = data.ticketId;
-      this.tabPosition = "third";
+      console.log(data, '查看作业票详情')
+      this.ticketId = data.ticketId
+      this.tabPosition = 'third'
       getStepInfo(this.ticketId).then((res) => {
-        this.EightStepForm = res.data;
-        console.log(res, "作业票-详细信息");
-      });
-      this.machineryId = data.machineryId;
+        this.EightStepForm = res.data
+        console.log(res, '作业票-详细信息')
+      })
+      this.machineryId = data.machineryId
       // 获取设备工艺图
       getTechnologyInfo(data.machineryId).then((res) => {
-        this.machineryImg = res.data.machineryImg;
+        this.machineryImg = res.data.machineryImg
         // 获取电柜选中隔离点
-        const lotoId = res.data.lotoId;
-        const selectPointsIds = res.data.pointIdList;
+        const lotoId = res.data.lotoId
+        const selectPointsIds = res.data.pointIdList
 
         getLotoMapInfo(lotoId).then((response) => {
-          console.log(response, "电柜信息--NewMarsJob");
+          console.log(response, '电柜信息--NewMarsJob')
           this.selectPointList = response.data.filter((item) =>
             selectPointsIds.includes(item.pointId)
-          );
-          console.log(this.selectPointList, "拿到的选中隔离点数据");
-        });
-      });
+          )
+          console.log(this.selectPointList, '拿到的选中隔离点数据')
+        })
+      })
     },
     getList() {
       const data = {
         pages: 1,
-        size: -1,
-      };
+        size: -1
+      }
       getWorkstationTicketList(data).then((res) => {
-        console.log(res, "查看-正在进行中作业票列表");
+        console.log(res, '查看-正在进行中作业票列表')
         this.TicketListPage = res.data.filter(
-          (item) => item.workstationId == "8"
-        );
+          (item) => item.workstationId == '8'
+        )
         this.COCOTicketListPage = res.data.filter(
-          (item) => item.workstationId == "7"
-        );
-      });
+          (item) => item.workstationId == '7'
+        )
+      })
       listTechnology(data).then((res) => {
-        console.log(res, "technologyList");
-        this.technologyList = res.data.records;
-      });
+        console.log(res, 'technologyList')
+        this.technologyList = res.data.records
+      })
       listMarsDept(data).then((res) => {
-        console.log(res, "marsDeptList");
-        this.marsDeptList = res.data.records;
-      });
+        console.log(res, 'marsDeptList')
+        this.marsDeptList = res.data.records
+      })
       const query = {
         pageSize: 10000,
-        pageNum: 1,
-      };
+        pageNum: 1
+      }
       getUserList(query).then((res) => {
-        console.log(res, "userList");
+        console.log(res, 'userList')
         this.listLockerOption = res.rows
           .filter((item) => item.unitId == 9)
           .map((item) => ({
             label: item.nickName,
-            value: item.userId,
-          }));
-      });
+            value: item.userId
+          }))
+      })
     },
     // 作业票切换
     handelChange(val, workstationId, workstationName) {
-      console.log(val);
-      this.tabPosition = val;
-      this.marsSopTitle = workstationName;
+      console.log(val)
+      this.tabPosition = val
+      this.marsSopTitle = workstationName
       if (workstationId) {
         const data = {
           pages: 1,
           size: -1,
-          workstationId: workstationId,
-        };
+          workstationId: workstationId
+        }
         getIsMarsSopPage(data).then((res) => {
-          console.log(res, "SopPage");
-          this.marsSopPage = res.data.records;
-        });
+          console.log(res, 'SopPage')
+          this.marsSopPage = res.data.records
+        })
       }
-      if (val == "third") {
+      if (val == 'third') {
         const data = {
-          sopId: this.form[0].sopId,
-        };
+          sopId: this.form[0].sopId
+        }
         addJobTicket(data).then((res) => {
-          console.log(res, "作业票新增");
-          this.$message.success("作业开始执行");
-          this.ticketId = res.data;
+          console.log(res, '作业票新增')
+          this.$message.success('作业开始执行')
+          this.ticketId = res.data
           getStepInfo(this.ticketId).then((res) => {
-            this.EightStepForm = res.data;
-            console.log(res, "作业票-详细信息");
-          });
-        });
+            this.EightStepForm = res.data
+            console.log(res, '作业票-详细信息')
+          })
+        })
       }
     },
     // 多选框选中数据
     handleSelectionChange(selection) {
-      console.log(selection, "mars设备工艺表格多选拿到的数据");
-      this.form = selection;
-      this.machineryId = selection[0].machineryId;
+      console.log(selection, 'mars设备工艺表格多选拿到的数据')
+      this.form = selection
+      this.machineryId = selection[0].machineryId
       getTechnologyInfo(selection[0].machineryId).then((res) => {
-        this.machineryImg = res.data.machineryImg;
-      });
+        this.machineryImg = res.data.machineryImg
+      })
     },
     // 添加内部人员
     addInside(row) {
-      if (row.stepIndex == "3") {
-        this.open = true;
+      if (row.stepIndex == '3') {
+        this.open = true
         const query = {
           pageSize: 10000,
-          pageNum: 1,
-        };
+          pageNum: 1
+        }
         getUserList(query).then((res) => {
-          this.insideTableData = res.rows.filter((item) => item.unitId == 9);
-          this.outsideTableData = res.rows.filter((item) => item.unitId != "9");
-          console.log(this.insideTableData, this.outsideTableData, "用户");
-        });
+          this.insideTableData = res.rows.filter((item) => item.unitId == 9)
+          this.outsideTableData = res.rows.filter((item) => item.unitId != '9')
+          console.log(this.insideTableData, this.outsideTableData, '用户')
+          // 获取已分配人员数据
+          getJobTicketInfo(this.ticketId).then((res) => {
+            const assignedUsers = res.data.jobTicketUserList || [];
+            console.log(assignedUsers, '已分配人员');
+            this.dialogForm.locker = assignedUsers
+              .filter(item => item.userRole == 'jtlocker')
+              .map(item => item.userName);
+            console.log(this.dialogForm.locker,'上锁人回显数据')
+            // 更新内部和外部用户的选中状态
+            this.$nextTick(() => {
+              // 手动选中内部人员
+              this.insideTableData.forEach((user) => {
+                const isAssigned = assignedUsers.some(
+                  (assigned) =>
+                    assigned.userId == user.userId && assigned.userType == '0'&&assigned.userRole!=='jtlocker'
+                );
+                if (isAssigned) {
+                  this.$refs.insideTable.toggleRowSelection(user, true);
+                }
+              });
+
+              // 手动选中外部人员
+              this.outsideTableData.forEach((user) => {
+                const isAssigned = assignedUsers.some(
+                  (assigned) =>
+                    assigned.userId == user.userId && assigned.userType == '1'&&assigned.userRole!=='jtlocker'
+                );
+                if (isAssigned) {
+                  this.$refs.outsideTable.toggleRowSelection(user, true);
+                }
+              });
+            });
+          });
+
+        })
+
       } else {
+
         const data = {
           stepId: row.stepId,
-          stepStatus: "1",
-        };
+          stepStatus: '1'
+        }
         updateJobStep(data).then((res) => {
-          this.$message.success("执行成功");
+          this.$message.success('执行成功')
           getStepInfo(this.ticketId).then((res) => {
-            this.EightStepForm = res.data;
-            console.log(res, "作业票-详细信息");
-          });
-        });
+            this.EightStepForm = res.data
+            console.log(res, '作业票-详细信息')
+          })
+        })
       }
     },
 
     // 上锁人下拉选择change事件
     handlelockerChage(val) {
-      console.log(val, "上锁人chage");
-      const user = this.listLockerOption.find((item) => item.value == val);
+      console.log(val, '上锁人chage')
+      this.$forceUpdate();
+      const user = this.listLockerOption.find((item) => item.value == val)
 
-      if (user && this.dialogForm.locker !== "") {
+      if (user && this.dialogForm.locker !== '') {
         const existingUser = this.listLockerOption.find(
           (u) => u.userName === user.label
-        );
+        )
         if (!existingUser) {
           this.newticketUserDTOList.push({
             userName: user.label,
             userId: user.value,
             userType: 0,
-            userRole: "jtlocker",
-          });
+            userRole: 'jtlocker'
+          })
 
-          console.log(this.newticketUserDTOList, "用户");
+          console.log(this.newticketUserDTOList, '用户')
         } else {
           // console.log('用户已存在', user.label)
         }
       }
     },
+    handlelockerClear(){
+      this.newticketUserDTOList = []
+      console.log(this.newticketUserDTOList, '清除后的用户');
+    },
     InSelectionChange(selection) {
       selection.forEach((item) => {
         if (!this.AllUserTable.some((user) => user.userId === item.userId)) {
@@ -841,11 +874,11 @@ export default {
             userName: item.nickName,
             userId: item.userId,
             userType: 0,
-            userRole: "jtcolocker",
-          });
+            userRole: 'jtcolocker'
+          })
         }
-      });
-      console.log(this.AllUserTable, "内部人员");
+      })
+      console.log(this.AllUserTable, '内部人员')
     },
 
     OutSelectionChange(selection) {
@@ -855,103 +888,103 @@ export default {
             userName: item.nickName,
             userId: item.userId,
             userType: 1,
-            userRole: "jtcolocker",
-          });
+            userRole: 'jtcolocker'
+          })
         }
-      });
-      console.log(this.AllUserTable, "外部人员");
+      })
+      console.log(this.AllUserTable, '外部人员')
     },
     confirmAddUser() {
       const data = {
         ticketId: this.ticketId,
-        ticketUserDTOList: [...this.AllUserTable, ...this.newticketUserDTOList],
-      };
-      console.log(data, "添加人员");
+        ticketUserDTOList: [...this.AllUserTable, ...this.newticketUserDTOList]
+      }
+      console.log(data, '添加人员')
       addJobUsers(data).then((res) => {
-        console.log(res, "添加人员");
+        console.log(res, '添加人员')
         if (res.data) {
-          this.$message.success("分配人员成功");
-          this.open = false;
-          this.AllUserTable = [];
-          this.dialogForm.locker = "";
+          this.$message.success('分配人员成功')
+          this.open = false
+          this.AllUserTable = []
+          this.dialogForm.locker = ''
           getStepInfo(this.ticketId).then((res) => {
-            this.EightStepForm = res.data;
-            console.log(res, "作业票-详细信息");
-          });
+            this.EightStepForm = res.data
+            console.log(res, '作业票-详细信息')
+          })
         }
-      });
+      })
     },
     // 人员列表删除
     deleteRow(index, rows) {
-      console.log(index, rows, "删除的行");
-      const deletedItem = rows[index]; // 获取要删除的项
-      rows.splice(index, 1); // 从显示的列表中删除
+      console.log(index, rows, '删除的行')
+      const deletedItem = rows[index] // 获取要删除的项
+      rows.splice(index, 1) // 从显示的列表中删除
 
       const formIndex = this.dialogForm.ticketUserDTOList.findIndex(
         (item) => item.userName == deletedItem.userName
-      );
+      )
       if (formIndex !== -1) {
-        this.dialogForm.ticketUserDTOList.splice(formIndex, 1); // 从 form.ticketUserDTOList 中删除
+        this.dialogForm.ticketUserDTOList.splice(formIndex, 1) // 从 form.ticketUserDTOList 中删除
       }
     },
     // 取消按钮
     cancel() {
-      this.open = false;
-      this.FiveDetailvisible = false;
+      this.open = false
+      this.FiveDetailvisible = false
     },
     // 作业票结束
     finshJobticket() {
       const data = {
-        ticketId: this.ticketId,
-      };
+        ticketId: this.ticketId
+      }
       updateJobToFinish(data).then((res) => {
-        console.log(res, "结束作业票");
+        console.log(res, '结束作业票')
         if (res.data) {
-          this.$message.success("作业票结束");
-          this.tabPosition = "first";
-          this.getList();
+          this.$message.success('作业票结束')
+          this.tabPosition = 'first'
+          this.getList()
         }
-      });
+      })
     },
     // 作业票取消
     cancelJobticket() {
       const data = {
-        ticketId: this.ticketId,
-      };
+        ticketId: this.ticketId
+      }
       updateJobToCancel(data).then((res) => {
-        console.log(res, "取消作业票");
+        console.log(res, '取消作业票')
         if (res.data) {
-          this.$message.success("作业票取消");
-          this.tabPosition = "first";
-          this.getList();
+          this.$message.success('作业票取消')
+          this.tabPosition = 'first'
+          this.getList()
         }
-      });
+      })
     },
     //   查看详情八大步骤
     checkDetail(row) {
-      if (row.stepIndex == "5") {
-        this.FiveDetailvisible = true;
-        let ticketId = this.ticketId;
+      if (row.stepIndex == '5') {
+        this.FiveDetailvisible = true
+        let ticketId = this.ticketId
         getJobPlayTicketInfo(ticketId).then((res) => {
-          console.log(res, "作业执行详细信息");
+          console.log(res, '作业执行详细信息')
           this.jobTicket = [res.data.jobTicket].map((item) => ({
             ...item,
             lockKeyName: res.data.lockKeyName,
-            colockKeyName: res.data.colockKeyName,
-          }));
-          this.lockUserList = res.data.lockUserList;
-          this.colockUserList = res.data.colockUserList;
-          this.ticketPointsList = res.data.ticketPointsList;
-        });
-      } else if (row.stepIndex == "8") {
-        let ticketId = this.ticketId;
+            colockKeyName: res.data.colockKeyName
+          }))
+          this.lockUserList = res.data.lockUserList
+          this.colockUserList = res.data.colockUserList
+          this.ticketPointsList = res.data.ticketPointsList
+        })
+      } else if (row.stepIndex == '8') {
+        let ticketId = this.ticketId
         getStepEight(ticketId).then((res) => {
-          console.log(res, "第八步查看作业票数据");
-        });
+          console.log(res, '第八步查看作业票数据')
+        })
       }
-    },
-  },
-};
+    }
+  }
+}
 </script>
 
 
@@ -1042,6 +1075,7 @@ export default {
   background-color: #a1a3a9;
   border-radius: 6px;
 }
+
 div[ref="mapContainer"] {
   transition: transform 0.2s ease;
 }

+ 10 - 10
src/views/mes/job/jobplay/index.vue

@@ -25,15 +25,15 @@
         />
       </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="作业区域" prop="workareaId">-->
+<!--        <treeselect-->
+<!--          style="width: 318px"-->
+<!--          v-model="queryParams.workareaId"-->
+<!--          :options="deptOptions"-->
+<!--          :normalizer="normalizer"-->
+<!--          placeholder="选择作业区域"-->
+<!--        />-->
+<!--      </el-form-item>-->
       <el-form-item>
         <el-button
           v-no-more-click
@@ -290,7 +290,7 @@ export default {
   },
   created() {
     this.getList();
-    this.getWorkareaList();
+    // this.getWorkareaList();
     this.initWebSocket()
   },
 

+ 40 - 40
src/views/mes/job/jobplay/jobPlayDetail.vue

@@ -9,9 +9,9 @@
         :header-cell-style="{ 'text-align': 'center' }"
         :cell-style="{ 'text-align': 'center' }"
       >
-        <el-table-column label="作业编号" prop="ticketCode">
-        </el-table-column>
-        <el-table-column label="作业名称" prop="ticketCode">
+<!--        <el-table-column label="作业编号" prop="ticketCode">-->
+<!--        </el-table-column>-->
+        <el-table-column label="作业名称" prop="ticketName">
         </el-table-column>
         <el-table-column label="状态" align="center" prop="ticketStatus">
           <template slot-scope="scope">
@@ -158,43 +158,43 @@
         </el-card>
       </el-col>
     </div>
-    <div class="message-list">
-      <div class="message_title">
-        <div class="dropdown">
-          <el-tooltip class="item" effect="dark" content="展开" placement="left">
-            <button class="dropdown-button" @click="changeShowDropdown">
-              <i class="el-icon-s-operation"></i>
-            </button>
-          </el-tooltip>
-          <div class="dropdown-content" v-if="showDropdown">
-            <el-tooltip class="item" effect="dark" content="作业状态" placement="left">
-              <button class="dropdown-item">
-                <i class="el-icon-plus"></i>
-              </button>
-            </el-tooltip>
-            <el-tooltip class="item" effect="dark" content="上锁状态" placement="left">
-              <button class="dropdown-item">
-                <i class="el-icon-circle-plus"></i>
-              </button>
-            </el-tooltip>
-            <el-tooltip class="item" effect="dark" content="共锁状态" placement="left">
-              <button class="dropdown-item">
-                <i class="el-icon-circle-plus-outline"></i>
-              </button>
-            </el-tooltip>
-          </div>
-        </div>
-        作业执行-操作日志
-      </div>
-      <el-timeline style="padding-top: 15px">
-        <el-timeline-item v-for="(v,i) in items" :timestamp="v.date" :key="i" placement="top" color="#0bbd87">
-          <el-card style="width: 450px">
-            <h4>{{ v.index }}</h4>
-            <p>{{ v.content }}</p>
-          </el-card>
-        </el-timeline-item>
-      </el-timeline>
-    </div>
+<!--    <div class="message-list">-->
+<!--      <div class="message_title">-->
+<!--        <div class="dropdown">-->
+<!--          <el-tooltip class="item" effect="dark" content="展开" placement="left">-->
+<!--            <button class="dropdown-button" @click="changeShowDropdown">-->
+<!--              <i class="el-icon-s-operation"></i>-->
+<!--            </button>-->
+<!--          </el-tooltip>-->
+<!--          <div class="dropdown-content" v-if="showDropdown">-->
+<!--            <el-tooltip class="item" effect="dark" content="作业状态" placement="left">-->
+<!--              <button class="dropdown-item">-->
+<!--                <i class="el-icon-plus"></i>-->
+<!--              </button>-->
+<!--            </el-tooltip>-->
+<!--            <el-tooltip class="item" effect="dark" content="上锁状态" placement="left">-->
+<!--              <button class="dropdown-item">-->
+<!--                <i class="el-icon-circle-plus"></i>-->
+<!--              </button>-->
+<!--            </el-tooltip>-->
+<!--            <el-tooltip class="item" effect="dark" content="共锁状态" placement="left">-->
+<!--              <button class="dropdown-item">-->
+<!--                <i class="el-icon-circle-plus-outline"></i>-->
+<!--              </button>-->
+<!--            </el-tooltip>-->
+<!--          </div>-->
+<!--        </div>-->
+<!--        作业执行-操作日志-->
+<!--      </div>-->
+<!--      <el-timeline style="padding-top: 15px">-->
+<!--        <el-timeline-item v-for="(v,i) in items" :timestamp="v.date" :key="i" placement="top" color="#0bbd87">-->
+<!--          <el-card style="width: 450px">-->
+<!--            <h4>{{ v.index }}</h4>-->
+<!--            <p>{{ v.content }}</p>-->
+<!--          </el-card>-->
+<!--        </el-timeline-item>-->
+<!--      </el-timeline>-->
+<!--    </div>-->
   </div>
 </template>
 

+ 10 - 10
src/views/mes/sop/sopm/index.vue

@@ -36,16 +36,16 @@
         >新增
         </el-button>
       </el-col>
-      <el-col :span="1.5">
-        <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="info"-->
+<!--                   plain-->
+<!--                   icon="el-icon-sort"-->
+<!--                   size="mini"-->
+<!--                   @click="toggleExpandAll"-->
+<!--        >展开/折叠-->
+<!--        </el-button>-->
+<!--      </el-col>-->
       <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
     </el-row>
 

+ 22 - 14
src/views/system/mars/index.vue

@@ -37,16 +37,16 @@
         >新增
         </el-button>
       </el-col>
-      <el-col :span="1.5">
-        <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="info"-->
+<!--                   plain-->
+<!--                   icon="el-icon-sort"-->
+<!--                   size="mini"-->
+<!--                   @click="toggleExpandAll"-->
+<!--        >展开/折叠-->
+<!--        </el-button>-->
+<!--      </el-col>-->
       <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
     </el-row>
 
@@ -102,7 +102,13 @@
         </template>
       </el-table-column>
     </el-table>
-
+    <pagination
+      v-show="total > 0"
+      :total="total"
+      :page.sync="queryParams.pages"
+      :limit.sync="queryParams.size"
+      @pagination="getList"
+    />
     <!-- 添加或修改部门对话框 -->
     <el-dialog :title="title" :visible.sync="open" width="600px" append-to-body>
       <el-form ref="form" :model="form" :rules="rules" label-width="80px">
@@ -173,6 +179,7 @@ export default {
       autoGenFlag: false,
       // 显示搜索条件
       showSearch: true,
+      total:0,//
       // 表格树数据
       deptList: [],
       // 部门树选项
@@ -188,7 +195,7 @@ export default {
       // 查询参数
       queryParams: {
         pages:1,
-        size:-1,
+        size:10,
         workstationName: undefined,
         workstationCode: undefined,
         userId:undefined
@@ -231,6 +238,7 @@ watch: {
         this.deptList = this.handleTree(response.data.records,"workstationId","parentId")
         console.log(this.deptList,'岗位列表')
         this.loading = false
+        this.total=response.data.total
       })
     },
     /** 转换部门数据结构 */
@@ -296,7 +304,7 @@ watch: {
         this.form.parentId = 0;
       }
       this.open = true
-      this.title = '添加部门'
+      this.title = '添加岗位'
       listMarsDept(this.queryParams).then(response => {
         this.deptOptions = this.handleTree(response.data.records,"workstationId","parentId")
       })
@@ -315,7 +323,7 @@ watch: {
       getMarsDept(row.workstationId).then(response => {
         this.form = response.data
         this.open = true
-        this.title = '修改部门'
+        this.title = '修改岗位'
       })
       listMarsDeptExcludeChild(row.workstationId).then(response => {
         this.deptOptions = this.handleTree(response.data.records,"workstationId","parentId")

+ 93 - 12
src/views/system/role/index.vue

@@ -218,8 +218,18 @@
         <el-form-item label="权限字符">
           <el-input v-model="form.roleKey" :disabled="true" />
         </el-form-item>
-        <el-form-item label="权限范围">
-          <el-select v-model="form.dataScope" @change="dataScopeSelectChange">
+<!--        <el-form-item label="权限范围">-->
+<!--          <el-select v-model="form.dataScope" @change="dataScopeSelectChange">-->
+<!--            <el-option-->
+<!--              v-for="item in dataScopeOptions"-->
+<!--              :key="item.value"-->
+<!--              :label="item.label"-->
+<!--              :value="item.value"-->
+<!--            ></el-option>-->
+<!--          </el-select>-->
+<!--        </el-form-item>-->
+        <el-form-item label="岗位权限">
+          <el-select v-model="form.marsDataScope" @change="dataScopeSelectChange">
             <el-option
               v-for="item in dataScopeOptions"
               :key="item.value"
@@ -228,13 +238,29 @@
             ></el-option>
           </el-select>
         </el-form-item>
-        <el-form-item label="数据权限" v-show="form.dataScope == 2">
+<!--        <el-form-item label="数据权限" v-show="form.dataScope == 2">-->
+<!--          <el-checkbox v-model="deptExpand" @change="handleCheckedTreeExpand($event, 'dept')">展开/折叠</el-checkbox>-->
+<!--          <el-checkbox v-model="deptNodeAll" @change="handleCheckedTreeNodeAll($event, 'dept')">全选/全不选</el-checkbox>-->
+<!--          <el-checkbox v-model="form.deptCheckStrictly" @change="handleCheckedTreeConnect($event, 'dept')">父子联动</el-checkbox>-->
+<!--          <el-tree-->
+<!--            class="tree-border"-->
+<!--            :data="deptOptions"-->
+<!--            show-checkbox-->
+<!--            default-expand-all-->
+<!--            ref="dept"-->
+<!--            node-key="id"-->
+<!--            :check-strictly="!form.deptCheckStrictly"-->
+<!--            empty-text="加载中,请稍候"-->
+<!--            :props="defaultProps"-->
+<!--          ></el-tree>-->
+<!--        </el-form-item>-->
+        <el-form-item label="数据权限" v-show="form.marsDataScope == 2">
           <el-checkbox v-model="deptExpand" @change="handleCheckedTreeExpand($event, 'dept')">展开/折叠</el-checkbox>
           <el-checkbox v-model="deptNodeAll" @change="handleCheckedTreeNodeAll($event, 'dept')">全选/全不选</el-checkbox>
           <el-checkbox v-model="form.deptCheckStrictly" @change="handleCheckedTreeConnect($event, 'dept')">父子联动</el-checkbox>
           <el-tree
             class="tree-border"
-            :data="deptOptions"
+            :data="workstationOptions"
             show-checkbox
             default-expand-all
             ref="dept"
@@ -257,6 +283,7 @@
 import { listRole, getRole, delRole, addRole, updateRole, dataScope, changeRoleStatus } from "@/api/system/role";
 import { treeselect as menuTreeselect, roleMenuTreeselect } from "@/api/system/menu";
 import { treeselect as deptTreeselect, roleDeptTreeselect } from "@/api/system/dept";
+import { listMarsDept } from '@/api/system/marsdept'
 
 export default {
   name: "Role",
@@ -316,6 +343,8 @@ export default {
       menuOptions: [],
       // 部门列表
       deptOptions: [],
+      // 岗位权限下拉
+      workstationOptions:[],
       // 查询参数
       queryParams: {
         pageNum: 1,
@@ -357,6 +386,44 @@ export default {
           this.loading = false;
         }
       );
+      const data={
+        pages:1,
+        size:-1
+      }
+      listMarsDept(data).then(response => {
+        debugger;
+        this.workstationOptions = this.transformToTree(response.data.records)
+        console.log(this.workstationOptions ,'岗位权限数据');
+      })
+    },
+    /** 转换mars岗位树数据为树形结构 */
+    transformToTree(records) {
+      const recordMap = {} // 创建一个 Map 以存储所有记录
+      const tree = [] // 最终返回的树形结构
+
+      // 初始化所有记录到 Map
+      records.forEach(record => {
+        recordMap[record.workstationId] = {
+          id: record.workstationId,
+          label: record.workstationName,
+          children: []
+        }
+      })
+
+      // 遍历记录并构建树
+      records.forEach(record => {
+        const parentId = record.parentId
+
+        if (parentId === '0') {
+          // 如果是顶层节点,直接添加到树中
+          tree.push(recordMap[record.workstationId])
+        } else if (recordMap[parentId]) {
+          // 如果有父节点,则将当前节点加入父节点的 children 中
+          recordMap[parentId].children.push(recordMap[record.workstationId])
+        }
+      })
+
+      return tree
     },
     /** 查询菜单树结构 */
     getMenuTreeselect() {
@@ -368,6 +435,7 @@ export default {
     getDeptTreeselect() {
       deptTreeselect().then(response => {
         this.deptOptions = response.data;
+
       });
     },
     // 所有菜单节点数据
@@ -440,6 +508,7 @@ export default {
         status: "0",
         menuIds: [],
         deptIds: [],
+        workstationIds:[],
         menuCheckStrictly: true,
         deptCheckStrictly: true,
         remark: undefined
@@ -484,7 +553,8 @@ export default {
           this.$refs.menu.store.nodesMap[treeList[i].id].expanded = value;
         }
       } else if (type == 'dept') {
-        let treeList = this.deptOptions;
+        // let treeList = this.deptOptions;//原本部门权限设置
+        let treeList=this.workstationOptions;
         for (let i = 0; i < treeList.length; i++) {
           this.$refs.dept.store.nodesMap[treeList[i].id].expanded = value;
         }
@@ -495,7 +565,9 @@ export default {
       if (type == 'menu') {
         this.$refs.menu.setCheckedNodes(value ? this.menuOptions: []);
       } else if (type == 'dept') {
-        this.$refs.dept.setCheckedNodes(value ? this.deptOptions: []);
+        // this.$refs.dept.setCheckedNodes(value ? this.deptOptions: []);
+        this.$refs.dept.setCheckedNodes(value ? this.workstationOptions: []);
+
       }
     },
     // 树权限(父子联动)
@@ -543,14 +615,22 @@ export default {
     /** 分配数据权限操作 */
     handleDataScope(row) {
       this.reset();
-      const roleDeptTreeselect = this.getRoleDeptTreeselect(row.roleId);
+      // const roleDeptTreeselect = this.getRoleDeptTreeselect(row.roleId);//原来部门的选中回显权限
+
       getRole(row.roleId).then(response => {
         this.form = response.data;
         this.openDataScope = true;
         this.$nextTick(() => {
-          roleDeptTreeselect.then(res => {
-            this.$refs.dept.setCheckedKeys(res.checkedKeys);
-          });
+        response.data.workstationIds.forEach((v) => {
+          this.$nextTick(()=>{
+            this.$refs.dept.setChecked(v, true,false);
+          })
+        })
+          // 原本部门的数据权限回显
+          // roleDeptTreeselect.then(res => {
+          //   this.$refs.dept.setCheckedKeys(res.checkedKeys);
+          //
+          // });
         });
         this.title = "分配数据权限";
       });
@@ -585,7 +665,8 @@ export default {
     /** 提交按钮(数据权限) */
     submitDataScope: function() {
       if (this.form.roleId != undefined) {
-        this.form.deptIds = this.getDeptAllCheckedKeys();
+        // this.form.deptIds = this.getDeptAllCheckedKeys();
+        this.form.workstationIds = this.getDeptAllCheckedKeys();
         dataScope(this.form).then(response => {
           this.$modal.msgSuccess("修改成功");
           this.openDataScope = false;
@@ -611,4 +692,4 @@ export default {
     }
   }
 };
-</script>
+</script>

+ 8 - 8
src/views/system/technology/technologyDetail/MapData.vue

@@ -29,14 +29,14 @@
                      style="float: left; height: 33px; line-height: 2px;"
           >关闭
           </el-button>
-          <el-button v-no-more-click @click="reset" type="primary" icon="el-icon-refresh"
-                     style="float: left; height: 33px; line-height: 2px;"
-          >重置
-          </el-button>
-          <el-button v-no-more-click @click="view" type="primary" icon="el-icon-view"
-                     style="float: left; height: 33px; line-height: 2px"
-          >预览
-          </el-button>
+<!--          <el-button v-no-more-click @click="reset" type="primary" icon="el-icon-refresh"-->
+<!--                     style="float: left; height: 33px; line-height: 2px;"-->
+<!--          >重置-->
+<!--          </el-button>-->
+<!--          <el-button v-no-more-click @click="view" type="primary" icon="el-icon-view"-->
+<!--                     style="float: left; height: 33px; line-height: 2px"-->
+<!--          >预览-->
+<!--          </el-button>-->
         </div>
       </el-card>
 

+ 5 - 4
src/views/system/technology/technologyDetail/craftDetail.vue

@@ -8,7 +8,8 @@
     </el-radio-group>
 <!--    工艺信息-->
     <div class="craft" v-if="this.tabPosition == 'craftInfo'">
-
+      <Tinymce  />
+<!--      富文本编辑器-->
     </div>
     <!-- 设备列表 -->
     <div class="device" v-if="this.tabPosition == 'deviceList'">
@@ -340,18 +341,18 @@ import { listMarsDept } from '@/api/system/marsdept'
 import { listLoto } from '@/api/mes/lotoStation/lotoStation'
 import MapData from '@/views/system/technology/technologyDetail/MapData.vue'
 import { getIsMarsSopPage } from '@/api/mes/sop/sopindex'
-
+import Tinymce from '@/components/tinymce/example/Index.vue'
 export default {
   name: 'Dept',
   dicts: ['sys_normal_disable'],
-  components: { Treeselect, MapData },
+  components: { Treeselect, MapData,Tinymce },
   data() {
     return {
       // 遮罩层
       loading: true,
       //自动生成编码
       autoGenFlag: false,
-      tabPosition: 'deviceList',
+      tabPosition: 'craftInfo',
       total1:0,//设备列表
       total2:0,//sop列表
       // 非多个禁用

+ 6 - 108
src/views/system/technology/technologyDetail/deviceDetail.vue

@@ -1,116 +1,14 @@
 <template>
   <div class="app-container">
     <el-radio-group v-model="tabPosition" style="margin-bottom: 30px">
-      <el-radio-button label="deviceInformation">设备信息</el-radio-button>
+      <el-radio-button label="deviceInfo">设备信息</el-radio-button>
       <el-radio-button label="Loto">锁定站</el-radio-button>
 
     </el-radio-group>
 
     <!-- 设备列表 -->
-    <div class="device" v-if="this.tabPosition == 'deviceList'">
-      <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="['iscs:machinery: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:hw:information:batchremove']"
-          >批量删除</el-button
-          >
-        </el-col>
-        <!-- <el-col :span="1.5">
-          <el-button
-            v-no-more-click
-            type="info"
-            plain
-            icon="el-icon-sort"
-            size="mini"
-            @click="toggleExpandAll"
-            >展开/折叠
-          </el-button>
-        </el-col> -->
-        <right-toolbar
-          :showSearch.sync="showSearch"
-          @queryTable="getList"
-        ></right-toolbar>
-      </el-row>
-
-      <el-table
-        v-if="refreshTable"
-        v-loading="loading"
-        :data="deptList"
-        row-key="machineryId"
-        :default-expand-all="isExpandAll"
-        :tree-props="{ children: 'children', hasChildren: 'hasChildren' }"
-        @selection-change="handleSelectionChange"
-      >
-        <el-table-column type="selection" width="55" align="center" />
-        <el-table-column
-          prop="machineryCode"
-          label="设备编码"
-        ></el-table-column>
-        <el-table-column
-          prop="machineryName"
-          label="设备名称"
-        ></el-table-column>
-<!--        <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"-->
-<!--              @click="handleLook(scope.row)"-->
-<!--            >查看-->
-<!--            </el-button>-->
-<!--          </template>-->
-<!--        </el-table-column>-->
-        <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="['iscs:machinery:edit']"
-            >编辑
-            </el-button>
-            <el-button
-              v-no-more-click
-              size="mini"
-              type="text"
-              icon="el-icon-delete"
-              @click="handleDelete(scope.row)"
-              v-hasPermi="['iscs:machinery:remove']"
-            >删除
-            </el-button>
-          </template>
-        </el-table-column>
-      </el-table>
+    <div class="device" v-if="this.tabPosition == 'deviceInfo'">
+      <Tinymce  />
     </div>
     <!-- LOTO站 -->
     <div class="loto">
@@ -219,18 +117,18 @@ import { genCode } from "@/api/system/autocode/rule";
 import { listMarsDept } from "@/api/system/marsdept";
 import { listLoto } from "@/api/mes/lotoStation/lotoStation";
 import MapData from '@/views/system/technology/technologyDetail/MapData.vue'
-
+import Tinymce from '@/components/tinymce/example/Index.vue'
 export default {
   name: "Dept",
   dicts: ["sys_normal_disable"],
-  components: { MapData, Treeselect },
+  components: { MapData, Treeselect,Tinymce },
   data() {
     return {
       // 遮罩层
       loading: true,
       //自动生成编码
       autoGenFlag: false,
-      tabPosition: "deviceInformation",
+      tabPosition: "deviceInfo",
       // 非多个禁用
       multiple: true,
       // 显示搜索条件

+ 20 - 12
src/views/system/unit/index.vue

@@ -28,16 +28,16 @@
         >新增
         </el-button>
       </el-col>
-      <el-col :span="1.5">
-        <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="info"-->
+<!--                   plain-->
+<!--                   icon="el-icon-sort"-->
+<!--                   size="mini"-->
+<!--                   @click="toggleExpandAll"-->
+<!--        >展开/折叠-->
+<!--        </el-button>-->
+<!--      </el-col>-->
       <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
     </el-row>
 
@@ -89,7 +89,13 @@
         </template>
       </el-table-column>
     </el-table>
-
+    <pagination
+      v-show="total > 0"
+      :total="total"
+      :page.sync="queryParams.pages"
+      :limit.sync="queryParams.size"
+      @pagination="getList"
+    />
     <!-- 添加或修改单位对话框 -->
     <el-dialog :title="title" :visible.sync="open" width="400px" append-to-body>
       <el-form ref="form" :model="form" :rules="rules" label-width="80px">
@@ -135,6 +141,7 @@ export default {
       autoGenFlag: false,
       // 显示搜索条件
       showSearch: true,
+      total:0,//
       // 表格树数据
       deptList: [],
       // 单位树选项
@@ -150,7 +157,7 @@ export default {
       // 查询参数
       queryParams: {
         pages:1,
-        size:-1,
+        size:10,
         unitName: undefined,
         userId:undefined,
       },
@@ -180,6 +187,7 @@ export default {
         this.deptList = this.handleTree(response.data.records,"unitId","parentId")
         console.log(this.deptList,'单位列表')
         this.loading = false
+        this.total=response.data.total
       })
     },
     /** 转换单位数据结构 */

+ 11 - 4
src/views/system/user/index.vue

@@ -318,8 +318,9 @@
         </el-row>
         <el-row>
           <el-col :span="12">
-            <el-form-item label="玛氏岗位" prop="workstationIds">
-              <el-select v-model="form.workstationIds" clearable multiple placeholder="请选择玛氏岗位">
+<!--            玛氏岗位-->
+            <el-form-item label="岗位" prop="workstationIds">
+              <el-select v-model="form.workstationIds" clearable multiple placeholder="请选择岗位">
                 <el-option
                   v-for="item in MarsWordStationOptions"
                   :key="item.workstationId"
@@ -341,8 +342,8 @@
 <!--            </el-form-item>-->
           </el-col>
           <el-col :span="12">
-            <el-form-item label="角色">
-              <el-select v-model="form.roleIds" multiple placeholder="请选择角色">
+            <el-form-item label="角色" prop="roleIds">
+              <el-select v-model="form.roleIds" multiple placeholder="请选择角色" >
                 <el-option
                   v-for="item in roleOptions"
                   :key="item.roleId"
@@ -518,6 +519,12 @@ export default {
             trigger: ["blur", "change"]
           }
         ],
+        workstationIds:[
+          { required: true, message: "岗位不能为空", trigger: "blur" }
+        ],
+        roleIds:[
+          { required: true, message: "角色不能为空", trigger: "blur" }
+        ],
         phonenumber: [
           {
             pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/,