Преглед изворни кода

新增合格证模板组件,优化合格证管理功能,支持多种模板选择和打印预览

yusheng пре 5 месеци
родитељ
комит
159fbf2d47

+ 28 - 15
src/api/bpm/index.js

@@ -1,12 +1,11 @@
-import request from '@/utils/request'
+import request from '@/utils/request';
 
 export async function getActivityList(query) {
-
-  const res= await request({
+  const res = await request({
     url: '/bpm/activity/list',
     method: 'get',
     params: query
-  })
+  });
 
   if (res.data.code == 0) {
     return res.data.data;
@@ -14,11 +13,10 @@ export async function getActivityList(query) {
   return Promise.reject(new Error(res.data.message));
 }
 export async function getProcessInstance(id) {
-
-  const res= await request({
+  const res = await request({
     url: '/bpm/process-instance/get?id=' + id,
-    method: 'get',
-  })
+    method: 'get'
+  });
 
   if (res.data.code == 0) {
     return res.data.data;
@@ -42,7 +40,7 @@ export async function getProcessDefinitionBpmnXML(id) {
   const res = await request({
     url: '/bpm/process-definition/get-bpmn-xml?id=' + id,
     method: 'get'
-  })
+  });
   if (res.data.code == 0) {
     return res.data.data;
   }
@@ -53,17 +51,20 @@ export async function getTaskAssignRuleList(query) {
     url: '/bpm/task-assign-rule/list',
     method: 'get',
     params: query
-  })
+  });
   if (res.data.code == 0) {
     return res.data.data;
   }
   return Promise.reject(new Error(res.data.message));
 }
 export async function processInstanceCreateAPI(data) {
-  const res = await request({
-    url: '/bpm/process-instance/create',
-    method: 'post'
-  },data)
+  const res = await request(
+    {
+      url: '/bpm/process-instance/create',
+      method: 'post'
+    },
+    data
+  );
   if (res.data.code == 0) {
     return res.data.data;
   }
@@ -74,7 +75,19 @@ export async function getModelPage(query) {
     url: '/bpm/model/page',
     method: 'get',
     params: query
-  })
+  });
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+//撤回
+export async function withdraw(query) {
+  const res = await request({
+    url: '/bpm/task/withdraw',
+    method: 'get',
+    params: query
+  });
   if (res.data.code == 0) {
     return res.data.data;
   }

+ 20 - 3
src/components/addDoc/browse.vue

@@ -4,7 +4,11 @@
     :close-on-click-modal="false"
     custom-class="ele-dialog-form"
     append-to-body
-    :fullscreen="true"
+    resizable
+    :multiple="multiple"
+    :width="width"
+    :maxable="true"
+    :fullscreen="fullscreen"
   >
     <iframe
       :src="fileUrl"
@@ -18,7 +22,7 @@
 </template>
 
 <script>
-  import { getFileType } from './util.js';
+
 
   export default {
     data() {
@@ -27,7 +31,20 @@
         showEditFlag: false
       };
     },
-
+    props: {
+      multiple: {
+        type: Boolean,
+        default: false
+      },
+      width: {
+        type: String,
+        default: '100%'
+      },
+      fullscreen: {
+         type: Boolean,
+        default: true
+      }
+    },
     methods: {
       open(row) {
         this.showEditFlag = true;

+ 191 - 0
src/views/certificateManagement/components/certificate.vue

@@ -0,0 +1,191 @@
+<template>
+  <ele-modal
+    title="合格证"
+    :visible.sync="QRvisible"
+    v-if="QRvisible"
+    width="750px"
+    append-to-body
+  >
+    <div class="switch" v-if="type == 'print'">
+      <div class="switch_left">
+        <ul>
+          <li
+            v-for="item in tabOptions"
+            :key="item.key"
+            :class="{ active: activeComp == item.key }"
+            @click="activeComp = item.key"
+          >
+            {{ item.name }}
+          </li>
+        </ul>
+      </div>
+    </div>
+    <div v-show="activeComp === 'main' && type != 'print'">
+      合格证列表:
+      <el-button type="primary" @click="add()"> 选择 </el-button>
+    </div>
+    <div id="printSection" v-show="activeComp === 'main'">
+      <!-- <certificate_conformity_jangnan_template
+        ref="template1Ref"
+        :type="printType"
+      ></certificate_conformity_jangnan_template> -->
+
+      <component
+        :is="form.reportTemplateCode"
+        ref="template1Ref"
+        :type="printType"
+        :key="form.reportTemplateCode"
+      ></component>
+    </div>
+    <bpmDetail
+      v-if="activeComp == 'bpm' && form.processInstanceId"
+      :id="form.processInstanceId"
+    ></bpmDetail>
+    <div slot="footer">
+      <el-button @click="print" v-if="type == 'print'">打印预览</el-button>
+      <el-button
+        type="primary"
+        v-if="type != 'print'"
+        :loading="loading"
+        @click="save()"
+      >
+        保存
+      </el-button>
+      <el-button
+        type="primary"
+        v-if="type != 'print'"
+        :loading="loading"
+        @click="save('sub')"
+      >
+        提交
+      </el-button>
+      <el-button @click="close">关闭</el-button>
+    </div>
+    <listCoomModal
+      ref="listCoomModalRef"
+      @success="successModal"
+    ></listCoomModal>
+  </ele-modal>
+</template>
+
+<script>
+  import { mapGetters } from 'vuex';
+  import certificate_conformity_jangnan_template from './certificate_conformity_jangnan_template.vue';
+  import certificate_conformity_general_template from './certificate_conformity_general_template.vue';
+  import listCoomModal from './listCoomModal.vue';
+  import { save, update } from '@/api/certificateManagement';
+  import bpmDetail from '@/views/bpm/processInstance/detail.vue';
+
+  export default {
+    name: 'print',
+    computed: {
+      ...mapGetters(['user'])
+    },
+    components: {
+      certificate_conformity_jangnan_template,
+      listCoomModal,
+      certificate_conformity_general_template,
+      bpmDetail
+    },
+    data() {
+      return {
+        QRvisible: false,
+        form: {
+          reportTemplateCode: '',
+          reportTemplateId: '',
+          reportTemplateName: ''
+        },
+        loading: false,
+        type: '',
+        printType: '',
+        activeComp: 'main',
+        tabOptions: [
+          { key: 'main', name: '合格证详情' },
+          { key: 'bpm', name: '流程详情' }
+        ]
+      };
+    },
+
+    methods: {
+      async open(row, type) {
+        if (type == 'add') {
+          this.form.reportTemplateCode = row.code;
+          this.form.reportTemplateId = row.id;
+          this.form.reportTemplateName = row.name;
+        } else {
+          this.form = row || {};
+        }
+
+        this.activeComp = 'main';
+        this.type = type;
+        this.printType = type;
+        this.QRvisible = true;
+        this.$nextTick(() => {
+          this.$refs.template1Ref.init(this.form);
+        });
+      },
+      add() {
+        this.$refs.listCoomModalRef.open();
+      },
+      save() {
+        let data = { ...this.form, ...this.$refs.template1Ref.getValue() };
+        let api = data.id ? update : save;
+        if (!data.productCode) {
+          this.$message.warning('请选择合格证');
+          return;
+        }
+        this.printType = 'print';
+
+        this.$nextTick(() => {
+          const printSection = document.getElementById('printSection');
+          data.reportTemplateJson = {
+            template: printSection.innerHTML
+          };
+          this.loading = true;
+
+          api(data)
+            .then((msg) => {
+              this.loading = false;
+              this.$message.success('操作成功');
+              this.$emit('reload');
+              this.close();
+            })
+            .catch((e) => {
+              this.loading = false;
+            });
+        });
+      },
+      close() {
+        this.QRvisible = false;
+        this.form = {
+          reportTemplateCode: '',
+          reportTemplateId: '',
+          reportTemplateName: ''
+        };
+      },
+      successModal(data) {
+        this.$nextTick(() => {
+          this.$refs.template1Ref.init(data);
+        });
+      },
+      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();
+        };
+      }
+    }
+  };
+</script>
+
+<style lang="scss"></style>

+ 130 - 0
src/views/certificateManagement/components/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>

+ 154 - 0
src/views/certificateManagement/components/certificate_conformity_jangnan_template.vue

@@ -0,0 +1,154 @@
+<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>
+              <el-input
+                v-else
+                type="textarea"
+                v-model="form.remark"
+                autosize
+              ></el-input>
+            </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>

+ 478 - 0
src/views/certificateManagement/components/listCoom.vue

@@ -0,0 +1,478 @@
+<template>
+  <div class="ele-body">
+    <el-card shadow="never">
+      <!-- 搜索表单 -->
+      <search @search="reload" />
+      <!-- 数据表格 -->
+      <ele-pro-table
+        ref="table"
+        :columns="columns"
+        :datasource="datasource"
+        row-key="code"
+        :page-size="20"
+        @columns-change="handleColumnChange"
+        :cache-key="cacheKeyUrl"
+      >
+        <template v-slot:toolbar>
+          <el-dropdown
+            trigger="click"
+            v-if="
+              pageName == 'management' &&
+              $hasPermission('qms:qmscertificatemanagement:save')
+            "
+          >
+            <el-button size="small" type="primary" class="ele-btn-icon">
+              新增
+            </el-button>
+            <el-dropdown-menu slot="dropdown">
+              <el-dropdown-item
+                v-for="item in reportTemplateList"
+                :key="item.id"
+                @click.native="open(item, 'add')"
+                >{{ item.name
+                }}{{
+                  '(' +
+                  item.versionSymbol +
+                  item.bigVersion +
+                  item.versionMark +
+                  item.smallVersion +
+                  ')'
+                }}</el-dropdown-item
+              >
+            </el-dropdown-menu>
+          </el-dropdown>
+        </template>
+
+        <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"
+            @click="open(row, 'edit')"
+            v-if="
+              ![1, 2, 3].includes(row.status) &&
+              pageName == 'management' &&
+              $hasPermission('qms:qmscertificatemanagement:update')
+            "
+            >修改</el-link
+          >
+          <el-link
+            type="primary"
+            :underline="false"
+            @click="approvalSubmit(row)"
+            v-if="
+              ![1, 2, 3].includes(row.status) &&
+              pageName == 'management' &&
+              $hasPermission('qms:qmscertificatemanagement:save')
+            "
+            >提交</el-link
+          >
+          <el-link
+            type="danger"
+            :underline="false"
+            @click="cancel(row)"
+            v-if="
+              ![1, 2, 3].includes(row.status) &&
+              pageName == 'management' &&
+              $hasPermission('qms:qmscertificatemanagement:cancel')
+            "
+            >作废</el-link
+          >
+          <el-link
+            type="primary"
+            :underline="false"
+            @click="withdraw(row)"
+            v-if="[1].includes(row.status) && pageName == 'management'"
+            >撤回</el-link
+          >
+          <el-link
+            type="primary"
+            :underline="false"
+            icon="el-icon-edit"
+            @click="open(row, 'print')"
+          >
+            打印
+          </el-link>
+        </template>
+      </ele-pro-table>
+    </el-card>
+
+    <certificate ref="certificateREf" @reload="reload" />
+    <processSubmitDialog
+      :processSubmitDialogFlag.sync="processSubmitDialogFlag"
+      v-if="processSubmitDialogFlag"
+      ref="processSubmitDialogRef"
+      @reload="reload"
+    ></processSubmitDialog>
+  </div>
+</template>
+
+<script>
+  import search from './search.vue';
+  import certificate from './certificate.vue';
+  import processSubmitDialog from '@/components/processSubmitDialog/processSubmitDialog.vue';
+  import { getQmsReportTemplatePageList } from '@/api/inspectionWork';
+
+  import tabMixins from '@/mixins/tableColumnsMixin';
+  import { getList, getById, cancel } from '@/api/certificateManagement';
+  import { withdraw } from '@/api/bpm';
+  import dictMixins from '@/mixins/dictMixins';
+  export default {
+    props: {
+      pageName: {
+        type: String,
+        default: ''
+      },
+      type: {
+        type: String,
+        default: ''
+      }
+    },
+    components: {
+      search,
+      certificate,
+      processSubmitDialog
+    },
+    mixins: [dictMixins, tabMixins],
+    data() {
+      return {
+        cacheKeyUrl: 'qsm-c2e9664a-certificateManagement',
+        processSubmitDialogFlag: false,
+        orderTypeList: [
+          {
+            id: 0,
+            label: '库存性订单'
+          },
+          {
+            id: 1,
+            label: '生产性订单'
+          },
+          {
+            id: 2,
+            label: '无客户生产性订单'
+          },
+          {
+            id: 4,
+            label: '不定向订单'
+          }
+        ],
+        processSubmitDialogFlag: false,
+        // 表格列配置
+        reportTemplateList:[],
+        columns: []
+      };
+    },
+    created() {
+      this.requestDict('质检计划类型');
+      this.requestDict('取样类型');
+      this.setColumns();
+      this.getReportTemplateList();
+    },
+
+    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: 'remark',
+          //   minWidth: 180,
+          //   label: '重要记事',
+          //   align: 'center',
+          //   showOverflowTooltip: true
+          // },
+          {
+            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: 'executeUserName',
+            minWidth: 110,
+            label: '计量单位',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+
+          {
+            prop: 'processingType',
+            minWidth: 110,
+            label: '加工类型',
+            align: 'center',
+            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: '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: 220,
+            align: 'center',
+            resizable: false,
+            isNone: this.type == 'add',
+            slot: 'action',
+            fixed: 'right',
+            showOverflowTooltip: true
+          }
+        ].filter((el) => !el.isNone);
+      },
+      /*回显类型 */
+
+      /* 表格数据源 */
+      datasource({ page, where, limit }) {
+        if (this.pageName == 'management') {
+          where['generateType'] = 2;
+        }
+        return getList({
+          ...where,
+          pageNum: page,
+          size: limit
+        });
+      },
+      /* 刷新表格 */
+      reload(where) {
+        this.$refs.table.reload({ page: 1, where: where });
+      },
+      approvalSubmit(res) {
+        this.processSubmitDialogFlag = true;
+        this.$nextTick(() => {
+          let params = {
+            businessId: res.id,
+            businessKey: 'qms_certificate',
+            formCreateUserId: res.createUserId,
+            variables: {
+              businessCode: res.code,
+              businessName: res.productName,
+              businessType: '合格证'
+            }
+          };
+          this.$refs.processSubmitDialogRef.init(params);
+        });
+      },
+      /* 报工 */
+      async open(row, type) {
+        this.$refs.certificateREf.open(row, type);
+        // this.$refs.addRef.open(row, type);
+      },
+      getReportTemplateList() {
+        getQmsReportTemplatePageList({
+          pageNum: 1,
+          pageSize: 999,
+          isEnabled: 1,
+          type: 1
+        })
+          .then((res) => {
+            this.reportTemplateList = res.list;
+          })
+          .catch((err) => {
+            console.error('获取报表模板列表失败:', err);
+            // this.$message.error('获取报表模板列表失败:' + (err.message || '操作异常'));
+          });
+      },
+      /* 删除 */
+      cancel(row) {
+        cancel([row.id])
+          .then((msg) => {
+            this.$message.success('作废成功');
+            this.reload();
+          })
+          .catch((e) => {});
+      },
+      withdraw(row) {
+        withdraw({
+          processInstanceId: row.processInstanceId,
+          businessId: row.id,
+          processDefinitionKey: 'qms_certificate'
+        })
+          .then((msg) => {
+            this.$message.success('撤回成功');
+            this.reload();
+          })
+          .catch((e) => {});
+      }
+    }
+  };
+</script>

