ysy 1 yıl önce
ebeveyn
işleme
77ecc9789c

+ 237 - 0
src/views/produce/components/jobBooking/components/turnoverBom.vue

@@ -0,0 +1,237 @@
+<template>
+    <div>
+        <div class="title_box rx-bc mt6">
+            <div class="name">周转车 </div>
+
+            <div class="rx-bc"> </div>
+        </div>
+        <el-collapse accordion>
+            <div class="material" v-for="(item, index) in newList" :key="index">
+                <el-collapse-item>
+                    <template slot="title">
+                        <div class="content_table">
+                            <div class="item rx-sc">
+                                <div class="rx ww50">
+                                    <div class="lable rx-cc">编号</div>
+                                    <div class="content">
+                                        {{ item.code }}
+                                    </div>
+                                </div>
+
+                                <div class="rx ww50">
+                                    <div class="lable rx-cc">名称</div>
+                                    <div class="content">{{ item.name }}</div>
+                                </div>
+                            </div>
+
+                            <div class="del_box">
+                                <el-link type="danger" icon="el-icon-delete" @click="getDelete(index)"></el-link>
+                            </div>
+                        </div>
+                    </template>
+
+                    <div class="content_table2">
+                        <div class="head row rx-sc">
+                            <div class="item ww10">货位</div>
+                            <div class="item ww35">工单编号</div>
+                            <div class="item ww35">产品编码</div>
+                            <div class="item ww20">数量(PCS)</div>
+                        </div>
+
+                        <div class="table">
+                            <div class="tr row rx-sc" v-for="(it, idx) in item.extInfo.positionList" :key="idx">
+                                <div class="item ww10">{{ it.code }}</div>
+
+                                <div class="item ww35" :class="{ color157: it.workOrderCode === wordItem.code }">
+                                    {{ it.workOrderCode }}
+                                </div>
+
+                                <div class="item ww35"
+                                    :class="{ 'color157': it.categoryCode === wordItem.productCode }">
+                                    {{ it.categoryCode }}
+                                </div>
+
+
+
+                                <div class="item ww20 " :class="{ 'content_num': pattern == 'job' }" v-if='!isDetails'>
+                                    <el-input size="mini" class="uni-input" v-if='it.isFull == 0' @input="quantInt(index, idx, it)"
+                                        v-model="it.quantity" type="digit"
+                                        :disabled="(!Object.prototype.hasOwnProperty.call(it, 'isOccupy') && it.isOccupy) || pattern != 'job'"></el-input>
+                                    <span v-else>{{ it.quantity }}</span>
+                                </div>
+
+                                <div class="item ww20" v-if='isDetails'>
+                                    {{ it.quantity }}
+                                </div>
+
+
+                            </div>
+                        </div>
+                    </div>
+                </el-collapse-item>
+            </div>
+        </el-collapse>
+    </div>
+</template>
+<script>
+export default {
+    props: {
+        list: {
+            type: Array,
+            default: () => []
+        },
+
+        wordItem: {
+            type: Object,
+            default: () => { }
+        },
+
+        pattern: {
+            type: String,
+            default: ''
+        },
+
+        isDetails: {
+            type: Boolean,
+            default: false
+        }
+    },
+    watch: {
+
+        list: {
+            immediate: true,
+            deep: true,
+            handler(newVal) {
+
+
+                this.newList = newVal
+
+
+            }
+        }
+    },
+
+    data() {
+        return {
+            newList: [],
+
+            totalCount: 0,
+        };
+    },
+    methods: {
+
+
+        quantInt(index, idx, it) {
+            if (it.quantity >= 1) {
+                this.$set(this.newList[index].extInfo.positionList[idx], 'workOrderCode', this.wordItem.code)
+                this.$set(this.newList[index].extInfo.positionList[idx], 'categoryCode', this.wordItem.productCode)
+
+            } else {
+                this.$set(this.newList[index].extInfo.positionList[idx], 'workOrderCode', '')
+                this.$set(this.newList[index].extInfo.positionList[idx], 'categoryCode', '')
+                this.$set(this.newList[index].extInfo.positionList[idx], 'quantity', 0)
+            }
+
+
+            this.totalCount = 0
+            this.newList.forEach(f => {
+                f.extInfo.positionList.forEach(o => {
+                    if (o.workOrderCode == this.wordItem.code && (!Object.prototype.hasOwnProperty.call(o, 'isOccupy') || (o.isOccupy == 0 && o.quantity > 0))) {
+                        this.totalCount = Number(this.totalCount) + Number(o.quantity)
+                    }
+                })
+            })
+
+            this.$message.info(`已经放${this.totalCount}`)
+            this.$emit('formedNumFn', this.totalCount)
+
+
+        },
+
+        getDelete(index) {
+            this.list.splice(index, 1);
+        }
+    }
+};
+</script>
+
+<style lang="scss" scoped>
+.material {
+    width: 92%;
+}
+
+.content_table2 {
+    width: 100%;
+
+    .row {
+        width: 100%;
+
+        .item {
+            color: #404446;
+            font-size: 14px;
+            padding-left: 6px;
+        }
+
+        .color157 {
+            color: #157a2c;
+        }
+
+        .ww20 {
+            width: 20%;
+        }
+
+        .ww25 {
+            width: 25%;
+        }
+
+        .ww35 {
+            width: 35%;
+        }
+
+        .ww10 {
+            width: 10%;
+        }
+    }
+
+    .head {
+        height: 32px;
+        background: #f7f9fa;
+        border-top: 1px solid #e3e5e5;
+        border-left: 1px solid #e3e5e5;
+
+        .item {
+            height: 32px;
+            line-height: 32px;
+            border-right: 1px solid #e3e5e5;
+            box-sizing: border-box;
+        }
+    }
+
+    .tr {
+        border-top: 1px solid #e3e5e5;
+        border-left: 1px solid #e3e5e5;
+
+        .item {
+            font-size: 12px;
+            min-height: 32px;
+            display: flex;
+            align-items: center;
+            border-right: 1px solid #e3e5e5;
+            box-sizing: border-box;
+            white-space: normal;
+            word-break: break-all;
+        }
+
+        &:last-child {
+            border-bottom: 1px solid #e3e5e5;
+        }
+    }
+}
+
+.content_num {
+    display: flex;
+    align-items: center;
+    padding: 2px;
+    --input-background-color: #f0f8f2;
+}
+</style>

