| | |
| | | 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 { |
| | |
| | | uploadInfo: { |
| | | // 是否展示上传EXCEL以及对应的url |
| | | isShow: true, |
| | | url: 'mes/bom/uploadExcel' |
| | | url: 'mes/bom/uploadExcel', |
| | | }, |
| | | prelang: 'completeProductStructure', |
| | | options: { |
| | |
| | | isRefresh: true, // 是否显示刷新按钮 |
| | | isShowHide: true, // 是否显示显影按钮 |
| | | isSearch: false, // 高级查询按钮 |
| | | defaultOrderBy: { column: 'id', direction: 'desc' } |
| | | defaultOrderBy: { column: 'id', direction: 'desc' }, |
| | | }, |
| | | table: { |
| | | total: 0, |
| | |
| | | isTrue: true, |
| | | isSearch: true, |
| | | searchInfoType: 'text', |
| | | render: { fun: this.addOrUpdateHandle } |
| | | render: { fun: this.addOrUpdateHandle }, |
| | | }, |
| | | // 零件名称 |
| | | { |
| | |
| | | sort: true, |
| | | isTrue: true, |
| | | isSearch: true, |
| | | searchInfoType: 'text' |
| | | searchInfoType: 'text', |
| | | }, |
| | | // 零件号 |
| | | { |
| | |
| | | sort: true, |
| | | isTrue: true, |
| | | isSearch: true, |
| | | searchInfoType: 'text' |
| | | searchInfoType: 'text', |
| | | }, |
| | | |
| | | // 状态 |
| | |
| | | formatVal = '已取消' |
| | | } |
| | | return formatVal |
| | | } |
| | | }, |
| | | }, |
| | | |
| | | // 类型 |
| | |
| | | formatter: this.formatBomTypeDbType, |
| | | optList: () => { |
| | | return this.bomTypeDbOptions |
| | | } |
| | | }, |
| | | }, |
| | | // 版本号 |
| | | { |
| | |
| | | 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', |
| | |
| | | sort: true, |
| | | isTrue: true, |
| | | isSearch: true, |
| | | searchInfoType: 'text' |
| | | searchInfoType: 'text', |
| | | }, |
| | | // 创建时间 |
| | | { |
| | |
| | | sort: true, |
| | | isTrue: true, |
| | | isSearch: true, |
| | | searchInfoType: 'datetimerange' |
| | | } |
| | | searchInfoType: 'datetimerange', |
| | | }, |
| | | ], |
| | | toolbar: [ |
| | | // { |
| | |
| | | text: '产品结构生成BOM', |
| | | fun: this.addByStructureHandle, |
| | | disabled: false, |
| | | permitArr: [] |
| | | permitArr: [], |
| | | }, |
| | | { |
| | | text: '批准', |
| | |
| | | this.approveHandle('ACCEPT') |
| | | }, |
| | | disabled: false, |
| | | permitArr: ['01draft'] |
| | | permitArr: ['01draft'], |
| | | }, |
| | | { |
| | | text: '撤回', |
| | |
| | | this.approveHandle('REVOKE') |
| | | }, |
| | | disabled: false, |
| | | permitArr: ['02accepted'] |
| | | permitArr: ['02accepted'], |
| | | }, |
| | | { |
| | | text: '拒绝', |
| | |
| | | this.approveHandle('CANCEL') |
| | | }, |
| | | disabled: false, |
| | | permitArr: ['02accepted'] |
| | | permitArr: ['02accepted'], |
| | | }, |
| | | { |
| | | text: '删除', |
| | |
| | | this.deleteAll() |
| | | }, |
| | | disabled: false, |
| | | permitArr: [] |
| | | } |
| | | permitArr: [], |
| | | }, |
| | | ], |
| | | operator: [ |
| | | { |
| | | text: '删除', |
| | | type: 'text', |
| | | size: 'small', |
| | | fun: this.deleteHandle |
| | | } |
| | | fun: this.deleteHandle, |
| | | }, |
| | | ], |
| | | operatorConfig: { |
| | | fixed: 'right', |
| | | label: '操作', |
| | | width: 100, |
| | | minWidth: 100 |
| | | } |
| | | minWidth: 100, |
| | | }, |
| | | }, |
| | | stateOptionList: [ |
| | | { |
| | | value: '01draft', |
| | | label: '草稿' |
| | | label: '草稿', |
| | | }, |
| | | { |
| | | value: '02accepted', |
| | | label: '已接受' |
| | | label: '已接受', |
| | | }, |
| | | { |
| | | value: '03cancelled', |
| | | label: '已取消' |
| | | } |
| | | label: '已取消', |
| | | }, |
| | | ], |
| | | bomTypeDbOptions: [] |
| | | bomTypeDbOptions: [], |
| | | } |
| | | }, |
| | | components: { |
| | | ttable |
| | | ttable, |
| | | }, |
| | | computed: { |
| | | ...mapGetters(['permissions']) |
| | | ...mapGetters(['permissions']), |
| | | }, |
| | | activated() { |
| | | this.getData() |
| | |
| | | addOrUpdateHandle(row) { |
| | | this.$router.push({ |
| | | name: 'completeProductStructure', |
| | | params: { id: row == null ? null : row.id } |
| | | params: { id: row == null ? null : row.id }, |
| | | }) |
| | | }, |
| | | // 按产品结构生成BOM |
| | | addByStructureHandle() { |
| | | addByStructure() |
| | | this.$message({ |
| | | message: '已在后台生成BOM,请执行结束后刷新页面', |
| | | type: 'success' |
| | | addByStructure().then((res) => { |
| | | let result = Array.from(new Set(res.data.data)) |
| | | this.$message.success(result.join(',')) |
| | | this.getData() |
| | | }) |
| | | // this.$message({ |
| | | // message: '已在后台生成BOM,请执行结束后刷新页面', |
| | | // type: 'success', |
| | | // }) |
| | | }, |
| | | // 删除 |
| | | deleteHandle(row) { |
| | |
| | | confirmButtonText: '确定', |
| | | cancelButtonText: '取消', |
| | | type: 'warning', |
| | | closeOnClickModal: false |
| | | closeOnClickModal: false, |
| | | }) |
| | | .then(function() { |
| | | .then(function () { |
| | | const ids = [] |
| | | ids.push(row.id) |
| | | return delObj(ids) |
| | |
| | | confirmButtonText: '确定', |
| | | cancelButtonText: '取消', |
| | | type: 'warning', |
| | | closeOnClickModal: false |
| | | closeOnClickModal: false, |
| | | }) |
| | | .then(function() { |
| | | .then(function () { |
| | | const ids = that.multipleSelection.map((item) => { |
| | | return item.id |
| | | }) |
| | |
| | | handleSelectionChange(val) { |
| | | // 根据状态,禁用表头按钮 |
| | | // 筛选出选中记录的状态 |
| | | var stateArr = val.map(function(value, index) { |
| | | var stateArr = val.map(function (value, index) { |
| | | return value.state |
| | | }) |
| | | // 选中状态数组元素去重 |
| | |
| | | }, |
| | | getStateOptionList() { |
| | | return this.stateOptionList |
| | | } |
| | | } |
| | | }, |
| | | }, |
| | | } |
| | | </script> |