ysy 1 год назад
Родитель
Сommit
bb30b99029

+ 186 - 165
src/views/produce/components/feeding/components/semiProductBom.vue

@@ -1,13 +1,12 @@
 <template>
-    <div>
-      <div class="title_box rx-bc mt6">
-        <div class="name">物料清单({{list.length || 0}})个 </div>
-  
-        <div class="rx-bc"> </div>
-      </div>
+  <div>
+    <div class="title_box rx-bc mt6">
+      <div class="name">物料清单({{ list.length || 0 }})个 </div>
 
+      <div class="rx-bc"> </div>
+    </div>
 
-      <el-table
+    <el-table
       :ref="`semiProductBom`"
       class="table_content"
       :max-height="600"
@@ -17,234 +16,256 @@
       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="code" minWidth="110" >
+      <el-table-column label="编码" type="code" minWidth="110">
         <template slot-scope="{ row, $index }">
-          {{ row.code}}
+          {{ row.code }}
         </template>
       </el-table-column>
 
-      <el-table-column label="名称" type="name"  minWidth="110">
+      <el-table-column label="名称" type="name" minWidth="110">
         <template slot-scope="{ row, $index }">
-          {{ row.name}}  ({{row.rootCategoryLevelId == 2 ? '在制品' :  row.rootCategoryLevelId == 23 ? '半成品' :  row.rootCategoryLevelId == 9 ? '产品' :   item.rootCategoryLevelId == 28 ? '废品' : ''  }})
+          {{ row.name }} ({{
+            row.rootCategoryLevelId == 2
+              ? '在制品'
+              : row.rootCategoryLevelId == 23
+              ? '半成品'
+              : row.rootCategoryLevelId == 9
+              ? '产品'
+              : item.rootCategoryLevelId == 28
+              ? '废品'
+              : ''
+          }})
         </template>
       </el-table-column>
 
-      <el-table-column label="型号" type="modelType" >
+      <el-table-column label="型号" type="modelType">
         <template slot-scope="{ row, $index }">
-          {{ row.modelType}}
+          {{ row.modelType }}
         </template>
       </el-table-column>
 
-      
-      <el-table-column label="规格" type="specification" >
+      <el-table-column label="规格" type="specification">
         <template slot-scope="{ row, $index }">
-          {{ row.specification}}
+          {{ row.specification }}
         </template>
       </el-table-column>
 
-            
-      <el-table-column label="牌号" type="brandNum" >
+      <el-table-column label="牌号" type="brandNum">
         <template slot-scope="{ row, $index }">
-          {{ row.brandNum}}
+          {{ row.brandNum }}
         </template>
       </el-table-column>
 
-
-      <el-table-column label="包装库存" type="brandNum" >
+      <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="currentTaskDiagram.isFirstTask == 1 ? '物料重量' : '上道重量'" type="weightUnit" >
+      <el-table-column
+        v-if="singleReport == 1"
+        :label="currentTaskDiagram.isFirstTask == 1 ? '物料重量' : '上道重量'"
+        type="weightUnit"
+      >
         <template slot-scope="{ row, $index }">
           <div v-if="currentTaskDiagram.isFirstTask == 1">
-              {{ row.extInfo.weight || 0 }} {{ row.extInfo.weightUnit }}</div
-            >
-            <div  v-if="currentTaskDiagram.isFirstTask == 0">
-              {{ row.extInfo.newWeight || 0 }}
-              {{ row.extInfo.weightUnit }}</div
-            >
+            {{ row.extInfo.weight || 0 }} {{ row.extInfo.weightUnit }}</div
+          >
+          <div v-if="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" >
+      <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" >
+      <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" >
+      <el-table-column
+        v-if="singleReport == 1 && deviceList.length > 0"
+        width="140"
+        label="设备"
+        type="deviceId"
+      >
         <template slot-scope="{ row, $index }">
           <el-select
-                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>
+            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" >
+      <el-table-column
+        v-if="singleReport == 1 && deviceList.length > 0"
+        label="炉次号"
+        width="90"
+        type="heatNumber"
+      >
         <template slot-scope="{ row, $index }">
           <el-input
-                size="mini"
-                v-model="row.extInfo.heatNumber"
-                placeholder="请输入炉次号"
-              />
+            size="mini"
+            v-model="row.extInfo.heatNumber"
+            placeholder="请输入炉次号"
+          />
         </template>
       </el-table-column>
 
-      <el-table-column  v-if="singleReport == 1" label="数量" width="90" type="feedQuantity" >
+      <el-table-column
+        v-if="singleReport == 1"
+        label="数量"
+        width="90"
+        type="feedQuantity"
+      >
         <template slot-scope="{ row, $index }">
-          <el-input
-                size="mini"
-                v-model="row.feedQuantity"
-                placeholder="数量"
-              />
+          <el-input size="mini" v-model="row.feedQuantity" placeholder="数量" />
         </template>
       </el-table-column>
 
