Commit f7b1f106 by fairyly

feat: 增加组件

parent bb1d7737
...@@ -3,32 +3,31 @@ ...@@ -3,32 +3,31 @@
* @Author : 无尘 * @Author : 无尘
* @Date : 2020-02-13 16:13:59 * @Date : 2020-02-13 16:13:59
* @LastEditors : 无尘 * @LastEditors : 无尘
* @LastEditTime : 2020-02-15 16:21:48 * @LastEditTime : 2020-02-17 10:33:22
* @FilePath : \Hapi-demoj:\公司\haoban-3\src\components\company\add-member.vue * @FilePath : \Hapi-demoj:\公司\haoban-3\src\components\company\add-enterprise.vue
--> -->
<!-- <!--
<add-member :memberObj="memberObj" @refreshData="refreshData"></add-member> <add-enterprise :memberObj="memberObj" @refreshData="refreshData"></add-enterprise>
import addMember from '@/components/company/add-member.vue'; import addEnterprise from '@/components/company/add-enterprise.vue';
--> -->
<template> <template>
<el-dialog width="600px" :title="partForm.staffId ? '成员详情' : '新增成员'" :visible.sync="memberVisible" append-to-body :before-close="handleClose"> <el-dialog width="600px" title="新增GIC商户授权" :visible.sync="memberVisible" append-to-body :before-close="handleClose">
<div class="add-title m-b-20 font-14 color-303133 font-w-500">基本信息</div> <el-form :model="partForm" :rules="rules" ref="form" label-width="140px" class="dialog-form">
<el-form :model="partForm" :rules="rules" ref="form" label-width="100px" class="dialog-form"> <el-form-item label="选择商户" prop="">
<el-form-item label="选择商户" prop="staffName"> <el-autocomplete style="width: 363px;" v-model="partForm.enterpriseName" :fetch-suggestions="querySearchAsync" @select="handleSelect">
<el-input v-model="partForm.enterpriseName" @blur="inputBlur()" @keyup.native="value => toInput(value)"> <el-select v-model="partForm.version" slot="prepend" class="w-95" :disabled="disflag" @change="changeCode">
<el-select v-model="partForm.version" slot="prepend" class="w-92" :disabled="disflag" @change="changeCode">
<el-option v-for="(item, index) in versionList" :label="item.label" :value="item.value" :key="index + 'option'">{{ item.value }}</el-option> <el-option v-for="(item, index) in versionList" :label="item.label" :value="item.value" :key="index + 'option'">{{ item.value }}</el-option>
</el-select> </el-select>
</el-input> </el-autocomplete>
</el-form-item> </el-form-item>
<el-form-item label="超级管理员"> <el-form-item label="超级管理员">
{{ partForm.clerkName }} {{ partForm.clerkName }}
</el-form-item> </el-form-item>
<el-form-item label="超级管理员手机号" prop="sex"> {{ partForm.phoneNumber | formatPhoneNum }} <el-button type="primary" @click="sendCode('form')">点击短信验证</el-button> </el-form-item> <el-form-item label="超级管理员手机号" prop="sex"> {{ partForm.phoneNumber | formatPhoneNum }} <el-button type="primary" @click="sendCode()">点击短信验证</el-button> </el-form-item>
<el-form-item label="短信验证码" prop="code"> <el-form-item label="短信验证码" prop="code">
<el-input v-model="partForm.code" placeholder="请输入验证码"></el-input> <el-input style="width: 180px;" v-model="partForm.code" placeholder="请输入验证码"></el-input>
</el-form-item> </el-form-item>
</el-form> </el-form>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
...@@ -43,9 +42,10 @@ import countryMobile from '@/components/common/country-mobile.vue'; ...@@ -43,9 +42,10 @@ import countryMobile from '@/components/common/country-mobile.vue';
import selectDepartment from '@/components/company/select-department.vue'; import selectDepartment from '@/components/company/select-department.vue';
import { getRequest, postRequest } from '@/api/api'; import { getRequest, postRequest } from '@/api/api';
import errMsg from '@/common/js/error'; import errMsg from '@/common/js/error';
import showMsg from '@/common/js/showmsg';
import PhoneNumber from 'awesome-phonenumber'; import PhoneNumber from 'awesome-phonenumber';
export default { export default {
name: 'add-member', name: 'add-enterprise',
components: { components: {
limitInput, limitInput,
countryMobile, countryMobile,
...@@ -76,27 +76,21 @@ export default { ...@@ -76,27 +76,21 @@ export default {
return { return {
versionList: [ versionList: [
{ {
label: '3.0', label: 'GIC 3.0',
value: '3.0' value: '3.0'
}, },
{ {
label: '4.0', label: 'GIC 4.0',
value: '4.0' value: '4.0'
} }
], ],
memberVisible: true, memberVisible: true,
partForm: { partForm: {
version: '', version: '3.0',
enterpriseName: '', enterpriseName: '',
nationCode: '86', nationCode: '86',
phoneNumber: '', phoneNumber: '',
postion: '', code: ''
activeFlag: 0,
department: [],
departmentIds: '',
sex: '1',
syncPostionFlag: '1',
extendPostion: ''
}, },
rules: { rules: {
staffName: [ staffName: [
...@@ -126,6 +120,105 @@ export default { ...@@ -126,6 +120,105 @@ export default {
}, },
methods: { methods: {
/** /**
* 发送验证码
*/
sendCode() {
const that = this;
let params = {
phoneNumber: that.partForm.phoneNumber,
nationCode: that.partForm.nationCode,
type: ''
};
getRequest('/haoban-web/send-code', params)
.then(res => {
let resData = res.data;
if (resData.errorCode == 1) {
const phone = String(that.partForm.phoneNumber);
let handle = phone.substr(0, 3) + '****' + phone.substr(7, phone.length - 1);
showMsg.showmsg(`已发送验证码到${that.partForm.nationCode}-${handle}`, 'success');
return false;
}
errMsg.errorMsg(resData);
})
.catch(function(error) {
that.$message.error({
duration: 1000,
message: error.message
});
});
},
/**
* 校验验证码
*/
checkCode() {
const that = this;
let params = {
phoneNumber: that.partForm.phoneNumber,
nationCode: that.partForm.nationCode,
type: '',
code: that.partForm.code
};
return new Promise((resolve, reject) => {
getRequest('/haoban-web/validate-code', params)
.then(res => {
let resData = res.data;
if (resData.errorCode == 1) {
resolve(true);
return false;
}
errMsg.errorMsg(resData);
resolve(false);
})
.catch(function(error) {
resolve(false);
that.$message.error({
duration: 1000,
message: error.message
});
});
});
},
/**
* 搜索查询列表
*/
getSearchList() {
const that = this;
let params = {
version: that.partForm.version
};
return new Promise((resolve, reject) => {
getRequest('/haoban-web/staff-add', params)
.then(res => {
let resData = res.data;
if (resData.errorCode == 1) {
resolve(resData.result);
return false;
}
errMsg.errorMsg(resData);
resolve(false);
})
.catch(function(error) {
resolve(false);
that.$message.error({
duration: 1000,
message: error.message
});
});
});
},
/**
* 搜索查询列表
*/
async querySearchAsync(queryString, cb) {
const that = this;
const res = await that.getSearchList();
cb(res);
},
handleSelect(item) {
console.log(item);
},
/**
* 改变对外职务 * 改变对外职务
*/ */
checkGroupIds: function(nodes) { checkGroupIds: function(nodes) {
...@@ -149,19 +242,23 @@ export default { ...@@ -149,19 +242,23 @@ export default {
handleClose(done) { handleClose(done) {
const that = this; const that = this;
that.$refs['form'].resetFields(); that.$refs['form'].resetFields();
that.partVisible = false; that.memberVisible = false;
done(); done();
}, },
cancel() { cancel() {
const that = this; const that = this;
that.$refs['form'].resetFields(); that.$refs['form'].resetFields();
that.partVisible = false; that.memberVisible = false;
}, },
/** /**
* 确定保存 * 确定保存
*/ */
submitForm(form) { async submitForm(form) {
const that = this; const that = this;
const flag = await that.checkCode();
if (!flag) {
return false;
}
that.$refs[form].validate(valid => { that.$refs[form].validate(valid => {
if (valid) { if (valid) {
that.toAddPost(); that.toAddPost();
...@@ -178,12 +275,7 @@ export default { ...@@ -178,12 +275,7 @@ export default {
nickName: that.partForm.nickName, nickName: that.partForm.nickName,
sex: that.partForm.sex, sex: that.partForm.sex,
nationCode: that.partForm.nationCode, nationCode: that.partForm.nationCode,
phoneNumber: that.partForm.phoneNumber, phoneNumber: that.partForm.phoneNumber
departmentIds: that.partForm.departmentIds,
postion: that.partForm.postion,
extendPostion: that.partForm.extendPostion,
activeFlag: that.partForm.activeFlag,
syncPostionFlag: that.partForm.syncPostionFlag
}; };
postRequest(that.partForm.staffId ? '/haoban-web/staff-edit' : '/haoban-web/staff-add', params) postRequest(that.partForm.staffId ? '/haoban-web/staff-edit' : '/haoban-web/staff-add', params)
.then(res => { .then(res => {
...@@ -226,20 +318,11 @@ export default { ...@@ -226,20 +318,11 @@ export default {
}); });
} }
}, },
watch: { watch: {}
memberObj(newData, oldData) { /* mounted() {
const that = this; const that = this;
if (Object.keys(newData).length) {
that.partForm = newData; } */
}
}
},
mounted() {
const that = this;
if (Object.keys(that.memberObj).length) {
that.partForm = that.memberObj;
}
}
}; };
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
...@@ -252,6 +335,10 @@ export default { ...@@ -252,6 +335,10 @@ export default {
border-radius: 50%; border-radius: 50%;
} }
.w-95 {
width: 95px;
}
.m-l-30 { .m-l-30 {
margin-left: 30px; margin-left: 30px;
} }
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
* @Author : 无尘 * @Author : 无尘
* @Date : 2020-02-13 16:13:59 * @Date : 2020-02-13 16:13:59
* @LastEditors : 无尘 * @LastEditors : 无尘
* @LastEditTime : 2020-02-15 16:21:48 * @LastEditTime : 2020-02-17 11:30:35
* @FilePath : \Hapi-demoj:\公司\haoban-3\src\components\company\add-member.vue * @FilePath : \Hapi-demoj:\公司\haoban-3\src\components\company\add-member.vue
--> -->
<!-- <!--
...@@ -160,11 +160,13 @@ export default { ...@@ -160,11 +160,13 @@ export default {
that.$refs['form'].resetFields(); that.$refs['form'].resetFields();
that.partVisible = false; that.partVisible = false;
done(); done();
that.$emit('refreshData');
}, },
cancel() { cancel() {
const that = this; const that = this;
that.$refs['form'].resetFields(); that.$refs['form'].resetFields();
that.partVisible = false; that.partVisible = false;
that.$emit('refreshData');
}, },
/** /**
* 确定保存 * 确定保存
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
* @Author : 无尘 * @Author : 无尘
* @Date : 2020-02-13 14:02:22 * @Date : 2020-02-13 14:02:22
* @LastEditors : 无尘 * @LastEditors : 无尘
* @LastEditTime : 2020-02-15 15:12:46 * @LastEditTime : 2020-02-17 14:20:28
* @FilePath : haoban-3\src\components\company\depart-list.vue * @FilePath : haoban-3\src\components\company\depart-list.vue
--> -->
<!-- <!--
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
<div class="depart-id font-12 color-909399">{{ departObj.departmentId }}</div> <div class="depart-id font-12 color-909399">{{ departObj.departmentId }}</div>
</div> </div>
<div class="depart-children-list border-box m-t-18"> <div class="depart-children-list border-box m-t-18">
<div class="depart-children-title"><span class="iconfont iconbumen color-303133"></span><span class="font-16 color-303133 font-w-600">下级部门</span></div> <div class="depart-children-title"><span class="iconfont iconbumen color-303133"></span><span class="font-16 color-303133 font-w-600 p-l-5">下级部门</span></div>
<div class="depart-condition-wrap flex flex-space-between m-t-20"> <div class="depart-condition-wrap flex flex-space-between m-t-20">
<el-input placeholder="请输入部门名称/ID" v-model="searchInput" class="w-274" @keyup.native="value => toInput(value, searchInput)" clearable @clear="clearInput"></el-input> <el-input placeholder="请输入部门名称/ID" v-model="searchInput" class="w-274" @keyup.native="value => toInput(value, searchInput)" clearable @clear="clearInput"></el-input>
<el-button type="primary" @click="addChildPart">新建子部门</el-button> <el-button type="primary" @click="addChildPart">新建子部门</el-button>
...@@ -154,8 +154,9 @@ export default { ...@@ -154,8 +154,9 @@ export default {
*/ */
getChildren(item) { getChildren(item) {
const that = this; const that = this;
that.currentPage = 1; that.$emit('resetData', item);
that.getTableList(); // that.currentPage = 1;
// that.getTableList();
}, },
handleClose(done) { handleClose(done) {
...@@ -235,11 +236,11 @@ export default { ...@@ -235,11 +236,11 @@ export default {
/** /**
* 获取列表数据 * 获取列表数据
*/ */
getTableList(val) { getTableList() {
const that = this; const that = this;
let para = { let para = {
parentId: '', parentId: that.departObj.departmentId,
isStore: '', isStore: that.departObj.isStore,
keyWord: that.searchInput || '', // 搜索字段 keyWord: that.searchInput || '', // 搜索字段
pageNum: that.currentPage, // 当前页 pageNum: that.currentPage, // 当前页
pageSize: that.pageSize // 一页显示个数 pageSize: that.pageSize // 一页显示个数
...@@ -249,7 +250,7 @@ export default { ...@@ -249,7 +250,7 @@ export default {
let resData = res.data; let resData = res.data;
if (resData.errorCode == 1) { if (resData.errorCode == 1) {
that.tableData = resData.result.list || []; that.tableData = resData.result.list || [];
that.total = resData.result.total; that.total = resData.result.pageInfo.total;
return false; return false;
} }
errMsg.errorMsg(resData); errMsg.errorMsg(resData);
...@@ -261,6 +262,22 @@ export default { ...@@ -261,6 +262,22 @@ export default {
}); });
}); });
} }
},
watch: {
departObj(newData, oldData) {
const that = this;
if (Object.keys(newData)) {
that.currentPage = 1;
that.getTableList();
}
}
},
mounted() {
const that = this;
if (Object.keys(that.departObj)) {
that.currentPage = 1;
that.getTableList();
}
} }
}; };
</script> </script>
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
* @Author : 无尘 * @Author : 无尘
* @Date : 2020-02-13 14:02:40 * @Date : 2020-02-13 14:02:40
* @LastEditors : 无尘 * @LastEditors : 无尘
* @LastEditTime : 2020-02-15 16:05:33 * @LastEditTime : 2020-02-17 14:48:49
* @FilePath : \haoban-3\src\components\company\depart-member.vue * @FilePath : \haoban-3\src\components\company\depart-member.vue
--> -->
<!-- <!--
...@@ -13,11 +13,11 @@ ...@@ -13,11 +13,11 @@
<template> <template>
<div class="depart-list-body"> <div class="depart-list-body">
<div class="depart-children-list m-t-20"> <div class="depart-children-list m-t-20">
<div class="depart-children-title"><span class="iconfont iconchengyuan color-303133"></span><span class="font-16 color-303133 font-w-600">部门成员</span></div> <div class="depart-children-title"><span class="iconfont iconchengyuan color-303133"></span><span class="font-16 color-303133 font-w-600 p-l-5">部门成员</span></div>
<div class="depart-condition-wrap flex flex-space-between m-t-20"> <div class="depart-condition-wrap flex flex-space-between m-t-20">
<div> <div>
<el-input placeholder="请输入姓名/手机号" v-model="searchInput" class="w-274" @keyup.native="value => toInput(value, searchInput)" clearable @clear="clearInput"></el-input> <el-input placeholder="请输入姓名/手机号" v-model="searchInput" class="w-274" @keyup.native="value => toInput(value, searchInput)" clearable @clear="clearInput"></el-input>
<el-select v-model="activeFlag" placeholder="所有状态" class="m-l-6"> <el-select v-model="activeFlag" placeholder="所有状态" class="m-l-6" @change="changeStatus">
<el-option v-for="item in statusOptions" :key="item.value" :label="item.label" :value="item.value"> </el-option> <el-option v-for="item in statusOptions" :key="item.value" :label="item.label" :value="item.value"> </el-option>
</el-select> </el-select>
</div> </div>
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
</div> </div>
</div> </div>
<div class="m-t-20"> <div class="m-t-20">
<el-table class="select-table" ref="multipleTable" :data="tableData" tooltip-effect="dark" :style="{ width: '100%', minHeight: tableH }" @selection-change="handleSelectionChange"> <el-table class="select-table" ref="multipleDepartTable" :data="tableData" tooltip-effect="dark" :style="{ width: '100%', minHeight: tableH }" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55"> </el-table-column> <el-table-column type="selection" width="55"> </el-table-column>
<el-table-column label="姓名" show-overflow-tooltip> <el-table-column label="姓名" show-overflow-tooltip>
<template slot-scope="scope">{{ scope.row.staffName || '--' }}</template> <template slot-scope="scope">{{ scope.row.staffName || '--' }}</template>
...@@ -38,10 +38,10 @@ ...@@ -38,10 +38,10 @@
<template slot-scope="scope">{{ scope.row.postion || '--' }}</template> <template slot-scope="scope">{{ scope.row.postion || '--' }}</template>
</el-table-column> </el-table-column>
<el-table-column prop="" label="手机号码" show-overflow-tooltip> <el-table-column prop="" label="手机号码" show-overflow-tooltip>
<template slot-scope="scope">{{ scope.row.nationCode }}{{ scope.row.phoneNumber }}</template> <template slot-scope="scope">{{ scope.row.nationCode }}-{{ scope.row.phoneNumber }}</template>
</el-table-column> </el-table-column>
<el-table-column prop="" label="操作" show-overflow-tooltip> <el-table-column prop="" label="操作" show-overflow-tooltip>
<template slot-scope="scope"> <el-button type="text" @click="showDetail(scope.row)">详情</el-button><el-button v-if="scope.row.activeFlag == 0" type="text" @click="toInvaite(scope.row)">邀请</el-button> </template> <template slot-scope="scope"> <el-button type="text" @click="showDetail(scope.row)">详情</el-button><el-button v-if="scope.row.activeFlag == 0" type="text" @click="toInvite(scope.row)">邀请</el-button> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<div class="block common-wrap__page text-right m-t-24" v-if="tableData.length != 0"> <div class="block common-wrap__page text-right m-t-24" v-if="tableData.length != 0">
...@@ -124,6 +124,12 @@ export default { ...@@ -124,6 +124,12 @@ export default {
that.currentPage = 1; that.currentPage = 1;
that.getTableList(); that.getTableList();
}, },
// 选择状态
changeStatus() {
const that = this;
that.currentPage = 1;
that.getTableList();
},
/** /**
* 调整部门 * 调整部门
...@@ -163,18 +169,21 @@ export default { ...@@ -163,18 +169,21 @@ export default {
/** /**
* 邀请 * 邀请
*/ */
toInvite() { toInvite(item) {
const that = this; const that = this;
if (item) {
that.postInvite(item);
}
if (!that.multipleSelection.length) { if (!that.multipleSelection.length) {
showMsg.showmsg('请先选择成员!', 'warning'); showMsg.showmsg('请先选择成员!', 'warning');
return false; return false;
} }
that.postInvite(); that.postInvite();
}, },
postInvite() { postInvite(item) {
const that = this; const that = this;
let params = { let params = {
staffIds: '' staffIds: item ? item.staffId : that.multipleSelection.map(ele => ele.staffId).join(',')
}; };
postRequest('/haoban-web/staff-invite', params) postRequest('/haoban-web/staff-invite', params)
.then(res => { .then(res => {
...@@ -310,7 +319,12 @@ export default { ...@@ -310,7 +319,12 @@ export default {
* 勾选 * 勾选
*/ */
handleSelectionChange(val) { handleSelectionChange(val) {
this.multipleSelection = val; const that = this;
that.multipleSelection = val;
// 如果需要过滤就需要,下面重新勾选过滤后的数据
//rows.forEach(row => {
// this.$refs.multipleDepartTable.toggleRowSelection(row);
//});
}, },
/** /**
...@@ -358,6 +372,22 @@ export default { ...@@ -358,6 +372,22 @@ export default {
}); });
}); });
} }
},
watch: {
departObj(newData, oldData) {
const that = this;
if (Object.keys(newData)) {
that.currentPage = 1;
that.getTableList();
}
}
},
mounted() {
const that = this;
if (Object.keys(that.departObj)) {
that.currentPage = 1;
that.getTableList();
}
} }
}; };
</script> </script>
......
...@@ -15,7 +15,9 @@ import orgTree from './org-tree.vue'; ...@@ -15,7 +15,9 @@ import orgTree from './org-tree.vue';
<ul class="m-l-10"> <ul class="m-l-10">
<draggable :list="itemData" class="org-component" :options="leftOption" :move="onMove" @start="isDragging = true" @end="itemMoveEnd"> <draggable :list="itemData" class="org-component" :options="leftOption" :move="onMove" @start="isDragging = true" @end="itemMoveEnd">
<li v-for="(item, index) in itemData" :key="index + 'gic'"> <li v-for="(item, index) in itemData" :key="index + 'gic'">
<div class="li-cell cursor-pointer" @click="toggleExpand(item)">{{ item.label }}</div> <div class="li-cell cursor-pointer" @click="toggleExpand(item)">
<span :class="['font-12 color-606266', item.expand ? 'el-icon-caret-bottom' : 'el-icon-caret-right']"></span><span :class="['font-14 p-l-10 p-r-10 iconfont', item.isStore == 1 ? 'icondianpu-kuai' : 'iconqiye-tianchong', item.bindFlag == 1 ? 'color-2f54eb' : 'color-dedfe6']"></span><span class="font-14 color-606266">{{ item.label }}</span>
</div>
<li-row v-show="!!item.children.length && item.expand" :itemData="item.children"></li-row> <li-row v-show="!!item.children.length && item.expand" :itemData="item.children"></li-row>
</li> </li>
</draggable> </draggable>
...@@ -98,6 +100,7 @@ export default { ...@@ -98,6 +100,7 @@ export default {
.li-cell { .li-cell {
line-height: 26px; line-height: 26px;
} }
.w-110 { .w-110 {
width: 110px; width: 110px;
} }
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
* @Author: 无尘 * @Author: 无尘
* @Date: 2020-02-05 10:50:57 * @Date: 2020-02-05 10:50:57
* @LastEditors : 无尘 * @LastEditors : 无尘
* @LastEditTime : 2020-02-08 17:22:48 * @LastEditTime : 2020-02-17 15:23:39
--> -->
<!-- <!--
设置成员所在部门(回收站) 设置成员所在部门(回收站)
...@@ -12,182 +12,211 @@ ...@@ -12,182 +12,211 @@
import setDepartment from '@/components/set-department.vue'; import setDepartment from '@/components/set-department.vue';
--> -->
<template> <template>
<el-dialog width="660px" title="设置成员所在部门" :visible.sync="setVisible" append-to-body :before-close="close"> <el-dialog width="600px" title="设置成员所在部门" :visible.sync="setVisible" append-to-body :before-close="handleClose">
<div class="select-search"> <div class="select-search">
<!-- 树形也自带有过滤搜索的方法 --> <!-- 树形也自带有过滤搜索的方法 -->
<el-input placeholder="请输入部门名称" v-model="searchSelect" style="width: 100%;" @keyup.native="value => toInput(value, searchSelect)" @clear="clearSearch"> <i slot="prefix" class="el-input__icon el-icon-search"></i> </el-input> <el-input placeholder="请输入内容" v-model="searchSelect" style="width: 296px;" @keyup.native="value => toInput(value, searchSelect)" @clear="clearSearch"> <i slot="prefix" class="el-input__icon el-icon-search"></i> </el-input>
</div> </div>
<div class="select-tree-wrap"> <div class="select-tree-wrap m-t-20">
<el-tree :data="treeData" node-key="groupId" ref="setTree" default-expand-all :props="defaultProps" :expand-on-click-node="false" @node-click="handleNodeClick"> <el-tree :data="treeData" node-key="groupId" ref="setTree" default-expand-all :props="defaultProps" :expand-on-click-node="false" @node-click="handleNodeClick">
<span class="custom-tree-node" slot-scope="{ node, data }"> <span class="custom-tree-node" slot-scope="{ node, data }">
<span>{{ node.label }}</span> <span :class="['font-14 p-r-10 iconfont', node.isStore == 1 ? 'icondianpu-kuai' : 'iconqiye-tianchong', node.bindFlag == 1 ? 'color-2f54eb' : 'color-dedfe6']"></span><span class="font-14 color-606266">{{ node.label }}</span>
</span> </span>
</el-tree> </el-tree>
</div> </div>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button @click="goLast('form')">取消</el-button> <el-button @click="cancel">取消</el-button>
<el-button type="primary" @click="submitForm">确定</el-button> <el-button type="primary" @click="submitForm">确定</el-button>
</div> </div>
</el-dialog> </el-dialog>
</template> </template>
<script> <script>
/* eslint-disable */ /* eslint-disable */
import { getRequest, postRequest } from '@/api/api'; import {
import errMsg from '@/common/js/error'; _debounce
export default { } from '@/common/js/public';
props: { import {
applicationId: { getRequest,
type: String, postRequest
default() { } from '@/api/api';
return ''; import errMsg from '@/common/js/error';
import showMsg from '@/common/js/showmsg';
export default {
props: {
applicationId: {
type: String,
default () {
return '';
}
} }
}
},
data() {
return {
setVisible: true,
treeData: [],
searchSelect: '', // 搜索字段
selectId: ''
};
},
computed: {},
beforeMount() {
this.getOptionList();
},
mounted() {
this.getData();
},
methods: {
/**
* 输入
*/
toInput: _debounce(function(e, value) {
const that = this;
if (!that.storesCopy.length) {
return false;
}
if (value == '') {
that.stores = JSON.parse(JSON.stringify(that.storesCopy));
}
let filterData = JSON.parse(JSON.stringify(that.storesCopy)).filter(ele => {
return ele.storeName.includes(value);
});
that.treeData = filterData;
}, 500),
/**
* 清空
*/
clearSearch() {
const that = this;
that.treeData = JSON.parse(JSON.stringify(that.storesCopy));
}, },
/** data() {
* 点击 tree 数据 return {
*/ setVisible: true,
handleNodeClick(data) { treeData: [],
const that = this; searchSelect: '', // 搜索字段
console.log(data); selectId: ''
that.selectId = data.id; };
}, },
/** computed: {},
* 获取tree 数据
*/ mounted() {
getData() { this.getData();
const that = this;
let params = {};
getRequest('/haoban-manage-web/dept/deptList', params)
.then(res => {
if (res.data.code === '0000') {
that.treeData = res.data.result || [];
}
errMsg.errorMsg(resData);
})
.catch(function(error) {
that.$message.error({
duration: 1000,
message: error.message
});
});
}, },
methods: {
/**
* 关闭弹窗
*/
handleClose(done) {
const that = this;
that.$refs['form'].resetFields();
that.partVisible = false;
done();
that.$emit('closeSet');
},
cancel() {
const that = this;
that.$refs['form'].resetFields();
that.partVisible = false;
that.$emit('closeSet');
},
/**
* 输入
*/
toInput: _debounce(function(e, value) {
const that = this;
if (!that.storesCopy.length) {
return false;
}
if (value == '') {
that.stores = JSON.parse(JSON.stringify(that.storesCopy));
}
let filterData = JSON.parse(JSON.stringify(that.storesCopy)).filter(ele => {
return ele.storeName.includes(value);
});
that.treeData = filterData;
}, 500),
/**
* 清空
*/
clearSearch() {
const that = this;
that.treeData = JSON.parse(JSON.stringify(that.storesCopy));
},
/**
* 点击 tree 数据
*/
handleNodeClick(data) {
const that = this;
console.log(data);
that.selectId = data.id;
},
/**
* 获取tree 数据
*/
getData() {
const that = this;
let params = {};
getRequest('/haoban-manage-web/dept/deptList', params)
.then(res => {
if (res.data.code === '0000') {
that.treeData = res.data.result || [];
}
errMsg.errorMsg(resData);
})
.catch(function(error) {
that.$message.error({
duration: 1000,
message: error.message
});
});
},
/** /**
* 确定授权 * 确定授权
*/ */
submitForm(form) { submitForm() {
const that = this; const that = this;
let params = { if (!that.selectId) {
resourceId: that.form.resourceId, showMsg.showmsg('请选择部门', 'warning');
resourceName: that.form.resourceName, return false;
applicationId: that.applicationId }
}; let params = {
postRequest('/haoban-manage-web/dept/deptList', params) departmentId: that.selectId
.then(res => { };
if (res.data.code === '0000') { postRequest('/haoban-web/department-repair', params)
that.$emit('closeSet', that.selectId); .then(res => {
} if (res.data.code === '0000') {
errMsg.errorMsg(resData); that.$emit('closeSet', that.selectId);
}) }
.catch(function(error) { errMsg.errorMsg(resData);
that.$message.error({ })
duration: 1000, .catch(function(error) {
message: error.message that.$message.error({
duration: 1000,
message: error.message
});
}); });
}); }
} },
}, components: {}
components: {} };
};
</script> </script>
<style scoped> <style scoped>
.m-t-5 { .m-t-5 {
margin-top: 5px; margin-top: 5px;
} }
.dialog-top { .dialog-top {
margin-bottom: 20px; margin-bottom: 20px;
} }
.dialog-top img { .dialog-top img {
width: 40px; width: 40px;
height: 40px; height: 40px;
border: 1px solid #e4e7ed; border: 1px solid #e4e7ed;
border-radius: 50%; border-radius: 50%;
vertical-align: middle; vertical-align: middle;
margin-right: 10px; margin-right: 10px;
} }
.dialog-top span { .dialog-top span {
font-size: 14px; font-size: 14px;
font-weight: 600; font-weight: 600;
color: #303133; color: #303133;
} }
.select-info { .select-info {
display: inline-block; display: inline-block;
vertical-align: middle; vertical-align: middle;
} }
.dialog-operate { .dialog-operate {
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;
} }
.pagination-content { .pagination-content {
text-align: right; text-align: right;
} }
.dialog-form { .dialog-form {
width: 430px; width: 430px;
padding-top: 20px; padding-top: 20px;
} }
.w-215 { .w-215 {
width: 215px; width: 215px;
} }
.w-115 { .w-115 {
width: 115px; width: 115px;
} }
</style>
.select-tree-wrap {
height: 445px;
overflow-y: auto;
border: 1px solid #e4e7ed;
}
</style>
\ No newline at end of file
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
* @Author : 无尘 * @Author : 无尘
* @Date : 2020-02-13 14:02:40 * @Date : 2020-02-13 14:02:40
* @LastEditors : 无尘 * @LastEditors : 无尘
* @LastEditTime : 2020-02-15 16:52:59 * @LastEditTime : 2020-02-17 13:46:51
* @FilePath : \haoban-3\src\components\company\store-member.vue * @FilePath : \haoban-3\src\components\company\store-member.vue
--> -->
<!-- <!--
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
<div class="depart-id font-12 color-909399">{{ departObj.departmentId }}</div> <div class="depart-id font-12 color-909399">{{ departObj.departmentId }}</div>
</div> </div>
<div class="depart-children-list m-t-20"> <div class="depart-children-list m-t-20">
<div class="depart-children-title"><span class="iconfont iconchengyuan color-303133"></span><span class="font-16 color-303133 font-w-600">门店成员</span></div> <div class="depart-children-title"><span class="iconfont iconchengyuan color-303133"></span><span class="font-16 color-303133 font-w-600 p-l-5">门店成员</span></div>
<div class="depart-condition-wrap flex flex-space-between m-t-20"> <div class="depart-condition-wrap flex flex-space-between m-t-20">
<div> <div>
<el-input placeholder="请输入姓名/手机号" v-model="searchInput" class="w-274" @keyup.native="value => toInput(value, searchInput)" clearable @clear="clearInput"></el-input> <el-input placeholder="请输入姓名/手机号" v-model="searchInput" class="w-274" @keyup.native="value => toInput(value, searchInput)" clearable @clear="clearInput"></el-input>
...@@ -49,7 +49,7 @@ ...@@ -49,7 +49,7 @@
</el-table-column> </el-table-column>
<el-table-column prop="" label="手机号码" show-overflow-tooltip> <el-table-column prop="" label="手机号码" show-overflow-tooltip>
<template slot-scope="scope"> <template slot-scope="scope">
<el-select v-model="scope.row.clerkId" placeholder="请选择"> <el-select v-model="scope.row.clerkId" placeholder="请选择" @change="changeClerk($event, scope.row)" @focus="getClerkList($event, scope.row)">
<el-option v-for="item in clerkOptions" :key="item.value" :label="item.label" :value="item.value"> </el-option> <el-option v-for="item in clerkOptions" :key="item.value" :label="item.label" :value="item.value"> </el-option>
</el-select> </el-select>
</template> </template>
...@@ -125,6 +125,72 @@ export default { ...@@ -125,6 +125,72 @@ export default {
}, },
methods: { methods: {
/** /**
* 选择导购
*/
changeClerk(e, item) {
const that = this;
that
.$confirm(`是否确认为【${item.staffName}】绑定导购ID【${e}】`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
.then(() => {})
.catch(() => {
this.$message({
type: 'info',
message: '已取消'
});
});
},
postChange(obj) {
const that = this;
let params = {
clerkId: obj.clerkId
};
postRequest('/haoban-web/staff-bind', params)
.then(res => {
let resData = res.data;
if (resData.errorCode == 1) {
that.currentPage = 1;
that.getTableList();
// 是否需要更新左侧 tree
return false;
}
errMsg.errorMsg(resData);
})
.catch(function(error) {
that.$message.error({
duration: 1000,
message: error.message
});
});
},
/**
* 获取未绑定导购
*/
getClerkList(e, item) {
const that = this;
let params = {
departmentId: item.departmentId
};
getRequest('/haoban-web/staff-no-bind-list', params)
.then(res => {
let resData = res.data;
if (resData.errorCode == 1) {
that.clerkOptions = resData.result.list;
return false;
}
errMsg.errorMsg(resData);
})
.catch(function(error) {
that.$message.error({
duration: 1000,
message: error.message
});
});
},
/**
* 输入 * 输入
*/ */
toInput: _debounce(function(e, value) { toInput: _debounce(function(e, value) {
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
* @Author: 无尘 * @Author: 无尘
* @Date: 2019-03-20 14:36:37 * @Date: 2019-03-20 14:36:37
* @LastEditors : 无尘 * @LastEditors : 无尘
* @LastEditTime : 2020-02-15 17:01:02 * @LastEditTime : 2020-02-17 13:53:28
--> -->
<template> <template>
<div class="contacts-wrap common-set-wrap"> <div class="contacts-wrap common-set-wrap">
...@@ -92,7 +92,7 @@ export default { ...@@ -92,7 +92,7 @@ export default {
], ],
selectData: {}, selectData: {},
departObj: { departObj: {
isStore: 1 isStore: 0
}, },
// 分页参数 // 分页参数
currentPage: 1, currentPage: 1,
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
* @Author: 无尘 * @Author: 无尘
* @Date: 2019-03-20 14:36:37 * @Date: 2019-03-20 14:36:37
* @LastEditors : 无尘 * @LastEditors : 无尘
* @LastEditTime : 2020-02-16 14:43:00 * @LastEditTime : 2020-02-17 10:43:43
--> -->
<template> <template>
<div class="my-customer-wrap common-set-wrap"> <div class="my-customer-wrap common-set-wrap">
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
<div class="content-gic flex"> <div class="content-gic flex">
<div class="gic-content-business"> <div class="gic-content-business">
<ul> <ul>
<li v-for="(item, index) in enterpriseData" :key="index + 'li'"> <li v-for="(item, index) in enterpriseData" :key="index + 'li'" @click="selectEnterprise(item)">
<div class="ul-li-cell flex"> <div class="ul-li-cell flex">
<div class="cell-img"> <div class="cell-img">
<img :src="item.enterpriseLogo" alt="img" /> <img :src="item.enterpriseLogo" alt="img" />
...@@ -32,9 +32,11 @@ ...@@ -32,9 +32,11 @@
</div> </div>
</li> </li>
</ul> </ul>
<div class="add-enterprise cursor-pointer text-center"><span class="iconfont icontianjiajiahaowubiankuang font-12 color-2f54eb"></span><span class="font-12 color-2f54eb p-l-10">新建GIC商户授权</span></div> <div class="add-enterprise cursor-pointer text-center" @click="showAddDialog"><span class="iconfont icontianjiajiahaowubiankuang font-12 color-2f54eb"></span><span class="font-12 color-2f54eb p-l-10">新建GIC商户授权</span></div>
</div>
<div class="gic-content-depart">
<org-tree :itemData="gicData"></org-tree>
</div> </div>
<div class="gic-content-depart"></div>
</div> </div>
</div> </div>
<div class="apps-content-right"> <div class="apps-content-right">
...@@ -42,19 +44,31 @@ ...@@ -42,19 +44,31 @@
<span class="font-16 color-303133 text-left">企业微信组织架构</span> <span class="font-16 color-303133 text-left">企业微信组织架构</span>
<el-button type="text" @click="toRecycle">回收站()</el-button> <el-button type="text" @click="toRecycle">回收站()</el-button>
</div> </div>
<div class="content-wx"></div> <div class="content-wx">
<wx-tree :itemData="wxData" v-model="wxData"></wx-tree>
</div>
</div>
</div>
<div class="save-body m-t-10">
<div class="change-title text-center font-14 color-303133">好办组织结构于2020-10-10 14:22:15 发生改动</div>
<div class="text-center m-t-15">
<el-button type="primary" @click="saveData">保存更改并同步至企业微信</el-button>
</div> </div>
</div> </div>
</div> </div>
<add-enterprise v-if="addShow" @refreshData="refreshData"></add-enterprise>
</div> </div>
<vue-gic-footer></vue-gic-footer> <vue-gic-footer></vue-gic-footer>
</div> </div>
</template> </template>
<script> <script>
import navCrumb from '@/components/nav/nav.vue'; import navCrumb from '@/components/nav/nav.vue';
import { getRequest } from '@/api/api'; import addEnterprise from '@/components/company/add-enterprise.vue';
import orgTree from '@/components/company/org-tree.vue';
import wxTree from '@/components/company/wx-tree.vue';
import { getRequest, postRequest } from '@/api/api';
import errMsg from '@/common/js/error'; import errMsg from '@/common/js/error';
// import { _debounce } from '@/common/js/public'; import { _debounce } from '@/common/js/public';
export default { export default {
name: 'reviewed', name: 'reviewed',
data() { data() {
...@@ -83,12 +97,106 @@ export default { ...@@ -83,12 +97,106 @@ export default {
} }
], ],
gicData: [], gicData: [],
wxData: [] wxData: [],
addShow: false
}; };
}, },
computed: {}, computed: {},
methods: { methods: {
/** /**
* 保存
*/
saveData: _debounce(function() {
const that = this;
that.postSaveData();
}, 300),
postSaveData() {
const that = this;
let para = {};
postRequest('/haoban-web/wx-enterprise-bind', para)
.then(res => {
let resData = res.data;
if (resData.errorCode == 1) {
that.tableData = resData.result.list || [];
that.total = resData.result.total;
return false;
}
errMsg.errorMsg(resData);
})
.catch(function(error) {
that.$message.error({
duration: 1000,
message: error.message
});
});
},
/**
* 选择企业
*/
selectEnterprise(item) {
const that = this;
that.getGicData(item);
},
getGicData(item) {
const that = this;
let para = {
enterpriseId: item.enterpriseId, //
wxEnterpriseId: item.wxEnterpriseId, //
version: item.version
};
getRequest('/haoban-web/wx-enterprise-bind', para)
.then(res => {
let resData = res.data;
if (resData.errorCode == 1) {
that.tableData = resData.result.list || [];
that.total = resData.result.total;
return false;
}
errMsg.errorMsg(resData);
})
.catch(function(error) {
that.$message.error({
duration: 1000,
message: error.message
});
});
},
getWxData(item) {
const that = this;
let para = {
enterpriseId: item.enterpriseId, //
wxEnterpriseId: item.wxEnterpriseId, //
version: item.version
};
getRequest('/haoban-web/wx-enterprise-bind', para)
.then(res => {
let resData = res.data;
if (resData.errorCode == 1) {
that.tableData = resData.result.list || [];
that.total = resData.result.total;
return false;
}
errMsg.errorMsg(resData);
})
.catch(function(error) {
that.$message.error({
duration: 1000,
message: error.message
});
});
},
/**
* 新增
*/
showAddDialog() {
const that = this;
that.addShow = true;
},
refreshData() {
const that = this;
that.addShow = false;
},
/**
* 跳转回收站 * 跳转回收站
*/ */
toRecycle() { toRecycle() {
...@@ -152,7 +260,10 @@ export default { ...@@ -152,7 +260,10 @@ export default {
document.documentElement.style.backgroundColor = '#fff'; document.documentElement.style.backgroundColor = '#fff';
}, },
components: { components: {
navCrumb navCrumb,
addEnterprise,
orgTree,
wxTree
} }
}; };
</script> </script>
...@@ -184,6 +295,13 @@ export default { ...@@ -184,6 +295,13 @@ export default {
.right-box { .right-box {
min-height: 500px; min-height: 500px;
padding: 0px; padding: 0px;
.save-body {
width: 100%;
height: 120px;
padding: 32px 0 22px 0;
background: #fff;
box-sizing: border-box;
}
.apps-content { .apps-content {
.apps-content-left { .apps-content-left {
width: 50%; width: 50%;
...@@ -269,7 +387,7 @@ export default { ...@@ -269,7 +387,7 @@ export default {
} }
.gic-content-depart { .gic-content-depart {
position: relative; position: relative;
padding: 0 20px; padding: 20px;
box-sizing: border-box; box-sizing: border-box;
} }
} }
...@@ -284,6 +402,10 @@ export default { ...@@ -284,6 +402,10 @@ export default {
padding: 0 20px; padding: 0 20px;
box-sizing: border-box; box-sizing: border-box;
border-bottom: 1px solid #e4e7ed; border-bottom: 1px solid #e4e7ed;
.content-wx {
padding: 20px;
box-sizing: border-box;
}
} }
} }
} }
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
* @Author: 无尘 * @Author: 无尘
* @Date: 2019-03-20 14:36:37 * @Date: 2019-03-20 14:36:37
* @LastEditors : 无尘 * @LastEditors : 无尘
* @LastEditTime : 2020-02-13 11:08:44 * @LastEditTime : 2020-02-17 15:03:54
--> -->
<template> <template>
<div class="my-customer-wrap common-set-wrap"> <div class="my-customer-wrap common-set-wrap">
...@@ -22,22 +22,24 @@ ...@@ -22,22 +22,24 @@
</div> </div>
</div> </div>
<div class="table-condition-search m-t-20"> <div class="table-condition-search m-t-20">
<el-input placeholder="请输入部门名称/CODE/ID" v-model="searchInput" class="w-293" @keyup.native="value => toInput(value, searchInput)" clearable @clear="clearInput"></el-input> <el-input placeholder="请输入部门名称/CODE/ID" v-model="searchInput" class="w-293" @keyup.native="value => toInput(value, searchInput)" clearable @clear="clearInput"> </el-input
<el-select class="w-191" v-model="searchType" placeholder="所有部门类型" @change="changeType"> ><el-select class="w-191 m-l-10" v-model="searchType" placeholder="所有部门类型" @change="changeType">
<el-option v-for="item in options" :key="item.id" :label="item.label" :value="item.id"> </el-option> <el-option v-for="item in options" :key="item.id" :label="item.label" :value="item.id"> </el-option>
</el-select> </el-select>
</div> </div>
<div class="m-t-20"> <div class="m-t-20">
<el-table class="select-table" ref="multipleTable" :data="tableData" tooltip-effect="dark" :style="{ width: '100%', minHeight: tableH }"> <el-table class="select-table" ref="multipleTable" :data="tableData" tooltip-effect="dark" :style="{ width: '100%', minHeight: tableH }">
<el-table-column label="部门名称" show-overflow-tooltip> <el-table-column label="部门名称" show-overflow-tooltip>
<template slot-scope="scope">{{ scope.row.departmentName || '--' }}</template> <template slot-scope="scope"
><span class="iconfont icondianpu-kuai color-2f54eb"></span><span class="p-l-10">{{ scope.row.departmentName || '--' }}</span></template
>
</el-table-column> </el-table-column>
<el-table-column prop="" label="ERP CODE" show-overflow-tooltip> <el-table-column prop="" label="ERP CODE" show-overflow-tooltip>
<template slot-scope="scope">{{ scope.row.storeCode || '--' }}</template> <template slot-scope="scope">{{ scope.row.storeCode || '--' }}</template>
</el-table-column> </el-table-column>
<el-table-column prop="" label="操作" show-overflow-tooltip> <el-table-column prop="" label="操作" show-overflow-tooltip>
<template slot-scope="scope"> <template slot-scope="scope">
<el-button type="text" size="small" @click="showDetail(scope.$index, scope.row)">恢复</el-button> <el-button type="text" size="small" @click="toRecover(scope.$index, scope.row)">恢复</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
...@@ -48,12 +50,14 @@ ...@@ -48,12 +50,14 @@
</div> </div>
</div> </div>
</div> </div>
<set-department v-if="setVisible" @closeSet="closeSet"></set-department>
</div> </div>
<vue-gic-footer></vue-gic-footer> <vue-gic-footer></vue-gic-footer>
</div> </div>
</template> </template>
<script> <script>
import navCrumb from '@/components/nav/nav.vue'; import navCrumb from '@/components/nav/nav.vue';
import setDepartment from '@/components/company/set-department.vue';
import { getRequest } from '@/api/api'; import { getRequest } from '@/api/api';
import errMsg from '@/common/js/error'; import errMsg from '@/common/js/error';
import { _debounce } from '@/common/js/public'; import { _debounce } from '@/common/js/public';
...@@ -80,12 +84,26 @@ export default { ...@@ -80,12 +84,26 @@ export default {
currentPage: 1, currentPage: 1,
pageSize: 20, pageSize: 20,
total: 0, total: 0,
tableData: [] tableData: [],
setVisible: true
}; };
}, },
computed: {}, computed: {},
methods: { methods: {
/** /**
* 恢复
*/
toRecover() {
const that = this;
that.setVisible = true;
},
closeSet() {
const that = this;
that.setVisible = false;
that.currentPage = 1;
that.getTableList();
},
/**
* 路由跳转 * 路由跳转
*/ */
changeRoute(path) { changeRoute(path) {
...@@ -180,7 +198,8 @@ export default { ...@@ -180,7 +198,8 @@ export default {
document.documentElement.style.backgroundColor = '#fff'; document.documentElement.style.backgroundColor = '#fff';
}, },
components: { components: {
navCrumb navCrumb,
setDepartment
} }
}; };
</script> </script>
......
...@@ -395,6 +395,9 @@ input:focus { ...@@ -395,6 +395,9 @@ input:focus {
.p-45 { .p-45 {
padding: 45px; padding: 45px;
} }
.p-l-5 {
padding-left: 5px;
}
.p-l-6 { .p-l-6 {
padding-left: 6px; padding-left: 6px;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment