e 3 years ago
commit 088e10c894
  1. 40
      public/table.json
  2. BIN
      src/assets/img/person/bg.png
  3. BIN
      src/assets/img/person/bind.png
  4. BIN
      src/assets/img/person/date.png
  5. BIN
      src/assets/img/person/edit.png
  6. BIN
      src/assets/img/person/idcard.png
  7. BIN
      src/assets/img/person/manag.png
  8. BIN
      src/assets/img/person/open.png
  9. BIN
      src/assets/img/person/school.png
  10. BIN
      src/assets/img/person/select.png
  11. BIN
      src/assets/img/person/user.png
  12. 14
      src/components/Header.vue
  13. 4
      src/config/index.js
  14. 8
      src/router/index.js
  15. 8
      src/store/index.js
  16. 83
      src/utils/api.js
  17. 11
      src/utils/http.js
  18. 4
      src/views/Home.vue
  19. 3
      src/views/Login.vue
  20. 352
      src/views/customer/AddCustomer.vue
  21. 180
      src/views/customer/customer.vue
  22. 36
      src/views/data/Framework.vue
  23. 1
      src/views/data/Introduce.vue
  24. 444
      src/views/data/Product.vue
  25. 1322
      src/views/setting/Person.vue
  26. 1669
      src/views/user/AddUser.vue
  27. 209
      src/views/user/User.vue