+ 307 - 214
src/views/produce/components/jobBooking/index.vue

@@ -1,271 +1,364 @@
 <template>
 <template>
   <div>
   <div>
     <div class="top_fixed">
     <div class="top_fixed">
-      <el-button type="primary" size="mini" @click="save(2, 'all')">一键报工</el-button>
-      <el-button type="primary" size="mini" @click="removeCacheFn('all')">清空缓存</el-button>
-      <el-button type="primary" size="mini" @click="save(1, 'all')">缓存</el-button>
+      <el-button type="primary" size="mini" @click="save(2, 'all')"
+        >一键报工</el-button
+      >
+      <el-button type="primary" size="mini" @click="removeCacheFn('all')"
+        >清空缓存</el-button
+      >
+      <el-button type="primary" size="mini" @click="save(1, 'all')"
+        >缓存</el-button
+      >
     </div>
     </div>
 
 
     <div class="job_box">
     <div class="job_box">
-      <div v-for="(item, index) in List" :key="index" class="card_box" v-if="isLoad">
+      <div
+        v-for="(item, index) in List"
+        :key="index"
+        class="card_box"
+        v-if="isLoad"
+      >
         <div class="title_box rx-bc">
         <div class="title_box rx-bc">
           <div class="name">工单信息 </div>
           <div class="name">工单信息 </div>
 
 
           <div class="rx-bc">
           <div class="rx-bc">
