Ver Fonte

工单打印

quwangxin há 2 anos atrás
pai
commit
ce2baac08e

+ 295 - 254
src/components/print/OrderPrint.vue

@@ -1,5 +1,5 @@
 <template>
-  <ele-modal :visible.sync="visible" type="工单打印" width="80vw">
+  <ele-modal :visible.sync="visible" type="工单打印" width="1200px">
     <div class="print-container" ref="pagesRef">
       <el-row class="main-data mb-16">
         <el-col :span="6">
@@ -26,8 +26,8 @@
           <div class="value">{{ infoData.formingNum }}PCS</div>
         </el-col>
         <el-col :span="4">
-          <!-- <div class="bg">要求成型日期</div>
-          <div class="value">2023/08/20</div> -->
+          <div class="bg">工单状态</div>
+          <div class="value">{{ statusList[infoData.status] }}</div>
           <div class="bg">要求成型重量</div>
           <div class="value">{{ infoData.formingWeight }}KG</div>
         </el-col>
@@ -39,14 +39,14 @@
           :key="index"
           v-if="item.taskTypeName === '挤压成型'"
         >
-          <el-col :span="14" class="bg top"
+          <el-col :span="24" class="bg top"
             ><div class="title">{{ index + 1 }}0 挤压成型</div></el-col
           >
-          <el-col :span="10" class="bg top">备注:</el-col>
+          <!-- <el-col :span="10" class="bg top">备注:</el-col> -->
           <template v-for="(itm, idx) in item.list || []">
             <el-col
               :span="t.span"
-              :class="t.class"
+              class="border-dashed-right border-dashed-bottom"
               v-for="(t, i) in extrusion"
               :key="i + '-' + idx"
             >
@@ -65,14 +65,14 @@
           :key="index"
           v-else-if="item.taskTypeName === '自然干燥'"
         >
-          <el-col :span="14" class="bg top"
+          <el-col :span="24" class="bg top"
             ><div class="title">{{ index + 1 }}0 自然干燥</div></el-col
           >
-          <el-col :span="10" class="bg top">备注:</el-col>
+          <!-- <el-col :span="10" class="bg top">备注:</el-col> -->
           <template v-for="(itm, idx) in item.list || []">
             <el-col
               :span="t.span"
-              :class="t.class"
+              class="border-dashed-right border-dashed-bottom"
               v-for="(t, i) in drying"
               :key="i + '-' + idx"
             >
@@ -90,15 +90,15 @@
           :key="index"
           v-else-if="item.taskTypeName === '升温干燥'"
         >
-          <el-col :span="14" class="bg top"
+          <el-col :span="24" class="bg top"
             ><div class="title">{{ index + 1 }}0 升温干燥</div></el-col
           >
-          <el-col :span="10" class="bg top">备注:</el-col>
+          <!-- <el-col :span="10" class="bg top">备注:</el-col> -->
 
           <template v-for="(itm, idx) in item.list || []">
             <el-col
               :span="t.span"
-              :class="t.class"
+              class="border-dashed-right border-dashed-bottom"
               v-for="(t, i) in temperature"
               :key="i + '-' + idx"
             >
@@ -116,14 +116,14 @@
           :key="index"
           v-else-if="item.taskTypeName.includes('定长')"
         >
-          <el-col :span="14" class="bg top"
+          <el-col :span="24" class="bg top"
             ><div class="title">{{ index + 1 }}0 半加定长</div></el-col
           >
-          <el-col :span="10" class="bg top">备注:</el-col>
+          <!-- <el-col :span="10" class="bg top">备注:</el-col> -->
           <template v-for="(itm, idx) in item.list || []">
             <el-col
               :span="t.span"
-              :class="t.class"
+              class="border-dashed-right border-dashed-bottom"
               v-for="(t, i) in halflong"
               :key="i + '-' + idx"
             >
@@ -141,14 +141,14 @@
           :key="index"
           v-else-if="item.taskTypeName === '备炉'"
         >
