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/technology/completeproductstructure/index.vue | 136 +++++++++++++++++++-------------------------- 1 files changed, 58 insertions(+), 78 deletions(-) diff --git a/src/views/technology/completeproductstructure/index.vue b/src/views/technology/completeproductstructure/index.vue index 1be5f56..6187aab 100644 --- a/src/views/technology/completeproductstructure/index.vue +++ b/src/views/technology/completeproductstructure/index.vue @@ -10,7 +10,21 @@ :ajaxFun="ajaxFun" ref="completeProductStructureTable" > - <template #toolbar></template> + <template #toolbar> + <el-button type="primary" @click="addByStructureHandle" + v-if="permissions.technology_completeproductstructure_bom">浜у搧缁撴瀯鐢熸垚BOM</el-button> + <el-button @click="() => {this.approveHandle('ACCEPT')}" + :disabled="uniqueStateArr.includes('01draft')" + v-if="permissions.technology_completeproductstructure_accept">鎵瑰噯</el-button> + <el-button @click="() => {this.approveHandle('REVOKE')}" + :disabled="uniqueStateArr.includes('02accepted')" + v-if="permissions.technology_completeproductstructure_revoke">鎾ゅ洖</el-button> + <el-button @click="() => {this.approveHandle('CANCEL')}" + :disabled="uniqueStateArr.includes('02accepted')" + v-if="permissions.technology_completeproductstructure_cancel">鎷掔粷</el-button> + <el-button @click="() => {this.deleteAll()}" type="primary" + v-if="permissions.technology_completeproductstructure_batch_delete">鎵归噺鍒犻櫎</el-button> + </template> </ttable> </basic-container> </div> @@ -34,7 +48,7 @@ multipleSelection: [], uploadInfo: { // 鏄惁灞曠ず涓婁紶EXCEL浠ュ強瀵瑰簲鐨剈rl - isShow: true, + isShow: false, url: 'mes/bom/uploadExcel', }, prelang: 'completeProductStructure', @@ -214,62 +228,8 @@ searchInfoType: 'datetimerange', }, ], - toolbar: [ - // { - // text: '鏂板', - // type: 'primary', - // fun: this.addOrUpdateHandle, - // disabled: false, - // permitArr: [] - // }, - { - type: 'primary', - text: '浜у搧缁撴瀯鐢熸垚BOM', - fun: this.addByStructureHandle, - disabled: false, - permitArr: [], - }, - { - text: '鎵瑰噯', - fun: () => { - this.approveHandle('ACCEPT') - }, - disabled: false, - permitArr: ['01draft'], - }, - { - text: '鎾ゅ洖', - fun: () => { - this.approveHandle('REVOKE') - }, - disabled: false, - permitArr: ['02accepted'], - }, - { - text: '鎷掔粷', - fun: () => { - this.approveHandle('CANCEL') - }, - disabled: false, - permitArr: ['02accepted'], - }, - { - text: '鍒犻櫎', - fun: () => { - this.deleteAll() - }, - disabled: false, - permitArr: [], - }, - ], - operator: [ - { - text: '鍒犻櫎', - type: 'text', - size: 'small', - fun: this.deleteHandle, - }, - ], + toolbar: [], + operator: null, operatorConfig: { fixed: 'right', label: '鎿嶄綔', @@ -291,6 +251,7 @@ label: '宸插彇娑�', }, ], + uniqueStateArr: [], bomTypeDbOptions: [], } }, @@ -304,6 +265,16 @@ this.getData() }, created() { + if(this.permissions.technology_completeproductstructure_del){ + this.table.operator = [ + { + text: '鍒犻櫎', + type: 'text', + size: 'small', + fun: this.deleteHandle, + }, + ] + } this.getBomTypeDbOptions() }, methods: { @@ -333,6 +304,10 @@ }, // 鏂板 / 淇敼 addOrUpdateHandle(row) { + if(!this.permissions.technology_completeproductstructure_edit && row.id!=null){ + this.$message.error("璇ヨ鑹叉病鏈夋搷浣滄潈闄�") + return + } this.$router.push({ name: 'completeProductStructure', params: { id: row == null ? null : row.id }, @@ -341,14 +316,18 @@ // 鎸変骇鍝佺粨鏋勭敓鎴怋OM addByStructureHandle() { addByStructure().then((res) => { - let result = Array.from(new Set(res.data.data)) - this.$message.success(result.join(',')) + console.log(res.data.data); + let mes=""; + res.data.data.forEach(item=>{ + mes+=item + }) + this.$message({ + message: mes, + type: 'success', + dangerouslyUseHTMLString: true + }) this.getData() }) - // this.$message({ - // message: '宸插湪鍚庡彴鐢熸垚BOM锛岃鎵ц缁撴潫鍚庡埛鏂伴〉闈�', - // type: 'success', - // }) }, // 鍒犻櫎 deleteHandle(row) { @@ -443,21 +422,22 @@ uniqueStateArr.push(stateArr[i]) } } + this.uniqueStateArr = uniqueStateArr // 寰幆琛ㄥご鎸夐挳锛屽垽鏂瘡涓寜閽殑permitArr鏄惁瀹屽叏鍖呭惈閫変腑鐘舵�侊紝鑻ュ畬鍏ㄥ寘鍚紝鍒欐寜閽寒锛屽惁鍒欐寜閽伆 - var toolbar = this.table.toolbar - for (var j = 0; j < toolbar.length; j++) { - if ( - uniqueStateArr.every((val) => - toolbar[j].permitArr.length <= 0 - ? true - : toolbar[j].permitArr.includes(val) - ) - ) { - toolbar[j].disabled = false - } else { - toolbar[j].disabled = true - } - } + // var toolbar = this.table.toolbar + // for (var j = 0; j < toolbar.length; j++) { + // if ( + // uniqueStateArr.every((val) => + // toolbar[j].permitArr.length <= 0 + // ? true + // : toolbar[j].permitArr.includes(val) + // ) + // ) { + // toolbar[j].disabled = false + // } else { + // toolbar[j].disabled = true + // } + // } // 灏嗛�変腑璁板綍璧嬪�肩粰multipleSelection this.multipleSelection = val }, -- Gitblit v1.9.3