Sfoglia il codice sorgente

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

695593266@qq.com 3 mesi fa
parent
commit
b07259592e

+ 21 - 4
src/api/qms/index.js

@@ -1,8 +1,6 @@
 import request from '@/utils/request';
 
-
-
-export async function queryFactory () {
+export async function queryFactory() {
   const res = await request.get(`/qms/quality_work_order/queryFactory`);
   if (res.data.code == 0) {
     return res.data.data;
@@ -10,5 +8,24 @@ export async function queryFactory () {
   return Promise.reject(new Error(res.data.message));
 }
 
+//合格证
+export async function getCertificatetList(params) {
+  const res = await request.get(`/qms/qmscertificatemanagement/page`, {
+    params
+  });
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
 
-
+// 质检报告
+export async function getQualityReportApproval(params) {
+  const res = await request.get('/qms/quality_work_order/pageByReport', {
+    params
+  });
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}

+ 7 - 6
src/utils/page-tab-util.js

@@ -248,21 +248,22 @@ export function logout(route, from) {
     if (localStorage.getItem('singleUserInfo') == '1') {
       router.push({
         path: '/singleLogin',
-        query: from ? { from } : void 0
+        // query: from ? { from } : void 0
       });
     } else {
       router.push({
         path: '/login',
-        query: from ? { from } : void 0
+        // query: from ? { from } : void 0
       });
     }
   } else {
     if (localStorage.getItem('singleUserInfo') == '1') {
-      location.replace(
-        BASE_URL + 'singleLogin' + (from ? '?from=' + from : '')
-      );
+      // location.replace(
+      //   BASE_URL + 'singleLogin' + (from ? '?from=' + from : '')
+      // );
+      location.replace(window.location.origin + '/singleLogin');
     } else {
-      location.replace(BASE_URL + 'login' + (from ? '?from=' + from : ''));
+      location.replace(window.location.origin + '/login');
     }
   }
 

+ 4 - 4
src/utils/request.js

@@ -62,9 +62,9 @@ service.interceptors.response.use(
     // 登录过期处理
     if (error?.response?.status === 401) {
       const currentPath = router.currentRoute.path;
-      if (currentPath === LAYOUT_PATH) {
-        logout(true);
-      } else {
+      // if (currentPath === LAYOUT_PATH) {
+      //   logout(true);
+      // } else {
         MessageBox.alert('登录状态已过期, 请退出重新登录!', '系统提示', {
           confirmButtonText: '重新登录',
           callback: (action) => {
@@ -76,7 +76,7 @@ service.interceptors.response.use(
             MessageBox.close();
           }
         });
-      }
+      // }
       return Promise.reject(new Error(error.response.data?.message));
     } else if (!error?.response?.status) {
       console.log(error.message);

+ 49 - 24
src/views/batchRecord/components/editModal.vue

@@ -52,7 +52,7 @@
                 dictName="记录规则事项类型"
                 v-model="form.itemType"
                 @change="itemTypeChange"
-                :disabled="reportWorkType == 4"
+                :disabled="form.reportWorkType == 4"
               >
               </DictSelection>
             </el-form-item>
@@ -123,11 +123,11 @@
 
         <header-title
           title="基本信息"
-          v-if="form.itemType != 1 && reportWorkType != 4"
+          v-if="form.itemType != 1 && form.reportWorkType != 4"
           style="margin-top: 20px"
         ></header-title>
 
-        <template v-if="form.itemType != 1 && reportWorkType != 4">
+        <template v-if="form.itemType != 1 && form.reportWorkType != 4">
           <el-row>
             <el-col v-if="form.itemType == 2" :span="8">
               <el-form-item
@@ -302,7 +302,7 @@
                 ></el-input>
               </el-form-item>
             </el-col>
-            <el-col v-if="reportWorkType == 2" :span="8">
+            <el-col v-if="form.reportWorkType == 2" :span="8">
               <el-form-item label="产出物">
                 <el-select
                   v-model="form.outputType"
@@ -348,7 +348,7 @@
           </el-col>
           <el-col :span="8">
             <el-form-item
-              v-if="reportWorkType != 4"
+              v-if="form.reportWorkType != 4"
               label="工序名称"
               prop="produceTaskId"
             >
@@ -378,9 +378,9 @@
           <el-col :span="8">
             <el-form-item
               label="产品编码"
-              :required="form.recordTemplateStyle != '3' && reportWorkType != 4"
+              :required="form.recordTemplateStyle != '3' && form.reportWorkType != 4"
               :prop="
-                form.recordTemplateStyle != '3' && reportWorkType != 4
+                form.recordTemplateStyle != '3' && form.reportWorkType != 4
                   ? 'productCode'
                   : ''
               "
@@ -400,9 +400,9 @@
           <el-col :span="8">
             <el-form-item
               label="产品名称"
-              :required="form.recordTemplateStyle != '3' && reportWorkType != 4"
+              :required="form.recordTemplateStyle != '3' && form.reportWorkType != 4"
               :prop="
-                form.recordTemplateStyle != '3' && reportWorkType != 4
+                form.recordTemplateStyle != '3' && form.reportWorkType != 4
                   ? 'productName'
                   : ''
               "
@@ -452,7 +452,7 @@
             <el-form-item
               label="要求生产数量"
               :prop="
-                form.recordTemplateStyle != '3' && reportWorkType != 4
+                form.recordTemplateStyle != '3' && form.reportWorkType != 4
                   ? 'formingNum'
                   : ''
               "
@@ -475,7 +475,7 @@
             form.produceTaskId &&
             form.produceTaskInstanceId &&
             workOrderInfo &&
-            reportWorkType == 2 &&
+            form.reportWorkType == 2 &&
             form.itemType == 2
           "
           ref="materialRef"
@@ -526,7 +526,7 @@
         </template>
 
         <ele-pro-table
-          v-if="form.itemType == 2 && reportWorkType != 4"
+          v-if="form.itemType == 2 && form.reportWorkType != 4"
           v-loading="loading"
           ref="table"
           row-key="id"
@@ -679,7 +679,7 @@
     <selectReleaseRules
       ref="selectReleaseRulesRef"
       @chooseRules="chooseReleaseRules"
-      :notProduceTaskConfig="reportWorkType == 2"
+      :notProduceTaskConfig="form.reportWorkType == 2"
     ></selectReleaseRules>
 
     <programRulesDialog
@@ -808,6 +808,13 @@
           }
         },
         deep: true
+      },
+      reportWorkType: {
+        handler(newVal, oldVal) {
+          console.log('reportWorkType~~~', newVal, oldVal);
+        },
+        immediate: true,
+        deep: true
       }
     },
     data() {
@@ -1072,6 +1079,7 @@
     },
     computed: {
       reportWorkTypeName() {
+        console.log('reportWorkType~~~', this.reportWorkType);
         switch (this.reportWorkType) {
           case 1:
             return '产前准备';
@@ -1171,12 +1179,14 @@
       open(type, data, activeComp = 'main') {
         console.log('data', type, data);
         this.type = type;
-        this.form.reportWorkType = this.reportWorkType;
+        // 优先使用传入数据中的 reportWorkType,否则使用 props 中的值
+        const currentReportWorkType = data.reportWorkType || this.reportWorkType;
+        this.form.reportWorkType = currentReportWorkType;
 
         if (type == 'add') {
-          this.title = `新增${this.reportWorkTypeName}事项`;
+          this.title = `新增${this.getReportWorkTypeName(currentReportWorkType)}事项`;
         } else if (type == 'edit') {
-          this.title = `编辑${this.reportWorkTypeName}事项`;
+          this.title = `编辑${this.getReportWorkTypeName(currentReportWorkType)}事项`;
           this.form.workOrderId = data.workOrderId;
           this.form.id = data.id;
           console.log('this.form', this.form);
@@ -1190,7 +1200,7 @@
             this.getRulesDetiasList(data.ruleId);
           }
         } else if (type == 'detail') {
-          this.title = `${this.reportWorkTypeName}事项`;
+          this.title = `${this.getReportWorkTypeName(currentReportWorkType)}事项`;
           this.form.workOrderId = data.workOrderId;
           this.form.id = data.id;
           if (data.processInstanceId) {
@@ -1209,6 +1219,21 @@
         }
         this.visible = true;
       },
+      // 获取报工类型名称(辅助方法)
+      getReportWorkTypeName(type) {
+        switch (type) {
+          case 1:
+            return '产前准备';
+          case 2:
+            return '过程控制';
+          case 3:
+            return '产后检查';
+          case 4:
+            return '生产统计';
+          default:
+            return '';
+        }
+      },
       // 查询详情
       async getDetias() {
         this.loading = true;
@@ -1329,7 +1354,7 @@
       selectReleaseId() {
         if (this.type == 'detail') return;
         this.$refs.selectReleaseRulesRef.open(
-          this.reportWorkType,
+          this.form.reportWorkType,
           this.form.produceTaskId
         );
       },
@@ -1379,7 +1404,7 @@
       // 获取工序列表
       async getProductTaskList(id) {
         // 生产统计不关联工序
-        if (this.reportWorkType == 4) return;
+        if (this.form.reportWorkType == 4) return;
         const data = await getTaskInstanceList(id);
         console.log('data 工序列表', data);
         this.produceTaskList = data.filter(
@@ -1468,12 +1493,12 @@
       },
       // 记录规则保存或者 一键报工
       async releaseRulesSaveOrSubmit(type) {
-        if (this.form.executeUsersIds.length == 0 && this.reportWorkType != 4) {
+        if (this.form.executeUsersIds.length == 0 && this.form.reportWorkType != 4) {
           this.$message.warning('请选择执行人!');
           return;
         }
 
-        if (this.form.duration <= 0 && this.reportWorkType != 4) {
+        if (this.form.duration <= 0 && this.form.reportWorkType != 4) {
           this.$message.warning('工时必须大于0!');
           return;
         }
@@ -1482,7 +1507,7 @@
         if (
           type.includes('submit') &&
           this.form.recordTemplateStyle != '3' &&
-          this.reportWorkType != 4
+          this.form.reportWorkType != 4
         ) {
           // 验证检查项目
           const detailRequired = this.form.details.some((i) => {
@@ -1509,7 +1534,7 @@
         }
 
         //
-        if (this.reportWorkType == 4) {
+        if (this.form.reportWorkType == 4) {
           // 延迟 500ms 等待公式计算
           await new Promise((resolve) => setTimeout(resolve, 700));
         }
@@ -1675,7 +1700,7 @@
       async getListByWorkOrderId(type = '') {
         if (
           !this.form.produceTaskId ||
-          this.reportWorkType != 2 ||
+          this.form.reportWorkType != 2 ||
           this.form.itemType != 2
         )
           return;

+ 9 - 1
src/views/batchRecord/components/programRulesDialog.vue

@@ -654,6 +654,7 @@
           ]
         },
         executorList: [],
+        defaultExecuteUsers: [],
         uerList: [],
         // 执行方式列表
         executeMethodList: [],
@@ -837,6 +838,7 @@
       }
     },
     created() {
+      this.getDefaultExecuteUsers();
       // 获取审核人列表、巡点检人员
       this.getUserList();
       // 获取所有班组
@@ -969,6 +971,12 @@
           this.addForm.groupId = null;
         }
       },
+      getDefaultExecuteUsers() {
+        let data = { pageNum: 1, size: -1 };
+        getUserPage(data).then(res => {
+          this.defaultExecuteUsers = res.list;
+        });
+      },
       // 获取审核人列表、巡点检人员
       async getUserList(params) {
         try {
@@ -1217,7 +1225,7 @@
       // 负责人变更 同步执行人列表
       executeIdListChange() {
         this.addForm.executeUsers = this.addForm.executeIdList.map((userId) => {
-          const user = this.executorList.find((u) => u.id === userId);
+          const user = this.defaultExecuteUsers.find((u) => u.id === userId);
           return {
             userId: user.id,
             userName: user.name,

+ 413 - 0
src/views/batchRecord/components/tables/certificate.vue

@@ -0,0 +1,413 @@
+<template>
+  <div class="ele-body">
+    <el-card shadow="never">
+      <!-- 搜索表单 -->
+      <seekPage
+        :seekList="seekList"
+        :formLength="3"
+        @search="reload"
+      ></seekPage>
+
+      <!-- 数据表格 -->
+      <ele-pro-table
+        ref="table"
+        :columns="columns"
+        :datasource="datasource"
+        row-key="code"
+        :page-size="20"
+        @columns-change="handleColumnChange"
+        :cache-key="cacheKeyUrl"
+      >
+        <template v-slot:code="{ row }">
+          <el-link
+            type="primary"
+            :underline="false"
+            @click="open(row, 'print')"
+            >{{ row.code }}</el-link
+          >
+        </template>
+        <template v-slot:type="{ row }">{{
+          getDictValue('质检计划类型', row.type)
+        }}</template>
+        <!-- 操作列 -->
+        <template v-slot:action="{ row }">
+          <el-link
+            type="primary"
+            :underline="false"
+            icon="el-icon-edit"
+            @click="open(row, 'print')"
+          >
+            打印
+          </el-link>
+        </template>
+      </ele-pro-table>
+    </el-card>
+    <ele-modal
+      title="合格证"
+      :visible.sync="QRvisible"
+      v-if="QRvisible"
+      width="90%"
+      append-to-body
+    >
+      <div id="printSection">
+        <component
+          :is="form.reportTemplateCode"
+          ref="template"
+          :key="form.reportTemplateCode"
+          v-if="!form.reportTemplateJson?.template"
+        ></component>
+        <div v-else v-html="form.reportTemplateJson?.template"> </div>
+      </div>
+
+      <div slot="footer">
+        <el-button @click="print">打印预览</el-button>
+
+        <el-button @click="QRvisible = false">关闭</el-button></div
+      >
+    </ele-modal>
+  </div>
+</template>
+
+<script>
+  import tabMixins from '@/mixins/tableColumnsMixin';
+  import dictMixins from '@/mixins/dictMixins';
+  import { getCertificatetList } from '@/api/qms/index.js';
+  import certificate_conformity_jangnan_template from './certificateTemplate/certificate_conformity_jangnan_template.vue';
+
+  export default {
+    mixins: [dictMixins, tabMixins],
+    components: {
+      certificate_conformity_jangnan_template
+    },
+    props: {
+      tableQuery: {
+        type: Object,
+        default: () => {
+          return {};
+        }
+      }
+    },
+    data() {
+      return {
+        cacheKeyUrl: 'qsm-c2e9664a-certificateManagement',
+
+        orderTypeList: [
+          {
+            id: 0,
+            label: '库存性订单'
+          },
+          {
+            id: 1,
+            label: '生产性订单'
+          },
+          {
+            id: 2,
+            label: '无客户生产性订单'
+          },
+          {
+            id: 4,
+            label: '不定向订单'
+          }
+        ],
+        form: {},
+        QRvisible: false,
+        // 表格列配置
+        columns: []
+      };
+    },
+    computed: {
+      seekList() {
+        return [
+          {
+            label: '订单号:',
+            value: 'orderNo',
+            type: 'input',
+            placeholder: '请输入'
+          }
+        ];
+      }
+    },
+    created() {
+      this.requestDict('质检计划类型');
+      this.requestDict('取样类型');
+      this.setColumns();
+    },
+
+    methods: {
+      setColumns() {
+        this.columns = [
+          {
+            columnKey: 'index',
+            label: '序号',
+            type: 'index',
+            width: 55,
+            align: 'center',
+            showOverflowTooltip: true,
+            fixed: 'left'
+          },
+          {
+            prop: 'code',
+            slot: 'code',
+            label: '合格证号',
+            showOverflowTooltip: true,
+            align: 'center',
+            minWidth: 130
+          },
+          {
+            prop: 'quantity',
+            label: '交验数量',
+            showOverflowTooltip: true,
+            align: 'center',
+            minWidth: 100
+          },
+          {
+            prop: 'qualifiedQuantity',
+            label: '合格数量',
+            showOverflowTooltip: true,
+            align: 'center',
+            minWidth: 110
+          },
+          {
+            prop: 'type',
+            label: '类型',
+            slot: 'type',
+            showOverflowTooltip: true,
+            align: 'center',
+            minWidth: 110
+          },
+
+          {
+            prop: 'produceTaskName',
+            minWidth: 110,
+            label: '工序名称',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'produceTaskCode',
+            minWidth: 110,
+            label: '工序编号',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'batchNo',
+            minWidth: 110,
+            label: '批次号',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'orderNo',
+            label: '订单号',
+            showOverflowTooltip: true,
+            align: 'center',
+            minWidth: 140
+          },
+          {
+            prop: 'luxuryProductCode',
+            minWidth: 110,
+            label: '顶级产品编码',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'luxuryProductName',
+            minWidth: 110,
+            label: '顶级产品名称',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'productCode',
+            minWidth: 110,
+            label: '编码',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'productName',
+            minWidth: 110,
+            label: '名称',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+          // {
+          //   prop: 'executeDeptName',
+          //   label: '下发数量',
+          //   showOverflowTooltip: true,
+          //   align: 'center',
+          //   minWidth: 110
+          // },
+
+          {
+            prop: 'measureUnit',
+            minWidth: 110,
+            label: '计量单位',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+
+          {
+            prop: 'processingType',
+            minWidth: 110,
+            label: '加工类型',
+            align: 'center',
+            formatter: (row) => {
+              return row.processingType == 2
+                ? '加工'
+                : row.processingType == 3
+                ? '装配'
+                : '';
+            },
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'workAme',
+            minWidth: 110,
+            label: '作业名称',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'contractor',
+            minWidth: 110,
+            label: '承制单位',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'orderType',
+            minWidth: 110,
+            label: '订单类型',
+            align: 'center',
+            formatter: (_row, _column, cellValue) => {
+              let obj = this.orderTypeList.find(
+                (el) => el.id == _row.orderType
+              );
+              return obj ? obj.label : '';
+            },
+            showOverflowTooltip: true
+          },
+
+          {
+            prop: 'status',
+            minWidth: 110,
+            label: '状态',
+            align: 'center',
+            isNone: this.pageName == 'list',
+            formatter: (row) => {
+              return row.status == 0
+                ? '待提交'
+                : row.status == 1
+                ? '审核中'
+                : row.status == 2
+                ? '已审核'
+                : row.status == 3
+                ? '已作废'
+                : row.status == 4
+                ? '驳回'
+                : '撤回';
+            },
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'generateType',
+            minWidth: 110,
+            label: '生成类型',
+            align: 'center',
+            formatter: (row) => {
+              return row.generateType == 1
+                ? '自动生成'
+                : row.generateType == 2
+                ? '手动新增'
+                : '';
+            },
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'createUserName',
+            minWidth: 110,
+            label: '创建人',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'createTime',
+            minWidth: 110,
+            label: '创建时间',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'approvalUserName',
+            minWidth: 110,
+            label: '审批人',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'approvalTime',
+            minWidth: 110,
+            label: '审批时间',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+          {
+            columnKey: 'action',
+            label: '操作',
+            width: 120,
+            align: 'center',
+            resizable: false,
+            isNone: this.type == 'add',
+            slot: 'action',
+            fixed: 'right',
+            showOverflowTooltip: true
+          }
+        ].filter((el) => !el.isNone);
+      },
+      /*回显类型 */
+
+      /* 表格数据源 */
+      datasource({ page, where, limit }) {
+        return getCertificatetList({
+          ...where,
+          pageNum: page,
+          size: limit,
+          ...this.tableQuery
+        });
+      },
+      /* 刷新表格 */
+      reload(where) {
+        this.$refs.table.reload({ page: 1, where: where });
+      },
+      print() {
+        const printSection = document.getElementById('printSection');
+        const printWindow = window.open('', '_blank');
+        printWindow.document.open();
+        printWindow.document.write('<html><head><title>打印预览</title>');
+        printWindow.document.write(
+          '<style>table { border-collapse: collapse; width: 100%; } td { border: 1px solid black; padding: 5px; text-align: center; }</style>'
+        );
+        printWindow.document.write('</head><body>');
+        printWindow.document.write(printSection.innerHTML);
+        printWindow.document.write('</body></html>');
+        printWindow.document.close();
+        printWindow.onload = function () {
+          printWindow.print();
+        };
+      },
+      /* 打印 */
+      open(row) {
+        this.form = row;
+        this.QRvisible = true;
+        if (!row.reportTemplateJson.template) {
+          this.$nextTick(() => {
+            console.log(this.$refs, 'this.$refs');
+            this.$refs.template.init(row);
+          });
+        }
+      }
+    }
+  };
+</script>

+ 130 - 0
src/views/batchRecord/components/tables/certificateTemplate/certificate_conformity_general_template.vue

@@ -0,0 +1,130 @@
+<template>
+  <div
+    style="
+      display: flex;
+      align-items: center;
+      justify-content: center;
+      flex-direction: column;
+      padding: 20px;
+    "
+  >
+    <div
+      style="
+        width: 100%;
+        display: flex;
+        flex-direction: column;
+        align-items: center;
+        border: 2px solid #000;
+        padding: 30px 20px;
+      "
+    >
+      <div
+        style="
+          font-size: 28px;
+          font-weight: 800;
+          text-align: center;
+          width: 100%;
+          margin-bottom: 30px;
+        "
+      >
+        合格证
+      </div>
+
+      <div
+        style="
+          width: 100%;
+          font-size: 16px;
+          margin-bottom: 40px;
+          text-align: center;
+        "
+      >
+        本产品经检验符合技术条件要求,准予按序流转。
+      </div>
+
+      <div style="width: 100%; font-size: 16px; line-height: 2.5">
+        <div style="display: flex"
+          >产品编号:
+          <span
+            style="flex: 1; margin-left: 10px; border-bottom: solid 1px #000"
+          >
+            {{ form.productCode }}
+          </span>
+        </div>
+        <div style="display: flex">
+          产品名称:
+          <span
+            style="flex: 1; margin-left: 10px; border-bottom: solid 1px #000"
+          >
+            {{ form.productName }}
+          </span></div
+        >
+        <div style="display: flex"
+          >批  号:
+          <span
+            style="flex: 1; margin-left: 10px; border-bottom: solid 1px #000"
+          >
+            {{ form.batchNo }}
+          </span></div
+        >
+        <div style="display: flex"
+          >检 验 员:
+          <span
+            style="flex: 1; margin-left: 10px; border-bottom: solid 1px #000"
+          >
+            {{ form.approvalUserName }}
+          </span></div
+        >
+        <div style="display: flex"
+          >检验时间:<span
+            style="flex: 1; margin-left: 10px; border-bottom: solid 1px #000"
+          >
+            {{ form.approvalTime }}
+          </span></div
+        >
+        <div style="display: flex"
+          >合格证号:<span
+            style="flex: 1; margin-left: 10px; border-bottom: solid 1px #000"
+          >
+            {{ form.code }}
+          </span></div
+        >
+      </div>
+
+      <div
+        style="
+          width: 100%;
+          font-size: 16px;
+          margin-top: 40px;
+          text-align: right;
+        "
+      >
+      </div>
+    </div>
+  </div>
+</template>
+
+<script>
+  import { mapGetters } from 'vuex';
+  export default {
+    computed: {
+      ...mapGetters(['user'])
+    },
+
+    data() {
+      return {
+        form: {}
+      };
+    },
+
+    methods: {
+      async init(row) {
+        this.form = row || {};
+      },
+      getValue() {
+        return this.form;
+      }
+    }
+  };
+</script>
+
+<style lang="scss"></style>

+ 147 - 0
src/views/batchRecord/components/tables/certificateTemplate/certificate_conformity_jangnan_template.vue

@@ -0,0 +1,147 @@
+<template>
+  <div
+    id="print"
+    style="
+      display: flex;
+      align-items: center;
+      justify-content: center;
+      flex-direction: column;
+    "
+  >
+    <div
+      style="
+        position: relative;
+        width: 100%;
+        display: flex;
+        flex-direction: column;
+        align-items: center;
+      "
+    >
+      <div
+        style="
+          font-size: 24px;
+          font-weight: 800;
+          text-align: center;
+          width: 100%;
+          margin-bottom: 10px;
+        "
+      >
+        半成品验收合格证
+      </div>
+
+      <div style="width: 100%; font-size: 14px; margin-bottom: 10px">
+        <span
+          style="
+            min-width: 65px;
+            border-bottom: 1px solid #000;
+            display: inline-block;
+            text-align: center;
+          "
+          >{{ form.contractor || ' ' }}</span
+        >
+        厂生产的下述半成品,经我们按产品图及技术条件要求验收合格,准予按序流转。
+      </div>
+
+      <div
+        style="
+          width: 100%;
+          font-size: 14px;
+          text-align: right;
+          margin-bottom: 10px;
+        "
+      >
+        {{ form.createTime }}
+      </div>
+    </div>
+
+    <table
+      cellspacing="0"
+      border
+      style="
+        width: 100%;
+        table-layout: fixed;
+        word-break: break-all;
+        word-wrap: break-word;
+        font-size: 12px;
+        border-collapse: collapse;
+      "
+    >
+      <thead>
+        <tr align="center">
+          <td style="padding: 5px">产品名称(代号)</td>
+          <td style="padding: 5px">半成品名称(代号)</td>
+          <td style="padding: 5px">批号</td>
+          <td style="padding: 5px">交验数</td>
+          <td style="padding: 5px">合格数</td>
+        </tr>
+      </thead>
+      <tbody>
+        <tr align="center" v-if="form?.productName">
+          <td style="padding: 5px">{{ form.luxuryProductName }}</td>
+          <td style="padding: 5px">{{ form.productName }}</td>
+          <td style="padding: 5px">{{ form.batchNo }}</td>
+          <td style="padding: 5px">{{ form.quantity }}</td>
+          <td style="padding: 5px">{{ form.qualifiedQuantity }}</td>
+        </tr>
+        <tr align="center">
+          <td style="padding: 5px"></td>
+          <td style="padding: 5px"></td>
+          <td style="padding: 5px"></td>
+          <td style="padding: 5px"></td>
+          <td style="padding: 5px">&nbsp;</td>
+        </tr>
+        <tr>
+          <td colspan="5" style="padding: 5px; text-align: left">
+            <div style="width: 100%; height: 100px">
+              重要记事:
+
+              <span v-if="type == 'print'"> {{ form.remark }}</span>
+            </div>
+          </td>
+        </tr>
+      </tbody>
+    </table>
+
+    <div
+      style="
+        width: 100%;
+        font-size: 14px;
+        margin-top: 10px;
+        display: flex;
+        justify-content: space-around;
+      "
+    >
+      <div>主管:{{ form.createUserName }}</div>
+      <div>验收者:{{ form.approvalUserName }}</div>
+    </div>
+  </div>
+</template>
+
+<script>
+  import { mapGetters } from 'vuex';
+  export default {
+    name: 'print',
+    computed: {
+      ...mapGetters(['user'])
+    },
+    props: {
+      type: String
+    },
+    data() {
+      return {
+        form: {}
+      };
+    },
+
+    methods: {
+      async init(row) {
+        this.form = row || {};
+      },
+      getValue() {
+        return this.form;
+      }
+    }
+  };
+</script>
+
+<style lang="scss"></style>

+ 271 - 0
src/views/batchRecord/components/tables/qualityReportApproval.vue

@@ -0,0 +1,271 @@
+<template>
+  <div class="ele-body">
+    <el-card shadow="never">
+      <seek-page
+        :seekList="seekList"
+        @search="search"
+        ref="search"
+        :keyValue="'qms-inspectionReport-index-search'"
+      ></seek-page>
+
+      <ele-pro-table
+        ref="table"
+        :columns="columns"
+        :datasource="datasource"
+        :pageSize="20"
+        :pageSizes="[20, 30, 40, 50, 100]"
+        @columns-change="handleColumnChange"
+        :cache-key="cacheKeyUrl"
+        row-key="id"
+      >
+        <template v-slot:reportNumber="{ row }">
+          <el-link type="primary" :underline="false" @click="open(row)">{{
+            row.reportNumber
+          }}</el-link>
+        </template>
+
+        <!-- 操作列 -->
+        <template v-slot:action="{ row }">
+          <el-link
+            type="primary"
+            :underline="false"
+            icon="el-icon-edit"
+            @click="open(row, 'print')"
+          >
+            打印
+          </el-link></template
+        >
+      </ele-pro-table>
+    </el-card>
+    <ele-modal
+      title="质检报告"
+      :visible.sync="detailVisible"
+      v-if="detailVisible"
+      width="90%"
+      append-to-body
+    >
+      <div id="printSection">
+        <div v-html="template"> </div>
+      </div>
+
+      <div slot="footer">
+        <el-button @click="print">打印预览</el-button>
+
+        <el-button @click="detailVisible = false">关闭</el-button></div
+      >
+    </ele-modal>
+  </div>
+</template>
+<script>
+  import dictMixins from '@/mixins/dictMixins';
+  import tabMixins from '@/mixins/tableColumnsMixin';
+  import { getQualityReportApproval } from '@/api/qms/index.js';
+
+  export default {
+    mixins: [dictMixins, tabMixins],
+    components: {},
+    props: {
+      tableQuery: {
+        type: Object,
+        default: () => {
+          return {};
+        }
+      }
+    },
+    data() {
+      return {
+        cacheKeyUrl: 'qsm-c2e9664a-inspectionReport-index',
+
+        detailVisible: false,
+        template: '',
+        columns: [
+          {
+            type: 'index',
+            columnKey: 'index',
+            align: 'center',
+            label: '序号',
+            width: 55,
+            showOverflowTooltip: true,
+            fixed: 'left'
+          },
+          {
+            prop: 'reportNumber',
+            label: '报告编码',
+            slot: 'reportNumber',
+            align: 'center',
+            width: 180,
+            showOverflowTooltip: true,
+            fixed: 'left'
+          },
+          {
+            prop: 'code',
+            label: '质检工单编码',
+            // slot: 'code',
+            align: 'center',
+            width: 180,
+            showOverflowTooltip: true
+          },
+
+          {
+            prop: 'productCode',
+            width: 120,
+            label: '产品编码',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'productName',
+            width: 120,
+            label: '产品名称',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'specification',
+            label: '规格',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'brandNo',
+            label: '牌号',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+
+          {
+            label: '创建时间',
+            prop: 'reportDate',
+            align: 'center',
+            width: 160
+          },
+          {
+            label: '创建人',
+            prop: 'reportTemplateCreateUserName',
+            align: 'center',
+            width: 160
+          },
+          {
+            label: '审批时间',
+            prop: 'reportApprovalTime',
+            align: 'center',
+            width: 160
+          },
+          {
+            label: '审批人',
+            prop: 'reportApprovalUserName',
+            align: 'center',
+            width: 160
+          },
+          {
+            prop: 'reportApprovalStatus',
+            label: '审批状态',
+            align: 'center',
+            width: 80,
+            formatter: (row, column, cellValue) => {
+              switch (cellValue) {
+                case 0:
+                  return '未提交';
+                case 1:
+                  return '审核中';
+                case 2:
+                  return '已审核';
+                case 3:
+                  return '审核不通过';
+                case 7:
+                  return '作废';
+                default:
+                  return '';
+              }
+            }
+          },
+          {
+            columnKey: 'action',
+            label: '操作',
+            align: 'center',
+            width: 120,
+            resizable: false,
+            slot: 'action',
+            fixed: 'right'
+          }
+        ],
+        statusList: [
+          { value: 0, label: '未提交' },
+          { value: 1, label: '审核中' },
+          { value: 2, label: '已审核' },
+          { value: 3, label: '审核不通过' },
+          { value: 7, label: '作废' }
+        ]
+      };
+    },
+    created() {},
+    computed: {
+      seekList() {
+        return [
+          {
+            label: '报告编码:',
+            value: 'reportNumber',
+            type: 'input',
+            placeholder: ''
+          },
+          {
+            label: '工单编码:',
+            value: 'code',
+            type: 'input',
+            placeholder: ''
+          },
+          {
+            label: '工单名称:',
+            value: 'name',
+            type: 'input',
+            placeholder: ''
+          },
+          {
+            label: '审批状态:',
+            value: 'reportApprovalStatus',
+            type: 'select',
+            placeholder: '',
+            planList: this.statusList
+          }
+        ];
+      }
+    },
+    methods: {
+      async datasource({ page, where, limit }) {
+        return getQualityReportApproval({
+          ...where,
+          pageNum: page,
+          ...this.tableQuery,
+          size: limit
+        });
+      },
+      search(where) {
+        this.$refs.table.reload({
+          where: where
+          // page: 1
+        });
+      },
+      print() {
+        const printSection = document.getElementById('printSection');
+        const printWindow = window.open('', '_blank');
+        printWindow.document.open();
+        printWindow.document.write('<html><head><title>打印预览</title>');
+        printWindow.document.write(
+          '<style>table { border-collapse: collapse; width: 100%; } td { border: 1px solid black; padding: 5px; text-align: center; }</style>'
+        );
+        printWindow.document.write('</head><body>');
+        printWindow.document.write(printSection.innerHTML);
+        printWindow.document.write('</body></html>');
+        printWindow.document.close();
+        printWindow.onload = function () {
+          printWindow.print();
+        };
+      },
+      /* 打印 */
+      open(row) {
+        this.template = row.reportTemplateJson.template;
+        this.detailVisible = true;
+      }
+    }
+  };
+</script>

+ 11 - 1
src/views/batchRecord/index.vue

@@ -204,6 +204,8 @@
   import deviceBatchRecordTable from './components/tables/deviceBatchRecordTable.vue';
   import craftFilesTable from './components/tables/craftFilesTable.vue';
   import qualityInspection from './components/tables/qualityInspection.vue';
+  import certificate from './components/tables/certificate.vue';
+  import qualityReportApproval from './components/tables/qualityReportApproval.vue';
 
   export default {
     components: {
@@ -217,7 +219,7 @@
       batchRecordTable,
       deviceBatchRecordTable,
       craftFilesTable,
-      qualityInspection
+      qualityInspection,certificate,qualityReportApproval
     },
     name: 'batchRecord',
     mixins: [dictMixins, tableColumnsMixin],
@@ -263,6 +265,14 @@
           {
             name: '首件两检',
             componentName: 'qualityInspection'
+          },
+          {
+            name: '质检报告',
+            componentName: 'qualityReportApproval'
+          },
+          {
+            name: '合格证',
+            componentName: 'certificate'
           }
         ],
         activeType: '生产工单',