Kaynağa Gözat

部分开会出现的演示问题进行修复登录名工号人员选择与单位内外部属性列调整

pm 10 ay önce
ebeveyn
işleme
f277585fd5

+ 15 - 11
src/views/mes/hw/lotoStation/index.vue

@@ -30,9 +30,9 @@
         <el-form-item label="岗位" prop="workstationId" >
           <treeselect style="width: 200px" v-model="queryParams.workstationId" :options="marsOptions" :normalizer="Marsnormalizer" placeholder="请选择岗位"/>
         </el-form-item>
-<!--        <el-form-item label="设备/工艺" prop="lotoId" >-->
-<!--          <treeselect style="width: 200px" v-model="queryParams.lotoId" :options="machineryOptions" :normalizer="machinerynormalizer" placeholder="请选择设备/工艺"/>-->
-<!--        </el-form-item>-->
+        <el-form-item label="设备/工艺" prop="lotoId" >
+          <treeselect style="width: 200px" v-model="queryParams.lotoId" :options="machineryOptions" :normalizer="Machinerynormalizer" placeholder="请选择设备/工艺"/>
+        </el-form-item>
         <el-form-item style="margin-left: 20px">
           <el-button v-no-more-click
                      type="primary"
@@ -355,14 +355,17 @@ export default {
       listMarsDept(data).then(response => {
         this.marsOptions = this.handleTree(response.data.records,"workstationId","parentId")
       })
-      // 设备工艺
-      listTechnology(data).then(response => {
+
+      // 设备/工艺
+      listTechnology(data).then((response) => {
+        const data=response.data.records.filter((item) =>item.machineryType=='工艺')
         this.machineryOptions = this.handleTree(
-          response.data.records,
-          'machineryId',
-          'parentId'
-        )
-      })
+          data,
+          "machineryId",
+          "parentId"
+        );
+
+      });
 
     },
     /** 转换部门数据结构 */
@@ -376,7 +379,8 @@ export default {
         children: node.children
       }
     },
