Bläddra i källkod

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

lucw 9 månader sedan
förälder
incheckning
b8069189db

+ 5 - 0
src/router/routes.js

@@ -32,6 +32,11 @@ export const routes = [
     path: '/printJuren',
     path: '/printJuren',
     component: () => import('@/views/produce/components/juRenPack.vue'),
     component: () => import('@/views/produce/components/juRenPack.vue'),
     meta: { title: '打印条码' }
     meta: { title: '打印条码' }
+  },
+  {
+    path: '/printJuRenOne',
+    component: () => import('@/views/produce/components/juRenPackOne.vue'),
+    meta: { title: '打印条码' }
   }
   }
   // 404
   // 404
   // {
   // {

+ 4 - 1
src/views/produce/components/jobBooking/components/batchSemiProductJobBom.vue

@@ -7,7 +7,10 @@
           class="rx-bc"
           class="rx-bc"
           style="margin-left: 20px"
           style="margin-left: 20px"
           v-if="
           v-if="
-            item.currentTaskDiagram.type == 4 && this.printStyle == 'juRen1'
+            !isDetails &&
+            item.currentTaskDiagram &&
+            item.currentTaskDiagram.type == 4 &&
+            this.printStyle != 'notExist'
           "
           "
           ><el-button type="text" size="mini" @click="pritJuRen()"
           ><el-button type="text" size="mini" @click="pritJuRen()"
             >打印条码</el-button
             >打印条码</el-button

+ 108 - 5
src/views/produce/components/jobBooking/components/oneJobQualityBomPL.vue

@@ -269,7 +269,7 @@
                 filterable
                 filterable
                 v-model="row.extInfo.appearance"
                 v-model="row.extInfo.appearance"
                 placeholder="请选择"
                 placeholder="请选择"
-                style="width: 240px"
+                style="width: 160px"
                 :disabled="isDetails"
                 :disabled="isDetails"
                 @change="qualityChange"
                 @change="qualityChange"
               >
               >
@@ -287,19 +287,62 @@
               </span>
               </span>
               <el-input
               <el-input
                 v-model="row.extInfo.reportWeight"
                 v-model="row.extInfo.reportWeight"
-                style="width: 240px"
+                style="width: 160px"
+                @input="qualityChange"
               ></el-input>
               ></el-input>
 
 
               <span style="display: inline-block; margin-left: 26px">
               <span style="display: inline-block; margin-left: 26px">
-                处置:
+                不合格处置:
               </span>
               </span>
               <el-select
               <el-select
+                size="mini"
+                class="content_num"
+                filterable
+                v-model="row.extInfo.notType"
+                placeholder="请选择"
+                style="width: 160px"
+                :disabled="isDetails || row.extInfo.appearance != 2"
+                @change="qualityChange"
+              >
+                <el-option
+                  v-for="item in notTypeList"
+                  :label="item.name"
+                  :value="item.code"
+                  :key="item.code"
+                >
+                </el-option>
+              </el-select>
+
+              <span style="display: inline-block; margin-left: 26px">
+                处置/原因:
+              </span>
+              <div
+                v-if="
+                  row.extInfo.appearance != 1 &&
+                  row.extInfo.notType &&
+                  row.extInfo.notType != 5 &&
+                  row.extInfo.notType != 8
+                "
+              >
+                <span v-if="isDetails">{{ row.extInfo.notReason }}</span>
+                <el-input
+                  v-else
+                  size="mini"
+                  class="content_num"
+                  v-model="row.extInfo.notReason"
+                  placeholder="原因"
+                />
+              </div>
+              <el-select
+                v-if="
+                  ![1, 2, 3, 4, 6, 9, 7].includes(Number(row.extInfo.notType))
+                "
                 size="mini"
                 size="mini"
                 class="content_num"
                 class="content_num"
                 filterable
                 filterable
                 v-model="row.extInfo.taskId"
                 v-model="row.extInfo.taskId"
                 placeholder="请选择"
                 placeholder="请选择"
-                style="width: 240px"
+                style="width: 160px"
                 @change="(e) => selectName2(e, $index)"
                 @change="(e) => selectName2(e, $index)"
                 :disabled="isDetails"
                 :disabled="isDetails"
               >
               >