-            <el-button type="text" size="mini" @click="openPicking(item.id, item)">添加物料</el-button>
-            <el-button type="text" size="mini" @click="removeCacheFn(item.id)">清空缓存</el-button>
-            <el-button type="text" size="mini" @click="save(1, index)">缓存</el-button>
+            <el-button
+              type="text"
+              size="mini"
+              @click="openPicking(item.id, item)"
+              >添加物料</el-button
+            >
+            <el-button type="text" size="mini" @click="removeCacheFn(item.id)"
+              >清空缓存</el-button
+            >
+            <el-button type="text" size="mini" @click="save(1, index)"
+              >缓存</el-button
+            >
           </div>
           </div>
         </div>
         </div>
 
 
         <workOrderBom :item="item"></workOrderBom>
         <workOrderBom :item="item"></workOrderBom>
-        <paramBom v-if="item.paramDetailList.length != 0" :list="item.paramDetailList"></paramBom>
-
-        <jobBom :item="item" :notFormed="item.notFormedList" :warehouseList="warehouseList"></jobBom>
-
-        <deviceBom v-if="item.equipmentList.length != 0" :list="item.equipmentList"></deviceBom>
-
-        <modelBom v-if='item.modelList.length != 0' :list='item.modelList' pattern='job' ref='modelRef'></modelBom>
-
-        <palletBom v-if="item.palletList.length != 0" :list='item.palletList'></palletBom>
-
-        <revolvingDiskBom  v-if="item.revolvingDiskList.length > 0" pattern='job' :list="objData.revolvingDiskList"></revolvingDiskBom>
+        <paramBom
+          v-if="item.paramDetailList.length != 0"
+          :list="item.paramDetailList"
+        ></paramBom>
+
+        <jobBom
+          :item="item"
+          :notFormed="item.notFormedList"
+          :warehouseList="warehouseList"
+        ></jobBom>
+
+        <deviceBom
+          v-if="item.equipmentList.length != 0"
+          :list="item.equipmentList"
+        ></deviceBom>
+
+        <modelBom
+          v-if="item.modelList.length != 0"
+          :list="item.modelList"
+          pattern="job"
+          ref="modelRef"
+        ></modelBom>
+
+        <palletBom
+          v-if="item.palletList.length != 0"
+          :list="item.palletList"
+        ></palletBom>
+
+        <revolvingDiskBom
+          v-if="item.revolvingDiskList.length > 0"
+          pattern="job"
+          :list="objData.revolvingDiskList"
+        >
+        </revolvingDiskBom>
 
 
         <semiProductJobBom></semiProductJobBom>
         <semiProductJobBom></semiProductJobBom>
 
 
-        <byProductBom  v-if='item.productRecycleList.length != 0' :list='item.productRecycleList'> </byProductBom>
+        <byProductBom
+          v-if="item.productRecycleList.length != 0"
+          :list="item.productRecycleList"
+        >
+        </byProductBom>
+
+        <turnoverBom
+          v-if="item.turnover.length != 0"
+          :list="item.turnover"
+          :wordItem="item"
+          pattern="job"
+        >
+        </turnoverBom>
       </div>
       </div>
     </div>
     </div>
+
+    <pickingList
+      isType="job"
+      ref="pickingListRef"
+      @allSelection="allSelection"
+    ></pickingList>
   </div>
   </div>
 </template>
 </template>
 
 
 <script>
 <script>
