Selaa lähdekoodia

Merge branch 'master' of http://47.100.37.243:10191/wutt/manHourHousekeeper

zhouyy 4 kuukautta sitten
vanhempi
commit
5890dda47f

+ 3 - 0
fhKeeper/formulahousekeeper/customerBuler-crm-h5/index.html

@@ -5,6 +5,9 @@
     <link rel="icon" type="image/svg+xml" href="/vite.svg" />
     <meta name="viewport" content="width=device-width, initial-scale=1.0" />
     <title>客户管家</title>
+    <script src="https://res.wx.qq.com/open/js/jweixin-1.2.0.js" referrerpolicy="origin"></script>
+    <script src="https://open.work.weixin.qq.com/wwopen/js/jwxwork-1.0.0.js" referrerpolicy="origin"></script>
+    <script src="https://s.url.cn/qqun/qun/qqweb/m/qun/confession/js/vconsole.min.js "></script>
   </head>
   <body>
     <div id="app"></div>

+ 4 - 4
fhKeeper/formulahousekeeper/customerBuler-crm-h5/src/components/common/translationComponent.vue

@@ -1,15 +1,15 @@
 <template>
-  <template v-if="userInfo.userNameNeedTranslate == 1">
-    <!-- <template v-if="Array.isArray(openId)">
+  <template v-if="userInfo.userInfo.userNameNeedTranslate == 1">
+    <template v-if="Array.isArray(openId)">
       <template v-for="(item, index) in openId">
         <ww-open-data :type='type' :openid='item'></ww-open-data>
         <span v-if="index < openId.length - 1">,</span>
       </template>
     </template>
-    <ww-open-data :type='type' :openid='openId' v-else></ww-open-data> -->
+    <ww-open-data :type='type' :openid='openId' v-else></ww-open-data>
   </template>
   <template v-else>
-    {{ Array.isArray(openId) ? openId.join(',') : openId }} 😔
+    {{ Array.isArray(openId) ? openId.join(',') : openId }}
   </template>
 </template>
 

+ 8 - 3
fhKeeper/formulahousekeeper/customerBuler-crm-h5/src/pages/login.vue

@@ -37,6 +37,9 @@ const isWX = ref(false)
 useLifecycle({
   load: () => {
     verifyLoginEnvironment()
+  },
+  init: () => {
+    verifyLoginEnvironment()
   }
 });
 
