From 0119182fc7947e3bd2299a24bba7e25e913dbddc Mon Sep 17 00:00:00 2001 From: zouyu <2723363702@qq.com> Date: 星期五, 22 十二月 2023 09:47:40 +0800 Subject: [PATCH] modified: src/api/plan/productionschedul.js modified: src/views/plan/productionschedul/index.vue modified: src/views/quality/processInspect/index.vue modified: src/views/quality/processInspect/processInspect-form.vue modified: src/views/quality/rawMaterial/rawMaterial-form.vue --- src/views/technology/completeproductstructure/index.vue | 284 +++++++++++++++++++++++++++----------------------------- 1 files changed, 135 insertions(+), 149 deletions(-) diff --git a/src/views/technology/completeproductstructure/index.vue b/src/views/technology/completeproductstructure/index.vue index d8d450f..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> @@ -20,12 +34,13 @@ import { fetchList, delObj, - addByStructure + addByStructure, } from '@/api/technology/completeproductstructure' import ttable from '@/views/common/ztt-table.vue' import { mapGetters } from 'vuex' import { changeState } from '../../../api/technology/completeproductstructure' import { remote } from '@/api/admin/dict' + export default { data() { return { @@ -33,8 +48,8 @@ multipleSelection: [], uploadInfo: { // 鏄惁灞曠ず涓婁紶EXCEL浠ュ強瀵瑰簲鐨剈rl - isShow: true, - url: 'mes/bom/uploadExcel' + isShow: false, + url: 'mes/bom/uploadExcel', }, prelang: 'completeProductStructure', options: { @@ -49,7 +64,7 @@ isRefresh: true, // 鏄惁鏄剧ず鍒锋柊鎸夐挳 isShowHide: true, // 鏄惁鏄剧ず鏄惧奖鎸夐挳 isSearch: false, // 楂樼骇鏌ヨ鎸夐挳 - defaultOrderBy: { column: 'id', direction: 'desc' } + defaultOrderBy: { column: 'id', direction: 'desc' }, }, table: { total: 0, @@ -67,7 +82,7 @@ isTrue: true, isSearch: true, searchInfoType: 'text', - render: { fun: this.addOrUpdateHandle } + render: { fun: this.addOrUpdateHandle }, }, // 闆朵欢鍚嶇О { @@ -77,7 +92,7 @@ sort: true, isTrue: true, isSearch: true, - searchInfoType: 'text' + searchInfoType: 'text', }, // 闆朵欢鍙� { @@ -87,7 +102,7 @@ sort: true, isTrue: true, isSearch: true, - searchInfoType: 'text' + searchInfoType: 'text', }, // 鐘舵�� @@ -112,7 +127,7 @@ formatVal = '宸插彇娑�' } return formatVal - } + }, }, // 绫诲瀷 @@ -127,7 +142,7 @@ formatter: this.formatBomTypeDbType, optList: () => { return this.bomTypeDbOptions - } + }, }, // 鐗堟湰鍙� { @@ -137,61 +152,61 @@ sort: true, isTrue: true, isSearch: true, - searchInfoType: 'text' + searchInfoType: 'text', }, // 鏇夸唬鍙� - { - minWidth: '120', - prop: 'alternativeNo', - label: '鏇夸唬鍙�', - sort: true, - isTrue: true, - isSearch: true, - searchInfoType: 'text' - }, + // { + // minWidth: '120', + // prop: 'alternativeNo', + // label: '鏇夸唬鍙�', + // sort: true, + // isTrue: true, + // isSearch: true, + // searchInfoType: 'text', + // }, // 鏇夸唬鎻忚堪 - { - minWidth: '120', - prop: 'alternativeDesc', - label: '鏇夸唬鎻忚堪', - sort: true, - isTrue: true, - isSearch: true, - searchInfoType: 'text' - }, + // { + // minWidth: '120', + // prop: 'alternativeDesc', + // 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: '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', + // }, // 鐗规��1 - { - minWidth: '120', - prop: 'characteristicOne', - label: '鐗规��1', - sort: true, - isTrue: true, - isSearch: true, - searchInfoType: 'text' - }, + // { + // minWidth: '120', + // prop: 'characteristicOne', + // label: '鐗规��1', + // sort: true, + // isTrue: true, + // isSearch: true, + // searchInfoType: 'text', + // }, // 鍒涘缓浜� { minWidth: '120', @@ -200,7 +215,7 @@ sort: true, isTrue: true, isSearch: true, - searchInfoType: 'text' + searchInfoType: 'text', }, // 鍒涘缓鏃堕棿 { @@ -210,98 +225,56 @@ sort: true, isTrue: true, isSearch: true, - searchInfoType: 'datetimerange' - } + searchInfoType: 'datetimerange', + }, ], - toolbar: [ - { - text: '鏂板', - type: 'primary', - fun: this.addOrUpdateHandle, - disabled: false, - permitArr: [] - }, - { - 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: '鎿嶄綔', width: 100, - minWidth: 100 - } + minWidth: 100, + }, }, stateOptionList: [ { value: '01draft', - label: '鑽夌' + label: '鑽夌', }, { value: '02accepted', - label: '宸叉帴鍙�' + label: '宸叉帴鍙�', }, { value: '03cancelled', - label: '宸插彇娑�' - } + label: '宸插彇娑�', + }, ], - bomTypeDbOptions: [] + uniqueStateArr: [], + bomTypeDbOptions: [], } }, components: { - ttable + ttable, }, computed: { - ...mapGetters(['permissions']) + ...mapGetters(['permissions']), }, activated() { this.getData() }, created() { + if(this.permissions.technology_completeproductstructure_del){ + this.table.operator = [ + { + text: '鍒犻櫎', + type: 'text', + size: 'small', + fun: this.deleteHandle, + }, + ] + } this.getBomTypeDbOptions() }, methods: { @@ -331,17 +304,29 @@ }, // 鏂板 / 淇敼 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 } + params: { id: row == null ? null : row.id }, }) }, // 鎸変骇鍝佺粨鏋勭敓鎴怋OM addByStructureHandle() { - addByStructure() - this.$message({ - message: '宸插湪鍚庡彴鐢熸垚BOM锛岃鎵ц缁撴潫鍚庡埛鏂伴〉闈�', - type: 'success' + addByStructure().then((res) => { + console.log(res.data.data); + let mes=""; + res.data.data.forEach(item=>{ + mes+=item + }) + this.$message({ + message: mes, + type: 'success', + dangerouslyUseHTMLString: true + }) + this.getData() }) }, // 鍒犻櫎 @@ -350,9 +335,9 @@ confirmButtonText: '纭畾', cancelButtonText: '鍙栨秷', type: 'warning', - closeOnClickModal: false + closeOnClickModal: false, }) - .then(function() { + .then(function () { const ids = [] ids.push(row.id) return delObj(ids) @@ -374,9 +359,9 @@ confirmButtonText: '纭畾', cancelButtonText: '鍙栨秷', type: 'warning', - closeOnClickModal: false + closeOnClickModal: false, }) - .then(function() { + .then(function () { const ids = that.multipleSelection.map((item) => { return item.id }) @@ -427,7 +412,7 @@ handleSelectionChange(val) { // 鏍规嵁鐘舵�侊紝绂佺敤琛ㄥご鎸夐挳 // 绛涢�夊嚭閫変腑璁板綍鐨勭姸鎬� - var stateArr = val.map(function(value, index) { + var stateArr = val.map(function (value, index) { return value.state }) // 閫変腑鐘舵�佹暟缁勫厓绱犲幓閲� @@ -437,27 +422,28 @@ 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 }, getStateOptionList() { return this.stateOptionList - } - } + }, + }, } </script> -- Gitblit v1.9.3