同步成员
This commit is contained in:
@@ -92,9 +92,8 @@
|
|||||||
</el-button>
|
</el-button>
|
||||||
<ai-import :instance="instance" :dict="dict" v-if="tabIndex === 0" type="wxcp/wxuser" name="内部通讯录"
|
<ai-import :instance="instance" :dict="dict" v-if="tabIndex === 0" type="wxcp/wxuser" name="内部通讯录"
|
||||||
:importParams="{departmentId:search.departmentId}" @success="getList"/>
|
:importParams="{departmentId:search.departmentId}" @success="getList"/>
|
||||||
<el-button size="small" icon="iconfont iconUpdate_Files" v-if="tabIndex === 0" :loading="btnLoading"
|
<el-button size="small" icon="iconfont iconUpdate_Files" v-if="tabIndex === 0" :loading="btnLoading" @click="syncMembers">同步部门</el-button>
|
||||||
@click="syncMembers">同步数据
|
<el-button size="small" icon="iconfont iconUpdate_Files" v-if="tabIndex === 0" :loading="btnLoading" @click="syncUser">同步成员</el-button>
|
||||||
</el-button>
|
|
||||||
<ai-wechat-selecter refs="addTags" :instance="instance" v-model="users" @change="onChooseUser"
|
<ai-wechat-selecter refs="addTags" :instance="instance" v-model="users" @change="onChooseUser"
|
||||||
:disabled="currIndex < 0" v-if="tabIndex === 1">
|
:disabled="currIndex < 0" v-if="tabIndex === 1">
|
||||||
<el-button size="small" :disabled="currIndex < 0" type="primary" icon="iconfont iconAdd">添加成员</el-button>
|
<el-button size="small" :disabled="currIndex < 0" type="primary" icon="iconfont iconAdd">添加成员</el-button>
|
||||||
@@ -505,25 +504,13 @@ export default {
|
|||||||
},
|
},
|
||||||
|
|
||||||
syncMembers() {
|
syncMembers() {
|
||||||
let departId = this.search.departmentId;
|
|
||||||
if (!departId) departId = 1;
|
|
||||||
this.btnLoading = true
|
this.btnLoading = true
|
||||||
|
|
||||||
this.instance.post(`/app/wxcp/wxdepartment/syncDepart`).then(res => {
|
this.instance.post(`/app/wxcp/wxdepartment/syncDepart`).then(res => {
|
||||||
if (res.code == 0) {
|
if (res.code == 0) {
|
||||||
this.instance.post(`/app/wxcp/wxdepartment/syncUser?departmentId=${departId}`, null, {
|
this.$message.success('同步成功')
|
||||||
timeout: 1000000
|
this.getList()
|
||||||
}).then(res => {
|
this.getTree()
|
||||||
if (res.code == 0) {
|
|
||||||
this.$message.success('同步成功')
|
|
||||||
this.getList()
|
|
||||||
this.getTree()
|
|
||||||
}
|
|
||||||
|
|
||||||
this.btnLoading = false
|
|
||||||
}).catch(() => {
|
|
||||||
this.btnLoading = false
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}).catch(() => {
|
}).catch(() => {
|
||||||
@@ -531,6 +518,26 @@ export default {
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
|
syncUser() {
|
||||||
|
let departId = this.search.departmentId;
|
||||||
|
if (!departId) departId = 1;
|
||||||
|
this.btnLoading = true
|
||||||
|
|
||||||
|
this.instance.post(`/app/wxcp/wxdepartment/syncUser?departmentId=${departId}`, null, {
|
||||||
|
timeout: 1000000
|
||||||
|
}).then(res => {
|
||||||
|
if (res.code == 0) {
|
||||||
|
this.$message.success('同步成功')
|
||||||
|
this.getList()
|
||||||
|
this.getTree()
|
||||||
|
}
|
||||||
|
|
||||||
|
this.btnLoading = false
|
||||||
|
}).catch(() => {
|
||||||
|
this.btnLoading = false
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
getTags() {
|
getTags() {
|
||||||
this.instance.post(`/app/wxcp/wxtag/listAll`).then(res => {
|
this.instance.post(`/app/wxcp/wxtag/listAll`).then(res => {
|
||||||
if (res.code == 0) {
|
if (res.code == 0) {
|
||||||
|
|||||||
Reference in New Issue
Block a user