@ -1,40 +0,0 @@
{
"list": [{
"id": 1,
"name": "张三",
"money": 123,
"address": "广东省东莞市长安镇",
"state": "成功",
"date": "2019-11-1",
"thumb": "https://lin-xin.gitee.io/images/post/wms.png"
},
{
"id": 2,
"name": "李四",
"money": 456,
"address": "广东省广州市白云区",
"state": "成功",
"date": "2019-10-11",
"thumb": "https://lin-xin.gitee.io/images/post/node3.png"
},
{
"id": 3,
"name": "王五",
"money": 789,
"address": "湖南省长沙市",
"state": "失败",
"date": "2019-11-11",
"thumb": "https://lin-xin.gitee.io/images/post/parcel.png"
},
{
"id": 4,
"name": "赵六",
"money": 1011,
"address": "福建省厦门市鼓浪屿",
"state": "成功",
"date": "2019-10-20",
"thumb": "https://lin-xin.gitee.io/images/post/notice.png"
}
],
"pageTotal": 4
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

@ -5,12 +5,10 @@
</div> </div>
<div class="header-right"> <div class="header-right">
<div class="header-user-con"> <div class="header-user-con">
<!-- <span>应用市场</span> <div class="user" @click="toPerson">
<el-divider class="ml20" direction="vertical"></el-divider> -->
<div class="ml20">
<el-avatar :size="40" :src="circleUrl"></el-avatar> <el-avatar :size="40" :src="circleUrl"></el-avatar>
<span class="user-avator">{{username}}</span>
</div> </div>
<span class="user-avator">{{username}}</span>
<el-divider class="ml20" direction="vertical"></el-divider> <el-divider class="ml20" direction="vertical"></el-divider>
<el-button type="text" class="ml20" @click="loginout">退出</el-button> <el-button type="text" class="ml20" @click="loginout">退出</el-button>
</div> </div>
@ -35,6 +33,9 @@ export default {
} }
}, },
methods: { methods: {
toPerson(){
this.$router.push('/person')
},
loginout() { loginout() {
localStorage.removeItem('ms_username'); localStorage.removeItem('ms_username');
this.$router.push('/login'); this.$router.push('/login');
@ -75,6 +76,11 @@ export default {
height: 70px; height: 70px;
align-items: center; align-items: center;
} }
.header-user-con .user{
display: inline-flex;
align-items: center;
cursor: pointer;
}
.user-avator { .user-avator {
cursor: pointer; cursor: pointer;
margin-left: 10px; margin-left: 10px;

@ -17,6 +17,10 @@ export default {
* @description 默认密码 * @description 默认密码
*/ */
initialPassword: '111aaa', initialPassword: '111aaa',
/**
* 所属平台1->职站 2->数据平台
*/
platformId: 1,
/** /**
* @description 系统列表 * @description 系统列表
*/ */

@ -77,11 +77,15 @@ let router = new Router({
meta: { title: '数据管理' } meta: { title: '数据管理' }
}, },
{ {
// 权限页面
path: '/permission', path: '/permission',
component: () => import(/* webpackChunkName: "permission" */ '../views/customer/Permission.vue'), component: () => import('../views/customer/Permission.vue'),
meta: { title: '应用权限', permission: true } meta: { title: '应用权限', permission: true }
}, },
{
path: '/person',
component: () => import('../views/setting/Person.vue'),
meta: { title: '个人中心' }
},
{ {
path: '/404', path: '/404',
component: () => import(/* webpackChunkName: "404" */ '../views/404.vue'), component: () => import(/* webpackChunkName: "404" */ '../views/404.vue'),

@ -3,7 +3,6 @@ import Vuex from 'vuex';
Vue.use(Vuex); Vue.use(Vuex);
const store = new Vuex.Store({ const store = new Vuex.Store({
state: { state: {
customerId:'',
courseId:'', courseId:'',
userId: '', userId: '',
roleId: '', roleId: '',
@ -13,15 +12,14 @@ const store = new Vuex.Store({
systemId: '', systemId: '',
orderId: '', orderId: '',
userLoginId: '', userLoginId: '',
userName: '',
roleId: '',
loginToken: '' loginToken: ''
}, },
mutations:{ mutations:{
userData (state, payload) { userData (state, payload) {
state.userId = payload.user_id state.userId = payload.user_id
}, },
customerData (state, payload) {
state.customerId = payload.customer_id
},
courseData (state, payload) { courseData (state, payload) {
state.courseId = payload.course_id state.courseId = payload.course_id
}, },
@ -40,6 +38,8 @@ const store = new Vuex.Store({
}, },
userLoginData (state, payload) { userLoginData (state, payload) {
state.userLoginId = payload.userLogin_id state.userLoginId = payload.userLogin_id
state.userName = payload.userName
state.roleId = payload.roleId
}, },
tokenData (state, payload) { tokenData (state, payload) {
state.loginToken = payload.loginToken state.loginToken = payload.loginToken

@ -1,20 +1,15 @@
// let host = 'http://192.168.31.117:8080'
// let host = 'http://www.huorantech.cn/liuwanr'
let host = 'http://39.108.250.202' let host = 'http://39.108.250.202'
let host1 = 'http://192.168.31.216:8888' let host1 = 'http://192.168.31.151:9000'
let host2 = 'http://192.168.31.125:9000'
let host3 = 'http://192.168.31.140:9000'
export default { export default {
logins: `${host}/liuwanr/userInfo/adminLogins`, //登录 logins: `${host}/liuwanr/userInfo/adminLogins`, //登录
// addUser: `${host}/liuwanr/user/addUser`, //增加用户
addUser: `${host}/liuwanr/userInfo/addUser`, //增加用户新版 addUser: `${host}/liuwanr/userInfo/addUser`, //增加用户新版
// queryUser: `${host}/liuwanr/user/queryUser`, //查询用户
queryUser: `${host}/liuwanr/userInfo/queryUserInfo`, //查询用户新版 queryUser: `${host}/liuwanr/userInfo/queryUserInfo`, //查询用户新版
// deleteUser: `${host}/liuwanr/user/deleteUser`, //删除用户
deleteUser: `${host}/liuwanr/userInfo/deleteUserInfo`, //删除用户新版 deleteUser: `${host}/liuwanr/userInfo/deleteUserInfo`, //删除用户新版
updateUser: `${host}/liuwanr/user/updateUser`, //编辑用户 updateUser: `${host}/liuwanr/user/updateUser`, //编辑用户
// queryUserDetails: `${host}/liuwanr/user/queryUserDetails`, //查询用户详情
queryUserInfoDetails: `${host}/liuwanr/userInfo/queryUserInfoDetails`, //查询用户详情新版
queryAccountIsExist: `${host}/liuwanr/userInfo/queryServerAccountIsExist`, //查询账号是否存在 queryAccountIsExist: `${host}/liuwanr/userInfo/queryServerAccountIsExist`, //查询账号是否存在
queryUserOR: `${host}/liuwanr/userInfo/queryUserOR`, //查询系统列表详情 queryUserOR: `${host}/liuwanr/userInfo/queryUserOR`, //查询系统列表详情
queryWorkNumberIsExist:`${host}/liuwanr/userInfo/queryWorkNumberIsExist`,//查询学号、工号是否存在 queryWorkNumberIsExist:`${host}/liuwanr/userInfo/queryWorkNumberIsExist`,//查询学号、工号是否存在
@ -30,20 +25,38 @@ export default {
updateOR: `${host}/liuwanr/userInfo/updateOR`, //更新用户组织架构 updateOR: `${host}/liuwanr/userInfo/updateOR`, //更新用户组织架构
deletePlatform: `${host}/liuwanr/userInfo/deletePlatform`, //更新用户组织架构 deletePlatform: `${host}/liuwanr/userInfo/deletePlatform`, //更新用户组织架构
updateUserRoleId: `${host}/liuwanr/userInfo/updateUserRoleId`, //更新用户角色id接口 updateUserRoleId: `${host}/liuwanr/userInfo/updateUserRoleId`, //更新用户角色id接口
resetPwd:`${host}/evaluation/tms/system/resetPwd`,
deleteCustomer: `${host}/liuwanr/customer/deleteCustomer`, //删除客户 // 客户管理
updateCustomer: `${host}/liuwanr/customer/updateCustomer`, //更新客户 deleteCustomer: `${host3}/nakadai/customer/delCustomer`,
addCustomer: `${host}/liuwanr/customer/addCustomer`, //添加客户 updateCustomer: `${host3}/nakadai/customer/updateCustomer`,
queryCustomer: `${host}/liuwanr/customer/queryCustomer`, //查询客户 addCustomer: `${host3}/nakadai/customer/addCustomer`,
queryCustomerIsExists: `${host}/liuwanr/customer/queryCustomerIsExists`, //查询客户是否存在 queryCustomer: `${host3}/nakadai/customer/queryCustomer`,
queryCustomerDetails: `${host}/liuwanr/customer/queryCustomerDetails`, //查询客户详情 queryCustomerDetails: `${host3}/nakadai/customer/queryCustomerDetails`,
queryCustomerIndustryClass: `${host}/liuwanr/customer/queryCustomerIndustryClass`, //查询行业类 resetPwdCustomer: `${host3}/nakadai/customer/resetPwd`,
queryCustomerIndustry: `${host}/liuwanr/customer/queryCustomerIndustry`, //查询行业 queryCustomerIsExists: `${host3}/nakadai/customer/queryCustomerIsExists`,
queryPhone: `${host}/liuwanr/user/queryPhone`, //查询电话 updateEnabled: `${host3}/nakadai/customer/updateEnabled`,
querySchoolData: `${host}/liuwanr/customer/querySchool`, //根据学校名称查询学校信息 queryCustomerIndustryClass: `${host}/liuwanr/customer/queryCustomerIndustryClass`,
queryPlatform: `${host}/liuwanr/userInfo/queryPlatform`, //查询系统列表 queryCustomerIndustry: `${host}/liuwanr/customer/queryCustomerIndustry`,
queryPhone: `${host}/liuwanr/user/queryPhone`,
querySchoolData: `${host3}/nakadai/school/querySchool`,
queryPlatform: `${host}/liuwanr/userInfo/queryPlatform`,
// 用户管理
delUserAccount: `${host3}/users/userAccount/delUserAccount`,
queryUserInfoDetails: `${host3}/users/userAccount/queryUserInfoDetails`,
queryUserInfoList: `${host3}/users/userAccount/queryUserInfoList`,
resetPwd: `${host3}/users/userAccount/resetPwd`,
selectAccountDetail: `${host3}/users/userAccount/selectAccountDetail`,
selectUserSysBind: `${host3}/users/userAccount/selectUserSysBind`,
updatePersonCenter: `${host3}/users/userAccount/updatePersonCenter`,
updateUserAvatars: `${host3}/users/userAccount/updateUserAvatars`,
userInfo: `${host3}/users/userAccount/userInfo`,
checkCode: `${host3}/users/userAccount/checkCode`,
findPasswordByEmail: `${host3}/users/userAccount/findPasswordByEmail`,
findPasswordByPhone: `${host3}/users/userAccount/findPasswordByPhone`,
updateAccountEnable: `${host3}/users/userAccount/updateAccountEnable`,
updateAccountAllEnable: `${host3}/users/userAccount/updateAccountAllEnable`,
queryOrder: `${host}/liuwanr/order/queryOrder`, //查询订单 queryOrder: `${host}/liuwanr/order/queryOrder`, //查询订单
queryOrderDetails: `${host}/liuwanr/order/queryOrderDetails`, //查询订单详情 queryOrderDetails: `${host}/liuwanr/order/queryOrderDetails`, //查询订单详情
queryOrderCustomer: `${host}/liuwanr/order/queryOrderCustomer`, //查询订单客户 queryOrderCustomer: `${host}/liuwanr/order/queryOrderCustomer`, //查询订单客户
@ -96,15 +109,23 @@ export default {
downloadFiles: `${host}/liuwanr/aliyun/downloadFiles`, //下载文件 downloadFiles: `${host}/liuwanr/aliyun/downloadFiles`, //下载文件
// 数据管理 // 数据管理
getIdQueryTable:`${host1}/data/huoran/data/table/getIdQueryTable`, getIdQueryTable:`${host1}/data/table/getIdQueryTable`,
getTableByClassification:`${host1}/data/huoran/data/table/getTableByClassification`, getTableByClassification:`${host1}/data/table/getTableByClassification`,
getTableByCondition:`${host1}/data/huoran/data/table/getTableByCondition`, getTableByCondition:`${host1}/data/table/getTableByCondition`,
originalList:`${host1}/data/huoran/data/table/originalList`, originalList:`${host1}/data/table/originalList`,
originalListById:`${host1}/data/huoran/data/table/originalListById`, originalListById:`${host1}/data/table/originalListById`,
saveCategory:`${host1}/data/huoran/data/table/saveCategory`, saveCategory:`${host1}/data/table/saveCategory`,
saveTable:`${host1}/data/huoran/data/table/saveTable`, saveTable:`${host1}/data/table/saveTable`,
updateCategory:`${host1}/data/huoran/data/table/updateCategory`, updateCategory:`${host1}/data/table/updateCategory`,
deleteCategory:`${host1}/data/huoran/data/table/deleteCategory`, deleteCategory:`${host1}/data/table/deleteCategory`,
deleteTable:`${host1}/data/huoran/data/table/deleteTable`, deleteTable:`${host1}/data/table/deleteTable`,
previewData:`${host1}/data/data/preview`, previewData:`${host2}/data/preview`,
// 产品管理
deleteProduct:`${host1}/data/product/delete`,
findById:`${host1}/data/product/findById`,
listByEntity:`${host1}/data/product/listByEntity`,
saveProduct:`${host1}/data/product/save`,
updateProduct:`${host1}/data/product/update`,
saveRecord:`${host1}/data/dataRecord/saveRecord`,
} }

@ -133,10 +133,8 @@ export function get(url, params){
resolve(res.data); resolve(res.data);
break; break;
case 500: case 500:
this.$message.error( reject(res.data)
res.data.errmessage break
);
break;
case 300: case 300:
this.$message.error( this.$message.error(
res.data.errmessage res.data.errmessage
@ -229,6 +227,11 @@ export function post(url, params) {
res.data.errmessage res.data.errmessage
); );
break; break;
case 10001:
this.$message.error(
res.data.message
);
break;
} }
}else{ }else{
resolve(res.data) resolve(res.data)

@ -5,9 +5,9 @@
<div class="content-box" > <div class="content-box" >
<div class="content"> <div class="content">
<transition name="move" mode="out-in"> <transition name="move" mode="out-in">
<keep-alive> <!-- <keep-alive> -->
<router-view></router-view> <router-view></router-view>
</keep-alive> <!-- </keep-alive> -->
</transition> </transition>
<el-backtop target=".content"></el-backtop> <el-backtop target=".content"></el-backtop>
</div> </div>

@ -63,9 +63,10 @@ export default {
} }
this.$post(this.api.logins,data).then(res => { this.$post(this.api.logins,data).then(res => {
if(res.message.retvalue.roleId == 1){ if(res.message.retvalue.roleId == 1){
let user = res.message.retvalue
this.$message.success('登录成功'); this.$message.success('登录成功');
localStorage.setItem('ms_username', this.param.username); localStorage.setItem('ms_username', this.param.username);
this.$store.commit("userLoginData", { userLogin_id : res.message.retvalue.userId}); this.$store.commit("userLoginData", { userLogin_id : user.userId,userName: user.userName,roleId: user.roleId});
this.$store.commit("tokenData", {loginToken: res.message.retvalue.loginToken}) this.$store.commit("tokenData", {loginToken: res.message.retvalue.loginToken})
this.$router.push('/customer'); this.$router.push('/customer');
}else{ }else{

@ -7,7 +7,7 @@
<div class="per_title" v-preventReClick @click="goback()"> <div class="per_title" v-preventReClick @click="goback()">
<i class="el-icon-arrow-left"></i> <i class="el-icon-arrow-left"></i>
<span class="per_back">返回</span> <span class="per_back">返回</span>
<span class="per_school" v-text="customerId != '' ? '编辑客户信息' : '新增客户信息'"></span> <span class="per_school" v-text="customerId ? '编辑客户信息' : '新增客户信息'"></span>
</div> </div>
<el-button type="primary" size="small" round class="mag" v-preventReClick @click="saveAdd('form')">确定</el-button> <el-button type="primary" size="small" round class="mag" v-preventReClick @click="saveAdd('form')">确定</el-button>
</div> </div>
@ -21,73 +21,74 @@
</div> </div>
<div> <div>
<el-form :model="form" :rules="rules" ref="form" label-width="80px" class="flex-start-around"> <el-form :model="form" :rules="rules" ref="form" label-width="120px" class="flex-start-around" :disabled="isDetail">
<el-col :span="6" style="margin-right: 60px;"> <el-col :span="6" style="margin-right: 60px;">
<el-form-item label="国家"> <el-form-item prop="countries" label="国家">
<el-select v-model="form.countries" clearable placeholder="请选择国家"> <el-select v-model="form.countries" clearable placeholder="请选择国家">
<el-option v-for="(item,index) in countryList" :key="index" :label="item.name" :value="item.name"></el-option> <el-option v-for="(item,index) in countryList" :key="index" :label="item.name" :value="item.name"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item prop="schoolId" label="客户名称"> <el-form-item prop="provinceId" label="省份">
<el-select v-model="form.schoolId" filterable clearable placeholder="请选择学校" <el-select v-model="form.provinceId" placeholder="" disabled>
@change="SchoolChange" @clear="clearSchool()">
<el-option v-for="(item,index) in schoolList" :key="index" :label="item.schoolName" :value="item.schoolId"></el-option>
</el-select>
</el-form-item>
<el-form-item label="省份">
<el-select v-model="form.provinces" placeholder="" disabled>
<el-option v-for="(item,index) in provinceList" :key="index" :label="item.provinceName" :value="item.provinceId"></el-option> <el-option v-for="(item,index) in provinceList" :key="index" :label="item.provinceName" :value="item.provinceId"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item prop="adminName" label="管理员"> <el-form-item label="到期时间">
<el-input placeholder="请输入管理员姓名" v-model="form.adminName"></el-input> <el-date-picker type="date" disabled v-model="form.expireDate" style="width: 100%;" value-format="yyyy-MM-dd"></el-date-picker>
</el-form-item> </el-form-item>
<el-form-item prop="IndustryClass" label="行业类"> <el-form-item prop="industryClassId" label="行业类">
<el-select v-model="form.IndustryClass" clearable placeholder="请选择行业类" @change="changIndustry" @clear="clearIndustry()"> <el-select v-model="form.industryClassId" clearable placeholder="请选择行业类" @change="changIndustry" @clear="clearIndustry()">
<el-option v-for="(item,index) in IndustryClassList" :key="index" :label="item.industryClassName" :value="item.industryClassId"></el-option> <el-option v-for="(item,index) in IndustryClassList" :key="index" :label="item.industryClassName" :value="item.industryClassId"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item prop="name" label="联系人姓名">
<el-input placeholder="请输入联系人姓名" v-model="form.name"></el-input>
</el-form-item>
<el-form-item prop="account" label="账号">
<el-input placeholder="请输入账号" v-model="form.account"></el-input>
</el-form-item>
<el-form-item prop="email" label="邮箱"> <el-form-item prop="email" label="邮箱">
<el-input placeholder="请输入邮箱" v-model="form.email"></el-input> <el-input placeholder="请输入邮箱" v-model="form.email"></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="6" style="margin-left: 60px;"> <el-col :span="6" style="margin-left: 60px;">
<el-form-item label="客户类型"> <el-form-item prop="customerType" label="客户类型">
<el-select v-model="form.customerType" disabled placeholder=""> <el-select v-model="form.customerType" placeholder="请选择客户类型">
<el-option v-for="(item,index) in customerTypeList" :key="index" :label="item.name" :value="item.value"></el-option> <el-option v-for="(item,index) in customerTypeList" :key="index" :label="item.name" :value="item.value"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="学校类型"> <el-form-item prop="cityId" label="城市">
<el-select v-model="form.level" placeholder="" disabled> <el-select v-model="form.cityId" placeholder="" disabled>
<el-option v-for="(item,index) in levelList" :key="index" :label="item.name" :value="item.value"></el-option>
</el-select>
</el-form-item>
<el-form-item label="城市">
<el-select v-model="form.city" placeholder="" disabled>
<el-option v-for="(item,index) in cityList" :key="index" :label="item.cityName" :value="item.cityId"></el-option> <el-option v-for="(item,index) in cityList" :key="index" :label="item.cityName" :value="item.cityId"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item prop="adminPhone" label="手机号"> <el-form-item prop="schoolId" label="客户名称">
<el-input placeholder="请输入管理员手机号" v-model="form.adminPhone" maxlength="11"></el-input> <el-select v-model="form.schoolId" filterable clearable placeholder="请选择学校" @change="SchoolChange" @clear="clearSchool">
<el-option v-for="(item,index) in schoolList" :key="index" :label="item.schoolName" :value="item.schoolId"></el-option>
</el-select>
</el-form-item> </el-form-item>
<el-form-item prop="industry" label="行业"> <el-form-item prop="industryId" label="行业">
<el-select v-model="form.industry" clearable placeholder="请选择行业" :disabled="form.IndustryClass ? false : true"> <el-select v-model="form.industryId" clearable placeholder="请选择行业" :disabled="form.industryClassId ? false : true">
<el-option v-for="(item,index) in industryList" :key="index" :label="item.industryName" :value="item.industryId"></el-option> <el-option v-for="(item,index) in industryList" :key="index" :label="item.industryName" :value="item.industryId"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="到期时间"> <el-form-item label="手机号">
<el-date-picker type="date" disabled v-model="form.stopTime" style="width: 100%;" value-format="yyyy-MM-dd"></el-date-picker> <el-input placeholder="请输入联系人手机号" v-model="form.phone" maxlength="11"></el-input>
</el-form-item>
<el-form-item label="职务">
<el-input placeholder="请输入职务名称" v-model="form.position" maxlength="11"></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-form> </el-form>
@ -98,33 +99,68 @@
<el-card shadow="hover" class="mgb20" v-show="customerId"> <el-card shadow="hover" class="mgb20" v-show="customerId">
<div class="flex-center mgb20 user_header"> <div class="flex-center mgb20 user_header">
<p class="addhr_tag"></p> <p class="addhr_tag"></p>
<span>应用权限</span> <span>课程权限</span>
</div> </div>
<div> <div>
<el-table :data="coursePermissionss" class="orderTable" stripe header-align="center"> <el-table :data="coursePermissionss" class="orderTable" stripe header-align="center">
<el-table-column type="index" width="100" label="序号" align="center"> <el-table-column type="index" width="100" label="序号" align="center">
</el-table-column> </el-table-column>
<el-table-column prop="courseName" label="应用名称" align="center"> <el-table-column prop="courseName" label="课程名称" align="center">
</el-table-column> </el-table-column>
<el-table-column prop="usePeriod" label="使用期限(年)" align="center"> <el-table-column prop="usePeriod" label="使用期限" align="center">
</el-table-column> </el-table-column>
<el-table-column prop="marketPrice" label="市场价(万)" align="center"> <el-table-column prop="usePeriod" label="起止日期" align="center">
</el-table-column> </el-table-column>
<el-table-column prop="transactionPrice" label="成交价(万)" align="center"> <el-table-column prop="usePeriod" label="剩余期限" align="center">
</el-table-column> </el-table-column>
<el-table-column prop="discount" label="折扣率(%)" align="center"> <el-table-column label="端口地址" align="center">
<template slot-scope="scope">
<el-button @click="configure(scope.row)">配置</el-button>
</template>
</el-table-column> </el-table-column>
<el-table-column label="状态" align="center">
<template slot-scope="scope">
<el-switch
v-model="scope.row.isDeliverGoods"
:active-value="1"
:inactive-value="0"
active-text="启用"
inactive-text="禁用"
disabled>
</el-switch>
</template>
</el-table-column>
</el-table>
</div>
</el-card>
<el-card shadow="hover" class="mgb20" v-show="customerId">
<div class="flex-center mgb20 user_header">
<p class="addhr_tag"></p>
<span>数据平台权限</span>
</div>
<div>
<el-table :data="coursePermissionss" class="orderTable" stripe header-align="center">
<el-table-column type="index" width="100" label="序号" align="center">
</el-table-column>
<el-table-column prop="courseName" label="产品名称" align="center"></el-table-column>
<el-table-column prop="usePeriod" label="使用期限" align="center"></el-table-column>
<el-table-column prop="usePeriod" label="起止日期" align="center"></el-table-column>
<el-table-column prop="usePeriod" label="剩余期限" align="center"></el-table-column>
<el-table-column prop="usePeriod" label="账号数" align="center"></el-table-column>
<el-table-column label="端口地址" align="center"> <el-table-column label="端口地址" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button @click="configure(scope.row)">配置</el-button> <el-button @click="configure(scope.row)">配置</el-button>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="发货" align="center"> <el-table-column label="状态" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-switch <el-switch
v-model="scope.row.isDeliverGoods" v-model="scope.row.isDeliverGoods"
:active-value="1" :active-value="1"
:inactive-value="0" :inactive-value="0"
active-text="启用"
inactive-text="禁用"
disabled> disabled>
</el-switch> </el-switch>
</template> </template>
@ -142,19 +178,21 @@
<el-table :data="contractInformations" class="table" stripe header-align="center"> <el-table :data="contractInformations" class="table" stripe header-align="center">
<el-table-column type="index" width="100" label="序号" align="center"> <el-table-column type="index" width="100" label="序号" align="center">
</el-table-column> </el-table-column>
<el-table-column prop="contractInformationNumber" label="合同编号" align="center">
</el-table-column>
<el-table-column prop="contractInformationName" label="合同名称" align="center"> <el-table-column prop="contractInformationName" label="合同名称" align="center">
</el-table-column> </el-table-column>
<el-table-column prop="contractInformationNumber" label="合同编号" align="center"> <el-table-column prop="contractInformationName" label="合同期限" align="center">
</el-table-column> </el-table-column>
<el-table-column prop="contractInformationSum" label="合同金额" align="center"> <el-table-column prop="contractInformationLink" label="产品内容" align="center">
</el-table-column> </el-table-column>
<el-table-column prop="contractInformationLink" label="合同文件" align="center"> <el-table-column prop="contractInformationSum" label="合同金额" align="center">
</el-table-column> </el-table-column>
<!-- <el-table-column prop="payamount" label="操作" align="center"> <el-table-column label="操作" align="center">
<template> <template>
<el-button type="text">配置</el-button> <el-button type="text">查看</el-button>
</template> </template>
</el-table-column> --> </el-table-column>
</el-table> </el-table>
</div> </div>
</el-card> </el-card>
@ -216,31 +254,48 @@
<script> <script>
export default { export default {
name: 'baseform',
data() { data() {
return { return {
customerId : this.$route.query.id,
isDetail : Boolean(this.$route.query.show),
customerData: [], customerData: [],
form: { form: {
schoolId: '',
customerName: '', customerName: '',
countries: '中国', countries: '中国',
IndustryClass: '', industryClassId: '',
industry: '', industryId: '',
provinces: '', provinceId: '',
adminName: '', account: '',
adminPhone: '', name: '',
city: '', phone: '',
position: '',
cityId: '',
customerType: '', customerType: '',
stopTime: '', expireDate: '',
email: '', email: '',
level: '' schoolId: ''
}, },
rules: { rules: {
adminName: [ countries: [
{ required: true, message: '请输入管理员姓名', trigger: 'blur' } { required: true, message: '请输入国家', trigger: 'blur' }
],
provinceId: [
{ required: true, message: '请输入省份', trigger: 'blur' }
],
cityId: [
{ required: true, message: '请输入城市', trigger: 'blur' }
],
customerType: [
{ required: true, message: '请选择客户类型', trigger: 'change' }
], ],
adminPhone: [ name: [
{ required: true, message: '请输入管理员手机号', trigger: 'blur' }, { required: true, message: '请输入联系人姓名', trigger: 'blur' }
],
account: [
{ required: true, message: '请输入账号', trigger: 'blur' }
],
phone: [
{ required: true, message: '请输入手机号', trigger: 'blur' },
{ {
pattern: /^1[3456789]\d{9}$/, pattern: /^1[3456789]\d{9}$/,
message: '请输入正确的手机号', message: '请输入正确的手机号',
@ -258,11 +313,11 @@ export default {
trigger: 'blur' trigger: 'blur'
} }
], ],
industry: [ industryId: [
{ required: true, message: '请选择行业', trigger: 'change' } { required: true, message: '请选择行业', trigger: 'change' }
], ],
IndustryClass: [ industryClassId: [
{ required: true, message: '请选择行业类', trigger: 'change' } { required: true, message: '请选择行业类', trigger: 'change' }
], ],
}, },
customerTypeList: [{ customerTypeList: [{
@ -282,30 +337,9 @@ export default {
}], }],
provinceList: this.$store.state.provinceList, provinceList: this.$store.state.provinceList,
cityList: [], cityList: [],
levelList: [{
name: '本科',
value: 1
},
{
name: '大专',
value: 2
},
{
name: '高职',
value: 3
},
{
name: '中专',
value: 4
},
{
name: '其他',
value: 5
}],
IndustryClassList: [], IndustryClassList: [],
industryList: [], industryList: [],
schoolList: [], schoolList: [],
customerId : this.$store.state.customerId,
contractInformations: [], contractInformations: [],
coursePermissionss: [], coursePermissionss: [],
ipVisible: false, ipVisible: false,
@ -337,31 +371,31 @@ export default {
mounted() { mounted() {
this.getIndustryClass() this.getIndustryClass()
if(this.customerId){ if(this.customerId){
let data = { this.$get(this.api.queryCustomerDetails,{
customerId: this.customerId customerId: this.customerId
} }).then((res) => {
this.$get(this.api.queryCustomerDetails,data).then((res) => { let customer = res.result.customer
this.form = { this.form = {
schoolId: res.message[0].customers[0].schoolId, schoolId: customer.schoolId,
countries: res.message[0].customers[0].countries, countries: customer.countries,
IndustryClass: res.message[0].customers[0].industryClassId, industryClassId: customer.industryClassId,
industry: res.message[0].customers[0].industryId, industryId: customer.industryId,
provinces: res.message[0].customers[0].provinceId, provinceId: customer.provinceId,
adminName: res.message[0].customers[0].adminName, account: customer.account,
adminPhone: res.message[0].customers[0].adminPhone, phone: customer.phone,
city: res.message[0].customers[0].cityId, cityId: customer.cityId,
level: res.message[0].customers[0].level, customerType: customer.customerType,
customerType: res.message[0].customers[0].customerType, expireDate: customer.expireDate,
stopTime: res.message[0].customers[0].stopTime, email: customer.email,
email: res.message[0].customers[0].email, name: customer.name,
} position: customer.position,
this.contractInformations = res.message[0].contractInformations }
this.coursePermissionss = res.message[0].coursePermissionss this.contractInformations = res.result.contractInformations
this.getCityData() this.coursePermissionss = res.result.coursePermissionss
this.changIndustryData() this.getCityData()
this.getSchoolData() this.changIndustryData()
}).catch((res) => { this.getSchoolData()
}) }).catch((res) => {})
}else{ }else{
this.getSchoolData() this.getSchoolData()
} }
@ -370,7 +404,7 @@ export default {
// //
getCityData(){ getCityData(){
let data = { let data = {
provinceId: this.form.provinces provinceId: this.form.provinceId
} }
this.$get(this.api.queryCity,data).then(res => { this.$get(this.api.queryCity,data).then(res => {
this.cityList = res.message this.cityList = res.message
@ -378,9 +412,8 @@ export default {
}, },
// //
clearSchool(){ clearSchool(){
this.form.provinces = '', this.form.provinceId = '',
this.form.city = '', this.form.cityId = '',
this.form.level = '',
this.form.customerName = '' this.form.customerName = ''
}, },
// / // /
@ -390,36 +423,31 @@ export default {
provinceId: '', provinceId: '',
cityId: '' cityId: ''
} }
this.$get(this.api.querySchoolData,data).then(res => { this.$get(this.api.querySchoolData).then(res => {
this.schoolList = res.message this.schoolList = res.list
}).catch(res => {}); }).catch(res => {});
}, },
// //
SchoolChange(val){ SchoolChange(val){
this.clearSchool() this.clearSchool()
if(val){ if(val){
let obj = {}; let obj = {}
obj = this.schoolList.find((item)=>{ obj = this.schoolList.find((item)=>{
return item.schoolId === val; return item.schoolId === val
}); });
this.form.customerName = obj.schoolName this.form.customerName = obj.schoolName
this.form.level = obj.level this.form.provinceId = obj.provinceId
this.form.provinces = obj.provinceId
this.getCityData() this.getCityData()
this.form.city = obj.cityId this.form.cityId = obj.cityId
let data = { this.$get(this.api.queryCustomerIsExists,{
schoolId: this.form.schoolId schoolId: this.form.schoolId
} }).then(res => {
this.$get(this.api.queryCustomerIsExists,data).then(res => { this.NoAdd = true
if(res.message.length != 0){
this.$message.warning('该客户已存在');
this.NoAdd = false
}else{
this.NoAdd = true
}
}).catch(res => { }).catch(res => {
}); this.$message.warning('该客户已存在')
this.NoAdd = false
})
} }
}, },
// //
@ -430,7 +458,7 @@ export default {
}, },
// //
clearIndustry(){ clearIndustry(){
this.form.industry = '' this.form.industryId = ''
}, },
// //
changIndustry(){ changIndustry(){
@ -439,7 +467,7 @@ export default {
}, },
changIndustryData(){ changIndustryData(){
let data = { let data = {
industryClassId: this.form.IndustryClass industryClassId: this.form.industryClassId
} }
this.$get(this.api.queryCustomerIndustry,data).then(res => { this.$get(this.api.queryCustomerIndustry,data).then(res => {
this.industryList = res.message this.industryList = res.message
@ -451,44 +479,42 @@ export default {
if(this.NoAdd){ if(this.NoAdd){
let obj = {}; let obj = {};
obj = this.schoolList.find((item)=>{ obj = this.schoolList.find((item)=>{
return item.schoolId === this.form.schoolId; return item.schoolId == this.form.schoolId;
}); });
this.form.customerName = obj.schoolName this.form.customerName = obj.schoolName
this.form.level = obj.level this.form.provinceId = obj.provinceId
this.form.provinces = obj.provinceId
this.getCityData() this.getCityData()
this.form.city = obj.cityId this.form.cityId = obj.cityId
let data = { let data = {
customerName: this.form.customerName, customerName: this.form.customerName,
customerId: this.customerId,
schoolId: this.form.schoolId, schoolId: this.form.schoolId,
countries: this.form.countries, countries: this.form.countries,
industryClassId: this.form.IndustryClass, industryClassId: this.form.industryClassId,
industryId: this.form.industry, industryId: this.form.industryId,
provinceId: this.form.provinces, provinceId: this.form.provinceId,
adminName: this.form.adminName, account: this.form.account,
adminPhone: this.form.adminPhone, phone: this.form.phone,
cityId: this.form.city, cityId: this.form.cityId,
level: this.form.level,
customerType: this.form.customerType, customerType: this.form.customerType,
stopTime: this.form.stopTime, expireDate: this.form.expireDate,
email: this.form.email, email: this.form.email,
customerId: this.customerId name: this.form.name,
position: this.form.position
} }
if(this.customerId){ if(this.customerId){
this.$post(this.api.updateCustomer,data).then((res) => { this.$post(this.api.updateCustomer,data).then((res) => {
this.$message.success('编辑成功'); this.$message.success('编辑成功')
this.goback() this.goback()
}).catch((res) => { }).catch((res) => {})
})
}else{ }else{
this.$post(this.api.addCustomer,data).then((res) => { this.$post(this.api.addCustomer,data).then((res) => {
this.$message.success('添加成功'); this.$message.success('添加成功')
this.goback() this.goback()
}).catch((res) => { }).catch((res) => {})
})
} }
}else{ }else{
this.$message.warning('该客户已存在'); this.$message.warning('该客户已存在')
} }
} }
}) })
@ -506,15 +532,15 @@ export default {
}; };
</script> </script>
<style scoped> <style lang="scss" scoped>
.addhr_tag{ .addhr_tag{
background-color: #666; background-color: #666;
width: 6px; width: 6px;
height: 17px; height: 17px;
margin-right: 5px; margin-right: 5px;
} }
.radio_icon{ .radio_icon{
font-size: 26px; font-size: 26px;
color: #9278FF; color: #9278FF;
} }
</style> </style>

@ -12,28 +12,28 @@
<el-form label-width="80px"> <el-form label-width="80px">
<el-col :span="6"> <el-col :span="6">
<el-form-item label="国家"> <el-form-item label="国家">
<el-select v-model="form.countries" clearable placeholder="请选择国家"> <el-select v-model="form.countries" placeholder="请选择国家">
<el-option v-for="(item,index) in countryList" :key="index" :label="item.name" :value="item.name"></el-option> <el-option v-for="(item,index) in countryList" :key="index" :label="item.name" :value="item.name"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="6"> <el-col :span="6">
<el-form-item label="省份"> <el-form-item label="省份">
<el-select v-model="form.provinces" clearable placeholder="请选择省份" @change="getCity()" @clear="clearprovince()"> <el-select v-model="form.provinces" clearable placeholder="请选择省份" @change="getCity" @clear="clearprovince">
<el-option v-for="(item,index) in provinceList" :key="index" :label="item.provinceName" :value="item.provinceId"></el-option> <el-option v-for="(item,index) in provinceList" :key="index" :label="item.provinceName" :value="item.provinceId"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="6"> <el-col :span="6">
<el-form-item label="城市"> <el-form-item label="城市">
<el-select v-model="form.city" clearable placeholder="请选择城市" :disabled="form.provinces ? false : true" @change="getData()"> <el-select v-model="form.city" clearable placeholder="请选择城市" :disabled="form.provinces ? false : true" @change="initData">
<el-option v-for="(item,index) in cityList" :key="index" :label="item.cityName" :value="item.cityId"></el-option> <el-option v-for="(item,index) in cityList" :key="index" :label="item.cityName" :value="item.cityId"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="6"> <el-col :span="6">
<el-form-item> <el-form-item>
<el-input placeholder="请输入客户名称/管理员姓名/电话" prefix-icon="el-icon-search" v-model="form.keyword" clearable @keyup.enter.native="onSearch"></el-input> <el-input placeholder="请输入客户名称/管理员姓名/电话" prefix-icon="el-icon-search" v-model="form.keyword" clearable></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-form> </el-form>
@ -54,31 +54,34 @@
<el-button type="primary" size="small" round @click="delAllSelection">批量删除</el-button> <el-button type="primary" size="small" round @click="delAllSelection">批量删除</el-button>
</div> </div>
</div> </div>
<el-table :data="customerData" class="table" stripe header-align="center" @selection-change="handleSelectionChange" :row-key="getRowKeys"> <el-table :data="listData" class="table" stripe header-align="center" @selection-change="handleSelectionChange" row-key="customerId">
<el-table-column type="selection" width="55" align="center" :reserve-selection="true"></el-table-column> <el-table-column type="selection" width="55" align="center" :reserve-selection="true"></el-table-column>
<el-table-column type="index" width="100" label="序号" align="center"> <el-table-column type="index" width="100" label="序号" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
{{scope.$index + (pageNo - 1) * pageSize + 1}} {{scope.$index + (page - 1) * pageSize + 1}}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="schoolName" label="客户名称" align="center"> <el-table-column prop="customerName" label="客户名称" align="center">
</el-table-column>
<el-table-column prop="countries" label="国家" align="center">
</el-table-column> </el-table-column>
<el-table-column label="行业" align="center"> <el-table-column label="行业" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<span class="ellipsis">{{scope.row.industryName}}</span> <span class="ellipsis">{{scope.row.industryName}}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="countries" label="国家" align="center">
</el-table-column>
<el-table-column prop="provinceName" label="省份" align="center"> <el-table-column prop="provinceName" label="省份" align="center">
</el-table-column> </el-table-column>
<el-table-column prop="adminName" label="管理员姓名" align="center"> <el-table-column prop="cityName" label="城市" align="center">
</el-table-column>
<el-table-column prop="name" label="联系人" align="center">
</el-table-column> </el-table-column>
<el-table-column prop="adminPhone" label="管理联系电话" align="center"> <el-table-column prop="account" label="账号" align="center">
</el-table-column> </el-table-column>
<el-table-column label="操作" align="center"> <el-table-column label="操作" width="270" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<!-- <el-button type="text">查看</el-button> --> <el-button type="text" @click="resetPassword(scope.row)">重置密码</el-button>
<el-button type="text" @click="show(scope.row)">查看</el-button>
<el-button type="text" @click="edit(scope.row)">编辑</el-button> <el-button type="text" @click="edit(scope.row)">编辑</el-button>
<el-button type="text" @click="handleDelete(scope.row)">删除</el-button> <el-button type="text" @click="handleDelete(scope.row)">删除</el-button>
<el-button type="text" @click="permission">应用权限</el-button> <el-button type="text" @click="permission">应用权限</el-button>
@ -86,7 +89,7 @@
</el-table-column> </el-table-column>
</el-table> </el-table>
<div class="pagination"> <div class="pagination">
<el-pagination background layout="total, prev, pager, next" :total="totals" @current-change="handleCurrentChange" :current-page="pageNo"> <el-pagination background layout="total, prev, pager, next" :total="total" @current-change="handleCurrentChange" :current-page="page">
</el-pagination> </el-pagination>
</div> </div>
</el-card> </el-card>
@ -100,11 +103,11 @@ export default {
name: 'customer', name: 'customer',
data() { data() {
return { return {
name: localStorage.getItem('ms_username'), searchTimer: null,
countryList: [{ countryList: [{
name:'中国' name:'中国'
}], }],
customerData: [], listData: [],
form: { form: {
countries:'中国', countries:'中国',
provinces: '', provinces: '',
@ -114,19 +117,19 @@ export default {
multipleSelection: [], multipleSelection: [],
provinceList: [], provinceList: [],
cityList: [], cityList: [],
pageNo: 1, page: 1,
pageSize: 10, pageSize: 10,
totals: 1, total: 1,
ruleIds: [] ruleIds: []
}; };
}, },
components: { watch: {
'form.keyword': function(val) {
}, clearTimeout(this.searchTimer)
computed: { this.searchTimer = setTimeout(() => {
role() { this.initData()
return this.name === 'admin' ? '超级管理员' : '普通用户'; },500)
} },
}, },
mounted() { mounted() {
this.getData() this.getData()
@ -134,34 +137,36 @@ export default {
}, },
methods: { methods: {
getData() { getData() {
let data = { this.$post(this.api.queryCustomer,{
countries: this.form.countries, countries: this.form.countries,
provinceId: this.form.provinces, provinceId: this.form.provinces,
cityId: this.form.city, cityId: this.form.city,
searchContent: this.form.keyword, searchContent: this.form.keyword,
pageNo: this.pageNo, page: this.page,
pageSize: this.pageSize size: this.pageSize
} }).then(res => {
this.$get(this.api.queryCustomer,data).then(res => { this.listData = res.message.list
this.customerData = res.message.rows this.total = res.message.totalCount
this.totals = res.message.total }).catch(res => {})
}).catch(res => {}); },
initData(){
this.page = 1
this.getData()
}, },
getProvince(){ getProvince(){
this.$get(this.api.queryProvince).then(res => { this.$get(this.api.queryProvince).then(res => {
this.provinceList = res.message this.provinceList = res.message
this.$store.commit("provinceData", { provinceList : this.provinceList}); this.$store.commit("provinceData", { provinceList : this.provinceList})
}).catch(res => {}); }).catch(res => {})
}, },
//
clearprovince(){ clearprovince(){
this.form.city = '' this.form.city = ''
}, },
getCity(){ getCity(){
this.clearprovince() this.clearprovince()
this.getCityData() this.getCityData()
this.pageNo = 1 this.page = 1
this.getData() this.initData()
}, },
getCityData(){ getCityData(){
let data = { let data = {
@ -169,97 +174,76 @@ export default {
} }
this.$get(this.api.queryCity,data).then(res => { this.$get(this.api.queryCity,data).then(res => {
this.cityList = res.message this.cityList = res.message
}).catch(res => {}); }).catch(res => {})
}, },
permission(){ permission(){
this.$router.push('/permission') this.$router.push('/permission')
}, },
addcustomer(){ addcustomer(){
this.$store.commit("customerData", { customer_id : ''}); this.$router.push('addcustomer')
this.$router.push('/addcustomer');
}, },
edit(row){ edit(row){
this.$store.commit("customerData", { customer_id : row.customerId }); this.$router.push(`addcustomer?id=${row.customerId}`)
this.$router.push('/addcustomer'); },
show(row){
this.$router.push(`addcustomer?id=${row.customerId}&show=true`)
}, },
handleDelete(row) { handleDelete(row) {
this.$confirm('确定要删除吗?', '提示', { this.$confirm('确定要删除吗?', '提示', {
type: 'warning' type: 'warning'
}) }).then(() => {
.then(() => { this.$post(this.api.deleteCustomer,row.customerId).then(res => {
let str = ''; this.$message.success('删除成功')
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('删除成功');
this.getData() this.getData()
}).catch(res => {}); }).catch(res => {})
}) }).catch(() => {})
.catch(() => {});
},
getRowKeys(row) {
return row.customerId;
}, },
handleSelectionChange(val) { handleSelectionChange(val) {
this.multipleSelection = val; this.multipleSelection = val
}, },
delAllSelection() { delAllSelection() {
if(this.multipleSelection.length != ''){ if(this.multipleSelection.length != ''){
const length = this.multipleSelection.length; let arr = this.multipleSelection
let str = ''; let delList = arr.map(item => {
for (let i = 0; i < length; i++) { return item.customerId
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);
}
//
this.$confirm('确定要删除吗?', '提示', { this.$confirm('确定要删除吗?', '提示', {
type: 'warning' type: 'warning'
}) }).then(() => {
.then(() => {
let data = {
customer: arr
}
this.$post(this.api.deleteCustomer,data).then(res => { this.$post(this.api.deleteCustomer,data).then(res => {
this.multipleSelection = []; this.multipleSelection = [];
this.$message.success('删除成功'); this.$message.success('删除成功')
this.getData() this.getData()
}).catch(res => {}); }).catch(res => {})
}).catch(() => {}); }).catch(() => {})
}else{ }else{
this.$message.error('请先选择客户 !'); this.$message.error('请先选择数据')
} }
}, },
onSearch(){ handleCurrentChange(val) {
this.pageNo = 1 this.page = val
this.getData() this.getData()
}, },
handleCurrentChange(val) { resetPassword(row){
this.pageNo = val; this.$confirm(`重置后的密码为:${this.$config.initialPassword},确定重置?`, '提示', {
this.getData(); }).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(() => {
});
}, },
} }
}; };
</script> </script>
<style scoped> <style lang="scss" scoped>
.mag{
margin-right: 20px;
}
</style> </style>

@ -56,7 +56,7 @@
<el-dialog title="导入" :visible.sync="importVisible" width="80%" center @close="closeImport" class="dialog" :close-on-click-modal="false"> <el-dialog title="导入" :visible.sync="importVisible" width="80%" center @close="closeImport" class="dialog" :close-on-click-modal="false">
<el-container style="padding: 20px 0 20px 20px;background-color: #f0f0f0;"> <el-container style="padding: 20px 0 20px 20px;background-color: #f0f0f0;">
<el-aside width="300px"> <el-aside width="300px">
<el-tree style="margin: 10px;" ref="typeTree" :data="importTypeList" node-key="id" accordion :default-expanded-keys="defaultTypeActive" show-checkbox :props="defaultProps" highlight-current @node-click="importTypeClick"></el-tree> <el-tree style="margin: 10px;" ref="typeTree" :data="importTypeList" node-key="id" accordion :default-expanded-keys="defaultTypeActive" :current-node-key="curId" show-checkbox :props="defaultProps" highlight-current @node-click="importTypeClick"></el-tree>
</el-aside> </el-aside>
<el-main style="padding-top: 0;padding-bottom: 0;"> <el-main style="padding-top: 0;padding-bottom: 0;">
<el-card shadow="hover"> <el-card shadow="hover">
@ -94,6 +94,7 @@
export default { export default {
data() { data() {
return { return {
schoolId: 1001,
typeList: [], typeList: [],
defaultProps: { defaultProps: {
children: 'children', children: 'children',
@ -188,6 +189,7 @@ export default {
this.categoryName = row.data.categoryName this.categoryName = row.data.categoryName
}, },
delType(row){ delType(row){
//
this.$confirm('确定要删除吗?', '提示', { this.$confirm('确定要删除吗?', '提示', {
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
@ -225,6 +227,13 @@ export default {
}, },
preview(row){ preview(row){
this.$get(`${this.api.previewData}?tableName=${row.name}&tableId=${row.id}`).then(res => { this.$get(`${this.api.previewData}?tableName=${row.name}&tableId=${row.id}`).then(res => {
this.$post(this.api.saveRecord,{
platformUserId: 4,
tableId: row.id,
type: 2,
schoolId: this.schoolId,
}).then(res => {}).catch(res => {})
let comment = res.comment let comment = res.comment
let previewHead = [] let previewHead = []
comment.map(n => { comment.map(n => {
@ -278,18 +287,19 @@ export default {
this.$message.error('请先选择数据') this.$message.error('请先选择数据')
} }
}, },
async getTable(n,i){ getTable(n,i){
let res = await this.$post(`${this.api.originalListById}?categoryId=${n.id}&showName=&pageNum=1&pageSize=10000`) this.$post(`${this.api.originalListById}?categoryId=${n.id}&showName=&pageNum=1&pageSize=10000`).then(res => {
res.list.map(n => { res.list.map(n => {
n.label = n.showName n.label = n.showName
n.id = String(n.id) n.id = String(n.id)
}) })
n.children = res.list n.children = res.list
if(!i && !this.tableName){ if(!i && !this.tableName){
this.defaultTypeActive = res.list[0].id this.defaultTypeActive = [res.list[0].id]
this.tableName = res.list[0].name this.tableName = res.list[0].name
this.curId = res.list[0].id this.curId = res.list[0].id
} }
}).catch(res => {})
}, },
batchImport(){ batchImport(){
this.$post(this.api.originalList).then(res => { this.$post(this.api.originalList).then(res => {

@ -85,7 +85,6 @@ export default {
this.defaultActive = [res[0].id] this.defaultActive = [res[0].id]
this.introduceText = res[0].introduce this.introduceText = res[0].introduce
} }
console.log(11,this.defaultActive)
}).catch(res => {}) }).catch(res => {})
}, },
typeClick(data,node){ typeClick(data,node){

@ -10,12 +10,12 @@
</div> </div>
<div> <div>
<el-form label-width="80px" class="flex-between"> <el-form label-width="80px" class="flex-between">
<div class="flex-center"> <div class="flex-center no-mb">
<el-form-item label="创建日期"> <el-form-item label="创建日期">
<el-date-picker v-model="date" align="right" unlink-panels type="daterange" start-placeholder="开始日期" end-placeholder="结束日期" format="yyyy-MM-dd" value-format="yyyy-MM-dd" @change="getData" clearable></el-date-picker> <el-date-picker v-model="date" align="right" unlink-panels type="daterange" start-placeholder="开始日期" end-placeholder="结束日期" format="yyyy-MM-dd" value-format="yyyy-MM-dd" clearable></el-date-picker>
</el-form-item> </el-form-item>
<el-form-item label="状态"> <el-form-item label="状态">
<el-select v-model="status" clearable placeholder="请选择状态" @change="getData"> <el-select v-model="status" clearable placeholder="请选择状态" @change="initData">
<el-option v-for="(item,index) in statusList" :key="index" :label="item.name" :value="item.value"></el-option> <el-option v-for="(item,index) in statusList" :key="index" :label="item.name" :value="item.value"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
@ -34,41 +34,25 @@
<div class="flex-between mgb20"> <div class="flex-between mgb20">
<div class="flex-center"> <div class="flex-center">
<p class="hr_tag"></p> <p class="hr_tag"></p>
<span>订单列表</span> <span>产品列表</span>
</div> </div>
<div> <div>
<el-button type="primary" size="small" round @click="add">新增</el-button> <el-button type="primary" size="small" round @click="add">新增</el-button>
<el-button type="primary" size="small" round @click="delAllSelection">批量删除</el-button> <el-button type="primary" size="small" round @click="delAllSelection">批量删除</el-button>
</div> </div>
</div> </div>
<el-table :data="orderData" class="table" stripe header-align="center" @selection-change="handleSelectionChange" row-key="id"> <el-table :data="listData" class="table" ref="table" stripe header-align="center" @selection-change="handleSelectionChange" row-key="id">
<el-table-column type="selection" width="55" align="center" :reserve-selection="true"></el-table-column> <el-table-column type="selection" width="55" align="center" :reserve-selection="true"></el-table-column>
<el-table-column type="index" width="100" label="序号" align="center"> <el-table-column type="index" width="100" label="序号" align="center"></el-table-column>
</el-table-column> <el-table-column prop="productName" label="产品名称" align="center"></el-table-column>
<el-table-column prop="orderNumber" label="订单编号" align="center"> <el-table-column prop="tableNum" label="数据量(表)" align="center"></el-table-column>
</el-table-column> <el-table-column prop="userName" label="创建人" align="center"></el-table-column>
<el-table-column prop="customerName" label="产品名称" align="center"> <el-table-column prop="orderNum" label="订单数量" align="center"></el-table-column>
</el-table-column> <el-table-column prop="market" label="市场价" align="center"></el-table-column>
<el-table-column prop="orderAmount" label="数据量(表)" align="center"> <el-table-column prop="createTime" label="创建时间" align="center"></el-table-column>
</el-table-column>
<el-table-column prop="orderDate" label="创建人" align="center">
</el-table-column>
<el-table-column prop="orderType" label="订单数量" align="center">
</el-table-column>
<el-table-column prop="orderStatus" label="市场价" align="center">
</el-table-column>
<el-table-column prop="orderNature" label="创建时间" align="center">
</el-table-column>
<el-table-column prop="orderNature" label="状态" align="center"> <el-table-column prop="orderNature" label="状态" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-switch <el-switch v-model="scope.row.status" :active-text="scope.row.status ? '上架' : '下架'" :active-value="1" :inactive-value="0" @change="switchOff($event,scope.row,scope.$index)"></el-switch>
v-model="scope.row.enable"
:active-text="scope.row.enable ? '上架' : '下架'"
:active-value="0"
:inactive-value="1"
style="margin: 0 10px 0 10px"
@change="switchOff($event,scope.row,scope.$index)"
></el-switch>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作" align="center"> <el-table-column label="操作" align="center">
@ -80,8 +64,7 @@
</el-table-column> </el-table-column>
</el-table> </el-table>
<div class="pagination"> <div class="pagination">
<el-pagination background layout="total, prev, pager, next" @current-change="handleCurrentChange" :current-page="pageNo" :total="totals"> <el-pagination background layout="total, prev, pager, next" @current-change="handleCurrentChange" :current-page="page" :total="totals"></el-pagination>
</el-pagination>
</div> </div>
</el-card> </el-card>
</el-col> </el-col>
@ -89,24 +72,71 @@
<el-dialog :title="isDetail ? '查看产品' : (id ? '编辑产品' : '新增产品')" :visible.sync="productVisible" width="30%" center @close="closeProduct" class="dialog" :close-on-click-modal="false"> <el-dialog :title="isDetail ? '查看产品' : (id ? '编辑产品' : '新增产品')" :visible.sync="productVisible" width="30%" center @close="closeProduct" class="dialog" :close-on-click-modal="false">
<el-form ref="form" label-width="120px" :disabled="isDetail"> <el-form ref="form" label-width="120px" :disabled="isDetail">
<el-form-item prop="userAccount" label="数据产品名称"> <el-form-item label="数据产品名称">
<el-input v-model="userAccount" placeholder="请输入数据产品名称"></el-input> <el-input v-model="productName" placeholder="请输入数据产品名称"></el-input>
</el-form-item> </el-form-item>
<el-form-item prop="userName" label="市场价格"> <el-form-item label="市场价格">
<el-input v-model="userName" placeholder="请输入市场价格"> <el-input v-model="market" placeholder="请输入市场价格">
<span slot="suffix">/账号</span> <span slot="suffix">/账号</span>
</el-input> </el-input>
</el-form-item> </el-form-item>
<el-form-item prop="userName" label="已选数据"> <el-form-item label="已选数据">
<el-button type="primary" size="small">配置数据权限</el-button> <el-button type="primary" size="small" @click="configData">配置数据权限</el-button>
<el-tree ref="type" :data="typeList" node-key="id" accordion show-checkbox :props="defaultProps" highlight-current></el-tree> <el-tree ref="type" :data="typeList" show-checkbox node-key="id" :default-expanded-keys="checkedIds" :default-checked-keys="checkedIds" :props="defaultProps"></el-tree>
</el-form-item> </el-form-item>
</el-form> </el-form>
<span slot="footer" class="dialog-footer" v-if="!isDetail"> <span slot="footer" class="dialog-footer" v-if="!isDetail">
<el-button @click="productVisible = false"> </el-button> <el-button @click="productVisible = false"> </el-button>
<el-button type="primary" @click="saveSure('teacherForm')"> </el-button> <el-button type="primary" @click="confirm"> </el-button>
</span> </span>
</el-dialog> </el-dialog>
<el-dialog title="数据配置" :visible.sync="configVisible" width="70%" center @close="closeConfig" :close-on-click-modal="false">
<el-container style="padding: 20px 0 20px 20px;background-color: #f0f0f0;">
<el-aside width="300px">
<el-tree style="margin: 10px;" ref="typeConfig" :data="typeConfigList" show-checkbox node-key="id" accordion :default-expanded-keys="configIds" :default-checked-keys="configIds" :current-node-key="categoryId" :props="defaultProps" highlight-current @current-change="typeConfigClick"></el-tree>
</el-aside>
<el-main style="padding-top: 0;padding-bottom: 0;">
<el-card shadow="hover">
<el-form label-width="80px" class="flex-between mgb20">
<div class="flex-center">
<el-form-item label="创建日期" style="margin: 0 20px 0 0">
<el-date-picker v-model="updateTime" type="date" placeholder="选择日期" format="yyyy-MM-dd" value-format="yyyy-MM-dd" @change="initConfigData"></el-date-picker>
</el-form-item>
<el-input placeholder="请输入数据表名称" v-model="keywordConfig" prefix-icon="el-icon-search" clearable></el-input>
</div>
</el-form>
<el-table :data="listConfigData" class="table" ref="table" stripe header-align="center">
<el-table-column type="index" width="100" label="序号" align="center"></el-table-column>
<el-table-column prop="showName" label="数据表名称" align="center"></el-table-column>
<el-table-column prop="dataTotal" label="数据总量" align="center"></el-table-column>
<el-table-column prop="dataSize" label="数据大小" align="center"></el-table-column>
<el-table-column prop="updateTime" width="150" label="更新时间" align="center"></el-table-column>
<el-table-column label="操作" width="220" align="center">
<template slot-scope="scope">
<el-button type="text" @click="previewConfig(scope.row)">预览</el-button>
</template>
</el-table-column>
</el-table>
<div class="pagination">
<el-pagination background layout="total, prev, pager, next" :current-page="pageConfig" @current-change="handleCurrentConfigChange" :total="totalConfig"></el-pagination>
</div>
</el-card>
</el-main>
</el-container>
<span slot="footer" class="dialog-footer">
<el-button @click="configVisible = false"> </el-button>
<el-button type="primary" @click="confirmConfig"> </el-button>
</span>
</el-dialog>
<el-dialog title="预览" :visible.sync="previewVisible" width="60%" center :close-on-click-modal="false">
<el-table :data="previewData" class="table" stripe header-align="center" row-key="id">
<el-table-column type="index" width="100" label="序号" align="center"></el-table-column>
<el-table-column v-for="(item,index) in previewHead" :prop="item.field" :key="index" :label="item.comment" align="center"></el-table-column>
</el-table>
</el-dialog>
</div> </div>
</template> </template>
@ -114,11 +144,16 @@
export default { export default {
data() { data() {
return { return {
schoolId: 1001,
userId: this.$store.state.userLoginId,
userName: this.$store.state.userName,
keyword: '', keyword: '',
searchTimer: null, searchTimer: null,
date: [], date: [],
startTime: '',
endTime: '',
status: '', status: '',
orderData:[], listData:[],
multipleSelection: [], multipleSelection: [],
statusList: [{ statusList: [{
name: '不限', name: '不限',
@ -129,26 +164,63 @@ export default {
}, },
{ {
name: '已下架', name: '已下架',
value: 2 value: 0
}], }],
pageNo: 1, page: 1,
pageSize: 10, pageSize: 10,
totals: 1, totals: 1,
productVisible: false, productVisible: false,
id: '',
productName: '',
market: '',
typeList: [], typeList: [],
defaultProps: { defaultProps: {
children: 'children', children: 'children',
label: 'label' label: 'label'
}, },
defaultActive: [], checkedIds: [],
isDetail: false,
typeIndex: 1000,
configVisible: false,
configChecked: [],
configCheckedTableId: [],
categoryId: '',
configIds: [],
updateTime: '',
keywordConfig: '',
typeConfigList: [],
pageConfig: 1,
pageSizeConfig: 10,
totalConfig: 0,
listConfigData: [],
previewVisible: false,
previewHead: [],
previewData: []
}; };
}, },
watch: { watch: {
date: function(val){
if(val){
this.startTime = val[0]
this.endTime = val[1]
}else{
this.startTime = ''
this.endTime = ''
}
this.initData()
},
keyword: function(val) { keyword: function(val) {
clearTimeout(this.searchTimer) clearTimeout(this.searchTimer)
this.searchTimer = setTimeout(() => { this.searchTimer = setTimeout(() => {
this.initData() this.initData()
},500) },500)
},
keywordConfig: function(val) {
clearTimeout(this.searchTimer)
this.searchTimer = setTimeout(() => {
this.initConfigData()
},500)
} }
}, },
mounted() { mounted() {
@ -156,64 +228,132 @@ export default {
}, },
methods: { methods: {
getData() { getData() {
// this.$get(this.api.queryOrder,data).then(res => { this.$post(this.api.listByEntity,{
// res.message.rows.forEach(e => { createTime: this.startTime,
// e.orderType = this.orderTypeFn(e.orderType) endTime: this.endTime,
// e.orderStatus = this.orderStatusFn(e.orderStatus) pageNum: this.page,
// e.orderNature = this.orderNatureFn(e.orderNature) pageSize: this.pageSize,
// }) productName: this.keyword,
// this.orderData = res.message.rows status: this.status,
// this.totals = res.message.total }).then(res => {
// }).catch(res => {}); this.listData = res.pageList.records
this.totals = res.pageList.total
}).catch(res => {})
}, },
initData(){ initData(){
this.pageNo = 1 this.page = 1
this.getData() this.getData()
}, },
getTable(n,i){
this.$post(`${this.api.getIdQueryTable}?categoryId=${n.originId}&showName=&pageNum=1&pageSize=10000&updateTime=`).then(res => {
res.list.map(n => {
n.label = n.showName
n.id = String(n.id)
})
n.children = res.list
}).catch(res => {})
},
getType(){ getType(){
this.productVisible = true
this.$post(this.api.getTableByClassification).then(res => { this.$post(this.api.getTableByClassification).then(res => {
res.map(n => { res.map(n => {
n.id = String(n.id) n.originId = n.id
n.id = String(++this.typeIndex)
n.label = n.categoryName n.label = n.categoryName
n.children.map(n => { n.children.map(n => {
n.id = String(n.id) n.originId = n.id
n.id = String(++this.typeIndex)
n.label = n.categoryName n.label = n.categoryName
n.children.map(n => { n.children.map(n => {
n.id = String(n.id) n.originId = n.id
n.id = String(++this.typeIndex)
n.label = n.categoryName n.label = n.categoryName
n.isThird = true n.isThird = true
}) })
}) })
}) })
this.typeList = res res.map((n,i) => {
this.productVisible = true if(n.children.length){
n.children.map(n => {
if(n.children.length){
n.children.map(n => this.getTable(n,i))
}else{
this.getTable(n,i)
}
})
}else{
this.getTable(n,i)
}
})
setTimeout(() => {
this.typeList = res
},500)
this.importVisible = true
}).catch(res => {})
},
handleType(data,typeList){
let result = data
if(typeList.length){
typeList.map(e => {
if(result.includes(e.id) && e.children.length){
e.children.every(n => result.includes(n)) || result.splice(result.indexOf(e.id),1)
}
e.children.length && this.handleType(data,e.children)
})
}
return result
},
getDetail(){
this.$post(`${this.api.findById}?id=${this.id}`).then(res => {
let data = res.product
this.productName = data.productName
this.market = data.market
this.checkedIds = this.handleType(data.tableId.split(','),this.typeList)
this.$refs.type.setCheckedNodes(this.checkedIds)
}).catch(res => {}) }).catch(res => {})
}, },
add(){ add(){
this.getType() this.getType()
this.id = ''
this.checkedIds = []
}, },
edit(row){ edit(row){
this.getType() this.getType()
this.id = row.id
this.getDetail()
},
switchOff(val,row,index) {
this.$post(this.api.updateProduct,{
id: row.id,
productName: row.productName,
market: row.market,
tableId: row.tableId,
userId: row.userId,
userName: row.userName,
createTime: '',
orderNum: '',
status: val,
tableNum: row.tableNum,
updateTime: '',
}).then(res => {
this.$message.success(val ? '上架成功' : '下架成功')
}).catch(err => {})
}, },
preview(row){ preview(row){
this.isDetail = true this.isDetail = true
this.getType() this.getType()
this.id = row.id
this.getDetail()
}, },
handleDelete(row) { handleDelete(row) {
this.$confirm('确定要删除吗?', '提示', { this.$confirm('确定要删除吗?', '提示', {
type: 'warning' type: 'warning'
}) }).then(() => {
.then(() => { this.$post(`${this.api.deleteProduct}?ids=${row.id}`).then(res => {
let result = row.orderId
var arr = []
arr.push(result)
let data = arr
this.$post(this.api.deleteOrder,data).then(res => {
this.$message.success('删除成功') this.$message.success('删除成功')
this.getData() this.getData()
}).catch(res => {}); }).catch(res => {})
}) }).catch(() => {})
.catch(() => {});
}, },
handleSelectionChange(val) { handleSelectionChange(val) {
this.multipleSelection = val this.multipleSelection = val
@ -221,33 +361,183 @@ export default {
delAllSelection() { delAllSelection() {
if(this.multipleSelection.length != ''){ if(this.multipleSelection.length != ''){
let arr = this.multipleSelection let arr = this.multipleSelection
let result = arr.map(e => e.orderId) let result = arr.map(e => e.id)
this.$confirm('确定要删除吗?', '提示', { this.$confirm('确定要删除吗?', '提示', {
type: 'warning' type: 'warning'
}) }).then(() => {
.then(() => { this.$post(`${this.api.deleteProduct}?ids=${result.join(',')}`).then(res => {
let data = result this.$refs.table.clearSelection()
this.$post(this.api.deleteOrder,data).then(res => {
this.multipleSelection = []
this.$message.success('删除成功') this.$message.success('删除成功')
this.getData() this.getData()
}).catch(res => {}) }).catch(res => {})
}).catch(() => {}) }).catch(() => {})
}else{ }else{
this.$message.error('请先选择订单 !') this.$message.error('请先选择数据')
} }
}, },
handleCurrentChange(val) { handleCurrentChange(val) {
this.pageNo = val this.page = val
this.getData() this.getData()
}, },
closeProduct(){ closeProduct(){
this.productName = ''
this.market = ''
this.isDetail = false this.isDetail = false
this.typeIndex = 1000
this.typeList = []
},
confirm(){
if(!this.productName) return this.$message.warning('请输入数据产品名称')
if(!this.market) return this.$message.warning('请输入市场价格')
if(isNaN(this.market)) return this.$message.warning('市场价格请输入数字')
let list = this.$refs.type.getCheckedNodes()
let tableId = []
list.map(n => {
if(n.name) tableId.push(n.id)
})
if(!tableId.length) return this.$message.warning('请选择数据')
let data = {
id: this.id,
productName: this.productName,
market: this.market,
tableId: tableId.join(),
userId: this.userId,
userName: this.userName,
createTime: '',
orderNum: '',
status: '',
tableNum: tableId.length,
updateTime: '',
}
if(this.id){
this.$post(this.api.updateProduct,data).then(res => {
this.$message.success('新增成功')
this.productVisible = false
this.getData()
}).catch(res => {})
}else{
this.$post(this.api.saveProduct,data).then(res => {
this.$message.success('新增成功')
this.productVisible = false
this.getData()
}).catch(res => {})
}
},
configData(){
this.configVisible = true
this.getConfigType()
let list = this.$refs.type.getCheckedNodes()
let configIds = []
list.map(n => {
if(!n.name) configIds.push(n.originId)
})
this.configIds = configIds
},
typeConfigClick(data,node){
this.categoryId = data.id
this.getConfigTable()
},
closeConfig(){
this.$refs.typeConfig.setCheckedNodes([])
},
getConfigType(){
this.$post(this.api.getTableByClassification).then(res => {
res.map(n => {
n.id = String(n.id)
n.label = n.categoryName
n.children.map(n => {
n.id = String(n.id)
n.label = n.categoryName
n.children.map(n => {
n.id = String(n.id)
n.label = n.categoryName
n.isThird = true
})
})
})
this.typeConfigList = res
if(res[0].children.length){
this.categoryId = res[0].children[0].id
}else{
this.categoryId = res[0].id
}
this.getConfigTable()
}).catch(res => {})
},
getConfigTable(){
this.$post(`${this.api.getIdQueryTable}?categoryId=${this.categoryId}&showName=${this.keywordConfig}&pageNum=${this.pageConfig}&pageSize=${this.pageSizeConfig}&updateTime=${this.updateTime ? this.updateTime : ''}`).then(res => {
this.listConfigData = res.list
this.totalConfig = res.totalCount
}).catch(res => {})
},
initConfigData(){
this.pageConfig = 1
this.getConfigTable()
},
handleCurrentConfigChange(){
this.pageConfig = val
this.getConfigTable()
},
previewConfig(row){
this.$get(`${this.api.previewData}?tableName=${row.name}&tableId=${row.id}`).then(res => {
this.$post(this.api.saveRecord,{
platformUserId: 4,
tableId: row.id,
type: 2,
schoolId: this.schoolId,
}).then(res => {}).catch(res => {})
let comment = res.comment
let previewHead = []
comment.map(n => {
n.field != 'id' && n.field != 'operation_time' && previewHead.push(n)
})
this.previewHead = previewHead
let data = res.data
data.map(n => {
for(let i in n){
if(typeof n[i] == 'string' && n[i].endsWith('+0000')) n[i] = this.formatDate('yyyy-MM-dd hh:mm:ss',new Date(n[i]))
}
})
this.previewData = data
this.previewVisible = true
}).catch(res => {})
},
getTableId(list){
let checked = this.configChecked
list.map(n => {
if(n.children && n.children.length){
this.getTableId(n.children)
if(checked.includes(n.originId) && n.children[0].name){
this.configCheckedTableId = [...this.configCheckedTableId,...n.children.map(n => n.id)]
}else{
this.getTableId(n.children)
}
}
})
},
confirmConfig(){
this.configChecked = this.$refs.typeConfig.getCheckedKeys().map(n => Number(n))
this.getTableId(this.typeList)
this.checkedIds = Array.from(new Set(this.configCheckedTableId))
this.configVisible = false
this.$refs.type.setCheckedNodes(this.checkedIds)
} }
} }
}; };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
/deep/ .no-mb .el-form-item{
margin-bottom: 0;
}
/deep/.el-container{
.el-aside{
padding: 15px;
background-color: #fff;
}
}
</style> </style>

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

@ -52,7 +52,7 @@
<el-row> <el-row>
<el-col :span="10"> <el-col :span="10">
<el-form-item label="创建时间" class="userRadio"> <el-form-item label="创建时间" class="userRadio">
<el-radio-group v-model="form.month" @change="itemRadio"> <el-radio-group v-model="form.month">
<el-radio v-for="(item,index) in dateList" :key="index" :label="item.id" border>{{item.name}}</el-radio> <el-radio v-for="(item,index) in dateList" :key="index" :label="item.id" border>{{item.name}}</el-radio>
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
@ -60,12 +60,12 @@
<el-col :span="8"> <el-col :span="8">
<el-form-item label="自定义"> <el-form-item label="自定义">
<el-date-picker v-model="form.date" align="right" unlink-panels type="daterange" <el-date-picker v-model="form.date" align="right" unlink-panels type="daterange"
start-placeholder="开始日期" end-placeholder="结束日期" format="yyyy-MM-dd" value-format="yyyy-MM-dd" @change="selectTime" clearable></el-date-picker> start-placeholder="开始日期" end-placeholder="结束日期" format="yyyy-MM-dd" value-format="yyyy-MM-dd" clearable></el-date-picker>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="6"> <el-col :span="6">
<el-form-item> <el-form-item>
<el-input placeholder="请输入用户姓名/学校名称" prefix-icon="el-icon-search" v-model="form.keyword" clearable @keyup.enter.native="onSearch"></el-input> <el-input placeholder="请输入用户姓名/学校名称" prefix-icon="el-icon-search" v-model="form.keyword" clearable></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
@ -83,43 +83,39 @@
<span>用户列表</span> <span>用户列表</span>
</div> </div>
<div> <div>
<el-button type="primary" size="small" round class="mag" @click="adduser">新增用户</el-button>
<el-button type="primary" size="small" round @click="delAllSelection">批量删除</el-button> <el-button type="primary" size="small" round @click="delAllSelection">批量删除</el-button>
</div> </div>
</div> </div>
<el-table :data="userData" class="table" stripe header-align="center" @selection-change="handleSelectionChange" :row-key="getRowKeys"> <el-table :data="userData" class="table" stripe header-align="center" @selection-change="handleSelectionChange" row-key="userId">
<el-table-column type="selection" width="55" align="center" :reserve-selection="true"></el-table-column> <el-table-column type="selection" width="55" align="center" :reserve-selection="true"></el-table-column>
<el-table-column type="index" width="100" label="序号" align="center"> <el-table-column type="index" width="100" label="序号" align="center">
</el-table-column> </el-table-column>
<!-- <el-table-column prop="userAccount" label="用户账号" align="center"> <el-table-column prop="account" label="用户账号" align="center">
</el-table-column> -->
<el-table-column prop="userName" label="姓名" align="center">
</el-table-column>
<el-table-column prop="countries" label="国家" align="center">
</el-table-column> </el-table-column>
<el-table-column prop="provinceName" label="省份" align="center"> <el-table-column prop="userName" label="姓名" align="center">
</el-table-column> </el-table-column>
<el-table-column prop="cityName" label="城市" align="center"> <el-table-column prop="schoolName" label="学校" align="center">
</el-table-column> </el-table-column>
<el-table-column prop="schoolName" label="学校名称" align="center"> <el-table-column prop="platformName" label="来源" align="center">
</el-table-column> </el-table-column>
<el-table-column prop="NewaccountRole" label="账号角色" align="center"> <el-table-column prop="phone" label="手机号" align="center">
</el-table-column> </el-table-column>
<el-table-column prop="creationTime" label="创建时间" align="center"> <el-table-column prop="createTime" label="创建时间" align="center">
</el-table-column> </el-table-column>
<el-table-column prop="logInNumber" label="登录次数" align="center"> <el-table-column prop="logInNumber" label="登录次数" align="center">
</el-table-column> </el-table-column>
<el-table-column label="操作" align="center"> <el-table-column label="操作" width="270" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<!-- <el-button type="text">查看</el-button> --> <el-button type="text" @click="show(scope.row)">查看</el-button>
<el-button type="text" @click="edit(scope.row)">编辑</el-button> <!-- <el-button type="text" @click="edit(scope.row)">编辑</el-button> -->
<el-button type="text" @click="handleDelete(scope.row)">删除</el-button> <el-button type="text" @click="handleDelete(scope.row)">删除</el-button>
<el-button type="text" @click="resetPassword(scope.row)">重置密码</el-button> <el-button type="text" @click="resetPassword(scope.row)">重置密码</el-button>
<el-switch v-model="scope.row.isEnable" :active-value="1" :inactive-value="0" style="margin: 0 10px 0 5px" :active-text="scope.row.isEnable ? '启用' : '禁用'" @change="switchOff($event,scope.row,scope.$index)"></el-switch>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<div class="pagination"> <div class="pagination">
<el-pagination background @current-change="currentChange" :current-page="pageNo" layout="total, prev, pager, next" :total="totals"> <el-pagination background @current-change="currentChange" :current-page="page" layout="total, prev, pager, next" :total="totals">
</el-pagination> </el-pagination>
</div> </div>
</el-card> </el-card>
@ -133,6 +129,8 @@ export default {
name: 'user', name: 'user',
data() { data() {
return { return {
platformId: this.$config.platformId,
searchTimer: null,
form: { form: {
name: '', name: '',
countries: '中国', countries: '中国',
@ -189,12 +187,38 @@ export default {
id: 12, id: 12,
name: '1年内' name: '1年内'
}], }],
pageNo: 1, page: 1,
pageSize: 10, pageSize: 10,
totals: 1, totals: 1,
multipleSelection: [] multipleSelection: []
}; };
}, },
watch: {
'form.keyword': function(val) {
clearTimeout(this.searchTimer)
this.searchTimer = setTimeout(() => {
this.initData()
},500)
},
'form.month': function(val){
if(val){
let unit = 24 * 60 * 60 * 1000
this.form.date = [this.formatDate('yyyy-MM-dd',new Date(new Date().getTime() - unit * 30 * val)),this.formatDate('yyyy-MM-dd',new Date(new Date().getTime() + unit))]
}else{
this.form.date = []
}
},
'form.date': function(val){
if(val.length){
this.form.startTime = val[0]
this.form.endTime = val[1]
}else{
this.form.startTime = ''
this.form.endTime = ''
}
this.initData()
}
},
mounted() { mounted() {
this.getData() this.getData()
}, },
@ -210,27 +234,19 @@ export default {
endTime: this.form.endTime, endTime: this.form.endTime,
roleId: this.form.accountRole, roleId: this.form.accountRole,
searchContent: this.form.keyword, searchContent: this.form.keyword,
pageNo: this.pageNo, platformId: this.platformId,
pageSize: this.pageSize page: this.page,
size: this.pageSize
} }
this.$get(this.api.queryUser,data).then(res => { this.$get(this.api.queryUserInfoList,data).then(res => {
res.message.rows.forEach(e => { this.userData = res.message.list
if(e.roleId.length > 1) { this.totals = res.message.totalCount
let NewaccountRole = []
let roleIds = e.roleId.split(',')
roleIds.forEach((n,k) => {
NewaccountRole.push(this.roleStatus(n))
})
e.NewaccountRole = NewaccountRole.join(',')
}else{
e.NewaccountRole = this.roleStatus(e.roleId)
}
})
this.userData = res.message.rows
this.totals = res.message.total
}).catch(res => {}); }).catch(res => {});
}, },
initData(){
this.page = 1
this.getData()
},
// //
clearprovince(){ clearprovince(){
this.form.city = '', this.form.city = '',
@ -240,7 +256,7 @@ export default {
getCity(){ getCity(){
this.clearprovince() this.clearprovince()
this.getCityData() this.getCityData()
this.pageNo = 1 this.page = 1
this.getData() this.getData()
}, },
getCityData(){ getCityData(){
@ -249,7 +265,7 @@ export default {
} }
this.$get(this.api.queryCity,data).then(res => { this.$get(this.api.queryCity,data).then(res => {
this.cityList = res.message this.cityList = res.message
}).catch(res => {}); }).catch(res => {})
}, },
// //
clearcity(){ clearcity(){
@ -259,7 +275,7 @@ export default {
getSchool(){ getSchool(){
this.clearcity() this.clearcity()
this.getSchoolData() this.getSchoolData()
this.pageNo = 1 this.page = 1
this.getData() this.getData()
}, },
getSchoolData(){ getSchoolData(){
@ -269,108 +285,91 @@ export default {
} }
this.$get(this.api.querySchool,data).then(res => { this.$get(this.api.querySchool,data).then(res => {
this.schoolList = res.message this.schoolList = res.message
}).catch(res => {}); }).catch(res => {})
},
onSearch(){
this.pageNo = 1
this.getData()
},
itemRadio(val){
this.form.month = val
this.form.date = ''
this.form.startTime = ''
this.form.endTime = ''
this.getData()
},
selectTime(val){
if(val){
this.form.startTime = val[0]
this.form.endTime = val[1]
}else{
this.form.startTime = ''
this.form.endTime = ''
}
this.form.month = ''
this.getData()
}, },
currentChange(val) { currentChange(val) {
this.pageNo = val; this.page = val
this.getData(); this.getData()
}, },
permission(){ permission(){
this.$router.push('/permission') this.$router.push('/permission')
}, },
adduser(){ adduser(){
this.$store.commit("userData", { user_id : ''}); this.$store.commit("userData", { user_id : ''})
this.$router.push('/adduser'); this.$router.push('/adduser')
}, },
edit(row){ edit(row){
this.$store.commit("userData", { user_id : row.userId}); this.$store.commit("userData", { user_id : row.userId})
this.$router.push('/adduser'); this.$router.push('/adduser')
},
show(row){
this.$store.commit("userData", { user_id : row.userId})
this.$router.push('/adduser')
}, },
handleDelete(row) { handleDelete(row) {
this.$confirm('确定要删除吗?', '提示', { this.$confirm('确定要删除吗?', '提示', {
type: 'warning' type: 'warning'
}) }).then(() => {
.then(() => { this.$get(this.api.delUserAccount,{
let arr = [] userId: row.userId,
arr.push(row.userId) isdel: 1
this.$post(this.api.deleteUser,arr).then(res => { }).then(res => {
this.$message.success('删除成功'); this.$message.success('删除成功')
this.getData() this.getData()
}).catch(res => {}); }).catch(res => {})
}) }).catch(() => {})
.catch(() => {});
}, },
resetPassword(row){ resetPassword(row){
this.$confirm(`重置后的密码为:${this.$config.initialPassword},确定重置?`, '提示', { this.$confirm(`重置后的密码为:${this.$config.initialPassword},确定重置?`, '提示', {
}).then(() => { }).then(() => {
let data = { let data = {
newPwd: this.$config.initialPassword, newPwd: this.$config.initialPassword,
userId: row.userId, userId: row.userId,
}
this.$get(this.api.resetPwd,data).then(res => {
if(res.message == 'success'){
this.$message.success('重置成功')
}else{
this.$message.error('重置失败')
} }
this.$get(this.api.resetPwd,data).then(res => { }).catch(res => {})
if(res.errmessage == 'success'){ }).catch(() => {})
this.$message.success('重置成功')
}else{
this.$message.error('重置失败')
}
}).catch(res => {});
}).catch(() => {
});
}, },
getRowKeys(row) { switchOff(val,row,index) {
return row.userId; this.$get(this.api.updateAccountAllEnable,{
id: row.userId,
isEnable: val
}).then(res => {
this.$message.success(val ? '启用成功' : '禁用成功')
}).catch(res => {})
}, },
handleSelectionChange(val) { handleSelectionChange(val) {
this.multipleSelection = val; this.multipleSelection = val
}, },
delAllSelection() { delAllSelection() {
if(this.multipleSelection.length != ''){ if(this.multipleSelection.length != ''){
let newArr = this.multipleSelection let newArr = this.multipleSelection
let delList = newArr.map(e => e.userId) let delList = newArr.map(e => e.userId)
//
this.$confirm('确定要删除选中用户吗?', '提示', { this.$confirm('确定要删除选中用户吗?', '提示', {
type: 'warning' type: 'warning'
}) }).then(() => {
.then(() => {
this.$post(this.api.deleteUser,delList).then(res => { this.$post(this.api.deleteUser,delList).then(res => {
this.multipleSelection = []; this.multipleSelection = [];
this.$message.success('删除成功'); this.$message.success('删除成功')
this.getData() this.getData()
}).catch(res => {}); }).catch(res => {})
}).catch(() => {}); }).catch(() => {})
}else{ }else{
this.$message.error('请先选择客户 !'); this.$message.error('请先选择客户 !')
} }
}, },
} }
}; };
</script> </script>
<style scoped> <style lang="scss" scoped>
.mag{ .el-form-item{
margin-right: 20px; margin-bottom: 0;
} }
</style> </style>

Loading…
Cancel
Save