Преглед изворни кода

作业票数据修改和位置修改

pm пре 7 месеци
родитељ
комит
f8727a6539
1 измењених фајлова са 72 додато и 47 уклоњено
  1. 72 47
      src/views/mes/job/jobm/NewMarsJob.vue

+ 72 - 47
src/views/mes/job/jobm/NewMarsJob.vue

@@ -31,6 +31,7 @@
           alt=""
         />
         <div v-for="(item, index) in jobconfigPoint.records" :key="item.id">
+          <!-- 绿色盒子 -->
           <div
             class="deptGreen"
             :style="{left:item.x+'px',top:item.y+'px'}"
@@ -45,63 +46,81 @@
             :key="'btn-' + i"
             @click="handleTicketDialogVisible(item.entityId, item.entityName)"
             :style="{
-      width: '28px',
-      height: '28px',
-      background: 'rgb(4, 134, 241)',
-      textAlign: 'center',
-      lineHeight: '28px',
-      fontSize: '20px',
-      color: 'white',
-      borderRadius: '5px',
-      position: 'absolute',
-      top: (item.y - 70) + 'px',
-      left: (item.x - ((TicketListPage[item.entityId] ? 3 * 35 : 0) - 53) / 2 + i * 40) + 'px',
-      cursor: 'pointer'
-    }"
+    width: '28px',
+    height: '28px',
+    background: 'rgb(4, 134, 241)',
+    textAlign: 'center',
+    lineHeight: '28px',
+    fontSize: '20px',
+    color: 'white',
+    borderRadius: '5px',
+    position: 'absolute',
+    top: (item.y - 70) + 'px',
+    left: (item.x - ((TicketListPage[item.entityId] ? Math.min(TicketListPage[item.entityId].length, 3) * 35 : 0) - 60) / 2 + i * 40) + 'px', // 动态计算宽度
+    cursor: 'pointer'
+  }"
           >
             {{ i + 1 }}
           </div>
 
-
-          <!-- 显示作业票图标,最多 3 个图标 -->
-
           <img
             v-for="(ticket, index) in (TicketListPage[item.entityId] && TicketListPage[item.entityId].slice(0, 3)) || []"
-            :key="'ticket-' + index"
+            :key="ticket.ticketId"
             :style="{
-       width: '35px',
-       height: '35px',
-       position: 'absolute',
-       cursor: 'pointer',
-       top: (item.y - 40) + 'px',  // 让图标浮在岗位的上方
-       left: (item.x - ((TicketListPage[item.entityId] ? 3 * 35 : 0) - 53) / 2 + index * 40) + 'px'
-     }"
+    width: '35px',
+    height: '35px',
+    position: 'absolute',
+    cursor: 'pointer',
+    top: (item.y - 40) + 'px',
+    left: (item.x - ((TicketListPage[item.entityId] ? Math.min(TicketListPage[item.entityId].length, 3) * 35 : 0) - 53) / 2 + index * 40) + 'px' // 动态计算宽度
+  }"
             :src="index === 2 && (TicketListPage[item.entityId] && TicketListPage[item.entityId].length > 3) ? imageMap[5] : imageMap[ticket.ticketType]"
             alt=""
             @click="index === 2 && (TicketListPage[item.entityId] && TicketListPage[item.entityId].length > 3) ? handleTicketDialogVisible(item.entityId, item.entityName) : handleTicketClick(ticket)"
-
           />
