695593266@qq.com před 11 měsíci
rodič
revize
edb2df145b

+ 494 - 495
src/views/inspectionStatistics/qualityControlWorkOrder/index.vue

@@ -7,7 +7,6 @@
         row-key="batchNo"
         :columns="columns"
         :datasource="datasource"
-        :toolbar="false"
         :selection.sync="selection"
         @expand-change="expandChange"
         class="table"
@@ -22,7 +21,6 @@
             ref="table1"
             :columns="columns1"
             :datasource="getList(row)"
-            :toolbar="false"
             :needPage="false"
             :show-header="false"
             :loading="loading"
@@ -82,7 +80,7 @@
               <h4 class="level" style="font-family: '宋体'">优级</h4>
             </aside>
             <aside class="right">
-              <ele-qr-code :value="text" :size="120" level="L"  />
+              <ele-qr-code :value="text" :size="120" level="L" />
             </aside>
           </footer>
         </div>
@@ -142,527 +140,528 @@
     </el-dialog>
   </div>
 </template>
-  <script>
-import search from './components/search.vue';
-import EleQrCode from 'ele-admin/es/ele-qr-code';
-import {
-  getQualityControlWorkOrder,
-  queryListDetail,
-  exportList,
-  savePicture,save
-} from '@/api/inspectionStatistics';
-import dictMixins from '@/mixins/dictMixins';
-import { printElement } from 'ele-admin';
-import WithView from '@/components/upload/WithView.vue';
-import { getImageUrl } from '@/utils/file';
+<script>
+  import search from './components/search.vue';
+  import EleQrCode from 'ele-admin/es/ele-qr-code';
+  import {
+    getQualityControlWorkOrder,
+    queryListDetail,
+    exportList,
+    savePicture,
+    save
+  } from '@/api/inspectionStatistics';
+  import dictMixins from '@/mixins/dictMixins';
+  import { printElement } from 'ele-admin';
+  import WithView from '@/components/upload/WithView.vue';
+  import { getImageUrl } from '@/utils/file';
 
