ysy 1 年之前
父節點
當前提交
52a2f95eec

+ 12 - 1
src/api/produce/job.js

@@ -11,4 +11,15 @@ export async function listByIdsReport(data) {
     return Promise.reject(new Error(res.data.message));
   }
   
- 
+ 
+
+
+  // 根据工单id获取工序列表
+  export async function getTaskInstanceList(id) {
+    const res = await request.get(`/pda/mes/workorder/getTaskInstanceById/${id}`);
+    if (res.data.code == 0) {
+      return res.data.data;
+    }
+    return Promise.reject(new Error(res.data.message));
+  }
+  

+ 240 - 4
src/views/produce/components/jobBooking/components/semiProductJobBom.vue

@@ -6,7 +6,201 @@
       <div class="rx-bc"> </div>
     </div>
 
+    <el-table
+      ref="oneJobQualityBom"
+      class="table_content"
+      :max-height="600"
+      :data="list"
+      tooltip-effect="dark"
+      style="width: 100%"
+      stripe
+      border
+    >
+      <el-table-column label="序号" type="index" width="55">
+        <template slot-scope="{ row, $index }">
+          {{ $index + 1 }}
+        </template>
+      </el-table-column>
 
+      <el-table-column label="次数" type="index" width="80">
+        <template slot-scope="{ row, $index }">
+          <div
+            class="tag_box"
+            v-if="
+              Object.prototype.hasOwnProperty.call(row, 'extInfo') &&
+              Object.prototype.hasOwnProperty.call(
+                row.extInfo,
+                'productionTimes'
+              ) &&
+              Object.prototype.hasOwnProperty.call(
+                row.extInfo.productionTimes,
+                item.currentTaskDiagram.taskId
+              )
+            "
+          >
+            {{ row.extInfo.productionTimes[item.currentTaskDiagram.taskId] }}
+          </div>
+
+          <div class="tag_box" v-if="row.isCache">缓</div>
+        </template>
+      </el-table-column>
+
+      <el-table-column label="编码" type="code" minWidth="110">
+        <template slot-scope="{ row, $index }">
+          {{ row.code }}
+        </template>
+      </el-table-column>
+
+      <el-table-column label="名称" type="name" minWidth="110">
+        <template slot-scope="{ row, $index }">
+          {{ row.name }}
+
+          ({{
+            row.rootCategoryLevelId == 2
+              ? '在制品'
+              : row.rootCategoryLevelId == 23
+              ? '半成品'
+              : row.rootCategoryLevelId == 9
+              ? '产品'
+              : row.rootCategoryLevelId == 28
+              ? '废品'
+              : ''
+          }})
+        </template>
+      </el-table-column>
+
+      <el-table-column label="型号" type="modelType">
+        <template slot-scope="{ row, $index }">
+          {{ row.modelType }}
+        </template>
+      </el-table-column>
+
+      <el-table-column label="规格" type="specification">
+        <template slot-scope="{ row, $index }">
+          {{ row.specification }}
+        </template>
+      </el-table-column>
+
+      <el-table-column label="牌号" type="brandNum">
+        <template slot-scope="{ row, $index }">
+          {{ row.brandNum }}
+        </template>
+      </el-table-column>
+
+      <el-table-column label="包装库存" type="brandNum">
+        <template slot-scope="{ row, $index }">
+          {{ row.packingCountBase }}/ {{ row.minUnit }}
+        </template>
+      </el-table-column>
+
+      <el-table-column
+        v-if="singleReport == 1"
+        :label="
+          item.currentTaskDiagram.isFirstTask == 1 ? '物料重量' : '上道重量'
+        "
+        type="weightUnit"
+      >
+        <template slot-scope="{ row, $index }">
+          <div v-if="item.currentTaskDiagram.isFirstTask == 1">
+            {{ row.extInfo.weight || 0 }} {{ row.extInfo.weightUnit }}</div
+          >
+          <div v-if="item.currentTaskDiagram.isFirstTask == 0">
+            {{ row.extInfo.newWeight || 0 }}
+            {{ row.extInfo.weightUnit }}</div
+          >
+        </template>
+      </el-table-column>
+
+      <el-table-column v-if="singleReport == 1" label="刻码" type="engrave">
+        <template slot-scope="{ row, $index }">
+          {{ row.extInfo.engrave }}
+        </template>
+      </el-table-column>
+
+      <el-table-column
+        v-if="singleReport == 1"
+        label="物料代号"
+        type="materielCode"
+      >
+        <template slot-scope="{ row, $index }">
+          {{ row.extInfo.materielCode }}
+        </template>
+      </el-table-column>
+
+      <el-table-column
+        v-if="singleReport == 1 && deviceList.length > 0"
+        width="140"
+        label="设备"
+        type="deviceId"
+      >
+        <template slot-scope="{ row, $index }">
+          <el-select
+            class="content_num"
+            v-model="row.deviceId"
+            placeholder="请选择"
+            @change="(e) => selectVal(e, row, $index)"
+            size="mini"
+          >
+            <el-option
+              v-for="item in deviceList"
+              :label="item.name + '-' + item.codeNumber"
+              :value="item.id"
+              :key="item.id"
+            >
+            </el-option>
+          </el-select>
+        </template>
+      </el-table-column>
+
+      <el-table-column
+        v-if="singleReport == 1 && deviceList.length > 0"
+        label="炉次号"
+        width="90"
+        type="heatNumber"
+      >
+        <template slot-scope="{ row, $index }">
+          <el-input
+            size="mini"
+            class="content_num"
+            v-model="row.extInfo.heatNumber"
+            placeholder="请输入炉次号"
+          />
+        </template>
+      </el-table-column>
+
+      <el-table-column
+        v-if="singleReport == 1"
+        label="数量"
+        width="90"
+        type="feedQuantity"
+      >
+        <template slot-scope="{ row, $index }">
+          <el-input
+            size="mini"
+            class="content_num"
+            v-model="row.feedQuantity"
+            placeholder="数量"
+          />
+        </template>
+      </el-table-column>
+
+      <el-table-column
+        v-if="singleReport == 1"
+        label="位置"
+        width="110"
+        type="feedQuantity"
+      >
+        <template slot-scope="{ row, $index }">
+          {{ row.extInfo.position }}
+        </template>
+      </el-table-column>
+
+      <el-table-column label="操作" fixed="right" width="60px">
+        <template slot-scope="{ $index, row }">
+          <el-link type="danger" @click="getDelete($index)">删除</el-link>
+        </template>
+      </el-table-column>
+    </el-table>
   </div>
 </template>
 