-    machinerynormalizer(node) {
+    // 设备工艺树
+    Machinerynormalizer(node) {
       if (node.children && !node.children.length) {
         delete node.children
       }

+ 26 - 40
src/views/mes/job/jobm/NewMarsJob.vue

@@ -200,9 +200,8 @@
                     <el-table-column label="步骤" prop="number">
                       <template slot-scope="scope">
                         <span v-if="scope.row.lockNum !== null">
-                          <img src="@/assets/images/lockImg.png" alt="" style="width: 12px;height:13px;margin-top: 5px;">
-<!--                          <i class="el-icon-goods"></i>-->
-                          {{ scope.row.lockNum }}
+<!--                          <img src="@/assets/images/lockImg.png" alt="" style="width: 12px;height:13px;margin-top: 5px;">-->
+                          <i class="el-icon-lock">{{ scope.row.lockNum }}</i>
                         </span>
                         <span v-if="scope.row.userNum !== null">
                           <i class="el-icon-user">{{ scope.row.userNum }}</i>
@@ -685,7 +684,7 @@ import { getLotoInfo, getLotoMapInfo } from '@/api/mes/lotoStation/lotoStation'
 export default {
   name: 'NewSop',
   components: { Template, MapData },
-  dicts: ['sop_type', 'ticket_status'],
+  dicts: ['sop_type', 'ticket_status','ticket_user_type'],
   data() {
     return {
       tabPosition: 'first',
@@ -769,26 +768,6 @@ export default {
         console.log('我制定了')
       }
     },
-    'workstationId': function (val) {
-      if (val) {
-        this.workstationId=val
-        const query = {
-          pageSize: 10000,
-          pageNum: 1,
-          workstationId:this.workstationId,
-        }
-        getUserList(query).then((res) => {
-          this.listLockerOption = res.rows
-            .filter((item) => item.unitId == 9)
-            .map((item) => ({
-              label: item.nickName,
-              value: item.userId
-            }))
-          this.insideTableData = res.rows.filter((item) => item.unitId == 9)
-          this.outsideTableData = res.rows.filter((item) => item.unitId != '9')
-        })
-      }
-    }
   },
 
   mounted() {
@@ -916,21 +895,6 @@ export default {
         console.log(res, 'marsDeptList')
         this.marsDeptList = res.data.records
       })
-      const query = {
-        pageSize: 10000,
-        pageNum: 1,
-        workstationId:this.workstationId,
-      }
-      console.log(query,'用户的参数')
-      getUserList(query).then((res) => {
-        console.log(res, 'userList')
-        this.listLockerOption = res.rows
-          .filter((item) => item.unitId == 9)
-          .map((item) => ({
-            label: item.nickName,
-            value: item.userId
-          }))
-      })
     },
     // sop类型 el-radio
     handleSopchange(data) {
@@ -1034,13 +998,34 @@ export default {
         this.newticketUserDTOList=[]
         this.open = true
 
+        const roleId=this.dict.type.ticket_user_type.find((item)=>item.label=='jtlocker')//利用字典值来记录上锁人 共锁人 方便如果修改了值 直接系统更改
+        const query1 = {
+          pageSize: 10000,
+          pageNum: 1,
+          workstationId:this.workstationId,
+          roleId:roleId.value,
+          unitId:9
+        }
+        // 上锁人赋值  上锁人 共锁人都要遵循 属于当前工艺 当前作业负责人或者执行人的角色属性
+        getUserList(query1).then((res) => {
+          // 上锁人下拉数据
+          this.listLockerOption = res.rows.map((item) => ({
+              label: item.nickName,
+              value: item.userId
+            }))
+        })
+        const roleIdColocker=this.dict.type.ticket_user_type.find((item)=>item.label=='jtcolocker')//利用字典值来记录上锁人 共锁人 方便如果修改了值 直接系统更改
         const query = {
           pageSize: 10000,
           pageNum: 1,
-          workstationId:'8',
+          workstationId:this.workstationId,
+          roleId:roleIdColocker.value,
         }
+        // 共锁人赋值
         getUserList(query).then((res) => {
+          // 内部共锁人
           this.insideTableData = res.rows.filter((item) => item.unitId == 9)
+          // 外部共锁人
           this.outsideTableData = res.rows.filter((item) => item.unitId != '9')
 
           // 获取已分配人员数据
@@ -1282,6 +1267,7 @@ export default {
 
 
 <style scoped lang="scss">
+
 .deptXLG {
   position: absolute;
   width: 65px;

+ 51 - 11
src/views/mes/md/segregationpoint/index.vue

@@ -27,9 +27,9 @@
       <el-form-item label="岗位" prop="workstationId" >
       <treeselect style="width: 200px" v-model="queryParams.workstationId" :options="deptOptions" :normalizer="normalizer" placeholder="选择岗位"/>
       </el-form-item>
-<!--      <el-form-item label="设备/工艺" prop="machineryId" >-->
-<!--        <treeselect style="width: 200px" v-model="form.parentId" :options="deptOptions" :normalizer="normalizer" placeholder="选择岗位"/>-->
-<!--      </el-form-item>-->
+      <el-form-item label="设备/工艺" prop="machineryId" >
+        <treeselect style="width: 200px" v-model="queryParams.machineryId" :options="machineryOptions" :normalizer="Machinerynormalizer" placeholder="选择岗位"/>
+      </el-form-item>
       <!-- <el-form-item label="状态" prop="calendarType">
         <el-select v-model="queryParams.calendarType" placeholder="状态">
           <el-option>正常</el-option>
@@ -51,7 +51,7 @@
 <!--      </el-form-item>-->
       <el-form-item label="能量源" prop="powerType">
         <el-select
-          style="width: 300px"
+          style="width: 200px"
           v-model="queryParams.powerType"
           placeholder="请选择能量源"
         >
@@ -188,8 +188,8 @@
 <!--      </el-table-column>-->
       <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="machineryName" >
+      </el-table-column>
       <el-table-column label="LOTO站" align="center" prop="lotoName" >
       </el-table-column>
       <el-table-column label="作用" align="center" prop="remark">
@@ -381,11 +381,11 @@
         </el-row>
         <el-row>
           <el-col :span="11">
-            <el-form-item label="所属电柜" prop="lockTypeName">
+            <el-form-item label="锁定站" prop="lockTypeName">
               <el-select
                 style="width: 300px"
                 v-model="form.lotoId"
-                placeholder="请选择所属电柜"
+                placeholder="请选择锁定站"
               >
                 <el-option
                   v-for="dict in lotoOptions"
@@ -631,6 +631,8 @@ export default {
       },
       // 表单参数
       form: {},
+      //工艺树
+      machineryOptions: [],
       LockTypeOptions: [],//锁具机构类型下拉
       padLockTypeOptions: [],//挂锁类型下拉
 
@@ -707,9 +709,20 @@ export default {
       //     'children'
       //   )
       // })
+      // 岗位
       listMarsDept(data).then(response => {
         this.deptOptions = this.handleTree(response.data.records,"workstationId","parentId")
       })
+      // 设备/工艺
+      listTechnology(data).then((response) => {
+        const data=response.data.records.filter((item) =>item.machineryType=='工艺')
+        this.machineryOptions = this.handleTree(
+          data,
+          "machineryId",
+          "parentId"
+        );
+
+      });
       // 锁具机构类型
       listLockType(data).then((response) => {
         this.LockTypeOptions = this.handleTree(response.data.records, 'locksetTypeId')
@@ -741,7 +754,16 @@ export default {
         children: node.children
       }
     },
-
+    Machinerynormalizer(node) {
+      if (node.children && !node.children.length) {
+        delete node.children
+      }
+      return {
+        id: node.machineryId,
+        label: node.machineryName,
+        children: node.children
+      }
+    },
     normalizerLockset(node) {
       if (node.children && !node.children.length) {
         delete node.children
@@ -816,7 +838,16 @@ export default {
     /** 搜索按钮操作 */
     handleQuery() {
       this.queryParams.current = 1
-      this.getList()
+      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])
+      }
+      getIsIsolationPointPage(this.queryParams).then((response) => {
+        // console.log(response, "接口返回结果");
+        this.isolationList = response.data.records
+        this.total = response.data.total
+        this.loading = false
+      })
     },
     /** 重置按钮操作 */
     resetQuery() {
@@ -824,7 +855,16 @@ export default {
       (this.queryParams.startTime = ''),
         (this.queryParams.endTime = ''),
         this.resetForm('queryForm')
-      this.handleQuery()
+      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])
+      }
+      getIsIsolationPointPage(this.queryParams).then((response) => {
+        // console.log(response, "接口返回结果");
+        this.isolationList = response.data.records
+        this.total = response.data.total
+        this.loading = false
+      })
     },
     // 多选框选中数据
     handleSelectionChange(selection) {

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

@@ -204,6 +204,7 @@ export default {
       autoGenFlag: false,
       // 显示搜索条件
       showSearch: true,
+      isEditing:false,//添加一个标识符
       // 总条数
       total: 0,
       // 表格树数据
@@ -261,6 +262,10 @@ export default {
   },
   watch:{
     "form.workstationId":function(newVal,oldVal){
+
+      if(newVal!==oldVal&&this.form.machineryId&&!this.isEditing){
+        this.form.machineryId=null
+      }
       if(newVal){
         const data={
           pasge:1,
@@ -391,9 +396,13 @@ export default {
     /** 修改按钮操作 */
     handleUpdate(row) {
       this.reset()
+      this.isEditing = true
       selectIsMarsSopById(row.sopId).then(response => {
         this.form = response.data
         this.open = true
+        setTimeout(()=>{
+          this.isEditing = false
+        },1000)
         this.title = '修改SOP'
 
       })
@@ -406,6 +415,7 @@ export default {
             updateIsMarsSop(this.form).then(response => {
               this.$modal.msgSuccess('修改成功')
               this.open = false
+
               this.getList()
             })
           } else {

+ 10 - 2
src/views/system/technology/technologyList/index.vue

@@ -206,7 +206,7 @@
       </div>
     </div>
     <!-- 添加或修改部门对话框 -->
-    <el-dialog :title="title" :visible.sync="open" width="490px" append-to-body>
+    <el-dialog :title="title" :visible.sync="open" width="460px" append-to-body>
       <el-form ref="form" :model="form" :rules="rules" label-width="120px">
 <!--        <el-form-item label="上级" prop="parentId">-->
 <!--          <treeselect-->
@@ -245,7 +245,7 @@
 <!--          </el-col>-->
 <!--        </el-row>-->
 <!--        mars岗位-->
-        <el-form-item label="岗位" prop="workstationId">
+        <el-form-item label="岗位" prop="workstationId" >
           <treeselect
             v-model="form.workstationId"
             :options="marsOptions"
@@ -320,6 +320,7 @@ export default {
       loading: true,
       //自动生成编码
       autoGenFlag: false,
+      isEditing: false, // 增加一个标识变量
       tabPosition: 'craft',
       total1:0,//工艺分页
       total2:0,//设备分页
@@ -381,6 +382,9 @@ export default {
   },
   watch: {
     'form.workstationId': function(newVal, oldVal) {
+      if(newVal!==oldVal&&this.form.lotoId&&!this.isEditing) {
+        this.form.lotoId = ''
+      }
       if (newVal) {
         const data = {
           pasge: 1,
@@ -748,6 +752,7 @@ export default {
     /** 修改按钮操作 */
     handleUpdate(row) {
       this.reset()
+      this.isEditing = true
       getTechnologyInfo(row.machineryId).then((response) => {
         this.form = response.data
         this.open = true
@@ -758,6 +763,9 @@ export default {
           this.form.machineryType='设备'
           this.title = '修改设备'
         }
+        setTimeout(()=>{
+          this.isEditing = false
+        },1000)
       })
     },
     handleLook(row) {