Jelajahi Sumber

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

LAPTOP-16IUEB3P\Lenovo 3 tahun lalu
induk
melakukan
9e62189cc0

+ 2 - 0
package.json

@@ -26,8 +26,10 @@
     "ele-admin": "^1.11.2",
     "element-ui": "2.15.7",
     "github-markdown-css": "^5.1.0",
+    "html2canvas": "^1.4.1",
     "jsbarcode": "^3.11.5",
     "json-bigint": "^1.0.0",
+    "jspdf": "^2.5.1",
     "nprogress": "^0.2.0",
     "tinymce": "^5.10.5",
     "vue": "^2.7.10",

+ 11 - 1
src/api/produceOrder/index.js

@@ -118,7 +118,17 @@ export async function writeOffWork (data) {
 }
 //包装要求
 export async function getPackageList (code) {
-  const res = await request.get(`/aps/workorder/getPackageList/${code} `);
+  const res = await request.get(`/aps/workorder/getPackageList/${code}`);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+//根据工序ID查询设备信息
+export async function getDeviceByTaskId (params) {
+  const res = await request.get(
+    `/main/producetask/getDeviceByTaskId/${params.taskId}/${params.rootCategoryLevelId}`
+  );
   if (res.data.code == 0) {
     return res.data.data;
   }

+ 187 - 0
src/components/EquipmentDailog/report-equipment.vue

@@ -0,0 +1,187 @@
+<template>
+  <ele-modal
+    :visible.sync="visible"
+    title="添加工单-选择设备"
+    width="65vw"
+    append-to-body
+  >
+    <div class="search-box">
+      设备名称
+      <el-input placeholder="请输入" v-model="name"></el-input>
+    </div>
+    <!-- 数据表格 -->
+    <!-- :highlight-current-row="isSingle" -->
+    <ele-pro-table
+      ref="table"
+      :columns="columns"
+      @done="handleDone"
+      row-key="id"
+      :needPage="false"
+      :initLoad="false"
+      :selection.sync="selectionList"
+      :datasource="datasourceShow"
+      :current.sync="current"
+      highlight-current-row
+      height="45vh"
+      @row-click="choose"
+    >
+      <template v-slot:select="{ row }">
+        <el-radio class="radio" v-model="radio" :label="row.id"
+          ><i></i
+        ></el-radio>
+      </template>
+    </ele-pro-table>
+    <div class="footer" slot="footer">
+      <el-button @click="cancel">取消</el-button>
+      <el-button @click="confirm" type="primary">确定</el-button>
+    </div>
+  </ele-modal>
+</template>
+
+<script>
+  import { getDeviceByTaskId } from '@/api/produceOrder/index';
+  export default {
+    props: {
+      taskId: {
+        type: String,
+        default: ''
+      }
+    },
+    data () {
+      return {
+        visible: false,
+        current: null,
+        name: '',
+        selectionList: [],
+        memoList: [],
+        datasource: [],
+        isSingle: false,
+        callback: null,
+        radio: ''
+      };
+    },
+    computed: {
+      columns () {
+        const list = [
+          {
+            label: '设备编码',
+            prop: 'code'
+          },
+          {
+            label: '设备名称',
+            prop: 'name'
+          },
+          // {
+          //   label: '生产状态',
+          //   prop: 'status'
+          // },
+          {
+            label: '未完成工单数',
+            prop: 'incompleteOrderNum'
+          },
+          {
+            label: '预计完成时间',
+            prop: 'planCompleteDate'
+          },
+          // {
+          //   label: '产能',
+          //   prop: 'capacityNum',
+          //   width: 200,
+          //   formatter: (row) =>
+          //     row.capacityNum + ' ' + row.capacityUnit + '/' + row.capacityTime
+          // },
+          {
+            label: '末单牌号',
+            prop: 'lastOrderGrade'
+          }
+        ];
+
+        if (!this.isSingle) {
+          list.push({
+            slot: 'select',
+            prop: 'select',
+            label: '选择',
+            align: 'center'
+          });
+        }
+        return list;
+      },
+      datasourceShow () {
+        return this.datasource?.filter((item) => {
+          if (this.name) {
+            return item.name.includes(this.name);
+          }
+
+          return true;
+        });
+      }
+    },
+    methods: {
+      openSingle (list = [], callback) {
+        this.memoList = list;
+        this.callback = callback;
+        this.isSingle = true;
+        this.visible = true;
+        this._getList();
+      },
+      handleDone ({ data }) {
+        if (this.memoList.length) {
+          this.$nextTick(() => {
+            this.$refs.table.setCurrentRow(
+              data.find(
+                (item) =>
+                  item.id ==
+                  (this.memoList[0].deviceId ||
+                    this.memoList[0].sourceInstanceId)
+              )
+            );
+          });
+        }
+      },
+      async _getList () {
+        const data = await getDeviceByTaskId({
+          rootCategoryLevelId: '4',
+          taskId: this.taskId
+        });
+        this.datasource = data || [];
+      },
+      confirm () {
+        if (this.isSingle) {
+          if (!this.current) return this.$message.error('请选择数据');
+
+          this.callback && this.callback(this.current);
+        } else {
+          if (!this.current) return this.$message.error('请选择数据');
+          this.$emit('success', [this.current]);
+        }
+
+        this.cancel();
+      },
+      cancel () {
+        this.$refs.table.setCurrentRow();
+        this.$refs.table.clearSelection();
+        this.radio = '';
+        this.current = null;
+        this.visible = false;
+      },
+      // 单击获取id
+      choose (row) {
+        this.current = row;
+        this.radio = row.id;
+      }
+    }
+  };
+</script>
+
+<style lang="scss" scoped>
+  .search-box {
+    display: flex;
+    justify-content: flex-start;
+    align-items: center;
+    margin-bottom: 20px;
+    .el-input {
+      width: 220px;
+      margin: 0 32px;
+    }
+  }
+</style>

+ 861 - 0
src/components/print/OrderPrint.vue

@@ -0,0 +1,861 @@
+<template>
+  <ele-modal :visible.sync="visible" type="工单打印" width="80vw">
+    <div class="print-container" ref="pagesRef">
+      <el-row class="main-data mb-16">
+        <el-col :span="6">
+          <div class="bg"> 生产工单号 </div>
+          <div class="code">条码区</div>
+          <div class="value">21122403906633005</div>
+        </el-col>
+        <el-col :span="5">
+          <div class="bg">生产版本</div>
+          <div class="value">X011 挤压</div>
+          <div class="bg">产品编码</div>
+          <div class="value">W05363955011</div>
+        </el-col>
+        <el-col :span="5">
+          <div class="bg">计划编号</div>
+          <div class="value">YU21122400039</div>
+          <div class="bg">产品名称</div>
+          <div class="value">木工刀</div>
+        </el-col>
+        <el-col :span="4">
+          <div class="bg">计划类型</div>
+          <div class="value">内销计划</div>
+          <div class="bg">要求成型数量</div>
+          <div class="value">1000 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">850.5 KG</div>
+        </el-col>
+      </el-row>
+
+      <el-row class="processes-data">
+        <el-col :span="14" class="bg top"
+          ><div class="title">10 挤压成型</div></el-col
+        >
+        <el-col :span="10" class="bg top">备注:</el-col>
+        <el-col
+          :span="item.span"
+          :class="item.class"
+          v-for="item in extrusion"
+          :key="item.label"
+        >
+          {{ item.label }}:{{ item.key }}
+        </el-col>
+      </el-row>
+      <el-row class="processes-data">
+        <el-col :span="14" class="bg top"
+          ><div class="title">20 自然干燥</div></el-col
+        >
+        <el-col :span="10" class="bg top">备注:</el-col>
+        <el-col
+          :span="item.span"
+          :class="item.class"
+          v-for="item in drying"
+          :key="item.label"
+        >
+          {{ item.label }}:{{ item.key }}
+        </el-col>
+      </el-row>
+      <el-row class="processes-data">
+        <el-col :span="14" class="bg top"
+          ><div class="title">30 升温干燥</div></el-col
+        >
+        <el-col :span="10" class="bg top">备注:</el-col>
+        <el-col
+          :span="item.span"
+          :class="item.class"
+          v-for="item in temperature"
+          :key="item.label"
+        >
+          {{ item.label }}:{{ item.key }}
+        </el-col>
+      </el-row>
+      <el-row class="processes-data">
+        <el-col :span="14" class="bg top"
+          ><div class="title">40 半加定长</div></el-col
+        >
+        <el-col :span="10" class="bg top">备注:</el-col>
+        <el-col
+          :span="item.span"
+          :class="item.class"
+          v-for="item in halflong"
+          :key="item.label"
+        >
+          {{ item.label }}:{{ item.key }}
+        </el-col>
+      </el-row>
+      <el-row class="processes-data">
+        <el-col :span="14" class="bg top"
+          ><div class="title">50 备炉</div></el-col
+        >
+        <el-col :span="10" class="bg top">备注:</el-col>
+        <el-col
+          :span="item.span"
+          :class="item.class"
+          v-for="item in furnace"
+          :key="item.label"
+        >
+          {{ item.label }}:{{ item.key }}
+        </el-col>
+      </el-row>
+      <el-row class="processes-data">
+        <el-col :span="14" class="bg top"
+          ><div class="title">60 烧结</div></el-col
+        >
+        <el-col :span="10" class="bg top">备注:</el-col>
+        <el-col
+          :span="item.span"
+          :class="item.class"
+          v-for="item in sinter"
+          :key="item.label"
+        >
+          {{ item.label }}:{{ item.key }}
+        </el-col>
+      </el-row>
+      <el-row class="processes-data">
+        <el-col :span="14" class="bg top"
+          ><div class="title">70 质检</div></el-col
+        >
+        <el-col :span="10" class="bg top">备注:</el-col>
+        <el-col
+          :span="item.span"
+          :class="item.class"
+          v-for="item in quality"
+          :key="item.label"
+        >
+          {{ item.label }}:{{ item.key }}
+        </el-col>
+      </el-row>
+      <el-row class="processes-data">
+        <el-col :span="14" class="bg top"
+          ><div class="title">80 深加工(精磨)</div></el-col
+        >
+        <el-col :span="10" class="bg top">备注:</el-col>
+        <el-col
+          :span="item.span"
+          :class="item.class"
+          v-for="item in deepProcesse"
+          :key="item.label"
+        >
+          {{ item.label }}:{{ item.key }}
+        </el-col>
+      </el-row>
+      <el-row class="processes-data">
+        <el-col :span="14" class="bg top"
+          ><div class="title">90 包装</div></el-col
+        >
+        <el-col :span="10" class="bg top">备注:</el-col>
+        <el-col
+          :span="item.span"
+          :class="item.class"
+          v-for="item in packageOpt"
+          :key="item.label"
+        >
+          {{ item.label }}:{{ item.key }}
+        </el-col>
+      </el-row>
+      <el-row class="processes-data">
+        <el-col :span="14" class="bg top"
+          ><div class="title">110 预缴库</div></el-col
+        >
+        <el-col :span="10" class="bg top">备注:</el-col>
+        <el-col
+          :span="item.span"
+          :class="item.class"
+          v-for="item in preStorage"
+          :key="item.label"
+        >
+          {{ item.label }}:{{ item.key }}
+        </el-col>
+      </el-row>
+    </div>
+    <div slot="footer">
+      <el-button type="primary" @click="handlePrint">打印</el-button>
+      <el-button>取消</el-button>
+    </div>
+  </ele-modal>
+</template>
+
+<script>
+  import { downloadPDF } from '@/utils/pdf.js';
+  export default {
+    data () {
+      return {
+        visible: false,
+        // 挤压成型
+        extrusion: [
+          {
+            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: '投料数量(KG)',
+            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: 8,
+            class: 'border-dashed-right border-dashed-bottom'
+          },
+          {
+            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-bottom'
+          },
+
+          {
+            label: '冲压次数',
+            key: 'xxx',
+            span: 4,
+            class: 'border-dashed-right'
+          },
+          {
+            label: '员工号',
+            key: 'xxx',
+            span: 4,
+            class: 'border-dashed-right'
+          },
+          {
+            label: '日期',
+            key: 'xxx',
+            span: 4,
+            class: 'border-dashed-right'
+          },
+          {
+            label: '清缸时长',
+            key: 'xxx',
+            span: 8
+          }
+        ],
+        // 自然干燥
+        drying: [
+          {
+            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: 8,
+            class: 'border-dashed-bottom'
+          },
+
+          {
+            label: '周转车编码',
+            key: 'xxx',
+            span: 8,
+            class: 'border-dashed-right '
+          },
+          {
+            label: '员工号',
+            key: 'xxx',
+            span: 4,
+            class: 'border-dashed-right '
+          },
+          {
+            label: '日期',
+            key: 'xxx',
+            span: 8
+          }
+        ],
+        // 升温燥
+        temperature: [
+          {
+            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'
+          },
+          {
+            label: '设备号',
+            key: 'xxx',
+            span: 4,
+            class: ' border-dashed-bottom'
+          },
+
+          {
+            label: '周转车编码',
+            key: 'xxx',
+            span: 8,
+            class: 'border-dashed-right'
+          },
+          {
+            label: '员工号',
+            key: 'xxx',
+            span: 4,
+            class: 'border-dashed-right'
+          },
+          {
+            label: '日期',
+            key: 'xxx',
+            span: 8
+          }
+        ],
+        // 半加定长
+        halflong: [
+          {
+            label: '长度(mm)',
+            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: 8,
+            class: ' border-dashed-bottom'
+          },
+
+          {
+            label: '舟皿名称',
+            key: 'xxx',
+            span: 4,
+            class: 'border-dashed-right'
+          },
+          {
+            label: '舟皿数量',
+            key: 'xxx',
+            span: 4,
+            class: 'border-dashed-right'
+          },
+          {
+            label: '员工号',
+            key: 'xxx',
+            span: 4,
+            class: 'border-dashed-right'
+          },
+          {
+            label: '日期',
+            key: 'xxx',
+            span: 8
+          }
+        ],
+        // 备炉
+        furnace: [
+          {
+            label: '产品数量',
+            key: 'xxx',
+            span: 8,
+            class: 'border-dashed-right'
+          },
+          {
+            label: '设备号',
+            key: 'xxx',
+            span: 4,
+            class: 'border-dashed-right'
+          },
+          {
+            label: '员工号',
+            key: 'xxx',
+            span: 4,
+            class: 'border-dashed-right'
+          },
+          {
+            label: '日期',
+            key: 'xxx',
+            span: 8,
+            class: ' '
+          }
+        ],
+        // 烧结
+        sinter: [
+          {
+            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: 8,
+            class: 'border-dashed-right border-dashed-bottom'
+          },
+          {
+            label: '员工号',
+            key: 'xxx',
+            span: 4,
+            class: 'border-dashed-right'
+          },
+          {
+            label: '日期',
+            key: 'xxx',
+            span: 8,
+            class: ''
+          }
+        ],
+        // 质检
+        quality: [
+          {
+            label: '半检结果',
+            key: 'xxx',
+            span: 12,
+            class: 'border-dashed-right border-dashed-bottom'
+          },
+          {
+            label: '员工号',
+            key: 'xxx',
+            span: 4,
+            class: 'border-dashed-right border-dashed-bottom'
+          },
+          {
+            label: '日期',
+            key: 'xxx',
+            span: 8,
+            class: 'border-dashed-bottom'
+          },
+          {
+            label: '成检结果',
+            key: 'xxx',
+            span: 12,
+            class: 'border-dashed-right border-dashed-bottom'
+          },
+          {
+            label: '员工号',
+            key: 'xxx',
+            span: 4,
+            class: 'border-dashed-right border-dashed-bottom'
+          },
+          {
+            label: '日期',
+            key: 'xxx',
+            span: 8,
+            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-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: '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: 12,
+            class: 'border-dashed-bottom'
+          }
+        ],
+        // 深加工
+        deepProcesse: [
+          {
+            label: '合格数',
+            key: 'xxx',
+            span: 8,
+            class: 'border-dashed-right'
+          },
+          {
+            label: '不合格数',
+            key: 'xxx',
+            span: 4,
+            class: 'border-dashed-right'
+          },
+          {
+            label: '设备号',
+            key: 'xxx',
+            span: 4,
+            class: 'border-dashed-right'
+          },
+          {
+            label: '员工号',
+            key: 'xxx',
+            span: 4,
+            class: 'border-dashed-right'
+          },
+          {
+            label: '日期',
+            key: 'xxx',
+            span: 4,
+            class: ' '
+          }
+        ],
+        // 深加工
+        packageOpt: [
+          {
+            label: '包装要求',
+            key: 'xxx',
+            span: 24,
+            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-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: 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'
+          },
+          {
+            label: '员工号',
+            key: 'xxx',
+            span: 8,
+            class: 'border-dashed-right border-dashed-bottom'
+          },
+          {
+            label: '日期',
+            key: 'xxx',
+            span: 4,
+            class: 'border-dashed-bottom'
+          }
+        ],
+        // 预缴库
+        preStorage: [
+          {
+            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: 16,
+            class: ' border-dashed-bottom'
+          }
+        ]
+      };
+    },
+
+    methods: {
+      open () {
+        this.visible = true;
+        this.init();
+      },
+      init () {},
+      //打印
+      handlePrint () {
+        this.PrintLoading = true;
+        downloadPDF(this.$refs.pagesRef, 'l').then((res) => {
+          this.PrintLoading = false;
+        });
+      }
+    }
+  };
+</script>
+<style media="print" scoped>
+  @page {
+    size: auto; /* auto is the initial value */
+    margin-bottom: 10mm; /* this affects the margin in the printer settings */
+  }
+</style>
+<style scoped lang="scss">
+  $heihgt: 36px;
+  $border: 1px solid #ddd;
+  * {
+    box-sizing: border-box;
+  }
+  .bg {
+    background-color: #f1f1f1;
+    line-height: $heihgt - 2px;
+    height: $heihgt;
+  }
+
+  .border-dashed-right {
+    border-right: $border;
+  }
+  .border-dashed-bottom {
+    border-bottom: $border;
+  }
+  .main-data {
+    .bg {
+      text-align: center;
+      border-right: $border;
+      border-bottom: $border;
+    }
+
+    .value {
+      line-height: $heihgt - 2px;
+      height: $heihgt;
+      border-right: $border;
+      border-bottom: $border;
+      padding-left: 10px;
+    }
+    .code {
+      line-height: 2 * $heihgt;
+      height: 2 * $heihgt;
+      border-right: $border;
+      border-bottom: $border;
+      text-align: center;
+    }
+  }
+
+  .print-container {
+    border-top: $border;
+    border-left: $border;
+    border-right: $border;
+    font-size: 20px;
+  }
+
+  .processes-data {
+    .title {
+      color: #000;
+      font-weight: bold;
+    }
+    :deep(.el-col) {
+      line-height: $heihgt - 2px;
+      height: $heihgt;
+      padding-left: 10px;
+    }
+    .top {
+      border-top: $border;
+      border-bottom: $border;
+    }
+  }
+</style>

+ 56 - 0
src/utils/pdf.js

@@ -0,0 +1,56 @@
+import html2canvas from 'html2canvas';
+import jsPDF from 'jspdf';
+
+const ratio = 1; //放大 兼容低分辨率屏幕清晰度
+
+const margin = 10; //边距
+// A4宽高
+const a4Width = 595.28;
+const a4Height = 841.89;
+// let pdf = null;
+export const downloadPDF = (page, fileName = '工单') => {
+  // direction : 方向
+  return new Promise((resolve, reject) => {
+    html2canvas(page, { scale: ratio }).then(function (canvas) {
+      var contentWidth = canvas.width;
+      var contentHeight = canvas.height;
+
+      //一页pdf显示html页面生成的canvas高度;
+      var pageHeight = (contentWidth / a4Width) * a4Height;
+      //未生成pdf的html页面高度
+      var leftHeight = contentHeight;
+      //页面偏移
+      var position = 10;
+      //a4纸的尺寸[595.28,841.89],html页面生成的canvas在pdf中图片的宽高
+      var imgWidth = a4Width - margin * 2;
+      var imgHeight = (imgWidth / contentWidth) * contentHeight;
+
+      var pageData = canvas.toDataURL('image/jpeg', 1.0);
+
+      var pdf = new jsPDF('', 'pt', 'a4');
+
+      //有两个高度需要区分,一个是html页面的实际高度,和生成pdf的页面高度(841.89)
+      //当内容未超过pdf一页显示的范围,无需分页
+      if (leftHeight < pageHeight) {
+        pdf.addImage(pageData, 'JPEG', margin, position, imgWidth, imgHeight);
+      } else {
+        while (leftHeight > 0) {
+          pdf.addImage(pageData, 'JPEG', margin, position, imgWidth, imgHeight);
+          leftHeight -= pageHeight;
+          position -= a4Height;
+          //避免添加空白页
+          if (leftHeight > 0) {
+            pdf.addPage();
+          }
+        }
+      }
+
+      pdf.save(`${fileName}.pdf`);
+      const blob = pdf.output('blob');
+      var blob_url = URL.createObjectURL(blob);
+      window.open(blob_url);
+      pdf = null;
+      resolve();
+    });
+  });
+};

+ 9 - 9
src/views/produceOrder/components/report/Common.vue

@@ -28,7 +28,7 @@
       <div class="right">
         <el-form-item
           label="执行人工号"
-          prop="executorJobNum"
+          prop="executorId"
           required
           label-width="100px"
           ><personSelectRemote
@@ -165,7 +165,7 @@
           ><el-input-number
             class="w100"
             :controls="false"
-            v-model="workReport.productInfo.netWeight"
+            v-model="workReport.productInfo.byProductWeight"
             :min="0"
             clearable
           ></el-input-number
@@ -202,16 +202,13 @@
         >
       </el-descriptions>
     </el-card>
-    <equipmentDailog
-      ref="equipmentRef"
-      :produceVersionId="infoData.produceVersionId"
-    />
+    <equipmentDailog ref="equipmentRef" :taskId="taskInfo.id" />
   </el-form>
 </template>
 
 <script>
   import personSelectRemote from '@/components/CommomSelect/person-select-remote';
-  import equipmentDailog from '@/components/EquipmentDailog/equipment-dailog';
+  import equipmentDailog from '@/components/EquipmentDailog/report-equipment';
   import { reportCount } from '@/api/produceOrder';
   import dayjs from 'dayjs';
   export default {
@@ -246,6 +243,7 @@
           executeTime: dayjs(new Date()).format('YYYY-MM-DD HH:mm:ss'),
           remark: '',
           productInfo: {
+            byProductWeight: '',
             standardNum: '',
             standardWeight: '',
             noStandardNum: '',
@@ -313,8 +311,10 @@
           (res) => {
             this.workReportDeviceList.code = res.code;
             this.workReportDeviceList.name = res.name;
-            this.workReportDeviceList.model = res.modelType;
-            this.workReportDeviceList.specification = res.specification;
+
+            this.workReportDeviceList.model = res.category?.category?.modelType;
+            this.workReportDeviceList.specification =
+              res.category?.category?.specification;
             this.workReportDeviceList.sourceInstanceId = res.id;
             this.workReportDeviceList.rootCategoryLevelId =
               res.rootCategoryLevelId;

+ 4 - 6
src/views/produceOrder/components/report/Drying.vue

@@ -29,7 +29,7 @@
       <div class="right">
         <el-form-item
           label="执行人工号"
-          prop="executorJobNum"
+          prop="executorId"
           required
           label-width="100px"
           ><personSelectRemote
@@ -178,7 +178,7 @@
           ><el-input-number
             class="w100"
             :controls="false"
-            v-model="workReport.productInfo.netWeight"
+            v-model="workReport.productInfo.byProductWeight"
             :min="0"
             clearable
           ></el-input-number
@@ -219,10 +219,7 @@
         >
       </el-descriptions>
     </el-card>
-    <workshopDailog
-      ref="workshopRef"
-      :produceVersionId="infoData.produceVersionId"
-    />
+    <workshopDailog ref="workshopRef" :taskId="taskInfo.id" />
     <catogaryDialog ref="catogaryDialogRef" />
   </el-form>
 </template>
@@ -265,6 +262,7 @@
           executeTime: dayjs(new Date()).format('YYYY-MM-DD HH:mm:ss'),
           remark: '',
           productInfo: {
+            byProductWeight: '',
             standardNum: '',
             standardWeight: '',
             noStandardNum: '',

+ 8 - 10
src/views/produceOrder/components/report/Extrusion.vue

@@ -24,7 +24,7 @@
       <div class="right">
         <el-form-item
           label="执行人工号"
-          prop="executorJobNum"
+          prop="executorId"
           required
           label-width="100px"
           ><personSelectRemote
@@ -177,7 +177,7 @@
           ><el-input-number
             class="w100"
             :controls="false"
-            v-model="workReport.productInfo.netWeight"
+            v-model="workReport.productInfo.byProductWeight"
             :min="0"
             clearable
           ></el-input-number
@@ -252,11 +252,7 @@
         ></el-descriptions-item>
       </el-descriptions>
     </el-card>
-    <equipmentDailog
-      ref="equipmentRef"
-      :isPlan="true"
-      :produceVersionId="infoData.produceVersionId"
-    />
+    <equipmentDailog ref="equipmentRef" :taskId="taskInfo.id" />
     <materialDialog
       ref="materialRef"
       :params="{
@@ -272,7 +268,7 @@
 <script>
   import { realTimeStorage } from '@/api/mainData';
   import personSelectRemote from '@/components/CommomSelect/person-select-remote';
-  import equipmentDailog from '@/components/EquipmentDailog/equipment-dailog';
+  import equipmentDailog from '@/components/EquipmentDailog/report-equipment';
   import materialDialog from '../materialDialog.vue';
   import catogaryDialog from '../catogaryDialog.vue';
   import { reportCount } from '@/api/produceOrder';
@@ -314,6 +310,7 @@
           remark: '',
           productInfo: {
             standardNum: '',
+            byProductWeight: '',
             standardWeight: '',
             noStandardNum: '',
             noStandardWeight: ''
@@ -428,8 +425,9 @@
           (res) => {
             this.workReportDeviceList.code = res.code;
             this.workReportDeviceList.name = res.name;
-            this.workReportDeviceList.model = res.modelType;
-            this.workReportDeviceList.specification = res.specification;
+            this.workReportDeviceList.model = res.category?.category?.modelType;
+            this.workReportDeviceList.specification =
+              res.category?.category?.specification;
             this.workReportDeviceList.sourceInstanceId = res.id;
             this.workReportDeviceList.rootCategoryLevelId =
               res.rootCategoryLevelId;

+ 9 - 8
src/views/produceOrder/components/report/Furnace.vue

@@ -18,7 +18,7 @@
       <div class="right">
         <el-form-item
           label="执行人工号"
-          prop="executorJobNum"
+          prop="executorId"
           required
           label-width="100px"
           ><personSelectRemote
@@ -80,16 +80,13 @@
         >
       </el-descriptions>
     </el-card>
-    <equipmentDailog
-      ref="equipmentRef"
-      :produceVersionId="infoData.produceVersionId"
-    />
+    <equipmentDailog ref="equipmentRef" :taskId="taskInfo.id" />
   </el-form>
 </template>
 
 <script>
   import personSelectRemote from '@/components/CommomSelect/person-select-remote';
-  import equipmentDailog from '@/components/EquipmentDailog/equipment-dailog';
+  import equipmentDailog from '@/components/EquipmentDailog/report-equipment';
   import { reportCount } from '@/api/produceOrder';
   import dayjs from 'dayjs';
   export default {
@@ -189,8 +186,10 @@
           (res) => {
             this.workReportDeviceList.code = res.code;
             this.workReportDeviceList.name = res.name;
-            this.workReportDeviceList.model = res.modelType;
-            this.workReportDeviceList.specification = res.specification;
+
+            this.workReportDeviceList.model = res.category?.category?.modelType;
+            this.workReportDeviceList.specification =
+              res.category?.category?.specification;
             this.workReportDeviceList.sourceInstanceId = res.id;
             this.workReportDeviceList.rootCategoryLevelId =
               res.rootCategoryLevelId;
@@ -212,6 +211,8 @@
                 name: this.infoData.productName,
                 code: this.infoData.productCode
               });
+              // 实际数量 也是 合格品
+              this.workReport.productInfo.standardNum = this.categoryMsg.number;
               fun({
                 checkState: 1,
                 workReport: this.workReport,

+ 9 - 9
src/views/produceOrder/components/report/HalfAdded.vue

@@ -28,7 +28,7 @@
       <div class="right">
         <el-form-item
           label="执行人工号"
-          prop="executorJobNum"
+          prop="executorId"
           required
           label-width="100px"
           ><personSelectRemote
@@ -177,7 +177,7 @@
           ><el-input-number
             class="w100"
             :controls="false"
-            v-model="workReport.productInfo.netWeight"
+            v-model="workReport.productInfo.byProductWeight"
             :min="0"
             clearable
           ></el-input-number
@@ -214,17 +214,14 @@
         >
       </el-descriptions>
     </el-card>
-    <equipmentDailog
-      ref="equipmentRef"
-      :produceVersionId="infoData.produceVersionId"
-    />
+    <equipmentDailog ref="equipmentRef" :taskId="taskInfo.id" />
     <catogaryDialog ref="catogaryDialogRef" />
   </el-form>
 </template>
 
 <script>
   import personSelectRemote from '@/components/CommomSelect/person-select-remote';
-  import equipmentDailog from '@/components/EquipmentDailog/equipment-dailog';
+  import equipmentDailog from '@/components/EquipmentDailog/report-equipment';
   import { reportCount } from '@/api/produceOrder';
   import catogaryDialog from '../catogaryDialog.vue';
   import dayjs from 'dayjs';
@@ -260,6 +257,7 @@
           executeTime: dayjs(new Date()).format('YYYY-MM-DD HH:mm:ss'),
           remark: '',
           productInfo: {
+            byProductWeight: '',
             standardNum: '',
             standardWeight: '',
             noStandardNum: '',
@@ -354,8 +352,10 @@
           (res) => {
             this.workReportDeviceList.code = res.code;
             this.workReportDeviceList.name = res.name;
-            this.workReportDeviceList.model = res.modelType;
-            this.workReportDeviceList.specification = res.specification;
+
+            this.workReportDeviceList.model = res.category?.category?.modelType;
+            this.workReportDeviceList.specification =
+              res.category?.category?.specification;
             this.workReportDeviceList.sourceInstanceId = res.id;
             this.workReportDeviceList.rootCategoryLevelId =
               res.rootCategoryLevelId;

+ 9 - 9
src/views/produceOrder/components/report/Heating.vue

@@ -28,7 +28,7 @@
       <div class="right">
         <el-form-item
           label="执行人工号"
-          prop="executorJobNum"
+          prop="executorId"
           required
           label-width="100px"
           ><personSelectRemote
@@ -177,7 +177,7 @@
           ><el-input-number
             class="w100"
             :controls="false"
-            v-model="workReport.productInfo.netWeight"
+            v-model="workReport.productInfo.byProductWeight"
             :min="0"
             clearable
           ></el-input-number
@@ -220,17 +220,14 @@
         >
       </el-descriptions>
     </el-card>
-    <equipmentDailog
-      ref="equipmentRef"
-      :produceVersionId="infoData.produceVersionId"
-    />
+    <equipmentDailog ref="equipmentRef" :taskId="taskInfo.id" />
     <catogaryDialog ref="catogaryDialogRef" />
   </el-form>
 </template>
 
 <script>
   import personSelectRemote from '@/components/CommomSelect/person-select-remote';
-  import equipmentDailog from '@/components/EquipmentDailog/equipment-dailog';
+  import equipmentDailog from '@/components/EquipmentDailog/report-equipment';
   import { reportCount } from '@/api/produceOrder';
   import catogaryDialog from '../catogaryDialog.vue';
   import dayjs from 'dayjs';
@@ -266,6 +263,7 @@
           executeTime: dayjs(new Date()).format('YYYY-MM-DD HH:mm:ss'),
           remark: '',
           productInfo: {
+            byProductWeight: '',
             standardNum: '',
             standardWeight: '',
             noStandardNum: '',
@@ -363,8 +361,10 @@
           (res) => {
             this.workReportDeviceList.code = res.code;
             this.workReportDeviceList.name = res.name;
-            this.workReportDeviceList.model = res.modelType;
-            this.workReportDeviceList.specification = res.specification;
+
+            this.workReportDeviceList.model = res.category?.category?.modelType;
+            this.workReportDeviceList.specification =
+              res.category?.category?.specification;
             this.workReportDeviceList.sourceInstanceId = res.id;
             this.workReportDeviceList.rootCategoryLevelId =
               res.rootCategoryLevelId;

+ 10 - 3
src/views/produceOrder/components/report/Package.vue

@@ -27,7 +27,7 @@
       <div class="right">
         <el-form-item
           label="执行人工号"
-          prop="executorJobNum"
+          prop="executorId"
           required
           label-width="100px"
           ><personSelectRemote
@@ -135,6 +135,9 @@
         <template v-slot:num="{ row }">
           <el-input v-model="row.number" placeholder="请输入"></el-input>
         </template>
+        <template v-slot:batchNo="{ row }">
+          <el-input v-model="row.batchNo" placeholder="请输入"></el-input>
+        </template>
       </ele-pro-table>
       <!-- <el-descriptions title="交接" direction="vertical" :column="5" border>
         <el-descriptions-item label="待交接数量"
@@ -200,7 +203,7 @@
           },
           {
             label: '批次号',
-            prop: 'batchNo'
+            slot: 'batchNo'
           },
           // {
           //   label: '包装编码',
@@ -306,6 +309,7 @@
             obj[pre.id] = true;
 
             next.push({
+              batchNo: '',
               brandNo: pre.brandNum,
               code: pre.code,
               sourceCategoryId: pre.id,
@@ -313,6 +317,7 @@
               model: pre.modelType,
               specifications: pre.specification,
               unit: pre.measuringUnit,
+              rootCategoryLevelId: pre.categoryLevelId,
               number: '',
               ...pre
             });
@@ -343,8 +348,10 @@
                 name: this.infoData.productName,
                 code: this.infoData.productCode
               });
+              // 实际数量 也是 合格品
+              this.workReport.productInfo.standardNum = this.categoryMsg.number;
               fun({
-                checkState: 1,
+                checkState: 2,
                 workReport: this.workReport,
                 workReportCategoryList: [
                   ...this.workReportCategoryList,

+ 1 - 1
src/views/produceOrder/components/report/Sinter.vue

@@ -82,7 +82,7 @@
 
 <script>
   import personSelectRemote from '@/components/CommomSelect/person-select-remote';
-  import equipmentDailog from '@/components/EquipmentDailog/equipment-dailog';
+  import equipmentDailog from '@/components/EquipmentDailog/report-equipment';
   import { reportCount } from '@/api/produceOrder';
   export default {
     components: { personSelectRemote, equipmentDailog },

+ 8 - 6
src/views/produceOrder/components/report/Warehousing.vue

@@ -9,10 +9,7 @@
     <div class="message-box">
       <ul>
         <li> <span class="label">报工次数</span>{{ countMsg.reportNum }}</li>
-        <li>
-          <span class="label">批次数量</span
-          >{{ countMsg.inStoreBatchNum }}PCS</li
-        >
+        <li> <span class="label">批次数量</span>{{ countMsg.reportNum }}</li>
         <li>
           <span class="label">累计入库数量</span
           >{{ countMsg.inStoreNum }}PCS</li
@@ -34,7 +31,7 @@
         <el-form-item
           label="执行日期"
           required
-          prop="executeTime"
+          prop="workReport.executeTime"
           label-width="100px"
           ><el-date-picker
             v-model="workReport.executeTime"
@@ -143,6 +140,9 @@
             inStorageNum: '',
             storageCode: '',
             storageName: ''
+          },
+          productInfo: {
+            standardNum: ''
           }
         },
         categoryMsg: {
@@ -192,8 +192,10 @@
                 name: this.infoData.productName,
                 code: this.infoData.productCode
               });
+              // 实际数量 也是 合格品
+              this.workReport.productInfo.standardNum = this.categoryMsg.number;
               fun({
-                checkState: 1,
+                checkState: 3,
                 workReport: this.workReport,
                 workReportCategoryList: [this.categoryMsg]
               }).then((res) => {

File diff ditekan karena terlalu besar
+ 283 - 240
src/views/produceOrder/detail.vue


Beberapa file tidak ditampilkan karena terlalu banyak file yang berubah dalam diff ini