提交 a8ea25b8 authored 作者: matian's avatar matian

代码优化

上级 ce262e48
...@@ -79,11 +79,9 @@ export default { ...@@ -79,11 +79,9 @@ export default {
}, },
// 添加员工 // 添加员工
submit() { submit() {
const param = this.multipleSelection
const arr = param.map(item => item.id)
const params = { group_id: this.id, customer_ids: arr }
this.btnDisabled = true this.btnDisabled = true
createCustomer(params) const arr = this.multipleSelection.map(item => item.id)
createCustomer({ group_id: this.id, customer_ids: arr })
.then(res => { .then(res => {
if (res.code === 0) { if (res.code === 0) {
this.$message.success('添加客户成功') this.$message.success('添加客户成功')
......
...@@ -60,8 +60,8 @@ export default { ...@@ -60,8 +60,8 @@ export default {
}, },
// 编辑/更新客户组 // 编辑/更新客户组
edit() { edit() {
const params = Object.assign({ id: this.data.id }, this.form)
this.btnDisabled = true this.btnDisabled = true
const params = Object.assign({ id: this.data.id }, this.form)
editCustomerGroup(params) editCustomerGroup(params)
.then(res => { .then(res => {
this.$message.success('客户组更新成功') this.$message.success('客户组更新成功')
......
...@@ -98,8 +98,8 @@ export default { ...@@ -98,8 +98,8 @@ export default {
this.$refs.form this.$refs.form
.validate() .validate()
.then(() => { .then(() => {
const params = Object.assign({ group_id: this.id, staff_ids: this.form.id })
this.btnDisabled = true this.btnDisabled = true
const params = Object.assign({ group_id: this.id, staff_ids: this.form.id })
createEmployee(params).then(res => { createEmployee(params).then(res => {
if (res.code === 0) { if (res.code === 0) {
this.$message.success('添加员工成功') this.$message.success('添加员工成功')
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论