@@ -46,7 +49,7 @@ function verifyLoginEnvironment() {
   isWX.value = currentEnvironment.indexOf("micromessenger") > 0 ? true : false
   const href = window.location.href;
   if (href.indexOf("userId") > 0) {
-    const loginUserId = href.substring(href.indexOf("userId=") + "userId=".length);
+    let loginUserId = href.substring(href.indexOf("userId=") + "userId=".length);
     if (loginUserId.includes('#/')) {
       loginUserId = loginUserId.substring(0, loginUserId.indexOf('#/'));
     }
@@ -62,7 +65,7 @@ function verifyLoginEnvironment() {
           tryAutoLogin()
         } else {
           //后台经过验证后,重定向过来带上了userId
-          const loginUserId = href.substring(href.indexOf("userId=") + "userId=".length);
+          let loginUserId = href.substring(href.indexOf("userId=") + "userId=".length);
           if (loginUserId.includes('#/')) {
             loginUserId = loginUserId.substring(0, loginUserId.indexOf('#/'));
           }
@@ -84,7 +87,8 @@ function onSubmit(fromVal) {
 // userId登录
 function loginByUserId(userId) {
   toastLoading('登陆中...', 0)
-  requests.post(USER_ID_LOGIN, { params: { userId } }).then(({ data }) => {
+  // requests.post(USER_ID_LOGIN, { params: { userId } }).then(({ data }) => {
+  requests.post(USER_ID_LOGIN, {  userId }).then(({ data }) => {
     loginProcessing(data)
   })
 }
@@ -133,6 +137,7 @@ function bindIfNessary() {
 
 // 登陆前的处理
 function loginProcessing(data = {}) {
+  sessionStorage.setItem('token', data.id)
   userInfo.updateState({
     userInfo: data,
     token: data.id,

+ 11 - 7
fhKeeper/formulahousekeeper/customerBuler-crm-h5/src/pages/moduleList/moduleList.vue

@@ -176,12 +176,16 @@
                             <img src="/src/assets/image/noTopMounted.png" class="w-full h-full">
                           </div>
                         </template>
-                        <div class="buttonCircle rounded-full" @click="edit(item)">
-                          <img src="/src/assets/image/edit.png" class="w-full h-full">
-                        </div>
-                        <div class="buttonCircle rounded-full" @click="deleteRow(item)">
-                          <img src="/src/assets/image/delete.png" class="w-full h-full">
-                        </div>
+                        <template v-permission="[queryParameters?.jurisdiction?.edit]">
+                          <div class="buttonCircle rounded-full" @click="edit(item)" >
+                            <img src="/src/assets/image/edit.png" class="w-full h-full">
+                          </div>
+                        </template>
+                        <template v-permission="[queryParameters?.jurisdiction?.delete]">
+                          <div class="buttonCircle rounded-full" @click="deleteRow(item)" >
+                            <img src="/src/assets/image/delete.png" class="w-full h-full">
+                          </div>
+                        </template>
                       </div>
                     </template>
                   </van-swipe-cell>
@@ -197,7 +201,7 @@
 
       <!-- 可拖拽添加 -->
       <DragBox>
-        <div class="addButton" @click="toAddEditor()">
+        <div class="addButton" @click="toAddEditor()" v-permission="[queryParameters?.jurisdiction?.newlyAdded]">
           <img src="/src/assets/image/add.png" class="w-full h-full" />
         </div>
       </DragBox>

+ 4 - 2
fhKeeper/formulahousekeeper/customerBuler-crm-h5/src/pages/tabbar/home/component/workbench.vue

@@ -98,7 +98,7 @@
     </div>
 
     <!-- 常用联系人 -->
-    <div class="mt-3">
+    <div class="mt-3" v-if="displayFrequentlyUsedContacts">
       <div class="text-size-large text-[#000] pl16">常用联系人</div>
       <div class="p16 pt-0 pb-0">
         <template v-for="item in topContactsList">
@@ -183,6 +183,7 @@ const showCommonForms = ref(false)
 const commonExpressionsHaveBeenAdded = ref([])
 const commonExpressionsHaveBeenNodded = ref([])
 const areYouRequesting = ref(false)
+const displayFrequentlyUsedContacts = ref(false)
 
 function toContactDetails(item) {
   router.navigateTo({
@@ -291,7 +292,7 @@ function processForms() {
   )
 
   commonExpressionsHaveBeenNodded.value = allFormList.filter(item =>
-    selectedForm.some(arrItem => arrItem.path !== item.path)
+    !selectedForm.some(arrItem => arrItem.path === item.path)
   )
 }
 
@@ -325,6 +326,7 @@ function getAllData() {
   if (areYouRequesting.value) {
     return
   }
+  displayFrequentlyUsedContacts.value = useInfo.modularList.filter(item => item.path === '/contacts').length
   areYouRequesting.value = true
   Promise.all([
     getVisitorPlan(),

+ 1 - 0
fhKeeper/formulahousekeeper/customerBuler-crm-h5/src/pages/tabbar/my/index.vue

@@ -43,6 +43,7 @@ function signOut() {
     success: () => {
       localStorage.clear()
       sessionStorage.clear()
+      window.location.reload();
     }
   })
 }

+ 7 - 1
fhKeeper/formulahousekeeper/customerBuler-crm-h5/src/utility/corpWXparam.js

@@ -4,7 +4,8 @@ const wxTokenUrl = 'http://mobworktime.ttkuaiban.com/api/wechat/loginByWXCode'
 const coprWxTokenUrl = 'http://worktime.ttkuaiban.com/api/corpWXAuth'
 
 export const WX_APPID = 'wx749c84daac654e1e' // 微信appId
-export const CORP_WX_APPID = 'ww4e237fd6abb635af' // 企业微信appId
+// export const CORP_WX_APPID = 'ww4e237fd6abb635af' // 企业微信appId
+export const CORP_WX_APPID = 'wwdd1137a65ce0fc87' // 企业微信appId
 
 /**
  * 企业微信重定向地址
@@ -25,6 +26,7 @@ export function obtainEnterpriseWeChatParameters(data = {}) {
   const token = data.id
   const curUrl = window.location.href.split('#')[0]
   requests.post(`/wxcorp/getCorpWXConfig`, { url: curUrl, token }).then((res) => {
+    console.log(res, '<====== 返回的参数 /wxcorp/getCorpWXConfig')
     wx.config({
       beta: true,
       debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
@@ -38,6 +40,7 @@ export function obtainEnterpriseWeChatParameters(data = {}) {
     wx.ready(function () {
       // config信息验证后会执行ready方法,所有接口调用都必须在config接口获得结果之后,config是一个客户端的异步操作,所以如果需要在页面加载时就调用相关接口,则须把相关接口放在ready函数中调用来确保正确执行。对于用户触发时才调用的接口,则可以直接调用,不需要放在ready函数中。
       requests.post(`/wxcorp/getCorpWXAgentConfig`, { url: curUrl, token }).then((res) => {
+        console.log(res, '<====== 返回的参数 /wxcorp/getCorpWXAgentConfig')
         wx.agentConfig({
           corpid: res.data.corpid, // 必填,企业微信的corpid,必须与当前登录的企业一致
           agentid: res.data.agentid, // 必填,企业微信的应用id (e.g. 1000247)
@@ -46,16 +49,19 @@ export function obtainEnterpriseWeChatParameters(data = {}) {
           signature: res.data.signature, // 必填,签名,见附录-JS-SDK使用权限签名算法
           jsApiList: ['selectExternalContact', 'openThirdAppServiceChat', 'openAppManage'], //必填,传入需要使用的接口名称
           success: function (result) {
+            console.log(result, '《+========== 成功1')
             //  wx.agentConfig成功回调后,WWOpenData 才会注入到 window 对象上面
             window.WWOpenData.bind(document.querySelector('ww-open-data'))
           },
           fail: function (res) {
+            console.log(res, '<===== 失败1')
             if (res.errMsg.indexOf('function not exist') > -1) {
               alert('版本过低请升级')
             }
           },
         })
       }).catch(err => {
+        console.log(err, '<===== 失败2')
         if (err.errMsg.indexOf('function not exist') > -1) {
           alert('版本过低请升级')
         }

+ 56 - 16
fhKeeper/formulahousekeeper/customerBuler-crm-h5/src/utility/generalVariables.js

@@ -12,10 +12,15 @@ export const routingInfos = {
     addEditingInterface: NEW_BUSINESS_OPPORTUNITY_EDITING, // 新增/编辑请求接口
     topMountedInterface: TOP_OF_BUSINESS_OPPORTUNITIES, // 顶置接口
     cancelTheTopMountedInterface: CANCEL_THE_TOP_PLACEMENT_OF_BUSINESS_OPPORTUNITIES, // 取消顶置接口
-    homeImage: '/src/assets/image/module/min_business.png', // 首页图片
-    moduleImage: '/src/assets/image/module/business.png', // 模块图片
+    homeImage: new URL('/src/assets/image/module/min_business.png', import.meta.url).href, // 首页图片
+    moduleImage: new URL('/src/assets/image/module/business.png', import.meta.url).href, // 模块图片
     searchFiled: { search: 'name' }, // 搜索字段
     image: '', // 图片
+    jurisdiction: { // 权限
+      newlyAdded: 'businessAddAnEdit',
+      edit: 'businessAddAnEdit',
+      delete: 'businessDelete'
+    }
   },
   'thread': {
     name: '线索',
@@ -28,10 +33,15 @@ export const routingInfos = {
     addEditingInterface: NEW_CLUE_EDITING,
     topMountedInterface: TOP_OF_CLUES,
     cancelTheTopMountedInterface: CANCEL_THE_TOP_PLACEMENT_OF_CLUES,
-    homeImage: '/src/assets/image/module/min_thread.png',
-    moduleImage: '/src/assets/image/module/thread.png',
+    homeImage: new URL('/src/assets/image/module/min_thread.png', import.meta.url).href,
+    moduleImage: new URL('/src/assets/image/module/thread.png', import.meta.url).href,
     searchFiled: { search: 'clueName' },
     image: '',
+    jurisdiction: {
+      newlyAdded: 'threadAdd',
+      edit: 'threadEdit',
+      delete: 'threadDelete'
+    }
   },
   'customer': {
     name: '客户',
@@ -44,10 +54,15 @@ export const routingInfos = {
     addEditingInterface: CUSTOMER_ADDED_EDITOR,
     topMountedInterface: CUSTOMER_TOP_MOUNTED,
     cancelTheTopMountedInterface: CUSTOMER_CANCELS_TOP_PLACEMENT,
-    homeImage: '/src/assets/image/module/min_customer.png',
-    moduleImage: '/src/assets/image/module/customer.png',
+    homeImage: new URL('/src/assets/image/module/min_customer.png', import.meta.url).href,
+    moduleImage: new URL('/src/assets/image/module/customer.png', import.meta.url).href,
     searchFiled: { search: 'customName' },
     image: '',
+    jurisdiction: {
+      newlyAdded: 'customerAdd',
+      edit: 'customerEdit',
+      delete: 'customerDelete'
+    }
   },
   'contacts': {
     name: '联系人',
@@ -60,10 +75,15 @@ export const routingInfos = {
     addEditingInterface: CONTACT_PERSON_ADDITION_EDITOR,
     topMountedInterface: CONTACT_TOP,
     cancelTheTopMountedInterface: CONTACT_PERSON_CANCELS_TOP_PLACEMENT,
-    homeImage: '/src/assets/image/module/min_contacts.png',
-    moduleImage: '/src/assets/image/module/contacts.png',
+    homeImage: new URL('/src/assets/image/module/min_contacts.png', import.meta.url).href,
+    moduleImage: new URL('/src/assets/image/module/contacts.png', import.meta.url).href,
     searchFiled: { search: 'name' },
     image: '',
+    jurisdiction: {
+      newlyAdded: 'contactsAdd',
+      edit: 'contactsEdit',
+      delete: 'contactsDelete'
+    }
   },
   'tasks': {
     name: '任务',
@@ -76,10 +96,15 @@ export const routingInfos = {
     addEditingInterface: TASK_ADD_EDIT,
     topMountedInterface: TASK_TOP,
     cancelTheTopMountedInterface: TASK_CANCELLATION_TOP,
-    homeImage: '/src/assets/image/module/min_tasks.png',
-    moduleImage: '/src/assets/image/module/tasks.png',
+    homeImage: new URL('/src/assets/image/module/min_tasks.png', import.meta.url).href,
+    moduleImage: new URL('/src/assets/image/module/tasks.png', import.meta.url).href,
     searchFiled: { search: 'taskName' },
     image: '',
+    jurisdiction: {
+      newlyAdded: 'tasksAdd',
+      edit: 'tasksEdit',
+      delete: 'tasksDelete'
+    }
   },
   'product': {
     name: '产品',
@@ -92,10 +117,15 @@ export const routingInfos = {
     addEditingInterface: PRODUCT_ADD_EDITOR,
     topMountedInterface: TOP_MOUNTED_PRODUCT,
     cancelTheTopMountedInterface: CANCEL_THE_TOP_PLACEMENT_OF_THE_PRODUCT,
-    homeImage: '/src/assets/image/module/min_product.png',
-    moduleImage: '/src/assets/image/module/product.png',
+    homeImage: new URL('/src/assets/image/module/min_product.png', import.meta.url).href,
+    moduleImage: new URL('/src/assets/image/module/product.png', import.meta.url).href,
     searchFiled: { search: 'productName' },
     image: '',
+    jurisdiction: {
+      newlyAdded: 'productAdd',
+      edit: 'productEdit',
+      delete: 'productDelete'
+    }
   },
   'contract': {
     name: '合同',
@@ -108,10 +138,15 @@ export const routingInfos = {
     addEditingInterface: CONTRACT_ADDITION_EDITING,
     topMountedInterface: TOP_OF_THE_CONTRACT,
     cancelTheTopMountedInterface: CONTRACT_CANCELLATION_WITH_TOP_PLACEMENT,
-    homeImage: '/src/assets/image/module/min_contract.png',
-    moduleImage: '/src/assets/image/module/contract.png',
+    homeImage: new URL('/src/assets/image/module/min_contract.png', import.meta.url).href,
+    moduleImage: new URL('/src/assets/image/module/contract.png', import.meta.url).href,
     searchFiled: { search: 'name' },
     image: '',
+    jurisdiction: {
+      newlyAdded: 'contractAdd',
+      edit: 'contractAdd',
+      delete: 'contractAdd'
+    }
   },
   'order': {
     name: '销售订单',
@@ -124,9 +159,14 @@ export const routingInfos = {
     addEditingInterface: ORDER_ADDITION_EDITING,
     topMountedInterface: SALES_ORDER_TOP_PLACEMENT,
     cancelTheTopMountedInterface: CANCEL_THE_TOP_PLACEMENT_OF_THE_SALES_ORDER,
-    homeImage: '/src/assets/image/module/min_order.png',
-    moduleImage: '/src/assets/image/module/order.png',
+    homeImage: new URL('/src/assets/image/module/min_order.png', import.meta.url).href,
+    moduleImage: new URL('/src/assets/image/module/order.png', import.meta.url).href,
     searchFiled: { search: 'orderName' },
     image: '',
+    jurisdiction: {
+      newlyAdded: 'orderAdd',
+      edit: 'orderEdit',
+      delete: 'orderDelete'
+    }
   }
 }

Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 4 - 4
fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/controller/WeiXinCorpController.java


Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 5 - 5
fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/service/impl/UserServiceImpl.java


+ 14 - 2
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/ProjectApprovalController.java

@@ -114,14 +114,26 @@ public class ProjectApprovalController {
             User id = userMapper.selectById(projectApproval.getInchargerId());
             projectApproval.setInchargerName(id.getName());
         }
-        if(!StringUtils.isEmpty(projectApproval.getProjectCode())){
+        if (projectApproval.getId() != null) {
+            //编辑
             Integer count=projectMapper.selectCount(new LambdaQueryWrapper<Project>().eq(Project::getCompanyId, companyId).eq(Project::getProjectCode, projectApproval.getProjectCode()));
-            Integer count1=projectApprovalService.count(new LambdaQueryWrapper<ProjectApproval>().eq(ProjectApproval::getCompanyId, companyId).eq(ProjectApproval::getProjectCode, projectApproval.getProjectCode()));
+            Integer count1=projectApprovalService.count(new LambdaQueryWrapper<ProjectApproval>().eq(ProjectApproval::getCompanyId, companyId).eq(ProjectApproval::getProjectCode, projectApproval.getProjectCode()).ne(ProjectApproval::getId,projectApproval.getId()));
             if(count>0||count1>0){
                 msg.setError("已存在项目编号为["+projectApproval.getProjectCode()+"]的项目/立项");
                 return msg;
             }
+        } else {
+            //新增
+            if(!StringUtils.isEmpty(projectApproval.getProjectCode())){
+                Integer count=projectMapper.selectCount(new LambdaQueryWrapper<Project>().eq(Project::getCompanyId, companyId).eq(Project::getProjectCode, projectApproval.getProjectCode()));
+                Integer count1=projectApprovalService.count(new LambdaQueryWrapper<ProjectApproval>().eq(ProjectApproval::getCompanyId, companyId).eq(ProjectApproval::getProjectCode, projectApproval.getProjectCode()));
+                if(count>0||count1>0){
+                    msg.setError("已存在项目编号为["+projectApproval.getProjectCode()+"]的项目/立项");
+                    return msg;
+                }
+            }
         }
+
         if(!projectApprovalService.saveOrUpdate(projectApproval)){
             msg.setError("验证失败");
             return msg;

+ 2 - 2
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/ReportServiceImpl.java

@@ -3218,7 +3218,7 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
             List<UserCorpwxTime> userCorpwxTimeList = null;
             WxCorpInfo wxCorpInfo = wxCorpInfoMapper.selectOne(new QueryWrapper<WxCorpInfo>().eq("company_id", companyId));
             if (company.getPackageOa() == 0 && timeType.getSyncCorpwxTime() == 1) {
-                userCorpwxTimeList = userCorpwxTimeMapper.selectList(new QueryWrapper<UserCorpwxTime>().select("corpwx_userid, ask_leave_time").eq("company_id", companyId).eq("create_date", curDate).gt("ask_leave_time", 0));
+                userCorpwxTimeList = userCorpwxTimeMapper.selectList(new QueryWrapper<UserCorpwxTime>().select("corpwx_userid, name, ask_leave_time").eq("company_id", companyId).eq("create_date", curDate).gt("ask_leave_time", 0));
             }
             for (User u : userList) {
                 //入职日期在当前日期之后的,不要显示
@@ -3250,7 +3250,7 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
                         }
                     }
                 } else if (wxCorpInfo != null && userCorpwxTimeList != null) {
-                    Optional<UserCorpwxTime> find = userCorpwxTimeList.stream().filter(uct -> uct.getCorpwxUserid().equals(u.getCorpwxUserid())).findFirst();
+                    Optional<UserCorpwxTime> find = userCorpwxTimeList.stream().filter(uct -> (u.getCorpwxUserid() != null && uct.getCorpwxUserid() != null && uct.getCorpwxUserid().equals(u.getCorpwxUserid())) || (u.getCorpwxUserid() == null && u.getName().equals(uct.getName()))).findFirst();
                     if (find.isPresent()) {
                         user.put("leaveType",0);//默认为事假
                         user.put("leaveTimes", find.get().getAskLeaveTime());