| | |
| | | :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> |
| | |
| | | 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: [], |
| | | }, |
| | | ], |
| | | toolbar: [], |
| | | operator: [ |
| | | { |
| | | text: '删除', |
| | |
| | | label: '已取消', |
| | | }, |
| | | ], |
| | | uniqueStateArr: [], |
| | | bomTypeDbOptions: [], |
| | | } |
| | | }, |
| | |
| | | }, |
| | | // 新增 / 修改 |
| | | 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 }, |
| | |
| | | // 按产品结构生成BOM |
| | | 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=>{ |
| | |
| | | }) |
| | | this.getData() |
| | | }) |
| | | // this.$message({ |
| | | // message: '已在后台生成BOM,请执行结束后刷新页面', |
| | | // type: 'success', |
| | | // }) |
| | | }, |
| | | // 删除 |
| | | deleteHandle(row) { |
| | | if(!this.permissions.technology_completeproductstructure_del){ |
| | | this.$message.error("该角色没有操作权限") |
| | | return |
| | | } |
| | | this.$confirm('是否确认删除编号为' + row.number, '提示', { |
| | | confirmButtonText: '确定', |
| | | cancelButtonText: '取消', |
| | |
| | | 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 |
| | | }, |