ysy hace 1 año
padre
commit
e31dab30d1

+ 38 - 24
src/views/produce/components/feeding/components/deviceBom.vue

@@ -7,13 +7,15 @@
     </div>
 
     <div class="material">
-      <div class="content_table" v-for="(item,index) in list" :key='index'>
+      <div class="content_table" v-for="(item, index) in list" :key="index">
         <div class="item rx-sc">
-
           <div class="rx ww33">
             <div class="lable rx-cc">工位名称</div>
             <div class="content">
-              {{ item.workstationName || (item.extInfo && item.extInfo.workstationName) }}
+              {{
+                item.workstationName ||
+                (item.extInfo && item.extInfo.workstationName)
+              }}
             </div>
           </div>
 
@@ -29,22 +31,30 @@
         </div>
 
         <div class="item rx-sc">
-       
           <div class="rx ww33">
             <div class="lable rx-cc">固资编码</div>
             <div class="content rx-sc">
-              <div>{{item.extInfo.fixCode}}</div>
+              <div>{{ item.extInfo.fixCode }}</div>
             </div>
           </div>
 
           <div class="rx ww33">
             <div class="lable rx-cc">编号</div>
             <div class="content rx-sc">
-              <div>{{item.extInfo.codeNumber}}</div>
+              <div>{{ item.extInfo.codeNumber }}</div>
             </div>
           </div>
 
-          
+          <div class="rx ww33">
+            <div class="lable rx-cc">炉次号</div>
+            <div class="content content_num rx-sc">
+              <el-input size="mini" v-model="item.extInfo.heatNumber" placeholder="请输入炉次号" />
+            </div>
+          </div>
+        </div>
+
+        <div class="del_box">
+          <el-link type="danger" icon="el-icon-delete" @click="getDelete(index)"></el-link>
         </div>
       </div>
     </div>
@@ -52,27 +62,31 @@
 </template>
 
 <script>
