|
|
@ -522,7 +522,7 @@ |
|
|
|
alt=""> |
|
|
|
alt=""> |
|
|
|
</el-dialog> |
|
|
|
</el-dialog> |
|
|
|
|
|
|
|
|
|
|
|
<el-dialog :title="curRow ? '编辑客户' : '创建客户'" |
|
|
|
<el-dialog :title="curRow ? '编辑客户' : '添加客户'" |
|
|
|
:visible.sync="customerVisible" |
|
|
|
:visible.sync="customerVisible" |
|
|
|
width="300px" |
|
|
|
width="300px" |
|
|
|
class="dialog" |
|
|
|
class="dialog" |
|
|
@ -942,10 +942,10 @@ export default { |
|
|
|
this.dataPermissionss = res.result.dataPermissionss |
|
|
|
this.dataPermissionss = res.result.dataPermissionss |
|
|
|
this.getCityData() |
|
|
|
this.getCityData() |
|
|
|
this.changIndustryData() |
|
|
|
this.changIndustryData() |
|
|
|
this.getSchoolData() |
|
|
|
this.getSchool() |
|
|
|
}).catch((res) => { }) |
|
|
|
}).catch((res) => { }) |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
this.getSchoolData() |
|
|
|
this.getSchool() |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
methods: { |
|
|
@ -1064,7 +1064,6 @@ export default { |
|
|
|
setCustomer () { |
|
|
|
setCustomer () { |
|
|
|
this.initCustomer() |
|
|
|
this.initCustomer() |
|
|
|
this.customerListVisible = true |
|
|
|
this.customerListVisible = true |
|
|
|
// this.customerVisible = true |
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
handleCurrentChangeCustomer (val) { |
|
|
|
handleCurrentChangeCustomer (val) { |
|
|
|
this.pageCustomer = val |
|
|
|
this.pageCustomer = val |
|
|
@ -1088,6 +1087,13 @@ export default { |
|
|
|
// 创建客户 |
|
|
|
// 创建客户 |
|
|
|
addCustomer () { |
|
|
|
addCustomer () { |
|
|
|
this.curRow = null |
|
|
|
this.curRow = null |
|
|
|
|
|
|
|
this.customerForm = { |
|
|
|
|
|
|
|
schoolName: '', |
|
|
|
|
|
|
|
provinceId: '', |
|
|
|
|
|
|
|
cityId: '', |
|
|
|
|
|
|
|
customerId: '', |
|
|
|
|
|
|
|
schoolId: '', |
|
|
|
|
|
|
|
} |
|
|
|
this.customerVisible = true |
|
|
|
this.customerVisible = true |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 编辑客户 |
|
|
|
// 编辑客户 |
|
|
@ -1110,6 +1116,7 @@ export default { |
|
|
|
}).then(async () => { |
|
|
|
}).then(async () => { |
|
|
|
await this.$post(`${this.api.delClientsOrSchools}?schoolId=${row.schoolId}`).then(res => { |
|
|
|
await this.$post(`${this.api.delClientsOrSchools}?schoolId=${row.schoolId}`).then(res => { |
|
|
|
this.$message.success('删除成功') |
|
|
|
this.$message.success('删除成功') |
|
|
|
|
|
|
|
this.getSchool(row.schoolId) |
|
|
|
this.getCustomer() |
|
|
|
this.getCustomer() |
|
|
|
}) |
|
|
|
}) |
|
|
|
}).catch(() => { }) |
|
|
|
}).catch(() => { }) |
|
|
@ -1134,24 +1141,28 @@ export default { |
|
|
|
|
|
|
|
|
|
|
|
const row = this.curRow |
|
|
|
const row = this.curRow |
|
|
|
form.customerName = form.schoolName |
|
|
|
form.customerName = form.schoolName |
|
|
|
if (this.curRow) { |
|
|
|
let res |
|
|
|
if (row.bindOrNot) { |
|
|
|
try { |
|
|
|
// 编辑客户 |
|
|
|
if (this.curRow) { |
|
|
|
await this.$post(this.api.clientSettingsEditClient, form) |
|
|
|
if (row.bindOrNot) { |
|
|
|
|
|
|
|
// 编辑客户 |
|
|
|
|
|
|
|
res = await this.$post(this.api.clientSettingsEditClient, form) |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
// 编辑学校 |
|
|
|
|
|
|
|
res = await this.$post(this.api.editClientsOrSchools, form) |
|
|
|
|
|
|
|
} |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
// 编辑学校 |
|
|
|
// 新增学校 |
|
|
|
await this.$post(this.api.editClientsOrSchools, form) |
|
|
|
res = await this.$get(this.api.addNewCustomersByOneself, form) |
|
|
|
} |
|
|
|
} |
|
|
|
} else { |
|
|
|
} finally { |
|
|
|
// 新增学校 |
|
|
|
this.submiting = false |
|
|
|
await this.$get(this.api.addNewCustomersByOneself, form) |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
this.customerVisible = false |
|
|
|
this.customerVisible = false |
|
|
|
this.submiting = false |
|
|
|
|
|
|
|
this.$message.success('添加成功') |
|
|
|
this.$message.success('添加成功') |
|
|
|
this.getCustomer() |
|
|
|
this.getCustomer() |
|
|
|
this.getSchoolData(res.schoolId) |
|
|
|
this.getSchool(res.schoolId || '') |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 获取产品分类 |
|
|
|
// 获取产品分类 |
|
|
|
getCategory () { |
|
|
|
getCategory () { |
|
|
@ -1289,12 +1300,7 @@ export default { |
|
|
|
this.form.customerName = '' |
|
|
|
this.form.customerName = '' |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 获取学校/客户名称 |
|
|
|
// 获取学校/客户名称 |
|
|
|
getSchoolData (schoolId) { |
|
|
|
getSchool (schoolId) { |
|
|
|
let data = { |
|
|
|
|
|
|
|
schoolName: '', |
|
|
|
|
|
|
|
provinceId: '', |
|
|
|
|
|
|
|
cityId: '' |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
this.$get(this.api.querySchoolData).then(({ list }) => { |
|
|
|
this.$get(this.api.querySchoolData).then(({ list }) => { |
|
|
|
this.schoolList = list |
|
|
|
this.schoolList = list |
|
|
|
// 有传schoolId,则需要找到这个学校然后赋值表单 |
|
|
|
// 有传schoolId,则需要找到这个学校然后赋值表单 |
|
|
@ -1305,6 +1311,8 @@ export default { |
|
|
|
this.form.provinceId = item.provinceId |
|
|
|
this.form.provinceId = item.provinceId |
|
|
|
this.getCityData() |
|
|
|
this.getCityData() |
|
|
|
this.form.cityId = item.cityId |
|
|
|
this.form.cityId = item.cityId |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
this.form.schoolId = '' |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
}).catch(res => { }); |
|
|
|
}).catch(res => { }); |
|
|
@ -1451,12 +1459,13 @@ export default { |
|
|
|
}, 1500) |
|
|
|
}, 1500) |
|
|
|
this.$store.commit('schoolIdData', { schoolId: this.form.schoolId }) |
|
|
|
this.$store.commit('schoolIdData', { schoolId: this.form.schoolId }) |
|
|
|
this.$message.success('添加成功') |
|
|
|
this.$message.success('添加成功') |
|
|
|
tab ? this.tabChange(tab, 1) : this.router.push('list') |
|
|
|
tab ? this.tabChange(tab, 1) : this.$router.push('/customer') |
|
|
|
}).catch((res) => { |
|
|
|
}).catch((res) => { |
|
|
|
this.submiting = false |
|
|
|
this.submiting = false |
|
|
|
}) |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
|
|
|
|
this.submiting = false |
|
|
|
this.$message.warning('该客户已存在') |
|
|
|
this.$message.warning('该客户已存在') |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|