Commit 054fd5cf by xinlaa

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

1 parent f061c5c0
...@@ -69,3 +69,19 @@ export function removeLabel(data) { ...@@ -69,3 +69,19 @@ export function removeLabel(data) {
data data
}) })
} }
/**
* 客户生日编辑
* @param {*} data
* {
"externalUserid": "",
"birthday": ""
}
*/
export function updateBirthday(data) {
return request({
url: service,
method: 'PUT',
data
})
}
\ No newline at end of file \ No newline at end of file
...@@ -51,6 +51,13 @@ export function addDepart(data) { ...@@ -51,6 +51,13 @@ export function addDepart(data) {
}) })
} }
export function removeDepart(ids) {
return request({
url: service + '/' + ids,
method: 'DELETE',
})
}
/** /**
* 获取通讯录人员列表 * 获取通讯录人员列表
* @param {*} params * @param {*} params
......
...@@ -214,7 +214,18 @@ export default { ...@@ -214,7 +214,18 @@ export default {
); );
this.dialogVisibleDepart = true; this.dialogVisibleDepart = true;
}, },
departRemove() {}, departRemove(id) {
this.$confirm("是否确认删除吗?", "警告", {
type: "warning",
})
.then(function () {
return api.removeDepart(id);
})
.then(() => {
this.getTree();
this.msgSuccess("删除成功");
});
},
departSubmit() { departSubmit() {
api[this.formDepart.id ? "updateDepart" : "addDepart"](this.formDepart) api[this.formDepart.id ? "updateDepart" : "addDepart"](this.formDepart)
.then(() => { .then(() => {
...@@ -316,20 +327,23 @@ export default { ...@@ -316,20 +327,23 @@ export default {
<span class="fr"> <span class="fr">
<i <i
class="el-icon-edit" class="el-icon-edit"
title="编辑"
v-hasPermi="['contacts:organization:editDep']" v-hasPermi="['contacts:organization:editDep']"
v-if="node.level !== 1" v-if="node.level !== 1"
@click.stop="departEdit(data, 1)" @click.stop="departEdit(data, 1)"
></i> ></i>
<i <i
class="el-icon-plus" class="el-icon-plus"
title="添加"
v-hasPermi="['contacts:organization:addDep']" v-hasPermi="['contacts:organization:addDep']"
@click.stop="departEdit(data, 0)" @click.stop="departEdit(data, 0)"
></i> ></i>
<i <i
class="el-icon-delete" class="el-icon-minus"
title="删除"
v-hasPermi="['contacts:organization:removeDep']" v-hasPermi="['contacts:organization:removeDep']"
v-if="node.level !== 1" v-if="node.level !== 1"
@click.stop="departRemove(data)" @click.stop="departRemove(data.id)"
></i> ></i>
</span> </span>
</div> </div>
......
<script> <script>
import * as api from "@/api/customer/group"; import * as api from "@/api/customer";
export default { export default {
name: "CustomerDetail", name: "CustomerDetail",
...@@ -15,13 +15,11 @@ export default { ...@@ -15,13 +15,11 @@ export default {
this.customer = this.$route.query; this.customer = this.$route.query;
}, },
methods: { methods: {
getList(page) { updateBirthday() {
page && (this.query.pageNum = page); let { externalUserid, birthday } = this.customer;
this.loading = false; api.updateBirthday({ externalUserid, birthday }).then((response) => {
api.getMembers(this.query).then((response) => { this.msgSuccess("操作成功");
this.list = response.rows; this.datePickerVisible = false;
this.total = +response.total;
this.loading = false;
}); });
}, },
}, },
...@@ -37,7 +35,7 @@ export default { ...@@ -37,7 +35,7 @@ export default {
<div class="mb10"> <div class="mb10">
{{customer.name}} {{customer.name}}
<span <span
:style="{color: customer.type === 1 ? '#4bde03' : '#f9a90b'}" :style="{color: customer.type == 1 ? '#4bde03' : '#f9a90b'}"
>{{ ({1: '@微信', 2: '@企业微信'})[customer.type] }}</span> >{{ ({1: '@微信', 2: '@企业微信'})[customer.type] }}</span>
<i :class="['el-icon-s-custom', ({1: 'man', 2: 'woman'})[customer.gender]]"></i> <i :class="['el-icon-s-custom', ({1: 'man', 2: 'woman'})[customer.gender]]"></i>
</div> </div>
...@@ -50,7 +48,7 @@ export default { ...@@ -50,7 +48,7 @@ export default {
type="date" type="date"
value-format="yyyy-MM-dd" value-format="yyyy-MM-dd"
placeholder="选择日期便于以后客情维护" placeholder="选择日期便于以后客情维护"
@blur="datePickerVisible = false" @blur="updateBirthday"
></el-date-picker> ></el-date-picker>
<i v-else class="el-icon-edit" @click="datePickerVisible = true"></i> <i v-else class="el-icon-edit" @click="datePickerVisible = true"></i>
</div> </div>
...@@ -139,4 +137,15 @@ export default { ...@@ -139,4 +137,15 @@ export default {
text-align: right; text-align: right;
} }
} }
.el-icon-s-custom {
font-size: 16px;
margin-left: 4px;
color: #999;
&.man {
color: #13a2e8;
}
&.woman {
color: #f753b2;
}
}
</style> </style>
\ No newline at end of file \ No newline at end of file
...@@ -45,15 +45,43 @@ ...@@ -45,15 +45,43 @@
<span v-else>登 录 中...</span> <span v-else>登 录 中...</span>
</el-button> </el-button>
</el-form-item> </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> </el-form>
<!-- 底部 --> <!-- 底部 -->
<div class="el-login-footer"> <div class="el-login-footer">
<span>Copyright © 2018-2019 LinkWechat All Rights Reserved.</span> <span>Copyright © 2018-2019 LinkWechat All Rights Reserved.</span>
</div> </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> </div>
</template> </template>
<script> <script>
import axios from "axios";
import { getCodeImg } from "@/api/login"; import { getCodeImg } from "@/api/login";
import Cookies from "js-cookie"; import Cookies from "js-cookie";
import { encrypt, decrypt } from "@/utils/jsencrypt"; import { encrypt, decrypt } from "@/utils/jsencrypt";
...@@ -65,8 +93,8 @@ export default { ...@@ -65,8 +93,8 @@ export default {
codeUrl: "", codeUrl: "",
cookiePassword: "", cookiePassword: "",
loginForm: { loginForm: {
username: "admin", username: "",
password: "admin123", password: "",
rememberMe: false, rememberMe: false,
code: "", code: "",
uuid: "", uuid: "",
...@@ -84,6 +112,8 @@ export default { ...@@ -84,6 +112,8 @@ export default {
}, },
loading: false, loading: false,
redirect: undefined, redirect: undefined,
authLink: "",
dialogVisible: true,
}; };
}, },
watch: { watch: {
...@@ -94,7 +124,57 @@ export default { ...@@ -94,7 +124,57 @@ export default {
immediate: true, 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() { 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.getCode();
this.getCookie(); this.getCookie();
}, },
...@@ -145,6 +225,9 @@ export default { ...@@ -145,6 +225,9 @@ export default {
} }
}); });
}, },
goVote() {
window.open("https://www.oschina.net/p/linkwechat");
},
}, },
}; };
</script> </script>
...@@ -210,4 +293,14 @@ export default { ...@@ -210,4 +293,14 @@ export default {
.login-code-img { .login-code-img {
height: 38px; 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> </style>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!