品规管理新增和编辑接口联调

merge-requests/1/head
张鑫 5 years ago
parent 6bd2e4c84c
commit 7f42669c11

@ -106,5 +106,15 @@ export default {
name: '分类列表', name: '分类列表',
method: 'POST' method: 'POST'
}, },
addCategory: {
url: '/category',
name: '新增分类',
method: 'POST'
},
editCategory: {
url: '/category',
name: '编辑分类',
method: 'PUT'
},
} }

@ -86,40 +86,40 @@ export default {
}, },
methods: { methods: {
handleOk() { handleOk() {
// this.confirmLoading = true; this.confirmLoading = true;
// setTimeout(() => { setTimeout(() => {
// this.form.validateFields((err, values) => { this.form.validateFields((err, values) => {
// console.log(values) console.log(values)
// if (!err) { if (!err) {
// console.log(this.title) console.log(this.title)
// if(this.type=='add'){ if (this.type == 'add') {
// this.$api.httpApi.addCameraIo({ this.$api.httpApi.addCategory({
// data:values data: values
// }).then(res => { }).then(res => {
// if(res.code==200){ if (res.code == 200) {
// this.$emit('sure',false) this.$emit('sure', false)
// this.$message.success(''); this.$message.success('新增品规成功');
// } }
// }).catch(err => { }).catch(err => {
//
// }); });
// }else if(this.type=='edit'){ } else if (this.type == 'edit') {
// values.id = this.id values.id = this.id
// this.$api.httpApi.editCameraIo({ this.$api.httpApi.editCategory({
// data:values data: values
// }).then(res => { }).then(res => {
// if(res.code==200){ if (res.code == 200) {
// this.$emit('sure',false) this.$emit('sure', false)
// this.$message.success(''); this.$message.success('编辑品规成功');
// } }
// }).catch(err => { }).catch(err => {
//
// }); });
// } }
// } }
// }); });
// this.confirmLoading = false; this.confirmLoading = false;
// }, 500); }, 500);
}, },
handleCancel() { handleCancel() {
console.log('Clicked cancel button'); console.log('Clicked cancel button');

Loading…
Cancel
Save