| | |
| | | })) |
| | | } |
| | | }) |
| | | this.$HTTP.get('/api/blade-cps/device-types/page?keyWord=¤t=1&size=-1').then(res => { |
| | | this.$HTTP.get('/api/smis/device-types/page?keyWord=¤t=1&size=-1').then(res => { |
| | | if (res.code === 200) { |
| | | this.options.machineTypeId = res.data.records.map(item => ({ |
| | | label: item.name, |
| | |
| | | })) |
| | | } |
| | | }) |
| | | this.$HTTP.get('/api/blade-cps/employee/tree').then(res => { |
| | | this.$HTTP.get('/api/smis/employee/tree').then(res => { |
| | | if (res.code === 200) { |
| | | this.options.employeeId = res.data |
| | | } |
| | | }) |
| | | this.$HTTP.get('/api/blade-cps/group/tree?groupCategory=1&groupType=group_machine').then(res => { |
| | | this.$HTTP.get('/api/smis/group/tree?groupCategory=1&groupType=group_machine').then(res => { |
| | | if (res.code === 200) { |
| | | this.options.groupId = res.data |
| | | } |
| | | }) |
| | | this.$HTTP.get('/api/blade-cps/organization/tree?groupType=group_organization&groupCategory=1').then(res => { |
| | | this.$HTTP.get('/api/smis/organization/tree?groupType=group_organization&groupCategory=1').then(res => { |
| | | if (res.code === 200) { |
| | | this.options.organizationId = res.data |
| | | } |
| | |
| | | this.form[item] = '' |
| | | }) |
| | | if (params.id) { |
| | | this.$HTTP.get(`/api/blade-cps/machine/detail/${params.id}`).then(res => { |
| | | this.$HTTP.get(`/api/smis/machine/detail/${params.id}`).then(res => { |
| | | if (res.code === 200) { |
| | | this.form = { |
| | | ...this.form, |
| | |
| | | let res |
| | | try { |
| | | if (this.form.id) { |
| | | res = await this.$HTTP.put('/api/blade-cps/machine', data).catch(() => { |
| | | res = await this.$HTTP.put('/api/smis/machine', data).catch(() => { |
| | | throw new Error() |
| | | }) |
| | | } else { |
| | | res = await this.$HTTP.post('/api/blade-cps/machine', data).catch(() => { |
| | | res = await this.$HTTP.post('/api/smis/machine', data).catch(() => { |
| | | throw new Error() |
| | | }) |
| | | } |