diff --git a/resources/beike/admin/views/pages/customers/index.blade.php b/resources/beike/admin/views/pages/customers/index.blade.php index f90fbdf5..cd6e8077 100644 --- a/resources/beike/admin/views/pages/customers/index.blade.php +++ b/resources/beike/admin/views/pages/customers/index.blade.php @@ -95,7 +95,7 @@ name: '', email: '', password: '', - customer_group_id: 1, + customer_group_id: @json($customer_groups[0]['id'] ?? ''), status: 1, }, }, @@ -128,15 +128,10 @@ return; } - $.ajax({ - url: `/admin/customers`, - type: 'post', - data: self.dialogCustomers.form, - success: function(res) { - self.$message.success(res.message); - self.customers.push(res.data); - self.dialogCustomers.show = false - } + $http.post('customers', this.dialogCustomers.form).then((res) => { + this.$message.success(res.message); + this.customers.push(res.data); + this.dialogCustomers.show = false }) }); }, @@ -148,13 +143,9 @@ cancelButtonText: '取消', type: 'warning' }).then(() => { - $.ajax({ - url: url, - type: 'delete', - success: function(res) { - self.$message.success(res.message); - self.customers.splice(index, 1) - } + $http.delete(url).then((res) => { + self.$message.success(res.message); + self.customers.splice(index, 1) }) }).catch(()=>{}) }, diff --git a/resources/beike/admin/views/pages/tax_classes/index.blade.php b/resources/beike/admin/views/pages/tax_classes/index.blade.php index a58a7bba..8a2e8224 100644 --- a/resources/beike/admin/views/pages/tax_classes/index.blade.php +++ b/resources/beike/admin/views/pages/tax_classes/index.blade.php @@ -54,18 +54,18 @@ - + - + - + - + @@ -104,7 +104,7 @@ id: null, title: '', description: '', - rates: [], + rules: [], }, }, @@ -133,7 +133,7 @@ id: tax.id, title: tax.title, description: tax.description, - rates: tax.rates, + rules: tax.rules, } } }, @@ -142,11 +142,11 @@ const tax_rate_id = this.source.all_tax_rates[0]?.id || 0; const based = this.source.bases[0] || ''; - this.dialog.form.rates.push({tax_rate_id, based, priority: ''}) + this.dialog.form.rules.push({tax_rate_id, based, priority: ''}) }, deleteRates(index) { - this.dialog.form.rates.splice(index, 1) + this.dialog.form.rules.splice(index, 1) }, addFormSubmit(form) { @@ -161,9 +161,9 @@ } $http[type](url, this.dialog.form).then((res) => { - // this.$message.success(res.message); - // this.tax_classes.push(res.data) - // this.dialog.show = false + this.$message.success(res.message); + this.tax_classes.push(res.data) + this.dialog.show = false }) }); },