-          <el-col :span="14" class="bg top"
+          <el-col :span="24" class="bg top"
             ><div class="title">{{ index + 1 }}0 备炉</div></el-col
           >
-          <el-col :span="10" class="bg top">备注:</el-col>
+          <!-- <el-col :span="10" class="bg top">备注:</el-col> -->
           <template v-for="(itm, idx) in item.list || []">
             <el-col
               :span="t.span"
-              :class="t.class"
+              class="border-dashed-right border-dashed-bottom"
               v-for="(t, i) in furnace"
               :key="i + '-' + idx"
             >
@@ -166,14 +166,14 @@
           :key="index"
           v-else-if="item.taskTypeName === '烧结'"
         >
-          <el-col :span="14" class="bg top"
+          <el-col :span="24" class="bg top"
             ><div class="title">{{ index + 1 }}0 烧结</div></el-col
           >
-          <el-col :span="10" class="bg top">备注:</el-col>
+          <!-- <el-col :span="10" class="bg top">备注:</el-col> -->
           <template v-for="(itm, idx) in item.list || []">
             <el-col
               :span="t.span"
-              :class="t.class"
+              class="border-dashed-right border-dashed-bottom"
               v-for="(t, i) in sinter"
               :key="i + '-' + idx"
             >
@@ -191,14 +191,14 @@
           :key="index"
           v-else-if="item.taskTypeName === '质检'"
         >
-          <el-col :span="14" class="bg top"
+          <el-col :span="24" class="bg top"
             ><div class="title">{{ index + 1 }}0 质检</div></el-col
           >
-          <el-col :span="10" class="bg top">备注:</el-col>
+          <!-- <el-col :span="10" class="bg top">备注:</el-col> -->
           <template v-for="(itm, idx) in item.list || []">
             <el-col
               :span="t.span"
-              :class="t.class"
+              class="border-dashed-right border-dashed-bottom"
               v-for="(t, i) in quality"
               :key="i + '-' + idx"
             >
@@ -216,14 +216,14 @@
           :key="index"
           v-else-if="item.taskTypeName === '包装'"
         >
-          <el-col :span="14" class="bg top"
+          <el-col :span="24" class="bg top"
             ><div class="title">{{ index + 1 }}0 包装</div></el-col
           >
-          <el-col :span="10" class="bg top">备注:</el-col>
+          <!-- <el-col :span="10" class="bg top">备注:</el-col> -->
           <template v-for="(itm, idx) in item.list || []">
             <el-col
               :span="t.span"
-              :class="t.class"
+              class="border-dashed-right border-dashed-bottom"
               v-for="(t, i) in packageOpt"
               :key="i + '-' + idx"
             >
@@ -231,6 +231,30 @@
                 (item.formatter && item.formatter(itm)) || itm[t.key]
               }}
             </el-col>
+            <el-col
+              v-for="material in itm.workReportCategoryList.filter(
+                (i) => i.rootCategoryLevelId == 10
+              )"
+              :span="24"
+              style="padding-left: 0"
+              :key="material.code"
+            >
+              <el-col :span="8" class="border-dashed-right border-dashed-bottom"
+                >物料名称:{{ material.name }}
+              </el-col>
+              <el-col :span="4" class="border-dashed-right border-dashed-bottom"
+                >物料编号:{{ material.code }}
+              </el-col>
+              <el-col :span="4" class="border-dashed-right border-dashed-bottom"
+                >数量:{{ material.number }}
+              </el-col>
+              <el-col :span="4" class="border-dashed-right border-dashed-bottom"
+                >批次号:{{ material.batchNo }}
+              </el-col>
+              <el-col :span="4" class="border-dashed-right border-dashed-bottom"
+                >数量:{{ material.number }}
+              </el-col>
+            </el-col>
           </template>
           <el-col :span="24" v-if="!(item.list && item.list.length)">
             <div class="no-data">暂无数据</div>
@@ -241,14 +265,14 @@
           class="processes-data"
           v-else-if="item.taskTypeName.includes('库')"
         >
