Explorar o código

Merge branch 'dev' into test

longfenglin hai 1 ano
pai
achega
4d003d774e

+ 1 - 1
src/api/produce/workOrder.js

@@ -25,7 +25,7 @@ export async function workorderPage(data) {
 
 // 工单列表 
 export async function workorderPage2(data) {
-  const res = await request.post('/mes/workorder/taskReportPage', data);
+  const res = await request.post('/mes/workorder/taskReportPage2', data);
   if (res.data.code == 0) {
     return res.data.data;
   }

+ 1 - 1
src/views/produce/components/footBtn.vue

@@ -61,7 +61,7 @@ export default {
           type: 'job',
           bjColor: '#157A2C'
         },
-
+        
         {
           name: '委外请托',
           type: 'Outsourcing',

+ 4 - 6
src/views/produce/components/outsourcing/index.vue

@@ -192,23 +192,21 @@ export default {
 
         changeTaskId(e) {
             console.log(e);
-
             const arr = this.newStepsList.find(item => item.taskId === e)
-            console.log(arr);
 
             if (this.newStepsList.length) {
-                const id = this.newStepsList[0].taskId;
+                const id = this.newStepsList[0].sourceTaskId;
                 //isFirstTask 1是首工序 0不是
-                if (arr.isFirstTask) {
+                if (this.attributeData.isFirstTask) {
 
                     this.attributeData.sceneText = "首工序";
                     this.attributeData.outsourceScene = 1;
-                    if (arr.taskId !== id) {
+                    if (arr.sourceTaskId !== id) {
                         this.attributeData.sceneText = "首工序及多工序";
                         this.attributeData.outsourceScene = 4;
                     }
                 } else {
-                    if (arr.taskId === id) {
+                    if (arr.sourceTaskId === id) {
                         // 单工序
                         this.attributeData.sceneText = "单工序"
                         this.attributeData.outsourceScene = 2;

+ 50 - 2
src/views/produce/components/picking/details.vue

@@ -15,6 +15,8 @@
       <div class="rx-sc" v-if="!isDetails">
         <div class="c_title">领料记录 </div>
         <el-button type="primary" size="mini" style="margin: 0 5px" @click="handleAdd">新增</el-button>
+        <!-- <el-button type="primary" size="mini" @click="openOutsourcingPicking()">委外领料</el-button> -->
+
       </div>
       </template>
 
@@ -42,20 +44,29 @@
       v-if="detailedShow"
       :detailedObj="detailedObj"
     ></detailed>
+
+    <outsourcingPickingList v-if="outsourcingPickingShow" ref="outsourcingPickingListRef" @closeOutsourcingPicking="closeOutsourcingPicking"></outsourcingPickingList>
+
   </div>
 </template>
 
 <script>
   import { pickDetails } from '@/api/produce/picking';
   import detailed from './detailed.vue';
+  import outsourcingPickingList from './outsourcingPickingList.vue';
+  import { getTaskInstanceById } from '@/api/produce/index';
+
 import { boolean } from 'mathjs';
   export default {
     name: 'picking-details',
-    components: { detailed },
+    components: { detailed,outsourcingPickingList },
     props:{
       isDetails:{
         type: Boolean,
         default: false
+      },
+      workTaskId:{
+
       }
     },
     data() {
@@ -65,6 +76,7 @@ import { boolean } from 'mathjs';
         detailedObj: null,
 
         statusList: ['未领料', '领料中', '已出库', '已驳回'],
+        outsourcingPickingShow:false
       };
     },
 
@@ -127,6 +139,12 @@ import { boolean } from 'mathjs';
             slot: 'action'
           }
         ];
+      },
+      taskObj() {
+        return this.$store.state.user.taskObj;
+      },
+      clientEnvironmentId() {
+        return this.$store.state.user.info.clientEnvironmentId;
       }
     },
 
@@ -156,7 +174,37 @@ import { boolean } from 'mathjs';
 
       detailedClose() {
         this.detailedShow = false;
-      }
+      },
+      openOutsourcingPicking(){
+        console.log('this.workListIds',this.workListIds)
+        if(this.workListIds.length == 1){
+          this.getTaskInstanceByIdFn()
+          // this.outsourcingPickingShow=true
+        }else{
+          this.$message.warning('只能选择一条工单进行委外领料');
+        }
+      },
+      closeOutsourcingPicking(){
+        this.outsourcingPickingShow=false
+      },
+      //获取工单列表
+      getTaskInstanceByIdFn() {
+        getTaskInstanceById(this.workListIds[0]).then((res) => {
+          // console.log(res,this.workTaskId, 'res2345678');
+          let { data } = res;
+          if (data.length) {
+            let arr = data.filter(item => item.taskId == this.workTaskId)
+            console.log(arr,this.workTaskId, 'res2345678');
+            if(arr[0].existOutsource){
+               this.outsourcingPickingShow=true
+            }else{
+              this.$message.warning('当前工序不能委外领料');
+            }
+          }
+
+        })
+
+      },
     },
     created() {}
   };

+ 133 - 0
src/views/produce/components/picking/outsourcingPickingList.vue

@@ -0,0 +1,133 @@
+<template>
+  <ele-modal title="委外领料" :visible.sync="visible" :before-close="handleClose" :close-on-click-modal="false"
+    :maxable="true"
+    :close-on-press-escape="false" append-to-body width="60%">
+    
+
+    <template slot="footer">
+      <el-button size="mini" @click="handleClose">取 消</el-button>
+      <el-button size="mini" type="primary" @click="save()">确 定</el-button>
+    </template>
+
+  </ele-modal>
+</template>
+
+<script>
+import pickingList from './pickingList.vue';
+import { workorderList, getCode,getInventoryTotal,znworkorderList } from '@/api/produce/workOrder';
+import { typeName } from '../common.js';
+import { batchSave,znfindVoucherList } from '@/api/produce/picking';
+
+export default {
+  components: {
+    pickingList
+  },
+  props: {
+    workListIds: {
+      type: Array,
+      default() {
+        return [];
+      }
+    }
+  },
+
+  data() {
+    return {
+      visible: true,
+     
+    };
+  },
+  computed: {
+    taskObj() {
+      return this.$store.state.user.taskObj;
+    },
+    clientEnvironmentId() {
+      return this.$store.state.user.info.clientEnvironmentId;
+    }
+  },
+
+  watch: {},
+  methods: {
+    
+
+   
+
+
+    handleClose() {
+      this.$emit('closeOutsourcingPicking', false);
+    },
+
+   
+
+    save() {
+      
+      
+
+      
+    }
+  },
+
+  created() {
+  }
+};
+</script>
+
+<style lang="scss" scoped>
+.table_content {
+  margin-bottom: 10px;
+}
+
+
+.tableZ_box {
+  border: 1px solid #e3e5e5;
+  margin: 6px 0;
+
+  &:last-child {
+    border-bottom: none;
+  }
+
+  .row {
+    width: 100%;
+    display: flex;
+  }
+
+  .col {
+    width: calc(100% / 5);
+    display: flex;
+    align-items: center;
+    min-width: 200px;
+    min-height: 32px;
+    border-bottom: 1px solid #e3e5e5;
+    border-right: 1px solid #e3e5e5;
+
+    &:last-child {
+      border-right: none;
+    }
+
+    .name {
+      display: flex;
+      align-items: center;
+      padding: 4px;
+      width: 80px;
+      height: 100%;
+      background-color: #d0e4d5;
+      color: #000;
+    }
+
+    .content {
+      padding: 4px 6px;
+      color: #000;
+    }
+  }
+
+  .pd6 {
+    padding: 0 6px;
+  }
+}
+</style>
+
+<style>
+:v-deep .el-form-item__error {
+  bottom: -6px !important;
+}
+</style>

+ 6 - 2
src/views/produce/index.vue

@@ -79,7 +79,7 @@
             <div class="right_main">
               <!-- 领料 -->
               <div v-if="operationType == 'pick'">
-                <pickDetails ref="pickListRef" @pickAdd="pickAdd"></pickDetails>
+                <pickDetails ref="pickListRef" :workTaskId="workTaskId" @pickAdd="pickAdd"></pickDetails>
               </div>
 
               <div v-if="operationType == 'feed'">
@@ -210,6 +210,7 @@ export default {
       feedNeedEquipment:0,//投料是否要添加生产设备1是0否
       reportNeedFeed:0,//生产质检是否需要处置再报工1是0否
       singleReportInspection:null,//获取选中的工单是单个还是批量
+      workTaskId:null,//选中的工单工序id
     };
   },
 
@@ -374,6 +375,8 @@ export default {
     },
 
     workSelect(data) {
+      console.log(11112222,data)
+      this.workTaskId=data.list.length>0?data.list[0].taskId:null;
       this.singleReportInspection=data.list.length>0?data.list[0].singleReport:null;//获取选中的工单是单个还是批量
       this.isStep = true;
       this.operationType = null;
@@ -471,12 +474,13 @@ export default {
         console.log(res, 'res');
         let { data } = res;
         if (data.length) {
-          data = data.filter(item => item.type == 1);
+          data = data.filter(item => item.type == 1 || item.type == 4);
           let arr = data.findIndex(item => item.sourceTaskId == this.taskObj.id)
           console.log(arr);
           if (arr != -1) {
             data.splice(0, arr + 1)
           }
+          console.log(data, '吃饭吃饭吃饭吃饭');
           this.$set(this.outsourceForm, 'newStepsList', data)
         }