+<!--          <div-->
+<!--            v-for="(ticket, i) in (TicketListPage[item.entityId] && TicketListPage[item.entityId].slice(0, 3)) || []"-->
+<!--            :key="'btn-' + i"-->
+<!--            @click="handleTicketDialogVisible(item.entityId, item.entityName)"-->
+<!--            :style="{-->
+<!--      width: '28px',-->
+<!--      height: '28px',-->
+<!--      background: 'rgb(4, 134, 241)',-->
+<!--      textAlign: 'center',-->
+<!--      lineHeight: '28px',-->
+<!--      fontSize: '20px',-->
+<!--      color: 'white',-->
+<!--      borderRadius: '5px',-->
+<!--      position: 'absolute',-->
+<!--      top: (item.y - 70) + 'px',-->
+<!--      left: (item.x - ((TicketListPage[item.entityId] ? 3 * 35 : 0) - 53) / 2 + i * 40) + 'px',-->
+<!--      cursor: 'pointer'-->
+<!--    }"-->
+<!--          >-->
+<!--            {{ i + 1 }}-->
+<!--          </div>-->
+<!--          &lt;!&ndash; 显示作业票图标,最多 3 个图标 &ndash;&gt;-->
+<!--          <img-->
+<!--            v-for="(ticket, index) in (TicketListPage[item.entityId] && TicketListPage[item.entityId].slice(0, 3)) || []"-->
+<!--            :key="ticket.ticketId"-->
+<!--            :style="{-->
+<!--              width: '35px',-->
+<!--              height: '35px',-->
+<!--              position: 'absolute',-->
+<!--              cursor: 'pointer',-->
+<!--              top: (item.y - 40) + 'px',  // 让图标浮在岗位的上方-->
+<!--              left: (-->
+<!--                item.x - -->
+<!--                ((TicketListPage[item.entityId] ? TicketListPage[item.entityId].length * 35 : 0) - 53) / 2 +  // 计算总宽度并居中,减去单个图标宽度,确保居中-->
+<!--                index * 40  // 处理图标间隔-->
+<!--              ) + 'px'-->
+<!--            }"-->
+<!--            :src="index === 2 && (TicketListPage[item.entityId] && TicketListPage[item.entityId].length > 3) ? imageMap[5] : imageMap[ticket.ticketType]"-->
+<!--            alt=""-->
+<!--            @click="index === 2 && (TicketListPage[item.entityId] && TicketListPage[item.entityId].length > 3) ? handleTicketDialogVisible(item.entityId, item.entityName) : handleTicketClick(ticket)"-->
+
+<!--          />-->
 
-          <!--          <img-->
-          <!--            v-for="(ticket, index) in TicketListPage[item.entityId] || []"-->
-          <!--            :key="ticket.ticketId"-->
-          <!--            :style="{-->
-          <!--    width: '35px',-->
-          <!--    height: '35px',-->
-          <!--    position: 'absolute',-->
-          <!--    cursor: 'pointer',-->
-          <!--    top: (item.y - 40) + 'px',  // 让图标浮在岗位的上方-->
-          <!--    left: (-->
-          <!--      item.x - -->
-          <!--      ((TicketListPage[item.entityId] ? TicketListPage[item.entityId].length * 35 : 0) - 53) / 2 +  // 计算总宽度并居中,减去单个图标宽度,确保居中-->
-          <!--      index * 40  // 处理图标间隔-->
-          <!--    ) + 'px'-->
-          <!--  }"-->
-          <!--            :src="imageMap[ticket.ticketType]"-->
-          <!--            alt=""-->
-          <!--            @click="handleTicketClick(ticket)"-->
-          <!--          />-->
-          <!--:src="require(`@/assets/images/${imageMap[ticket.ticketType]}.png`)"-->
 
         </div>
 
@@ -788,7 +807,12 @@
       class="elDialog"
     >
       <el-table :data="TicketListPage[currentWorkstationId] || []">
-        <el-table-column label="编号" prop="ticketName" width="100">
+        <el-table-column label="岗位" prop="workstationId" width="70">
+          <template slot-scope="scope">
+            {{ currentWorkstationName }}
+          </template>
+        </el-table-column>
+        <el-table-column label="编号" prop="ticketName" width="50">
           <template slot-scope="scope" style="width: 50px">
             {{ scope.$index + 1 }}
           </template>
@@ -928,7 +952,7 @@ export default {
     isStepFourExecuted() {
       const stepFour = this.EightStepForm.find((step) => step.stepIndex == '4')
       return stepFour && stepFour.stepStatus === '1'
-    },
+    }
 
   },
   watch: {
@@ -959,6 +983,7 @@ export default {
 
   },
   methods: {
+
     // 正在进行中作业票点击数字打开弹窗
     handleTicketDialogVisible(entityId, entityName) {
       this.ticketVisible = true