-import { listByIdsReport } from '@/api/produce/job';
-import { getWarehouseList } from '@/api/produce/index';
-
-import workOrderBom from '../feeding/components/workOrderBom.vue';
-import paramBom from '../feeding/components/paramBom.vue';
-import jobBom from './components/jobBom.vue';
-import deviceBom from '../feeding/components/deviceBom.vue';
-import modelBom from '../feeding/components/modelBom.vue'
-import palletBom from './components/palletBom.vue'
-import revolvingDiskBom from '../feeding/components/revolvingDiskBom.vue' 
-import semiProductJobBom from './components/semiProductJobBom.vue'
-
-import byProductBom from './components/byProductBom.vue'
-export default {
-  components: {
-    workOrderBom,
-    paramBom,
-    jobBom,
-    deviceBom,
-    modelBom,
-    palletBom,
-    revolvingDiskBom,
-    semiProductJobBom,
-    byProductBom
-  },
-  props: {
-    workListIds: {
-      type: Array,
-      default() {
-        return [];
+  import { listByIdsReport } from '@/api/produce/job';
+  import { getWarehouseList } from '@/api/produce/index';
+  import pickingList from '../picking/pickingList.vue';
+
+  import workOrderBom from '../feeding/components/workOrderBom.vue';
+  import paramBom from '../feeding/components/paramBom.vue';
+  import jobBom from './components/jobBom.vue';
+  import deviceBom from '../feeding/components/deviceBom.vue';
+  import modelBom from '../feeding/components/modelBom.vue';
+  import palletBom from './components/palletBom.vue';
+  import revolvingDiskBom from '../feeding/components/revolvingDiskBom.vue';
+  import semiProductJobBom from './components/semiProductJobBom.vue';
+
+  import byProductBom from './components/byProductBom.vue';
+  import turnoverBom from './components/turnoverBom.vue';
+  export default {
+    components: {
+      pickingList,
+
+      workOrderBom,
+      paramBom,
+      jobBom,
+      deviceBom,
+      modelBom,
+      palletBom,
+      revolvingDiskBom,
+      semiProductJobBom,
+      byProductBom,
+      turnoverBom
+    },
+    props: {
+      workListIds: {
+        type: Array,
+        default() {
+          return [];
+        }
       }
       }
-    }
-  },
-  data() {
-    return {
-      List: [],
-      idsList: [],
-      isLoad: false,
-
-      warehouseList: []
-    };
-  },
-
-  computed: {
-    taskObj() {
-      return this.$store.state.user.taskObj;
     },
     },
+    data() {
+      return {
+        List: [],
+        idsList: [],
+        isLoad: false,
 
 
-    clientEnvironmentId() {
-      return this.$store.state.user.info.clientEnvironmentId;
-    }
-  },
+        warehouseList: []
+      };
+    },
 
 
-  watch: {
-    workListIds: {
-      handler(val) {
-        this.getList(val);
+    computed: {
+      taskObj() {
+        return this.$store.state.user.taskObj;
       },
       },
-      deep: true,
-      immediate: true
-    }
-  },
-
-  created() {
-    this.getWarehouseListFn();
-  },
-
-  methods: {
-    getList(ids) {
-      this.idsList = ids || [];
-      let param = {
-        ids: ids,
-        taskId: this.taskObj.id,
-        type: 0
-      };
-      this.isLoad = false;
-      listByIdsReport(param)
-        .then((res) => {
-          this.List = res.map((obj) => {
-            if (!Object.prototype.hasOwnProperty.call(obj, 'turnover')) {
-              obj['turnover'] = [];
-            }
-            if (
-              !Object.prototype.hasOwnProperty.call(obj, 'aridRegionList')
-            ) {
-              obj['aridRegionList'] = [];
-            }
 
 
-            if (!Object.prototype.hasOwnProperty.call(obj, 'instanceList')) {
-              obj['instanceList'] = [];
-            }
+      clientEnvironmentId() {
+        return this.$store.state.user.info.clientEnvironmentId;
+      }
+    },
 
 
-            if (!Object.prototype.hasOwnProperty.call(obj, 'palletList')) {
-              obj['palletList'] = [];
-            }
+    watch: {
+      workListIds: {
+        handler(val) {
+          this.getList(val);
+        },
+        deep: true,
+        immediate: true
+      }
+    },
 
 
-            if (
-              !Object.prototype.hasOwnProperty.call(obj, 'revolvingDiskList')
-            ) {
-              obj['revolvingDiskList'] = [];
-            }
+    created() {
+      this.getWarehouseListFn();
+    },
 
 
-            if (obj.palletList.length > 0) {
-              obj.palletList = obj.palletList.map((m) => {
-                return {
-                  hideKc: true, // 不显示库存
-                  quantity: m.feedQuantity,
-                  ...m
-                };
-              });
-            }
+    methods: {
+      getList(ids) {
+        this.idsList = ids || [];
+        let param = {
+          ids: ids,
+          taskId: this.taskObj.id,
+          type: 0
+        };
+        this.isLoad = false;
+        listByIdsReport(param)
+          .then((res) => {
+            this.List = res.map((obj) => {
+              if (!Object.prototype.hasOwnProperty.call(obj, 'turnover')) {
+                obj['turnover'] = [];
+              }
+              if (
+                !Object.prototype.hasOwnProperty.call(obj, 'aridRegionList')
+              ) {
+                obj['aridRegionList'] = [];
+              }
 
 
-            if (this.taskObj.type == 6 && this.clientEnvironmentId == 3) {
-              obj.semiProductList = obj.pickOutInList;
-            }
+              if (!Object.prototype.hasOwnProperty.call(obj, 'instanceList')) {
+                obj['instanceList'] = [];
+              }
 
 
-            obj.workReportInfo = {
-              formingNum: null,
-              formingWeight: null,
-              formedNum: null,
-              formedWeight: null,
-              taskId: this.taskObj.id
-            };
-
-            obj.notFormedList = [
-              {
-                notFormedNum: null,
-                notFormedWeight: null,
-                weightUnit: obj.weightUnit,
-                unit: obj.unit,
-                warehouseId: null // 处置 仓库id
+              if (!Object.prototype.hasOwnProperty.call(obj, 'palletList')) {
+                obj['palletList'] = [];
               }
               }
-            ];
 
 
-            if (obj.semiProductList.length > 0) {
-              // 预制体报工
-              obj.workReportInfo.formedNum = obj.semiProductList.length;
-            }
+              if (
+                !Object.prototype.hasOwnProperty.call(obj, 'revolvingDiskList')
+              ) {
+                obj['revolvingDiskList'] = [];
+              }
 
 
-            obj.workReportInfo.formingNum = obj.formingNum;
-            obj.workReportInfo.formingWeight = obj.formingWeight;
-            obj.workReportInfo.unit = obj.unit;
-            obj.workReportInfo.weightUnit = obj.weightUnit;
-            obj.workReportInfo.workOrderId = obj.workOrderId;
+              if (obj.palletList.length > 0) {
+                obj.palletList = obj.palletList.map((m) => {
+                  return {
+                    hideKc: true, // 不显示库存
+                    quantity: m.feedQuantity,
+                    ...m
+                  };
+                });
+              }
+
+              if (this.taskObj.type == 6 && this.clientEnvironmentId == 3) {
+                obj.semiProductList = obj.pickOutInList;
+              }
+
+              obj.workReportInfo = {
+                formingNum: null,
+                formingWeight: null,
+                formedNum: null,
+                formedWeight: null,
+                taskId: this.taskObj.id
+              };
 
 
-            obj.paramDetailList.map((m) => {
-              if (m.extInfo.textType == 5) {
-                m.remainingTime = m.extInfo.remainingTime;
+              obj.notFormedList = [
+                {
+                  notFormedNum: null,
+                  notFormedWeight: null,
+                  weightUnit: obj.weightUnit,
+                  unit: obj.unit,
+                  warehouseId: null // 处置 仓库id
+                }
+              ];
+
+              if (obj.semiProductList.length > 0) {
+                // 预制体报工
+                obj.workReportInfo.formedNum = obj.semiProductList.length;
               }
               }
+
+              obj.workReportInfo.formingNum = obj.formingNum;
+              obj.workReportInfo.formingWeight = obj.formingWeight;
+              obj.workReportInfo.unit = obj.unit;
+              obj.workReportInfo.weightUnit = obj.weightUnit;
+              obj.workReportInfo.workOrderId = obj.workOrderId;
+
+              obj.paramDetailList.map((m) => {
+                if (m.extInfo.textType == 5) {
+                  m.remainingTime = m.extInfo.remainingTime;
+                }
+                return {
+                  ...m.extInfo
+                };
+              });
+
               return {
               return {
-                ...m.extInfo
+                ...obj
               };
               };
             });
             });
+          })
+          .finally(() => {
+            this.isLoad = true;
 
 
-            return {
-              ...obj
-            };
+            if (this.taskObj.id == 1) {
+              this.getCacheFn();
+            }
           });
           });
-        })
-        .finally(() => {
-          this.isLoad = true;
+      },
 
 
-          if (this.taskObj.id == 1) {
-            this.getCacheFn();
+      openPicking(id, item) {
+        this.$refs.pickingListRef.open(id, item);
+      },
+
+      allSelection(id, selectList) {
+        this.List.forEach((m) => {
+          if (m.id == id) {
+            let turnover = [];
+            let equipmentList = []; // 生产设备
+
+            selectList.forEach((f) => {
+              if (f.rootCategoryLevelId == 4) {
+                equipmentList = equipmentList.concat(f);
+              }
+              if (f.rootCategoryLevelId == 7) {
+                turnover = turnover.concat(f);
+              }
+            });
+
+            this.$set(m, 'equipmentList', equipmentList);
+            this.$set(m, 'turnover', turnover);
+
+            this.$forceUpdate();
           }
           }
         });
         });
-    },
-    async save(type, index) { },
+      },
+      async save(type, index) {},
 
 
-    getCacheFn() { },
+      getCacheFn() {},
 
 
-    removeCacheFn(type) { },
+      removeCacheFn(type) {},
 
 
-    getWarehouseListFn() {
-      getWarehouseList().then((res) => {
-        this.warehouseList = res.data;
-      });
+      getWarehouseListFn() {
+        getWarehouseList().then((res) => {
+          this.warehouseList = res.data;
+        });
+      }
     }
     }
-  }
-};
+  };
 </script>
 </script>
 
 
 <style scoped lang="scss">
 <style scoped lang="scss">