-  export default {
-    name: 'deviceBom',
-    props: {
-      list: {
-        type: Array,
-        default: () => []
-      },
-      isDetails: {
-        type: Boolean,
-        default: false
-      }
+export default {
+  name: 'deviceBom',
+  props: {
+    list: {
+      type: Array,
+      default: () => []
     },
+    isDetails: {
+      type: Boolean,
+      default: false
+    }
+  },
 
-    computed: {},
+  computed: {},
 
-    data() {
-      return {};
-    },
+  data() {
+    return {};
+  },
 
-    methods: {}
-  };
+  methods: {
+    getDelete(idx) {
+      this.list.splice(idx, 1);
+    }
+  }
+};
 </script>
 
 <style scoped lang="scss">

+ 19 - 0
src/views/produce/components/feeding/components/modelBom.vue

@@ -0,0 +1,19 @@
+<template>
+  <div>
+    <div class="title_box rx-bc mt6">
+      <div class="name">模具信息 </div>
+
+      <div class="rx-bc"> </div>
+    </div>
+  </div>
+</template>
+<script>
+  export default {
+    props: {
+      list: {
+        type: Array,
+        default: () => []
+      }
+    }
+  };
+</script>

+ 82 - 0
src/views/produce/components/feeding/components/productsBom.vue

@@ -0,0 +1,82 @@
+
+<template>
+    <div v-if="productsObj.name != 'undefined' && productsObj.feedQuantity != 'undefined'">
+        <div class="title_box rx-bc mt6">
+            <div class="name">在制品 </div>
+
+            <div class="rx-bc"> </div>
+        </div>
+
+        <div class="material">
+      <div class="content_table">
+        <div class="item rx-sc">
+          <div class="rx ww33">
+            <div class="lable rx-cc">名称</div>
+            <div class="content">
+              {{
+                productsObj.name  + '-在制品'
+              }}
+            </div>
+          </div>
+
+          <div class="rx ww33">
+            <div class="lable rx-cc">牌号</div>
+            <div class="content">{{  productsObj.brandNu }}</div>
+          </div>
+
+          <div class="rx ww33">
+            <div class="lable rx-cc">型号</div>
+            <div class="content">{{ productsObj.modelType  }}</div>
+          </div>
+        </div>
+
+        <div class="item rx-sc">
+          <div class="rx ww33">
+            <div class="lable rx-cc">数量</div>
+            <div class="content rx-sc">
+              <div> {{ productsObj.extInfo.sourceQuantity  || 0  }} {{ productsObj.unit }}</div>
+            </div>
+          </div>
+
+         
+
+          <div class="rx ww33">
+            <div class="lable rx-cc">投料数量</div>
+            <div class="content content_num rx-sc">
+              <el-input size="mini" v-model="productsObj.feedQuantity"  type="digit" @input="maxFeedQuantity()" placeholder="请输入投料数量" />
+            </div>
+          </div>
+        </div>
+
+        <div class="del_box">
+          <el-link type="danger" icon="el-icon-delete" @click="getDelete(index)"></el-link>
+        </div>
+      </div>
+    </div>
+    </div>
+</template>
+
+
+<script>
+export default {
+    props: {
+        productsObj: {
+            type: Object,
+            default: () => { }
+        },
+
+        itemObj: {
+            type: Object,
+            default: () => { }
+        }
+
+    },
+    methods: {
+        maxFeedQuantity() {
+            if (this.productsObj.feedQuantity > this.itemObj.formingNum) {
+                this.$set(this.productsObj, 'feedQuantity', this.itemObj.formingNum)
+            }
+        }
+    }
+
+}

+ 0 - 79
src/views/produce/components/feeding/components/workOrderBom.vue

@@ -70,84 +70,5 @@
   .material {
     margin-top: 6px;
 
-    .content_table {
-      width: 100%;
-      border: 1px solid #e3e5e5;
-
-      .item {
-        display: flex;
-        border-bottom: 1px solid #e3e5e5;
-
-        .lable {
-          width: 66px;
-          text-align: center;
-          background-color: #f7f9fa;
-          font-size: 13px;
-          border-right: 1px solid #e3e5e5;
-          flex-shrink: 0;
-        }
-
-        .lable80 {
-          width: 80px !important;
-          font-size: 12px;
-        }
-
-        .ww60 {
-          width: 60px;
-        }
-
-        .content {
-          width: 250px;
-          min-height: 32px;
-          font-size: 14px;
-          line-height: 14px;
-          font-style: normal;
-          font-weight: 400;
-          padding: 9px 4px;
-          box-sizing: border-box;
-          word-wrap: break-word;
-          flex-grow: 1 !important;
-
-          .unit {
-            padding: 0 2px;
-            font-size: 12px;
-            color: #404446;
-          }
-        }
-
-        .content_num {
-          display: flex;
-          align-items: center;
-          padding: 0 2px;
-        }
-
-        .pd2 {
-          padding: 2px 4px;
-        }
-
-        &:last-child {
-          border-bottom: none;
-        }
-      }
-
-      .ww55 {
-        width: 55%;
-      }
-
-      .ww50 {
-        width: 50%;
-      }
-
-      .ww45 {
-        width: 45%;
-      }
-
-      .ww30 {
-        width: 30%;
-      }
-      .ww20 {
-        width: 20%;
-      }
-    }
   }
 </style>

+ 288 - 283
src/views/produce/components/feeding/index.vue

@@ -13,12 +13,7 @@
 
           <div class="rx-bc">
             <el-button type="text" size="mini">出库单</el-button>
-            <el-button
-              type="text"
-              size="mini"
-              @click="openPicking(item.workOrderId, item)"
-              >添加物料</el-button
-            >
+            <el-button type="text" size="mini" @click="openPicking(item.workOrderId, item)">添加物料</el-button>
             <el-button type="text" size="mini">清空缓存</el-button>
             <el-button type="text" size="mini">缓存</el-button>
           </div>
@@ -26,334 +21,344 @@
 
         <workOrderBom :item="item"></workOrderBom>
 
-        <paramBom
-          v-if="item.paramDetailList.length != 0"
-          :list="item.paramDetailList"
-        ></paramBom>
+        <paramBom v-if="item.paramDetailList.length != 0" :list="item.paramDetailList"></paramBom>
+
+        <deviceBom v-if="item.equipmentList.length != 0" :list="item.equipmentList"></deviceBom>
+
+        <productsBom v-if="item.product != null && item.product != '{}'" :itemObj="item" :productsObj="item.product">
+        </productsBom>
+
+
+        <modelBom v-if='item.modelList.length != 0'  :list='item.modelList'
+        >
+        </modelBom>
 
-        <deviceBom
-          v-if="item.equipmentList.length != 0"
-          :list="item.equipmentList"
-        ></deviceBom>
       </div>
     </div>
 
-    <pickingList
-      isType="feed"
-      ref="pickingListRef"
-      @allSelection="allSelection"
-    ></pickingList>
+    <pickingList isType="feed" ref="pickingListRef" @allSelection="allSelection"></pickingList>
   </div>
 </template>
 
 <script>
-  import { workorderList } from '@/api/produce/workOrder';
-
-  import pickingList from '../picking/pickingList.vue';
-
-  import workOrderBom from './components/workOrderBom.vue';
-  import paramBom from './components/paramBom.vue';
-  import deviceBom from './components/deviceBom.vue';
-  export default {
-    name: 'feeding',
-    components: {
-      pickingList,
-
-      workOrderBom,
-      paramBom,
-      deviceBom
-    },
-    props: {
-      workListIds: {
-        type: Array,
-        default() {
-          return [];
-        }
-      }
-    },
-
-    computed: {
-      taskObj() {
-        return this.$store.state.user.taskObj;
+import { workorderList } from '@/api/produce/workOrder';
+
+import pickingList from '../picking/pickingList.vue';
+
+import workOrderBom from './components/workOrderBom.vue';
+import paramBom from './components/paramBom.vue';
+import deviceBom from './components/deviceBom.vue';
+import productsBom from './components/productsBom.vue';
+import modelBom from './components/modelBom.vue';
+export default {
+  name: 'feeding',
+  components: {
+    pickingList,
+
+    workOrderBom,
+    paramBom,
+    deviceBom,
+    productsBom,
+    modelBom
+  },
+  props: {
+    workListIds: {
+      type: Array,
+      default() {
+        return [];
       }
-    },
-
-    watch: {
-      workListIds: {
-        handler(val) {
-          this.getList(val);
-        },
-        deep: true,
-        immediate: true
-      }
-    },
-    data() {
-      return {
-        List: []
-      };
-    },
-
-    methods: {
-      getList(ids) {
-        let param = {
-          ids: ids,
-          taskId: this.taskObj.id
-        };
-        workorderList(param).then((res) => {
-          this.List = res.map((m) => {
-            m.workOrderId = m.id;
-            m.paramDetailList = [];
-
-            m.instanceList = []; // 物料
-            m.equipmentList = []; // 设备
-            m.modelList = []; // 模具
-            m.aridRegionList = []; // 干燥区
-            m.packingList = []; // 包装
-            m.palletList = []; // 舟皿
-            m.revolvingDiskList = []; // 周转盘
-            m.semiProductList = []; //半成品
-
-            if (m.pickOutInList.length > 0) {
-              m.pickOutInList.forEach((f) => {
-                if (f.rootCategoryLevelId == 1) {
-                  m.instanceList.push(f);
-                } else if (f.rootCategoryLevelId == 4) {
-                  m.modelList.push(f);
-                } else if (f.rootCategoryLevelId == 5) {
-                  m.modelList.push(f);
-                } else if (f.rootCategoryLevelId == 11) {
-                  m.aridRegionList.push(f);
-                } else if (f.rootCategoryLevelId == 13) {
-                  m.packingList.push(f);
-                } else if (f.rootCategoryLevelId == 8) {
-                  m.palletList.push(f);
-                } else if (f.rootCategoryLevelId == 26) {
-                  m.revolvingDiskList.push(f);
-                } else if (
-                  [23, 2, 9, 28].includes(Number(f.rootCategoryLevelId))
-                ) {
-                  m.semiProductList.push(f);
-                }
-              });
-            }
-
-            // 处理字段
-            m.quality == '' ? (m.quality = {}) : '';
-
-            if (!Object.prototype.hasOwnProperty.call(m, 'product')) {
-              m.product = '{}';
-            }
-
-            delete m.id;
-            if (this.taskObj.id) {
-              m.taskId = this.taskObj.id;
-              m.taskName = this.taskObj.name;
-            }
-            return {
-              ...m
-            };
-          });
-        });
+    }
+  },
 
-        this.$forceUpdate();
-      },
+  computed: {
+    taskObj() {
+      return this.$store.state.user.taskObj;
+    }
+  },
 
-      openPicking(id, item) {
-        this.$refs.pickingListRef.open(id, item);
+  watch: {
+    workListIds: {
+      handler(val) {
+        this.getList(val);
       },
-
-      allSelection(id, selectList) {
-        this.List.forEach((m) => {
-          if (m.workOrderId == id) {
-            let modelList = []; // 模具
-            let instanceList = []; // 投料
-            let aridRegionList = []; // 干燥区
-            let equipmentList = []; // 生产设备
-            let palletList = []; // 舟皿
-            let revolvingDiskList = []; // 周转盘
-            let semiProductList = []; // 半成品
-            let turnover = []; //周转车
-
-            selectList.forEach((f) => {
-              if (f.rootCategoryLevelId == 4) {
-                equipmentList = equipmentList.concat(f);
-              }
-              if (f.rootCategoryLevelId == 5) {
-                modelList = modelList.concat(f);
-              } else if (f.rootCategoryLevelId == 1) {
-                instanceList = instanceList.concat(f);
+      deep: true,
+      immediate: true
+    }
+  },
+  data() {
+    return {
+      List: []
+    };
+  },
+
+  methods: {
+    getList(ids) {
+      let param = {
+        ids: ids,
+        taskId: this.taskObj.id
+      };
+      workorderList(param).then((res) => {
+        this.List = res.map((m) => {
+          m.workOrderId = m.id;
+          m.paramDetailList = [];
+
+          m.instanceList = []; // 物料
+          m.equipmentList = []; // 设备
+          m.modelList = []; // 模具
+          m.aridRegionList = []; // 干燥区
+          m.packingList = []; // 包装
+          m.palletList = []; // 舟皿
+          m.revolvingDiskList = []; // 周转盘
+          m.semiProductList = []; //半成品
+
+          if (m.pickOutInList.length > 0) {
+            m.pickOutInList.forEach((f) => {
+              if (f.rootCategoryLevelId == 1) {
+                m.instanceList.push(f);
+              } else if (f.rootCategoryLevelId == 4) {
+                m.modelList.push(f);
+              } else if (f.rootCategoryLevelId == 5) {
+                m.modelList.push(f);
               } else if (f.rootCategoryLevelId == 11) {
-                aridRegionList = aridRegionList.concat(f);
-              } else if (f.rootCategoryLevelId == 7) {
-                turnover = turnover.concat(f);
+                m.aridRegionList.push(f);
+              } else if (f.rootCategoryLevelId == 13) {
+                m.packingList.push(f);
               } else if (f.rootCategoryLevelId == 8) {
-                palletList = palletList.concat(f);
+                m.palletList.push(f);
               } else if (f.rootCategoryLevelId == 26) {
-                revolvingDiskList = revolvingDiskList.concat(f);
+                m.revolvingDiskList.push(f);
               } else if (
                 [23, 2, 9, 28].includes(Number(f.rootCategoryLevelId))
               ) {
-                semiProductList = semiProductList.concat(f);
+                m.semiProductList.push(f);
               }
             });
+          }
 
-            this.$set(m, 'modelList', modelList);
-            this.$set(m, 'instanceList', instanceList);
-            this.$set(m, 'aridRegionList', aridRegionList);
-            this.$set(m, 'equipmentList', equipmentList);
-            this.$set(m, 'turnover', turnover);
-            this.$set(m, 'palletList', palletList);
-            this.$set(m, 'revolvingDiskList', revolvingDiskList);
-            this.$set(m, 'semiProductList', semiProductList);
+          // 处理字段
+          m.quality == '' ? (m.quality = {}) : '';
 
+          if (!Object.prototype.hasOwnProperty.call(m, 'product')) {
+            m.product = '{}';
+          }
 
-            this.$forceUpdate();
+          delete m.id;
+          if (this.taskObj.id) {
+            m.taskId = this.taskObj.id;
+            m.taskName = this.taskObj.name;
           }
+          return {
+            ...m
+          };
         });
-      }
-    }
-  };
-</script>
+      });
 
-<style scoped lang="scss">
-  .top_fixed {
-    width: 100%;
-    height: 40px;
-    background: #fff;
-    display: flex;
-    align-items: center;
-    justify-content: flex-end;
-  }
+      this.$forceUpdate();
+    },
 
-  .feed_box {
-    margin-top: 6px;
-    width: 100%;
-    height: calc(100vh - 70px - 50px - 80px - 60px);
-    overflow-y: scroll;
-    overflow-x: hidden;
-  }
+    openPicking(id, item) {
+      this.$refs.pickingListRef.open(id, item);
+    },
 
-  .card_box {
-    background: #fff;
-    padding: 8px;
-    border-radius: 2px;
-  }
-</style>
+    allSelection(id, selectList) {
+      this.List.forEach((m) => {
+        if (m.workOrderId == id) {
+          let modelList = []; // 模具
+          let instanceList = []; // 投料
+          let aridRegionList = []; // 干燥区
+          let equipmentList = []; // 生产设备
+          let palletList = []; // 舟皿
+          let revolvingDiskList = []; // 周转盘
+          let semiProductList = []; // 半成品
+          let turnover = []; //周转车
+
+          selectList.forEach((f) => {
+            if (f.rootCategoryLevelId == 4) {
+              equipmentList = equipmentList.concat(f);
+            }
+            if (f.rootCategoryLevelId == 5) {
+              modelList = modelList.concat(f);
+            } else if (f.rootCategoryLevelId == 1) {
+              instanceList = instanceList.concat(f);
+            } else if (f.rootCategoryLevelId == 11) {
+              aridRegionList = aridRegionList.concat(f);
+            } else if (f.rootCategoryLevelId == 7) {
+              turnover = turnover.concat(f);
+            } else if (f.rootCategoryLevelId == 8) {
+              palletList = palletList.concat(f);
+            } else if (f.rootCategoryLevelId == 26) {
+              revolvingDiskList = revolvingDiskList.concat(f);
+            } else if (
+              [23, 2, 9, 28].includes(Number(f.rootCategoryLevelId))
+            ) {
+              semiProductList = semiProductList.concat(f);
+            }
+          });
 
-<style lang="scss">
-  .mt6 {
-    margin-top: 6px;
-  }
+          this.$set(m, 'modelList', modelList);
+          this.$set(m, 'instanceList', instanceList);
+          this.$set(m, 'aridRegionList', aridRegionList);
+          this.$set(m, 'equipmentList', equipmentList);
+          this.$set(m, 'turnover', turnover);
+          this.$set(m, 'palletList', palletList);
+          this.$set(m, 'revolvingDiskList', revolvingDiskList);
+          this.$set(m, 'semiProductList', semiProductList);
 
-  .title_box {
-    .name {
-      font-size: 14px;
-      font-style: normal;
-      font-weight: 400;
-      color: #157a2c;
-      padding-left: 5px;
-      position: relative;
-
-      &:before {
-        position: absolute;
-        content: '';
-        left: 0px;
-        top: 0px;
-        bottom: 0px;
-        width: 2px;
-        height: 14px;
-        background: #157a2c;
-        margin: auto;
-      }
+          this.$forceUpdate();
+        }
+      });
     }
   }
+};
+</script>
 
-  .material {
-    margin-top: 6px;
+<style scoped lang="scss">
+.top_fixed {
+  width: 100%;
+  height: 40px;
+  background: #fff;
+  display: flex;
+  align-items: center;
+  justify-content: flex-end;
+}
+
+.feed_box {
+  margin-top: 6px;
+  width: 100%;
+  height: calc(100vh - 70px - 50px - 80px - 60px);
+  overflow-y: scroll;
+  overflow-x: hidden;
+}
+
+.card_box {
+  background: #fff;
+  padding: 8px;
+  border-radius: 2px;
+}
+</style>
 
-    .content_table {
-      width: 100%;
-      border: 1px solid #e3e5e5;
+<style lang="scss">
+.mt6 {
+  margin-top: 6px;
+}
+
+.title_box {
+  .name {
+    font-size: 14px;
+    font-style: normal;
+    font-weight: 400;
+    color: #157a2c;
+    padding-left: 5px;
+    position: relative;
+
+    &:before {
+      position: absolute;
+      content: '';
+      left: 0px;
+      top: 0px;
+      bottom: 0px;
+      width: 2px;
+      height: 14px;
+      background: #157a2c;
+      margin: auto;
+    }
+  }
+}
 
-      .item {
-        display: flex;
-        border-bottom: 1px solid #e3e5e5;
-
-        .lable {
-          width: 66px;
-          text-align: center;
-          background-color: #f7f9fa;
-          font-size: 13px;
-          border-right: 1px solid #e3e5e5;
-          flex-shrink: 0;
-        }
+.material {
+  margin-top: 6px;
 
-        .lable80 {
-          width: 80px !important;
-          font-size: 12px;
-        }
+  .content_table {
+    width: 100%;
+    border: 1px solid #e3e5e5;
+    position: relative;
+
+    .item {
+      display: flex;
+      border-bottom: 1px solid #e3e5e5;
+
+      .lable {
+        width: 66px;
+        text-align: center;
+        background-color: #f7f9fa;
+        font-size: 13px;
+        border-right: 1px solid #e3e5e5;
+        flex-shrink: 0;
+      }
 
-        .ww60 {
-          width: 60px;
-        }
+      .lable80 {
+        width: 80px !important;
+        font-size: 12px;
+      }
 
-        .content {
-          width: 250px;
-          min-height: 32px;
-          font-size: 14px;
-          line-height: 14px;
-          font-style: normal;
-          font-weight: 400;
-          padding: 9px 4px;
-          box-sizing: border-box;
-          word-wrap: break-word;
-          flex-grow: 1 !important;
-
-          .unit {
-            padding: 0 2px;
-            font-size: 12px;
-            color: #404446;
-          }
-        }
+      .ww60 {
+        width: 60px;
+      }
 
-        .content_num {
-          display: flex;
-          align-items: center;
+      .content {
+        width: 250px;
+        min-height: 32px;
+        font-size: 14px;
+        line-height: 14px;
+        font-style: normal;
+        font-weight: 400;
+        padding: 9px 4px;
+        box-sizing: border-box;
+        word-wrap: break-word;
+        flex-grow: 1 !important;
+
+        .unit {
           padding: 0 2px;
-        }
-
-        .pd2 {
-          padding: 2px 4px;
-        }
-
-        &:last-child {
-          border-bottom: none;
+          font-size: 12px;
+          color: #404446;
         }
       }
 
-      .ww55 {
-        width: 55%;
+      .content_num {
+        display: flex;
+        align-items: center;
+        padding: 2px;
+        --input-background-color: #f0f8f2;
       }
 
-      .ww50 {
-        width: 50%;
+      .pd2 {
+        padding: 2px 4px;
       }
 
-      .ww45 {
-        width: 45%;
+      &:last-child {
+        border-bottom: none;
       }
+    }
 
-      .ww30 {
-        width: 30%;
-      }
+    .ww55 {
+      width: 55%;
+    }
 
-      .ww33 {
-        width: 33.33%;
-      }
+    .ww50 {
+      width: 50%;
+    }
 
-      .ww20 {
-        width: 20%;
-      }
+    .ww45 {
+      width: 45%;
+    }
+
+    .ww30 {
+      width: 30%;
+    }
+
+    .ww33 {
+      width: 33.33%;
+    }
+
+    .ww20 {
+      width: 20%;
+    }
+
+    .del_box {
+      position: absolute;
+      right: 2px;
+      top: 2px;
     }
   }
+}
 </style>

+ 8 - 2
src/views/produceOrder/index.vue

@@ -23,9 +23,11 @@
         row-key="code"
         :cache-key="`${activeName}produceOrderTable`"
         :selection.sync="selection"
-        :parse-data="parseData"
+
         @sort-change="onSortChange"
-      >
+        autoAmendPage
+      >        
+      <!-- :parse-data="parseData" -->
         <template v-slot:toolbar>
           <el-button type="success">新建</el-button>
           <el-button type="success">暂停</el-button>
@@ -455,8 +457,12 @@
 
       /* 数据转为树形结构 */
       parseData(data) {
+        console.log(99,data);
         return this.$util.toTreeData({
           data: data.list,
+          count: data.total,
+
+
           idField: 'code',
           parentIdField: 'originalCode'
         });