+ 361 - 0
src/views/certificateManagement/components/listCoomModal.vue

@@ -0,0 +1,361 @@
+<template>
+  <ele-modal
+    title="合格证列表"
+    :visible.sync="visible"
+    width="90%"
+    append-to-body
+  >
+    <div class="ele-body">
+      <el-card shadow="never">
+        <!-- 搜索表单 -->
+        <search @search="reload" />
+        <!-- 数据表格 -->
+        <ele-pro-table
+          ref="table"
+          :columns="columns"
+          :datasource="datasource"
+          row-key="code"
+          :page-size="20"
+          @columns-change="handleColumnChange"
+          :cache-key="cacheKeyUrl"
+          :selection.sync="selection"
+          :needPage="false"
+          height="500px"
+          full-height="calc(100vh - 200px)"
+        >
+          <template v-slot:type="{ row }">{{
+            getDictValue('质检计划类型', row.type)
+          }}</template>
+        </ele-pro-table>
+      </el-card>
+    </div>
+    <div slot="footer">
+      <el-button type="primary" @click="save()"> 确认 </el-button>
+      <el-button @click="visible = false">关闭</el-button>
+    </div>
+  </ele-modal>
+</template>
+
+<script>
+  import search from './search.vue';
+
+  import tabMixins from '@/mixins/tableColumnsMixin';
+  import { getList } from '@/api/certificateManagement';
+  import dictMixins from '@/mixins/dictMixins';
+  export default {
+    components: {
+      search
+    },
+    mixins: [dictMixins, tabMixins],
+    data() {
+      return {
+        cacheKeyUrl: 'qsm-c2e9664a-certificateManagement',
+        selection: [],
+        orderTypeList: [
+          {
+            id: 0,
+            label: '库存性订单'
+          },
+          {
+            id: 1,
+            label: '生产性订单'
+          },
+          {
+            id: 2,
+            label: '无客户生产性订单'
+          },
+          {
+            id: 4,
+            label: '不定向订单'
+          }
+        ],
+        visible: false,
+        // 表格列配置
+        columns: []
+      };
+    },
+    created() {
+      this.requestDict('质检计划类型');
+      this.requestDict('取样类型');
+    },
+
+    methods: {
+      open() {
+        this.visible = true;
+        this.setColumns();
+      },
+
+      duplicateChecking() {
+        let is = false;
+        let key = ['type', 'batchNo', 'produceTaskName', 'orderNo'];
+        key.forEach((_key) => {
+          if (
+            this.selection.some((item) => item[_key] != this.selection[0][_key])
+          ) {
+            is = true;
+          }
+        });
+        //  if(){
+
+        //  }
+        return is;
+      },
+      save() {
+        if (!this.selection.length) {
+          this.$message.error('请选择合格证');
+          return;
+        }
+
+        if (this.selection.length > 1 && this.duplicateChecking()) {
+          this.$message.warning(
+            '合格证类型、批次号、工序、订单号必须保持一致!'
+          );
+          return;
+        }
+
+        this.visible = false;
+        let data = this.selection[0];
+
+        this.$emit('success', {
+          batchNo: data.batchNo,
+          certificateId: this.selection.map((item) => item.id).toString(),
+          contractor: data.contractor,
+          generateType: 2,
+          isMerged: 1,
+          luxuryProductCode: data.luxuryProductCode,
+          luxuryProductName: data.luxuryProductName,
+          orderNo: data.orderNo,
+          orderType: data.orderType,
+          productCode: data.productCode,
+          productName: data.productName,
+          processingType: data.processingType,
+          produceTaskCode: data.produceTaskCode,
+          produceTaskId: data.produceTaskId,
+          produceTaskName: data.produceTaskName,
+          qualityWorkOrderId: data.qualityWorkOrderId,
+          // reportTemplateId: data.reportTemplateId,
+          // reportTemplateCode: data.reportTemplateCode,
+          // reportTemplateName: data.reportTemplateName,
+          type: data.type,
+          workAme: data.workAme,
+          qualifiedQuantity: this.selection.reduce(
+            (total, item) => total + item.qualifiedQuantity,
+            0
+          ),
+          quantity: this.selection.reduce(
+            (total, item) => total + item.quantity,
+            0
+          )
+        });
+      },
+      setColumns() {
+        this.columns = [
+          {
+            columnKey: 'index',
+            label: '序号',
+            type: 'index',
+            width: 55,
+            align: 'center',
+            showOverflowTooltip: true,
+            fixed: 'left'
+          },
+          {
+            width: 45,
+            type: 'selection',
+            columnKey: 'selection',
+            align: 'center'
+          },
+          {
+            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: 'remark',
+          //   minWidth: 180,
+          //   label: '重要记事',
+          //   align: 'center',
+          //   showOverflowTooltip: true
+          // },
+          {
+            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: 'executeUserName',
+            minWidth: 110,
+            label: '计量单位',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+
+          {
+            prop: 'processingType',
+            minWidth: 110,
+            label: '加工类型',
+            align: 'center',
+            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: '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
+          }
+        ].filter((el) => !el.isNone);
+      },
+      /*回显类型 */
+
+      /* 表格数据源 */
+      datasource({ page, where, limit }) {
+        return getList({
+          ...where,
+          generateType: 1,
+          // isMerged: 0,
+          pageNum: 1,
+          size: 999
+        });
+      },
+      /* 刷新表格 */
+      reload(where) {
+        this.$refs.table.reload({ page: 1, where: where });
+      }
+    }
+  };
+</script>

+ 2 - 14
src/views/certificateManagement/components/search.vue

@@ -4,14 +4,9 @@
 </template>
 
 <script>
-  import { getList } from '@/api/inspectionStandard';
-  import { recordingMethodList } from '@/utils/util.js';
-
   export default {
     data() {
-      return {
-        qualityStandardList: []
-      };
+      return {};
     },
     computed: {
       seekList() {
@@ -38,14 +33,7 @@
         ];
       }
     },
-    created() {
-      getList({
-        pageNum: 1,
-        size: -1
-      }).then((res) => {
-        this.qualityStandardList = res.list;
-      });
-    },
+    created() {},
     methods: {
       /* 搜索 */
       search(e) {

+ 0 - 279
src/views/certificateManagement/index.vue

@@ -1,279 +0,0 @@
-<template>
-  <div class="ele-body">
-    <el-card shadow="never">
-      <!-- 搜索表单 -->
-      <search @search="reload" />
-      <!-- 数据表格 -->
-      <ele-pro-table
-        ref="table"
-        :columns="columns"
-        :datasource="datasource"
-        row-key="code"
-        :page-size="20"
-        @columns-change="handleColumnChange"
-        :cache-key="cacheKeyUrl"
-      >
-        <template v-slot:toolbar>
-          <el-button
-            size="small"
-            type="primary"
-            class="ele-btn-icon"
-            @click="open('', 'add')"
-          >
-            新增
-          </el-button>
-        </template>
-        <template v-slot:code="{ row }">
-          <el-link
-            type="primary"
-            :underline="false"
-            @click="open(row, 'detail')"
-            >{{ row.code }}</el-link
-          >
-        </template>
-
-        <!-- 操作列 -->
-        <template v-slot:action="{ row }">
-          <el-link
-            type="primary"
-            :underline="false"
-            icon="el-icon-edit"
-            @click="open(row, 'edit')"
-          >
-            打印
-          </el-link>
-        </template>
-      </ele-pro-table>
-    </el-card>
-    <!-- 编辑弹窗 -->
-    <add ref="addRef" @reload="reload" />
-  </div>
-</template>
-
-<script>
-  import search from './components/search.vue';
-  import add from './components/add.vue';
-
-  import tabMixins from '@/mixins/tableColumnsMixin';
-  import { getList, getById } from '@/api/certificateManagement';
-  import dictMixins from '@/mixins/dictMixins';
-
-  export default {
-    components: {
-      search,
-      add
-    },
-    mixins: [dictMixins, tabMixins],
-    data() {
-      return {
-        cacheKeyUrl: 'qsm-c2e9664a-certificateManagement',
-
-        processSubmitDialogFlag: false,
-        // 表格列配置
-        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: 'remark',
-            minWidth: 180,
-            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: 'executeUserName',
-            minWidth: 110,
-            label: '计量单位',
-            align: 'center',
-            showOverflowTooltip: true
-          },
-
-          {
-            prop: 'processingType',
-            minWidth: 110,
-            label: '加工类型',
-            align: 'center',
-            showOverflowTooltip: true
-          },
-          {
-            prop: 'processingType',
-            minWidth: 110,
-            label: '作业名称',
-            align: 'center',
-            showOverflowTooltip: true
-          },
-          {
-            prop: 'contractor',
-            minWidth: 110,
-            label: '承制单位',
-            align: 'center',
-            showOverflowTooltip: true
-          },
-          {
-            prop: 'orderType',
-            minWidth: 110,
-            label: '订单类型',
-            align: 'center',
-            showOverflowTooltip: true
-          },
-
-          {
-            prop: 'createUserName',
-            minWidth: 110,
-            label: '开证人',
-            align: 'center',
-            showOverflowTooltip: true
-          },
-          {
-            prop: 'createTime',
-            minWidth: 110,
-            label: '开证时间',
-            align: 'center',
-            showOverflowTooltip: true
-          },
-          {
-            prop: 'status',
-            minWidth: 110,
-            label: '状态',
-            align: 'center',
-            formatter: (row) => {
-              return row.status == 1 ? '正常' : '已作废';
-            },
-            showOverflowTooltip: true
-          },
-          {
-            columnKey: 'action',
-            label: '操作',
-            width: 220,
-            align: 'center',
-            resizable: false,
-            slot: 'action',
-            fixed: 'right',
-            showOverflowTooltip: true
-          }
-        ]
-      };
-    },
-    created() {
-      this.requestDict('质检计划类型');
-      this.requestDict('取样类型');
-    },
-
-    methods: {
-      /*回显类型 */
-
-      /* 表格数据源 */
-      datasource({ page, where, limit }) {
-        return getList({
-          ...where,
-          pageNum: page,
-          size: limit
-        });
-      },
-      /* 刷新表格 */
-      reload(where) {
-        this.$refs.table.reload({ page: 1, where: where });
-      },
-
-      /* 报工 */
-      async open(row, type) {
-        this.$refs.addRef.open(row, type);
-      },
-
-      /* 删除 */
-      remove(row) {
-        const loading = this.$loading({ lock: true });
-
-        removeItem([row.id])
-          .then((msg) => {
-            loading.close();
-            this.$message.success('删除' + msg);
-            this.reload();
-          })
-          .catch((e) => {
-            loading.close();
-          });
-      }
-    }
-  };
-</script>

+ 19 - 0
src/views/certificateManagement/list.vue

@@ -0,0 +1,19 @@
+<template>
+  <div><listCoom pageName="list"> </listCoom> </div>
+</template>
+
+<script>
+  import listCoom from './components/listCoom.vue';
+
+  export default {
+    components: {
+      listCoom
+    },
+    data() {
+      return {};
+    },
+    created() {},
+
+    methods: {}
+  };
+</script>

+ 19 - 0
src/views/certificateManagement/management.vue

@@ -0,0 +1,19 @@
+<template>
+  <div><listCoom pageName="management"></listCoom> </div>
+</template>
+
+<script>
+  import listCoom from './components/listCoom.vue';
+
+  export default {
+    components: {
+      listCoom
+    },
+    data() {
+      return {};
+    },
+    created() {},
+
+    methods: {}
+  };
+</script>

+ 14 - 2
src/views/inspectionWork/components/experimentReport.vue

@@ -8,7 +8,6 @@
     append-to-body
     width="80%"
     :maxable="true"
-
   >
     <header-title title="基础信息"> </header-title>
     <el-form
@@ -634,7 +633,20 @@
           this.form.qualityStandardName = row.qualityStandardName;
           this.form.qualityStandardId = row.qualityStandardId;
           this.form.qualityWorkOrderId = row.qualityWorkOrderId;
-          this.form.processRequirementsJson = row.defaultValue;
+          this.form.processRequirementsJson = '';
+          if (row.symbol) {
+            this.form.processRequirementsJson += row.symbol;
+          }
+          if (row.textType == 3) {
+            this.form.processRequirementsJson +=
+              row.minValue + '-' + row.maxValue;
+          } else {
+            this.form.processRequirementsJson += row.defaultValue;
+          }
+          if (row.unitName) {
+            this.form.processRequirementsJson += row.unitName;
+          }
+
           this.$nextTick(async () => {
             if (row.procedureJson.tempJson) {
               this.$refs.experimentationProcess1.init(

+ 2 - 1
src/views/inspectionWork/index.vue

@@ -737,7 +737,8 @@
         getQmsReportTemplatePageList({
           pageNum: 1,
           pageSize: 999,
-          isEnabled: 1
+          isEnabled: 1,
+          type: 0
         })
           .then((res) => {
             this.reportTemplateList = res.list;