-.top_fixed {
-  width: 100%;
-  height: 40px;
-  background: #fff;
-  display: flex;
-  align-items: center;
-  justify-content: flex-end;
-}
-
-.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;
+  .top_fixed {
+    width: 100%;
+    height: 40px;
+    background: #fff;
+    display: flex;
+    align-items: center;
+    justify-content: flex-end;
+  }
+
+  .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;
+      }
     }
     }
   }
   }
-}
-
-.job_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;
-}
+
+  .job_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>
 </style>

+ 17 - 0
src/views/produce/components/picking/pickingList.vue

@@ -417,6 +417,8 @@
           ) {
           ) {
             URL = assetPage;
             URL = assetPage;
           }
           }
+        } else if(this.isType == 'job') {
+          URL = assetPage;
         }
         }
 
 
         const res = await URL(param);
         const res = await URL(param);
@@ -529,6 +531,21 @@
           this.allSelection = feedList || [];
           this.allSelection = feedList || [];
           this.visible = true;
           this.visible = true;
 
 
+          this.$nextTick(() => {
+            feedList.forEach((item) => {
+              this.$refs.table.toggleRowSelection(item, true);
+            });
+          });
+        } else if (this.isType == 'job') {
+          let feedList = [];
+          feedList = [
+            ...item.turnover,
+            ...item.equipmentList,
+          ];
+          this.temporaryList = feedList || [];
+          this.allSelection = feedList || [];
+          this.visible = true;
+
           this.$nextTick(() => {
           this.$nextTick(() => {
             feedList.forEach((item) => {
             feedList.forEach((item) => {
               this.$refs.table.toggleRowSelection(item, true);
               this.$refs.table.toggleRowSelection(item, true);