@@ -491,6 +534,44 @@
             name: '让步接收',
             name: '让步接收',
             value: 3
             value: 3
           }
           }
+        ],
+        notTypeList: [
+          {
+            code: 1,
+            name: '返工'
+          },
+          {
+            code: 2,
+            name: '返修'
+          },
+          {
+            code: 3,
+            name: '报废'
+          },
+          {
+            code: 4,
+            name: '降级使用'
+          },
+          {
+            code: 5,
+            name: '让步接收'
+          },
+          {
+            code: 6,
+            name: '留样'
+          },
+          {
+            code: 7,
+            name: '消耗'
+          },
+          {
+            code: 8,
+            name: '回用'
+          },
+          {
+            code: 9,
+            name: '转试销'
+          }
         ]
         ]
       };
       };
     },
     },
@@ -516,26 +597,48 @@
         if (this.item.sampleQuality && this.item.sampleQuality.length != 0) {
         if (this.item.sampleQuality && this.item.sampleQuality.length != 0) {
           let formedNum = 0;
           let formedNum = 0;
           let notFormedNum = 0;
           let notFormedNum = 0;
+          let formedWeightCount = 0;
+          let notFormedWeightCount = 0;
           this.item.sampleQuality.forEach((item) => {
           this.item.sampleQuality.forEach((item) => {
             if (item.extInfo.batchReportInfo.length == 0) {
             if (item.extInfo.batchReportInfo.length == 0) {
               const data = item.extInfo;
               const data = item.extInfo;
-              if (data.appearance == 1 || data.appearance == 3) {
+              if (
+                data.appearance == 1 ||
+                data.appearance == 3 ||
+                !data.appearance
+              ) {
                 formedNum++;
                 formedNum++;
+                formedWeightCount += Number(data.reportWeight);
               }
               }
 
 
               if (data.appearance == 2) {
               if (data.appearance == 2) {
                 notFormedNum++;
                 notFormedNum++;
+                notFormedWeightCount += Number(data.reportWeight);
               }
               }
             } else if (item.extInfo.batchReportInfo.length != 0) {
             } else if (item.extInfo.batchReportInfo.length != 0) {
               const data = item.extInfo.batchReportInfo;
               const data = item.extInfo.batchReportInfo;
               data.forEach((it) => {
               data.forEach((it) => {
                 formedNum += Number(it.allFeedQuantity);
                 formedNum += Number(it.allFeedQuantity);
+                formedWeightCount += Number(it.allReportWeight);
               });
               });
             }
             }
           });
           });
 
 
+          console.log(formedWeightCount, '合格品重量');
+          console.log(notFormedWeightCount, '不合格品重量');
+
           this.$set(this.item.workReportInfo, 'formedNum', formedNum);
           this.$set(this.item.workReportInfo, 'formedNum', formedNum);
           this.$set(this.item.workReportInfo, 'notFormedNum', notFormedNum);
           this.$set(this.item.workReportInfo, 'notFormedNum', notFormedNum);
+          this.$set(
+            this.item.workReportInfo,
+            'formedWeight',
+            formedWeightCount
+          );
+          this.$set(
+            this.item.workReportInfo,
+            'notFormedWeight',
+            notFormedWeightCount
+          );
           this.$forceUpdate();
           this.$forceUpdate();
         }
         }
       },
       },

+ 4 - 6
src/views/produce/components/jobBooking/components/semiProductJobBom.vue

@@ -17,7 +17,10 @@
           class="rx-bc"
           class="rx-bc"
           style="margin-left: 20px"
           style="margin-left: 20px"
           v-if="
           v-if="
-            item.currentTaskDiagram.type == 4 && this.printStyle == 'juRen1'
+            !isDetails &&
+            item.currentTaskDiagram &&
+            item.currentTaskDiagram.type == 4 &&
+            this.printStyle == 'juRen1'
           "
           "
           ><el-button type="text" size="mini" @click="pritJuRen()"
           ><el-button type="text" size="mini" @click="pritJuRen()"
             >打印条码</el-button
             >打印条码</el-button
