From dbab45ef6e56c32ca3b2d286ec5cb7ed0c86bfea Mon Sep 17 00:00:00 2001
From: charles <981744753@qq.com>
Date: 星期四, 18 七月 2024 21:57:21 +0800
Subject: [PATCH] feat:实现crm与aps共用token
---
src/views/other/payment/collectionPlan/AddCollectionPlan.vue | 31 +++++++++++++++++++++++++++----
1 files changed, 27 insertions(+), 4 deletions(-)
diff --git a/src/views/other/payment/collectionPlan/AddCollectionPlan.vue b/src/views/other/payment/collectionPlan/AddCollectionPlan.vue
index e1eea7a..25b144d 100644
--- a/src/views/other/payment/collectionPlan/AddCollectionPlan.vue
+++ b/src/views/other/payment/collectionPlan/AddCollectionPlan.vue
@@ -198,7 +198,7 @@
amount: 130,
sourceType: this.editCommonConfig.sourceType, // 婧愬崟绫诲瀷 1閿�鍞槑缁�2鏈嶅姟鍚堝悓3閿�鍞彂绁�
sourceId: this.editCommonConfig.infomation.id,
- principalId: 0,
+ principalId: '',
planAmount: 0, // 璁″垝閲戦
firstDate: this.getCurrentDate(1),
collectionType: 1,
@@ -209,10 +209,24 @@
created() {
console.log(this.editCommonConfig)
this.setData()
- this.setTableForm()
this.getCommonData()
},
methods: {
+ getCookie(cookieName) {
+ var cookieValue = null;
+ if (document.cookie && document.cookie !== '') {
+ var cookies = document.cookie.split(';');
+ for (var i = 0; i < cookies.length; i++) {
+ var cookie = cookies[i].trim();
+ // 蹇界暐涓嶅畬鏁寸殑cookie
+ if (cookie.startsWith(cookieName + '=')) {
+ cookieValue = cookie.substring(cookieName.length + 1, cookie.length);
+ break;
+ }
+ }
+ }
+ return cookieValue;
+ },
// 璁剧疆鍒濆鍊�
setData() {
this.amount =
@@ -222,7 +236,8 @@
this.editConfig.infomation = {
collectionType: this.collectionType,
moneyType: "浜烘皯甯�",
- amountTotal: this.editCommonConfig.infomation.amountTotal
+ amountTotal: this.editCommonConfig.infomation.amountTotal,
+ principalId:''
}
},
getCommonData() {
@@ -231,7 +246,15 @@
console.log(res)
if (res.code === 200) {
this.memberOptions = res.data.member
+ let username =this.getCookie('username')
+ this.memberOptions.map((item) => {
+ if (item.username == username) {
+ this.$set(this.editConfig.infomation, "principalId", item.id)
+ }
+ })
+ this.principalId=this.editConfig.infomation.principalId
}
+ this.setTableForm()
})
.catch((err) => {
console.log(err)
@@ -321,7 +344,7 @@
id: 0,
moneyType: "浜烘皯甯�",
percent: ratio,
- principalId: this.principalId,
+ principalId: Number(this.principalId),
remark: "",
sourceId: this.sourceId,
sourceType: this.sourceType,
--
Gitblit v1.8.0