From 616a71ebbb82d6143768a17bf4ab84b860bb82e0 Mon Sep 17 00:00:00 2001
From: licp <lichunping@guanfang.com.cn>
Date: 星期二, 21 五月 2024 14:53:12 +0800
Subject: [PATCH] 修改产品追溯
---
src/views/technology/document/index.vue | 193 ++++++++++++++++++++---------------------------
1 files changed, 83 insertions(+), 110 deletions(-)
diff --git a/src/views/technology/document/index.vue b/src/views/technology/document/index.vue
index 7db3d0f..0f9485e 100644
--- a/src/views/technology/document/index.vue
+++ b/src/views/technology/document/index.vue
@@ -11,15 +11,6 @@
ref="documentTable"
>
<template #toolbar>
- <!-- <el-button type="primary" :loading="ifsSynsLoading" @click="syncIfs"
- >ERP鍚屾</el-button
- > -->
- <el-button
- type="primary"
- @click="deleteBatch"
- v-if="permissions.technology_document_del"
- >鎵归噺鍒犻櫎</el-button
- >
<!-- <el-button
type="primary"
@click="bindTestStandard"
@@ -142,25 +133,25 @@
searchInfoType: 'text'
},
// 缁濈紭棰滆壊
- {
- minWidth: '120',
- prop: 'insulationColor',
- label: '缁濈紭棰滆壊',
- sort: true,
- isTrue: true,
- isSearch: true,
- searchInfoType: 'text'
- },
+ // {
+ // minWidth: '120',
+ // prop: 'insulationColor',
+ // label: '缁濈紭棰滆壊',
+ // sort: true,
+ // isTrue: true,
+ // isSearch: true,
+ // searchInfoType: 'text'
+ // },
// 鎶ゅ棰滆壊
- {
- minWidth: '120',
- prop: 'sheathColor',
- label: '鎶ゅ棰滆壊',
- sort: true,
- isTrue: true,
- isSearch: true,
- searchInfoType: 'text'
- },
+ // {
+ // minWidth: '120',
+ // prop: 'sheathColor',
+ // label: '鎶ゅ棰滆壊',
+ // sort: true,
+ // isTrue: true,
+ // isSearch: true,
+ // searchInfoType: 'text'
+ // },
{
minWidth: '120',
prop: 'testStandard',
@@ -239,7 +230,7 @@
isSearch: true,
searchInfoType: 'text'
},
- {
+ /* {
minWidth: '120',
prop: 'projectType',
label: '椤圭洰绫诲埆',
@@ -271,7 +262,7 @@
isSearch: true,
searchInfoType: 'text'
},
-
+ */
// 鎻忚堪
{
minWidth: '120',
@@ -322,72 +313,8 @@
searchInfoType: 'datetimerange'
}
],
- toolbar: [
- {
- text: '鏂板',
- type: 'primary',
- fun: this.addOrUpdateHandle,
- disabled: false,
- permitArr: []
- },
- {
- text: '澶嶅埗',
- fun: this.copyDocument,
- disabled: false,
- permitArr: []
- },
- {
- text: '鎵瑰噯',
- fun: () => {
- this.changeState('accept')
- },
- disabled: false,
- permitArr: ['01draft', '03accepted', '04reject']
- },
- {
- text: '鎷掔粷',
- fun: () => {
- this.changeState('reject')
- },
- disabled: false,
- permitArr: ['01draft', '03accepted', '04reject']
- },
- {
- text: '鎾ら攢',
- fun: () => {
- this.changeState('cancel')
- },
- disabled: false,
- permitArr: ['01draft', '03accepted', '04reject']
- }
- /*,
- {
- text: '娴风紗OA',
- fun: () => {
- this.approveHandle(0)
- },
- disabled: false,
- permitArr: ['01draft', '04reject'],
- loading: false
- },
- {
- text: '闄嗙紗OA',
- fun: () => {
- this.approveHandle(1)
- },
- disabled: false,
- permitArr: ['01draft', '04reject'],
- loading: false
- },
- {
- text: '瀵煎嚭word',
- type: 'primary',
- fun: this.exportWord,
- disabled: false,
- permitArr: []
- } */
- ],
- operator: [],
+ toolbar: [],
+ operator: null,
operatorConfig: {
fixed: 'right',
label: '鎿嶄綔',
@@ -457,10 +384,51 @@
activated() {
this.getData()
},
- created() {
- this.getBomTypeDbOptions()
+ created() {
+ if(this.permissions.technology_document_add){
+ this.table.toolbar.push({
+ text: '鏂板',
+ type: 'primary',
+ disabled: false,
+ fun: ()=>{this.addOrUpdateHandle()},
+ permitArr: [],
+ })
+ }
+ if(this.permissions.technology_document_accept){
+ this.table.toolbar.push({
+ text: '鎵瑰噯',
+ disabled: true,
+ fun: ()=>{this.changeState('accept')},
+ permitArr: ['01draft', '03accepted', '04reject'],
+ })
+ }
+ if(this.permissions.technology_document_reject){
+ this.table.toolbar.push({
+ text: '鎷掔粷',
+ disabled: true,
+ fun: () => {this.changeState('reject')},
+ permitArr: ['01draft', '03accepted', '04reject'],
+ })
+ }
+ if(this.permissions.technology_document_cancel){
+ this.table.toolbar.push({
+ text: '鎾ら攢',
+ disabled: true,
+ fun: ()=>{this.changeState('cancel')},
+ permitArr: ['01draft', '03accepted', '04reject'],
+ })
+ }
if (this.permissions.technology_document_del) {
- this.table.operator.push({
+ this.table.toolbar.push({
+ text: '鎵归噺鍒犻櫎',
+ type: 'primary',
+ disabled: false,
+ fun: ()=>{this.deleteBatch()},
+ permitArr: [],
+ })
+ }
+ if (this.permissions.technology_document_del) {
+ this.table.operator = [{
text: '鍒犻櫎',
type: 'text',
size: 'small',
@@ -469,18 +437,19 @@
val: ['01draft'],
key: 'state'
}
- })
- } else {
- this.table.operator.push({
- text: '鍒犻櫎',
- type: 'text',
- size: 'small',
- fun: this.deleteHandle,
- show: {
- val: [],
- key: 'state'
- }
- })
+ }]
+ }
+ this.getBomTypeDbOptions()
+ },
+ watch:{
+ multipleSelection(newVal){
+ if(newVal.length==0){
+ this.table.toolbar.forEach(ele=>{
+ if(ele.text=='鎷掔粷' || ele.text=='鎵瑰噯' || ele.text=='鎾ら攢'){
+ ele.disabled = true
+ }
+ })
+ }
}
},
methods: {
@@ -523,6 +492,10 @@
},
// 鏂板 / 淇敼
addOrUpdateHandle(row) {
+ if(!this.permissions.technology_document_edit && row.id!=null){
+ this.$message.error("璇ヨ鑹叉病鏈夋搷浣滄潈闄�")
+ return
+ }
this.$router.push({
name: 'documentForm',
query: { id: row == null ? null : row.id }
--
Gitblit v1.9.3