@@ -24,24 +218,66 @@
         default: () => []
       },
 
-      currentTaskDiagram: {
+      item: {
         type: Object,
         default: () => {}
       },
       isDetails: {
         type: Boolean,
         default: false
+      },
+      singleReport: {
+        default: null
+      }
+    },
+
+    watch: {
+      equipmentList: {
+        immediate: true,
+        deep: true,
+        handler(newVal) {
+          this.deviceList = newVal;
+          this.changeHeatNumber();
+        }
       }
     },
 
     data() {
-      return {};
+      return {
+        deviceList: []
+      };
+    },
+
+    methods: {
+      changeHeatNumber() {
+        this.deviceList.forEach((f) => {
+          this.list.forEach((o) => {
+            if (
+              o.deviceId &&
+              f.instanceId == o.deviceId &&
+              this.deviceList.length > 1
+            ) {
+              o.extInfo.heatNumber = f.extInfo.heatNumber;
+              this.$forceUpdate();
+            } else if (this.deviceList.length == 1) {
+              o.extInfo.heatNumber = this.deviceList[0].extInfo.heatNumber;
+              this.$forceUpdate();
+            }
+          });
+        });
+      }
     }
   };
 </script>
 
 <style lang="scss" scoped>
-  .materialBor {
-    border: 1rpx solid #157a2c;
+  .tag_box {
+    display: inline-block;
+    padding: 1px 6px;
+    margin-right: 6px;
+    background: #e6a23c;
+    font-size: 11px;
+    color: #fff;
+    border-radius: 2px;
   }
 </style>

+ 4 - 0
src/views/produce/components/picking/detailed.vue

@@ -57,10 +57,14 @@
         </ele-pro-table>
       </div>
     </el-dialog>
+
+
   </div>
 </template>
 <script>
+
   export default {
+    components: { },
     props: {
       detailedObj: {}
     },

+ 43 - 24
src/views/produce/components/produceOrder.vue

@@ -1,36 +1,44 @@
 <template>
-  <ele-pro-table
-    ref="table"
-    :columns="columns"
-    width="100%"
-    height="300px"
-    :datasource="datasource"
-    :selection.sync="selection"
-    @selection-change="handleSelectionChange"
-    cache-key="produceOrderZ"
-    highlight-current-row
-    @row-click="rowClick"
-    :need-page="false"
-  >
-    <template v-slot:toolbar>
-      <div class="c_title">工单列表 </div>
-    </template>
-
-    <template v-slot:code="{ row }">
-      <el-link type="primary" :underline="false">{{ row.code }}</el-link>
-    </template>
-  </ele-pro-table>
+  <div>
+    <ele-pro-table
+      ref="table"
+      :columns="columns"
+      width="100%"
+      height="300px"
+      :datasource="datasource"
+      :selection.sync="selection"
+      @selection-change="handleSelectionChange"
+      cache-key="produceOrderZ"
+      highlight-current-row
+      @row-click="rowClick"
+      :need-page="false"
+    >
+      <template v-slot:toolbar>
+        <div class="c_title">工单列表 </div>
+      </template>
+
+      <template v-slot:code="{ row }">
+        <el-link type="primary" @click="handRoute(row)" :underline="false" >{{ row.code }}</el-link>
+      </template>
+    </ele-pro-table>
+
+    <routings v-if="routingShow" :routeObj="routeObj" @closeRoute="closeRoute"></routings>
+  </div>
 </template>
 
 <script>
   import { workorderPage } from '@/api/produce/workOrder.js';
+  import routings from './routings.vue';
 
   export default {
-    components: {},
+    components: { routings },
     data() {
       return {
         loading: false,
-        selection: []
+        selection: [],
+
+        routeObj: {},
+        routingShow: false
       };
     },
     computed: {
@@ -141,7 +149,18 @@
         this.$emit('workSelect', ids);
       },
 
-      rowClick() {}
+      rowClick() {},
+
+      handRoute(row) {
+         this.routeObj = row;
+         this.routingShow = true;
+      },
+
+      closeRoute() {
+        this.routingShow = false;
+      }
+
+
     }
   };
 </script>

+ 62 - 0
src/views/produce/components/routings.vue

@@ -0,0 +1,62 @@
+<template>
+    <div>
+        <el-dialog title="工艺路线" :visible.sync="visible" :before-close="handleClose" :close-on-click-modal="false"
+            :close-on-press-escape="false" append-to-body width="70%">
+
+            <el-tag type="warning" style="margin-bottom:  40px;">{{ routeObj.produceRoutingName }}</el-tag>
+          
+            <div>
+                <el-steps :active="activeIndex" space="20px" align-center>
+                    <el-step v-for="(item, index) in routeList" :key="index" :title="item.taskTypeName"></el-step>
+                </el-steps>
+            </div>
+        </el-dialog>
+    </div>
+</template>
+<script>
+import { getTaskInstanceList } from '@/api/produce/job';
+export default {
+    props: {
+        routeObj: {
+            type: Object,
+            default() {
+                return {};
+            }
+        }
+    },
+    data() {
+        return {
+            visible: true,
+            routeList: [],
+            activeIndex: 0
+        };
+    },
+
+    methods: {
+        getTaskFn() {
+
+            getTaskInstanceList(this.routeObj.id).then((res) => {
+                this.routeList = res;
+
+
+                            // 使用findIndex方法查找
+            const index = this.routeList.findIndex(item => Number(item.taskId) == Number(this.routeObj.taskId));
+            this.activeIndex = index
+            });
+
+
+
+        },
+
+        handleClose() {
+            this.$emit('closeRoute');
+        }
+    },
+
+    created() {
+        this.getTaskFn();
+    }
+};
+</script>
+
+<style lang="scss" scoped></style>