-          <el-col :span="14" class="bg top"
+          <el-col :span="24" class="bg top"
             ><div class="title">{{ index + 1 }}0 预缴库</div></el-col
           >
-          <el-col :span="10" class="bg top">备注:</el-col>
+          <!-- <el-col :span="10" class="bg top">备注:</el-col> -->
           <template v-for="(itm, idx) in item.list || []">
             <el-col
               :span="t.span"
-              :class="t.class"
+              class="border-dashed-right border-dashed-bottom"
               v-for="(t, i) in preStorage"
               :key="i + '-' + idx"
             >
@@ -262,7 +286,7 @@
           </el-col>
         </el-row>
         <el-row class="processes-data" :key="index" v-else>
-          <el-col :span="14" class="bg top"
+          <el-col :span="24" class="bg top"
             ><div class="title"
               >{{ index + 1 }}0
               {{
@@ -272,11 +296,11 @@
               }}</div
             ></el-col
           >
-          <el-col :span="10" class="bg top">备注:</el-col>
+          <!-- <el-col :span="10" class="bg top">备注:</el-col> -->
           <template v-for="(itm, idx) in item.list || []">
             <el-col
               :span="t.span"
-              :class="t.class"
+              class="border-dashed-right border-dashed-bottom"
               v-for="(t, i) in deepProcesse"
               :key="i + '-' + idx"
             >
@@ -324,6 +348,12 @@
           2: '外销订单',
           3: '预制订单'
         },
