2213980799@qq.com vor 1 Jahr
Ursprung
Commit
a33de40490

+ 118 - 0
public/fromQRCode/designDrawing.html

@@ -0,0 +1,118 @@
+<!DOCTYPE html>
+<html>
+    <head>
+        <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+        <meta http-equiv="X-UA-Compatible" content="IE=edge">
+        <meta name="viewport" content="width=device-width,initial-scale=1.0">
+        <meta name="apple-mobile-web-app-capable" content="yes">
+        <meta name="apple-mobile-web-app-status-bar-style" content="black">
+        <meta name="format-detection" content="telephone=no">
+        <meta http-equiv="X-UA-Compatible" content="chrome=1" >
+        <title>湖南宝悦新型建材有限公司</title>
+        <style>
+            *{
+                outline: 0;
+                padding: 0;
+                margin: 0;
+                border: none;
+                box-sizing: border-box;
+                background-size: contain;
+                background-position: center;
+                background-repeat: no-repeat;
+            }
+            ul,ol{
+                list-style: none outside none;
+            }
+            ul.product-info {
+                padding: 20px;
+            }
+                ul.product-info > li {
+                    line-height: 30px;
+                    font-size: 14px;
+                }
+        </style>
+    </head>
+
+    <body>
+        <ul class="product-info">
+            <li>
+                <label for="">产品名称:</label>
+                <span id="productName">-</span>
+            </li>
+            <li>
+                <label for="">规&emsp;格:</label>
+                <span id="specification">-</span>
+            </li>
+            <li>
+                <label for="">编&emsp;码:</label>
+                <span id="productCode">-</span>
+            </li>
+            <li>
+                <label for="">批次号:</label>
+                <span id="batchNo">-</span>
+            </li>
+            <li>
+                <label for="">生产日期:</label>
+                <span id="createTime">-</span>
+            </li>
+            <li>
+                <label for="">产品检验:</label>
+                <span>合格</span>
+            </li>
+            <li>
+                <label for="">质量等级:</label>
+                <span>优级</span>
+            </li>
+            <li>
+                <label for="">生产厂家:</label>
+                <span>湖南宝悦新型建材有限公司</span>
+            </li>
+            <li id="designDrawing">
+                <!-- <img style="width: 100%; margin-top: 20px;" src="./view.jpeg" alt=""> -->
+            </li>
+        </ul>
+    </body>
+    <script>
+        function str_to_obj(str){
+            var obj = {};
+            var temp = str.split('&');
+            for(var i = 0; i < temp .length;i++) {
+                var t  =  temp[i].split('=');
+                obj[t[0]]=t[1];
+            }
+            return obj
+        }
+  
+        var queryObj = str_to_obj(window.location.search.substring(1));
+        var productName = document.querySelector('#productName');
+        var specification = document.querySelector('#specification');
+        var productCode = document.querySelector('#productCode');
+        var batchNo = document.querySelector('#batchNo');
+        var createTime = document.querySelector('#createTime');
+        var designDrawing = document.querySelector('#designDrawing');
+
+        if(queryObj.productName){
+            productName.innerHTML = decodeURIComponent(queryObj.productName);
+        }
+        if(queryObj.specification){
+            specification.innerHTML =decodeURIComponent(queryObj.specification) 
+        }
+        if(queryObj.productCode){
+            productCode.innerHTML = queryObj.productCode
+        }
+        if(queryObj.batchNo){
+            batchNo.innerHTML = queryObj.batchNo;
+        }
+        if(queryObj.createTime){
+            createTime.innerHTML = decodeURIComponent(queryObj.createTime);
+        }
+
+        // if(queryObj.de) {
+        //     var _img = document.createElement('img');
+        //     _img.src = window.location.origin + '/' + decodeURIComponent(queryObj.de);
+        //     // _img.src = './view.jpeg';
+        //     _img.style = 'width: 100%; margin-top: 20px;';
+        //     designDrawing.appendChild(_img);
+        // }
+    </script>
+</html>

BIN
public/fromQRCode/view.jpeg


+ 32 - 0
src/api/inspectionStatistics/index.js