@@ -945,8 +948,6 @@
     created() {
     created() {
       this.getTaskFn();
       this.getTaskFn();
       this.getCodeData();
       this.getCodeData();
-
-      console.log(this.list, 'list1111111111111111111111111');
     },
     },
 
 
     mounted() {
     mounted() {
@@ -957,9 +958,6 @@
       this.clientEnvironmentId =
       this.clientEnvironmentId =
         this.$store.state.user.info.clientEnvironmentId;
         this.$store.state.user.info.clientEnvironmentId;
 
 
-      console.log(this.clientEnvironmentId);
-      console.log(this.item, 'this.itemitemitems');
-
       this.getPrintData();
       this.getPrintData();
       this.getisJuRen();
       this.getisJuRen();
     },
     },

+ 10 - 3
src/views/produce/components/jobBooking/index.vue

@@ -783,6 +783,11 @@
                     this.taskObj.type == 6)
                     this.taskObj.type == 6)
                 ) {
                 ) {
                   obj.semiProductList = obj.pickOutInList;
                   obj.semiProductList = obj.pickOutInList;
+                  obj.semiProductList.forEach((item) => {
+                    if (item.extInfo.taskId == -1) {
+                      item.extInfo.taskId = item.extInfo.taskId + '';
+                    }
+                  });
                   obj.pickOutInList = [];
                   obj.pickOutInList = [];
 
 
                   console.log('赋值了');
                   console.log('赋值了');
@@ -792,6 +797,11 @@
                 ) {
                 ) {
                   if (obj.pickOutInList && obj.pickOutInList.length != 0) {
                   if (obj.pickOutInList && obj.pickOutInList.length != 0) {
                     obj.semiProductList = obj.pickOutInList;
                     obj.semiProductList = obj.pickOutInList;
+                    obj.semiProductList.forEach((item) => {
+                      if (item.extInfo.taskId == -1) {
+                        item.extInfo.taskId = item.extInfo.taskId + '';
+                      }
+                    });
                     obj.pickOutInList = [];
                     obj.pickOutInList = [];
                   }
                   }
                 } else if (this.taskObj.type == 6 && obj.singleReport == 0) {
                 } else if (this.taskObj.type == 6 && obj.singleReport == 0) {
@@ -910,8 +920,6 @@
                     }
                     }
                   }
                   }
                   item.confirm = 0;
                   item.confirm = 0;
-
-                  console.log(item, 'item');
                   return item;
                   return item;
                 });
                 });
 
 
@@ -923,7 +931,6 @@
                   }
                   }
                   item.confirm = 0;
                   item.confirm = 0;
 
 
-                  console.log(item, 'item');
                   return item;
                   return item;
                 });
                 });
 
 

+ 39 - 19
src/views/produce/components/juRenPack.vue

@@ -14,7 +14,7 @@
       </div>
       </div>
 
 
       <div class="label-info-right">
       <div class="label-info-right">
-        <div class="right-box">{{ level ? level : ' ' }}</div>
+        <div class="right-div">{{ level ? level : ' ' }}</div>
         <div class="right-div"
         <div class="right-div"
           >{{ netWeight ? netWeight : ' '
           >{{ netWeight ? netWeight : ' '
           }}{{ weightUnit ? weightUnit : ' ' }}</div
           }}{{ weightUnit ? weightUnit : ' ' }}</div
@@ -33,7 +33,19 @@
   export default {
   export default {
     data() {
     data() {
       return {
       return {
-        productName: ''
+        batchNo: '',
+        createDate: '',
+        enforceStandards: '',
+        layBy: '',
+        level: '',
+        netWeight: '',
+        notice: '',
+        productName: '',
+        purchaseOrigins: '',
+        specification: '',
+        warrantyPeriod: '',
+        warrantyPeriodUnit: '',
+        weightUnit: ''
       };
       };
     },
     },
 
 
@@ -53,19 +65,20 @@
         warrantyPeriodUnit,
         warrantyPeriodUnit,
         weightUnit
         weightUnit
       } = this.$route.query;
       } = this.$route.query;
