| | |
| | | let params = { |
| | | ...data |
| | | } |
| | | return await this.$HTTP.get(`/api/blade-cps/material-type/page`, params).then(res => { |
| | | return await this.$HTTP.get(`/api/smis/material-type/page`, params).then(res => { |
| | | return res |
| | | }) |
| | | } |
| | |
| | | }, |
| | | methods: { |
| | | init() { |
| | | this.$HTTP.get(`/api/blade-cps/material-type/list`).then(res => { |
| | | this.$HTTP.get(`/api/smis/material-type/list`).then(res => { |
| | | this.options.typeId = res.data.map(item => ({ |
| | | label: item.name, |
| | | value: item.id |
| | |
| | | |
| | | }, |
| | | table_del(rowArr, type) { |
| | | this.$HTTP.delete(`/api/blade-cps/material-type/delete-material-type?ids=${rowArr.map(v => v.id).toString()}&type=${type}`).then(res => { |
| | | this.$HTTP.delete(`/api/smis/material-type/delete-material-type?ids=${rowArr.map(v => v.id).toString()}&type=${type}`).then(res => { |
| | | if (res.code === 200) { |
| | | this.$message.success("操作成功"); |
| | | this.$refs.table.reload(this.params) |
| | |
| | | this.$refs.dialogForm.validate(async (valid) => { |
| | | if (valid) { |
| | | if (this.form.id) { |
| | | this.$HTTP.put(`/api/blade-cps/material-type/update-material-type`, { |
| | | this.$HTTP.put(`/api/smis/material-type/update-material-type`, { |
| | | ...this.form |
| | | }).then(res => { |
| | | this.drawer = false |
| | | this.$refs.table.reload(this.params) |
| | | }) |
| | | } else { |
| | | this.$HTTP.post(`/api/blade-cps/material-type/create-material-type`, { |
| | | this.$HTTP.post(`/api/smis/material-type/create-material-type`, { |
| | | ...this.form |
| | | }).then(res => { |
| | | this.drawer = false |