ysy 1 rok temu
rodzic
commit
8feb33bbce

+ 8 - 1
src/api/produce/feeding.js

@@ -40,7 +40,14 @@ export async function batchSave(data) {
     return Promise.reject(new Error(res.data.message));
   }
   
-  
+  // pda根据工单ids查询投料单
+  export async function feedByOrderIds(data) {
+    const res = await request.post(`/pda/mes/feed/listByOrderIds`, data);
+    if (res.data.code == 0) {
+        return res.data.data;
+      }
+    return Promise.reject(new Error(res.data.message));
+  }
  
 
  

+ 166 - 0
src/views/produce/components/feeding/details.vue

@@ -0,0 +1,166 @@
+<template>
+  <div>
+    <div class="feed_box">
+      <div v-for="(item, index) in dataList" :key="index" class="card_box">
+        <div class="rx-bc">
+          <div class="item_box rx-bc">
+            <div class="round">{{ index + 1 }}</div>
+            <div class="time">投料时间:{{ item.createTime }} </div>
+          </div>
+
+          <div class="item_box rx-bc">
+            <div class="time">工序名称: {{ item.taskName }}</div>
+          </div>
+        </div>
+
+        <div v-for="(it, idx) in item.orderInfoList" :key="idx">
+          <workOrderBom :item="it" :isDetails="true"></workOrderBom>
+
+          
+						<deviceBom v-if='it.equipmentList.length != 0' :list='it.equipmentList'></deviceBom>
+						
+						
+						<productsBom  v-if="Object.prototype.hasOwnProperty.call(it, 'inProductList') && it.inProductList[0]" :productsObj="it.inProductList[0]"></productsBom>
+
+						<modelBom v-if='it.modelList.length != 0' :list='it.modelList'>
+						</modelBom>
+
+						<instanceBom v-if='it.instanceList.length != 0'  :isDetails='true' :list='it.instanceList' :currentTaskDiagram='currentTaskDiagram' :equipmentList='it.equipmentList'></instanceBom>
+						
+						<semiProductBom v-if='it.semiProductList.length != 0'  :isDetails='true' :list='it.semiProductList' :currentTaskDiagram='currentTaskDiagram' :equipmentList="it.equipmentList"></semiProductBom>
+						
+
+                        <turnoverBom v-if='it.turnover.length != 0' :list='it.turnover':isDetails='true' :wordItem='it' pattern='feed'></turnoverBom>
+
+						<packingBom v-if='it.packingList.length != 0' :list='it.packingList'></packingBom>
+						
+						<palletBom v-if="Object.prototype.hasOwnProperty.call(it, 'palletList') && it.palletList.length != 0" :palletList='it.palletList'></palletBom>
+						
+						<revolvingDiskBom v-if="Object.prototype.hasOwnProperty.call(it, 'revolvingDiskList') && it.revolvingDiskList.length != 0"  :revolvingDiskList="it.revolvingDiskList"></revolvingDiskBom>
+        </div>
+      </div>
+    </div>
+  </div>
+</template>
+
+<script>
+  import { feedByOrderIds } from '@/api/produce/feeding';
+  import workOrderBom from './components/workOrderBom.vue';
+  import deviceBom from './components/deviceBom.vue';
+  import modelBom from './components/modelBom.vue';
+  import instanceBom from './components/instanceBom.vue';
+  import semiProductBom from './components/semiProductBom';
+  import packingBom from './components/packingBom.vue';
+  import palletBom from './components/palletBom';
+  import revolvingDiskBom from './components/revolvingDiskBom';
+  import productsBom from './components/productsBom.vue';
+  import turnoverBom from './components/turnoverBom.vue';
+  export default {
+    components: {
+      workOrderBom,
+      deviceBom,
+      modelBom,
+      instanceBom,
+      packingBom,
+      palletBom,
+      revolvingDiskBom,
+      semiProductBom,
+      productsBom,
+      turnoverBom
+    },
+
+    props: {
+      routeObj: {
+        type: Object,
+        default() {
+          return {};
+        }
+      },
+
+      curTaskId: {
+        type: String,
+        default() {
+          return '';
+        }
+      }
+    },
+
+    watch: {
+      curTaskId: {
+        handler(val) {
+          this.getList(val);
+        },
+        deep: true,
+        immediate: true
+      }
+    },
+
+    data() {
+      return {
+        ids: [],
+        taskId: null,
+        dataList: [],
+
+        currentTaskDiagram: {
+          isFirstTask: 0
+        },
+
+        isLoad: false
+      };
+    },
+
+    created() {
+      //   this.getList();
+      console.log(this.routeObj);
+    },
+
+    methods: {
+      async getList(taskId) {
+        if (!taskId) {
+          return false;
+        }
+        let param = {
+          ids: [this.routeObj.id],
+          taskId: taskId
+        };
+        const res = await feedByOrderIds(param);
+        console.log(res);
+        this.dataList = JSON.parse(JSON.stringify(res));
+      }
+    }
+  };
+</script>
+
+<style scoped lang="scss">
+  .rx-bc {
+    display: flex;
+    align-items: center;
+    justify-content: space-between;
+  }
+
+  .item_box {
+    margin-top: 5px;
+    margin-bottom: 6px;
+    padding: 0 10px;
+
+    .round {
+      width: 20px;
+      height: 20px;
+      line-height: 20px;
+      border-radius: 50%;
+      background: #157a2c;
+      color: #fff;
+      text-align: center;
+      font-size: 12px;
+    }
+
+    .time {
+      color: #157a2c;
+      font-family: PingFang HK;
+      font-size: 14px;
+      font-style: normal;
+      font-weight: 500;
+      margin-left: 8px;
+    }
+  }
+</style>

