|
|
@@ -52,9 +52,7 @@
|
|
|
<el-form ref="form" :rules="rules" :model="form" label-position="left" label-width="120px">
|
|
|
<el-form-item label="选择用户" prop="labelName">
|
|
|
<el-select v-model="form.labelName" placeholder="请选择,支持关键词搜索" clearable filterable>
|
|
|
- <el-option label="321" value="3"></el-option>
|
|
|
- <el-option label="321" value="3"></el-option>
|
|
|
- <el-option label="321" value="3"></el-option>
|
|
|
+ <el-option v-for="(item, index) in userList" :label="item.name" :value="item.id" :key="item.id"></el-option>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
|
|
|
@@ -72,6 +70,7 @@
|
|
|
<script>
|
|
|
import templateTable from "@/components/templateTable.vue";
|
|
|
import * as api from '@/api/customerManage/wechatCustomer'
|
|
|
+import {customerUnbindUser} from "@/api/customerManage/wechatCustomer";
|
|
|
|
|
|
export default {
|
|
|
components: {
|
|
|
@@ -89,7 +88,9 @@ export default {
|
|
|
pageNum:1,
|
|
|
pageSize:10,
|
|
|
},//页面检索对象
|
|
|
- form: {},//提交表单
|
|
|
+ form: {
|
|
|
+ labelName: ''
|
|
|
+ },//提交表单
|
|
|
rules: {
|
|
|
labelName: [
|
|
|
{
|
|
|
@@ -101,33 +102,27 @@ export default {
|
|
|
|
|
|
},
|
|
|
Result: {
|
|
|
- content: [
|
|
|
- {
|
|
|
- name: "3232",
|
|
|
- status: true
|
|
|
- },
|
|
|
- {
|
|
|
- name: "3232",
|
|
|
- status: false
|
|
|
- }
|
|
|
- ],
|
|
|
- totalSize: 100,
|
|
|
+ rows: [],
|
|
|
+ total: 100,
|
|
|
},
|
|
|
Columns: [
|
|
|
- { prop: "name", label: "openid", minWidth: 180, },
|
|
|
- { prop: "name", label: "用户ID", minWidth: 180, },
|
|
|
- { prop: "mobile", label: "微信昵称", minWidth: 160 },
|
|
|
- { prop: "userId", label: "手机号码", minWidth: 120 },
|
|
|
- { prop: "deptName", label: "头像URL", minWidth: 160 },
|
|
|
- { prop: "type", label: "绑定时间", minWidth: 160, formatter: this.typeFormatter },
|
|
|
- { prop: "originalLevel", label: "状态", minWidth: 160, formatter: this.originalLevelFormatter },
|
|
|
- { prop: "originalLevel1", label: "最后同步时间", minWidth: 160, },
|
|
|
+ { prop: "wxOpenid", label: "openid", minWidth: 180, },
|
|
|
+ { prop: "userCode", label: "用户ID", minWidth: 180, },
|
|
|
+ { prop: "wxNickname", label: "微信昵称", minWidth: 160 },
|
|
|
+ { prop: "wxPhone", label: "手机号码", minWidth: 120 },
|
|
|
+ { prop: "wxAvatar", label: "头像URL", minWidth: 160 },
|
|
|
+ { prop: "bindTime", label: "绑定时间", minWidth: 160, formatter: this.typeFormatter },
|
|
|
+ { prop: "status", label: "状态", minWidth: 160, formatter: this.originalLevelFormatter },
|
|
|
+ { prop: "createTime", label: "最后同步时间", minWidth: 160, },
|
|
|
|
|
|
],
|
|
|
+ userList: [],
|
|
|
+ userId: ''
|
|
|
}
|
|
|
},
|
|
|
// 生命周期函数
|
|
|
created() {
|
|
|
+ this.initUserList()
|
|
|
},
|
|
|
// 方法函数
|
|
|
methods: {
|
|
|
@@ -140,9 +135,16 @@ export default {
|
|
|
},
|
|
|
// 操作用户
|
|
|
userOperation() {
|
|
|
+ let that = this
|
|
|
this.$refs['form'].validate((valid) => {
|
|
|
if (valid) {
|
|
|
- console.log(valid)
|
|
|
+ api.customerBindUser(that.userId, that.form.labelName).then(res => {
|
|
|
+ if(res.code == 200) {
|
|
|
+ this.$message.success(res.msg)
|
|
|
+ this.findPage()
|
|
|
+ }
|
|
|
+ this.userBindingShow = false
|
|
|
+ })
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
@@ -157,23 +159,45 @@ export default {
|
|
|
cancelButtonText: '取消',
|
|
|
dangerouslyUseHTMLString: true,
|
|
|
}).then(() => {
|
|
|
- this.$message({
|
|
|
- type: 'success',
|
|
|
- message: '删除成功!'
|
|
|
- });
|
|
|
+ api.customerUnbindUser(row.id).then(res => {
|
|
|
+ if(res.code == 200) {
|
|
|
+ this.$message.success(res.msg)
|
|
|
+ this.findPage()
|
|
|
+ }
|
|
|
+ })
|
|
|
+ // this.$message({
|
|
|
+ // type: 'success',
|
|
|
+ // message: '删除成功!'
|
|
|
+ // });
|
|
|
}).catch(() => {
|
|
|
|
|
|
});
|
|
|
} else {
|
|
|
this.userBindingShow = true;
|
|
|
-
|
|
|
+ this.userId = row.id
|
|
|
}
|
|
|
- }, //列表查询
|
|
|
+ },
|
|
|
+ initUserList() {
|
|
|
+ api.userList(localStorage.getItem('username')).then(res => {
|
|
|
+ if(res.code == 200) {
|
|
|
+ this.userList = res.data
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ //列表查询
|
|
|
findPage() {
|
|
|
api.findWeCustomerUserList(this.query).then((res)=>{
|
|
|
- console.log(res)
|
|
|
+ if(res.code == 200) {
|
|
|
+ this.Result = {
|
|
|
+ rows: res.rows,
|
|
|
+ total: res.total
|
|
|
+ }
|
|
|
+ }
|
|
|
})
|
|
|
},
|
|
|
+ originalLevelFormatter(row,column){
|
|
|
+ return row.status==0?'未绑定':'已绑定'
|
|
|
+ },
|
|
|
// 同步用户
|
|
|
syncUser() {
|
|
|
|