-export default {
-  mixins: [dictMixins],
-  components: {
-    search,
-    EleQrCode,
-    WithView
-  },
-  data() {
-    return {
-      visible: false,
-      remarkVisible: false,
-      text: '',
-      currentRow: {remark:""},
-      selection: [],
-      list: [],
-      loading: false,
-      imgVisible: false,
-      imgs: {},
-      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: '序号'
-        // },
+  export default {
+    mixins: [dictMixins],
+    components: {
+      search,
+      EleQrCode,
+      WithView
+    },
+    data() {
+      return {
+        visible: false,
+        remarkVisible: false,
+        text: '',
+        currentRow: { remark: '' },
+        selection: [],
+        list: [],
+        loading: false,
+        imgVisible: false,
+        imgs: {},
+        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: 'famBeNo',
-          align: 'center',
-          width: 60
-        },
-        {
-          label: '计划号',
-          prop: 'planCode',
-          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: 'batchNo',
+            label: '批次号',
+            align: 'center',
+            width: 150
+          },
+          {
+            prop: 'qualityTime',
+            label: '日期',
+            align: 'center',
+            width: 120
+          },
+          {
+            label: '釜号',
+            prop: 'famBeNo',
+            align: 'center',
+            width: 60
+          },
+          {
+            label: '计划号',
+            prop: 'planCode',
+            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,
+          {
+            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
-        },
+            reserveSelection: true
+          },
+          {
+            width: 45
+          },
 
-        {
-          prop: '',
-          label: '批次号',
-          align: 'center',
-          width: 150
-        },
-        {
-          prop: 'qualityTime',
-          label: '日期',
-          align: 'center',
-          width: 120
-        },
-        {
-          label: '釜号',
-          prop: 'famBeNo',
-          align: 'center',
-          width: 60
-        },
-        {
-          label: '计划号',
-          prop: 'planCode',
-          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: '',
+            label: '批次号',
+            align: 'center',
+            width: 150
+          },
+          {
+            prop: 'qualityTime',
+            label: '日期',
+            align: 'center',
+            width: 120
+          },
+          {
+            label: '釜号',
+            prop: 'famBeNo',
+            align: 'center',
+            width: 60
+          },
+          {
+            label: '计划号',
+            prop: 'planCode',
+            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);
-    },
-    imgVisibleOpen() {
-      this.imgVisible = true;
-      console.log(this.currentRow.picture, 'this.currentRow.picture');
-      this.imgs = JSON.parse(JSON.stringify(this.currentRow.picture));
+          {
+            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: ''
+      };
     },
-    savePicture() {
-      savePicture({
-        id: this.currentRow.id,
-        remark: this.currentRow.remark,
-        picture:[this.imgs]
-      });
-      this.currentRow.picture = this.imgs;
-      this.setCode();
-      this.handleClose();
-      this.$refs.search.search();
-    },
-
-    save() {
-      save({
-        id: this.currentRow.id,
-        remark: this.currentRow.remark
-      });
-      this.remarkVisible = false;
-      this.$refs.search.search();
+    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);
+      },
+      imgVisibleOpen() {
+        this.imgVisible = true;
+        console.log(this.currentRow.picture, 'this.currentRow.picture');
+        this.imgs = JSON.parse(JSON.stringify(this.currentRow.picture));
+      },
+      savePicture() {
+        savePicture({
+          id: this.currentRow.id,
+          remark: this.currentRow.remark,
+          picture: [this.imgs]
+        });
+        this.currentRow.picture = this.imgs;
+        this.setCode();
+        this.handleClose();
+        this.$refs.search.search();
+      },
 
-    },
-    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);
-    },
+      save() {
+        save({
+          id: this.currentRow.id,
+          remark: this.currentRow.remark
+        });
+        this.remarkVisible = false;
+        this.$refs.search.search();
+      },
+      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);
-    },
-    handleClose() {
-      this.$refs.WithViewRef.clearImg();
-      this.imgVisible = false;
-    },
-    close() {
-      this.remarkVisible = false;
-      // this.currentRow.remark = '';
-    },
-    openEdit(row) {
-      this.visible = true;
-      if (row) {
-        this.currentRow = row;
-      }
-      if (
-        Array.isArray(this.currentRow.picture) &&
-        this.currentRow.picture.length > 0
-      ) {
-        this.currentRow.picture = this.currentRow.picture[0];
+      print() {
+        printElement(this.$refs.printRef);
+      },
+      handleClose() {
+        this.$refs.WithViewRef.clearImg();
+        this.imgVisible = false;
+      },
+      close() {
+        this.remarkVisible = false;
+        // this.currentRow.remark = '';
+      },
+      openEdit(row) {
+        this.visible = true;
+        if (row) {
+          this.currentRow = row;
+        }
+        if (
+          Array.isArray(this.currentRow.picture) &&
+          this.currentRow.picture.length > 0
+        ) {
+          this.currentRow.picture = this.currentRow.picture[0];
+        }
+        this.setCode();
+      },
+      setCode() {
+        const paramsStr = this.obj_to_str({
+          productName: encodeURIComponent(this.currentRow?.productName),
+          specification: encodeURIComponent(this.currentRow?.specification),
+          productCode: this.currentRow?.productCode,
+          batchNo: this.currentRow?.batchNo,
+          createTime: this.currentRow?.qualityTime?.split(' ')[0],
+          designDrawingImg: encodeURIComponent(
+            this.currentRow?.picture?.storePath
+          )
+        });
+        this.text =
+          'http://bymes.shenzhuo.vip:44800/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
+        });
       }
