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