@@ -0,0 +1,32 @@
+import request from '@/utils/request';
+import { download } from '@/utils/file';
+
+
+
+// 出釜质检列表
+
+export async function getQualityControlWorkOrder(data) {
+  const res = await request.post('/qms/quality_work_order/List_count', data);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+// 出釜质检详情列表
+
+export async function queryListDetail(parentId) {
+  const res = await request.get(`/qms/quality_work_order/query_list_detail/`+parentId)
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+// 导出
+
+export async function exportList(data) {
+  const res = await request.post('/qms/quality_work_order/List_count/export', data, {responseType:'blob'} );
+  download(res.data, '出釜质检')
+}
+
+

+ 2 - 1
src/api/inspectionWork/index.js

@@ -4,7 +4,8 @@ import request from '@/utils/request';
 // 列表
 
 export async function getList(data) {
-  const res = await request.post(`/qms/quality_work_order/page?`,data);
+  const res = data.parentId?await request.post(`/qms/line_point/page`):await request.post('/qms/quality_work_order/page', data);
+  console.log(res)
   if (res.data.code == 0) {
     return res.data.data;
   }

+ 1 - 1
src/config/setting.js

@@ -21,7 +21,7 @@ export const SYSTEM_NAME = 'qms';
 export const REPEATABLE_TABS = [];
 
 // 不需要登录的路由
-export const WHITE_LIST = ['/login', '/forget'];
+export const WHITE_LIST = ['/login', '/forget','/fromQRCode/designDrawing.html'];
 
 // 开启 KeepAlive 后仍然不需要缓存的路由地址
 export const KEEP_ALIVE_EXCLUDES = [];

+ 81 - 0
src/views/inspectionStatistics/qualityControlWorkOrder/components/search.vue

@@ -0,0 +1,81 @@
+<!-- 搜索表单 --> 6
+<template>
+  <el-form label-width="77px" class="ele-form-search" @keyup.enter.native="search" @submit.native.prevent>
+    <el-row :gutter="15">
+      <el-col v-bind="styleResponsive ? { lg: 6, md: 10 } : { span: 6}">
+        <el-form-item label="批次号:">
+          <el-input clearable v-model="where.batchNo" placeholder="请输入" />
+        </el-form-item>
+      </el-col>
+
+      <el-col v-bind="styleResponsive ? { lg: 6, md: 10 } : { span: 6}">
+        <el-form-item label="计划号:">
+          <el-input clearable v-model="where.standardCode" placeholder="请输入" />
+        </el-form-item>
+      </el-col>
+      <el-col v-bind="styleResponsive ? { lg: 6, md: 10 } : { span: 6}">
+        <el-form-item label="产品编码:">
+          <el-input clearable v-model="where.productCode" placeholder="请输入" />
+        </el-form-item>
+      </el-col>
+      <el-col v-bind="styleResponsive ? { lg: 6, md: 10 } : { span: 6}">
+        <el-form-item label="产品规格:">
+          <el-input clearable v-model="where.specification" placeholder="请输入" />
+        </el-form-item>
+      </el-col>
+      
+      <el-col v-bind="styleResponsive ?{ lg: 6, md: 12 } : { span: 6 }">
+        <el-form-item label="组织机构:">
+          <auth-selection data-type="Array" v-model="where.deptIds" style="width: 100%"></auth-selection>
+        </el-form-item>
+      </el-col>
+      <el-col style="display: flex;justify-content: flex-end" v-bind="styleResponsive ? { lg: 18, md: 18 } : { span: 18}">
+        <div class="ele-form-actions">
+          <el-button type="primary" icon="el-icon-search" class="ele-btn-icon" @click="search">
+            查询
+          </el-button>
+          <el-button @click="reset">重置</el-button>
+        </div>
+      </el-col>
+    </el-row>
+  </el-form>
+</template>
+
+<script>
+export default {
+  data() {
+    // 默认表单数据
+    const defaultWhere = {
+      batchNo: '',
+      productName: '',
+      productCode: '',
+      specification:'',
+      deptIds:[]
+    };
+    return {
+      defaultWhere,
+      // 表单数据
+      where: { ...defaultWhere },
+
+    };
+  },
+  computed: {
+    // 是否开启响应式布局
+    styleResponsive() {
+      return this.$store.state.theme.styleResponsive;
+    }
+  },
+  methods: {
+    /* 搜索 */
+    search() {
+      this.$emit('search', this.where);
+    },
+    /*  重置 */
+    reset() {
+
+      this.where = { ...this.defaultWhere };
+      this.search();
+    }
+  }
+};
+</script>

+ 461 - 0
src/views/inspectionStatistics/qualityControlWorkOrder/index.vue

@@ -0,0 +1,461 @@
+<template>
+  <div class="ele-body">
+    <el-card shadow="never">
+      <search ref="search" @search="search"></search>
+      <ele-pro-table
+        ref="table"
+        row-key="batchNo"
+        :columns="columns"
+        :datasource="datasource"
+        :toolbar="false"
+        :selection.sync="selection"
+        @expand-change="expandChange"
+        class="table"
+  
+      >
+        <ele-toolbar>
+          <!-- 默认插槽添加左边内容 -->
+          <el-button type="primary" @click="exportList">导出</el-button>
+        </ele-toolbar>
+
+        <template v-slot:expand="{ row }">
+          <ele-pro-table
+            ref="table1"
+            :columns="columns1"
+            :datasource="getList(row)"
+            :toolbar="false"
+            :needPage="false"
+            :show-header="false"
+            :loading="loading"
+          >
+            <template v-slot:action="{ row }">
+              <el-link type="primary" :underline="false" @click="openEdit(row)">
+                二维码
+              </el-link>
+            </template>
+          </ele-pro-table>
+        </template>
+      </ele-pro-table>
+    </el-card>
+    <el-dialog
+      class="ele-dialog-form"
+      :visible.sync="visible"
+      :close-on-click-modal="false"
+      :close-on-press-escape="false"
+      width="400px"
+      append-to-body
+      title="二维码"
+    >
+      <div ref="printRef" class="codeDiv">
+        <div>
+          <ele-qr-code :value="text" :size="120" />
+        </div>
+
+        <div style="margin-left: 20px">
+          <div>产品名称:{{ currentRow.productName }}</div>
+          <div>产品编码:{{ currentRow.productCode }}</div>
+          <div>规格:{{ currentRow.specification }}</div>
+        </div>
+      </div>
+
+      <template v-slot:footer>
+        <el-button @click="print">打印预览</el-button>
+      </template>
+    </el-dialog>
+  </div>
+</template>
+  <script>
+import search from './components/search.vue';
+import EleQrCode from 'ele-admin/es/ele-qr-code';
+import {
+  getQualityControlWorkOrder,
+  queryListDetail,exportList
+} from '@/api/inspectionStatistics';
+import dictMixins from '@/mixins/dictMixins';
+import { printElement } from 'ele-admin';
+export default {
+  mixins: [dictMixins],
+  components: {
+    search,
+    EleQrCode
+  },
+  data() {
+    return {
+      visible: false,
+      text: '',
+      currentRow: {},
+      selection: [],
+      list: [],
+      loading: false,
+      columns: [
+        {
+          width: 45,
+          type: 'selection',
+          columnKey: 'selection',
+          align: 'center',
+          reserveSelection: true
+        },
+        {
+          width: 45,
+          type: 'expand',
+          columnKey: 'expand',
+          align: 'center',
+          slot: 'expand'
+        },
+        // {
+        //   width: 50,
+        //   type: 'index',
+        //   columnKey: 'index',
+        //   align: 'center',
+        //   label: '序号'
+        // },
+
+        {
+          prop: 'batchNo',
+          label: '批次号',
+          align: 'center',
+          width: 150
+        },
+        {
+          prop: 'qualityTime',
+          label: '日期',
+          align: 'center',
+          width: 120
+        },
+        {
+          label: '釜号',
+          prop: 'workOrderCode1',
+          align: 'center',
+          width: 60
+        },
+        {
+          label: '计划号',
+          prop: 'workOrderCode2',
+          align: 'center',
+          width: 150
+        },
+        {
+          prop: 'productName',
+          label: '产品名称',
+          align: 'center',
+          width: 150
+        },
+        {
+          prop: 'productCode',
+          label: '产品编码',
+          align: 'center',
+          width: 150
+        },
+        {
+          prop: 'specification',
+          label: '规格',
+          align: 'center',
+          width: 150
+        },
+
+        {
+          prop: 'total',
+          label: '总数量',
+          align: 'center',
+          width: 80
+        },
+        {
+          prop: 'qualifiedNumber',
+          label: '合格数',
+          align: 'center',
+          width: 80
+        },
+        {
+          prop: 'qualificationRate',
+          label: '合格率',
+          align: 'center',
+          width: 80
+        },
+        {
+          label: '报废',
+          align: 'center',
+          width: 60,
+          prop: 'scrapNumberSum'
+        },
+        {
+          prop: 'scrapReason',
+          label: '原因',
+          align: 'center',
+          width: 160
+        },
+        {
+          prop: 'scrapNumberRate',
+          label: '报废率',
+          align: 'center',
+          width: 70
+        },
+        {
+          prop: 'cutRepairNumberSum',
+          label: '切补',
+          align: 'center',
+          width: 60
+        },
+        {
+          prop: 'cutRepairReason',
+          label: '原因',
+          align: 'center',
+          width: 160
+        },
+        {
+          label: '切补率',
+          prop: 'cutRepairNumberRate',
+          width: 70
+        },
+        {
+          prop: 'correctNumberSum',
+          label: '降级修正',
+          align: 'center',
+          width: 80
+        },
+        {
+          prop: 'correctReason',
+          label: '原因',
+          align: 'center',
+          width: 150
+        },
+        {
+          label: '降级修正率',
+          prop: 'correctNumberRate',
+          width: 100
+        },
+        {
+          columnKey: 'action',
+          label: '操作',
+          width: 80,
+          align: 'center',
+          resizable: false,
+          slot: 'action',
+          showOverflowTooltip: true
+        }
+      ],
+      columns1: [
+        {
+          width: 45,
+
+          reserveSelection: true
+        },
+        {
+          width: 45
+        },
+
+        {
+          prop: '',
+          label: '批次号',
+          align: 'center',
+          width: 150
+        },
+        {
+          prop: 'qualityTime',
+          label: '日期',
+          align: 'center',
+          width: 120
+        },
+        {
+          label: '釜号',
+          prop: 'workOrderCode1',
+          align: 'center',
+          width: 60
+        },
+        {
+          label: '计划号',
+          prop: 'workOrderCode2',
+          align: 'center',
+          width: 150
+        },
+        {
+          prop: 'productName',
+          label: '产品名称',
+          align: 'center',
+          width: 150
+        },
+        {
+          prop: 'productCode',
+          label: '产品编码',
+          align: 'center',
+          width: 150
+        },
+        {
+          prop: 'specification',
+          label: '规格',
+          align: 'center',
+          width: 150
+        },
+
+        {
+          prop: 'total',
+          label: '总数量',
+          align: 'center',
+          width: 80
+        },
+        {
+          prop: 'qualifiedNumber',
+          label: '合格数',
+          align: 'center',
+          width: 80
+        },
+        {
+          prop: 'qualificationRate',
+          label: '合格率',
+          align: 'center',
+          width: 80
+        },
+        {
+          label: '报废',
+          align: 'center',
+          width: 60,
+          prop: 'scrapNumberSum'
+        },
+        {
+          prop: 'scrapReason',
+          label: '原因',
+          align: 'center',
+          width: 160
+        },
+        {
+          prop: 'scrapNumberRate',
+          label: '报废率',
+          align: 'center',
+          width: 70
+        },
+        {
+          prop: 'cutRepairNumberSum',
+          label: '切补',
+          align: 'center',
+          width: 60
+        },
+        {
+          prop: 'cutRepairReason',
+          label: '原因',
+          align: 'center',
+          width: 160
+        },
+        {
+          label: '切补率',
+          prop: 'cutRepairNumberRate',
+          width: 70
+        },
+        {
+          prop: 'correctNumberSum',
+          label: '降级修正',
+          align: 'center',
+          width: 80
+        },
+        {
+          prop: 'correctReason',
+          label: '原因',
+          align: 'center',
+          width: 150
+        },
+        {
+          label: '降级修正率',
+          prop: 'correctNumberRate',
+          width: 100
+        },
+        {
+          columnKey: 'action',
+          label: '操作',
+          width: 79,
+          align: 'center',
+          resizable: false,
+          slot: 'action',
+          showOverflowTooltip: true
+        }
+      ],
+      where:{},
+      page:'',
+      limit:""
+    };
+  },
+  created() {},
+  methods: {
+    obj_to_str(obj) {
+      var str = '';
+      for (var k in obj) {
+        str += `${k}=${obj[k]}&`;
+      }
+      return str;
+    },
+    getList(row) {
+      return this.list.filter((item) => item.batchNo == row.batchNo);
+    },
+
+    datasource({ page, where, limit, parent }) {
+      this.where=where
+      this.page=page
+      this.limit=limit
+      return getQualityControlWorkOrder({
+        ...where,
+        pageNum: page,
+        size: limit
+      });
+    },
+    async expandChange(data) {
+      if (this.list.map((item) => item.batchNo).includes(data.batchNo)) {
+        return;
+      }
+      const val = await queryListDetail(data.batchNo);
+      val.forEach(item=>{
+        item['batchNo']=data.batchNo
+      })
+      this.list.push(...val);
+    },
+
+    print() {
+      printElement(this.$refs.printRef);
+    },
+    openEdit(row) {
+      this.visible = true;
+      this.currentRow = row;
+      const paramsStr = this.obj_to_str({
+        productName: encodeURIComponent(row.productName),
+        specification: encodeURIComponent(row.specification),
+        productCode: row.productCode,
+        batchNo: row.batchNo,
+        createTime: row.qualityTime.split(' ')[0]
+        // de: encodeURIComponent(this.$props.currentRowData.designDrawing)
+      });
+      this.text =
+        window.location.origin +
+        '/qms/fromQRCode/designDrawing.html' +
+        '?' +
+        paramsStr;
+    },
+    exportList(){
+      exportList({
+        ...this.where,
+        stringList:this.selection.map(item=>item.batchNo),
+        pageNum: this.page,
+        size: this.limit
+      })
+    },
+    search(where) {
+      this.$refs.table.reload({
+        where: where,
+        page: 1
+      });
+    }
+  }
+};
+</script>
+<style lang="scss" scoped>
+.codeDiv {
+  display: flex;
+  div {
+    font-size: 16px;
+    line-height: 35px;
+  }
+}
+.ele-body {
+  :deep(.el-table--border .el-table__expanded-cell) {
+    padding: 0;
+    .el-table {
+      border: none;
+    }
+  }
+}
+</style>