Commit 054fd5cf by xinlaa

组织架构删除,客户修改,企业微信授权登陆等

1 parent f061c5c0
......@@ -69,3 +69,19 @@ export function removeLabel(data) {
data
})
}
/**
* 客户生日编辑
* @param {*} data
* {
"externalUserid": "",
"birthday": ""
}
*/
export function updateBirthday(data) {
return request({
url: service,
method: 'PUT',
data
})
}
\ No newline at end of file
......@@ -51,6 +51,13 @@ export function addDepart(data) {
})
}
export function removeDepart(ids) {
return request({
url: service + '/' + ids,
method: 'DELETE',
})
}
/**
* 获取通讯录人员列表
* @param {*} params
......
......@@ -214,7 +214,18 @@ export default {
);
this.dialogVisibleDepart = true;
},
departRemove() {},
departRemove(id) {
this.$confirm("是否确认删除吗?", "警告", {
type: "warning",
})
.then(function () {
return api.removeDepart(id);
})
.then(() => {
this.getTree();
this.msgSuccess("删除成功");
});
},
departSubmit() {
api[this.formDepart.id ? "updateDepart" : "addDepart"](this.formDepart)
.then(() => {
......@@ -316,20 +327,23 @@ export default {
<span class="fr">
<i
class="el-icon-edit"
title="编辑"
v-hasPermi="['contacts:organization:editDep']"
v-if="node.level !== 1"
@click.stop="departEdit(data, 1)"
></i>
<i
class="el-icon-plus"
title="添加"
v-hasPermi="['contacts:organization:addDep']"
@click.stop="departEdit(data, 0)"
></i>
<i
class="el-icon-delete"
class="el-icon-minus"
title="删除"
v-hasPermi="['contacts:organization:removeDep']"
v-if="node.level !== 1"
@click.stop="departRemove(data)"
@click.stop="departRemove(data.id)"
></i>
</span>
</div>
......
<script>
import * as api from "@/api/customer/group";
import * as api from "@/api/customer";
export default {
name: "CustomerDetail",
......@@ -15,13 +15,11 @@ export default {
this.customer = this.$route.query;
},
methods: {
getList(page) {
page && (this.query.pageNum = page);
this.loading = false;
api.getMembers(this.query).then((response) => {
this.list = response.rows;
this.total = +response.total;
this.loading = false;
updateBirthday() {
let { externalUserid, birthday } = this.customer;
api.updateBirthday({ externalUserid, birthday }).then((response) => {
this.msgSuccess("操作成功");
this.datePickerVisible = false;
});
},
},
......@@ -37,7 +35,7 @@ export default {
<div class="mb10">
{{customer.name}}
<span
:style="{color: customer.type === 1 ? '#4bde03' : '#f9a90b'}"
:style="{color: customer.type == 1 ? '#4bde03' : '#f9a90b'}"
>{{ ({1: '@微信', 2: '@企业微信'})[customer.type] }}</span>
<i :class="['el-icon-s-custom', ({1: 'man', 2: 'woman'})[customer.gender]]"></i>
</div>
......@@ -50,7 +48,7 @@ export default {
type="date"
value-format="yyyy-MM-dd"
placeholder="选择日期便于以后客情维护"
@blur="datePickerVisible = false"
@blur="updateBirthday"
></el-date-picker>
<i v-else class="el-icon-edit" @click="datePickerVisible = true"></i>
</div>
......@@ -139,4 +137,15 @@ export default {
text-align: right;
}
}
.el-icon-s-custom {
font-size: 16px;
margin-left: 4px;
color: #999;
&.man {
color: #13a2e8;
}
&.woman {
color: #f753b2;
}
}
</style>
\ No newline at end of file
......@@ -45,15 +45,43 @@
<span v-else>登 录 中...</span>
</el-button>
</el-form-item>
<el-form-item class="ac">
<a :href="authLink">
<img
src="//wwcdn.weixin.qq.com/node/wwopen/wwopenmng/style/images/independent/brand/300x40_white$4dab5411.png"
srcset="//wwcdn.weixin.qq.com/node/wwopen/wwopenmng/style/images/independent/brand/300x40_white_2x$6a1f5234.png 2x"
alt="企业微信登录"
/>
</a>
</el-form-item>
</el-form>
<!-- 底部 -->
<div class="el-login-footer">
<span>Copyright © 2018-2019 LinkWechat All Rights Reserved.</span>
</div>
<el-dialog title="开源软件评选" :visible.sync="dialogVisible" width="400px" class="c">
<div>
<p>2020年度最佳人气项目开源软件评选。</p>
<p>
请为
<strong style="color: #FF0036;" class="cp" @click="goVote">LinkWeChat</strong> 投票,谢谢支持。
</p>
<div class="ac">
<img src="@/assets/image/vote-code.png" alt />
<p style="color: #FF0036;">☛☛微信扫码投票☚☚</p>
</div>
</div>
<div slot="footer">
<el-button @click="goVote">朕要支持</el-button>
<el-button type="primary" @click="dialogVisible = false">残忍拒绝</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import axios from "axios";
import { getCodeImg } from "@/api/login";
import Cookies from "js-cookie";
import { encrypt, decrypt } from "@/utils/jsencrypt";
......@@ -65,8 +93,8 @@ export default {
codeUrl: "",
cookiePassword: "",
loginForm: {
username: "admin",
password: "admin123",
username: "",
password: "",
rememberMe: false,
code: "",
uuid: "",
......@@ -84,6 +112,8 @@ export default {
},
loading: false,
redirect: undefined,
authLink: "",
dialogVisible: true,
};
},
watch: {
......@@ -94,7 +124,57 @@ export default {
immediate: true,
},
},
beforeCreate() {
// http://106.13.201.219/#/login?auth_code=xxx
console.log("routerbeforeCreate", this.$route);
// let hash = location.hash;
// let arr = hash.slice(hash.indexOf("?")).split("=");
if (!this.$route.auth_code) {
return;
}
getUserInfo.call(this);
async function getUserInfo(params) {
// 如果授权回调
// 1、获取access_token
let res = await axios({
url: "https://qyapi.weixin.qq.com/cgi-bin/service/get_provider_token",
method: "post",
data: {
corpid: "ww24262ce93851488f",
provider_secret:
"a9DS2sqQRks46VEl6qgz1Z-U_HPwyHUuBAkp_6II9lIH5g1vO6L4VMPUGLeVT5G_",
},
});
// 2、获取用户信息
if (res.provider_access_token) {
let resUserInfo = axios({
url:
"https://qyapi.weixin.qq.com/cgi-bin/service/get_login_info?access_token=" +
res.provider_access_token,
method: "post",
data: {
auth_code: this.$route.auth_code,
},
});
if (resUserInfo.errcode == 0 && resUserInfo.errmsg === "ok") {
console.log(resUserInfo);
}
} else {
}
}
},
created() {
// console.log("routerCreated", this.$route);
let authParams = {
appid: "ww24262ce93851488f", // * 服务商的CorpID
redirect_uri: encodeURI("http://106.13.201.219/#/login"), // * 授权登录之后目的跳转网址,需要做urlencode处理。所在域名需要与授权完成回调域名一致
state: "", // ? 用于企业或服务商自行校验session,防止跨域攻击
usertype: "admin", // ? 支持登录的类型。admin代表管理员登录(使用微信扫码),member代表成员登录(使用企业微信扫码),默认为admin
};
this.authLink = `https://open.work.weixin.qq.com/wwopen/sso/3rd_qrConnect?appid=${authParams.appid}&redirect_uri=${authParams.redirect_uri}&state=${authParams.state}&usertype=${authParams.usertype}`;
this.getCode();
this.getCookie();
},
......@@ -145,6 +225,9 @@ export default {
}
});
},
goVote() {
window.open("https://www.oschina.net/p/linkwechat");
},
},
};
</script>
......@@ -210,4 +293,14 @@ export default {
.login-code-img {
height: 38px;
}
.login /deep/.el-dialog {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
margin-top: 0vh !important;
}
.el-dialog__body {
padding: 0px 20px;
}
</style>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!