Эх сурвалжийг харах

修改分页与demo演示中提出的部分问题

pm 10 сар өмнө
parent
commit
e4babbd409

+ 56 - 0
src/api/mes/job/job.js

@@ -17,6 +17,13 @@ export function getJobTicketInfo(repairId) {
     method: 'get'
   })
 }
+// 获取八大步骤详细信息
+export function getStepInfo(repairId) {
+  return request({
+    url: '/iscs/step/selectStepsByTicketId?ticketId=' + repairId,
+    method: 'get'
+  })
+}
 //查询作业区域列表
 export function getworkareaList(repairId) {
   return request({
@@ -49,3 +56,52 @@ export function deleteIsJobTicket(repairId) {
     method: 'post'
   })
 }
+
+//mars八大步骤作业票执行 第三步骤-新增人员
+export function addJobUsers(data) {
+  return request({
+    url: '/iscs/step/addJobUsers',
+    method: 'post',
+    data:data
+  })
+}
+//mars八大步骤作业票执行
+export function updateJobStep(data) {
+  return request({
+    url: '/iscs/step/updateJobStep',
+    method: 'post',
+    data:data
+  })
+}
+//mars八大步骤作业票执行 结束作业票
+export function updateJobToFinish(data) {
+  return request({
+    url: '/iscs/ticket/updateJobToFinish',
+    method: 'post',
+    data:data
+  })
+}
+//mars八大步骤作业票执行 结取消作业票
+export function updateJobToCancel(data) {
+  return request({
+    url: '/iscs/ticket/updateJobToCancel',
+    method: 'post',
+    data:data
+  })
+}
+// 获取第八步有冲突的作业票新消息
+export function getStepEight(data) {
+  return request({
+    url: '/iscs/step/getStepEight?ticketId='+ data,
+    method: 'get',
+  })
+}
+// 查看作业票-正在进行中的作业票
+
+export function getWorkstationTicketList(query) {
+  return request({
+    url: '/iscs/ticket/getWorkstationTicketList',
+    method: 'get',
+    params: query
+  })
+}

+ 1 - 1
src/api/system/machinery.js

@@ -48,7 +48,7 @@ export function updateTechnology(data) {
 // 删除设备工艺
 export function delTechnology(deptId) {
   return request({
-    url: '/iscs/machinery/deleteIsMachineryByMachineryIds?machineryIds=' + deptId,
+    url: '/iscs/machinery/deleteIsMachineryByTechnologyIds?machineryIds=' + deptId,
     method: 'post'
   })
 }

+ 0 - 1
src/components/separationPoint/workshop.vue

@@ -317,7 +317,6 @@ export default {
     },
     // 监听输入框变化
     handleInputChange() {
-
       this.$refs.tree.filter(this.workareaName) // 调用树的 filter 方法
     },
     // 节点单击事件

+ 11 - 3
src/router/index.js

@@ -148,6 +148,14 @@ export const dynamicRoutes = [
         name: 'NewOperations',
         meta: { title: '作业管理-新建作业票', activeMenu: '/mes/job/jobm/NewOperations' }
 
+      },
+      // mars 新建作业票流程
+      {
+        path: 'NewMarsJob',
+        component: () => import('@/views/mes/job/jobm/NewMarsJob'),
+        name: 'NewMarsJob',
+        meta: { title: '作业管理-新建作业票', activeMenu: '/mes/job/jobm/NewMarsJob' }
+
       },
       {
         path: 'NewOperationsEdit',
@@ -198,7 +206,7 @@ export const dynamicRoutes = [
     path: '/system/technology/technologyDetail',
     component: Layout,
     hidden: true,
-    permissions: ['iscs:loto:list'],
+    permissions: ['iscs:machinery:list'],
     children: [
       {
         path: 'craftDetail',
@@ -213,7 +221,7 @@ export const dynamicRoutes = [
     path: '/system/technology/technologyDetail',
     component: Layout,
     hidden: true,
-    permissions: ['iscs:loto:list'],
+    permissions: ['iscs:machinery:list'],
     children: [
       {
         path: 'deviceDetail',
@@ -227,7 +235,7 @@ export const dynamicRoutes = [
     path: '/mes/hw/lotoStation/index',
     component: Layout,
     hidden: true,
-    permissions: ['iscs:loto:list'],
+    permissions: ['iscs:station:list'],
     children: [
       {
         path: 'MapData',

+ 4 - 4
src/views/mes/hw/lotoStation/index.vue

@@ -50,7 +50,7 @@
                    icon="el-icon-plus"
                    size="mini"
                    @click="handleAdd"
-                   v-hasPermi="['iscs:loto:add']"
+                   v-hasPermi="['iscs:station:add']"
         >新增
         </el-button>
       </el-col>
@@ -63,7 +63,7 @@
                    size="mini"
                    :disabled="multiple"
                    @click="handleDelete"
-                   v-hasPermi="['iscs:loto:remove']"
+                   v-hasPermi="['iscs:station:remove']"
         >批量删除
         </el-button>
       </el-col>
@@ -132,7 +132,7 @@
                      type="text"
                      icon="el-icon-edit"
                      @click="handleUpdate(scope.row)"
-                     v-hasPermi="['iscs:loto:edit']"
+                     v-hasPermi="['iscs:station:edit','iscs:station:query']"
           >编辑
           </el-button>
           <el-button v-no-more-click
@@ -140,7 +140,7 @@
                      type="text"
                      icon="el-icon-delete"
                      @click="handleDelete(scope.row)"
-                     v-hasPermi="['iscs:loto:remove']"
+                     v-hasPermi="['iscs:station:remove']"
           >删除
           </el-button>
           <!--          <el-button v-no-more-click size="mini" type="text">预览</el-button>-->

+ 17 - 17
src/views/mes/job/jobm/Mapdata.vue

@@ -233,23 +233,23 @@ export default {
           })
 
           // 添加点击事件监听器
-          knovaImage.on('click', () => {
-            const isCurrentlySelected = this.redrects[labelText].visible()
-
-            if (isCurrentlySelected) {
-              // 如果当前已选中,则取消选中
-              this.redrects[labelText].visible(false)
-              this.redtexts[labelText].visible(false)
-              this.pointIdList = this.pointIdList.filter(id => id !== pos.pointId) // 移除ID
-            } else {
-              // 如果当前未选中,则选中
-              this.redrects[labelText].visible(true)
-              this.redtexts[labelText].visible(true)
-              this.pointIdList.push(pos.pointId) // 添加ID
-            }
-
-            this.layer.batchDraw() // 更新图层显示
-          })
+          // knovaImage.on('click', () => {
+          //   const isCurrentlySelected = this.redrects[labelText].visible()
+          //
+          //   if (isCurrentlySelected) {
+          //     // 如果当前已选中,则取消选中
+          //     this.redrects[labelText].visible(false)
+          //     this.redtexts[labelText].visible(false)
+          //     this.pointIdList = this.pointIdList.filter(id => id !== pos.pointId) // 移除ID
+          //   } else {
+          //     // 如果当前未选中,则选中
+          //     this.redrects[labelText].visible(true)
+          //     this.redtexts[labelText].visible(true)
+          //     this.pointIdList.push(pos.pointId) // 添加ID
+          //   }
+          //
+          //   this.layer.batchDraw() // 更新图层显示
+          // })
 
           // 底部白色背景
           const bgrect = new Konva.Rect({

+ 412 - 27
src/views/mes/job/jobm/NewMarsJob.vue

@@ -15,13 +15,40 @@
       v-show="tabPosition == 'first'"
     >
       <img
-        style="width: 1250px; height: 700px"
+        style="width: 1250px; height: 700px;"
         src="@/assets/images/marsBg.png"
         alt=""
       />
-      <img style="width: 35px;height: 35px;position: absolute;top:220px;left: 720px;"
-           src="@/assets/images/marsPoint.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>
@@ -94,9 +121,21 @@
         <div class="left-bottom">
           <el-card class="box-card" style="margin: 10px">
             <div slot="header" class="clearfix">
-              <span>LOTO站信息</span>
+              <span>锁定站信息</span>
             </div>
-            <MapData style="width: 300px;height: 320px;margin-left: 35%" :machineryId="this.machineryId"></MapData>
+            <el-row>
+              <el-col :span="9">
+                <el-table :data="selectPointList">
+                  <el-table-column prop="pointName" label="隔离点"></el-table-column>
+                  <el-table-column prop="powerTypeName" label="危险能量类型"></el-table-column>
+                </el-table>
+              </el-col>
+              <el-col :span="8">
+                <MapData style="width: 300px;height: 320px;margin-left: 15%" :machineryId="this.machineryId"></MapData>
+              </el-col>
+            </el-row>
+
+
           </el-card>
         </div>
       </div>
@@ -117,13 +156,14 @@
             <div style="width: 700px; height: 600px">
               <div style="width: 100%; height: 100px">
                 <div>
-                  <el-table :data="EightStepForm" :show-header="false" style="margin-top: 100px">
-                    <el-table-column label="" prop="stepIndex">
+                  <!--                  :show-header="false"-->
+                  <el-table :data="EightStepForm" style="margin-top: 60px">
+                    <el-table-column label="步骤" prop="stepIndex">
                       <template slot-scope="scope">
                         <span>第{{ scope.row.stepIndex }}步</span>
                       </template>
                     </el-table-column>
-                    <el-table-column label="" prop="number">
+                    <el-table-column label="步骤" prop="number">
                       <template slot-scope="scope">
                           <span v-if="scope.row.lockNum !== null">
                           <i class="el-icon-goods">{{ scope.row.lockNum }}</i>
@@ -136,7 +176,7 @@
                         </span>
                       </template>
                     </el-table-column>
-                    <el-table-column label="" prop="stepStatus">
+                    <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)"
@@ -159,16 +199,32 @@
                       </template>
                     </el-table-column>
                     <el-table-column
-                      label=""
+                      label="内容"
                       prop="stepContent"
                       width="300"
                     ></el-table-column>
+                    <el-table-column
+                      label="详情"
+                      prop=""
+
+                    >
+                      <template slot-scope="scope">
+                        <span v-if="scope.row.stepIndex == '5'||scope.row.stepIndex == '1'||scope.row.stepIndex == '8'">
+                          <el-button type="text" size="small" @click="checkDetail(scope.row)"
+                          >查看</el-button
+                          >
+                        </span>
+
+                      </template>
+                    </el-table-column>
                   </el-table>
 
                 </div>
               </div>
             </div>
           </div>
+          <el-button style="float:right" type="primary" @click="finshJobticket">结束作业</el-button>
+          <el-button style="float:right;margin-right: 10px" type="danger" @click="cancelJobticket">取消作业</el-button>
         </el-card>
       </div>
     </div>
@@ -261,7 +317,7 @@
                       stripe
                       height="400"
             >
-              <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
@@ -280,7 +336,7 @@
               >
                 <template slot-scope="scope">
                           <span style="color: #2a87ff">{{
-                              scope.row.userType=='0'?'内部':'外部'
+                              scope.row.userType == '0' ? '内部' : '外部'
                             }}</span>
                 </template>
               </el-table-column>
@@ -308,6 +364,175 @@
       </div>
     </el-dialog>
 
+    <!--    第五步查看作业详情弹窗-->
+    <el-dialog :visible.sync="FiveDetailvisible"
+               width="1000px"
+
+               append-to-body
+    >
+      <el-row>
+        <el-card class="box-cardStatus">
+          <div slot="header" class="clearfix">
+            <span style="font-weight: bolder">作业状态</span>
+          </div>
+          <el-table
+            :data="jobTicket"
+            :header-cell-style="{ 'text-align': 'center' }"
+            :cell-style="{ 'text-align': 'center' }"
+          >
+            <el-table-column label="作业编号" prop="ticketId">
+            </el-table-column>
+            <el-table-column label="作业名称" prop="ticketName">
+            </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="上锁钥匙" prop="lockKeyName">
+            </el-table-column>
+            <el-table-column label="解锁钥匙" prop="colockKeyName">
+            </el-table-column>
+          </el-table>
+        </el-card>
+      </el-row>
+      <el-row>
+        <el-col :span="7" style="height: 400px">
+          <el-card class="box-card1">
+            <div slot="header" class="clearfix">
+              <span style="font-weight: bolder">人员状态</span>
+            </div>
+            <el-table :data="lockUserList">
+              <el-table-column label="上锁人" prop="userName"></el-table-column>
+              <el-table-column label="状态" align="center" prop="jobStatus">
+                <template slot-scope="scope">
+                  <div
+                    class="box"
+                    style="
+                    width: 30px;
+                    height: 30px;
+                    border: 1px solid black;
+                    background-color: white;
+                    margin: 0 auto;
+                  "
+                  >
+                  <span
+                    v-if="
+                      scope.row.jobStatus == 0 ||
+                      scope.row.jobStatus == 1 ||
+                      scope.row.jobStatus == 2 ||
+                      scope.row.jobStatus == 3
+                    "
+                  ></span>
+                    <!-- 显示错号 -->
+                    <span
+                      v-else-if="scope.row.jobStatus == 4"
+                      style="font-size: 20px; line-height: 30px"
+                    >🔒</span
+                    >
+                    <!-- 显示对号 -->
+                    <span
+                      v-else-if="scope.row.jobStatus == 5"
+                      style="font-size: 20px; line-height: 30px"
+                    >✓</span
+                    >
+                  </div>
+                </template>
+              </el-table-column>
+            </el-table>
+          </el-card>
+          <el-card class="box-cardgsr">
+            <el-table :data="colockUserList">
+              <el-table-column label="共锁人" prop="userName"></el-table-column>
+              <el-table-column label="状态" align="center" prop="jobStatus">
+                <template slot-scope="scope">
+                  <div
+                    class="box"
+                    style="
+                    width: 30px;
+                    height: 30px;
+                    border: 1px solid black;
+                    background-color: white;
+                    margin: 0 auto;
+                  "
+                  >
+                  <span
+                    v-if="
+                      scope.row.jobStatus == 0 ||
+                      scope.row.jobStatus == 1 ||
+                      scope.row.jobStatus == 2 ||
+                      scope.row.jobStatus == 3
+                    "
+                  ></span>
+                    <!-- 显示错号 -->
+                    <span
+                      v-else-if="scope.row.jobStatus == 4"
+                      style="font-size: 20px; line-height: 30px"
+                    >🔒</span
+                    >
+                    <!-- 显示对号 -->
+                    <span
+                      v-else-if="scope.row.jobStatus == 5"
+                      style="font-size: 20px; line-height: 30px"
+                    >✓</span
+                    >
+                  </div>
+                </template>
+              </el-table-column>
+            </el-table>
+          </el-card>
+        </el-col>
+        <el-col :span="6">
+          <el-card class="box-card2">
+            <div slot="header" class="clearfix">
+              <span style="font-weight: bolder">隔离点状态</span>
+            </div>
+            <el-table :data="ticketPointsList">
+              <el-table-column label="隔离点" prop="pointName" width="80">
+              </el-table-column>
+
+              <el-table-column label="状态" align="center" prop="pointStatus">
+                <template slot-scope="scope">
+                  <div
+                    class="box"
+                    style="
+                    width: 30px;
+                    height: 30px;
+                    border: 1px solid black;
+                    background-color: white;
+                    margin: 0 auto;
+                  "
+                  >
+                    <span v-if="scope.row.pointStatus == 0" style=""></span>
+                    <!-- 显示错号 -->
+                    <span
+                      v-else-if="scope.row.pointStatus == 1"
+                      style="font-size: 20px; line-height: 30px"
+                    >🔒</span
+                    >
+                    <!-- 显示对号 -->
+                    <span
+                      v-else-if="scope.row.pointStatus == 2"
+                      style="font-size: 20px; line-height: 30px"
+                    >✓</span
+                    >
+                  </div>
+                </template>
+              </el-table-column>
+              <el-table-column label="挂锁名称" prop="lockName">
+              </el-table-column>
+              <el-table-column label="锁具机构" prop="locksetName"></el-table-column>
+            </el-table>
+          </el-card>
+        </el-col>
+      </el-row>
+      <div slot="footer" class="dialog-footer">
+        <el-button v-no-more-click @click="cancel">关 闭</el-button>
+      </div>
+    </el-dialog>
   </div>
 
 </template>
@@ -317,14 +542,23 @@ 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, getJobTicketInfo, getStepInfo, updateJobStep } from '@/api/mes/job/job'
+import {
+  addJobTicket,
+  addJobUsers,
+  getJobTicketInfo, getStepEight,
+  getStepInfo, getWorkstationTicketList, 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'
 
 export default {
   name: 'NewSop',
   components: { Template, MapData },
-  dicts: ['sop_type'],
+  dicts: ['sop_type', 'ticket_status'],
   data() {
     return {
       tabPosition: 'first',
@@ -332,6 +566,7 @@ export default {
       marsSopPage: [],//岗位对应sop列表
       marsSopTitle: '',//岗位后 对应展示sop
       marsDeptList: [],
+      listLockerOption: [],//上锁人下拉数据
       form: null,//存储选中的设备工艺sop列表数据
       machineryImg: null,//第三步作业执行渲染设备工艺图片
       machineryId: null,//第三步作业执行渲染电柜的数据
@@ -349,7 +584,15 @@ export default {
       // 弹出层标题
       title: '',
       // 弹框中显示的form表单内容
-      newticketUserDTOList: [] //为了上锁人单独传递数据
+      newticketUserDTOList: [], //为了上锁人单独传递数据
+      FiveDetailvisible: false,//第五步详情弹窗
+      ticketPointsList: [],//第五步详情的隔离点信息
+      colockUserList: [],//第五步详情的共锁人信息
+      lockUserList: [],//第五步详情的上锁人信息
+      jobTicket: [],//第五步详情的作业票信息
+      TicketListPage: [],//作业票列表page接口传递的数据 底图循环渲染图标 RR岗位作业票
+      selectPointList:[],//隔离点选中的表格渲染
+      COCOTicketListPage:[],//CCO岗位的作业票
     }
   },
   computed: {
@@ -363,11 +606,42 @@ export default {
     this.getList()
   },
   methods: {
+    handleTicketClick(data) {
+      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
+      // 获取设备工艺图
+      getTechnologyInfo(data.machineryId).then((res) => {
+        this.machineryImg = res.data.machineryImg
+        // 获取电柜选中隔离点
+        const lotoId=res.data.lotoId
+        const selectPointsIds=res.data.pointIdList
+
+        getLotoMapInfo(lotoId).then((response) => {
+          console.log(response, '电柜信息--NewMarsJob')
+          this.selectPointList = response.data.filter((item) =>
+            selectPointsIds.includes(item.pointId)
+          );
+          console.log(this.selectPointList, '拿到的选中隔离点数据');
+        })
+      })
+
+    },
     getList() {
       const data = {
         pages: 1,
         size: -1
       }
+      getWorkstationTicketList(data).then((res) => {
+        console.log(res, '查看-正在进行中作业票列表')
+        this.TicketListPage = res.data.filter((item) =>item.workstationId=='8')
+        this.COCOTicketListPage=res.data.filter((item) =>item.workstationId=='7')
+      })
       listTechnology(data).then((res) => {
         console.log(res, 'technologyList')
         this.technologyList = res.data.records
@@ -491,10 +765,10 @@ export default {
             userId: item.userId,
             userType: 0,
             userRole: 'jtcolocker'
-          });
+          })
         }
-      });
-      console.log(this.AllUserTable, '内部人员');
+      })
+      console.log(this.AllUserTable, '内部人员')
     },
 
     OutSelectionChange(selection) {
@@ -505,10 +779,10 @@ export default {
             userId: item.userId,
             userType: 1,
             userRole: 'jtcolocker'
-          });
+          })
         }
-      });
-      console.log(this.AllUserTable, '外部人员');
+      })
+      console.log(this.AllUserTable, '外部人员')
     },
     confirmAddUser() {
       const data = {
@@ -518,11 +792,11 @@ export default {
       console.log(data, '添加人员')
       addJobUsers(data).then((res) => {
         console.log(res, '添加人员')
-        if(res.data){
+        if (res.data) {
           this.$message.success('分配人员成功')
-          this.open=false;
-          this.AllUserTable = [];
-          this.dialogForm.locker=''
+          this.open = false
+          this.AllUserTable = []
+          this.dialogForm.locker = ''
           getStepInfo(this.ticketId).then((res) => {
             this.EightStepForm = res.data
             console.log(res, '作业票-详细信息')
@@ -546,8 +820,60 @@ export default {
     // 取消按钮
     cancel() {
       this.open = false
-    }
+      this.FiveDetailvisible = false
+    },
+    // 作业票结束
+    finshJobticket() {
+      const data = {
+        ticketId: this.ticketId
+      }
+      updateJobToFinish(data).then((res) => {
+        console.log(res, '结束作业票')
+        if (res.data) {
+          this.$message.success('作业票结束')
+          this.tabPosition = 'first'
+          this.getList()
+        }
+      })
+    },
+    // 作业票取消
+    cancelJobticket() {
+      const data = {
+        ticketId: this.ticketId
+      }
+      updateJobToCancel(data).then((res) => {
+        console.log(res, '取消作业票')
+        if (res.data) {
+          this.$message.success('作业票取消')
+          this.tabPosition = 'first'
+          this.getList()
+        }
+      })
+    },
+    //   查看详情八大步骤
+    checkDetail(row) {
+      if (row.stepIndex == '5') {
+        this.FiveDetailvisible = true
+        let ticketId = this.ticketId
+        getJobPlayTicketInfo(ticketId).then((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
+        getStepEight(ticketId).then((res) => {
+          console.log(res, '第八步查看作业票数据')
+        })
+      }
 
+    }
   }
 }
 </script>
@@ -581,4 +907,63 @@ export default {
   color: #fff;
   cursor: pointer;
 }
+
+.box-cardStatus {
+  width: 850px;
+  margin: 15px;
+}
+
+.box-card1 {
+  width: 250px;
+  margin: 15px;
+}
+
+.box-cardgsr {
+  width: 250px;
+  height: auto;
+  margin: 15px;
+}
+
+.box-card2 {
+  width: 560px;
+  margin: 15px;
+}
+
+.status-container {
+  width: 100%;
+  height: 100%;
+  background: pink;
+  display: flex;
+}
+
+.box {
+  width: 30px;
+  height: 30px;
+  border: 1px solid #e7e5e5;
+  background-color: rgb(209, 77, 77);
+}
+
+.error-icon {
+  color: red;
+  font-weight: bold;
+}
+
+.success-icon {
+  color: green;
+  font-weight: bold;
+}
+
+//滚动条的宽度
+::-webkit-scrollbar {
+  width: 8px;
+  height: 8px;
+  background-color: #e4e4e4;
+  border-radius: 6px;
+}
+
+//滚动条的滑块
+::-webkit-scrollbar-thumb {
+  background-color: #a1a3a9;
+  border-radius: 6px;
+}
 </style>

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

@@ -8,9 +8,9 @@
       v-show="showSearch"
       label-width="100px"
     >
-      <el-form-item label="作业编号" prop="ticketCode">
+      <el-form-item label="作业编号" prop="ticketId">
         <el-input
-          v-model="queryParams.ticketCode"
+          v-model="queryParams.ticketId"
           placeholder="请输入作业编号"
           clearable
           @keyup.enter.native="handleQuery"
@@ -61,7 +61,7 @@
       <el-table-column
         label="作业编号"
         align="center"
-        prop="ticketCode"
+        prop="ticketId"
         width="200"
       >
       </el-table-column>
@@ -71,12 +71,12 @@
         prop="ticketName"
         width="200"
       />
-      <el-table-column
-        label="作业区域"
-        align="center"
-        prop="workareaName"
-        width="200"
-      />
+<!--      <el-table-column-->
+<!--        label="作业区域"-->
+<!--        align="center"-->
+<!--        prop="workareaName"-->
+<!--        width="200"-->
+<!--      />-->
       <!-- 上锁状态 -->
       <el-table-column label="上锁状态" align="center" width="230">
         <template slot-scope="scope">

+ 36 - 53
src/views/mes/md/segregationpoint/index.vue

@@ -101,7 +101,7 @@
           icon="el-icon-plus"
           size="mini"
           @click="handleAdd"
-          v-hasPermi="['mes:md:seg:add']"
+          v-hasPermi="['iscs:point:add']"
         >新增
         </el-button>
       </el-col>
@@ -114,7 +114,7 @@
           size="mini"
           :disabled="multiple"
           @click="handleDelete"
-          v-hasPermi="['mes:md:seg:batchremove']"
+          v-hasPermi="['iscs:point:remove']"
         >批量删除
         </el-button>
       </el-col>
@@ -156,7 +156,7 @@
             v-no-more-click
             type="text"
             @click="handleView(scope.row)"
-            v-hasPermi="['mes:md:seg:query']"
+            v-hasPermi="['iscs:point:list']"
           >{{ scope.row.pointCode }}
           </el-button>
         </template>
@@ -271,7 +271,7 @@
             type="text"
             icon="el-icon-edit"
             @click="handleUpdate(scope.row)"
-            v-hasPermi="['mes:md:seg:edit']"
+            v-hasPermi="['iscs:point:edit']"
           >编辑
           </el-button>
           <el-button
@@ -280,7 +280,7 @@
             type="text"
             icon="el-icon-delete"
             @click="handleDelete(scope.row)"
-            v-hasPermi="['mes:md:seg:remove']"
+            v-hasPermi="['iscs:point:remove']"
           >删除
           </el-button>
         </template>
@@ -366,17 +366,29 @@
         </el-row>
         <el-row>
           <el-col :span="11">
-             <el-form-item label="作业区域" prop="workareaId">
-              <treeselect
+            <el-form-item label="所属电柜" prop="lockTypeName">
+              <el-select
                 style="width: 300px"
-                v-model="form.workareaId"
-                :options="deptOptions"
-                :normalizer="normalizer"
-                placeholder="选择作业区域"
-              />
+                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="workareaId">-->
+<!--              <treeselect-->
+<!--                style="width: 300px"-->
+<!--                v-model="form.workareaId"-->
+<!--                :options="deptOptions"-->
+<!--                :normalizer="normalizer"-->
+<!--                placeholder="选择作业区域"-->
+<!--              />-->
+<!--            </el-form-item>-->
           </el-col>
           <el-col :span="11">
             <el-form-item label="挂锁类型" prop="lockTypeId">
@@ -419,7 +431,6 @@
                 placeholder="选择锁具机构类型"
               />
             </el-form-item>
-
           </el-col>
         </el-row>
         <el-row>
@@ -432,24 +443,7 @@
               />
             </el-form-item>
           </el-col>
-          <el-col :span="12">
-            <el-form-item label="所属电柜" prop="lockTypeName">
-            <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-col>
         </el-row>
-
         <el-row>
           <el-col :span="8">
             <el-form-item label="隔离点图标" prop="pointIcon">
@@ -498,8 +492,6 @@
             </el-form-item>
           </el-col>
         </el-row>
-
-
       </el-form>
 
       <div slot="footer" class="dialog-footer">
@@ -677,14 +669,14 @@ export default {
         current: 1,
         size: -1
       }
-      listWorkarea(data).then((response) => {
-        this.deptOptions = this.handleTree(
-          response.data.records,
-          'workareaId',
-          'parentId',
-          'children'
-        )
-      })
+      // listWorkarea(data).then((response) => {
+      //   this.deptOptions = this.handleTree(
+      //     response.data.records,
+      //     'workareaId',
+      //     'parentId',
+      //     'children'
+      //   )
+      // })
       // 锁具机构类型
       listLockType(data).then((response) => {
         this.LockTypeOptions = this.handleTree(response.data.records, 'locksetTypeId')
@@ -695,6 +687,7 @@ export default {
       })
     //   所属电柜
       listLoto(data).then((response) => {
+        console.log(response,'电柜数据')
         this.lotoOptions = response.data.records.map((item) => {
           return {
             value: item.lotoId,
@@ -815,17 +808,7 @@ export default {
       this.form.workshopId = 0
       this.getworkShop()
     },
-    // 查询明细按钮操作
-    // handleView(row) {
-    //   this.reset();
-    //   const teamId = row.teamId || this.ids;
-    //   getTeam(teamId).then((response) => {
-    //     this.form = response.data;
-    //     this.open = true;
-    //     this.title = "查看";
-    //     this.optType = "view";
-    //   });
-    // },
+
     /** 修改按钮操作 */
     handleUpdate(row) {
       this.reset()

+ 0 - 1
src/views/mes/sop/sopm/NewSop.vue

@@ -44,7 +44,6 @@
         style="width: 50%; margin: 20px"
         :header-cell-style="{ background: '#004d8c', color: '#FFFFFF' }"
         :data="technologyList"
-
       >
         <el-table-column type="selection" width="55" align="center" />
         <el-table-column

+ 12 - 3
src/views/mes/sop/sopm/index.vue

@@ -84,7 +84,7 @@
                      type="text"
                      icon="el-icon-edit"
                      @click="handleUpdate(scope.row)"
-                     v-hasPermi="['iscs:mars:sop:edit']"
+                     v-hasPermi="['iscs:mars:sop:edit','iscs:mars:sop:query']"
           >修改
           </el-button>
 
@@ -101,7 +101,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="470px" append-to-body>
       <el-form ref="form" :model="form" :rules="rules" label-width="100px">
@@ -198,6 +204,8 @@ export default {
       autoGenFlag: false,
       // 显示搜索条件
       showSearch: true,
+      // 总条数
+      total: 0,
       // 表格树数据
       deptList: [],
       // mars树选项
@@ -219,7 +227,7 @@ export default {
       // 查询参数
       queryParams: {
         pages:1,
-        size:-1,
+        size:10,
         sopName: undefined,
         sopCode: undefined
       },
@@ -270,6 +278,7 @@ export default {
       getIsMarsSopPage(this.queryParams).then(response => {
         debugger;
         this.deptList = response.data.records
+        this.total = response.data.total;
         this.loading = false
       })
       const data={

+ 13 - 7
src/views/system/mars/index.vue

@@ -33,7 +33,7 @@
                    icon="el-icon-plus"
                    size="mini"
                    @click="handleAdd"
-                   v-hasPermi="['iscs:mars:add']"
+                   v-hasPermi="['iscs:workstation:add']"
         >新增
         </el-button>
       </el-col>
@@ -78,7 +78,7 @@
                      type="text"
                      icon="el-icon-edit"
                      @click="handleUpdate(scope.row)"
-                     v-hasPermi="['iscs:mars:edit']"
+                     v-hasPermi="['iscs:workstation:edit']"
           >修改
           </el-button>
           <el-button v-no-more-click
@@ -86,7 +86,7 @@
                      type="text"
                      icon="el-icon-plus"
                      @click="handleAdd(scope.row)"
-                     v-hasPermi="['iscs:mars:add']"
+                     v-hasPermi="['iscs:workstation:add']"
           >新增
           </el-button>
 <!--          v-if="scope.row.parentId != 0"-->
@@ -96,7 +96,7 @@
                      type="text"
                      icon="el-icon-delete"
                      @click="handleDelete(scope.row)"
-                     v-hasPermi="['iscs:mars:remove']"
+                     v-hasPermi="['iscs:workstation:remove']"
           >删除
           </el-button>
         </template>
@@ -190,7 +190,8 @@ export default {
         pages:1,
         size:-1,
         workstationName: undefined,
-        workstationCode: undefined
+        workstationCode: undefined,
+        userId:undefined
       },
       // 表单参数
       form: {},
@@ -210,14 +211,15 @@ watch: {
     immediate: true,
     handler(val) {
       console.log(val,'用户id')
-      this.queryParams.userId = val;
+
+        this.queryParams.userId = val;
       this.getList();
+
     }
   }
 },
 
   created() {
-
     this.getList()
   },
   methods: {
@@ -257,6 +259,7 @@ watch: {
         workstationId: undefined,
         parentId: undefined,
         workstationName: undefined,
+        userId: undefined,
       }
       this.autoGenFlag = false;
       this.resetForm('form')
@@ -278,8 +281,11 @@ watch: {
     },
     /** 重置按钮操作 */
     resetQuery() {
+      this.queryParams.userId = undefined
       this.resetForm('queryForm')
       this.handleQuery()
+      this.$router.push('/user/mars')
+
     },
     /** 新增按钮操作 */
     handleAdd(row) {

+ 28 - 26
src/views/system/technology/technologyDetail/MapData.vue

@@ -5,32 +5,38 @@
       <el-card class="box-card">
         <div slot="header" class="clearfix">
           <span style="font-size: 18px">锁定站信息展示</span>
-<!--          <span-->
-<!--            style="-->
-<!--                float: right;-->
-<!--                padding: 1px 0;-->
-<!--                font-size: 22px;-->
-<!--                cursor: pointer;-->
-<!--              "-->
-<!--            type="text"-->
-<!--            @click="goBack"-->
-<!--          >×</span-->
-<!--          >-->
+          <!--          <span-->
+          <!--            style="-->
+          <!--                float: right;-->
+          <!--                padding: 1px 0;-->
+          <!--                font-size: 22px;-->
+          <!--                cursor: pointer;-->
+          <!--              "-->
+          <!--            type="text"-->
+          <!--            @click="goBack"-->
+          <!--          >×</span-->
+          <!--          >-->
         </div>
         <div style="height: 100%;padding-bottom:10px">
           <el-input v-model="value" type="textarea" :rows="26" disabled></el-input>
         </div>
         <div class="bottombtn" style="width:100%;height: 35px;padding: 10px 0 0">
-<!--          <el-button v-no-more-click @click="save" type="primary" icon="el-icon-edit"-->
-<!--                     style="float: right; height: 33px; line-height: 2px"-->
-<!--          >保存-->
-<!--          </el-button>-->
-<!--          <el-button v-no-more-click @click="close" type="primary" icon="el-icon-close"-->
-<!--                     style="float: right; height: 33px; line-height: 2px;margin: 0 10px"-->
-<!--          >关闭-->
-<!--          </el-button>-->
-          <!--          <el-button v-no-more-click @click="reset" type="primary" icon="el-icon-refresh"  style="float: right; height: 33px; line-height: 2px;margin: 0 10px">重置</el-button>-->
-          <!--          <el-button v-no-more-click @click="view" type="primary" icon="el-icon-view" style="float: right; height: 33px; line-height: 2px">预览</el-button>-->
+          <el-button v-no-more-click @click="save" type="primary" icon="el-icon-edit"
+                     style="float: left; height: 33px; line-height: 2px"
+          >保存
+          </el-button>
+          <el-button v-no-more-click @click="close" type="primary" icon="el-icon-close"
+                     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>
 
@@ -69,13 +75,10 @@ export default {
       selectPoints: []//回显之前选中的隔离点
     }
   },
-
   mounted() {
-    this.p
     this.$nextTick(() => {
       this.getLoToInfo()
     })
-
   },
 
   methods: {
@@ -98,7 +101,6 @@ export default {
         getLotoMapInfo(lotoId, sopId, ticketId).then(response => {
           console.log(response, '电柜预览接口调用')
           this.form.map = response.data
-
           if (response.data) {
             try {
               this.value = JSON.stringify(response.data, null, 4)
@@ -108,7 +110,7 @@ export default {
           }
           this.initKonva()
         })
-      });
+      })
 
       //   设备工艺详情
       getTechnologyInfo(this.$route.query.machineryId).then(response => {

+ 71 - 48
src/views/system/technology/technologyDetail/craftDetail.vue

@@ -1,12 +1,15 @@
 <template>
   <div class="app-container">
     <el-radio-group v-model="tabPosition" style="margin-bottom: 30px">
-      <el-radio-button label="craftInformation">工艺信息</el-radio-button>
+      <el-radio-button label="craftInfo">工艺信息</el-radio-button>
       <el-radio-button label="deviceList">设备列表</el-radio-button>
       <el-radio-button label="Loto">锁定站</el-radio-button>
       <el-radio-button label="sopList">SOP列表</el-radio-button>
     </el-radio-group>
+<!--    工艺信息-->
+    <div class="craft" v-if="this.tabPosition == 'craftInfo'">
 
+    </div>
     <!-- 设备列表 -->
     <div class="device" v-if="this.tabPosition == 'deviceList'">
       <el-row :gutter="10" class="mb8">
@@ -79,21 +82,21 @@
             <img :src="scope.row.machineryImg" alt="" style="width: 50px; height: 50px;"/>
           </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"
-              @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"-->
+<!--              @click="handleLook(scope.row)"-->
+<!--            >查看-->
+<!--            </el-button>-->
+<!--          </template>-->
+<!--        </el-table-column>-->
         <el-table-column
           label="操作"
           align="center"
@@ -130,16 +133,16 @@
     <div class="sopList" v-if="this.tabPosition == 'sopList'">
       <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-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
@@ -155,10 +158,10 @@
           </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
@@ -186,15 +189,15 @@
           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-edit"-->
+<!--              @click="handleUpdate(scope.row)"-->
+<!--              v-hasPermi="['iscs:machinery:edit']"-->
+<!--            >编辑-->
+<!--            </el-button>-->
             <!-- <el-button
                 v-no-more-click
                 size="mini"
@@ -217,7 +220,22 @@
           </template>
         </el-table-column>
       </el-table>
+
     </div>
+    <pagination
+      v-show="total1 > 0&&tabPosition=='deviceList'"
+      :total="total1"
+      :page.sync="queryParams.pages"
+      :limit.sync="queryParams.size"
+      @pagination="getList"
+    />
+    <pagination
+      v-show="total2 > 0&&tabPosition=='sopList'"
+      :total="total2"
+      :page.sync="queryParams.pages"
+      :limit.sync="queryParams.size"
+      @pagination="getList"
+    />
     <!-- 添加或修改部门对话框 -->
     <el-dialog :title="title" :visible.sync="open" width="450px" append-to-body>
       <el-form ref="form" :model="form" :rules="rules" label-width="120px">
@@ -334,6 +352,8 @@ export default {
       //自动生成编码
       autoGenFlag: false,
       tabPosition: 'deviceList',
+      total1:0,//设备列表
+      total2:0,//sop列表
       // 非多个禁用
       multiple: true,
       // 显示搜索条件
@@ -357,9 +377,10 @@ export default {
       // 查询参数
       queryParams: {
         pages: 1,
-        size: -1,
+        size: 10,
         machineryName: undefined,
-        machineryCode: undefined
+        machineryCode: undefined,
+        machineryId: undefined,
       },
       LotoOptions: [], //电柜绑定
       // 表单参数
@@ -418,10 +439,13 @@ export default {
     getList() {
       this.loading = true
       listTechnology(this.queryParams).then((response) => {
+
         debugger;
         const filterData = response.data.records.filter(item => {
           return item.parentId == this.$route.query.machineryId
         })
+        this.total1=filterData.length
+
         this.deptList = this.handleTree(
           filterData,
           'machineryId',
@@ -454,14 +478,12 @@ export default {
           }
         })
       });
-      const dataSop={
-        pasge: 1,
-        size:-1,
-        machineryId:this.$route.query.machineryId
-      }
-      getIsMarsSopPage(dataSop).then(response => {
+
+      this.queryParams.machineryId=this.$route.query.machineryId
+      getIsMarsSopPage(this.queryParams).then(response => {
         debugger;
         this.SopList = response.data.records
+        this.total2=response.data.total
         this.loading = false
       })
     },
@@ -555,13 +577,14 @@ export default {
       } else {
         this.form.parentId = this.$route.query.machineryId
       }
-
+      this.form.machineryType='设备'
       this.open = true
       this.title = '添加设备'
     },
     /** 修改按钮操作 */
     handleUpdate(row) {
       this.reset()
+      this.form.machineryType='设备'
       getTechnologyInfo(row.machineryId).then((response) => {
         this.form = response.data
         this.open = true

+ 15 - 15
src/views/system/technology/technologyDetail/deviceDetail.vue

@@ -69,21 +69,21 @@
           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"-->
+<!--              @click="handleLook(scope.row)"-->
+<!--            >查看-->
+<!--            </el-button>-->
+<!--          </template>-->
+<!--        </el-table-column>-->
         <el-table-column
           label="操作"
           align="center"

+ 0 - 1
src/views/system/technology/technologyList/MapData.vue

@@ -69,7 +69,6 @@ export default {
     }
   },
   mounted() {
-
     this.$nextTick(()=>{
       this.getLoToInfo()
     })

+ 202 - 208
src/views/system/technology/technologyList/index.vue

@@ -12,6 +12,7 @@
             prefix-icon="el-icon-search"
             style="margin-bottom: 20px"
             @input="handleInputChange"
+            @clear="handleClear"
           />
         </div>
         <div class="head-container">
@@ -33,10 +34,10 @@
     <div class="right">
       <el-radio-group v-model="tabPosition" style="margin-bottom: 30px">
         <el-radio-button label="craft">工艺</el-radio-button>
-        <el-radio-button label="equipment">设备</el-radio-button>
+        <el-radio-button label="device">设备</el-radio-button>
       </el-radio-group>
-      <!-- 工艺 -->
-      <div class="craft" v-if="this.tabPosition == 'craft'">
+
+      <div v-if="tabPosition === 'craft' || tabPosition === 'device'">
         <el-form
           :model="queryParams"
           ref="queryForm"
@@ -44,10 +45,10 @@
           :inline="true"
           v-show="showSearch"
         >
-          <el-form-item label="工艺名称" prop="machineryName">
+          <el-form-item :label="tabPosition === 'craft' ? '工艺名称' : '设备名称'" prop="machineryName">
             <el-input
               v-model="queryParams.machineryName"
-              placeholder="请输入工艺名称"
+              :placeholder="tabPosition === 'craft' ? '请输入工艺名称' : '请输入设备名称'"
               clearable
               @keyup.enter.native="handleQuery"
             />
@@ -68,8 +69,7 @@
               size="mini"
               @click="resetQuery"
             >重置
-            </el-button
-            >
+            </el-button>
           </el-form-item>
         </el-form>
         <el-row :gutter="10" class="mb8">
@@ -96,20 +96,8 @@
               @click="handleDelete"
               v-hasPermi="['mes:hw:information:batchremove']"
             >批量删除
-            </el-button
-            >
+            </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"
@@ -128,166 +116,39 @@
           <el-table-column type="selection" width="55" align="center"/>
           <el-table-column
             prop="machineryCode"
-            label="工艺编码"
+            :label="tabPosition === 'craft' ? '工艺编码' : '设备编码'"
           ></el-table-column>
           <el-table-column
             prop="machineryName"
-            label="工艺名称"
+            :label="tabPosition === 'craft' ? '工艺名称' : '设备名称'"
           ></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>
+            prop="workstationName"
+            label="岗位"
+          ></el-table-column>
           <el-table-column
-            label="操作"
-            align="center"
-            class-name="small-padding fixed-width"
+            prop="machineryImg"
+            :label="tabPosition === 'craft' ? '工艺图' : '设备图'"
           >
             <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-plus"
-                @click="handleAdd(scope.row)"
-                v-hasPermi="['iscs:machinery:add']"
-                >新增
-              </el-button> -->
-              <!--          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:machinery:remove']"
-              >删除
-              </el-button>
+              <div  class="img-box" >
+                <el-image
+                  style="width: 75px; height: 75px"
+                  :preview-teleported="true"
+                  class="images"
+                  :hide-on-click-modal=true
+                  :src="scope.row.machineryImg"
+                  :zoom-rate="1.2"
+                  :preview-src-list="[scope.row.machineryImg]"
+                  :initial-index="1"
+                  fit="cover" >
+                </el-image>
+                <i class="el-icon-zoom-in" id="eyeicon"></i>
+              </div>
             </template>
           </el-table-column>
-        </el-table>
-      </div>
-      <!-- 设备 -->
-      <div class="equipment" v-if="this.tabPosition !== 'craft'">
-        <el-form
-          :model="queryParams"
-          ref="queryForm"
-          size="small"
-          :inline="true"
-          v-show="showSearch"
-        >
-          <el-form-item label="设备名称" prop="machineryName">
-            <el-input
-              v-model="queryParams.machineryName"
-              placeholder="请输入设备名称"
-              clearable
-              @keyup.enter.native="handleQuery"
-            />
-          </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"
-              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="设备详情"
+            label="详情"
             align="center"
             class-name="small-padding fixed-width"
           >
@@ -316,16 +177,6 @@
                 v-hasPermi="['iscs:machinery:edit']"
               >编辑
               </el-button>
-              <!-- <el-button
-                v-no-more-click
-                size="mini"
-                type="text"
-                icon="el-icon-plus"
-                @click="handleAdd(scope.row)"
-                v-hasPermi="['iscs:machinery:add']"
-                >新增
-              </el-button> -->
-              <!--          v-if="scope.row.parentId != 0"-->
               <el-button
                 v-no-more-click
                 size="mini"
@@ -338,32 +189,46 @@
             </template>
           </el-table-column>
         </el-table>
+        <pagination
+          v-show="total1 > 0&&tabPosition=='craft'"
+          :total="total1"
+          :page.sync="queryParams.pages"
+          :limit.sync="queryParams.size"
+          @pagination="getList"
+        />
+        <pagination
+          v-show="total2 > 0&&tabPosition=='device'"
+          :total="total2"
+          :page.sync="queryParams.pages"
+          :limit.sync="queryParams.size"
+          @pagination="getList"
+        />
       </div>
     </div>
     <!-- 添加或修改部门对话框 -->
-    <el-dialog :title="title" :visible.sync="open" width="450px" append-to-body>
+    <el-dialog :title="title" :visible.sync="open" width="490px" append-to-body>
       <el-form ref="form" :model="form" :rules="rules" label-width="120px">
-        <el-form-item label="上级" prop="parentId">
-          <treeselect
-            v-model="form.parentId"
-            :options="machineryOptions"
-            :normalizer="normalizer"
-            placeholder="选择上级"
-          />
-        </el-form-item>
+<!--        <el-form-item label="上级" prop="parentId">-->
+<!--          <treeselect-->
+<!--            v-model="form.parentId"-->
+<!--            :options="machineryOptions"-->
+<!--            :normalizer="normalizer"-->
+<!--            placeholder="选择上级"-->
+<!--          />-->
+<!--        </el-form-item>-->
 
-        <el-form-item label="设备/工艺名称" prop="machineryName">
+        <el-form-item :label="this.tabPosition=='craft'?'工艺名称':'设备名称'" prop="machineryName">
           <el-input
             v-model="form.machineryName"
-            placeholder="请输入设备/工艺名称"
+            placeholder="请输入名称"
           />
         </el-form-item>
         <el-row>
           <el-col :span="18">
-            <el-form-item label="设备/工艺编号" prop="machineryCode">
+            <el-form-item :label="this.tabPosition=='craft'?'工艺编号':'设备编号'" prop="machineryCode">
               <el-input
                 v-model="form.machineryCode"
-                placeholder="请输入设备/工艺编号"
+                placeholder="请输入编号"
               />
             </el-form-item>
           </el-col>
@@ -430,6 +295,7 @@
 </template>
 
 <script>
+
 import {
   listTechnology,
   addTechnology,
@@ -454,7 +320,10 @@ export default {
       //自动生成编码
       autoGenFlag: false,
       tabPosition: 'craft',
-      multiple: false,
+      total1:0,//工艺分页
+      total2:0,//设备分页
+      // 非多个禁用
+      multiple: true,
       // 显示搜索条件
       showSearch: true,
       // 表格树数据
@@ -476,7 +345,7 @@ export default {
       // 查询参数
       queryParams: {
         pages: 1,
-        size: -1,
+        size: 10,
         machineryName: undefined,
         machineryCode: undefined,
         workstationName:undefined,
@@ -526,27 +395,38 @@ export default {
           })
         })
       }
+    },
+    "tabPosition":function(newVal, oldVal){
+      if(newVal){
+        this.getList()
+      }
     }
   },
 
   methods: {
+
     /** 查询部门列表 */
     getList() {
       this.loading = true
       listTechnology(this.queryParams).then((response) => {
         debugger;
-        if(this.tabPosition == 'craft'){
-          this.deptList = response.data.records.filter(item => {return item.machineryType == '工艺'})
-          console.log(this.deptList, '设备/工艺列表---a')
-        }else{
-          this.deptList = response.data.records.filter(item => { return item.machineryType == '设备'})
-          console.log(this.deptList, '设备/工艺列表---v')
+        let filteredData;
+        if (this.tabPosition == 'craft') {
+          filteredData = this.filterByMachineryType(response.data.records, '工艺');
+          console.log(filteredData, '工艺列表---a');
+          this.total1=filteredData.length;
+        } else {
+          filteredData = this.filterByMachineryType(response.data.records, '设备');
+          console.log(filteredData, '设备列表---v');
+          this.total2=filteredData.length;
         }
+
         this.deptList = this.handleTree(
-          response.data.records,
+          filteredData,
           'machineryId',
           'parentId'
-        )
+        );
+
 
         // 岗位新增的下拉
         this.machineryOptions = this.handleTree(
@@ -554,6 +434,7 @@ export default {
           'machineryId',
           'parentId'
         )
+
         this.loading = false
       })
       const data = {
@@ -590,6 +471,31 @@ export default {
 
       })
     },
+    // 过滤设备工艺children数据类型是
+    filterByMachineryType(records, machineryType) {
+      return records.reduce((acc, item) => {
+        if (item.machineryType === machineryType) {
+          // 过滤符合条件的父级
+          const filteredItem = { ...item };
+
+          // 如果有子级,则递归过滤子级
+          if (item.children && item.children.length > 0) {
+            filteredItem.children = this.filterByMachineryType(item.children, machineryType);
+          }
+
+          // 将符合条件的父级和子级添加到结果中
+          acc.push(filteredItem);
+        } else if (item.children && item.children.length > 0) {
+          // 父级不符合条件,但子级可能符合条件,递归过滤子级
+          const filteredChildren = this.filterByMachineryType(item.children, machineryType);
+          if (filteredChildren.length > 0) {
+            acc.push({ ...item, children: filteredChildren });
+          }
+        }
+        return acc;
+      }, []);
+    },
+
     // mars岗位数深层次遍历
     findNodeById(nodes, targetId) {
       for (let i = 0; i < nodes.length; i++) {
@@ -657,6 +563,32 @@ export default {
         } else {
           console.log('未找到匹配的节点')
         }
+      });
+      listTechnology(this.queryParams).then((response) => {
+        debugger;
+        let filteredData;
+        if (this.tabPosition == 'craft') {
+          filteredData = this.filterByMachineryType(response.data.records, '工艺');
+          console.log(filteredData, '工艺列表---a');
+        } else {
+          filteredData = this.filterByMachineryType(response.data.records, '设备');
+          console.log(filteredData, '设备列表---v');
+        }
+
+        this.deptList = this.handleTree(
+          filteredData,
+          'machineryId',
+          'parentId'
+        );
+
+
+        // 岗位新增的下拉
+        this.machineryOptions = this.handleTree(
+          response.data.records,
+          'machineryId',
+          'parentId'
+        )
+        this.loading = false
       })
     },
     /** 转换mars岗位数据结构 */
@@ -697,6 +629,13 @@ export default {
           console.log('未找到匹配的节点')
         }
       })
+
+    },
+    // 岗位查询 清除事件
+    handleClear(){
+      this.queryParams.workstationId = ''
+      this.queryParams.workstationName=''
+      this.getList()
     },
     normalizer(node) {
       if (node.children && !node.children.length) {
@@ -728,7 +667,9 @@ export default {
       this.form = {
         machineryId: undefined,
         parentId: undefined,
-        machineryName: undefined
+        machineryName: undefined,
+        workstationId: undefined,
+        workstationName: undefined,
       }
       this.autoGenFlag = false
       this.resetForm('form')
@@ -758,6 +699,8 @@ export default {
     },
     /** 重置按钮操作 */
     resetQuery() {
+      this.queryParams.workstationName = undefined;
+      this.queryParams.workstationId = undefined;
       this.resetForm('queryForm')
       this.handleQuery()
     },
@@ -776,16 +719,19 @@ export default {
       if (row != null && row.machineryId) {
         this.form.parentId = row.machineryId
       } else {
-        this.form.parentId = 0
+        this.form.parentId = null
       }
+
       // 在工艺新增就是工艺 设备新增就是设备
       if(this.tabPosition=='craft'){
         this.form.machineryType='工艺'
-      }else if(this.tabPosition=='equipment'){
+        this.title = '添加工艺'
+      }else if(this.tabPosition=='device'){
         this.form.machineryType='设备'
+        this.title = '添加设备'
       }
       this.open = true
-      this.title = '添加部门'
+
     },
     /** 修改按钮操作 */
     handleUpdate(row) {
@@ -793,9 +739,25 @@ export default {
       getTechnologyInfo(row.machineryId).then((response) => {
         this.form = response.data
         this.open = true
-        this.title = '修改部门'
+        if(this.tabPosition=='craft'){
+          this.form.machineryType='工艺'
+          this.title = '修改工艺'
+        }else if(this.tabPosition=='device'){
+          this.form.machineryType='设备'
+          this.title = '修改设备'
+        }
       })
     },
+    handleLook(row) {
+      // 工艺详情
+      if (this.tabPosition == "craft") {
+        this.$router.push("/system/technology/technologyDetail/craftDetail?machineryId=" + row.machineryId);
+      } else {
+        // 设备详情
+        this.$router.push("/system/technology/technologyDetail/deviceDetail?machineryId=" + row.machineryId);
+      }
+    },
+
     /** 提交按钮 */
     submitForm: function() {
       this.$refs['form'].validate((valid) => {
@@ -807,6 +769,9 @@ export default {
               this.getList()
             })
           } else {
+            if(this.form.parentId==null){
+              this.form.parentId=0
+            }
             addTechnology(this.form).then((response) => {
               this.$modal.msgSuccess('新增成功')
               this.open = false
@@ -840,7 +805,36 @@ export default {
   }
 }
 </script>
-<style scoped>
+<style scoped lang="scss">
+
+.img-box {
+  width: 75px;
+  height: 75px;
+  position: relative;
+
+  #eyeicon {
+    display: none;
+  }
+}
+
+.img-box:hover {
+  background: #000;
+
+  .images {
+    opacity: 0.6;
+  }
+
+  #eyeicon {
+    display: block;
+    position: absolute;
+    top: 40%;
+    left: 40%;
+    z-index:100;
+    color: white;
+    pointer-events:none
+  }
+}
+
 .app-container {
   width: 100%;
   height: 100%;

+ 39 - 136
src/views/system/user/index.vue

@@ -34,6 +34,7 @@
               placeholder="请输入工号"
               clearable
               style="width: 240px"
+              oninput="value=value.replace(/[^\d.]/g,'')"
               @keyup.enter.native="handleQuery"
             />
           </el-form-item>
@@ -317,17 +318,27 @@
         </el-row>
         <el-row>
           <el-col :span="12">
-            <el-form-item label="岗位">
-              <el-select v-model="form.postIds" multiple placeholder="请选择岗位">
+            <el-form-item label="玛氏岗位" prop="workstationIds">
+              <el-select v-model="form.workstationIds" clearable multiple placeholder="请选择玛氏岗位">
                 <el-option
-                  v-for="item in postOptions"
-                  :key="item.postId"
-                  :label="item.postName"
-                  :value="item.postId"
-                  :disabled="item.status == 1"
+                  v-for="item in MarsWordStationOptions"
+                  :key="item.workstationId"
+                  :label="item.workstationName"
+                  :value="item.workstationId"
                 ></el-option>
               </el-select>
             </el-form-item>
+<!--            <el-form-item label="岗位">-->
+<!--              <el-select v-model="form.postIds" multiple placeholder="请选择岗位">-->
+<!--                <el-option-->
+<!--                  v-for="item in postOptions"-->
+<!--                  :key="item.postId"-->
+<!--                  :label="item.postName"-->
+<!--                  :value="item.postId"-->
+<!--                  :disabled="item.status == 1"-->
+<!--                ></el-option>-->
+<!--              </el-select>-->
+<!--            </el-form-item>-->
           </el-col>
           <el-col :span="12">
             <el-form-item label="角色">
@@ -345,20 +356,8 @@
         </el-row>
         <el-row>
           <el-col :span="12">
-            <el-form-item label="玛氏岗位" prop="workstationIds">
-              <el-select size="small" v-model="form.workstationIds" placeholder="请选择" value-key="workstationIds"  :popper-append-to-body="false" multiple
-                         @remove-tag="removeTag" >
-                <el-option :value="selectTreeValue"  class="setstyle" disabled>
-                  <el-input class="setinput" size="mini" placeholder="输入关键字进行过滤" clearable v-model="filterText"></el-input>
-                  <el-tree :data="treeData" check-strictly default-expand-all show-checkbox node-key="id" ref="treeRef" highlight-current
-                           :filter-node-method="MardfilterNode" :props="defaultProps" @check-change="handleCheckChange"></el-tree>
-                </el-option>
-              </el-select>
-            </el-form-item>
-          </el-col>
-          <el-col :span="12">
-            <el-form-item label="归属单位" prop="unitIds">
-              <treeselect v-model="form.unitIds" :options="UnitOptions" :normalizer="Unitnormalizer" :show-count="true" placeholder="请选择归属单位" />
+            <el-form-item label="单位" prop="unitIds">
+              <treeselect v-model="form.unitIds" :options="UnitOptions" :normalizer="Unitnormalizer" :show-count="true" placeholder="请选择单位" />
             </el-form-item>
           </el-col>
         </el-row>
@@ -509,6 +508,9 @@ export default {
           { required: true, message: "用户密码不能为空", trigger: "blur" },
           { min: 5, max: 20, message: '用户密码长度必须介于 5 和 20 之间', trigger: 'blur' }
         ],
+        unitIds:[
+          { required: true, message: "单位不能为空", trigger: "blur" }
+        ],
         email: [
           {
             type: "email",
@@ -573,7 +575,8 @@ export default {
       }
       listMarsDept(data).then(response => {
         this.MarsWordStationOptions = response.data.records;//初始化数据
-        this.$set(this, 'treeData', this.transformDataToTree(response.data.records));
+
+        // this.$set(this, 'treeData', this.transformDataToTree(response.data.records));
       })
     },
     // 筛选节点
@@ -617,6 +620,8 @@ export default {
         remark: undefined,
         postIds: [],
         roleIds: [],
+        unitIds:null,
+        workstationIds: null,
 
       };
       this.resetForm("form");
@@ -631,6 +636,7 @@ export default {
       this.dateRange = [];
       this.resetForm("queryForm");
       this.handleQuery();
+      this.$router.push('/user/user')
     },
     // 多选框选中数据
     handleSelectionChange(selection) {
@@ -655,91 +661,7 @@ export default {
     HandleLookWorkStation(row){
       this.$router.push('/user/mars?userId='+row.userId)
     },
-    // 树形结构
-    transformDataToTree(data) {
-      const map = {};
-
-      // 将所有节点放入 map 中,方便查找
-      data.forEach(node => {
-        map[node.workstationId] = { id: node.workstationId, label: node.workstationName, children: [] };
-      });
-
-      // 构建树形结构
-      const roots = [];
-      data.forEach(node => {
-        if (node.parentId == 0 || node.parentId == null) {
-          roots.push(map[node.workstationId]);
-        } else {
-          if (map[node.parentId]) {
-            map[node.parentId].children.push(map[node.workstationId]);
-          }
-        }
-      });
-
-      return roots;
-    },
-    // 新增节点回显
-    addTag(node) {
-      this.selectTreeValue.push({ id: node.id, label: node.label });
-      this.form.workstationIds.push(node.label);
-      // 更新树的选中状态
-      this.$nextTick(() => {
-        this.$refs.treeRef.setCheckedNodes(this.selectTreeValue.map(item => ({ id: item.id, label: item.label })));
-      });
-    },
-
-    // 移除Tag
-    removeTag(nodeLabel) {
-      // 删除 selectTreeValue 中对应的节点
-      const indexValue = this.selectTreeValue.findIndex(item => item.label === nodeLabel);
-      if (indexValue !== -1) {
-        const removedNode = this.selectTreeValue[indexValue];
-        this.selectTreeValue.splice(indexValue, 1);
-
-        // 更新树的选中状态(取消选中节点)
-        this.$nextTick(() => {
-          this.$refs.treeRef.setChecked(removedNode.id, false);
-        });
-      }
 
-      // 删除 form.workstationIds 中的对应节点
-      const indexForm = this.form.workstationIds.findIndex(item => item === nodeLabel);
-      if (indexForm !== -1) {
-        this.form.workstationIds.splice(indexForm, 1);
-      }
-    },
-
-    // 编辑回显选中节点
-    editTag(workstationIds) {
-      const workstationNames = workstationIds.map(workstationId => {
-        const record = this.MarsWordStationOptions.find(record => record.workstationId === workstationId);
-        return record ? { id: record.workstationId, label: record.workstationName } : null;
-      }).filter(node => node !== null);
-
-      console.log(workstationNames, 'workstationNames');
-
-      this.$nextTick(() => {
-        const checkedNodes = workstationNames.map(node => node.id);  // 通过 id 作为唯一标识
-        this.$refs.treeRef.setCheckedNodes(checkedNodes);
-      });
-
-      // 确保这里绑定的是正确的 key 值
-      this.form.workstationIds = workstationNames.map(node => node.label); // 使用 id 而不是 name
-    },
-    // 节点选中
-    handleCheckChange(data, checked, indeterminate) {
-      if (checked) {
-        this.addTag(data); // 调用 addTag 方法
-      } else {
-        this.removeTag(data.label); // 调用 removeTag 方法
-      }
-    },
-
-    // 玛氏筛选节点
-    MardfilterNode(value, data){
-      if (!value) return true;
-      return data.label.indexOf(value) !== -1;
-    },
     /** 查询部门下拉树结构 */
     getTreeselect() {
       treeselect().then(response => {
@@ -770,15 +692,6 @@ export default {
     handleAdd() {
       this.reset();
       this.getTreeselect();
-      // 清空选中节点并重置 form.workstationIds
-      this.$nextTick(() => {
-        if (this.$refs.treeRef) {
-          this.$refs.treeRef.setCheckedKeys([]);
-          this.form.workstationIds = [];
-        } else {
-          console.error('treeRef is not defined');
-        }
-      });
       getUser().then(response => {
         this.postOptions = response.posts;
         this.roleOptions = response.roles;
@@ -794,21 +707,15 @@ export default {
 
       const userId = row.userId || this.ids;
       getUser(userId).then(response => {
-
         this.open = true;
         this.form = response.data;
         this.postOptions = response.posts;
         this.roleOptions = response.roles;
         this.form.postIds = response.postIds;
         this.form.roleIds = response.roleIds;
+        this.form.workstationIds=response.workstationIds
+        this.form.unitIds=response.unitIds;
 
-        //查找并转换
-        if(response.workstationIds){
-          this.editTag(response.workstationIds)
-        }else {
-          this.form.workstationIds=[]
-        }
-        this.form.unitIds= response.unitIds;
         this.title = "修改用户";
         this.form.password = "";
       });
@@ -837,13 +744,13 @@ export default {
       this.$refs["form"].validate(valid => {
         if (valid) {
           if (this.form.userId != undefined) {
-            // 文字转换
-            const workstationIds = this.form.workstationIds.map(deviceName => {
-              const record = this.MarsWordStationOptions.find(record => record.workstationName == deviceName);
-              return record ? record.workstationId : null;
-            }).filter(id => id !== null);
-            this.form.workstationIds=workstationIds
-            this.form.unitIds=this.form.unitIds
+
+            if (!Array.isArray(this.form.unitIds)) {
+              this.form.unitIds = [this.form.unitIds]; // 如果不是数组,转换为数组
+            } else {
+              // 确保数组中的每个元素都是独立的
+              this.form.unitIds = this.form.unitIds.flat();
+            }
             updateUser(this.form).then(response => {
               this.$modal.msgSuccess("修改成功");
               this.open = false;
@@ -851,13 +758,9 @@ export default {
             });
           } else {
             // 文字转换
-            const workstationIds = this.form.workstationIds.map(deviceName => {
-              const record = this.MarsWordStationOptions.find(record => record.workstationName == deviceName);
-              return record ? record.workstationId : null;
-            }).filter(id => id !== null);
-            this.form.workstationIds=workstationIds
             this.form.unitIds=[this.form.unitIds]
-            console.log(this.form,'新增参数')
+            console.log(this.form.workstationIds,'新增参数')
+
             addUser(this.form).then(response => {
               this.$modal.msgSuccess("新增成功");
               this.open = false;