Kaynağa Gözat

Merge branch 'dev' of http://110.41.163.243:9980/kd-aiot/kd-aiot-frontend-mes into dev

2213980799@qq.com 1 yıl önce
ebeveyn
işleme
1b6f53f752

+ 76 - 76
src/views/produce/components/feeding/components/productsBom.vue

@@ -1,105 +1,105 @@
-
 <template>
-<div>
-  <!-- <div v-if="productsObj && productsObj.name != 'undefined' && productsObj.feedQuantity != 'undefined'">
-        <div class="title_box rx-bc mt6">
-            <div class="name">在制品 </div>
-
-            <div class="rx-bc"> </div>
-        </div>
+  <div>
+    <div
+      v-if="
+        productsObj &&
+        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 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>
 
-          <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="rx ww33">
+              <div class="lable rx-cc">牌号</div>
+              <div class="content">{{ productsObj.brandNu }}</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 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 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>
 
-        <div class="del_box">
-          <el-link type="danger" icon="el-icon-delete" @click="getDelete(index)"></el-link>
+          <div class="del_box">
+            <el-link
+              type="danger"
+              icon="el-icon-delete"
+              @click="getDelete(index)"
+            ></el-link>
+          </div>
         </div>
       </div>
     </div>
-    </div> -->
-
-  {{ productsObj }}
-  33
   </div>
-
 </template>
 
-
 <script>
