From a48ded866d223f581944ea9043df1b296b3425e3 Mon Sep 17 00:00:00 2001
From: zouyu <2723363702@qq.com>
Date: 星期四, 21 十二月 2023 13:17:46 +0800
Subject: [PATCH] 	modified:   src/views/basic/company/index.vue 	modified:   src/views/basic/customizeparamtemplatetype/index.vue 	modified:   src/views/basic/division/index.vue 	modified:   src/views/basic/factory/index.vue 	modified:   src/views/basic/location/index.vue 	modified:   src/views/basic/param/index.vue 	modified:   src/views/basic/part/index.vue 	modified:   src/views/basic/post/index.vue 	modified:   src/views/basic/shift/index.vue 	modified:   src/views/basic/staff/index.vue 	modified:   src/views/basic/template/index.vue 	modified:   src/views/basic/warehouse/index.vue 	modified:   src/views/basic/workstation/index.vue 	modified:   src/views/plan/manufacturingorder/index.vue 	modified:   src/views/plan/masterproductionschedule/index.vue 	modified:   src/views/plan/operationtask/index.vue 	modified:   src/views/plan/productionschedul/index.vue 	modified:   src/views/quality/finishedProductInspection/index.vue 	modified:   src/views/quality/rawMaterial/index.vue 	modified:   src/views/technology/completeproductstructure/index.vue 	modified:   src/views/technology/document/index.vue 	modified:   src/views/technology/operation/index.vue 	modified:   src/views/technology/routing/index.vue 	modified:   src/views/technology/structure/index.vue 	modified:   src/views/warehouse/FinishedWarehousing/index.vue 	modified:   src/views/warehouse/changestock/index.vue 	modified:   src/views/warehouse/pallettransports/index.vue

---
 src/views/quality/rawMaterial/index.vue |   93 ++++++++++++++++++++++++----------------------
 1 files changed, 49 insertions(+), 44 deletions(-)

diff --git a/src/views/quality/rawMaterial/index.vue b/src/views/quality/rawMaterial/index.vue
index f9a611a..3437c51 100644
--- a/src/views/quality/rawMaterial/index.vue
+++ b/src/views/quality/rawMaterial/index.vue
@@ -27,7 +27,7 @@
             @queryParam="getQueryParam($event)"
             ref="rawMaterialTable">
             <template #toolbar>
-                <el-button @click="exportRawMaterial" type="primary" >瀵煎嚭</el-button>
+                <!-- <el-button @click="exportRawMaterial" type="primary" >瀵煎嚭</el-button> -->
             </template>
             </ttable>
         </basic-container>
@@ -38,11 +38,11 @@
             @refreshDataList="getData"
         ></RawMaterialForm>
         <el-dialog
-        top="10vh"
+        top="7vh"
         title="鎵撳嵃棰勮"
         :visible.sync="printDialogVisible"
-        width="60%">
-        <div style="width:100%;height: 60vh;overflow-y: scroll;">
+        width="70%">
+        <div style="width:90%;margin-left:5%;height: 60vh;overflow-y: scroll;">
             <printTemplate id="printRaw" :formData="printFormData"></printTemplate>
         </div>
         <span slot="footer" class="dialog-footer">
@@ -54,11 +54,12 @@
 </template>
 <script>
 import ttable from '@/views/common/ztt-table.vue'
-import { getRawInspectList,delObj,exportRawMaterial,getObj } from '@/api/quality/rawMaterial'
+import { getRawInspectList,delObj,exportRawMaterial,getObj,downloadReport } from '@/api/quality/rawMaterial'
 import RawMaterialForm from './rawMaterial-form'
 import * as fecha from 'element-ui/lib/utils/date'
 import { mapGetters } from 'vuex'
 import PrintJS from 'print-js'
+import { transformZip } from '@/util/fileTransform'
 import printTemplate from './rawMaterial-print.vue'
   export default {
     data() {
@@ -213,37 +214,8 @@
                             }
                     },
                 ],
-                toolbar: [
-                    {
-                        text: '鏂板',
-                        type: 'primary',
-                        fun: this.addOrUpdateHandle
-                    },
-                    {
-                        text: '涓嬭浇妫�楠屾姤鍛�',
-                        type: 'primary',
-                        fun: this.downloadReport
-                    }
-                ],
-                operator: [{
-                    text: '鎵撳嵃',
-                    type: 'text',
-                    size: 'small',
-                    fun: this.previewFun,
-                    show: {
-                        val: [
-                            '1',
-                            '0'
-                        ],
-                        key: 'judgeState'
-                    }
-                },
-                {
-                    text: '浣滃簾',
-                    type: 'text',
-                    size: 'small',
-                    fun: this.deleteHandle
-                }],
+                toolbar: [],
+                operator: null,
                 operatorConfig: {
                 fixed: 'right',
                 label: '鎿嶄綔',
@@ -260,7 +232,30 @@
         RawMaterialForm,
         printTemplate,
     },
-    created() { },
+    created() { 
+        if(this.permissions.quality_rawMaterial_add){
+            this.table.toolbar.push({
+                text: '鏂板',
+                type: 'primary',
+                fun: this.addOrUpdateHandle
+            })
+        }
+        if(this.permissions.quality_rawMaterial_download){
+            this.table.toolbar.push({
+                text: '涓嬭浇妫�楠屾姤鍛�',
+                type: 'primary',
+                fun: this.downloadReport
+            })
+        }
+        if(this.permissions.quality_rawMaterial_del){
+            this.table.operator = [{
+                    text: '浣滃簾',
+                    type: 'text',
+                    size: 'small',
+                    fun: this.deleteHandle
+                }]
+        }
+     },
     computed: {
         ...mapGetters(['permissions'])
     },
@@ -285,7 +280,15 @@
                     this.$message.error("鍙兘閫夋嫨宸叉娴嬬殑鏁版嵁")
                     return
                 }
-                console.log(selection)
+                let ids = []
+                selection.forEach(ele=>{
+                    ids.push(ele.id)
+                })
+                downloadReport({ids : ids}).then(res=>{
+                    transformZip(res)
+                }).catch(error=>{
+                    console.log(error)
+                })
             }
         },
         //鏌ョ湅鎶ュ憡鎸夐挳
@@ -305,13 +308,12 @@
                 type: "html",
                 // header: "鍘熸潗鏂欐娴嬫姤鍛�",
                 targetStyles: ["*"],
-                style: `@page {margin: 0mm 5mm;size: A4;};
-                    html {zoom:100%;};
+                style: `@page {margin: 0mm 5mm;size: A4;}
+                    html {zoom:100%;}
                     @media print {
 					  html,body{
-					    width:880pt;
-					    height:900pt;
-					    margin:0;
+					    width:200mm;
+					    height:297mm;
 					  }
 					}`,
                 ignoreElements: ["no-ignore"],
@@ -323,7 +325,6 @@
         },
         exportRawMaterial(){
             exportRawMaterial(this.queryParam).then(res=>{
-                console.log(res)
                 this.downloadFun(res)
             }).catch(error=>{
                 console.log(error);
@@ -367,6 +368,10 @@
         },
         // 鏂板 / 淇敼
         addOrUpdateHandle(row) {
+            if(!this.permissions.quality_rawMaterial_edit && row.id!=null){
+                this.$message.error("璇ヨ鑹叉病鏈夋搷浣滄潈闄�")
+                return
+            }
             this.$router.push({
                 name: 'rawMaterialForm',
                 query: { 

--
Gitblit v1.9.3