-      this.setCode();
-    },
-    setCode() {
-      const paramsStr = this.obj_to_str({
-        productName: encodeURIComponent(this.currentRow?.productName),
-        specification: encodeURIComponent(this.currentRow?.specification),
-        productCode: this.currentRow?.productCode,
-        batchNo: this.currentRow?.batchNo,
-        createTime: this.currentRow?.qualityTime?.split(' ')[0],
-        designDrawingImg: encodeURIComponent(
-          this.currentRow?.picture?.storePath
-        )
-      });
-      this.text ='http://bymes.shenzhuo.vip:44800/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;
+  .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;
+  .ele-body {
+    :deep(.el-table--border .el-table__expanded-cell) {
+      padding: 0;
+      .el-table {
+        border: none;
+      }
     }
   }
-}
 </style>
 <style media="print" lang="scss">
-@page {
-  size: 85mm 60mm;
-  margin: 0mm;
-}
+  @page {
+    size: 85mm 60mm;
+    margin: 0mm;
+  }
 </style>
 <style lang="scss" scoped>
-.id-label-card {
-  width: 85mm;
-  height: 59.5mm;
-  border: 2px solid #000;
-  color: #000;
-  box-sizing: border-box;
-  > header {
-    height: 70px;
-    border-bottom: 1px solid #000;
-    padding: 12px 7px;
+  .id-label-card {
+    width: 85mm;
+    height: 59.5mm;
+    border: 2px solid #000;
+    color: #000;
     box-sizing: border-box;
-    position: relative;
-    line-height: 20px;
-    > h4 {
-      margin: 0px;
-    }
-    > h6 {
-      margin: 0px;
-    }
-    > img {
-      width: 45px;
-      height: 45px;
-      position: absolute;
-      right: 7px;
-      top: 4px;
-    }
-  }
-  > footer {
-    display: flex;
-    height: 152px;
-    > aside {
-      height: 100%;
-    }
-    > aside.left {
-      flex: 1;
-      border-right: 1px solid #000;
+    > header {
+      height: 70px;
+      border-bottom: 1px solid #000;
+      padding: 12px 7px;
       box-sizing: border-box;
-      padding: 7px;
       position: relative;
-      > * {
-        margin: 0;
-        line-height: 30px;
+      line-height: 20px;
+      > h4 {
+        margin: 0px;
       }
-      .status {
-        position: absolute;
-        top: 5px;
-        right: 5px;
+      > h6 {
+        margin: 0px;
       }
-      .level {
+      > img {
+        width: 45px;
+        height: 45px;
         position: absolute;
-        right: 0px;
-        top: 0px;
-        height: 100%;
-        width: 30px;
-        writing-mode: vertical-lr;
-        text-align: center;
-        font-size: 20px;
+        right: 7px;
+        top: 4px;
       }
     }
-    > aside.right {
-      width: 139px;
+    > footer {
       display: flex;
-      align-items: center;
-      justify-content: center;
-      box-sizing: border-box;
+      height: 152px;
+      > aside {
+        height: 100%;
+      }
+      > aside.left {
+        flex: 1;
+        border-right: 1px solid #000;
+        box-sizing: border-box;
+        padding: 7px;
+        position: relative;
+        > * {
+          margin: 0;
+          line-height: 30px;
+        }
+        .status {
+          position: absolute;
+          top: 5px;
+          right: 5px;
+        }
+        .level {
+          position: absolute;
+          right: 0px;
+          top: 0px;
+          height: 100%;
+          width: 30px;
+          writing-mode: vertical-lr;
+          text-align: center;
+          font-size: 20px;
+        }
+      }
+      > aside.right {
+        width: 139px;
+        display: flex;
+        align-items: center;
+        justify-content: center;
+        box-sizing: border-box;
+      }
     }
   }
-}
 </style>

+ 2 - 2
vue.config.js

@@ -33,8 +33,8 @@ module.exports = {
       '/api': {
         // target: 'http://124.71.68.31:50001',
         // target: 'http://192.168.1.107:18086',
-        target: 'http://192.168.1.125:18086',
-        // target: 'http://192.168.1.144:18086',
+        // target: 'http://192.168.1.125:18086',
+        target: 'http://192.168.1.144:18086',
         // target: 'http://192.168.1.30:18086',
         // target: 'http://192.168.1.251:18186',
         // target: 'http://124.71.68.31:50001',