-export default {
+  export default {
+    name: 'productsBom',
     props: {
-      product: {
-          type: Object,
-          default: () => { }
-        },
-
-        itemObj: {
-            type: Object,
-            default: () => { }
-        }
-
+      itemObj: {
+        type: Object,
+        default: () => {}
+      },
+      productsObj: {
+        type: Object,
+        default: () => {}
+      }
     },
 
-    watch: {
-      product: {
-        immediate: true,
-        handler(newVal) {
-          console.log(newVal)
-          this.productsObj = newVal
-          this.$forceUpdate()
-        },
-        deep: true
-        
-    },
+    computed: {},
 
-    created() {
-      console.log()
+    data() {
+      return {};
     },
 
     methods: {
-        maxFeedQuantity() {
-            // if (this.productsObj.feedQuantity > this.itemObj.formingNum) {
-            //     this.$set(this.productsObj, 'feedQuantity', this.itemObj.formingNum)
-            // }
+      maxFeedQuantity() {
+        if (this.productsObj.feedQuantity > this.itemObj.formingNum) {
+          this.$set(this.productsObj, 'feedQuantity', this.itemObj.formingNum);
         }
+      }
     }
+  };
+</script>
 
-}
+<style scoped lang="scss"></style>

+ 9 - 5
src/views/produce/components/feeding/index.vue

@@ -12,7 +12,7 @@
       >
     </div>
 
-    <div class="feed_box">
+    <div class="feed_box"  v-if="isLoad">
       <div v-for="(item, index) in List" :key="index" class="card_box">
         <div class="title_box rx-bc">
           <div class="name">工单信息 </div>
@@ -37,7 +37,7 @@
           </div>
         </div>
 
-        <workOrderBom :item="item"></workOrderBom>
+        <workOrderBom :item="item" ></workOrderBom>
 
         <paramBom
           v-if="item.paramDetailList.length != 0"
@@ -53,7 +53,8 @@
         <productsBom
           v-if="item.product != null && item.product != '{}'"
           :itemObj="item"
-          :product="item.product"
+
+          :productsObj="item.product"
         >
         </productsBom>
 
@@ -84,7 +85,7 @@
         <aridRegion
           v-if="item.aridRegionList.length != 0"
           :list="item.aridRegionList"
-          @handleScan="handleScan"
+          
         ></aridRegion>
 
         <palletBom
@@ -174,7 +175,8 @@
     data() {
       return {
         List: [],
-        idsList: []
+        idsList: [],
+        isLoad: false,
       };
     },
 
@@ -185,6 +187,7 @@
           ids: ids,
           taskId: this.taskObj.id
         };
+        this.isLoad = false;
         workorderList(param)
           .then((res) => {
             let arr = [];
@@ -246,6 +249,7 @@
             this.List = deepClone(arr);
           })
           .finally(() => {
+            this.isLoad = true;
             this.getCacheFn();
           });
 

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

@@ -1,268 +1,253 @@
 <template>
   <div>
     <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 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="name">工单信息 </div>
 
           <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>
 
         <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>
 
         <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>
       </div>
     </div>
   </div>
 </template>
 
 <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';
-  export default {
-    components: {
-      workOrderBom,
-      paramBom,
-      jobBom
-    },
-    props: {
-      workListIds: {
-        type: Array,
-        default() {
-          return [];
-        }
+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'
+export default {
+  components: {
+    workOrderBom,
+    paramBom,
+    jobBom,
+    deviceBom
+  },
+  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,
 
-        warehouseList: [],
-      };
-    },
+    clientEnvironmentId() {
+      return this.$store.state.user.info.clientEnvironmentId;
+    }
+  },
 
-    computed: {
-      taskObj() {
-        return this.$store.state.user.taskObj;
+  watch: {
+    workListIds: {
+      handler(val) {
+        this.getList(val);
       },
+      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'] = [];
+            }
 
-      clientEnvironmentId() {
-        return this.$store.state.user.info.clientEnvironmentId;
-      }
-    },
-
-    watch: {
-      workListIds: {
-        handler(val) {
-          this.getList(val);
-        },
-        deep: true,
-        immediate: true
-      }
-    },
-
-    created() {
-      this.getWarehouseListFn() 
-    },
+            if (!Object.prototype.hasOwnProperty.call(obj, 'instanceList')) {
+              obj['instanceList'] = [];
+            }
 
-    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, 'palletList')) {
+              obj['palletList'] = [];
+            }
 
-              if (!Object.prototype.hasOwnProperty.call(obj, 'instanceList')) {
-                obj['instanceList'] = [];
-              }
+            if (
+              !Object.prototype.hasOwnProperty.call(obj, 'revolvingDiskList')
+            ) {
+              obj['revolvingDiskList'] = [];
+            }
 
-              if (!Object.prototype.hasOwnProperty.call(obj, 'palletList')) {
-                obj['palletList'] = [];
-              }
+            if (obj.palletList.length > 0) {
+              obj.palletList = obj.palletList.map((m) => {
+                return {
+                  hideKc: true, // 不显示库存
+                  quantity: m.feedQuantity,
+                  ...m
+                };
+              });
+            }
 
-              if (
-                !Object.prototype.hasOwnProperty.call(obj, 'revolvingDiskList')
-              ) {
-                obj['revolvingDiskList'] = [];
-              }
+            if (this.taskObj.type == 6 && this.clientEnvironmentId == 3) {
+              obj.semiProductList = obj.pickOutInList;
+            }
 
-              if (obj.palletList.length > 0) {
-                obj.palletList = obj.palletList.map((m) => {
-                  return {
-                    hideKc: true, // 不显示库存
-                    quantity: m.feedQuantity,
-                    ...m
-                  };
-                });
+            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 (this.taskObj.type == 6 && this.clientEnvironmentId == 3) {
-                obj.semiProductList = obj.pickOutInList;
-              }
+            if (obj.semiProductList.length > 0) {
+              // 预制体报工
+              obj.workReportInfo.formedNum = obj.semiProductList.length;
+            }
 
-              obj.workReportInfo = {
-                formingNum: null,
-                formingWeight: null,
-                formedNum: null,
-                formedWeight: null,
-                taskId: this.taskObj.id
-              };
+            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.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.paramDetailList.map((m) => {
+              if (m.extInfo.textType == 5) {
+                m.remainingTime = m.extInfo.remainingTime;
               }
-
-              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 {
-                ...obj
+                ...m.extInfo
               };
             });
-          })
-          .finally(() => {
-            this.isLoad = true;
 
-            if (this.taskObj.id == 1) {
-              this.getCacheFn();
-            }
+            return {
+              ...obj
+            };
           });
-      },
-      async save(type, index) {},
+        })
+        .finally(() => {
+          this.isLoad = true;
 
-      getCacheFn() {},
+          if (this.taskObj.id == 1) {
+            this.getCacheFn();
+          }
+        });
+    },
+    async save(type, index) { },
 
-      removeCacheFn(type) {},
+    getCacheFn() { },
 
+    removeCacheFn(type) { },
 
-      getWarehouseListFn() {
-        getWarehouseList().then(res => {
- 
-          this.warehouseList = res.data
-        })
-      },
+    getWarehouseListFn() {
+      getWarehouseList().then((res) => {
+        this.warehouseList = res.data;
+      });
     }
-  };
+  }
+};
 </script>
 
 <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>