diff --git a/src/store/index.js b/src/store/index.js
index 7029e0d..327cada 100644
--- a/src/store/index.js
+++ b/src/store/index.js
@@ -3,7 +3,6 @@ import Vuex from 'vuex';
Vue.use(Vuex);
const store = new Vuex.Store({
state: {
- customerId:'',
courseId:'',
userId: '',
roleId: '',
@@ -21,9 +20,6 @@ const store = new Vuex.Store({
userData (state, payload) {
state.userId = payload.user_id
},
- customerData (state, payload) {
- state.customerId = payload.customer_id
- },
courseData (state, payload) {
state.courseId = payload.course_id
},
diff --git a/src/utils/api.js b/src/utils/api.js
index db822ef..9b9dcc9 100644
--- a/src/utils/api.js
+++ b/src/utils/api.js
@@ -26,17 +26,20 @@ export default {
deletePlatform: `${host}/liuwanr/userInfo/deletePlatform`, //更新用户组织架构
updateUserRoleId: `${host}/liuwanr/userInfo/updateUserRoleId`, //更新用户角色id接口
- deleteCustomer: `${host}/liuwanr/customer/deleteCustomer`, //删除客户
- updateCustomer: `${host}/liuwanr/customer/updateCustomer`, //更新客户
- addCustomer: `${host}/liuwanr/customer/addCustomer`, //添加客户
- queryCustomer: `${host}/liuwanr/customer/queryCustomer`, //查询客户
- queryCustomerIsExists: `${host}/liuwanr/customer/queryCustomerIsExists`, //查询客户是否存在
- queryCustomerDetails: `${host}/liuwanr/customer/queryCustomerDetails`, //查询客户详情
- queryCustomerIndustryClass: `${host}/liuwanr/customer/queryCustomerIndustryClass`, //查询行业类
- queryCustomerIndustry: `${host}/liuwanr/customer/queryCustomerIndustry`, //查询行业
- queryPhone: `${host}/liuwanr/user/queryPhone`, //查询电话
- querySchoolData: `${host}/liuwanr/customer/querySchool`, //根据学校名称查询学校信息
- queryPlatform: `${host}/liuwanr/userInfo/queryPlatform`, //查询系统列表
+ // 客户管理
+ deleteCustomer: `${host3}/nakadai/customer/delCustomer`,
+ updateCustomer: `${host3}/nakadai/customer/updateCustomer`,
+ addCustomer: `${host3}/nakadai/customer/addCustomer`,
+ queryCustomer: `${host3}/nakadai/customer/queryCustomer`,
+ queryCustomerDetails: `${host3}/nakadai/customer/queryCustomerDetails`,
+ resetPwdCustomer: `${host3}/nakadai/customer/resetPwd`,
+ queryCustomerIsExists: `${host3}/nakadai/customer/queryCustomerIsExists`,
+ updateEnabled: `${host3}/nakadai/customer/updateEnabled`,
+ queryCustomerIndustryClass: `${host}/liuwanr/customer/queryCustomerIndustryClass`,
+ queryCustomerIndustry: `${host}/liuwanr/customer/queryCustomerIndustry`,
+ queryPhone: `${host}/liuwanr/user/queryPhone`,
+ querySchoolData: `${host}/liuwanr/customer/querySchool`,
+ queryPlatform: `${host}/liuwanr/userInfo/queryPlatform`,
// 用户管理
delUserAccount: `${host3}/users/userAccount/delUserAccount`,
@@ -51,7 +54,7 @@ export default {
checkCode: `${host3}/users/userAccount/checkCode`,
findPasswordByEmail: `${host3}/users/userAccount/findPasswordByEmail`,
findPasswordByPhone: `${host3}/users/userAccount/findPasswordByPhone`,
-
+
queryOrder: `${host}/liuwanr/order/queryOrder`, //查询订单
queryOrderDetails: `${host}/liuwanr/order/queryOrderDetails`, //查询订单详情
queryOrderCustomer: `${host}/liuwanr/order/queryOrderCustomer`, //查询订单客户
diff --git a/src/utils/http.js b/src/utils/http.js
index e819b5a..b282a32 100644
--- a/src/utils/http.js
+++ b/src/utils/http.js
@@ -133,10 +133,8 @@ export function get(url, params){
resolve(res.data);
break;
case 500:
- this.$message.error(
- res.data.errmessage
- );
- break;
+ reject(res.data)
+ break
case 300:
this.$message.error(
res.data.errmessage
@@ -229,6 +227,11 @@ export function post(url, params) {
res.data.errmessage
);
break;
+ case 10001:
+ this.$message.error(
+ res.data.message
+ );
+ break;
}
}else{
resolve(res.data)
diff --git a/src/views/Home.vue b/src/views/Home.vue
index 7b38572..e043743 100644
--- a/src/views/Home.vue
+++ b/src/views/Home.vue
@@ -5,9 +5,9 @@
-
+
-
+
diff --git a/src/views/customer/AddCustomer.vue b/src/views/customer/AddCustomer.vue
index a4a0159..096f778 100644
--- a/src/views/customer/AddCustomer.vue
+++ b/src/views/customer/AddCustomer.vue
@@ -7,7 +7,7 @@
返回
-
+
确定
@@ -21,39 +21,36 @@
-
+
-
+
-
-
-
+
+
+
-
-
-
-
+
+
-
-
+
+
+
+
-
-
+
+
-
-
-
-
+
+
@@ -62,40 +59,36 @@
-
-
+
+
-
-
-
-
-
-
-
-
+
+
-
-
-
-
-
-
+
+
+
+
-
-
+
+
-
-
+
+
+
+
+
+
@@ -114,18 +107,47 @@
-
+
-
+
-
+
+
+ 配置
+
-
+
+
+
+
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
配置
@@ -156,19 +178,21 @@
+
+
-
+
-
+
-
+
-
+
@@ -230,38 +254,55 @@
-
diff --git a/src/views/customer/Dashboard.vue b/src/views/customer/Dashboard.vue
index 66fad16..350003c 100644
--- a/src/views/customer/Dashboard.vue
+++ b/src/views/customer/Dashboard.vue
@@ -12,28 +12,28 @@
-
+
-
+
-
+
-
+
@@ -50,39 +50,38 @@
客户列表
- 新增客户
+ 新增客户
批量删除
-
+
- {{scope.$index + (pageNo - 1) * pageSize + 1}}
+ {{scope.$index + (page - 1) * pageSize + 1}}
-
-
-
+
{{scope.row.industryName}}
+
+
-
-
-
+
+
- 重置密码
- 查看
+ 重置密码
+ 查看
编辑
删除
应用权限
@@ -90,7 +89,7 @@
@@ -104,11 +103,11 @@ export default {
name: 'dashboard',
data() {
return {
- name: localStorage.getItem('ms_username'),
+ searchTimer: null,
countryList: [{
name:'中国'
}],
- customerData: [],
+ listData: [],
form: {
countries:'中国',
provinces: '',
@@ -118,19 +117,19 @@ export default {
multipleSelection: [],
provinceList: [],
cityList: [],
- pageNo: 1,
+ page: 1,
pageSize: 10,
- totals: 1,
+ total: 1,
ruleIds: []
};
},
- components: {
-
- },
- computed: {
- role() {
- return this.name === 'admin' ? '超级管理员' : '普通用户';
- }
+ watch: {
+ 'form.keyword': function(val) {
+ clearTimeout(this.searchTimer)
+ this.searchTimer = setTimeout(() => {
+ this.initData()
+ },500)
+ },
},
mounted() {
this.getData()
@@ -143,29 +142,32 @@ export default {
provinceId: this.form.provinces,
cityId: this.form.city,
searchContent: this.form.keyword,
- pageNo: this.pageNo,
- pageSize: this.pageSize
+ page: this.page,
+ size: this.pageSize
}
- this.$get(this.api.queryCustomer,data).then(res => {
- this.customerData = res.message.rows
- this.totals = res.message.total
+ this.$post(this.api.queryCustomer,data).then(res => {
+ this.listData = res.message.list
+ this.total = res.message.totalCount
}).catch(res => {});
},
+ initData(){
+ this.page = 1
+ this.getData()
+ },
getProvince(){
this.$get(this.api.queryProvince).then(res => {
this.provinceList = res.message
this.$store.commit("provinceData", { provinceList : this.provinceList});
}).catch(res => {});
},
- // 清除省份
clearprovince(){
this.form.city = ''
},
getCity(){
this.clearprovince()
this.getCityData()
- this.pageNo = 1
- this.getData()
+ this.page = 1
+ this.initData()
},
getCityData(){
let data = {
@@ -173,97 +175,76 @@ export default {
}
this.$get(this.api.queryCity,data).then(res => {
this.cityList = res.message
- }).catch(res => {});
+ }).catch(res => {})
},
permission(){
this.$router.push('/permission')
},
addcustomer(){
- this.$store.commit("customerData", { customer_id : ''});
- this.$router.push('/addcustomer');
+ this.$router.push('addcustomer')
},
edit(row){
- this.$store.commit("customerData", { customer_id : row.customerId });
- this.$router.push('/addcustomer');
+ this.$router.push(`addcustomer?id=${row.customerId}`)
+ },
+ show(row){
+ this.$router.push(`addcustomer?id=${row.customerId}&show=true`)
},
handleDelete(row) {
this.$confirm('确定要删除吗?', '提示', {
type: 'warning'
- })
- .then(() => {
- let str = '';
- str += row.customerId+',';
- var deleteList = str.split(',').map(Number);
- deleteList.pop()
- var arr = [];
- var signAgainReq = new Object();
- signAgainReq.customerId = deleteList[0];
- arr.push(signAgainReq);
-
- let data = {
- customer: arr
- }
- this.$post(this.api.deleteCustomer,data).then(res => {
- this.$message.success('删除成功');
+ }).then(() => {
+ this.$post(this.api.deleteCustomer,row.customerId).then(res => {
+ this.$message.success('删除成功')
this.getData()
- }).catch(res => {});
- })
- .catch(() => {});
- },
- getRowKeys(row) {
- return row.customerId;
+ }).catch(res => {})
+ }).catch(() => {})
},
handleSelectionChange(val) {
- this.multipleSelection = val;
+ this.multipleSelection = val
},
delAllSelection() {
if(this.multipleSelection.length != ''){
- const length = this.multipleSelection.length;
- let str = '';
- for (let i = 0; i < length; i++) {
- str += this.multipleSelection[i].customerId+',';
- }
- var deleteList = str.split(',').map(Number);
- deleteList.pop()
- var arr = [];
- for(var i = 0,len = deleteList.length; i < len; i++){
- var signAgainReq = new Object();
- signAgainReq.customerId = deleteList[i];
- arr.push(signAgainReq);
- }
- // 批量删除
+ let arr = this.multipleSelection
+ let delList = arr.map(item => {
+ return item.customerId
+ })
this.$confirm('确定要删除吗?', '提示', {
type: 'warning'
- })
- .then(() => {
- let data = {
- customer: arr
- }
+ }).then(() => {
this.$post(this.api.deleteCustomer,data).then(res => {
this.multipleSelection = [];
- this.$message.success('删除成功');
+ this.$message.success('删除成功')
this.getData()
- }).catch(res => {});
- }).catch(() => {});
+ }).catch(res => {})
+ }).catch(() => {})
}else{
- this.$message.error('请先选择客户 !');
+ this.$message.error('请先选择数据')
}
},
- onSearch(){
- this.pageNo = 1
+ handleCurrentChange(val) {
+ this.page = val
this.getData()
},
- handleCurrentChange(val) {
- this.pageNo = val;
- this.getData();
+ resetPassword(row){
+ this.$confirm(`重置后的密码为:${this.$config.initialPassword},确定重置?`, '提示', {
+ }).then(() => {
+ this.$get(this.api.resetPwdCustomer,{
+ customerId: row.customerId,
+ }).then(res => {
+ if(res.message == 'success'){
+ this.$message.success('重置成功')
+ }else{
+ this.$message.error('重置失败')
+ }
+ }).catch(res => {});
+ }).catch(() => {
+ });
},
}
};
-
diff --git a/src/views/data/Product.vue b/src/views/data/Product.vue
index 6961614..e8055dd 100644
--- a/src/views/data/Product.vue
+++ b/src/views/data/Product.vue
@@ -10,7 +10,7 @@
-
+
@@ -531,6 +531,9 @@ export default {