From 847696329faa795077d966845f37b88fbd3a2cdc Mon Sep 17 00:00:00 2001
From: Crunchy <3114200645@qq.com>
Date: 星期二, 21 五月 2024 16:33:28 +0800
Subject: [PATCH] 2023-5-21 selOutBatchNo接口 质量的过程检验,新增不触发接口,编辑或者查看才触发 与 追溯select切换只显示第一条数据问题

---
 src/views/quality/processInspect/index.vue |   91 ++++++++++++++++++++++++++++++++-------------
 1 files changed, 65 insertions(+), 26 deletions(-)

diff --git a/src/views/quality/processInspect/index.vue b/src/views/quality/processInspect/index.vue
index fdc05d8..a109bf1 100644
--- a/src/views/quality/processInspect/index.vue
+++ b/src/views/quality/processInspect/index.vue
@@ -2,7 +2,7 @@
 	<div class="content-main">
 		<div class="rawPage">
             <basic-container>
-                <ttable 
+                <ttable
                 :table="table"
                 @handleSelectionChange="handleSelectionChange"
                 :prelang="prelang"
@@ -20,11 +20,13 @@
     import ttable from '@/views/common/ztt-table.vue'
     import * as fecha from 'element-ui/lib/utils/date'
 	import processInspectForm from './processInspect-form'
-    import { page,deleteById } from '@/api/quality/processInspect'
+    import { transform } from '@/util/fileTransform'
+    import { mapGetters } from 'vuex'
+    import { page,deleteById,exportProcessInsProduct } from '@/api/quality/processInspect'
 	export default {
 		components: {
 			processInspectForm,
-            ttable
+            ttable,
 		},
 		data() {
 			return {
@@ -55,12 +57,28 @@
                     column: [
                         {
                             minWidth: '120',
-                            prop: 'orderNumber',
-                            label: '璁㈠崟缂栧彿',
+                            prop: 'proInsNo',
+                            label: '杩囩▼妫�楠岀紪鍙�',
                             isTrue: true,
                             isSearch: true,
                             searchInfoType: 'text',
                             render: { fun: this.addOrUpdateHandle }
+                        },
+                        {
+                            minWidth: '120',
+                            prop: 'orderNumber',
+                            label: '璁㈠崟缂栧彿',
+                            isTrue: true,
+                            isSearch: true,
+                            searchInfoType: 'text'
+                        },
+                        {
+                            minWidth: '120',
+                            prop: 'materialCode',
+                            label: '浜у搧缂栧彿',
+                            isTrue: true,
+                            isSearch: true,
+                            searchInfoType: 'text'
                         },
                         {
                             minWidth: '120',
@@ -72,7 +90,6 @@
                         },
                         {
                             minWidth: '130',
-                            width: '150',
                             prop: 'specs',
                             label: '瑙勬牸鍨嬪彿',
                             sort: true,
@@ -145,22 +162,8 @@
                             }
                         },
                     ],
-                    toolbar: [
-                    {
-                        text: '鏂板',
-                        type: 'primary',
-                        fun: this.addOrUpdateHandle
-                    },
-                    {
-                        text: '瀵煎嚭',
-                    }
-                    ],
-                    operator: [{
-                        text: '浣滃簾',
-                        type: 'text',
-                        size: 'small',
-                        fun: this.deleteHandle
-                    }],
+                    toolbar: [],
+                    operator: null,
                     operatorConfig: {
                     fixed: 'right',
                     label: '鎿嶄綔',
@@ -170,8 +173,34 @@
                 },
 			}
 		},
-		created() { },
+        computed: {
+            ...mapGetters(['permissions'])
+        },
+		created() {
+            if(this.permissions.quality_processInspect_add){
+                this.table.toolbar.push({
+                        text: '鏂板',
+                        type: 'primary',
+                        fun: this.addOrUpdateHandle
+                    })
+            }
+            if(this.permissions.quality_processInspect_del){
+                this.table.operator = [{
+                        text: '浣滃簾',
+                        type: 'text',
+                        size: 'small',
+                        fun: this.deleteHandle
+                    }]
+            }
+         },
 		methods: {
+            exportExcel(){
+                let queryParam=this.$refs.processInspect.getQueryParam();
+                delete queryParam.criteria
+                exportProcessInsProduct(queryParam).then((res)=>{
+                    transform(res)
+                })
+            },
 			deleteHandle(row){
 				this.$confirm('纭鍒犻櫎璇ユ暟鎹悧锛�', '鎻愮ず', {
 				confirmButtonText: '纭畾',
@@ -190,10 +219,20 @@
 			},
 			// 鏂板 / 淇敼
 			addOrUpdateHandle(row) {
+                if(!this.permissions.quality_processInspect_edit && row){
+                    this.$message.error("璇ヨ鑹叉病鏈夋搷浣滄潈闄�")
+                    return
+                }
+                let isAdd = true
+                if(!row) {
+                    isAdd = false
+                }
 				this.$router.push({
 					name: 'processInspectForm',
-					query: { id: row == null ? null : row.id,resultVal : row == null ? null : row.result },
-				})
+					query: { id: row == null ? null : row.id },
+                    params: { resultVal : row == null ? null : row.result },
+                    isAdd: isAdd
+                })
 			},
             formatResult(row, column, cellValue){
                 if(cellValue != undefined || cellValue != null){
@@ -295,4 +334,4 @@
 	.rawPage .content-body {
 		flex: 1;
 	}
-</style>
\ No newline at end of file
+</style>

--
Gitblit v1.9.3