-      this.productName = productName;
-      this.batchNo = batchNo;
-      this.createDate = createDate;
-      this.enforceStandards = enforceStandards;
-      this.layBy = layBy;
-      this.level = level;
-      this.netWeight = netWeight;
-      this.notice = notice;
-      this.purchaseOrigins = purchaseOrigins;
-      this.specification = specification;
-      this.warrantyPeriod = warrantyPeriod;
-      this.warrantyPeriodUnit = warrantyPeriodUnit;
-      this.weightUnit = weightUnit;
+      this.productName = productName ? productName : '';
+      this.batchNo = batchNo ? batchNo : '';
+      this.createDate = createDate ? createDate : '';
+      this.enforceStandards = enforceStandards ? enforceStandards : '';
+      this.layBy = layBy ? layBy : '';
+      this.level = level ? level : '';
+      this.netWeight = netWeight ? netWeight : '';
+      this.notice = notice ? notice : '';
+      this.purchaseOrigins = purchaseOrigins ? purchaseOrigins : '';
+      this.specification = specification ? specification : '';
+      this.warrantyPeriod =
+        warrantyPeriod && !warrantyPeriod ? warrantyPeriod : '';
+      this.warrantyPeriodUnit = warrantyPeriodUnit ? warrantyPeriodUnit : '';
+      this.weightUnit = weightUnit ? weightUnit : '';
 
 
       if (this.warrantyPeriodUnit === '1') {
       if (this.warrantyPeriodUnit === '1') {
         this.warrantyPeriodUnit = '分钟';
         this.warrantyPeriodUnit = '分钟';
@@ -77,8 +90,14 @@
         this.warrantyPeriodUnit = '月';
         this.warrantyPeriodUnit = '月';
       } else if (this.warrantyPeriodUnit === '5') {
       } else if (this.warrantyPeriodUnit === '5') {
         this.warrantyPeriodUnit = '年';
         this.warrantyPeriodUnit = '年';
+      } else {
+        this.warrantyPeriodUnit = '';
       }
       }
 
 
+      this.$nextTick(() => {
+        window.print();
+      });
+
       // const { id, name, price } = this.$route.query;
       // const { id, name, price } = this.$route.query;
       // this.order = { id, name, price };
       // this.order = { id, name, price };
 
 
@@ -133,13 +152,14 @@
     // flex: 1;
     // flex: 1;
     flex-direction: column;
     flex-direction: column;
     justify-content: center;
     justify-content: center;
+    margin: 37px 0 1px 30px;
 
 
-    .right-box {
-      margin: 34px 0 1px 18px;
-    }
+    // .right-box {
+    //   // margin: 34px 0 1px 18px
+    // }
 
 
     .right-div {
     .right-div {
-      margin: 0 0 1px 18px;
+      // margin: 0 0 1px 18px;
       height: 17px;
       height: 17px;
     }
     }
   }
   }

+ 191 - 0
src/views/produce/components/juRenPackOne.vue