-      
-      <el-table-column  v-if="singleReport == 1" label="位置" width="110" type="feedQuantity" >
+      <el-table-column
+        v-if="singleReport == 1"
+        label="位置"
+        width="110"
+        type="feedQuantity"
+      >
         <template slot-scope="{ row, $index }">
-         {{row.extInfo.position}}
+          {{ 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-column
+        label="操作"
+        fixed="right"
+        width="60px"
+        v-if="!isDetails"
+      >
+        <template slot-scope="{ $index, row }">
+          <el-link type="danger" @click="getDelete($index)">删除</el-link>
+        </template>
+      </el-table-column>
     </el-table>
-  
-  
-    </div>
-  </template>
-  <script>
-    export default {
-      props: {
-        list: {
-          type: Array,
-          default: () => []
-        },
-        equipmentList: {
-          type: Array,
-          default: () => []
-        },
-  
-        currentTaskDiagram: {
-          type: Object,
-          default: () => {}
-        },
-        isDetails: {
-          type: Boolean,
-          default: false
-        },
-
-        singleReport: {
+  </div>
+</template>
+<script>
+  export default {
+    props: {
+      list: {
+        type: Array,
+        default: () => []
+      },
+      equipmentList: {
+        type: Array,
+        default: () => []
+      },
+
+      currentTaskDiagram: {
+        type: Object,
+        default: () => {}
+      },
+      isDetails: {
+        type: Boolean,
+        default: false
+      },
+
+      singleReport: {
         default: null
       }
-      },
-  
-      watch: {
-        equipmentList: {
-          immediate: true,
-          deep: true,
-          handler(newVal) {
-            this.deviceList = newVal;
-            this.changeHeatNumber();
-          }
+    },
+
+    watch: {
+      equipmentList: {
+        immediate: true,
+        deep: true,
+        handler(newVal) {
+          this.deviceList = newVal;
+          this.changeHeatNumber();
         }
+      }
+    },
+
+    data() {
+      return {
+        deviceList: []
+      };
+    },
+
+    methods: {
+      getDelete(index) {
+        this.list.splice(index, 1);
       },
-  
-      data() {
-        return {
-          deviceList: []
-        };
+
+      selectVal(e, item, idx) {
+        let obj = this.deviceList.find((f) => f.id == e);
+
+        this.$set(
+          this.list[idx],
+          'deviceName',
+          obj.name + '-' + obj.codeNumber
+        );
+        this.$set(
+          this.list[idx]['extInfo'],
+          'heatNumber',
+          obj.extInfo.heatNumber
+        );
       },
-  
-      methods: {
-        getDelete(index) {
-          this.list.splice(index, 1);
-        },
-  
-        selectVal(e, item, idx) {
-          let obj = this.deviceList.find((f) => f.id == e);
-  
-          this.$set(
-            this.list[idx],
-            'deviceName',
-            obj.name + '-' + obj.codeNumber
-          );
-          this.$set(
-            this.list[idx]['extInfo'],
-            'heatNumber',
-            obj.extInfo.heatNumber
-          );
-        },
-  
-        changeHeatNumber() {
-          console.log(this.deviceList);
-  
-          this.deviceList.forEach((f) => {
-            this.list.forEach((o) => {
-              if (
-                o.deviceId &&
-                f.id == o.deviceId &&
-                this.deviceList.length > 1
-              ) {
-                o.extInfo.heatNumber = f.extInfo.heatNumber;
-                o['workstationName'] = f.workstationName;
-              } else if (this.deviceList.length == 1) {
-                o['deviceName'] = this.deviceList[0].name;
-                o['deviceId'] = this.deviceList[0].id;
-                o['workstationName'] = this.deviceList[0].workstationName;
-                o.extInfo.heatNumber = this.deviceList[0].extInfo.heatNumber;
-  
-                this.$forceUpdate();
-              }
-            });
+
+      changeHeatNumber() {
+        console.log(this.deviceList);
+
+        this.deviceList.forEach((f) => {
+          this.list.forEach((o) => {
+            if (
+              o.deviceId &&
+              f.id == o.deviceId &&
+              this.deviceList.length > 1
+            ) {
+              o.extInfo.heatNumber = f.extInfo.heatNumber;
+              o['workstationName'] = f.workstationName;
+            } else if (this.deviceList.length == 1) {
+              o['deviceName'] = this.deviceList[0].name;
+              o['deviceId'] = this.deviceList[0].id;
+              o['workstationName'] = this.deviceList[0].workstationName;
+              o.extInfo.heatNumber = this.deviceList[0].extInfo.heatNumber;
+
+              this.$forceUpdate();
+            }
           });
-        }
+        });
       }
-    };
-  </script>
-  
-  <style lang="scss" scoped>
-    .mb4 {
-      margin-bottom: 4px;
     }
-  </style>
-  
+  };
+</script>
+
+<style lang="scss" scoped>
+  .mb4 {
+    margin-bottom: 4px;
+  }
+</style>

+ 33 - 0
src/views/produce/components/jobBooking/details.vue

@@ -0,0 +1,33 @@
+<template>
+  <div> 444 </div>
+</template>
+
+<script>
+  export default {
+    props: {
+      routeObj: {
+        type: Object,
+        default() {
+          return {};
+        }
+      },
+
+      curTaskId: {
+        type: String,
+        default() {
+          return '';
+        }
+      }
+    },
+
+    watch: {
+      curTaskId: {
+        handler(val) {
+          this.getList(val);
+        },
+        deep: true,
+        immediate: true
+      }
+    }
+  };
+</script>

+ 96 - 79
src/views/produce/components/routings.vue

@@ -1,112 +1,129 @@
 <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-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>
+        工艺路线: <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"
-            @click.native="handIdx(index, item.taskId)" :description="desIndex == index ? '此处' : ''"></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>
+            <feedDetails
+              :routeObj="routeObj"
+              :curTaskId="curTaskId"
+            ></feedDetails>
+          </el-tab-pane>
+          <el-tab-pane label="报工详情">
+            <jobDetails
+              :routeObj="routeObj"
+              :curTaskId="curTaskId"
+            ></jobDetails>
           </el-tab-pane>
-          <el-tab-pane label="报工详情"></el-tab-pane>
         </el-tabs>
-
-
       </div>
     </el-dialog>
   </div>
 </template>
 <script>
-import { getTaskInstanceList } from '@/api/produce/job';
-import feedDetails from '../components/feeding/details.vue'
-export default {
-  components: {
-    feedDetails
-  },
-  props: {
-    routeObj: {
-      type: Object,
-      default() {
-        return {};
+  import { getTaskInstanceList } from '@/api/produce/job';
+  import feedDetails from '../components/feeding/details.vue';
+  import jobDetails from '../components//jobBooking/details.vue';
+  export default {
+    components: {
+      feedDetails,
+      jobDetails
+    },
+    props: {
+      routeObj: {
+        type: Object,
+        default() {
+          return {};
+        }
       }
-    }
-  },
-  data() {
-    return {
-      visible: true,
-      routeList: [],
-      activeIndex: 0,
-      desIndex: 0,
-      curTaskId: null
-    };
-  },
+    },
+    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)
-        );
+          // 使用findIndex方法查找
+          const index = this.routeList.findIndex(
+            (item) => Number(item.taskId) == Number(this.routeObj.taskId)
+          );
 
-    
-        this.desIndex = index;
+          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;
+          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');
+      },
 
-    handleClose() {
-      this.activeIndex = 0;
-      this.$emit('closeRoute');
+      handIdx(index, taskId) {
+        this.curTaskId = taskId;
+        if (taskId == -2) {
+          this.$message.info('完结状态不能点击');
+        } else {
+          this.desIndex = index;
+        }
+      }
     },
 
-    handIdx(index,taskId) {
-      this.curTaskId = taskId;
-      if(taskId == -2) {
-      this.$message.info('完结状态不能点击')
-      } else {
-        this.desIndex = index;
-      }
-   
+    created() {
+      this.getTaskFn();
     }
-  },
-
-  created() {
-    this.getTaskFn();
-  }
-};
+  };
 </script>
 
 <style lang="scss" scoped>
-::v-deep .el-step__icon {
-  cursor: pointer;
-}
+  ::v-deep .el-step__icon {
+    cursor: pointer;
+  }
 
-.routing_box {
-  margin-bottom: 20px;
-  margin-left: 20px;
-  text-align: center;
+  .routing_box {
+    margin-bottom: 20px;
+    margin-left: 20px;
+    text-align: center;
 
-  span {
-    color: #157a2c;
-    font-weight: bold;
+    span {
+      color: #157a2c;
+      font-weight: bold;
+    }
   }
-}
 </style>

+ 1 - 1
src/views/produceOrder/components/unpackDialog.vue

@@ -285,7 +285,7 @@ export default {
     },
 
     setSurplus() {
-      this.form.surplusUnpack.push({ originalCode: this.formData.code, formingNum: this.formData.formingNum, planStartTime: '', classeId: '' })
+      this.form.surplusUnpack.push({ originalCode: this.formData.code, formingNum: this.formData.formingNum, planStartTime: '', classeId: '', isCopy:1  })
     },
 
     openUnpack() {

+ 1 - 1
src/views/produceOrder/index.vue

@@ -120,7 +120,7 @@
               报工
             </el-link>
             <el-link
-              v-if="row.status == 4 && !row.originalCode"
+              v-if="row.status == 4 && row.originalCode"
               type="primary"
               :underline="false"
               icon="el-icon-truck"