+        statusList: {
+          4: '待生产',
+          5: '生产中',
+          6: '已完成',
+          7: '已延期'
+        },
         // 挤压成型
         extrusion: [
           {
@@ -425,7 +455,7 @@
             label: '冲压次数',
             key: 'stampingTimes',
             span: 4,
-            class: 'border-dashed-right',
+            class: 'border-dashed-right border-dashed-bottom',
             formatter (itm) {
               const obj = itm.workReportDeviceList.find(
                 (i) => i.rootCategoryLevelId == 5
@@ -437,19 +467,19 @@
             label: '员工号',
             key: 'executorJobNum',
             span: 4,
-            class: 'border-dashed-right'
+            class: 'border-dashed-right border-dashed-bottom'
           },
           {
             label: '日期',
             key: 'executeTime',
             span: 4,
-            class: 'border-dashed-right'
+            class: 'border-dashed-right border-dashed-bottom'
           },
           {
             label: '备注',
             key: 'remark',
-            span: 4,
-            class: 'border-dashed-right'
+            span: 12,
+            class: 'border-dashed-right border-dashed-bottom'
           }
           // {
           //   label: '清缸时长',
@@ -533,14 +563,20 @@
             label: '升温曲线',
             key: 'temperatureRamp',
             span: 8,
-            class: 'border-dashed-right border-dashed-bottom'
-          },
-          {
-            label: '干燥时长(分钟)',
-            key: 'xxx',
-            span: 4,
-            class: 'border-dashed-right border-dashed-bottom'
+            class: 'border-dashed-right border-dashed-bottom',
+            formatter (itm) {
+              const obj = itm.workReportDeviceList.find(
+                (i) => i.rootCategoryLevelId == 4
+              );
+              return obj?.extraField?.temperatureRamp;
+            }
           },
+          // {
+          //   label: '干燥时长(分钟)',
+          //   key: 'xxx',
+          //   span: 4,
+          //   class: 'border-dashed-right border-dashed-bottom'
+          // },
           {
             label: '合格数',
             key: 'standardNum',
@@ -573,10 +609,16 @@
           },
 
           {
-            label: '周转车编码',
+            label: '舟皿编码',
             key: 'xxx',
             span: 8,
-            class: 'border-dashed-right'
+            class: 'border-dashed-right',
+            formatter (itm) {
+              const obj = itm.workReportDeviceList.find(
+                (i) => i.rootCategoryLevelId == 8
+              );
+              return obj?.code;
+            }
           },
           {
             label: '员工号',
@@ -599,12 +641,12 @@
         ],
         // 半加定长
         halflong: [
-          {
-            label: '长度(mm)',
-            key: 'xxx',
-            span: 8,
-            class: 'border-dashed-right border-dashed-bottom'
-          },
+          // {
+          //   label: '长度(mm)',
+          //   key: 'xxx',
+          //   span: 8,
+          //   class: 'border-dashed-right border-dashed-bottom'
+          // },
           {
             label: '合格数',
             key: 'standardNum',
@@ -685,7 +727,13 @@
             label: '产品数量',
             key: 'xxx',
             span: 8,
-            class: 'border-dashed-right'
+            class: 'border-dashed-right',
+            formatter (itm) {
+              const obj = itm.workReportCategoryList.find(
+                (i) => i.rootCategoryLevelId == 9
+              );
+              return obj?.number;
+            }
           },
           {
             label: '设备号',
@@ -720,12 +768,12 @@
         ],
         // 烧结
         sinter: [
-          {
-            label: '烧结曲线',
-            key: 'sinteringCurve',
-            span: 4,
-            class: 'border-dashed-right border-dashed-bottom'
-          },
+          // {
+          //   label: '烧结曲线',
+          //   key: 'sinteringCurve',
+          //   span: 4,
+          //   class: 'border-dashed-right border-dashed-bottom'
+          // },
           {
             label: '合格数',
             key: 'standardNum',
@@ -739,7 +787,7 @@
             label: '不合格数',
             key: 'noStandardNum',
             span: 4,
-            class: 'border-dashed-bottom',
+            class: 'border-dashed-bottom border-dashed-right',
             formatter (itm) {
               return itm.productInfo?.noStandardNum;
             }
@@ -747,7 +795,7 @@
           {
             label: '设备号',
             key: 'deviceCode',
-            span: 8,
+            span: 4,
             class: 'border-dashed-right border-dashed-bottom',
             formatter (itm) {
               const obj = itm.workReportDeviceList.find(
@@ -760,149 +808,8 @@
             label: '员工号',
             key: 'executorJobNum',
             span: 4,
-            class: 'border-dashed-right'
-          },
-          {
-            label: '日期',
-            key: 'executeTime',
-            span: 4,
-            class: 'border-dashed-right'
-          },
-          {
-            label: '备注',
-            key: 'remark',
-            span: 4,
-            class: 'border-dashed-right'
-          }
-        ],
-        // 质检
-        quality: [
-          {
-            label: '半检结果',
-            key: 'xxx',
-            span: 12,
-            class: 'border-dashed-right border-dashed-bottom'
-          },
-          {
-            label: '员工号',
-            key: 'executorJobNum',
-            span: 4,
-            class: 'border-dashed-right'
-          },
-          {
-            label: '日期',
-            key: 'executeTime',
-            span: 4,
-            class: 'border-dashed-right'
-          },
-          {
-            label: '成检结果',
-            key: 'xxx',
-            span: 12,
-            class: 'border-dashed-right border-dashed-bottom'
-          },
-          {
-            label: '员工号',
-            key: 'executorJobNum',
-            span: 4,
-            class: 'border-dashed-right'
-          },
-          {
-            label: '日期',
-            key: 'executeTime',
-            span: 4,
-            class: 'border-dashed-right'
-          },
-          {
-            label: '外径',
-            key: 'xxx',
-            span: 4,
-            class: 'border-dashed-right border-dashed-bottom'
-          },
-          {
-            label: '长度',
-            key: 'xxx',
-            span: 4,
-            class: 'border-dashed-right border-dashed-bottom'
-          },
-          {
-            label: '垂直度',
-            key: 'xxx',
-            span: 4,
-            class: 'border-dashed-right border-dashed-bottom'
-          },
-          {
-            label: '圆度',
-            key: 'xxx',
-            span: 4,
-            class: 'border-dashed-right border-dashed-bottom'
-          },
-          {
-            label: '跳动',
-            key: 'xxx',
-            span: 4,
-            class: 'border-dashed-bottom'
-          },
-          {
-            label: '抗拆/损伤',
-            key: 'xxx',
-            span: 4,
-            class: 'border-dashed-right border-dashed-bottom'
-          },
-          {
-            label: '直线度',
-            key: 'xxx',
-            span: 4,
-            class: 'border-dashed-right border-dashed-bottom'
-          },
-          {
-            label: '粗糙度',
-            key: 'xxx',
-            span: 4,
-            class: 'border-dashed-right border-dashed-bottom'
-          },
-          {
-            label: '其它',
-            key: 'xxx',
-            span: 4,
-            class: ' border-dashed-bottom border-dashed-right '
-          },
-          {
-            label: '合格数',
-            key: 'standardNum',
-            span: 4,
             class: 'border-dashed-right border-dashed-bottom'
           },
-          {
-            label: '合格数',
-            key: 'noStandardNum',
-            span: 4,
-            class: 'border-dashed-right border-dashed-bottom'
-          },
-          {
-            label: '待处理',
-            key: 'xxx',
-            span: 4,
-            class: 'border-dashed-right border-dashed-bottom'
-          },
-          {
-            label: '让步',
-            key: 'xxx',
-            span: 4,
-            class: 'border-dashed-right border-dashed-bottom'
-          },
-          {
-            label: '可修',
-            key: 'xxx',
-            span: 4,
-            class: 'border-dashed-bottom'
-          },
-          {
-            label: '员工号',
-            key: 'executorJobNum',
-            span: 4,
-            class: 'border-dashed-right'
-          },
           {
             label: '日期',
             key: 'executeTime',
@@ -916,6 +823,147 @@
             class: 'border-dashed-right'
           }
         ],
+        // 质检
+        // quality: [
+        //   {
+        //     label: '半检结果',
+        //     key: 'xxx',
+        //     span: 12,
+        //     class: 'border-dashed-right border-dashed-bottom'
+        //   },
+        //   {
+        //     label: '员工号',
+        //     key: 'executorJobNum',
+        //     span: 4,
+        //     class: 'border-dashed-right'
+        //   },
+        //   {
+        //     label: '日期',
+        //     key: 'executeTime',
+        //     span: 4,
+        //     class: 'border-dashed-right'
+        //   },
+        //   {
+        //     label: '成检结果',
+        //     key: 'xxx',
+        //     span: 12,
+        //     class: 'border-dashed-right border-dashed-bottom'
+        //   },
+        //   {
+        //     label: '员工号',
+        //     key: 'executorJobNum',
+        //     span: 4,
+        //     class: 'border-dashed-right'
+        //   },
+        //   {
+        //     label: '日期',
+        //     key: 'executeTime',
+        //     span: 4,
+        //     class: 'border-dashed-right'
+        //   },
+        //   {
+        //     label: '外径',
+        //     key: 'xxx',
+        //     span: 4,
+        //     class: 'border-dashed-right border-dashed-bottom'
+        //   },
+        //   {
+        //     label: '长度',
+        //     key: 'xxx',
+        //     span: 4,
+        //     class: 'border-dashed-right border-dashed-bottom'
+        //   },
+        //   {
+        //     label: '垂直度',
+        //     key: 'xxx',
+        //     span: 4,
+        //     class: 'border-dashed-right border-dashed-bottom'
+        //   },
+        //   {
+        //     label: '圆度',
+        //     key: 'xxx',
+        //     span: 4,
+        //     class: 'border-dashed-right border-dashed-bottom'
+        //   },
+        //   {
+        //     label: '跳动',
+        //     key: 'xxx',
+        //     span: 4,
+        //     class: 'border-dashed-bottom'
+        //   },
+        //   {
+        //     label: '抗拆/损伤',
+        //     key: 'xxx',
+        //     span: 4,
+        //     class: 'border-dashed-right border-dashed-bottom'
+        //   },
+        //   {
+        //     label: '直线度',
+        //     key: 'xxx',
+        //     span: 4,
+        //     class: 'border-dashed-right border-dashed-bottom'
+        //   },
+        //   {
+        //     label: '粗糙度',
+        //     key: 'xxx',
+        //     span: 4,
+        //     class: 'border-dashed-right border-dashed-bottom'
+        //   },
+        //   {
+        //     label: '其它',
+        //     key: 'xxx',
+        //     span: 4,
+        //     class: ' border-dashed-bottom border-dashed-right '
+        //   },
+        //   {
+        //     label: '合格数',
+        //     key: 'standardNum',
+        //     span: 4,
+        //     class: 'border-dashed-right border-dashed-bottom'
+        //   },
+        //   {
+        //     label: '合格数',
+        //     key: 'noStandardNum',
+        //     span: 4,
+        //     class: 'border-dashed-right border-dashed-bottom'
+        //   },
+        //   {
+        //     label: '待处理',
+        //     key: 'xxx',
+        //     span: 4,
+        //     class: 'border-dashed-right border-dashed-bottom'
+        //   },
+        //   {
+        //     label: '让步',
+        //     key: 'xxx',
+        //     span: 4,
+        //     class: 'border-dashed-right border-dashed-bottom'
+        //   },
+        //   {
+        //     label: '可修',
+        //     key: 'xxx',
+        //     span: 4,
+        //     class: 'border-dashed-bottom'
+        //   },
+        //   {
+        //     label: '员工号',
+        //     key: 'executorJobNum',
+        //     span: 4,
+        //     class: 'border-dashed-right'
+        //   },
+        //   {
+        //     label: '日期',
+        //     key: 'executeTime',
+        //     span: 4,
+        //     class: 'border-dashed-right'
+        //   },
+        //   {
+        //     label: '备注',
+        //     key: 'remark',
+        //     span: 4,
+        //     class: 'border-dashed-right'
+        //   }
+        // ],
         // 深加工
         deepProcesse: [
           {
@@ -972,80 +1020,65 @@
           {
             label: '包装要求',
             key: 'xxx',
-            span: 24,
-            class: 'border-dashed-right border-dashed-bottom'
+            span: 4,
+            class: 'border-dashed-right border-dashed-bottom',
+            formatter (itm) {
+              return itm?.packInfo?.packDemand;
+            }
           },
           {
             label: '包装单位',
             key: 'xxx',
             span: 4,
-            class: 'border-dashed-right border-dashed-bottom'
+            class: 'border-dashed-right border-dashed-bottom',
+            formatter (itm) {
+              return itm?.packInfo?.packUnit;
+            }
           },
           {
             label: '包装数量',
             key: 'xxx',
             span: 4,
-            class: 'border-dashed-right border-dashed-bottom'
+            class: 'border-dashed-right border-dashed-bottom',
+            formatter (itm) {
+              return itm?.packInfo?.packNum;
+            }
           },
           {
             label: '最小包装单元',
             key: 'xxx',
             span: 4,
-            class: 'border-dashed-right border-dashed-bottom'
+            class: 'border-dashed-right border-dashed-bottom',
+            formatter (itm) {
+              return `PCS/${itm.packInfo.packUnit}`;
+            }
           },
           {
             label: '净重',
             key: 'xxx',
             span: 4,
-            class: 'border-dashed-right border-dashed-bottom'
+            class: 'border-dashed-right border-dashed-bottom',
+            formatter (itm) {
+              return itm?.packInfo?.netWeight;
+            }
           },
           {
             label: '毛重',
             key: 'xxx',
             span: 4,
-            class: ' border-dashed-bottom'
-          },
-          {
-            label: '物料编码',
-            key: 'xxx',
-            span: 4,
-            class: 'border-dashed-right border-dashed-bottom'
-          },
-          {
-            label: '物料名称',
-            key: 'xxx',
-            span: 4,
-            class: 'border-dashed-right border-dashed-bottom'
-          },
-          {
-            label: '物料数量',
-            key: 'xxx',
-            span: 4,
-            class: 'border-dashed-right border-dashed-bottom'
+            class: ' border-dashed-bottom',
+            formatter (itm) {
+              return itm?.packInfo?.roughWeight;
+            }
           },
           {
             label: '尾料',
             key: 'xxx',
-            span: 8,
-            class: 'border-dashed-right border-dashed-bottom'
-          },
-          {
-            label: '物料编码',
-            key: 'xxx',
-            span: 4,
-            class: 'border-dashed-right border-dashed-bottom'
-          },
-          {
-            label: '物料名称',
-            key: 'xxx',
             span: 4,
-            class: 'border-dashed-right border-dashed-bottom'
-          },
-          {
-            label: '物料数量',
-            key: 'xxx',
-            span: 4,
-            class: 'border-dashed-right border-dashed-bottom'
+            class: 'border-dashed-right border-dashed-bottom',
+            formatter (itm) {
+              return itm?.packInfo?.surplusNum;
+            }
           },
           {
             label: '员工号',
@@ -1062,7 +1095,7 @@
           {
             label: '备注',
             key: 'remark',
-            span: 4,
+            span: 12,
             class: 'border-dashed-right'
           }
         ],
@@ -1072,7 +1105,13 @@
             label: '产品数量',
             key: 'xxx',
             span: 4,
-            class: 'border-dashed-right border-dashed-bottom'
+            class: 'border-dashed-right border-dashed-bottom',
+            formatter (itm) {
+              const obj = itm.workReportDeviceList.find(
+                (i) => i.rootCategoryLevelId == 9
+              );
+              return obj?.number;
+            }
           },
           {
             label: '员工号',
@@ -1089,7 +1128,7 @@
           {
             label: '备注',
             key: 'remark',
-            span: 4,
+            span: 12,
             class: 'border-dashed-right'
           }
         ]
@@ -1102,12 +1141,14 @@
         this.init();
       },
       init () {
+        for (const p of this.processList) {
+          this.$set(p, 'list', []);
+        }
         printWorkOrderInfo(this.workOrderId).then((res) => {
           for (const t of res.taskInfo) {
             for (const p of this.processList) {
-              if (!p.list) {
-                this.$set(p, 'list', t || []);
-              } else if (t.taskName === p.taskTypeName) {
+              if (t.taskName === p.taskTypeName) {
+                console.log(t.taskName, p.taskTypeName);
                 p.list.push(t);
               }
             }
@@ -1172,7 +1213,7 @@
     border-top: $border;
     border-left: $border;
     border-right: $border;
-    font-size: 20px;
+    font-size: 14px;
   }
 
   .processes-data {

+ 34 - 1
src/utils/pdf.js

@@ -25,10 +25,14 @@ export const downloadPDF = (page, fileName = '工单') => {
       var imgWidth = a4Width - margin * 2;
       var imgHeight = (imgWidth / contentWidth) * contentHeight;
 
+      console.log(imgHeight, 'imgHeight');
+
       var pageData = canvas.toDataURL('image/jpeg', 1.0);
 
       var pdf = new jsPDF('', 'pt', 'a4');
 
+      console.log(canvasSplit(canvas, imgWidth, a4Height - 20));
+
       //有两个高度需要区分,一个是html页面的实际高度,和生成pdf的页面高度(841.89)
       //当内容未超过pdf一页显示的范围,无需分页
       if (leftHeight < pageHeight) {
@@ -36,8 +40,9 @@ export const downloadPDF = (page, fileName = '工单') => {
       } else {
         while (leftHeight > 0) {
           pdf.addImage(pageData, 'JPEG', margin, position, imgWidth, imgHeight);
+          console.log(leftHeight, pageHeight, position);
           leftHeight -= pageHeight;
-          position -= a4Height;
+          position -= pageHeight;
           //避免添加空白页
           if (leftHeight > 0) {
             pdf.addPage();
@@ -54,3 +59,31 @@ export const downloadPDF = (page, fileName = '工单') => {
     });
   });
 };
+
+function canvasSplit (canvas, width, height) {
+  const pageList = [];
+  const contentHeight = canvas.height;
+
+  let leftHeight = (width / canvas.width) * contentHeight;
+
+  console.log('leftHeight', leftHeight);
+  const can = document.createElement('canvas');
+
+  can.width = width;
+  can.height = height;
+
+  const ctx = can.getContext('2d');
+
+  const imgHeight = (canvas.width / width) * height;
+
+  while (leftHeight > 0) {
+    ctx.drawImage(canvas, 0, 0, canvas.width, imgHeight, 0, 0, width, height);
+    pageList.push(canvas.toDataURL('image/jpeg', 1.0));
+    ctx.clearRect(0, 0, 0, 0);
+    leftHeight -= imgHeight;
+
+    console.log('leftHeight', leftHeight, imgHeight);
+  }
+
+  return pageList;
+}

+ 31 - 24
src/views/produceOrder/components/report/HalfAdded.vue

@@ -49,7 +49,7 @@
             type="datetime"
             format="yyyy-MM-dd HH:mm:ss"
             placeholder="请选择"
-			:disabled="formData.dateType==2"
+            :disabled="formData.dateType == 2"
           ></el-date-picker
         ></el-form-item>
       </div>
@@ -105,7 +105,7 @@
         <el-descriptions-item label="舟皿数量" :span="3"
           ><el-input
             placeholder="请输入"
-            v-model="boatMsg.extraField.num"
+            v-model="boatMsg.extraField.boatNum"
           ></el-input
         ></el-descriptions-item>
         <el-descriptions-item label="质检项" :span="2">
@@ -254,18 +254,18 @@
         type: Object,
         default: () => ({})
       },
-	  formData: {
-	    type: Object,
-	    default: () => ({})
-	  },
-		firstInfo:{
-		  type: Object,
-		  default: () => ({})
-		},
-		currentInfo:{
-			type: Object,
-			default: () => ({}) 
-		}
+      formData: {
+        type: Object,
+        default: () => ({})
+      },
+      firstInfo: {
+        type: Object,
+        default: () => ({})
+      },
+      currentInfo: {
+        type: Object,
+        default: () => ({})
+      }
     },
     data () {
       return {
@@ -312,7 +312,7 @@
           rootCategoryLevelId: '',
           specification: '',
           extraField: {
-            num: ''
+            boatNum: ''
           }
         }
       };
@@ -329,7 +329,10 @@
       infoData: {
         immediate: true,
         handler () {
-          if (this.infoData.id && this.currentInfo.code == this.firstInfo.code) {
+          if (
+            this.infoData.id &&
+            this.currentInfo.code == this.firstInfo.code
+          ) {
             // 设备
             this.workReportDeviceList = Object.assign(
               {},
@@ -347,14 +350,18 @@
           }
         }
       },
-		formData: {
-		  immediate: true,
-		  handler () {
-			if (this.formData.dateType==2) {
-			  this.$set(this.workReport,'executeTime',this.formData.appointTime);
-			}
-		  }
-		}
+      formData: {
+        immediate: true,
+        handler () {
+          if (this.formData.dateType == 2) {
+            this.$set(
+              this.workReport,
+              'executeTime',
+              this.formData.appointTime
+            );
+          }
+        }
+      }
     },
     created () {
       this.workReport.executorId = this.$store.state.user.info?.userId;

+ 2 - 2
vue.config.js

@@ -31,8 +31,8 @@ module.exports = {
     proxy: {
       // 当我们的本地的请求 有/api的时候,就会代理我们的请求地址向另外一个服务器发出请求
       '/api': {
-        target: 'http://192.168.3.51:18086', // 测试
-        // target: 'http://192.168.3.35:8080', // kang杨威
+        // target: 'http://192.168.3.51:18086', // 测试
+        target: 'http://192.168.3.35:8080', // kang杨威
         // target: 'http://192.168.3.25:8080', // 黄峥嵘
         // target: 'http://192.168.3.41:8080', // 何江鹏
         // target: 'http://192.168.3.33:8080', // 谢一平