| | |
| | | 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: '操作', |
| | |
| | | label: '已取消', |
| | | }, |
| | | ], |
| | | uniqueStateArr: [], |
| | | bomTypeDbOptions: [], |
| | | } |
| | | }, |
| | |
| | | this.getData() |
| | | }, |
| | | created() { |
| | | if(this.permissions.technology_completeproductstructure_bom){ |
| | | this.table.toolbar.push({ |
| | | text: '产品结构生成BOM', |
| | | disabled: false, |
| | | type: 'primary', |
| | | fun: ()=>{this.addByStructureHandle()}, |
| | | permitArr: [], |
| | | }) |
| | | } |
| | | if(this.permissions.technology_completeproductstructure_accept){ |
| | | this.table.toolbar.push({ |
| | | text: '批准', |
| | | disabled: true, |
| | | fun: ()=>{this.approveHandle('ACCEPT')}, |
| | | permitArr: ['01draft'], |
| | | }) |
| | | } |
| | | if(this.permissions.technology_completeproductstructure_revoke){ |
| | | this.table.toolbar.push({ |
| | | text: '撤回', |
| | | disabled: true, |
| | | fun: () => {this.approveHandle('REVOKE')}, |
| | | permitArr: ['02accepted'], |
| | | }) |
| | | } |
| | | if(this.permissions.technology_completeproductstructure_cancel){ |
| | | this.table.toolbar.push({ |
| | | text: '拒绝', |
| | | disabled: true, |
| | | fun: ()=>{this.approveHandle('CANCEL')}, |
| | | permitArr: ['02accepted'], |
| | | }) |
| | | } |
| | | if(this.permissions.technology_completeproductstructure_batch_delete){ |
| | | this.table.toolbar.push({ |
| | | text: '批量删除', |
| | | type:'primary', |
| | | disabled: false, |
| | | permitArr: [], |
| | | fun: ()=>{this.deleteAll()}, |
| | | }) |
| | | } |
| | | if(this.permissions.technology_completeproductstructure_del){ |
| | | this.table.operator = [ |
| | | { |
| | | text: '删除', |
| | | type: 'text', |
| | | size: 'small', |
| | | fun: this.deleteHandle, |
| | | }, |
| | | ] |
| | | } |
| | | 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: { |
| | | getBomTypeDbOptions() { |
| | |
| | | }, |
| | | // 新增 / 修改 |
| | | 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=>{ |
| | | mes+=item |
| | | }) |
| | | this.$message({ |
| | | message: mes, |
| | | type: 'success', |
| | | dangerouslyUseHTMLString: true |
| | | }) |
| | | this.getData() |
| | | }) |
| | | // this.$message({ |
| | | // message: '已在后台生成BOM,请执行结束后刷新页面', |
| | | // type: 'success', |
| | | // }) |
| | | }, |
| | | // 删除 |
| | | deleteHandle(row) { |