@@ -0,0 +1,191 @@
+<template>
+  <div class="label-container">
+    <div class="ju_ren_one_level">
+      <span>{{ productName ? productName : ' ' }}</span>
+      <span class="ju_ren_one_level_two">{{ '' }}</span>
+    </div>
+
+    <div class="ju_ren_two_level">
+      <span>{{ purchaseOrigins ? purchaseOrigins : ' ' }}</span>
+    </div>
+
+    <div class="ju_ren_two_level">
+      <span>{{ specification ? specification : ' ' }}</span>
+      <span class="ju_ren_one_level_two"
+        >{{ netWeight ? netWeight : ' '
+        }}{{ weightUnit ? weightUnit : ' ' }}</span
+      >
+    </div>
+
+    <div class="ju_ren_Three_level">
+      <span>{{ level ? level : ' ' }}</span>
+    </div>
+
+    <div class="ju_ren_four_level">
+      <span>{{ batchNo ? batchNo : ' ' }}</span>
+      <span class="ju_ren_two_level_two">{{
+        createDate ? createDate : ' '
+      }}</span>
+      <span class="ju_ren_two_level_two"
+        >{{ warrantyPeriod ? warrantyPeriod : ' '
+        }}{{ warrantyPeriodUnit ? warrantyPeriodUnit : ' ' }}</span
+      >
+    </div>
+
+    <div class="ju_ren_four_level">
+      <span>{{ notice ? notice : ' ' }}</span>
+    </div>
+
+    <div class="ju_ren_four_level">
+      <span>{{ layBy ? layBy : ' ' }}</span>
+    </div>
+
+    <div class="ju_ren_four_level">
+      <span>{{ enforceStandards ? enforceStandards : ' ' }}</span>
+    </div>
+  </div>
+</template>
+
+<script>
+  export default {
+    data() {
+      return {
+        batchNo: '',
+        createDate: '',
+        enforceStandards: '',
+        layBy: '',
+        level: '',
+        netWeight: '',
+        notice: '',
+        productName: '',
+        purchaseOrigins: '',
+        specification: '',
+        warrantyPeriod: '',
+        warrantyPeriodUnit: '',
+        weightUnit: ''
+      };
+    },
+    mounted() {
+      const {
+        batchNo,
+        createDate,
+        enforceStandards,
+        layBy,
+        level,
+        netWeight,
+        notice,
+        productName,
+        purchaseOrigins,
+        specification,
+        warrantyPeriod,
+        warrantyPeriodUnit,
+        weightUnit
+      } = this.$route.query;
+      this.productName = productName ? productName : '';
+      this.batchNo = batchNo ? batchNo : '';
+      this.createDate = createDate ? createDate : '';
+      this.enforceStandards = enforceStandards ? enforceStandards : '';
+      this.layBy = layBy ? layBy : '';
+      this.level = level ? level : '';
+      this.netWeight = netWeight ? netWeight : '';
+      this.notice = notice ? notice : '';
+      this.purchaseOrigins = purchaseOrigins ? purchaseOrigins : '';
+      this.specification = specification ? specification : '';
+      this.warrantyPeriod =
+        warrantyPeriod && !warrantyPeriod ? warrantyPeriod : '';
+      this.warrantyPeriodUnit = warrantyPeriodUnit ? warrantyPeriodUnit : '';
+      this.weightUnit = weightUnit ? weightUnit : '';
+
+      if (this.warrantyPeriodUnit === '1') {
+        this.warrantyPeriodUnit = '分钟';
+      } else if (this.warrantyPeriodUnit === '2') {
+        this.warrantyPeriodUnit = '小时';
+      } else if (this.warrantyPeriodUnit === '3') {
+        this.warrantyPeriodUnit = '日';
+      } else if (this.warrantyPeriodUnit === '4') {
+        this.warrantyPeriodUnit = '月';
+      } else if (this.warrantyPeriodUnit === '5') {
+        this.warrantyPeriodUnit = '年';
+      } else {
+        this.warrantyPeriodUnit = '';
+      }
+
+      this.$nextTick(() => {
+        window.print();
+      });
+    }
+  };
+</script>
+
+<style scoped lang="scss">
+  .label-container {
+    width: 90mm;
+    height: 70mm;
+    box-sizing: border-box;
+    font-size: 12px;
+    color: green;
+    margin: 0 auto;
+    // line-height: 1.8;
+    // font-family: "SimSun", "宋体", sans-serif;
+
+    .ju_ren_one_level {
+      display: flex;
+      margin: 63px 0 0 64px;
+      flex-direction: row;
+
+      span {
+        display: inline-block;
+        width: 70px;
+        height: 19px;
+      }
+
+      .ju_ren_one_level_two {
+        margin-left: 35px;
+      }
+    }
+
+    .ju_ren_two_level {
+      margin-left: 64px;
+
+      span {
+        display: inline-block;
+        width: 70px;
+        height: 19px;
+      }
+
+      .ju_ren_one_level_two {
+        margin-left: 35px;
+      }
+
+      .ju_ren_two_level_two {
+        margin-left: 100px;
+      }
+    }
+
+    .ju_ren_Three_level {
+      margin: 2px 0 0 110px;
+
+      span {
+        display: inline-block;
+        height: 19px;
+      }
+    }
+    .ju_ren_four_level {
+      margin: 3px 0 0 64px;
+
+      span {
+        display: inline-block;
+        width: 60px;
+        height: 19px;
+      }
+
+      .ju_ren_one_level_two {
+        margin-left: 42px;
+      }
+
+      .ju_ren_two_level_two {
+        margin-left: 42px;
+      }
+    }
+  }
+</style>

+ 6 - 1
src/views/produceWord/index.vue

@@ -186,7 +186,12 @@ r++<template>
             align: 'center',
             align: 'center',
             showOverflowTooltip: true
             showOverflowTooltip: true
           },
           },
-
+          {
+            prop: 'specification',
+            label: '规格',
+            align: 'center',
+            showOverflowTooltip: true
+          },
           {
           {
             prop: 'priority',
             prop: 'priority',
             label: '优先级',
             label: '优先级',