+ 93 - 53
src/views/produce/components/routings.vue

@@ -1,72 +1,112 @@
 <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>
-
+    <el-dialog title="工艺路线" :visible.sync="visible" :before-close="handleClose" :close-on-click-modal="false"
+      :close-on-press-escape="false" append-to-body width="70%">
+      <div class="routing_box">
+        工艺路线: <span>{{ routeObj.produceRoutingName }}</span></div>
       <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-step v-for="(item, index) in routeList" :key="index" :title="item.taskTypeName"
+            @click.native="handIdx(index, item.taskId)" :description="desIndex == index ? '此处' : ''"></el-step>
         </el-steps>
+
+
+        <el-tabs type="border-card">
+          <el-tab-pane label="投料详情">
+             <feedDetails :routeObj="routeObj" :curTaskId="curTaskId"></feedDetails>
+          </el-tab-pane>
+          <el-tab-pane label="报工详情"></el-tab-pane>
+        </el-tabs>
+
+
       </div>
     </el-dialog>
   </div>
 </template>
 <script>
-  import { getTaskInstanceList } from '@/api/produce/job';
-  export default {
-    props: {
-      routeObj: {
-        type: Object,
-        default() {
-          return {};
-        }
+import { getTaskInstanceList } from '@/api/produce/job';
+import feedDetails from '../components/feeding/details.vue'
+export default {
+  components: {
+    feedDetails
+  },
+  props: {
+    routeObj: {
+      type: Object,
+      default() {
+        return {};
       }
-    },
-    data() {
-      return {
-        visible: true,
-        routeList: [],
-        activeIndex: 0
-      };
-    },
+    }
+  },
+  data() {
+    return {
+      visible: true,
+      routeList: [],
+      activeIndex: 0,
+      desIndex: 0,
+      curTaskId: null
+    };
+  },
 
-    methods: {
-      getTaskFn() {
-        getTaskInstanceList(this.routeObj.id).then((res) => {
-          this.routeList = res;
+  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;
-        });
-      },
+        // 使用findIndex方法查找
+        const index = this.routeList.findIndex(
+          (item) => Number(item.taskId) == Number(this.routeObj.taskId)
+        );
 
-      handleClose() {
-        this.activeIndex = 0;
-        this.$emit('closeRoute');
-      }
+    
+        this.desIndex = index;
+
+        if( this.routeObj.taskId != -2) {
+          this.curTaskId  = this.routeObj.taskId
+        } else {
+          this.curTaskId  = this.routeList[0].taskId
+          this.desIndex = 0;
+        }
+        this.activeIndex = index;
+
+      });
+    },
+
+    handleClose() {
+      this.activeIndex = 0;
+      this.$emit('closeRoute');
     },
 
-    created() {
-      this.getTaskFn();
+    handIdx(index,taskId) {
+      this.curTaskId = taskId;
+      if(taskId == -2) {
+      this.$message.info('完结状态不能点击')
+      } else {
+        this.desIndex = index;
+      }
+   
     }
-  };
+  },
+
+  created() {
+    this.getTaskFn();
+  }
+};
 </script>
 
-<style lang="scss" scoped></style>
+<style lang="scss" scoped>
+::v-deep .el-step__icon {
+  cursor: pointer;
+}
+
+.routing_box {
+  margin-bottom: 20px;
+  margin-left: 20px;
+  text-align: center;
+
+  span {
+    color: #157a2c;
+    font-weight: bold;
+  }
+}
+</style>